ÿA. HISTORY OF THE SOFTWARE
= ól

Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) f ó&Netherlands
as a successor of a language called ABC. � ‚remains Ä ð4's
principal author, although it includes many contributions from o‹ `s.

Inø #5,h  + óinued his work onv   .pCorporaN a for
N ÿal Research Initiatives (CNR ðnri.reston.va.us)
inA ñton, Virginia where he released several versÏ  ofÃ’
softwareÓ „May 2000× 0and& É ðcore development team moved to
BeOpen.com toã m=  D ALabs7 Á.  In OctobeÉ #¡same
year,: ¶3 j   Digital C� Ï °, which becC WZope pm H2001Y # Sý a Found�` (PSF,’r
https:“p¡.org/psf/)ñformed, a non-profit organizM 
0pspecifi¡y$owA-relSüIntellectual Property.
Ê y ÷a sponsoring memB“PSF.

Allp`s are  ª Source (svQopens  ç  ¿
“3 @Defi£Âon).  HistorÕ ó, most, but not all,‚ 
„ñs have also been GPL-compatible;òñtable below summarizes‰ uvariousÑ ‚.

    Râ   @Deri�  @Year   DOwne  z =    ä   ³ R? (1)† ê0.9.0 thru 1.26 õ 1991-1995   CWI 1yes… 41.3: 5< A  7  < 9< %NR= < 6P  	 !1.C   É	 < !now 42.0  &1.K   2   ¿Ö ; T1.6.1  ;   ;   Ã' yÔ#2){ #  D2.0+T  ¥ d   PSF { 92.0{ ; -;2.1< $1+P w < ØL 5200 ³ < 3É    < 1 <  2 †babove < = ´ @-now[ x ð
Footnotes:

(1) GPLô@-compatible doesn't mean that we're distributing Python under
    the GPL.  All ôlicenses, unlike& –, let youU eF ða modified version without maky òyour changes open source.  ThE 8GPLÐ …  B ‘e it possê ¤to combine±  m ‰ Ðother softwar¸ âat is releasedù Ï ;	 3 ðs don't.

(2) Accord· ðto Richard Stallman, 1.6.1W 0not=¶ ,† `becausµ #s Ç ð has a choice of law cl'  |q B åCNRI, however,|  's8 1yerO Ptold *  ø  G @is "¥ &in)"›û ñ GPL.

Thanks to õmany outside volunteers who have workJàGuido's
directø"to±Ttheseys½ñ).


B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE U �PYTHON
= +#

'Ñand documentaÆ  =º59 S`RFound2 L4# V �2.

Starw  ¬Ð3.8.6, exampldPrecip	  ‡ Ž° code in
thØ™ DdualXž ] PSF ‡ 
V  H aZero-CrD BSDA  § 6ome4 ,Ôrporated into¹ #is?”differentD es.
The  >sA ú Ï @fallS|¡b Ûð SOFTWARE FOUNDAÿ LICENSE VERSION 2
- •

1. ThisH �AGREEMENTÃ`betwee1MÞ ¤
("PSF"), NaIndiviŠ¢or Organiz
#("… e") accessø Aand
Þawise u t˜ ‡"("™D") i ð  or binary form€ ±
its associ¤	ºÔ.

2. SubjectÔPterms; ` condiâs„ ­ ` Agree,IÔhereby
grantsWðe a nonexclusive, royalty-free,@ld-w;Ü ƒ ôreproduce,
analyze, test, perÖ 0/orVðplay publicly, prepNƒderivati€5s,
×e•[ËPaloneC0in ØG ¨§,
providedoFEPSF'ù G 3notÍôcopyright,
i.e., "C   (c) 2001, 2 3 4 5 6 7 8 9 q10,
201< 1< à13, 2014, 2015a, 2016 7 8 9 !20 1 ð$2 Python Software Foundation;
All Rights Reserved" % ´retained inA €alone or õ.any derivative version
prepared by Licensee.

3. In the event  0 8s aN ñwork that is based on
y ¤corporates– 0or � @partb ð	reof, and wants to make
} ± c �available& ðothers as provided herein,W $n
Ï  �by agree` tincludeRsuch ` ñ brief summary of‡ ±changes madz  �.

4. PSFõ dmakingã 	¨ ˆ ñon an "AS IS"
basis. A ðMAKES NO REPRESENTATIONS OR WARRANTIES, EX   ò
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMIK ,h ûAND
DISCLAIMS ANYz y Z ð MERCHANTABILITY ±FITNESS
FORA ðPARTICULAR PURPOSE&  THAT THE U ÐF PYTHON WILL¢ ‘
INFRINGEC `THIRD I ÂY RIGHTS.

5d2SHA3 ñ BE LIABLE TO LICENSEl  Ç POTHERm  RSo ¤ PINCID^°L, SPECIAL,¦ ðCONSEQUENTIAL DAMAGEfð LOSS AS
A RESULTT ñMODIFYING, DISTRIBUT 1OR  0WISð 3INGï #,
$ DERIVATIVEðREOF, EVEN IF ADVISEDb  0SPOSSIn Ô ÔEOF.

6. This�  AÔm¢ðwill automatically terminate up|ð material
breach of irAerms‚Pcondih°s.

7. Noth×iw ð shall be deemed˜0cret qany
rel·@shipn €agency, ü0ner , `joint j±ure between²5andÉ/. ý ðdoes not grant pù sà � 0useK °
trademarkss  B nam      s 9 aendorsAñ promote
productB  }@icesÙ äÎ  ÞQthirdè ðy.

8. By copying, installZ1or Èpwise us ^,ä&e
¹@be b ®   âº � t$
$ä.


BEOPEN.COM;° AGREEMENT Ë2o 2.0
- Y ñ e ` SOURC­£h ÄVERSION 1

1ÑÈ%  J	ÒBeOpen.com (" p"), hav0ò(an
office at 160 Saratoga Avenue, Santa Clara, CA 95051tàthe
IndividualqOrganiz¸4 ("Ú�") acces£ ®·
ts³ðin source or binarð:y form and its associated
documentation ("the Software").

2. Subject to  QtermsL Pcondi9 ðs of this BeOpen Python License
Agreeg ,! Ôhereby grants( òe a non-exclusive,
royalty-free, world-wide l[  • ðreproduce, analyze, test, perù ð
and/or display publicly, prepare derivatived 0ks,, atributV ðd
otherwise use 'ø alone or in anyM ñversion,
provided, however, thatI 4À is retainedY Dthe
r ,s Û Ed by`T.

3.ƒ‘is making… \   available[Á0e oÛ ñf "AS IS"
basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITK ,k ûAND
DISCLAIMS ANY} | Y] ð MERCHANTABILITY ±FITNESS
FORA ðPARTICULAR PURPOSE&  THAT THE U F ÐSOFTWARE WILL« ‘
INFRINGEI `THIRD O ÔY RIGHTS.

4.Ä 2SHA6 ñ BE LIABLE TO LICENSEu  Ð POTHERv  RSÁ ETHE
x ³ PINCIDp°L, SPECIAL,µ ñCONSEQUENTIAL DAMAGE�ðLOSS
AS A RESULTZ ðUSING, MODIFYINGA �DISTRIBUT  þ { _ àANY
DERIVATIVEðREOF, EVEN IF ADVISED]  < SPOSSIx Õ  EOF.

5. T3d %ð will automatically u€inate upŒð material
breach� Û ( �O.

6l àshall be goverm!byÝ’interpret€Àall
respectsS 0lawx    Stœ ñ of California, ÈdbÀconflict of
6   F@Noth% "inD¥ dG€d to
crer  p1rel¿@ship� PagencÝ`artner ,Ÿôjoint venture
between y ?e. š‚does not¹p
permisÈ  - Ì trademarksy  ` namesË!a     
s  = aendorsG‚promote ÖtC qservicei§ Õ ðany
third party.  A  | epœ i3e "™ ™w" logosìñ at
http://www.p¿‘labs.com/- �.html may-¡used accorßts! ed9éðweb page.

7. By copying, install8or h   ]s‘,É 
aRs9qbe bounè - Àd conditionsÿ: of this License
Agreement.


CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
--- a

1. Tn T ñis between the Corporation for N ð:al
Research Initiatives, having an office at 1895 Preston White Drive,
Re Ð, VA 20191 ("ê q"), and€ ñIndividual or Organiz„ 3
(",¢e") access| Ñd otherwise u bPython%ð software in
source[ `binaryä m} ðits associated docuŽ{ ñ.

2. Subject toª Qterms; Pcondi2sÖ Ö , ê Õ
hereby grantüòe a nonexclusive, royalty-free, world-wide
l. „ �reproduce=ñalyze, test, perfor× ð/or display publicly,
prepQderivË d 0ks,, atributV 
Y(e WQ
alonJwin any M ñversion, provided, however, that3's
Ð&O )`'s notQôof copyright, i.e., "C ï (c)
1995-2001¾ ¾p; All RY sß`rved" ¹retained inõ  õ 
õ  ]Dd byÝðe.  Alternately,W @lieu/î ,= ñ  may substitute}`followÿ±text (omitt Øhe
quotes): "±ð is made availableU Ò
Ò#in®� ®". UåP toge‹i with
~  Å abe loc`oo in#et¸ ‚Û q
uniqueÐñsistent identifier (known as a handle):|ƒ.22/1013Ÿ SI£also be obã`from a««xy server ž 
V	ž ò URL: http://hdl.„ P.net/† ‚".

3. Ið  evÆ íe, Ã ?Bwork( �ãased on
or incŸ*es˜!or„@part @reof1d wi€to make
Â i "toI 	 » ³ in¹$en²e @by a¶s�`includeŠ AsuchUÐ a brief summr!of‡ cchange“)toÏ Q.

4.wµkÚ	N	µ OoŠò "AS IS"
basis. H ðMAKES NO REPRESENTATIONS OR WARRANTIES, EX   ò
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMIK â i ðAND
DISCLAIMS ANY REPRESENTATIðON OR WARRANTY OF MERCHANTABILI ðR FITNESS
FOR ANY PARTICULAR PURPOSEE  THAT THE U ñF PYTHON 1.6.1 WILL NOT
INFRINGEI QTHIRDO òY RIGHTS.

5. CNRI SHA4 ñ BE LIABLE TO LICENSEs  � POTHERt  RS¿ v 
v ± ðINCIDENTAL, SPECI	 ð	OR CONSEQUENTIAL DAMAGESÌ ðLOSS AS
A RESULTZ ñMODIFYING, DISTRIBUT 1OR … 0WISý 9INGü #,
7 DERIVATIVE'ðREOF, EVEN IF ADVISEDh  CSPOSSI� à ðLEOF.

6. This License Agreement will automatically terminate upon a material
breach of its ( ÿs and conditions.

7l ð+shall be governed by the federal
intellectual property laws  ) ðUnited States, including without
limita‹ Y   copyrightM ,´ A, to# 0ext”such
U.S.�  * ô does not apply,° ’ ôCommonwealth of
Virginia, ex�   's*PflictÑ  F bprovis:0NotÇ AstanÔ  ñ ¡foregoing,ã p regard¼ óderivative works based
on Python?@that(PorporÔÕnon-separableÛ ( ðwas
previously distribusQunder1pGNU Gen±u PublicW`(GPL),& 
Ý  of  #  ' t 
 ponly asò °issues arisó’ $orñ	spect to
Paragraphs 4, 5ï  7rd p.  NothT !inˆ 
(¬ @be d9‚0creQqany relu@shipð agency, partner ò, or joint venture betweenµ4andH1e. ¯‡  ‘pgrant p«s@ !2useL ptradema1or
 ± name in a    ! s to endorse£ ppromoteðducts or
servicesDeÐ  ü Qthirdê ð y.

8. By clickQoQðe "ACCEPT" button wherŽ qdicatedL !by§ ì�
installB Ñr otherwise uúá,5  aÕ*ube
boun`ª Ì 3

  · d


CWI@° AGREEMENT &7ÿ 0.9.0 THROUGH 1.2
- 5

C¨ (c) 1991 - �5, StichtPMathe¯ðsch Centrum Amsterdam,
The Ne4Álands.  All ÿ@s reÍled.

P=,�‚, modify8ð  this software ðand its
documentation for any purpose & ðFwithout fee is hereby granted,
provided that the above copyright notice appear in all 1iesa  9 R
bothC 9 n]  is permiss© T É
supporting Ó ,c œ Ñname of Stich. ðMathematisch
Centrum or CWI not be used ¸ pdvertise Àor publicity™ @tain ±to
distribuR!ofx ”software Nö	specific, written prior
ä ðP.

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDV  7 xIMPLIED? ðOF MERCHANTABILITY AND
FITNESSA À NO EVENT SHE © ð
BE LIABLE
FOR ANY SPECIALL ðDIRECT OR CONSEQUENTIAL DAMAGES  2  ñ
WHATSOEVER RESULðFROM LOSS OF USE, DATA; ðPROFITS, WHETHER IN AN
ACTION. ðCONTRACT, NEGLIGENCE9 O. ’TORTIOUS 1 `, ARIS;`OUT
OF)  IN¹ "NER {0THE†   �PERFORMAV 8F T‹ð.

ZERO-CLAUSE BSD LICENSE (@CODE¯  N ðPYTHON DOCUMENTA¾ /
- 26

PX toî,Ÿ‘y, modifyCE/or Ùue this Õ7
7 å D  ;0.

Ú ˜ð IS PROVIDED "AS IS"w % oAUTHORñ$
Rñ
f ð S
AND ð.„ð” Ü´ ªÜÚC,
IN
  å å
å´å
å > O6?CONå
å�"""Recordyñ#phased-in incompatible language changes.

Each linvGðform:

    FeatureNÑC= "_ P(" Opz÷alRelease "," Mandatory G  K  ðCompilerFlag ")"

wü½, normally,j <h < Ý þ“5-tuples
Ð s¾  Õ ° as sys.veràS_infoé ñ(PY_MAJOR_VERSION, #T2” 2.1.0a3; aRtÔ  2 -IN2 À 1; an int
 ð    PY_MICRO_VERSION, # the 0; an int
&  ' ÐRELEASE_LEVEL' Ñ"alpha", "bet ýcandidate" or "final"; stringI cSERIALp 3p ñ)

OptionalRelease records� sfirst r ‘in which
b ðfrom __future__ import Fea ñName

was accepted.

InV cg Ãof Mandatory{  t üat have not yet occurred,
. € predict6  ¶ ¾ ¤ i fŒ ñ will become part
of  ý language.

Else‘ 2whe» R CbecaM  M D;
in3@s at¢ÿafter that, modules no longer needTato useÀ Ž pin quesÈó, but may continue 1 Csuch¥>s.
O 4 ñalso be None, meaning¸ ´ a planned v “got
droppÜpstancessclass _Òàtwo correspondX Ûmethods,
.get‡p() and  ùò().

CompilerFlag iÀ(bitfield) f  pp shouldÕ ƒpassed iÊàourth
argument& �Àbuiltin funcP" ci  ()" \enabl|°
dynamicallv˜ Òd code.  ThisŽ vis stor‚ .[  r_® ñ
attribute on _FW3 inVK àese values musç1tch
òappropriate
#defin‰aCO_xxx� sú óInclude/cpython/ƒ u.h.

NoÛ@lineV ev·Pdeletþ ÷tÖ ãile.
"""

all_¡_names = [&ò"nested_scopes", Pgenerû „division" ’absolute_W  with_stateµ dprint_³ 0uni……_literalk äbarry_as_FLUFL. “ T_stop `annota	 ? P]

__ì _à "
 	ö ]"] +  ƒ

# The ŒÂsymbols are ª d here undn@he s\H" Bin
#ThuËbpc.h, soªò n editor searchÿ@find+mm p.
# Howà, 2y'rt exÆ¥ì ,;at`y don'ï beÄ@ to
Î#isÞñ.
CO_NESTED = 0x0010ß )# ! 8 ò GENERATOR_ALLOWC 9 %# ±@s (o.Pete, rp0x1000)L °FUTURE_DIVIu� I2000Ž $# ~3 ñ ABSOLUTE_IMPORT: 4: ¤# perform ©[0 by×Ðault
CO_FUTURñE_WITH_STATEMENT = 0x80000  ñ# with statement
CO_FUTURE_PRINT_FUNCTION9 19 : ÷# print function9 ñUNICODE_LITERALS; 2; ÷
# unicode string literalsB ÑBARRY_AS_BDFL? 4? # áGENERATOR_STOP$ × ž PStopIY  � ø becomes RuntimeError in generator~ `ANNOTAõ » ö Y    # annotaX sY Ë bs at rc ð


class _Feature:

rðdef __init__(self, opL ð alRelease, mand• y ñ compiler_flag):J  N  A .@ , =K 
( W - =c 
* 	o 9 =  È JgetO¼ Ò   ò"""Return first rã  {Âwhich this f"ò was recognized.i  ç T& õ$is a 5-tuple, of the same form as sys.version_info.Ö 5""" r‘ 	;k  œKgetMÕ Ï 4ill!|Ö /…, or, ifÑ  Cÿdropped, is Nonež c__repr¤Ò>"×@" + * (&Œ,ž  À ‚{ 2 	�õ))


nested_scopes =sÿ((2, 1, 0, "beta",  1)i  0 20 @alph1 00 	ÆCO_NESTED)

K‚ R ‚   3 �final",  6CO_QALLOW‡ @divi… 2× (€  2*üDIVISION)

absolute_import† 5Þ [ 2� 0 &  ” ðABSOLUTE_IMPORT)

é_éš * ©6Ë © › ˜ 
�1)

G_G— f · d #  0À0, "alpha", _0),
  ÿ<CO_FUTURE_PRINT_FUNCTION)

unicode_literals = _Feature((2, 6, 0, "alpha", 2h 
A  (30 03 › &  � ùUNICODE_LITERALS)

barry_as_FLUFL� A3, 1m � !(4. › ™ üBARRY_AS_BDFL)

generator_stop– 5h Ÿ"beta", 12
 070 ac0• úGENERATOR_STOP)

annotationÆ33, c “  � 1W‘ Ž `ANNOTAUð S)
# This file exists as a helper for the test. ñ_frozen module.
"""Shared AIX support funcÞ �."""

im 7sys Áconfig

try:& ñubprocess
except I? ñError:  # pragma: no cover> t# _aix_‚ ð#is used in distutils by setup.py to build C extens�š¥# before s‹ ÷
 dependencies like _posix# °are availab ãÓ X_boot* s[ b


def¾ Òtag(vrtl, bd)ô# type: (List[int], int) -> stü BInfeªðABI bitwidth from maxsize (assuming 64#  é Ü�default)Gô_sz = 32 if sys.= ñ== (2**31-1) else 641  # ± @[verBñ, release, technology_level]/ ðreturn "aix-{:1x}{:1d}{:02d}-{:04 ‘}".formatB[0],e 1	  2]" , _sz)


#Ã\ract ‡ G andŠ  Š `a VRMFD6ingƒ Î \(vrmf€1struˆÐ °v, r, tl = 5 é.split(".")[:3ó  ¼q(v[-1])Â#(r Htl)]Œbosmp64(� ~ ‘Tuple[strD a  d nR\+a % ò	 e.g., ['7.1.4.34', 1806> 1Theÿ€set bos.| 1 is÷ ÔÂkernel. It's3 T<Adateqreflect4 €current ‰oAs of ñruntime environment.? Á 0# W†pK 2allS`ystems°òhave lslpp installátÂ1locQQ Wout =dñ
.check_output(["/usr/bin/N €", "-Lqc ""]J `out.de~Œ("utf-8" tstrip() 0:")ª»àignore
    # Uð'se str() and int() to help mypy see types
    return (3 �out[2]),6   ñ-1]))


def aix_platform():= #I p: () ->v  1""" ñ-AIX filesets are identified by four decimal values: V.R.M.F.A ¢V (versionÍ ðR (release) can be¿ ñreived using ``uname``A ðSince 2007, start# Pwith œ â5.3 TL7, the Mƒ ‘ has been@ ‘included 4  ' Ð ‘ bos.mp64e¡representsK ¡TechnologyE ÐLevel (TL) ofy Ó. The F (Fix)w �also incrÞ Ñs, but is notD  ÷ ð vant for comparË   Aases† bbinary ‚tibilityHOFor  ® pso-call”�uilddatez Reeded@ RAgain'b$ Pof anÏ  †  6 „associat3'H jIX ABI£  7 ñ#described  as guaranteed at: https://www.ibm.com/\ðsupport/knowledgecenter/en/ssw_²²72/install/_>#ta Qhtml
M  %Àpep425 purpoW ò *øÂ tag becomesð"aix-{:1x}{:1d}{:02d}-{:04 0}"./°at(v, r, tlÚf¡, bitsize)€ ae.g., P Ñ6107-1415-32"ó … 06.1¯@ bd  r, 32-bi =and< /64< %64< ¯Pvrmf,^ != ;0bosâ(Ÿ r( Atag(	 Pvrtl(8 )9  * # extract  Q fromfàBUILD_GNU_TYPEæ ang[L ?bgtW‘List[int]'@gnu_¾ò = sysconfig.get_ j_var("n "Â  ifO A À`aise V‚MErro@  ¢³not definedO  ì =^  64 46Ri {w_w!ofIð system Python w®ruilt ondÎ#›_	@DATEÄ À  |-1ureÚÆ# lslpp -Lcqàñ| awk -F:  '{ print $NF }'�Ü _5‘	6AIXŒ A2tryy  „	H  µ ¾†except (§a, Type²Y I rÍ)f"}  	ÍÒ or invalid: · F  6f"{’ 3!r}Ä  âÊé )
–ñBasic subprocess implementationèðPOSIX which only u‡pos func& …s. Only
< ð features requiredö: by setup.py to build C extension modules when
subprocess is unavailable.F ò*is not used on Windows.
"""
import os


# distutils.spawn3 'by �command.— Ö_ext
# calls Š ñ.Popen().wait()
class  ò:
    def __init__(self, cmd, env=None)'  +   p._cmd =$ ?  Penv =7 
 Ðreturncode = Q 
   w “  U d  pi^ ‘os.fork(),  d 1if  6= 0‘   @# Ch–z1   :try-   0if t  ._± � ˜ *  . ‘os.execveþ C[0],C *N ®  :   OelseX W 
L ofinallÍ  ¦os._exit(11 u Ÿ# Parent %á_, status = os(¦pid(pid, 0V  Ï ê 	Ñ1 A 1_to�  í( )î = 8 9  ( 0


`_check\C(cmdñ.# Use regex [a-zA-Z0-9./-]+: reject empty string, space, etc.	�safe_charÝ ![] ðfor first, last in (("a", "z"), ("A Z 0 39")“  É  A  ch8 ¡range(ord(Q 0),   V W) + 14  8 � ò .append(chr(ch)e \"./-" ¶ = ''.join(2 gÐif isinstanceIè, (tuple, listÅ p!st1cmd/elB  7strÉ 	8 B[cmdU
trôb False 40arg5B !if½  arÏ	{  D	Z     > 6argR   #%é     O  ¬ àR Rif ch« &n 
w Y s k ATrueß�_aix_supóÜ.ùÌ;PoutpuÌ 9	 �ƒ**kwargsµ2if  ¥ òraise NotImplementedError(repr(/ )T ±¡ê M RValueD Cf"unØ 3ed ¤£: {cmd!r}"W °tmp_filenam"È Q.tmp"5Úã “‘2" " @= © f"z H} >{s "}"˜	"ð# system() spawns£ a shell
  õstatus = os.system(cmd)  ‚exitcode" Bwait2 D_to_ ( 5 4if  :J  q ù'raise ValueError(f"Command {cmd!r} returned non-zero "C  G 	  f"l  „   {  ± e!r}")
; :try‹ úwith open(tmp_filename, "rb") as fp1  u östdout = fp.read(ô ñexcept FileNotFoundã 
E A 1b''œ gfinallœ © ™os.unlink© y /OSo  BpassW € ð
# Copyright 2007 Google, Inc. All R ðjs Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs) for collections, according b ñEP 3119.

Unit tests are in &_c< .m ò

from abc import ABCMeta, abˆ smethod
 ðsys

GenericAliaðtype(list[int])
EllipsisTyp ñ ...)
def _f(): e1FunÇ (  _f' ðl _f

__all__ = ["AGñable", "Coroutine", gÔ   "AsyncIter)  0tor:  ¿ a 	? DHash: F  / ' "< ‘ "Reversi– 	J PSizedp  èAaine} DCall` C‰Ä 0Set9 0Mut+  	[ wMapping$  ( @View, DKeys EItem Y 	A qSequencqŽ  	* qByteStr–  ñ]

# This module has been r9!d }” ‰8to ¨_ ð
# speed up interpreterÄðrtup. Some of the s`s such–¾ ( ø
# required early butY² öps a lot^ Sother sâðSee issue #19218
__·"Û "€Private 1 R ¬ Àthat we want-Pregisà t Ô pvarious¡s!o 4 ‘they willTæ“s like:
#i~õiter(somebytearray)!  cñrt isinstance(it, ÷0ble( `Note: GAimpl´"atˆDthesxmð not be distinct
# ³¯ €may have¬`ir own~Q  ëScificÊ ê  A !reW Ðincluded on t` L .
Ú  s_é  Ý! == ( a(b''))! û % à()))
#callable÷	_iterator = ???
dict_key Ptype( Â({}.keys()))) Pvalue B 	+  - Oitem,   + Hlist• S Q[]))
 oreversy   d(/ )
rangeP   (0Í Along * 	�1 << 1002 /se¦ 1set ?strM Ÿ""))
tupl— > ?zip> 1zip! ²## views ##‹ ™1 = /¨ Š  (Ç~    p## misce Ämappingproxy+  m 1.__4e_)
genL  ó((lambda: (yield))T �coroutineY °async def _ ‘(): pass
 $ = 
 5 æ ! )( Ð.close()  # Pònt ResourceWarning
delM A
## v †hronous ¹ 1##
 �  agŽ ¼ @
_ag�   # _6 ‘ 2ag)f òag


### ONE-TRICK PONIES ###

í óheck_methods(C, * ñ):
    mro = C.__mro__ Bfor & 3 in
 s/  3   B &ro   #if.   B´
% )  [l ž] is None/  3 ñreturn NotImplemented¯    Ubreak ;elsN F  ñ
True

class Hashable(meta ±=ABCMeta):
e â__slots__ = () ’@abstract× ( ‹Ã_hash__(self~ · y 0> h ; 1sub ×hook__(cls, CE `if clsBµ 
Fe ,_c#"_— !")ª ’ k_Await9aQ • @ü (´ –  2!__¢ @_getÖ ´  (G´”icAlias)
JC¡(  Y!AsendU!, r’"""Send a ¥ into the ç.a Ä RaQnext |#ed6 áor raise StopIÊ6ion: 5"""F ) ÀIteration

 ñ)   @abstractmethod
    def throw(self, typ, val=None, tb	 !):-  1 õ"""Raise an exception in the coroutine.0 ðReturn next yielded` que or rJ �StopIteraK : 5"""F  if5 @ is ˜ Ž  ’ _if tb   d 5typM   Pval =î %() I ?noth  3 �val.with_J†eback(tbD n Aval
W  _Qclose_G0Genú ÏorExit insidH:try ¼.Ç	P ˜ «) ( ), {Ÿ  #ApassÅ   Jelset ê åRuntimeError(" ™ ignored p "")k@class†Q__sub ×hook__(cls, C• `if clsêCh“ lr_check_` ðs(C, '__await__', 'send 1 	 ¢'-rH õNotImplemented


w ¥.register(ò A)


¾ a AsyncÐ�ble(meta ¢=ABCMeta):Ô__slots__ = (¢œ__aiter__Gª s 5torM w È �fV ,blý"j"« "P X!__¦ �_getitem ¸ °icAliasc ð 	¨ _a®0__a¦e óð  ä $  ¬ 
Á…  Æ@ whe ˆhausted.¾9 z
4 ¥ï ï. J.ƒ /orN ä P__",  œñ!(ƒ ¿	«(Afrom¢D ”hronous g|uW¸,¢§ 6ion2 	Û'l ¦ .am(µã• „/  : †'ueÿ�"""Send aue intoÔ À       Returó$n next yielded value or raise StopAsyncIteration.
  5""" . 
" ñ @abstractmethod aV ð def athrow(self, typ,… ‘=None, tb	 !):4  y A"""R› €an excep• � in the U °hronous gen´ &or³ _Returò 3 if§ @ is ª    ¤ _if tb   -5typÕ   Pval = %() I ?noth  3 �val.with_c†eback(tbD n 2valŒ#xQclosex`G?öExit inside coroutineT:try
`await Û.ç	W ¦ Ë) ( ,€ «  6Epass/Jelse€ ý áRuntimeError("%™ ignored ‚ "")6g@class¿ ¹Q__sub ×hook__(cls, C¢ `if cls
E[ ¥ –r_check_e òs(C, '__aiter__'  «  ò   `'asend8 y
 ò'vrz úNotImplemented


® ¡.register(;_YA)


  �ble(meta ¢=ABCMeta):BÔ__slots__ = (V Yö œ�while Faç¾!m ¯.Ð ©2"__² "\ ®!__#�_getitem ü{icAliasdDtor(� [#D[' F "  ™ Q fromY Þ �ator. Whey‡hausted,(—  Ž'Ÿ E ¡æ	• 5- Î3?torÎ'Î 4 __/__6ä &or0Qbytes =/)
" Warray& #' ‡callable& % „dict_key­p $ Àvalueiteratoór)
Iterator.register(dict_itemi % 1lis% < ! reverseI 	Prangeo J ?ong& /se� ?strf 
Otuplˆ 7zipB ‘

class Rã Qible(Kò
ble):

    __slots__ = () ñ @abstractmethod( cdef __,¡d__(self):  H ¶while False   £yield None] “ Z 1sub ×hook__(cls, C` ˆif cls iÍ 
i âreturn _check_a hs(C, "¸ "  íE__")¿ = ô NotImplemented
@2Gen�??tor?	+Nnext'B"""R¨ @the $  Æ` from  gk .œ ñWhen exhausted, raise StopÍFtion- 5"""9 Õ  ª`.send(†ä(  2 `, valu( Æ  ’"""Send a _ into´ å á #ed6 /orÁ ê E¢Qthrow›Q, typÄ =ö A, tb	 S Œa a_0cepJ? inÔ K if	 É ˜ 
Ã_if tb  �ù5typâ  Pval =î (ÏI 1not|
h 3 �val.with_ì†eback(tbD n 2vals ÖQclose_G&ÏExit inside Ð £:try›  {.Ç	P ˜  ex«) ( ,Ÿ  #Epass4e£ê åRuntimeError("¸ ™ ignored p "Gµmb  '/__ÎV 
»Í!'_à€__', '__a  |  ë  'Û 6 ^ 	 Ï'Zu ¤ €)%¡Sized(meta�=ABCMeta*	iÀ_len__(self)3:
  ‘return 0
 Á@classmethod ‘def __sub æhook__(cls, C)E ö if cls is Sized  e b r_check_\ ñ s(C, "__len__")k , ñNotImplemented


~ ñ  Container(meta ¢=ABCMeta):Á â__slots__ = () ’@abstract| m Ø cQ ·s__(self, xÕ ¸ SFalseI s F Á "£ ' B!__¥ �_getitem	 · ç(GenericAlias)Z‘llection(Â¶, Iterable,vd
d a‚ ?Jqiter__" 4[P_Callð  
-˜ ô """ Represent `7 ð[argtypes, result 2]`.9óThis sets ``__args__`` to a tuple ³ ôing the flattened ``Z !``Yæfollowed by ``m `m 0Exa<6: `ž ÿ[int, str], float]``‘ c 4``(0 / )^  _2"""Ó iU4new$€origin, ò Zðif not (isinstance(" ,‘) and len g) == 2=  † ñraise TypeError(¶    "˜ô must be used as  [²d, ...]³'].ct§B, t_c! =Æ j 7if ¿ . Klist¬  Ú  �*$ R ö#elò _is_param_expr(2 P ü €f"Expectß  € @ of ~õs, an ellipsis, "¼ & 0f"Py €Spec, oröò catenate. Got {Ž }$"¯super().__û3‘@property‰ -î Deter„î  as = []2  ¯ 0forˆ@ in ²!._§"__� "   ò# Looks like a gôaôJ  (  if hasattrl<u ‘ "‹èRarg._£$ µ
�  ] J €s.extend` :   . NelseD 0if  Ï0varÏ  I $ ;  q 3appq b ðreturn tuple(dicñt.fromkeys(params))

    def __repr__(self):   aif len ñ	.__args__) == 2 and _is_M Z_expr' 7[0]I  M õ return super().t )o " õ(f'collections.abc.Callable',  R   ñf'[[{", ".join([_typeÏ Ð(a) for a in Ù Ã ¿[:-1]])}], Q {D 
8  -16 ':Nduce< .* =y ¾ €if not (^ ) U   LM  € = list( Ó 1),  5-1]j T_Bô GenericAlias, ( : 	Ù sgetitemÚ  ,  †  # < ðed during TypeVar substitu½",  Às the custom! Uclass£ Ñ# rather than* €default Ì(s.³ ð object.  Most of0 J ð code is copied ô F ying's _J  Â — wbuiltinE w ., qð# A special case^ñPEP 612 where if X = ´˜[P, int],b ð hen X[int, str]T&X[ %].- a0lenï� @eter“- 1if  _0 6= 0Ì ¼ Qraiseª�Error(f'{á}2 �2a g ¢'›±°isinstance(w, tuple f   2 = " 	C {� 1EÆ ß  ÿâ  a    ¾i  	  ¼ �   9 œ 9 $ '),¢  ï:÷ y !if½ &!=gb°Too {"many" U D >C Î else "few"}‘ î   f'âaumentsÝÀ;6 tctual { Ñ}, expected {m • }òÈ´ = dict(zipß- šB1new'F = [„† rg* oˆ
;!ifQ }pvarlikeÚÀ 	) ‰ z?arg(   , 0arg… ”F[arg”    ÝBU  8 K$"EPa—œõypes, an ellipsis, "R G  	0f"PªöSpec, or Concatenate. Got {arg}"~M  Oð:
                ñarg = subst[arg]
  ù# Looks like a GenericAlias( ð#elif hasattr(arg, '__parameters__') and isinstance& .$ ™, tuple):[  Š 1subM {s = arg8 /  ifÐ 2 M Q 0argO s (ÿ ¶x] for x inA )_  A 6parg[subK 
8@new_ p.appendí %)
I #Å ó	s[0] occurs due to thingmõZ[[int, str, bool]] from PEP 612M hif notZ} ›[0], listRµt_result = + *-1Á t¿ " :# < B = (/ $, [ 5øreturn _CallableC( ú(S ð))


def _is_typevarƒHÒ`obj =   8# l®�TypeVar/PˆASpec% ‘ ñ(obj.__module__ == 'typing''  å   ¶+ 0nam) Uin {'S C', 'h 6'})µ }P_expri �Ð"""Checks if Á ñmatches either a®1 ofØ  s, ``...``	 r Q`` or£ Ù``_ConcatenatY"``,Ñ 1.py0 1""" } ²is EllipsisS ï DTrue, ´=objR2  Ø ™2obj	 ; m(9¿ '6 Z ~©S0anyc0.__f Ê 
 Ë	 0in  sŸ 5<_re›RªAthe  )‰ an© ecŠÒpecial-casing£ò (internal helper).çbCopied†b:mod:`Œò` since collections.abšÀshouldn't de6’ on that ü .‘Å™[rÓÔ ’(if2Ø 7 &#–builtins'3d «@qualq!__²   2f'{# Ò C__}. 4 }€  ¥	E'...- 1Fun_ �Ö rå† ¥  %„

class £Q(meta ¢=ABCMeta):ëp__slotsz# (æñ @abstractmethodÐð _call__(self, *$Ž, **kwds¦ RFalsee @{ N 1sub ×hook__(cls, CI `if clsFÈ Àe:
         ó   return _check_methods(C, "__call__")
  - ñ NotImplemented
 ñ__class_getitem__ =  S ñ(_CallableGenericAlias)


### SETS ###


4 ñ Set(Collection):c ð"""A set is a finite, iterX ² container.’ BThisƒ � provides$ rcrete g† $ iÈ ai �s of allo mã except for __e ps__, __| ä__ and __len__| ño override the comparisons (presumablyU �speed, as* z ñsemantics are fixed), redefinek v Qge__,6 @thenC ³ other operÕ Ðwill automatiÕ y ¡llow suit.> 2"""7q__slotsÁ"() 3defv b(self,c — Pif no™‘instance(… ,É'  + D    aif lenf 1) > J E QFalse¿  <  ¢€elem in § 6    1if  ¨ nÂ 
"  & ž 
Y  ITrue1t__ª H{ <y ê .~"__u	´g¤ a¸¤  ¬¤ eHO	XD
o
ÿX�
4 Y �
! X/eqOé X/==Y@£|Afrom Œ@(clsš¶ô'''Construct an ) r" > F F anyÖSinputV IHMust\2is ‹ 1 ifþž  él ¶or signatur*Adoes±!acÜ � G î  x  s   1'''ì   <icls(itn?and»Iz -f l    „  m ._6|QvalueZ
 ií !ð value in self)
ñ
    __rand__ = __
 
 ñdef isdisjoint(self, other):!  = õ$'Return True if two sets have a null intersection.'< pfor val9 nY X  \ &if  ~ 
  " r} UFalseW  FTrueÉ o__or__Å ñif not isinstance(ç §, Iterableñ w åNotImplemented€ °chain = (e â Ys in y  e %s)6 ¶  è ƒ._from_i} (Q )Ì 0__rÉ ¬ 	   «___subã ;SetÞ  " R? = á  / W
 !inQ F j  NëqV@rAã~B! Ë	Ax’	ë³V�‡Ê " -›B) | ! -tú 1__r÷ ’
 “AhashF cð """Compute the # ç@of a=.B  È!No' ðat we don't define __: 1__:»0all: Bs arS  ¶.Õ0But�4you? ay  &  8 ¥ type, itsX g shoulÖ c ‚this funÊ§ T ðmust be compatibl¥ Geq__Ð A¨ ‚ought to. €re equal¥ �they contF "6samÝeoðs, regardless of howOyi–F, anÅ 
4  ] PorderA   ] @; soN Are's_EmuchMqfreedomÆ __á 5 or8°.  We matchC × algorithm us%!by ñbuilt-in frozenset‹º5"""y 0MAXA–ys.maxsiz°MASK = 2 * % 5+ 15  Š2len†ð
        h = 192ó7868237 * (n + 1)
  •h &= MASK åfor x in self:  0 ¶hx = hash(xB  ‘ ^= (hx ^ ú<< 16) ^ 89869747)  * 3644798167U ‚ hN ` >> 11G  (h &25u h‰ õ * 69069 + 907133923[ Ù «if h > MAXÖ " - @ . \== -1. ¦= 59092371n ò+return h


Set.register(frozenset)


class MutableSet(Set)^ b"""A m ð set is a finite, iter4 Á container.
© RThis W €provides$ ñcrete generic implementations of all@ ð methods except û#__e ps__, __| 
 alen__,8 ôadd(), and discard()“ ðo override the comparisz ±(presumablyl �speed, as* Y ðsemantics are fixedh ðll you have to do ð redefine __le__Ž D @thenQ ³ other operú ñwill automatical‡ ¡llow suit.> 2"""\â__slots__ = () ’@abstract91 @def  /s, valueÕ  Ùrdd an e….a     ¤raise NotI¤edErroro ts hRemovev ’  Do not s  � ôßion if absentœ  ÷ rg (‡ !If† ”a member,� A Keyú 	„ "ifQ4 “Ï = (˜ ` š ..   ¾ 1pop» 
®RÊ »bpopped‚ A.  R­k  6Zempty± 1t =¯Z l  ‰ 2tryé    � ¦ = next(itÚ‹PStopI÷ ´
; 
ó ¥ from Nonem ö  t   © e Rclear³ l 1"""`@is s$á(creates N newæ ùators!) but effectiveù ¦while Truej  ™   ¹  —v
4 FpassÅ q__ior__Ç  4Ø Ùó  Ø*itF v  Â" { +  	e ?andf ‡ D - iã á    P ”    s xÙ Aif i- V 
× Àself.clear()#
  Uelse:   úif not isinstance(it, Set)( , ðt = self._from_iterabl3 )U ÿ for value in itJ  f   Q "  p   ‘.discard(P 
g  $ Ò     > -ad: areturnÈ 
¶ Ðdef __isub__(6 8, iÿ @if i"3 
ª  . v.clear(› “ H ê 	° @
Mutsò0Set.register(set)


### MAPPINGS ###

class Mapping(Collection)Æ D"""A ð	 is a generic container » ñassociating key/‹;bpairs.GRThis r €providesH UcreteY  implementaˆ �s of allL ámethods excepty À__getitem__,£0ter
 Áand __len__.; 2"""„ â__slots__ = () ö# Tell ABCMeta.__new__ that t´ óshould have TPFLAGS_NB seti Â__abc_tpflagf Ë1 << 6 # Py_7  ’@abstractà ° rÜ u7keyuâraise KeyErrorL  8 6get0 ç, default=None> 0'D.) ðk[,d]) -> D[k] if k“0D, ¥d d.  dC Ps to G !.'¥  D2try+    �U[key]* ¶° 6 ¬ Ì #__isz
€  )y VFalse« Ö FTrue� AkeysjW1"D. SaÒ-like object ø 'Ða view on D's5%s"€ n ‚KeysViewd x  ðy  z 5 { OItem| Ú}  ~ nð . w Vx E__eqWotheru£" ,»+ £DNotIm,ed}2dicG."q()) ==  ]  ˜¡__reversed[ &#

XˆmiPproxy‘' ëtSized):U ­#'_= "',  ëe__init" ï  .: 3 = " B À def __len__“(self):
  ¡return len ±._mapping)
# Ádef __repr__! ; ð	'{0.__class__.__name__}( M Â!r})'.formatF ^ 7 Ágetitem__ = I ñmethod(GenericAlias)


 ² KeysView(M«   t, Set):W QslotsO (É @< X Ú Ñfrom_iterableš 0, iH  cset(itK ƒcontains^, keypkey in u[¥ F  | B = `yield � : 
ý ÷.register(dict_key"OItem#� åç Ðkey, value =  ™ {6try£  :v =U[key]0 `exceptZError< ÄVFalse2 ?lse' Cv is• ror v == ¶0forð
g Ü(ü 	Ò  æ¾ä "åV9æ ¯Collection	ÅŽ£Ô ž Á?if Z
  - ²6Tru± ÆÇÃ B¸ Œ†6


^†"‡0Mut=Œ”CZ"""A "  _2a gÚ �0er ² ±associatingâ Akey/p r pairs.„BThis'� providesH UcreteY  implementa
�s of allV #s 5 y %__ƒT, __s�  0delz1__,> _0ñ__, and __len__. 2"""¢ /__� ‚abstract 1 Ân �÷ FEaiseág @S ´ S L ô__marker = object9 ¤ 6popI ¤, default=4 [ P'''D./ ñk[,d]) -> v, remove specified' ?Õòthe correspondingsV þ A  If5 ð is not found, dMD õed if given, otherw1Àror is raiseCd.
  5''' Etry:    õvalue = self[key] ú except KeyError7 Ñif default is= ‹.__marke)  d UraiseX  TeturnC  Jelseh 1del^ 
› C À 
B Àdef popitem(Ï )K T'''D. ò
) -> (k, v), remove and r• ±some (key, ] a) pairb  x ñ   as a 2-tuple; but â +P if D_empty‰ò key = next(iterÂ )w ŽÖStopIterationà  ™ „ †from NonyÎ ëf
gCclea£ … 2'D. a { C.  R`0ll ™!s ˜ /D.“›while Tru å  ØÉ¬Fpass» aupdate_ú, other=(), /, **kwds63 D.1 ˆ[E, ]**FÝ UL " DÕ €mapping/¿aable EWF Â ÁIf E present  hOð.keys() method, does:0 ö for k in E: D[k] = E[k¨ % U olacks U 
Z vSW @n ei#° case, thisØÂfollowed by:  0, vI !F.å%()« Q ‡áif isinstance(†2, M@� „ ÿ  ey^ ( p      " =Ñ É Äelif hasattrk "n"j >q  ÆÄ QË ¯Æ C  ­o( F    3set¸Þ =´7'D.0 Qk[,d]þñD.get(k,d), also set› =dûPk notå Då]¼¢  ½ éË/ - ==R Ì `


Mut‡W`.regisZðdict)


### SEQUENCES ###

class Seque™ðReversible, Collecw"Ó"""All the op’ós on a read-only sK .�ÁConcrete subl ñes must override __new__ or __init__,P__get^1__,8r__len__^ð"""

    __slots_ðF_ = ()

    # Tell ABCMeta.__new__ that this class should have TPFLAGS_SEQUENCE set.
M à__abc_tpflags_g Ì1 << 5 # Py_8 � ñ @abstractmethod• ñdef __getitem__(self, index):"  n praise I RErrorP < Citer9 2 Ui = 0@ 6tryM  Q ªwhile True   @v = ‡ 5[i]A     }yield v ei += 1 gexcept± 
f hreturnÅ ƒcontainsÉ w, valueÐ �for v inš 
N  if s3  ( "== 
)  Á { ú ®  XFalse• ƒreversed• Ž iŽ # ¡(range(lenÂ'))-  w 8Vz  ¾è2 ò �, start=0	 hop=NonR'''S.5 !1, [0  óop]]) -> integer -- Û RfirstV2 ofÈ � @   Ra0s Vvbr if the+ ò is not present.%; ¢Supporting¼ ð and stop arguments@ Ñoptional, but@ ¶recommended“ 5'''$ #ifY †  e zart < 0çf = max‘" +E J, 0)Z  opŸ  ß Y /opX  opçå nw [ a1is Z aor i <
± ž †	ò M iŸ   ¥ # Ybreak5 é™7 ÛXcountÛ2'S. Å´`number¯°occurrences 5 Ü isum(1 ' ÄvÝ2 
p)

SequU ÿ.register(tuple)  ?str õ âmemoryview)


X´ByteString(z @"""T€Ñunifies bytesâ 
 SarraysRXXX S padd all¥2ir RsA2"""ˆb__slotŸ ƒ ô  c ?s)
 ~ Å tMutableÁ Ê  A” ` operaóôs on a read-write sy¦ `Concre !ub+`es musodovide ªÁor __init__,•9R, __sFÀ__, __delite m__, __len	 ñand insert().
    """
	 â__slots__ = () ñ @abstractmethod( ñdef __setitem__(self, index, value):)  ^ praise I _ErrorW >delW P &ê ¢ 
3'S.' 	Ã 3 --)Ô r beforeè 'à  #cappend3'S.    n  n Ñto the end of †sequence|  × ¼ 1lenk )ƒi ‰ Rclear ˜2'S. �) -> Noneƒ °remove all ††s from Ss 6tryD  àªwhile True     Upop()/gexcept
6 Fpass¹ reverse»   )µ ' ¶ *IN PLACE*° En = † ÷for i in range(n//2c» P[i], Ä ˜[n-i-1] =  &i]° ;extòsW 3'S.! �iterable¾   ÞB by 	³ing elementˆ < ã "if3As is¡ 
S`sBist( � 
v
 
;  ü § Q Ó  õ8=-1ç @''S." [O]` M«`‘nd returng2 atWã (default last  �K   RI€ if listö `empty Õ h  0out8àç G &''7vÏ§ 1delF¿  ° vï-žu@'" \í Ð first occurrÓ « % « ò VQ; ò  *  å ¶not present9 ä Ì  ®.é )¶e__iaddÈ^ ¸< ¦= s? # `


Mut×S© .register(¨) ðbytearray)  # Multiply inheritinglðe ByteString
# This module±used to map-ðold Python 2 names  >3new 4 Din
#*  3  % cpickle` ". n Dneedf 3ke $ ô	streams
# generated withU `2 load Û” 43.
Ä �is a copyÐlib2to3.fixes ð
_imports.MAPPING.  We canü 3
# 7  Ýðuse the mapping dñ0efined there, because lib2to3 uses pickle.
# Thus, this could c. ó@the module to be imported recursively.
IMPORT_MAPPING = {
    '__builtin__' : ' 2s',  Àcopy_reg': '    PQueue q	  ÀSocketServer s s $ ¢ConfigPars$ c p $ 1rep@   4lib� ±tkFileDialo” Òtkinter.filed A otkSimp, s . “ColorChoo• Z c c \ nCommonˆ c 
\ & 
  PTkdnd,s   j HFont f  ¨MessageBox$ m 4box8¹ScrolledTexN s t V ¸TkconstantsU  ( iu %tin 8ttk:   4 ° ¢ ‘markupbasT_ ; @_win3: '
  QthreaA_  Tdummy I: '_ % Pbhash‘ tdbm.bsd‘ tdumbdbm     n# K g 0: 'I 4gnu. `xmlrpcÅ2: ' t.client" ªfXMLRPC;+ 
<ChttpK   I ð htmlentitydefs'Ò  . %ie×CHTML€$ 
€QCooki‹g  @ c 	ˆ  4jarÔ †BaseHTTPÐ I 
Î Ptest. @_sup¸ n  . [ X1and‘•subproces� 1url¾ ñ rurllib. ? Qrobot r$  * > 2ˆ  u.reques¬6anyçí q_abcoll\  	 ñections.abc',
}

Á»ðntains rename rules that are easyÈðhandle.  We ignore&  more
# coÙñx stuff (e.g. mapping'  Z As in Æ £ and types."s)U$es… !shWb Pn befv N R  ¢ ½fixed.
NAMEN(('OÀ, 'xrange'):l6 ('^# ' w: Wreduc: Ôfunctools', ' < nv !sy6  6 funichr6 ¬  8 $od« 
ä Zstr')8 Àtin__', 'lonRg'):  ð('builtins', 'int'),
 ¢('itertool 6zip6 *  8  8 /ma8  8 efilters 
p  ; 	Pfalse@ Ê <  A ¿zip_longestA  	 A €UserDictF…Iterable â): ('collectiok C 1LisC    ;  ; `String€  =  ?  A pwhichdb>  ; 9dbm 0 a_socke« bfromfd( 1 Ãmultiprocess¨ BConn> # &.c  8, '. V 2 `  ³ Pk Z 1tex¿ ( T Cfork± _PopenR p _, }   JQurlli]ñContentTooShortErroä"('$ !.e ï *  ¥ .  k ¢getproxies™  P.requ¿8, '" @ Ïpathname2urlB 
$ D šquote_plu„ Pparse¤   > 	{ 
9 H(unT  _ø ; 
" v   x  8  4rl2	= ru$ D acleanuü
B " @ Sencodßû $rl < �5
y  : zretrievx 
> # 
B 2	OHTTPô =  ?URL<  ñ,
}

PYTHON2_EXCEPTIONS = (Ú±"ArithmeticP "l `"Asser 
 ‰ttribute �BaseExcep0 A jBuffer( ´ytesWarning' pDepreca:  9EOF> ¢Environmen*B z »FloatingPoi+ ðFutureWarning",
    "õGeneratorExit",
    "IOError _mport  uWarning( ªndentation- Index <Key ÕboardInterrupŠ iLookup, ZMemor? IName$ éNotImplemented *OS yverflow ÑPendingDeprecÐ ê ŠReferencv [RuntiŠ  
@ ’# Standar› ð is gone in Python 3, so we map it to Excep\¤`StopIt¼4ion‚ZSyntak 
€ y"Systemô  9Tab" :Typð ÉUnboundLocal* �UnicodeDe  /En yH ŒTranslat~ e Ú KUser JValu; ! —ZeroDivis¹q)

try:lqWindowsÉ !
e‡ s# ’pass
else ø	PYTHON2_EXCEPTIONS += ("J ò ",)

for excnamþ8 P ò NAME_MAPPING[("„ dions",? 0)] b ibuilti ø

MULTIPROCESSING— 1= (ä ’'Authentiðì 'ô 'BufferTooShort bProces bTimeou+>',
á Š é bmultipi iî   ‡.contextà

# Same, but o03.xOô2.x
REVERSE_IMPORTaá = dict((v, k)4 `(k, v) 
+ ÿ.items())
assert len(V A) == 
B )… äƒ 
) � 
)  	   Non-mutualmŠpings.

¦ ’.update({,ÂcPickle': 'p
 *"_et1tre Pxml.e ".E T -  FileDialogI 0tkiýb.filed (  SiË* s 
, ð DocXMLRPCServerY ‚xmlrpc.s 	T FHTTP) Khttp' ?CGI$ ò# For compatibility with broken !ps savedB5oldæ@ vervsX ½@Dict· `collecðs^  ?Lis 	QStrinP@  ðwhichdb': 'dbm',
   ÷ 'StringIO':  'io',
    'c  ò})

REVERSE_IMPORT_MAPPING.update({; €_bz2': ' N @_dbm    �functools   g, 1: '  `pickle1 
  ,
— ONAME� ñ('__builtin__', 'basesó c'): (' s Rstr')k ±('exception ÞStandardError: E- @ €UserDictY  s ecollec[  { Qsocke9 _ bobjectw   V S' @Typev  Ÿ
k‚ 'reduceZ * – ðtkinter.filedialog… RFileD Ý  7, ' YH HLoad.  œ <, '" ˜ GSave@ œ  " P Hsimpê S ì 	 9, ' ð Ðxmlrpc.server3S
 rHTMLDoc{’DocXMLRPC &  ž N 8 ¡DocGeneratŸ‰ È/('[  3 ` @ ÐRequestHandlee 8 j /):b 0 Z 	2CGI÷ Ç ; p Hhttpà)OHTTPl 	- & ¿ A  : k ?CGI. 9# e  b s ƒk< 3, '! ”‚ñPYTHON3_OSERROR_EXCEPTIONS = (È²'BrokenPipeFÔ Ú'ChildProcess 2onn(cAborte}7  5 _Refus5 YReset:  .ZExist†   zNotFoun� I<rup™ ÉIsADirectorya ?Not ©Permission1 iLookup eTimeouÀ ÿ)

for excname in �à:
    REVERSE_ñ!NAME_MAPPING[('builtins', excname)] = ('exceptio ð'OSError')

PYTHON3_IMPORTERROR_EXCEPTIONS< ò
    'ModuleNotFound? „,
)

forl O in P :M �REVERSE_½ #bImport‚ ñ')
"""Internal classes used by the gzip, lzma and bz2 mË qs"""

iM 4 io
 øsys

BUFFER_SIZE = io.DEFAULT_   # Compreso ñdata read chunk size


“ ð
 BaseStream(io.BufferedIO )ñ"""Mode-checking helper func¸.°  ŒQdef _( ó_not_closed(selfL  % 0if  . d     ±raise ValueG°("I/O operak B on 7 � file")
¶w @can_ì u  2noty    Wable(• } €io.UnsupË4edO{ p("File E Popen ] I ?ing‡ _writeˆ 	 ! ˆ 2 I ˆ Oseek‡ 	 Æ ‡  1See…is only 3! "• R 1"onËsåV? !ifx6 Î ®  °The underlyÃ > object¯ Bdoes� " � |S3Dec}`ReaderY<RawTaAdapts
d2 Åor API to a 4 ½e 	j¹ Ì·return True q_init__
b, fp, w ð_factory, trailing_eƒs=(), **% Gargsc  r •._fp = fpï »eof = False €pos = 0  Ðurrent offsetŸi ´s“¾  P# Set ½3 of¼ 	. ñ once it is known,¥‹SEEK_ENDŒ I I= -1e >ave’!¦¥arguments.P A# If5 Uôcontains multiple 2ed × ws, eachA  ÷ will need a separateê #or³y. A new N Øqis alsoQ Ðed when impleÀ  ±a backwardsÇ&()Õ Ë”"# =r  t . Àcomp_args = Ódecomp_args
  bself._ ˜ressor =  ¹_factory(**  F %)
H ù# Exception class to catch from b ÷signifying invalidH Ptrail @dataF eignore" † & A_err´ 
 ™  def close(5 +):D 	” V= Nonf ò return super().F ð  W }seekablZ 8 W5fp.( < �readinto– 7, b™ ðwith memoryview(b) as  , ‘.cast("B" Pbyte_ Ú  ×9Æ l U(len(, %)) -   [:'  < P)] = 	 ) Ö ! _`  ^—, size=-1Î !if J < 0¢ P  8 .B Call(! ” bif not< #or�?eofE 5b""¨  µ  Êø  # Default if EOF is encounteres`DependtÁon the input , our call‹  	60may« � ## Û 1any@ 0. IS ð
is case, try again after þ  y åanother block.P ªwhile Trueü  ZcŽ .# M1rawU 1 = q
î�.unused_:%ory  :  ¯1_fp³Ë(BUFFER_SIZES 8 Ã} 
¾  !   ]breaks  # Continues¶next stream =   ’ ¾f  ? Ó   ?try¾ 3g	B.‘ (
{ f e6ã
Äv 9# T!�isn't a G á Ç#ed4"; ?> it? � „;elsn ( raneeds_/¯  ˜?�B š PraiseáEc("Compf>Áended beforeÞ0 ?  ‚"end-of-° marker was·_ched"Ñ > e ´    O.!ifr
ˆÀ    break
    Ñif not data:
  ÿself._eof = True  rsize = * 9pos# ¥return b"" ) € += len(v ) 2   
 Àdef readall(< )¢ ±chunks = []+  µ ‘# sys.max˜ Ðmeans the maxn øgth of output buffer is unlimited,J ao that@ ‡whole in7 öcan be decompressed within on+6# .# …() call.f Qwhilez# :F î (Æ ò  â ö s.append>O ?’b"".join(- )K�# RewindÑ fx tâ °e beginning . r stream«  †!_r> † •¶._fp.seek(0Ë =FFals  po¼0¼  ,%orX ¸_factory(**, S_argsã  ¨ ˆ  ! ÷, offset, whence=io.SEEK_SETU “calculate3 ñ as an absolute .‚position Œ#if[ G == ^ ¤ & 6pas/el5 :CUR5 »  -+� 2L :ENDL `# Seekàð
relative to EOF - we need Eknow0's Cì  Ê #ifé  J < 0h  # Ñ .É÷io.DEFAULT_BUFFER_SIZE 5  	*  w  *se‰ ðraise ValueError("Invalid v C for¹Ò: {}".format(')L € °# Make it s+#atƒ 4 )`number7PbytesF@skipa Fward>$if: <C:posµ 4eG,elÞ -0_v Îâad and discard^PuntilîQreachçŽdesired ØÅh >ç} äOmin(èƒ)Ð  Wq  UbreakÐ   ‰ -1! ó> 	.te4B"""R• ¿{currentß"¯^ `"""Sha7psupportìB scaAPdocumS 1typ@lara5‘s in HTML›X
 À.

This modu]0s uD {a found9 `  ­ ³html.parser3 Ô.  It has no
z  Ñ‘ublic APIm ashouldãðbe used directlyñ0.

"""

import re

_declname_match = re.compile(r'[a-zA-Z][-_.a ±0-9]*\s*').2 B ŸstringlitG ù(\'[^\']*\'|"[^"]*")D Ìcommentclose„ ÿ--\s*>')
_markedsection, @]\s*  / ðD
# An analysis of the MS-Word extensions is available at
# http://www.planetpublishð/xmlarena/xap/Thursday/U ïtoXML.pdf

_ms® ª 1delŽò
class ParserBase:
    """ b base % ðwhich provides some Gaon supáÁmethods usedI !byñ SGML/HTML and X
 pt !s.! u òdef __init__(self)�   0if  1.__Œ  __D£ ¶  )   ñraise RuntimeError(�    "Ü upà .I Á must be subj Qed")
>  Ÿ \resetœ ™ ¡lineno = 1-  g  ¦offset = 0F lgetposG ð"""Return current T q number8L 1 `   r2 k  / 2no,), t ÿ# Internal -- update] ñ  This should beÎ ð # called for ea@ieceâðdata exactly once, in orderm   CtherG Qwords�concatenaZ I 1all binput ß“s to this? 1funŠŸ {  jqentire B .3  ´ð qj, i, jZfi >= jmYjG  !awì =`r  n~sJ ³.count("\n"s + 2if . 
r Ä e  T Cno +0 B  � (pon hrindexo B # SÅ‰not fail? n %Å = j-(pos+1)$ $el m   
2  U+ j-i: “j|ï _o@char´ "'' #— "ar(nfuse by�&s)Ú3 a 3 S7, iß#Ð Ó °s‡(ofh ;±"“ai î Á# deployed,"ƒt@only! q@docuFB typ*; #cl“ ó ("<!DOCTYPE html...>"Å . ñISO 8879:1986, however, has moreEplexb œ a bsyntax› le� sÒ  <!j  Žvcludingn@# --¹Went--V [A ð]  ± V  ö ó	following list: ENTITY, æ À, ELEMENT,
   ò# ATTLIST, NOTATION, SHORTREF, USEMAP,
- Ñ  # LINKTYPE,
 @, ID * 	 eSYSTEM2 ó rawdata = self.  •j = i + 2 sassert ) õ&[i:j] == "<!", "unexpected call to parse_declaration"L %ifH Rj:j+1J 5>":"  Ù ù# the empty comment <!>$ Åreturn j + 1 _ `in ("-© ,")e …Start ofd öfollowed by buffer boundaryr¡ œor just a) .�  ) ¦ -£ ð<# A simple, practical version could look like: ((name|stringlit) S*) + '>'
a   ƒn = len(¢)‚ 2ns'--': #X,  I ñ# Locate --.*-- as‰@body' •7 å Oü& &(iŒ (elŽ Š [‰  marked sec+� ÿ[statusWord [...arbitrary SGML...]]­ [ 
gWhere Y `is oneé ñTEMP, CDATA, IGNORE, INCLUDE, R © ò	Note that this is extendMðMicrosoft Office "Save³ �Web" funý àto include [ifæ Ï and [endif]i„ý _X
‹Pse: #®gother «@ elepsà  ! `type, e `_scan_�G(j, éŠif j < 0n$jW !ifw  V N0doc 
k   _« –chars = 'þQwhiles ns 6c =m]y  éAif cv z  P# end w Ây syntaxE  , Jzj[i+2:jk  & ì  *   ô RhandlE(e I #   Jelseñ     °# According� ·´HTML5 specsjús "8.2.4.44 Boguò H   # *!e"‚9 �5 MarkupÊ*Mopen(K C 5, aU �token sh÷bôZittedÜ =   `# CallÖ qunknowndÿ provides more flexibility thoughM fH g¹	h Ž D{in "\"'¶  Am =   »d_match¦ð, j)
            à    if not m:
  ýreturn -1 # incomplete+ ¹j = m.end() ù2elif c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":N  � `name, p °self._scan_ _(j, i~ , þ decl_othercharsò  W Yj + 1w Å _== "[’  ð# this could be handledõ ù
a separate doctype parser`  × 0if ž #  i / o   .  ¨ Ó O _. �_subset(Ã  9 Ë i ðin {"attlist", "link‚    želement"}. Q ±# must toleç ²[]'d groupsÑcontent model #n T ò  =ion] @also5 ðdata attribute specifications of  Æ S  ê  ë 1  ?¹  !   s¥ 	 1  † ¢  › W s S °raise Asserá ðError("unsupported '[' Ä (%sR 1" %  ½ 
 ROelseÉt \expecs  B¹"e a ] %%rÏ \ ` % rawý:[j]i Žif j < 0Î ³j® Ä  Ò# Internal --�Ð a marked sec€) ‚Overrideï#toéð MS-word extension syntax <![if  #]>¡<![endif]>U 2deft _r _r (Ýp, i, reò6=1)è  = % . O  âa67ôi:i+3] == '<![', "uneÓcall toƒ %)"T  – Nx† i+3, i  iœ‡˜!ifb Z  È`{"temptcò 	 aignore
 Qnclud r ‘ð	# look for standard ]]> o%ngË  #smatch= t Ý óionclose.search(U,Û × = / ²  if�  õ Lndif*™ ¯MS Office ™ s l › Øsð
               õ4 'unknown status keyword %r in marked section' % rawdata[i+3:j]
    ) Õif not match:  ) •return -1 šif report) 2j =@ †.start(0^  H Sself.» h_decl(™ 6 j]/ s � @.endK ~ ó# Internal -- parse comment, 6 Ólength or -1 × ¡terminatedG 2def= _= (� 0, iE  Ù 6=1)Ü § 0 = & . I  Ø  bö :i+4] != '<!--'D  ) °raise Asser›û
Error('unexpected call to› &)'4 = ¸ Äclose.searchOV, i+43 : � Ù9dhandle˜ Œ _[i+4:Û!ô scan past the iõ`subsetçÀa <!DOCTYPE M0araU,—#3ing@ ‚dex justT ôany whitespace follow- Ptrail A']'.O  /_m’_doctype_‰ 7 ƒ ö?pos;tn = len.µ Ki|  9ºwhile j < nÂ5c =ÞÚºif c == "<"4  Q s8 U:j+2]l     Oif s@  ! ý# end of buffer; incompleteM  0 žG    k !« !¬   " x¨updatepos(mv, j + 1; 0  rž  2 "‹!haNzÏ(in %r)" % sI ‰ @if (¤  2)PÂ x   N:o L4) >0 j   n :@[j:jýt?!--Ë ÚÏP€jz6 ¯   !if0Í    aj—~continu›@nameDÝ_y_ E!2,]Ú\ — _== -1™ • ö g vðin {"attlist", "eleÓ ðntity", "notation_"}:
   ÿself.updatepos(declstartpos, j + 2)8 ÿraise AssertionError(*  u �"unknown ` 0ara3 ÿ %r in internal subset" % nameK ‹ ñ# handle the individualC sD ð meth = getattr(ü ñ, "_parse_doctype_" +? m @j = C 1(j,É )* �if j < 0t‰return j  Þelif c == "%"8 þ# parameter entity referenc,@if (¼ 1)P nN  ”þ# end of buffer; incompletQ  0 ¶ )-1·   * = Op._scan_Â‚ *@ s Ðif rawdata[j]å /";5  *  µ	· n]9  5  O QwhileÝWn and† ¯.isspace()pT .¨ë >²   œ   ¦
\    ¢íÇ 4 éð"unexpected char af™ÌR Oelse¹ _¨[	Wh  ü Èc m… reached”þ  4# I0-- Sñ  past <!ELEMENT€IèKdef Êselementèi‹‡ ® íÃ4 �  iáV== -1G   È     õ# style content model; just skip until '>'] Ú �    if.  < O[j:]‡   ö.find(">", j) + Â¯ ^ woATTLISwoattliswž ç – 6c =‘à:j+1]
        ×if c == "":
  •return -1 * >+ Fj + . zwhile 1U ü&# scan a series of attribute descriptions; simplifiedC õ  name type [value] [#constraint]²  Ï  , À, j = self._� _ ù(j, declstartpos)7 Šif j < 0}  Q j/ úc = rawdata[j:j+1… ;:P i  2 (3  ñ # an enumeratedé; look for ')'� P g")" in§ ]Ý  +  ,Ì Ù.find(")", j)ß )   OelseG (Ø  4 c /¯.isspace()N  • 
a J   oif not× P# endrýbuffer, incomplete. X À ð  Pe 6 Ú cœ 4lin "'\Î Ñ Rm = _òãringlit_match(Š ä
Nif m€  O  ’jm.end(:  &  º    # ë   [  à#I (if8'  ^ ?) $ ‚   ! WŠ	 ? Ž  w 
’  SL>'>'ž# all donV¨  ò 
AÒ# Internal --ñ past <!NOTATION£1ara4 àdef _parse_docA_not! (ã;, iO¥ ‡4 k  D{Ë ' Dg  óŸîŒ;Ë	ª 	‡À  if c == '>K':
  Éreturn j + 1 Þif c in "'\""8 ùm = _declstringlit_match(rawdata, j)P  x Žif not mO   ‹ -ˆ   ªj = m.end(T NelseL `name, 4 °self._scan_ B(j, ³ jartposM  i Žif j < 0U   ¡ !j
Ù à# Internal -- e á past <!ENTITYk �arations2 ðdef _parse_doctype_entity(© ;, iŸ † U0 = * . U  ™ 3if  Û[i:i+1] == "%· ièvwhile 1l  Q   5c =V ej:j+1]p     Ðc=   /Ð  \¯.isspace()>  ® – X ö  Ubreak¦ (  T i   ( é jZ T P¾[U Qd M I¥@¡ ?‡ {m    º   Å# incomplete/  !elÌ  ¸>¸  E x Û  f   ã    ˆ  a | ð token and the new posi # A, or## [ ò-1 if we've reacheD aend ofO qbuffer.8 T }â aI(tn = lenÅ!@if iUn­r>gNone, œ iW lsë[groupí K  .r @if (Ü ½ ?s))«  ¾¯ C  # WSR )   Ü  w �.lower(),† ‚¸.updatepos(p', û c  aise AsseriError(…  & ™"expected[ut %r" %£i : Às+20]
        0)

 ñ## To be overridden -- handlers for unknown objects7 4def ñ_decl(self, data):"  ] ðpass
from _weakrefset import WeakSet


M óget_cache_token(F ñ"""Returns the current ABC .  . .Ì 2The Ó is an opaque¸ P (supy ðing equality testing) identify 1theÃ n ¡version of… }  övirtual subclasses. ‰ bchange4ðwith every call to ``register()`` on anyÞ .� 1""" r  ñMeta._abc_invalidation_counter


„ * V(typeJ =    ¹ Pdefinï ò Abstract Base CÅ s (ABCs)ZÒUse this metaC �to createj€ABC.  Any @ canRdÄ Ðdirectly, andHñn acts as a mix-in Z a.  YouF Talso "F òunrelated concrete5 åes (even builtL 1es)o 7 E  Ú  x '¼'þ@thes× § ñir descendants willE  beƒ wsideredþ&· bPBC byõ   D $is%p() funcÍQ, but, C ñwon't show up inD ð	their MRO (Method ResoluK ± Order) nor¹  ¿"ho�‘implementB!s $ed¨ |  ï Áallable (not| rpvia supÃ)·  ³# A global ¢P thatŸi¾  âed each time aÎ" i2#ý ed±,a ² nÐanything.  It²!ce.ƒ …negative1 �@clea¸òbefore its next useÄ r# Note:ö½ Àis private. ]`abc.º`„ }  �  externd` ÄB = 0Ï ó	__new__(mcls, name, base óspace, /, **kwargsî x Tcls =›.J G À  F  # Compute ¼Dof a/mo • ¯ /   { { I     �  ¡, value inÝ Ð �.items(): ±if getattr(; t, "__isx • Å__", False)}G  t  < m   s© ˜    “   b  ' a 
_ s` Wset()p E   — % =§ »NNoneØ Ó 
¸  s   £ `s.add(Ê j Ðcls.__abstracótmethods__ = frozenset(abstracts)
  õ# Set up inheritance registry& ”cls._abc_ ¶ = WeakSet(L & _cache# Ÿnegative_, ò_version = ABCMeta› õinvalidation_counterÁ ±return cls
 3defæ ñer(cls, subclass):!  A"""R
Åer a virtual) ` of an„ .T  3 Rh Us the) ñ, to allow usage as a m ¸ decorator.v  Áif not isins›(§ g, type­  ~ õ
raise TypeError("Can onlyì w 6es"¶Tif isW ` (cl_ Ý Ø Õ  # Already a ¼ ñ# Subtle: test for cycles *after* 1ing -"aJ '";L Óthis means weN"X.�°er(X) and iõrpret itgVno-op]
í ù í 0# Ts Àwould create¶ Â á, which is bad¿  ðõ algorithm below½  N šdRuntim�PRefus %toa nˆ0«aø ery.add³ÓP += 1ÀI5$e ’ ’¾ :!ë ?U_dumpEˆfile=Non™ð """Debug helperQprint$3ABCœery."""w # @(f"C”1: {û ³_module__}. pqualnam 1",    H SInv. b: {getzŸ_token()}?  ¶ ` ! i=–.__dict__% Þ §ñame.startswith("/"¡ - @valucgetatt~ d µ  '   ®û9 ,xZ   3 % 0 = ï V {u A}: {( +!r‹éùQ_cleaµ � @"""C Óœ  (=dûgæ$orñ)êÚc .c )k  —s€ ( ~ 7 {  K  � 6( %_¨rcheck__ 
-�Override;Ý. ,©
&�# Inlinec¬  i 1ing„ à    subclass =ó instance.__class__
  aif sub õ in cls._abc_cache:'  . µreturn True  subtype =  (i )! `   5 isk 
Y Eif (y ‚negative‚ µ_version ==S  Œ   rABCMeta° ý	invalidation_counter and6 î 
u )Ÿ  l ü FFalsý   õ# Fall back to theå y check.‚ H î _‹ ( 4__( >/ 2any!3 €c) for c¼@ ,ƒ  s1))
~ ^def _< !ls* ýô ±"""Override] $is™ b �cls)."""`  	”if not is- Œ 
U÷raise TypeError('f ñ) arg 1 must be a £ '0# C\ ¦ƒ ª  eÌU ^  ; may haveàg&if6; ½/< ¬
4# IÐeTY ” ò  yç $ } ¶ = WeakSet(80 j­ € "elà 	t
� 
Þ Ö
M~	BEhookm Bok =kË   _9Pif okr ”êNotImplementedŒ Yasser·Šok, bool6Q 
; 	MŠE.add÷
@ ;elsO	? 
/H <9ðif it's a direct˜Aª §ugetattr¬ ÷ , '__mro__', ()	¦ å � 	"Ÿ ¤ò of a registeredæ¶ (recursiveB ä@rcls¼ ð: *ry– ± ? Ø Ü  - à !î Ø sØ Ú[es__(° Û  B + Ð    cls._abc_ûcache.add(subclass)
  µreturn True ñ# No dice; update negative S ) ”cls._abc_  _  s k ñ.False
# Copyright (c) 2004 Python Software Foundation.
# All 1 ñs reserved.

# Written by Eric Price <ep ðat tjhsst.edu>
# óand Facundo Batista <f  1 ÷aniquetil.com.ar8 òRaymond Hettinger <p· `at rcn2 / pAahz <a ‹at pobox"  Tim PetersÍ ó#This module should be kept in sync with the latest¤@s of ñ 
# IBM specific>õ as it evolves.  Those9 @willf �treated
#0 ò bug fixes (deviH @frome _ ò	 is a compatibility, usa €
# bug) la ðbackported.  At tí @poin eU !stD @zingŒ !nds ‹ s ðbecoming fewer, small	  n ‘less sign ‘nt.

"""
Z ³ ²n implementÖ ð of decimal floa× – ðarithmetic based on
z“General D7 A( Sy!:
,ðhttp://speleotrove/u   i p.html

Ä úIEEE standard 854-1987O ðen.wikipedia.org/ /: _1 $

¢ Ù òhas finite precisionYðarbitrarily large b†Às.

The purp<m«�is to supß Î 7!us§ñamiliar
"schoolhouse" rules"Óto avoid someÊ° tricky repð®P
issu6 Pssoci°¸ kbinaryÁë�e package±eð ally
useful for³ancial appl6 s  òor contexts where users have
expecFas thatžat odds˜   (v  inâce,
in À ú, 1.00 % 0.1 gives 0.09  5 I `ead
of ;— ('> F') % b0.1') ‹ ³ "e Ä $ed+Ð('0.00')).

Hð  q—0exa9jØ Æµq:

>>> ) !im* 3setP¢(ExtendedC`)  ±7(0)‘ ' 7'1'    t : x'-.0123# $-0 ) h123456J  m b23.45e. (78X  1.2 "E+ -80; v.33') +€H1.27B >2.66 J2.347 ‡3.87') -I 08.4ú ö ð2.20')
>>> dig = ôDecimal(1)
>>> print(dig /  t3))
0.3 ( ñgetcontext().prec = 18 C K 31 §.sqrt())
1 †  ÿ.732050807568877291 ò ** 123)
4.85192780976896427E+5¯ Uinf =ì '1)ù 0Ñinf)
Infinityo :neg= -> , 9)
-B + 1 + c 1NaN^ 	 * > ¬0œ 	 ðtraps[DivisionByZero]±i G ùTraceback (most recent call last):
  ... dF.d q: x / 0f  !C2 .˜ ðInvalidOperationš 4 �c.flags[( ")
' ”c.divide(+50),ÑD0))
 R'NaN'Ôc} ~} ' ! # =ú Æ ' Ì /)
 *D5: 0¢� nñ \	²k ì 
k1ñ
"""

__all__ = [
    # Two major classes 'C', '™1',
 ñ# Named tuple representž! < T! 6 G ` Sfault  g WBasic …Extended  PExcepK ¥  M pClamped Ö  
Š"',¸ pInexact! 0Rou|   �Subnormal €Overflow 4Und @ UFloatªú š �al condi½ ì that trigger ¦ R ¨  Impossibley , £0verÀ`Syntax& <  § 0finBðConstants for use in setting up¥  ½` ROUND_DOWNW  {HALF_UP 7EVE$ tCEILING^9 VFLOOR7 C 
g  05! · BFunc; · �manipulaµ o² s€ j î  Slocal/ £CLimiÀthe C versioón for compatibility
    'MAX_PREC', õEMAX', 'MIN_EMIN qTINY',
7 Á# C version:V ðile time choice that enables th ñ!read local context (deprecated, now always true)i ß'HAVE_THREADS~ 'šcoroutine� c óCONTEXTVAR'
]

__xname__ = __ Ð   # sys.moduÙ ðlookup (--without-thç 5s)
5 °= 'decimal'qó# For pickling
__Gj S'1.70' tHighestg1 ofH‘spec thiswPlies | Ê  `  ó# See http://speleotrove.com/™ É/
__libmpdec� ‘"2.4.2" #m  :4le * š ð

import math as _	  qnumbers   ‘sys

try:½ ófrom collections V  |bdtupleD 2ame 6 D[T  != ª (('  Æñsign digits exponent')
except IÅ RError‘ ? ð = lambda *args:  �

# RoundÉæROUND_DOWN = ' "'
 vHALF_UP  	  7EVE? "   $ vCEILINGD    VFLOOR   { $UP c 
µ  $ (05<   'ú CL„ 
ºr = True k "ifWòaxsize == 2**63-1Š¤M = 9  "  ¹" ÏM = -D m9
elsem A4250 d  [  
A 51 =  pMIN - (¬  r0-1)Hr“s

class uE”áion(Arithmetic) )¥ ‚"""Base ¼Aion ? .žFUsed ‘s derive b ;.Ð VIf an' & s' wanother QbesidÍpis (sucìI òUnderflow (Inexact, Ö¢Subnormal)@indiñ Âat it is onl�‚called iìƒ ðs are present.  Tüðisn't actually uñ 1for�  anything, “#ghÂhandle  -- Cf Dwhen‹�._raise_e  “ Š 0and×Y [Rtrap_ßr. `not seŸ PFirstAumenÝ Àself, second, <theO u.  More> ás can be givenÐ Òse being afteð — hðplanation in _raise_úerror (For example,
  ñ context._raise_2 P(NewE; ý, '(-x)!', self._sign) wouldI Dall 9 £().handle(` 	A 1.)
> ðTo define a new exception, it shg ð be sufficient to have  aderiveI Ôfrom DecimalEE . 1""" Cdef “  Ë %, ™ q*args):&  üpass


class Clamped(] 0 €"""Expon› àof a 0 changedª ³fit bounds.ñ ð his occurs and ORals cf ™ if the eS ñ result has been¨ ôaltered in ordern  > Áconstraints ” €specificó Bcret4 representar@.  T� 2may¡ _ whenŽ  Szero “ ¡be outside3 õ ~ 
h B, or[ áa large normalÖ bnumber_ç¦an encoded°that cannot` bed.  I tÌ Álatter case,— X†is reduc§ Ž=¸rresponding• 1of û ðdigits are appen› !to_ 5coe¨Ö("fold-down")ŠV±InvalidOper~_BAn i. $ o/ ã was performed\ðVarious bad things caus‘2is:€ASome £ creates a„qing NaNò ¡-INF + INF „0 * (+-)  ) / Qx % 00   1% x ñ
x._rescale( non-integer ) @sqrtdc , x >C C0 ** x (8 7  – "An Tnd is3ö 4The²oaJ af#Pthese8 ða quiet positive3œ»)\iB,”Qwhichy/!isò Talso i ÑNaN, but with- �original™,'aÜ  ¦(Ðdiagnostic inEf Æð0if  ? °ans = _dec_]€_triple() 2[0]	,8  âint, 'n', True£ G   ôreturn ans._fix_nan) % _„%üConversionSyntax(6„0TryÁ toã@vert0ly “ed string(ç„ f- <  $becš t>#a · C€it does œ!coœ › 1snumericQ 
sØ {e¢¿is [0,qNaN]Ñ#À  return _NaðN

class DivisionByZero(DecimalException,  % ô Error):
    """ q by 0.
 ó
This occurs and signals dh µ-by-zero if ñ of a finite numberL 1by + ñwas attempted (during a@ Óde-integer or b opera¿ Aor aM 0pow$  ð with negative right-h² = And),À 3theV and wasL 1notš ô €e resultÊ  2 D  � P is [Á,inf], where   + ‘exclusiveZ $orC  5 s P Unds få ,ð Ais 1 san odd å fL 1-0,  . 2"""§@def î ñle(self, context,œ s, *argsê îñreturn _SignedIn­yÚ ]KôImpossible(InvalidOvR `"""CanF€perform 
#µ adequatelyaUi_ -ofK – c 
2yremaindòhad too many digits (would b§0lonr‘than precCt).  The ú0,qNaN]}w-Na±�Undefinede´
7 § oˆn! R @ ­k±,YÊˆ ‚M @dend9Balso‚sQ}InexactÎH2° round, los¡ inÛˆZa  QneverÄ¼nÒ& iƒ5 ð(that is, it neede¾2 be� !edÈË@scar  Õ[w‘1non–)Œ0if Ppverflowhu" QcondikåôJ ± Àin all cases¬•unchanged2e iRm`al may° 1tesáð	or trapped) to determine4qa givenq ÷À(or sequence4  s)µp ˆþ CýJá) '¢.  Unknowne2ingluexampleë ¸3an Ðf  » é  cû�@is c³ x &Î`s are hðchecked
    on cðreation and either the precis qexceeds Ðcapability of ò
    underlying concrete represent^ ñor an unknown or unsupported roundingM ðwas specified.  These a #tsv  g ñtext need only be checked whenK  È �values ar“ �quired to/ $us` ñ result is [0,qNaN].A A"""
	 ôdef handle(self,� ‘, *args):&  ðreturn _NaN

class Rß ð ed(DecimalExceps6 Ò"""Number gotðed (not  necessarily changed durj5").£ ±This occursÌusignalsQ  #evÞñ  of–Boper¦!isÈ [  „ 0tha°, some zero»Anon- õdigits were discarded fromÐcoefficient),= is pverflow > PcondiÈ þ“ ¢°n all cases¯#uneñ 1 ma0teskÀ(or trapped) determine ™ C giv< 3 €sequence€ Ps) caFa a los�7AŸSubnormalðExponent < Emin befo¹ A5ingå êsb ì ·1ver×!orYÎ  OB (û âAadju?e¡ `is lesal ° ,± 2any‡Bing)ÆdÂ‡ Ä,&r ß Ç	@yiel»&a { #ÇOº”(Inexact,ß	Îƒerical o- ¹'  „ ´o ©B¶(eaÐz'anõ Æ M¡an attemptùQivideM !byÛ…), afterºp, would,g&< anÜ‘ largest _ g K  caµ+Ad by- eimplem(ä 9 FEmaxÁeã ¢ depends om � ôRmode:ï#Fo© �-half-upõ*  `even (Öf+ d‚1and± 1 0up,|¨ Aed),º  ö ´ M * œa,inf],J  wh   J /  '0 inhAedia o6.  Å  • s L w i`el‚finite n- t pmAed i4G @currN•ð, with the sign of tô#he intermediate result.  For
    round-ceiling, th$ 1 is ³same as for- rdown if aign ofK  < m   I P1, or	 ò[0,inf] otherwise‹ Z efloor,M ­  7  [ ‰ • … M I 0‰ 1‰ ðIn all cases, Inexact and R&!edM ñwill also be raised. A"""
	 ñdef handle(self, context, sign, *args):,  „$if" .�÷ing in (ROUND_HALF_UP,  BEVEN( @  1 DDOWNB 'UP|  < ðreturn _SignedInfinity[­ ]¥   V == 0»  ? ¿ #==¯ zCEILING2  6 u ) Ðdec_from_trip[LC'9'*__.prec* TEmax-  7 ?+1)ê 1¸ ê 
ZFLOOR0 ¿ ]
) è 1Pé ó

class Underflow(ì,é³, Subnormal,ä"""Numerical u9 S withUÄ‚ed to 0.
±This occursH B7alsA Dif aA Gis iu1the”òadjusted exponent o}×Pwould�ñsmaller (more negative) thanJ G% €st value Pt can@ ´Bd byGð mplementation (> 5 L ü Emin).  That is;IbothÎ sQeø ‡after aneUbe a 8 c numbe…Red, iwÒnecessary, soÐ 6its- is not lesÑ�an Etinyº cis may‡ Ö Bin 0Õ î  ¯mU2 Ó&ank #of] þPd Zh ó X²‘FloatOper“Ð(DecimalExcep¤¶, TypeError·ÀEnable strich‚semanticÓ0mixofY ¤U s¨Il  alŒ Mÿtrapped (default), I 1 is\`permitÉ!inaj  ()¯…structor.’.create_då  ()oI ¥±omparison oðors. Both conversion añRnd comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by settingH fFloatO3 ðn the context flags.  Explicit Pversi’ AwithD àDecimal.from_fQ P() or-  F ’.create_d' _' ado notG 1set}  u !.
 °Otherwise (— `signalØ útrapped), only equality2Cnd e¹ N 5con½  Op. All oj B@s ra} 
%�°"""

# List~ppublic ˜ Rs and;"
_³ ðs = [Clamped, DiviC¡ByZero, InÙñ, Overflow, Rounded,¸  ð  4Und  uInvalid¹Ú, Subnormal, ¯ ]§ 0Map� dias (perl“spec) to ¨ R
_con& •_map = {C6}Syntax:| 	¥  ©  ã ¯Impossible7  ê _fined6 ‘ Cµ3 }V/  rW´ing modes
_ _ ò = (ROUND_DOWN,  yHALF_UP 5EVE  zCEILING«B TFLOOR@ J j €05UP)

#  Î R Funcµ    ù sThe getÒ!()�s fb à manage accessña thread-local
# cpÚu

impor svars

_'  L ' `_var =€   $ .Þ TVar('£ y')

defµ :cà"""Returns thi  � $'sZ 5(If P doesd´ yet have a1 2, rP _ Ta new ' f k  âN0 ¡`copiessDefaultè 3 7 2tryÑ   ‚  4a.get()œ öexcept LookupErrorB 8$ =44  ^ W Cset(5 ^  * ˆ  ƒ' )w A"""S®  9. .% ] %ifXJin (s, Basic+`, Exteý s  G W LW.copyï ! p.clear_Is 	D
del¦  ¤ q   b# Don'ãqaminate;’namespace,#€ “(ctx=None¼ ¹{mQr for ðpy of the supplieôd context

    Uses a copy of the current( f if no ±s specifiedB µThe returne\ á manager creatb Ôlocal decimalN A ñin a with statement:    ¦def sin(x)   1 U Ð ›() as ctx)  . Õctx.prec += 2\    `# Rest ÿ
sin calculation algorithm5 u< Y  is. 12 gð Úr than normal: *ó	 +s  # Convert result to3  S ¥¥ 
’ExtendedCê; O ó ) %c  Ä  NP from?
ï k “General DþASbetic SLco
< +þ)s>>> set „(Default_  # vprint(g) ))! !28  ( •
d]0...Ú  n8 = I <  Y w ‚ —y 1...> !30 � xÔ 
� W � € 
` 9_ / 
1"""0 !ifî �is None: û  µ_  M�(ctx)


# `class    P

# D1Rt subK `Œònumbers.Real and d. °register it1ô such
# (because� òs are not interoperablewÐfloats).  Seeõ ) „es in
# x ùpy for more detail.

¨ s(objectŸ@"""FX ping poi�  E 7a9.˜™ð
__slots__ = ('_exp','_int Ásign', '_is_·2al'## –1ly,Ã Pvalue ßJñinstance is given byv  #  (-1)**_c 0 * r p * 10**„ % ß1al ] T 0 >G by ˜ ‚ == TrueÊÐ# We're immutzP, so ¡p__new__s‘ __init__n  ! R(cls,u T="0",p=¼p ÁA"""C²% a›|ù .�  -  ‘€('3.14')  P# str¿Qinput”   4  P ð(0, (3, 1, 4), -2))!ptuple (3�, digit_ ¢, exponentÍg À Decimal(314,)  d# int
 åDecimal('314') D>>>   E314)O ²# another dB • instanceD 8 [ ×'  3.14  \\n'\ ðleading and trail ÿ whitespace okayh  .Ä E"""
% ð# Note that the coefficient, self._i ÷is actually stored asF Pa strŽ !raþ ÷than as a tuple of digits.  This speeds upE  � "' 0 to�Qeger"ï @"int   # È" conversion‹ Ì ÷!are used in almost every arithmetic operation on†  ª  û n� Árnal detail:.2as_ß @funcJ G ¤$he/ ­ Ðstructor stilJ ral with$Gs of@ å .« Žö = object.__new__(cls)$ t# From ŽO 0REs‹³ist on real²õs, so we can too.5 Tif is¿p(value,5 %):#  /²m = _parser% .öp().replace("_", "")H 8 Êif m is NoneR  context$  ( % S= get (i  ' `return… S õ ._raise_error(CGySyntax,ß  >  ô"Invalid literal foré�: %r" % 0› D  ó °.group('sigÜn== "-"  î ._% I = 1’ ?els1 	1 01 ´intpart = m~ 7int×œ ( ois not™ù # finite numberi  H Lfracn   �') or ''1 Pexp =`(ž 3exp/ 0¦  b ê  inÑ pstr(int  u +j  	 l7 n   e- len(1 ˜ g ös_special = FalsÉ U ŒHdiagn  É  i agáp f ]# NaN¡   ¥ 	 n lb0')).lŽ'J B ”;al'á &  p  ?N= 'NÍ (     	B nB >  ¢|ä Q  Y .'0Y Ð    self._exp‹ = 'F'
  ùself._is_special = True( preturn + 
 õ# From an integer ðif isinstance(value,% %):#  … 1if  Z >= 0    n ©._sign = 0: Oelse1 11 L =expK  Òint = str(abs² /))B  	'OFals(Õother decimal] -D% 1¬  Æ " =;U._expK 6_D%   õ I ?int$ +  	2 &Ârnal workingÂ B �_WorkRep	å   L 	 ä Ù' ?intØ T=£üO.exp' ÿ#ñtuple/list conversion (possibly fG!s_( (x(I ,, )bif lenÃ n) != 3%praise V”ñ Error('Invalid S à size in creat¨ 3of Ž = i	 'Í  £ 2 orS y.  The  K úshould have exactly three elements.'¦ # process y ‹ù test rejects floats4†if not (3 M2[0]ÁB and¸0[0]'L(0,1‡ g"gš RfirstO  L 2the2) "–  P  "'be‚A; eie0 for aI ð positive number¸1? Gnega *."o� Ñ 9[0]» ãQ[2] =€’²# infinity:é[1] is ignoredP  v Ù.'0”  Òõ*[2• E Éöfd`idate ½`digitsËx 1x # >= [  ³  B 0 ¿ 
5 ¡Q0 <=  À <= 9:
       þ# skip leading zeros
'  Âif digits or
 o != 0:1  7 2 �.append( )1 OelseK ðraise ValueError("The second v ÿ in the tuple must "i  –  ô	"be composed of integersV _rangeQ Þ0 through 9."ó "if· 0[2]d ¯('n', 'N')b# NaN:vas formí ¯diagnosticë óself._int = ''.join(map(str,L )›  : Uexp =¨ c 	ýs_special = True, ñelif isinstance(´@[2],kõ Õfinite numberÿ Agiveÿ ½coefficientq Æ  
 Ì?[0]@OFalsçãOthirâ. Þ anj Õ,ô 0oneè 2'°"strings 'F«°Üpreturn @
”û {, floatúÿif context is Non ! S= get (Æ !._T!_e2Fp ¥Operation,�  )  à ±ct semanticg@ mix­ ÿs and Decimals ar‹"enabledôð$ => a.from_V 
Á  ? ._€ 	´ $ Fsign$   %   % i.I iÃ+  	V ålD Typ¢`CannotÑ¤vert %r to 2" %X)&Á@classmethodk Gdef $gcls, f.`"""ConY 2s aL _ 2a dŸ4¢, exactly.h  é0Not?$at� �@0.1)| º  tsame as+ �('0.1').¤  M ”Since 0.15 p   represent ãbbinary«  S`point,ÈM %�is storedx  „ {nearestS - vwhich i¶U0x1.9 À99ap-4.  Theó exact equivalent of the value in decimal
  {is 0.10 õ55511151231257827021181583404541015625.
G R>>> D[ õ.from_float(0.1)$   /('q &'M q w f'nan')- z ?NaND ?infD �InfinityI -Ž J -K ?0.0Ð  F-0')…5"""móif isinstance(f, int):õ p# handlÅteger inputsF  ) ð sign = 0 if f >
 ielse 1& k# 	 ÷coeff = str(abs(f‘-el  ,)):C �if _math.Ë uf(f) or [nan(f1  ° ù return cls(reprx    U @copyÝ ú (1.0, f) == 1.0ƒ  2  % ß  + 
rn, d = a.as_innv_ratio(Ø m  Iûd.bit_length() -lZfn*5**kC — ðraise TypeError("argumamust bý Y‚'."Qáresult = _dec_Øptriple(!, ‰ 7, -€  ifz4 is
$�Y ìµ  Å … – pdef _isü8selÿA"""R5 ‘s whetherù@numbØ÷s not actually one¾Ü"a , – 1ò5NaN 2 s r “ Ê._is_specialü 0exp…elf._expW  ö1if  Z= 'n'7   7
WE6 N6 2j G 03LiÐ(¾ PQ9 eN  § HeQrVE+INF– -i- Xë Fë 0if »  ._•<-=  ¡check_nans0, oWP=NoneüQntext 6‡É h P are n , Ù ´ñ ( À are NaN ret“urn nan
  0ret %0
 õDone before operations.  6"""- àself_is_nan =  •._isnan()1 õif other is None:  „  C UFalse! ?els/ > s 9 !if� X "orƒ  
‚ ¯if context¢  ¦ ! S= get &() $ t J== 2i  % pC ô._raise_error(InvalidOu•, 'sNaN',×  B  	 �y * }ú  – a¥—  ¬ – ' $ P._fixa(5wRe ,     ' éðdef _compare_checkb  s(q ,,,)Ÿ À"""Version oA 9 ò	 used for the signaling c UisonsÅ "e_& �, __le__ t g Vgt__.eSW  'a if eib ¿  í Î…a (quiet} &orž ‚) NaN.  X  ¯ úNaNs take precedence over F  ( ™ RE Š n‹ ;"nd…  h È  B “  }ô yu …_special Äv  +B.is_­
  # 0€ ©_ :  ' p involv{ê e  Ã 
W$elðÛ ¬ÎÜ   ó  Û qc¶oŸµÚ @À              þ'comparison involving NaN',
.  eother)3 ‘return 0
 ñdef __bool__(self):  O B"""R- €True if ! Ñ is nonzero; \ bwise r* bFalse.\  D ôNaNs and infinities are consideredM .x  W  y ñ ._is_special or� Â._int != '0'u Ñ 1cmpÍ ,¡ 
Ô CW�e the two€ ñ-NaN decimal instancesb ½ ç Ö Es -1<k 5, 0 "== C 1Ó H> ð .  This routine_ò
for internal use only."""ã  XE © )Î 6  Ga_inf =Ü  > ˜&y(" * I +  , Œ . ô   
|  V Î0  (elA H@ 
-MA /sel 14€# check _ ¿Rs;  Dõ†('0') == 6-0'aif not4
i  "
  ™ ï ® �-((-1)**Q m._sign†  
m i <  å; û ÐIf different X ‚s, neg osEless–#if›� ! <ù S x �Ë-  Í ; Ÿ ¸ ”_adjusted¢ Ÿ )  .*  � , ž- 
” ‚ Fpadd€ `+_*Rt._exp - 6exp  óŒ _D  ¥E  F  q R 
E ¸ G ¶  
´  u ÿW7 �� F -F c  /el¾: ãy þœ
� Ò Q Qse: #™C â e Ñ ¾ S b{ 	)'´# Note: The 	ö	dard doesn't cover rich žsRl #: ñs.  In particular,o¾ðfication is silent onò< the
    # subject of what should happen for a comparison involving a NaN.
F pWe takeX € followi# ‚pproach:l  W   ==S sT PquietZ ô always return Fals³ ?  !A 6Tru@ _== orF 	`signalÄ BNaN  ¿ ù	   InvalidOperation, and¬  a  t À as above ifF 	  is not tr~d]¡  <, >, <=f >ý (?#or³ Hing)q Í Â ± %r ÐThis behaviorÛ  deIÐed to conformpclosely ³possible toE t”ñpecified by IEEE 754.
# ðdef __eq__(self, other,a ¢text=None)� «$ ö = _convert_for_æ
J Àequality_op=ÒR M "ifn  Ý æNotImplementedq  ( Äš µ   0if � Ñ._check_nans(" ¼ ·  1 F 
 J "mpC )c0!/lt!E4Tans =peF?anso)*< (e(ÿ=)gQÿ>(QuÀ   return otSher
  õans = self._compare_check_nans(other, context)7 uif ans:  N Åreturn False  a "mpR q) >= 0
& Cdef z (' *, u f=None)k B"""C© · 2 to1 B.  R‚ òa decimal value:h  £ òa or b is a NaN ==> D, f('NaN'â Pa < b4  	+ )-1* (==+ 	* 0) >( 
~ R 1""" { Á = _convert_ Gö , raiseit=True)è ## #P(NaN,ë 0) = W 1if nÀ._is_special^ C andU „ ™ 	:2 3 6  %6ansÃ  ž 5._cAí  =�__hash__Ð ¥ U"""x. 0) <™ + 0(x)b # In orderMðmake sure that the 5 T of a-† instancèÛ# agrees with5 ðnumerically equal integYWfloat‰ ñor Fraction, we followP £rules for P — ·es outlinedG !in3 �documentaP õ.  (See library docs, 'Built-in Types').G !ifa"† ·!  BGnan(|     [ ÑError('Cannot» À a signalingœ®.1 B 'elg f øfobjectó 4ÑM *seÄ   a _�   # ŽÅ-_PyHASH_INF(     /el]   > = > } 1exp
� 1expß£ = pow(10,•Texp, R vMODULUSí Œ I : €10INV, -,/._U  0_ =¾l•._int) * \ %’ ç .B ó î  ª ! - - 02-2 2b == -1+ % û�as_tuple� Ñ"""Representsñnumber as a triple : .rSTo shm ¡Ðrnals exactly: †they are# G á  µ ±T— .W,o „(map(intÆ A) 7exp× as_ ' _rÁä   Exä  Ó mfiniteŸ 	àform n / d.

   ò0Returns a pair (n, d) of integers.  When called on an infinity
E ð  or NaN, raises OverflowError RValue ô respectively.

B ó>>> Decimal('3.14').as_‡ …_ratio()/ †(157, 50 	A o-123e5C  % 0 ?, 1H O0.00F 0> ™ 5""" Àif self._is_õ Eial:  ù ! Šis_nan()  " Q ?ð("cannot convertw4 to¯ ("Î  D OelseZ 	ª] Ièb É 0if ‘  ê 
f r\ !èp# Find hð in lowest terms such that abs(Q µ) == n / d;p ð# we'll deal wit3 Õe sign later.* 0n =J .Kzš_exp >= 0» #¹2 isîX  UÁ  œ `* 10**­ .M 5, 1€ yþ od2, d5ð ï ú (2**d2 * 5**d5){ ed5 = -r o  — Pwhile\ P> 0 ai@ % 5Fâ  - yn //= 5A   vd5 -= 1µ  ð"# (n & -n).bit_length() - 1 counts trailing zerosßVbinar'H �representÔnmÐn (provided nv0nonD ù 2ù Pshift  Omin(ª F, d2 �  	; 
  bn >>= Y $2$ 	 2d =·f << d2F k  ¬
o  ª%-nG : d? `def __9!__Ï+D"""RRãs the number a¾`stanceha.¥ð# Invariant:  eval(h 1(d)}d• "E Ò('%s')" % str” ¬ 3str« À, eng=False,·œtext=NoneÄ  Š M  B ƒ 
$Ù Ðin scientific}IMÀCaptures allø  < ainform*  š  ~underlyp p * ¸Ò = ['', '-'][„  ]% æõ . ™:'F' | [ D + '‰'g  % %elm  Ç_== 'nL 	Àgn + 'NaN' +Ç self._int
  selse: # ©exp == 'N'%  0 óreturn sign + 'sNaN' +8  V 2 ð# number of digits
  € to left  decimal poB  g     9 =a  ™ e+ len(H ')
r ¿dotplace is~ 5the‚ 8theG � @ in + €mantissa±   ÷output string (that is,G Àafter adjust$  6 •exponent)( 'ifÝ �<= 0 and™ ý U> -6:/  T# no J ™ required# 
=K " Ìelif not eng[ ðusual scientific( ‚ation: 1É1 onU 

· ¡ ~ 1u ¸a,0'~ qengineeT1noty e, zeroH a ((¸+ 1) % 3 - x /seg ?nonj -j 6+ 1‚5if û  Ë
w Êintpart = '0ZDfrac .Pd'0'*(-L )b    Å#   >é| ‚+e A -V  k   º 5	—â f $[:b ]+ S ó 2 1 :2 !ifr%==g
æ   ?= '£ 
€f contex®K Non ï ! S= get (j ³['e', 'E'][' ÷.capitals] + "%+d" % £Ô6
TD%+ #+í0 ²def to_eng_z
,Ô =Ñ )ó """Convert to a®@, us‘m` if anq ¨Jbeeded.�   E¥ I has9 Pwhich?  a multiple1…3.  This caN`ave up¥ 3es  2 ß 9   )å (5mayJ 	®@addiµ : @eithˆð ne or two trail ï%s.B 5""" –0 m¶__(eng=Truep÷† ž__neg__˜RJÑs a copy withº [iswitchupRounds, !itnoreason¾ Vð is_special:
     óans = self._check_nans(context= $)
0   yif ans:   `return 
 3if D Š is None8  S= get )()@ 1not¡ D andM ú	.rounding != ROUND_FLOOR] ð # -Decimal('0')‚   , [  Å-0'), exceptÀ  Ø H# ine  } Ymode., P–copy_abs(>;els 0 hnegateVT._fix›$Àdef __pos__(Æ,"=l)A"""R @s a › °, unless itva sNaN.zRbös the number (if more than precision digitsæ 5"""!if¼Æ._is_special”  ]�Á¤+ (-0) = 0[MNÑ & iH&abHå_=TrueT 'óabsolute value oûS!IfOñkeyword argument 'l '‡‘false, doœ e.  TheRaexpresy â  ._d1__(,  =F@ êpequival` %to> 3  ÿ 6 &()½µ R 
®EF â ïq� Z_sign¼ jd_neg__Lç©
p¯> f'2ans¦5add¦_otherY Î 1 + 0 žp-INF +  1(orWðreverse) cause InvalidOperat§oerrorsò_ Á = _convert_ ( Ù"ifˆ  ©€NotImpleÁ*edjÿ >  �0 K2 or’  
Œ öÀ._check_nans÷(other, context)
  yif ans:   `return 
 þif self._isinfinity()? ò# If both INF, same sign => !as  , opposite ierror.p  Œ t B 1!= Ñ !._ 4and “  J Ö 
�._raise_w ð(InvalidOperation, '-INF +Ã '6L €Decimal(
% /if™ • I Ý ¡)  # Can't'D be oV here•‘exp = min‚ d._exp,x 6exp“ õnegativezero = 0g$ifð
.rounding == ROUND_FLOOR e á t
ƒ
þú0the; wer is 0,  ¯`shouldÐ � ê, in this caseþ$ ´ 1÷ aif notŒž   :
Ž t      ! Õ W (
M  !  3 E = 1>  ðans = _dec_from_triple(, y, '0', Š3 “ans._fix(’
� 5ansn    ÷ 
œ ;ax(% -Þjprec-1d » :’._rescaleC “ 8 À %p Á 
n Ö À . ¿ G€0op1êqWorkReps8op2 å  1î# Ânormalize(op Ÿ.¦)éhresultX S  b0p1.h ”!p2 
Yq# Equal&mÐ  ‹F 0int÷zop2.intD  ' *å£í? 1 ( õ   ¥ /< ¤ N  =$  o
© J Ð# OK, now abs€3) > 2[ * t _N== 1�u B ož Š œš 2   ½	�Oelsej ½ f   �# So we kÙ àthe sign, and £op1 > 0.
  õelif op1.sign == 1:  # cresult ) 1 7 T, op2# e(0, 0)( OelseR 	0* P# NowK  ¢ €abs(op2)­ 
# « j ?= 0Y Qint =Ó  
 +œ 5intE ’  / 9 -9 : 3expa 5exp âans = Decimal(+  öans._fix(context  ¢return ansî Ñ__radd__ = __
  ó
def __sub__(self, other, R f=None)B"""R[  . " -/ 5"""¸ @  g �convert_ (    z i ö is NotImplementedl /È > ²   0if  ò ._is_special orŒ  
L 49 ¢check_nansš ñ ù « q :ansO   g  #œ  á ²computed as +« Æcopy_negate(q U © ­¥ .0 ³  …ÓrÔ!g! -¥ Ô]ö ƒ .““= )	è ?mul»#*„M  ¹ö%(+-) INF * 0 (or its reverse) raise InvalidOperationù0]$if¤ c §
Ÿ-c = get (; î R¦ñ!._ ^ sHú ˜  if¶
Ì    Ò    ™ —infinity(± #   bif notÜ ]  " a +!._ñ|_error(÷0, '.-'Â M ƒ_SignedI™ [u][ 0  ¾Ç  Æ 2C0 * Ê Æ À[resultsign]3

  ðresultexp = self._ q+ other , õ# Special case for multiplying by zero[ aif notV 1 or V :"  „ òans = _dec_from_triple(˜ ²sign, '0',  Iexp)? P# Fix~ "in– ùthe exponent is out of bounds; z úans._fix(context_ ¯return ansPpowerv %10r !if
Ï._int == '1'	?B Õ  ‚  $ifòŸ (@?intž 5=0op1%€WorkRep(i ¨8op2 %)¯a
€str(op1.ü P* op2
 )Æ N 5« 2 Y€__rmul__¢ _
 š ñ def __truediv__Ó ,„#, ‹f=None)&B"""R� " // E."""~ ý  l �convert_ ( 2î  æNotImplementedm  ½ Ì 
# À   $ifª I *ne? Ç c = get (š Þw ^Ó _ 	i  ò c._is_sƒ$or,  
 «9 ¢check_nansdÒ :ansG   		  Õö sinfinity() andœ  W ð._raise_error(InvalidOperatioƒ(+-)INF/ 'K� u ƒ_SignedI· [r]sQ 9 xÇ 	À ðClamped, 'Division!G 'x n d© ™ i wEtiny() 
›sœ �eó�Ò 
  *
 — { 	¤Ú qUndefinî [0 / 0ß Û D 
¡ByZero, 'xA  , ø â ¥  °¼-|5expð     coeff = 0
   belse:
  ù# OK, so neither = 0, INF or NaN- Ðshift = len(o. �._int) - Cself ù+ context.prec + 1H bexp = 0   #- N  g 	1 ð op1 = _WorkRep(: )! 2! O 
" 1if X Z >= 0 
ácoeff, remaindñdivmod(op1.int * 10**D P, op2 
c ^Z N c -d 
[ &if› ½ ù)# result is not exact; adjust to ensure correct roundingC ¬ 1if 	o % 5 =) ' $ ,+=×^ - � ™ Àget as closeŸ Ñideal exponen Žpossible¢  + _(A3 Pwhile^ 1 < j ? 5andì /10í m//= 10\  á  �  0ansŽñdec_from_triple(sign, str(A ),• èóreturn ans._fix(C!)
X ±def _divide ,4,j)B"""RL * 4 //,  9" %  ),{e ¨ ­bision.t  Þ ÅAssumes that%H 2norJ  wa-,&  ‹»  G �infinite xL ¤ ; …nonzero., 5"""  4, ^u  ._ ( $if #isl 'y(„ <B ¾-Q= minM.=| Ÿ ` texpdiff¯ 0ed(!î . w !if³4Q(._Å  Š[ V<= -2ê v 7/(_o…'0', 0),q  4   v ¥._rescale(ð U.*)§ if·é $<=~@
˜ ´3 ~ a!>=t:expf  Ê  $ ¢ £!**² 4 -3 ½  / é  Ò% *E $2.E 1
 
E 0q, ,
$Ê
, aif q <?oÉ Ë :/q)Î Ç Àriple(self._ósign, str(r), ideal_exp))

  õ%# Here the quotient is too large to be representable= õans = context._raise_error(DivisionImpossible,7 {  '… ‚ õin //, % or divmod')L °return ans, Ù ôdef __rtruediv__(self, other,° u=None):J �"""Swaps - /, R and b Es __P E."""8 * ±= _convert_ ( ¨ "if  ]æNotImplemented‚  n , c  .ˆ Ø �= Þ1t RYc 2 //’ , ‹ KÞ T� $ifÆP*neF
c = get ( f¹ éÂ._check_nans´!ß  if\
c ”(z^  w! =+!._ ^? Æ ƒ ·isinfinity(‘ © 7/._$  ( Ñ ê .ŠòInvalidOperation, '§(INF, INF)P M   ß Þ ´   ;elsp  2 “(_SignedIÒ []ý´ ˆINF % x'½bif not\
ž  _
  ª -·–Undefined.O0, 0*;û ‚  ByZero, 'x~@0', I)I/Yx % 0Gtµ, remainder¿odivide1  c._fix(Þ F!n  	¶�²µO ´l‡ Pc³?modþ ™ ëð % other
       c """
  ñother = _convert_ ( )& 1if  õ is NotImplemented:$  Q breturn, 
 ¢if context@ *ne6  S= get &()@ òans = self._check_nans¤ ,[ 	­ :ansc ™ 6ansW #ifT Ïisinfinity()7 ” ö._raise_error(InvalidOperation, 'INF % x'Œ ‚elif not
] € 
 Fv Wx % 0t  C ;else  Y óDivisionUndefined, '0Z Êqremaind2�ldivideŒ?[1]4 @ c._fix(‰ /¡ ' ­Ðdef __rmod__(w ,OüW=None»�"""Swapsà/ºBand _ As __L .	T {   ¼ .„ Ð 
= ý ù S_near/ Ó ÿ 	~R² ? õ est to 0-  abs(\ - B) <=� %/2@ #È-¶ l!, \sit=True  5ýD#t == +/-ÿL -> ×
¯/._/4Y  æ  	'§® W, x)'*#½ Ô 0Ê !eiÜÑ M or í� ¯Mi ò 	 ú @x, 0ó     ê1• *0• E ˆ[ÈÎ2 _\	qDecimal7 ];ans\f À    # self =ó 0 -> remainder = self, with ideal exponent
   _ p = min(7 . q, other )4 Qf not] :  P óans = _dec_from_tripleO ¢sign, '0',Œ  ` Œ Y  D õ
return ans._fix(context)
j ø# catch most cases of large or small quotié sexpdiffÓ.adjusted() -å  k  if28 3>= ‹ š.prec + 1ý #+  # ‘+1 => abs/J€) > 10**  f ÷ c ö_raise_error(DivisionImpossible3¢ _<= -2”  � Y< 0.1‹ ÆŠrescale(',†rounding‘ Í Ä
nð both arguments to have the sameT%, …n divide¯ 0op1qqWorkRephŠ 8op2 €; ðif op1.exp >= op2 
>   aint *=´(  0 -/ l Lelse= *2.= b  nw = 0q, ­adivmodf Aint,e 6int( #ÜPis r*J
š;Ìp is +/-Ö „ ö #Ê 
4 ð.   Apply correction‰Pensur‹a/#ÐcA) <= ]%/2i Ðif 2*r + (q&1öŒ 
%2r -|i“ Bfq += 1ô@if q¨ ò $ DO <! E®  Z‚sult hasx ®  Àelf unless rWvnegativ„* k ._ V Šif r < 0¥  # P = 1-	 ,  õ  &-rõ ‰OIostr(r)LHðdef __floordiv__(ïîÞf=None)¾ 0"""' 2 //f5"""À  o�convert_ ( Â u Q I€NotImpleù&edf 
É> $ifx@ nsøc = get (9P Ã Â._check_nans¤ õ 	­ ?ans™ 9ans— T ·isinfinity(6 Ð ø /._$  ( µ¼ .ÁÀInvalidOpera£ð, 'INF // INF')
    eelse:
 	 òreturn _SignedInfinity[self._sign ^ other %]
B bif not 
X 0if @ 
  p m õcontext._raise_error(DivisionByZero, 'x // 0',q  B   x ª 
¸ )F 
ž 
ÒUndefined, '0¡ )à … qdivide(=#, V 3)[0Cðdef __rfloordiv__(7 ,P0 f=None)J�"""Swapsa/\ R and z Fs __Q E."""÷ + ±= _convert_ ž "if€ ö is NotImplementedƒ  ƒo , c  .‰ Ú = 8Sfloat
ï F ù  representationÚ n‡._isnan(>  ª  ?is_  # †q ValueE‹@"CanÛ+ Ñaling NaN to ® "7 F ´s = "-nan" t @ m  " *  
Q > 1str*X Ro )(s1/in/Cß! ¬ ð an int, truncatÆ  º�ecessaryKŠ_special§ Ú l MC{integerE'elb i�Óg 0OveAw·@  o  r`(-1)**x4¡† Šexp >= 0˜Qs*int³”._int)*10N 5expM î@ "[:Š ³exp] or '0'ó!__¾`__ = _k "__u‘@propertym  KAreal“ o ?elf7 Oimag7 “Decimal(0�  f Ÿconjugate4  É k  . @__coJxá›   (êGelf)n P_fix_Ü W á õ"""Decapitate the payload of a¶!it €/ =XÎ¿  lð# maximum lengthU 1 qis precº øvclamp=0µ#  &-1" !1.² _ Cmax_O d_len =,.Z % - \ 7  if� (: 0) >¦ I Àad_len:
      £payload = 
 S[len( c)-max_ ó_len:].lstrip('0')
D  ðreturn _dec_from_' äle(self._sign,c ",  –exp, TrueJ F qDecimal= !)
h �def _fix ±, context):  ‚ ñ"""Round if it is necessary to keepx Á within prec bision.f  I F ÷$s and fixes the exponent.  Does not raise on a sNaNC –ArgumentsŸ  ó 3 - Ú • instance¿ Ñ $ -Û e used.  6"""£ !ifË Æ._is_specialj  Ä ! Gnan('    Ä# decapitate™ ;5z  .   œ É .Š_Z · Â * Jelse�   #´  ™Ó+/-Infinity; W Ÿunalteredx : V ì  Y @zero¯n°ð	 should be between Etinyßj `# Emaxþ �clamp==0,  2 W Etop( 1 V =¾. (:  'op !ifR \
9@exp_œ 3= [k.¬ ,Š ] ¸ ]Ñ  ònew_exp = min(ma:.  > Piny),' _ §  :  � = !!=µ6 
™  ) ’ _
€_error(CC*edS  . é"
S'0', º 
B TT ? in Æösmallest allowablÙ0 of:… result,Kp# equalCD´adjusted()- N$+1Y> €  = W ß†._int) +Xó.F < "ifŸAin >ï
�»# overflow:( 3 if ©  C 5max]  ‘Fans ’	ÅO[ �, 'above!'¹ Î
ž	E Inexact* s4Ü6ansù Bõ¥ubnormal =ý <Úã 	/ 
Cž®g 4# rK r ü has too many digitsg #$ <Ž 
i 3  � Z  ¤#ifp J < 0U   ž =v2'1'éÀmin-1)
       ¶digits = 0
 õ  rounding_method = self._pick_ ôfunction[context. ]M `changeE   W (U ", „ )4 Eoeffw Rint[:' ‰] or '0'. 4if e I> 0:  × cN qtr(int( :)+1t  * cif len! 4 > Ú NprecX  2 L 1 =  J[:-1ý  #   Ùexp_min += 1
¡ õ# check whether the€q pushed ðexponent out of rV	J 4if g n> Etop²  aníÖ ó_raise_error(Overflow, 'above Emax',úJsign/Oelsea ñ_dec_from_tripleê ._E ,*,« )” ò Àappropriate ; ùals, taking care to respect#>  ³ñedence described in  4 Pifica¿	< K1andý Þ_is_subnormalò M2UndN
4/ifR &S‚ R ûš zInexactF Ä R*ed* ®if not ansp "# ¼ÄClamped on u ¬
d x ? 
x `returnx 0N` JûÀ# fold down  Â d == 1 Ã has too few³>  2 c: o._exp ’Ÿ ÿ  *Q_paddH  p._int +*_ g -ù<•
 S a ,C ß a# hereºñ was representabl…Ãbegin with; ©#un—F  qDecimal³ ü }`r eachØ	 crs belowt2#  � óis a finite, nonzero a x  *   * ðn integer satisfyHQ0 <= # <ú [C#G � � ä As ei²`-1, 0,™P1, asK3low! ƒ P1 indnres that¾ ƒshould bïÀed up (away ; Î † O   0D ¡truncated,³g 0allïð
    #     digitðHs to be truncated are zeros (so the value is unchanged)
    #  -1 indicates that there E 0nonH m digith 
C ñdef _round_down(self, prec):!  h ñ"""Also known as 1 µ-towards-0,¾ E."""7 €if _all_… sZ ]._int_  c …return 0= Felse‚ # --1º !up^ Y @"""RÛ Ùs away from 0£ w -÷ .i _half_n g5 up (t )o @int[h Ï] in '56789'ó 1UVì 
\0 5 % á p_exact_D ›ù-ä ú6|Z  Š @)¨?eveÐ¼ 0to ( `, rest‹0nea 	& tÑ e and \¤ ¬  (œ ’ == 0 or ½ ó"-1õg02468'k 9 •:qceilingŽ) ¹8not1ß if negative.ÊOsignºö ³ '½ ê å9 e´_floorÔ  y   (Ö ²( 0Ô Ó  )  × f/05eur unlessáµ sq5Ã� «Ý ‹ ó  „/05�2 Ç<R_picktñing_function = dict(ë %ÈROUND_DOWN =¬," &UP  ,up XHALF_#  œ_( 
m *  ET 7EVE™ , Rž qCEILING£ Àound_ceiling3,
  üROUND_FLOOR = _round_floor$ F05UP# B05up" !)
M Sdef _@ ñ_(self, n=None):!  q @"""Rb    ð to the nearest integer, or òa given precision.i  H ñIf only one argument is supplied, É õ a finite Decimal‰ �instance‰ 	R.  If! Sis inK %orF Pa NaNÄ ðn a Python exception� jraisedI G D ônd lies exactly halfway between twosl iì A ê  ed3 NFp with eA§last digitB2>>>$(Å('123.456'))\ 5123 2  ˆ-456.7893 O-4574 
93.00 b 
82.5- 2Z 	3, 4, 	8InfX ðTraceback (most recRPcall ?ÃU  ...[ òOverflowError: cannotY4 an5y0 E ?NaN‹ 2_Valueˆ  ¦	<†a second<®>Ÿ"isÉ \nÄ dLÐ places using™.   `mode fÇ¥he current? hcontexŒ2For- # n¾E0-n)KpequivalŸ%toU  ± —.quantizeÓ_En'))÷6, 0ú' À 76, 2) @ ?.46C -D ?E+2B "-IŸy'), 37ˆ  g0È  psNaN123A  I5"""P 1if C þ ôó ¯#Å-©‘form: use6ÑÁ y\  B  ` o÷¹0(n,	™ ) !  tB Typ;('Sì"toª  should beJ Wegrale M 0expòödec_from_triple(0, '1', -nh / areturn2Œ3exp" # #³

è imÊ._is_specialG! is_nan(ü 
&("’Ànd a NaN")
   felse:
 
 õ raise OverflowError("cannot round an infinity")@ Pretur ñt(self._rescale(0, ROUND_HALF_EVEN))
7 Ñdef __floor__6 )� B"""RS Athe % @ of \ B, as† bteger.N  ¿ aFor a œ óe Decimal instance< ©  V �greatestŽ  @ !inR ñ n such that n <=; B.  I� 4 is!e s 5NaNE ðthen a Python exception5 ]d± 5"""8 i] Æ._is_specialž ! wis_nan(-    ` o ValueºG NaN´ 3 ]ZFLOOROceil $ ?ing>eleast ø� >  øB  ÿxCEILING1fmaþ÷, other, third, context=Noneíø"""Fused multiply-adT7s´*R +Q ‚ with noÇM  þ…rmediate¿wproductF · †B and± D are� ‚ied togeÉ r  a  z Âresult.  Theö P operZ #isQ!ddS    0 ,D  ) €a single÷&alÝ €is perfoÚ .2  q Á = _convert_ ( !, Mvit=TrueèK4  4 i £# compute W;^ � InvalidOõ %@f ei=	G  í @gnal¾0NaN}!ifY  f•zero time¦yf  F ô {
Ž a  ‘
› J! S= get (9 # } ®exp == 'N'H ¡B !._ˆ!_eŠ0‘, 'sNaN',¨m Ö À_exp == 'N':+
  ù-return context._raise_error(InvalidOperation, 'sNaN', other)M ùif self._exp == 'n':!  y ‘product =, 	 BelifX C … D 
† F†  bif notm ¤  ¨ 	ƒ  >  ú'INF * 0 in fma'I > (ò_SignedInfinity[Þ bsign ^Â  ._ ]† M
 U 	b@0 * 	BJelseÖ Wðdec_from_triple(J
X,X œ sstr(intI pint) *  § ._ )N K+æUexp)
Ž ¢Ò ô .__add__(third,Ï0 ñdef _power_modulo¥ Æ",  5 f=None)9ð"""Three argument version of _X V__"""› ñ Á = _convert_ ( ëîÀ is NotImple^ &ed{  ké > þ ³ d  	e  f - Ë $ifKA nQ7c = get (v ½ ð# deal with NaNs: if < N`e any Rs ön first one wins,ñ# (i.e. behaviour forP  – ðidentical to that˜6fma Üs_is_nanz†._isnan($ `%  &  '  ( ) "orÅ :  
ò= J== 2!  Zt¸@ B  	 2 * ¯²  â– ^•— 	J˜ À   return coÿntext._raise_error(InvalidOperation, 'sNaN',
  ymodulo)0 ù if self_is_nan:  W areturn$ P._fix& 1(co  J _otherK % L v ± ,  § ð# check inputs: we apply same restric.ös as Python's pow(¾ €if not (	õ._isinteger() andk    À ' ¼ ( )_r[Mí‡  ‹  'Ü Ñ 3rd argumentÞ Ÿallowed 'J ¥unless allK cs are !)s'DO < 0ç X'2nç 0canÈ/beå Únegative when7šspecifiedè  d Þé X	Ðé E0')
Ñ`# addiî(alüñ for decimal: the ¿ °us must be èG õthan 10**prec in absolute value* "ifJ ôo.adjusted() >= Ó ? $R�insufficiî v bision:èÕ÷7 î0hav41re L Œ ` digit2>ñ# define 0**0 == NaN,¬õconsistency with two-— 7powD ù(even though it hurts!™ Ã �1and ê™Ró at least one of‘51stR¬ ¿ 	ò¢¿be nonzero;M v!is‰ èZ@compô@sign¼ eresult! 1if U 2 „(ß7 5= 01 Jelseu#  Žð ._sign

       ñ  # convert modulo to a Python integer, and self	 £other to
  ”# Decimal1 ðs (i.e. force their exponentsb …be >= 0)C } ¢= abs(int( )" ðbase = _WorkRep(� A.to_¤ §ral_value(2 r 6 ¼ 7 Œ  ômpute result usingÜ ] pow(— (Ÿ d.int %I** A10,  Cexp, %))& u ô for i in range(¼ e.exp):&  q N ! =]    , c /)   	% Q 5intˆ 
0 ñreturn _dec_from_triple(sign, strá  ),´5 ñdef _power_exact�!, `(, ´  """Attemptú"co[ ¿!**/  A 6ly.� TGivenVs{ ŽažU p, aa �  'i "an` Í i0the@!erZ ‡ …, with pB òdigits of precision.  R*xNone ifA u is not@ × à representableã"p [ ñ ð	Assumes that elimination~ õspecial cases has already beeno ¡performed:• «ómust both be nonQ ;(   E basitiveA ðnot numerically equalÈ"1;ì ? 5 beB ó	nonzero.  For efficiencyÀ._exp should. “ ¥too large,F "so@10**)< )gpa feasiPacalcul-F."""D@# In|Q commyðbelow, we write x¡# <låy “ %# & Ž 3  WG P= xc*« x6 ² by) = y #ye]'xcO  ÇSyc popÊ!erER diviá Wby 10+ð# The main purpose¹ °this method!±to identifyá —*failure*€ pof x**yÎ"be%+ly®�as littleÏgort asG 1pos© P.  So]Alook>QcheapG€easy tesþ&ha##ì' €sibilityÕ Ÿ  be~Mp.  Onlyx7all„ Sthesea Áare passed d� Pgo onæ AactuÆ ` 	ZPHere'†a�idea.  ExÂ@s y }! rn alsber m/nàmî ˜ @n reœ’vely prim Pn>0. Çn( ‡    †C 
>–(at *any*”T), xc‡ínÇ › DaL kÀve integer aó"nd xe must be divisible by n.  If y is negative
  õ# then additionally xcI óa power of either 2 or 5, hence   O qof 2**n& F**n. 
 ý* There's a limit to how small |y| can be: if y=m/n as abo¹ :U 
 P  (1); rxc != 1ã 0for	 a resuls Ðbe representa-w!ô	need xc**(1/n) >= 2, andÿ 1lso  ´   X.  SoŠ  F !ifÔ à<= 1/nbits(xc)Œ nk<0 ,<=? 2~ D|y|)v ‘  r 1< 2�  thÊ ×  ä,otC 	ç “2 (24e4v0, |xe|÷ R1, so  z �>= 1.  H,ifp  # @< 1/D é £ 
{” ÀNote that sinxÃ€ot equal6ð 1, at least one¨ ü7and“  Ú ²apply.  Now’	‘ if¨6c|*¤<F €10**-ye ' ¨len(str(|y/ �) <= -yeÍ ô 4ùslarge y÷Ô wif it's‡ @posiÂ:X´ normalizedØñwill have coefficient¤'y,G  so! \ 
‰ V  —`**y < ô pñ(y pp/log10É5 y*  ,pN 	ü„ nÊjxactly… '.
& 4if o¤abs(yc*xe)ka  ´ ;-yeí ’/xe2�  ¸  Ë# Similarly,ˆ P)*xc_¸Ž pimplies]Â  
TÜ õx = _WorkRep(self)5 0xc,Ðå= x.int, x.exp Pwhile<–% 10 == 0 µ •xc //= 102  fe += 1\y€ oÞ� ¢yc, ye = y� y�  ?yc � y� y� €# case w Ï T== 1:É!isÐ(xe*y), with  Ô  # required
bÙ… integer$ %ifX  Y*= yc  Q Ew ! *
 Pye); • %u 9ralM ¤e#† ¨   +    6e <íÀ          re·turn None
  úexponent = xe * 10**y# ù if y.sign == 1:?  J C - 	% ÿ # if other is a nonnegative integer, use ideal D B C._is4 b() andY $._¡ 0¡ W _W € = self. Q*int(š )²  × Äzeros = min(< -K Z, p-1: Nelse‚ L 0f !re”ñ_dec_from_triple(0, '1' + '0'*; ,- %)
I à# case where ya\ñ : xc must be ei€wa power> ƒof 2 or  e of 5.  ü	‘last_digi=Zc % 1à 7if $ Îin (2,4,6,8)"ò# quick test for¨  Ž 2�  –   ifÚ ¾& -xc != xcO  ' _ó  P# nowF ‘l 0; eC5itsr öe = _nbits(xc)-1Œ Z   A# Wea ?hav #S ´#   x = 2**…¡xe, e > 0,æVy < 0˜ f   K þThe exact result is!9 ó  x**y = 5**(-e*y)€(e*y + x ¼  ð provided that both C  ¯ E 5 arú‚s.  Note+ /ifN  � !>=¡pp, then ä Bcan'é�xpressedI  e¡ly with p ¼søŸprecisionbQUsing~ ñabove, we can guard against large valuee /ye^  ` 93/65táan upper bound€log(10)/ 5), so !ê  ú
  ye >= len(str(93*p//65)®C ^V  0   ( j  -y ?1 > q p65 > p*¿ Ç G   ë ÷ BÀthe coefficiº!of‹íK  5 inÿ.¿@emaxÏ Ã’st e such£5¤<ˆÑ: `= p*93p�  Q	š 1 )  ›ÂJ b# Find€ -Z;möÀintegers
     øe = _decimal_lshift_exact(e * yc, ye)
2   x7 x8 	õif e is None or x :d  h areturn/ 
! M o> emax>  N  šxc = 5**eX þelif last_digit == 5] ð# e >= log_5(xc) if xcÙ ýa power of 5; we haveº ý# equality all the way up to xc=5**26588 vPnbitsv }*28//65& ðxc, remainder = divmod(í N, xcÎ&if0 í  6ˆ   Pwhileÿ 0% 500C ~xc //= ¯  L je -= 1‹  ð# Guard against large valuesd‘ye, usingD@same•�ic as in#' '«ñ2' branch.  10/3Êÿn upper bound forO  €log(10)/ =2)."  œ­ = p*10//3 Bif yJpen(str(0 /))A„J Çå2Ç / NelseEA¾�>= 10**p9 c   J-e-xâh  Vð_from_triple(0, ä†xc), xe)îp# now yvöpositive; find m and n such that y = m/ÛCw m, n = yc*Õ  (15 ae != 0q l�ÿabs(yc*xe))) <= -yW  0xc_ª `³ƒ  %  u cu 1u  #)*@ z  ü ,Ò,(-Ã³Pm % 2²n	 D ¥ m¶2¹   n  W 	 W 	 W W 5ðcompute nth rootøx×yŠif n > 1¾#šð1 < xc < 2**n th÷en xc isn't an nth power
   if% ù!= 1 and xc_bits <= n:)  4 Éreturn None
 ðxe, rem = divmod( )n)$ !if# O!= 0Z ‘# computeÀ aroot o³ ùusing Newton's methodq  a Ö €<< -(-_n× ù(xc)//n) # initial estimate: ®while Trueª Gq, rè ºc, a**(n-1)ï  0@if aKqG   Ybreaky   ?elsw     Ñ "(am @ + qÌ 	? áif not (a == qÑr .0)� Ì ]  fxc = aßú# now xc*10**xe is thŽ  †original* š ÃmƒÄS l ðif m > p*100//_log10_lb¹ w n /   p, hencev G*m >t  ¯ p Ÿ `result½  !årepresentable.5 >ˆ 
KGCUxc**m[ fxe *=  k O0**pR @ ð # by this point Ô Ù*is* exactly Ú > Radjus7 `exponeD ào get as close	 ±possible toc WidealG <  , k…ecessary! Astr_ý 0strž ñif other._isinteger()� Asignª
€ _v € = self. Q*int(= 
wú zeros = min(xe-A ‚, p-len(¨ ±tH 0Ä êò_dec_from_triple(0, P Q+'0'*8 Q, xe-
 )ÝÀdef __pow__(Ã ,�, modulo=R‘, context ²B"""Ry ; 2 **= C [ %@ "].g  ÄðWith two argumentsY C @ !**62 Ohree4 ° 5 )r `.  For$ tB ` form,! p follow®ð restrictions on ? ¯ f hold:Ñ z - all _ 0s mÐ1be Or¦# - " §nonnegativæ@- ei’R3 or4 •(or both)` 0nonÊ¨ # -u" Ït öhave at most p digits,B �  where p� žù§ precisionž`If any1PtheseöD°is violatedMà InvalidOperatSion
  õflag is raised.
 ðThe result of pow(self, other, modulo); õidentical to theC ? ñthat would be obtained by computing ] !**] 5) %C g ð with unbounded precision, but„ J fed mor� ñ efficiently.  I* Õalways exact.h 6"""û #ifß  Z •not None:,  :preturn ‚._power_« (Ã  ¦, context)^ ! Á = _convert_ 8 )e "ifj ƒ ïNotImplemented‰ D d $ify @ ¿ – c = get (¤ @# eièP arguw  G „a NaN => is ² Sans =¢check_nansØ  >  oif ansÍ 6ansË €# 0**0 =l r (!), x ð1 for nonzero x (includN¹+/-InfinityR Ì*
w 0if   Í
  ¨ ê%!._)ñ_error(InvalidOperat�†'0 ** 0'w  D ;els@  Z H_Oneï 6ãhas sign 1 iffX †is 1 and!åan odd integer’J _5 5= 0 iO J== 1÷ |C._isT *()#  À 7Q + Oeven(  , 
‹ 1‹   £# -ve**nonƒ 	:  > k# (-0)) 0 3  Ò  P –ð[  B    'xy¹¡x negative·yn$an°-#. eó,B `out doÚ€any unwa	  r9ing†  ÆˆQcopy_| eÞð0**(+ve or Inf)= 0;g"(-  >0) = Ea ó d 
>3n:= 0!  [÷_dec_from_triple(�, '0', 0@dSignedñ[N ]X:Infö á ;æ ,**û .  Uæþ ¯ 	 & D¸à# 1**other = 1ñ, but the choice of exponent and sflags
  ±# depend on / �of self,8 Áon whether o Gis aD ú	positive integer, a nega `or nei@ ; if • == _One:  Ÿ "ifn C._isY *()#  ' #ä p = max(³ `._exp* Aint(° i), 0),] : ñ 1-context.prec)@ evaluatingÏ A Ÿ directlyE  òis dangerous until we knowÀ ¢ is small M C  Äcould be 1e9 )( @sign51 Ù ímultiplier = 0H $elJ 8 > N / Y  sÄ Ž   	’ ˜
C Axp ={È6 * ; - ià: < ÈÇ eZ 
* R  ¬ ã ú_raise_error(Rounded•/elð @ zInexact@ n  . Å 	Æ ðreturn _dec_from_triple(result_:ð , '1'+'0'*-exp,@)Šð# compute adjusted! Eq  pD_adj³2 (P  & À ** infinity t> 1, 0 5< 1f # B -7 sO C <C >C ñL‡ M#if¡.& ` 0) Wç ?< 0‚ s 0'†Õ Î@O sSignedI5[Á]® å‘ here on,Å* ñ always goes through Ecall‡ ²# to _fix a;õf this function./ ¥ans = None Øˆ = False™  crude testd ²catch cases˜ð treme overflow/_
 U.  If^ q# log10ƒ!)*Î� >= 10**b“ 
 ö>= len(str(Emax)l#ø n5 B 
/  X  9 !+1U Fhencæ „*‚ h u+1), soÊ Â occurs.  Thÿ Í Efor ê  vsimilarbÌ ý  Ñ_ B() +U.kÀd()
        ðif (self_adj >= 0) == (other._sign W0):
   # 4 ‘ > 1 and . ‚ +ve, or < ;-ve@ ùpossibility of overflow& €if bound˜ ûlen(str(context.Emax)–  ¡ ñans = _dec_from_triple(resultÐ x, '1', I 5+1)y Oelseí -í +í 2undî U to 0z  ¿ vEtiny =ž   (ž  $ -9 *B E-1)
‘ ò# try for an exact Hõ with precision +14 0if ƒkis NonI  =�._power_U m’ X 7 + ”ö  @ ois not]  $ ¡ é ¹1Ë %    J &  1,½ S._int
 :exp} > ¶ x = True.âusual case: in& � ö, x**y computed directly as exp(y*log(x)l H	p! -} � xÿqWorkRepÚT  ¡c, xe = x.æ Yx.expA  _A Ú
B Pyc, yB yB yB Tif y.;‚ †yc = -yc< š #C corrÿ#edw�:  start)3,Â ÷ # then increase©SuntilN ñ is unambiguously n :abl¬™extra = 3d Qwhileb`coeff,Ù Œdë!(xy", ?A, p+Y 
\ 1if A ¶ % (5*10**(ýŸeff))-p-1ë > Ybreakª   k   +Å 	 µE", v y Ó 	 `unlikeê A, ln`log10,‚ ù ` funct&€respects † #vðing mode; no need`switch
 ùROUND_HALF_EVEN herzT ñ 's a difficulty%   w
'Ç'ò =a@tegeÙd‹ 7theÁ¡.  In thisÙÙ  È PificaØ @ prequireâ  atç # I÷flag be raised (in spite of@ r ñness), but sinceH ’ Á $ á _fix won't doŸ G  ²pus.  (CJ¢spondingly¾ ÐUnderflow sigónal should also
  ò'# be raised for subnormal results.)  We can't directly2 E ù)these signals either before or after calling _fix, sinceC Aat w¢ òviolate the precedence  c Ù.  So we wrapE 0e .` m ñ in a temporary context, and re÷ = ¦ ewards. �if exact3 Pnot oÛ å._isinteger():-  Tô# pad with zeros up to length‚ .Ö û+1 if necessary; thisL Áensures thatsRoundedkV willÂ·  Š  ifv Ù(ans._int) <=€ 
¸  2 Šexpdiff ( j + 1 -L 	§  ; òans = _dec_from_triple}   tˆ S+'0'*j ,H  L   Å Cexp-9 ))
: P# cre2‘a copy of-tcurrentö ,—Pclearïšlags/trapv3new)	 W )()u ( .S  _fQ %  T�exception�_>als~P • [8 \] = 0ò r
 R  &4newæ 	¤ —>Ffix(c A1 Inî ®dž¹, Underflowa R !._C s_error(I 
2ï]./$[Sq]
	] ‹ Æ `propag
g | !PorigiÛ;†  cp	Ñ U# hav!anM"Ovû %, º 
Æ#E­Ä, Clamped.  J P needØPe corV† áarguments.  NoTorderã$-s =iø�tant here»‹œ Š 6
ä0 à, 'above Emax'<!s.ç
þÇL> PÆ   YÊ 5 QJelses MJ 3 ¢return ans­òdef __rpow__(self,?,¬W=NoneA�"""Swaps - /kyY As __L E."""/& ±= _convert_ ð(other)
        ÷if other is NotImplemented:
  breturn,   ó.__pow__(self, context= !)
5 Ûdef normalize* VNone)u D"""N* ð- strip trailing 0s, change anyth ¡equal to 0 Re0"""v  Ç $if“ ê &nek    ¨ c = get (¶    0if Ù Ê._is_specialA Sans =$ ³check_nans(K  M  jif ansH   X6ansÁ 5dup` 4fixY )X 5 `if dup¡ —infinity(O " W 6dupW i‘t: 
‡ ,  _dec_from_�1le(c Æsign, '0', 0� ³exp_max = [ö U.Emax….Etop()] eclamp]Á ’end = lene 9int\   =¦ U._exp3 Rwhile Ðint[end-1] ==œ   and exp <  š 
â   E+= 1M  # „ -   `:end],n 9 ïVquantîàexp, rounding=ô  ³C"""Q= Xp so its` PonentÉðthe same as that of  .ápSimilarÁ±rescale(expMñ) but with error ¾Eing. J    7±= _convert_= L ã, raiseit=True 1 z$ ;   %if/ ñ  2
ÈM$ =â. ¿ 1 or+ÒÂá¡« Ï0 …&is² – ¨ 
ò <  ò=  A ÙqDecimalŒñ)  # if both are inf, ii%OK >   B !._ _Dý(InvalidOperation,>  B  '1“‡one INF'Q#· ‰ñshould be between Etinyû |v ç6.' V() <=M <A < Š ¨ î .p'targetp ¿!ou¯bTs in ú í ¹  Ö
p  ) '._¡b7exp«À   return anós._fix(context)

  ðself_adjusted =  . %()( !if + #> M e.Emax:)  X ereturn! ù_raise_error(InvalidOperation,:  >  ð 'exponent of quantize result too large for curr) £ 'È ö - exp._exp + 1 × Oprec× RË 1hasÏ ¿many digitsÕ ;4ans¼”_rescale(× ©, rounding7ansèø Ï�@len(Í W_int)È À™!# #õ appropriate flagsâ0if å0and º<hJEmin² .‚�Subnormal>é
M ƒ !%
  ´m vInexactk * R¦'edœð	# call to fix takes care  õnecessary folddown, and4õ# signals Clamped if 5 '  X=V
$ ª   rÎ2ans7‘def same_¹0um(4„, other,�f=None)%B"""RH @True‰  6  ¯ 9 ‘ have the[  ”ë; Ewise° � bFalse.“  § PIf ei„   o\ñnd is a special value,b ðfollowing rules SFused® S   * h ° Dboth[ 4 –infinitie§9 ;NaN3 = æ ,w ß  Ú   5"""- Á = _convert_ ( ,J0it=¸ wÀT._is_"or^ 	Œ â–.is_nan()µ %orž  ®   ä % *e=  ª w; ‘$==§ 2expð ƒé * ,2êð:
        """Resðcale self so that the exponent is ó, either by padding with zeros
  o! ptruncat$  digits, us  Y ¡given rounE emode.
A ñSpecials are returnedj öout change.  This operation i‚ óquiet: it raises no flags, and u binform> @fromô … wcontext— Pexp =Q to s2õ to (an integer)= Ú =å ! 5""" !ifzb._is_sû :  T� Decimal(§k aif notB 6 P_dec_Þ q_triple? À._sign, '0',Ò )}Ž  ï >ð 
X #üq answer•ÿ ‰ �ecessary¿ ‰ 		0  ó   ü p._int +½ *Î  ¬ -É Ï ²# too many ‡;’	Ólose data.  I†Åadjusted() <— #\ £-1, replac+ðby 10**(exp-1) befo±Ö= x c = len° aint) +µ%._½ 2 #if­ J < 0~ ? = M	2 '1Ö&-1' Q‰ 0j ‘this_funcC=’ Tpick_Ä [ ]? ŒId = I æ ,Ä „ dcoeff e Rint[:“ @] orÏX #ifçjd == 1G qtr(int( ')+í 1%
6 .Bdef õ ¿ ê"s,0Fing)‡ @"""Rç` a nonÿ,	 ¾ª (õa fixed number ofä  ‚ïificant figure#€Infiniti4 ANaNsÏ ˆ 5—unalteredÈ8 0º 8 0äO< <=Ó¤ð ValueError("argumxóshould be at least 1 in¨"[¶D T
P5ans£!reç.2+1-Í #w¦can happenMM  ‘sl S  ^i;G èfor example wh/P99.97]/3 E .D W8  ›Ž `s we eð p with an extraó 0 at the end of
  # õnumber; a second rescale fixes this.3 ÷
if ans.adjusted() != self :.  h Qans =5 _Y (B õ+1-places, rounding)B `return? 
 ðdef to_integral_exact(� > á=None, context )” @"""Rg ás to a nearby Q 2er.f  ¸ UIf no’ ñ	 mode is specified, takeB· % Afrom¬  F  v‰ ñ.  This method rais_!e � ‘ed and InÓ e flagsG ÷when appropriate¨ ™See also:ñvalue, which does W !ly± fsame a_  ä˜ Pexcep/Qat it< 2n't¯ ž $orµ 5"""° "ifA_is_2&al‚  ¸Ó._check_nans(+=  4 |
H   $    qDecimal$P ¡ Šexp >= 0W < 1notá 6 P_dec_q_triple{ é._sign, '0', 0‰ í  ^ º
T  S= get (? ~>is @  =. ®�¤0P	n  , ó© !._Ùs_error(ÎB Â 
&  & 2ans�öÞW¦ èö • ø4estù‚, withouéRing i‰a ;ed.àÊ ¶gÃdÁJelse`3¦ÐÔdnèPchang°Òbut we provid5Aold 2ñfor compatibilityR o. =e¢4sqr‹”|Ñ ƒÓsquare root o1e0µ À    if self.ç_is_special:
  óans = self._check_nans(context= )4 jif ansH  S `return 
0 a óisinfinity() andx Ÿsign == 0S €Decimal(G )] aif notF 
; ¥# exponentÝ ù	exp // 2.  sqrt(-0) = -0ª ñ_dec_from_triplew  ._§ a, '0',r $._S 
T._fixK
·  É R  ù 1¾ B |ò._raise_error(InvalidOperation, 'Ï §x), x > 0'j â# At this poin*õ represents a positive number.  Let p beð# the desired precisioèdgAress1 in* Èform c*100**F hwith ct Crealy Ðe an integer,+ 8nd B ñbeing chosen so that h Â(p-1) <= c < qp.  The“ Ë ó(exact) square root ofÀ s@c)*1¼ ,•   _ F $<=* o B**p,� –e closestfSable Á7 atF Kbp is nv ñ where n = round_half_even(êGc)),E  œt ;5 toŸ u $  A \CF »@casefa tie.  
 ò To ensure correct¦  ™pin all E �s, we use> `follow- `trick:& acomput* 	— toWextraB wplace (< +1 instead»  &),œ GdownÑ @, if  p result„!in ùÑits last digi h0 or 5~€we incre8 f0 @to 10 6_ 0pecf0ly;t Git'sÓ s rwe leavH ±alone.  Now­ RfinalÙ 7 toG !p ´s (or fewer’ ’ ãunderflow) wilE B Ò!ly ws öappropriate flags.„#æ1an ©,&of(`  š4 = ×  (+1I °write argumº”	O$e ´eexp//2d #Å ‰p'ideal'¡,b“dƒ $ i‘*lyÄD.  l^ - S' s' Gc inŠ b3100«l«l™Ñop = _WorkRepx] õ 0op.vE>> 1j 3if  (& JÀ   c = op.in‡t * 10
  õl = (len(self._int) >> 1) + 1* Uelse:  ? ©c = op.int  O 
N !+1P 
' õ'# rescale so that c has exactly prec base 100 'digits'? qshift =' %-l 2if  L>= 0«  *=L !**" 3  Ç u u = True î  ò, remainder = divmod(c,W -X )@ Y 6not; " Be -=° õfind n = floor(sqrt(c)) using Newton's methodL  1 @10**8 QwhileÖ 
…q = c//n)  ¬ šif n <= q,   Ybreak-  (  … Rn + qí    _ aß v*n == cø "ifû
} &Sult i;7öto use ideal exponent ¿ y   Ð# assert n % =Â ™ 
 , @n //@?2 q"**
?$ +ú +   Rý  A?±; fix last ý as described abov Þ 5Ö 
] v n‰ 1‡öans = _dec_from_triple(0, str(n), e). �# round, Ô°fit to currŠfcontex  z ö ._shallow_copy(9T  ì#= 5 d._set_ ö(ROUND_HALF_EVEN: ¾ “ans._fix(>    .J " =Á 6ingÕ ¢return ans qdef max„, other,™ f=None)WA"""R? òs the larger value.N  uLLikeS ð ) except if oneñ ô`a numbr — sGPNaN (xwsignals9 ÂsNaN).  Alsoá %s.8 5""" Í  ð�convert_ ( Ø, raiseit=Truõ$ifþ  ¥    Þ ec = get (5 •fÂs_special orY5._i 
V 2# I@oper÷ °is a quiet    s¼  ™ 8@then�õ  ¤ #W ) ralways `eR ( sÒGsnan¦  o r  ¹    ë nÝ nÎ  = é —1? k µ (   �  Š Û &   s 2== V  ¢ ð= 0:
             ôreturn other._fix(context)
#  + ñself._check_nans(< %, 8 9 Cc = . "mp' V ¥if c == 0:0  i û+# If both operands are finite and equal in numerical valueG ûthen an ordering is appliedr 9 ðIf the signs differ bn max s ¡ P with H rpositivJ º ?minA 
U nega3 
O 
  %¥  ! 0ame‰ n � exponentù pused toŽ;ectL  ; Ðresult.  This2 qexactlyJ CG ùin compare_total.O ô	$ ý+ þ*-1�Rans =Ž, Oelse&  [
& šK ansÇ" €def min(4 ,` ²f=None)b A"""Rçrsmallere.q LLikeT ð ) except if oneIPnot a¬Dber,ÿ”  ïPNaN (Ö o7als9 ösNaN).  Also roundsk5"""D €Á = _convert_ sö , raiseit=True)¾  �é ¥   ™ Îc = get (@  Lò ._is_special orZ 
V Þ Ý | €a quiet  
 �Â   1num8Î,thå  ) calways`%ed Ì %sn‰fisnan(†  o r  ¹   @if sH: onÎ  = é È1ã k Ô (   £8k
s 2== V  ¢ V Á W 
	� ÂE2 $Äó ÓÞ ¡_isinteger	ô0whe ,fZ#n 5 u ¢	 
Ž FFals¶6 ]exp >Ó4  «ý Frest¿0nt[w._exp:]% Æ,  = '0'*len( ´ð def _iseven(selSf):
  õ"""Returns True if self is even.  Assumes åan integer."""I bif not& !or –._exp > 0o  v rp o >   { ’._int[-1+ ñexp] in '02468'
3 Ðdef adjusted(( Ò E the& ² exponent oâ ¼ ?try£  Z Å Q+ lenj Ÿ Q) - 1Š  Ñ ÷# If NaN or Infinity,•is string2 ÿexcept TypeError~ 0ì ‘canonicalƒ í sî òsame Decimal object.F  ¨ �As we do©°have differÖencodings forL pnumber, ½ ƒreceiveda € already3uin its ¯  M %m.: tò¢  ÔÃcompare_signí P, othƒ Êcontext=NoneC6 £ to® 6 à operand numerA'lyóIt's pretty much like … °(), but allÝ"s • c, with Ô°NaNs takingT ñcedence over quietF ã Á = _convert_ ( ±, raiseit =4)OSans =hµ ´_check_nans> 87 oif anss5ans^ ¡.^ S =[ 5 Á?totÀ(ø 0 usKÅ÷bstract representationsË@This‚ „Æ 8 „standardÓ°, which use$&irÂ  % value. Not$ Qat a Í P ordeÅ f pdefinedß £possible aª O ²  d   ð ÿ= ), A #¬0one� �negative ì ú R pis posi 0, iíEeasyœ ì.o;  >;  $#_Nm 8OneK  < 1 )O K C 6 Ï  ë  le¾ °handle bothMV type± }  úfisnan(ù� "  ,._# % "orE  

& /==& ¥;° payloads a«@oughƒDy'reOÊ  :   Ò [key =^5intƒ 1   Ú _6  Ð._int), other{._int
  ðif self_key < other :)  8  - ?ign  ! ¿return _OneA Oelse> �NegativeF  ƒ ° >° 6r 	 Ø ¸ ° YZero
 Ê M   ã �nan == 11Y » 	#if"K À � 2� 7K � ƒŸ ,T  Û$oLná � C � \Î
±6	9 W9  Ck T._expp  
<  Y êŽ  U  ÿ  ì. ö 2  c 1elf}  Á  Š \  d ’ À ¦ ñ+ðdef compare_total_mag(+, ö , context=None)´ B"""C9 s§2 to2 ð using abstract repr., ignor Vsign.pJLikeƒ ð, but with operand's 6 D àed and assumedw Qbe 0.Ï  5""" 5Á = _convert_ ( ö , raiseit=True)’ 1s =Ò ¶.copy_abs()Q " =æ  `)s.R#(o\ lS  c
NR¡@s a x  2theú 0setê 80. ß q ò_dec_from_triple(0,Á  W 4exp ¬is_specialš nße � i\8ed.œ ÷ º7 ¢· Àn _dec_from_ôtriple(0, self._int 4exp Óis_special)
  Uelse:   óreturn _dec_from_] 1G ] P àdef copy_sign(˜ ö, other, context=None)~ A"""R} sÇ   with the B 2 of? A."""a  ­ Q Á = _convert_ ( æ, raiseit=Trueó á 5 .¯ ë l  p   Û /._h>  3expþ Ae **ì C  y iQ:@ is =<   Y c = get 5()
@  # … ¥NaN) = NaN Rans =q Ã_check_nans(C = Bjif ans} V<ansq �-Infinityw 0u #ifr 3isi! �() == -1Z \_Zero\ 0T 1T 1notX D <OneC ž  Q ß¥ ¤ qDecimalé	y Æ`result»ðnow guaranteed to be inexact (, Etrue… ö # mathematical H òtranscendental). There's no nZ E ã Rounded and Is  6 ð---they'll always” 3 Gd asG a� !of�@callÃ U_fix.( 4p =çU.prec 4adjlŠadjusted¤twe onlyÁ ð do any computation for quite a sm€ Hrang14of ^  õ�onents---: ð example, -29 <=)    10X ¨ #Ý @defaµb.  Fort %erZ + —C ðindistinguishable RQ 1 at4 `given   ision, whi% 'orE Olargm  eiQà overflows or ß ŽlJA== 0  Œ¤> len(str(ð·.Emax+1)*3)� a#j Ÿ   ?1e0, '1'îW ; -el— 1— -}Etiny()› ø  �g¡ ` &-1ê¤  ;J< -pgð# p+1 digits; fin¯ qR will�Ö correct flagY¨ ð + '0'*(p-1) + '1', -p)
    ð    elif self._sign == 1 and adj < -p-1:
)  ù## p+1 digits; final round will raise correct flags? ñans = _dec_from_triple(0, '9'*(p+1),v )7 å# general case Jelse›  op[ €WorkRep(Õ E  ¿ àc, e = op.int, 5expP  "  if 	
_  ! yc = -c
5 …# comput÷ "lyûed result: increase precision byF 3Vü at a time until we get an unambiguousl? …Cableu 	^ ™extra = 3 ›while TruIê �oeff, exUPdexp(@A, p+M 
[ 2 @if c5 ñ % (5*10**(len(str(  ))N.))V > Ybreakž   k   +¹ 	 Go ½ )¬#YÀthis stage, E bshould°·Õly with *any*w #% òing mode, not just- õ ROUND_HALF_EVEN7 £context = 
 ö ._shallow_copy(HÁ _ + 4et_ (c :  É =Ï c._fix(i    .J % =Ì `returnF  òdef is_canonicalQ½B"""R3  A GE is 3 €; otherw_ bFalse.b  áðCurrently, the encodðof a Decimal instance] ValwayTl Q, so ÞPmetho{ Ð sß„ for anyR .Ÿ5""" £  Ï ¡ ofinite 0 ý A� 	â  considered_0ite\ itý 0neiQ² "inl   nà O NaNÚ 
 ² É._is_specialê P ì 2 î a ƒ ZY= 'F'ƒ ?nan~ ïa qNaN or sNaN„ #Ãin ('n', 'N'.øCnormø,¾W=NoneÃa• ¾onumber� E  Ý ¸} ;¯R …r0is ­ 
5 Àcontext = geÃtcontext()
  sreturn  ñ
.Emin <= self.adjusted()
0 Àdef is_qnan(! !):  J B"""RJ qTrue ifB ò is a quiet NaN; otherwise r. •False."""J   ` É._exp == 'n'‚ osigned„ �negative�  j  ‚ 1€  F _aling+N�ubnormal	,Ä_=None›sA Ôñ._is_special or notì ÆßÛ$if¤   § 
5 …_ = ge«›$ <U ½	¨Azero a 0 ß ü 	1andP._int<''0¸0_lnÖ__bounÂñCompute a lower ( ” for the ÷ ² exponent oje.ln().j"Ink` wordsV ¢r such thaµ7 õ >= 10**r.  AssumesI *  ²@fini› pnd posiR î % F!= 1†  ×J #Å 00.1_x ‘10 we useÛ ñinequalities 1-1/$ Pln(x)- 5x-1K Cadj £ LR + le’tF) - -  if6ä 
np# argumE;Ž Ð23/10 = 2.3 aÁŠVln(10Cðˆ ïtr(adj*23//10)Ž _<= -2� V<= 0.Â `  �(-1-adj)e Òop = _WorkRep <àc, e = op.int, 5exp -L== 0ž 11 <×U < 101  œ 0num�Ptr(c-H*-e4den  
 F 50num)  0den (W  <  n #Ë`== -1,#   ” % V e2tr(– C - c�&l9 #>s¦õnatural (base e) logarithmŠ	öó$Í °# ln(NaN) =< 0ansT ¦Ã_check_nans(B= ð)
        if ans7:
  µreturn ans
 õ# ln(0.0) == -Infinity ¿if not selfL •_Negative: ; Z  D) =  " !ifY S._isiy (ˆ 1l A B d 1¾ 50.0 [  Õ O_OneP KZero
nÏ ü
) raises InvalidOperationb `._signh µ ‘context._P |_error(U ,V ® ”'ln of a © ˆ value')È Âresult is ir¶ õal, so necessarily inexactz àop = _WorkRep(ñ) àc, e = op.int, 5exp  9 ç Hprec‹ òcorrectly rounded � ¡: repeated‹ pcrease > ¥ision by 3a ô# until we get an unambiguous[ Cable] 9 Ãplaces = p -k€ln_exp_bŽ ò() + 2 # at least p+3 5 D ›while TruEPcoeff3Pdlog(",; 8 Ãp# asserb ¡n(str(abs(= ¥)))-p >= 1m  1 1if  ß % (5*10**(le; J-1))Ù ? YbreakQ Ñ 7 +=S anò_dec_from_triple(intœ [<0), ® 2, -K mø3 = 
 ö ._shallow_copy( 9ing+ 4et_ ö(ROUND_HALF_EVEN: ¬ “ans._fix(i    .J " =m5ingrû§def _log10õRñ"""Compute a lower 7ð for the adjusted exponent› E .Z 5().€ òIn other words, find r such thab7 F0**r@ vAssumes,  Þ¬ e and posi‡ Q V != 1E 8"""œRFor xl   P< 0.1f³only need aó !onò uinteger× Q# par÷ ò  ý #),… Pis coµ 2dir k H @ ;@x.  •  †  <= x <= 10‘ 0use8  µ—qualitiesE A1-1/.  ‹ x)8 px-1. Ifá  Ô bhave |§ Wx)| >@ (A Â)/2.31 > 0. ; 0< 1w n8 V (1-x, RSadj =gaexp + ¸·elf._int) -ê if?~r À#B  Ï  ÃT  GVdj))-;Q à<= -2:
         Ð# self < 0.1
  ö	return len(str(-1-adj))-& àop = _WorkRep(G )B àc, e = op.int, 5exp Åif adj == 0:  y T# 1 <’ )10 `num = Œ †c-10**-eo  < 3den  Z231*c Î anum) -Ù 0den ([ !<  5+ 2v #¦ 0-1, 5 <=œ %  < — • -z v c+ e - o P"231" !1
M ‘def log10Kö , context=None)'A"""R›Ðs the base 10: ‘arithm of¥ B."""Y  $ifP @ is S R    m c = get &()@ #a Ñ10(NaN) = NaN´  ; 0ansxóelf._check_nans(E = � ý*ns )>anss @0.0)+•-Infinityz aif notî O •_Negative: ; Ð   Õ  % iJC_isi| (‹ 1o A B g n‰ E or È õ
) raises InvalidOperation? � @signy c!._P |_error(U ,V  µ 	'† H%a ¹ ovalue'  ön?·  `int[0]¹ q'1' and¬ ._ "1: A0'*(eA1intñ « ù# answer may need roundingÖ ‹qDecimalGq._exp +î ¢| b : JelseÑ€# result,"ir•õal, so necessarily inexactI  ª 	    "  VÒFprec  ²# correctly ­ ¡: repeated› 0cre B (isUF Wuntilç ´unambiguousZ IableÜ Pplaceí"p-L) b _b�6()+= g ›while Tru`  PcoeffAdF (", c - *   ‚# assertÉPtr(abcÆeff)))-p >= ™ 1   õ f P% (5*©j? ;-1)q ?   Ybreak  ¦ Y += 3 €ñ_dec_from_triple(int(ï A<0),Â¾ 2, -O \ÿ$ =µö ._shallow_copy( 	+ 4et_ ð(ROUND_HALF_EVEN)
        anós = ans._fix(context)
   Ä.rounding =  $ `returnE 
 ó def logb(self, C q=None):"  ] Q""" R: ñs the exponent of �magnitude  J r's MSD.d  B ÂThe result iD Ôinteger which Y ‹ r ñost significant digi�   0 (ae õough it were truncatedK ³to a single? àwhile maintainC î AvaluÚ 4thai &anH Ôwithout limit5 í   Ô %).z 5""" #€¥NaN) = NaN  anð Ð Ä._check_nansø=¬  ifØ¶ xr¶  Œ$ifè w ë
4 Y c = get &()@ ² `+/-Infµ E+Inf¶ 2if ³ ·isinfinity(K• #_I  [ 0V  ^ ø, DivisionByZerof 1notj 
½ ñ · ê._raise_error(L 1, 'úi0)', 1à óotherwise, simply W  ‰adjusted ó e, as a£ ñ# Decimal.  Note ?‘no attemp	±made to fitI6C Ainto @currrÙ $ &k Ç.¢ &()Á >I  ¡_islogicalF ´2"""þc True â =a½ 3 ‡ operandó`For beW ,Œ¡must be a `e numb1ith� gnE!0,˜  .)anjð0, and a coefficiCwhosÅ!s c eall beE  eiÓ 0 or 1‰×  ._W2 !=-  ÙQ._exp lFFalsj 0forN1 inžZ._int7 !if!  Àzin '01'   õ ¯
[   …3·Sfill_cºÇP, opa bÍTdif =ö .prec - len(opa/¤ Zf > 0œ  opa = '0'*H +a dl6 <6 Topa[-À y %:]<  N – b– b– bZ e–  6 ?opb– qFuoC_ands3zA òApplies an 'and'2²tion betwee0ÝM  's'Ðits."""
     ÷	   if context is None:
   S= get 5()
$ ñother = _convert_ ( ç, raiseit=True5 ñif not self._islogical() or > 	 
• dreturn¹ !._g ÷_error(InvalidOperationw •# fill to: EprecË Ã(opa, opb) =œ  0 _Ÿ þ , Tint, ª )nth ¤make the o‡ õ, and clean starting zeroes� ðresult = "".join([str(int(a)& ñb)) for a,b in zip´  ³ '])G ò_dec_from_triple(0, b 0.ls A('0'sc'0', 0Á Cdef ò !_iÓ(¨,4=$)�A"""I' õ all its digits."""“ f$ˆð ˆ .œ Oxor(ã  C'1'*©.ÞE,0),‡ P  1  #orþ é	ö Applies an 'or'ú� between7L ')9â [ �ÿQ|�a ó wŽx�ÿÐ^�Àreturn _dec_ð	from_triple(0, result.ls ñ.('0') or '0', 0)

    def max_mag(self, other, context=None):,  0 ð"""Compares the values numerically with õir sign ignored."""G e Á = _convert_ ( ã, raiseit=True¨  | $if– @ is ™ ˜    ³ c = get (@  ã À._is_specialu  
V ð# If one operand| Àa quiet NaN   
G   @numbB@thenõ  ¤ #+0ber) ù always returned( Tsn = ® Ynan() o r  ¹   Qif snÝ nÎ  „ iÐ Q == 1½  k >= 0(  , � Š Cfix(X
�  * s V  ¢ V Á W 
	� ¤check_nans+� c9ò copy_abs()._cmp2 . Ã  Y J òb_totalH 
Wc> *-1CRans =O� Oelse&  ê‘ Kô Yans._H ³/in³ÿÿÿJ� ˆ  ²¼³£next_minusi»b Raôlargest representableEðsmaller than its“elf."""
  õif context is None:  #  S= get 5()
$ pans = sW Ã_check_nans(* = )0 jif ansd `return X #ifU ÿisinfinity() == -1= £_NegativeI. r Ÿ J I ódec_from_triple(0, '9'*Ê d.prec,4w.Etop()' % =# Vcopy(! ÿ._set_rounding(ROUND_FLOOR+  ÷ignore_all_flagsO @new_ß …4fix~J 5if ) !¯F% =› b ¯.__sub__(_"(1'•iny()-1),I  L > de¥ €xt_plus(r R =˜)² A"""R4ð#s the smallest representable number larger than itX «·øB×1ùWvCEILING±/._ûu?addûPctowardý_otherí@clos
!to?A, in#¢direction c !s ^ .q‘The resul	 WL Va à`(excluÌy )pJ � !ñunless both have· ñ same value.  If õtwo operands areƒ ðnumerically equal,0  Ú  a ‘" o`P with' F ×sign set to b† al  $of?ÓSZÁ = _convert_ ( ã, raiseit=Trueú E ˆDu À, context)
   ‚if ans:
  `return 
 õcomparison = self._cmp(other)& 8if ) ?= 0Z @ ”copy_signE F *-1G 4ans† önext_plus(context� {else: #’ 1g  í J 8minK , ñ# decide which flags to raise using value oQ9 `ê._isinfinity()Í ¸ !._L õ_error(Overflow,I  ®  "'IY áe result from toward'E Aans.�? m œ gInexaci* vRoundedT #elÔadjusted() < f OEmin2UndX ‚ ŸSubnormal, Ø ( € À# if precisi&ó= 1 then we don't-ÙClamped for aß#Â™0E-Etiny. `if not—
% } C	Ej )ÆrÚðdef number_class(š,‘W=None®A"""RA Às an indicatì  ofê  C   F .v 3The Qis on$ the follow;istring‡GsNaNÿ 
 -ôy" !-Né þ GZero + 5 +\ +‚ 5"""W "if$|is_snanó‡"ä 5 q5 7NaN4 $nf
	cŠ i$ += D„ É U #f 4 y5 €	5 ÷|is_zeroó eÀY  ŽU  ÛÇÐ     1 ¿1 �@ is À
l (c = get (¦  ¸:Y=/  ‰ 3 Ù W­  ? Þ 6   # ;2 a ÙÐ, regular, boFÑ=, :Ø À._sign:
      óreturn "-Normal"
 e else:   + ++  ö def radix(self)3 ‚"""Just 7 ös 10, as this is Decimal, :)""w .  V(10)
g Qotateh ú, other, context=None} RÚ Qs a r8  d copy of © ±, value-of-J x times.‹ $if^  °  a Ý  { c = get (¯    X ±= _convert_ ( ç, raiseit=True5 Qans =¢ Ä._check_nans5 f ) d jif ans˜ C2ans;( x ¯._exp != 04 ` !._ž ù_error(InvalidOperation~ dnot (-8 ²prec <= int³ )  ¤ ˜ ¬ " x ÷  Åß._isinfinity(Z g5g#´õs, pad if necessaryh htorot Ð  erotdig¬5int  toQ =>.b- len(6 	B. >’` B'0'*$ +Ê5digi Relif  <@ s ![-( &:]p# let'sU Eate!V /= Adig[4:] € ![: ]2 kò _dec_from_triplªu._sign,,  ö v 0.ls= Ó('0') or '0',3expÂ tascalebØ 6  oÊònd after adding the second¿ to its expÿô liminf = -2 * (ÜiEmax +¯limsup =  4  ² ~p wT • qV?d = 
ä7intï' +J- L dd._fix] Qdç)Ahift(À, other, conÓtext=None):
  õ,"""Returns a shifted copy of self, value-of-other times."""D `if con^ @ is a `  g  S= get 5()
@ X ±= _convert_ ( ç, raiseit=True5 Qans =¢ Ä._check_nans5 f )d jif ans˜ rù   Œ 1if x ¯._exp != 04 ` !._ž ù_error(InvalidOperation~ dnot (-8 ²prec <= int³ )  ¤ D¬ " x ÷  Åß._isinfinity(Z €Decimal(/ g#´õs, pad if necessaryh htorot Ð  erotdig¬5int  toQ =>.b- len(6 	B. >’` B'0'*$ "+ ? i Relif  <@ 4 ![-( &:]r# let's!U S  ÷ S H=ˆ ![: ]; JelseX3 2 + Ð &ro0 	) 
 [U¸ 4ñ_dec_from_tripleãu._sign,’  [  i 0.lsA €('0') or  ,�3exp4ñ# Support for pickling,S , and deepa{ ádef __reduce__š ŸÁ  ñ.__class__, (str 3),)x I  X G  ©"ypø )£ì
‚m   	ð# I'm immutable; þñefore I am my own cloneÌ  6 E ± ¯ 	­ 	± g, memoþ · %öMy components are alsoÊ ­ Â# PEP 3101 sÛ . € _localeµò keyword argument should b#ãðsidered private: iU�provided0@easeyÑtesting only.° àeformat1�specifier`�ß,›  VA"""FF 3 a ð instance accordz !toä egiven h .6The ï  FatandarÒ 6mat& `, withX Ó  0 Ñ Õ described inm2.  ¨ 	Ðtypes 'e', 'E &f'¼ 'F g G !n'ið'%' are supportedó.  If the formatting
  ð(type is omitted it defaults to 'g' or 'G', depending onO D õvalue of context.capitals.# E"""
 ò# Note: PEP 3101 says that i© – °not presentr nC ðthere should be at least one digit after8 æ decimal point– ‘# We take% plibertyÉ Pignorê Ðthis requirem† 7for… DX q---it's« `umablyQ  reBm_  su 7hat< �ð(float, '') behaves similarF Ro str$ )¸ ik »UNone:Y  Øˆc = get &()�âspec = _parse_‰ _ eifier(
 ç, _localeconv= L !# / 1al ñs don't care abou¹ Ñ or"VcisioÊ²if self._isƒ *alÍ @sign­ § Bign(2   , )ÿ abody =:) ªcopy_abs()(  { Ppec['ž š'] == '%'~  OP + 	h treturn A!al› Pign, 3 › 4 3# a	 f µjÀF ¶ !isM 
·  ”Ø ` ['g',Æ#][O ¤]#ð'%', adjust exponþo­` accor/ly˜ N � Ìú dec_from_tripleÐ3nt,Yexp+2rPround­  necessary,Ç ±  	 Pmode d  ‹š­ ' = . $ 2pre¬ L( %']& &ifÕ Ž ³ Ý
�µ_n 'eEl "  !._“ (v A+1,  :ingÊ/ela /fFÎ [  Ò g0resà%(-e c ¤gG' and le•fint) >
 O
�  Ëã ~ böcase: zeros with a positive¤ ca€%be¢C# reE árn fixed#;  &m°90e0i Ð²  ç  	 ‘._exp > 0ù 	iNin 'u 5 q0ê « 0fig, 8Bplacuo	Æ4 Aleftðse àexp + len(selfƒ._int)
  õ	if spec['type'] in 'eE':!  ( ñif not self and precision is JNone3  7 ædotplace = 1 -6 	\ ?els; / /el® ;fF%¯ x ¯leftdigitsF +gGE  k Ñelf._exp <= 0ú P _ > -6ô 
, |  ñ 0 r# find Â q beforeˆ ñafter decimal point, Åget exponentG 5if :< 0¶ Õintpart = '0'3  ª Ffrac 4*(-E 1) +L3 Ÿ# p > len(3& )u "   +� $*(B -@ ³› µ [Ý h $[:b @] ort Â Z 3 2 %:],  &= ä
# ô # done with the¯-qàific stuff;  hUAover' 6res»A# of Ñformatting to _ õ_number function zreturn ' ’csign, $, ê,<,ò	)

def _dec_from_triple(: �coefficiexp9 “ial=Falseó´"""Create añ instance directly,&àout any validaÍ ,Î nü 1liz à (e.g. removal@lead`zeros)ÕTargum`conver¯.œEThis/ Ãñ	for *internal use only*.} 2"""7  ò = object.__new__(D„Ÿ #  ._#0 =  B   ind9 MH 1is_. alQ bpecialŽ Þ \ �

# Regis� p as a k>Bof N#ñ(an abstract base class).
# However, doÓrQ  itL  Real (becae Ps are.  
#L“eroperablôPfloat^ £"s.ˆ .\ =0

# ‚ Context˜     !

× # _N ‚Manager(º—m m  u òto support localc& #()>P  Set]@copy Û 2 Slied .  H0__eSA__()› Ø4oreŠ 7 …previous
? 0xit>  ‡  •1_in  þ , ‰9 Ý  )   . Àntext = new_ñcontext.copy()
    def __enter__(self):     s.saved_; c = get C *  5 4new3 h  % |return ! o ˆ 3xit‡ ©, t, v, tb‘ 
g 	œ ¢)

class Cç s(object? 0""" “ains the Ä ñ
 for a Decimal instance.
– 2 pprec -  pision (= ñuse in rounding, div ò, square roots..	( % -3 â type (how you - ±traps - If  ð[exception] = 1,Ê n   1 is»  q ÿraised when it is caused.  Otherwise, a valueE ñ substituted in.i  flags  - W[ )an‹ e !, & ¿ bis setC ¨ @(Whe� q or notÚ  ù €_enabler· 2set6 ÿShould be reset by user ofØ  6 ñ
Emin -   Minimum exponentÑ BEmax .ax pcapital– K  ›�1, 1*10^1Ÿ @prin{as 1E+1á 3  5 80, + !e1| Pclamp}  IfßechangeŸ ò	s if too high (Default 02"""¶L'inL ´b=None,_3ing   "ax Œ ¬  ý &  ®  á  ³s J –_ignored_8 © p P# Setœ à !s;¥£everythingbTZ and N ,u ó # inherit from 1 Ö ' 2tryâ |   Kdc =. - jª NameError: Bpass† H ë |! =7 À !isà ’� else dc. f : ,=¶ B  F  
J  æ1 =  #if „   ! : !ax:  ax| x   
: -5 =  'if €  ) J =p † y n %	E �+if 5  1 
¶n
EU = []‡  ¤3 
D 	ˆ    =
 ¦ LAelif5$is¦()  rç *   Ò ðtraps = dict((s,ñ int(s in traps)) for  £_signals + #
  Uelse:   Qself.B " =. 
  ÿ if flags is Non:   ô= dict.fromkeys(� E, 0)N ñelif not isinstance(? ,> )˜    ^ F((s,ô  ô  x ô & " =â ô ðdef _set_integer_check(#À, name, valu —min, vmax· ß . 7int'  vðraise TypeError("%s must be anç  € 1" %w Dúif vmin == '-inf'5   ¡ ! >œ 
 x V$ y ðin [%s, %d]. got: %sƒ (û ô )˜ Ü š ™ <À ™ !_d, %s™  ý$‹ 2 orÕ4( › 43ð return object._xnattr__p)Ÿß_t	- df�dhŠ
 j   
dò m0key€dÏz  
$ Œ6KeyŠ!is!a’/id~ a 
… ¢ ~ -»d·ß
 · 1ameFKprecày  ‘.R ©¨ Þ`, 1, '‰³¥ $ _ OEmin_ (á ¿ OEmax` (0¿ �capitalsc +1_clamp\ D‹rounding_  ü otû ueW_( ð_modes:
              û+  # raise TypeError even for strings to have consistency
  ý# among various implementations.1 v ù("%s: invalid rounding mode" % value)E üreturn object.__setattr__(self, name,9 Aelif æ == 'flags' or traps':j  W .g ß_signal_dict(g ’_ignored_p ] Ç +seG Å‚AttributÊ(Æ  ±ó"'decimal.Context'@€ has no BA P '%s'z à !)
J �def __del& 	h)� Ø‰ û"%s cannot be deleted^ ‘# Support|ð	pickling, copy, and deep � creduceŒ † jq = [sigP ¡sig, v in Ç  á.items() if v]V  %<   < •ƒµ.__class__,\  `   ! Rprec,‘ ò EEmin .axA 6 ƒcapitals+ qclamp, Ý !, ¨ )¼4rep!-ð"""Show the currentì  E."""½ s(£s.append('M(Ð !=% 5)d,Æ4=%(ß U)s, 'Q  
 'ð 0=%(  : AEmax  ax ç 4=%(   I  (  /)d#   M!rs�)R çà @f.__ !__8f6ñ =[' + ', '.join' s) /]'v   Áv tv Èpv & v ¥� ™ &)'çRclear°*áÂ"""Reset allk !Hzero, @ 	
rF  ÷Š[+ \] = 0ƒ × ƒ 
" ƒ * ƒ   ƒ �_shallow_v…  ƒCs a ) ­R from Tnc = *û  /º    ÿ@/    Uä GÀ              ðself._ignored_flags)
   ¡return nc
 �def copy(5 !):  ' A"""R* �s a deep& ` from + E."""- Ánc = ContextI b.prec,) ƒrounding EEmin 5ax,E  v  c ƒcapitals/ _clamp0 	ê .Î )4 Ttraps k . ›  __] A__ =BÁ_raise_errorð, condition, explana ê = None, *argsp±Handles an I _  x pIf the à z is in ° ", Ös' õdefault response.ø òOtherwise, it set1  X ,; Bn, ik 2cor?  º@  N€_enabler‰ 1setJ !re N Pexcepì :.  q ¥ O 4he ­ °value after™ @ting’ ô Á u$E = _j•_map.get( ‡"if` Hh
M {Õ# Don't touch’ Ã  # × T A().hÇçÊp  p!s[À U] = 1N Pif no™0lf.l% “ 2Theo s@²ine how to |  § vmselves;ª ® 0# EÒðs should only be riske  Ties o6Ð #
`U = []# 9Í (()3 ž> B_allÌ[
;IìQ all ]Èay are d d<³Ž` 9 ¯(*_signals‚  "  5 1, * † «s†  \ñðmutate-- This way¸pYaK Z` leaveÝ• originalGg# alonë ¦ 1 = ; r+ list(Ñ '$ ”Sregar\U QStop ‰Ð"ifÇò  and isinstance£ À[0], (tuple,� )… åÈ " =B &[0k1for  ø% 
W2 b.removx ð # We inherit object.__hash__, so we must deny tÐ ×aicitly¯. UOEtinˆ	  @ (= C0 - dð + 1)"""
       ñ	 return int(self.Emin -  ñprec + 1)

    def Etop) !):   A"""RF õs maximum exponent (= Emax - M 5"""; ~ , ~ Ñ_set_rounding‡ j, type� ”Sets the * $ .Å  ± ! S, and@ AcurrÅ –previous)¹ … [ ö  Often used like:m £context = 
 f.copy(K ñ# so you don't changeÀ tcalling9 } ñ# if an error occurs in4 umiddle., € 
F†ROUND_UP‘ Rval =ä__sub__(other,‰ =Ê 3  .[ | @ {òThis will make it¥ö up for that operationÆ 	4{¤ f ó > ! =£ r ¨ Úãcreate_decimal]znum='0'`C* ’s a new D1 ð instance but us¸ ‰ 4 as7‚ó method implemenµ–to-number0 ofÜÄ 5IBMw ‚specific1 (' Tif is— ¡(num, str)ç  ð != num.strip() or '_'I7numó  ¸7 Ò �._raise_~õ(ConversionSyntax,  7  Q"traiÝ`or leaÑ± whitespace¤ 'G   ÷"underscores are not permitted."~4d =9 Ñ Ø ÎÂif d._isnan(/@len( Rnt) >Ð)Vclamp – 1>ð	diagnostic info too long°FNaN"¿ { ad._fixÉç¢_from_floaÿ7, fù?"""ì ? 1 a A ùXaV4>>>$B = C  (a2=5,!Bing=ªFDOWNì ; .ÂÛ ö3.1415926535897932B À"('% ' \ —  ÿ traps=[Inexact]7 “ $ðTraceback (most rec‡ W last£ k&..)¿.— b: Noneå +   Ð        d = Dòecimal.from_float(f)  ò# An exact conversion
 õ  return d._fix(sel8 " °# Apply the? átext rounding
F ‘# Methods qdef absJ Q, a):  L A"""Rm sM ñabsolute value of ‚operand.[  7 I Ñ is negative,2 `result  £ Ñsame as using  Bminu›  N ` qtion on  ßnd.  OtherwisX Ó  r Qplus F W È ð >>> ExtendedConI.)D»…('2.1'))\ 
  G O-100H  H _101.5I  K -L //-1 &1' 5"""‘ Ra = _ì0t_o×ö(a, raiseit=True8  ²a.__abs__(cœ=¿Ô$ddÔ?, b×O4sumË2two7ndsÐÁ5dd(ðe12'),  /7.Ð9 ö Y *E+[ 1.01E+4å1.02 ` 1­ 2À3¦¤ V8), 5�1E 5< 0� '&1 = $tdd__(b,' [  @if r‹æNotImplemented $ ˆð TypeError("Unable toU pvert %s þ V" % bKelseQ V& r­ _a´°­îWstr(aò); Ÿcanonical>  Âl¥ w objectèðAs we do not have different encoARs for8 ¸anumber×vƒreceiveda € alreadyeuin its ²  M m‚ m- p?2.51 Š ;!if×  isinstanceaoïƒ ´ requires aï »pan argu;&."ø»%a.@ À()

    def ócompare(self, a, b):
  B"""C  õs values numerically.
) âIf the signs o òoperands differ, aD ó representing each + O y('-1' iH ÿ is less than zero, '0&   5 orN ƒnegative5 Oor '^ vgreatera )t uused inN Rplaceä $atº 0 fo8 "e OÂison instead+ …e actualG ó D*Th?  ê ñen effected by subtrac9pVecond… 5roma    �first andž€n returnv‹`accord  to$ s result´ L x Hon: œ/ ›% P ¢ š
7  ™6ò>>> ExtendedContext.…õe(Decimal('2.1'),  E3'))�  6-1' X "h D Z 0Y 00´ Z 3	± 
.-cX  H ¹° »O1, 2¡ @ Ó/1)I ,1Ö 2�5"""¯öa = _convert_other(a, raiseit=Trueà ñ% aBb, c%=ñ)Â3def¹ e_Ã/al _ð4twoŠ'ôt's pretty much likõñe(), but all NaNsNƒal, with 5ing	$ 0tak¾€precedenš‘ver quietF +<c =/Q  óc+	ñD%Q Üãðc.flags[InvalidOg™tion] = 0Í nprint(0 Àration])
      0
   õ>>> c.compare_signal(Decimal('NaN'),  e2.1'))=  (   T öprint(c.flags[InvalidOperation]D 17 1 : = µ a 
7 ì sÅ í [xV-1, 2_6-1'  ^Æ ?-1)C % } r 2å	† 5"""¹öa = _convert_other(a, raiseit=True¾ Œreturn asñb, context=self)
^ Ddef $`total( �, a, b):#  ÅB"""CÂps two ohñnds using their abstract represent‹.j  G ðThis is not like9 ” standardˆ ¡, which us  Åir numerical�  value. Not$ Qat a ¾ ` order“ õis defined for all possible© O 
± s²  ’ExtendedC?Yr ËY12.73Í_127.9Ï	êd @-127c 1/12a :P12.30b ©' c P0d 0—‹Š'?.30d ûd &ß‰Bí£¨ ¯O 1·»Xbb¬O_mag°?Q ignoD ­L²	-ð, but with operand's ósign ignored and assumed to be 0.
  5""" õa = _convert_other(a, raiseit=True), ñreturn a.compare_total_mag(b)
' ñdef copy_abs(self, a):  } A"""RE 1s a( À of the oper´ Awith Î 0set¾ "0.]  B õ>>> ExtendedContext.q æDecimal('2.1')¹ 
 Ž L O-100M  M /-1�  &1' “0u‰d�3  object}2 (iß 
 4P ?-1.† T ‹Lë a‰onegate/i¬/ed˜t ” o'101.5Í- HT : î T ›-'?Â ¡ sŸ:, b·bCopies›Tecond³0's 9  ¨ É—first oneŸâIn detail, it F8 “Tequali u >s’ z â > ®¥ '1.50'), )O7.33(* “ a "'-7 a FÂ  -Ã � Ä /c 5_1, -2? 	ûjÀopy_sign(Decãimal(1), -2)
  1Dec F'-1' ô>>> ExtendedContext.copy_sign(1, 7 6-2)6  
L 5"""n öa = _convert_other(a, raiseit=TrueN ‡return ay 1b)
K ñdef divide(self, a, b):  Ø 3"""Œ ' ósion in a specified cÖ Q  5 ô e M V('1')ü ?'3'ý 40.3 R^ 2^ 6 7^ 5^ 2¼ ?2.5V 
/10W /0.]1  �ô¿O8.004' Z <2.4[ .O1.20d0\ 1 Z /À1� ?E+6n * ` O5, 5ù R/5)G *55íþ&ô = a.__truediv__(b,µ=õöif r is NotImplemented Ýcð TypeError("Unable toU  �0 %s \V" % bc KelseQ žr@‘O_int•´òs two numbers and ëñs the integer part of rresult.l  Ï í€ Å *('F°<
X  è	3Y !	1/0.³ Z À(10, 3)
    ð    Decimal('3')
   ô>>> ExtendedContext.divide_int(4 f10), 37  L 510,„ /3)L 5"""¤ öa = _convert_other(a, raiseit=TrueM òr = a.__floordiv__(b, cÚ V=self, õif r is NotImplemented:x   f ð TypeError("Unable toU  ’ 0 %s V" % bc KelseQ �eturn r
g °def divmod(œ v, a, b)2 B"""R1 ¡(a // b, ab .@  £ Ã T • ?(8){à7'2'#   Ä ` 4Û` '0'% ` F8, 4‰ N -W 88\ü ç-<å�4expâß‹s e ** a×=c =žVcopy( >Ñc.Emin = -999X  ^ax =   ’ ¨'-Infinity™ 01*c.= 16 ¯.367879441@ 	u 5 t œ2.7182818ä³ ¯0.69314718H 0 » +8
 • ?&10Åõ §22026.4658x %9a­
�  |4fma—,]c�ð a multiplied by* gplus c°øThe first two operands are= @togeÂt, using !y,“  ·”the thirdD  £ then addedl # åresult of that> ¨ ð cation, using aódd, all with only one final rounding.

  õ>>> ExtendedContext.fma(Decimal('3'),  5 E7'))J $ 622' ` -a /-8a ™888565290» š1557.9693 ¿-86087.7578Ü ß1.38435736E+1è v1, 3, 4'7Å 1{/3)G *3J 4µŽ 5"""Ööa = _convert_other(a, raiseit=TrueÛ �return aArb, c, cSb=self)vðdef is_canonical( U, a):u B"""RL  a õ if the operand is = !; ” bwise r3 WFalseâ¡Currently,F @encoT of aÙ� instance] ealways� l ó, so this methodq !s ¥ tfor anyR � 	H2.50w Y ˆ –”if not is¸  •G H ä«È TypeError("{ — requiresÿas an argument."à C (×ofiniteÔ!: ÑAd	¶ consideredí0ite7i$@ nei¹J"inl   n´O NaN®2 «
òD O-0.3ïD 0A 8Inf„ >*D ?NaND %1_î„"3is_p
¡ý£!< ¥:B I�G Àl('-Inf'))
   RTrue
 õ"  >>> ExtendedContext.is_infinite(Decimal('NaN'))8 OFalsF 19 5"""S ða = _convert_other(a, raiseit=¶ F ‰return a¬ !)
L ñdef is_nan(self, a):  ô B"""R<  Q õ if the operand is a qNaN or sNaN;9 ‘ bwise r@ .s  Z J ‡ EO2.50F	B ‡ Å £ ‚ -Ö ƒ B ÃJ ã ¾ orwÁ"n<  numberÂ=c =Vcopy(| gÙc.Emin = -999�  ^ax =   •› VŽcâÑ 6 @0.1Ey È�Š q  ?0.0‚r O-Infn  ®¤ b	$1Bcâ=W
pqƒ  /Puiet , $%} %+
C x	O ¿ò 
A &ºC Æ
5 Ç1¥ 
¹osignedê!Ÿnegative;¸&| º+E 8-12j¼C ãÀ   True
    ð    >>> ExtendedContext.is_signed(8)
%   UFalse 7 -8 6Tru7 5"""C ða = _convert_other(a, raiseit=7 } ‡return a› !)
J @def ° Ñnan(self, a):  µ B"""R;  P ð if the operand is a ê ¥aling NaN;: ‘ bwise rA  .u  [  ‰ ö Decimal('2.50')È E d C ?NaNB ,sC  „ 1¹ Ç2 )ÅPubnor9Ê s= /; ¼=c =ùVcopy(õ   Ùc.Emin = -9996  ^ax =   ‘� (cà: @0.1E€ 	Æ= 0„: H-Infs ¾: r9 jKQcá=_
{Ozero@# : sh  > "	¨á? n"
‚ X-0E+2ô† Ã F» 0m	i a1Ù æl!
sùnatural (base e) logarithm o<	MI/ln!Y ¨finity'O v(c.< ð1.000'))
        DÓecimal('0')
  ¤>>> c.ln(D Æ2.71828183')(  31.0 F 
/10> ¯2.30258509> 
Ÿ+InfinityE  Ç 1³  ð 5"""5 öa = _convert_other(a, raiseit=TrueM €return a+ácontext=self)
O  def log10( Q, a):  fA"""R> Ðs the base 10/ ‘arithm of ‚operand.R  : �Â = ExtendedCy f.copy(œ ' Å.Emin = -999{  ^ax =  ² Û³-oñ ? O.001±.-3î
< V< ½Ï ¶ 27 ¯.301029996| ø 18 78 Ÿ.84509804A æ%;0 ‚«O›  b  „exponent”magnitude (g's MSD.ÂThe result ikÔinteger which ` 6�õmost significant digi— † 0 (al @oughÅD Íó were truncated to a singleO ùwhile maintainingG Cvaluù a� óand without limit5 ý   ä ) =IGlogbú5Ò2ÉF .G ÊG ?0.0�-� Ó *” 7Z1¥Xs 0; ú ÉÀit=True)
     ðreturn a.logb(context=self)

! ðdef logical_and( �, a, b):!  % ä"""Applies the0 ò operation 'and' between each Ând's digits.p  O 4The ås must be bothZ hnumber4 Ò>>> ExtendedCÇ  Ô ¸ èDecimal('0'),  )Ç   Y $?1')Y 51² E
Y ² &1'Ç :110gO1010 10* m;111¾ ` À –110, 1101ó Ò ¨ O110)S 4� � ¥ ¦ 5"""² öa = _convert_other(a, raiseit=TrueO A?b, i] "
I A all"ó1 in (/ndaþ/ ™	– :  ê   P /V =S 1ü‰¬ ?  ë´  0¬ %0�/10´  ] ‘ä 
W0ý –6„–$or’´/or³g5or(E
KèÀ_or(Decimal(ó'0'), Decimal('1'))
    ø>>> ExtendedContext.logical_or(4 X 0X D° 8+10/01¶ 1 7  F m( _ Ÿ110, 1101J &1' ºO110)S 4� ¥ Ž  H'111¦ 5"""ü öa = _convert_other(a, raiseit=TrueP ˆreturn a�Bb, c£q=self)
Z Ddef ²@xor( �, a, b):!  ÿä"""Applies the0 ò operation 'xor' between each Ând's digits.p  O 4The ås must be bothZ hnumber4 °	 ¸ B
¸µ0	Y l+	Y 1u² 
Y ² "1a $ 0ƒ{Û8 10s  e!T Ÿ ‘ § Ò '¨ "6 “#?max max compar ð wo values numerrly and •CwmaximumPIf eiÖ� is a NaNtn õ general rules apply.²O= Qwise,, �tnds areŸ 0d a qough by' Ðcompare
     ð   operation.  If they are numerically equal n ¢ left-hand= Cnd
  Áis chosen as+ ñresult.  Otherwise ömaximum (closer to positiveL ¡nfinity) o— D twoq /s j 
@ õ>>> ExtendedContext.max(Decimal('3'),  E2'))<  &3' Q 9-10S 3S /*1.S 1S 1¦ 7¤ ?NaNS 7S F1, 242; - /1)D '1¾2¼ˆ 5"""Ýàa = _convert_o˜ö(a, raiseit=TrueÕ �return a:Bb, cIb=self)lÀdef max_mag( …, a, b):p ¢"""Compareivaluesa@withòir sign ignored.b  ]}v M'Û6W 	æ"}  õ ° 	O1, -9-²A 	t  >J +D-E	” F1[J/inFUmin cJ?wo J  –µm0minjJPIf eiöM LPa NaN‚âõgeneral rules apply.ÛË,1 F s6Ÿ d qough by'  F xcxOnegaxO/inx
Q z Ù À      >>> ExötendedContext.min(Decimal('1.0'),  S'))
    &  o>>> ExU 7S ?NaNU &7'j S F1, 2& � ; - /1)D '1/29‰ 5"""#öa = _convert_other(a, raiseit=TrueÖ �return a™Bb, c¨q=self)
S Àdef min_mag( �, a, b):  ­ð"""Compares the values numerically with òir sign ignored.b  E …v N)'3Ü/-2Û  œ W -X 4 ' Y O1, -:$	ð  >I *C/-2CQ¿ G
$usE
BðMinus corresponds to unary prefix„Çus in Python<ðThe operation is eƒ ated usingzð	 same rules as subtract; ÕE m� 0(a)N acalculO : à('0', a) whereG E '0'K "haw €exponentz  "h nÿ(us.3ð71.3
òJ -2 ` Ã J 1<  '-1… �.�__neg__(�tultiplyL‘m!  	 ries two'7nds>PIf ei&  ô’a specialÎ ßn „ generalJUpply.2OG Qwise,, çVs are‰ `d toge* 8 e('long# cÉ ì0resÉ  ngøaSðber which may beS= %asO  casum of‡ tlengths î }  g"2´”À'3.60')
    õ     >>> ExtendedContext.multiply(Decimal('7'),  P3'))
=    621' W 90.9Y ?0.8[ O0.72] ./-0\ O-0.0\ @6543ð  ß4.28135971E+1&O7, 7M 9® /7)J -7è 7û4” 5"""öa = _convert_other(a, raiseit=Trueâ òr = a.__mul__(b, c�V=self' õif r is NotImplemented:s  ”a ð TypeError("Unable toU  � 0 %s £V" % bc KelseQ �eturn r
g ð def next_minus(  F, a)3 A"""R2 ñs the largest represent� ònumber smaller than a.b  Å  C=c =žVcopy(­ ' Á.Emin = -999£ A Œ.Emax =  ôÐ ?('1140.9 Š/c.F oE-1007L  	µ œ B-1.0 Ž  4¦ �Infinity§ 9ó HE+99í~÷ 1šH2(&Z( am
+M¥/pl¤‡¥Â¤sÏ [£m¢
D $-1†¼ $-0 VX£W ¢Ü¦ ¢
-£ð plus(1)
       Ò Decimal('1.0 S1')
  5""" öa = _convert_other(a, raiseit=True8 ñreturn a.next_plus(context=self)
V Adef ! ptoward( �, a, b):!  † A"""RN ðs the number closest to0 Òin direction M Bs b.f  E ÂThe result iH A Årepresentabl^ Afromn Ufirst‹ öoperand (but not#   Q) thad !in — E Ÿ  Í dsecond= r, unles  Q as haveK EsameF Wvalueá ò>>> c = ExtendedCnf.copy(˜' Å.Emin = -999Q  ^ax =  §36'),A62')i $ Wm T ‰-1E-1007[ 1[ $-0+ Æ Y Š 3\ 0\ 2¸ 1U 40.9 U á g ³ 2/-14» I0.00-   %  X 
O0, 19  -/0)D '0�1æ©ˆ :3-O(b, ?„ormalize=
:n ´ reduces ano <�its simplLGformS Es€ially a Ä: eôwith all trailing zeros removed B~_  L®¯ (@/2.ý ^ M ?-2.ßæš ?1.2Ï/1.O  ?-12œ _1.2E+R   12s,Àl('1.2E+2')
  ó >>> ExtendedContext.normalize(Decimal('0.00'))
6   ' L 6) > 6> 5"""_ öa = _convert_other(a, raiseit=TrueM ‡return a· cÉ q=self)
V ðdef number_class( Q, a):  Ø A"""RL ñs an indication of the 8  ‚operand.^  ? T# dis one* öfollowing stringsr u  -sNaN‚ ;  - ‰Infinity# Ÿ 2Sub´ GZero + 5 ,+N\ +‚ L  ç=c =7Vcopy(˜' Ê.Emin = -999A Ž.Emax =  	§+ˆ †'ž '] D I1E-1Ç'ñ ? ?2.5> (@0.1E
Á †ƒ €  Ô9 -: -: ¹ -¹ -|-mÀ }? ?- ?9NaN½  9  Ö: # 	:  u 	6123„àf/Ei?pluaðPlus corresponds to unary prefix ; « in Python_u“ð is evaluated us^ £ðsame rules as add;º/@  g Ñ(a) is calculI 4 @('0'` whereA 6 '0¦1has l €exponento  � b 	 a~ Ú81.3ã
 ¼ H -I  à
        >>> Eó
xtendedContext.plus(-1)
  ÆDecimal('-1' 5"""" öa = _convert_other(a, raiseit=True8 òreturn a.__pos__(cx q=self)
T  def power( ñ, a, b, modulo=None):(  ¡ @"""Ri ¢s a to the; 0 of5 #to8 ¢ if given.d  < ð$With two arguments, compute a**b.  If a is negativea 5n b òmust be integral.  The result will õexact unless b isB : @ and^ < pis fini‹ `nd canI ¡expressed Q 'lyG ý 'precision' digitsì Ohreeî (ï 3) %-`.  ForŽ ` t; ` form,!   following¹ Àtrictions on ? bf hold:„z - all _ ,s XI E - b 4non™! Àat least oneJa or6 Hzero2 \X  " “Ïhave at mostc Ê øoÀ ¸)F£identical «(Š  that wouldí³obtained by— f«U withA PunbouÎ P, but} Úðd more efficientlyç " F balwayscC›>>> c = E2Vcopy(â' Å.Emin = -999X  ^ax =  óoU2'),  63')c  8’^ E -F -G 
F -� _0.125‘ 91.7Ø 8Ø ¯69.7575744P 0O ¿0.301029996Y 32.0 Y !Iny_  ‡ 0M "0¢ eÓ™ 1L + „&) sí -î -O ï $M ð , ñ À-Infinity'),ó Decimal('2'))
   –Infinity' Å>>> c.power(( F0'),L 0L eNaN')
d H 3H 7 /16W /11� -V  -W 8­ ¬ « 	-&‰23E12345£ i67E189 %  67 ñå�11729830Ä -1Ç?729É 7 *-2
h _65537Z "ó ExtendedContextÍO7, 7ö  k823543ô B */7)K .7O N 2™  Ö 5""";öa = _convert_other(a, raiseit=TrueM òr = a.__pow__(b, modulo, cV=self/ õif r is NotImplemented:{  ?i ð TypeError("Unable toU  • 0 %s .V" % bc KelseQ return r;Ðdef quantize(ž v, a, b)4 A"""R3 ð s a value equalt €'a' (rouþò), having the exponent of 'b'.n  Ñ ÃThe coeffici!  1 `resultñderived from thaD  # •left-hand!óoperand.  It may be � 4 usŒ @currj    @sett 0(if­ O eµ Pis be" ñincreased), multiplied by a positive ½ é uten (ifP  µ T &deT o �unchanged>  ’ ?%isN valready~Brigh )tqUnlike ¾  ‘tions, ifo alengthÃ žPafter$ ‡ .H ` would|Bgrea0 Àan precision? »n an Invali¿ Š  Ë!di
 "is\ Õñ This guaranteesp, unles Here  0n e#M ,z Loí jEof aû xValwayoågÐ.

        Alñ:so unlike other operations, quantize will never raise Underflow, even
    õif the result is subnormal and inexact.
1 ô>>> ExtendedContext.w õ(Decimal('2.17'),  …0.001'))H   + &0' a '` _ 1^ 2] /O1e+0\ 2º O0E+1_ I-InfØ�Infinity¿  .  øße ?NaNÇ 90.1b #-˜ 3 ÷O1e+5 0E º+35236450.6¿ ?e-2g "e Q2 ?1e-„O217.‡_  b ˆ †]  JÂÛ?2E+   ” 
EÞ^ O1, 2£  /1)I ,1Ú 2’ 5"""œÑa = _convert_û2(a,Þvit=Trueß †return ašBb, c®b=self)Ñ¡def radix( :m ‚"""Just I Ðs 10, as this%â3, :I  LÚ] ™ 9 8('1Ôç r 9ð10)

    def remaiónder(self, a, b):
  ð"""Returns the remai. õ	 from integer division.
9 T. dsult i< �sidue ofK  4 ¡dend after Åoperation ofI ½calculatingp ò as described foŠ 3de-™ •, roundedN qto prec® ð digits if necessary.  º 0sig… –  reÆ 6, i” ”non-zero,Ü @same� Dthatá �original ê 	6is ï  will fail ® S Pcondis^ Ö Q  oÖ (x  is¥ %!onÈ Q 2twox ‘nds wouldx ," O æ¤cannot be ‡7ed)È €>>> Exted…Context.> õ(Decimal('2.1'),  E3'))n  &  [ /10Z &1'o X -Y -Z  I10.2´ 1& ,/0.j0�\ :3.6· ] ?1.0oV22, 6œ4B 3 ?22)K - � O 6¡– 5"""Aöa = _convert_other(a, raiseit=Trueã òr = a.__mod__(b, c7=' @if r]æNotImplemented˜ Ÿa ð TypeError("Unable toU  � 0 %s Õ V" % bc KelseQ ê" rÆ6defðO_nea#o+ð"a - b * n", where nÌ  AÃ O 0estwe exactM2val%À"x / b" (if ·; às are equally H  E ã…even oneM âis chosen).  IyÐ ‘ E  !0C  ú� be K  Gof aÿ/ThÇ§À).

        õ$>>> ExtendedContext.remainder_near(Decimal('2.1'),  c3'))
   V-0.9' a )10` 6` 2^ 3¾ 1] $-¼ ^ -_ %I10.21& “{(/0.Á 0a ":3.6Á b -{ c V3, 11q‰3Ë#/3)P 33*/11)  5"""ó öa = _convert_other(a, raiseit=Trueí Œreturn a´Bb, cÎq=self)
^ °def rotate( �, a, b):  ÇA"""RQ 3s a) ‘d copy of, r times.N  2 ð The coefficient( Ïthe result iH    •digits in{   I  ðfirst operand.  p `numberk •places ofG Þ 0ion{ °taken from ^ àabsolute value?   dsecondb ,I Awith7 R �being to qleft if 
C 5 isE ´positive or9 aright ÖGwiseK®­Ó4D8"40 `] 1b9]  % à V y3456789º /-2^ A8912/ »6 e 0d , É 0+É Å  Î É !13 /, È 0K ,6  Í/ Àl('13333330'3)
  ñ>>> ExtendedContext.rotate(13 Æ, Decimal(1)8  '& &0' 5"""` öa = _convert_other(a, raiseit=True8 „return a� Bb, c“ q=self)
V ðdef same_quantum( �, a, b):"  Û A"""RO  s e ñ
 if the two operands have  O ¢ exponent.g  E ðThe result is never affected by eiÑ C aign or åcoefficient of“ .  g „ “ â mf2.17')’w'0.001'˜UFalses Z +	Y  FX 1	U ® %9Inf- J­ Ÿ10000, -1A % I )J )B à-s	Õ d.	ab\ocaleb W OTfirstQ@ aft!Qdding	ðsecond value itsdø~ (RZ'7.50ë2ï( @0.07* £] 0\ „ Z +3Z 7E+3<²· F1, 4¢ú O1E+4A 3 /1)J -1£4}a '” ­/Ohift³0a s( ¡ed copy of6g times˜ ÷
ÄÎ
H  edigits'!in6 I  	60.  p `number“ VplaceG "toµ  ‚¡taken from[ ƒabsoluteaoãug,� Àwith the shiñft being to the left if ósecond operand is
  ´positive or9 òright otherwise.  Digits shifted inc E õcoefficient are zeros.
  ñ>>> ExtendedContext.M õ(Decimal('34'),  E8'))?  #40 ' \ )12\ 9\ 0T y3456789[ /-2\ !12- b 10a 	 Ž 6˜  7 |+Å + 0)8 6, 2¬É L 7 6 /8)U 1M ù 2s' 	ª 5"""fÑa = _convert_4ö(a, raiseit=Trueÿ ƒreturn aüBb, cb=self)0�def sqrt( U, a):l `"""Squañroot of a non-negaÄQnumbeÈY § precisionŽI result mus9ð inexact, it is rou®1 usS"he ¥-half-even– —algorithmc | Õ Ë'È\	D -E   ž Š /.3‰.6244998ýQ 10 öó 1Þ 1êE	"/1.# $/1.Ô  a I 7Õ ¯2.64575131Þ Ý ¯3.16227766N ŸŸ1.4142135B  _þ 9
 !/ ÆÄaubtrac!Àf, a, b):
    ò"""Return the difference betwee ñ two operands.

9 ÷!   >>> ExtendedContext.subtract(Decimal('1.3'),  U07'))F  V0.23' ^ %/30^ /00^ ./2.¼ _-0.77_ F8, 5è  ý /8)I ,8—5’’ 5"""³öa = _convert_other(a, raiseit=Trueß òr = a.__sub__(b, c*V=self' õif r is NotImplemented:s  ta ð TypeError("Unable toU  � 0 %s SV" % bc KelseQ úrÓðdef to_eng_string(£ F, a)6 B"""Cø  h "a ) ð , using enginee< ð	 notation if an exponentä gneededIE8 9has9 Pwhich? õa multiple of 3.  This*Àcan leave up¥ q3 digit ä@left9   d¥å place and mayJ qrequireAaddiÏ Pof eió€ one or PtrailHzero#2The:<  isÁ affected by\ ü
›ãˆ('123E+1ó0'1. %3'É O 3O N +)-1‘�'12.3E-9ž "-î 9-12   ð !97E-ŽO'700ž %7‰/70æ "0H ‚0.00E+3'¨ Ž&ò*a.N‚”H?sci s a numbers scientific í$ þ   "À   return a.ð"__str__(context=self)

    def to_integral_exact(! Q, a):$  ( ñ"""Rounds to an 1 2er.F  " ñWhen the operand has a negative exponent,% ‘result is Esamek �as using ¢quantize()X Gtion Rgiven And aN I £left-hand-“ c, 1E+0' \ righ   ¸  Ä •precisionM !of� J D ( Á setting; InD K 3…ed flagsK Ðare allowed i4"isÃ  Ý €.  The rm Amode'�aken fromˆ L ÓˆÒ>>> ExtendedCñ.âõ Decimal('2.1'))P  ' S ?100S  j U .W B?1.5® 2'?-10X ?-10Y (O10E+° _.0E+6³ '�7.89E+77 À%O-Inf[   Winity» 5"""h öa = _convert_other(a, raiseit=True©�return añ )ü	_valueüÿ)ò, except that no÷U willÎ be*å ´ÝÃÅÝ0S Årk  ç ÝU Ý2W Àal('101.5'))#
  åDecimal('102') õ>>> ExtendedContext.to_integral_value(= †-101.5')A  Y (O10E+X o1.0E+6³ '�7.89E+77µ  &?Inf[ —-Infinity» 5"""h öa = _convert_other(a, raiseit=Truee�return a› cµq=self)
^ ñ# the method name changed, but we provide also- ñold one, for compatibilityR 7 =   ñ


class _WorkRep(object):= ó__slots__ = ('sign','int','exp #  �: 0 or 18 p# int:   qexp:  N© @int,, bstringù `def __u0__(!, À=3 Ž  "if 1 isN ¨      9 .Ž ! = }      ~int = 0 <exp5 ñelif isinstance(‘ #, 7• ^ { )  ._ i ‚ 2intP .±/K � J 5expI Jelseö �# assert¬  Gtupl�^  › " =K5[0]] ! ¦  /[1   Ÿ 8[2]ÄCreprÄ#b"(%r,  Q)" % ì³$, ¡
 �exp)



ð	normalize(op1, op2, precÍg D"""N& $s ' � to have,sR » òand length of coefficient.Ë pDone du ¡ addition.& ifc .M <�  
 — tmN1op24  V'  =5  
Ç0 ?
0 2“ `# Let p �= min(tmpt ` - 1,  Áadjusted() -Pision  )» a# ThenÐ png 10**N  to> G has#òffect (after rounding¦ nD ôany positive quantity smaller thang ¢; similarl—#¯qsubtrac^P  So V P ßG  qreplaceF”# it withh à.  This avoidsÚ %€ ògetting too large�tmp_len =A(strb3int2A "  .$  P=u +¨-Ÿ: ˜B - 2Lï  ð+ other.exp - 1 ƒ< exp:
  Ûother.int = 1 Pexp =/ 
 1tmp)  *= 10 ** (  % "- G Eexp)+   =  ðreturn op1, op2

# ð! Integer arithmetic functions used by ln, log10,“ Ð and __pow__ E ò,#

_nbits = int.bit_length

def _decimal_lshift_exact(n, e)�""" Given?  � 1s nf 3e, ¸ õn * 10**e if it's a. Â, else None.0°The computaÊ ó is designed to avoid! ñing large powers of 103ÓunnecessarilyZ ?>>>Ð B3, 4ƒB3000B . d00, -9 C)  #ë sÉ È 1"""Š ’if n == 00 Ah �elif e >" :J  *E ’# val_n ="st` divid !n.<  w 1str0 ¢str(abs(n)ô   L 1en(( T) - l ·.rstrip('0'4 Ç  ¼ ÚC B< -eÔAn //ø#-eL±sqrt_nearesDaDtClosestE êð the square rootÙ   …positive+ �n.  a isè Zâitial approximG0to > Q |.  Any P G ñwill do for a, but> c¦ rn ¢ n( C ñfaster convergence V bé	!P<= 0 m  
 æðraise ValueError("Both arguments‡ _X� should b*2.")“"b=sÆwhile a != bk `b, a =ï ’a--n//a>>ÛèaÆr
È1x,  ÌŠ¡x™a nonnega¾< +a!stAiß¡to x / 2**, ;Û² round-to-e{P case#La tib@b, q©2 <<¬ b, x >> l ã ðq + (2*(x & (b-1)) “q&1) > b)5divÆ ú Æ !a/X xbl"s;É Ç Ê � iEÒ 
`q, r =æAmod(… ; 
È r¾ öilog(x, M, L = 8¾ P9!M*4 p/M), wi�bsolute e”  b�Aable„  ¿ �erms only“3x/M‚r"s !M<Æc 0M *Õ²(x/M).  ForÌ h00.1E0x/M  10’p differ†A bbetweeh
b  © )ð exact result isð at most 22.  For
    L = 8 and 1.0 <= x/M õ10.0 the difference isD q15.  InC  both cases1 ðse are upper bounds on ñ error; it will usually beG ñmuch smaller."""
 ð# The basic algorithmŠ  œ ñfollowing: let log1p bem rfunctio£ # P(x) = p(1+x). \ n 3x/M  1p((x-M)/M! RWe us  #W GreduX ¤    F @1p(yF !2*Š ò(y/(1+sqrt(1+y)))-  ñ repeatedly until^ ²argument toQ  ê ´ (< 2**-L iÓ àabsolute value® 2ForB� y we can¾ Z @Tayl Seriesƒ eexpans$ Ì à~ y - y**2/2 +	 ò3/3 - ... - (-y)**T/T:  ° truncating.0T sØ@that? TÑ benough…T wholgpcomputa½ . ñcarried out in a form of fixed-point aSetic,‡ ðwith a real number z be— ò	represented by an intege¢# approximƒ `to z*M¨ Ào avoid loss� Ppreci@,c Ê3low€  -"ctâb \ ð2**R*y*M, where Rô $th» 5of zPs per¢ed so far.,sy = x-M� L9 T; R =R =  ' 0
 €while (RL'0absæÃ<< L-R >= M K Oy   R > + a>> R-L+ !):V  *  ­ ò_div_nearest((M*y) << 1Ã %  PM + _S7 ÅM*(M+_rshift “y, R)), Mu H bR += 1*)#  -bT termóT = -int(-10*len(str(M))//(3*LV yu ? =  ê w æ BM, T	Pfor kÒ÷range(T-1, 0, -1%? Yk) - :ˆ  *wð à jreturn& 2w*y! `def _d£“0(c, e, ps u"""Give s   ÷p$0c >¥ pÎA0, c«eCAq10**p *Ô@0(c* 2e),T 5an Ë#1 of=±‘1.  Assumb3at A  *Ønot exactly 17•increase ¦ ì!2;´ `ensateJP this �dividingz à# final result "10pF2fu# write� Aas dÛ fÙ beitheróQ#   f6O1Qd 410,A$ A<= 0$ '0.& .˜ AThus¸ Pclose0r1, f = § lèàen(str(c))
   À f = e+l - ( ñ>= 1)

    if p > 0:   •M = 10**p k> 5p-f xif k >=7  ; 2c *< k* Felse\ % ñ= _div_nearest(c,p #-k“  % Ðlog_d = _ilog" õ	M) # error < 5 + 22 = 27i  2  103 èlog10_digits(p8 1. ` ‰  C Pd*M, 	 910). àtenpower = f*M� Axact# 
ä  =  [  0 % ² :2.3} O 	f	¸ 20.5®jreturn? p N + dC £0)

def _dARe, p)Šð"""Given integers c, e and p with c€, comput + ð ñapproximation to¿0p *80(c*=2e),J €an absolG ¿oGó
at most 1.  Assumes that A � is not eg‚ly 1."""ð# Increase precis‡ ˆby 2. Th i' !isÌ qensatedÅ ó# for at the end¯ E divQ A100.- dp += 2~ urewriteª Aas dö fE �either f"W`1 <= d 110,R 0# o" A<= 0" '0.$  . É �n we can»  @ YgM )as…Bd) + #*f˜210)Ì âl = len(str(c)å #~ ö*_dîâ<˜]KV} ofx‚0.5 in cÄ c#]ó magnifies existingh / ð  by a factor of0¶0y H s x«§w¯
01# p¡ v: just ge›@whol
  ˜ Sby 0;ž -< Tvá ·f«p¹,10º"11&Bif f. ä Wextra8–abs(f)))-Õì"+ * ½0in ’_¥+7 Ð) < |f| * 1 =
 d „ u# after¡,	@|f|/uE 0 + ìF< 10 §  J f~ @_ten¶ f* =˜  Q!**_ 0 F 
Æ  X  
$ 
  Ý ôsum < 11+27 = 38é
ö v < 0.38Û G  À(f_log_ten +ñ$ log_d, 100)

class _Log10Memoize(object):
    """C$ ñ)to compute, store, and allow retrieval of, digits of theF €constant} õ(10) = 2.302585....  This & Áis needed by@ ÅDecimal.ln,   ´  1exp‘  ±__pow__."""C ódef __init__(selfá  å   .¶ B= "2š õ0929940456840179914546843642076011014886"
a 2getG b 7, pe ð"""Given an integer p >= 0,@ðurn floor(10**p)*log+.^  §  For exampl„Felf.p #3)E  s ¿ .“  5    #›2areÅð	d as a string, for quickŒ¥version toM #º  inÝô	 case that we've already+‡d enoughA  ;> Hd• PshoulR÷ ways be correct= ð(truncated, not roun'¶to nearest)ú ‚if p < 0É    óraise ValueError("p z öbe nonnegative")zK a>= lenÚ-Þ [ #÷ � p+3, p+6 09, ãø öcontinue until aß C “least one@d extra$ Vonzer” 7 $ 5= 3,  ªwhile True  ¬ > ¡ ,vù  to within 1ulpY  A @M = ª1(p+@ =+2)$ S   =`c(_div_¦2(_ißb*M, M)Ž@ #ifø ![-d ¢:] != '0'* q  ™ ]break 1 , +#`# keepÆ“ reliables ð
 so far; remove trailing }s` #y@next@   D 	% 
d .ryµp('0')[:-1]2 0ret8intp°[:p+1])

_lý_F + =Á)!

øãiexp(x, M, L=8·‘Ž1s xÉ  “  >—BsuchÞòx/M is small in absolutÞvM 9à¢approximatI1 M*Š `/M).  ÐA0 <=ö  b <!4,b   e¦ t  the result‹ bû¡by 60 (andG Àis usually m¾ ² 1er)" Ö# Algorithm: Ö ™ !z)óa real number z, first divide zG  by:1uit6ppower R¶2<ñ|z/2**R| < 2**-Lê#enA P z 2m1(+  Š 9 €) - 1 usx ÿ Û s TaylorE Rserie�#  pexpm1(xO àx + x**2/2! + òx**3/3! + ...
    # ò Now use the identity   , Ã expm1(2x) = Bx)*( Rx)+2),  ò R times to comput^ ƒsequenceB ƒz/2**R),5 M  p(R-1)),«   ,. S(z/2)
 3).
2 ñFind R such that xR ±/M <= 2**-L) ôR = _nbits((x<<L)//M)D ñTaylor series.  (2**L)**T > M? òT = -int(-10*len(str(M))//(3*L)ú yd òdiv_nearest(x, T ÑMshift = M<<RR ñfor i in range(T-1, 0, -1):   rQ #*(J c+ y),  5* iÌ ‘ExpansionF  f kf Rf  g F � $(kÈ� Ry*(y+0  { óreturn M+y

def _dexp(c, e, pn C"""Cðan approximation(1 ñ*10**e), with p decimal places ofÙ Ppreciç 	R~ õs integers d, f :ë   ] P(p-1)d   ap, andY q  (d-1)† 1f <yc „e) < (d+ S ñIn other words, d, _f is ã â w PdigitÞ  Ú ” $ `an err2ñn d of at most 1.  This isG  al ñ, but not quite,×qsame as M òbeing < 1ulp: when =' / °could be up­¢10 ulp."""	ò# we'll call iexp» $M N +¾0givu Op+3 ó  Ä dp += 2U <rlog(10)U Vextra*° = adjusted°Ponent&¸V 3 Ô= max(0, e + Èrc)) - 1ª�q = p + 0 … Pquoti] Z #/(—   U(e+q) qßPround 2dow¡1e+q§ 2if  F>= 0
c "= e  0 Oelse'  //Ø-)  » ò , rem = divmod(U ’, _log10_�3(q)Ñ€# reduce5 °ainder backü`origin•‡� ^ _Arem,NPZ R þAesul­_4s< 120; ïPafter¯ ës < 0.62k n	l B (r  p)z P00), ý ! -Ø3žúpower(xc, xe, yc, yªVGivenQ*  ,  y@pres-Bng D§rs x = x§ xe+ °  Ëy  g Ötx**y.  ¾`a pair»ÈB)ÊcÊð c-1)*10**e < x*ò*y < (c+1)*10**e

    in other words, c ñ is an approximation to x**y with p digitsF òof precision, and$ €an errorf ò	c of at most 1.  (This iA  al ñ, but not quite, the same as N ñbeing < 1ulp: when c‡ 0== Û ó(p-1) we can only guarantee� ’< 10ulp.)Wa Àsume that: xÿ �positiveÏ  ” Pequal1ã y& �nonzero.€ 2"""Q Ñ# Find b suchU ™ b™ ‚<= |y| <­ b: ó
b = len(str(abs(yc))) + y§€# log(x)' x¤@(-p-P ,“ ñp+b+1 places after0Ñdecimal pointi �lxc = _dO qc, xe, = ñ# compute product y*,  { Jyc*l~ 0+ye p“ !1)h ²shift = ye-â 2if  Q>= 0:$  €p�  U yC $  Kelse( Ò_div_nearest(5 ,Y-7 Ã 0if V 	g #ò prefer a result˜ðisn't exactly 1; t—rmakes i4 ¨ `# easiWo"qa corre9 trounded[ ¡in __pow__Ì  B Tif ((ä!xcßòxe >= 1) == (yc > 0)): # ifk6> 1 F ²coeff, exp @íu+1, 1-pl 
<8 Sp-1, 3 
/ 	c ð_dexp(pc, -(p+1).ãW QšA "10 (  ° B+= 1sreturn ( ôexp

def _log10_lb(c,[ x5= {Ú ð'1': 100, '2': 7	 à3': 53, '4': 4 v5': 31,6 P6': 2# 7? P6, '8	  , 9> "})gC"""C �a lower bÚ@ forw  Q10(c) %a % integer c. ó @if cåíÀraise ValueEà("The argumentÈð should be nonnegaŒ"."S@str_9 /c TC100*eW_c) -H[6 p[0]]

# À Helper Funcá s   ¼�convert_N( !, ñ óit=False, allow_floa v? �Bto D».2pVerifie at it's ok10use^ñan implicit construÓ ˜(If{  ·4tru�  0 0ver»a from   !; 	Bpis usedh  ‘ !ñarison methods (__eq__+ƒfriends)º ¤isinstance å  6Ç@} .f 8 >int4 M \ Àif allow_floóat and isinstance(other, float):
  ñreturn Decimal.from_$ 1 !)
* §if raiseit:   ð TypeError("Unable to convert %s \ A" % … )S y óNotImplemented

def _@ ò_for_comparison(self,D ó, equality_op=FalseÕ ¤"""Given aÕ   A ô a Python objectT ” Ÿ ýa pair (s, o) ofM ñs such that "s op o" is=  equivalent "w  !  ƒ�" for anyU fthe 6 ã > ò operators "op".‚1""" /ifÕ b ÚÊ ñ ,Þ G 5# CPö with a Rational(ó(also includes integers` #W  ò qn/d <=> !*d   (ß nfd: á, d positive).É ñ# A NaN or infinity can be left unchanged§ óout affecting theD ;r result] &”_numbers.ñ Ð  0aif notÉ Æ._is_specialî % Èq= _dec_)atriple˜q._sign,—  ,  	sstr(int8 bint) *¥€.denominÿ)M ‚elf._expW x 	ýÏB.num]Ùsj"À ]álex types.  == '!=²ñ#; 1 ip should)bceed, ™  Â eiP TrueÁ<ñ# as appropriate.  O+  \ sH  <ú° 
 Alex)( �P.imagê 0ü # =£Areal« e<YÓcontext = get («(ifÉs  Ç. €.flags[F¹O�ion] = 1†  * Oelse< _·!_e¢
C _`"stricqmantics«0mix²Ù s)Sqs are eö&d"Ô æL,7Y  ¹ + 
É,Ù@


# € Setup S›Rfic C[ s   ð 

# The default« Pprotoé„ used by_ °()
# Is mutßB, soõ4new> sº°have differúb ’values

Dr ¶ % =a Çöprec=28, rounding=ROUND_HALF_EVEN³ðtraps=[DivisionByZero, Overflow,ó InvalidOperation],
  wflags=[ aEmax=9 ' aEmin=- 9 §capitals=1 ñ0lamp=0
)

# Pre-made alternate contexts offered by the specific¡ ð 
# Don't change! 0se; ð user should be able to select" Fse
#f )an' ñreproduce results from other implement„ `s
# ofR œ ’.

BasicCÀ 3 = 
 (Löprec=9, rounding=ROUND_HALF_UP#ýtraps=[DivisionByZero, Overflow,°0, CVred, Und& ²Ä³)

Extendedž ¨ MEVENª l  
# ð crud for parsing strings   ð
#
# Regular expres ñ
^ tnumericf p.  AddiØ!alûmÄ!s:Q q1. Unco Ìð two '\s*' lines<�allow leaµð and/or trailing
# whitespace.  But not”apºA disP s7 Š in
# a º .¡ Ð2. For finite" Ábers (not in 0ies• a NaNs)Ä Cbodyœ#
#4 � between! "opQ sign=  c ðexponent must hav3 atñst one decimal digit, possibly afterc "  point.  ThE ˜lookaheadÂð'(?=\d|\.\d)' checks this.

import re
_>óer = re.compile(r"""ª@ # Aì ü ç1sisM0:
#) 1\s*�@(?P<ý p>[-+])?  U# an  ' @, fo� ei2...K   > È    Q# ...àªber (with P H)I ¦P<int>\d*)F @   #Ž C5a (uÑempty) integeftJ  \.ë AfracN ë #Ò ð  , 7parK EJ 1exp4R?\d+)N K ID, or/|œ @Inf(×yG é /náy?  Ž  œIal>sB ? (Ã!lyéa°e6NaNs 
 #K¦  g Adiag?
' Èˆ - `nosticÁ o%)p\Z
""",Ë�VERBOSE | úIGNORECASE).match

_all_zerosûT'0*$'& »_exact_half& 5' ‘ð PEP3101 supportÏ functions # g
# The? ¡in this seP òh have little to do with the Decimal
# class, and could potentially be reused or adapted for other pure
# Python numericR Àes that want} ðimplement __format__
#
# AP Ðmat specifier ¡ Á looks like:/ ñ  [[fill]align][s ô!#][0][minimumwidth][,][.precision][type]

_parseƒ t ð_regex = re.compile(r"""\A
(?:
   (?P<y D>.)? „ À>[<>=^])
)?
%  ’ c>[-+ ] calt>\# “zeropad>0 ´ “>(?!0)\d+ ñ thousands_sep>, 0:\.e Ù 5>0|6 !  P<ê  >[eEfFgGn%† p\Z
""",Ý óVERBOSE|re.DOTALL)

del re
Pólocale module is only needü @0'n'§	¸ . �¡
# rest ofiÈPEP 3101 cod¬Ñquite happily˜Àout it, so wV�don't car½£o much if Ÿ  is Ápresent.
try¦t import& Bas _1 ‘
except I  RError1 @pass/f (¯ ,,O ¢conv=None)F @"""PYH®validate a$
<õ Turns a standard<l Áinto a dict,' VD òfollowing entries:\    §:   character„�pad field y .Q !  Ð: ¬ KA, eiîp'<', '> “=' or '^'9  ô:( +# -#  # p o ð
: nonnegative integer givÎ ) 	™ 6ð: boolean, indicat1 1whe  0to â ä 1 s� 	GP: str6 €to use a¨g± separator,ß » ¤grouping: 
  Ø X 8 s™   3mat~  g Cd by” : d…l_point™ Cfor !  ! 5 úE
& Ê  ©?  ÒT: one¡"2s '4&%'5 6 1""" ?m =%@h.match1)9 @if mJ ˆ 0ñ     raise Value�A("In;AS: " + _ˆ)ëP# get aionaryq G_6Q = m.¸  (:  "Ðpad; defaults` 5  `.  If .  ^Adingb #Ð ¡requested,…  x= kAs shWRbe ab­à    fill = forömat_dict['fill']
    align = for   ! 	 ßzeropad'] = ( Áis not None)c *if^ E :  †  # Gill <   ! ðraise ValueError("F0 õcharacter conflicts with '0'"^  A  R" in Ã ó  specifier: " + _ Â  = #if,¤ A]OmentŸ    £ Ÿ ' 	Ü Ò !aor ' '
õ# PEP 3101 originallyû òd that the defaultï ¾ cshouldF ðbe left;  it was la�SagreeF aright-Fóed makes more senseH ñ*for numeric types.  See http://bugs.python.org/issue6857.@ 	ô j •
  ö 1>'
) #Ð sêÐhandling: '-'êÂ negative, ' @posi ?  š E  ']© á¥	� % =d † Äminimumwidth“ ñ
s to 0; precision remains>1 ifJQgiven� 	e Q ü :int”"  "0'Ò× ‚ Ü Áà . -= x  )ÿ q ì @1'g'© G'v7n aCof 08Tlittl4@;N@vert�@to 190ame0"d  unÅ Ûd7‡ .« V == 0ñ *  £ ù º l I  vn 'gGn'H  <	* 	s $ 1!ø%determine thousands separator, grouping, and decimal! $an¡ñadd appropriate entriel‰ Qå H== 'Ä Æ# apart fromt  s,& ò behaves just like 'grû %=" àif _localeconv a
A! =/ .6 (Ö q Ó NB_sepÁÞ 9 cpExplici’ „qË3'n'–v±%['Ë 
 9 áÀ    format_døict['grouping'] = _localeconv #
  �format_d: Þdecimal_point?  D Qelse:
  Q 9if Q ÷thousands_sep'] is Non1  5 2 
E= ''_ 	* 	ç o[3, 0]) · q = '.'
, hreturn´ s

def _j òalign(sign, body, spec)ñ ñ"""Given an unpadded, non-7 ðed numeric string 'C `' and S ‚    p', add J  /  ( J €ment con•   €to the g} E   !atœ `ifier Ï€ionary '² ñ' (as produced by7 Tparseë  ' = ").1"""& ñ # how much extra space do we have to play with?4 áminimumwidth =™ ([' '¬Efill      =  (*(; R - le•)  X"))· 2T  U 1if  r == '<'Å �`result4 Qign +ê$ +ˆÑ )el> >> µ +ÞH > =>  u > ^> ahalf =~ A)//2t 	Ù   [:1 )] ¢ u [ :š
Øòraise ValueError('UnrecognisedW¦cfield'‹^_Y¶‘_lengths( 6ingR¦Convert a ¹t-style - ñ into a (possibly infinite)ú °iterable of+ ð egers representAJ  6 … ïBThe ´ W from‰ (()D,Ê ŠPinputAthis„ ð# function, should beÕ 9ist˜ Qin on« 4the; Pollow© QthreeŸs¯## P  (1)yæempty list, or  2)Š  u †positive3+ [6q#   (3)J , “¡.CHAR_MAX]s t ) yðtools import chain,|1eat( eif notËÕ «Š[~%if% @[-1]´0p üÀ 7] >= 2E w \T[:-1]…  B-2])0ÜS m 8ì e 1  _ Ü 3u3³5forè  7}yinsert_=r(digits�a, min_^à=1):
    """Inñ,sert thousands separators into a digit string.

    spec is õctionary whose keys should include '_ ‘_sep' andG ñ!'grouping'; typically it's the result of parsing aformat@  ‡ qifier u _( "e_" _ µ ÐThe min_width¨ òword argument givex àminimum length€ 1theq ’ ñ
, which will be padded on  óleft with zeros if necessaryŠ I ,5  + H  æ ùadds an extra '0'[ !to‹ Àavoid a lead5 cÂð.  For example, inì1ingA òcommas every threeê ø¢ '123456',Ê 72=8,)C r'0,123,) 0eveÔough that hasC9ù 3"""AAep =G[]Z %  "']A  Rs = [1 ¡for l in _ _¼!s( Qing):X  ½–if l <= 0   ñraise ValueError("< Ã Ó ï•ositive")S ð# max(..., 1) forces at�Bst 1Y1 toì!Fof aªI 0l =¤(O Alen(|0s), ¹ b 6, l| ¦ ðs.append('0'*(l -· > 2) +‚ fs[-l:]; ^ $ = 2:-lN ôU -= l¢  Ï#ot2  Ê› U Ubreak< 
S ben(sepŽ Felse�?ax(S þ $`return�p.join(r2sed0•s))

def K°ign(is_negaû,»Tõ"""Determine sign character.ñ7if @ ë ‰ 1'-'Ó Aelif\  ['J  ']ÓM' +'2  Þ% ; CX 'É jnumberË Òintpart, frac
 <expã Fw2 a C  ñ€e follow…Rdata:¡î P true	 Ö@  >N ÿR falsg’ :u ‚«YPmust ð‘ar beforeXÂdecimal poin Ñ I 
¡come afterF > ñexp: exponent, a”qintegerr ƒE: di 	Ofrom¶ Û²%�This funB 3 us�"inÃ0ion  h 4 toÇ ¼©(û ½™ soÀ  format theq sign
  óformat the exponent ñadd trailing '%' for(   Ctype( ózero-pad if necessary îfill and align" A"""
+  ’ B = _� _ ò(is_negative, spec), áif fracpart or �['alt']:L  Ø ! =  õdecimal_point'] +D U †exp != 0U  æ ¦'] in 'eE'^ ðechar = {'E': 'E', 'e
 e
 G
  g
 @e'}[¾ "['O ]¥ â+= "{0}{1:+}".(e ,–)2 #ifË G 0 ==–• ó + × |  ¦8pad$¤min_width %qminimum ”'] - len(X )  œ’ Felse€ O 0² !nt¥ò
= _insert_thousands_sep(i  Ý%, A èereturnC(~ #, : +œ C P)


# ð Useful Constants l ðernal use only) *  	ò

# Reusable defaults
_Infinity = DU£('Inf')
_N¯# -$ (aN: 0NaN: GZero w0)
_One 1_ 
 0-1)ª t_Signed{ [)d] is i° rw/ thatþ/ E = (Ú -, Ê c O¡related toðhash implementation;   0(x)„ ¡based
# on0 Preduc& û of x modulo _PyHASH_MODULUS
  ¦0ys.V a_info.7 Aus
#j p values“  ã ­@posi>‚KBies, 5ansl =INFh 5inf   NA¾sˆ 1nan�¿ P10INVõ  TPinverrDf 10é   _primeó D œ= pow(10,( M - 2  )
del sys
VkPython• o } "io‹ !e., P
impoMs
 4abc Ucodec Terrno Estat y‰II P_thre0nst 2of   K1to  õe startup cost
from 9 H ðallocate_lock as Lock
	pys.plat+ Ÿp{'win32~‚cygwin'}™V `msvcrt æ psetmodeO _ 
Ê „ = None
à "io¢ $ioH ó(__all__, SEEK_SET
 3CUR
 ðEND)

valid_seek_flags9ó0, 1, 2}  # HardwiredÃ á Ñhasattr(os, '` rHOLE') × S ….add(os.* ¡' Àflags.add(osðN.SEEK_DATA)

# open() uses st_blksize whenever we can
DEFAULT_BUFFER_SIZE = 8 * 1024  # bytesR ð NOTE: Base clasY ô(defined here are registered with the "official" ABCs
# 7 ðin io.py. We don't° ð real inheritance though, because¼ . ”want
# to/ q ðC implementations.¿ ûRebind for compatibility
BlockingIOError =   > @Does­ !IOÑfinalizer logu Pexcepn 1 if ÷close() method fails?
# The - `s igno1°silently by"Àault in reletñNbuild.
_IOBASE_EMITS_UNRAISABLE = (hasattr(sys, "gettotalrefcount") or sys.flags.dev_mode)
# ß 3Àcheck its 'eps' arguOÿ?
_CHECK_ERRORS = � ô


def text_encoding(	 ñ	, stacklevel=2):
    """ ÑA helper funcQ€to choos	eS  J !.
4 EWhen ñ is not None, just return it./ ¤Otherwise,  ¨1deft ´ M ó (i.e. "locale")q FThis¡  em.Can Eê pWarning*« *˜  ” A and‡ ‹Swarn_€ / 0 Htrues `can be&dBAPIsia =e ‘parameterk Àthat pass it/ TextIOWrapj!or/0How!2, px°consider usÓ Ï �="utf-8"Q@new Œ B Ê&ifG!is�ë ïH % =]ª   ?if H 0 `mport FEingsH    .	 4("'x Õ-Éspecified.",@  D  áÉQ + 1); nj 
@k  ÊPtins.q 
#�rick so ¨  A() wäbecome a boundN Ç0 st8r
# as a”ñ variable (as dbm.dumb does).k ÔSee init_set_Š _s ðin Python/pylifecycle.c.
@sK!cmÌÚ2 `file, Eõ="r", buffering=-1,ý‘", M (Wrnewline  5�fd=True,•!er "):ê�r"""Open {  JÂòa stream.  Raise OSÏAupon~$urK< Pis ei	" aT!orì H  é0giv  0namQ!ndÙApathÀ éN !n'¯ 0 °current worYÒ directory) o4 !toG "beé dŸ€an integ Àile descript£	; ð be
    wrapped. ð(If a file descriptor is given, it ÷closed when the
    returned I/O objec+ ‘, unless :  fdE ñ set to False.)
E @mode ðan optional string that specifiesw  . qn which ¹ !isL ðopened. It defaultsp 3'r'1 `means ' � for readi qin text^ q. OtherP ñcommon values are 'w': @writ: q(trunca 2theG if5 al_ yI ²exists), 'x@ àexclusive crea÷   o‡1newD ‚, and 'a. Pappenª M (ý òon some Unix systems, â :@all ¨  » A   ¥ 0endn ÇBaregard±!ofYðcurrent seek posi¦ G). I-�, if enco�  †&no¶dK " uDàis platform deÚ went. (F’1andì  À  hñraw bytes use binary¯(Vleaveˆ $un5Sd.) T®‘available8 Ï:ƒ=  	  $³ ñCharacter Meaning -  	  $N  Ò ‚ Ì(ú)) "w'( ) S/, »Rfirst: x: ¢De a �tE(it8 a8 "  gr ÈŠö N2it .N bN ô t » ü +" Š ba diskh  – 2upd¸(¨ e s¬ >UB �universal2linE q ‚precated2 9K.å  Th•Ê¶ )a'rt' (Ó  Ç ½  0). E+arandomH qaccess,�mqQ'w+b'sÎfBto 0t,>lô&'r9  L+ uwithoutR0on.wîo @implÃ ?Û@rais›�n `FileE#`Error`] H.³`PythonÒ {áuishes betweenãæTed in/ ß &J!s,0eveMÕ€ underlyBoper[  doesn't. ­ ^ G rì (æ4'b'ê “argument);² contents aÁãK$s Wbany dee
€  ('òA, or¡“ 0't'.� *edˆ Àrgument), thñ$e contents of the file are
    returned as strings,& ðbytes having been first decoded us aE ð	platform-dependent encod" #or+  { –specified  ¡if given.
K ð'U' mode is deprecatž ñnd will raise an exception in future versionsJ ðof Python.  It has no effect4  ñ 3.  Use newline to11rolF 0uniV $al! sŸ ® Pbuffe5 ¯ Aan o’ �al integeû  edS 2setV1 qpolicy.e aPass 0( fwitch X ðoff (only allowed» abinary‰ A), 19 QelectN Ç B > `usable= Dtext; 0andL® >L @indiwN ·0ize>�a fixed-s Schunkª p.  Whenay Pargumi‘ç]sdefault>  '` worksŒ foï "s:2* Bó  ¼s½; – !s;m§ õ— Ò  ­cchosen›ð a heuristic try� ‘to determ‘he underl rdevice'Ö �  "block n  " R@fallD òback on `io.DEFAULT_BUFFER_SIZE`ýô  On many system€*õòtypically be 4096 or 8192 ¦Clong’ñ* "Interactive" î6( ófor which isatty()ss True)$Juse Jˆ.  OtherT  &  "¿pdescrib±2bovb   r ³ƒ « #"is¯atr namj T   "usE{ ü  e6 ®  V á. This should 21be ; "in³  X ' $e €H  «£É {É`, but ž, `suppor–#bycb can bð ±passed.  Se¢  0c71ule Þ @listTN a s Prrors­Z¥d that OVs howSe9  arÎ!àbe handled---t(�10not]0¯2 ŸG '} 0ct'q‰p ValueEr “jrÆ ¬š K (‡`of Non¤ 
 ª ),ð T� 'ignore~  J T ps. (Notq1at   ×S % §1lea“¢data loss.ó¯1doc·a] ¼Á‘.registerÃ$a Á É p)Btted’ 	ï WÖhCis a q5 Êu 1(itÛg papplies�æ ­ð). It can be None,� '', '\n ñr', and '\r\n'.  It works
    as follows:
 ô* On input, if newline is None, universal Ps mod! ? ò  enabled. Lines in theR € can end Ÿ #orž ª H ðthese are translate9 !toÚ ð
 before being returned ton B Ðcaller. If itÂ  À ¿ ¹ `, but õ G qendings‹ i  c 6 un¤ p £has any ofH  óother legal values, q d ±only terminô  byÔ c givenK astring.  =  Y ,is¦ îOoutpï Â  «ð characters written� þ ‚â system defaulOð  separator, os.´ 0sep/F l ª%noúð ion takes place4  Ø ¥  of
J g % Ê l FH  ³x r.6�closedfd| Q bool’   `False,’ € underly›ñfile descriptor willj òbe kept open whe4/ 1is X ò d. This does noÄ, !a * 5nam‡µ  ÷°must be Tru†£ that caseÌ 1TheKQy crepM ie �n-inheritÒ0 �A custom¬ !erÓð be used by passë au 8  c*Ù 0er*Ä eò 1for9ˆ Qobjec½tPobtaié!bya 1ingO a € with (*< Õ*, *flags*). ! Ç1 anÆ ?G œ(Ê 0os.¾ Ç q resultÝñ	functionality similar toP D  ;)A M #()¤#s ½è �whose typ(`pends û!he¦ñY Ñthrough which.�standardÍ  ×  ra— `s such½ 0reaÈ Â; bpperform¶WgPpen()ßØ toQ n¬ i
 Atext• a ('w',– 'l0'wtxr `etc.),~r ï °TextIOWrapp�p f J j abinaryl RL ðed class varies:U ä  0 G  š ð BufferedReader;6  e7  › #nd I  «t¸J aWriterœ N  „ /S  K $a 9 cRandomIåÐalso possibleLu~Ð or bytearrayÓ& 1Ðboth
    readñing and writing. For strings S ñ&IO can be used like a file
    opened in a text mode,U Ðfor bytes a B K abinaryM .h 1""" ðif not isinstance(‹ q, int):"  –   Á = os.fspath% ) A R(str,° N O ñ	raise TypeError("invalidq: %r" % c ?strU  - U   U Pbuffe«° þ ¯ 2 _  d Pencod!isiANoneÎv( ,/Ö 1 {  z  [/s x & v / t  r  Z€s = set(  !ift1s - ò"axrwb+tU") or len, % > sý LValu) b †   n @creax` = "x"E  s¨1reaˆK= "r ® 6 w Tappen8 a 5updo + ¼K= "t ‰K= "b Vif "U 5if Ù $or\ @ž 4or Ž 9  º¼C   U… ƒ€be combiuÀwith 'x', 'w 0a',f B'+'"` Q °import warnÖ\   .	 Q("'U'ú €Ådeprecated",0  4  D# BionWZ 6, 2u ½2Tru)"if  oUù õ ¬can't have6 ¦ sat onceè r$+ } +{&+ z?> 1y  H /l"e/? {  —(ò 9  Cý1
3musø €exactly �!ofÖ Ž T«[ Ì �  Äô 	; i@does{ taè%n L �argumentr Yp 2J n 
newlineo $Àsn't take a ñ%newline argument")
    if binary and buffering == 1:" & åmport warnings  .	 !("a D ( Ð=1) isn't supK Ted inz "P  l  ó"mode, the default¡ ÿ size will be used",D ‚RuntimeWº 2, 2÷ ÿraw = FileIO(file@  `(creat Î"x" or "") +l U(read+ r+ 
6wriV w+ 
VappenX a- 
7upd¯ +, Ú  òclosefd, opener=  esiQ= rawè 6try	 â_× CAalse(  ¸ N	C 3/ 1< 0gÆraw.isatty()\  A , E= -1X   { ?Truz ?< 0W ùDEFAULT_BUFFER_SIZEh 	ð  y   àbs = os.fstat(À  5Àno()).st_blk“	H ñexcept (OSError, Attribute ù  e 6pas[  JelseÉ    e8s >    CbP  6 ›!¢raise Valuž ˆ("invali â 6 l 	Q ,==s  YÁ �return rj	4‡  ca6rhave unÛ ºed text I/O� 
r 5 A = Bÿ €edRandomÅ,P2ingý Ø Uelif û4or °5or �c oWriterc 2J OReadJ 
"C€unknown Nq: %r" % ó Š# =“ÄÀAenco«=Ÿ_ (	 p ¿ = TextIOWrVr-$, / 0, e83s, »*, P À  Y ¾   .õ ! =ð  À ¬‹Q .((h  &q

# DefL˜ðpure-Python implec‘ation forhð_code()
# that does not allow hooks. ¨ 5 @irstÚ.l dH Àtests.
def _µT `_with_‚ƒing(path\Ð"""Opens the ñVprovided file with mode ``'rb'``. This function
    should be used when the intent is to treat the co As as? �executabl Ade.
 ‡``path``^ Àan absolute  * ñWhen supported by} ¨runtime, t° @ can© ahookedi €in order¥ ðallow embedders mor• Àntrol over c !s.> 	Çality is not’ !on’ @currš @ 1"""H  im¿ ‚ warning .	 Ð("_pyio.open_† a() mayk z@ing × 1s",R  š RW` A, 2)% preturn U (SÑ, "rb")

try:"   p 8 =  þ
except AttributeError4 _A _N_Ì òing


def __getattr__(name)A 0if  ò == "OpenWrapper"  Ö ö# bpo-43680: Until Python 3.9, ,2 wa�òa static method an N quiltins`4 0set    Úãbecome a boundP -L ? Àa class variã3. _F (0a bx 5-inRc whereP Í Dis aé „D. In H3.10þ  ()g 7nowŸ 	,
ˆ  6 ò"()® � ª  Ùs®'8àis deprecated,&rŸ instead'± S D5 5ion¹³stacklevel=Ä * wglobal u ñ  ! =x  þ"  [raiseÙž@


#n`normalM  ra¥, both `Unˆ2Ope '`sÃ2 toö 
# same object.sF ~ ‰	|6 1(OS±b, Valu½} Prpass


@ ±IOBase(meta â=abc.ABCMeta):¯`"""The £tract baseû²for all I/O pes, act±@on sQms of}Pbytesf2ere¼ó public constructorú}“  ¸ðs dummy implemenò@ons „ Cmany­as thatp tderivedš ! êðride selectively;³Œ default` J r®sâa> d  P 4Ð read, writtets seekedÌ !Ev6Rough qB doe»qdeclareB 1 orD ‘e because| ðtheir signatures willu,y,¬ ïcclientšÀd
    considñLer those methods part of the interface. Also, implementations
    may raise UnsupportedOper$ ƒ when op sX ¢y do not s/ A areK �called.
 ñ6The basic type used for binary data read from or written to a file isJ Ñbytes. Other  Ð-like objects Ã accepted asP arguì as too.J ñText I/O classes work with str” ¾  Note that Õ ting anyZ ð
(even inquiries) on a cloä sstream ¼ Êundefined. I}yóOSError in this caseˆ óIOBase (and its sub¼ )ët¢ñor protocol, meaningù Ê 3an O :‘ can be i< Ðed over yieldñ  W Plines˜ aG Ü 
› Dalso‹ ° :keyword:`Za` statv3. Iâ 0exa,V 0fp õ ?1aftÔte suiteË J I 0 oB 2te:o! ðopen('spam.txt', 'r')1fp:k p    fp.k€e('Spam Zqeggs!')# 2"""R P### IBrnal ### fdef _u*Æ(self, name)d 4"""; :^4an è ex­1ionM i.ˆ  ¯   r ˜("%s.%s()‘Qed" %Í  =  ½ 1.__SP__.__È #__Ð )ó  	@Posi4 	AseekG a, pos,0Jce=0`Changee pM I ¡ !  te N r   õp offset 3. AÜ  k G ò0pre
€relativeA  X v p indica# #by° ‚.  Value J  « ü!ce`Cintsj  `* 0 --‘n´ (h ”default);² `shouldj@zeroë‹ v6P 1P |current(J 0mayG 1negÚ ã0* 2? 0end0� 5 ½is usually 9 DSomeuÂng systems /€ cÀ ±provide add™Aal v4Ç€Return ati 4 Ànew absolute¹F ™ ñ U.g"i"’ …Atelly
j‚ 
`
lÃ ‚  t X(0, 1x 0run>| õK=NonýT% Hrto size¼.S / ¦ ] ¤ %IO$ Â"rešð  by tell().  Recturn
  Õthe new size. 5""" ñself._unsupported("truncate")
' ò### Flush and close ### Pdef f (J !):2  ~ 2"""5 òwrite buffers, if applicable.E  0 ñThis is not implemented for read-only‚ ÿnon-blocking streamsÝ 	`checkC· 5d()  à# XXX Should t}  re< 4ð umber of bytes Ä bten???± !__’d = False   A f œIO object�method hap effect9 5 @file( aly�d !ifO š.³ ¢ v:try   0 Õ0  ofinall2 b g = Tru__del__ òDestructor.  CallsÐ 8().¥¦ f ~«  Úúexcept AttributeErroræ �# If gettC? p fails,ÿn › k…probablyb  À# in an unusË÷ state, so ignorp / ](  "ifê d™ '  ú	_IOBASE_EMITS_UNRAISABLE9 	äJelse' £# The try/&I å rin caseûis called at programþ ðexit time, when it's possiblF ôat globals have °6bee  
¡# deleted,ÞtM  é—!()‰ a might£‹.  Since� `there'0 thÕñwe can do about such@ Duresi  P,noØ } aend us±0we Aress–tracebackt Ç ¤  –  ~
œ  Bpass% všInquiriesp@seeksQ RÄÑa bool indicaå0whe#Ö Ò ÷orts random accessˆ"IfÚ , n ¢(), tell();"ñ() will raise OSjÓÌ±may need to•S test\ 2 õ†  `_ÎSª, msg=None“Internal:  Uå�OperationVR z í  [^’ O) (t  Ák 0("F»#or´ us .• I   ifò  @  õ ð  else msg)

   ó def readable(self):
  ñ*"""Return a bool indicating whether object was opened forR Uing.
L ‘If False, õ() will raise OSError.- 5""" r‚ = O  ³ x_checkR¹ ª, msg=NoneÃ “Internal:n ñUnsupportedOperation if file is not¤  † ’ !if$  -.;t  >Ù k 0("Fi œor streams .û  I   ifò  @  õ P else )&@writÇ Ù7 R Ù  ð e() and truncat é1WÉ é9 ´  "é) (é.J é5‘@propertyÄ  oclosedõ  :Íò .  True iff theÿ’has been * ÀðFor backwards compatibility, thisˆ$a Œ ,#  e3eÝ
K"__u ¿åCÎ úqa ValueVÛa TÕ† #  , ÍS P("I/Oï=o0EØ·÷### Context manager ### _eÑ#__àÀ  # That's a| ¡¡ reference Ä :"""W @ment¯‚tocol.  ê s ø
 (an instance of IOBase).2 ) .£)n µ # 	º 3xit¹ w, *argsN¢ RCallsš-()Š ¹(ý FöLower-level APIsGÀ# XXX Shouldü se be pres1evepunimple(6ed?Ç  (#no~ò ,�s underly& , ³ descriptorX t)•§one existsg$An Pyd-  ¢$IOn2doe¨0useö Qf k Œð._unsupported("filñeno")

    def isatty(self):   õ6"""Return a bool indicating whether this is an 'interactive' stream.
N K õFalse if it can't be determined.0 5"""  ™ õ ._checkClosed() r£ X Ò ð
### Readline[s] and write Rs ###(  ú r( ü —, size=-1r!adF l  a J þ of bytes from theõ !IfS  "òspecified, at most C @will
 � °Size should gan intT2The‹ ?@atork ñalways b'\n' for binary files; EtextC ,Â 0newÜ ðs argument to open­ „ @used aselect4  1 L Š Ï(s) recognizÙ0# FŸ ðackwards compatibility, a (slowishK Ò&() Pif ha¼rÀg"peek"¿ È ènYkahead(  "  1 = l G &(1e %   uif not 0 -   '1 Un = (= ö	.find(b"\n") + 1) or len" �  ¤_ >= 0}  d Rmin(nÎC ž nž JelseL 2ã iê;NonP ³ 6= -/ t :try…  5 9 `_indexšRize._ %__¿  ( þexcept AttributeErrorO ’raise Typ! @(f"{b 0!r}7 ÚcZeger":±  x  > š ˜ 	™1s ="Warray Rwhileþ6< 0öAs) < 
º bb @elf.:(Ê
£ �b>  § Ybreak1‰res += b ó if res.endswith›O PÈG(resX�__iter__žxdÐ # §n__nextI  {  i  
Æ 	PStopI´6tioÐ  5 �  {  sË p, hint=éÖ * ! st!4 ! H [" `qcontrolafnumberO  � •: no moreÂk I g —ðtotal size (in bytóes/characters) of all
  õlines so far exceeds hint.# 5""" !if ² is None or U<= 0:&  \ õreturn list(self) Un = 0 � E= [] @for  @ in ; 
Y   �s.append( Z  x �n += len  qif n >=² 
T  9 Ubreak„ ¿ Anes
 �def writet sÔ ,§ &s)M @"""W$ ! aú  n/ ò  to the stream.R  v ðLine separators are not added,™ itn`usual @eachX  O \ ž  L €providedm Ahave… _ 1 at† ?endß næ._checkClosed(] |  p  –  sö  } ;  zò
io.IOBase.register( Ò)


class Raw  :0"""9  &  z ð raw binary I/O.”ø ð# The read() method/ñimplemented by calling( ó into(); derivedF j Àes that wantEqsupport7 ¢() only neab A  ƒ [ ñ as a primitive operation.  In general,V 2 ccan beJ Àmore efficieˆ 1han, #()8ð# (It would be temptÞ ƒto also E an ¦ � 3 ofd ® €in termsT  0(),ãAcase-`latterU!a › tsuitabl¯ é  S, butK¦ 1lea–ô nasty recursionh • Qa sub‰† doesn'tÀ ’ either.)! �­  wš, size=-1‰Ru Rand r‹!upÔñize bytes, where= ß  � td ÓR8 sH cy7 ð  object on EOF,!if/ !isÕ  G 1setÓ�to block ” °has no data–  Ì “%if¡  g u Í E= -1m / <� 0.n 7allÝ1b =Þ `array(OÆ.__index__() ¼C ½b `
¨ ‚ Á ª †del b[n:ø& �+(bê °  z ä Runtil� us	ƒmultiple7ÿ3 �  9resñ Ä ªwhile TrueÂ ©=�?ö(DEFAULT_BUFFER_SIZEF  d  !otâ
K   
m   “ !+=/ #[if rehr•­Vs(resu 4elsµ À       # b''§ or None
  Áreturn data
 ñdef readinto(self, b):  7 à"""Read bytes % ó  a pre-allocate ò -like object b.\  A Rq @s an> ó representing the number ofc  Œ õ (0 for EOF), orŽ  Ï 1 if9 l ñis set not to block and has noé    W .H 5"""  ô ð ._unsupported("-  ë "")È  $_write!W ” Àgiven bufferv  á ŸIO stream     i ðten, which may be less thanh ¼ alength=2 inBæ  i eã õio.RawIOBase.register( Ð)
from _io im#… FileIO
" 5  ±)


class B"ed] ( "):W0"""s  +  ñ:Sed IOLs6°The main di]¥ence with … ! i!t!Ò‘() method/ßes omit~ásize argument,90doe:ñt have a defaultE Pimple+ @atio‹ at  0ersî7#()µ pIn addi, ,“   ]!()o † « ray rais¯BÈ¤ingIOErrorôpunderly<3rawX ù qin non-ÿ1ing­ Amodec   œ Qy; un¨`their C Ðcounterparts,;²y will nevex2 {× �A typicalashouldŒ�inherit ;a¦š 
Gâ, but wrap one¿ ¡+  { ¼ z °?=-1¡  ô«  upŽ +  KAere  i‹Í  ¤IR Q&1ed,B „’ negativeÂ F Y A y Rs allrPuntilÀf BposiT  ¿  â k  Í 'i´ ac; ±', multipleÑ -s6aissuedeatisfyG  l  Ô A (unb0EOFþ ðreached first).  But’? � v âas (XXXt Îðpipes?), at mostß . F  ¬ o2be ¬ „õ a short result “ 9y� ² ‡imminentpzRempty› array onžR|/s ydÏ  U ì  \ mo'Í §  Ñ    r ‹  ó1ôéà with at most ó
one read() system call,
  õwhere size is an int. 5""" ðself._unsupported("Y A1")
$ 1defj Pinto(- Q, b):  l Ð"""Read bytesf óo a pre-allocate ò -like object b.\  A L  r ò(), this may issue multiplë õs to the underlying rawŠ ástream, unless* `latter×'interactive'~ dReturn"  represent]  l “number ofá  © È (0 for EOF)K ñ	aises BlockingIOError if‹ 
µ  ­ u has noÃ qdata at1 Lmome´) r·  � ._” ž!b,ª1=FalseÀ 1Áàbuffer *b*, us€at most wpÆHÃ8TruGj y$, p÷if not isinstance(b, memoryview*  ü7b = 5(b)á  £b.cast('B'Ë 3 iŽ1‚  9= †1(len(b)Q Oelse4 3 @n = G  ] ‚ €b[:n] =  ’n  5_writeqW æSgiven\wæ#IO%c÷™ n  ten, whichóSalwayQengthÆbiw _ Â
Ÿ °is full andÂ P á0canPaccepD!re8å	 Ð   d™ å e™adetache[ß€Separate¬ :`Q from â  Ú Ï'it AfM }4raw=  ÂRbeen ‹  edÅ#e K i …unusable/_state’]  ú Aio.BŸúedIOBase.register( ¶)


class _ \Mixin) :´`"""A m! ` implePation8C  t R with× ‹3TÌ0pas=¿requests onË@ A  It)ðdoes *not* provide implemeñntations of read(), ñinto() or
    write(). A"""
	 ñ	def __init__(self, raw):  7   p._raw = 6 €### Posiw ring ###  O CseekK ×pos, whence=0U Snew_p@ 1 = d Araw.; 5 )‡ 9if 5 6< 0¤  ¨ ñ raise OSError("J ô) returned an invalid y "^ ' 	b Ð AtellÐ Á 8pos¸ # O  ife  ¤ 6 ¤ 7pos› qruncateŸ ,u W=None© [Ö_checkClosed(§  ¢Writable()]  Rð# Flush the stream.  We're mix÷ðbuffered I/O with lower-level ,À‘# and a fS ñmay be necessary to synch both viewÎ { wcurrentJ 0fil’ 2ateÍ ­ Ì ] Ã ‰0is 
1Ã‰b ÃXXX: Should Jðbe used, insteadm@pass § V
F ‘  directlã t¯?% y¾  " C(pos‹ l‰ BcÅ
pö  C ø"ifV0 dú +SValue.C B on /  b \ .Ÿ ( a ì0 ~|   5ais not  O : ™ :tryª  Ú # .´ ¡BlockingIO¹ Ò or BrokenPipÌ E etc^ ?   q ¼    ofinallu  2  ò § ò odetachó nÀ t W0 al·"y \ ,ed{»  ; 6 šð ¶   ! =r g2rawß TšInquiriesN ï
 M ÕC   ( §‘@propertyu  <raw'E  ¨ Ž ; vd> 	œdD 2namÅ  $ @ ?mod@  $ @  ñ £__getstateLz Ÿ#Ty§`(f"can�pickle {YÀ__class__.__œ Ó__!r} object"ij Àrepr__(self)3:
  õmodname = self.__class__.__module__, ?cls, @qual . 6tryg  n    h   X úexcept AttributeError< ó	return "<{}.{}>".format(¿ #, œ )U ?lseD 	 ƒ O={!rN ,% !)
U ò	### Lower-level APIs ### °def fileno(I){ »   S.raw.& V  8 oisatty8 & A)


¤ò
 BytesIO(BufferedIOBase):‘ 4""" ð I/O implementation using an in-memory bP ! bN B."""H â# Initialize _ € as soon òpossible since it's used by __del__(–ó# which calls close W b= Nonex  �__init__ ,  Aial_© =+ gQbuf =Ä SarrayZ  x*if: q is notl § *  D *+=. ü  Áª ;buf xpos = 0¿ ƒgetstateÃ ¯ "ifqd‡ ¢raise ValuF("__J 2 on=dq"] ¢ jÀ__dict__.cop¬  T@getvZ T‘ B"""Re1theH!s ) ñ  (contents) of  $S  x  ,    Ø � Ô ó³ .ƒ@2get˜! Ô pa reada¨�and writ JviewÖ .× 3‘ Ø { † ¼ Ý  ! Ù fÒµg.clear‚super().c Q ,s Ÿ, size=-1|  6 º K _ from´ Ê  Z/is�  } U = -1”eÖg † 9 `_indexq@ize.K7dex  ( z ' ‘3Typ�0f"{b 4!r}zIWteger� ; ±    > š § –:< 05 1lenœ, R   =if  $ <ÚÀpos:
         °return b""
   ònewpos = min(len(self._buffer),   # u+ size): 3b = - [+ ": W ]-  =  • �ytes(b)
 ‘def read1� ,{ Q=-1):  ¹ ñ"""This is the same as5 .%  h Š  [ (Ï    o Swriteo bi "ifç fclosed�  … ñraise ValueError("F B to / f file"5÷if isinstance(b, strl T 4TypS bcan't Y 0str] `binary= 7eam_ ðwith memoryview(b)  
¸ @n =  0.nbwñ  # Size of any  Á-like object% � šif n == 0P \0(  15pos 0if  -> k
Q â# Inserts null‘ � betweenð°current end¶   ki  ­ Q# and. 3newA†position$ * ðpadding = b'\x00' * (© -© Í : O/C += J ˆ   P[pos:V @+ n]l &  5= n WnCseek¤×pos, whence=0D° Q ? on¯:try˜°pos_index =É"._ %__´ ò except AttributÅ
E 6â�f"{pos!r}Íçnot an integerÜJelseH  0‡ … (š#if¬ ƒ<Ä Îš Ð‘negative )>a %r" %#&,)w  C ñ› l• 1Ë 6 Zmax(0z6posf eJ 2J l  +½R [	´unsupported\vø¢¯Ì ·Atell·¨& B ¨z UruncaÙ�pos=Noneˆ 'P Œ `0is i 
�! 1  Üz ' ~ & ‚ÀtributeError;:
  ùraise TypeError(f"{pos!r} is not an integer")> NelseP úpos = pos_index(4  if N < 0: Š CValu‹ ð"negative truncate= öition %r" % (pos,)c õdel self._buffer[pos:]¶ `returnE 
 Ðdef readable(8 )– "ifJ fclosed  ?ª ‘I/O opera� 2on 7 g file.8‚ FTrueƒ Owritƒ lOseekƒ d�
class B±¤edReader(_ ’IOMixin):04""" * braw[, ðr_size])+ A e for aéò, sequential BaseRawIO object.; û
The constructor creates a§ [ •the givenc A rawa£stream andŒ ¡ H. If  jñomitted, DEFAULT_BUFFER_SIZEK �is used. 2"""©  Â�__init__Â,| 	=R  èA"""CÞ c a new˜ !edÍ Ÿer using ä  8    ›     !ifBEraw.g{  # K"OS}ñ'"raw" argument must beŒ  Ÿ#.'Ü ; #.	ir,<=‚‰ ~dinvaliº [Ê /.v# =;ã¦ ¥ ' p_reset_ ™ ó ad_lock = Lock(æ  Þ 5  û Þ=rÌA 
ax  - C   .–  Á -""¹ 2ad_Ó0X  ” � ,W=NoneX 0"""œ c bytesW R¸ —s exactly% ñ  of data unlesstpunderlyƒfraw IO  [ñreaches EOF or if7 Ácall would bXqin non- 5ingF Amode� Þ ˆs,td until]  ý )^ H Y œ å ] 0ot , O< -1\ˆ`number&T1 to¤ ”Bwith¶Ö û à:
            üreturn self._read_unlocked(size)

    def  Ñelf, n=None):&  * õnodata_val = b"" Pempty Áues = (b"", = # Xbuf =‹ 5buf  po7 ¨ 2pos�  w ð # Special case for when the number of bytes to é p is uns7 Ufied.j @if n  � ¶ or n == -1ä  q ‰ 2setUbuf()D  # ±if hasattr(. `raw, '{ Gall'4 -   TchunkCraw., X  + 2if . !isE
�  "   Ý�buf[pos:]Î  Ö 	§  ) OelseC +y 	C ‹  Ÿ[k ¡]  # Strip„‚consumedƒl } €current_pI = 0[ Ÿwhile Tru   ð# Read until EOFß   9 () would bÐ
s w nk
(n Å0	 	Ï  y   ]break 	
q+= len(D 
Y A  �s.append% üc"".joiH  s)$¤ AT+)#, [ œat most nÕ@avaiÿ ¿ pbuf) - ¾� # Length‹ ™( àable buffered =«Š1<= ) 
pÁ# Fast path:b : ÛUfullyY T  =�· ™ I+= nŒá Íepos+n]" c# Slow{  jQ from… cstream’benoughA arev,G #or* "an¿Pccurs¢Æ 7 = s[ Âwanted = max|ac6, nO_`J < ndd �(] C  Q�$|/ =J  M   © #Î’more thanNR only$~ „<N#¹OBhaveT5nnRin(n,`  2out	ˆ^ Œ bout[n:@ k  *Qextra" iÕÑ×G  ÓGrã X ð:n] if out else noñdata_val

    def peek(self, size=0):    ò*"""Returns buffered bytes without advancing the position._  C ðThe argument indica@ `a desiP òminimal number ofb E; weˆ ñ#do at most one raw read to satisfy it.  We never r¶ F morE Pthan é .Ì _ï .d 5"""  Þ + _h V_lock × a O _C0_un& 0ed(W ) ` jngÒwant = min(n,x £ )— ¡have = len±.� bbuf) -7  5pos4 1if 7 !< f #or := 0Ò !to= " =J � ! -4 S   @currÒ. @raw.*(F ´  - 3if 0 
s   B < D_buf~ ‹   [  tpos:] +L 	� K upos = 0# 	¯m \ µ # 1e,-1aads upƒ2izeµ,
¬øead() system call.j$# aL P.  IfK 3leaø {& iŒ,$d# onlyú¿¯À.  Otherwise5 9 doI!if, < Öž] @b9 =Y|b`÷
Y1VX *  ±ƒ–     [ Â ,=)¿p# Imple» â d ¡into() and‚  01()•ó	not strictly necessary (Ç`# coul6 Qly on/ôbase class that provides an iz aQÁ in terms ofÝ # Š P1()).Àdo it anywayžAkeepn [_pyioX L psimilar/  Ç' v (which=  ± Óe methods forI °performance¡ Rsons)]B µ,T,' d]  ª `n *buf*ZSƒ  íQ# Neeðcreate a memoryview objecth´type 'b', oD pwe may ×pbe ablebassignî  1it,1sli(itC ò… n~  ¬ !ifb `isinst7W(buf,° w 0 $Ï  /  ifT .n)$s ‹À          reƒturn 0
  õbuf = buf.cast('B')
 —written =1 õwith self._read_lock:2  V dwhile < ¶< len(buf):Y  '   ð # First try to Q à from internalš 9fer`  9 Àavail = min(` ‘  k ( -£ Epos,† )L 1if O 
Æ  f   Cbuf[Ì : +/ ]] = \M  3   
‘ [ Jpos: P L 
* 2 +=¬ , Ÿ % %if›%==ü  É _breakºóIf remaining space in callers¸ý  is larger than¶ #é,€directly oT E %ifÇ % -Ý >¿buffer_sizeä  Þe@raw.�@into°ö]3 �if not nW  " ;m # eofµ    °nbðOtherwise refillý  - unless we'red  ^PÐ1 mode and alä ý y got some data: #elÞ (. 1: ® )ð 0 J€_peek_unOed(13  #† A# InÀ  “Ä   Â�as soon aý _ haveÏ i«)adÈ Ç � Œ!rem û  �def tell(ì Û , !_Br¦edIOMixin., ! -© 8 =¬+ªO6posg Aseekg !, Ä‡whence=0v  Ï ��in valid_: j_flagsè  raOáValueError("in2  \  ? 6ue"òï‚ J== 1o  ãRpos -jú ¦	 8 -= O Ú ±  s h 2setVJbuf(# ®odclass ¸|Writer(y ¿D"""AÞQfor aròeable sequential RawIO object.Òû
The constructor creates a{  W —the given_ 1raw"°stream. If ' ã p •: ð, it defaults to
    DñEFAULT_BUFFER_SIZE.
    """
	 þdef __init__(self, raw, buffer_size=DF !):>  K `if not6 §.writable(  # ôraise OSError('"raw" argument must be > 2.')œ  ; !_B‰ ®edIOMixin.­ )‹ ¸ V <= 0¨  N ‰ RValueŒ ƒ"invalidð  ð "Q  .S =) x ' _À ûe_buf = bytearray(M & Ãlock = Lock(î  Š C A R Epreturn  G.rawi*< eÃb< ÷if isinstance(b, str 4TypQcan't‘e/   to binary 7eam#Bwith™ Û 
v"if! jclosed  – ev 3 W filet  5 ñ# XXX we can impleMðsome more tricksE Õtry and avoidµE rpartialì s aif lenR.Ü bbuf) >Î Ó ó# We're full, so let's pre-flush theKÉ.  (This may€ ¡ ³B1QingIO¸ v¡charactersŸ –ten == 0.s C   9_z 0_unL 'edš # 0bef6=ô 	˜ M £ îš.extend(bw    ’ Q 2 - q 	Z r)>try‡ Ù ¯ ü 
 ' |except iOas eX ­ ) q   'gve hit]�. We hav!ac� #a ¯	6 I  #ÉïÄcut back ourl9 �overage  - -ôJ ù3-= U + › 1 8 ![: k]M )ð(e.errno, e.stre�,$:ten±d Ž 6tenXttruncat[‡pos=NoneC�© ˆ e_a
5 …
 if pos is _ 
?  ß  =‡ KtellÃÂ Àself.raw.truñncate(pos)

    def flush(self):   Pwith  Æ._write_lock  #  > 0_un  7ed(X _  0 b "if` jclosed[ ñraise ValueError("L B on / v file")¯ BhileP ° :bufT :try  Ä 2n =6 Araw.é 	õ 6bufd  0 €except Bî QingIOŸ X Á dRuntimÃ   õ.raw should implement RawIOBase: it "Ö  r  "E Bnot m ”  C Ïif n is None¯ B (ˆ ßerrno.EAGAIN," "H! cå     coê 0te USout b?J", 0`§ ]> lenˆŸ or n < 0¿ !OS�(€ û() returned incorrect number of bytes%2delDF[:n]+Atell™ Èf ö _BufferedIOMixin., / +Ñ W AseekW ÷ , pos, whence=0f #if  R�in valid_: j_flagsA!in2 F v\ÿ  ›	ü  £
T ÀÕ
¿ § á ,Ö" ô ” E WÞ (« T Y ¥ »ð
# We have to release the ƒ and cal†ç() (which willH öprobably just re-takK `) in c] F ÷ has been overridden inO  a subclassÓ  ’ ‚user set©G ðto something. Thisç . GsameO ±behavior asß C�eation., *_# mayg › ’BrokenPipêE etcL  qŽ® (/zfinallycòQ  ²ã t
(„tRWPair( ]"):rc"""A b®q readerè¸Pr obj+’together.6 3 (  "N 
C Dput G 1 toõform a sequential IOs qhat can• “ ×0ypiŽyK AusedT P PocketŽÁtwo-way pipe¼ À  reader andñ writer are RawIOBase objects that òreadable and
   7  ð&respectively. If the buffer_size is omitted it defaul\ oI ñDEFAULT_BUFFER_SIZE. A"""
	 ð# XXX The usefulness oh óis (compared to having two separate IOE Ô )� €questionÁ .f ðdef __init__(self, õ 2er,ì (r,Õ =·  !):j  ã"""Constructorb    Æ ‘argumentsZ ­ y¢ instances  /      cif not• .œ  ¾ (v  & ðraise OSError('"( Der" u � must beH  A 2.') > d .  # d  ( d    A 	d  \¿ aer = B)’edReader(¯ 	k)V:  T 	: WÁ( : ;  Ú X Ö ”7=-180if   FNoneÇ  A= -1L   qreturn Ž  X !erÏ (* Ls Cintow bq B . bC Ô @ $ r¬(e(= Cpeek<  š /=0� / 7ize€  Þ 1D 	7Æ 1	J 
1Î  ‹  KŽ Ê + Ê  &?  $ eJ+ ? _flush{ 	< ( 9 \close9 ;tryd2elfÂ"r.2 õofinall1  è e1   ylisattyu ® ) B) orÎÆ  •@propertya £ da 	I ) †


classìdandom(ûÁ, "): C"""Az A€nterfaceïrH @ accsstreamsm icƒ¡ creates aù ñ#ndÙ° for a seekø I ,ï Ñraw, given inÚ@firsÄñG õ : ñ í. ‹ ˆ U€³raw._checkSÖ (RÐBufferedReadeór.__init__(self, raw, buffer_size)
  B edWrite8 9 ƒdef seek^ ñ pos, whence=0):#  _ #if à not in valid_: f_flags+  / ñraise ValueError("in2 F v "¼  Ü v.flush( i› Êlf._read_bufe p# Undo  u ahead.¯  „ Qwith X @ JlockA  & ! @raw.Ë o ˜pos - len vbuf), 1£ à# First do the�N, pn empty ¥ ¶0, s- %at® B# if& !aw? P fail‰Ãe don't loseõö ed data foreverô  ± =ñ Ð Ï´ b_reset<:buf˜ m :< 0Pö#OSóR´) returned ‡positionÿ$ Q pos
 –Atell|
‡œ wäH 
J ]  ÷Kelse½ §  ; wReader.; < ™ qruncate� ,µ Z=None§  !0is  
h   §] ˜R# Use 1to 3eadýîê › )Q )´  9µ     ¶  A= -1 Bˆ¥ – Ey “ Cinto— bD` 	F ô pÛ Ã 	Ôb G Â 1¿ b /-1Å 'I d  à  ',G (PÇ _ ƒ‚ "h & †± t )� C   9 ³™#
ö ô	


class FileIO(RawIOBasÚE_fd p_create QFalseú ¹ wable =   g  šappending- ð seekable = Noneñ
    _closefd = True
 ódef __init__(self, file, mode='r', 7 =5 ñ , opener=None):C  \ ‘"""Open a> a.  TheC õ$ can be 'r' (default), 'w', 'x' or 'a' for reading,U @writ ð exclusive creation8 Pappen2 o  ¸ P willp ) …ed if itR òdoesn't exist whenÐ d� p 	\ E; itU •truncatedQ C  .  A FileEi esErrorF Draisš 0 al÷ yQ š s› Ï Ping. g3ingj¸  … impliesM Ñ rso this‘�behaves i®àsimilar way to—°. Add a '+' tÈT ôto allow simultaneous¼S and v ¢. A customdruþ bó BpassÒ Òcallable as *i!*.Kpunderly' ç¡descriptor ¦   ¦ ±object is tå°btained by e  H ` õ	 with (*name*, *flags*).J ˆ â must return a8í Œ (Ì 0os.` É R aresult�@funcÏPalityR�4to H g� 5"""G 0if °–._fd >= 0� ‘`# HaveÂ¿ ö û  +f first[  5 :tryF   h I .fd"  & 1os.  D ” )©   ofinall^  Ã B= -1“ 0  · sinstance(° w, floatt ( LQ Typedð('integer argumenë²pected, gotD 'œ h ,inf 4 … 	Ô |if fd <z— DValu˜ PnegatÂ G 3Œ Jelse]x  no×Ÿmode, strQvalid‘: %s' % (> ) ` 1set P) <=  �'xrwab+'e ç /inf Psum(cƒR'rwax   ’ `) != 1‡  ú .count('+') > 1" ‚ M§ âò  exactly one of; e/o/£"e/A) 'Ö ¿	 '… Ùqat mostQ iplus')± Ï"ina	S ä¦e~d !  • þ " —â = os.O_EXCL | UCREATn Aelifkð in mode:
        ñself._readable = True
  •flags = 0 õelif 'w' in mode:  3 R OwritR Ños.O_CREAT |  UTRUNCN h ah &Š ŸappendingÝ 	~ dAPPENDŒ ™ 
�  ó +‹ 
E	‹ ] " D Band  5 
f–"|=8ERDWRM 7< O < GONLY> sÑ
k !WR/ 0  ögetattr(os, 'O_BINARY', 0)E noinherit_7 K = (6 ‘NOINHERIT9 5 orh  [
 ; qCLOEXEC9 )7  h Zs |= { “ æowned_fd = Nonû:try6šif fd < 0  ” îif not closefd   $ ðraise ValueError('Can6 4use: ö=False with file name'Í  H   Áif opener is¶ s Õ 0os., (P !, ~, 0o666X ,elü n   K t J C  - ÿisinstance(fd, int)¨  4 4Typ€expected8 “eger from÷   D ¢    g #OSƒ‚Negativen¯descriptora  (%fd_ T   ó 
eî sos.set_	 $û+ V ÅW$ ='	~ �fdfstat 
 :(fd˜Ë \ 0if 8 “.S_ISDIR(H @.st_Ô«@ÂIsADirectoryJqerrno.EK ,   l  	 1treF !),•
Ê ò except Attribut,gË# Ignore the-  ø H or w ¼ í# don't exist. Ipass ´`blksizP¦`c, 'st_ ¬	>  ž ’" ^ <= 1á e öDEFAULT_BUFFER_SIZEâ ~ðif _setmode:
        õ# don't translate newlines (\r\n <=> \n)
2 	 ù_setmode(fd, os.O_BINARY)
+ ùself.name = file 1if   ¹_appending:   k ú%# For consistent behaviour, we explicitly seek to thf F aend of„ ð (otherwise, it mighX  Ÿe only onG ý first write()).¯ >tryÄ  ‚ @os.l¢ 0¾0, SEEK_ENDZÿexcept OSError as eS áif e.errno != 	 .ESPIPE0  ‡ Fraisk 
. ÿif owned_fd is not Nonƒ  ”os.close(/ 
Ë 
j è fdd#Àdef __del__( )ˆ ³fd >= 0 and+s !fd  œ  : ˆ d@  ê ù import warningsª .	 A('unV da%r' % “ Ò,), ResourceWI ,I  i  âstacklevel=2, 7 =¡ 
  ³ (.ŽgetstateLQ Type`(f"canþ  piq ! {S À__class__.__sÙ__!r} object"j Nreprf >  : • = '%s.%s
.] �module__	˜ @qualb &__î…
ÆÒreturn '<%s [!  ]>– ­ ‘| i " =9  * ø’ AttributVy (z `fd=%d ïA=%r ‡   rŠ U ò  (Ÿ ,€ _( G  K );elslŠ  Ç  „  E   A /=%Œ  @ }  C  _G )&ÑcheckReadable
¢ €Ñ #_r% B k` UnsupŠñedOperation('File[�open for D Ming'‚ EWrit‚ `, msg=�Œ  › / Œ ) D Œ  Ÿ l, sizeƒ 0"""*� at most$ ‚ bytes, À edÊ .  *Omðmakes one system call@ö less data may beL åthan requested„ñ In non-blocking³‚ Àns None if nóo data is available.
  öReturn an empty bytes object at EOF- 5"""9 ÿself._checkClosed() @Readr  pif size‘ rNone or E< 0:C  Ÿ rœ j rH 'llG ?try/ 0os.- (7 A_fd,^ � ÿexcept BlockingIOErrorK  Ÿ 
“ @def V 1allY )0 0"""å B alliò from the file, Æ Red as^.S  â ƒIn non-bŒ E mod2 s1 @much æis immediatelyÉ,ž  K 0or ¯ _ if nò/  ë`1bufëõ= DEFAULT_BUFFER_SIZE» Êápos = os.lseekq.Ê¶0, SEEK_CURÑ þ 2end2 Ufstat2 P).st_‚ l  - 0if 0 f>= posÉ    µ  & -% E + 1C A/OS9 Fpassß�result =øWarrayÀªwhile Trueƒ rif len(< S) >= ‘ 
' 
ª 2 ¨  "   ? ƒ += max( ,“
Unº Â-• 	c ¾ t Rchunk’ 7‘:, nd MŽ
 Q i€ N  Ybreak—   {	 $!t ¥ 0: #ÚAchedµ ô!of  À	8  T j ª _Q ÿ\SÐ OAinto:, bS@Sameù‘RawIOBaseÕ0 ().ˆöm = memoryview(b).cast('B'i != � /&m)!  ê   )  qm[:n] =ÖTnÉ _writeÆ W þis b to€ number @ 7ten€Only makŠñne system call, so notn§ µ v may beL  «  4Theh #ofŠ „actually.  Š× _ed.  • sU m é Â �e would Ì3* 53d¯  #| ~#bÀÀ     except ÷BlockingIOError:
  Áreturn None
 ödef seek(self, pos, whence=SEEK_SET)C ð"""Move to new file3 bition.Q  m ðArgument offset is a byte count.  Op3 Dal a+ u Á defaults to   O ‰ s or 0 (U �from starg ‹ ,p õshould be >= 0); other valuesW Aare [ 0CUR[ @1 (mÝ brelatiæ @currÉ 1poså "i aor neg* &),U "ndU 0ENDU 2U  cend of³ uusuallyL ¥, althoughT ñmany platforms allowµó ing beyond the X aZ )�ÐNote that not@ " � objects 	 Uable.v 5""" áif isinstance(%Wfloat ©¡raise Type{À('an integer¥required')Y  væ._checkClosed( ¬@os.lž ¢A._fd„¦)v ÇAtell% – 1""" @) ->‹ C.  CÓ½BCan É !OSÇ   fë!ons $>(s.!È #"0,,8CURÈ qruncateÌ p, size=±
× T& úÌ ¡to at most4 qsHSize`: áB æ2as bed by DOThe :  çpchanged% –v ð É C >Z@Writ€$"ifì !isÔª � q 1 = B Â xSos.ftBhY 2 �  fc§3 
�¿S Kw!A 3 d6@ can„qbe used[1furŸ�I/O opera2s. 8 •() may be¼ ¡called morÕ�n once wi60t eõg!if ” 
0:try  E bQelf._2 .fd"  & 1os.   LF  0finå< ssuper()=  òì ® 
jbTrue i@ÿ supports random-accesœÞ p  Á m
«  š .X í sexcept >
I    8 _q f= Falsß # Oelse9  
À    return sðelf._seekable

    def read q(self):   ñ"""True if file was opened in a8 • mode."""6  E õ ._checkClosed() rreturn # w ‰ Owrit‰ ! 8 eŠ ( @  x Š  ð /no RÂ âthe underlyingÿdescriptor (an integer)#&fd� oisatty�  ž Ž  ² ÿ is connected to a TTY devic¥7os.y R._fd)“ ‘@property× Acè/fd¢ %�will be > Bd by
 (2	3+ ˆ  Œ…  0Str¥0giv - . ¹#if™vcreated	  ·
  # « Q'xb+'    Oelse/ 	. %elh šappending:   ˆ aˆ /abˆ h ‡ <
¦  ö r‡ r‡ 9U òwb'


class TextIOBase( "):ª0"""  ' Òfor text I/O.!  Th2E ñprovides a character and line basöpterface\astreamè Q ` There‚�no publicŒ‘structor.)  o	  6 Y®š, size=-1|ÁRead at most" ™ rs from ƒ 1, w{  E  € |â  ‰I 1 ³ýbuffer until we havef !or bit EOFÃ  Q "If* òis negative or omitted,Z 8 ó  9 > ds”S   "   Ðunsupported(","€ < ve=
7PWrite ísªÍ?  &x h y ttruncat| Špos=Noneƒ T% &dto pos¦7pos¥ n ‚   ”þ 
x éx0new% à or EOF.

    ð(    Returns an empty string if EOF is hit immediately.
7   5""" ñself._unsupported("readline")
' °def detach(. !): I ðSeparate the underly� ±buffer from ñTextIOBase and rÇ B it.m  W QAfter- H ƒhas been’ 1ed,) V  ö Uin an¢ ïunusable stateï ‘@propertyW  �encoding øSubclasses should override.xø BNoneù e 0new‡se  pLine enƒ ÷s translated so farKPOnly F . !du2 ð ªçare consideredE Ó  ´Ü _errorÚ E P sett“ !ofÞ±decoder or zeã ž • 2io.2 ˆ¦.register( A)


ÇÒ IncrementalN‘DŽ (” 7cs.!  "õr"""Codec used when lô file in universal ðñ mode.  It wrapsd–another i�  , 30\r\0d \- Rto \nL AalsoK qrecordsZ†types of}  a1unt0  Wµ ¿ 1ith? oð=False, it ensureS !atX Ì � sequencešóBed i ƒone piec—­ `�__init__û,é 2e, B ='÷3ct't ‹˜.W C  )Ý  @  å.æ % =_e# $ =  
 ªseennl = 0 p¸Qcr = B  ÷ R õ Âinput, finalkä #t  & a (withy€eventualÿtö a previous passç 1if ê u r¢ ŽÞ ‚output =h É Oelse) T .\ (¥ Ë Ñ ‡  (y "orû 	— r"\r" + . Ÿ  # ˆ U 	l   #{€ain last. :¥5notô SFdataî #hÊ Y (): ÿ` to geL  \nÚà"asÀ s #if© P.ends³(À )	 u j  4 Ú ð  = output[:-1]
  ôself.pendingcr = True

" õ# Record which newlines are read) ÷crlf = output.count('\r\n')$ "  P') - > ' I n' º ñseennl |= (lf and  §_LF) | (cr UCR) \f â   * 	@ VCRLF)"ifX ©translate:H !ifÂ 
  Y ö �replace("v", "\n"  2 K I G “ creturnŒÅ Ðdef getstate(#)d Ý ëdecoder is Nonã  buß5b""f  ® …flag = 0 >els9 #, (  y .g .� ' U<<= 1Q � £¸ � |1 ý 2bufw  s !, 2 " = „ · � � = bool(­ 6& 1¿ ¬ â  I?notM Q & .— (‚ S>> 1)€ »\reset¸F „ ¯ UFalseÎ ¦ #‚ “ D_LF tq_CR = 2_ _7B = 4u‘@property  È @Ë µ(x,.  Ý  & .r"  [ xb (c   )8 V r±  n| & e !)[™±ò	]


class TextIOWrapper( bBase):EÂr"""CharacteÎ ‚ð  based layer ov ° BufferedIO@ ¡ object, b .N @encoëñ gives the name of  Athat Òstream will bE¹Qd or 0 ðed with. It defaults to localeè‘preferred0 Aing(“)• Árrors determ_ ˜  strictnessž : Ð‚ €ing (see§ l ¾Ãcs.register)+ ‘ "S "w �q can be§‘, '', '\n 0r',å Ç . à qcontrol:u Phandl‹ 1of ™K€s. If itÕ¦ universalE!isC óenabled.  With this  °, on input,ç b    Ãs¨ I 2or ¬ Ÿ¬ðd to '\n' before õ:being returned to the
    caller. Conversely, on output, '\n' is translat= q systemD ðdefault line separator, os. °sep. If new  O ñany other of itsG õlegal values, that3 pbecomes¶  Awhen @fileU AreadI band it ò &unÂ >. Oá c tà I ² !.
 !Ifâ p_bufferQ¡is True, aH XPflush{ �implied §   I õwrite contains aÓ ¡character.( 2"""z ò_CHUNK_SIZE = 2048 Ó# Initialize ˜ € as soon ñpossible since it's used by __del__()k q# whichÇ ss close W d= Nonex AThe Ç ô_through argument has no effect her 2thié # e. 0ati« RlwaysQ  åR 0.  f X pis presc Conly· sË!at	ûsignature can match !of  C ì2ionhòdef __init__(self, ä°, encoding=ý ƒ, errors  �  Q  ì= A bFalse,ä 5= %):=  } ƒ._check__ ( ¨ ^ ” „ = text_ (	 )¦ , %ifÃ Æ == "locale"r  % :try   M   =Èfdevicek  .{…no()) or] Î G ðxcept (AttributeECñ, UnsupportedOper	 ;   OpassÎ 1 iml  ÿ ¡ I! � "#   ôC ð may fail if PythonõhYbuilte  Ë Qy"utf-8"# Nelsez 5 y Ô.getpreferred (H	) no…instance[, stripraise Vy•("invalid<u: %r" % 
b k Õcodecs.lookupn i)._is_¦
ä  msg = ("%r? I aÕj *; ' J`   "usBt `open()}òhandle arbitrary – "< ? ï Lª ð  † Ý ó ž  
¾  –= "strict« Î0if ß &is“ 
s‘¦ •8 “ 
â ðif _CHECK_ERRORS:+
  ñcodecs.lookup_error( 5s)
- ò self._buffer = 	   deK ó d_chars = ''  #+ ò	 for text returned from 4 rJ 	�_used = 0N Òoffset into _= q  b kread()N ð snapshot = NoneG Ainfo“ äreconstructing� l stateG ¢eekable = @tell5  #.s' ‡ @has_  Á1 = hasattr(I 9 1, ' '¿ òconfigure(encoding,  ¥, newline,« Ü  ·9 Ówrite_throughà³def _check_P ˜ ^ %):_ $ifs r is notR1and ³isinstance(J W, strA    ±raise TypeEm…"illegal[ Ðtype: %r" % ( N 6),)Œ  ‰ @in (ß‘, "", "\n r ?\n"… OValu† v ‡ Ð )5› É$, ¡=‰ ¦ A  Q  
«‰=False, ± Ê  w $._w % =‚ a "  i ”“   XØ ¸  e õ  €b2cratioŸ,.0/ Ð±universal =#e  * €translata&  ev   . nQ ÿM 3N !”- M p or os.Ž<sepÓ   P+ =a] n* =Í[ r# don't ö a BOM in the middle of a fil”#if†p …î   ©() d„positionÁx.Ç­ * 5if - F!= 0    >try   ‚ B_get–�er().setQ&(0¾ ,   �except L~X ±# Sometimesôper does<Uexist Z  Bpassl#3‘is eitherÇ,ûða tuple (dec_flags‚xt_inputÀ p# where.#  ¨ ®sNðd (integer) item½  Iª #´$ne^ G Pchunk7 t A bytõ Pat co  2 ` afterK æðpoint.  We use this to reconstró(uct decoder states in tell().

    # Naming convention: ñ(  - "bytes_..." for integer variables that count input 2 C OcharC ®  d 4 bacters§ òdef __repr__(self)¦  Ã ñ	result = "<{}.{}".format( ñ.__class__.__module__,Ÿ  <   d 	< µqualname__)> 6try‡  K  ! 1 = =   * úexcept AttributeError< Fpass0 :lse æ P+= " [ V={0!rì   ™ Dmode™   i ™ : [ ™   ™ treturn Í ² " encoding7 >½ )‘@property¿  ! ì	h ‰_% E  �sC # A ïline_bufferingI 

+ Q ßwrite_throughP 
	* O › H 
# A  Y±reconfigure8 ?, *6]�=None, e) 0newð Ÿ=EllipsisB  # >; 	Ø  ÞF"""R  ð the text stream with new parameFî ¤ñ This also flushÃe; .Y & 5""" 1if "._Ÿ�r is not ó &  6   Tand (* 3 or @  D  + =, D) + ðraise UnsupportedOperaÈ([ 4"ItO ñ possible to setDµ  or? ˜3 of  w   a"after; ³first read"¬ ! 'ifñ  -
Ó  þ — !  D Q¼_ 	Ú e,	8 …'strict'4 Aelif¿²isinstance(W ,ì `2Typ´“("invalidÚ s: %r" % ü Ý 
n0§ ¿   Ù ¹  d » À            õ   raise TypeError("invalid encoding: %r" % C)

  õif newline is Ellipsis:   ' ! å= self._readnl#  ccheck_+ ( 
i  f  _bufferingp JNonel $ s 
 z ÿif write_throughS 
# R 	 Ì uflush()g  ´_configure(W0, ep$s,C,3  7 
Á ,· &Ðdef seekable(t )i –lf.closed  d ÿDValu òI/O operation on 7 v file."Ù creturnÖ{  �  è� 7 Ï.+ Ì  c? + ? †  .t ! Î  P_tell^è_× a\  I@not  P and  ` = �:try’ –. £   ofinall2 € è(0@prÎ!ty_ š† Ä ˜ ) ÓG =namjE   ' C  |  E/no| ) Å  ; oisatty; ) ;  "¬ 7, s 'Wà data, where s¾aa str'1 u@m 8 to87 4ðot isinstance(s,o —  t ˜—Rcan'tû0 %s` @text: eeam" %®  >  às.__class__.__“&__üælength = len(s �haslf = t!._Ù Ãtranslate orü
Ÿ)ó•"\n" in s— 2if P  àQ  `nl != I 
 às = s.replace(  ,‰ ¡ &nlÁ l er1 | » Cget_ ³°# XXX What %0e wPjust «Eing?× 2b =2er.J Bè –ž &(bž W_A@(,bor "\rJ![ # ö_set_decoded_chars(''w Àself._snapsh³ot = None
  õif self._decoder:  ! 	 ….reset()" áreturn length
 ±def _get_enO (B )U Dmake 0 = $ øcs.getincremental; .- 6ingw  S  Xer = T p †._errors3 ª 	: ±  A ±  ±  ; ™ 	±   «  / « ‘ÖreaduniversalB —B F = I7‚NewlineDÈ($ ,ß N –translate, 3 = 
 Ì j 9  ñ# The following three methods implÉÃ an ADT for ^„d_chars.G Bext b ´ed from the„ ñ is buffered here until# cclientG ðrequests it by call— @our ö B() o
  #()ª … °:set¡ ›!, ­ a"""Set� 
0 ¨ A."""”  :Zø  @  $ 	Ÿ_used = 0ŸI    n=Ë
¡ ÏAdvance intoª Poffse³  � ° @if n— w 
’+# =m/­ [` %:]G Oelse? F F + nI ± 0 +=–(– ík×_jrewindÒb
]R* WÉ	QJ < nðraise AssertionE"("š Oö  out of bounds"Þ I-= nï aK 1unkå 
â ¤ƒRead and} ô n°Pchunk� FdataµBª 8 "er]  U :‡PvalueN0TruÜÀless EOF was¹ached. lBH 0sträÏis placed in|@ (re! , ·ts previousJ ‡ )i Pentir=Bput ê ƒis sent O‹ —r, thoughI @someÓit may remain¡ Ý0, yJ6o b‹Â# converted.° AGr2€@VS<#no»Àr")

       ÷ if self._telling:
  ð# To prepare for & û(), we need to snapshot a point in theH  file where ù decoder's input buffer is empty.
? Bdec_" ,: ƒ_flags =º L ¹.getstate()= `# Give” !is¹ @know… ære was a validÈ Æ C Flen(† ð) bytes ago with•  Ï  € W (b''© )Î á# Read a chunk% Àode it, and ‘the resulJ�ã …d_chars.œ ½šhas_read1¿\_k .G.- (] ¦CHUNK_SIZE9OelseL K 	pof = noÏ 2put� Ã 	Ú ¥ _ "r. (È V, eof¨ Â 3set3 # ¬3ode / #if« 
ã M °b2cratio = ö| 1) / ( œ I c :/ W 60.0àÄ [�  At¬ž,ˆ ‘Cbefob â,g Ô#I 3nexŠ ½$be |Q " +™®r H Ð ÷ = n”Ñ«
C )ò areturn2eof ñdef _pack_cookieP¢, positionX ÷*=0Ö  ’  ™±_to_feed=0,§Á_eof=False, C ! vskip=0)ó# The meaning of aï ” � is: seek9š !se¢k#R!r °  -  X  , —> „  ¥  !,  GthemJ Ainto¶mrn z Ó 1 as 1EOFl ,  n Ù D 	ñ ÿ `actersâ  l[ dtö.  For most simplÉÙ $s,ñwill often just give aÒ @ off  G(F' |EP<<64) 	Ì…<<128) |Ú õ(à P<<192= Tbool()c)<<256ƒk.unmgbigintFrest„¢ = divmod() 1, 1ª ‘ / ì0  . 	ã 2 Î Ä6 kjð , dec_flags, byñtes_to_feed, bool(need_eof), char ñ
skip

    def tell(self):   pif not  ¦._seekable  # ó!raise UnsupportedOperation("underlying stream isQ K /")k  Œ ?ingj “OSError("$ P posio @ disŸ ÷d by next() calld È fflush(y @ =è pbuffer._ & ƒdecoder % _ ¿   ä rNone orQ ”_snapshot 
× #if' @ !d_ 
$  iõ# This should never happen.†  (   •PAsser2@pendŒi W text9 UeturnT  õ# Skip backward to the Û ð point (see _reaÆ Funk)› ¡dec_flags,�e_inputOH Ê pÖp-= len(Ñ4 )• ”How many Ô  =ùacters have been used up since¸ ?q  9 ˜ W ”_H 1 *ifJZ == 0·A# We‡ én't moved from‚  :( mr†¯Ô_pack_cookie(,ð O	PStartãg 'á, we will walk‹ å rÚ Q# foræð	until it gives us enough AodedoÂ Ósaved_state =* Qr.get T<try00Faso@arch…   an acceptÚ  sß 1p, closeˆ&ou»  >�# currentÇ—  R›Aale: ,ÿ . õ() has a large overheadG Àregardless o‘unk size;^1antY`number" Asuchq Ks toL Ðbe O(1) in moÿ 1itu¦ ”s (commonEÁs, sensible @`˜ �Actually,µæÁbe exactly 1S`fixed-­  Ó{cs (all” S8-bit  ñ, also UTF-16 and +32}  NÁ_bytes = intLQ._b2c! *-c� º = yack = 1Œ aÅ ! ^ < C  Xwhile0 >— * í4r.s—H(b''W
   3 1# D J ÿ˜emptative˜	¼  6 "n ¯ q  Ð&[:Ü .])w  „: <=>
8 h Ð    b, d = deÿcoder.getstate()
   Ÿif not b:  1 ñ# Before pos and no bytes buffered in deo o => OKL ßdec_flags = d& ÿchars_to_skip -= n+ _break 0# S> vback by¬ aamountÉ ÿ reset heuristicG  ƒ _ï �-= len(bI)  n == 1K Oelsecð# We're too far ahead, O  ½ ]a bitQ  š $ œ  /ac ! =\ _\ 9* 2Z § < ó9= 01  ‡ û$.sjP(b'',ì9))
4 ù# Note our initial start point.,  _z=€sition +Â  ’ .  am	$ :if `N== 0› —ÿ haven't moved from the®  õ
return self._pack_cookie(Ë ,A AFeedf WA onepð at a time.  As we go,¾e0 	å é# nearest "saf² 2" bÏ Ê Àcurrent loca[E "(a”@ whe£ heÖ W@ has{ Ehing\›, so seekl`# can ‰ "lyü L!reŠ`advancU this� )ˆ\_fed ˆûneed_eof = FalseÉ CR¼ @d sil `‘`. ~i Pfor iñfrange(,Înext_input))UÀ +%
z +o‰ "r. (a Ž[i:i+1])� fœ† r¤	B Ÿ
™ *<=Bè  2# Do ‘ is empty&æAis a   J   ¬1 +=s	¸ '   ­ > @u^ 8,^ ,ç : A¶O, 0,
 \3 >+Åˆ”0did“¥get enough×ðdata; signal EOFû  to get more.
  òchars_decoded += len( "r. ý(b'', final=True))F °need_eof = "   :if i < �to_skip:2  § ù*raise OSError("can't reconstruct logical file position")
N ð# The returned cookie corresponds!ú
the last safe start point2F Â self._pack_O (r  ¼ C R_pos,N ô_flags, bytes_fed, 5,^s*ly”ñr.setstate(saved_ ú ‘def trunc @elf,f=None)M Å fflush(s  if+ @ is . -  Ó Rpos =ü Gtell6 ubuffer.€ 7pos— pdetach(| ‹ "ifW < ~ SValue. ‚already ^ 6ed"Ñ  j .æ : Í _ Ã3  ! =	 ê 2   nAseekÕ ,`§, whence=0ç  * �_reset_enq$r(µ&  k@"""R(  ˜, ñ (merely useful for proper BOM handling)"""˜  H   +trB  T  "orŠ'_g¥ N; Áxcept Lookup‹
' $ ¹# SometimesÃ @doesÅYexist¦  6 Ipass Nelse] ¤ì^ != 0"  M Ò (0Ç $ `   .®(Á  «jclosed{ £ (B on . ¨œcif notq C;ablð S ðUnsupportedOperaçð("underlying stream9Q  ekK 
k ‘Ê == SEEK_CUR¾  ¤U‹ 	›ð	do nonzero cur-relative Û s�  H`# Seek¼ !to#`currenvÇù should attempt toa# sync: ˜Q with U 
Î) 0[ ÓëCelifÜK?ENDKH?endK°
ãÀ      positi÷on = self.buffer.seek(0, whence)
  ( ÿ_set_decoded_chars(''( énapshot = NoneJ "ifu I )r:  s l h Šr.reset(f _ 0_en‹ ªr(position% treturn  g #ifâ Z != 0 ôraise ValueError("unsupported7 ’(%r)" % ()&,)x ¿if cookie <[ �negative y¨ 1 %r] H ] …flush()
Ï ð# The strategy o_ðek() is to go back t(  af- —art pointG °and replay * `effectP Qread(ïà_to_skip) from' 5re.C ðstart_pos, dec_flags, bytes9 ùfeed, need_eof, R E = \I runpack_( 	ü OSeeká 
Ÿ ë° Àcç$ ã½ �# Restore 	@oder•its state=+ sŽ­ IP== 0 œx 
·	 2,elt0 orš £  	Œ\ 2½ < } gr­  ¸ A.setW((b'')Eÿse(S vq + Œ d �
¿ Ð# Just like _Ê€_chunk, �	£ddave a x � ” Rinput? : X (éS : >Ä  %   ) , (x @0A = p k# Skip‹'ofd kactershf len(³ 1) <6 ÷“ y i#OSfscan't r9Ålogical file"S"w z_used ={ )5M Ž   / 6 Adef Û ä p, size=Ð)c  ÷ ._checkReadableÿ x0ize‹ 8 7  q  O U = -1Jelse$ :try 9 `_index‡Rize._ %__K  ( ðexcept AttributeError:
          ó raise TypeError(f"{size!r} is not an integer")
6  Yelse:    > 0 =  v_index(6 pdecoder Telf._ Aor s 4get 7 !ifO J < 0p ù# Read everything.� ¬result = (^ ¹d_chars() +2  Á  › . A öbuffer.read(), final=True)ã  > n sÌ n /''( `napsho¨ INone� rreturn É  yp# Keep š ò	ing chunks until we haveC ÷ ¢acters to _ 
5¬eof = Fals‹ MÞ ªÞ  ò
à ¢while len(Á 2) <† 1and[:eofÑ >�  zj  Õ _Ò  )   Y = +=A— ( -† 
¥ cdÁdef __next__ú)¦ ” @telli)DlineÞ ¸   ¶ !if÷   R  Ç V s
" x  {seekablªÓÑStopIteration×  i î  ‚ 
  ì ª  U ,£=‹÷  ƒ ¢jclosed½ CCValuD"Q b from 0 W file> N 0izeb h 
O  HQ = -1   µ ð:try5  '  9 s ƒRize._ %__K  ( ò except Attributµ O × L™ ò # Grab all the wöd text (we will rewind any extra bits later)Æ Ý  °_¨)ù 
@starx0‡ GMakeƒ ðr if it doesn't alÝ € 6istt Ú A×
S � 'r(‰ ’pos = end	  “ F g
Q  Eã  ‘ Ptrans	
$  å P# NewUs areÁ 2 öd, only search for \1 B   ™  G Á.find('\n', A
P - 0if 0 ,>=±    ê  ' &+ ë   Ubreak  � ! =ë © ` # àelif self._reaÛduniversal:
  4# U ÿ newline search. Find any of \r, \r\n, \nE  ñ	The decoder ensures that4 ÿ are not split in two pieces
M  ð	In C we'd look for these: €parallel” }course.B €nlpos = Í ý.find("\n", start)/ .cr/ r/ 3if 2 N= -1R a3if … $  ( ý # Nothing found›  $   º  Ò 0en(Ö Å  & Oelse�   0# Fd À    2end½ ?+ 1’ ]break /elú Š }lone \rF 	‹ l‹ ‡ <­‰ Ó 	„ „ "==… ? + 0‰ r‹ 26‹ x O v v Še# non-�s | à¶Îself._readnlò0if 1 O>= 0Þ¾  ' o+ len(R  ôÌ 	› €if size j A andJ  ¦ )   € |   ¡  # reache< 1gthQ 	e |  !È@ end(ù
seen yet - get more data'N @whilÈ@Ž_chunk()©  Ý g¾~d_chars(    
  >  .B += €Iget_o (Þ>0end÷Ifileî  Ž Z sZ *''\ , Þnapshot = NonR areturn}¥ ñ 	é>Ò
7 =  Ádon't exceed X P# Rewo
Ñ to just afte� "we8ð rewind_decoded_óchars(len(line) - endpos)
  preturn  "[: !]
 ‘@property pdef new( �s(self):  G D   ¤._decoder.- I if  ó else None


class StringIO(TextIOWrapperb 0""" ò I/O implementation using an in-memory buffer.Ã ðThe initial_value argu@ ¢ sets the  Àof object.  6 ¾ ã 4 qis like7 pone of š ± ñ 's constructor.= 2"""Œ  A __Ž !__A,› D="",bS="\n"ÿ  adsuper(&,P%).N ¡BytesIO(),s  2  ÿencoding="utf-8"9 ÿrrors="surrogatepass? W= ‡ô# Issue #5645: make universal¢s semantic» same as in“ü @# C 9 òion, even under Windows˜ !iÓ1 is’Ô   ·õwritetranslate = Falsen *ifÈ K ?notO   o àot isinstance(œD, stô ~  °raise TypeE})("6 € must be= 1 orw  , � E{0}"¦ M  ».format(typ�  `vname__)§ ? 
À &  vseek(0)1getpá¦elf.flush(G J! =ðZ æ „ D_geto7 bold_st«C A.get '  Wreset :tryÞ0  Á .mÖ Ö), final=TrueÉ  lW H  r.‰ ® (¸ 0c__repr10#yR tellÚ @its @ E. Indë�# that'sA
Yfdetail*#
– Þ.e®,ÿ O9  �dõ … ;  S ª ,ch+ â# This doesn'tOvsense o
ß OÒunsupported("X 0")
Á ü �s used byrñ site module to add custom builtins.@ 
� o~ dð
s are almost immortal andU ñy keep a referenc[ Stheirk ð
# globals.  Defin@themõÐthe site moduó-le would keep too many references
# alive.
# Note this means �odule shG ”also avoiR RhingsC ` in itR ó>globals.

import sys

class Quitter(object):
    def __init__(self, name, eof#  ' ±self.name =  <  Peof =2  S CreprS H ñreturn 'Use %s() or %s to exit' % … k !, v Geof)X CcallX ·, code=Nonec ð)# Shells like IDLE catch the SystemExit, but listen when  !irj  Ù õ# stdin wrapper is closed.# 2tryE 0   Asys.6 .+ (¸   jexcept. EpassL HraisŸ (Û $)
¼]_Prin½1""" âactive prompt àps for p7 0ingÝ ñ license text, aý 1 of„ ñcontributors and1 ñcopyright notice."""
/ ÒMAXLINES = 23 ÷J ðdata, files=(), dir	 ³¬oú/__r __V 0 =  ’  f6 €lines =   ‡  V    ò[os.path.join(dir¦   º X   Z0dirw Í d (    , u  1   (s]3Qsetup÷fþ!__Î 
:Fw  ï w  ~  à sQ Ê º ¤with open(6 ú
, encoding='utf-8') as fpN  =   ˜ wfp.read    UbreakÇ   (Ž OSErrorW 	4 if˜
* y ô   e  U?¶.split('\n'÷( ‘cnt = len¤.’)ÃíD à[ .ifM 2 <=ðY
Ñ ñR "\n"­[ Ç Z Oelse9 3TypqPto semae full~@ext"{á  "I,)*2ä y¨‰ ä ‹‚= 'Hit Rö ”Pmore,ö0q (g )uquit: '« Ý eno = 0 zwhile 1ä ½ l ipbrange(L ",  * +mÐ  … = : Fs[i]n ' °ðIndexError:
         dbreak
   Yelse:   ýlineno += self.MAXLINES( ­key = None `while ! !is" f  j  ! ý = input(prompt)K  ( !ifL ÿnot in ('', 'q')U  1 Y › L  ==C B )ó

class _Helper(objectu ñ"""Define the builtin 'help'.
Å ðThis is a wrapper around pydoc.+ Ð that provide*   ¢ful messagX4wheZ  O �typed aty ðPython interactiveN 3mpt„ €Calling X +()6 rš starts aG  2 ‘ session.Ð 	L Ñthing) prints_ A for” p” /! '* 'C 2"""Ðdef __repr__(fW ¼Áreturn "TypeZ !()\ å  ž Q, " \š  6  2"or4  :  . r about  !."8 † Ccall† ÷ , *args, **kwds• bimport»<  p ª Ð(? ñ
"""Strptime-related U íònd functions.

CLASSES’ðLocaleTime -- Discover¥¡d stores l#  -specific e € informaT ¦  B  RED ñ Creates regexesRÀpattern matcÐ` a str0ñof text containingO  õ  p “
FUNCTIONÄ €_getlang~ pFigure ‚wó  @uageÑ ber Aused•  PÜ s s@ F PCalcuFsi‚ pstruct K@esenb!by “passed-inÕ 
�
É <  n   yÔndar
from re  0ompÕaD"_c % ¬IGNORECASE rescape >  # @dateŽ h (  (     _	 ,|  ! Ydelta2  7 	1zon�  _  1 _   )™ t_thread˜  al(pte_lockn   _ 0

_ ‘__ = []

c	(P,#  ôˆcurrent bset to<m … 0le.S ( „LC_TIME)¶B¹SAŸand handlM H ¹!todZ„ATTRIBUT² “�f_weekday­Tfull  ÷names (7-item liséa6 qabbrevi*= uf_monthq  Ðnames (13-iteÿm list; dummy value in [0], which
   õis added by code)& òa_month -- abbreviated  Ònames (13-itez ,z I v Ž  z @m_pmx öAM/PM representation (2t ® ÀLC_date_time; ðformat string for  / Q % L G “ B  j  --{ ‰  „  % 1zonÌ õdaylight- and non- …savings / 
X „A† of setsý @langú ²Language us…instance�Ctupl0A"""
l ñdef __init__(self):  ò"""Set all attributes.8    POrder‘ Àmethods callr`attersJø dependency reasonA °The locale Æ ¾  isà À at the offsƒ  nd õn checked again before° àexiting.  This°ó to make sure thU Í ‘ were nott ewith aO 0mixÝ "in› Ërfrom moM  n ïÀ t @wouls•st likelyN àhappen when usäpthreads !reL  G3s a-CtL Afunc[äwhile another ? `hanges1C  Ol%e ; %inO iB  „’till runnR`Properr » ç  ï åI ðlocks to prevent c‹  1  c *Œ  Ü  Z Ee isL {  &ø  h®@is dyÀin case some AdoesË¦think abou2"do† iROnly ;ppossibl‚ s‡Es ifZ Æ e‚¸ Ú5did°  EPtz.tzµ atˆPan isY  Ø õprogrammer, though,J  siµu µ ev Ðis worthless ° ou)!at5œ á ¤   ×.ap = _get (A ï__calc_weekday K a í  é  'if« A != ¦  º   Ü praise V=rError("Z{Qed duQ âQializ”"þ !if^0.tz#j  "or À   Ž û � Àd during iniñtialization")

    def __calc_weekday(self):  " `# Set  $.a$ B and f ÷using the calendarC umodule. J 4= [0 õ.day_abbr[i].lower() for i in range(7)]E | E OnameE Ù %= › h # m  D_monthB!f_" @a > 4< í  4)1354  F 5	F ¼  4U 2 3 = ö ._am_pm.  C by ò ime.strftime().P ¤õ0The magic date (1999,3,17,hour,44,55,2,76,0) is not really thatº #F ò#al; just happened to have used it everywhere else  aI Dstat� §was needed þ  ˆÒ0or °  ðg(1, 22‰ é  ú �_tuple =   @uct_ (ö 
)›  I [.Ý  d(=  I YQ"%p",] j )ŒB ÿÀ K ŒN ‡–  - Ç P$ ,M  2, &  • ü¼ #™ ­ 
)Usû+22ù M&qbecauseµ—amount ofk ðoverloaded numbers;Àminimized.  wPorder²àwhich searchesºL Ñvalues withinr  format str90is R± important;f—liminatesK ðpossible ambiguityl 0 whN 0omeb Æg representss TÕ?:û ¤Ø ºfNone,  Ê' 7[0]l bcbå ? 1? x? 2? X? ðreplacement_pairsì Ñ('%', '%%'), µ.0[2] EA'),Ã  f / ![3- BH sH aH xH bH  ’![1_ pD À              ó('1999', '%Y'), (' y !22 PH'),
0  A('44" M0 !55 S !76 j> !17" d0 !03 m  { ÿ# '3' needed for when no leading zero.; "('× wi !10w EI')]/ ñreplacement_pairs.extend([(tz, "%Z")v õtz_values in self.timezoneL 5  Å  tzH U %])F   ðoffset,directive, q((0,'%cË Q1,'%x
 •2,'%X')):@  v @currÒ àformat = date_± [[  / s pld, newk 
^  3 ð# Must deal with possible lack of localº )foœ > €manifestÁ itPð as the empty str ÿ(e.g., Swedish'sJ  p ðAM/PM info) or a platp returnO pa tupleŸ g O  y #s z °MacOS 9 havA  C ô ­ Ž('',''))|nif old5 û ›
 .|#(o� > ð# If %W is used,2ún Sunday, 2005-01-03 will fall on week 0 sinc®#3 Ðoccurs beforeY � first Mo^  4 Ÿü year.  OtherwisP $%Uœ 
 9_} =  q.struct• ((ža,1,3,1 j6,3,0)û pif '00' @ f	 (&,Y f  <©U_W = '%W'÷Nelse«- U- H? = Á–'11', U_WÇ  çE.LC_F 	š0•) 	$ 1$  	$ 12]
á ¡def __calce ·(Y Z# SetÎd by usìv.tznameÌó# Do not worry aboutüQility'3ime9 S[0] =ñK [Ã Q# andµð.daylight; handl€ atì@strpã ƒ :try° ftzset(lúexcept AttributeError8 6pasQ µ  ± L @" ¨ $  & Bno_s,€= frozen˜ ã{"utc", "gmt",r[Æ[0].lower()}¾ "if$ _ 
¹ ?hase ¢ ðtzname[1].lower(S)})
  Uelse:   öhas_saving = frozenset(3 óself.timezone = (no1 &, = ò)


class TimeRE(dict)k ð"""Handle conversionk ñm format directives to regexes."""
« Ðdef __init__(� �, locale_— S=Nonej  Ñ ò"""Create keys/values.J    ð Order of executŒ Àis important” ø dependency reasonA  ˜  I   (if‹ ï      ª .© ( =, Ú  ' “9  Lð  [š0bas‘[super .0{i  m ð# The " [1-9]" part2thew! iƒrmake %c¥¹ANSI C workL ñ'd': r"(?P<d>3[0-1]|[1-2]\d|0a   29]|n :)",? f? Íf>[0-9]{1,6}' H' ‘H>2[0-3]|l ]\d|\d. I. ‰I>1[0-2]Œ 0 G0 BG>\d % j%  j>36[0-6]|ñ 5ë ó õ  	 ÿ   ] m] m² M0 M7„ 	 S'  S>³  �/0-. U. 5U>5e4à \  w. wƒ -6]Õ u" nu>[1-7" V" Vr 6y 0# W¡ð set below by us»:'U']y_ yØ¢ ð#XXX: Does 'Y' need|Òworry about hùless or more thani #V© 4 digits? %'Y… Y…  _‰ %'z% `z>[+-]% 2:?[¬(
 B\.\d"½?)?|(?-i:Z)N AA': @‘__seqToRE2ˆû.f_weekday, 'A')—aB aB aB BB ý f_month[1:], 'BD bD aD bD pD �m_pm, 'p> Z> 1(tz²tz_names inmæ+	& `for tzL X “8 -'Z± q%': '%'îÀ      base._ö	_setitem__('W', base.__g ó	U').replace('U', 'W'))
  1 G ñc', self.pattern( òlocale_time.LC_dat K 
xK F 
XF  ™ 1))
Ø Ñdef __seqToRE¿ ñ
, to_convert, directive):0  B"""C  ð a list to a regex string for match aG .w  G ÖWant possible- `valuesS Òbe from longef õ shortest.  This“ Ãprevents theT ¢ility of a\ e occur� !a i ¥ that alsoL Sa subÇ ? hlarger0 £should hav¹ õ ed (e.g., 'abc'L Awhen Xdef' @ Abeen· , )!5"""I ”@ = s&d( °, key=len, 	†rse=True» �ð 'inàÔ ‘#ifä Z!= ''    Ubreak’ Jelse$ †return 'ÿ ñ= '|'.join(re_escape(stuff)(  ™ º C å(?P<%s>%s' % (˜ ò 8gex1 † 0%s)* @ u ì©,~ :matÛRÆ 8  /  ) ¤cformatå«@Need³“make sureXÀny character�ö
at might be interpreted aËy ²syntax are 1dn £processed_œ  ¼¥@# Th‘ ƒb() callM  s  š ÇmisconstruedK $asä� ò.  Cannot use re.© ’ since weÇto deal withL ­ ÇÕs (%m, etc.).( _¨ ös = re_compile(r"([\\.^$*+?\(\){}\[\]|])"	c  8 2gexF Å.sub(r"\\\1"ÿo ³whitespace_Kmentz _'\s+'f  = q  '\5 q `le '%'þ° 
S €_index =ŠAmat. u('%')+1À  ¥ 0"%s "8 ,=  A  ¢ +[:– ?-1]G  %[L K &]]Z ‰ & ÷ [/ E+1:]Á r¹î ì Àcessed_formaõt, format)

    def compile(self :  # ´"""Return a+ °d re objectO @ the åmat string."""A r> 8re_j “.pattern(� ò, IGNORECASE)

_cache_lock = _thread_allocat ò()
# DO NOT modify _TimeRE= £ or _regex Ðwithout acqui§ ¹ i  i ª
# first!
H "= W ñ()
_CACHE_MAX_SIZE = 5 # Max number of s Ées stored in† 
“ `= {}

†ò_calc_julian_from_U_or_W(year, week_of_ 0day    ²starts_Mon)»Á"""Calculateè J[ Ñ day based on R  K  ½  Ë 1and- !ofÊ   %  , G� u _R ñrepresenting whether^  3 X L vassumes! I s’ 0SunP Qor Mo
  (6È%0)S£_X  ) °= datetime_	 .c1, 1).$ !()u ñ# If we are dealª 1ith† à%U directive (9  ” s), it'sL @easiã Áo just shiftJ ƒview to É  beh  =¸ R * I  l . gif notZÏÎ ‰A ù ( �+ 1) % 7L  0 %H = ( 	, `# Need´ `watch #Qfor a‹ r 0 (whe,r Ä  +0 is¹ x #Ú p same aà àpecified by %UÎ2%W)ó  ý �_0_length¥ 27 -„è Ó i¾V == 0e01 +Ÿ N ¤ Felse9 qdays_top ! =ó ’ b+ (7 * T ï B- 1)S f
y K 	ˆ 
äSV(isoÕ 
  $, 
 ?dayÎ�ISO 8601š , Ë Z 2dayx &    ¥0artyosßF 01 ¿ / € containÓZ4 JanN  z€s range ÂB 1 (W )^27 (ý$1corz<on Î 	 t°, 1, 4).isoˆ ‘day() + 3Ðpordinal? 0  ! @ * 7!   *&- i 8 $# : mae negaðor 0 now, which meanÎem ðitpreviou�calendar}d %ife 6< 1vz +ò 
S1).to+ Æ s Ö  Q -= 1g   (    
Àiso_year, 1,ó 1).toordinal()
    return iso_year,  ð


def _strptime(data ñing, format="%a %b %d %H:%M:%S %Y"):Z B"""R] ða 2-tuple consisting of a Z ð struct and an int' qtainingJ  the number6 ðmicroseconds based on $ PinputO  `  O 1theA ¯  T."""
 ÿ index, arg in enumerate([ð  ]Ú  8ðif not isinstance(arg,c %  ) umsg = "H)l ðument {} must be8 ,Q 1{}"œ  ;   òraise TypeError(msg.Ï (» 1typ} 2)))× òglobal _TimeRE_cache, _regex b Rwith  R_lock¶ t qlocale_�=H . F  0 ÷if (_getlang() != & . 5 or.  2  [ |.tzname/  1 Œdaylight3  z	2 = ø †   k.clear! Ë  Hlen(X ö) > _CACHE_MAX_SIZEm… îP  ‚ ÈR.get(  Î M š 7 
n :try  6 /  f -�.compilek  9 Q# Keyœ ¬Ãd when a bad(á is found; canï¹pecified asP# \\,Šðwhich case it was a%‘ay % but ¾ùa space after itK fexceptž nas errú ð bad_directive =% ‰.args[0]P  í  if× / n= "\\"V  . Z *"%Ü $ 0delr j LS ValuùP"'%s'JZ² 2in ½ " =" %L  h  (� Ò²)) from Non:7 0# I)è²only occursí }„ 0str~<is î �H 5õ 0stró%b æ õ ± ùÀ[: 3] =5  (˜ h.matchò^Z6und½ µ  Þ @� %r doesÚU � ? %r©
| œ± 0if ` _ �rÈ W.end(ð raise ValueErroÿr("unconverted data remains: %s" %
   . ñ_string[found.end():])
6 ³iso_year =  ANone ñ month = day = 1 0hou+ ñminute = second = fraction = 0* btz = -6 •gmtoff = \  _6 ð # Default to -1 ñsignify that values not known; €critical/ Qhave,‚ �# though  è pweek =  4_of÷ ”  h_start² #8  Âand julian d­  edz  I ` so as  · Ral ne ‚calculat[#É ›  x  X =V (³@_dicŒ  `.group !()? Afor  �_key in ' 4 �.keys():(  #£# DirectivEø	explicitly handled below3 —  c, x, XG  M 2 õy making out of other dk 	9 IU, W ð    worthless wiµtuaof thex1 'ifí f== 'y'¬  – ÆFint(	R['y']/ $   €# Open GN¡ specificaÃ Ròstrptime() states€Ea %yŒ G ’ w « Prange´[00, 68] is  century 20 Bwhil F   #[69,993 2190U (   "if®Z<= 68   !+=k 	® Oelse/ 	g -elkYkYkG  GG  ›² ,= ¶GK mK ³H mH BH plocale_	1.f_^ i.index\¶B'].lower()dù  bf af bf df [dHF ùG HG IG IG  Â@ampmV ²ËÄget('p', '')n	Ü1# I0Pre wa#  AM/PM indÙùor, we'll treat this like AMH 1if ~ ˆin ('', ‡am_pm[0]S ®   p# We'reî AM 6`is corw2 unå * 	u B 1looGàat 12 midnight;.
  ð# 12 midnight ==  AM	 mhour 01 1if  + :  _   < �elif ampm\ þlocale_time.am_pm[1]L ð# We're in PM so we need to add« bto the’ munless’ 1# wF  looking at9 Onoon   ¥  12w "==^ -12Z !6¿ +  > 	�group_keyi :'M'> ÿminute = int(found_dict['M'])I 	*S'I osecondI  SI fI 8 = ‰ 5f']ˆ  è B# Pa˜òlways return micro… snös += "0" * (6 - len(s)Ý  U ƒfractionÀ s D A² ¨weekday = m#f_ i.index]§A'].lower(ˆ j  aj aj aj wj wÐ <3if ê  b0 !  ) 6ÊOelse. E-= 1/  u² u² ‘ c jc Tjulia$¤jb ¬ Úin ('U', 'W')ï  ˆ ƒ_of_yearzV ¹‰ O5if   r+'U§  % ¡# U starts�ª on Sunday + † _4 / =ª<# Wd /Mod ò3[== 'VÕ 1isoç(/'V~ K zK zbzbAif zYZ9  .�gmtoff =tÌ J 1[3]M :M   Q  Ž Êz[:3] + z[4:î "   !if¸jz) > 5F   q 5] != 'q , 0msg	ð"Inconsistent use of :
{�e'z']}"�D  àraise ValueErrŸor(msg)
  ýz = z[:5] + z[6:]* þhours = int(z[1:3]N fminute& ?3:5&  fsecond& ž5:7] or 0Q ¢gmtoff = ( P* 60  T) + (o  Y » F ¡_remainderì 8ä  ó# Pad to always return micro] .^ ü_padding = "0" * (6 - len(ˆ )ñ “_fractionp9 < +  v S ýif z.startswith("-"):Æ  T B = -
 % ¢ .  7 úelif group_key == 'Z'{ ñ# Since -1 is default value only nee’ðworry about settaUtz ifn  Â ð# it can be someth( Úother than -1ÁÒfound_zone =  údict['Z'].lower(R2forŸ Q, tz_© ðs in enumerate(locale_time.  ] q #ifp     B O 
" ×   p# Deal ÃR bad g  ”up where n € names a )he! J   á# same and yet: �.daylightŠÿtrue; too ambiguous toK pbe able9‚tell whaS Û Ehas [ savingsI @if (Ã 0.tzÁ 0[0]3  1]² = +  Å  Û Ñ† 0noteï("utc", "gmt")—    _breakj Oelse£ 8 tJ=  # [ Ô“the casesÍx1itiÊ"izÈê# don't assume1 s �ÑISO week/year„ 0if   ×Né Diso_    Õ 0if !  G 6 !orW 4day 0  Ö praise VºpError("Š d ðdirective '%G' must¡BusedÐ"¨  F  " N ‘ N  V'% a› J = ¡('%A', '%a 0w',„v'%u')."ô�if julianö * ° ú pDay of · $j'J ¬ pcompatiZö O OG'. I À        "Useð( '%Y' instead.")
    elif week_of_year is None and iso_   1not :8  < : 0day   5     ñraise ValueError("ISOm õ directive '%V' must be used with "f  J  P"the N ³ N !G'º ah  › J = ¡('%A', '%a Äw', or '%u')/ ‰ Oelseé %ÿ is incompatibleì è ‰Y'. Use 	O'%G';eAleapûÁ_fix = False 1if x ¡month == 2h b  93 ’= 1904  # �is first m U ñ of 20th centuryq  _ " � 2TruŽ «] � s 10

J 0# IØQ know$Ç!of E  àPwhat Ã  !at5â, we can figur| Q# out< fJulian5 eÎ .u Bif j ¢ # z  d ?is D~%   F à_starts_Mon =  „@ "  Ÿ 0 ¨Í E   ¢ ‚= _calc_ Ð_from_U_or_W(  Aday,è  G  ¸ v = Ï a o  Aø 5   ;  ð @  7 ,pÎ  V(E '  
  O É F + 1Œ 	¹	ˆ ^ <= 0 Y -= 1yéP= 366š°calendar.isÖY)˜93659 h 0+= C Ä	– 
_P# Can© @pre-Èð ulate datetime_	 r() sincÌ¢change in Á} $# ? 1ion{ðthus could have different vËA for
 ë 'ofI  ‹ eR  °ð # Need to add 1	 cresult¦  U `  º ÿ!1,80K -=ð  1 !, ¡,¡õ).toordinal() - \¬  �   )2B J1, 1< +ç S:ÕPAssum} até²they botherã sincludem � @ (or+ hit wasŠ ‚sed abov � /P Pday) = 0ill+†accurateË Wð= datetime_date.ïfromordinal(
  ï(julian - 1) ++ 
�datetime_	 ô (year, 1, 1).tol %))C  ! 0 = - 6 presult. $ _month%   & ?day$  1day" pif week% �is None:  õ  ‡  � ½ f s, day).* (À `# Add · ‘zone infoT ñtzname = found_dict.get("Z")
" €if leap_ç F_fixŒ ð# the caller didn't supply a / ð but asked for Feb 29th. We coul2 d  Ú Q# useR ñ default of 1900< Ácomputations@ ÷set it back to ensureM @thatr Qruaryw b is sm® õ than March 1st.8 ¶ =w þ }return `,3  ¼ úhour, minute, second" Ž", ž@, tz  }ð , gmtoff), fracã  _ °

def _strpÄ_ P(data @ing,%òmat="%a %b %d %H:%M:%S %Y")µB"""RÐ a` strucEased on~Pinput ping and í Tforma A.""" Ftt =™ ” A)[0]+ L ¼ .z È Att[: ü_STRUCT_TM_ITEMS])ø  ì + @(clsè(ÿclass cls instance ba)¿# Œü’ = tt[-2:=Bargs t:6] + (,á#ifG ç;not8xtzdeltav H (±"s=ˆ É:cro Šn  õ2if ² ]    ,tze  r(� õG 7elsàB : s+= (tz,­cPcls(* ñ)
# system configurD¡ generatedãuø byë / + Ñ module
buildª@_var…ñ {'ABIFLAGS': '',
 'AC_APPLE_UNIVERSAL_BUILD': 0  "IX HDATE ÐGENUINE_CPLUS  ñ LIGNOF_LONG': 4F  fSIZE_T uT_SOABI; õNDROID_API_LEVEL R± £/src/emsdk €upstream Âcripten/emarÚ Rê 1rcs UBASEC p-Wno-unD-€ -Wsign-µöare -Wunreachable-codeG %PPI  ðMODLIBS': '',
 'BINDòIR': '/src/cpython/installs/ ÿ-3.10.2/bin',
 'BINLIBDEST: 3libL  K E �LDLIBRARYE 2libl    $.a" `SHARED! "cc pUILDEXE  `PYTHON E  �_GNU_TYP1 òx86_64-pc-linux-gnu* °YTESTR_DEPSE !\\  CC y &CCŒ  AFLAG/ õ6-Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g '
   ÷'-fwrapv -O3 -Wall -O2 -g0 -fPIC} ?FOR• �_ALIASINGÀ ÷-fno-strict-aliasingD R_NODIÉ ‘ONFIGFILEÜ ¥configure 
 b.ac ac T.h py I.in Ë Ô ã'Makefile.pre.BCf VURE_CGæ & ¬ ÿ-std=c99 -Wextra … Œ ‘  '2 ŸparameterÁ  0  5 0misFÿ-field-initializers? ðerror=implicit-function-declara E òfvisibility=hidde—U&PPWásUSE_BZIP2=1 - gZLIB=1ð Š%LD4  ! 1_AR""'Ë=®S ' 'CŽ =} ‹ 1 "
a ÿ+"'PLATFORM_TRIPLET=wasm32-emscripten' '--without-pymalloc'M Q--dis€ashared;  Aipv6 !en# ßbig-digits=30P , qoptimiz»sE Dhost¬ yunknown´ ì �--build=¤Ð prefix=ºÂ q _w  Ü 4 Žâ "CC« bemsdk/ €upstream ÓO/emcÃBPKG_åo_PATH=× &  ¦/IRw ñcache/sysroot/local/·"kgá:i¸  ¾ G  øA  '"=Á NCLUDED{vincludexB P=™ ¼A †À3.10',
 'CORðEPYTHONPATH': '',
 'COVERAGE_INFO ñ/src/cpython/build/P ú-3.10.2/coverage.infoD oREPORTF ¿lcov-reportD €_OPTIONSL Ä--no-branch-} ² --title "Cž  Q O '
  'p "q bPPFLAGb óI. -I./Include -sUSE_BZIP2=1 bZLIB=1; fTYPES_? ðDHAVE_FFI_PREP_CIF_VAR;  ÏLOSURE_LOC=1® &'-2 C- !AL/ {  XX1c++ qDESTDIRÅ 	¹’installs/É¼r '4 O/lib8 %~  9C 0 Š …-dynloadþ 0LIBÉ ‘ B 	 QoSHAREDV #¤ &q ÀIRMODE': 755€1DIS1öREADME.rst ChangeLog configure
 b.ac ac T.h py 8.indÀ'Makefile.pr« ÜóLib Misc Ext-dummy™ J+ AFILEv¸ $©'É ½ ¢ €LINCLDIRš. €LLIBRARY  ñOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754': 0z* ?BIG$ nLITTLE' 1K @TRACÕTD A_DEP#"\\š  RHEADE² 1OBJ-  `YNLOADe Ù ôr_shlib.t1ENAè 4PV6Ñ  EN\0PIP4 qupgradeO &EXœ :EXE�òEXPERIMENTAL_ISOLATED_SUBINTERPRET® 4 EXáPSFROMe ^  &YMÀ ËEXTRATESTOPT *_C‘EXT_SUFFIØ.yò	-310-wasm32-emscripten.sü  Å 0644�ò FLOAT_WORDS_BIGñðFLOCK_NEEDS_LIBBSÜÏ �GETPGRP_¿4ARG2 †GITBRANC'PGITTA  â¥GITVERSION@GNULY "'n¥ T PCCEPTs(  OSY  3DDR 0LARe ²IGNED_REQUI¢ [LOCA_Y àLTZONE': 0,
 'óHAVE_ASINH': 1,
 ' €M_TYPES_ 0 +TA* ùBIND_TEXTDOMAIN_CODESETN ¦BLUETOOTH_
 
X  öROKEN_MBSTOWCS': Œ B ONICE �PIPE_BUF ?OLL ßSIX_SEMAPHOREp ÿ PTHREAD_SIGMASKG °SEM_GETVALU› W³ ŠUNSETENV< ÙUILTIN_ATOMIC@jCHFLAGŽ [CHOWN& :ROOy@CLOC¢ ‚   � Þ   :TIMµ 3 ?SET pSE_RANG2 šÛCOMPUTED_GOTO· jONFSTR¹ KONIOi{COPYSIGâ OPY_FILt ARYPTE Ô  m jTERMID�  _* Æ PURSESp /TE 
ÃC/ yHAS_KEYÛ `IMMEDO�e PIS_PA•   ž _RESIZE#   & v  _ OSYNC”   ?AHE— LUSE_Âç PWCHGAˆÌ ÀDECL_ISFINIT+£  IN¨ *NA. �RTLD_DEEP{	ò  PGLOBAãS < 0LAZ  /OC7 KMEMB	q oNODELEÝ s ANOLOIu 9NOW�V ATZNA‰F‘VICE_MACRVL @V_PT5	. Z_PTMX"BIREC'* qIRENT_Dò
Š   ém 0IRFˆ KLFCN|[DLOPE¾:UP2_ :UP3 ð	YLD_SHARED_CACHE_CONTAINT‡ ¶ pYNAMIC_Y9INGH \ENDIA’ ,EPö ‰_CREATE1(*ER�0ERF^ó BERRN´ AVENT¦ @EXECè& ÚXPLICIT_BZERO·  2MEMDI  PM¤ I qFACCESSk @CHDI¯	 'MO²ÀVE_FCHMODAT'þ: 1,
 'HAVE_FCHOWN' +AT ZNTL_H ‹DATASYNC {OPENDIR †WALK': 0{ jEXECVE' KINIT 0LOC9 ´ .OR :PTYJ ŠPATHCONF jSEEK64ˆ   O' <TAT{STATVFS) ÿ LTELLb   b ;TIMè lTRUNCAþ U) Nv    N µ ºGAI_STRERRO�YGAMMAÿGCC_ASM_FOR_MC68881  Xá < =X878 ŠUINT128_TªGETADDRINFpGETC_UNø)EDošGETENTROPì›GETGRGID_ä   ?NAM `OUPLIS� CG 0OUPYn±GETHOSTBYNA²	0  e  j_3_ARGX O_R_5" 6" 	œ I ø `LOADAVq 	- JLOGIí0GETØ „zPAGESIZ¦pGETPEER4 š=PGI®MPGRP( '  [RIORIÂ k 0WEN¤	Å /PWÔ?PWUlRANDOMz �_SYSCALL /ESÌ  NRESU» S  P¶ 	*MSPNA‡ W1' ð LIBC_MEMMOVE_BUÀ +RP�HÛQHTOLE¡7JHYPOIRIEEEFQ c 0IF_ÚYINDEXŠINET_ATO= P CITGRH\ {NTTYPESÄ !IO ( ÝPA_PURE_CONST!KI°Û   P* @QUEU¸V @LANGåm * úLARGEFILE_SUPPOR$pLCHFLAGJ @CHMO¸F ELa& 0IBDk  K ^  IBš	}NLIBI~«LIBREADLINê   ISOLVD ÀLIBSENDFILE'ü: 0,
 'HAVE_LIBUTIL_H' ;UID gNK': 1; LNKAT ­UX_CAN_BCMT N l  _J19396 ÜRAW_FD_FRAMESš Z  $ ^   ¿JOIN_FILTERC _MEMFD� NETLINK OQRTR _RANDOOTIPC4 ¡VM_SOCKETS 	nqUX_WAIT ÂJOCKF†LOG1P 2 šNG_DOUBLE ,STÓ<UTIqjMADVIS: yMAKEDEVN zMBRTOWC d[CREATA QEMORYÝ ö zMEMRCHRB KKDIR¦ kMKFIFO'   (  NO×b MKNOD&  ô 
N *MAS<MRE bNCURSE¹ <NDIPNETPAå_  ´“ kNET_IF
:NIC0ùNON_UNICODE_WCHAR_T_REPRESENTATION%KOPENç   9PTYè zPATHCONQ;PAUîJPIPER@PLOC ù JPOLL\ "OLië POSIX_FP  LLLOC+ @SPAWä N   ­‹ :REA÷P 
®  Ö 9 JLIMIålPROCESç�PROTOTYPœ“  THj ã_CONDATTR_SETC+& �DESTRUCTOò† E aGETCPU? �P" 
I !INÃ Q !KI£ `SIGMASÐ¥ žKPWRIÆ Y' VZ  S	" ©  
S @REAL«> LNAME< ð L_APPEND_HISTORïð àRL_CATCH_SIGNA¯
 POMPLELE  iJACTE¡ G + �DISPLAY_MZ   OOJZ ' 	®
Q 0SUPØS… * ¿PRE_INPUT_Hj  ðRESIZE_TERMINAL': ö0,
 'HAVE_ROUND': 1 ¦TPSPAWN': ' ÿSCHED_GET_PRIORITY_MAX#  HL 7 !RR: �INTERVAL6  ¿SETAFFINITY _PARAM d JULER ÍEM_CLOCKWAIT �GETVALUE ;OPEù �EM_TIMEDH kUNLINKF \NDFIL[ JTEGIh^SETEU '  jGROUPSY�ETHOSTNAMi I¯  ÓqSETLOCA• 	 Pn  LPGRPl õ RÖ ?RESW  ?RESî  RS;  JVBUF� kHADOW_‚3HM_Õú 5HM_» pIGACTIO
 `LTSTACé	 `FILLSE_	 ËINFO_T_SI_BA]1SIG=RUP7 <NAL½ šIGPENDINGé kIGRELSú IGù¨	‘ ¼  © 
Z kNPRINTX OCKADDR_ALˆ  LSA_L8 PTORAG¬  ‹OCKETPAI§ w@PLIC> w [SIZE_?[TATVF$ºTAT_TV_NSECæ  2½ü TDARG_PROTOTYPEQ LDINT¡ ^TDLIB l_ATOMIy  RF¥Ž ]RINGSB    0LCP#L_TROPT?  ASIGNm	, üUCT_PASSWD_PW_GECOä R# - ²  $ SGƒST_BIRTH× ¦TI %  LK·H 
 ¯Ž E @FLAG! f G†
… ORDEV‚ �TM_TM_ZONi/#YMß A+YNê[YSCONH^YSEXI«¡YS_AUDIOIOïÝ ŸYS_BSDTTY  bDEVPOL2
3 ?DIR0  ÐENDIAN_H': 0,ù	
 'HAVE_SYS_EPOLL_H': 0, oVENTFD   AFILE 1I BIOCTa 
 ²KERN_CONTRO 
€ qLOADAVGQ  /CK  ?MEM¯ _MKDEV0 1MAN 
— QMODEM 
v ONDIR  BPARA/ 
G V
 _RANDO0 RESOURCAaSELECT| 
M ESENDu
® _SOCKE4 oTATVFSN /TA1 CYSCA" YSMACROM ‚YS_DOMAIc
� aTERMIOƒ  ?IMEN ?TIM?TYP/ U] 
¯ U‹  OTSNA] ?WAIBXATTI ÈTCGETPGRP':  S jEMPNAM* ù  &$jTGAMMA< KIMEGO  F
%  MP( ˆ › )_RzTM_ZONE< kRUNCAT ZJ	< ŠUCS4_TCL ' *RUNISTj iLINKATy ÐUSABLE_WCHAR_ @<UTIGU8,NSD   SW   l€ rUID_CREç h   PENC_Bÿ  ‘GENERATE_Q ?SAF$  
kUO     YVFORK¥  ‘3J  4 -ID7 P @
q `WCSCOL«… @WCSFÊ 
d ZCSXFRsjWMEMCM ÊWORKING_TZSE«iWRITEV¦ ™ZLIB_COPY _XT h€OST_GNU_ùð': 'wasm32-unknown-emscripten'‚ÐINCLDIRSTOMAK‰ò'/src/cpython/installs/ þ-3.10.2/include '
  B [š  ™ � /À/python3.10'ò,
 'INCLUDEDIR': '/src/cpython/installs/ ÷-3.10.2/include'> /PY= S  R H QSTALLF eusr/bi 8 -c# __DATA( y -m 644/ PROGRAM2 	+ oSCRIPT* _HARED*  † 5755[ `SONAME- 2libK ø ".a" 0O_H °Modules/_io m $.h$ @OBJS' !\\ eLDCXXS† 3c++ AFLAG)  a_NODISÚ  aLIBRAR¶• #LD! 6 q ”�LDVERSION›  Õ ) 0IBC  "DE| ]<lib3LIB‡ A x JFFI_ß 4-lm 3OBJc Pû N1IBPÙ ˆ ¤/pkgconfigO Pâe
/G ‚õ-wasm32-emscripten^ 2YTH‹ ä
A_DEPã $ ~ ±_OMIT_FROZE¡!IBV g-ldl  k SUÎ …asyncio 3 1NKC`c^fINKFORv× `PO_32Bv 
íËIPO_INTEL64_±LVM_PROF_ERè"noL  1FIL£ QMERGE2  ã lr`OCALMO+Ï p-DHAVE_vý PREP_CIF_VAR=1  üLOSURE_LOC=1 '
  '2 C- "AL/ , Q-lbz2ž pMACHDEP{ _È/ PSTLIB3 Õ"í`MACOSXFÖLOYMENT_TARGEmIMAIN×ðMAJOR_IN_MKDEV': 0J €SYSMACROT1 aKESETUÙ $./)“makesetupÍ NÂÈ ‚share/maÉaMKDIR__ ysmkdir -Y €ODBUILT_Å ” ò	'array  audioop  math  c ÿ_contextvars  _struct äð  '_random  _bise( ð_datetime  _heapq  _json  _csv _typesQ ðunicodedata  _picklJ ð	socket  select  _posixsuÞbprocess  '
  ò'binascii  zlib  pyexpat  _sha1 2256	 2512	 3O À_md5  _blake, @crypM  bz ÿqueue  _multibytecodecL  ss_cn  _ &hk `iso202X  /jpK &kr? ÿtw  _lsprof  _decimal  mmaG ðxxsubinterpreters  posix  errnorá ‘ ¯  _weakref˜ òfunctools  _operato£ €llection “abc  iter* ÊPatexil@signÊ 0_stÉ0tim“ `threadó @ocal /io— °faulthandleŽ °tracemallocâ PymtabB ôtype',
 'MODDISABLED_NAMES': ' 1LIB ý-DHAVE_FFI_PREP_CIF_VAR=1  ËLOSURE_LOC=1½'- C( "AL* äT-lbz2‡ 1OBJ‡ áModules/arraym E.o   hudioop Emath) 
�'7 _% 5 c 6 Å 7 ¶contextvars-  `structW w orandom;  fbisect A @date'* ~ Vheapq B @json£ 8 :csv  (?s.o€callback# E    ¿%.ošocfieldG Rstgdi.F 0uni�Idata’ `pickle Õ Wsocke>Q  seœ$su‚ j C v  ~  �d 9 pxmlpars·  !roÉ J gxmltokEä } E  ín I fsha256' = 6512 ? 3% = >md5 @ Q & gb_implß  s r_œd c?_bzÌ _Ë= 
Ú b¼ Ñc7 0s_h¯¹ %   e MV Às_jp.o  '
    ü'Modules/_codecs_kr.o   )tw µlsprof.o '
J 5   M Érotatingtree9 •decimal.ob ŸbasearithN —constants7 zcontext Pvolutq — (cr1 —difradix2E  fn" ? ‡fourstep0 'io mpallocÉ .mp ÇnumbertheoryL 3sixk � €transposï MQmmapmÑ v: ö_xxsubinterpreters3 øVposix J Verrno& = 9_sr– [) O p_weakreXÒ —_functool¥ ? |operatoÁ�llectionB  ab¾} Oiter| fatexitâ nsignal @_stajAOtime6  fthread 
_localA i¯£  ioƒµIfileçZbytes quffered ”  ®  x astring q±faulthandleÆL t_tracemn? hsymtabù A òtype.o',
 'MODULE_OBJS': '\\ €ULTIARCH úwasm32-emscripten# �_CPPFLAG@ 4-DM; M=\\"; 2\\"> ð
VWDELCH_IS_EXPRESSION': 0• ÀNO_AS_NEEDED‚ 3 lOBJECTª ñ OPENSSL_INCLUDE… /  %LD� 
 .IB- ARPATô + T~ ò-DNDEBUG -g -fwrapv -O3 -Wall) ñ THER_LIBTOOL_OP7  ðPACKAGE_BUGREPOR ã  DNAME÷  lSTRING ?TAR- <URL* 8VERNÑPARSER_HEADERô æ üÐ \\ Parser/myp0linÐ ptokeniz¡Ý OEGENX  W - €GO_PROF_4  “ [
 JUSE_ �LATLIBDIR- 2lib0 Z ñ
OSIX_SEMAPHORES_NOT_ENABL>à0,
 'PROFILE_T÷BASK': '-m test --pgo --timeout=1200',
 'PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT': 1,, ñSYSTEM_SCHED_SUPPORTED': 0R PURIFY} a ˆY3LIBRAR ðLONG_BITS_IN_DIGId 3? PYTHON? cpythonE   �FRAMEWORÚ  0DIR9 Ïno-framework' sINSTALL. " `PREFIXL  KPATH �_FOR_BUILþ 1'_P¼ ò_PROJECT_BASE=/src/cÌ �/build/PyÙ ¿-3.10.2 '
  N ôHOST_PLATFORM=$(f 	 )G ”  ¼ ƒ=$(shellAf py� ÿ dir.txt && echoJ Ê _/`cat> 
m �`:)./Lib/ æ ö&SYSCONFIGDATA_NAME=_sysconfigdata__emscripten_wasm32- ` ‘ ƒâÏAREGE€ pHEADERSÿ(\\ :OBJ ±TIN_HASHLIB E$ �"md5,sha1 0256 0512 “3,blake2"\ F ÁMODULE_CFLAGE ÿ-Wno-unused-result -Wsign-compareó eÿ"'-Wunreachable-code -DNDEBUG -g -fwrapv -O3 -WallQ ÿO2 -g0 -fPIC -std=c99 -Wextra? Ò å  paÌ?terI ÿmissing-field-initializers@ ðerror=implicit-function-declara F ðfvisibility=hidden  -I./Include/internal N 9 ã -sUSE_BZIP2=1 oZLIB=1G 1DPyTaD_CORE 4TINn_?	Ì'P-0
ƒ `_NODIS'Hú p ä'+ @  ?'-W(/'-
ô OERCE_C_LOCALE'~Y»¬Àlt -Wsign-coþmpare -Wunreachable-code '
  ÿ&'-DNDEBUG -g -fwrapv -O3 -Wall -O2 -g0 -fPIC -std=c99K ù
Wextra -Wno-unused-result ŸparameterG ÿno-missing-field-initializers6 ðerror=implicit-function-declara ÿ -fvisibility=hidden Q ðI./Include/internal -I.  ï -sUSE_BZIP2=1I $ ñZLIB=1 -DPy_BUILD_CORE',
 'PY Å_LDFLAGS': ' %PP | Š f > óENABLE_SHARED': 0n ÐFORMAT_SIZE_To 4"z"4 …   a_NODIS0 - ðSSL_DEFAULT_CIPHER¾ 1g  w_STRING‹ ¶STDMODULE_Cé @sign-coÞðã8P è2L í ; òöA -÷I 	4 –!y_o/y_¦÷y_HASH_ALGORITHM1 �TRACE_REFmÔÀQUICKTESTOPT ò'-x test_subprocess "io ¡lib2to3 \\ËpREADELFCtrue pSSRCDIR ð Mac/Resources/fÁCwork) €TSIGTYPE* Bvoid %UNyÐcSCRIPTR ò/src/cpython/installs/ ±-3.10.2/libK õ SETPGRP_HAVE_AR@PSHELLu r/bin/sh- BHLIB†ldl  -lm p_SUFFIX4 3.so ÀM_NEEDS_LIBRßSðSIGNED_RIGHT_SHIFT_ZERO_FILL^ % `TEPATHP M °IZEOF_DOUBL8 hpOF_FLOA_ 4 1POSƒ'16 ,IN( !LO6;   i 	@    8': ‚ 1OFFm  1PID [ 0PTHO_KEY ¢ 1SHO=2È  ù A 2TIMv† }UINTPTR- ˜VOID_P': Ÿ JWCHA+ ÀEOF__BOOL': ñ1,
 'SOABI': 'cpython-310-wasm32-emscripten'+ `RCDIRS- ñParser Objects P; „ Modules Ô/_io ProgramsB ‘_GDB_HOOKH ò ./Tools/gdb/libƒ 2.py. òTATIC_LIBPYTHON': ³ ‘TDC_HEADE�  ð RICT_SYSV_CURSE_ ñ"/* Don't use ncurses extensions */"Ù €TRIPFLAGÛ -« $UBí �  0TOO% òInclude Lib Misc# PYSLIBy D'-lm À_SELECT_WITH  T_TIMEË ÁTCLTK_INCLUD³ '7  M  aESTOPT^  @PATH�  )2'./M C `RUNNERE 2  •ý´s/run_tests™RTESTS 9 pctypes/# 5 \\q  è 0OUTë 0200h 8 b_MODULì "yelðTHREAD_STACK_SIZ1 2IME0  5':  OHM_INe0 Z(ñ/usr/share/zoneinfo: ;lib & 
 5etc& ç ±UNICODE_DEP™þ ÀUNIVERSALSDK!, �PDATE_FILß 'e´update_filegðUSE_COMPUTED_GOTOd Ò  ^ IQ'3.10` ÁWHEEL_PKG_DIÐ  INDOW_HAS_áB ŽðDECIMAL_CONTEXTVA8 O �OC_STRING7  @TRACÅ Œ + 4YLDŸ zEDITLIN& yLIBINTL) ÐNEXT_FRAMEWOR.U ‰PYMALLOC0 uVALGRINn ðX87_DOUBLE_ROUNDINÆE 0XMLC©±xml xml/dom Qetree
 pÐs 1sax;Àabs_builddirÆS/src/&/ /ø-„%.25 ?src3 �dataroot4 ƒinstallsÍj Ãp ½exec_prefix¤ = 7 2 Õ ò.'}
"""Thread-local o	ñ.

(Note that this m´ provides a-Ðversion of th2  O Aing.R ñ
 class.  Depending on* 9 €à you're using,$ ð,re may be a
 faster one available.  You should always impor· 1e `… `… ‘ from
 `tò �ing`.)

 E supD ¢managementä  à / ó@.
Ifº ` have  6°you want toÁ ‰   "a € ô, simply create
 [ ŠA andõðits attributes:

  >>> mydatÿa = local()
  >>> mydata.number = 42  
  ò	
You can also access theS ú-object's dictionary:
N  __ r__
  {'t o': 42}' ð
.setdefault('widgets', []¾ *[]5    
  []

Wha‹ ñimportant about thread- ± 0s iÆ a @eir R are
% Cto a7 x. If weú - Ðin a differenG  d û Plog =” qð def f():
  ...  ó items = sorted(“,.  ()ô 2 ±log.append(  ? ^W = 11k 9 	( )©1ñ 3ingd8& = !.TK�(target=fƒ  Q* e.startf Ejoin  lo] ÷[[], 11]

we getH \ñ.  Furthermore, changes made in~o ™ Ò
don't affectËBseen+ è	œ	åñOf course, values you› bfrom aî=ä, including a ³°
attribute,JÓ for whatever© � was cur2|P timeÒ ? &  ²  o< £at reason,— ‚nerally ù wëÔto save
theseÅ Aacro¯ O @s, aõðey apply only to~ ¡  they
came ø %.
þÙcreate customÐs by subclass   A MyLŒi	½ Žõ :ù__init__(self, /, **kw<  R  .Ž .update(kw¤N qsquaredM D qreturn K � ¡** 2

This�be useful:0supk °wà, methods and
¼ `ializa `.  NotòQat ifÐ¤define an ê A õ	, it will be
called each5	‰ Ó@usedøpa separ³‡   Ã `
is neÄ!arüž eZ á	Ð`.

Now­ 3we 
ã[% =æÂcolor='red')G pwe have=å hD � 
 }aÌaitial Q ,  1
  h ½4delè c
And aZ� that ope#2s oU }\ / G‘4

As bef—   @ ~U œb@À[[('color', ð.'red')], 11]

without affecting this thread's data:

  >>> my º.number
  2 @colo óFTraceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no at( ! 'f ð*'

Note that subclasses can define slots, but they are no  Û  
lg 4. T Äshared acros sú `  � (< Æ   !__o b__ = ' '6% =? )7/ O = 4P Q  ²P

So,Ê q separaý  Ê ¤ ´# =½Qing.TÇ”(target=fy * {.start( ‚join()

0s wbewe seej @11

 3del$ð	
"""

from weakref imporf ¤contextlib  ámanager

__allS!["sò"]

# We need to use )!s m  th  Ëemodule2
#  å may also wantS Aur `r !` ú�, if supÂ Afor  ðs
# isn't compiled inD  † `e`i @.  TYð
creates potential problemM  �“ circularrs.  ForêÐreason, we doy Um Áing`
# until+’bottom ofÖ�file (a hœpsufficišàto worm around: /
#¢  F).  v Îôplatforms on CPython do have06
# 2!3he ± 2, ax Pre isñ& 
#ž Tn, so ðs introduced by fiddlþ †Porder )€s here w< ¡anifest.

ç! _Ø@impl£b  """A –W  _-* ­ dicts"""
qkey', '!  	 0 Eargs @lock #__#!__4 Âá __init__(selfl c 0  #³@ keyýq2he é&' 0�  k? ðWe keep it a strÔ  ¡ spU /@make €unlikelyÓ   h ¡ë  M ¦# a "real"o i  · .§ B= '_2inga.  h@.' +† 2(idê  � ^  ê R{ id(Û ”) -> (ref  ‰5) }�  ü P = {}ŒX@get_ n ç p �"""ReturnaØ· EAcurr'NP. Rail1Key¶ Enone| �$d. _ 3 = M ~   2  r~ ¹ B[id(7 0)][¬ ( Bdef DÆ Cbd a newÈ Àr the currenót thread, and return it."""
  ålocaldict = {} åkey = self.key P ² = current_ %()"  idJ 2id(  Adef m õ_deleted(_, key=key):@  — ¢# When the2 ƒimpl is 9 �, remove! g ¹ attribute.J  B= wr ª  j #if# _ Šnot None�  ' 3del( 0.__-u__[key]l  Ý a Þ idt=idtÞ 3  | Û . o 
Õ P# Notþ aá is@ ±suboptimal Ô    ûÅ object gets®  Ó ð# caught in a referencqûop. We would like to be calledE ¡as soon asŽeOS-lev.Ú ends insteadÅ Ý  ™
 ˜  Û —¶) .'`s.pop(r¦ !wr   =ã (Ð,T¨¡#, œ,ø/   
 Ð �  s � Q[idt]" ; ‰  ¹ . ¤´  ð

@contextmanager
ka_patchÏ ]#=îe.__get!__* A, '_Y  __. 'ú 6tryðdQ  A.getê™ÿ except KeyError3 hcreate6  i±args, kw = Y ƒ   õ # __init__(* b, **kw¢ Gwith; Flock ßB.__sñ ì ‰ ‚__', dctK  � Òyield


classO »__slots__ =* :N 
· …ø _new__(cls, /, ¹ R  o @if (Ò q or kw)Š 3 .ñ  ãÆ Ô ?   ¡raise Type|à("Initializati|Ðrguments are /¦supported"ø  f "½ #   2 = &  ý …   .¼" =Ö  Ù
@ $  ¥‡ = RLockE è ®[ š,ïX #�@needŠfnH"Çbnticip!of© » %# lSbeingÊ,N ñmake sure we don't 7 it? ö again ourselvesÉ‘  ë Ê v3˜Gnameôñã Ë   Z L
S À(self, name)ñ

    def __setattr__(self, name, value):(  , !if æ == '__dict__'  # õraise AttributeError(A  "   °"%r object w + S í is read-only">  % ¥ Ð.__class__.__° 5__)+ ±with _patchÒ Å  € creturnƒ .ÿ '0del° 	'[  Æø  


from th¬òing import current_ ð	, RLock
# Access WeakSet8 ðough the weakref module.
# This codeð	separated-out because it ðneeded
# by abc.py to load everyth› òelse at startup.
¼ _y » 2ref TtypesÑ óGenericAlias

__all__ = ['Ì Q']


Žò _IterationGuardÏ ðntext manager registers itÓ1 inA! iK `ors of ß#-ð container, such as÷  ©ðy all removals until> 3  N cexits. vðtechnique should be rúPively¸ œøsafe (since sets are)..Einit+ i´ 4ñ# Don't create cyclesŽ  © .; y = ref( )v DenteÉh 2w =7	: (3Aif wProt Noneº …   2w._Žring.addV¨ rQ ¯ 	Œ xe, t, b” 7Hs = ˜ Ž  ± !s.e©    §Jot sâ   ¡w._commit_= Uals()Úì6 7	âPdata=:â  . ~toA f qe(item,ž@ref=ß 8 )H  �   G  lf# º  !if@ Á% ËÍ     j •._pending0.ap ® 
}  <  aN  ‹.discardB n 2 = p eÍ€# A list1keyç‘Umoved' F  ¡ ´  ¥]$ Àlf._iteratin³g = set()
  õif data is not None:  $ Àself.update(* !)
 ðdef _commit_removals(, )? 1popp µlf._pending, A.popI  d tdiscard-  g . $ ›while Tru  6tryr  M   §item = popë   þexcept IndexError< ereturnx  6 Œ (W  |_iter__ø üwith _IterationGuard$  W @for S pref in >.ü ”  & $ =- Ô  K !if Ç %   Ð# Caveat: the4 ùrator will keep a strong reference to G   0# `˜  ` until it~ ÿresumed or closed.< Pyield mON_lenN�A lenD"6) - \	£ƒcontainsY ,u ¥@@wr =ý î ê   :OType9 ¥ UFalseñ  )wrÞñ creduce› • : ñ ñ__class__, (list E),),i      qgetattr! Ñ, '__dict__',Ø)"ad’"ifˆU
•¬ W   Ì.j 1refN,\ 1e� Bclea¸ Œ >f Acopy.v |Â {% » Z " 8 ® 4è > Ö!lf Y!»?Keyº  8draise    ('¹ñfrom empty WeakSet')   $	{ žšt I d&z§Om ªœþ ð‰ On Š ‡‰ _other€Às:
         ó   self._commit_removals()
  õfor element in other:  % B Cadd(' !)
 Àdef __ior__(# ,< )=   �.update(X v areturn� N ¯differenceQ �newset =8 W.copyÉ  .E _{ 
/ Ê ¦__sub__ = = – Q  Ø î 1__iL ð ) < "ifÓ …_pending©MŠÌG 2 isŒ>  §data.clear;Oelse, ÿ  ref(item) < 
 9áÏintersectionã¡.__class__o n D if   X~ Q__andÎo Ð Ó  > ÒP Ò  < ‹.Ò, ] .´· Š(ssubset†~ 0 s B__le~3 zO__lt-ù s 0 <   tmap(ref�|PissupOÅ 2 Ç gÇ 5 É gÉ >É O__eqàif not isinstaJ,0"v )MbNotImpÝ!edì \  =R/t(l¦symmetric_;X¤O ‹ß Ê¬ V Â 0__xt b –  ¥e 	 û Sù  A.__i` ð   & < ð4G Â)À       self.ð.data.symmetric_difference_update(ref(item, self._remove) for  Ã in other)
  areturn0 
  def union(D ,0 :  4 1 Á.__class__(ed sa 	8  e st ‚__or__ =d s ©isdisjoint@ x "le™  .intersect« Õ f) == 0T �__repr__R )K    .Y)8 Ó 0get2« å ð)method(GenericAlias)
# Copyright 2007 Google, Inc. All R ñXs Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs) accordingQ àEP 3119."""


Î"ab= Â sfuncobj°"""A decorax ´indicating 7  8 "s.!ðRequires that the  a#ñ is ABCMeta or derived from it.  AF, ? Whas aA 	3 K ‘cannot be> ýinstantiated unless all of its¶ ñ are overridden.D >The) °can be callZ s nyY  æ anormal? q'super'+ Õ mechanisms. U 3`() mayU uïbdeclarÉ `+ô
properties and descriptorbUsage:‹ �MRC(met…=7à $   @o › È      %4my_" _# [, ...K  3 "..J f  UT.__isH G B2Truõ >/ 2


À 3  8 ( � ¬5 2`Deprec/w, use '$ „' with '€ {  ' e?eadh 3ABCŽ  ÷   @P 	WsD O(clsw	d  x	 q	!  Ýr__init_	,¸GableÉ  ö  Á ò ÿ (), W > )ÑbstaticW( | Ó6 Ô% Õ2Q H ù   ÖE (I` ÒÀthod__ = Truñe

    def __init__(self, callable):"  &  õ.__isabstractmethod__ = True- psuper(), W > ¤)


class C ”property(	 t õ
"""A decorator indicating:  2 Bies.Ê óDeprecated, use '" ”y' with 'u ¸ ¢' instead:? ç � SC(ABC‰     @M æ  
S 	  Y4my_" _A e^  L #..È 2"""’ l	R

try ñfrom _abc import (get_cache_token, ä ™register,²  †   N _“ancecheck9 1subÁ  j OdumpI breset_p Rry, _ ž ±s)
except I¹ XErrorÔ p?× �ABCMeta, u A ß Ä  ‘.__module–¢'abc'
elseV »  + H(typã0"""_ $ 0for insAðp Base C$0es %#s)´ 7ÒUse this metaG Àto create anx A.  A	 „ can be P!edÆ  G ñdirectly, and then acts as a mix-in ^ a.  YouJ Ralso e%erJ Punrel’ concrete9  ½ ¥even builtP 1es)s 7 I 1ABC€ †'virtual· Ps' --¥ sã ¯ i:åscendants willI  be‹ wsideredF 0 ofE Ã vQBC by ¨ H $is9ñ() function, but0 
G õwon't show up inH Átheir MRO (MÍp ResoluO ± Order) norÅ  ×&ho¨ implementa. s/$ed´ „  û XU (not„ ŠCvia 7%).  
    Oó	__new__(mcls, name, base û space, **kwargsdTcls =e .K “  ‹ yit(cls) Pretur sÃ /  º  2 ,ù¢ C"""R™< a l $F\  ` Rt sú€, to allòBsage>7Wi G m  Ë í ¿ ˆ  ä  F%st2"__í Gí �Override n$is) (	  , `.™ 	+ �p ž ð subclasscheck__÷(cls, subclass):
  ô"""Override for is) (	 ©, cls).""": Äreturn _abc_+ [checkp 
6 òdef _dump_registry+ žfile=Noneœ ôDebug helper to print the ABC G œ ' @(f"Cò ó: {cls.__module__}. pqualnam 1", ‡   )²  )L ÿInv. counter: {get_cache_token()}C (%® ,4=  ‚negativeR ,€ . 
" Ð_version) = _Š  V M» 	 9: { /!rº ý 2 ² ?  < 
À E 
 N %V  ^ 
Z ß÷ ª Ù´a_clearb@C ”.   (Kd¼þ ging or testingGi_reset)3 ‰ os‡ , …  9 æ 0


ñupdate_abstractmethods" á"""Recalculatetset of 4  5  n Ž.ë QIf a  À has had one2 6its3 J ð implemented aft!he½D Áwas created,“ 9 ø	 will not be considered O QuntilK ñthis function is called. Altern°Ply, i¼ <new§ Ê AbeenN PaddedÂ ¼¦ B, it’ Konly“ a)½  ofË M @ ú § YTÅ ashouldk Ì ð  before any useå 1madx§ r £usually in§õdecorators that addé toª  rBject1 éR5sR,åallow usage as^ 7  If2     ¾¡an instanc« ÐABCMeta, doesßQhing.· ´ if  ’1attÇL, '_×7__'‚Q# We Ñ.    here beca=ñcls might by a C�  b#aaL�or a pythXË q(especilgduringG D°, and we waðo handle both cases.
        retñurn cls

    abstracts = set() õ# Check the existing+ ± methods of! ñparents, keep only ConesM ñ
that are not implemented.  ¡for scls i˜ ±.__bases__:  ¦  # @name# €getattr(3 T, '__Ã — †__', ())>  B „value = > Pcls, S b, None÷  )   %if( 8 z, "__isi «__", Falsek  B + `s.add(h b ð# Also add any other newly -ede# E !, �  ÷cls.__dict__.items(ˆ Â +¾ t  p� = frozenA sñ 5retpñ 
class ABC(meta ƒ=ABCMeta¼ ¡"""Helper   :ðprovides a standard way to create anV a using5²inheritanceB1""" ð__slots__ = ()
"""StuffL ñparse AIFF-C and ð files.

Unless explicitlyŒ 2tedÄQwise,÷ðdescription below is true
both Êc Z i !Any !-C{ A hasX `followˆ structure.Ã,+-  +
  | FORMŠ O|
  , d<size>* %  , 	1 X  ] CAIFC/  , | , p<chunks_ , 1 .6  O °  	    i  ú 3+

6
40str1"q�" instead·  qC".

A ž � consistÔò	an identifier (4 bytes) ‚Ped byŠ5ize ù,
big endian order),0  I°data.  The p² field doespnclude
+   _8€   header.

@ ‹  Ü ¿ 0typ°re recogniz]q
  FVERøp  <vers–`number €-C definM @docuš3> (  Î)BDMARKI #< ±markers> (2¡ ðg  list! ‡<5 6 ID7 Ò, must be > 04 p  <posiG>g	 L  R> ("pí"$ ICOMM­ channel®  <Í °sound frame$ óD � saÀ & ø <  Gâfrequency> (10ó, IEEE 80-bit extendeda  ñ AfloagPpointÆ   is^R�<compresÕ )ð<human-readable versiñon of compression type> ("pstring")
  SSND
  ð<offset> (4 bytes, not used by this program:  4 �<blocksizX 6 ó sound data>

A � � consists¸ 1ƒ ² length, a ´   ðcharacters, and 0 or 1
³ ó pad to make the totalF ð% even.

Usage.

Reading AIFF files:
  f = aifc.open( Á, 'r')
where( ¡ is eitherd @name˜ a `or an >  Îpointer.
The ð must have methods read(), seek  ä ñclose().
In someÌ)Qaudioj Qs, if’ ƒsetpos()S  ° Ê ,
[  Ðnecessary.

TípreturnsÏ sinstancè ¡class witho `followKcpublicX O°getnchannel‘ D -- W anumber:Ä ' s (1 for– g    mono, 2 p stereo„ø getsampwidth() ^   1le  1 inOÿs
  getframerate3  Ç ’frequency0 n1 ¿ 	c Á ' 4  x p c —   �� ('NONE'Ù ŠÝ  .  _F `human-)�able versá*of5 ? m   /edw Pparamð ® a ‰ ddtupleª ,`of allÆ:the Pabove| s @ordeÚ�getmarkerf  V1getN@listO    s> " Ž í;Nonk ù€re are n#rkî H @(id)† d   ¼ñspecified id (raiseñ<errƒd  @ AdoesPexist® �2(n)Ò é¢at most n !  Þ ·‘
  rewindà ¡   Ã 4cbeginnf  6  ceam
  è1posÞ  Ö; Ø ò position
  tellk r  u‡current - s€1--  , (gpit unus‰)äD é>{ ,A ! Pgiven² É )Ð¡# !ofqsÙ i ½0ati÷ :@noth&Qto doÜE eactualÔ L FŽÔ 	'ð called automati @y wh¦ 2he ø ð
is destroyed.

Writ† ÆPwPDÀer must haveð methods write(), tell @seek ô<and
close().

This returns an instance of a class with the following publicm ±:
  aiff()  �-- createR °AIFF file ( ²-C default)6 c6 !-C8 ð
  setnchannels(n) -- ” `number¯ ! 0 ›sampwidth0   1le  * ›framerate*    ( n €  ‚ ! . �comptype( `, nameñ   @  * €ression - @ andÛ 
,  ü human-readable 5 u ¿params(tupln Aall # Òeters at once; Ïmark(id, pos¯ àadd specified / 0 to¨ P list�  3s
 r¶  (^€ current`  itì ‘in outputæŠ (usefulö  inê Abina3 Š0setj  ()Pçx€raw(data } g" r audio ) Ñ€out pathÎ upÈ 
z ²‚header
 N> d  Åbpatch ^ å Q ‚¨  --Š * , ¢ =µ
You shouldé`beforeB h firstÏ qraw or
&á Ö.  The total _ à does not need bes ð,
but when it is    7ácorrect value,‡ M 0havr 2
be�ed up.
IK @bestL ¼ Jset É�, perhaps\Psiblyd 
#,Mt£ î 
 us
 ê `raw.
W.  n   ¨ AbeenCÐten, either c& ? P(b'')Z¾ ()Á 	€sizes in¬  ð.
Marks can be added anytime.  If, @re a !ny…±s, you must„ Üa after*¼  .
è  9 » Ë  y putomati yÛÎ(ó 
is destroyed.
1í‘is openedq ¼ a extenê '.2'• 3 ŠYoX5wisF £  i1ten«‚ R9

aged by Ù m (� © s	 · b e:
ô"""

import struct „builtins ðwarnings

__all__ = ["Error", "B"]

\ `(Excepâ)KP  pas? �AIFC_ver1Á= 0xA280514072# V À 1 of AIFF-Cò

def _read_long(file):
    try	   ðreturn struct.unpack('>l', 3 .B q(4))[0]= dexcept0 WerrorM �aise EOFE ¨ from NoneŽ u� !L� F_shorth� 29� "H� FJstri>Álength = ord8#11)) 4if " 6= 0¡data = b''' Melse qC R Z& 1 =V gummy =«15 × v ø%

_HUGE_VAL = 1.79769313486231e+308 # See <limits.h>±òfloat(f): # 10 bytesÄ cxpon =f¹W) # 2% 0sig$ 12 Aif e5 <# -$  •% =- �+ 0x8000C ehimantv N v 4v /lo& � 4== X $= < 	ibf = 0.ƒ (el9 f0x7FFFÌ * q³ 
ì
Ü q- 16383(  ú  > (Œ c* 0x10 # +™ Ã) * pow(2.0,!I- 63÷R3* fÇcwrite_¡3, x!f. (üú Ü9x)); u<  ˆ< ïv  p: Ü;  ; ·3, sí ˜–(s) > 255°r´QValue¶"("=  êÓeds maximum p œ"qD0B',3(s)& 5 Œ Ò+ zb'\x00'ˆ‹±import mathC_if x ]B gƒx = x * t
¢>"= íR 
uÂ!  O ±4   FG 
b fž¾=¿ ‚.frexp(x" B e>$Q4 or 9 V >= 1 "!= Ð: # Infinity ‡or NaN
  ùexpon = sign|0x7FFF  ©himant = 0 -lo Welse:Z  ‰# Finite@ w  y+ 16382" 2if  8< 0W é# denormalized3  r f˜ ±math.ldexp( ,N )1 e à   |	; U > = h *32e (fs“ Rfloor“ 
' iBint(4 
! r 2 - / /, { $Í{ ù _write_ushort(fD @long À ³  a ð)

from chunk import C  ¤ollections önamedtuple

_aifc_params =  ((' )',¨  ñ'nchannels sampwidth framerate n ¡s comptype	  i *')€ .H õ.__doc__ = 'Number of audio l á(1 for mono, 2 ‰stereo)'× .• W rSample ­ ‹in bytes9 ¹  Ä 9 Ûing frequency6 ð 4 Ä Y n  9 ÁCompression <q("NONE"î ¬AIFF filesò  K  bK ñ("""\
A human-readable ver] Rof th›p a
('not²  <ed'z à""")


class AM \ :/`# Varih ñ s used in this . $ * uThese v0 �are avail? 1 toŸ óuser though appropria�# methods+f   _)1 --H Aopen:U with9  º �(), close	 ’and seek(‚#ôqset thr‡  6 __ŒC__()K Ô _Ñy nÍ1 ` ÷ e 5getO i Rg  e - c Fe <C per£ + l›3Ô  , …q ˆ  ~q  + lzÒ I c  (W R%-Cïv'vP' if # à)
    #       ð#available through the getcomptype() method
    # _ qname --, ¡human-readG pAIFF-C & €ression G >  D /  u tmarkerst   As in� ¯audio filee  = �ers() andë   )()= ó s …_soundpo€ PpositÛ 	ƒ cstream4 ê 	EtellXX, set~	A Psetpo¬ ’   ° These varizós are used internally only:0 A_ver‘º« dnumber,  deÃq  Ñô
or from builtin module cl9 °comm_chunk_ B Q1 iff¬QCOMM    has been & = Faifc2   sing an ¬ æö_ssnd_seek_needed8 ŸÀed correctly.*k   P A for… eframes
a ­ Á-- instantiaùCof aÉ QclassE  ;BSSND i _W !iz2s qof one   ˜  8  Š 
3 _ @ = N$ ò # Set here since __del__ checks it6 ñdef initfp(self,)û ì   .1= 0l  sconvertx   " K= [] S È   5 O0= C!( y ‰ "if9@.getbÖ() != b'FORM'Ê  + Ðraise Error('F ð does not start with 9 F id'c £formdata =k  c&(4!  ifÊ$  }  y} K«õ /el= C= 	1Oelseã  Ù 8 orÝ ˜ €£ " 9‰ f† zwhile 1‰ 5 n&= ¾  “#tri   f ïJ  ¯q * ¡except EOFÒ
  ! Ubreak¦   Y  %Ê5	( T+  Ñ ƒ” Q œ   âÂ(g 
­ - j
B ~  ~ 	™9 	Ì  z Udummyô  ¯ /(8  O 
³öÀ         eliû
f chunkname == b'FVER':
  ñself._version = _read_ulong(B )3 =eliZ OMARKZ  O OmarkM ` f.skip(f rif not ˜ Qcomm_' ˜ 7 or Bssnd 
× òraise Error('COMMÃ and/or SSND ¡missing')
å Ðdef __init__(� F, f)\ ÷if isinstance(f, str  Yðfile_object = builtins.open1 F'rb'ê  1 6trya      { .‡ 7fp(R 
: nexcept= 1 g.close\ ]   "ó   JelseH ð# assume it is an Â  [  Þ  alÚyE  I 	¸ 	TSenterU3areturnì‚'ex‚W*args4 e Ù  # ò User visible methods.   ßQgetfpÜS ‡  ._å � lrewind1 „ _€ñ seek_needed = 1i Ö_soundpos = 0U ¾  E …  x ! =…  G   "ifz!isý;Non¯ J 4 0 =  †  ?  Y 
  	Ltell× 	» · Ïgetnchannels; 
& 
< _frame: $ 	8 Ÿsampwidtht 
& 	< O Orate< 
& 	< comptyp; % :  yu 
 :  % `

##  “3getˆ9    Ã	™$ 	r _param[g_aifc_# .Ê"),u5getE1(),* }  r L Ó`F nPsD  	hC    '()G0getJ-eré aif len6#._$ )÷0ØH	# Ò < 	\ P [ H, id±0or  Ber iÄ| 
v  8dŽ . :[0]   a† " {¨Ê ¢ {0!r} doeð	exist'.format(id))

    ó	def setpos(self, pos):
   if q < 0 or  > ( –._nframes+  2 õraise Error('position not in range')\ H  soundpos =_  ñsnd_seek_needed = 1
$  ¸ Bread† ¼ ” 
À g J 
¸ $ `chunk.t &(0¬  Ý sdummy = sQ -  ˆ *(8- Ò X ã *< µ 1izeË  \   l
™   E p �  a ++ v +  % 60j 3if 'Z == 0o ¥return b''0 Odataõ J Ù i`ðlf._convert and U 
z   g + ( J Ý M‰ R+ len4 A // µ._nchannelsÒ  T Ý –sampwidth“ 0 ¨ —#f ò# Internal methods. %  ¼‘_alaw2lin§ ,)@impo,audioop=  ³ p a .D  � G, 2)` u` 0D `  _adpcmÁ  ~£ot hasattrü !'_M gstate' ò º# first tim.9 f = Non$ ³ &  =Á + #2,žT éÄ ùa_comm_	Ï  Ç „ ˆA = _9 bshort(. â- "+ Olong* •N = (X P + 7)8b a £rate = int; Dfloa“ ý Ãm <;û@bad - 1le 2öM M T# of ÊN /Í 0sizÍ  ] ¾	Š Faifc{vÑDEBUG: SGI's £@edit¡roduces a å  u 5:-(U  > PkludgŒ v  iÂ  ]ó¯ J= 18{  * A 1X   �warnings.	 2('W :� QCOMM ]  ^ ' :    Ð.chunksize = G23
  ©#DEBUG end ùself._comptype = chunk.read(4)+ B Ystart ©if kludge:  } Òlength = ord([ Bfile` *1)a  1 3if 4 Ž& 1 == 0U  ( % =. =+ 1} p  6sizÝ  +? ; « ªseek(-1, 1® Q0namt _Lr_string
H ;if …®!= b'NONE'ü . =. OG722.   *] snvert =m �adpcm2linû .eld þin (b'ulaw', b'ULAW')� o  ; n an An  ; n s¥  · ð
raise Error('unsupported €ression #'¾ < bqsampwidî2V,elr .  W  O  ¾ì3 S  % FUb'not� Aed'
0 Adef aPmark([ ,Âžn Rers =+ l_short‹p# Some óðs appear to contain invaliQunts.}  © ö# Cope with this by testing for EOF- :try5 " ´i in range(ª ½  d   /id¿  $   &poè /lor ( W<� + 0if V 0or 5 
Á      ?# s>Ehave+ (  „# dummy ›Rconsi6/of2 a‡  it‰Q0 and� ? ''/  #.__ .Ðpnd((id,E ,; ~`except­
ä òw = ('Warning: MARKd“s only %sÏ þ%s instead of %s' %¤ A(len±¦ b), ''   	 1 L^ 's',N  ;
Ÿw¶  s.	 ó(w)

class Aifc_writð# Variables used”Ï/ #w •# These v0 0are4 `r settC € throughGóropriate methodsD "of._   _}Á -- the openŽ\?  ´ �(), close	 @tell ðseek()
    #    ñ(   set through the __init__() method
    # _comptype --) pAIFF-C  �ression  °('NONE' in # )@  F n 0setA  9 P() or� oparams€ 5nam€ áhuman-readablel �  ~ 5”nchannelsÿ ônumber of audio   q I ð žsampwidthr “bytes per|  + /lez  & Q z …frameratk : ïling frequencyl C l n* V ¡written to{oheader„ [ ‚ @aifccàwhether we're r  ò aÆp-C file¢  ƒ 
 Y ÆK, rek	= Eaiff-   ° These varièós are used internally only:0 A_verŽ
¨ ¸,  } ý  ú   Êô
or from builtin module cl5 Y # •h Y »Aactu¤ / E †datalengà@size?  Œ Tx!es� j ÿ_I \ Ê J Ž � _Ü`= NoneìÐSet here sincñdel__ checks it
6 6def.‚self, f)† í÷if isinstance(f, str  #  w ”_object =p`s.open1 B'wb'? -   #trç    { .µ7fp(R 
: fexceptž = 1 z.close(8  ( Rraiseô     �# treat .¸` exteny”s as non-Q"ed¨6 >   ñ if f.endswith('I '  ( Þ _LE = 0C JelseÎ ð# assume it is an Hœ d al/½ \   ` >)æ  Ú   ,E œ   .5 B—  lt= _AIFC’&   ù û4!  òu= b'notl=ed'+ @nverF Ä sBÀ        selfó._sampwidth = 0
  ÿ self._framerate  n s written!  Odata Oleng’ `markerv +[]­   8 ‚aifc = 1ß ñ# AIFF-C is default
N Àdef __del__(!):  6   ˆ.close()- ^enter/ preturn 6 	. 3xit- , *argsc 
# ò# User visible methods.   ¸ Laiffµ !if‚ #._®vÖ  Ú ðraise Error('cannot change patrðafter starting to M 1e')�  H  ì #._j0ö   ™ w1™ @setné Anels¡ %,  —EZ&if„ O < 1«�bad # of­ Ä ŒÎ & =V  g 
õ  ÔH Ž hnumber�  A t— %._V ’ 5set�’ 
� ™ … Š?tenž ×( ÿ$u< 1 or • O > 4w  £ , 1le dÁ    & =U g
a ªH �  $ ‰ œ , ˜ Œ 1setn œ 
— Û sQ5if „ _ <= 0ÿ  Œ-  Â Š   & =T þ gþ 
ó ŠH ‹ $ ‡ ˆ*  – Š  ¶ ´ 
‘ „À       raiseó- Error('cannot change parameters after starting to write')
  €self._nf3 Cs = 
 
! sdef get (, !):  > preturn  B  _ 6ten? ±setcomptype@ $,  
 GnameT /ifP u y Oaiseü 0%if�  @ñin (b'NONE', b'ulaw	 eULAW',ø  ƒ  4b'a. A. ‡ b'G722'Ü  4 r» ±unsupported‰ €ression -£7! =,  $ ’ ƒ "  O"   ˆgˆ˜ 	È E \ ]    O Â: 	 % `

##  : `setverÓ 9 #,  !):#  ð D  !   5/, ím '… $ =� %1set=s°  ñ ncñnels, sampwidth, =Trate,?Ü H
  " =šsZ Ø ý    ý é*í™Dsetnj(
 µ5set„(
 % ž(
 % ã !   Ð(	 Ù)AgA9!ifb‚Ò 7 or Ä 
 ¶  ¾2allaû7setDäb_aifc_×ä%._� ,z‡  � Ü .   Y.    4qsetmark� ±, id, pos, & ó ¦if id <= 0  #	 H ÷er ID must be > 0 if\ / <E PpositŽK =L  v°isinstance(² w, bytesú¥  . § 5 ©  for i in rÒA(lenð._markers)):
     ôif id == self._markers[i][0]:
&  % ý = id, pos, name1 ereturn 	@ ™.append((C 1))
/ pdef get‘ (7 V, id)’ @for  Zer in½ %  · á . × ¦ P ~  : Òraise Error('> ÿ {0!r} does not exist'.format(id½  1ersÀ ¼ aif len r)„0» — 6NonY  < 1AtellX n 	2 ænframeswritten9   e 1rawC g, dataI !ifô °isinstance(!  , (bytes,  garray)5  I ' Ñ = memoryview9 µ).cast('B')s× àensure_header_› @ten(3 J )/ Î ! =P A // ¿ Ó._sampwidth *!–nchannelsC #if zconvert‚ S  " ½ ³ Pfile.ª ` Ò ©  ! 5tenR  #+  ]  † ;  +ÿ ÒÏš  W ø V ¼ —  -  ¿ ! U or \´  ò U P ulength 5   J 
m‘ b_patchû(QcloseÉ ]¡  @ is +
U þ� :try  u r0 Õ n Â J & 1Q  * ö# quick pad to even sizÆ %   ~  ¾ =gb'\x00 &   * z … 5+ 1ë 6  neÁ/s(Ô Ë + ãa  ƒ ç =  ™ = Iö 
 :   kfinallÏ@# ProÏt ref cycles Ë! =2	! fž —	 Ž   9 .¤µ#; ò# Internal methods. ©_lin2alvÑmport audioop=  þ Ø .D  ‹3, 2…  E` ðulaw(self, data)3:
  åimport audioop dreturn ñ.lin2ulaw(data, 2)
* Pdef _ Àadpcm(self, # )a ãif not hasattr; !'_I gstate'D  ¬  ] .  q = Noneˆ     w /, &  Û Ä _ Å . )N   U ë óensure_header_written¼  + Gsize· ä ” snframes5   ¼ #if¹ ð	comptype in (b'ULAW', b'|	 A Aalaw LG722,T  a} šsampwidthx  (   % E = 2
     ¤ L _ != 2Q Ðraise Error('1 1le € ð must be 2 when ñ �ressing 't  x  `'with / , /ö or G7.22 (ADPCM)'Ì B 
‹Žchannels½ 	¹ $# ) ¬Ÿspecified\ 	 í ê \  ( ©^ DOrate^  T , ½ 
û –ØÊúUinit_­oõ
ëJ  $ ÂQ== b'�
¬ ' snvert =ùE%elrT   û û_  7 ^  S^  W^  7 0	Q ”  , Colength8ƒaifc andó !G_NONE'G T 	—ö u q._file.� w(b'FORM¼
[D º' =Ã A // ù5._n%*½  ÜŽ  $ù] < N ½P ?& 1!" k >+ 1U  Š
K p –‰ ¨ = ˆRƒ –  ///	< ô  b   f Àlf._dataleng‡th + 1
  ùelif self._comptype == b'G722':,  7 + ídatalength = ( �+ 3) // 4? m B >& 1h l k  Ð :tryI . Rform_® c_pos =ð µfile.tell()¨ ñexcept (AttributeError, OS	 )` ENoneS Bcomm~ z gwrite_˜ C’ 2Oaifc  Ç R †(b'AIFC'= Fí & KFVER& _ c_ulongŽ  3 :, 4N ( lvversion4 Oelse¶ F� K   .– w(b'COMM" † mƒ - YshortÛ h –nchannels2 t£;pis not àÕ qnframes+ f	’ m’ G �  £ñin (b'ULAW', b'ulaw	 A a È¸€ 8t ¹6 ¶ Çsampwidth * H 6 Ofloa~ë Fratez ~ò{ D  ùz KstriÔ6 7namz  	yGSSNDyœ Ossnd„¸ :+i 7 0[ 10)
±Cdef % â 6&, z P®�ñ  = 18 + 5 + lenP q
� ·7if 9   =- Ý Ž{!12â  c Ü	R %18*  . 	F 0 'pG4 + 4 +oCmark� 5+ \G  b   $‹ h+ 16 +x7 greturný Àð
patchheader(self):
      ó  curpos = self._file.tell()
  #if õdatawritten & 1:"  )   elengthM   0 9+ 1/ o  # –e(b'\x00'w Oelsec _ 0if z � Û  Uand \0  ¾  ã ”nframes =6   ¤  ÷ : Fmarks 0º î Rseek(v6, 0ï  † ereturn™ 6  Borm_j I_posE Udummy€ µ 6e_f0 (y V  ùœ  ø b _U bulong(+  4,@ % ?tene OssndË i Ä O + 8c d ° Û ' ´ ~n =W
' Bdef ¨  þ1ers)üaif len #._$ )] ù –  GMARK A = 2‰  =Bfor c 3 in� s‘  ) Aid, 9cname =5 H  # _ 	 +Ç  0 ™) + 1 + 60 è ! ?& 1ã  W H_Yƒ è Ú    =�  x5+ 8– O Sshort€¨�[ C9� &idq  ) ù ?pos* Kstri}y 

�óopen(f, mode=None�!if @ is   if hasattr7 '8 '4  Ÿ     P = f.	 c¡  q = 'rb'& t qn ('r', \ ÷Â Aifc_read(fñ )el: w: (wb– : #; 6Ñraise Error("ž …must be � 0, '` ðor 'wb'")


if __S __É¢'__main__'5¤import syså !no ’.argv[1:](  :1sys ð.append('/usr/demos/[ó/audio/bach.aiffã fnž< 1[1]i Rwith ßnKv') as fm ÷print("Reading", f‚ ànchannels =", óf.getnchannels())
  òprint("nframes   =", /  -  –sampwidth-  /  H Frate/  /  ‡comptype‹  . <nam.   . õif sys.argv[2:]:  Ggn = ] !ÆWriting", gn> > úwith open(gn, 'w') as gc  ) Ág.setparams(b Ž '   ~while 1D   Ñdata = f.readJjs(1024—  *   pif not 5 O  % Ybreak÷     sg.writeg  F 
g ôDone.")

import webbrowser –hashlib

 .6ð"https://xkcd.com/353/L pdef geo: ó (latitude, long ‚datedow)Ù ¥'''Compute6 ñ) using the Munroe algorithm.
ñ 5>>>/ ò37.421542, -122.085589, b'2005-05-26-10458.68'	’37.8577133 b544543[ 1'''c -# ã A426/ @h = á ƒlib.md5(Ó ò, usedforsecurity=False).hexdigest( ñ6p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]Š Ê`'%d%s   N wYp[1:]~q ñ))
# Author: Steven J. Bethard <s ".b `@gmailåð>.
# New maintainer7ðof 29 August 2019:  Raymond HetƒRer <r $.h Y ñ

"""Command-line parðlibrary

This module is an opšßse-inspired cB b that:åÁ- handles bo	ô tional and posi �rgumentslð- produces highly informative usage mes 1 0supZsÎ 1ers„ ð dispatch to sub-ë 0ersã €e follow  å d simpl^ 1exa  Ê ° sums integY  = 2
 Ð  z €e resultw sa file:� a = arg #.Aú qParser(  Zpdescrip P='sums … !at ƒ  ÈqV sr.add_a[ U 'Æ °', metavar= à', nargs='+', _U=int,� „help='an�  Ù  be?medy ð--log', default=ocstdoutp �FileType(,ƒ  ª Pa where  should be „3ten”  Ô # =. ðs()
    args.logñ.write('%s' % sum(args.integers))
     ñ0log.close()

The module contains the following public classes:
I ñ- ArgumentParser -- K ñain entry point for command-line parsing. Ai N  › ñexample above shows,Š Sadd_am õ() method is used to populateK  À  g ñ er with actionsŒ  op ´al and posi b  s.È nL  „ s€ Rinvokƒ rconvert° Qrgs a F 	ãinto an object£ ±ttributes.
6 aEErro`AexceÂ @ rai ,byŠW Ys wheÇ €re are eO sv )$'s&!. q sa Fwhil[ W  : 	Õ  [ ~caught “  lqemittedÝ  ð*asgmessag €FileType[‘A factoryÄQdefin† Ðypes of files¯be createdarinstancF r  Í °typically pùEd as¼  þ Ptype=Q … © = Î„ Ì  'BbaseRÑ  V&er‚T| »&ar„€selectedi œ  
ùstrings like 'store_true' or 'append_const' toÉ c Ë 	¡. However,® garE �customizaK 	a cs, subF& 5mayJ 1be Ü"edŸyX0 ¨ )°HelpFormatt£ ‘RawDescri( JText € ¹ ‰Defaults'  ¼g ½ef5ichA Pmay bäsœaâ 4œ _þ Â  ±&thÙ S¯ ruø*. ‹ iZ d¨ ,€ ü R=Rawÿ Q tellb‡M 0not¢ achange! ff q Ø help text,] 8 Ç Fradds inK 0ionñ&utIÔ mo|  m Å.

All other‚tin thisÆ ¼ :€idered iU ¨žðdetails.
(Also notÚ +at` ±L
‡re only
j ($asÙPnames6 /0APIõ  û 3ter)  s is
stillƒs¹ /an¼ ð.)
"""

__version__ = 'ú1.1'
__all__ = [
    'ArgumentParser', MErro IType ðBooleanOptionalAc K @File2  ¾HelpFormattp �Defaults% ‘RawDescrih # OText pMetavarŒ   ”Namespaceª 
È ´ONE_OR_MORE! „OPTIONAL dPARSER vREMAIND „SUPPRESS! GZEROS ô]


import os as _os !re $re "sy# ósys

from gettext C   H 3, n $

… d = '== T=='

Ï   8?'
Ÿ   7*'
  2+'
ó   eA...'
õ    ð_UNRECOGNIZED_ARGS_ATTR  ÿ	_unrecognized_args'

# = 	á
# Utility funjßs and classes@ 
) ñ _AttributeHolder(object):ò"""Abstract base^ ñ
 that provides __repr__.
4 5The ñ method returns a string in the f:m  ˆC¾  ‚Ç(attr=name,  E...)f   » òs are determined either by a³ a-levelJ 2 àp_kwarg_g Qs', o3 pinspect§  ¤ pinstancÕ @dictè  ª 2"""ð 5defð S(self< % Atype^ 0 =    !._ !__Ê  (  … s“] AstarU = {} afor arG r Q._get' (} Y €.append(­R(arg)I &  O  p, valuežW #sY 0if 2 Ü.isidentifier$  [ Ú � °'%s=%r' % (C u �  8 Felse    [: 2] =± 5if # 
> ˆ @**%s‡ 8 ‰ ·€ '%s(%s)+ (Æ¾°, ', '.joinN_¿')) –? PœZ Alist3.__]mitems(G  * E [2†Rcopy_A  , 1if  w is NonX‡ [q # ¼ E p module1 �used only 'H'n q_const'ˆ2# a�,"  itF DneedH 2wheþdæÄ� isn't a .J ”Delay itsÏ ªPspeedž!upE²common case8 "ifmõ ð) is list:
      ñ  return items[:]
    import copy $   . (. z)


# = ÿ
# Formatting Help$  a
class - ±er(object):r 5""" ± for generaU �usage mes ñs and argument help strings.
K òOnly the name of this ‚  	 ñonsidered a public API. All7 qmethodsL ¢provided bS F Ware cG nA le‘ Ñation detail.C 2"""˜ ñdef __init__(self,   € Oprog  ±indent_incrf /=2%  @max_P_posi‡ ?=24'  Âwidth=None):™  ~ Â# default seË …, ¦ 1if  @ is @ º >   Deshutil4   5 "=  ò.get_terminal_size().columnt 3   7 F-= 2§  7 ._&0 =  i  )< =  2 6} = min( K  ¦  Cmax(» M 20,€ k * 2))† 1 =`ï Bcurrÿ K = 0> _level   ac_Ë alength$ = qroot_se+ 2 = HS §í² • : O É ñwhitespace_matcher = _re.compile(r'\s+', \ASCIIv ¯long_breakB ‚n\n\n+')~ ±
¿!==## ò ^3ËL èC @â )];$ $ +u æš 7 æB+= 1Ú h  deh -h PasserKlf._¦ �>= 0, 'IŠ€ decreas�elow 0.'® -® :_gý7 Ï 	  Y`er, pa”, headingÀ  ]fŒZ d  + ' O  DX ! h $ =r # R = []� ]  Å w ‹˜ # #× ló3ed G	f "ifŽ­ ais not�
z V Ö z Rter._Y (@À         joi÷n = self.formatter._join_parts
  Àitem_help = # ð([func(*args) for   ,  2 inW  5 :s])I f ùparent is not None:(  | œ ™dedent()
* €# returnI ùhing if the section was empty6  if0  £ Ø ~ V ,''o 1adda Oheadp Onon-t Ó 9 ý ÂSUPPRESS and! 0curC0_inË 
! 	þ  ^e ú= '%*s%s:\n' % (7 Y, '',– 
Ð?elsº \ ? ?@¡ñ-initial newline, B   Î |	Ã Ÿ N ƒ(['\n', 4 ,Ö ,  ]2�def _add_ö(‹,·)  $._	¨ .6 ¦s.append((ð)_ ?# = ¹ á# Message buil:bmethodj>  ¼ cstart_� À ô ½ (­7 ("_SG ò RF 8lf.DdAI7, [óX „ 9 [ Ü 9endÚ Ñ ŽD  Œ  .Yr æ� 
: p  Ctext   s  C%exŸ	¢ + ¸p  ^  /^ "._`_: 0, [ “ - u. !,  1, a"ðs, groups, prefix=
« 1 “ ¬ Î ˜=[ 5 2 É 	q íüSPargum¥ ? Ä 
® Ø .Ñ´ 	ƒ ð# find all invocaÐ. ¢   Fget_ qk ! 	_ 8 Zs = [K (< ))]3  é2sub è Prˆ5ed_! sE 
Œ ¸ | R€ F _ 7   �# update'qmaximumòy length± h _ À = max(map(l÷en, invocations))
   ac —_length =*  ù+ self._current_indentE ! K 4max; o= max( ,C “   [ ¦ ))
: ñ# add the item to ?lis¤ 0dd_' • rformat__ 2, [	 ]b 0def\ ¡_arguments6 ", & 5s):ˆ 3for 3 in
 s  Ò 5addN (G l ?# = d r# Help-¯ Ãting methods ; =  Æ 9 Q_helpÄ »   # =äqroot_se.5 50if 3 
Ý   E ñlong_break_matcher.sub('\n\n',> O  >   `.strip, ‘') + '\n'Å  ' areturn@  Ú •_join_parž  _G (ng£> 0''.2  ([' [  _   Ð !  Î  P 1 0if ( B and	 ø is not SUPPRESSS_YQusage�!,  Z÷, groups, prefix¯ i  Š is None‰0 a = _('T 3: 'b à B# ifl  ? �specified€ Ve tha3(  É k _ # =O Á% dict(prog=ë_ { Pno opq´als or posi Ðare available’ 0age¦ Pjust M }(elž  š x § T{ª !'%  O)s' ¯ ¬ Ø­ ’calculateª ¯_og = ™ ÇWsplitLHfromN‚  / Ç I= [] �  Q 
 [ _ #ifò.i -
ë  *   $ ¥als.append   ;elsÝ µ E 	Ý Â# build full™ 	& Ž¾ !s_<	0  2 = 0 (× ( +ˆÊ
ñU  ø ŽsH   sh[ìg ]·sDa# wrapîQ  ‚s+ Ðit's too long'
  ótext_width = self. - écurrent_indent< ñif len(prefix) + –usage) > Z ):
7  ~ �# break . ý into wrappable parts3   ½_regexp = (   W ÿr'\(.*?\)+(?=\s|$)|') [) ]) .S+D )V Bopt_Î þ= format(optionals, groups6 <pos6 Oposi8  n  ðs = _re.findall( % , % “ x  , @ 
� @ ð assert ' '.joinë _P F) ==y &8  c 8   ± 1`helper\+Žing line*�def get_ 2s, À", ®}=None):   E7 _ = []  #ifb € is not i h l a_len ==� _) - 1| OelseM ò M 1fork1 in sZ  ê1ineª 3+ 1ë ¹
êA and•K ö ’s.append(§ & +M �)t :   # …& ´ ^j  7  Y š à ˆ* ] +^ . / +ºB y #s @s[0]s ?@[0][Ç:öareturnÜsž…  ogöðshort, follow it with wä` *Vù prog) <= 0.75 *] � Í   =U@ * (á ]¨R ?+ 1i if² Ôµ' =n[X 6] +> {p  Á 0extÁ"osˆ J  el…- 
µ À            Álines = get_ ÿ([prog] + pos_parts, indent, prefix)
   _else:  - \ 2 = ^ 
( P# if z ð is long, put it on its own E : x ¶ ß = ' ' * len(Á 	ì b = optø w Õ =D 0(!ifŠ  Ì os) > 15] ƒ †.extend(ˆ Ä Œ � C ÿ)C É Ú! +¦sâ2joiÄÍs into usageÚ   µ@\n'.3 (b )R #ˆq with '1 %:'I óreturn '%s%s\n\n' % ù,t L ñdef _format_actions_M s(self,  –, groups)©b# find   ices and i(4ify< 2 in& sŸ M p v = set(Z`insert’%{}3 2forF O Œ  Ãbif not$ )._b 
)  - ò	raise ValueError(f'empty? ! {? #}'% 2   >tryK tstart =î .r!x(A ‡ 6[0]å  P gexcept‡ ^ zcontinu#ï0endK� +`… 
‚  † $if¼ [Ì ‚:end] ==Ä ¢  C  �*ž8  < ¥ R.add(J ©  . 	æ�required• / Ô  — W- 1 |
0] +9[X #  Š" v Q ?= 'O 0if Æ3in 7 ­ ± « ]ª 1N ?= 'M ó ?if q/(Ç 1‡ ]EO À       if enÿ d in inserts:
  % Ï[end] += ')'0 OelseN M Pfor i£ ÿrange(start + 1, end)c ­ •i] = '|'
« õ# collect all actions format strings- ¥parts = [] ’ ,9  š £enumerate(M &):n  Põ# suppressed arguments are marked with Nonef 8 ñremove | separatorª P 	; #if¡ þ.help is SUPPRESS3ä €.append(… )K  Š $if#‘.get(i) =VM . Nn.pop(iM ,elO  ÑS / crproduceÕ<rg Ê ™ z 4not opý_+ Í ódefault = self._get_ ð_metavar_for_posiJ #alõ  eH mS_args1 #, X )Ø  ¶  # 00t'sm�a group,à ¸p the outer¢ 5    9 7 _¢ë 0  § 1[0]ßq[' and  "-1 /]';  ?  ) " =0 _1:-1]Ë 1addµ ‰ Æ Qng to Mlist| W sŸ  #$# û �first wayT ainvoke[ ë 	vbracketä ¼ °5  / =7/[0é !ifx Ocô	al doesn't take a value,wi{ #˜ Í-s or --longà .nK µ0Ÿ 7À kusage(N u q M½  µ s¶ FARGS»   À u ‚ 1y¡w M  ÄÊ  ‚ 5  B²'%s %s' % (| Y ,Øs Smø‚it look < %alÚ •€required73in ê60if . A.5  «  "in)òÀ         parût = '[%s]' % part

  ñ# add the action string to Mlist4  J �s.append( )X ð# insert things a
 õe necessary indicesU òfor i in sorted(? õs, reverse=True):0  À  t £s[i:i] = [2 H[i]]ˆ �join allÈ Ý èitems with spa‡ 1tex.0 '.9  ([+  � 0tem  u A if  Éis not None]ÿ ñclean up separatorsG ö	mutually exclusive group
õ open = r'[\[(]'ò Sclose ']) ´ ð _re.sub(r'(%s) ì K �, r'\1', ' )N   6 = 5  6  5 h 6 `%s *%s7 (m > )? s À\(([^|]*)\)'2 §  ® .“)p(fareturnÛ # Þ  #exìÀdef _format_* S(selfUÀif '%(prog)'ì *   s  ! =Lq % dict/ =O !._: …  , Á_width = maxt . "- 3 öcurrent_indent, 11¤  ½O ' *1 m ò U Bfillç  „ ç x ,yÒent) + '\n\n', %® ,y±# determinex’required ê "anGµentry label¤ ‘help_posibQ= minf "._s õ_max_length + 2,9  z ê  2 	W > •  � 
xŽ < 	*  ¹E - 2¯ @ ƒheader =¹~ `invoca	( 	Ø0no v €; start �Pame lu b ­°a final new ~ !if“V .G Ã%up” ~$''ò_¾ V  S   —p%*s%s\nÿ2tupJ ) s# short=W nameË  fsÏ |pad two�ƒelif len"y C) <=Z Ôß "Ýí A-*s Z ï  ê  «P_firs@0Clong± ns	ÂOelseÕ "´À        acti÷on_header = '%*s%s\n' % tup
  õindent_first = help_position
* ñ# collect the pieces of  ac, : 0 ’parts = [ ‹ ]Q i> are was= G forQ ’, add linj  ™ U textd 2if ^ . 8and •.strip():0  õ  * _F ð = self._expand_ (O )2 !if� 5 
L P ¤ Q asplit_ (V : ,E Zwidth`  F .ˆ.append(­(žC, ''H ^ N[0])L  E  2 int   ^s[1:]¾ | ½ }  L ())Æ!or§Pa new  ×� descripõdoesn't end with onedƒelif not¼*P.ends, [('\n'Å
/   ’ � @re a rny sub-ÚsTQtheir… as wellŽ  >2sub/  C%Riter_Œ5ed_! s2
[	  A rformat_X (A 
Lðreturn a single Â%ngœ  Q Qjoin_i ( •Ydef _m p_invoca‰(; ,iT	�!.oµ_} sÚ `defaul( K c._get_ €_metavar~ A$al"Æ  t+ $, 4  < cmatter7 #, ^ :)(1ë9  Jelse´  ‹~ … #«Oñ 4al ¨Ðtake a value,–[mat i#D ‡-s, --lo¦  šªnargs == 0•  & ™ @.extö}Õ -   ²  ª s« T ARGS°  	•: t €ªò6ð I  	UM ©$rgJñ	œ  A  ›f G #inÌ7k @ oe@s %s(T ', ¨ ž B tP', '.€z�È (sÝ ,
„D 1 is;NonÑ2res„
1 ð 
        elif a÷ction.choices is not None:
  ! Ò_strs = [str( b) for  Y in aQ ]E óresult = '{%s}' % ','.joinM ` )4 ;els‡ B õdefault_metavar
4 0def’ ú mat(tuple_size)Í âif isinstance(T !, / *  rreturn ' h       0 X 2) *\ ‹ A ' bformatÀ  ¼ _ ³_args(self,S+, ô « %ge
0 = 6 .P Bter(›H “ #ifl  .n  
 Å %sÃ| ((1¼N º== OPTIONAL�R O[%s]T ÊZERO_OR_MOREX ? = ¤  ®sif len(, j) == 2G  & 	£ ‘ [%s ...]¬ : E / ÿA  ì @ /el9/NEä ™ %%s˜  W ó 2—šREMAINDERù \ E...'á ¡ OPARS@ 0— .�SUPPRESS– “ ):try7  —[Á'½ º_µSrange ü)ºþexcept TypeError\ ¢raise Valu" ¢("invalid Lv q") from`P š k ¬ 9) %¾Ä¤ C LF L¹expand_helpL;Pparam“dict(vars‚), prog=N  F 9@name<Rlist(F W  Õ 2if  [, ]OÓ - 9del. Ü l shasattrŒ t P, '__~ ;__'ž  u 	Ÿ =€ .8 ‰ Ï b.get('ó0s')Ø 5	sÖ 0,Ü?: Dˆ T &]]l¨   # =s] £ ³  ú  4ing×ð  % params

    òdef _iter_indented_subactions(self,  C):
  6try   7get7 # =3 *._ A úexcept AttributeErrorS Fpass0 :lse  š .´ %())  � ºyield from  ( C  de÷ 1()
D ¤split_line¸text, widthbext = H ðwhitespace_matcher.sub(' ', ? w).strip„ Q# The ðwrap module is used only for Ñmatting help.¨  è ð# Delay its import, ` speed. öup the common usage of argparseI =  ¦  Š a ereturn¢ . (& 4Pfill_ 4  ' ", [:7±  • ± ,Û  @ sinitialV=¶ 4 ªsubsequent7 P † »_#ng"Vo .1 ` D ðdefault_metavar_for_opª/alU ©dest.upperñ] Oposi_ ñ


class RawDescri¢ pHelpForÊ9er( 0""" A mes«f. ñ which retains an J  æFin dg "s.4O> þ1namöRthis ™  	 ñonsidered a public API. All5bmethod�±provided by F  ar[G n„plementa4  d° lf2"""˜ ` —,‚''.join(–0 +  ñ	 i¨.¼  øs(keepends=True))™@Textm’® ¸ œ n!ll·F�‘Aý— èug@ArguD¶sp	 bSadds   values toÑi hcÀs consideredñ a public API. All the methods
    provided by ñclass are considered an implementation detail.C A"""
	 ðdef _get_help_string(self, ac7 !):(  x  # # = .  øif '%(default)' not in+ G  K $if 4 1 is5 ŠSUPPRESS/  3 ) õing_nargs = [OPTIONAL, ZERO_OR_MORE]—  8   o  opÕ é Ds orˆ T i'Å h Š  R  þ d += ' ö &: 5s)'„ preturn 1 2


¬ù
MetavarTypeHelpFormatter( {0""" ¤ message f. ± which uses@arguï’ 'type' a 9‘ my û value (instead ofA bdest')#2OnlhBname+ 2is É  	 t»cá _Ý R_for_è/alÌ–ä.00.__á "__ö ^ @posiH` $_

# = A
# O¡ss and AÑs0 
§ Ê Ã (	A þJ  gFNoneÕ	  "'el/ .G/6 • '/'.joins 2 )T  §ï@in ({ $, ù´  d› Î .9 S   ¯P  6 M  }choicesí Œ'{' + ',ò 0 ) }ø?elscÛ¡Error(Exceøþ p"""An e à from creating± us	 4an " (§ al œ").ËBThe ÚøïDis ew  fcP, augJqed with%"iny KZabout3ïthat caused itft_init__’’,Øû  ù €.Þ Ó" =¦æŸ 8 '=Y ) É‚ o ?if r  0is š b   =îi ")sô  
ø  1 Ð % %-Û ð )s: %(message)s3'
  óreturn format % dict(message=self. ,3 : 
 Ãargument_nam9 	 ³)


class A* ñTypeError(Exception):e p"""An e ó from trying to convert a command line str! ¡a type."""K ©pass


# = P
# Acr  ” .es" ® ' ö(_AttributeHolderª "In<Øion about how« ©  s  ñPython objects.
° –  õ  are used by an;`ParserE ö represent the iŒ N `needed( p2 ¤ a single ›_¤one or morJs 1theH Ã Õ. The keywordI Ò  ƒ Á ±constructorÅ AalsoK Tall aLDs of‰„instance
Kb /"s:" w1- o0_ø°s -- A listQ ® -) !qs which‰  H   ñshould be associated with this a ž 0 `- destr   î t  û ×  qAhold”1creS Ó8(s)Ç Anarg¾ L PumberN 	Â ¬us that ° 	Æ  pðumed. By default, Ù? P willç +  >	M Uvalue0 `produc[ q Other  ’s include³  ð- N (an integer)µwsumes N0( \ 1s a¾)‡  P V- '?'A @zero«Ù s5 *5  às£ /d � +L  y +K BNoteÀ *ñdifference between+¸™B=1 i÷	ä žeéÇœ»,ølÓtýf ,€ i@tainLS 	 S $be_Ad ifâ ŽÁis specifiedî i ó  ( @usesø…@rakes noë . 5  šù�Š 6notŽ 	×  J L “A callablÃ ac° µO‡Ý,Ô 	²f Ëed Ã"edÂ !. Q ýSdard  | s·,H
}Qfloate  Aplexdáuseful example\Dsuch½ Àes.  If None7,
  Õstr is used.
 õ8- choices -- A container of values that should be allowed. If not None,P  q ðafter a command-line argument has beenl ù
verted to the appropriateP ðtype, an exception will� Àraised if itÞ ¢not a membÃ IthisL `collecD 	€required@TrueR “ + ° must alway¼ Ð specified atº b ö  ö `. This™ ñonly meaningful for oÌ )al)	L 5s­ Ahelp© 1he  àstring describ ¼ r	< tmetavar? @name!be—  < › &'s·Mwithì ~ N & r 'dest'C® |  aR e z .í 2"""�údef __init__(selfÁ [4_ò s!   x   anargs=  u M  _const odefaul  �; [ u[=FalsD›  _= É %):Ô  7.¾%+ =6
-  1  ==t 31 =  
 1  =Ãs6 /R 9
:  /0 =  
 , U ‘
 ,4 =  
!  ,! =
 )3 = 
 m`get_kwpH ŸUs = [M  ’'Z'iô >) @ :  + -   õ  ]Ó �return [(î ‘, getattr,¡!))  1 in &s]@Áformat_usage6 A\ � '[0C d__callðr parser} bspace,C*s,Ä÷� NotImplehÅedError(_('.e )²ódefined'))

class BooleanO‘Aö( Ô �IúÕ 
? u- 
 À            ü   required=False,
  �help=Non qmetavar 5):
= õ_option_strings = [] Ifor   : in %s:-  Ž N ‰.append(D )}  3 *ifR ú.startswith('--')b  3 	O Ê = '--no-' +J 6[2:Ë  8   ¢ 0if V€ is not ]È and default 
¨ 6 c+= " (, 4: % F)s)"ùsuper().__init__(S	í +s=À 
Pdest= 
 znargs=0 – = 
 Ptype= 
 ƒchoices= 
 Ÿ	 
  = 
 ˜ údef __call__(self, parser, namespace, values,öâ í  ` Ã R .Y
¾‡setattr(m 4 \
	> ´ �)Ê Áformat_usageÎ Ôñreturn ' | '.join! � ð)


class _StoreAc´( Î4C ® 
i 
*s!  á 	€8 B þ4  Qconstw  _  d f g1å a   if ë Z == 0praise VsrError('*  $s•! a–ð s must be != 0;S ^you 'Uu   P'haveY�hing to S ,T rsuch as M strue or.  @ may• õmore appropriate')™ 2if + íé ¿!= OPTIONAL!%rÑ Rupplyb 5' %L € â , È	’Ü ×ß 
»= 
 Ï 
 Í  
 È 
 Æ	  À   help=help7,
  ƒmetavar= !)
 ô4def __call__(self, parser, namespace, values, option_string=None):
d ‡setattr(8  Q T.destC ð)


class _StoreConstAcV ( ():™ Dinit™ ° m  	� sï ! { 8 cv / QfaultÙ   ïrequired=False!  Ohelp= w )5]uper( , ;C).__	Å 
ø = 
˜  = 
 znargs=0 = 
 "de 
 	 
   q] A.Í uBTruemyQGGI!  OI	á HM`=p 
öã  
 à 	 
 Þ   ¸w¹qð nÏ ¸&á ¹Sq 
~²= 
 â 	 
  µ= ºcAppend¶ dQá ¢
£ ©¶ ù `<  Otype choices 5 x  @1if ë ð == 0:
            rÿ4aise ValueError('nargs for append actions must be != 0; if arg '
   ð'strings are not supplying the vx 3 tok /, O  5 — Sconst� @ may› @moreL ´ropriate')
� 2if 2 !is‰ ’None and ð Å!= OPTIONAL:4  < r! %rÀ × b 5' %L € �super(_ATASù, self).__init__(y  opw_A= ,+ Pdest= 
 Ú = 
 	= 
 `defaulL  
 Ptype= 
 ƒchoices= 
 ”required=	 
 Phelp= 
 ƒmetavar= !)
î Ðdef __call__(:ò, parser, namespace,S9s, 0=î)Ù÷items = getattr(@  Y .L 5 {  	4 a_copy_ ( ä . (Üs sl 
; £)


class (Cä-( ():8 ´ 
B ± 
s!  ç á 4        N  ão=False!   éŠ  ë ©	6;S0© 7	 
U   
  £ ˜.6%RCountúXé6ÊÑ ÄbÛ Àlt=default,
  ”required=	 ',
 ` help= !)
 ô4def __call__(self, parser, namespace, values, option_string=None):
_ ÷count = getattr(@  Y q.dest, 5 {  8 2if 7 !is N    5= 00 s\ 
0 ð+ 1)


class _HelpAc· ( ():ú Dinitú f  |  	ð sJ!  Ô Ÿ=SUPPRESS  _fault# 	 �Kgsuper(¼  , CC).__± 	¬ 
§ = 
– ±    ¨ !de 
 znargs=0 ·   I?�p.print_c %()ï  Wexit(ærVersionâéAva ©
	:ó"show program's w À number and û &")),	/Š1!  Ò.á =ë �—2b  Cq Q$ifz  „? { A ³formatter =;e._get_ ¾ £.add_text(O â_ÿ†message(: 
 Ý, _sys.stdoutD  +&ASubPÝs)2ßChoicesPseudo)  Â9Ž Z1p, alias- º¨ 5 `metava* ƒ! =dJ " $ifA â    > ó+= ' (%s)' % ', '.join(y  4 csup = $ /._ì  <	– 6sup{
_P=[], Î = ,a&  ‘   É = 	BR	„  9 �Àings,
        fprog,
 
 Ïparser_class  ßdest=SUPPRESS   ïrequired=False!  �help=Non qmetavar 5):
� `self._±  _prefix =  ! »  "  * Sname_ê ‹map = {}# ÷choices_actions = []’ ¡uper(_SubPf !sA'  , « µ).__init__(U  ^ opK š_strings= 
+g  
 Ênargs=PARSER ¯ =€ +._à 
+ £	 
 ¡  
 œ )sdef addL(~  , ~ `, **kw¯ %):Q# setºò from the existing Ú, 2if @ `.get('ï`') is <S  X( [$ á] = '%s %s' % ’ 	;Ÿ ¿  > `aliaseáH c.pop(' W', ()- ò# create a pseudo- � to holdÓ Œ DÏ ' C' inÙ 
Å   # = „   %')C  ­ [ •! =o2._C¬P’ Š(…Ç ,� 
K  ¬"._Q ç‚.append( h   »A@ and0 it  5map¶ % «  _(#. •  ¼ SP_map[  Ø= z r# make  ó available under ü U alsoa #fo  ˆ" 
‰ƒ + „ creturn„ ›  ‚_get_subsˆ
6 l m„E q_call__> ,d Áù space, values, L@ #   # =3 5[0]4arg•  '1:ï¹ ÛL ã@ if CUestedM "if• ½ ¯Dnot 0iQtattrªÏ  : í µ 	€aselecthŒ z :trya   & FV b ú except KeyErrorQ  Ï ,'; #':˜I 
4 }  'âÁ': ', '.joinÔª)‡ 9 ô msg = _('unknowg7 %(‚ 3)r °Ds: % ð)s)') % args
         ó   raise ArgumentError(self, msg)

  ñ# parse all the remaining options into —namespace= õstore any unrecognized< !on: �object, sI !at 7topH Rlevel‹ ð r can decide wh/ �o do with: m½ ñIn case this subÍ Ðr defines new ’aults, web F q # in a+ â  ² @ and- pn updatg §e original¾ 8 0for1 � relevantq 5ts., 5sub- ð , arg_strings =+ Aser.Ã Ç_known_args(& u, None)O  o  key, valueÉ Xvars(f ¥).items():6  ú ‡setattr(Ž I  (if¦ 
D l A €).setdefmö(_UNRECOGNIZED_ARGS_ATTR, []¾  ˆ gˆ < ˆ).extend±)

class _E  Ac´‚(_Append ù Ãdef __call__
j5r, Ã H#s,Á�=uü Q? = ¼   c\.destª4 a_copy_ (  å Ñs ° l ; i)

# = �
# Type %.es  ?@File) (ø3°"""Factory iPcreatDfile"Rtypes’ÔInstances of R � are typiz°y passed as  e=\¡"s e¤¶PšPr add	( ¢() method.t uKeywordés¦Â- mode -- A eb indicÄ 1how©Ì i ðbe opened. Accepts" ’  ª  BsamelsÄ ¡he builtin; a() fun„ó�- bufsiz‹ @The s  's desired @fer " 	y  m 	ˆ  ªy Pencod²7-- z  o 	û o  fsr	z Y#dež e8 *oè ‹be handl”‡2"""/Einit %P='r',‰ …T=-1, © û", ¢  Pelf._A ! =m¼ ›_ø=[   e % =p " =� Å  PÅ ð string):
      ó%  # the special argument "-" means sys.std{in,out}
  õif string == '-':  ! úif 'r' in self._mode"  & ƒreturn _d )inD  elF wF ;outG s{  ™msg = _('ó Pwith ¬ w %r') %¾ 	T ½ õaise ValueError(msg)
' µ# all otherWõ	s are used as file names5 :try&"Ropen(o,”  tbufsize •encoding,X  °  •e· %s)& ‘except OSÐ  £ 9�args = {'»  º #':1, 'N F': e$ s qmessagemp"can't Î D '%(F q)s': %(A 6)s"‘  @ rgA™4TypnX %^syÐdef __repr__(å )O½   �/>#kw+ 4[('K'-  B), (ó s P]J  H ð_str = ', '.join([Ÿ �(arg) fo ' + 0 ifÍ • != -1] +H   ð ['%s=%r' % (kw,: R   V Ë H v Æis not None]ƒ�q'%s(%s)m Btype]0.__!__~ së o)

# = �
# Optionnsnd Posi Parsing@ €
class N8ópace(_AttributeHolderóñ"""Simple objectm1sto³a3 "s.²I*  úås equality by ( ¨` and vò!s, Áprovides a sm k© è`esentaá . 2"""q ªCinitªB, **¯Á  ñ ! bÌÐ   0set£ Ž,¤ ", E [7 ]%eqk —h !ifü±isinstance(" ,g-  y 5Not:!edâ  Avars› )$ W 	– …containsœ 7keym i 0key½“_dict__

0_Acb"sCK 2er(ó/):lª  ®  adescriš7 Ïprefix_chars  D�_default#  Pconfl· Uhandl¦ | msuper(Å rC).__&73  U³ 7 =  Þ /� À = argument_“default
  øself.prefix_chars =  
) üconflict_handler =  
2 õ# set up registries w _ X = {};  ›er action:  "(' ñ', None, _StoreA4 )n 4   's. '7 #e_const= C y U_trueA ?Tru¹ V_falsA F ‚ `append~ A
 9 þ ? ÿ Acoun;C	 { @help² OHelp5 pversion8 V ; pparsers; BSubP > 3extbE
 9 —ð# raise an excepéu if theW j¥is invalid@ E%ge�(()C ä;age6   î+[] o‰ _²6ng_) 
¡[group—- _ = = \ ùmutually_exclusive- Š ## ©sÀ  9ðdetermines whethC2n "Õ õ" looks like a negative number~ Y _ P_matcO ð= _re.compile(r'^-\d+$| 0*\. 'ˆ‡ `or notÞ@re a 2ny ˜ �als thatŸ ž ~ • #¦ üs -- uses a list so it can be shared and edite.Dhas_[ Ù „ ²r ?# =   RÑa±bmethod
6 3def	0er(a, ñ	ry_name, value, object):l  ¦¹Pry = 8 .7C.set
(' N &{}  [c 3] =e . š T _y_getŸ 
o =p	¥ Mturn¡ [{ –  ].^ … ,á+:
ƒ´# NamespaceC ¯ accessor ŒÀ============= ñ
    def set_defaults(self, **kwargs):&  *   .( ƒ.update(' 
'  # if these\ T ÷ match any existing arguments, replaceB Äthe previousF 0 onW Á object with fnew on> âfor action in µ  sÌ  Ð #if( P.dest- Ì 
&  * ? .#2 = ) [ 2st] NgNM ` I¢ %0== J F andº ¶Î is not None¿ kreturn3 n )ã `s.get(m ,T ")
ß )# A N X# AddÜs s / 	
   9Dadd_:*„Ž1"""9  9 ¶ ÿ..., name=value, ...)1  op-›_string,  I  † V úpno posiS  alæðs are supplied or only³ ¶ 8andI ót doesn't look like an�  ¬ wparse ar D K rchars =qprefix_ " !ifG u © @len( b) == 1x‘rgs[0][0]* 1in B 
u Z1rgs1 '�'^	praise V§aError(3 2`twice 5
Y?'Õ 
™ä _‹5 _ (UÜ ? ó# otherwise, we're aÓ|Õ| 7;elswj 	ˆ X/al† ˆù5wasQ, useøütr-level+ ’ Cif 'Ì'©” 
ª �Ðy%']F  "ifuLW M + a [y ] 4 [p 
` 0eli�4lf.°c Õm G ÞRcreat?¼N,«—add it to`0 U_clasDX_pop_    É¸t callable(-  + dunknow¹™ "%s"' % E &,)] # =w¬ Ð(**kwargs)

   ò%# raise an error if the action type is not callable
:   ð_func = self._registry_get('= #',K . 	 )I )ifa (+ Y %):$  u « `ValueE­ L('%rž F' % A E,))
C  Û 1ypeZ  7 �FileTypee $a 0 õ class object, instance of it'o  ²  ÿ' must be passed¯ ›²metavar doe™Qmatch¶ 9€ °if hasattr(ž0, "—»_formatter"^:try
 ½  : .8 3().E b_args(+f, NoneÔ = pexcept d°_ Òp"lengthLè \tupleî n{ "ÝcreturnˆBadd_— ž ) Adef  Órgument_group*S `, **kw
 & S = _A8 G7 €;‡ i ‘s.append(Q ,¼  ¯© òmutually_exclusiveJ ³ ¬ M; E: 	µ 9 ® p º _dB© S€# resolvz»y conflicts� dcheck_ 
Ì a#Î3 todks listD { Á  | £.containerÌ‡d Qindex`- ¡ by any op$ strings itp~ 3for" _" 3 in¨ .:  s7	" Ì)s[ 3] =P ­ 1set« @flagÍ©  ö
look like negative number½ %#if‚Z _Z _¤1er. (È  p  Lhas_O A +al< <   9 ‹CTrue :  ˜I tcreatedf     ¯| °s_remove­ù› < "s.3 
ÙL  B”S sT  :¡# collect Fs¤VtitleÔàtitle_group_maƒp = {}
  ñfor group in self._action_ %s:*  1 "if- `.title3 	 , J_map/  3 òmsg = _('cannot merge d rs - twoT ùs are named %r')y  J ðraise ValueError([ 1% (© ’ )6 � [* 2] =w 
h £# map eachŸ s to its(  ƒ   E  ì I�containerNn  K b# if a` ¡ with the ¶ û exists, use that, otherwiseD Ãcreate a newL �matchingP � 'Ë  „ Ó £"in„ ×	¥ ! [JÂadd_argument+ (»     L =XÇ,' pdescrip�-  3 óconflict_handler8  ) � 	 ‹§ toJ&irc	¢  E+  É ñ MG e &  G[:  ‘	9 9mapU£ h# add Öòmutually exclusives¦ q# NOTE:p4dd_1 _1 v ² ever gainsW= andF r=ðn this code will need8öbe expanded as abov¸ 0  /É .— ?Smutex± =µ kÕ uƒrequired † h! Ù Ý Ó Þ ç .­ ` 9 ü3all£slƒs0 oršiØœ 
˜ v­ d¸  ŸR.get(# ,l0)._n  :Ðdef _get_posi¨ al_kwargs(¢, dest, ** ). s„ke sure �@ is �†specifieˆDif '& 'fP O  ˆ  y"+ Ôs an invalid œ ³ *s"Fx6Typwð  g  º 6rk ? W sù§ zØt least one i�ealwaysú ´2if Û † 'nK!')úin [OPTIONAL, ZERO_OR_MORE]ð kwargs['requireÃd'] = True
  ðif kwargs.get('n ó') == ZERO_OR_MORE and 'default' not in9 :L  S M —['requirer ' õ&# return the keyword arguments with no option strings> < Rdict(m p, dest= ,6 _6 Q=[])
; ’def _get_W 2al_= €(self, *ø B, ** )Õ ñ# determine shortClongl ¢ b ƒ Q = []ƒ   8 ƒ ! 3forX    i � ’  H P# err+ !ò that don't startIõan appropriate prefix�  K !ifÐ	¶ 0[0]x  .3 j_chars…  >  › R = {'@ *':¾ ,k  1  'X =': l }; ómsg = _('invalidk �2 %(„ ])r: '= x :mus" Û ˆacter %(– M)r')H Àraise ValueEƒ(– %Àskj #™ s�2ing“3twoˆz `s are Õ ñ O Ù ƒs.appendï  
ª kif len" A > 1¾	O /[1ì Ÿ ½‹ 6q# infer¢0inaÒñ, '--foo-bar' -> 'foo_ f"-x xÄ Û# =p`.pop(' v', Noneú !ifi 1 is 
® ;ongÁ 
$  l Z 
% ! =š
 6s[0× 8 OelseN 	€I  � ! =Ê 
s  .l×p³	— ‰ Ñ G �  ®D  =*ª {�s like % 	Ó 
�  j Ð ÷.replace('-', '_'3	~updatedZ	Ÿ ©`pop_ac™a_class^,l [ô=iO2 ” '5 ­ ä�_registry�%('5 	 ",  £  ·qhandlerž ž1funÈ ð from conflict handler strSing
  òhandler_func_name = '_ õ_conflict_%s' % self. $ rJ Etry:  ^ ð return getattr(> #, 6 p )4 úexcept AttributeErrorS õmsg = _('invalid Ž öresolution value: %r'\ � `aise V [ (N Ö !)
— ¥def _checkÈ  acl "):(  _ Ð# find all op es that£ £ with this  b  : Å _5 …als = [] 3for0 ²_string in ~ .3  s+.if7  ƒ.i 6 _K = – " =ÿ> [Š ½  H   â ™.append((7 ,+b 3al)… A !# ábve any( Eicts&"if = Ñ �  Ê€Ï 3getî*r(/3 (*¦ s¦ +^ , _eÃ	2? dicting})»`messag†¤ngettext('Š  ý2 e: %s', ) < s= Glen(| ® ( M <š, '.join(¥ 	´ í,ë? "in
^]° r‚Argument×z%D Ö á	–ãÄ  Í moÌ%llm ÝÖ |iHŽ Th ?theh  �  , R0.re¨ 
§N 8 SJ.pop; c, NoneP >   P# if ¢ Û£now has noÁí", Ž € it from4 	Ã #ä °tainer holdR)it# cif notTí „ –   2conV "._‚ 	´)


class _Y�Group(_A$$sC@ .+s_init__:d €, title=)�, descriN ‡**kwargs3Q# add@missö “keyword aéð s by checking tãhe container
  ûupdate = kwargs.setdefault# ö('conflict_handler',P . )? Éprefix_chars;  7 “argument_— 	;  ? Ñsuper_init =  3(_AK áGroup, self)._% %__° -  ×(description= B, **/%)
7 0# gW µ attributes  i P.titlh 
 _: 0_aci hs = []X §share most]  with tÔp  _registrieR ù. † € .  + o__ 'ng¹ 9 # G Ó¡  - òhas_negative_number_e  alB \0  ÛŠ 9 
5 5ð mutually_exclusk � a S ' ¸ƒdef _add(\ ", K%):s   H 1 åJelf.>Œ.append(+ creturn„ ¦ oremove© @
B x  û £ 2 £ £

class _M}E|©x '):¾ §#__a¡÷, required=FalsetË k (R t_ % =j Öò : & =&º Ö 1  #if®.n : â”msg = _('� ´ ¤s must be *'Ê  E öraise ValueError(msg" Í ¡iÔ .Ý% 5  Ï ò•B” WË— 2 ‰(”Parser(_AÓ¢Holder, _A«COaò"""Object for parsing command line 3ñ s into Python o4 "s.„Keyword † s÷ñ- prog -- The name of  Sram (=4 À      ``os.póath.basename(sys.argv[0])``)
  Ã- usage -- A 1mes ø(default: auto-generated from argumentsL ²descriptionR  ÷	of what the program doesŒ `epilog; áText following4 r  U = 0par�  > ÖParsers whose« ÷ should be copied into this one‰ ð formatter_classT THelpF   �for print¤ Shelp =	˜ ¡refix_charI pCharact  tp  ! o7&al¯ � ‚romfile_- M  , Ås containingK  ÷@addi£l h_  ý DThe  `value û /al® ðconflict_handlerB 0Str%bindica0bow to $  ¬ 4 :Aadd_V ž‘dd a -h/- .× 0- a+p_abbrevp A S longZsm 2be # iÊ×unambiguouslyM Áexit_on_erro¾ �DetermineTãether or not As : es withO  sI Òinfo when an  Roccurô A"""
5 ñdef __init__(self,  H   A_=None  Ò =# † g?=[]{  8=50  ÏO='-'#   n Ï	û� ¼( ¢!='�€ …O=Truny$  P% "):ì ÑPsuperï1 =  (U , $).-  9 (Ö O  s - P 5 ] )ü #W1set Y Þæ !if/@ is ñ:  < * ‰ = _os.pñ_òp  J.5   M  :" =	
 2 = 	 
 ÷  =A/ Î=Yë
; Ž4 =  ! Àf.allow_abbróev = allow_abbrev
  ùself.exit_on_error =  
, Áadd_group = 8   ‚argument ,   À_positionals� @ F(_('  C Ks'))A /op?  2  �subparserr FNoneÀ õ# register typesl õdef identity(string):  *rreturn   å T  ('U 0', u ,P )€ …add helpó Õ if necessaryX õ# (using explicit default to override globalK _$ C Ð_prefix = '-'q  "n  ¹_chars else 5[0]� &ifð ¿ 
(9  ;  
Š T+'h',Ó ž @*2+'[ -',=  ac= 8 ž=SUPPRESS1  H Ò=_('show thistmfage andâ nm  # œeparentSs, ½ /Cfor * #in
 s _¢container_È "s(; § !:tryA   y # =e .äŒ  ( ðexcept AttributeEÇO ;pas8 >lse' Ïi „.update(Œ Ï?# = Qò	# Pretty __repr__ method <  ŒÀ_get_kwargs(� �@nameÚ[i  þ   ['prog;l'usage adescriV ü formatter_class üconflict_handler   í z B@ [(À ‘, getattrÝ  ,  0)) W  1 in "s];0‚1# OÙ Eal/Py Ø K‚R  � Ø U³ "**Ÿš%_- q is not
i Ö.o 0can' åhave multiple G �² 0theAser ¶ "  T ñ2it'‰ qpresent. 8Å C.setà"('=)ô )ú 7  if 'title'¬E X or '^ 
û 9 R = _(9 S.pop(O Ù, 'subcommandÝ w ^ @  ƒÀ))
         ò   self._subparsers = óadd_argument_group(title, description)
  Uelse:   Y P_posi= Eals
2 ñ# prog defaults to the usage mes ‚of this « §, skippingF o˜ 4al ¼ ñ s and with no "Q •:" prefix9 ð if kwargs.get('Œ ›') is NonØ ”formatter*U_get_ ( í 	0  0_acs9 sŽò_mutually_exclusive•sÃ  n † .¿ì (ˆ &, v 2s, b J, ''³ 	[F] = V 
 ø _help().strip()Åacreate»¥"s ß †dadd itÜ� U listÊ : V_clas3pop+ (¨ 3, '0 Ç t =*s2 _¸ ¢ngs=[], **G 0 ._LR ( 	ó areturnó þ dv û Ø * D 6Hdef `  } ,8 )P#if .Ã "  þ = "._" ?als¹  (   °•@ 
Ì  ‚ ¯sƒÎ < [	 �  3forî 2 in�J K0 ]_ “ × K • K3notÄ ²™ ?# = ð `# CommÆElineÙf¢ing method	X  |; è¥,^  s=õ±, namespace À (* vÓG RknownM # B ^ ±:rgv¹ðmsg = _('unrecognized‹ ~Ws: %sÝ üë`error(= ö% ' '.join(argv)p l � ¯  O Ò ü À s#´ sÅèasystem Ð À    ”  ÷ @sys.¶ E[1:]!   # make sur`!atQ Å are mutable< ]  X s³À # default Nóamespace built from parser defaults
  Eif n0 …is None:  %  4= N+ 5()
% õ# add any actione õ that aren't present6 4for0 ’in self._@ s€ #if( ú.dest is not SUPPRESS,  °  Ò µot hasattr(¿ ,G )8 < „ .)o  7   ?setp } �?¤?=² > /  >  È   * ,£f [ ]Ç ¿ ð the arguments and exit if r e,Yerrorˆ - A_on_ 
¥:try  wßSrgs =¨ � À_known_args( ,ì)‰ F ƒexcept A¸ Eœ l ù	err = _sys.exc_info()[1]K  O Ê  E –(str(err)p ?elsb,:Ä z /ifñû_UNRECOGNIZED_ARGS_ATTRö ž.extend(gÆE Ò  ó <delÿ9 µ freturn”ÿ Y]def _Å Y& ˆ_stringsÒ±`# replCarg + Oþ  file reference„ 1 $ Ô_prefix_chars
!4arg� Areadx_M _N ƒ) 	9ð
map all mutually exclusiv.J toA` other'aL# @y cal¥occur with  ×�_conflicte%{}  �Åmutex_group ’“ _“ " f6 ¿  =Ê L .1  s  5 w #i,. ¢  { §enumerate(” H Ä N Ü M ï C.set»U " J, []É	J  Ã ?[:i4 ji + 1:1Afindù!op8�indices,6�determineÙ ñ;…_patternIð# which has an 'O'ð
 if there is an option at ƒindex,
  # <'A'4 ûargument, or a '-" U '--'F b õ_string_indices = {}# 4arg  Àpattern_part& /[]&  �s_iter =  (> %s)- vfor i,  Ø in enumerate4 L 5):
;  þ P# all> @s afl ²-- are non-Ñ s0  if- Å 1 ==:#  W � _é ¶.append('-'Ã  1    Ë 9  È  
i  8 & m <A')ö o�wise, add* Ø 5 to È
þ  )ad note' G 5Wit wag	Nelse¹ ]à_tuple = self.2se_ 'al½-#ifÓC ois Noni   "„V = 'A±    ¡   Š îÓY[i] =} 	ï  8   t Ot ´> ¸a# joinx0pie[@togeÇ ¶Bform X“ i s  '.N b  „)tsx Pconve¦Carg  t ñthe appropriate anIqn takesŽ  acv� Rseen_  ôFset(Ú ½non_default) G 1defd " (R °±$s,¦µ =!)‹u @ Ss.addL –  ËQ_valuÔ¯3get 7 ƒ I J P# err² � ™b ¥0not�¡owed with ¤µ previously J  »  µó às, assuming thæz †Rat us±ZI Ö ù don't really count as "present"4 y Á w .i 
l ·  µ _å | 5  tconflicl _ Us.get‰+[]ê I   4if 2 @ L ˜ Â  D   �msg = _('¸/? %sæ  <   u@_nam _L (¤ 
‘ @  ðraise ArgumentError(act÷ion, msg % action_name)

  £# take the% û if we didn't receive a SUPPRESS valueD ù(e.g. from a default)$ Áif argument_B …s is notY :0  £ ¶ p(self, ¼ lspace,I A, opß gstringá Q# funû ° to convert? _+ “s into anB #al‹ 0def8 Rsume_f üal(start_index):O1getN. Ð identified a iv 5dexd  ë . ƒ_tuple =� ¦  j Wices[x ]> )æ, explicit_argU d ¶ ¥ `y addiM#al…  al° Ó @same> >	ƒ "# @-xyzÚ Q0  s -x -y -z[ noB ês are required*Pmatch³ -0 =  *._ 	| ÿ =Zs = [«while True­ y#• µwe found noö 
™, skip itr  :  Ò\~is NoneÁ ' óextras.append(argÖ
Ï
 8   wreturn øJ + 1¼ ( Å Pthere{%anú lGP, tryG ÎÐ #û #'sâ? s; �only this; %ifr  ¹ …  Ú �count = ’  7 © (ÍW, 'A'Ê æ  î ¢ n Óa single-dashÈ A andÝ g³  M #à  ¯parse moreS  Ns ou	K  ofVc tail  ÕL‚ @char²ãqprefix_ .  r3rg_91= 0ã f V1[1]U1in H ” ² h5Ÿ~+[]N)¢ J  i _*[0„ (  	± ! =© ) +B? 	Knew_Ú q[1:] or’F ‡ ƒ uals_mapc J_!í @   #ifi1 & iGX | ? _ 8Œ [„ D B ö 1 = Àxplicit_arg
  oelse:
  ÿmsg = _('ignored explicit argument %r')D 
sraise A0 àError(action, ` %U o_arg)
M ’# if the :  3 õ ect exactly one’ , we'veG ñsuccessfully matchedY  op“ a; exit OloopE @elifn ¿_count == 1Fÿstop = start_index + 1X  r„args = [h ]. Gõ _tuples.append(] L ", Ø �_string)«_break}e¶ ƒÓa double-dash\ À did not use:¯ #³
;( ” 0�)Œ.ˆŽre is noÖ ‚, try to]#9Ral's ™ PP`s with7 £ following$ s1Ž Ò,½\Ÿ§ðselected_pattern°3argbs [T :½ 0 >( è ¾g »`  +G—,^ ~ ws¦  F ª c4_ B# ad|O| al7 åñ list and return<‰at whichß #! E 	T `Yopped1 cassertL?	! 3for ,SsG3 in =  Rtake_­Ó‘	w ï  ŽŠÞ pof Posi©€als left3ð be parsed; thisšgmodifi÷ æ# by consume_pE (W  ‡elf._get. Ñ 's(¦Q# fun% ‹ Aconv[f into ] :Î?defš A4)a#5‰ as many asl Ðsible
         òmatch_partial = self._ ”arguments  
2  ðselected_pattern = arg_string3  é[start_index:]A  . ’counts = r ˆ Ð(positionals,“ 	i ))
G ð# slice off the appropriate‘  ‘ µ for each P] H qand addF %   0itsM As to Ilist>  ^  ac´ ,) _Ù z in zipÏ ÷ )):C  Y0arg $ ¸ 	A N& +i 
Y I 	) š“ r Rtake_º ( Á sf ñs that we just parsed5`return0	v !#  5 @hich! •#s'³ ß ™s stoppedB h[:] =  @len(@ï +s)u” N˜# consumeŽ Ê  OpÚ`als alìÀately, untilú Ehave¢ P# pas Žalast o? × ( Pextraî[¿˜ E = 0, #ifE ` QJicesBBmax_l ' !ex_-x(  A )c OelseO %-17 Ywhile˜<Î‰ :l ¤p9anyt‘preceding4nexDw  @   ð Iin([-  1 x  »  ¯%3 #ifÄ(>=û ]No f O != ² 
x < Ò@_endðÉ¢_  (5¶ J  # only try½ŸVPal ifÈddidn't÷ #9 #Î0 duð ” =ingC (if­Û >, Ê è 
ôG p  8 vcontinu¢    ó    k 	l #B ]d allrwe coulŠwe're noH# 9’Sof anûr,W �re were D )©	“ iðnot in option_strëing_indices:
  ãstrings = arg_ `[start5 ãex:next_option   ]L ãextras.extend(L )' ] ? = _ 
8 Ñ# consume the4  “  al and anyÁ Ùuments for itA 
u M × 7al( )z v  ` @posi alb qllowing� alast O#%alw Bstop+$ =¿ _E u Äif we didn't9 A alll 1argæ  `, ‚re were ‚‚  ‘
áœ ):]ñ ‘make sureq °required acú sf rpresenty0lso¤ 6verq#0 ò  defaults which> Ænot given as´´ s _s 6= [k Ú ” in self.) 
Ü$if„  p , /en+  / .€ 
O  $    J @.appíC_get b_name(¥ )þOelse\ P# ConHº >ð now instead of dox•it before:    `# pars( 0ð s to avoid call co 2funßK rtwice (ÄÀmay fail) if{ÃB wasÙF, bu“   `# only: !it0 Pdefin``lreadyÕáamespacÝ 3if `.#0is è@None—É  �  isI4anc¢B ,P)< 
€hasattr(à� ,©_.dest< m  is getN 	)$ Ä s: 
,ü  <   6 ±Dvalu	Í ´)<if ù
Ÿ S �error(_('Â$fo!�5areH �: %s') %® ¬', '.join(z ™ /# °€groups h2#ne, ¹t  N*  xÄ ñ_mutually_exclusive_" ;1if  / ] ÷ ^ . L )S  ›  ‹ 7 “seen_non_é;  ? ðbreak

             ð# if no actions were used, report the error
0  ]else:  " ânames = [_get_\ _ ( )6  :  3for‘ ± in group._ L s@ #if? ÿ.help is not SUPPRESS]= ñ msg = _('one of÷ Àarguments %sF Ÿrequired'À Qself.+(N °% ' '.join(û Es))
z �# returng �updated & �pace and eextra ‡ ? = 1 !, * sa ðdef _read_args_from_files(¢ ,P –_strings)ÀP# expy o Ñ referencing A � 0new] G  ëW¿#rg  Ãa "s:¤ èP   # . pregularš q‘, just ad±m back intoElist‹  J Ät? u  Bu 1[0]0in . Ð Ö_prefix_chars
 R   å †.append(Í Ñ 0  Õ!plÀ9CQ withÆ  ‚ z contenÎ X>try£  w Q Gopenš €[1:]) assý<  @ Ð ³È    ª - ClineÖ\ .m€().split 's(YC  K  F ’qconvertT A 0_to sÓ   P  X  › ×««0 " =6Y N -:ext-s<  except OSE`¢0err˜ÿsys.exc_info()[1¦L‚str(erru€modified"t Vb
è¼ `± ƒ c·R [N  ]M `_matchñŠ §“L Ø‡_pattern!# = R SCthis 7Carg I >n#9  ¶	 ¸u =h. (0 ¶ ò  |`# raisé 0ionŠ!we‚€n't ableº bfind aæ · "if  –;Non‡‹  Ó{7 Ð        None:û _('expected one argument'),
  ™OPTIONAL:6 at most> ­NE_OR_MOREA ?leaB }Ž ñmsg = nargs_errors.get(action. )1 0if 4 ‰is None:  æ   §= ngettext&%s ;  K7 /s'8 	¸ 8 %  	« sraise A¤Eú õ ,à %)
. õ# return the number ofÌ •s matched1 / Alen( “.group(1)U Qdef _ _$ó s_partial(self,·  s,f p_string# fttern)tò# progressively shorteª ú ðs list by slicing offÊ ® t# finals � until we 2d aÞ . µresult = [] ð for i in range(ø } ‡), 0, -1³  ä _“ 4e ={ 6[:iU  ( !pañ À = ''.join([a._get_›_# »
ª C   « ~  ° 
 sˆ ]=  q = _re. (k ” q  #  is not)K�.extend([7ê ) §   §  E;s()¨  p _break±ÿ¯ S ecounts² ¯� F ¢€parse_op	™#rg�Ôó# if it's an emptyk ò, it was meant to be a posiV … !if*a_ å â ¤  r¢   w ð doesn't start withd _refix�  0[0]{opK o_chars—  ,; ppresentY    a(r,_’ 7 � ”ˆ_4 š  ? = 2 [\ 
xnD ð,Ë‚ð's just a single +_acter€  ‘ o) == 1n'`beforeéG "="}o0'='h‰ 
ƒ Ózà, explicit_arg÷ = arg_string.split('=', 1)
  “if option+ © in self._ 0_ac% )s:=  H  / =6 	[L ]D rreturn K ,‘ õ , explicit_arg
< ó# search through all possible prefixes of theS  D 1and9 { sþ  / ¦parser forS ¡interpreta
E Ü etuples4getB (�)Æ ³if multipleŽs match,¹ å was ambiguous‚ yif len(‰ Z) > 1®   £ ª', '.join(šR  Ù   –
 7^ _í ]e0argw "{'% '':œ1, 'ï Ces':§)s}‰ •msg = _('ú ( 3: %õ ‚)s could:3 %(S :)s'Š Û`error(W %‰ s�¤exactly on“X  ed”’is segmen	• is good,´ S# so ÓMdÝ& /el·/==¸Z3, =ý   ¯u f! k!itDpnot fouýCs anS õ, but it looks like a negativeº �# number,+  ’°meant to be/i 'al0 `unlessÐere areT -J -k · Ò #ifT‚ _. _Ý!r. X
ð0if è ó\_has_H q /alÖ JNNoneBÿcontains a space	a`if ' '/
µ y ¸j·!al¸PthereŽsno suchÕ‡ƒin this Þ1(th9€it might¿sa valid< © B sub2 K¦ ,C=&, 1^def _ ŽL)¸result = []w©¾ós starting with twoï± charactersfGonlyÿ 0 atˆE '='  7    œ .:_ " &0[0]%  D¢ &[1 Ü  ¡ÓÊallow_abbrev" & !'=&	W )  - # ðprefix, explicitû_arg = option_string.split('=', 1)
  ]else:  % F lprefixV 2 ƒexplicit‡ MNone( :for  £ in self._q · 0_acÅ sœ *ifE Ã.startswith(G ¸ )@  à a / =~ 	[M ” ]Î  H   btup = R ,› (, B õresult.append(tup)
, ô# single characteCðs can be concatenated ÷ their argumentsL ¯but multipR ãalways have to 	M L vseparatç,el›0[0]ã » Zs andu[1] not" 
¯oÉËƒ
d= = {TshortbP :[:2á4 Z “ F[2:]§ 	ß/@B == Š { ¾ 
) {   ‚Ô/Ð
Ž  „  Ò   .Éñ Rë !#¾øuldn't ever get her4ƒðerror(_('unexpecÛ ~Š: %s') %R	8`returnY collE Vtuple+ ¶Õðdef _get_nargs_pattern(ž ,í`#Å€all exam[ £ below, weF€o allow %@'--'Ÿ� ð# which are represenô `as '-'] Cthe … _› |. ¾  e#û �default (À) is assumedáDbe a`/^ 1if R  4  = 
v È = '(-*A-*)'� ó Pzero û neö •N  î�OPTIONALm ð ?-*)'

        ó# allow zero or more arguments
  õelif nargs == ZERO_OR_MORE:$  + # õ_pattern = '(-*[A-]*)'
) t ?ones ?ONEr As ðany number of options… ó ŸREMAINDERð O[-AOï g 0 fowoed by • &OPARS’ ?-*A• °suppress acb, likeä%=0¬
ù�SUPPRESS>-*-òø
 others should be integerg/se\  %s^ ò % '-*'.join('A' *½ )iÓif this is anð%aló  -- 2not%edø #if% .%�_stringsž 	ÿ�.replace(§ U, '')^ +< '; < Ó# return the j  	L ?# = = ö# Alt command lin’ parsing,%ring fre¾Crmix@ ^ = 1defH  e_õ 7 0ed_P`(self,sñs=None, namespace )r / * @v = 7 .š }e_knownX . M } Û6rgvX  Žðmsg = _('unrecognized– 	K: %sÀ� `error(= C% ' �Vargv)p ” � º  Z è 6s a7 Â stãVextraa#­ ñ `# posiú`al can� ×!ly—¢U with76s.  G areM Rfirstâd6 8allc ú@s derÒvated.  The '¦ 'P 0areánS @.  IË ò¡rser defin¿  ÂÂincompatible~ (thž tc assumø�(e.g. use*âQ, subZWrs) a• PTypeEò t vraised. 
 ø s(' 'ô 'ó@settI©±§default toH p(�is blocksB addÿ o'att 0 to# H �À     positioðnals = self._get_positional_ac	 Ss()
  Ra = [ S for  6in 7 s. 5 #if& õ.nargs in [PARSER, REMAINDER]]5  0 :  C ðraise TypeError('parse_intermixed_Y :ƒ Y arg'D  H  q' with “ ’=%s'%a[0]¢ %)
: $ifî Q.destó PgroupÆ 3ñmutually_exclusive_" 

,! .( e ø p \ N]./inÅ EÄ Gå '
:tryˆ ¤save_usage> ; m5   "ifm/ Š is None\  '   ò# capture the full 6  O0use*e@ mes‹ 
u C   ©9 ébformat¿ V()[7: 1    c Þ«  de/ Gvate‰‘  ) 1on.C‚) =$	E �   ## O = 0' \ W �SUPPRESS, 	ˆ vdefaultŠ  9 	# ? = g ñnamespace, remaining¯6ÌQknown (Ì,v   z ¾= ÜRremov†WemptyâÕ values from t À Åif (hasattr(* ,× a« ³   and get@ 	_==[])¢ B ¥ 0war†�s import  °  2   ñ('Do not expect %Ås%s' % (p ¾ , )Ê ?delÂ 		Š 0fin\Ñ ’# restoreÂ â0bef yexitingN  Ð ûÞ N 1 `  d &  7  	9  oph‰ "‡ f ]!# P Ds.  J ðs aren't normally reÛquired, but
  ò# they could be, so make sure }aren't.; ðfor action in op
 Mals:)  s ) ‚.save_re’ # =@ . ; 	$ � = False,  � Pgroup� ñ
self._mutually_exclusive_" ¥  ¤   w  Þ 
# ¢ ñnamespace, extras = © ñparse_known_args(remaining ,u  y  t )E 0fin­¡# restore • Àr values bef yexitingL  …  }ä ~S	d j c 8á#x O 
òw #w Pusage¼ Î 5 ureturn vê
" ?# =  Vm€ conversZsmethods = = ’def _get_²(« ,bæ, arg_strings)ö # ¹ everything$ð PARSER, REMAINDER= 0s, ? ñp out first '--'z  #ifk  .nÂ@ not§[M ]~  8 :try   ­ €.remove(m 
Ãqexcept 3^ErrorH Bpassz V #¥ Ñ ñument produces a default when¿ fpresen4!if � J and÷ º== OPTIONAL�  �
&  § ¿Fcons„  ! Oelse7 Î   9 áif isinstance(h Ö '     ãHV(ä,
� 7  tr._check‡1 � #h -â='*' on a posiH@, if€öre were no command-linþ#ÌQs, us¯Æ ì st is anÛ×other than NoB `elif (°ÚÀZERO_OR_MOREûÍ  û  .ä`¥ §  €  — Ù"À    value = ×arg_strings
  ñself._check_value(action,  %)
. ð# single argument or op- &al ¤produces a0 I G —elif len(’ ²) == 1 and ~ õ.nargs in [None, OPTIONAL]:I  Å D 0, =„ ä � 2 = ì ;getê F )^ 0 �REMAINDER† Òs convert allN1s, N …ing nonen 	û 5== S 
ô Î [Ÿ Ï €v) for v?Û (s]ËOPARS¬ 2but° ÿ  only the first· [ ´ 5 æ ñ BÂ9[0]¯…SUPPRESS’ð does not put anythŠ!inÛ �namespac–V á  l ÿò other types of ß+Y a liV/se^ ó;  .
b    _	XRretur4â"edà# i Vdef _¬ l ,í,¡¹)—  -U_funcº€registryH  ('  'D . 	 Ë!ifô�callable(+ Y m   Òmsg = _('%r i(4 'N  * sraise AUError7 F %êd ÿ  6 # J1 to|±appropriate; I6try E �result =' b I	§Ÿ AType£  P0dicd e³ 	eexceptÑ 2 
{  !” = getattñ y0'__ ‰__', rep )= !ú	= str(_sys.exc_info()[1]* g	î ´ s—VÊõ also inú 
(? &, <   á  0Ú2= {Á : W 1, ''':} ù7Á_('invalid %É")s{A: %(C %)r­À      raise óArgumentError(action, msg % args)

  õ# return the converted value% # bresult< ±def _check_, t(self, l  %):B #\ ò  must be one of õhoices (if specified)D #if_ #.c) €is not ND #an¶  +in, ‹  ù  Q = {'¨ "':ð ,k  $  'n ô': ', '.join(map(reprò “ 9))}E  tÒ= _('invalid M A: %({ ð)r (choose from %  F)s)'û  Œ oraise Û?# = ž ó
# Help-formatting methods ; =  ù9 a_usageùê `ter = e._get_ (Õ  G.addM .X ,> Rsœ   i ö
mutually_exclusive_groupst Ê{ 
 c_help(â   ] á ( — !# Ë  m ?terò Pu �# descrip 
‹ AtextÉ., É @posiA aals, oL @als vÒuser-defined qg ‰‹9 inØ sžœ �start_seÂÉ3 f.titleÙ ¦ 8  QÔ >3 	Ü  1  
9 a>sq E _R S E A 5end° 	Ahepilog |¬  h.' 	:  determine �(q ] abov§  f
 Ý’ x à#  .A ñ ter_class(prog=  
 ¦ lë jOprinh8  „5 p, file=î¯ !if 1 isJñile = _sys.stdout^  ³Æ _d 5mesËô x )u ê –  Š1  • Uw ” ð_print_message(sóelf, message, file=None):
  $if     !if/ @ is 2 
  !  M å = _sys.stderrT  s.write(€ !)
! :# =  ó Exiting methods 
+ = ¡def exit(sß …status=0é ã  ? ƒ._print_¤ ¬ ,Ø )v  Õ í { u Ó ‘ Crror’ M fA"""e!  ƒ: stringA  \ Pˆ Ps a u­•¡ incorpora5the 2to xE and£  ž "s.k W ð0If you override this in a subclass, it should not return -- it
C     aeither~õ or raise an exception.‰ 5""" jiÞ (I¾ ^óargs = {'prog': 6 Sog, '8$':ÿ }]  ÷ �(2, _('%(@ A)s: s4: %Ö�)s\n') % j $)
¢ "asè 2~~~8ðThe `ast` module helps Python applicaî ðs to process trees of ¥, ¤ ðabstract syntax grammar.  h   it÷ ñ might change withK Deach‡ ‚release;Òm© °to find outž q ²tically whaï  § tcurrent”   looks likÖ€d allows%ifó Sof itb<An Á  ð
 can be generated by passá Zò.PyCF_ONLY_AST` að`a flagU � ð	`compile()` builtin funcz ~Aby uR - @pars+ )' Hfrom"v°result will¨ a½ ¼Ñobjects whoseK $ es‘ inherit V È  ¾ (/ed
Õ „d into aÏRcode ~ w Ú û H-in á | 0ddiâqvarious¶%er3Ps areðvided that make work™g P Ç„s simple¬@main·  enl  / *  
g n^ iÓ™#inlR6 ˆ =0asyô1use^ òrface for librarieK ²  ­   t Ì1ithop›bñ(template enginesM 0exaÍ 2).
æ`:copyrJ 4: C P 2008®âArmin Ronacher×”:license:µL .KPimporæ!s
 S_ast  * ¤contextlib  Ómanager, null 3 Denum- ðIntEnum, auto


x÷SsourcâÀname='<unknoõwn>', mode='exec', *,
  ñtype_comments=False, feature_version=None):6 1""" ñParse the source into an AST node.' òEquivalent to compile(3 ¢, filename¡ ò, PyCF_ONLY_AST)B ZPass ¦ @TrueO �get back  ] Å S wher› Âyntax allowsO À zflags =s ³ !ifP ø  14 |5 ÔTYPE_COMMENTS: »isinstance(Ed, tuplG O ìmajor, minor =uñ  # Should be a 2-@ Æ  ? qassert F Q == 3„   z " =d   Melifk 0is ãê 
Q = -1? ¶# Else it sœ nýq givingÓ >‚ for 3.xº `return­

k¨ Ø  _Þ = ð)


def literal_eval(‘«_or_stringËpSafely ) @uateÅ`expresüÌb or a = € containì �a Python4 @.  Tm  <   ð provided may onlyJ qsist of6 fo¨1ingO Z Ç  }  uc• s: óings, bytes, numbersbò s, lists, dictsE se Ñbooleans, andó•7if Á ¶ 5,w : ‰
 @ = pj .l5‚p(" \t")ç ='j!')æ r E‡y 	
Š Q.body\  ð_raise_malformed_- ¥ R umsg = "% ô ½ "ngñ ô ñif lno := getattrJ ±, 'lineno',TZ  5  ^ �+= f' on ) q {lno}'¤  ! £ Á ValueError(2 ` f': {¯ 3!r}.Ò ±convert_num o lif notÄA, Co• t)� L9  .vs )3 án (int, float, 7lex\  ª NÎ á ¹ a  	º @sign‹Á �¡, UnaryOp)´ û.op, (UAdd, USub)± @operë<= _7. ˆ Þ   �c  b [  . Í#+ L ë     FelseR    3 -3  ¨   @½Ž ´ Àe, Constant)7:
  õreturn node.value ðelif isinstance(# �, Tuple)D t â(map(_convert,X oelts))Y OListX OlistW &/SeV /seU (œCall) and!±.func, Name  õ s D# Á.id == 'set'H  @args  qkeyword /[] Å Y<Dicaif lenÒ–.keys) != sq  À ð_raise_malformed_¨ F „  ( T�dict(zip¼v , <  I š LQBinOp€ ëop, (Add, Sub)å tleft = ¿P_signç !umæ .  ë 9igh3 n, r 
- 
P M í, (int, float)² D ›, complex­  *
R  �.á ?Add-   1 › | 1 + ` …Jelseá :   > ->  <
% Vñ_or_string)


def dump ð$, annotate_fields=True, include_attributes=False, * „dent=Non¨1"""å Rì a ¿Qattedk ã of the tree ið  This is mainly useful; L üdebugging purposes.  If±  A òtrue (by default)ø s 2ed ¡ will show‘ Qnames , ý �  .‰ t f 8 iresultb qbe moreYaact byK PomittÓ ²unambiguousl  ‹ E.  ArÂ such as lin5bnumber± ñcolumn offsets are noto6ed 5tkbwantedäð  can be set to W?  inò kÒa non-negativ– £integer or,\n òtÀbe pretty-pr2 Âd with that _ "plevel. \  (]Ó� selectsW asingleò  representation³� ì_Œï` '=0½ âß  C | 
ž5 Q += 1¤  ©  ð	prefix = '\n' + indent *‡ level
  ûsep = ',\n' + indent *) Yelse:7 `prefix: ' O   ú	if isinstance(node, AST)Q ’cls = typ# )V 0arg *[] ù llsimple = True pkeyword7 ù annotate_fields' Àfor name in › .% 
�  0>try   @valuƒ sgetattrâ  U 
Å  , ÿexcept AttributeErrorW Á Ý  K   kcontinú   2if — Äis None and ¡ Acls,õ s, ...) $ ‡ @„ %, ¦ƒ_format( Ž%aØ  Â I 	Áî .Å  @ð.append('%s=%s' % (¤,))‡ õ l   O Ë 
=  ñpnclude_és‚b ® �. 	 � ˜  ž % =û � ü
³  ,     / €  „7 N k 
ç h W `&=  l5 ?rgsO+if] @len(Fn) <= 3âreturn '%s(%s)­ðode.__class__.__¾Ã__, ', '.joiR p), not ^ 	)	S U àZ, sep\ FFalsj elíÞKlistß!if–  €î N[]',Ê¹ a[%s%s]ž Y"x,ºP)[0] LxÙJ)), ¼ X 2rep´)| 6° ¹’raise TypÉ ('expectedá€, got %r²  ø ½ … Cx!is&² Éƒ žW, str_  ‹C ' *ÃÅ â Àn _format(noñde)[0]


def copy_location(new_node, old
 ¡):
    """ ÄCopy source 6 ð (`lineno`, `col_offset Eend_ Pand ` $ U ôattributes) from *~ d* to *– ð * if possible, P greturn# .R ¯ @for ^ R in '‰ F', '�    “      ÿ  %ifK Ÿ  ._] » �    l ² ! J  N °value = get5 (S ,e q, None)Ì  .    # › © m   ª p are opÇ!alE ˜ (KtheyN �should beòied whether the Ÿ !isˆ r or not[ ‹   &if% 5not) (g  * ?hasã  )Ä   Ð.startswith("Õ "ù ƒ K  s6h6· > " ïµfix_missingö s(óf :ðWhen you compile a & ` tree «  1(),2( ¦r expects ªªð ¡Severy^ Àhat supportsW àm.  This is raŸM ptedious@fills J ‘generatedN ps, so t> ¡helper addV 'se!Q °recursively reññ  already set, b Ating™  | *@s of L aparentƒ È.  It works c ò J @at *X*]~ šA_fixš,K&, D,  Ê ,%if÷ $ j “!ifõ ¯ - ,? U  Y    ! .æ=¤     Jelseö  2 @ 7  ±  % 'µ C P 7, '? G = PŒ  3 .1 ' =W”  µ Ë 	: L ?  Ó �Ó  QˆC Œ# ' =,Š É 	: É  ?  É  ò  Í   C ¤5 ¨ ¤ ã À  end_col_ofðfset = node.end_col_of #
  ñfor child in iter_ _4  s( %):-  4 Q_fix($ ¦, lineno, X  , h     )H @  X b, 1, 0  areturn¯ ò


def increment_S ‘ S, n=1– 1"""V I) A the˜ ° number and” 	 qof eachj  ø  4 AtreeK Ðstarting at *© ð* by *n*. This is useful to "move code" ±a differentL €locatione qa file. · 	~Awalká Ü  nBif 'û 'D xÊ._attributesœ 0 ` = get* ®I �, 0) + nŠ e (   "¹G "w 	.  b(2 - :z P  ~ )Ernot Nonu v ÷   Í X =È	À 4  ÅYfieldÀsY ñ  a tuple of ``(. ð name, value)`` ›%   ``!._ 1s``@thatÎ £present on5é8  I G Á6try  yª 6 ,Ì < !,  5 * „except AZErrorM DpassU !^æ&“ll direct$ ~ s5#, ÿ R, all– s 1are_s& # " Aitem@ Á + Alist b <�6  B© 	ä Òif isinstanceÚ[, AST^]¢  ; /el=  œ >   Ì  Œ ‡ 
m M 
K  - ‡  *   �  & ¥Ñget_docstringÃ, clean=True� ®R9 Ç4 Á  BgiveU1 orrv if no + "caÑbe found.  IfJ �ð  provided does ¸Fhave@ �s a TypewNñwill be raised.
 AIf *Ã *1`È `9Ptabs 2Pexpanj ‘to spacesÀ‘any white M y0canf Àuniformly re�ad fromÀ bsecondýaonwardÁ( 
h Í> þ À, (AsyncFuncËYDef,  QClass sModule)ž Ø»("%r can't C1" %0@.__cP P__.__ö"__èž 
Q.bodyê ¬ ð.body[0], Expr))3:
  ±return None pnode =  Ò.body[0].valu àif isinstance(% f, Str)P Dtext@ sR /el6 !CoF lt) andU r ?, s[ “ Felse Ï †if clean" áimport inspect¢  ¸  .5 @doc( )& [   ó


def _splitlines_no_ff(source@"""S!   aÉ ‘ing into 0 ` ignor ‘form feed	Ñother chars.
w ñThis mimics how the Python parser † "s | a code.: 1""" qidx = 0 } A= [] Pnext_ Q = '' `while 4 Z< lenÓ  *3c =l B[idxH   L A+= cL    J E+= 1 ð# Keep \r\n togeò   °� == '\r' ? 	‰  ì € . &n'â v 	� 2'\nÜ      U 	” w  inw \K  •s.append(X  M    HÏ 5if  � N 	b# cêpad_whitespaceŽò r"""Replace all7ñ except '\f\t' in asa with F $s.Presul°ýPfor c4 a· ! V   ý E 	ö
–
& "' Žï ? ð Bget_| ƒ_segmentó ,“÷, *, padded=Falsk3Get— ? 1 of3*V ð* that generated *Å*lðIf some location inŸ  (`™‘no`, `end7 Ácol_offset`,û"or#  !) Çsssing, û  v{ *Ù ** q`True`,» RfirstÄ°of a multi-� ` state&Q will| #be!ñð to match its original posiè 
06tryá Æ Rò  Ÿ  ¹ 1 or”. ê  C þ
g   Â $no- -* Y  ’ ) ~ )   o  <  w 
 - AæAttributeErrorÏ ¼¢ £ ?s =V 0if l  -  õ =Ñ-noX  !  s[ `no].enÐ6()[º :G  B].de$ Ž #if Z  Xàing = _pad_whiàtespace(lines[ òno].encode()[:col_offset].de ±)
    else:
   Ñpadding = ''
 „first =   + ^ d  c :d C !laB 8 @end_
 
    A @  Õ ) =y 0+1:4 J «   Ás.insert(0, » æ  pappend(�  âreturn ''.join>ò)


def walk(node)1"""Î ðRecursively yield all descendant 4 ðs in the tree startW@at * *J a(inclup � itself),> ñno specified order.  This is useful if youM `only w€ –to modifyŠ ñplace and don't care about¥ �context.I è ñfrom collections import deque* btodo =  ([Ø ]W`while  ; Z  ! = ’.popleft(.    , @.extŸ°iter_child_5 s…, u  û


class NodeVisitor(objectµA" v$ b base ; Athatìsò abstract syntaxÀ 9qcalls aù G 1fun’ for eversd found®% Cmay qSa valFPwhichÔÁforwarded byŒ `h ’` method.å» Sis meòabe sub �ed, withD   ÙS !orÇ X sY ¢Per defaul*  À sæ  Ô { s C1``'' a_'`` +U ƒ � name ofƒ  / ÷.  So a `TryFinally`“e a wouldI 2be _4 Uòbehavior can be chang:`overriVG  ± H Iu  If noâ b existè až B (µ³� `None`)Ú ‘`generic_`Q ¡„d insteaºD{2use< ´`ÉÀSapplyÕ As to� �s during• ðtraversing.  For ta3%al‹ Ó  (`o ±TransformerÂ !atL ballows51icaî#  å (¡,� c ¿1""" 7.D  f RA A_' +? 1.__,P__.__0!__k  4 * Ãor = getattrw L  , … .}®ë=; Å 	5 V  ¡
Í `Called–µno explicitT0	ù  f!,î ÕÜ ×! ø Pif is6Qance(qT, lisÏ $  Ðfor item in value:
   ÿ	if isinstance(item, AST).  A ¡self.visit/ )W *elQ vz R J ( !)
L Adef ` 1_Co™  t(* g, node™ 4 ! = . ?  ¤ àtype_name = _cF _= _ `s.get( (: )Ç 0if  ? kis Non<‘for cls, b /inc  N's(²  ›   $?cls+   / � =s ç    Ubreak Å ?notÉ  ¢method = 'p6' +ü L  b >try5 Ãor = getattr¨W R A þexcept AttributeErrorS Ipassy ;els~ N êimport warning2     .	 B(f"{“ û} is deprecated; addk)",  M 
 D? BionW :, 2ì  1 breturn] 0or(~%   Ö‘.generic_M( `

clas{ðdeTransformer(NodeVz#or+1"""° 1A :3 ':`$ Q` sub @ tha/ñlks the abstract syntax tree andL ñallows modification ofg"s.£AThe j ž ±` will walkd 0ASTS A use õ o P 1theo ù 2or £òs to replace or removA 1old… _.  IfS O  ß 
S  õ ``Ç1``,8  Ž® #beb Òd from its loõ 
Àotherwise itJ œ ad withN rë ë0.   a may bÃ ¡ �originalÌ õ in which case nü ±ment takes y@Here† Æan example t!çð	rewrites all occurrencesu²blookup6�(``foo``)xò``data['foo']``::î2   FRZ ANameŒþ),  ÿÄ-  êÀ ( 3   ,¡Subscript(&  6=L @id='§ â', ctx=Load())­/  eslice=FE  ý?.id2  R ! <ctxˆ Ÿ@Keep·Bmindq mh½óde you're operating on has chi¿s$ Q musta  eiaÆS. r@ cÓ â:.):`=`P   ðod for the node fð$irst.

    For nodes that were part of a collection Ástatements (. Pappli; Qo allP $ V ñ), the visitor may also return a lisl „ `rather‹ nN Ñjust a singleR · ñ Usually you usee ð transformer lik Bis::è !  ? † = YourT+ 1().ž (‚ )v 2"""5 Âdef generic_% Qself,J !):,  Dñfor field, old_value in iter_ s^ 3  7 åif isinstance(: ,_  ,   2new\ es = []      ‡ | O 
t  (   
| 6 _, ASTw   /   % 0 = 3 4 "  1if " � is None‹ 6 �continueØ ! ˆelif not6` º  A =�.extend(; ½  5 “ 
R ?appR ‹f[:] = 8 	ê Þ ˜ H  ´
“m Ú  >1ew_4 ’
qdelattr´,ÚN ?elsÑ<set? ,ö  z I   q


# IfÆ ast module7 loaded morÏðan once, only add deprecat$ aethods" 
ì aot has‹ !Cogct, 'n'äñ# The following cods  Gñbackward compatibility.±ð# It will be removedîcfuture  :€_getter(1t  UE"""D¶ T. Use&pnstead. )   r( C .±™&_s_ ,C f 2 " = : 
ã.n = property(« #, U ¦,  q, ó
class _ABC(type)t÷_init__(cls, *args¦ écls.__doc__ =  Ži ^ )Dast.–  ;0ead/™o QTcheckx  + w n ! $, [ + …FFalsž`if clsù _c^_ú sã:try  N Ç! =¿ Ô   þexcept AttributeErrorF 
”  D ˜àreturn (
       úisinstance(value, _const_types[cls]) and
7  Onot A ý_not.get(cls, ()))I  preturn z 4.__˜ rcheck__B   ²)

def _new °*args, **kw
 !):d ²for key in    º !if ¿ Ön cls._fields#  ' °# arbitrary0 úword arguments are accepte�continue†  H Xpos =g ¦.index(keyý 0if ( g< len(Ç  A   ñraise TypeError(f"{¹ ñ_name__} got multiple Ì s ² ’ {key!r}"t  if’  ñ�CLant(eÞ %  ._•¬2 ´
class Num(W a, meta S=_ABC¼�‚ = ('n',² ] ! =û
N ?StrN sN _BytesP 8DNameì W =à Ellipsi• !)
�%T (	 ]$s o 	   èm(..., à *   . €A = {½ ñNum: (int, float, complex),  £Str: (str, º@: (bÂ 0: (ZÃ(None), bool; ô " @...)B (}
›  ËŸ  D ) * Anode;— ÷Ï  * 8: '� ñ',  # should be before intá ¬ 8   0int 2um'&	 1	 s7C'Str6 .1: '> z  4: 'D',
}r“slice(AST­ð"""Deprecated AST  ÕD."""8 Iõ> : p Use th2dexÒ€ directlÖQstead`  tí + Ÿ! œ AExtS× Ÿ `ast.Tuq ™� 
dims=()’ 	J `(list(. y), Load4 a

# Ifðast module is loaded mCðthan once, only add deprecateóVd methods once
if not hasattr(Tuple, 'dims'):
    # The following code is for backward compatibility.8 ñIt will be removed in future.
% Pdef _n Ã_getter(selfy  } ñ"""Deprecated. Use elts instead."""H  , preturn B .% b sb w, valuei 6 " = > .¡ È = property(² ,À ^ ó)

class Suite(modd 	É ` AST nH- r.  Unus�Python 3Û M ÿAugLoad(expr_contextX 4_StoreY >_ParamV 8ð
# Large float and imaginary literals get IÀto infinitie0@ thexø.
# We unparse those* Âto INFSTR.
_	 ñ = "1e" + repr(sys.‡ õ_info.max_10_exp + 1 ö_Precedence(IntEnum² P tabl† `at oriÒ ¢ted from p
rgrammar èáTUPLE = auto()ÿUYIELD  %  £# 'yield',	 [ '5 OTEST4 Ð # 'if'-'else9 blambda5 /OR3  '2'or$ /ANŒ $ 2and% /NO}  ~ 2not% ?CMPo @# '<› >  == > < A!=',ä   ä n7  ÿi
  is  is 6EXPï P B  
T B# '|5 !BX$ ž% C# '^# "B# '&# OSHIF! ú û >* _ARITH&@# '+Ò -( OTERM'  q*( @ / % "//8 OFACTÒ 1# u€f B, '~3 FPOWE9R# '**$ OAWAIá Cawai6ATO¶ ” 4Lnext,2try²q !__k!__6 «( €except V_ErrorG ÷


_SINGLE_QUOTES = ("'", '"')
_MULTI ÷'"""', "'''")
_ALL *K 9, *@ KU¬Ör(NodeVisitorMMÐ�in this è ð
 recursively traverse an ñ<AST and
    output source code for the abstract syntax; original formattingD ñis disregarded."""
 ñ!def __init__(self, *, _avoid_backslashes=False):5  •  , #._” K= [] buffer   ûprecedences = {}9 ¯type_ignor  «indent = 09 ´ / =É  ÷ £interleaveù  ‡, f, seqë ð
"""Call f on each item in( ¡, calling ?  () qbetweeng -  Pseq =:  r(_ ½ 6tryV ) af(next% )& úexcept StopIteration7 Fpass/ :lse  2xœ :seq  t ¼ @     Gf(x)2“tems_view2 traverser,Ù *ms5T  É‘ separate·pgiven *Gñ s* with a comma, Åappend it to“  ïUE. If= ±is a single„  ”u]�, a traiœ\ K ¤will be ad ì   qif len(™ j) == 1,ñ # 6[0]£ @ –write("," e�* wƒ�lambda:  B @ "),Å 
e‘Âmaybe_newlinÆ
‚0Add! 0 ifTQisn't‡Àstart of genT#ede  Ï   "if” ì
® 7\n",Dfill&jext=""› IÇpa piece… Jtextÿ€, accord^!to³ ucurrentËh level» ž 
$“ i è 3" *é T 0 + ’ Ó -  8 , B"""AµÑ � G.ä(c á_j  ( �# k  € "._) F  ‘@property# ß+ Œƒñ value = "".join W %m fclear( qreturn J ”@@con¯ vmanagerƒ Alockc _¸extra = NonS E B  C ê pr=#he£ bX Ps. ItÌÿ ,0chañer':', increasesFâ6 Ô 
{#de' »   K / 2xit„É Q* is Ò  ]rdirectlˆ J òred afte¿dcolon ª Àr.
        "C""
  õ self.write(":") •if extra:  1 .  0  Å_indent += 18 Uyield 	( -(  ñ @contextmanager Àdef delimit(7 Ö, start, end)˜ S"""A ?  @ ñ
 for preparing the source ñexpressions. It addsr  ã *e A* to7 òbuffer and enters, after exit i= µ *end*."""
H  ² YR + � Ø A û =_ifþ ,ð gdition	&if  Ô qreturn “ RL´ Oelse: Cnullc&()£ ãrequire_parens§ ÷precedence, node¢ °"""Shortcut`0addž1 ’ related Q  P ¿   Ã   ’"(", ")",Ý Fget_O (   >
“ ½ ,  ± v Y Qs.get^ E, _Pð W.TESTb sŽ b Ÿ 0, *¡ s! ·  1 in<sŽ B .ˆ [- 7] =â ž á �raw_docst¡ 4 t …"""If a ' z � is found‹  @qbody of¸ *¦uameter,B1KthatQ ò, None otherwise.©  ÜñLogic mirrored from ``_PyAST_GetDocSÁ !``d 4   õif not isinstance(ˆ    è À, (AsyncFunc/YDef,  QClass fModule¨�) or lené. Z) < 1“ñ  Ü }  y ! =G7 5[0] ´  . g, Expr• À [ XvalueY 	U !Co!t)À .@  Uy  D ¥ � N´type_commen“ % ¸  " =�_2 fignore5q.lineno` @ .& ; Ñ   Œ é e~Pf" # E 3: {4 }‹ » �traverse (ifB � g, listÖ  Ž ›@item % 
‰  " žl  , LZÂsuper().visiL:²# Note: as  �) resets{@outp>°ext, do NOT6Ay on: > 0deVU ðor.generic_visit to handleñb any nodes (as it calls back in to
    # the subclass visit() method, which resets self._source to an empty list)O 3defD  - ,� !):  n Ó"""Outputs a I òcode string that, if converted° tm 5astJ 0(us1 ðast.parse) will generate an AST equivalent± *E*"""G  ¦ Ó J= [] �traverse(9 ) ø return "".join(E !)
&  ¢_write_docÞ T_and_R Q_body: %Eif (5 A := ` vget_rawO ” ] a+ y N Ã - ‘ O .– F[1:]) FelseÁ7 ú F_Moduleä ¨ ñtype_ignores = {; c    ².lineno: f" { V.tag}È 1 Bfor   à ².a ] }
 † § L 6 [ }.clear(¿FunctionTypBwithàÿdelimit("(", ")"Ùµinterleave(Ä  ú   rlambda:M Ó I , çn@.argÁ sG À  N ä F [ -> "ÿ O 6s@  üOExpr [fill(Y õset_precedence(_P c.YIELDÀ [value; 
” " á ’ _Named— �r:™re_parensˆ RTUPLEˆ ¥Â BATOM9 s.target ¬  y �
Ò 3 õ  + ' ¨(:=¨ 
F l oImport¬!"i' f � ˜‡Nname7� OFrom‘ Mfrom� A." *�f.level9"if m¡Ý A  ö.$ < ð   /" SRAssigf0v� HÀ      for tað rget in node.ta Gs:
  âself.traverse(# )" ¶write(" = " 
< d Vvalue" ñif type_comment := 5 Hget_ (= )š  x + !)
ž ðdef visit_AugAssign([ ,ì K   f.fill(—  õ  | # ~ R" " +¸ abinop[1 ÿop.__class__.__name__] + "$Ç /nnÇ Bwith˜ ðdelimit_if("(", ")"	tñ.simple and isinstances÷ w, Name)6 "&:¦annotationf"if¢ 7ÿwœ D _Retur!"r' Üš 3 ˜ OPass±m"pass"Ó _Break< b& = �Continue@ c) C _DeletA =delòinterleave(lambda:Ài ¹, ž Ç¼oAssertÍ a' � e >est›?msg™ ± È ü  4 =msg· oGlobal· g' · FXC ¢sŠ oNonlocŒ n) Ž JOAwaiÎíòrequire_parens(_Precedence.AWAITð Í0("af ¹ðØ?     øUset_p� 
™ 2TOM˜ .¨ 6  B 
‘* að_Yield;$Àself.require÷_parens(_Precedence.YIELD, node):
  ùself.write("yield")  !if6 j.value;  F ?  ;   Uset_p� 	™ BATOM˜ b 
} B �traverse(Â * ¨ °def visit_Y¾ PFrom(• U í Pwith  �.require(,\ fromó .t2
praise VOðError("Node can't be used ­ aout a x» attribute.dÑ `&> \Rµ XD afill("Û ¡ :exc> de.causY L 'f( us2  *¼n exception%areturn/RóÁÊ 
6exc’² ; S ! 
\ ù !)
— Æ?Tryh7tryf Ùgblock(ôî 
z Fbody× ’for ex in·Šhandlers®
À &ex? LorelÉ6   µ  š ¹  # A 
½ h € PfinalÚ ¹  ƒ " l; c † #L  n ÁE†HFË´O;typd2  Å  
( A &?namW 	(asZ v | A W =—  4�ClassDef/æmaybe_newline(‚  ¾EdecoÀ  ¯rator_list@B
 E d Ç Dcª B " +-ðdelimit_if("(", ")", condi " => ‚bases or ‹keywordsÀÑcomma = False- —   û eø Àde.bases:
    ©if comma:
  ýself.write(", ")% Oelse; V } = True7 X ªtraverse(eX þfor e in node.keywordsf » tÝ Qwith Ú zblock()³  _Mô _docstring_and_	`_body(ö !)
V ðdef visit_FunctionDef(I ,b   3._f' q_helperL }, "def"S _AsyncX +aC  ^ …  › ° Ü, fill_suffix½ æmaybe_newline( Edeco  ¯rator_liste  e ;("@¯ ‡ .k(E d ˜def_str =¡ � + " " +kF.namÈL g : K ’delimit("<"ñ  _D �  öV.argsJ "ifz kreturn> M\(" ->œ 
] G ` ª °aextra=: �get_type_Æ1entI)Á Ñ&/orÉ
$orÄ""AÅL ²R &_fu  ®y g  .ü  O 
sktarget# µ(inµ>  Fiter< ®2
Ÿ  oa o.orÕž  ï  (" Z› (íh ÒIá	ƒ /if:7tesvŸ Ü 	ñ# collapse nested ifs into equivalent elifs.· ñ RwhileÀé � and lenK. a) == 1 ¨isinstance! {[0], IfQ ,( =] 5[0]z  ~ Ô - ˜ Ð ")
         ÷   self.traverse(node.test)
  Bwith* ‰block():  * H  FbodyH Å# final else> 1if s  or 
V R `fill(" "K  p “ #h !)
� ðdef visit_While(q ,� à   .† w&  ˆ  <	¥ @  
4u?ith $òinterleave(lambda:GÂwrite(", "), G�f.itemsòIaextra=@ñget_type_commentÄ)Â .* c " .j	oAsyncWï a*  ˜ õ §ñ_str_literal_helper(4ñ, string, *, quotelôs=_ALL_QUOTES, escape_special_whitespace=Faî‘A"""Hl P for 3ingi  Ž  s, minimiz a %s.œ òReturns the tuple (© @ 1 toZ ²e, possibleÀ  ,&s)K 5"""W  l w_char(c¶  ó# \n and \t are non-printable, but we only ¡ Em ifb F d 1v is Tru! 0 tR f ’ ºc in "\n\t"G B r/+ c‡ cAlwaysY Á backslashesR Zotherã  iactersK àif c == "\\" o5 et c.is2• À.encode("uni	 _P").de w("asciif	Ó ‰ 7 dÔ 4â= "".join(map( ÖÔ)_#_ã2s =,ìa  ifa"iO l 
qM ![qêq:  1if  c_MULTIS]t / /= M 0noti 
£ R Àif not possi×ble_quotes:
  ö# If there aren't any possi3 û	, fallback to using reprJ  onJ ò original string. Try8 Ae a … R from {_types,K òe.g., so that we use triple7 ’s for doce )s.A  ! =¦ ( )" ‡ ‘= next((qN Bq in^ • 3 ifÄ 1[0] &), 
P dreturn �1:-1], [f ]y ²if escaped_” ŒHSortö õprefer '''"''' over """\""""V  Î±ð.sort(key=lambda q: qÅ +==‚ J[-1]Ê @we'ru ê
wÐand we'd need×Ò @ a fõ	– #N,t 9 it ,ifi?[0]¦ 
, õ »assert len( ™[0]) == 3p  4 ® €  ¹“ + "\\" +¸ .  ,Q ñ
P ,Ñ 
0  def _writeø _avoiding_RÄslashes(self^B, *,;‰Ö=_ALL_QUOTES)@"""WU vð literal value with a best effZpattempt¶„  � .Sž	„ 0 = £ .Â j s_helpera	/ =û¿ ` ( =á &[0%f -F(f"{2 "}{– } &")bó visit_JoinedStrRGnode4^ 6"f"š  ëBelf.�šp @@ "_f‹ m  g ,"bbufferðrb > Ý H†
.E 
> sñ  N ª0 do¸�T Úð globally (i.e.,OAonlyÂ M 2to < ðthem inside Form7 dVUñs), it's cosmeticW ¦:redM  ³à whitespace. TÓ#isJ =  – 3 ”P  îðcases like: f"{x}\n". To accomplish thZ  we keep tr´fof wha|#ÌBour eÀ corresponds… ó  ò ´ 
( � ñConstant parts oR2 f-&,B SallowQs² r&lyº� 6= [ ø Ð0in e. ÆÅmeth = getatúÐ"_fstring_" +÷	 type(value).__name__)
  Bmeth" ú, self.buffer_writer,  —.append((/ ³, isinstancp A, Co 6t))F Bnew_F U = []Š `quote_® õ s = _ALL_QUOTES" Afor É  k #_c\ B in P :*  Ý ÷# Repeatedly narrow down the list of possible ~ 	F p  " =%`_str_l"©al_helper(;  … ? =K ,0 õescape_special_whitespace=isò 	6 Y p ]£‚ %  ¶ = "".join(1 $ ¢ ( =&[0®ù!F(f"{2 !}{b } 1")
³ ðdef visit_FormattedV˜Fv, node)Äb 6"f"ž  Œ_fstringJ  D Å? º ÂPavoidJ ±backslashes‘ ¼ u ‘JoinedStr) º !, T Á ¯ ¢ ™ .sã  ² }… = getatQ "k ?" +Â‡ rK �µ 
hif notËº W, strá  ¿ araise ÇtError("g •s inside .À should be aK Ging.Ù! =+ö.replace("{", "{{") } '}}A ú É¶u»J '"{] ¢unparser =� H1)(_?_<V=True®7 À.set_precede!%_P Â.TEST.next()Lþ E 0expx L E(™* 0if - °.startswith<´Þ ð ")  # Separate pairñ
opening brackets as "{ {"Å õpif "\\"Ø n 
Ñ0Unac1to . . A "f-Ê¸ ·ession part{°  j 	é  aconver6 Z!= -1Œ  R= chr4 P ×  zn "sra"V  , æ  kn_Ñ L æ = Ñ Ff"!{$ É…Ade.f'
‚ A '":% X LÀetattr(self,÷" "_fstring_" + type(node.format_spec).__name__)
  Mmeth- v, write*  a("}")
> ðdef visit_Name(self, s !):   a   .9   7.id= _ B_doc¹ C Vfill(‹ !ifi Æ.kind == "u"t x 6"u"9 � x �str_avoid4²backslashes
Ðvalue, quote_Nþ s=_MULTI_QUOTESÈ ƒconstantÇ A aif isi# 1ce( ÷, (float, complex)0  Ç õ-# Substitute overflowing decimal literal for AST infinities,„I 0and ! -  0 YNaNs.& •(  B Brepr¶ N    ÿ.replace("inf", _INFSTR) 	£nan", f"({- %}-
 )± _ H Qelif ¦ º_· â b;strU@ ç _ y /sebC � f " =Í x/Wtuple@  Bwithûdelimit("(", ")")  - ü ¡items_view«.À!, Š ý "if  is ...
G"...½,el6¹¥  (½ ± ±€4Lis‘|8 [8]84ònterleave(lambda:t§  p, ‚traverse_.elts– AComp€) ­š p 6elt¹ 1 êbgen infªgeneratorsÆ , ê P =gen¹ G> /Ex½ �
m  � ,½ I?Setu{}%¸ Q?Dic¹ À     with se÷lf.delimit("{", "}"):
  þself.traverse(node.key)$ ¯write(": "  
A Zvalue& ±for gen in d ªgenerators�  š 
“ Qgen)
� ð	def visit_comprehension(0 ,W Ü !if š.is_asyncg  3 .Ò     ¢ Û Oelse4 . P õset_precedence(_P b.TUPLE¤ v.target< 
A# ¯ (inƒ> z 	£EST.next()€ qiter, *‡?ifs‰ 
 , !  õ •if_clauseË+ifÄ“ ® f® ßP å_IfExpÝQwith g êrequire_parenst2ESTó � 3BbodyK G.tes¼O 
À 0 7% ›i D   ZÙ Ç  orA ¤  
É ' €?Set™v;elt³‘.òinterleave(lambda:óR, "), ´ Ü  } Ú  è 
Éà# `{}` would bÉðterpreted as a dictionary lqal, and Ÿ   Ð# `set` mightF Ûshadowed. Thuý «¸ }'{*()}'î?DicT ÷< Q_key_\¯_pair(k, vÛ&(k ³ † Çv   7 € Pitem( v  ‰ 0 =  	$»if k is NonL X #slÂunpacking op d ! és {**{'y': 2}}d J ²see PEP 448V metails* '**ï G   ! C@EXPRwZ zvz„ l Õð$ ê7¹ 3Àleave(
       ñlambda: self.write(", "),  ñ_item, zip(node.keys,  †values)
L A  )
 ðdef visit_Tuple(] 6 !):!  4 Bwithw ’delimit("{ "%  )  > .ˆ as_viewN ’.traverseW S.elts} ðunop = {"Invert": "~Ó !No 0not @UAdd + 0Sub 1-"}Ÿ  C °_precedenceN   Ž "A E: _P V.NOT,  *~" gFACTOR! +! -! }bqUnaryOp?¢operator =j Ù [¾õop.__class__.__name__]Æ 9 
Š D  [+ = Úô require_parens(+ ? ³  dh €3 
hP# facØ ñprefixes (+, -, ~) shouldn't be se%edÚ  ` ±# from the Æ 
 úy belong, (e.g: +1 instead of + 1‚ ?if Î  y is not ø �   å :" "^  7set)
 =.‰ /ndC  &½( #bi)  ’ " Â1MulL(*" $at @ 0Div\/ !Mo}% QLShifW (<< R (>> PBitOrZ | !Xo ^ !Ant & TFloor¡ 	¢ 0Pow\ *ã x5‚
ÚWARITH#Ù  *ùGTERM? @ / % +<<  HSHIFØ/>>! |  Bö^ X & 7ANDû /Ý *;CPOWEu	»€rassoc =�zenset(("æ)?»?BinWX-E [Y<À     if operûator in self.binop_rassoc:
  ðleft_precedence = operA  }.next()= Origh> 	7 Oelse† $	H  Ç  ½ 	? (se½ (p, node. 
ú < Ÿtraverse(% 	¤write(f" {U?} "M  ‰ Ø Š  >  
‹ & î ¡cmpops = {  4¶"Eq": "==", 2Not !  Lt+ <* 1LtE 	( G( >( G( >(  Is< (is) AIsNo? iis not n/ n ANotI Tnot i !}
Ì ðdef visit_Compare(«>)uBwith€require_, Uns(_PM.CMP9  @ R .°8 q? @1, *'c—  ]sÈx€for o, eÚ2zipz3opsi ] í  ´   ¸ �R" " +!ü[o.__class__.__name__] + "®J t"e)|Cbooll@"Andº�and", "Or Aor"}¥) ] Ÿ", (: IpAND, "o=  -ORíoBoolOpìx" =ñ ~ !s[�/opø ¦  é < 
¬ IG  [- ] @  �õincreasing_level_9 ‚ • 1 �nonlocalƒ–  ) m � ¹Á ÂQ  V§þ • W] 
§ ©,	ö ¹ òinterleave(lambda:ÙÛOs), sÒ s.values¹  ¤3�Attribut5} 6˜HATOMa 9: 	÷ƒ " ò%# Special case: 3.__abs__() is a syntax error, so if�Ì %À   # is an ió%nteger literal then we need to either parenthesize
  ð# it or add an extra space: õget 3 .__abs__().8 ñif isinstance(node.value, Co ot) and% + Uint):S  ’ õ self.write(" ")  . „ aattr)
7 ð def visit_Call(B  , % s   À.set_precedeÌ %_P R.ATOM5 [.func� straversÿ 
! Qwith _ ÷delimit("(", ")"  ò Æcomma = Fals—  �for e inµ Z.args, $ 1if A    € N |    Oelse; V j = Tru–  ; X þ e  
· keyword» ‡,ŸSubscript1 ) ñis_simple_tuple(slice_þÜ0# w‹ñunparsing a non-empty = ,­šñes can be safely�  U  À# omitted if7 0re Òû't any elements that explicitly requiresL ðes (such as starred? ‡ressionsô … ‰return (N   0, T$
" /  ( J.elt¢ % !noà (` belt, S« !) p lt)Q 
w  Y ÁsøØï : û OÍk ú [ú]úC
KP Æ Jµ ¡items_view¡.‹ ¦< M‘  < éÍ  A * íBms j   F f*œeBEXPRM CR Ú ]˜ �Ellipsis™  ..7Ç×  º< "ifwZlower#ž  & r" :U ?uppU & U = ðstep:
            s÷elf.write(":")
  s ñtraverse(node.step)
& ðdef visit_Match(.  , & !):!  J   €.fill("m&  c  _ fubject‡ Qwith ) gblock([  _ ±for case inz . s  $   B k  % Å ?argÃ " Ý F.arg  "ifx ªannotation} y = (":ý – ] H ¡ ouments§ Åfirst = TrueÂ# normal arg=  ¢all_args =Â qposonly +   0 pdefault0 ä[None] * (len(I @) -  È . 3)) M  Q  ¼¡index, eleÚ  ÇÕenumerate(zip] $, @ K), 1ea, d =F b  d1if 
—   v = Fals2  Nelse0 Ë,Ëa! P Oif dP = 2   p ´dS <6 ==uÃ"P ‹C, /"a  P# varîá, or bare '*' Ý Ð but keyword-*T… presenty9 2de.V  T  kw8  h 
¤Y*q
² 
Ÿ  "�< Ë Ú 
 (   
L . +   [ # !   % 	ƒ 2 / #ª¢“ �W0in ˆr - èE.kw_—4
"1 ¦ 
Õ 5 ! 9  ; �"=$ 4dð kw‡ :argÊ �a$*"6¨ gc 
» )�À            ð-self.traverse(node.kwarg.annotation)

    def visit_keyword(<  , 4 !):#  ' !if Æ.arg is None  !  6 Å.write("**"): ?els+  f  T / L =K d 
Ö ]valueË oLambdaÊ Qwith J ýrequire_parens(_Precedence.TEST› lf  ¡ " 
¥ Oargsâ :B Uset_p‘ � _.bodyZ  
 % ‘î_alias"Ë Fnamee 
s s as " +7- ¨ ŒOitemˆ 
Ë Îcontext_expr“  opÙal_varsš > µ	M º ¯match_case¼ `fill("% ã_
× vpattern” e_guardÊ (ifZ Ê E \  ugblock(æA AMV
ç ­I ŸSingletonM _”’_constant×T 	0equÎS ÿdelimit("[", "]"±interleave(I * :T¤ (I "), P.ìsG `?tar½  {" =\  M  9?ame¤ * e = "_"0 �´ @f"*{" /}"Ž Mapping‘  YG  G_ä `_pair( Spk, p =  Š  NŽ 0&(k´ d /("4: pÂ  7 è {Ÿ}èDkeysT  š "	G ‘  %',( @zip(ˆ 8ç, strict=True)7 À   )
         Àrest = node. 
  0if  Ù is not None:!  ) ~if keys   ýself.write(", ")> ! Pf"**{p A}")
) ðdef visit_MatchClass(2 ,± )t   õ.set_precedence(_P R.ATOM5 F.cls‡ 8 ‘traverse(	  Qwith % ’delimit("É "}  é „patternsL È  !   I ¹interleave(  ! rlambda:r 7, © /, _ ×  L Eattr� Akwd_ 	s 1if  H 9    z€ 6 _o [(pairù  .    I ˜ 0 = + 	m  %   \ @(f"{7 /}= + õ (…     %ifË  % t ‡š	 F žè ã 	?,( @zip(s  «ë þ s, strict=True)@  ®(A%Dname   � o    0if /  [_È&el–: y d Ã;elsmŒérequire_parenséBTESTI¨ ¬ &2BOR< .�     C “¸ , �(f" as {0  è ã/Oràü ¿ û ´ ÷ ¡.next(), *£ Ó )ü %] | ")¯U 
±@unpausast_obj´  br = _U" "r(‡treturn " .ò(? !

V Smain(L ¡import argj T  _   .ArgumentP� òr(prog='python -m ast'� ; c.add_a4 õ('infile', type=U þFileType(mode='rb'), nargs='?'Ê `  ¯default='-%  help='the | A to › #; > s \stdinº Àd_argument('ÿ-m', '--mode', default='exec',
  “choices=() p 'singlC P'evalU ¿func_type')I ñ!help='specify what kind of code must be parsed')’  ðr.add_argument('--no-o @-com sÐ ÿ
True, action='store_falseä › ð"don't add informaC p about n  n "œ 	að--include-attribute¤ 
– ?tru• 'H  H ñ such as line numbers and '3Èÿ  'column offsetsb
iÆ adent', F=int83ê in< E¢of nodes (°  õsspaces)‡ bargs =ý!r.÷ òAs()
Ö Pwith % p.infile
 :   ö €source =À’ile.read(¬0tre X (( ,O @.nam7@rgs.!ò _ò=z !noå [ °print(dump(f #, ³_³?   ,  %    �))

if __’ ò__ == '__main__'ì   ð()
# -*- Mode: Python; tab-width: 4  
#õ*   Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp? ÓAuthor: Sam R  <) ÿ@nightmare.com>

# = 2€
# Copyr_ ˆ 1996 by‚ %
#  æ  PAll R: ¡s Reserved0 ñPermission to use, copy, modify,J3dis·à this software ¡
# its doc�ááfor any purpos(  ³ <ðfee is hereby
# granted, provided t0them!ve� õ ðnotice appear in all
#! "ieô; BbothE  Ë 
; n_ Eis pø =
# X psupport÷	Ù e     ” ¼USam
#	!no¹0use;€ adverti'Ð or publicityƒ @taine Uto
# f �0of b j>1ðic, written prior
#O Ê.Úð<SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDC  9 xIMPLIEDA ð!OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHG š ð
BE LIABLE FOR ANY SPECIAL; �DIRECT ORûóONSEQUENTIAL DAMAGES 4  ðWHATSOEVER RESULTº ðFROM LOSS
# OF USE, DAð.TA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE; O0 ƒTORTIOUS3 Ð, ARISING OUT@ OS  
#H "NEV ±WITH THE USI �PERFORMAX ÿF THIS SOFTWARE.
# = 2ó8

r"""A class supporting chat-style (command/response) protocols.

This@ 5addE ` for 'G "' H 5 ó - where one side
sends a 'k ô', and the other ! ƒ ð (examples would be
.  @ ¶on internet© ° - smtp, nn f petc..).Ã ñe handle_read() method looks atŠ Áinput streamÞ q ñurrent
'terminator' (usually '\r\n'- Äsingle-line Æ "s," .' 
2Rmulti& Ðoutput), call”¶self.found_n 0() ñ Áts
receipt.
I  ñ	:
Say you build an async� client u� 4 thÉB.  Aô �start
of°connection,R ‘'ll have ˜ ’ r set toÛ °', in
order qprocessO  u @greexð.  Just before issuú �a
'LIST' à 0you  j im H@.  T9? ¼  ? 
> ðwill be accumulated´ j €your own‹òllect_incoming_data'
@) upÐ  ú ¶¤n control k Àreturned to
ŽE- byÙu FÞ q €.
"""
im Â±ore
from co© Sions ! bdeque
 uwarning   
 p(
    ',�hat modulxp deprec6. '*  reEàended replacemC"is– Aio',. D@ BionW‚  òstacklevel=2)



{‚ _/( ñore.dispatcher):T 1"""n m ¢n abstract}€.  You m>qderive Öž1addL º#woêsF
ï!()ˆ– �G #Ë@se aÏñverridable defaults
& ô
ac_in_buffer_size = 65536 ?out   á# we don't wanï!enf  Å 0useåPencodÂ$by} `, beca  tÜ 6P @sign5  `pplicaÖQ bug + p prilentlyÔ Euse_u 1= 0[  ’'latin-1'/ Ðdef __init__(ìñ, sock=None, map
 é ™#7 trÕ d  m1ingp  )  M .bS = b'w  ! @ qa list |!raYð than io.BytesIOó for a few reasons...
  ÷# del lst[:] is faster than bio.truncate(0)4 lst = [2 Ñself.incoming: 
N ñwe toss the use of ÷"simple producer" and replace it withG ña pure deque, whichH ð
original fifo was a wrappŒ %ofB ¥ m _- =N (ü ðasyncore.dispatcher.__init__(B Â, sock, map)å Ädef collect_S_data0   %):‡  raise NotIþ ñmentedError("must be  × in subclass"q _r  · ž�.append(– Á F_getµ ¯ Ád = b''.joinÑ J 5 c	e 6[:]ð veturn dl ñfound_terminatorW s "3<setd  , u j a"""SetFPinput-rimiter.¯  FC+ec‚ixed strYö any length, an integer, or None…5"""àif isinstance(� ,S )ýEÆuse_encoding7 Š  .  �Dytes;  z. ’/elh 2inth I :< 0_ xRValue‘'²`numberµ received b�  ®–positive' È  e á! =yS / m  2E > à# grab some mo�ata fromÆ œ1et,np# throwJ!to 4”or method( QcheckH ñ ™   1if ´`, tranî 3on T £next state3 à ´handle_readÝ “ Å*ryw Š1 = ï Arecv2 ö.ac_in_buffer_size^ñexcept BlockingIO®
U rDu 3 /OS+  y ² e‰k  ± K L 
Z ¾ Â . ÂBstr,÷ Á• "	  + Q  « �# Continurq searchØO ÙV :N îG  while callì> =
ã`.  The�ule loop&#nànecessary becaü€we might¬‘d severalÆ +Ÿ E acombosð a single recv(4096).

  ó
while self.ac_in_buffer:
   �lb = len(( )( Âterminator =T Fget_ (/ vif not   
v  { G# no! ù, collect it all~  0 ¡ $ ï_incoming_data¼ > i = b''f öelif isinstance(¾ o, int)Ä gumericÉ 	S  { ?n = 	žif lb < n_  > ÷ +B û  (   n ø ì M- lbã Oelse¿ /J[:n]G “   — Ã  M[n:]š > Ã ?= 0( _foundÙê ž# 3 casesÂ# 1) end of �‡ matches� exactly? %   íÍ, transitionÆ ?# 2m ¿some prefixf d to th1 h  3h AdoesôÞ O anyn ` ­0_le@ ¢ %Tindex®)W.findÊ;  "f > ^!= -1 BQ# we Š º  .  F� ?> 0P  & ñ	# don't bother reportingb Ïempty stringd B p(source\¾subtle bugsä  .   4D![:’*B +/ Î¥q# This G zPRight Qng ifH ÿ# is changed here.' Ìæ ,ê  Ó# check for aæ ƒ · ¤ 0 = –_Ž~_at_endÅ,!Óià:
              ÷if index != lb:
  ó# we found a prefix, collect up to the J 
Sself.: ñ _incoming_data( ñ ac_in_buffer[:-¢ /])S 8 > = L K /:]K _break Oelse C# noú oit allN  ]Ÿ ý F ù Ab''
w ñdef handle_write_)Ç = ý initiate_send(): Oclos:  2 Apushd  , Îj ðif not isinstance(!  , (bytes,  ÷array, memoryview)A  2ðraise TypeError('D ñ argument must beL ±-ish (%r)',
 ?  2typ‹ )cGsabs?3outŒU_sizeO aif lenÈ @) > 6 Z l öfor i in range(0,0 ,/ ß  4 ’ðproducer_fifo.app™ ì P[i:i+i ™D è  ‡þ Ìd_with_� Ú ¾ r - 7, v }readablp�"predicatƒ°r inclusion_ v8  u se”5()"u P# can�1use¦0old°S Ñ, it violates €claim of E òset_terminator method.2 ¾ # return (ê ›?) <– V–B 1V  Â »!8 i ¦ §rP or (- —connectedèùž_when_don­áautomatically . ó this channel oncˆöutgoing queue is emptyº„ 	Ÿ GNone” 
S 7 ¡Rwhile	L B and ç ÄDirst	; *[0G#jÁ ‚ string/Å R ¯ e entryQ 3fh 
{   2delŸ { 
 * 1if D  C k 
L À        selfÿ.handle_close()
   yreturn
 "# 9 ù classic producer behavior/ ùobs = self.ac_out_buffer_size* Itry:  ‘ ùdata = first[:obs]# ÿexcept TypeErrorA O.morë 0if h =  ‚ » ä  _fifo.appe<0ft(8 <OelseN 2del	R *[0×  x Šcontinue~Ñif isinstance~ ¢, str) andY Îuse_encoding„  ° „ = bytes?  œ2 )o ¡# send the"	|°„num_sentô ? h 
%¸/OS¶uh _eÙ¡ �4if ‚ ü  b < len™ @ or ¦ j)=  “– ¹žy Ì-Ò# we tried to“¾some actual›³def discard{ s(É ä õ# Emergencies only!ê +  º#in>  >%''  Ñ¦incoming[: = 	1±.clear()


@„ simple_% :€ µ �__init__® ,å ', =G=512Å l ß  ¢  8  Á ƒ(  p  - U !if(  .U 2) >fP 
,Uresulÿ 4 ![:? 2 !V ) 4  [4 V 5 â n Ã   h! Z -  1 f  p  Ö  
c ðp

# Given 'haystack', see if any prefix of 'needle' is at its end.  This
# assumes an exact match has already been checked.  Reˆ‡ònumber of
# charactersC �ed.
# forX  W: þ_p_a_e("qwerty\r", "\r\n") => 1# Jdkjf% 0% B 	J °<undefined>-ñZthis could maybe be made faster with a computed regex?
# [answer: no; circa Python-2.0, Jan 2001]
# new p  :   28961/b7old Q18307 Àre:        1ð2820/s
# regex:  ð$14035/s

def find_prefix_at_end(haystack, needle):
7 ƒl = len( A - 1 ôwhile l and not ? “.endswith2 C[:l]K O #-=B ðpreturn l
"""The asyncio package, tracking PEP 3156."""

# flake8: noqa

import sys

# This relies on each of the submodules havY òan __all__ variable.
from .base_events ib * �coroutine 0 �exception0 ^futurG Mlock, �protocol mrunner Nqueu[ mstream- �subproces >tasŒ nthread, xranspor3
a7= (T. +N 6   Z  ` f  l r x ~ „ Š �  – œ ¢  ñ#)

if sys.platform == 'win32':  # pragma: no cover±%}windows( Ïá*= ' z R
elseeN LunixK � _ 8 \ ³4ast _ Fcode “ncurrent.& einspecD  dZ 4ing+ Ttypes “warnings
3C_ �

class AôðIOInteractiveConsole(  . 1):
€ Åð__init__(self, locals 'opr…super().. ( )G  © > „.compile òr.flags |= ast.PyCF_ALLOW_TOP_LEVEL_AWAITŽ G @loop12oop  ¨ 0runÎ §   Ÿ \ = co…!.F"()K  e  O —callback(F   Âglobal repl_V ã   _iwfruptedc  , D y = NoneK  D Š = FalseL qfunc = P.Func
2Typã!, ” … 2try    "0 = U (Ãð    except Syste‹mExit:
  Yraise ÿexcept KeyboardInterrupt as exB  Äepl_future_i- Šed = Tru[  | * R.set_j yion(ex)„  ) ireturn 1 a BaseE¦ ?ion— h 	i ðif not inspect.iscoroutine(
 )o bresult) 	V Ö 	 >tryQ rWÿ	 = self.loop.create_taskc ‹ ƒs._chain›(P ", # 
t]cž A Æ5c)
Ú ® ÷all_soon_threadsafe(callback- þ© .S± ­ _SysteÚ 
Ö- 	7
Ó 7if  Ç
(  Â‹�write("\n'6\n"§  0 OelseF �showtraceñ()


class REPLT0(7Bing. "):b€def run(Ž �H¥banner = (™ •   ‘f'asynciop ò {sys.version} on Ïplatform}\n'B  ðUse "await" directly7“tead of "c .¬ ?)".F ñType "help", "copyright ÿredits" or "license" ‹ °for more in± _ationp ð{getattr(sys, "ps1k À>>> ")}imporî
j ² B�console.÷>actd= ,A�exitmsg='	 Cing /’F...'Kkfinall)ô warnings.filter ˆ Ž'ignore'ƒ °message=r'^Ûåá .* was never ß?ed$=  òcategory=RuntimeW� '
 @stopüðif __name__ == '__mÀ"_'> , $ ="°.new_event_ ()?˜  " ” ç¤locals = {$':Y }¥ M keË4 {'–  ',• Ÿpackage__ �'__loader  -  @  U  3 °'__builtins   , 0filV }ï  ) ­ ‚[key] = » !() †@ = AÐ!IO³ðactiveConsole(reüpl_locals, loop)

    repl_future = None ò_interrupted = False< Atry:.  I ñimport readline  # NoQA  �except I# VError8 BpassO ‹  thB � = REPLT !()E  ×.daemon = Tru± = s.start(á Qwhile( t 	¹  ½  Ã.run_forevers   ¼ ”KeyboardIN  & )ifJ`and no^z.done()7  ; Ø ‚w.cancel~  !   % � '   ccontin  Jelsew ñbreak
"""Base implementation of event&g.

The ð< can be broken up into a multiplexer (the part
responsible for notifying usj 2I/O] 0s) 5 9 ~ û proper,
which wrapsk �with func¼ Qalityh pscheduli ðcallbacks,
immediately or at a given time in € Œ`

Whenð a public API take† X �, subsequ4BposiŠ P
arguV`s will4 ëQed tog @ ð  if/when it is  ñed.  This
avoids0 …prolifer¦ö trivial lambdasÈö ölosures.
Keyword �  ‰ é  k  A are¯0supÅ€ed; this� ða
conscious design decision, leavm  M ‘door open€ku ¡
to modifyÍ @mean: !of  X Ž € itself.œ#

SQcolleàs  F.abc ’ncurrent.Å1 "5ool Theapq8 Xitert o( dsocket) 6sta …ubproces, 4ing/  V @racen %sy9 0war …eakref

©Cssl
‘M mñpragma: no cover44sslÖp
from .& ¨ Ö]tants |routine – Ù<ion 
u `protoc†
 1ssl Œ ›staggered Ltaskq Ptrans½  ÃB 4log lo\ à


__all__ = 'Eüð
Loop',


# Minimum number´_] Ëð imer handles be?Ð cleanup of
#/ecelled& ÷"is performed.
_MIN_SCHEDULED_TIMER_HANDLES = 100
… 1fra	‡ 
 thÙðre cancelled
# beðšfore cleanup of cancelled handles is performed.
_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5


_HAS_IPv6 = hasattr(socket, 'AF_INET6')

# Maximum timeout passed to select
 ðavoid OS limitations
MAXIMUM_SELECT_’ ð OUT = 24 * 3600_ ñ Used for deprec< À and removalü ðJ`loop.create_datagram_endpoint()`'s
# *reuse_address* parameter
_unset = object()


def _=2at_R( ‘):
    cb k¡._callback �if isinst’A(get>ócb, '__self__', None), tasks.TaskX  \ #ñ qmat the" X   ô return repr(cb.P )! Belse� + 4str¹ Ö spipe(fdx ý	if fd == subprocess.PIPEQ  '<9 #>'s 8 oSTDOUT:  estdout< ¯  Ú 4fd)¬ Aset_¸Aportƒ° >not�ÓSO_REUSEPORT', ñaise ValueError('W _X  J 0sup qed by sì� module'_6tryá  a  3 @.set "op¬ ãet.SOL_SOCKET,V .£ 2, 1^  C ‘except OS¢ 
_ rÀ '", ­ c  '’ ` defin!utÀimplemented.ó ipIÀ_info(host, >ð, family, type, proto, flow* Ó=0, scopeid=0�P# Try%Pskip /0ddr- P if "[ "Ëð
already an IP. Users migh!veŽ#üÐd name resolum0 inL±ir own codeC «  ) �ved IPs.J !ifû hû™inet_pton[•
9 ô ? @in {ò MÅ.IPPROTO_TCP ‘UDP} or \E ¥ ý  ü  ,ro At  n½k  qv_STREAM8 ˜ =†{ 1TCPu Aelif¶H ?DGRG $UDG Ö  Á ¬  (Ö  6= 0Œ E  ‚, bytes)º0ort¨ 7b''á  C 
:strA @ È A# IfáÂ's a servicefülike "http", don't ÊT Ö6 Ú 0 = §  B(Typ±ð , ValueError):
  Ðreturn None

 ñif family == socket.AF_UNSPEC:#  ' vafs = [! UINET] Æif _HAS_IPv65 9 Š.append(= !6)> Felse2 g ’ ]¢ öisinstance(host, bytes)8   0 =  â.decode('idna'e ‘if '%' in" 7 ð# Linux's inet_pton doesn't accept an Õ ñ zone index afterJ ,Ã  ç õ# like '::1%lo0'. r`for af� 6afsŒ 6try  S /š A(af,v Ô  #   Q# The ö has already been resolvedŽ  2 ­@ andŽ 	ý ÜÇ 8 Ê  ‡ ótype, proto, '', ˜úport, flowinfo, scopeid² 
ó Z   ^ K !ex¡zOSError<Bpass>0# "s" is noÐ‚ addressz ð
def _interleave_+  Í %s(
 q, first Bess_¯ƒ_count=1—E"""IF � list ofy  N £ tuples byA."""4q# Group* 8ess$   † 3_byz ò = collections.OrderedDict(/s1ddru0ddr‚ {À ! =t )[0×  ;!in! = } 
yž  [C ]@[ ) 0 # À  
 w  H Š  ‘Ž ¢.values())ÿ2reo~  ò¿F > 1Ò > @.extÃ‰ _[0][:R - 1]Â  â7delA Â sA öŠ   V !a Þ Ûðitertools.chain.from_ Uable(2  6   + Ûzip_longest(*à ¼ d) if aE + <Ÿ "

Aó
run_until_complete_cb(fut!ifŽPfut.cØSlled(    `exc =  ç3ionÌ  7if ñexc, (SystemExit, Keyboard�Wrupt)[  A ð# Issue #22429: ¯ •forever()Dùfinished, no need toF’# stop itI Z   * ñfutures._get_loop.7 p()


if¶Cattró , 'TCP_NODELAY'¸ •±set_nodelay-   r 1if  .là in {socket.AFñ_INET, socket.AF ‹6} and
   % „.type ==2 ¿SOCK_STREAM4 Wproto5 ÙIPPROTO_TCP):g c 0set @opt( 7et.1 ¬ òTCP_NODELAY, 1)
elseM ñdef _set_nodelayF i ðpass


class _SendfileFallbackP­ Acol(¶ Tcols. D ` ó_init__(self, transp   7òif not isinstance(# + ÷orts._FlowControlMixinA  E òraise TypeError("D íort should be E  s %")\ ¦ &._? =² ! ó   Q.get_  M ‚ ö _resume_reading< $is (: Iwrit: s f_pauseˆ¿ . ]    ùµ  ø  0if  *._¼ ‚ = x  )   Ý sy_fut =A l ðort._loop.create# 7ureñ • T   X QNone
�`async eQdrainbÅ „ ·is_closing()  n B£ConnectionH  9 §ed by peer3ï §  _ 0if ' 0is ¿ 
Aereturn+ Pawait. å  ß c— Q_madeé  Ë Ç dRuntimõInvalid state: "j  ™  "k :ð	have been established alÉOy.")§ Clost§ 7exc¡ •*1 isñ# Never happens if�C dis­ ±s after sen[ùthe whole contentò g# Thus? 0ion~ ð always an excepð from user persp)veN  if/  @ º  \Æ.{f (Q  5   z‹-isŽ¼ = N  Œ  ®� 1 $.lAion_Ý) *  ¢k Ô \ 8 ô* P  ._^ c!¥ ‚ H ¦ Ày_fut is NonGe:
  ereturn ÿself._write_ready_fut.set_result(False)0 � = None
& ðdef data_received(d , )Œ ðraise RuntimeError("Invalid state: � öing should be paused")j :eofi c ;`async Ó qrestoreÍ d  Ü ¢._transpor:�protocol, !._ B2if 5 × hm}6ing! ´) ^  ”, (U  Êq is notŸ
[ ñ# Cancel the future.À x   ð# Basically it haJ ° effect bec‹ Ü 0colh ëswitched back,L tno codeÌ€wait forZ \anymo~ ú Î !.c³ ø 
M 8 M² .I( ò()


class Server(events.Abstract &):x�__init__äõ, loop, sockets,ñ_factory, ssl_context,!:log$ t'  handshake_=outo n ! =u g1‚ $ =Œ   ûactive_count = 0  —‹ers = [] 84colÓ - =æ 2  Tlog =ð    ° !(  2  < 0ervC!= È €_foreverûËc__repréŠHR f'<{{_AÄ__.__name__}„=" œW!r}>'IaattachH_ dassert*X eÍÊ 	ØG+= 1a /dea 	? >	 -^ ­5   Í	# Ž== 0 and¿  '
ˆ=`wakeupˆ Z  p_    ¢  #._  Í T    q B in 
 s� !if0 g.done(~  E    ' ™‚_start_s�ß8  
… \Ô * u = True  Ô  Z Ò ð sockets:
        ñsock.listen(self._backlog)
    ùloop._start_serving('  . + ðprotocol_factory, j ",  Ïssl_context,A ) �   8 ñhandshake_timeout)
C €def get_¥ Ë !):  ” creturn}  ! 3 %isË  œ 5 ï 8 ‘@propertya  y  Ý <etsx #ift   † is Noneš ž (s° €tuple(tr> ô.TransportSocket(s) for s iÙ  ' 7ets\close• ' * =œ Ì  �  µ c s¯ 	/  6&._U  à ' M £ 1ock¦ V 
ý ?  ” Z&opŽ3ockË  I ( ‡† = Falseh 1if è .@ À_forever_futÈ 1not{E and¼  Y     	a > w.done() 3 / gcancelÎ/ 
! =— 	Ê \ ÿactive_count == 09swakeup()aasync ‘	¥ Q À    nÈ}°# Skip one —ð	 iteration so that all ' Å.add_reader'U0# g( erough. þawait tasks.sleep(0µ Derve{Ïµ  —¡( á
&�raise Run-^Error² f'S @er {0!r}0 alØ �y being ¾ 0ed 	¥ &)'9¢ é G  ’ � ¼#d'%D	Ú~  ¼ þé²`create54ure8 ^ :try© ô $îtÚrexcept  aions.C1ledq
V g  | ¼ ñ 7  ˆ  D_( d) kfinallÂ  > ¬ ' ~ 8œ\†  < ¥
 ª¾ = /er[, ©À ä    ‰ "._2 ’s.append( $Àawait waiterð	


class BaseEventLoop(e
 ¥s.Abstract ñ):

    def __init__(self):     û._timer_cancelled_count = 0( ëclosed = False �stopping üready = collections.deque()I acheduli +[] üdefault_executor = NonŒ Éinternal_fdsÈ ð# Identifier of the thœ P runn¿   S‘ loop, orb ! i. � &# % t is notC $ ^`  _i9¬  Àclock_resolu0 = �R.get_ öinfo('monotonic').. l PexcepF _handle ò	set_debug(coroutines._is v_mode()—Q# In 0   , „0ionJ a callback2ba step Etask§  # £ Àed this dura® Á in seconds,”EslowQ /B  dulogged.M ` + _| _R Z= 0.1* ’_current_; l p_factor¯±4€_origin_w’king_enab¸!l8 ´saved_depth• º Á# A weak setPöll asynchronous generators that ar@# beÔ it# Qed by_ ÚG_U 0gen1 q ·ref.WeakSet£ñ# Set to True when `N †shutdownH `³ ™³$ _7 ) =p w ±/orv v0Nrepr0�return ()  A  Af'<{‹!__ Ä__.__name__}=" 3is_h[()} 'G `+   * ~   F()}>C )îÜcreate_futureóA"""C  A a F" À object atta| ß Ø5"""¦ þ X "s.> (' = ‚  M€  , þP, *, =W‡@"""Sz Qule a+ u•™ .Ú  kR€ a Z      ¬  ‘ p._checkG7sedÆ2if    G î!isê T  "  “‘asks.Task4,ö Ò  × 3 :  1±ask._source'e!
a  + 1delÒ , À[-1]
       ‡ else:
  Ðtask = self._ �_factory( }, coro)2 bs._set0 Pname(:  ,  %)
. preturn   Edef 8 
h  )ž �"""Set a@    ñ that will be used by loop.create” 2().q  é %If= úis None the default^ Y ?setB õ a callable, it should have a signature matching '(§ R ', where ' 'Ò áa reference to© eactiveG Qeventò 0, 'ž=   õutine object.  The± E Smust Ÿ@a Fu² . 5""" i>2notB@and  ( À |ðraise TypeError('�† b7G 1 or` 's ‡
š$ =B å VgŽˆ ¾� B"""RŽ
P,r 1 ifn 'Pis ine.7˜ Ž  _make_sock— �ransport”  ,  ð, protocol, waiter=™E, *,z @  Sextra. Cserv; 
ì Ck Det t‚ 
È œáNotImplemented¦È 5sl_C (   \, rawÕ ªsslcontextá 	> 2*, Â µ_side=False @hostPë 	8 
; ssl_handshŒtimeoutM   {ÿ_connection_made=TrueR?SSLO-‡datagramTGD	ó 	 ’  addressÕ 
H#Ç „ Ì -�read_pipeÍ   æÚ  À  x  c Á -_writeÂ BÃ z Ä (PasyncÆ nšubprocessŒÀf, protocol,ÿ  args, shell,
  Ñstdin, stdout Ïerr, bufsizeI ðextra=None, **kw� %):‰ õ"""Create subprocess transport."""+ ñraise NotImplementedError
# ðdef _write_to_self( 
l W  ° a byte to " `-pipe, òwake up the event loop.`  :ðThis may be called from a differ3 ithread5 Ý ôclass is responsible for iÏ 1ing{ • .Ù  y J_Æ s	,Ó Z_listPw‚selector) s}Ácheck_closeds g !ifl.  Þ ÚqRuntimeÓ5('E€ 4U "')‹ën ÿdefault_executorx ! ¢_shutdown_ÁŠ [  : “ has been	— ñasyncgen_finalizer_hook˜ g, agen ê$._3 ¡s.discard(' ýbif not@#isB(G  DK  Ó b_soon_†Asafez !.ceR_task† !.aT(()TŠ �_firstit½ 
Ó6 s\�warnings.	 (Þ  ½   !f"H àhronous generaŽ{à!r} was scheduyfafter  D   !f"µ­^!()°"½’ResourceW¢ ",  =T Z   ®$adªÍ ¿ E def)|  < ²C"""SˆÁ all active C 
Š J † tr = True) ¶ >2len
• �  ) ð# If Python version{ð<3.6 or we don't haª )ny®  F   #¾vs aliveÊ   freturn£  Š@ing_é@s = £­ b w.clear(¨`resultI `await õŠs.gatherxE*[ag	�iag in ‘ ]1½ À_exceptions=p  Ôƒ j Q Bzip( *s,^ …Óif isinstance3 4, Em .  Mù“ À_handler({
   ð'message': f'an error occurred during clos ^of '
E 	 ÿf'asynchronous generator {agen!r}',C ÿ'exception': result) `  ge(  S N 1})
 ( ñ def shutdown_default_executor(self):/  Æ õ """Schedule the9 1 of @  @ E."""=  L .[ _u Õcalled = True. 2if 1 T 9 † is None–  š ereturn> ‚future =D rcreate_ %()& Pthreaz 	 Qing.T ƒ(target=‚ o­ ‚, args=(K ,,)L h.startc *ry© bawait @ ‰ kfinall* • c.join(³ ­&_d�  ,N ¨tv É ß.„(• =€Ñ  V7   b_soon_’ CsafeS.set_�•? ¯$ E¶j as ex_ I xion, exÑcheck_running
?%is"   Ü àraise RuntimeEØð('This event loopk al$#y h 'â "if+ @s._g‰ _9  (); 1not
õ x   ˜   @'Can> 1runX“ Õwhile another¦ ž L  (¯run_foreveÇ@Run û bl stop°  é/ed´ j æ'edÜ¿_ �   !ôcoroutine_origin_trackµv._debugXW l*_iŸ i@idencê  .@old_ê`_hooksõ0ys.* â2gen œ !ys»! “firstiterù  J x Š  Ï/izH 0nal H ó °ñ0s._?[Y 8  p  ¼
h   . .W_once    '_NpingD  ' Ubreakpß ®k G v = FalsÏ F # Ù ÈW  # ø  * 
ø N  !`„ 7 
ûÀn_hooks(*oldñ(_agen_hooks)

    def run_until_complete(self, future):*  . q"""Run - a the F" ’ is done.T  * !If  €argument" áa coroutine, i ÷wrapped in a TaskB ÿWARNING: It would be disastrous to call¾ )± Awith‰ Fsame€ � twice --ˆ ]  ‹   ein twoA `differÂ  Ÿ ðs and that can't“ Ggood· aReturnt õ's result, or raise its exception.m 5"""  ‚ö ._check_closed(×  ƒrunning(Ñ }ãnew_task = notÇBs.isÑ( O  0 = 5 ’s.ensure_ - p, loop=y 8 4if k $ � F# Aná  ýø 2d i[ @ didEv@, so9%reM  is no needö0log& @ "de‘y pending¾ Š" messagC p c._log_6 _6 v= False»- @add_Õ_fnback(_)6_cb:try ..5 wforeverÂþ
/ Oh‰  … !() Î€.cancell
F 3(Thï~ua BaseEy� ConsumeO’ 9ion}N !toI zPa warq,6  per doesË¡have acces¡*thˆN Qlocal®û    ô � 3  É ¡ kfinalluB oremoveÂ ‚1.y
^�   R°meError('Ev   A stoÑ beóá7d.'¦r*°  $Æ — L ‰
�@Stopõ „ƒe ‡QEvery! »ð already scheduled will st õ
run.  This simply informsiÄ ‚ š  v`after Ý<o iteraÙ C p? S= Tru~ ö ì÷  Cð ¾ aclears% Rqueue¯@shut w–•executor,Þ 1butÁä�wait forF ,  õ gfinishc c|Q mustB $beŸßÚ1if  isQ Ç(âæ
e@"Canþ$ ab  � "‰b 9Àed:
        °    return
   õ if self._debug:   qlogger. Á("Close %r",2 )+ @ c ‹d = True Ìready.clear(8 Ÿscheduled  ýexecutor_shutdown_callej ( ! =Ÿ  Ñ dfault_ ” 4if  Ê is not Noneü Õ *deD ! =+ K  &L .¡ Ñ(wait=False)
+ rdef is_#([ )n A"""R”s;ò if the event loop was < A."""R  y Êî   o q__del__m €, _warn= Pings.	 ‚ !if ˜ .§ !  n C R(f"unk ¡ {; ò!r}", ResourceWarning,  =" û Q v 0run1 (w  *  < .v (Q4  ! 8 R3is < R5@._th¸8_id&� Atime+ { Ä " Ñ according to Ú'Ø2ck.¸ ì @Thisp ð!a float expressed in seconds since an epoch, butZ   precision,… ñuracy and drift are unspecified 5mayE §differ perë. Š  ï ¨.monotonic¬ ³a_later1�, delay,  ðback, *args, context=‘
WÕArrange for a9  T!be  Ã ¡t a given Œ Wb  a Handle:=ñopaque object withY õncel() method thatô €can be u�Pto ca,  z� 	Æeã  $  3 ’an int or×,Ø….  It isp ð always relativeí  @currä AEach‰  RP willz  cð ed exactly onceh @f twÂ  ll. s 5re “m:  z Asame[õ, it undefined which· { WfirstõAny positional arguments afterO ˜ Æ !pa%toe  �  Ü ' 0hen’ !is/ed¨ 1r! = 1_at‘. B() +¶™w  ¤ ¶ è Ìbimer._`_trace³   N 1delW)  E[-1]~ ó ® rÝ [Ê g, whenÁ À *args, contÃext=None):
  õ""""Like call_later(), but uses an absolute time.
: A ñ corresponds to the event loop's= ¥() method.E 5""" õself._check_closed() 2if   VdebugÀ  Ç  9 Xthrea9 !  é Tback(	 0, ' F_at'o  ì 2r =Ä ñs.TimerHandle(when,0 G q, args,� –, contextH !ifú ð r._source_trace9 
Ã ?del) E[-1]`heapq. Rpush(ú ¢scheduled,D  Ç %._! u = TrueO breturn6 Ú1defÜ Q_soon` ì *í ç L ÑArrange for aI  ì  bd`ed as ]   xpossiblW°This operat€õ s a FIFO queue:S Es arR  inqÖ àorder in which y. õregistered.  EachN v will b èed exactly onc¤ àAny positionalÀuments afterq Z ¥ passed to§  $ h " Va it is; e$ƒ ¸&h! =þ ._Í 8 
  × 1™2if = * 	Ë, ÌP0all‘ Ò‘õif (coroutines.is 2E) orÆ `  ' 	4 @func&< k  7 ýraise TypeError(X &f"Z   cannot bež‚d with {Ã I}()"` )  ˆFable 
w~ 'Æ E ÷ object was expected by� >, 'À `'got {Š  �X!r}')Ÿ x Wš	k6âœ—a s ‘A y6 i  ._v’y.append(b Žœt³ H ç @"""CR thatS0urrR0  * B qrunning) yð .

        Non-òthread-safe methods of this class make óassumption and will
  ÷likely behave incorrectly when the ? Õis violated.
D ‘Should onI r called@ ò(self._debug == True).  The( Er isI ò	responsible for checkingÇ QcondiÆ   õperformance reasons.I 5""" 2if … 3Å_id is None:$  ereturn . "=  õ ing.get_ident()* iw Ž [ ,!=n f õaise RuntimeError(I  †   R"Non-t áQoperaú `invokelö an event loop other ö  H   B"thaÇ@curr/ Rone")½1def†b_soon_r  R¶, ðback, *args, context==)Ø b"""LikÑK s(), but8Ä .“�Þz_closedO  5f  Î  9 0allž (p 	 0, ' ‚ Í 'ªthandle £. C 	é : 2if = à._source_tracew 
¢ ?del* E[-1]íË �write_to_ �J ­ó run_in_executor¨ c, func®  \ #._6o.d '‹ f4if ’ j ‰udefaultØ % ô0# OY¿ U •3 	j  be,IusedA ÿ 7 j s l »  % ¿ 3conW¡.futures.T™TPoolE¦	Ž  B   ný_name_prefix='asyncio'1 ‰ ;   Õ Ï % =D K  Rwrap_ 
z× ‚.submit(èú!),e=u ;Lset_‚ “†Ðif not isinst·(r YHL  �warnings.	 
Ë   0'Us,0tha‰ � 4an ‘  A|'Ò ×`deprec
Uÿ  be prohibited K  õ in Python 3.9',¤ ±   DU BionWß 5, 2ýÀ self._defauält_executor =  ñ<

    def _getaddrinfo_debug(self, host, port, family, type, proto, flags):J  N  msg = [f"{; 0}:{< U!r}"]# #ifK : : ¢.append(f'l "={ U!r}')- !ifƒ >  ¢  ={ : · ;   !={ = fí =   !={ 
= Ö', '.join(msgÑ rlogger.xP'Get Œ@ess �a %s', 1 Pt0 = ¢f.time(K  9 5 —= socket.Ú(“Îg *dtg R - t06²@ = f² Jting¶ ô{msg} took {dt * 1e3:.3f}ms: {¨  &o sif dt >Ú úslow_callback_duration~: ò 
SOelse+ eN Ã   areturn¾  I à QasyncA s
%*,¿  L 
 ¾"=04  X 	 $'=0:"ifÒ€
½ „ T_func“´Š þ A ö  ¿ Bwait’ erun_inB(h  / hNone, ` 
!6t 	j@name… Ä +,h	0¨ " Q j ,)e )—  4 —_sendfile™  ,  €, offsetÕacount=	$ ( *MÙ_=TrueA and   Ç ëªout() != 0!ñraise ValueError("the: ö	et must be non-blocking"4 Õu._checkç €_params(ü 
è !, æ ? ;tryŒ PA_G \ hnative\ .
: x� rexcept  cions.S¼²NotAvailabl&0 as( 
¿ ƒif not fz
  € l² ‡î I ð ,î € ;t ðnative(self, socók, file, offset, count):
   # NB: send( ÷ syscall is not supported for SSL sockets andD �non-mmapm –s even ifW 'isK Uby OS= óraise exceptions.SŒ õNotAvailableError(4  ¼ $f"¬ ½ µ a6 µ ±   { Y!r} "F A"andµ   {  ! pcombina� 1")
. °async def _G _r ñ _fallback(self,q#ifŒ„Ï ’ile.seek(ª)y   Êblocksize = Amin(Ð ×önstants.SENDFILE_FALLBACK_READBUFFER_SIZEZ  ^ "if� else coG   P õbuf = bytearray(º # Ptotal@Ut = 0D :tryªwhile True ³    u 5 = !6 - z %, $ ™  ;  &if" _ <= 0j  / UbreakÇ     @view Pemory u(buf)[:x ]3 Ðread = await Nò.run_in_executor(None].- `into, ] Å !if¾ ' » · }  # EOF‹ „ î@all( r  [:[ ]y e@ += % 	^ greturn‹ kfinall'if+ @ > 0v� hasattr(°0, '4'Ñ €    Q' +M ØÒPcheck“_paramsÑ1'b'qhin getž œmode', 'b£ ÷RValueÝ"± ð should be opened in Ž0ry K "sä •�.type ==€êet.SOCK_STREAMÿu Wonly 0  K  U å&re¸
| x' ›
j ž 1isiQ$ce©i~ ©  ™ 3Typ   "t @must!òa positive integer (got {!r})".formatw )7 M ôÜ� ›Ž G'þ,Ó Õ— $"< Ð must be a noÿn-negative integer (got {!r})".format(
   …offset)) 2if  U < 0:  ; þraise ValueErrorR "; Ïmust be a no� 1‡ õ,async def _connect_sock(self, exceptions, addr_info, local_ vs=None)Ø ó"""Create, bind and ^ P one b aet."""„  6my_m U = []  ‰.append(- fòfamily, type_, proto, _» Vess =Å ^  Œ 0 = Â  6tryÍ  ž %   2et. (o = v ={ =� Ÿ I ú.setblocking(False$ -ifaq is not¦ 
š  U 0foræ _ì @_, lš= inG ;  ? î     ì .Å(V 
ª %   UbreakB   À1 OSà0 asW‹  3 nmsg =    0f'e,ò while attempting torOon '� B  % {Ù O!r}:3 �{exc.str} Ÿ.lower()}i .Texc =(W ¯errno, msg6 	ø>exc2 Âelse:  # all%�s failedŒ
f Jpop(` `await !
8(+l
3 areturnøy 
Š ýð !ifY $ � k.closeÎ ô • 
�` 1a lc::ionï \Àñcol_factory, hostlS, por [ ×c*, ssl$ š9=0,# –�=0, flags	  3 	) æ € server_† Bname 	3 ÿssl_handshake_timeou§ òhappy_eyeballs_delayO lRrleav` V£ çSa TCP“ %.
† x0 a §!am@rans0„2ionB Rgivenr ðnet host and
     ó   port: socket family AF_INET or . ó
6 depending on host (or
  @ ãif specified),D õ type SOCK_STREAM. protocol_factory must beP ða callable returny a8 µ instance.
3 õ6This method is a coroutine which will try to establish the connectionN !in ñbackground.  When successful," f © 5s aE `(transi,» u) pair.$ 5"""  ?`erver_a@nameÊ Ðnot None and  Essl:4  �þraise ValueError('sG €only meaKæful with ssl')D� } y R# UseÀas default f?
� P.  ItÍ @an e£ 	À B# ifF €is empty‚ë  et, e.g. w}+an8 ƒalready-Â$edt was passedK = aøF ðis given.  To avoid tO« ‘, you canQ ; ib='' --= p by† *ÔB ‘check.  (ÁAalso¦hs that›a numericA òIP/IPv6 address, weì0attM ðbverifyS [exactD < ;º ñprobably fail, but iÃPpossiš+toF `create{pertific  aFc IP© Fso wô ÊÐ# don't judgep ihere.)h !if O
 A 2You_Kset ¯) 'Z  A  '= us‚"ss8Qout a²'œ ` =% 
aðsl_handshake_timeN !isÕ kýè¾ /'s^ þÿðhappy_eyeballs_delay¸ � � ‘interleav   
‰R# If 2P  P ,$7to F @es bp Œ	Û + 9= 1O 	¡ !orã 
ž  å?ock!  H	�  "   '~ /á� M) .$beõQed atsÓ óu I Àinfos = awai¦ýlf._ensure_resolved(‚ (~ ,î #),Ã=Š,- àtype=socket.SOñCK_STREAM, proto= �, flags= ç, loop=self)
  Ùif not infos:  % ðraise OSError('getaddr- ù
() returned empty list')
D �if local_7 1 isl NNonek l# _[  s = await ¯ ù._ensure_resolved(b  ¦   g ’, family= ,/ ïtype=socket.SOA: OU ‘ Yl× ô  ( c  7  ?elsM q˜Ÿinterleav?  †_% Â ( &,  õ�exceptionÉ)[]Fðif happy_eyeballs_delay ¦ ##3Rusing:  : 	X  @for n   ? inÔ + >tryk      ƒ€connect_ € 9   ý ,� ', 
 3  ]breakÖ   U ˆº ‰continueE "O  # E â f, _, _¤taggered.s
 __race	ò(functools.partial(ÇD• ë  ú  LO)w ‘	0	O0if $²³ € = [exc � 0sub”     jin sub'  <6en(2 o) == 1þF, .[0Q 		Ì  g   ð# If they all have Ò same str(), a Oone.B qmodel =. 	† ï ifj (\ 1excÙ B G )ô  º — + ø  ( 1# RËqa combi¶§1 soï Àuser can seeŸ é #+ �various eŸ messages£ D–Multiple µ Ï: {}'.formatU Ã ‘', '.join7Àexc) for excó in exceptions)))

  Uelse:   ëif sock is Non  ! ùraise ValueError(?  "   ñ'host and port was not specified "nol  )')M Œ �.type !=- êet.SOCK_STREAM¼  y ô# We allow AF_INET,	 6
 ÀUNIX as long Itheyv F Gare i .#  aWe supà ppassingj `  Cÿets even though we haveI  ða dedicated API for that: create_unix_connecÄ� 1Disö † i| ÿis method, breaks backwards‹  Þcompatibilityh ýòf'A Stream Socke ð expected, got {#G!r}'ŽPtransPó
, protocol = await self.__4 
ˆ ^ F ð_factory, ssl, server_£Yname,ÿssl_handshake_timeout= ® ª¡ Zdebug–“# Get theÀQ from ¼ Ö because SSL  Zclose¦#9 4oldM  cqs a newD  ÿ *etØ  Ö=^ ò.get_extra_info('4 ƒqlogger.× S("%r {úed to %s:%r: (%r, %r)"J I  ^  , s,,Š ¨Qoreturn$ ½¯async def Aelf,8r 

1&7Ÿside=Fals9 E"):µ   Ñ.setblocking(J ú ¥ (  Ber =w_future&  —*sl�Ásslcontext =ãñ  if isinstance("`bool)  2	Ÿ}  _m) ! 
Œ÷ vˆ† ", Ì <§p À=  ]Ð~ Ô! þ 
;à xû äŠ äí á ä:tryZ ä( n´
) ƒ .ì è ŸlÀ     return ÷#transport, protocol

    async def sendfile(self, 2   ñ, offset=0, count=None,D  H  õ*, fallback=True):*  """Send a X 6 tok .”  L ðReturn the total number of bytes which wereº t; ôThe method uses high-performance os.í × if availableD › òmust be a regular² øobject opened in binary modC 0à tells from wh® ñto start readingä  p æ. If specified[o1 is) Eõmit as opposed tov ñ m   until EOFZ ðreached. File position ¥updated onK r›por also@casešPerror � Ú  %()B 0canXu¤ ± figure outã ê6 U òk@ setQ rb makesà io �manuallyy@ and9d_  k ­  §y@plat5Ð does not supE§  R0 usyscallI ÷(e.g. Windows or SSL socket on Unix)k`Raise  N DNotA�EOfo ]ystem‹ v � á •is False.0 5""" 'if„·is_closing(¶ ”rª R:!me� 4("TY -8 "ê · = getattr(U$'_² Æ_compatible'ö q  ´constants._+Mp¶UNSUPPORTEDv !if�“ 8 › p å  (     $f"¼  c fed forM% {ò 7!r}¢ ªTRY_NATIVE¡ :try  ’ ”`await Á._hnative| ij O  Ôp / rexcept  Tions.¨Ó as( Æ 0if M¶!  i ¡)4 
,  ²Í p  Í0disd?:' 3      9 �   #f" ²	‘ ´+À offset, couð#nt)

    async def _sendfile_native(self, transp,  ñ, offset, count):C  G óraise exceptions.SM õNotAvailableError(4  8 "u ÿ syscall is not supported"© �fallback« #ifÆ ¾  Š  à b.seek(ä )¨ ñblocksize = min(ü ², 16384) ifR else : õ uf = bytearray(J ] Ptotal{Ut = 0: ”proto = _HFë P Bcol(˜I *ryÑ ªwhile True  í µ    § ñ 6 - ¬ %, $ ‚  ;  &if" _ <= 0j  / greturn]     @view‹ Pemory u(buf)[:„ ]3 Ðread = await Éò.run_in_executor(NoneÖ.- `into, ] Ñ !if“ ' Ç Ã }  # EOF— � Ý~.drain(n Ùp.write(‘  [:z ]*  <0+= % q kfinall'iffð > 0 and hasattr(0, ''Ú �     ' +M 
œ æ �restore(Æ™start_tls½Qort,  õcol, sslcontext, *,Þ  �  ÿserver_side=False+ ‘hostname=Y ñsl_handshake_timeout4 "£"""Upgrade-²ort to TLS.e ¬ RçXa new( That *ò ‘* should e using� Åimmediately. 5"""  if1 B Ö 
«¡0RunÅ ‰q'Python4 `module;  }a²'· Á ¸isinstance(ž‚ssl.SSLC® ; } BTypez ²     &f'L  … €expectedGdbe an u ! oå l ?, 'P  Vgot {U ?!r}Ì  1getûs|!'_{ ™á_compatible', XØ [ % { 0!r}å  jç2 byõ z (()­  ÄBer =È±create_futuW ?  Dssl_G , !sl  )4Àl(
         ÷   self, protocol, sslcontext, waiter,
  Óserver_side,  ‹hostname* ÿsl_handshake_timeout=s 
9 õcall_connection_made=False)
Œ ð# Pause early so that "_ Í ÷
.data_received()" doesn'tE ðhave a chance to get � ›ed beforeT ˜ E()".O °transport.pœ —_reading(· # Dset_ª (· )P 0conü Q_cb =©.š Y_soon2 .• %, g M oresumeL . .% ¹ 	¸ %y:˜  a" Áexcept BaseE :ion7 k fclose(   U ñ  .c‘l  Ÿ /cb Faise#`returnÒie._app_… , ðasync def create_8êgram_endpoint(&Š_factory· Á  ølocal_addr=None, remote *M ƒfamily=0¶ 	 flags=0C Breus~  ess=_unset•    À¦ ×Ö  ò allow_broadcast= Q sock )A"""Cc c »E."""s !ifA € is not 6G  y ! �.type !=. Úet.SOCK_DGRAM/  3 rÅ ValueError(n    ðf'A UDP Socket was expected, got {Ú J!r}'¼Fif (è8 orå? orm Ì -  	 Ì0 ¹ £ + yiÍ  # show theãòblematic kwargs in ²}ion msg£ ·opts = dictÜ =ç  5ÊÖ‹Ã È!,  = E  U Å	  — Ì  4P N= 
î a0proR "ð', '.join(f'{k}={v}' for k, vh JÞ.items() if vO Ÿ ñet modifier keyword arguments can6˜be used 'ÙÀ         f'w÷hen sock is specified. ({problems})')
   . ú.setblocking(False$ Õr_addr = None> Uelse:  S Òif not (local4 ‘or remote )0 4 ¾family == 0   $ ðraise ValueError('unexpected › Bess F Þ  >  ! ò_pairs_info = (((. °, proto), (Û ,á :)),ÿ Ðelif hasattr(0óet, 'AF_UNIX') and~  Ä ! . Ñ 1for´ 8 in*,( Ê #if: sh ³ }  u°isinstance(ñ _, stro  G   S4TypR`string8Z9')
Þ 7 7if Ý ù  1[0]—  Ø Ÿ0, '\x00'ƒ >try a   ðif stat.S_ISSOCK(os. XŸ).st_mode`  G   0os.(ve< Ö  * ñexcept FileNotFoundl§ OpassK 	!OSA  as errH ñ # Directory may have permissions only to createà?et.{  Ê ‚logger.e*aUnable? Sheck ‘ ved0le Ä/ 'M  Q  'ÜŸ %r: %r',6 ",	V  ±¢l æ
P<), Ô½ æ a# joine S:by ):colG  5 ¾  ZÀs = {}  # UsLÐorder preserv MdictÈ  Aidx,v 7(0,f �1Î M ) ¶ mssert 7RtupleÔ1lenL)×M2, (¼  I  1'2-< C0 2ÿawait self._ensure_resolvedq  x,y=ÐRtype=§.<o_DGRAMª= �, flags=  †0op=› öÇ ôÎ n . sP('getÂ  9 ÿ() returned empty list€ H    5ðfam, _, pro, _, addrÿ ess in infos:
  ÿkey = (fam, pro)- 
0if 0 0not^ _addr_c  ~ , ð [key] = [None,  ]u 
; @[idx@   Mess
< p# each   Á has to haveB for  ò 1ilyõ �to) pairK  D _ sè  ¶ $  Þ Q(key,r . )g 
 
1.items(n0if b€((local_… F and` a[0] is;>) o·  “  (remoteF 1F .)]H‡   Ö Nñraise ValueError('canÆ 1get¹ ’ºformation')q Pexcep seŽ ¹# bpo-37228rif reusÝ a st n_unsetª 0 "  6Ì ©"Passing `n `=True`‰Ino "™  G  ð"longer supported, ¢¿he usage ofJ ÀSO_REUSEPORT]ÿUDP poses a significantP þsecurity concern."žOelse5�warnings.	 y("The *.±* parameter–Obeenœ °"deprecated,‘of 3.5.10Ïis scheduledN   0val6“3.11.", De BionWË ,ÒËstacklevel=2Ñ h (eS  äPess, › ®Pess))¤ ‚asock =µ rú ?tryÐS   2et. (] ärfamily= r, type=4 ³.SOCK_DGRAMk_=proth¡ ™  s Q_set_^ ( (j ¬ ) ÿif allow_broadcas  (    F @.set ?optí - pet.SOL_á @ET, 8  ß_BROADCAST, 1˜  ,  l ëblocking(FalseB h   6if 	Ðsock.bind(locßal_address)
   ‘if remote' :$  7 ÿif not allow_broadcast0  4 ð	await self.sock_connect( ,w ž  F rš + =1 ª ÿexcept OSError as exc¡ 0if „ 1 isÕ ONone)  €  * .close(Cy þ ions.append(exc+ ' h ‘ ;^raise /lsæ Ybreak0 e, X  V0eptï E[0]
7 ´protocol =  ‡_factory8 Ber =Ècreate_futur^”transport) õ _make_datagram_  ( ª,~ ", :", u ’ n •j_debug’cif loc6
  c ãlogger.info("D� — endpoint; 8=%r±  "­  N  "ßd: (%r, %r)",1 
§ 	L%, ü  s ÞÛ Ü ' Î ¯ × / "Ï .Ä :try›jè& qÒáÓoreturnP$ ðasync def _ensure_resolved(õ#, z?, *Ëð   family=0, type=uïet.SOCK_STREAMB v A Pflags	 Vloop))chost, W› E[:2]1 Ö` = _ip _ (5 ,¤ ¢ \0, *, vess[2:]g0if ? b0# "[ "" ¤already a @E IP.—  ³‹[U ± É(   @.get¢  9 Í  =xÔ ={h �  s ", w ) .ˆ_server_” * œgK À Ã Bs = Ý  8 .xã À, port), famßily=family,
  ÿtype=socket.SOCK_STREAME aflags= Å, loop=self)‰ Õif not infos:  ¦ ðraise OSError(f'getaddr* ö({host!r}) returned empty list'^  ^ 
^ ñ	async def create_server(  w    £ ð, protocol_factory, v ²=None, port 	: *wE›AF_UNSPEC% #iªAI_PASSIVE%   p  »backlog=1000 /sl/  `reuse_G?ess  Ü ÿssl_handshake_timeouQstartX–ing=True)ÚA"""Cyr a TCP .� |1Theh÷ parameter can be a string, in that case theJ 5 is‘‚bound toP 1and¶l Calsoq £equence of}  s H � o ‰  � 1all… sI  ( sY a. If a H ðappears multiple kñs (possibly indirectly e.g. whenC Fnameÿ presolves same IP þ!),:€ƒ is only² oó !toe—  ý<RyA a SAÔ object which²1use€Estopn 7iceG °This method… Åa coroutine.z 5""" ÷if isinstance(ssl, boolb E<BType>ñ'ssl argument mustàðn SSLContext or Û&')Œ?if õ ª  ¶ 0  _ !is@ ë‰ CValuŠ É      › _W b ‘ð meaningful with� ¢  ˜ / ‘ !orè 
•  × ?ock!  ˜ Cº 	 & '~ /1 W  ¯ � ò be specified at … ÐÅ  I 9if � �  _
º  * 
' P= os.ø² == 'posix'‹ ùys.platform != 'cygwin'� V‰ets = [] !ifQU '„  ö 6  £ 
: gelif (¤ , ,>I) ore  Î  ÿÓ/ û
collections.abc.Iterable)é C  2 �  	 � À       else:+
  €hosts =  
 f ð[self._create_server_getaddrinfo(8 ò , port, family= ,M v  aflags= )?  1for¨ 1 in )s]%  �  ´ úawait tasks.gather(*fsQ , ð
set(itertools.chain.from_ Qable(* *))ùcompleted = False‰ Itry:  ï  ½ 0res¼ S "  & ýaf, socktype, proto, canonname, sa = res_  = x      V ! =] 0et. ?et(o  
( :   dexcept> _errorÁ  - ó# Assume it's a bad/Ø /× ÿcol combination.Ò  N 2if …_debugv  , ùlogger.warning('¸Ò() failed to  / 'w  O  '6=B%r,  /)'îv `, exc__=True… � zcontinuq      �s.append( J �if reuse_È?essV D @.set Oopt(0
 % Òet.SOL_SOCKETÍ Ï_REUSEADDR, ã ™  R– Q_set_Â  ( é P# DisÈð
 IPv4/IPv6 dual stack supA @ (en% Od byá ð# default on Linux) which makeäcsingle!D `listenC Sboth |?ies‘if (_HAS_¼ ?and]  þ  Eaf =åŸAF_INET6 6 qhasattrHÿet, 'IPPROTO_IPV6'))‰ ò  8et.@ = ŸV6_V6ONLY< S0.bi-a+ú0OSEõo as erücraise . Ñ(err.errno, '5 6ßle attempting‚@'to ©  ?:o%r: %sÄÀ        % (sûa, err.strerror.lower())) from None
  ú completed = Tru! �finally:6 uif not = "  g ±for sock in ?ets)  -  ) ….close()p Jelse3 !ifK 1 isÐ 
  H Àraise ValueEô('Neither host/port n™ ö were specified'y  J k �.type !=x ïet.SOCK_STREAM~ ðf'A Stream Socket was expected, got {ü ;!r}€   pets = [ %]
Y 0 ö.setblocking(False)B ¡server = S	 c(self,â õs, protocol_factory,{   össl, backlog, ssl_handshake_timeoutV RPtart_ :ing@  Xer._s#  w ð	# Skip one loop iteratioa° that all ' É.add_reader'¿ Ù# go through. ÷await tasks.sleep(04 ¾ ›elf._debu¼ ð logger.info("%rŸ Ï `ing", 
 &ercreturn ”ðasync def connect_accepted_Ì9et(© ¯¦Á
¬*•=ü
 «( )— ó ?ock}ÿå  y L Y z Ð A and‡6ssl³  &‡ X     'ÿ  ^ ðonly meaningful withØ'
PtransJ*2 = > ›“._create_ÍEion_4 Ê6ockF p r D, ''=`_side=¡ÆÝ € ]É‘# Get theL"et;  Á Ö because SSL  ¼sj#I 4oldM  ²qs a newD â	:   & =^ ±.get_extra_d'! +et2† ‡ ŒÐled: (%r, %r)Žr¸ }!¡$  ® hS_pipeJ›  Z! - =mó �§V:d_futur&À    transporðt = self._make_read_pipe_transport( ó, protocol, waiter)

  Etry:   a# (  jexcept) e ….close().  G Vraiseg #ifª ZdebugI qlogger. p('Read · ù
 %r connected: (%r, %r)',h  l   7 µ.fileno(), ¢ ¥ oreturn$ ¶ ”async def… a_writea(vU ‘_factory,¸ )Þ x% =ƒ, / q$erÌÈcreate_futurUÍ ) õ• öªW\?÷l ñó _log_subprocessî¡msg, stdin 1out 7erròÅinfo = [msg]¨ ý 8 Æ is not None% ¾ 7 ¡.append(f'e “={_formatr A 6)}'ÁV 8outW @ and¥ verr == Å .STDOUTw ®out=stderr 9out€ <elsÆ f{ ’ 
r í  v î o : a  Ü J' 9nfoNÐ  ¹P
‡€ '.join(š)0Xc_shell#ðå�, cmd, *³ °  76in=V _.PIPE6  ;7   7 ÿ	universal_newlines=False§  "ÿ=True, bufsize=06 �encoding=.ƒ, errors Btext dH ˆ**kwargs£f…±isinstance(¥`(bytesÓ'r).  R Ìp ValueE‡ ù("cmd must be a string"›.
	T 2 c h` À     if not ‡shell:
  ñraise ValueError("% õ  must be True")3 ÿ if bufsize != 0L , N 0K OtextC  $ Ž KFals� ÿencoding is not NoneT 4 ˜  5 
› esU 2 S :´protocol =  –_factory(`±debug_log =Ê ? ‘if self._" 
á €# don't 7 õ#parameters: they may contain sensitive informationc  ñ# (password) and? ¹be too long- ‹ ­ R'run ;@comm; ™%r' % cmd5 Æ õ log_subprocess(J q, stdin 1out 6err!ótransport = awaitGmakeR _( (~ {,˜ ,Þd s ,é¦, **kwargs† 
Ž)Ã 4plogger.|µ('%s: %r', 9 %, µ j freturn ,>
Ù ¦async def O`_exec(i. l pgram, *Ô ,F  û �=\ Q.PIPE3=out M =err6 ñ universal_newlines=ê�  Ð+ ¯/=06 þ=ö", ê  n Ë ‹/ifÉ    `nû í	aS % F 	–ÂÿPopen_5q = (proG@) +  0cétÀnformation
   ö# (password) and may be too long
+ ó  debug_log = f'execute program {	 I!r}'7 Pself.7 Å_subprocess(L q, stdin 1out Eerr)C òtransport = await Q GmakeR _( (;  ½ ñprotocol, popen_args, Falsel { ,@ Ðbufsize, **kw= š #if‹ Í ?
  ì Ù is not None:Q ölogger.info('%s: %r',\%, É j freturn ,v× 
\ ðdef get_exception_handler(,)� B"""RL 5an .  . A, or² ð if the default oneÑ qin use.s  \5""" £  p .ˆ § s§ ,‡ 
° 4Set 1 as— înew event loopÈ .o  £ %If= !isÜ ,C Ú U willÖ obe setP ða callable object,  Åhould have aK ðsignature matching '(À ð, context)', where ' F “  – a referenc¢È gactive3, 'O @ Cdict« p (see `Á °5()`¹ �documentaYõ for details about¾ i�-     @(ƒü ¿üraise TypeError(f'As´Æs expected, ý  G  sf'got {t  ²lÂ$ =I] sE?  E Ø	€DTzf@Thisq  ed)n ±coccursF´Ú  D Aset,) 0canET ¿by a custom@ Ðthat wants to er	 Œbehavior¿ 6B log¾eÊ� messageš Uother¼ ¿p-dependæ ,!rm€R.  In.õ mode, a truncatedC Pstack/c¸qalso apO `d show~k Ë SgivenD s(e.g. aÀ  f!fu¿ðor task) was crez ,29anyeÃ parameter hÃ�same meanŠ Uas iny “bJ=o c.get(' 'ÚÀ    if not m—essage:
  m õ = 'Unhandled exception in event loop'
; " õ = context.get(' %')- (ifR ›s not NonŠ õexc_info = (type(K &),@  æ.__traceback__o ?els[ VFalseÈ ¶if ('sourceM '¢ $inÚ E andÍ <âself._current_:& iÝ 5 ,._€ )£`"['e ¨ _] = \š e Ólog_lines = []V pfor key
ssorted(� ¦ $if' #{'E 7', }Ö  H J Einuem   evalue WF[keyŽ  ! j >== ºd  tbÜu'.join(0Ñ.format_list(r )A e     > ðObject created at (most recécall last):\n'Í G Ú+= tb.rstrip(l 'elÓ åÓ CHëÓ H„
c= reprv	.Šñ.append(f'{key}: {Œ9}')·Óger.error('\nãD 6S=\? @def µ_cÁ r(×,ùã@"""CçCthe õs¢ Â&r.« T5 &` argum6pis a diX ontaining _ `follow Vkeys:G %- Z0: Eø  j;G-s1 (oÇeal): EÕoÏ	4 yfuture'1 F ™ instance0 Jtask. OTask, 
. \ Šprotocol2 P d štransport5 T 6 [socke3 S 0 Šasyncgene A þhronous generator that cause= 	  ø�:0NewWðs maybe introduced� 5 ¹2 qote: doÄàoverload this ómethod in an event loop subclass.
  õFor custom exception handling, use the/ U`set_) _) ber()` s Y 5"""6 Žif self.: • is None:,  ˜ :try   B odefaulƒ ‰context)I ª þ (SystemExit, KeyboardInterrupt)l Fraisõ  ~ J TBaseE(8 ñ # Second protecMùlayer for unexpected errors¬  f #³Cthe è ° implementaL �, as well  R Ð/edK  øós with overloaded "a ’"Ã ’   qlogger.´ %('ÿ  ¬ G <Mer',’  K  Öexc_info=Trueµ?els¼ ($/, ` ‘?exc	0 Ü�user setx.er‚ Lµ# Let's try4•F  1  ".¶A {¶â'message': 'Und È 	 =
'-  '::+'Ë$':Õ, }B å   d û < ÿ  R  * Ÿ# Guard 'i'4žcase it i	F ±Í™!/ 'ã u  e'while E¼G /inä  ˆ $¸ ódef _add_callbackô‘Ë """Add a HÍòe to _scheduled (Timer È) or _ready.¶Passerž’instance(e ,R#s.? D, 'Af öis required herem"ifP@e._cM Jlled/areturnæ  þ  /noƒ 	Ç À)
        seó2lf._ready.append(handle)

    def _add_callback_signalsafe(self, 0 :0  4 z"""Like8 p() but G ¢ed from a L  B Ur."""E  \ .z ™  d   # �write_to_ (· btimer_] ¯_cancelled¶ ðNotification that a TE H¥ has been M 	³ #ifÊ ¶._scheduled² ˜ D ·_count += 1trrun_once)G ò"""Run one full iter± òof the event loop.O  y AThis|ñs all currently ú  Ýös, polls for I/O,�Ñ sd ˜resulting: Äand finally  sA 'úv_later'6 .   ü ? Q= lenµW)+ Hif (/ õ> _MIN_SCHEDULED_TIMER_HANDLES and;   5/._’/Ç ˆ >8  < i mCANCELi —_FRACTION» 4 ñ# Remove delayed Uvat were[! iÐ™ir number Ù# is too high 6new~Y = []  ÙB in þ ?­ ¯ Ó°Œ "  U £‰ = False  . OelseD 	¼ � @   `heapq. Iify(8  ) â 9 = - 	� , 5= 0, Á ÖúÖhead of queue ± \while™ · F[0].ÖQÎ 	-l n  Â0 = W]?popz< 8 ú2 T–out = Non#ifÕ †#or ŠstoppingÕ E ‹D Æ‘# Compute¹ƒdesired L {Den =„ ñdhEwhenÎ  ù A à = min(max(0, & " -A  ! ñ()), MAXIMUM_SELECT�3OUT¨ K ±@_lis ¶’selector.	 (M 6outÛ' �process_B !s( I ^ ## ½'|Àbacks that a³re ready.
  ðend_time = self. B() + õ_clock_resolution8 Swhile% ¥scheduled:  ^ UhandlY _& 9[0]( 2if + ¤._when >= – 
Q  U Ybreak? < � = heapq. Apop(Î u )4  . ‰ = False& C 1rappend(m %)
( ð(# This is the only place where callbacks are actually * 6ed*ˆ²# All otherA  s just addZ Lm to»õ# Note: We run all currently nƒ ×, but not anyÁ  Œ ¤ 5 &by8 ^ tæ  § around --C ²they will b�  Qnext 3 ’(after anà ˜I/O poll)ÿ òUse an idiom thatT ~ð-safe without using ˜s@ ³ntodo = lenú 9 yöñ for i in range(0 )_Ü	_A –.popleft(J  †³mcancelý & zcontinuU#if6Zdebug‚  5 >try   Žâ_­ 	 Œ *  $t0Í  †Ã % @ _._run" *dtG _ - t0q Pif dtÀ¬ Tslow_]P_duraBÝ  Ž ðlogger.warning('Executí°%s took %.3>conds',ƒ  I  ‚_format_ê ÃJ, dtÕ 7 0fin¡¥ Ö _‚:NonãNelseB  i 0 = F    # Neededïëp cyclesOn PexcepH‚ occurs.‹ðdef _set_coroutine_origin_trackP ¾ —, enabledû„if bool( 2 ==  1 .Q _1 
ë breturn–  R$ift 
( ^ ý saved_depth = (í_sys.gñ 	< *()å 7 (
7 p öconstants.DEBUG_STACK_DEPTHb úp & �6  Àgin_tracking³_enabled = 
 ñ

    def get_debug(self):   preturn  ." 5 s5 ,V > 7 v  ] "ifY ·is_running(=  " A ñcall_soon_threadsafe¨  ._ƒ ö
coroutine_origin_tracking’ 0
__D ó_ = ()

import reprlib
from \    bident
 . ó"format_helpers

# States for Future.
_PENDING = ' À'
_CANCELLED  ’'
_FINISH  @'


š1isfU C(obj�"""Checks au ´RThis µôs True when obj is - Á instance or ¡dvertisingF  ityò as duck-type compatible by setting _asyncio_¦ A_blo|.H !Se8 sment inª · Âmore details, 1"""4 ½ � (hasattrø ß.__class__, 'r a') andC  :  Oobj./  ÷ “not None)l_Ý q†backs(cbtó‘ functionÇ ñ __L$__Ä  size = lenB ” 0if o   ^ cb'S� $b(„ €  Ï $ � ,s.µ u_sourceA R, ())b  pš ;= 1… U Ácb(cb[0][0])· 'el5 25 ’'{}, {}'.> ( _E ,' 1 1Z [ /> Z @<{} (>e «  #  _ - 2,2 	Ô -À � 'cb=[{cb}]´Ò# bpo-42183: ÜrPeeded~a proteO"
#ª£ó	or Task result contains œ�directlyÂn Ð.
# The logicq `borrows  å@§Ñlib.recursive¢   decorator@ òUnfortunately, the _ ' ` usage`  /"ssöecause of
# AttributeError:·.Õ '‘°ect has no é. ð  '__module__' e< 0.
#P €fter fixutå th cwe canò2 to¯ Ï ñ based approach.
ï m  =Ç jÃ $b_info(Ô‚2# (î�) -> strC2"""‰ V B = [Y 0._s;‘.lower()]Q 9if  E == !€' Qexcep’iMÓ* À       info.õappend(f'exception={future._ s!r}')
  Uelse:   ’key = id(: Ö), get_ident(8  * 0if - úin _repr_runningO  ) éresult = '...'n €  1 	P Š.add(key}  ' >trym   `# use • ñlib to limit the length of ùoutput, especiallyž  L   ÿ# for very long strings, í  . M"._ Ë 0fin~ Ï 
odiscar Uinfo.j "={ ô2if Ø¶._callbacksu B v_format' Ä 9 )È T Àsource_trace\ [ uframe =~ * E[-1]Pˆ áf'created at {G S[0]}: $1]Û preturn < à
import collec	s •subproces 0war·£s

from . = ›protocols Ptrans_  4log4 õlogger


class BaseSq T9 (C .  1):

ô
def __init__(self, loop, š á, args, shell,4  ® °stdin, stdoåÿ stderr, bufsize1  ówaiter=None, extra @**kwl )Ñ…super().¢ 0  ‚  ± õ._closed = False£  È % =Ó "  ð ! =÷   Å0 = «  ip   !0codˆ   Rexit_Vs = [�¯ aending ! ^g.deque 2 0ipe* +{}¤ gfinish   if°fin == ¬V.PIPE|`pb <[0]G ?outH 1H ?errH 2H Ø 1# CÇwPchildô ˆQ: set _Õ†attribut.è^`start(—= =F=   
•  H " ' )=1 B Wš ù g RraiseÜ  Æ p¯ uroc.pid_  Z&[''` Àproc

      ÷  if self._loop.get_debug():
  ûif isinstance(args, (bytes, str)/  :  program = / 	N Jelse` 1 9[0]4 rlogger.ž ù'process %r created: pid %s',7  Y  “ ,ó Upid)
. S b_task( óconnect_pipes(waiter)= Ádef __repr__/ ‚info = [F ö_class__.__name__ã ˆjclosed F ’.append('! %')¹ ;  «is not NonbD rf'pid={• Opid}N ¿returncode U 2 \  c /el³ ‡'runningª Fä 'ƒstarted'ª 	ustdin =0pes÷*(0Q& ø S !={ ." í Ÿostdoutr  1r ostderr$  2$  4K — S and >  is
 ?out="f'Ž =3 ´ 5outµ  !  [ f]  9 ‚m  f 1 X  ý Ö 
Á ' 4nfoX 1err¾ 5err¾ swð	 '<{}>'.format(' '.join(¤ 	¼&º,¬p, shellÚ1din 1out ðerr, bufsize, **kwÝñò
raise NotImplementedErrori ,Ãset_protocolv  I �( 4 = $ I  ® I ? 
F ; 0is_H?ing9 
 $ &ed7  2  ™C »ˆ š� ) r = True^  å2foræ 9 in ovalues” þ  ’ð Q …continue   4 4.ˆ (1if Þ .¡cY  F ]  i	G  K ð # has the child½ –�finished?2  [_ [  q _  Št g °# transport£ €n't beenÐified yet?
    øself._proc.poll() is None):

* 2if , ùloop.get_debug():'  3 ð
logger.warning('Close run p child r áess: kill %r',_ )u >try_ ‡  A .= )()� þ
except ProcessLookupErrorI Jpassp ñ# Don't clear the ð reference yet: _post_init() may stÆ 2runO Àdef __del__(® 0, _= Aings9aif not0._c.d® ? R(f"un À transport {a ò !r}", ResourceWy",  =" 
%  .K (r ³  Õ1pid³ ž creturnž 6pidä  1  Ocode8 
' 
? Upipe_Î C G, fd vif fd i� :pes\ ¡ €pes[fd].[ Oelse6  ì“ a_checkõŒ 
ˆ 7 &S Oaise{ e±send_signalb ",  j g Š ½ ü	I P Ë�terminat•A \ ? T m @ « : J `async o�_connect_©sgwaiterb  ý $ =î5rocä|%op  «Ü    !ifz`.stdinÅ x 
É + 0_, ™ @ = a•  M .³ Qwrite¹ (  9   �lambda: W( 0Subµ ÃessPipeProtoî ?0),?  / ¤ û W    ‚.{ as[0] =¦ æ ?outç (Areadk æ OReadå 1å ?outæ 1æ ?erræ m2æ ?erræ 2æ TasserØpending_callsò 
 «ðall_soon(self._protocol÷
.connection_made, self)
  ñfor callback, data in(  ._pending_  )s:7  B Ploop. `_soon(
 F *G 
g  y Q u = NoneW úexcept (SystemExit, KeyboardInterrupt)‡ MraisB QBaseEM ªion as exc7 ñif waiter is not‰ A and  ».cancelled(u  ü $ Bset_¸ vion(excö Oelsev Hpresult(B!)
DAdef «(mb, cb, Š‡ /ifÛ,  ç  J ·0.ap ((` éô 	A *š º Wpipe_±ClostÊ 0fd,Ä‡W  r# ¿._protocol.G $, B )Ù ¸try_finish(ED  Û ‘_receivedf G   Š  . F A ù µrocess_exitj §returncodel vassert  ¹, ç 2 /
8  :&._ : *¼œget_debugòlogger.info('%r Å S with�  Å B %r'm § 9¡ =>  = ” Vproc.µ   Ï 
¼ñ%# asyncio uses a child watcher: copy the status into UPopenu  .ð# object. On Python 3.6, it| ùrequired to avoid a ResourceWarning.P ï Æ ô + ê	8LÛÉ ñ wake up futures@ing  Õ(I   ' à_( +er/if=!ÇÌ ú q 2LÝ õ � ¢,Ñ"""Wait until× o es!itìu 	   v.£ 6°This methodïñ a coroutine."""Ž  ' 3F  E  / `
ž$ Ž  1 u  Õ Cer =# ‡rcreate_¼ª+Àwaiters.appeÃnd(waiter)
  €return a   1er
 ñdef _try_finish(self):  ; °assert not  .' %ed" #if c Æcode is NoneG  K   8 Pall(p-  _  1 ÷ and p.disconnecth  C ³   for p inu çpipes.values()¹  / 
² u = True� " c‰ -   _} ‘ion_lost,Í )0& :W, exc† :tryf ›protocol.j (> ¡ ofinallA aloop =˜ / Ð Oproc 
} " ð

class WriteSub> €essPipeP¨ (® Rs.Bas Wcol):s_init__ B G, fd	ø   0 =  ¶  ffd = fT  Û¤  Ü    † = FalseŒ SCmade“ �transport” eipe =   I c__reprÕ 7 ÈQ f'<{� !__@ò__.__name__} fd= @fd} É    V!r}>'g °  m°  	:h ÷ 	Ì!  X ._c ÂU 2.fdŸ
| 6 g  Ñpause_writing> m  ! É
1 ,_resumK 2 $)
¡ORead ¹,Ï  7 ØèÔÑdata_received ,  	@ipe_ 
3 t  @)
im¤ linecache ótraceback

from . * Ëbase_futures Ðcoroutines


°R_task°Pinfo( ©   8 = N .W 1 •0if ? Ö._must_cancel‹õ# replace statusd h r[0] = '4 Clingè  0.inKP(1, ''b=%r' %k 1get;#(): á 0 =  è •._format_ ä . çe P2, f'+ 0=<{ 3}>'Z Þ Bfut_	‚é O 3O  -  † "={A B!r}'„  < 	š á Qstack¶ d, limi‹±frames = []M¡if hasattr- ã a, 'cr_+ 'Ù Õð# case 1: 'async def' Ãcoroutines
   f = task._ ‘.cr_frame  Öelif hasattr(% R, 'gi' 1'):*  M ð# case 2: legacy Q n G D n /agn ÿ3: async generatorÛ F m -se» ú4: unknown objectL 2NonÀif f is not  I _while  %�if limit?  "   & F<= 0^    QbreakË    \ I-= 1 Óºs.append(f) ¦ = f.f_bacQ 2 ‚reverse(2 ¢ŸexceptionÉ %tbW* €.__traceh %__ƒ 3/tbI  Õ s "   & 4BRtb.tb† s   ê  Anext× rreturn D€


def _8Á_print_stackQ,c, fileL ex'Ñted_list = []V Óchecked = set’0fornnÃ$ge\ = V  ¬ clinenoï Z   c 2codæ   — Ôname = co.co_ 8 	     &0ile *3in Ã 
Ò T.add(_ 
d « acache.,  +   ' 0 =  # @.get +  n ,ðvglobalsk 
y.>   Ó L 1))
ð >excñ !ifý 
\ a(f'No  Ò{,B!r}'=§ ‚ m M Tg	N ÿ
 (most recent call last):g W S·S !	 Õü.P Ý(ï ?if í  ) ÞF in \ uformat_uð_only(exc.__class__,T  è“ (O „ ô, end='')
import enum

# After the connecólost, log warnings a+ ð(is many write()s.
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5n ðSeconds to wait before retrying ac‹ð().
ACCEPT_RETRY_DELAY = 1

# Number ñ4of stack entries to capture in debug mode.
# The larger the number, Cslow šoperationA ñ
# (see extract_w  ()% ñ format_helpers.py).
DEBUG_STACK_DEPTH = 10

# Nw  º Qecond´ ñwait for SSL handshakeÎ sompleteÀ ðdefault timeout matchø 0hatT ñNginx.
SSL_HANDSHAKE_TIMEOUT = 60.… @Used» àsendfile fallbIc-w  We us  œ @platì Ps
# tp ädon't support L A, orÌ  TLS connecOðs.
SENDFILE_FALLBñ READBUFFER_SIZE%€24 * 256- ³ñenum should be herð	break circular dependencóbetween
# base_events and sslproto
class _SPMode(j ñ.Enum):
    UNSUPPORTED =  aauto() �TRY_NATIV·  â 8 õ__all__ = 'coroutine', 'is 1fun0 Q'

imhDcollS4abc 8 Dools tinspect o %sy  Ìeø& Etype ówarnings

from . ‚ U fufs Œconstant  8$5 4logS ñlogger


def _is_»_»(Žá# If you set _a !utrue, @@¡ will wrapÚ‘resulting´P# genà or objectsñ a CoroWrapper iÃ  ce (definew³low).  ThatI & p  Ë áa message when~ n `is nev^ t€ #edG ðover, which may h„ nB  í `forgeté  � "a*"bp"yield š"L vwith a Scall. BNote· ýPvalue1  MÓflag is taken6 Ê �decorator" €used, so— bG 1any1pit must©$se+abefore¼R  r¨ Ñs.  A downsidO àusing this feai�  Ÿ  {¹sw  ¨ Ó Ðô .__next__ methoyÚ ú  V 2rue+°return sys.Qs.dev‰ vG(not ðignore_environmentf¬  A ƒbool(os.: ñ.get('PYTHONASYNCIOás')))


§ =#

ÉCÀ¼$# Ï ö õU  c!.
³ |Ð_init__(self,/ , [S=NoneŠ × `assert, e5.isëP(gen),�.Ý V q  I  h `.gen =m 
  y ! =€ A  # ¶Ðto unwrap @coóroutine decorator
  ðself._source_traceback = format_helpers.ex û
t_stack(sys._getframe(1))P ó
_name__ = getattr(gen, '_ }', None7 Oqual;  ? w Ðdef __repr__(Ð !):  â Acoro C = _Ó   - , 0if > O  S ô / =, E[-1]R  /  n ‚ ñ+= f', created at {L S[0]}: U1]}'
@ ²return f'<{š ”_class__.I5} {a #}>; ?ite S  O h - Nnext>- ¢.gen.send(¹¤  <   O w, value}? % | QthrowŠc, typeG =g  , u’ \ G A < )n Qclosen L % 6 •@propertyò 1gi_¸G ( ~ H runningJ * L ?codÚ 0gi_' F  ¾o__awaiû. À ŸyieldfromÂ , P ~ >delwò# Be careful accessingq ‡~5 -- ñ might not exist.¬ ~7gen…§E'genB %   T °Ã/ 2if 2 !isw  ®B and ê.f_lasti == -1?0msg^'Òá!r} was never "eD 5om'Ã  ž .tbÆ µG', (Š 8 Zif tb€   O …''.join(c. {list(tbK  8  ¼ ¤+= (f'\nCoUhobjectØ
½  :  ðf'(most recent call + ®1unc?to A 	ñ{constants.DEBUG_STACK_DEPTH}M ¶ lines):\n'b‚ Ä ªtb.rstrip(# ðlogger.error(msg)


« f5Cfunc=D"""DR• to mark * "s.êfIf the  4ï  before it ¡destroyed,1an � € message# ¨ dé1"""( 0warN s.	 Ð('"@coroutineû:" decorator is deprecated since Python 3.8, use "async def" instead',
    DI ¿ionWarning,&  Ñstacklevel=2)   ifW ð
pect.iscoroutinefunction(	 !):*  q F# In£ õ5 that's all we need to do for N s@ Èdefined withÝ .$ preturn z 
 	£ Agene>   £  v " =?  ³ FelseÁ @7 ¢ools.wrapsá g  - 1def· Ç(*args, **kwÿ  # 3res_ 	% C  $ òif (base_futures.is
 `(res) û#nstÑ  	J  N    isý@ance' ë, CoroWrapper)¡  / ¥ Öyield from re… ! 
     # If 'res'œöan awaitable, run it§ 0   6try_   < p_meth =€ 2.__ _â ÿexcept AttributeErrorV :pasÊ  o Î    <;QcolleÞts.abc.Aä H  C   PÊ  Ý (H &   ¾ pç �`types. `(
 9 Öif not _DEBUGô  žQper =�K 
æ ÊD ¨+dsæ 8w =M™ 1 ,M=:³  è   öif w._source_tracebackÄ  $   ?del) A[-1]Ù  $   #[¡< 3.5 doesúimplement __qualname_FU# on KÀ objects, so™ú set it manuallyÅA# Wekðgetattr as some callüšs (such ay#tLùpartial may lack© )p Bw.__Â 3 = t ‡4, ' z', Noneo 9 ÿ =  A œwWP._is_�™: =  @ # F° Ø V ŽÑ


# A markerW *.
e =±P()


„4  #½B"""R&qTrue if‹´_!ed9Õ  » ,A."""r´ %(i‡, p 1 or1  Ÿ  °<t ˆ 	à À)


# Prioriõ%tize native coroutine check to speed-up
# asyncio.is( ô.
_COROUTINE_TYPES = (types.CM bType,  ‘Generator /
   ö collections.abcH  , S §Wrapper)
_ˆ _^ ÷cache = set()


def $ a(obj):s ÷"""Return True if obj is a¡object."""4 !ifÃ F O in  `  Ö ra 
A  isinstanceG ,, =Ÿ  ? `# Justi ðcase we don't want˜í Ñmore than 100f < AposiÒ ð s.  That shouldF `ever hI—n, unless> õsomeone stressing the system on purpose.3 if len(0) <ž  £ + A.add> %))` L > FelseP  SFalse÷…_format_©(
 _iassert §s6 wg7 = µ ' †¤  jˆget_namej  ¬ #¶Vðs compiled with Cython oStimesãAhaveW ? Ðproper __qualb @__ o  q.  Whil Õ g a bug@ #ini ,Â	RcrashŽ úan AttributeErrorD óits __repr__ fun¢% im;¡ È ¥˜…helpers.¨qallback=.^ ’, (), {})– C ¡if hasattr' 8, 'a') andÀ. 
‡  Â§. =+ Ì /ell p
h  d ' ` À Ü °# Stop maskp€bugs, exn „mæa friendly way… G ß @f'<{ÿ-1)._÷ 1__}îDout  %>'™ ¦%'{J B}()'„ æ¢is_runningW ú 6try  Œ L  I 4.cr7 k kexcepts
B S W -giW  # [  ' ¡ 8   ¬ @_codF2Non†!cr% 
 À K     Z  `-giU  U "   g å: = Ž  ðif not coro_code:
    ò'    # Built-in types might not have __qualname__ or __  .
>   õif is_running(coro):  !  return f'{ @ #} 0 '* Oelse8 5 
,  Áframe = None ¡if hasattr‚ a, 'gi_& p') and 7 . h   ( * =$ W .elY "cr1 Y  Y 	$ Ç Ñ# If Cython'sz PutineÆ ñ a fake code object without properœ �# co_file‘ò  -- expose thatž Û _Q .5 ¨or '<emptyL ">'£ ¡lineno = 0p pif (is_2pwrapperY  æ    �.func isC  &  \ðinspect.isgenerator8 AtionÁF )IPsourcóôformat_helpers._get_; _& B Ÿ 2if  › ¯ ¾ /%, ú 3 E  ã   I  à 
E   krepr =òôdone, defined at {q 2}:{r }	Z L] É ÔM   Ç  ’
Ë � ð 2.f_ F  1E ì ’ æ C 
ò\ r «2rst 4 w cI •Ã à
"""Event loop´& e ñpolicy."""

__all__ = (J ‘'Abstract? QLoopP. /', 5', 4 dServer+ `Handle  TTimer H  é“ _¢ _“  , Oset_  6 /   7newA �  p °child_watch¦   'l  h _ ÷¡  Y  C 
 -   ô)

import contextvars o
 dsocket –subproces  y óthreading

from . a 
C’


class oÏB"""Oz)ðed by callback regiõ °‚ methods ¡r__slots$$'_6  Q_args	 ‘cancelled  Óy B  'Ó_be| /  u	 ¯_weakref__> L"')Óàdef __init__(sóelf, callback, args, loop, context=None):
  $if @ is    # 7 $ =' £vars.copy_ %()M Tself. 3    � ! =—  º  ; Å "  Ò ! =Ù  ûcancelled = False  arepr =â  2if ³  “ ·.get_debug(  $ Àsource_trace_ð = format_helpers.ex …t_stack(f  C   ösys._getframe(1)8Jelsews  ¢
[ Pdef _Ö `_info(2 ¸   @ = [ ñ.__class__.__name__]C  – A
Š  I •.append('$ '½ A x I1notkL <_ _oF d,Á Q” F µ
� Š# =D , 6[-1'+4nfoáf'created at {I S[0]}: 71]}#preturn K¼½_º• ÜLT à + Ò5nfoÕ   !²; r'<{}>'.y (' '.join(¦ &))¨ ô¦   ä # :led_ f = Tru˜Sí ‚ + �# Keep a Ó �esentatioV ¶  mode to k' HE and G   @# pa…t¶Ð For example,@ ÿ log the warning>  ý"Executing <Handle...> took 2.5 second":  À ! =Ç V	( $ ¿ ² ¾ "  òÐA  ‰Y �ó; & åL_run4 6tryA y ÷.2 $._­ 2, *a  œ o÷except (SystemExit, KeyboardInterrupt» k 7raiÂB QBaseEM  øjas exc¢ .cb–Z1a ˜   0msgf '‹ %inui {cb}'0 1I = {  L þ 'message': msg,  û Pion':ï "  Àhandle': selGf,
  } ùif self._source_traceback:'  @ œcontext['+ O'] =F 	E i óloop.call_exception_handler(c )7  3 õ = None  # Needed to break cycles when an Q ñ occurs.


class TimerHf ( )á ð"""Object returned by timed ¥  � registra¬ Ñ methods."""
¨ ð__slots__ = ['_scheduled', '_› "']) Ðdef __init__(Ú ,º ,i €, args, ##, =ý ®  ‡aassert: q is not‹    …super().j Ç ^ k
?delìF[-1]† U þ ! =¬  &‡ = False#‘repr_info%û    kâ ) Ç …pos = 2 Ï õcancelled else 1‰  N 0.inN€(pos, f'°  ={›.º&}'Y   6 ¬ S_hashÏª -   Å O )9 lWother> �if isinst» ( ,Ã+  òm · 1 < 5 v ñ ( éNotImplemented“ eÊ ,@ h “ ;3 orER_eq__ã k© g<H>ü <g<H	“ <-q ,å5á8 ==>E and~ ª   $._™6  :  '6  2 £  z2 ñ 
 †Õ o`
ò  Ù ._^rô_S 2ledV /Ç  (; ¥- c A"""RÀð a scheduled callba³ck time.

  1The â is an absolut òstamp, using the sam ? ðreference as loop.` 5()." 5""" ñreturn self._when


class AbstractServer:2 4""" ! s  A Òed by create_ 0().i 8  def close(i )M  ï q"""StopM ðing.  This leaves existê ñconnections openZ  @   ò
raise NotImplementedErrorS | @get_  1GetIQevent0 ö q objectŠ¯ttached to~ !is?ing€  R�qTrue if| @u Lccep `async _startˆ S  / aq I lž`method  ñidempotent, so it can be called Q 8   ¯5 Ú�lready beá ó   . -  ;    áä  ^ �_foreverl ä a until�coroutineâ PcanceÌ ¡ ± !er"  Øë ? 
 Ê   Ú "Qwait_BdØ  C² 0to + Î  ¥ "icÈ ¦ ;#0__aU<r__| ý>$Œ 5 3xit4 g, *excù .Ñ %()õa¼   
 ñ )”E­BLoopJ—Èí \ `# Runnh�and stopp  ‘/ Â  ,?runF1Runé; oQtop()ÿ�  ó  Åw ‡0_coËt/‡, future>?"""† 1a F/  ˆ 8donZl ø $ â's result, or £  ityx/on5r e.í € =pas soon¯˜reasonabl¶ ²Exactly how) 1tha“Âmay depend o“i7 a,Q, but �±no more I/OŸÀbacks should³sÞOuledô &Bis_rhú  |ðwhether the eventó loop is currently running."""
  ñraise NotImplementedError
# ñdef is_closed(self):  ? ò"""Returns True if the event Bwas < u 6 q  CŠ g  à .¦  � 2Thet Õshould not beô )  ispidempot¬ ÷and irreversibleW óNo other methods _ ø
be called after this one. f`async l‘shutdown_ Ogens S% Á all active 0 ÿhronous generatorswC 
† ÿdefault_executor� qchedule”¿ " o@  @ � 4# Msc 1ingt°backs.  Allu Ase r†ƒ Handles¾ O�_timer_h `_cance´Ç ",  
ÑðNotification that a TE ] ¥ has been M Ô  ”  7S_soon†    Ó ÷, *args, context=None� å  „.4 •_later(0,B J )ý} 9  I , delayC … /œ #atÞ Owhen_ : Ò\ – Ïreate_future@ Š& s‰ña coroutine object: cd w a task† _ z  ã½ro, *, nameéÎ Ž °s for interèng with thread‘ q_ "af˜:jrun_in*,ùc, func¡ºCset_H^ Q Õ# Network I/OÔ[ `F >³getaddrinfoÃ host, portÉê ‹
 àfamily=0, type Pproto	 flags=0¿ 	‘  <‘ ð sockaddr, flagsc=0):
  ñraise NotImplementedError
# ñasync def create_connection(! G ó self, protocol_factory, host=None, por 	: c*, ssl$ ƒfamily=0K 9=0,, Pflags Csock3 ¢local_addr 	1 pserver_† Oname" ÿsl_handshake_timeou§ òhappy_eyeballs_delayO ¢ interleav` ^(¯ Z8P /Ïet.AF_UNSPECV$ °I_PASSIVE,  ä «backlog=10“¼Qreuse‰3ess7  ús{`start_‡ing=Truecó"""A coroutine which­€s a TCP : ±er bound to”A and’.é ÈðThe return value iB SCt object` ‘an be useQ Estopw1ther 7ice\ "Ifw  S ðn empty string or !B allKõfaces are assumed\  µ ña list of multiple¨€ets will˜ Å õ ed (most likelyE Áone for IPv4‡another  @6).  9õ parameter can also beO ña sequence (e.g.Ÿ )   = sq!biy˜P b/t' !ei‡ pAF_INET 6 †force thz  Ÿe: 2useÏ × õ6. If not set itdÆ 7minSBfrom›�(default³ +)¶  qbitmaskI0getXinfo(/    ã  op1@allyžðspecified in orderß  Ã Õa preexistinga G #et�Ž “ �  tÀmaximum numbÍ–f queued ³Rs pas´^  MYen() ÿ 9100Ê !slÉ ¬Áan SSLContexƒ`enable 0 ovÓ ©jaccept‹ É % C�ess tellsèp kernel" 1 a ìï5 inÅ ðTIME_WAIT state, without waiL§Ãits natural è5 toD fexpire:¦V•automaticÆz Ž& oŠ MUNIXÛ   Ø ñallow this endpoinL%be­Ÿ  ãAsameµB as ´.@ 9ì Äð long as
       ð they all set this flag when being created. T ó option is not
  ösupported on Windows.
 ðsl_handshake_timeoutD @the  õ in seconds that an SSL serverH ñwill wait for comple�  ofÉ 3 h Ð before abortÉ 5theJ `connec< �. Defaul� )60· Ptart_„  ? !’o True (d4 p) causeµ e)µ @to sI a accepŠ ~ ðs immediately.  Wxj eFalse,³  ,Ñuser should a	S".b « d() or   ! _
Vver()O ao make8 ã ?er ª .; 5"""  raise NotI�²mentedErrorþðasync def sendfile(self, trans4 ,  ÷, offset=0, count=Noný h À*, fallback=‘%):‘ ‘"""Send aX ¦ through ar ™`Returnn amv ! o© t bytesò - öN_tlsó öprotocol, sslcontext, *íé  ¢k_side=#  + �hostnameI € ›4 
TxUpgradeH 0?TLSO F newpÒ*ô *Á´e using¾ p"·f_unix_p(U  /‹™ á_factory, path”3ssl Bsock S  ²_~sJ rWç úã .Ù  `qlog=100ª¦ 
¥Î (  ¢ ?ing´ óA coroutine whichOós a UNIX Domain Socketd{RThe rÎPvalue^a„ object,Y aÛP usedÃEstopÃ e¥ 'ce]  Q Ñstr, represenÌhasystem: U @bind[Y  U  ¼¿ 'to^  JR can \ðally be specified2ord¡ us„ppreexis� b [ ì _ Å À  Þ àmaximum numberó of queued connections passed to
  õlisten() (defaults to 100).
% àssl can be set! Áan SSLContex `enable • over the? jaccept‹ 
^ ð_handshake_timeout isD     in second 2at ~ u serverg Áwill wait fo� Ž Z  · Šcompleteî 960sî Ptart_] 4ingñ 6Tru6 p) causeŽ `e creaÝ  1 Ž @to sI  þ  K Šðimmediately.  Wheã JeFalse,Ö ñthe user should aâ Sû .b « d() or   ! ¦_forever()O ao make\²  H ª .; 5"""  raise NotIQ²mentedError5”async def~_¥ed_socket(J  ˆð	self, protocol_factory, , 
 * §*, ssl=Non#  >sslE( %):l �"""HandleB’ £ 7ion•@This„u0#byl ò €Ñ9 Ås outside ofn pio, butÃ   q –(leB | `methodƒ ´a coroutine+È!d,É  | öreturns a (transportbo) pairÚ-øÿ_datagram_endpoint(Îœ  ¯ ¡local_addr¿ˆ, remote *M ƒfamily=0ü  	 flags=0C Breus~ 5ess“    U Ü ò allow_broadcast= ç 
«Aøc whichk Öv v?0tryt‘establish49  ] d¦background—›uccessfulm eàP mustTaa call@S  -a— instanceä  2et ß‚ AF_INET13et. 6*   °UNIX dependa %onš „host (orP Ôif specified)V ÷ type SOCK_DGRAMŽ 	#P tell)€e kernel|" 1 a ÝñFet i‚ �TIME_WAIT5€te, with î ®  Ó±its natural   ËÀexpire. If nó'ot specified it will automatically be set to True on
  eUNIX.
 ðreuse_port tells the kernel> ñallow this endpoinU µbe bound toJ  9 Qsame M õas other existing@ Fs ar? È, so long asK Ry allÄ  } Àflag when beM  created. T Õoption is notF 0sup‹ ðed on Windows and some `'s. Ifó 5 ó:py:data:`~socket.SO_REUSEPORT` constantm € definedD n(J  capability, %un� ~_Ÿ_broadcasƒEsendl €messages³ ˆR waddresst  × R can 6/Rpn orderM ”use a preÇs  G ¥et object. 5""" ò
raise NotImplementedErrorc# Pipe“¤ubprocesse¬ Pasync` tðnect_read_pipe(self, protocol_factory,  %):� À"""Register =   ð in event loop. S("he Àto non-blockhGmode<r ’ should iCiates with P¢ ¦ interface* ¬  ¤a file-lik< $ ðReturn pair (transÒú  ),5re   gÉ	TReadT? � ®P# The'0sonûmaccept� ì ¢ead of jus! µ descriptort °# is: we ne Ro owne „Pclose½'at½ —finishingF ð Can got complic÷  eFÀs if pass f.CWno(),9 c fžx %tJ  ¦vice versa}¿ _write¡&> © 
¢. ¿OBaseƒ	 € ƒ >�0 al/‚y switch¿4non$¡'©W6�ÿÀ versa.
    ð    raise NotImplementedError

 ñ+async def subprocess_shell(self, protocol_factory, cmd, *,?  C  fstdin=V _.PIPE6 ?out7 !?err7 ¥**kwargs):Î 0!Oexec/*a ø -"?std, ?std+ *ñ# Ready-based callback registration methods.~Ô# The add_*() È return None' oremove*  True if so^ ‚ing was 0 dˆa# Fals& Qthere" @noth. ¢to delete."  • creaderç5fd,Ó !, ãD R � _U D  – Owrit– >U – @# CogÝù;I/OÌ esFuturesc…ƒock_recvh¿sock, nbyte¥#P Y_intoU ?bufÙ ¢ Usenda#¥ OdataQ &yconnect¡ oaddres÷ 'XaccepS ž & ï IfileŸ   ð, offset=0, count=¨eS *, f. – ó# Signal handling? P s _ ?sig«3^ À STask I½ „set_taskdh) a ðdef get_task_facÓtory(self):
  ñraise NotImplementedError
# !#  ¢ handlers. ódef get_exception_! _  H sH ,w °  Q odefaul� Ÿ, contextU Ocallï R  ñ# Debug flag manag{^d$ R$< Ÿ, enabledñ ò
class AbstractEventLoopPolicy94"""  ! p ð for accessing the e: › loop."""8  _ ß k"""GetA ^  T tcurrentÃ0 Ë§Returns any ” object iÜœ EBaseÚ ± interface,ô O 1or Q æ¸ in case nof Ähas been set« J ³ A andÞ  @÷does not specify to create oneé ñIt should never rù   N&  h ¾   ¿ Ù )z
Š,±*O"""S� µ  Õñ …   ‰ Anew_/C
 <ð Xa new…ëaaccordèeo this‰iÀ's rules. Ifˆ�re's need¼  À 4 0 as! d 5forO � ,É � must be =ßed explicitly!°# Child pro_"es ã ³(Unix only)" × ™c3 �_watcherdb  ´2 e %."ê Á JA 	s #, a P ~ "€ ­ ÏDöÖ°(¨ ’ 3"""8 È+a×œ ×Ô!InhA à, each thread hits ow—`.  How¾A, weh Ä� automati/yþ
Ñ3by ß›  …AmainD t s; other‚ Ðs by default ñhave no event loop.

    Other policies may , `differ- ñrules (e.g. a single globalB S ÷, or automatically creating an| ° per thread4 G uZ q some o” ûnotion of context to whichM !isA Áassociated). 2"""ä _ð ò _factory = None Òclass _Local(‘ Ping.l !):F  %A 9     P_set_æ “ed = FalsU ÷def __init__(selfJ   !._` 2 =  ~ )’  = Aget_Vx C ¨"""Get theR foRQe cur¶4æ ° pReturns=€instance]E@Loop½Qraise# Pexcep�L A  P    1if ˜ Ì   Qop is\E and< .   3notð þ .?0 ŽÓ _  ()g   ¬Emain j t ` §NH.newb)} 4 *if§  < r  5 * -ð RuntimeError('There/ %no‹} t3 in÷] %r.'$ V  %-  ç W.name· rÞ» V ,– 5M"""S\.ùSÁ	Ãe= TrueÒ Rasseri  = `$is{(X¥, Abstract†)C 	j  . ! =¯ Ò Æ 1 
Ì C~we a new-�You must É #)r‘make thisr‡M «  ž (—$op‡q()


# ø × „sy.  The 0 itÕ  Bcalwaysx,€ 0 if” #
#. 2's ¬qsay tha$Ž~B (oro=
# q)� sdefaultg  Ž Æ`lled bk ’e first
#G:to Ã_`Wy().
w X€
# Lock Êaprotec9 è…on-the-fQ  ]e  .
ž7k == X qQA TLSd  > @runnžF B, us× _Ä ! ‰#.
/R6  55 0_pi(ü, ó_R H = _M  ! ( (×2"""Æ ø " k@.  RÂð a RuntimeError ifð there is none.

    This function ñthread-specific.& 1""" œ# NOTE: t6 ñimplemented in C (see _asynciomodule.c)E ðloop = _get_running_ ( 0if   Œ QNone:4  « óraise RuntimeError('no C a event; 'I areturn o


defs _ B"""R. ?theR  @ or � 5çis a low-levelD÷ntended to be used byŸ sTz`+nP, pid‡ .zA_pidu$if2  ’1not	B andA Ò= os.getpid()N­O] …sø u ; `"""Setª{ 9~¬	íj@ = (,H),Qinit_Úƒt_policyi~global ! ¿¦with _lock—/if.   Ù Þñ:  # pragma: no branchL  Ó  ðfrom . import DefaultEzQLoopPž 	1 œ / =8 (ö  ô C"""G"@currô, è  .°ï © _g" HÊ ¥ Ðƒ 	£Š ×µ ‘#IfÅ –,dk …restoredí gassert@  ò Ø²isinstance(´ œ, AbstracÙW# =W 
À­d3an ÝÁWhen called m°a coroutine® a ð back (e.g. sche^!d ð ; Q_soon»ð or similar API)KïÃwill always æ z IfŒD¢ @ sete ed ] “ a ªesult of `,à Ri1()`ø :ÞŽÀd in C (see ü*_asynciomodule.c)
    return _py__get_event_loop()


def  ástacklevel=3):F Dcurr8 " =2 trunningL  m 9if * ²is not NoneH  % ’ ) d  import warW s  .	 �('There V i  Ñ  Ñ !',4  d  ÂDeprecationWZ ', á  	/
*ª_policy(). BsY � 9ú
"""Equivalent to calling J b K A."""Û 5 Ý9newôˆ— G “ Îš 8 –  / ïchild_watcher(0%J  œ ;  Ÿ  …
Ÿ § ¦ ¥U ± — ñ


# Alias pure-Python implement  s for test�¥purposes.
Òæ*  † *  *  `)  ( ÆK+ =$ ¤ž 7 b


tryÞ#B  ()4ñone of the most frequently•!ed¾`# func/Ss in T�.  Pure X" i­ñ# about 4 times slower than C-accelerated.j Tfrom µ « þ(é 6<, _^èòb,,½9¡)
except I€RErrorGƒpass
els¼aC¬ W ’ "_cvÑ ¼  - ë  -  - ë :X  + ó )  R }  } 
: C
""" 7AionsÀñ

__all__ = ('CancelledPõ', 'InvalidState sTimeout ‡  7   0  co¿VteReaG ðLimitOverrunError',
        ñ'SendfileNotAvailableError')


class Cancelled ð(BaseException):
H ô"""The Future or Task was c= E."""S rTimeoutQ M Poperad ù exceeded the given deadlineV ²InvalidStatÅ ([ ð	is not allowed in this sC 	\ )r(Runtimq 0 ” syscall j f!.
:@Raisy ‚f OS doe� “support sŸF 3for‘socket orG  Äa type. lÓIncompleteReaÄ1EOF|° 7 + p read e
Ò. Attributes:µ ¢- partial:( @byte5±ring before¬Ñend of streamqreachedn ð	- expected: total number3   [ ñ(or None if unknown)D  é  �ôdef __init__(self,£ ,f í  / %r_a Ð= 'undefined'`  "ist ¤else repr( |  I …super().| sf'{len( #)}Á OCon aê Aof 'Á  E  6f'{¢ }Á L '~ Celf.k $ =ò X  .´ % =H Å3creduce5"QeturnSP1),  o ), ^ .ÁLimitOverrund…R%€buffer l8 ° while lookK î³a separator3� ;�- consumHUto be  A# > 	:…message,8 ñ- •’ % =E v*sargs[0]v^ A)
im(”functools 0ins[  ¾4lib %sy) ótraceback

from . S  d �tants


$Aget_h °ion_source(   3 = y r.unwrap! ‘%if  is-  Û  D �pcode =  0.__ !__>   r“( @.co_ô1nam¨"de 0rst"no� u Psinst†m ,] ,ËÁ c _ì .š [ omethoda #ï  ÷ƒpformat_P ³† , #j  ¦ _ôG = _5 Àback(func, aòrgs, None)
    source = _get_function_ ( ( #if+ :7  ;   ò_repr += f' at {8 T[0]}: A1]}'4 ureturn 7 ð


def _format_args_and_kw ( ",  )v A"""F- E  © ö arguments and keyword !.
{ ð#Special case for a single parameter: ('hello',) is& •matted as !).O 1""" `# use ñlib to limit the length of aoutput4 ¢items = [] f­ sà  V  ƒ.extend([ .  )—  1 0 in s�(G pf'{k}={F 2libN Av)}'N @k, vO B .€ "()Y r³r'({})'.©±(', '.join(, +))É�callback>,§ È³, suffix=''ÓÓif isinstance2  "Ótools.partial,  @  °Ž 7# +q l @ Ò u	¬ .y ,\.~  .Us½ )T£if hasattr· ñ '__qualname__')‘A  ¢  ?=s ' ° /eld `  \ 
# X /se,  "Î ä ¤ /+=©a  -èf (+=”�i L¡extract_stI=±,_  """ReplaceÏ 8 e DD ð) that only does˜­ ánecessary workD úasyncio debug modeø0if ·Gã p = sys.JfVP().f_‹ h "ifÀ  ] Ï 9 5# L8`amount8Ž òto a reasonable  ,”
#° â�# can be Ü!edÑ ãeach coroutineš@tureùæ  E ÉA= co›ñts.DEBUG_STACK_DEPTHÕ  6 = vS²tSummaryƒ( DwalkÖ!),D  p  “ = 8 ôookup_lines=Falsú © ’.reverse(@ŽÖ �
"""A Fu'Ðclass similarê ä!on@�PEP 3148.Á
__all__ = (Þ 'B  5awrap_fQ   $is  
)

importq‚current. s utextvar tlogging" Ãsys

from . O ðbase_futures
from ö. import events
from  Œxception òformat_helpers


isfuture = base_ $s. ¼


_PENDING#  ½
_CANCELLED#  �
_FINISH$   Ð


STACK_DEBUn ‚logging. ñ- 1  # heavy-duty debu" ¡


class FÌ â:
    """This  ôis *almost* compatible with concurrent.ÿ I !.
J ÂDifferences: *- [ ó not thread-safe8 ô- result() and e•a() do 4 ðake a timeout argument/ z ¦  raise an> ¢ when the ­ õ  isn't done yet| òCallbacks registeredð @add_/ #_c#  ¡  re always  #ed€ 1vial gb loop'" u_soon()o g ³ 4wai0as_" sleted()o ’methods iâ št packagcð(In Python 3.4 or later we may be aç�to unifyË Pimplega".| 2"""Ü1# CL@vari= õs serving as defaults for instance + .Ç P_statR" �_r = None) 	  f	 Àsource_traceÓ	 cƒ €l_messagv _ ±# A saved C$ �ledError½ (SchainÜ 	escontextÑ d tled_exc~ Ã #
Ñfield is used` âa dual purpose“À# - Its presO 1 ôa marker to declare that aº¯sq  Æ¢ð  protocol (i.e.Q €intendedQ Çbe duck-type÷)× `#   Th¿Ðlue must also6@not-H,F  enb a subN¬ ” Pat it‚  Ú Ûdpby settft‘!to„   6 òset by __iter__() below so÷Task._step() can tell 5e d¨… between  `az �()` or`y´9M  Ä(correct) vs¢ #  , ' $in) & ƒ_asyncioA`_blockó r= False\Y__logÈ 0defþ ánit__(self, *,s=‹)D KÀ"""Initializ.� #  Øo"al$_Wcø llows explicitl¥e2 > M : bobjectábJ�‘. If it'sÓ‘provided,¦"  5 ¾ N  Hh ä G    Š    !if   àNone:
        ñ    self._loop = events._get_  0()
*   Uelse:   	@  G   åcallbacks = [] 'ifz .p debug()^ Àsource_traceL ð = format_helpers.ex …t_stack(f  ¡   "syÕ ¡frame(1))
# ó_repr_info = base_futures.	 ! 1 Rdef _  _(à ¯ òreturn '<{} {}>'.£ ' ñ.__class__.__name__,‚  �  ƒ' '.joinB ¬ $()À � Mdel_Ž cif notdF_log>
b0# síáxception() was<  ºð ed, or result() e+ 	Ã õ# has consumed the + 	) ) Sexc =© 1 µcontext = {2  1š'message'Î   0f'{›t }’ æ 0eveÝ Štrieved'”'Ž  ':9  +!':»  }§ ã¿
³ â ,['' %'] d é  w.¯_³ “_handler(_ ò2Œþgetitem__(cls, typeÏ2clsû‘@property| H 	V¦@ ¡ 
�Q 
 .setter^ 	W, valc  if 
Núraise ValueError('g À can only beú¦ to False'å´ " =' ¼  ÿ  ´ yù B"""R R ( F`ñ is bound to."""õ  »(    "ifE kis Non„õ cRuntim÷ "j `objectq  Öinitialized."ñ ’a à ñ_make_cancelled_eO ƒ‘"""CreateÞ C- { [š !if “  is…V .p  ü µThis should¡ Ôe �ce when ÖTing aD a¶f since-�t erasesw Psaved™I" <5ue.5 ˆ»ÿ _m G~ÁX *s.>
<  o.…† ¸0excæ#%__/¶ µ%xcá ð# Remove the referpence si ówe don't need this anymore.
  õself._cancelled_exc = None# ±return exc
 Bdef 1 (> `, msg=2 !):   Z A"""CT ò the future and schedule callbacks.V  6 (If/  ¯ `lreadyÇ Ce orw Sled, – õFalse.  Otherwise,„ gchangeR ¸'s state toJ “  « —  ® K m 7Tru;5"""!  	À.__log_traceÚ 1 = ž % 2if ( † ¶!= _PENDING9 n 
= : Å= _CANCELLED^ ! ™ _message =�# _ñ _í %()$ }  ë ™ ï_4  q 
óÑInternal: Asky¢event loopuoll allý'ThE are,d< b  ed as soon åpossible. AlsoÄ aclears� ã V list÷¼# 3s =  5[:]U fif not» ´2 Ä  Xåv[:] = [N fÎ �, ctx in\ L  E.š _þ (
  f,´ â, context=ctx)‡  ¹1led«
®RØ ê) iz6was!.,’ Ç=Ž/1# Dx`implemö!running(); see http://bugs.python.org/issue18699Â Odone½ !is/WÐDone means ei(ð that a result /Ü@eptiU ¨�vailable,t, &thÎ
%ø  ù.õä ˆ æ  ™$ Æ‚ ŸrepresentDphas bee[â’, raises  ²ledError.  ~É e $'s& isKVyet a L €InvalidS^O K  À O  ž ^ � aY}Bset,â 3exc "is± d½T	�
¢ÚºHmakeõ  ÈÚ  Æ k  ÊŠFINISHEDj ; Ã -s.2('R{!isUæ&.'†§ PÀexception isÇ not None:
  õraise self._exception" creturn qresult
 Edef / (? )X B"""R9 6the' ò that was set on this future.W  ™ T4 1(or¶ g if noM H R) is § ¡ed only if£  L  € a  ' §done.  If  ñhas been cancelled, sF C ]ErrorB `isn't ] M yet> ÂInvalidStateA Y 5""" #ifgs) æ == _CANCELLED[ Õ Sexc =- Umake_º  _e¡ %()U  / Í  9 k ¬!= _FINISHj ; -s.Ì 4('E5 b dVset.'ƒ  õ	.__log_traceback = False’ ÁÔ X k@add_aP_callB sð, fn, *, context=ß
ˆdAdd a 6 à to be run whe�e€� becomesÇ�> !isJ øed with a single argument -YŸobject. I�qalreadys �  isG r  ˆ §   ò & i‘tschedul‰  # e_soon.QZ ïzPENDINGXªUloop.R (b  emâ;elsU$if“ Î  –
j  —G $ =+ £vars.copy_ È † .‘s.append(¢ 2 "))3Á# New methodø³in PEP 3148Ý VoremoveY
HR+ � all instHs of\Afrom ">Ñ ´c" listw  ú s, `numberJ  5  è Î — dÍ†filtered	¶ = [(f, ctx” h  Dfor + $ iØz >:   µif f != fn]* CÑd_count = len›©1) - º ¯ 9if J 
/ún[:] = O • ¶	R 0So-ð ³ed internal(€s (note:fóset_running_or_notifyg3())Ì C* ÷ ", %
=AMarkî‹ A and itò ZW  k
£?is ,ã™}À  InvalidSta£teError.
  5""" õif self._state != _PENDING:$  7 ð
raise exceptions.InvalidS7 ` G(f'{K 1}:  U!r}')K ! ’result = 	  Š »= _FINISHED  ñ_schedule_callbacks()
%  deÏ %t_¨ (q ,¸ )Ö ö"""Mark the future done and set an7 ._  	(If2 ¢is already= ðwhen this method is ¦ Aed, Cs¨ I A¡råif isinstance(Hg, type> Â  & =+(í!if6 F )�StopIteraH� Q "B Typ²)(", 0 in7 ðcts badly with genL Fors Ö M  "Ù’cannot beŽdT Qo a F"¼  8.Hâ Â$ ¯#ž D  _log_traceÏr = Truet Ó‘__await__Ï†0if Ï E  ½(  b  ’_asyncio_æ”_blockingg  )  @yielÿplf  # TÉàtells Task to ˆ ° for compleÄ¸� àdRuntimãÚ Â wasn't used×¬ ‘breturn­7 ()¤ 2MayÌC too¨µ__iter__ = ; , Amake¹ batiblej 'ô ñfrom'.


# Neededæ @test+Òpurposes.
_Py-# =61


¥Ãget_loop(futˆp# Tries9 1 .*  ) pÒt's availableN€# Otherwufæ G  us�  ´Qold 'q ¢' property= 6tryXl   =æ{ ÅÁƒ Attribu(; 2pas¯Felse ŠY ñ Afut.• Bset_°�_unless_c[@lled),1�"""Helperƒz ë @ P only1    8T .Ý!ifð  ¬  ° £ (j )½ tconvert:0excÍ¬ µexc_class =èA if  ¢oncurrent.¸ 4s.C<]ši
* ¢(*exc.argsk /elm Àrrent.futureós.TimeoutError:
  úreturn exception( ±(*exc.args)2 @elif, ÿ_class is concurrent.futures.InvalidStaten - s /se¯ Æ


def _set_… _…  _s} ( ’, source)K �"""Copy ' ‚ from a ; _ to a× Fß A."""cassertW b.done($$if £cancelled(w  t” .  7 8noty  Ú ôrunning_or_notify_5 É  R Ã• Ç$ =…  h   Á u 7Nond¢  ƒ . (hDverteEexc( )þ *el¯Fsult�  re Š  ¼ l    )ãDcopyt ²(Íc, dest\ð"""Internal helperÊ ; 	æsnother Í
6HThe   may be
9  £ ê
¸M Œ0 O/ • 
‚ … ˆ× ®m  ; 
–   å—  ”  % r   Chain	0inaÎC* C twoçðs so that when one completes-t does t.*ƒ @ (or
34) oöP will>`copied… Å ‘ .£!Ifº  pÂ0led|  ©e gets  B too< òCompatible with both asyncio.×H andIÙs G »0if v"is% E)C  @instÉ ,Â  œ ãd ‰ � G ’raise Typ13('A§ Ãrequired forÖ¢ argument'vÆ rË   Ð  ° ^Õ "� Ú êÁ_loop = _get �]) if ¼ lð None
    dest_lúoop = _get_loop(destination) if isfuture òelse None

    def _set_state(2 ‘, other):#  ' O $   ! b_copy_ L D ",  )K  � Y <  € ªconcurrentF ? ’ µ ùcall_check_cancelè b 7if ., Kled(Â ‘if sourceN1 is&< or  N $ d  Æ   A d (ô   ø   2 O .Ò òsoon_threadsafe(! S )  :º( Ô 8if B ù E and� †   ×  û 2notÿ 1and?¢ pis_clos=j  > ereturnU u6  P  q K	e ³ $ 
K‘ 1 Õ,‰WS / Q MY ,Ö Z Á  E   .add_done_�Qback(
 	y‘ Î 1 ª@)


vCwrapëw0*, Ë=/a†"""Wrap  .1s.Fß± object."""¾ «
§”/ Ðassert isinstH� r A), \<  ù/f'(  ùò expected, got {» A!r}'A !ifð  )  ó  ¡ = events.ä ÜY3new@! =G s.create & d_chain € &, < ½ b


try‘ ñ	import _asyncio
except I RError( Vpass
”C# _C£ñis needed for tests.  =+ =h àá
"""Synchronizß± primitives÷0
__ð _ = ('Lock', 'E< 	 PCondi  �Semaphore vBounded 3)

í `collec6 £s

from .  ÿ Kions ðmixins


class _ContextManagerM )I{ã_aenter__(selfô X`await  ƒ.acquireÑ  ò# We have no useWðhe "as ..."  cla ±in the withq> 3Ament9 Clock�   ‘o
¯ 3xit® ¡, exc_type
 G, tbÁ » `releas»  Ÿ(", @a._Loop›3S ð"""Primitive lock ÷$objects.

    A primitive lock is a synchronization$ @that$ ‘not ownedF ñby a particular coroutine whenY ?ed.n ain oneG ðof two states, '‘ £ed' or 'un ¹ I‡ ô created in the % C ‘.  It hasV ábasic methods,p ðacquire() and release().  W·  R Œ  ñ [ %, 6 D qchanges - #toñ V ÷turns immediately` C 7 #is7 b   bõ ös until a call to« 1 inC hanothey˜  it1 ¾ tÚ Ç V F rresets 3  z (edÄ g.  The} MÁ should onlyG !beS —K è ;_ � b%to½D ‘;ÁIf an attemp@madeä À" aó VP, a RFómeError will be raisedTö�more tha—Ê"isŽ× >±waiting forº 	Ô  Á  œ � ,& ñZ ‚proceeds-aF Í !()K š	\ T w; firstQ QwhichG µ   e¶ | sØ 	É ‘éàpwith 'a'DñLocks also supportaSñous context management protocol.· '/  _  ='Ñ* … u· bUsage:Ó × 5 0 = � !()S   ".._   µ .ô ) Etry:  . : kfinall!  q .µ‰ Cç ?r u¥  6
”  • ¦  ç  Ø@ canÙ0tes1forå  ì€%0if Ç»   Ied()c $
Ielse. #i  ,Q ?&  ­ 2"""÷def __init__(self, *, loop=mixins._marker• …super().8 /   æ K  ._”ters = N_ Š  î ˆ = False� Crepr� w  reI } & t vextra =³9if k  .Å· � ( ° 	R W 1f'{ 4}, ( A{len6ë 5)}'W !rezðf'<{res[1:-1]} [{extñra}]>'

    def locked(self):   ò"""Return True i( õ is acquired."""/ r,  E "._R b Qasynch 8 i  AR ! aŒ .9  … ÐThis method bV ±s until the,  �  un 0ed, Ån sets it to�   R and ¨ sÕ .! Ê ˆif (not Ë ; ¹ �._waitersz uNone orG  ³   ð
all(w.cancelled() for w iž %lfD '))q 9 	t =¥ 	] ¾   #if¬ š Ì[ # õ= collections.deque()R Sfut =U øget_loop().create_futur/ ¶ [ Æ.append(fut)É’# FinallyÇÐ should be ca#p beforeÂ$ C87Err]û# handling as we don't want3 1 toW Ð ñ# _wake_up_first()Ñ`attemp*  a up itÍ : :tryG  \aü E fut8   fò 
@   c Hr.remove0    rexcept  £

T <if ±
!  S u 		° Vraise³1 ;Œˆ Hqrelease'ØI àAWhenô g  R   ÊRresetÆ àÁ»òIf any other coroutines arel0ed Ÿ 8 †:•to becomei Ñllow exactly æf¨ m[wproceed§Ç Õinvoked on anµ ¦P, a R¹!meÔ ê nE PThere #no¦f valueë ¦¡
ð v = Falsæ JelseQ ­ 	Ã b('Lock¯ t'ô t • 
@Wakeu “˜© ermPit isàIdonej	î Ú;ers® Œ×³ßPnext(Ë±”9   StopItera-j 2 0# .° ô() necessarily means that aã EwillvRlater9dL !eiÕt' $ S, or,!Ewas eÒ " 0 wa9H ð taken already, ó will hit this again and wake up a new waiter.
  õif not fut.done():  "   ð"set_result(True)


class Event(mixins._LoopBoundM H ñ"""Asynchronous equivalent to threading.K !.
| C] àimplementing ej Ã objects. An ñmanages a flag that can be setN  g ±rue with th ‘() method!Arese� Gfals) Uclear+ 31TheC Ñ blocks until` Š �is true. 1  ‘initially™ n V 2"""û `def __( ô__(self, *, loop=gcmarker_ £…super().8 /   )h $ Relf._üüs = collections.deque(, �value = F� Crepr� …  reW ‹ & V ðextra = 'set' if Þ "._g ex0'un ´ $ · 
™P 1f'{ !},˜�ers:{len=ò 5)}'W óreturn f'<{res[1:-1]} [F 6]>'í ais_setK ë B"""RD   Ë  f@only  b‚internal• å Œ  … v s S£:he \ Ýñ. All coroutines 8@for oÿ abecome�` are adned. C? G!llH x() onceÜN  ä y Er at allÙ ì ø nø 
Ö 0 = ` H    Ð cfut in@ * j  ÀØ #      à   ‹ •  2�ÖP SubsXXntly,šucallingB Á "()D@J P) is 1  ed.t I ù.u À j	Ñaš é †  ( 
è BÜÛ
}Ù£!If&' ³ on entry, þß k  ò	immediately.  Otherwise,`„ 0ano Ps5 toýŠ z, n} ¤ 
2
 º v  ‘=�@get_{þ ().create_futur` ræers.append(fut,:tryw a.  ¤t  3ð return True
     �finally:
  ð4self._waiters.remove(fut)


class Condition(_ContextManagerMixin, m Ás._LoopBound )g õ"""Asynchronous equivalent to threading.e !.
Ÿ RThis € Äimplements c‹ ÿ variable objects. A  K ðallows one or more coroutines†  ý ñ until they are notified by anotherM : ¨ £A new LockŠ  ¸ Ðreated and us	 sZ ñ underlying lock.R 2"""ó Ðdef __init__(—,& €=None, * Cop=mncmarkerf Í…super().C Ploop= )h  $ !ifS  ¤  V £     “ ! =Ì "()“    Š #._   N �# ExportÜ   !'s_ ñ ed(), acquire()`releas rmethodsý a  ? Aed =A . i ƒ P #  
$ f $  Ì  ðÀers = collecÜts.dequeù ŒCreprŒi re; o& f’extra = 'Ç Q' if Ã  ²() else 'un 'Å ) �
¡X 1f'{ 3}, Ë Q:{len4Ë&)}W óreturn f'<{res[1:-1]} [F 2]>'"a© û  W O ÷ s"""Wait)  È!If	@callâ*@ hasPd'  û ¥ when this ¡ H ped, a RœpmeError graisedz -: ôq,‹tu b€ w  b @l it_ cawakenû ¹ Pify()<õ €y_all()   2 fo  pthe sam^1¦$inF|u.  Onceû x ,ˆ 3re-âÊ  ¯ ¾ Ìfs TrueD E „    ifµ 
r
IA	W�('cannotQd on un€  d | 'h(÷+tr[Rfut =ˆ P_get_ŒA().cP_futu  ¼ 'þr.appendŽ   j   aµI futQ   32	  1 
† 	    < “# Must re»:P even   ‰ancelled� c v = Fals o QwhileÂ 
Ê  ð     await self.¿acquire()
   ]break rexcept  ýions.CancelledError:2  [ c$ ‰ = True
& 5if ! @ _raiseq K öasync def wait_for(self, predicate)Z ö """Wait until a$ â becomes true.Z  ¿ 7The% õshould be a callable which result will beå ðinterpreted as a boolean value.  a Wfinalg  5 isF ”the retur8  5""" ƒ =J à“while notª  ç a< 8.
 8   Y 
˜ $ 9 �cnotify‹:n=1… By²ñault, wake up one coroutineÍõing on this condition, if any.ø 0If ! ‘ 2 D 1hasò îd' ƒlock wheX emethodL  j aÓP, a R'!meÞA is �d2is B Ç sÈ ³at most n o™ Õ sÖ 0for� w Þ P variW@; itt pa no-opõ &no Es ar%’  Note: an aW6ned3 D doedtuallyTvfrom itpã+ it©3 reL ¾  Ka. SincZ ð)f Ø pUlease2 ,k \ 2er RÌÐ!if¾– k 7ed(F™!§P('canv € ?3un-µ d² "')¦ A uidx = 0°  ˜bfut in_
:ers.0if 9 J>= n  S =R   É Œfut.doneÆ # ydx += 18    5 Bset_`c(FalseÁ gA_allk ëZ¦all thread‚X0. ThÎ'ac6likáW, butî%llÖd pinstead Rone. ¡Û ©/  ¦  = 5ed,M ¦ >  SLA(len4.åð))


class Semaphore(_ContextManagerMixin, m Ás._LoopBound ~F"""AB ° implementa¿¬4A sc ! m[ s¶/ 0cou:]qis decrF ¡ed by eachÛ!()R} and in+ ð release() call.ñ: The counter
    can never go below zero; when acquire() finds that it is& , qblocks,N ñ"waiting until some other thread calls release().
6 ñ
Semaphores also support t¬ ó
ntext management protocol>  Ò Ñoptional argu% @give° ðe initial value fo�   aternal� ;Ï ñdefaults to 1. If‡ =  U €n is les] Ban 0ù V] PError qraised.\ 2"""æ `def __Ž ‚__(self,“ ñ=1, *, loop=mixins._marker):B  §…super().A /   )$ "ifQ F < 0:  > �  ¤ %("sÖmust be >= 0"[  ¯ "._=f w   úÀers = collec�˜s.deque()Creprà  ü=ùæ & ‚ �extra = 'nqed' if z  Â() else f'un ^!:{& ¼ %}'¶ ? _¹ 
1n 1f'{ 4}, ( A{len¿.; )W óreturn f'<{res[1:-1]} [F 7]>'Áwake_up_nextR Rwhileá g 
¢ � * =$ –.popleft(9  cif notÃ g.done(l  "   S ú.set_result(NoneJ  ( ä É pÂ A"""Rbs True°èvojcàd immediately.5 k   o è ƒ2= 0€ `async [H ‡  !AcÅD a si; _ ái B ÇAlarg¼!anï’ on entryô > Bdecr–ãit by one and µ ú Ù  QiAŠ oZ  OoJÕcoroutine hasE  Yew Z ¾@makeÒÇ !0,Ÿ tÝ¤ C  ¬ ³ Ù ‚��,<=c5fut�@get_›à().create_futuGm  c ™vÊs.append(futr:tryú ; a6 I futQ nexcept. Q# SeeÇ°similar cod¦ Queue.getù  _   «fut.cancelM  >1> 0W e8 ?ledg @ û 
ö  % ¶á 3 p E-= 1 Çe cðself):
        "ð%""Release a semaphore, incrementing the internal cou £ by one.
  ñ'When it was zero on entry and another coroutine is wai` 0for: %toM òbecome larger thanT àagain, wake up tS Œ 5"""K ûself._value += 1  K ô_up_next()


class BoundedS(
 !):B b"""A b& 9Q impl8qation.
, ÐThis raises V‰ 0Erró 2n r|P() ifRwould} “ yº G Sabove�aitial  ÷  ó & Ðdef __init__(ý ,' ó=1, *, loop=mixins._markerÒ  È 0 !._× 3=> [ " uuper().c „ X  ] )ô  ‡ Þ  V e 0if  •#>= w d p   ;:,('ŸIýd too many times')¹ • �)
"""Loggâ‚configur¶L‚import l" ‚


# Nam€  aer aftž³e package.
 =8 @.gete Ser(__& !__| @Even` 3op �x ðthreading
from .Z � e6 õs

_global_lock = / P.LockÉ‘# Used asÙ É0el j ¥³ parameter
ˆ = objecQ_LoopkM1•_@ f= Noneë Úi] 
ýA sis not ! [  ì  ðAType)(Ä    Ñf'As of 3.10,*U *× ‡�removed B'F  Q{type% Ñð name__}() since�¦ @ lon‡šnecessaryK ñA_get T Ö  ž 2 = ½.' rrunning/ D  Ü 4 !isiJ  # Xwith 
  # F  '    ².‡  ·%op)!if/ « ¬) 
p ¯0Runs²0f'{. 0!r}= ÙÀ to a differù` ¥areturn  Ÿ# us¨¡a proactorV�related ´fes.

A! iúÐ"notify-on-coœ —ð" multiplexer.  Cur“ Uly a
` pis onlyxÒ edÓ�Windows „PIOCP.© ó

__all__ = 'BaseP§ Â  GC',

S$io
 $os
 dsocket 0war Tignal ì `collecÚ +s
/Qbase_ks Àport constanüts
from . import future œexception Œprotocol 1ssl ^ Ptransh 0 ctrsock. 4log� ðlogger


def _set_( •et_extra(P  ,  u):
     .'  [' ret'] = j $.TŠ pSocket(" #)
? yH L AnameN  7 @.get   !()C 0” †et.errorS (if¢ @loopB s_debug(Ã  {    ‘.warning(]    "| â failed on %r"ó , exc_info=Trueä €if 'peer´ ˆ' not in– _³ 'tr | cN  e  Õ   : 
 ! S# UDP;Qs mayŸ phave a Q  µ 	
Ž õNone


class _ProactorBasePipe
Nùs._FlowControlMixin,q  ¨  †  s.\ X Ó0"""  ‡ Ãfor pipe andí €Rs."""�øà_init__(self, 2ÜeÀcol, waiter=ì ¬  Ð S serv* ›  Ë ”super()._m 3 n Õ& Aelf.ˆ 7       .¢! =Õ 5  ¿± (	 \  ž  @ § 
B  _buffer = è 2  # Ûor bytearray.2 ƒread_fut4  _write �pending_' K = 0? €conn_los^  àlosing = False­ üSet when close() called³ 1eofr 4ten> x 1if L_Æ1 is ¯ŒE‡._attach‡E  K.… Q_soon`$._š.Þ  ec÷a_made,z °#ifu… ô# only wake up the3 7onna �() has be"÷ Ò ³ °”ðresult_unless_cance`  P  >,O#zCreprz- OB = [F_ÓP__.__›5__]¸ ¯0ock(© L 0.apk!('&d'e%elC   :ingç> 7ing? =  ’ € ð not None:
       òinfo.append(f'fd={self._sock.fileno()}')
/ R  if " õread_fut is not None:'  / 
\  0 ^    < /!r[ Pwrite  \ 1 ]   > ^ obuffer« 	B Òbufsize={len(ô ; @eof_9 ?ten\ S'EOF & Uðreturn '<{}>'.format(' '.join(H1))
\ádef _set_extra—  , ­)u ¬ ! ¡['pipe'] =% D  C ƒprotocolF  J  4 =  I Dget_ I ? × � % ; ¯is_closing9 
$ 8   e3 ˜  6ing ‹Š B  ’ * | = True Õonn_lost += 1 !ifíA C and Ú¹6 Ôloop.call_sooZ ’connectioz ,T{"j g†.cancel(K $ ! =n fq__del__h€, _warn= Pings.	 é} ŠµE P(f"un{Ñed transport wð!r}", ResourceWarningß  =Ô Â  K (³fatal_error¾ ð exc, message='F     @ on "Š '× :tryG�if isinstP(V 0OSEi 6  \  ñ (odebug(+   / rlogger.$ ‘"%r: %s",Y¼ `, exc_=³
;els� W  6!._ƒ dQexcepc•handler({Ý 0  '/$':9,( Q  ':ž & ê"':Ó M %& .[W }þ kfinall¬ù Qforcege°	'  - ]�ÀÈempty_waiterÝù û > (._' \.doneê if! B  wG   §presult(4 ó  0 ñ		�  F ðexception(exc)
   òif self._closing:
  ereturn 	* | = True Õonn_lost += 1 g šwrite_futi Z  •.cancel()A  � % f = Non� d Oreadc  b 	$ a € �pending_­ E = 0¤   obuffer< ò loop.call_soon(1  ’connectio>q, exc)
[ _def _% @ * N6try 6›protocol.i (h  (   kfinallA ó# XXX If there is a À overlapped 60 on&   o+ ½  V   P# end ön it may fail with ERROR_NETNAME_DELETED if wÝD Pjust ªPe ourS `.  Fir ûalling shutdown() seems to‰  cuÆ Qt, buŠ @be uûC DisùEx() would be better.G ¡if hasattr†”._sock, ' *')† À ï ) .' ( Ïet.SHUT_RDWRò $ .ö   oo !rv‰x e Å s  Õ1notP¸  : ‹._detach„ j  BK –i  »2get,_Q_size5#  # =‹]6 H  e ßG ³ L T+= leb2 [× ) õ


class _ProactorReadPipeTransport( IBase ,ž  ¢  tG  s.Z V ý 5""" B forG—pipes."""q_init__: , J , û$, Ü�, waiter=›  Rextra  ­  ™c=65536�  Ñ =“ö data_length = -á' ]aused„uper()._Ã ½ 	 ÐCtra,¢ Š  ‚ × = bytearray(½ â�  h o  _­<ing1 pÀ VFalse}$is2 K =t C Fand   ½6ingQ & T ê7 4 or  
¢‚ ‰	† £ À # bpo-33694ó: Don't cancel self._read_fut because “ling an
  ÷4# overlapped WSASend() loss silently data with the current proactorL ö implementation. 
 Q If C© ÂIoEx() fails^ öERROR_NOT_FOUND, it means thatŸ N  cos õted (even if HasOÔ 4IoC" ÷() returns 0), butH 2 .G$()é &ly
`ignore� +e ® M ±error. Once2c2is D !d, ãIOCP loop will ` P å €ion I/O é Ðt and so not ìN ‘result of w L µWSARecv().
 #if5 ‰ Õ.get_debug():#  /rlogger. P"%r pYs Qing",F )X @def � !me‹@ing(™S v @clos—!orÎ  ' !._\ d� ¿`  ‘ * … = False² _  
zis NoneT D ù ‘call_soonª  ._ ½ ,; Ü  | �length =ô  ._pending_+_ Š c "  U = -1' 2if 9 Z > -1¦ a# CallÖðprotocol methode after ½  E	¶ 5(),_  µ D# si•H Òcan decide toÔÓW agaiÈ D Î  .t 1ý ‚received."[:Ú #],ã I¨S }]~T_eof_Ž Ó}v Þ J EOFñ :try¸–keep_open)¿.ž )§÷except (SystemExit, KeyboardInterruptÉ  w 7raiùB QBaseEM  8jas exc� Êafatal_³(†  V   pexc, 'F#  # :÷€Á �ÍFed.'Ð  F ¸!ifé—   #e(' LH
Ï,™SF SE#.ell anyÑ Qe while"isdÎ Ó V# The; ½be|lled onü)? oassert<) = r ®FÀdata_length §= length
  ureturn
 #if& e == 0:  3 ùself._eof_received()! M  ²isinstance(? ¤protocol, 
 ³s.BufferedP )x :try  � > ó _feed_data_to_bL _! u  ' 
µ ûexcept (SystemExit, KeyboardInterrupt’  � Yraiseÿ J QBaseEU ®ion as excÀ ùfatal_error(exc,P  f   'F4  4 :E.ø `_updat™/ 'L Úcall failed.' z Ñ    JelseÊ Æ k@col.^  )[ñdef _loop_reading™§, fut=None`¥U = -1Â  J 0 = *   ifO q is not, 
¬  Â rassert ·  ‹ @_fut3   1or — .¥   u E andy  H  f ~closing] … ß b Ö g.done(&   ¡# deliver (ûlater in "finally" clau­ 9   o«fut.resultÖ &   	    ð%# we got end-of-file so no need to reschedule a new a†  ò =Ñ  "[:Ò ]/ ¾² 0the=ðure will be replaced by nextk°actor.recv :c  Q  Hcñ#l(ý    #if¨ Ÿ€# since ! Áe() has beenn  edY¡ignore any5óˆ rÖ ~ Ý# bpo-33694: . j �currently«Ðfast path bec>9 ofh 1# a} Á loss issue ) 2òoverlapped WSASend() rlation. š   !if¶pp d9F  TÅ €.ÇS_intoõSsock,¢ J²Ù`Connec½ €AbortedE¸â	Ï  Î>ingÐ ¨  â À çû on pipe transport¬%el\å ðget_debug():
          ó,logger.debug("Read error on pipe transport while closing",
B  åexc_info=True), ñexcept ConnectionResetEr uas exc:,  Y Àself._force_z ]e(excO /OSB Qatal_Ú  B @, 'F / rñ 'h ¾ áions.Cancelledz 
µ rif not ¼  ¶ :ing"  Û Uraiseí Jelse$ 	F jpaused!  E d  Æ ò_fut.add_done_callback(! Ploop_& 6ingÖ zfinallyV êif length > -1 r àdata_received( ,7 ô)


class _ProactorBaseWritePipeTP(  	 \ ‡  œ!s.` \ )¸ 5""" ` for w† Øas."""
ð	_start_tls_compatible = º" Ádef __init__RÓ, *args, **kwm  ’ …super().- ' m & Õöempty_waiter = Nonen © k  ^d `isinst†€(bytes,  ÷array, memoryview)A  ƒ }Q TypeÀ(œ      f"w ñ argument must be a` ÿs-like object, "?   Q{typeŸ  †name__}"�#if%@eof_ó 2tenº ƒ   ¨ cRuntim« ')  e_eof() alÖ y ð'ed²[ g!isš lh 0una	"to7p; sendfòis in progress')¸ ° � <a Yeturn) ›šconn_lost0 À   a >= coôúts.LOG_THRESHOLD_FOR_CONNLOST_WRITESO  œ ëðwarning('socket.Ö 1() jd‚ ep™.M > ® Y += 1÷râ �# ObservEfstates” ±# 1. IDLE: ùe¿ò and _buffer both ~   P# 2. Ý 9ING7 Eset;8  Ü˜ ï# 3. BACKED UP5 Ö6< ðWe always copy the ÙA, so u÷r can't modify itA 2Àwe're still ï1ing� P åI/O to happen.; þìafut isA:  #94 ->7  &Tasser}L< À
           ÷$ # Pass a copy, except if it's already immutable.
  ñself._loop_writing(data=bytes %))1 ’elif not 6 õbuffer:  # WRITING -> BACKED UP7  o “# Make a † ­ ÿ which we can extendŸ i 0 = – Rarrayš 	b ” ømaybe_pause_protocol(Â !se± ¦ £Append to u P(also® Oies)� .¾ ˜ Â Jdef ƒ Ì ¡, f=None, ‘  !):0  P6try   qif f isŸ , C and¨ ÙPe_fut   zclosingL  P ó# XXX most likelyM `force_7 ðe() has been called,v ¤  G   A# it* $se;“ 0to “ 
Z 6 ireturnM bassertè  #.´Û 	(  ! =c #   ì2ingG I = 0$  S‡f.resultV ¯ !if¨c8  Æ# =F]	n  E ¹  ¶  K a #if]  �Ôc  ñ.´b_soon(x  ñconnection_lost,;A C   m 1eof?>ten“  * \ àsock.shutdown( ®et.SHUT_WR^ ô# Now that we've reduced the™ size, tell K$# ÿ Í ³0me w2ingQ was *�d.  Noter J  ðwe do this last sinc-  ¸`llback÷ ? edi�ediatelyK   –ò it may add more8ta Ý 1(evUu�à #beÊ k again©‡  * NelseËÇ ApÊJ K £actor.sendO å½áÉU g.done(æ �  ý3 ¹º4 - O len¨ 
4 é P.add_˜ _à ìß  ù ú>ingá  N ~ sh '’ )   v  G 	‘ À_done_callba÷	ck(self._loop_writing)
  2if # óempty_waiter is not None and#  A Pe_fut    :K  V L À.set_result(4  úexcept ConnectionResetError as exc` \ ý force_close(excO /OSB `atal_eh  B @, 'F  ß   ñ on pipe transport')
í qdef canMQe_eofb)ª ¶return True2 [ . Ô Í a \abortY + _ÿ O— h_make_ÈC íÇ  ÍÑraise RuntimeV0("E' 'Æalready set"Œ¬ ‹ # =E ‹a.creatKFure(8 ¡ 1k` g‘3 Ÿ  /et;
? ! = ô


class _ProactorWritePipeT=( NBase  ? \�__init__»Ó, *args, **kw%  ™…super().- ' & û Ÿ´	�#_p­ Q.recvm ¦._sock, 16�ö C õ.add_done_callba_ +“dÆ_ b W, futÇ  if ·.cancelled(  Á G# thƒ¡ has been 1dé  , æ aassert_ |…) == b''# l N :ingüA 
øD z 
 . 
@ s, (fut,
Woa e   ± 	¨
¿ x -`Broken—Ê)w Oelse?    �á�Datagramà d  Óñmax_size = 256 * 1024Gõ  #", Žðprotocol, address=ö,;   “ a extra €  ' G $ =Q K   µ n " ð# We don't need to 
 N¦ %.cÍ÷_made() since our baseK pconstru2õ does it for us.& éü  Àr, extra=extcra)

  ð"# The base constructor sets _buffer = None, so we … it hereF Vself./ ûcollections.deque()+ ò loop.call_soon(@   ƒ_reading£ ádef _set_extra(  ˆ Eck):R   Osock' ê  G “get_write¨ Q_sizeR L ð
return sum(len(data) for 
 r, _ in ­ § \abortP , Àforce_close(K6 asendto7 ,e Qaddr=' ä ñif not isinstance›  , (bytes,  ÷array, memoryview)Ù  ïðraise TypeError('Õ ñ argument must beL õs-like object (%r)',q L  2typ” )Ý  ! ¶  g Ë   gœ  #ifV ü aess isð  P and   1in C,1 ê CValuë ¼ ‚f'Invali[ Eess: u Bor {½ { Zess}'Ù  ‘conn_lost¦  1 
ò â 2 ">=súants.LOG_THRESHOLD_FOR_CONNLOST_WRITESO  5òlogger.warning('.R!) ïpd excepŒ&.'† @ ® � I+= 1(¦ñ # Ensure that w "e 	 ²¥immutable.G d # ‚.append(´Á!),Ú45 ¬ fuö�
�# No curr», ` operaê õs are active, kick one off™ v A  E" # else: A  e]  ê  al§y[ !edY Z ¾ ómaybe_pause_protocol(B Ž_w  4 \, futø:try÷ H
   Ø ¸  `assertc  À  p .5fut¼  *  þ	#  ifI y A# We{Zin a ã 0) d„ ôúback, get the resulƒ  ‡ Bfut. 7    V¨ [A or D&._Ð 8% ’% L ÿ 4 °¡ has been ®d÷  1 €nlosing & w  ãå ¥ q =,à| C   rŽ'   M6# =‡.popleftl 0 ± Àf._address iÛs not None:
  òself._write_fut =  òloop._proactor.send( ]sock,H W  
Ydata)B ?elsœ +/tož 6     â +p  addr= é úexcept OSError as exc’b protocol.e) Ý_received(excN EU ?ionP afatal_M  D @, 'F  ö  1 on÷ ÷ gram transport'o ¢¬ D  :ó.add_done_callback’ Ja6ingP  !B Àmaybe_resumeqû 1()
!Qdef _B qreadingU `, fut=Ñ)@ ¶! =ç;  b 6try!   #ifàšconn_lost   $ breturn€     cassert<  ‹  ó 0 is‰ A or — (._  Ÿ E and�  H  Aclos/	=  d ì  [ !if‘ iò	Pres =' .t$ltk @  '‰ % * €# since ® Ðe() has been ðed we ignore any ¸ d	Ô  H   ¾   •  ª  l0ess”î 2  j , s = res,ÖA ž œJ 
3š k M  7 � Ñ   2¾Crecv¢¾.a Šmax_sizeÐ*1 a £ Ofrom§ 5 Oz « ˆBU áions.Cancelledè
;!ifŒš _8:ing"  ¹ Uraise‰W$ TŠ
öÀ            òself._read_fut.add_done_callback(! Aloop& cing)
  …finally:   zif data   J �protocol.% àgram_received( õ, addr)


class _ProactorDuplexPipeTransport( IRead ,“  ~   ? ŸBaseWriteD t� %s.˜ )ü 5""" a for dÃ ± pipes."""
¥ �def can_w� A_eofsD  ¶ Æreturn False3 / þ	aise NotImplementedErrorTeSocket¥ P)L-H±connected sÁ Mó_sendfile_compatible = constants._S! ö Mode.TRY_NATIVEY�__init__‡ , ú,i $, ¼ß, waiter=Nonek Rextra S serv* Ô…super().m g 	!, Q ,L €�base_eveÙ Àset_nodelay()Ó   D Õ   ¦ b_    =et_' G ¦?Tru¥2if £closing or 1eof6ten¡  ¥ 3  ? . 1 = }     c *pfut is ²
X I  þ ‘.shutdown@¦et.SHUT_WRŽ )‘ExXLoop(‡ "  &):=ê p K×	éñ logger.debug('U2pV: %s'Q 1.__:¶__.__name__H  | $._:   =Ò‡ W@seleu" @   #HÞvenient alias7 f& O ur} s) caccept# as = {}`  †0et Áõ descriptor => FutureG Ã .º <Ùé Pmake_ô _t( Pif thõÂing.current_  ()'   Emain 
:°# wakeup fdÂ  only be im�lled to aÎ �from the [ ˆ Ù  ºasignalÛ a 1_fdà 0._c". Hno()ãì _M6 ¾À waiter=None?,
  ñextra=None, server %):9 ÿ-return _ProactorSocketTransport(self, sock, protocol, waiter � ˆ ƒ !)
~ õ def _make_ssl_tr  :  <raw‚ ¤sslcontextŽ Ú 
“ *s ¥_side=Fals	Ÿ_hostname8  ¯  7
]  ¶ `handshÄ qtimeout5 _ % 7a = ssl S.SSLPN(ñ  ù õ ) nì 
Š 4  Þè õ â .  >sl_¼  ­  )Ÿ $¥ G ½ >  ¥  m º =¬{ ¦Z V._app7T†datagram" Ë  qaddressÚ
l µ  ó¬ .DŠ Th ­6 ‡ˆ W¿duplex_pipeÑË � û ‚ KPipeý và  ûö Oreadô Bò OReadð  Aº_writeÅ Bq è³ò0# We want connection_lost() to be called when other end closes
§,  úWÇ  þý‹ ãØ 0if LÇ.is_running(  · �raise RunÀÒError("CannotÝ 3 a : Æ event loop"™b ‚ da `ž q Pif th¤Âing.current_ W() is Emain ²À     signal.óset_wakeup_fd(-1)
  ð# Call these methods before closing Ô event loop ( gallingK PBaseE) PLoop.? °e), becauseG ÷y can schedule callbacks withI   ð_soon(), which is forbidden whenP — !is± 5ed.I öself._stop_accept_futures($ ¬ _ ]_pipe  ‚proactorÕ  | = None� 0ele=   R# CloÊ  usuper()t  ðasync def sock_recv(¸ , Q, n):(  àÐreturn await % %._É 9 0ock3 
3 [  Y_into` ?bufb @ g  : i ysendallg Odatah  ? (!, 6 d yconnectd addressg B Í < m ml c 8 Lock)Y _â _ì ·file_nativec  ,  ÷ , offset, countx 6try  / Ano =8 . Ù ex1ú" (AttributeError, io.UnsupportedOperation) as errd braise K �ions.Sendk ²NotAvailablY ñ ("not a regular• "¦¾ ðsize = os.fstat(V pno).st_ Ñ ç } 1 OSÀ Ÿ DPblockw " =y3 if	 `else f “ 0if í 5 • µ¡0  # empty Ñ 7 u = min( �, 0xffff_ ;send_pos. " +ž ,š )¯ 
3 n  8 Ó PtotalžVt = 0 uªwhile Trueõ Ù ¹ -Ôë Þ  9   5if  ^ <= 0`  ' ¯ «     -wg ljx – .6 +=� q Œ ( kfinall½7if 8 >ï Àfile.seek(ofð%fset)

    async def _sendfile_native(self, transp,  @, of< ‘, count):C  G óresume_reading =7 4.is %()- S U.paus3  TawaitA À_make_empty_ 'er* 6tryƒ ‡ Rturn B  À U.sockÚ (z _ Ó ,¥  O  æfallback=Falseá kfinallœ | _resetÒ  r :if O
ä  # L 
' (ÓÍ`close_B_pipÍ°0if  ." ·ú_future is not None{ 3 w.cancel› ¦ / ! =] l)  –.¹ I  7 c7  7 òinternal_fds -= 1=t y <1# A=-y `et, reîF. :- > 0._s# ,. $._�   !etšXetpaiÒ7 Û.setblocking(a' Q ' 	ê +ê Iloopö f=þ1kOif f* ÿ f. õlt()  # may raiseö $ ˆf… 7 ñ# When we scheduled this FÂ, �assigned Mov C 	ø ü‚. If it'ðthere now, somethÜ?hasM  0tri„ "o 
P the ]b while� c/Ð was still in* P  ðqueue (see windows_events.ProactorE ÿLoop.run_forever). InO  ñ that case stop Ø ðinstead of continuß %toTo a newN  ­iteration.  re‚	 3f =p» Q.recvj#F4096>rexcept  aions.CaŠledError1# _6Ñï°) has been v2ed,ù  C æ ‰for data© ¼ ~ ð (SystemExit, KeyboardI>8rup V
âB QBaseEÒ `ion asØ 
Â Ð © _3 Ùion_handler({¤  e Á'message': '0 on…{@fromT /„ðself pipe',
      ÷'exception': exc,
  Ê'loop': self %})- Uelse:  8  /  ._ ù_reading_future = f* ðf.add_done_callback(8  ._z 	C !)
: Ñdef _write_to! 1 )‚ à# This may be W ðed from a different th› ñ, possibly afterc  Ã �# _closeb ô_pipe() has beenU ÷or even while it isA ñrunning.  Guard forIñ._csock being None or n ‡d.  WhenF  a - e\ $ ÷, send() raises OSError (with errno set toG ðEBADF, but let's not rely on the exact>  Œ Uode).> ¯ =½  2if  !isË ‡ Fbreturn¹  :try! < .Ð Wb'\0'VœÝ 
6 #ifŒ Zdebug  g qlogger. ¡("Fail to 5ñ a null byte intoý "Ð  ?  "“-�"1 Øexc_info=True¹Ñstart_serving¹ñ, protocol_factory,e b °sslcontext=< Crver  Blog=100B 	ò_handshake_timeouM &):¬ i …!(f[ a ï Ê  bif f i\ œ š &  conn, addr†.result(ú $  ê( 
ò`%r gotë0ew o  ecæo%r: %rÂY  «"er¯ ,L © Å- =ÐÛ Ë6 ‘  ‡0._m¶ïssl_transport(¿
 f&, A<Q_side¬4  ñ extra={'peername':Ç}H =.� 
 º ~ kp�  $_ocket'$Ä 
	À Ð"is_+d(XÆ  :  $f ‡1pro/0.acÅ(&
p Þð  OSError as exc;:
  þif sock.fileno() != -1(  7 ýself.call_exception_handler({Z  2   à'message': 'Ac8 Á failed on a~ Oet',@ m o': exc*  Ê pet': tr ð.TransportSocket( )@ /})�  2 ~.close(!  el> o_debug6qlogger." -(" b oet %r"™  C  - ,ª_info=True— , "  þs.CancelledError£  S â Oelse/  ï aÈ‘_futures[D B]] = fM°f.add_done_Bµback(loop)
+ _Hsoon ðdef _process_events(. !,  f_list)¬ 1# E$ S are 7 õed in the IocpProactor._poll() method‹ Bpass™ { Zstop_ô € t Bfor  h  � .2 ‡.values(5  Ø5 !.c§eC cclear(4› qserving” ,Re a ? = R 1popW, NonV#ifØ `· p`;  6ock°6\ð"""Abstract Protocol base classes."""

__Q_ = (­T'Base0 H', ' †Datagram 4 3Sub ¦ 'Buffered Q
)


  g 	—"""Common¦  p¾ ²interfaces.LðUsually user implemË £ð ùs that derived fromy ¾ Flike" or  · l  The only cDIwhenK ¦ should be‰ áed directly ism awrite-H tL ‚  Q pipe) � �__slots_£©aconnec3Cmade«U ° Ya± ¶ &a ; @ is > ä  p  è @arguJ   âV Ñ representingý ± Q .½ H ño receive data, waitÐ  _ @d() ¿s9 W[ v 
§ Ø'd,l p_lost()¥  C &edD > ÓH 2  ·ô$  l ð or closed.

      ó,  The argument is an exception object or None (the latter
  ðmeaning a regular EOFI €received>  8 aconnecW 5was@ Rabort& …closed). A"""
 ñ	def pause_writing(self):  ‰ ð """Called when p ñtransport's buffer goes over! òhigh-water mark.k  N Pk û and resume calls are paired --� )ó  ' %ed• Fonce� „ �strictly� D ð(even if subsequ¦ Áes increasesÎ _ Psize 4 B amore),Î   ctuallyÙ O¿  · G ` Sreachx ?lowE�Note that¾  ‘B Requal¹ ‡,r 
ñ¢ 1notŒ‚¹it must go QA¿Conversely,ò 	4£ i¤®  È1low=acü MÀse end condiíF  ? im’Ãant to ensur$`thingsË €as expec™ Heithq0arkmGzero´ NOTE: This  pÑonly Protocol7Cback“&s Lrðthrough EventLoop.Òp_soon()ô±if it were,	 Åould have noF 0eff5¼ i~Ñmost needed (  Ÿ  app keeps Ð5ingA Ðwithout yield\_untilq2½ä3"Ádrains belowhô5 Se¤Ö) for details•Öe
classŸT(Base¬ØÁ"""InterfaceJ ƒstream pÓý Áquser sh�QimpleÎtC .Ÿñy can inherit fromw+ “ ‚but don'³2 to9  X a×r here d÷!noÀ!y> 0raiL#s)° W¡µ PwantsrÝests a º,r0y p*aø ± pfactory: Òa utility funah(e.g.,Èfreate_„-()�   Bð made successfulB! _ (“�  & {æith a suitableÈ HItn data_!()C bwill bj@ed 0n ºp times 8 ” (bytes) @ Ä (G ;P; finê,‹yð_lost() will be cað@lled exactly once
    with either an exception object or None as an argument.

= òState machine of calls: ñ  start -> CM [-> DR*]	 AER?] L 2end2 À* CM: connec„ q_made()¨ õ* DR: data_received ~ER: eof )CLO Clost5 2"""t â__slots__ = () ;defj Qself, !):�  þ Q"""CaV‘when some# D is ¤ .R  / 5The@ # sa bytesi.W 5  ‡ 	×  † € Qthe oÈ2endŠÀ write_eof()ÊvequivalÁ ˜ QIf th³ ñturns a false value (including0), h •transport¶ Ðwill close it© ´.  If it reX 3truW ,+  U "thˆ Š V  Qup tom ‹protocol#ó
class BufferedP& T(Base .ô	"""Interface for stream Z �manual bQ  ‡ tru ã  Imî Bant:-àhas been addedª ñasyncio in Python 3.7< P*on al `visionc ðasis*!  Consider(abòexperimental API thafðmight be changedÑyremovedu 8tðEvent methods, suchÆô`create_server` and  {!`,»  ac¡ factoriesŽ Ò Ò ˜ Pimple¹ "iq�  ÿ@idea'´ ð è PllowsR�¢ly allocat) ° 0conœj·2.  ø �loops can% Pn use	 & Ü Pprovi½!by  to avoid u‰bessaryÙÑcopies.  ThisE  a `result„ð
noticeable performance iml  ~j 9H Æ  ig amounts) ð°.  Sophistidx ~ 	 œÀ#onçA at ô ÖCtime‘½!GB»aBU?]]* Æ"‚GB: get_¦ ŽS* BU:œo_updatÞL‚  ¬£, sizehint1 Žß ƒd a newß³ Q 5 *I *Ôa) Pommenhqminimall † ®!ed B A.  WU et"-1x B  ýbSwbitrary† 2MusxÀrn an objectó that implements the
  ò:ref:`buffer protocol < ¥objects>`.0 òIt is an error to return a zero-sized ? 6 A"""
C 3def ñ_updated(self, nbytes):&  œ à"""Called when´ 9 S was = Q with âreceived data.m  G *Y *¶ ñthe total number of w " were writtp oŠ  7 Ñ 
Deof_€ Ï Ç ñ other end callss ÷e_eof() or equivalentÇ sIf thismñs a false value (including None),•transportÊ Ðwill close itx‡.  If itX 3truW ,+  U 1V  R up !;ôó
class DatagramPaT(Base .ñ"""Interface forÊ 5 —.Gâ__slots__ = ()î [ ý 3 
�,K c, addrm  bAsome)  A  Ý Ów  c ø` ?excY 0a sí3or R ñ operation raiseP0OSERô!(O)ñ than BlockingIO&  (-arupted %.)è({¤Subprocessp}ÐŠsD ³‰Ppipe_Ž*"fdŽ/ Nq  ‘!es™ð into stdout/stderr i 4 fdºöint file descriptor˜ –  % úã ;  ì ] p_connec®Q_lostá , È ö‚ p associô·Pchildá ¡5 isÃ¦dÚ  Þ  Á!as³/edÐ 	D_exizˆ„Bhas 4 ú
R_feedä2to_!1ed_9( 	ê w°_len = len( ±!whª0ata Pbuf =cto.getb 9  ) =  ª0buf Y 6buf `if not9 " \  7 {� RuntimeB'('h )!edî@mptyH Cfer'q E iÏ ] 1 >=¥  
i Pbuf[:ð   "] ' é F ..C2 Î  + n> Oelsen  Ðbuf_len] = daçta[:buf_len]
  óproto.buffer_updated(* )* pdata =  [! :L    b p = len( õ)
__all__ = ('Queue', 'Priority ELifo 	 @Full+  ôEmpty')

import collections ãheapq

from . ( [locks ö mixins


class ` `(ExcepU !):ú â"""Raised when* ð.get_nowait() is called on an e¨ ) 1"""F ;pasn  Û m 3theH 'puq kmethodx S full. v (ù À._LoopBoundM
ì 0A q ð, useful for coordinating producer and consume# ¡routines.
ñ  If maxsize¨ ðless than or equal to zero, å t  . ñ infinite. If itP  is[ò integer greaterS 0D @n "a‘à put()" will bü¹1theI k treaches¤ q, untilc 0tem³ óremoved by get()Ø aUnlikeµ òstandard library}ó, you can reliably know thih!'sê Ž `with qù �(), since@ r ðgle-threaded asyncio applica¡‚ won't bØ  Prrupt´ aetween— ´a ³ do  Š2perH !onÐ .—  A	 `def __Ž„__(self,3Ä=0, *, loop=UcmarkerM `…super().C /   W V $._-=` G E p# Futur[    4 ˜getters =v.deque(` ? /pu? k u“�shed_taskt 0!Ž  ´ !  ù rg.Event‰ J '  .sVD  i()`# Thesrñree are overridable in subÅ  O ´J  r ±—Relf._
=I  ý H ? preturn  F p.poplefî :  ‰ $ g, item@   9 qappend(" ñ aEnd of”ì ÷s‰æ ³wakeup_nextž 7ersn ‘# Wake upQ  +  % � (if any)G@t isNPcanceÍ	 ßSwhile4 s    I =    cif not% g.done(¡ & M  Æ_result(NoneÉ( Rbreak,b_repr_ŸW ¦À f'<{type(seðlf).__name__} at {id(self):#x} { ó._format()}>'

    def __str__.    ò return f'<{type d S ðclass_getitem__(cls, H ,):b 7cls� £  ° 	+ ósult = f'maxsize=€  E!r}'Y ¡if getattr¶ ÷, '_queue', NoneX é \ +]  ) a={list= . )a  ¡ .á FtersÔ Q 0get# S[{lenR  9)}]´ S !pu0 S 	# S  S ÿ unfinished_task¯ 	  \8 c re<¿q›æ eÐ"""Number of ‘s in the –E."""»X ,# )b ‘@property/  ¼þr allowedz …X w  i _emptyg  R&vTrue ifÕ A is 4 ÿ, False otherwiseï Bnot y ï w Ofullv sre are ¸ fU   TNote:® Q0 wa”äitialized withM @=0 (­‘default),~ I Qthen £ )ð `never .# Ü#ifå ¦ L<= 0èu3D Oelse' 3sJ) >=^ ð Qasyncç"puÑ,
ŸaPut an V intoÈ.G  î % + Iû õ, wait until a freeÓ @slot3àavailable befoÅQddingŠ ERwhileê  e (É  ¥  õget_loop().create_future()‹  6 I_< ’s.append( 
) :tryŠ > aè / 	W nexcept1 + ð.cancel()  # JustœRcase      †done yet u   Ž   r# Clean'Ø b from u #ede sV  A 
oremove - ç ¾ ValueErrorò  ' E# ThÜ ’could be \ d� 	w Y by aP F   ð# previous get_nowa¯it call.
   Mpass ñif not self.full() and ýputter.cancelled():?  g ð# We were woken up by get_nowait(), buš �n't takeG 2the¿ `  WakeI   Ïnext in lineÚ ¾ €_wakeup_/ ( Â -s)p Frais† breturn%pu· aitem)
< Gdef   ^ !,   ‘"""Put an ` into ¿ òqueue without blocking.Y  @Iƒñ free slot is immediately available, ·   QQ (Fuç1"""¨  O "ifÊ Î    A 4  Ñ a._put(Õ  ûunfinished_tasks += 1$ " v.clear(s[ œ ge^sa`async g1get¾m‘"""Remove›®hFfromh
W{ is empty, Žf until§sa]PRwhileSG É " =# _ø÷loop().create_future Š< ’s.append( < ) :tryÄ  aÊ / ‰  nexcept1 + Ì‘()  # JusW@case®0ter{ †done yet \   Ž   c# CleaE Qters �A#ede sV  A 
rð - ç ¾ ValueErrorò  ' E# ThÜ ’could be \ d� 	w  ¸aP F   §# previous­0 lKÒ s	¡mœmfÂ m ,$: ž	.Rß10if ßfHelsekE=µlÎ
†mC ) d0 ñ .ÊrÕ ð item

    def tóask_done(self):
  õ("""Indicate that a formerly enqueued task is complete.
@ �Used by * ð consumers. For each get() u( ¡to fetch aS ,F ña subsequent call to# ´ ³) tells thei «   ¥processingM !on) µ ±If a join()× ðurrently blocking, it will reÑ ` when ˜ ¥items havep Sbeen ˆ ´ed (meaningO ˆ Ç Û Àwas receivedme everyO  b < Bhad ] uC in)…ñRaises ValueError ifGÀed more time?a€re were j µs placed in‚  XÐ. 5""" 0if EÐ._unfinished_å fs <= 0[ brš ™  ('*  _roo many§ %')j g E-= 1$ Ž =Ž P µ  .sšË’async def ) 
%Bg untiliP” °@gott0&nd¯ÖThe count of Eñ‘s goes ups 1 anª ª1add0 á« V B GdownD ›sl ‡%toL i 	 % ³@trie´1and`work ož  œ  ù  W5 D í PdropsíRzero,}A) un‰s€>Sawait®÷  ð()


class PriorityQì( û@"""A™( 1of  B; re
@s en
 0s iG ô order (lowest first¬E/ a“0ypi€y tuples , ~C: (p– â number, data) �² °Q_initÖ“, maxsize¿  ƒ É!._"R = []î8 $pu7  ã°, heappush=	  q.   M  n V  *7em)X  ð w R (opQ 'opP breturny (opV žALifowš6žAmostjÜ<²˜.JAá  (€.append(l.6 = ò!pop()
__all__ = 'run',

from . import coroutines À. import eveð^nts
from . import tasks


def run(main, *, debug=None):
    """Execute the coroutine and return the result.

5 ÐThis functiona s$ upassed D ñ, taking care ofq Pmanag  o ðasyncio event loop x pfinaliz& " qhronous@ ¿generators.� ñcannot be called when another N 
p iW @runnp !inË 0samCreadg "If=‘ is True,( ¹ @willx crun in- CmodeA 
5üalways creates a newÂcloses it atn 1nd.�It shouldq uuaD  çö  entry point foô ‘programs,c? M Àideally onlyP 94onc» ‚Example:q I _ t (M    0awaµ Ý‘.sleep(1)m     ëprint('hello')Y 4io.¶"()8 1"""@ "if&ss._get_·_; ()œ þ àß k ñraise RuntimeError(K     "Í t -) B[aç"ó"¸ 0if v øEs.is | Ž CValuŒ &"a2ò was expected, got {!r}".formatL v  ó $ =Anew_š â 6try Xs.set)  F b iå Ó 
I "  0 D J( @ 1% @run_t@l_co>"te¿ š âlž 	«  i Á_cancel_all_Ï(V k  $    *h  ‘shutdown_ßDgensL ;   ' §   ?  default_ex'(orF Ç  W i K¾  ä#()¬õ Å#to " =á.�- <  ˜ �k  V ª+    .� œ  > -  + @s.ga`%(*L ", o `_excep( s=7)¾� !ifã „ <ledc�continueN   2 p  - Í  èŸ ¥_handler({S  *   â'message': 'un( %d i @ dur;hG@.',P ; "':ç  /()/   c*  À     })
"""Eö#vent loop using a selector and related classes.

A! ðis a "notify-when-ready" multiplexer.  FL A subE ð6 which
also includes support for signal handling, see the unix_eventsN ó-module.
"""

__all__ = 'BaseSÅ Eà ¡Loop',

ime 0colâ Dions Terrno …functool  Tocket0 uwarning óweakref
try:
    x Ássl
except IŠ ñError:  # pragma: no cover7 ôssl = None

from .J Rbase_
 ›constants - lfuture+ `protocÿ 
u 1ssl Z PtransXH ctrsock. 4log½ ôlogger


def _test_aÔ ( a, fd, » )J‘# Test if( ° is monitorÃ'2 '9 sK#Z EÀfile descripåQ'fd'.$ ¯ ³Ukey =êÁ.get_key(fd), Ç2KeyÄ  8 Áreturn False Belse¼  ‘bool(key.ª 2s &¬ ) check_ssl_C0et( 0if ais not©1isiú!ce- ,% Q.SSLS«< ƒ ‘aise Type» "("" @ canQ µbe of type > "™ ½\(�." vx 4"""‘ê r!.
"2See %s.8 ¯òAPI specification¨ï Ê @p_init__4f+ Ú0or=6}  + ”super()._/ )|    Q. I : ± ! g”s.Default× ( / à‘.debug('UVC V: %s'§ 1.__W¶__.__name__H Uself.Ž6 j " @make' gf_pipe‰   3 = ›Ð.WeakValueDicZCary(VT ;_A dQock, ¢col, waiterE, *,ž  ¢   Qextra  #rv; )tD_\¡Th‡ 
 ’ ˆ ƒ ü 'slù 	Ô  WP, raw•	ªsslcontext	> *s a_side=) @host	8 ¯  5 se7
ð  2 8 sh…timeout= ð_HANDSHAKE_TIMEOcUT):
  ñssl_protocol = ssl S.SSLP (- 4 q self, ) @col,6 ÿcontext, waiter,4  Ñrver_side, se �hostname.  ðsl_handshake_timeout=­  )k ò
_SelectorSocketTransport(° qrawsock¯ ô { å  aextra= º =Á { `return	Z t._app_t… 
§ `def _mÔ †datagram" § ¤ ]7 Œ 	 Äaddress=None€ µ  ó¬ .DŠ 0‰ � ’ � !, ˆ )Qcloseð ˜ !ifYÇ.is_running(  ] �raise RunáError("Cannot R 3 a : Æ event loop"¦b 0 da Çs 8!._+ _ f_pipe(P �super()."  h  5 ‘@ is ¦  £| Ó  W .( J # 0 = F L   S 9  ñ ._remove_readerz0._sâ—.fileno()× 4elf Û N : Š  ¤    cU 7  7 ÷internal_fds -= 1á 0 ^ € 
 à 1# A8-y ïet, really. :-Ó  Ä à � 7 . GpairÉ k 
€setblock˜\False^ Q .' 	ê +ê  =  n ?add§	¿  ÊP_from=f\ �Acess _gï ,  8Gpasse
P 3 - ªwhile True¿:try  È  i  LG–recv(40965 *   !if 5 K  ! Ubreak”    -;proì  H 
e €except Ibarupted;m  ÄIinuel > Bû/IO= ¦ ; å�write_to‡Oð# This may be called Í� a differ¾ th•ñ, possibly afterc  -# û¤) has beenU !orÀ while it is#
  ÷.# running.  Guard for self._csock being None or closed.  WhenF  a - Set is$ ÷, send() raises OSError (with errno set toG ðEBADF, but let's not rely on the exact>  Œ Uode).> ¯ =½  2if  !isË :  ureturn
 :try! < .Ð eb'\0')+ dexceptÝ 
6 #ifŒ Zdebug  w qlogger. ñ("Fail to write a null byte intoý "w  ?  "·S-pipe�/",1 âexc_info=True) ðdef _start_serving(W ñ, protocol_factory,e b °sslcontext=< Crver ¿backlog=100B 	ö$_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT)g · Ð._add_reader(¢�.fileno()‘  å acÁ¿_connection�   ì  V  ç #, â N >sslà †› (Ï à —   ÚŒ¡ �Ð# This methodñonly called oncelðeach event loop tick whereôò p# liste«y et has triEñed an EVENT_READ. TB ÷ may be multipleN ñ`s waitå ûBan .yr() so iÓµ Ain a¦ vñ# See https://bugs.python.org/issue27906ì Æmore detailsC  w ³_ in range(:Ê ê”   Å �, addr =» ê  '   � $ 
‘`%r gotŠ0ew j  Ï from %r: %ra U l¦ ,H >      ^ �.setblocksZFalse( j#(B$ !IOPÓ, Interrupted CÍDAbor Q x ñ# Early exit becausvL2et 	p bufferÂVemptyº D   AZ	y´ ûfas exc¢ ;    )1ereïú  ndí n@ jus%Ng it„  if] .YAin (
 ð.EMFILE, errno.ENFILE,
  õ errno.ENOBUFS,  oMEM):
> ÿ&# Some platforms (e.g. Linux keep reporting the FD asJ ñready, so we remove4   ÿ handler temporarily.H ÿWe'll try again in a while2 óself.call_exception_o /({d  
ð'message': 'socket.ac? ÿ() out of system resource',M z o': exc* l P': tr `.TranscS… ( )@ /})�  _q_m!erF Ÿ.fileno()7 7ÿlater(constants.ACCEPT_RETRY_DELAY�  G ‰ ßstart_serving9 ñ protocol_factorEðck, sslcontext, Q /erP qbacklogA Þshake_timeoutOelse ú&raise  # The event loop will catch, log and ignore it§] ðextra = {'peernam‰]addr}ä—2 = ` p_connecí-2(3  –U 3 !, z \?sslCœ Âcreate_task(§ !)
œ ²async def _ ¿  I /, ½ T  ä   %T=None* * Ë =ø÷SSL_HANDSHAKE_TIMEOUT9• 0 = j \ tÃ yWB  ô(—dwaiterõYkfuture* 'if(
o  �  \0._m × A/¨ 
2Ÿ = •±£_side=Truez=€berver=& B {=º  ßÔsï V
x_ ú UÛ   è ï  +tr'  ab à waiter
        Áexcept BaseE Qion:
  ýtransport.close()" ]raise ð# It's now up to the protocol ahandle Åconnection.
I Ÿ ú(SystemExit, KeyboardInterrupt)± 
‹ B 	á z as exc7 êif self._debug  µcontext = {Ÿ    ž'message'; # •Error on QP creaõ æ for incoming /',n Ø Pion':Ì & }8 &if|i–ot None° ï $['¯E'] =@ \ Ô ] 4 ^  _ šUcall_ø _<#r(ª )6õdef _ensure_fd_no_V (F G, fd1µfileno = fdu òif not isinstance(& L, inm>try@/   =0 < . *();Î ± (Attribute"T, Typ BValu · Rð# This code matchesÆ€ectors._u Óobj_to_fd fun`?  3 j °(f"Invalid C ñ object: {fd!r}") from=5	w  =“ &f.‰ s[V 5no]> 1Key
SFpass* +ls²¯p @.is_§Oing(3 ì bRuntimX(]   óf'File descriptorþ · is used byÇ'D {— H!r}'¤¥add_reader˜ , ã·back, *args¿  ¼q._checkÞ 'ed†± = events.HW(N  M ,‡,·†¸5key²1selK¶.get_key(fd: ´
¯ @ ±register(fd‡ V Îs.EVENT_READÀ „ (é Ä ‹ rmask, (aò, writer) = key.&, Idata¼º Pmodifù  , T   |F¿ "½ � ¿  ç 2if ­  ` ›$  .c—lrreturn  
dremoveiÀself, fd):
   òif self.is_closed():
  Åreturn False :try& Rkey =J õ_selector.get_key(fd): ú except KeyErrorF l Jelse' ñmask, (reader, writer) = key.events, Edataz  Ï  : T &= ~¤ És.EVENT_READ* pif not 1 
}  G 2è ©unregisterë  * ½   @ Pmodif',p u, (NoneÙ ,)
š ú 1 is¤  - ¤ $ †.cancel(� €   l6Tru×  ² . � ’def _add_(Ô ÷, fd, callback, *argsP $ u._checknM  y ’handle = Â!.H (N  M ,d , ô Ô �D¯ +.å‡ åAeWRITE,Í  Ñ  Þð )Æ z ~é#» b  |GÀ #wÀ  ð #if��4�g[ ÷hlremovekZA"""R$ $ a� 9E."""˜ïÛ## Dboth�and connÿ. ¾ pÞ	+  kÝ _ƒ#   ‹ * « ’"""Add a 4 I	ÂÚùensure_fd_no_transport) ƒ àfd, callback, ñ*args)

    def remove_reader(self, fd):!  % A"""R$ 2 a & Õ callback."""(  ; õ._ensure_fd_no_transport(fd)) rreturn 0 
  ' (  š ‡add_writ— ,{ ", É 	¨ bAdd a 4 * .¦ #Ÿ „ .fd~ G| G& ¢ G6Y nGQasyncç“sock_recvœ   <, nèðceive data from the + 2et.ì  RThe rÅñvalue is a bytes object representingE S !re` !d.� K òmaximum amount of€ dto be 3 q at oncl Åspecified byJ n€ Z T²_check_ssl_Í ( ’#ifŽ‘debug andõ ö.gettimeout() != 0n ½ praise VvError("/P mustÁ Önon-blocking"s ;tryM Q ™ .¨n- “except (BH !IOp Ñ, Interrupted Ï ¡ Epass!Rfut =è æcreate_future(h  fd" §ock.fileno Þ`handleH Pelf._A6(AG  å �a, fut,m �¬ .: Tdone_n(  Ü ñfunctools.partialÙ.áÎ_=  Ì", ” = )ð rtPawaitŠ ã |G \ L ± J W=Nones#ifj    s or not ·.cancelled(5  Ì 
Ž ¾…  F 6H'# * À) can add ita ¥ as an I/Oy1 if��operation3 %'th#Á Gò immediately. Don't use it directlyËÛ&()Œ if^.J û ƒr 8=W 6t ð  # try again next í‹ uõSystemExit, KeyboardxÉB QBaseEÂ bfas exc´  ‚fut.set_s vion(exc§Oelse1 presult(%Óò à_into(self, so³ck, buf):
  õ"""Receive data from the socket.
* RThe r+ d, ñ	is written into *buf* (a @ablel [fer).E Ñturn value isn ånumber of byteX 9 5"""E ²_check_ssl_¦ ( )  ñif self._debug andÎ ö.gettimeout() != 0 praise V— vError("ö must be non-blocking"s ;tryM eå  ™ `.recv_"(|§ “except (BO !IOw Ñ, Interrupted ¯ ¨ EpassE Rfut =ï æcreate_future(œ  fd" §ock.fileno 'ö
ensure_fd_no_transport(fdD `handleH Yâadd_reader(fd, Œ_ì a, fut,yt³ .A ådone_callback(  ã òfunctools.partial(ª  Oy _=  , } › = )³ r‚PawaitŒ ÊKdef ª \ ¯ Ï#1 À) can add it™ ´ as an I/O Ð 1 ifÙ•operationà #= 'M Å ñ immediately. Don't use it directly,V A V` ifë .Y (7F ²nz=³´=} ð  # try again next ‘” õSystemExit, Keyboard×  ¶B QBaseE_0ionž6excÑbbt.set_s vion(exc=Oelse1 rresult(.)U`async [šbsendal´ ]º c"""SenH!to+ < r õconnected to a remot¬ö This method continue+0to š ¼è • ò until either all  €has been3 ft or aÂeÁ occurs. NonÇãñed on success. On . , l& i– vd  drL `no wayä ñdetermine how much  ,`vany, waL w �fully pro„ Ped byZ ½@ing zo Q?ionl§n˜ à ß(ÕÉÐxcept (BlockiñngIOError, Interrupted G):
  en = 0
 ûif n == len(data. `# all  U sent7  Q freturnK õfut = self.create_future()7  fd" §ock.fileno 8 ö_ensure_fd_no_transport(fdD ð# use a trick with a list in cloA € to stor( Õmutable stateŠ `handleŽ  ° ò _add_writer(fd,Å ð_sock_sendall, fut,  ,E   ¢memoryviewVV, [n]Ä @fut.s édone_callback(X òfunctools.partial(" ‚ « _>  , ° Î = )h £` awaitÁ ­Idef Ý [ â  º W, pos ifC .v (  1# FëÐ cancellation ð be scheduled on previous loop q, 	û ¶  @starZepos[0] >tryÚ .³(Â [; :yïexcept (Blocki6“ G õSystemExit, Keyboard€$Frais€B QBaseE”  1jas excÖ  +Bset_1 vion(excâ ~� ö G += � if Hì ¡ j ¶result(Noneh Jelse™ � B  Z`async ` ‰ƒ_connect_  ˆ, addresXB"""C)  ·�a remotekTet at3 .d  ò õThis method is a coroutine.5""" @_cheÌ!slø0et(� Þ  ‘debug and ú.gettimeout() != 0Óa ValuekE("th¹ @mustÿSnon-bo&")Ä  z¡ot hasattr‘ òet, 'AF_UNIX') or† `family€  ¶ 3et.# � `esolvebð0Rr 
e L‘", g =d . r, proto  ,¸=[ > F 5_,  R 4 = v  ¸�( ` .«D� ç
ˆJ  J¢q*\ õ • ±kð# Issue #23618: When X!C  )u Àct() fails w÷ith EINTR, the
  ð'# connection runs in background. We have to wait untilG { socketN ñ becomes writabl8 ñbe notified when> w «succeed orM ifails. ùself._ensure_fd_no_transport(fd)- ’handle = 6 @add_˜ 9er('  3fd,&  × _ž ‘_cb, fut,í š, addressf @fut.[ �done_call?b  òunctools.partial(– p — _B  , ‹ º = )p ùexcept (SystemExit, KeyboardInterrupt):ß FraisõB QBaseEM  ùjas exc7  × Bset_1 wion(excŠ ?lse1 Ñresult(None)
Š [def _è þ í aë =6 X 2if  @ is  0 orM ».cancelled(õ \dremoveô � ç� ì	�   ¦o breturnî  O6try8   0errˆpock.get@opt( Òet.SOL_SOCKETi f_ERRORq F 0if I J!= 0_   `# Jump©0anyÐ *Êclause belowJ 3 ò OSError(err, f'C Ë ƒCed {ú&}'‘ Á (BlockingIOG %, ‰!ed ›#M etÓñstill registered¡z  E  w pbe retr>Jlate%ApassÕ Ï ’ ›`async $ 0_acã�  ?A"""A ' a¸.x4The^�must be bÈÀ` and ls‡ning forN q N rÚ` value²€a pair (; Ø!reF % 3new‰ ž”object usAsend‹ ìreceive data o ,$ �N !isG æ tJ `other l !of4  » ò5"""[ ¡_check_sslµe¨ù#if+Qdebugž  ¨ Ù®timeout() ¤mVI'("¬ ®Snon-bQ"s 0fut? ýæcreate_future(# ò± CÀpt(fut, sock3)
  ñreturn await fut
 ðdef _sock_accept(self,   ,  !):'  D Afd = †.fileno(\ 6try(  , Ôconn, address7 b 7 * ö.setblocking(False$  ex— 3 (B  ñIOError, Interrupted ª  X  È ö._ensure_fd_no_transport(fda  - `handle¨ òelf._add_reader(fd, K  %  H @fut.= édone_callback(# ' ñ nctools.partialv.ˆ y _A  , } › = )· õSystemExit, KeyboardUraiseŽ B QBaseEeªion as excÍ Ö Bset_1 wion(excŠ ?lse1 ‰result(("))zbasync €0endTq_native", ¯ ,  ÷ , offset, countØ 3del¡0 Rorts[ Q5fd]ô  ’ !meÝSing =e 4.is 	Ö 0U.paus3  Jk °make_empty_b'er* 	Œ_^s(U   ,Ò  P fŠ=\kfinall»| !reôÒ  r :if O
 # L 
'  $ ÿ œ½¦82ãprocess_events1 H_lis öfor key, mask in & 
°  g`obj, (‚Ðer, writer) =A õ  ‰key.dataƒ"ifa &�òectors.EVENT_READ and W » is not Non6 T yº._cancelled§  &   7Rremov� ­fileobj› )   e£    G  ´¯¨ 
E ß QWRITEà /à ' à 4 (£
›  Æ à M †N�stop_serv€ ü  *._n � ”  ñclose()


class _SelT„ ¯ÿ._FlowControlMixinß7 L "):ðmax_size = 256 * 10ñ24  # Buffer size passed to recv().

    _b$ ð_factory = bytearrayB óConstructs initial value for self.A O Ð# Attribute up ’in the deG ñor: it must be set even if' co !orž ð# is not called (see _Sele® óSslTransport which may start by raising anM ¡exception) Â_sock = None`def __ê 0__(ß €, loop, * ð, protocol, extra=9 �, server !):Y  Y…super().O 3 P  & C  ['e �et'] = tr .ß pSocket( = 6tryp N AnameP  9 @.get   (F � OSErrorQ  û ì €if 'peerZ '°#inÛ 
U · » L   ³  »  »  9 ¿  & Net.eÄ  %  Ë!._Œ [ª  ^ 	È '  K ! =óâ  3_fd ’.fileno()<h '�_connecte2 ZFalseP Dset_, (	 N _ t h
C ~ �Î+Á  ‘ �_lost = 0à Se:!ena  "  ec$( «scheduled.y 1clo]!= Ú 
M alose()U : #ifÔ Ý „
#® & ‡._attachÍ  ”4._tü#s[0 `ock_fd×  —ÓCreprÓ¤sinfo = ? °_class__.__É5__]ó ¹  2!is3
³  L �.append('7ed'elC   ?ing> 7ing? ] `f'fd={á .ÁG_fd}+ d# testQ$P was { .edÖ  Pj �A andÇf   B.is_? (A ô@pollf0= _z #_sž_ÙtF!._C  ,ƒ  A  „  •0_fdnýÆs.EVENT_READh L 3if ” 
d 5nfo¦Sread=+ B ( Oelse> Widle'³ < R  SKÀ              øselectors.EVENT_WRITE)
, ¹if polling:  $ “state = '" '" Oelse4 iidle'
2 `bufsizR ðself.get_write_buffer_ (Ÿ Ñnfo.append(f'. 1=<{™ 3}, Q #={	 6}>'? òreturn '<{}>'.format(' '.join(info))   def abort(˜ )Õ   ÷._force_close(None6 Áset_protocol= $,  G  % =$ i " ö_connected = True§  4' q g ñ 
L ; !isÄ ?ing9 
 è 6ing8   e3 2if h   =Š Þ * Ó  a  G ñloop._remove_readers –._sock_fdØcif not :²R  D¥_lost += 1Œ ! 	s Zs 5 “call_soon£   p aectionv +, +q__del__3 €, _warn= Pings.	 Ê^ ý 1 isñ  P 
é E P(f"un\àed transport {Wò!r}", ResourceWarning,  =" Vã  t .Q (ê²_fatal_erro'ð, exc, message='F     6 on‹ 'Ø À# Should be 5ped fromJ  ep;å handler only.µáif isinstance(x 0OSE‹ ]  Â 9Ý -kdebug('  + rlogger.  ‘"%r: %s",WÖ ä _+=‡.ü N!._w  Ú B_excÓ _Ó %({Ï     '=$':G,$ I  ':("  ö"':¿ E 3" .µ
O }â Ð û9exc - ,h‹ 
½$/ Ò k.clear' � ~EÒ	E íÄS  µ ¾! òt ¹1 
˜ N @_àexc)

    def ó_call_connection_lost(self, exc):
  6try   0if ( •._protocoG *ed)  - 
* .q  k j kfinalln A Åsock.close()0 `    = None  ¨ " Oloop crver =ñ  se 	b   q is not„  $ ‹._detachÄ È a Š i ñ
def get_write_buffer_size­¨¡return len ., %)
G ±_add_reader# `, fd, 	·back, *argsR Ü @lf._y:ing× p ^ Â  J.i c õ


class _SelectorSocketTransport(  "):k ò_start_tls_compatible = Truüš_sendfile  Ãconstants._S! ò Mode.TRY_NATIVE`  pƒ__init__& Ô  , d$, L�, waiter=t,c  Rextra  7 Æ  ( Ú �•Dy_cbú    …super().‘ ‹ m ,h  a ¢eof = Fals X e×opaused bempty_å — ç `# Disayñthe Nagle algorithm -- small ´†s will b~ á# sent withoutI€ing for O ðTCP ACK.  This gener~ ‘decreases1 ñlatency (in some c æsignificantly.�base_eve±set_nodelayî ._è5+ x.*D_sooaÖ@madeŠ&lfq q# only ¹ ð î Wwhen  9 �() has be Ualledô Ì‡ Öˆ  Ã  D  à _–  � €± !if•/erÕÔ qwake up‡,Ù  � Š Ý �futures._£ðresult_unless_canceñ  \ – ,˜× ã U ÀùÛ
1isi94ce(0 + 1s.B‘3edP=  ~ Ú dä _âÜòJelser7 1 â_data_receivedÖŒ Àuper().set_p“rotocol(p	 ñ)

    def is_reading(self):   °return not  Ç._paused and vclosingQ & T #ifL 7 3 or 7 d~ ‚ ‘ 	† k= True Áloop._removeƒ !erÖ ¥._sock_fd)1 Š 4 §get_debug( ƒ rlogger. A"%r ¨ #s 4!",¿ PRresum} T v  aLFals?addü «  a! y/î Š  yŠ_Ï I  G_cb(I  0y__ CbuffÐF R�onn_lost@ø:try! Qbuf =Æ$._ .p &-1' !ifþhlen(bu0    ÷raise RuntimeError('P ") YJr empty Û 'i ÷except (SystemExit, KeyboardInterruptx è B QBaseEM ªion as exc ‡qfatal_e® D  V   pexc, 'F#  # /: *ç) call failed.Î  D õ '  ˆenbytes‹ ±¡.recv_intok˜ Ü ±(BlockingIOg%, !ed "ÒG ebT Y@ on ú Ïet transportI�?Û ^ Hvon_eof(i ‹›#ó®’_updated(z S žWbÝ Ù   h¼É ÀM  %? üy__data_receivedÕ� š    ] f ž.max_sizek	ÀerruptedErroWr):
  ereturn üexcept (SystemExit, KeyboardInterruptC LaiseB QBaseEM ªion as excz ð
self._fatal_error(exc, 'F a read  õ on socket transport')p  Ì Å  ¿if not datat  \ _ ¯y__on_eof(P ?tryH �protocol.i  _received( P Rj &  c^/: Æ ñ) call failed.')
L Adef ; @ Í0if  ÷._loop.get_debug(#  Ž rlogger. D"%r Da EOF",D y  / ‡±keep_open =, %._Í 6eof’Ž¡
Á �  þ 
·€# We're  ð ing the connect¦J so ía #$ð can write more, but we still +'t: Ò/ �so removed ä!erÛ Yback.; @_4 s2er(  7_fdÛ:lseï ) cclose(F ¿¿ E ,"”8¡isinstanceÌ , (bytes,  ÷array, memoryview)A  2ra TypeEÖ f'ñ argument must be aO ùs-like object, ' O   f'×B{typš ×).__name__!r}:eof� cRuntim  @'CanW ïr) afterê ^ €mpty_wai, !ist;Non†s ’unable toc ð; sendfile is inpZgressv  ¦  LÓ Â9ý  ÚZ_lost0   0 >= óúts.LOG_THRESHOLD_FOR_CONNLOST_WRITESO   È�warning('œ0et.Õ 1() d eph M 6  §_® U += 1Î  % á  8 jbuffer”  # Optimizap Ð: try to sendw now.
  Itry:   ù
n = self._sock.send(data)* ñexcept (BlockingIOError, Interrupted )b OpassM õSystemExit, KeyboardP I  _raiseJ QBaseE¢ ®ion as excˆ æ pfatal_e¾ €(exc, 'F q write  @ on Úet transport' :jreturn� >lsey  O0 =  I[n:]2  I aif not  =  ! j  Ñ# Not all was½ Ñten; register še handler¡loop._add_ú "r(  ø C_fd, …_ready)
¹ ø# Add it to the bufff K  >extT" ómaybe_pause_protocol(h Bdef ›    cassert§ k á, 'Data shouldT–be empty'½ #if5 šconn_lostum51Ï † )5%	1E -
)B %Æ bremove�á  œ5 û .clear(! w3¼Õ@_waiì!isì?Non}   0 R.set_0ion± eÁ �
! ö 3delFú :[:nØw áXresumâà  # May appendFF 
¨ z oâ‰ h ´ Â K  7 p O ã 0lt(ƒM 0   k ~closingÆ  & Z Pcall_šRectio W %elY ?eofU 	 Õ .shutdown( §et.SHUT_WRoí<eoflh Á 3 orþy >Õ –eof = Tru¾Ý:  ¬ º 1can«Àe_eof(self):#
  Áreturn True
 ñdef _call_connection_lost(self, exc):*  B �super().2  , + 0if B ö._empty_waiter is not NoneV Z :elf,  .set_excep” (Y  .   C° vError("  g ÷closed by peer"))ð Imake˜ í è ½ Óraise RuntimeŽ E÷  ÷ Õalready set")Í # =8öloop.create_future(8 !ifH? obufferPpresult(€M M ¯3!re� Õ Ì4? ! =éõ


class _SelectorDatagramTransport(  "):~ _Þ 0_fa: py = colG ‰ions.deqÊq_init__œ  , Cð, sock, protocol, address=,Š S ³ a extra n h < f } $ =‡ �    K .�AsoonÈ $._¼ .¤Qmade,+c Ð# only start o›ing when 9 �() has be _alled‡ @add_V /er7 < Ë  x2_fd¥ .:  y± 'if"Ô ´wake up the3 Ù  œ ™ d]0s._â!Ð_unless_canceñ  \ 8,óm”get_writeÉAsizeØR‚ðum(len(data) for 
 a, _ inë.E ` S yV Æ þÕ
$v ú:try  }  ² • Ô‘.recvfromp P.max_Ô ÖµÁ (BlockingIOÑ, Interrupted  BEpassŽ E !OS* 0 as‹
  Îe©_received(ŽN õ(SystemExit, Keyboard– � Ö� TBaseE•– afatal_“  Š @, 'F –  1 onß 	$ t
'G/ls%ñ    > ô   áà)

    def senódto(self, data, addr=None):
  òif not isinstance(, €(bytes,  ÷array, memoryview)A  H ðraise TypeError(f'E ñ argument must be aO õs-like object, 'Œ  K   f'Ÿ B{typš õ ).__name__!r}')< È  x Ý  M xreturn
)   ._:ess. !if&0n (.), 1 ü d  CValun    ‘f'Invalidc  {  g Y or {j à  E  ² * =Ž Ù  Úconn_lost and. í p 2 Q>= co
úts.LOG_THRESHOLD_FOR_CONNLOST_WRITESO  £ ñlogger.warning('socket.send() (Çd exception.Á > Ž I+= 1KÍ  8 jbuffer” Ð# Attempt to † ù it right away first.d :tryD  š #ifI°extra['peer‡.'],  0 ’  þ ü  ˜­ "   Oelse@ #to— H  S  dÁ (BlockingIO›Ñ, Interrupted Ï ½ Aloop&q_writerK ._Ô 4_fd TŠto_ready™ ‚ !OSg 0 asøî m  protocol.eAÚ_received(excV  à ï õSystemExit, Keyboardò ë  ’	ÿ· TBaseE¨½ afatal_º (L  ­   pexc, 'F'  M - 1 onšëgram transport @ ñ \ ñ # Ensure that w "e  Ö is immutableÚg# @.app‘äZ))m1 Ämaybe_pause_¤"()uXdef _ "eSwhile8z 
ÿ x Ö' –.popleft(�  šœJƒ(¯­4ð))  # Try again later.
             `break

  ùexcept OSError as exc:#  + ðself._protocol.e- í_received(exc)3 ireturn m þ(SystemExit, KeyboardInterrupt)~ _raiseJ QBaseEÂ ?ion½ afatal_º (L  à   pexc, 'F' q write - ÿ on datagram transport'ñ \ 4Åmaybe_resumeAõ()  # May append to buffer.? rif not F  
 Ñloop._remove_· "r( zsock_fd© #ifR zclosingS  = ðcall_connection_lost(None)
imR coll s Âwarnings
tryY , Cssl
ýI> n:ñpragma: no cover `ssl = o “

from . J ›constants › ± 4logL õlogger


def _create_1  þ ótext(server_side,  ƒhostname­V& û  L¹a Valueò 1('SM  M ð SSL needs a valid 0Conv 1')

‚# Client2 ðmay pass ssl=True9Óuse a default5 cF ð; in that case the:  J Qed isjzT# TheM   Âsecure for cŠ s4 ÐPython 3.4+: � ðup-to-date strong sett3 4ssl† =“ .~Æ |½c|gN t.check_# c = Fal<‘ n { õ


# States of an _SSLPipe.
_UNWRAPPED = " ð "
_DO_HANDSHAKE  7"
_6  °"
_SHUTDOWN0  `"


clÍv d(objecP"""An  "“ "". ð pipe allows you€communicu@withÑ „SSL/TLS ! i?cNãthrough memory‚@s. I0@n beÌ�`implemˆ!a ‘ity layeraè@exiså #a where£ ðdon't have accessµ  “. b's fil� Òdescriptor, og ·some reasonR @wantK  x/it' !caÌ `in "wrq¥d" and "un •mode. In    ,P ÿ  {4ed 7!un-aformed= O ;  Ül� œYlevelM pencryptP oçqrecord * r¥ ±vice versa.› 5* N . !isÜclowestB ð in the SSL protñ)ocol suite and is what travels
    as-is over the wire.
 ðAn SslPipe initiallyC ñin "unwrapped" mode. To start SSL, callD âdo_handshake()' phutdown* b again0  T 1().: 2"""‡ ñmax_size = 256 * 1024   # Buffer  òpassed to read()< `def __¾ õ__(self, context, server_side ñ hostname=None):‰  % �     SThe *F ñ* argument specifiesG‚ssl.SSLCm  — $usXE ‚ I €indicate¬1eth˜ isya´  ´ 5 orŸ 1cliƒ 0ideÜcnsportÆn £optional *w ì { ƒcan be uJÓ yÑ k 6 € you arePó	necting to. You may only A õ is parameter ifO  s@_sslFpule sup¼ 1s Sžr Name Iƒion (SNI! Ù ˜ ß#._™  =™  ék   ý B=P( ï ,  0 0tat£«_UNWRAPPED! Pincom& = »MemoryBIO()) _outgo) �sslobj = ­E @needXËdata = False# ˜?_cbE sª! D ‘@property  dvc
7 .4SSLŽ ¨ ûÈconstructor.Ìrreturn ³] Ò| ¯ssl_object Pinterú xASSLO- ˆ instanc–Rw  P0 ifø! pÿcs not ó 	³ ›² �´  "Wh÷ñmore record level Î0is A í`compleß Ð– Ÿ tì is current¾¯n progressp ^ <Ã ¾  ~ Ç  ¶ curity layÿ’ Xeffec¯‡µ@ durÞ ~Œ4= _‹•  ©	� _|Obackô SÒ © Ãƒ P  c« �a list ofÜ ¦4. A A ele"6is ( b¼s` J  )¤ A • �¿All am ,  ðà
        will òbe called when the handshake is complete. Th+ ãback will be
  D õ$ith None if successful, else an exception instance.D 5"""  ? õ
elf._state != _UNWRAPPED:&  } ÷raise RuntimeError('Â Õn progress orÎ 5d')E sh ‚slobj =  õcontext.wrap_bio(/  t $ “incoming,4 Poutgo , ¢rver_side=8 %se ,+ {hostnam/  ¹ !õ = _DO_HANDSHAKEW r Q_cb =ñ Æ& °sldata, app	 bfeed_s µ(b'', only_O V=True‘ ³assert len(I e) == 0h sreturn R 
 Ðdef shutdown(¯ ,  =J)ï�"""Start¦5SSL8 a sequeMT  ¤Rl ”a list ofv 4. A € elementè( rbuffersž  J  ùoµ@al *ê =a* argu? âcan be used toÚEll aÉ U thatš < x � w5out’ sU=U÷
no security layer presentL· b †SHUTDOWNÇ T¶ µ\ ^ #Sin (_,–1 4= _� �  ƒ",w ¯ 	  []ƒ Eb'']ˆ …1eoføend a potentially "ragged" EOF.Ä’is method¼�øan SSL_ERROR_EOF fg  %is¥ ¯unexpectedcMp.write_½ þm2 K§  Q4i 8 , ØÀZFalseT@FeedÑ record level> Q intoIpipe]e! @must
ra bytes
 —! Ie OK s¶rn empty* ¹  0 Th~
Z5get¼Xfor a¬µnitiated byO tE …endpoint² À  Return a (Àssldata, app	 Ó) tuple. The  ó element is a list of
  ðbuffers containing SSL M ð that needs to be sG Ðto the remote- %.
N  w ‹ w  o  –plaintextu P } �forwarded�  ‚ ²applicationñ z ä 4mayÕ O ƒan empty‡ A indA Png anË ð "close_notify" alert]  <  U mustP ðbe acknowledged by callEµshutdown()./ 5""" õif self._state == _UNWRAPPED:&  ¥û# If unwrapped, pass 5östraight throught  B !if[
W   10= [ñ]x Oelse3 

/ ¦return ([]Žì  Ï_—u= Falset ¦ 8 ð incoming.write(¬ )\ F = [“ Û  :tryÒ † ÊDO_HANDSHAKE-  2ú%# Call do_handshake() until it doesn't raise anymore� F Ö zsslobj.L  (   , &# _#' Ê ˜ >_cbÀ R ( o(None)T Fonlyë P úÙÿ n  4# H6á done: executeRâf blockß A Þ .	“ q# Main * a: readþQ fromä®éú Ÿwhile Tru  � tchunk =ÃÉ k (¯max_sizS  = ›.Ð1nd(L } * qif not " _:  # µ 
 2   Kbrea@/elB �SHUTDOWNCæÄâ+½(ä - `obj = †‹$  %) â {Þ G_cb(N B/z 0 DrtŒpossibleŸYafter½÷ ù\)BÀ     except ð (ssl.SSLError,  ±Certificate ·) as exc:
  ñexc_errno = getattr(exc, ' ‰', None)4  ifH 7 ‰not in (" a  ˆ òSSL_ERROR_WANT_READ¡  oWRITE,G ŠSYSCALL)É  s óif self._state == _DO_HANDSHAKE and! Îhandshake_cbH  L I (  
	 ( Yraise¶ : ð need_ssldata = = 2!== ÿ  %)
I ñ
# Check for record level P Pthat b ÷s to be sent back.B qHappensD Åthe initial Õ ærenegotiations@ Múoutgoing.pending0ã .l "d(ý 3 fread()6preturn ¯ É P, app	 ú Pdef f9 O ,ô §, offset=0ùñ"""Feed plaintext+ ` into ò Vpipe.UR~ a� V À) tuple. Thež ” P elemXÅis a list of_ÿbuffers containing¨� J óremote SSL instancˆ › 1 isÌ —number ofî @byte %atN ð
were processed, which may'1les/ nR `lengthR  ï (ÐNOTE: In case  ðshort writes, this call MUSTX Áretried with[ ESAME“ +0 pa’ �*v a* argugQ(i.e.> �id() must\ &th_Psame)¥ ispan Open:arequir°ð
. A further particularity3  :™ 'a Ù ð will always havù  q G¡0, because   Øf modul› Pdoes benablez #al5�. And evez2oug&áFzeroü » e�  st– Äbe encryptedã§²6"""Û £ssert 0 <=9 
 @len(v‘æ3šUNWRAPPEDé#ÁA thrÀ  G  ù@unwrüd %if{  z 
U  ' B@ = [U [5:]]Í  & Oelse< 

/ i� k T z > Ðview = memory 2›while Tru� ú •  Ê k = Fal>tryÇ * w ç ¬  ð += self._sslobj÷.write(view[offset:])
  ùexcept ssl.SSLError as exc:(  3 ò# It is not allowed to call i ÿ) after unwrap() until theM  Àclose_notifyW ðacknowledged. We return>   conditionq O Aalle½ ra short” .z ñexc_errno = getattr(exc, ' z', None' ÿ  ifþ.reason == 'PROTOCOL_IS_SHUTDOWN'8 = u Aexc.k $ =yý_ERROR_WANT_READµ } ¸  �Cin (¶= ,>  ‚  >  _WRITE? "�SYSCALL)þ Nraisðself._need_ssldata = ‹ç =))
ã €# See if+ñre's any record level ] ºback for us2if Œ þoutgoing.pendingÎ © 0.ap# (7 jread();2if { 31lenŽC) ort  p Ubreakí  ù Ò ,Z ô)


class _SSLProtocolTransport(t
 ÿs._FlowControlMixinî: O "):~ð_sendfile_compatible =«“stants._S! ÒMode.FALLBACK= Ádef __init__Fp, loop,#_pÂ Ni # ! =* '# ô 0 in} cm9 5sslV v I * ––d = False­ ãget_extra_info³ áname, default=7Ã�"""Get op¸5al L B 0rma E."""‚ ß‰ ³ +._ 	y  S5setÙ ¤ M
a  : 6app> 8 
 ^ ¡¼ W M 0is_l?ingK 
 $ &ed7  2 @"""CN h.6  ù‚Buffered	ñwill be flushed asynchronously.  No more. ž6 `receiv¤! Aî  ba $is\ ,“ C = 's'0necñ _lost() method g Á(eventually)a%edE Awith£ ©Âits argumentÕÀ    """
    ð	    self._closed = True
    ñssl_protocol._start_shutdown()
. Àdef __del__(6 €, _warn= Pings.	 !):,  Z iif not}   ! ? S(f"un› °transport {a ò!r}", ResourceWarning,  =" )m  P   .K ³ ¡is_reading¶ ¡ Ctr =Ÿ 
 ˆ _ Úif tr is NoneÆ õ	raise RuntimeError('SSL E A has
öbeen initialized yet'Ã §return tr.³ |_pauseÌ @"""P  ò the receiving end.¾ !ðNo data will be pas!to6  !'s& _F 6ed(£ pmethod ì vl resum‘ )ucalled.85""" Ÿ_j.Þ ÷ g  F ÄA"""Rˆ Ã ³ ù Dö  "edÿ ¯once again
	½  8 
é !Ð ê ñset_write_buffer_limits·p, high=Q, low
 
1Set ) P- and( r-water J Q for b × flow control"ôThese two values# � when to áf .$Ã `  m)ƒ î  9õs.  If specified,E  À8low¸ P must¦ðless than or equal“ &thÎü ó ¢.  NeitherÑ 1 caðŠnegativeû ó defaults are implementation-¬ cº @only¸ z  `given,' ‹j Uto anF t ½  "@Sett ¡  /@zero	0ces–  %as† Qwell,¿cT,s Ú to�  Opheneverè C Âp becomeÿ¤n-empty.  ‘  ‚1to � h > 6	q |À -j 2is a E bUse of`  ùžõenerally sub-optimal as itD @redu) op—u¼ es>0 doU2I/O(Bompu)< Ïconcurrently)! É;g;Àer_size(selfC):
  ñ"""Return the current size of õwrite buffer."""; r8 ñself._ssl_protocol._transport.get_B _B _[ 1()
F ‘@property Edef D €_paused(^ ¯ ñ# Required for sendfile fallback 7 r ¤ing/resume a logicl  þ À ‘ ¹  « Ö   g, data¦ A"""W6Asome ‘ bytes toSO  Ž óThis does not block; itys8  g Ñ and arranges%itÓ Pto beõt out asynchronously.' Æ!ifq °isinstance(f 1, (² ,¹  o çy, memoryview)í  ½ ðraise TypeError(f"E Ñ: expecting aI ts-like k &, N G  ¢f"got {typ– Õ).__name__}")Î Â r   K á  K©Å@_app> ú › â1can;Qe_eofê÷ 9`True i-5is Û@ sup"s d  C q), Fals. ?notN   ƒ _abort{  QCloseq �immediateëö B¹"ed‡@will#Ólost.  No mor£ †received0DThe Ýp's conn×0on_H ¡() method B õ (eventually) be‰ Pcalle$ öth None as its argumento Ÿµ$ c@d = �Ó


class SSLP—(Ã $s. Ðe"""SSLã .€PImpleš Pation % `on top °a socket usâPincom	  ¡�outgoingþ úñs which are ssl.MN²BIO objects ý 6  ÿ�__init__µ, loop, app–,K ñcontext, waiter,?   Áserver_side=b#,  @hostS=“:   ¶_ñPmade=b,   ñhandshake_timeoutY h �  if³ 1 is‰  G0Run< Jq'stdlib4 amodule¯£available'° ? [ _ƒ m ®   =Þ 	õ	ts.SSL_HANDSHAKE_TIMEOUT]/elp O<= 0Ú CValu"G  ¹   /f"‘ `should´ÿa positive number?3L Àout}")

    ð    if not sslcontext:
   ó = _create_transport_4 (4  < Óserver_side,  ¥hostname)
/ cself._   - $ =.   ( $if E B andº j » \ 7 `  d OelseB ENone7 Ã @ Â  & ñ# SSL-specific extra info. More ö are set when the handshakn Å# completes.] ƒ T v= dict(¸= yû# App data write bufferingV  ÿ_backlog = collections.deque()2 P œ_size = 0ó’waiter = 	 C ploop =   øset_app_protocol( Š   ¬ ÀCSSLP9 TÄ(> l  ª&lfF 0# _2  ip €stance (ýa until£Bconn† is made@ Z @sslpC  = ; Ð ö	ssion_established = FalsôG 5in_# �shutdown" %# 
€, ex: SeÈ…orSocket  5  ¿ @call_  %  Y 6sslÐ ‚_timeout< >]def _  , ë)Æ  .1) =, – G B_is_E = \)  ÞBisin	€$, ƒ 1s.B $edp|Ä rwakeup_û€ “ c= ½ õ  )  ` " Þ  ‹ ereturnž Ïü8  .c¹Wlled(]  < `if excX  \  $ BJ  }Pexcep F(excì , B  B aresultI@ & lÖ  2eb3œ× P"""Caì E¦low-level G  ô  ¬.Z § QStartÓ6SSLzf1"""‘  - ® � & =^$ þL¾ &._—,3  [  p (4 îÐ)
        selñ*f._start_handshake()

    def connection_lost(self, exc):$  ( ÷"""Called when the low-levelA @ is D ² or closed.h  D ÀThe argument)  ane  epz p object8 aNone (b Uatter„ ðmeaning a regular EOFI €received>  8 Ñ E was@ Rabort& œ %). 5""" 0if `._sess¶established Ò ' … = FalseT . áloop.call_soonmö ._app_protocol.¿ �‹J Jelse† ê# Most likely VQccurr¶µile in SSL     ±# Just markáóapp transport asÒõ so that its __del__ž H údoesn't complainh ` ö a pis not ÿ
à  T j	1 "._Æf = Truk+ X =S ¢  	J  # ¡if getattrŸ6, '9r_timeouKAle',^ *® g4 ›.cancel()” àwakeup_waiter(€!  µ &´ × tsslpipe @  ãÑpause_writingÕ ² Ü
H÷'s buffer goes ovš u¡high-waterBó[¦ È .› —_resumµ 6Ádrains below ¨ ¸  Ç·  ž ¸ Tdata_“l ,  rAsome™ ' Ñ=	@ bytˆ8ni!is®
_#å RWing, 2 •destroyed7 ;freturnÝ:tryW 0sslÏ P, app	 $ =V¤c.feed_& (" ÷except (SystemExit, KeyboardInterruptP‘ 'aipB QBaseEM 0ionÃ;�ðfatal_error(e, '$  1 š  Ï'¤ t f÷@hunk9 Û Uelf._U.“0e(c4 C X 	H @
H 1if 5 
  < ‰À              ðif self._app_protocol_is_buffer:
%  , ó s._feed_data_to8 "edM (@  T z �, chunk)7 Oelse‘ M .” Ÿreceived(Z ÿexcept (SystemExit, KeyboardInterrupt)x ]raise¬ R QBaseE] Ÿion as exF º ¿fatal_error6Ðex, 'applicatW ‡³ failed to ñ P SSL 'Nireturn½ aŸ þ start_shutdown(T abreak
P ƒdef eof_Š  d(C C`"""Cal¯ ñwhen the other end of ñlow-level streamY  5ò is half-closed.r   I9 2is Ù ñs a false value (including None),f •transport_ Qwill \ 0 it¸ ‡.  If itX 3truW ,+  U &th	V ` is up• ä ¬.m 5""" :try›÷ loop.get_debug(I ÷   rlogger.  4"%rqd EOF",ã)* 3 Û ð_wakeup_waiter(ConnecX`ResetEŒ7 aif notQ ß._in_handshak™ ³keep_open =0 d.!O5if A 
 ¾   õ ’warning('øŒ  Jfrom†5) 'n A  ñ 'has no effect £ usX 7sslMkfinallµW.J(E _É¡extra_infoñ, name, default=¡õ  tcame inH?    È ý   [T ]ñ %elPž  Ÿ Î p O 0 …} ¼  b ¶ ÃGž à ‰V >ß² %inz¨ å 1 š c w._abortÅ³ ( y f = Truå v% PwriteA nH(b''ï
  1 ,–ç   "._) ðbacklog.append((S F, 0)^	. ¥Á_size += len1 - ðprocess_write_backlog(ñ)

    def _start_handshake(self):   $ 0if  ÷._loop.get_debug(#  ' rlogger. A"%r W es SSL \ !",L )]  : ^ $ � atime =/ {   (; Felse¦ I ENonew s &inö f = Tru" õ0# (b'', 1) is a special value in _process_write_backlog() to doj Z# the † 	@ „.append(} ï - & "ou¸l*\X ³¡call_laterÛV._sslù _I ,?  C  „ ^checkA «  yI ¦ ^�	°!is±
}msg = (Ë )f"‡ Óÿtaking longer than "8  {ô 3¯} seconds:; Pabortd  ªconnectionf 6 om Õfatal_error(C8 AO 1edE Hmsg)ÄoË‚_completÊ,~G_excXm 	Uf= Fals# uƒ.cancel(‰ Á Uslobj¸€sslpipe.?eobjectc:try¼*ifª  ¥@not ¹
*  i Zraise1 Z    €peercertŒ •  » G÷xcept (SystemExit, KeyboardInterrupt6 \ } Ê eB QBaseE ªion as exc¸ �if isinst7ñ(exc, ssl.CertificateÝm  q Ø'Åõfailed on verifykP '¥  F 2  \ 
? �Ã  ‹	g freturnŽÀŽAd«9elfï# -…Y·	w �:vÓ took %.1f msˆ§, dt * 1e3Ãð# Add extra infoö
t becomes available after‚.� (A „.update(x=	 n
‚cipher=s· /()3 ¥ompression8  = À              øssl_object=sslobj,
  ) õif self._call_connection_made:'  @ ( Ûapp_protocol.0 (# –transportk  ìwakeup_waiter( @sess~ õestablished = True‹ ¥# In case d ð.write() was already Ñ ‘ed. Don't C Àimmediately Ï Qcess_F ö_backlog(), but schedule itñ# _on_handshake_compleƒ acan bep ÷ed indirectly from‚ v ?and” w is notH @reen	%t. iPloop.S_soon›>proë !)
; ?defx  R )ÿ ñTry to make progress on the G G– j ®  Í sNone or…tsslpipe r  €breturn¬   :try! ôfor i in range(leö ’ Ù)É  G   ãdata, offset =� 	6 1[0]% .  0if 9 
…  0ssl V ã �.feed_app% ( * K Celif� l 
º d &do¤(¿ _  Ý.ÐŒ  5 (1T ;els6 1   ¤ tshutdow«�finalizez {  þPchunkn /ñ‡><  ±  |0 < S ¬C  / J8? = á < “# A short@Ãmeans that a  is blockedk a èL pWe need¤aenable- �ing if itapaused!A cassertN Q _Y6 â"._f ˆ « 3Œpresume_Û 7ing  -  Vbreak	 Á# An entire Ît”Ž! W©nÍ @# deÏ * ŽareduceI €outstandK¶buffer sizeç� 3del@o ' T _T 6 -=q5 À  except (Sy÷stemExit, KeyboardInterrupt):
  Uraise Áexcept BaseE ªion as exc7 úif self._in_handshake#  e %# G Ñs will be re-v wd in _oA ¥_complete.’  F   n - Y(exc)1 ?els�  C °fatal_error9 @, 'F   ñ on SSL transport')
Z Xdef _;  M ,¬, message=I E Òif isinstance� 0OSEŽ ™bû loop.get_debug('  rlogger.  ‘"%r: %s",¡ž ¬ ¦_info=True0, Û !._w Rcall_i|Qler({ {  '$':,$ I !'::" 3:¿ %._ P  ’protocol'- 
" }ã KM � Á ñ  Á._force_clos£	€inalize(5 Œ  ò._sslpipe = None; b ‚ q is not( Ž ‡ „ \abort� :tryH t  ¤ Â f Ffú le 5   €)
"""Sup;ð for running coroutinesõðparallel with staÀ ed
 ðrt times."""

__�U_ = '& ±_race',

img ¤contextlib ó typing

from . ( levents æsç»eptions_mod+ Llock? àtasks


async %
§ (ã b_fns: ž £.Iterable[ ACall 4[],$ PAwait &]]ÝUdelayG O° ‡al[float' *2  Ë":   .AbstractECLoop­d,
) ->z aTuple[¾   2AnyR  y $inw  DListÖ & B]]
]©h"""Runò and take the first to finish.i¢This metho+ cs an ig6 ofj Q funcè5. TP aone isô ðstarted immediately. FOñthen on, whenever‘ ( p precedõ  Zqfails (õ• 	Q), orK ! *Øñ* seconds has passed,c Anextœ  JK C© ð. This continuesòT until one of the coroutines complete
    successfully, in which case all others are cancelled, or b 1allG _ afail.
 Ty ðprovided should be well-behaved~  « âfollowing way:J d* They9 õonly ``return`` ifÕ dÒ ˆ 
>  always raiä °n exceptionH tg udid notU Í 
,õ. In particular,< Uhandl-aX ,‚½ L ±probably re‰ Ã, like this:ô  ŸCtry:2   µ  # do work ¿ ³ asyncio.Ca¦\Error= Bundo· Eallyá dS  k – }FArgsI  ëñ_fns: an iterablg  cP funcù Às, i.e. call& es thatº g Ä& a¡Á object when: ¡ed. Use ``X Qools.zyal`` orP �lambdas tç s¹sguments t Ñdelay: amount!1imeýðseconds, between stã&ngŸ Ys. Ifs �``None``ç) ð will run sequentitˆ Ploop:p event   ¹ 3use& R}ótuple *(winner_result,  findex,Ñ0s)*G"reÈ ü 3- *- < *�  !heO  €Ò,òè ý Yif noó #on» 
m š l  k 7 ina  ``„  o `4or …  p{ " Iî ã 7ingI  G � mau : ¸4 on3,£ P* can¥GusedK ð
to definitively determinel /0 an[q, w²¡ions*: lis„  ØQed by¼ 's.‡ f``len(7 )	ps equalF K`numberlD P actuŠL çqed, ands porder i±�e same as �.”,M k €'s entryH ¸1"""2 p# TODO::Pn we 	  aV!()� €anext(),�"owæv“  o  !D=K"orYàs.get_running_" !()~ Tenum_@ 0 =  derate( (  On! =8A  / –Q = [], € Rtasks  ¹ R +A_one’ (  E  �previous_]Áed: typing.O¸ðal[locks.Event]) -“> None:
  ñ# Wait for the previous task to finish, or$ Õdelay secondsE %if9 ë_failed is notm  t ö&with contextlib.suppress(exceptions_mod.TimeoutError)°  C   ù# Use asyncio.wait_for() instead of µ() here, so·  H   ð# that if we get cancelÇ ñat this point, Eventn  j Os alO @ °, otherwise_ð re will be a "Tcödestroyed but it iW œ   ý# pending" later.Â a´sž Ì“ A(), Ä)D @# Geæ ðe next coroutineþ5run( :try‡ q_index,6 Q_fn =E `(enum_J F_fnsk ã  StopIteraî
T Vreturt q# StartÚ ¥@0runOl { ± ª 3hisõ ‘ = locks.º(‹  ì _å " ‘op.create �(run_oneÂ (ç Ö)@ qrunning0 @s.ap¢(U (  assert lenV 3 A) ==[BE + 2À á# Prepare plac‰ pu£&isî 2's O 2 ¼ o&wo< Ÿ  úš + — %1
˜ ’result = €ñfY û (SystemExit, KeyboardInterruptÞUraiset B TBaseE!G as Ã #'  [°—F] = J  '  Ìò .set()  # Kicksghˆ +lss  œoÒrnner's 
¿°nonlocal wi& í, 2 d  ¢ 0/  L »	( 	! J& h # =£ 	# 1# CîB all®nÀs. We take cŠ!toÐÚ}{currentM S¡as well. IS`do so,5 Pn sinÒ Œ Ø Ano `={` afterN ' 3and¤ 1led ’ ðusually thrown at one,Ã $I Pencouqa a curãÑcorner case wj  × ®;endN  upƒQdone(1VTrue,6 fFalse,¥ I Àƒß 0. Tt€behavior(pspecifiYâ 0ð!# https://bugs.python.org/issue30048
           û for i, t in enumerate(running_tasks):
  þif i != this_index$  3 ±t.cancel()
D QfirstV á = loop.create  v ñ_one_coro(None))6 	Ž †.append(K % 6try„ a# WaitÝ ña growing list of Õ ñ to all finish: poor man's version of~  È ò	# curio's TaskGroup or t unursery. dÅ uunt = 0 gwhile  `!= len÷ m . €, _ = awÒ ¼ . 7 f  ¯  6 2_co�  c   '    …# If runqù  raises an unhandled exception, it's probably ap # Pgrammhðerror, and I wantlysee it.7 Æif __debug__¼ ž    šd— ½   # Pif d. !()o Snot ds3led %d.Ç (Ì  I     - ® ôreturn winner_result,  ,,s7 ifinall”ÃMake sure no†€are left‹ P if w 1ave^P func‚U  ¨  ¯	
!x`__all_B(C ó'StreamReader',  HWrit   ¢Protocol',< ¡open_conne”  ? õstart_server')

import socket $ys 0waré  òeakref

if hasattr(= ³, 'AF_UNIX'·Ì Q+= ('Œ Ounix‘  – sfrom . �  azutines
 ]event  Üformat_helper p; 4log clogger{ Ò ñ(sleep


_DEFAULT_LIMIT = 2 ** 16  # 64 KiB


async def —`(host=A , � *Å D jlimit=x t, **kwdp"""A wr€r[¼y ") * Aa (re1, w]r) pair.
BThe  3 ˆed is a ŸP instAS; theG ' �+ º+ ` PargumÑ g î F fusual  ?to É  a 8 Ýñ_factory; most common\ @posi¥0al |� zráwith various oP§al keywordŠ Afoll«Ä 4AddV 6  Ü  K� (to set+ÉbÉ H ŠÐuse) and limiðt (to set the buffer limit passed to ñ
    StreamReader).
 À(If you want, �customize6 	2 q and/or6 J °Protocol clr Ás, just copyD pcode -- Are's@ ñ&really nothing special here except some convenience.): 1""" ðloop = events.get_running_ (- rë ) =È (=  , . = 2 pÍ 
4 P (R 7 ñtransport, _ = await[ ñ.create_connection(¿  �„lambda: t ‚, host, H b**kwds– ewriterÈ W (u C ¡ = treturn  L ô


async def start_server(client± Red_cb™ R=Nonež  %*,Ì  Ð  ]ó=_DEFAULT_LIMIT, Ó :6 @"""Sx ¢ a socket � ò, call back for each •   F#ed½€The firsí¢rameter, `- 	Â ó `, takes two pa, sŠ 0 ! (#. | _ Y is aOÍ Ôobject, while2 B 2 ¹ . b.  Thi“ ñ can either be a plain!unFñ or a coroutine;† Rif itp  ,  wiR e automatibyNÑverted into aD GTask^prest of½` argumoP are ¥ tWusual !toH  SýÙ$()Û®Á_factory; mo2@mmon] B @posi1   3andó with various op% vkeyword‹ F ‘followingo2e rPvalue+ Ã ysame as±´ 4Add� q  » E 	•£ ‘ €instancem@use)W²Ë, ß c, i.e.üSŸ Ì z an‰uKAstop  Aice.Ô •.  sú"()ƒ ;a
y­
 6 Lß±Öˆ×Ž  E   Í% / i M ÿ .3er(ö PKâ


if hasattr(³, 'AF_UNIX')ð# UNIX Domain SoðHckets are supported on this platform

    async def open_unix_connection(path=None, *,
1  ñlimit=_DEFAULT_LIMIT, **kwds):s  B ñ """Similar to `| cw ñ` but works with UNIX Domain SoÞ E."""O ðloop = events.get_running_ "()ì  y ñreader = StreamR (¶   , 3 = )` ‹protocol8 P (V ; Ptransƒ±, _ = awaitc }.createsu  ¯ „lambda: �  , ’Q, Gwrit× W (| A ¬ â treturn  P 7#Rstart± Ôserver(client2Red_cb£ 5v2‹ † /H ‡factory(¿ ›+J : Œ< N]ò I   ÅÊ 3 ì‡ æ ¤m(çŠô


class FlowControlMixin(g $s.á Iò"""Reusable flow c7 £ logic for¥Î’.drain().° TÌ`implemõE the&ð  methods pause_ÍRing()ÂWresum @ and| ôÁ_lost().  IfV 2subÛ ‘overrides…óthese it must call. 4per� ¬ l
Ç 7  ê _Þ ñ_helper() coroutine.m  í	  ‘Ó__init__(selfuCNoneX Ê!ifd@ is  y   7 .4_5@ Ö(stacklevel=4&OelseL  p¦ f ‚›d = False ô  ¼ ª " —H '  ` â Ú °assert not  !._. d= £  6Tru¢ #if4  Õ S\debugrlogger. 2"%rs#s t!",F � ± ~ ˜ ²   ® 
Qàif self._loop.çget_debug():
  rlogger. õ"%r resumes writing", self)
6 �waiter = ‚._drain_ $ 2if  Ê is not Noney  V 
> ! =' E  ¦ !if? M \.doneÁ  &  @set_¿ 0lt(p ´ ðdef connection_lost(} W, exc  +._* u = True” Ñ# Wake up the$õer if currently paused.2 Â ^  
	ereturn0 Ì _ ë R 
{ ¨j¯b¡  if9 Ùz ½ .‰ ¥  ;els2 Pexcep¤(™q`async ÃiahelperÁ¼#ifŽ¿eaise CÆResetError('  "%')‘ÁAgassert$ K3 or ¶.cancelled(ˆ *÷loop.create_future, óA Ø a q mg *ScloseÔk‡, streamsrMáNotImplementedL¡


class S3 óReaderProtocol(FlowControlMixin, p $s.% f A"""Hî P ôto adapt between 0 I andn .Ð P(This©"a 7I ùinstead of making= 0 it?! a*d 1sub‡ P, becää ñ has other potentialD Quses,¥ ¡to prevent> @user†  L	J  ë ±ccidentallyF ôcall inappropriate methodsC J.52"""ô_source_traceback X öy_init__í!_r»„, client`ed_cb=± , … ³ ä su¡4)._T %   —  $  °d  ¥'	~-  _w~Éweakref.ref( f  j  Ë.	4 "  A ³S À “  8  8é &# ®œ  ÞAd by.` á_server()` funÕn ² ð# Keep a strong refe÷rence to the reader until a connection
  ù# is established. Óself._strong_Q ƒ= stream 0 , vreject_n ‹ = False( D Ìwriter = Non# Ÿtransport Uclienj �ed_cb =   z �over_ssl™ ’closed = Ð ñloop.create_future()
R ‘@property @def )(A !):  q#ifS û O0_wr‚ ÿ +  / jreturn  Y –m 4_wr˜  Š Q_made‹ %, Q– ¹
� `contex‹{Ò  §   ó'message': ('An open%ð was garbage collected prior©'M  Q  '™·ing networkÊ/; @ bcall "q.Úù()" explicitly.')� } ²ú ource_traceback ® ;['s+ %']K 	l Ôn�all_excep®“_handler(c 
± Óz.abort( 0h d 3 & =$ –´ ë$if^ais not¦
H @.set7È({ § ” ”$ ó.get_extra_info('ssl ')4y ¼ ° 1 
ª ‚ $_�Sù WŸ¸ ,Ã,r  û 7 š  0 n 5res¡ë  (o !l 	
u õif coroutines.is G(resQ ¡   Q  ½ ?Atask- 	?( c gÏClostÏ7excx õ Ê  q ¹`if exc/ „ 
+ Ø R ›.feed_eofrOelse4  Ø(¿ ™  Ï©wd.done(â  ~ ž À            ÷  self._closed.set_result(None)
  Yelse:   @ Öexception(excB àsuper().connec  [_lost% � ðstream_reader_wr = Ž { s & _write# ”transportB C ðdef data_received(Q , )á  # ="o  H  þ 2if  q is not© D  #   `.feed_w ( !)
C  ‹ :eofŠ „ LFeof(—#ifà Šover_ssl½ ø# Prevent a warning in SSLProtocol.À = R"retu6 ¨true from 1 Š  ,@# haHð  effect when usv Assl"4 (   [ e False  FTruebB_getâ0_wa.ñÓ	o ® F a_del__< 4 " rekõs about unhandled %s.¨ P# Bet¸Ithanq ò._log_traceback =â U hack? :tryk­ ­ / ‚ ú  AttributeErrorA °pass  # fai´ ¶constructorF  2if j ±.done() and §cancelled(1 ¼  $ œ  /`)


clˆ SWÚ§ Ä"""Wraps a TÕ.œÑThis exposes 2(),	 Plines a[can_] _ ,Ö  £extra_infoÀ ˜ ò().  It adds drain() which cAs anD oìÃal Future on( €you can só for flow control^ 1lsoE g &a °ƒpropertyL æreferences the= ‚directly^2""" \c__initµ,` 3, p¿,Àg, loop§ .ˆBž v  Ã$ K % =V " #=`expectÀ !atÅ ñ&an%•() methodD cassert¨  h   or isinstd(M ", :R:å¨ $ # =J `   ÿ ! = °complete_fuI/ R.crea 7ureË# 8 Ze ¤Crepr¤� “B = [M _õ __.__name__, f'’"={&  Q!r}']c  ¨åÀr is not NonGe:
  òinfo.append(f'reader={self._ U!r}')4 ðreturn '<{}>'.format(' '.join(N 1))
. ‘@property àdef transport(` )‰ U   %._& G  9 Qwrite5 g, data; 4 .+ % @ _linesE 0 J A_eofI ˆ Ã � 0  Ï Acan_¨   Â I 
4 M 2losE , = ¯is_closingÐ 1 G `async × AwaitO ,edN a  ê ã._protocol._ge0 _ "er6 ·   `extra_X p, name,p Ÿault=Noneø I 	C Ç Qdrainm Y Ñ"""Flush the ¼‚ buffer.¯  RòThe intended use is to. & 2  w([ :  %"w.� s1"""C & #ifFœ c @not O ) Yexc =, ¶.exception(\  + 0if . ?is K  $ Praise' Š °.
Ž µ# Wait for ÿ`connec� Å_lost() call`  v 1# Rx +  ¯ë error if any,5 CZ aResetE+ ›otherwise- PYield¨ Úæevent loop so w ¢ \may bB  · ñed.  Without this, _Èò_helper() would („ ñimmediately, and code thats/  „r(...); 9o Ûb# in aÑ € QneverV ß ,õ +itn 8 “ot see an{Awhen`socketŠ œ9ed.@ œ vsleep(0x g2ñ


class StreamRœ:Jp_source-�ceback =  Ž�__init__Êñ, limit=_DEFAULT_LIMIT,D # É þr length<  á õ a security feature;î ñ
# it also doubles as half&.K 4"if Z <= 04sQValueÂ0('LÄ @ can¨!be4 'À `ê " =X ž À   if loop i—s None:
  ñ
self._loop = events._get_  %()2 ?els@ 	 G , Z ÷buffer = bytearrayO # °eof = False™ û# Whether we're done.V AwaitV  Ñ ð  # A future used by _# ž_for_datat ¡xception =` Ÿtransport !pag µ < 2if Ò  .Edebug()sðsource_traceback = format_helpers.ex …t_stack(f  $  "syª¡frame(1))
# Ðdef __repr__(� ~ ñinfo = ['StreamReader']8  S Á ¶
·  = á.append(f'{len_ "._- !)}ã&s'.O ?eofL O'eof5 ÿlimit != _DEFAULT_LIMITI !f'3  ={ö !._ }Z  /erI 	" J  /!rM eJP 	% S  V �V 	% V  V ¸S '! 4âreturn '<{}>'.¡ (' '.join(xÖ yG ™& ±sqI= W, excB ;  ­"xcA  º£# =� Ø q is notó
` &  a !if9 ! ¬.cancelledÜ + $ 
Ô  Î ¯ ¡awakeup¥!erñ ì A"""W  Ð read*() func® s ] 0ing, Úµ or EOF."""ï  $ Õ  !ifE /er]presult(³¬ '¸
%,  cassertà!  Ä  Q E, 'T´ al8ey set'÷ 9 =f ˜`maybe_ª mœ— Œ Ù0] and $ <ŽŠo? H E¯ .“  Ù Ging(AŒfeed_eof¥ B Àeof = True
   ðself._wakeup_waiter()

 °def at_eof(& !):   ð """Return True if the buffer is empty and 'feedC õ' was called."""L rI  b .) 7 Bnot  U ‘ P Adata”  ,  š vassert @ Ceof,†  + q after F Beof'Y  Ô !if6  % é   ¡ ) ˜ €.extend(6 )Ó " T Q 1if ½ °._transport5 ´ @NoneK  0     W opaused% 3lenY 6s) > 2 *JWlimit+ W :tryí   h œ .r –_reading(ç  , þexcept NotImplementedErrorX e# The X ¡ can't be a -d.õ ô# We'll just have tof1allü6 aForget”n €so we dot ¾keep trying@ ÿ 0 = –	� Nelseà 9 Í ! =6`async ObP_for_2­·, func_name�Ò"""Wait until¯2 6) o¾ ()8Tk  ”‘If streams�  , automati/ ¶y resume it •1# SB ñReader uses a futur…Alink`zprotoco£ emethod2#· a Aû coroutine. Running two 2s a¾—same timeL Rwouldòan unexpected behaviour. It '  7qpossibl¸ HknowL Fhich” 5 <Knextd#ifM*  c  !
Praiseã  ¾ (x  ¤  5f'{û3}()P whilWother� Ois 'D   alY y ’  O�for incom  4'Ï s 
—$7EOF # � T  a  X © `ù will make deadlock, so preventi  is< essential U  È ¡exactly(n) Ócase when n >{È·“‰ 
‡“FFalsL ! &.ír*  fDer =Œ ²oop.create_ ]a> :   %er^ finally¾ * ‡2 Q 4AlineK
@ ¼‘ chunk ofÈÐ from the stróeam until newline (b'\n') is found.

  ôOn success, return chunk that ends withK õ. If only partialI i õcan be read due to EOFZ ±incomplete /  Z 5outD ¶terminatingq @WhenF @ wasZ ñched while no byte …d, emptyM  `objectú rÞ eý sIf limi aZ ñ, ValueError willÐ ’aised. In…case, ifl i £ b*, ê gincludØ \ eemovedK ñ	from internal buffer. Elr 
 D Pclear¡ LÎ N  †   � against·j of th„p`If strN ×  paused, thFrunction‚ ðautomatically resume V! ed{vE """¤ asep = £ ålen = len(sep) Etry:  O JÐ= await self.
: rexcept  eions.I�BReadôJas ea 9< e.óJ Q €OverrunO "if¦ _Ü`starts ¯ p, e.conC*d)ˆ  í 9del> &[:/ © + seplen] ;elsÑ  I )ƒ @(d! bmaybe_Ó«_transport+ r8¦(e.args[0]S E ­b�async defÔd¯0lf,Å qarator=0"""©a data ) Ç¥C b ``sep?  ``÷�ñ > L 6andw ÕÇ›j WŸ% (²3. Rg¥ BýetC ¦ 0 at  k¦ ¤Configured„© ‡ YQchecknAlt. zP setsN g pmaximalG0gthùð Ý­ ö Û`not coH)ngF ­ ¢ BIf a˜poccurs D Q sã6  ‡ stL b ‘,¢ ?an ‡\c Ž f%d,h …J P¾Ÿset.  Theb Î¥ attributeI  may contaiðe*ly	 ÷ X0canã  ®  0bec6 wBoverm5, aj ¶	0ø É ù  j B aàbe left in theó internal buffer, so it can be read again.
  5""" õseplen = len(separator)  4if # E= 0:  K ôraise ValueError('SA p should‚ õat least one-byte string')
N f ÿ
lf._exception is not Nonev )se/ K ó # Consume whole Y   l‰  … €s, whichø egth is� #ª £ less than ÷. Let's check corner cases with> FÆ='SEPARATOR'Ä  # * we havžðceived almost comple#I(^ 1out» f    Ç T). i.å ´='some texty ¡'. In this¬ 9 weC  %ƒsafely c6
A - 1i s? Á H4 ofc�is first0   	,¥ A  4 ú='abcdefghijklmnopqrS'. We may › 	º ¤everythingÛ thjàR, butù ©require toB qanalyze® s¯ @ ôð t match partial
Ä TWô is slow and/or m ‚FSM. Forƒ  (I our� iìXmentañÐoptimal, sinc"½ ©rescanningD rof dataµ ±is known to<`belong Š 	A ¶real world,ç S willC  OG ZnoticB€performa¬ ñproblems. Even when€ ¥ÉMIME-encoded� §messages : # `offset`¡the number§ ytes from  Abegi   d 0wheþ V€ occurre´ Eof ``à H = 0[ Loop untilÃHfind>   ikŽ,™"ed¦ • g size,› öor an EOF has happened† ›while Tru8buf¶ ¾D ¢1# C¯ if° 2nowwbenough:	´ I forÒ 4P 6fitŸ   i  Ž #- 5 >=K6lenõ *   Pisep  ³ .G{,F Ê = !f @ ^!= -1\  # #¾ *is“0. `A `àÆbe used lateš F  #<�retrieveÈ m
 , Vbreak, �# see upp. omïeaexplanúP H=& ZS+ 1 -Tð
               ÿ if offset > self._limit:
   ðraise exceptions.L, ßOverrunError(8  K ñ'Separator is not found, and chunkY qed the … /',N ´ ))
! ô# Complete message (with full s€ û) may be present in bufferN ðeven when EOF flag» ‘set. ThisG Dhapp& ¹ 2astÏ M öadds data which makes•  �  \ üat's why we check fo�  “ ñ*ater* inspecting<Ì .€ #ifÞ>eofÜ‚= bytes(F )F  È ~.clear(% )3Inc›BRead+v m, NoneÉ _wait_for_3ð() will resume readí  Õ útream was paused÷ aG ú   R 'E guntil'} if isep	Û 
üçC, bu) U´longer thanüŠ œ /# =Î Ÿ![:¯ +HElen]® deñ Ï) Ïbmaybe__§_transportÙcreturn!Š š ‘async def–<v, n=-1)g0"""ö¢ up to `n`H Q from²sÆ.Î@If n 'Ðprovided, or ©ato -1,p  ÂŸ G¦ a+%adØA. Ifn  : 1�received‚ ¼ƒinternal � Pemptyl  ÿ P 1an  È oobject¿  Dzero= 2  Ï immediately>  °positive, tn@funcv@ tryH ÁMH Ù¬ @less:0equÚ  âgprequestY ‹Pat le½1oneØ 0,N 4¡before any-  , ‘ ¬ � sý K 6Rd€ed valueR  ÿ
1ed É  , configur¼"t >X @crea(
R% )ª aÔautomaticallyoUit if_ Hneedg6"""¸ ’E$Ç  æ II€/ 	K kn == 06 %K b''+ <* #¥  /ðjust loop creating a n÷ew waiter hoping to
  ð# collect everyth$ ûin self._buffer, but that wouldA ðdeadlock if the subprocess sends more? V [limitD òbytes.  So just call„ Rread(Ž 9 É) until EOF.E b„ is = [] ¹while True:  4 @ = a$p 5 qif not < S W Mreak8 1 ‘s.append( )% ò return b''.join# 5s)
% z œA and�  :eof“ Ú _å °_for_data('Z'^ ñ# This will work righnÛp @is lÛqthan n ¹¡  Y " = µ7 F[:n]í #deÝa  æ Ê ömaybe_resume_transport(E . s <  async def Ú qexactly† F, n)ƒ"""Read " B `n`² .H  ÂðRaise an Incomplete4 PError`EOF isi €ched befäJ u can be ‘ _. TheP ò.partial attribute oJ‘exception•N qcontainm<  b Æ  0 § czero, 1Rempty+ x objectø ƒ€ed value<  ëy�ed with  ö, configured at stream¢ 0rea¸ Z #If% à was paused, tr@func. æ � automati"y e it if_ fneededÿ5""" ô 6< 0ð ÐrÐVÕ ÄþAsize³ í 'beá :$"if&_›!is€;Nonat Î/ c© -==ª ‚ + Ã1lenÎ—Z) < nç Ÿ  iÌ¤[ -   ¼ Âg.clear€ !   ç á /s.3 ({  ŒÚ  A £¥†,== ê æ 
;els×V  Æ
Dè ó   w ç á!__Ô!__ÜäÀn self

    óasync def __anext__(self):
  Àval = await  µ.readline()$ 1if ' V= b'';  B °raise StopAl •Iteration< `return@ ÿ
__all__ = 'create_subprocess_exec', ö shell'

import 4 “

from .  kevents Œprotocol lstream Dtask 4logZ ÷ logger


PIPE =„ . z
STDOUT  Š
DEVNULL  ¥


class SS— Pµ (¦ õ.FlowControlMixin,` …  ÷ .\ V þ`"""Lik½ 
dReader# ¸, but for aí A"""
z S4iniRÓ, limit, loopa  — £super().__-    = _w_@ " =H e @ �elf.stdinB 7out ªerr = None6 a_trans4 z¼ited = FalsD Ûpipe_fds = []` — Q_clos? Ç Coop.ßPfuturI9 4Nrepr†@infoc D _¶__.__name__z "if¦| q is notü 
— P ¡.append(f'- !={]  F!r}'€T  ZU 6outV ?outW  £W 6errW :errW Qð'<{}>'.format(' '.join(ù &))¥`connec’Q_madeþ%, ª ]	4& O �_tdout& Q.get_09 *(1f> « �$= ª(0=) < Á   †A  ¶¦! Y s± 7.seó ( ã  < 8 4fds„1“" Vtderr@ & =�D2a  ª> D }Dk>errD	ã "‹KD2D/inCÀ.get_pipe_trÃansport(0)
  ³if stdin_tr Õ is not None:(  / Qself.. Á = streams.S qWriter( K ,?  C  �protocol=j = preader=· ; Aloopt  ._ !)
¸ ñdef pipe_data_received(œ P fd,  )#¦if fd == 1  ð ™  3@1outa   %el7 27 7err7 s�f  ( 3if  Ö  Q.feedê (× ÷ connection_lost?exc0Í  H%in¢  iiz %  C v.close(¿   ‘.¡  — d 0excc  !
ž F _Áf Ðd.set_result(4 
v ,el‚F Pexcep>(˜ VreturE›?if ^
e;eofÂL4  †@Ù.1in _#J_fdsÞ
 ¦.remove(fdÐ" amaybe_üÃ(³rocess_exit	ûE p$ u = True° $ i _"  > q aif len‹.û )�T0 and	‘ ú^! =C_get5"waCelf, 
¯ 4 „ Ë K
’ » �¢


class PÐ 7  £�__init__	%, Î $, O!, Ö3 ¦* & =6 «C % =N "  [ ! =b 
 ¾ 8 ï $ ;out% (;err& & 8pidÉ .˜ð pid()

    def ó__repr__(self):
  °return f'<{ ò.__class__.__name__}  qpid}>'
: ‘@property Bdef H Ocodeb ^ çtransport.get_5 )Y `async Q LwaitK ó"""Wait until the process exit andˆ 	 f  œ A."""³  þ  aj  Ÿ _ (–  � ±send_signal— ",  LD 	3 : P �terminat0F ) > 2kil‡  $ 4 X³_feed_stdinÈ WinputH sdebug =Aloop­ %()?¨ H r.write(H   1if 3 l uqlogger. (,     ð'%r communicate: ­  e Ñ (%s bytes)',œ S, lenv — :tryr àI g.drainÉ ñexcept (BrokenPipeError, ConnectionReset 0) ancd #¶ »() ignores S ¢V 		9 	=,Þ u got %r#3exc A [ W Rclose„V m' 1oAnoopibzLNone÷@_reaŸAream7 G, fd; A¡ ¦Upipe_ 6(fd­ ªif fd == 2½ stm P estderr‘Jelse/ cassertK 1)  _J 5out! !if¶,._R
_  uÅ = 'stdout' ¶  1 Œ  Eerr'X  y Â S3 %s¾ , c “output = ).4 $½ gX¾ ë.) ³ eß gef¾=“n1if  € is not  
¯u- ¯\8 f ¼: 	'/ p 
o½Š	=à1)
        elsGe:
  õstdout = self._noop()" "if þstderr is not NonF    F Öread_stream(2N ?els8 ~ rstdin, £  e ÿawait tasks.gather(+ z 2 ã  < â preturn A 4oute ñ)


async def create_subprocess_shell(cmd1 0in= 6out 2err Qz blimit=5ò
s._DEFAULT_LIMIT, **kwds)¼ðloop = events.get_running_ Ý õprotocol_factory = lambda: SÉ S¤P+ („  ,³ Â   „ = ´transport, “ 2 = ‘ & .Wz 0 Ã ” z	ú=,C ¹  5errG úPÓ(¨   , ¡ ñexec(program, *args
z ) ² Q‹L 6Ó�5¤2 B #m   $  Í�H%`"""SupB forÁñ , coroutines and the scheduler."""

__all__ = (‘ “'Task', '™ 
'ð'FIRST_COMPLETED&  �EXCEPTION 8ALL$ V      @_for Àas_completed Tsleepl | Ahiel! Ðensure_future Erun_ã 0_thDsafeE ‚current_Å   'ë   s! •_register# >_un )en# Sleave2 a
)

imx3conq .£ s utextvar …functool tinspect3 Iiter  Etype- 0war” ó eakref

from . ’ 2bas¨ s 5 ø. œexception. ðfutures
from .coóroutines import _is_co ð 

# Helper to generate new task names
# This usF ðtertools.count() instead of a "+= 1" opI ðion because the latter
# is not thr9 ð safe. See bpo-11866 for a longer explanation.
_™ _™ _‚ ker = i– ñ
1).__next__


def current> ô(loop=None):
    """Return a) ±ly executedA.""", 0if ?  Ä  B A  E  ð= events.get_running_ !()> rg _� - ” )­ 1all© s ª 1setu!ll¢ s5h?oop° 4Ð# Looping ove“¥WeakSet (_¥ €) isn't È� as it caúP updaAÁfrom another#üñ	while we do so. Therefor @castN Áto list prio©‘filtering1  W 3 ³self requir´>@, som Qrepea[ °several tim) 0gnoW M 0Run ñErrors (which are½°very likely<boccur)Çðissues 34970 and 36607ŸY �details. Qi = 0
 FTrueV6try  g ÿ1s =õ …B  ! xexcept ½ 
B  i ¥0  4 Êif i >= 1000-   Uraise0 7els     Qbreak  ß {tí R t in›  +   Àif futures._'tFZ 2ƒ.done()}2_seÀþ(	,¢Æ!if  š ? 
žH M  F! =£ . « H‘Attribute
Fpass0 S (h  Üµclass Task(1PyFñ):  # Inherit Python+  ¹alementÄp  K "# oD _ F !.
H U"""A € wrapped·"a 8 H, @# AnF PortanÛ@vari
 ²maintained Âa¸  … Â4#E @- Ei€ _fut_wa» ³ ¯,.P_stepYÅs scheduled;> ,or: Csome® A V*not*G r‹ `The onÀPransi`<E­ Û  `former¨ sthrough� ü_wakeup().  Whenœ  Ú 0one®Âits callback<¦# must be M žà# If False, docñlog a message ifW 	 š ðdestroyed whereas its
ð    # status is still pending
 Ó_log_destroy_ � = True
! ñdef __init__(self, coro, *, loop=None, name !):7  \ …super().? 0   )$ 0if U ö._source_tracebackG  K ?del( H[-1]N 1not¡ �utines.is®  (
 Ÿ  X ö# raise after Future° õ), attrs are required for __del__y L ñ prevent logging* Ttask in: ŠYFalseh ² ÖTypeError(f"aò ð was expected, got {ø R!r}")Ò ¬ !if²  À
m�  ÒÀ = f'Task-{_Á _ `_countÚ%}'™ OelseF @str(< ƒ f êmust_cancel = í " pfut_wai  = ­ t    Þ ! = Qntext 
 Ávars.copy_co (�  ž¡.call_soonñp.__stepø5 =x  Ë‘_register+; _ D2 * ‘tate == f…ãs._PENDING andü" J  ×× E = {    'Á!':K , ¡message': ñH�ed but it/Ð*!'D }R Ö Ö
 — ³ ,['A'] =­ 	l Ž¸óexception_handler(c ª™”	§÷
class_getitem__(cls, type;¢return clsSáœrepr_infoä. Abase!s. _1 K @get_×I ò  ! 
3  a3 
 ! 3 1setÐ3 h, valuä f  3  ˆ2tr(! 
@ cresultB  '\cRuntim­]Pdoes ª€support Œ ? ` operaÀ'—   Ùo  r &B u  ‡Sstackq  òLimitèB"""R°the list ofv‘ck frames
Qthis …s®u¢.P 
0If @  Ø  n $da> Js( š b where›À  suspended.ó'  If the coroutine has completed successfully or was
  ÿcancelled, this returns an empty list.c  E pterminal !by; ‹xceptionV  ¦  Q Õ of tracebackŒ …frames.
 BThe  û are always ordered from oldest to newest> o† áal limit gives,àmaximum number� i %to ù
; by default all availablœ ,  ed+t_ðmeaning differs depend ðon whether a stack›a& iG ^ :¼ ê %ofA  %+ P, but/ Ï +è 7 „`; P.  (TRmatch1F qbehavio3 ÏC †module.)ÀðFor reasons beyond our control, on‘#ne š ÷ 1 fo& us>&edê.˜ 5""" É Á base_tasks. Q_get_kb(self,° Šdef prin" *% ±=None, file %):m @"""P8  lÉ 'orÇ ¼ [ Š '˜¦	«ðis produces output similarÜ@that¤q,Š j —�retrievedÁû @).  Y…argumentE  ‰ Passedx 6   5 ! i)¥I/O streamF �to whichÐ ©is writtenS E ¯sys.stderrêÊï Âòÿ?msgÝ ARequc „É : 0 itKËƒarranges¹Ce0Errðo be thrown into&ö Xwrappä0 on! ¢ next cycl< "ug^¦event loop# àAthen@a ch‹  Û€clean upv C U deny…  irù  us°Qtry/e×‡/finallyõ âUnlike Future.ûðdoes not guarante¾ aš P will> 2ledít ’ion might" u
 5and°  ac} uprPdelay³ J a‰>!asi prõ EtingD 	/ >#ly/¤ ƒmay also'µ a value orF sraise aò ›Â 1òImmediately after~`methodW"ca•CTaskQQled()'à
        not ró)eturn True (unless the task was already cancelled).  A
  ( öill be marked as. Q whenR öwrapped coroutineD ôerminates with a Cm ó	Error exception (even ifa %()E  ¬ bnot ca¥  5""" öself._log_traceback = FalsŽ 1if ' udone():<  ñ r.1 ð _fut_waiter is � JNoneB ^ - .[‹(msg=msgs  w r# Leave˜ : €; it may|0a T³Ithat³ @ òcatches and ignoreç{ !la]@so wÅVy hav B   C# tox x Íagain later.r ) W �# It must¯  dPcase ± Ù P_step;t–scheduleda ›_F _¼ ! =½f !  å_message = msg# �  Qdef _~ (? ,q=¼Œ¹@aise5 ¦ás.InvalidStateÃ(h  F "f'q %):c [ 0: {ƒ Ö!r}, {exc!r}'å… ` y`isinstFA(excÑ œ 
\â š Sexc =“CmakeiPled_e�u 3  ¯ .‘ R òR   < 8 = w
! p_enter_f› ½1op,ž Ñ# Call eithera`.throwü 3) o Psend(_ )O=try@  !is‰ 
  î a# We u¸0e `S ð` method directly, beca$  ì ësÑ  D   q# don'tj@ `__61__`¡p`__next [ s±  <   ‚result =î  ˆ Û 	i ;els; ); o’ StopIter asá
� p #ši@righAforeÃ _ stopè  "
ð
 c   xsuper()N= 
6 5 "K Bset_i Jf.value@ ' Zions.[ :exc30# SÊ ÿ€originalX� ‚`can ch^/ita× –±5excÂ Û Å ÿ ð
()  # I.e., Future.cancel“(self).
  õexcept (KeyboardInterrupt, SystemExit) as exc:7  > Âsuper().set_G ‰ion(exc)' Uraise ) a BaseE{ ?ion^ %Jelse“ ôblocking = getattr(result, '_asyncio_future_, z', Noneµ 4if   q is not% 
n  ±# Yielded FW ó  must come from §.__iter__({ ?   2if “ ³s._get_loop· )}  ¶. ƒ  D 0new„õ = RuntimeError(w $  €f'Task {X s!r} got« / '5 {N 2 ð	attached to a different ¾ 'My  m Å ¯.call_soon£ . s_step, à ¢, context=  o 'elÂ32if Î  d O '  ½ ~  ^ 4 b0can=±await on itk z+ B  ) /2 3$ A R   /.Ig = Falì8  @ �add_done_Oback : _wakeup :   > @fut_‚Cer =öæ2if 5  Ê_cancel d 2 g .8 Ú  <   4msgÐn Ÿ_message)w  ; ª …ÛÞ0f'yóò was used instead of  úH	Iin t€Vwith ^î  bA>	>®  ‹c# Bareò Árelinquishes¤ärol for one ev Vation‚ Ç  Ý  Òî,

üº ðinspect.isgenerator(result):+
  ý# Yielding a generator is just wrong.6 ýnew_exc = RuntimeError((  m 0f'yb ò was used instead of  ¯from for 'A ˜ ýn task {self!r} with {result!r}')C  * ÿ._loop.call_soonª * s_step, ã ¢, context=  
g ]else:y [`somethe +  ^@an e4\0f'Tù rgot bad::ú jzfinallyù p_leave_¥(2 z ,  
5  ð = None  # Needed to break cycles when -ñxception occurs.
pÁdef __wakeupp –, future)— +tr¤ " .5(– ed a BaseE  o fas excN  Óð# This may also be a cancella¥ 
Ö ê !._XG(excq 8ð# Don't pass the value+`¶ Ñ` explicitly, š   q# as `Fç.__iter__` and Pawait dp  ne™t¸ €# If we 7" `À � ,¶()`Ë  ,)`� ÀPython eval ` would� `.send(T 0)` $!odo E 4ð`__next__()`, whichQaslowerG*s÷that return non-Utö!s Šutheir `:
ÍÊ  Í*A
_Pyá =  5


·óimport _asyncio
§I yž 4
` @# _CK   ß!edRtestsÓ  =' =b . 0


]ScreatÐàcoro, *, name=¹f±"""ScheduleµPexecu ¹ a 8 òutine object in a spawÎÌRœa+ © 1"""Í?ñ= events.get_runningßÊ {! =k.¾ ±A_set¢_É (1 Ô  $  P


# *!()@ðas_completed() similarµPthoseÙ ðPEP 3148.

FIRST_COMPLETED =Lƒcurrent.¥.% 5 ŸEXCEPTION5 	% O
ALLh Àtures.ALL_COò2MPLETED


async def wait(fs, *, timeout=None, return_when=ALL_COM@ ñ8):
    """Wait for the Futures and coroutines given by fs to complete.
E 0The óiterable must not be empty( CQ @will ówrapped in Tasks* R· Ós two sets of› A: (dÚ ƒpending)2 qUsage:
�  Ù 	% @ = a$ 30io. B(fs)0 ñ Note: This does» rraise TMcError!‚ às that aren't h u  cC�p occurs( †ç  f`secondÚ .< 1""" Bif f�2.is
  ¦ 7 or�5.isš  É ô ´ 1ype± ð(f"expect a listEU !s,ä P{typeC Ä.__name__}")‰  À,fs] CValu^ 1'SeS � $s/>#isø'O ‰| –in (FIRST“",  ¿EXCEPTION, ³ê � “f'Invalidlò  v® 7: {} #}'õðloop = events.get_running_ (& @fs =¨ &-vif any(ö 
�)KfÑ#fse ² 0war]  s.	  ("3ðexplicit passing W q objecto F 
 "Ï ) Àñeprecated since Python 3.8,ÕL ‘scheduledÁ premovalÇ B Q11.",
‡   Dx BionWê è, stacklevel=2O‚{ensure_Œ@(f, r= 	>}q½Á_ºè	ãJ @)


�_release4 0er(; „er, *arg›!ifŽ .Í(µ Ô .s`esult(V ` z|…_for(fut– D ^ æle	ÖVd, withÉà< ;( :r°  S q™	r ”.  When ai ±â�it cancelîae task?cs².  To avoid 1ask&A €lation, ê0 itRtshield(»!If8  „ Ã7 1ed, { sis also” 3ledî ´@funcd  = a)
[ ^ï%if0is í”ˆ2futž2 F<= 0/ 0futp 
ë # Š íB  ?ù€  ðreturn fut.resulct()

  ðawait _cancel_and_ °(fut, loop= )/ Etry:  C ðreturn fut.resul]     rexcept  aions.Cg °ledError as Q @aise 1ept4 qTimeout2 p() from Ã  ­ Aer =¬ ò .create_future(¶ t? u_handle* £all_later(! ¡, _releaseBer, ] G ÿcb = functools.partial(4 %µfut = ensur– Z >óadd_done_callback(cb¨	u#—   until the{ñure completes or Ø ‰  Ž	F   ûå & ­ a€
´
­ if .¸ *()  b 	   Nelse6  oremove  7  “# We mustgR that õask is not runningæ B q# afterSr_for() ´ /s.,  ýSee https://bugs.python.org/issue327519 hcœ r	æ  k³ Š„c_['W/# S O °# In case tí la`ù failed with some¿#	ñ , we should re-ž; it/ Ð Y406075 ˜ îÓ	   §[ 9 ¸ ? _
 - gfinallòTM.I O±
async def ?S(fs, . ,TR_whenV,ò"""Internal helper foŽ2().üTã¢s argumentì±be a collecÅAof Fõ¸1"""dpassert � V'Set (  qempty.'* I2Non.$ifë  V  p  Ù6d ƒ ou- @ Sen(fst3on_Sion(f` Äðnonlocal counter
   Òcounter -= 1
 d  if ( u<= 0 or  $ ÿreturn_when == FIRST_COMPLETED. ðEXCEPTION and (not f.cancelled() 	t  x  ðf.exception() is W yNone)):M øif timeout_handle- 
+  t 
, § ,()S  n Ëwaiter.done(u  J  ±set_result(Ÿ 
K ¶for f in fs„ `f.add_P ð_callback(_on_compleë )> 6try6 ai   e»gfinall" ÿ ¸  î �f.remove¿  â ò, pending = set(), Oif fm O  :&(f§Felse# ¡ o ) Ü @ � â


async def _¦P_and_a£(fut, loopðA"""CÉð
 the *fut* future or taskÝ�£ until it Ïbes."""Ñ ] Aer =\ ‚.create_I |ñcb = functools.partial(_releaseŸ 1er,k "er	0futï “/cbF , î q  4„# We canî3 onå ñdirectly to make·3 sþ :p itself|€reliablyY  Uable.@ Î ª lÙ p
# Thisi ð*not* a @coroutine!  It €just an Á¡ator (yiel�F¿@s).
$as~”ed(fs, *,O=ÏeA"""R)	U õwhose values are ‰ "s.øWW ý 	 \ G‹ 'ed. ± you'll getiP3s (­as!) of$ @orig	 Ñ  - S  ),~ o 3ord9�in which´ as soon asO y¶º eðdiffers from PEP 3148;0 ¡ proper wa#Ruse t—:ú  , ñ f] #   î 2 = 0f  ä1e ' §' may raisF 7 b# Use = µ DIf a¿ ¡specified,´ Q BwillR —T?aError 	 7*õ occurs before allq ò \} “Note: The"Qs 'f' _ðnecessarily membWRof fs * Õ  ¡3.is!0fs)n]ð iscoroutine(fs)3:
  ñ<raise TypeError(f"expect an iterable of futures, not {type(fs).__name__}")
T ðfrom .queues import Q R  # I ôhere to avoid circular. �problem.O bdone =B (c ñloop = events._get_ _ !()8 ò todo = {ensure_¾ @(f, $ = à) for f in setÍ }: Àimeout_handl| QNone
 ’def _on_t# &()GL  y   e�f.remove_Ì  _callback(I ¢completion¶  /    * À.put_nowait(ƒ )AJÑa dummy valueÇ _' ¢_for_one()< J  � q.clear(A ‘Can't do  ™ 0(f)1the.í ¤ '(fñ !if
 G 
ï `return­  â +Q was ù[first¢ ‰ h ¹ f"{ S and d ²!isš  4
š 
( t.cancelUaasync â
LD Pf = a  � 3getm °  ifL.s w 8# D®  	 H �Pexcep2s.Tmže [BsultÜBMay ? %f.A  7 ¢_f.add›!if3q j
f" =T ÷s_later(! ,KÝ £ _‹ range(len(`)wkyield ï@


@’Ás.coroutine
Êt_sleep0©€"""Skip T2œ £ run cycleú@ThisÜ ña private helperj')1io.[ ‘()', usedcPwhen Gp'delay'E 0setë`0.  It+ ¡s a bare 'Ì ': ðexpression (which Task.__step knows howJ ˜1pinstead Ácreating a F«c objeci1"""h s 1


Å îÇ ° @, reN=ÄtD"""CTc that àes after a givø Qime (Ntconds).u 1if ` V <= 0OK_¤¡ B� � ±ó òxrunningôår ú0h 3all�› ,}  �  U rs._set_“ ‚_unless_A?led> Y… 6tryÉl ‹ gfinall) h°Ý
Ú ù3_oré3, *êËÀ"""Wrap a coð2routine or an awaitable in a future.

    If the argument is a Fu" 1, i ñreturned directly.: 1"""  ¡ _ensure_f^ ƒ(coro_or p, loop= �)


def 0 *3 aNone):i #if» _s.isfg )  Ø !ifs  Ð @not G I and D ps._get_œ ¶ O  S óraise ValueError('The“ ð belongs to a differO V q than 'Ä  H  '…ñone specified asšB Ÿ%')F w
hÔ0if ô    0 ä Pif in€ Et.is40  È  W çŸ = _wrap_> ¿ Belse× G   _4Typ^´An asyncio.‘ a q Õ ÜaÕis required')(^!is �  s= event %Âstacklevel=4�Œ 7 Ì.create_task;¥


@types.Æ 4>�°"""Helper fÑ
p)ÐWWrapsòò(an object with _œa__) in­Œ  †0tha* Àll later be ž 2ped=�Task by ~  = ¶(yield from’ .‚ [())

0U._is_’  P ò


class _Gathering(Ë 8g3 ()ðThis overrides cancel()Á A all‚�children@�act moreÉPlike .3 ñ(), which doesn't immediately mark itself asA 7 6ledS !€_init__(1 $, † #, å  xiassertÜ ñK    ”super()._S  ªŽ      f $._f % =q F Relf._³ _LÒested = FalseS ¹ " · @msg=Œ ® 1if m Wdone(  † JR     5retf      
­  —O ¼ È ) "ifÊ £ ‘ ;msgx  * g 2TruÝ  jif retQ ‚# If anyW  éó s were actuallyMåled, we shouldG X ²# propagatec~alation§ûest regardless of? *)`_excep6 às* argument.  ÷See issue 32684.
  õself._cancel_requested = True* ðreturn ret


def gather(*coros_or_futures,$ ñurn_exceptions=False):M B"""RL "a 3 ð aggregating results from the given f rutines/5 1s.
O BCoro ö will be wrapped in c ¢nd schedul  [ QeventF ¢loop. TheyF ð not necessarilyV > Ñsame order asF Apass^ œ 3Allã Ás must shareÖ = €  | q If all ‚tasks ar~€done sucŽ afully,% ‘#edb #'s;1 is  qlist of™ U1(in ¶ #of €iginal sü[nce, ÿ D  18 Q  arrival). À *” ú*Ž  H,D  � R ë P treax  'asö ? v S, and€oÇ   ÷ 0; oœBwise,Bfirsé0rai£‰ ïòbe immediately propagŽ o]  þ!ed‡ �äC8 laé3: iSauter F ]Aled,äÒchildren (tha˜ Ahavew`comple	@yet)e also C kAany G " i|   ò  isv R as˜ 3it ý ³ ¡edError --Ö  xo¸ V*not*{ µÓis case.  (Thj oC "prÒ K � @ of Å± tÍ 2use¥Æ  tE &beq ".)å?If \Z,2  A˜@) af…i`ás been marked USwon't<  R`submit}¢awaitables-€For instî,| :  S u A � !anrtS`caller®pereforeÆ  ll3 "``Å .EA()``D ] Pcatch' 6an V (Ý!bykÜÇ )RG ]  þ 5 3 ú 1"""6 #if 
ïÕ O È1 = qs._get_ _ !()E  ( e=øcö<% R.set_Ø6([]B g I ! ‘_Ô_Wƒback(futr u ónonlocal nfinishË  R += 1P   "ifb .X (L   %3fut¥<led$  ( g# Mark¨’retrieved^ $   M Ñ   ó 	�  €  q�À    if fut.cÛancelled():
  ô# Check if 'fut' is c1 ¯ first, as8   / ô.exception()' will *raise* a CG _ErrorB  ý	instead of returning it.+ õexc = fut._make_¡  _e[ -()2 ¦outer.set_¢ >exc) y 	@ Nelse)„ R O 0if ) ¯is not NonJ   ‚   - ¤ ¥ úif nfinished == nfuts² P# All2òures are done; create a listyJsultàñ# and set it to the '² 'S 
£!reD e = []
¦  º 0for2 Ê in children¨  %  if$ .Õ§ ( «È	™	“  J   #¯ �M ðAlso, since we're addÐ =2èo value— Cto 'R'† 0aisQ 0it,ÍŽ't botheY‘ @sett/ ÿ__context__.  This also lets us preservŽ @callG 'zp' at moM:nce ‰    ƒ=+*s.(	 9  ''˜ø€_message¦ ] ¬? 9  ² B ” ~ ·  E Àj  * iÁs• N  ( R áO   Ús.append(res)S1if ‹.®_requestedx p# If ga& �  beÊJðled we must propag.th#aè° regardless?*œf¯s* argumenÈ @# Se¼žsue 326840 >ë@æI &w o sñ arg_to_fut = {}hÇí Õ~A = 0  ™ aloop ="  1argporos_orc  ©Â ifGE in ‰ "  { š s_ensureE ð(arg, loop=loop)
    õif loop is None:
 	  ð = futures._get_ Y(fut).  if&  J ~not argM Á# 'arg' was % ! FX ð, therefore, 'fut'G Ya newc  ” #4 ò
 created specifically ford €.  SinceZ   /erK  ò	can't control it, disabl7 ÿ"destroy pending task"G  �warning. “fut._log_J _J ‰= False
2 ©nfuts += 1 ñarg_to_fut[arg] Ž	"  g �add_done_í Zback( )l ;elsê0# T�ä's a duplicateiðobject in coros_orŒ †   =ù® v °children.apAA °outer = _Ga2ing(3 ,¥=xtqreturn 9 ò


def shield(arg)yq"""Waita›u^'  Í  òrom cancellation.¯ ÒThe statement  {0resá wV H Ã(something()añ	is exactly equivalent to‰U N v ñ*except* that ifE  †Qutine¹ ai{0 it3Ì !edR] ´B run& 'n ²  2  ‡6 @.  F¡the POV ofC 3 X 	3A didÍhØ£.  But itsv2 isE Dtill:  ¡ sy· -fw Áexpression s. Rraise? C¦üedError.  Note: IfÑ Í P by oPR meanF `this w‰ a - <)ÿ’If you wa¹ôcompletely ignoreÆ 3  (C²recommended¢ A  ca3 mb«0Ò) with a try/Ýò clause, as follows:þ t2tryÏ    … $   ] 
8K  ø¢"""Ü2inn�censureíZ( 1if # .o(n s ¦# Shortcut
ª1 >  ÅÃBQ# =Ø! =ö.è† f ò_2 
æ( ” "if&.ë8led²  ¶ !if¿9 &  * b# Marký �'s result·–retrievedø  0   W �Bion(á     î[® § M ÓRexc =¬ ð.exception()
      óif exc is not None:
  ù	outer.set_exception(exc)) ?els; 
Óresult(inner. A))

E Qdef _g ñ _done_callback( )“ !if¨ F  + (  ±  kremoveL _ 
 )€  J.add (3  h ™ 2  
G )qreturn   0


ó ð
run_coroutine_threadsafe( c, loopß À"""Submit a  2 ñ	 object to a given event9 .Ú Rv  6 ñncurrent.futures.F ? ¢ccess the ›.—1""" vy Es.is ­ §  þraise TypeError('A² Âis required'” _ = co¨ (¬ 9 x 6try( ‰ S ’s._chain_ t(ensure  Æ i=n", ' •  F ó÷ (SystemExit, KeyboardInterrupt‡  4 :  B TBaseE@0 asx
± #if~ lü	running_or_notify_cancelò c µ 7 n £— ˜  í .FY_soon{{r?` À


# WeakSet¨0tai¢ ñ all alive tasks.
_all_ ³ = weakref.9  ÇP# DicG8aryI 3 “that are °`ly act_ Ain
#n ï`s.  {EþÓLoop: Task}
_C � #{}{‘_register (z ÅC"""R a a newÖ ² in asyncio¼’ecuted byn+û  X s e/p  €,Y v © : = ¹ P.get(3 •$ifM ½ís RuntimŠPf"Canç‰ Q intoƒ   {ÿ ò!r} while another ý `   f"5 ( {¹  C ²is being ex#"."¶ 
Ó [Ï 1] =� !QleaveÔ î != ± r!@Leav½  + 2doe _matchh»Þ $;delé/un¥	U ! ah .„ rdiscardˆÀ


_py_regisôter_task = _regis y
_py_un  %  ' $en6  "   Uleaved  ú


try:
    from _asyncio import (‘ ,, � ,<  @  _† 6, _v 4 
1all© ²s, _current ¡)
except I› RErrorº ’pass
else *_cµ  	C³ ,_cË  ( Z Õ '_cÉ  % × J Ü     ñ
"""High-level supVófor working with threads in �S"""

…”functools Ñcontextvars

¸.±°events


__J‚_ = "to_a Q",


a U def  (b ð, /, *args, **kw
 )R@"""Aàhronously run 5 `tion *
 *½ “ separateÓ !.
#2Any[ E and^ Plied FthisT Ðare directly á!edJ #too Ã. Also, the (— :class:` ".C,ò ` is propagatedƒPallow…1 ¢ variables \ CmainÍ ð  to be accessedñ 1the— ÷ ðReturn a coroutinaat canI `waitedW 1getÊ ¿Ôual result ofï g   “qloop = . às.get_running_ !()- cctx = Û  ,c.copy_ %  »r_call =} hñ.partial(ctx.run, g rå  Í    2 ò_in_executor(NoneC j )áAbstract Trans½.ã ½(d U'Base* ‰', 'Read HWrit# 8 	# ‰Datagram `SubproÒ Q
)


�  z    ! ¼Å sÀ  ¤€__slots_ƒ²('_extra',) ñ __init__(self, ! =,v E "if  ¾  �     3 Q = {}î    L .m  ! u r  )4 S_infox Pname,Lault€ �"""Get opéDal té  B 0rma ô  }   ˆ   (f ¡is_closing� û 3"""@qTrue if!� #s : 1 or *edŠ àaise NotImplem¶d6 A ey  @Clos¬eñ Ê ã ðBuffered data willÎrflushedÁ*¡.  No more. ¨Àwill be receó!ived.  After all buffered data is flushed, the
  ö(protocol's connection_lost() method will (eventually) bA Pcalle$ õ	th None as its argument.k 5""" àraise NotImple( �edError
# „def set_ž t(self,  !):&  Ã Å"""Set a new  .k gk 
a `Return7� currentj õ

class ReadTransport(Base s ô"""Interface for read-only t9 sà æ__slots__ = ()=0is_9 1ing;] 1Ð qTrue ifØ \  )‘receivingh  5   ³_pausey P  p c R end.¸  e "No¯sÁbe passed to6  !'s& _F Aed() A ³¶until resum‘ )Ý °–&S  ˜] t ¯ Ÿ ;ingå D‘ :ïll once again ö æ  Óþ ©Õ –FWrit‰—w4 ˜ Õ; _Ÿq_limits¥p, high=EQ, low
 
] ë1the) P- and( 0-waôJ 4b P flowÕGtrolcñ These two valueø # P whenj "Àoyâ `  [)ƒ  „õs.  If specified,E  Â 8low¸ P mustûðless than or equal“ ² %; ¢.  NeitherÑ 1 caEŠnegativeû q defaul¡4e i~a÷-¬ cº u,z  OQgivenS‹j Uto anþ t ½  "@Settg ¡  /@zero	0ces–  %as† Qwell,¿c•,s Ú to�  ¤pheneverC Âô becomes non-empty.  ‘  ‚1to � h > 6	q | -j 2is a E À Use of zeroó# for either limit is generally sub-optimal as it
  ñreduces opportunitiesN õ
doing I/O and computation< Õconcurrently. 5""" ñraise NotImplementedError
# ñdef get_write_buffer_size(self):%  © ã"""Return the u  * 1 of C  C .ƒ < s j, datay W� Q some ‘ bytes tow Ptrans:.Ò  ­ óThis does not block; it� s8  g Xcarrangs˜ÿto be sent out asynchronousm(ê Slinesï €list_of_� ÷  a " ð (or any iterable)w 4 ´e default iH @QatenaQphe argu%sýacalls » B() ooresultv™ °= b''.join(Ã å W  c.V  1 )Á “ A_eof%
QCloseÃ& ð end after flush3…!ed/(°is like typ- ð^D into a UNIX program read ³from stdin.¡  bàData may still)�received‡3can‡ø `True is5is ý1 su?¦;q), Fals. ?not”_abort€
~ �immediateàBO‡# w)Ólost.  No morÒ E0The“ptocol's±0nec_H ’() method^ p(eventuqE) be‰  Àe$ rth None‚$s î´„
class T|U(Read !, ² Àð"""Interface repre] dra bidirÙ &al×¼QThereo’vTËas, butÔ î !y,"Auser	 F newi Ps; ra¼8 €platform{Qvides~E Wusefu£  Nfat are’ Ped usÙ  ,L b's besø–practicesá  ¬ Ðnever instantQ6s a¦  %0ly;Þ  y ê " a— ¡tility funQ, pas„ @it aÈ C€ factoryß  oñ >  inî �necessarybRcreatnî Žðprotocol.  (E.g.
þ    EventLoop.create_connection() or! Àserver().)

B ñ The utility fun; ò will asynchronously a ñ a transport and aF �protocol ðhook them up by calling  ) !'s8 ¯ ð_made() method, pass5 !it8 u .·  implementað ô here raises NotI Ãed for every_ | ñexcept writelines(), which² s �() in a le8 2"""„ ô__slots__ = ()


class DatagramT(U(Base $):F ‘Interface  d7 f (UDP)f/s.q  Àðdef sendto(self, H ³, addr=Noneo  + q"""Send" ? toX ( ñThis does not block; it buffers8  f í�arrangesÄ !itÜ  E Pto beš [t outM.'  ¨ ñ is target socket¾ 6ess' !If  *  Õ D use3  B æess pointed on<µ6ionJ  M     -,RErrorà [QabortZ
I0Cloƒ 'hem ³immediately¦ e B6ewZòbe lost.  No more“ †receivedµ  ¥: 6 H 6¸ (e•ually) bek ‡�ed with E°as its arguFo $ð¥Subprocessäò… 0  dget_pidf G_ 1 id 8   ¿ [ ¯returncodeb , Â�See alsoÅ  y õhttp://docs.python.org/3/library/s´ # v.Popen.c P p { 05pe_Ù J, fd¥ ?$ ¡Bpipe�number fS ms_signalw  
{ i  k\ Ì X  R#’ S%�terminat#AStopôÅ BAliaýcŒ@²On Posix OS=ä  ds SIGTERM&Hthe e    ðOn Windows the Win32 AôPI function TerminateProcess()
  òis called to stop the subp, %.
, •See also: öhttp://docs.python.org/3/library/H # „.Popen.t– O 5""" ò
raise NotImplementedError� ædef kill(self)’ """KillÅ ÁOn Posix OSs& &Ðsends SIGKILL	3¢On Windowsƒ õ) is an alias for Û /()@G ÿ /;ó
class _FlowControlMixin(TransportLC"""AGQlogic× â(write) flow c? ñ in a mix-in base c ÷ TL t must iÏQ get_Q ò_buffer_size().  It,  ™â ñ_maybe_pause_protocol() wheneverÉL  L  L ± increases,F Cand J _resumK Sit de8 Œ !ayøE ¬override s¿ àlimits() (e.g.A specify dià 1entB „defaults	$¶constructorð super().__init__(extra+AThisV wö 1™ ”�user mayü2 A and^ ¬,!  }4ir —2's ¨ �Ping()% F v  ‚ !be… 1ed.$  É	 õ__slots__ = ('_loop', 'ÿd ¡high_water 3low ).< 2!, Bp=None, \  ý és›    aassert;  ÿ@not M    f .¶ ! =&  /Ç ‹ = False& eØ   Î `ize =  .Ìz "if><0 _^h hreturn8  d ¦
9 # f = Tru b :try:   
> .m�  + ôexcept (SystemExit, KeyboardInterrupò 0  }J QBaseEU  Xoas exc¢  V.’_‡ Ùion_handler({] w Ä'message': ' à ‚ failed'Ó:  À  'exceptionŸ': exc,
   ÿ'transport': self' ƒprotocol& $._ 0 1})
k õdef _maybe_resume4 (i !):&  ” 1if  V µ_paused and&  *    = ñ.get_write_buffer_size() <=Æ ·._low_waterh > Š h y= Falsel 6try£  ;   } ? .Ù  Š Ying()A ûexcept (SystemExit, KeyboardInterruptŸ  d ;rai‹ J QBaseEU `ion as×£ ¢loop.call_= Ùion_handler({§  s   Ä'message': 'Þá Ž failed'÷C l thalimitsbndreturny/,@ChighAÏsw\  , 4 ¡=None, low
 q !if! @ is $ 
¹ if3   Z [ É = 64 * 1024ÂJelseO 3  2 5low1 j 	Rlow =¦ B// 4ù  L bif not !>=« J>= 0u ¸Å ValueError(t  C   !f'È  ({ Ó!r}) must be U \({low #0'R C � @ ž° k   Ï ­ É  ‘Á)[ B  “ = ý6low: ÚB(Û  œ ¹Ô < FeáNotImplementedn0
imÇt socket ôwarnings


class TðS( :C"""A: õ-like wrapper for exposing real 10 "s.C ðThese objects can×rsafely l°ed by APIs d ³`O ÓÂextra_info('É ð
')`.  All potentially dis="iv³Àoperations ([ " "= ñ.close()") are banned.y 2"""¸ ð __slots__ = ('_9 '',–�__init__@,õ : 0et.- eÃ ­.D ! =% d  Þ3_naC 8wha4 £.	 
41f"Uy{3 A} onT 6etsRPfrom :
;Àcket') "
     ð.f"will be prohibited in asyncio 3.9. Please report your use c $"
K   ùf"to bugs.python.org.",$ ñDeprecationWarning, source=self)
. ‘@property ±def family($ :  r preturn  r._sock.( F OtypeD  & B _protoC ' D  ¾ Œ__repr__9 Us = (Î  Ò 3f"<~`.Transu±Socket fd={ê ¼fileno()}, �ÿ ( 4P!s}, Ó     < ´ %  }" ˜ ¢ "ifp† f != -1” $ :try   rladdr => 0get°iname() + 1if . E    60f"{Ø & !={ ¯  & pexcept f Žet.errorO Ipass~ º rº Opeerº . k  ” º & !={ º &» 	(>"y iNtate}°raise TypeEô("Cannot serializeŠsobject" á Ÿ)û –   Ÿ»¢ <dup7  % n ïget_inheritablÒ1 L �shutdown… W, howÁ #ð doesn't currently3ôvide a high-level t´E APIžT# to i ° the connec.& ', (� , Ìcockopt® °*args, **kw
 º D= 7 b s—b ¯ 6 [ 5get8 < ­ - ­Ä |D  ý- D !by F / H  ac`‰Ë  P c._na('  –) method'æœ, ‰!_ ,, Vcp 2 q Àurn self._soðck.connect(*args, **kw
 ³)

    def " ¬_ex(self, + :+  /    g._na('5 ¥) method')( rreturn / &so‡  e _ Š Obind„ / ~ * x _ioctly 0 z + { olisten| 1 } , ~ �makefile€ )è" q . ÕEsendd ]3 u . è Ocloså  m + ß odetachA  ] , ^  Ü ‘msg_afalge B8 } 
k L( � (‡ ° � /to€ /to /to~ | z x /al¦ ( 2 w - ø	³t_inheritab3�
: ‘ 
5 ™ 2harÝÏ, process_idÎs+ € + P •recv_in„4 ~ / ø  $ Kfrom‹ Àgs, **kwargsC):
  õself._na('recvfrom_into() method')+ rreturn 2 Zsock.3 °*args, **kw
 !)
: @def ( 2msgZ  @ ,, - ’ 7 ‘ 2 c � (‹ Omsg(�  l‚ 3 	. „ € ÿ ü £settimeout~ Wvalue“1if  V == 0 ±ƒX `aise V@ eError(   'j £): only 0 | ð
 is allowed on transport ÙGets'¿g² « � & 0[³setblockingß Gflag3 pif not  Ü ,h .):À @ canh 4be ( Ó ‘__enter__¥ Ÿ  ÿ	context manager protocol
X @c__exitl o, *errr :] W ñ.
"""Selector event loop for Unix with signal handling."""

im Terrno i
 „tertools o
 sp  _ ) Q 5tat †ubproces: y ”threading.  warnings

Ù3 . ± Qbase_ë s se 
8 Œconstant6 œcoroutine d œexception. ]futurD ,± LtaskH š 4logû òlogger


__all__ = 'EaLoop',ú'AbstractChildWatcher', 'Safe 0 =Fas, _Pidfd- PMultin 
 1 'TÍe5 uDefaultª ðPolicy',
)


if sys.platformñ'win32':  # pragma: no cover´ rIÏð'Signals are notðD really supported on Windows')


def _sighandler_noop(signum, frame):
    """Dummy  3al 1 A."""  CpassP òwaitstatus_to_exitcode( O Atry:8 ï    return os.; 1 öexcept ValueErrorH À# The child w òed, but we don't understand its ’ .W  ˆ  @ �is should0 bhappenE ÷if it does, let's just< Æ CthatZ ¡; perhaps  æhelps debug itw 9 Ž ñ


class _UnixSelectorEventLœ  _e ms.Base& e0"""E  + q loop.
± XAdds É@ing ôUNIX Domain Socket;M to h Ä  W Mó _init__(self, s¯ S=None—  k—super()._/ ê )J # @elf.œCnal_obs = {}Å  n Qclosek \   Q ÷
if not sys.is_finalizing(<  y 0for� in list_ ‰ 4  8  ò {.remove·  Rˆ Felseµ :  if)î 
&  * pwarning*�rn(f"Clos½1theá  {† B!r} — 4  ÿ
f"on interpreter shutdown: Àstage, skipp~ KAers Eal",Í„ ’ResourceWÖ / - =â NZ   ¦†.clear()2�_process_0 Q_dataà ,  Õ0num  
�M+
  ’ ð# ignore null bytes written by _ e ‡ (Î ‰continueA , .b Z7numá 3add * rá ÷sig, callback, *argsñ „"""Add aÚ a	anal.  ConlyD æ WRaise‹@ if Šònumber is invalid or uncatchable?I bRuntimÖK  re? àa problem settr!upi I  Œ Q   Ðif (coroutineô (I) orc 8 ' 	4 †function< = 7 r2TypÁ &("H @ can{be usedbo"with È &)")Scheckï ð)
        self._ócheck_closed()
  Etry:   û'# set_wakeup_fd() raises ValueError if this is not theC û$main thread.  By calling it early we ensure that anB ñ event loop runn< “n another[ @ can€ Ëadd a signalG ‰handler. * .è öself._csock.fileno()'†except (A, OSŠ) as excG5r Runtim6µ(str(exc))
Ž Ÿ 1 = ï 1s.H¯ (.Àback, args, œ f, None’   "._Ë _H ¢rs[sig] =  h æ óRegister a dummy@; ð r to ask Python @writ®e* Å 6qnumber ø"e @ Ið descriptor. _process_¿ ¼_data() wil¸ :h  Z bs fromxW  ž ò 3 sð!`(sig, 93 gr_noop”Ï àSet SA_RESTARTb ÿlimit EINTR occurrencek ’interruptq GFals¾PCB1delùå	~!ifˆ T. 
— Ý     M&-1t %   ¾ n 6   Úlogger.info('�ð-1) failed: %s', F ˜ ifj¡.errno == 	 ~.EINVALé „ ´f'sig {sig}>ªbe caught'é OelseT YCdef z O@nal(‚,…): @"""I�nal help¿ at= the actual4 ! Ur."""â¨/ =1.gec½ #ifÅ c  5Œ  ƒöreturn  # Assume it's some race conditionER €._cancel¥   U  ù s.removerÿ)n R  †properlya lQ T_add_X Rsafe( ˆ{ ?elf� Š a'@r foÿ�  UNIX on¡ å R6@TrueÿoC Bwas … 1d, í ' 6notå Ôß ”x (o ¤šðKeyError:
         ó   return False

  �if sig == µnal.SIGINT:!  ( …handler % Ãdefault_int_ 1 Oelse? vSIG_DFL† :try3 0sig�  c(sig, h )i úxcept OSError as excG  if `.errnoä 	 z.EINVAL*  ç Ñraise RuntimeU 0(f'ö{sig} cannot be caught'‹  > ø   T é 0if D bself._Þ As‘  N 2 û.set_wakeup_fd(-1‰ R(ValuÇ ,%)& Z Ýlogger.info('` Ð failed: %s',S)Ó X3TruW£def _checkâ (ï ,a)ä ð"""Internal helper to validate a/  i RŸÖ s if the) Ñ number is inG õ or uncatchable.9I èK  re? ña problem setting upi ‚I 5"""U Ú¢isinstance¶7intõ  jB Typœc1mus[qan int,& wG!r}'m¯ D#inú .î l/s(o 64(f' N9 n l Äó	make_read_pipe_transportÐ  ,,õtocol, waiter=None, ò  Qextra. ² Mï_UnixReadPipeTx  —3tra,À _writeÁ B Â W| Ã %fasync É ®subprocessŠ#ro„¿args, shell„šÑstdin, stdout ¿err, bufsizÍI `, **kw� Þðwith events.get_child_w¢1er(� ( Z \ ¬.is_activeì , 0# C{f early«     # þ Õe' ion beforeÊ ^� creationÄB# pr¾  �` execu0 E § ?  !isØ SyîQ> it¨ &¤!("/io;[ ðated, "
             ø"subprocess support is not installed.")
? úwaiter = self.create_future(* õ transp = _UnixSk T @ort(C ù	, protocol, args, shell,u �  Ñstdin, stdout Ïerr, bufsizeN å = �, extra= J @**kw× ))
Ñ òwatcher.add_child_handler(6¯.get_pid()q  L.L ^ ²_callback, V  )y:•  Zaô   )er þexcept (SystemExit, KeyboardInterrupt)Q _raiseJ QBaseEU >ion8 ² \.closY¨ % _° ~ % | } creturn�Odef 5žBid, : EcodeK² z kô_soon_threadsafeÌ_di_exiteO `async � Qõunix_connection(Ä  ×  q 7ú_factory, path=None, *73ssl Bsock S ßrver_hostname" !sl¤Ñshake_timeout( õ™assert seN  T — a or isZKnce(&  µr¢fif sslf ù   [ 
(  , üº ValueErrorC "   ð 'you have to paa  when using� '¡ Jelsew Ÿ  N þ 
,  } £ ' 9ûonly meaningful withŠ  L  | ¢ C ‚ 	 X   /'sZ � J !if™‰  » ?ock!  „ ,`    'P and èA canÍð
be specified at the same Ç'„D C p= os.fs ( ÷ ' ] =d 0et. 2et( ”.AF_UNIX, êSOCK_STREAM, 0H >try H ú.setblocking(False9  … ª ‚ .ˆ ð , path)
         €except:
  Ísock.close() eraise
 JelseB 0if A { is Non  g B ò	 ValueError('no path and< ú were specified'† @if (b ¡.family !=5 Õet.AF_UNIX or   q  5 Gtype3 ÊSOCK_STREAM)È  6 « X Af'A x ðDomain Stream Socket was expected, got {‰ ;!r}Ø   ö.setblocking(False)lõ%transport, protocol = await self._create_connection_4 (»  l F ú_factory, ssl, server_hostname,: ÿsl_handshake_timeout=s ·ureturn � { Þ £async def Â Runix_ˆ ¹ 6elf> ¹  @=p;, *± 3ock ±backlog=100ë  ß Y 
( Atart¢ ‡ing=True?áif isinstance(TGbool" ]4Typñssl argument must be an SSLContext orU' p~ �1not0 Z  :sslæâ'Ü ^ ðonly meaningful withBž  › /  €  I
�  ¿ ?ock! +3	Œ "   'j E@can t bKÐ at the same ½¬  D C p= os.fs ( É #  < t  !et‘‚,’_ë B   ô# Check for abstract6 a `str`µq`bytes` 0s a up9ed.!if$ 1[0]õ Ûin (0, '\x00'y  :tryˆ     �€tat.S_IS¾ ‚(os.stat	x.st_modí 5  ’os.remove2 	¥  ( vÑ FileNotFound� OpassC !OS9  a/rr@ a# DireÞñ may have permissions Å#toy‚s  º ‚logger.eµpUnable ; É2or ø b stale/ 'P  T  ‘'%r: %r',ÇW, errå ' ³ a _.bindn j'Àas exc:
      ×sock.close()
  ñif exc.errno == 	 Í.EADDRINUSE:2  7 ð# Let's improve the: ÿor message by adding@ ð with what exact- ÿ ress it occurs.9 ±msg = f'Add/ ÿ{path!r} is already in use'@ ìraise OSError(í ý, msg) from NoneC OelseY 	0 nexcept. �

G o 0if @  ï  ¡ ^ A b Valueä 	”  ¼  '7ò was not specified, and nod  9')
F @if († ¡.family !=1 Ùet.AF_UNIX or1  s   5 Gtype3 ÏSOCK_STREAM)Ï %Af'A x ñDomain Stream Socketç `expectâ Pgot {‰ 8!r}Ù   ö.setblocking(False1ñserver = base_events.S €(self, [C ÿ], protocol_factory,  össl, backlog, ssl_handshake_timeout�  Ptart_– :ing9  Xer._s# üð# Skip one loop iteration so t˜Pall ' P.add_[*erU0# g, Zrough¯÷await tasks.sleep(0Drreturn § [°async def _Fó_sendfile_nativeb   ,  ÷ , offset, count::try4os.N ‰œ’ Attribut+
7 I) 0ionì“ ²NotAvailabl8 (W Ð"t  ()­ ga6 "É®  Ý  Šæ . »� * (º ó, io.UnsupportedOpÍ@) as™Û &"¹ � regular• ¾ 
òsize = os.fstat(Á P).st_ *È ‰Ÿ DË w " ='3 if	  Z  f “ !if5 • ´¡0  # empty½ ÷`fut = 	Ø.create_futurs ß¡_impl(fut,w,Oé/no?ð     offset, couónt, blocksize, 0)
  ñreturn await fut
 ðdef _sock_sendfile_native_impl(self,. ð, registered_fd, 4  , 1 1no,K h  »offset, cou¥ Ptotal€ 5t):J Afd =e .d (Ê *if� Æ is not NoneA  ˆ ð# Remove the callback early.  It should be rar'  at, † E Ðselector says  0 fdu �ready bu4 ` r still lsG û'EAGAIN, and I am willing to take a hit in that case inE Porder2 s¡1ify� acommon3 .1  Á!.r‰_writer(É	Vçfut.cancelled(� J +pupdate_¢@pos( Dno, ëÙ	•  "if
¼Æ" = 6 - Q =  › &ifôZ <= 0J  # ¾ 8 O  *¶set_result(˜ P '   í ± :tryŸ ¤sent = os.ƒ(aMc �except (BññingIOError, Interrupted ËA= ½ 7Cadd_dation_PB(futš <  6 x Õ P í pk+ F  F ?ock|Šu
p P!OS5z as exc­:if A } ÚM ¹ Ñexc.errno == 	 Ÿ.ENOTCONN4 ”type(exc)b `Connec{Ÿ Ô o ø# If we have an d ð this isn't a firsb]ll to³ $# �ƒ(), i.e.e� ² was closed¯�e middleK  !of= Aoper8 , normalizpeoÑà K  @to m(pit cons�únt across all Posix systems	  «new_exc = l (m  / "ä$et€c€@ed",µ %noÄ
ø ; j À.__cause__ =Lg Ž . 	 'ifî 7Õ ð# We can get here fûor different reasons, the main
  ÿ!# one being 'file' is not a regular mmap(2)-likeA   6 ÿ, in which case we'll fall back on using?  Ýplain send().  ðerr = exceptions.Sendr ýNotAvailableError(<  ë @"os.\  3   c� �failed")/ ´self._sock_2 €_update_> @pos( ðno, offset, total. tO …fut.set_¼ J(err' _else:ˆ `&xcˆ Ÿ ú (SystemExit, KeyboardInterrupt)¦ Frais
B TBaseE¨0 asµ
7 a8] 	Õ Y ifcjt == 0–  &_# EOF‰Uresult(<r1 +=Ç « M #  ifÑ istered_fdè?Non�  ¬Àadd_cancella„_G Ö`(fut, 1O <   @  : ±writer(fd,  aÐnative_impl, P Û  N  J Sock, Ž2 <ú, count, blocksizeÀG Kdef ¢  Å { 	^'if!, >y�os.lseekVÛos.SEEK_SET)
—  S�™ “ˆ  Õ  cb®È ifs.P ;ed(   wAfd =ä.o(ì G vd != -1u  <   › ….remove_H  Í Ø Fdone]ôcb)


class _UnixReadPipeTransport(t
  s.  "):7@max_éð = 256 * 1024  # max bytes we%d¿ 	 ev7Ploop ·ðL  E�__init__(Ñ  , ' ð, pipe, protocol, wa: =[q, extra […super().O &  ^ !._  ['_ A'] =h  V#  � ð = loop
        Ðself._pipe =  #
   cfileno . +()% €protocol'  " û closing = False epaused  0mod— ˜os.fstat(“ P).st_! . €if not (+  .S_ISFIFO(# E) or' ß  ' OSOCK' 2CHR& )):L •  ;f = NonÝ  j  8  AB ðraise ValueError("P®ñtransport is for½õs/sockets only.")
« ù os.set_blockingL,–. · ãloop.call_soon3 ¬ ð.connection_made, 5 #„  gprt read [when 9 �() has be Ualledµ  R /._‡  P_add_\ 5er,5  w J ˆª .9  y¶ �if waiterW O �
ñÙ ´wake up the3 Þ  ¥ ˜ Í i�futures._²ðresult_unless_cance$ð  \ É ,•ÜÁdef __repr__ÐÍ0infé[“ õ_class__.__name__]a!ifë7!isa 
$ L �.append('ý6ed'e%elC   ?ing> 7ing? ] bf'fd={³ Þ}* ñselector = getattrõ SD, '_! '& 8  ¡ Ù!is[ @ andÿ X  
Ã @pollñ=, Õ_events._testy  (\ |   ™ ¬Ü  z Æs.EVENT_READY : 3if } 
’  5nfo—& / # Oelse9 Gidle6 Î-
I ¸Y'openE w 	.  '	Cðreturn '<{}>'.format(' '.join(< )ó $ëö:try¦  data = os.5 / '._¦f.max_sizex“except (B^!IO«Ñ, Interrupted y  mEpassûE !OS* z as excœ èaatal_epexc, 'F e  1 on &kÀlse:
         �if data:
  ð self._protocol.%  _received( )3 NelseE 2if H þloop.get_debug()+  | ñlogger.info("%r was closed by peer",Q 
|  ; g  - ©ing = True¡ % Œ ò _remove_reader(? ofileno] 8 “call_soon3 !5eof B R ñconnection_lost, None)
Â ‚def paus­ 1ing{ Cfÿ !or&!._7 dmareturnZ ) 8ø 0‰ 3 ïç è~  s Œ5ingä¤  þ _resumÿ ?not&FFals<?add1”.  y%ó 5setž$, Œ¾  % =$ [ §! I ? ,J; 3is_s9 
$ 8   e3 6if ¶ " :ingºÍ   +e( q__del__T €, _warn= Pings.	 Õ “qpipe isw  P 
n E Q(f"unr Ðd transport {Š ò!r}", ResourceWarning,  =" iAipe.Q (ß²_fatal_erroŒð, exc, message='F     A on º � 'Ý À# should be Z;Pexcep^Ñ handler only` › ñ if (isinstance({ 0OSEŽ P) and� �.errno ==† gno.EIOw F  ö /._þ + C: %s÷õ _=ÍMkw  ô _ï _ï %({ì     '\$':f,$ I  ':"  …:'#  ]'" U
, }â Ð &8exc)  !  ƒ  .�ÊÀop._remove_róeader(self._fileno)
   ãloop.call_soon+  ñconnection_lost, exc)
? _def _% @ * :*  l 6try   z ›protocol.i (h  (   ofinallA ¦ipe.close(Ö  4 ` ¥ipe = None‹  ~ "   ô

class _UnixWritePipeTransport(t
 ùs._FlowControlMixin,~  ‚ 
 < Z V '):ns_init__a œ „, pipe, H�, waiter=ò  „1tra )~”super()._O pextra, P D@  ['e A'] =n Ë #    m . ¦? „Å a ýbuffer = bytearrayE  >¡K = 0?  ð	ing = False  # Set when  €e() or wÑp_eof() Ö2ed.z ©0modG�os.fstat�M@.st_! x `is_cha²  - �.S_ISCHR($ `¥is_fifo = % NFIFO& hsocket( LSOCK( tf not ({ 4or a  F  × ‚$
· 6  > À t & ðraise ValueError("2 íé is only for ";  ? 	 "h2s, É `s and fãacter devices"œ : ù os.set_blocking´,ŽÌ  –£`made, 5 q ñ # On AIX, the rwÐ trick (to be£Rified}& p end of6 #è  "¥"d)*Qworks0	.v ÷other platforms itJ 3 C:= `(Excepáö: OS X 10.4?  Issue #19294.( ifX>  6 qÇ � ‚Dsys.ˆ û.startswith("aix")€#Ô ' 1 ¨™x l�() has be´Ualledà  ë ‰/._¾ R_add_‘‰!  ×Ýå.=  yñ#ifn ¦ ý  h š â pwake upã3 ç 5�futures._íðresult_unless_cancell_ed,
  áwaiter, None)
0 ñdef __repr__(self):  K €info = [ ö.__class__.__name__]) "f $ qpipe isa H L õ.append('closed')A 4eliC   ?ing> 7ing?  © ] bf'fd={� wfileno}* ñselector = getattrõ ¤._loop, '_! '& ½   ¡ ä 1notè @ andÿ X 4is  
Ã •polling =, Õ_events._testy  ( |   ™ ,@ 2f._Ü  z Ös.EVENT_WRITEZ ; 3if ~ 
“  4nfo;'& 0 # Oelse9 Sidle'R 3   rbufsizeñ ðf.get_write_buffer_ (© � #f'A #={	 È1�
« W'openÝ Ù 	.  Š	¦ðreturn '<{}>'.format(' '.join(< ) Vñ  ™cS 3lenˆG Q_read y# = 0# PpBwas ¬ • by peer.>¶ à„gdebug(F  ¬plogger.Ã ^("%r S "jf°Z ² 
v æ !._• p(Brokenª vError()D �9 9ÿ g, data¿ ðassert isinstance(!  , (bytes,  ðarray, memoryview)), ô, � .ifH @ t  3 f ' =T L  	 ' 
ó~ I IÃconn_lost orå B+1 Q>= co óts.LOG_THRESHOLD_FOR_CONNLOSS�  „  ‘warning('T } $edT • 'X 5   B'os.¬ B ¬÷ raised exception.„ E õÎ I+= 1j 3  \8 €ö# Attempt to send it right away first& … >tryEn = Ó o x Ù: B à Á (BlockingIOñÑ, Interrupted J <  i 0ô N óSystemExit, KeyboardQ Àpt):
         draise
   Áexcept BaseE ¹ion as exc:)  - ÿself._conn_lost += 1% ðfatal_error(exc, 'F q write  ý on pipe transport')N ireturn þif n == len(data)© 6  !el8 >> 0/  F Ò = memoryviewX I[n:]z  ¡loop._add_Í "r( ‚fileno,   …_ready)
E  `buffer> y  ómaybe_pause_protocol(C Bdef u Z z ÿ cassert‚ f ö, 'Data should not be empty'˜ :tryqn = os.Æ f *._à ^ °HÀ(BlockingIOEüÑ, Interrupted ¯  SEpassE õSystemExit, KeyboardH A 
ÓB ÏŠv.clear(Í  ™ ! ì‚# RemoveÓ˜r here, _ùÅ) doesn't itå  ] P# becã" _I2 is•.( … qrn ÿ
t¹ ‡ €!Jelse?w˜ » � ß  ]% Ü 8 'Xresum(ò  # May append to ¥ 
W G #if(zclosingí  "   Ê 	¥  Ôe�	 8   < Acall3Rectio9Z(None¶ 1 ¶#elÃ ä B[:n]Ó (2can,A_eofÃ©j V True2 í. +L ·	„ ß o" =~  ø    ^o»
’> Š4 ‡Asoon!._  Þ—", ˜²  D6set„ M $, “M  .( % =$ [gI ? @Ê_ ; 3is_¢º 9 $ 8 Àclose(self):#
  ñif self._pipe is not None and  …closing:9  @ °# write_eof; ðall what we needed to : Re the-  i 	F a I 1()
 Àdef __del__(" €, _warn= Pings.	 )� É #  ³ E Q(f"un˜ Ðd transport {g ò!r}", ResourceWarning,  =" )Ÿ  L     =.Q ¿ Qabort½ ¨ 1 ,  hï ±fatal_error7 ð, exc, message='F     1 onJÀ 'e ð# should be called byM õeption handler onlyÏ iÅ‘instance(z 0OSE� Z  ô kû loop.get_debug('  + rlogger.  ‘"%r: %s",sØ æ ¦_info=True`Jelse¾=w  × B_excÒ _Ò %({Ï     '?$':I,$ I  ':'"  ("':¿ E ƒprotocol" $._ 
O }â Ð 8exc  !  =,   ._% `ing = :’ ¡fbuffer6  : D�_remove_}sŒ._fileno¤ J |.clear( 	M _readeM 0 ÁAsoonë!._ `connec¤Q_lostû 	Kall_% @ * ê 6try ÷ ’.D ~ (   ofinallA 5ipeê ,  W Ý! =AŽ "  !"   ô	

class _UnixSubprocessT±u(base_s _.Base(  '):R3sta”ñ, args, shell, stdin 1out ðerr, bufsize, **kw1 å3 $_w°  è    ~ M G == ž JPIPE“õ# Use a socket pair for‹ Ainceƒ Y™platformsXQ# sup¾0sel90ng �p events&zŒend of aB  `(which¼Àuse in orderÂadetectÉ m ofÎE ð
other end).  Notably thisqon AIX,ZLworkË �just fine· Q ö .p z¥!in�C.  I¤À         selÐf._proc = sub
 Ëess.Popen(
  Áargs, shell= �, stdin=  0out 1out 0err Merr,N óuniversal_newlines=False, bufsize= `, **kw} )E "if ù _w is not None:$  Â ž z.close(B  #el.) 1 = þ  ñ_w.detach(), 'wb'� dferingŸ S   A_w =‘ � zfinally¡ Å 4r å ò

class AbstractChildWatcher€ 4""" b base 1  for monitoã   c8  Aes.
Í ó
Objects derived from thisE A ÷ a collection ofbaes andM òreport their termina1 ¡r interrup ³by a signalˆ ñNew callbacks are registered with .add_Å ñ_handler(). Starting a new† ã Ñ must be doneC `in a 'M ð' block to allow³ " wT  SsuspeÕ ñits activity until. 4newM˜ if fully´ (E Íƒeeded to� ñevent a race condiñin some implement:#s) 0Exa ñ ì Ç ³      š"sleep 1"æ÷ _  I U.pid,š)5VNotesu Iš ³  ý ‡‡³thread-safeÔ  ­ 0SinœŠ # o”Pmay c•qsSIGCHLD7 t— V J Àwaitpid(-1),1 �re shouldPonly Êec D perÅ.I 2"""ã Ndef qiself, 1, *ÏC"""R¼–{¶ý €Arrange ªý(^ ¤returncode`  —!beó  1hen±  ú  ¨•ess 'pid'x±es. Specify anotherA  eu �the sameK €replacesI® previous Â  
:T %()u	î ¥    ^    •raise Not>ƒedError(e ‚kremoveö…)t , ² © ä 	}rThe funÒp`s TrueÏ E ´was successæ j dì7 0re 1  n w2to Å .ý hþ  at¯b_loop(õ   
ö ÀAttach the wóatcher to an event loop.

  ƒIf the w* ýwas previously attachedB ,6 un it isL ƒfirst de4 cbeforeD 0ingE  l <new† QNote: Õ may be None.Z 5""" @rais  òtImplementedError()× õdef close(self):: @"""C  ¼ ò �This must€ Bcallø ðmake sure that any underlyÔ ÿresource is freedµ (�is_activ¹ úReturn ``True`` i¸2is ; @ andŒ qused byë ùQ  O M  Binst P Pready¿õhandle process exit^×notificationsW¼ __Ô?r__À 0EntÐ²�'s contexšÐd allow startž k­ "es øê@func¬ ór` 2± !3xit° š, a, b, cyAExit�j¸ o ò
class PidfdChildWµ˜(Abstract ~  ó + ï$ i5¨0 us'ôLinux's pid file descriptorÊ3cK @poll.8 0 (p©  s)8aawait ? 0”q termin‹ þ. In some respects,ë  ÚÒa "GoldilocksY ã ð. It doesn't require signals or thÞ$s,$   ig‘fere withô³ qes laun`outside],ƒRscale‚linearlyL Ïumber of subY  ¸A Theš ñmain disadvantagy™o  aß 0pecŒ {Ü”  on… aork onM 0recâ(5.3+) kernelsÁ –$  NE__ináZ H . ._R! =²2   E¢backs = {}€P âr†	. _ exc_type, 
 Cvalu  eo ¢ 3pasø x ax Ð ais notÕ Ð2elf ¿.is_runningr!E'(×§  , ,À 0if  z  þ	• z*is¦ À._callbacks:'
  �warnings.	 (  & þ'A loop is being detached ', ðfrom a child watcher with pend> ­handlers',> ‚RuntimeW� )  õfor pidfd, _, _ in self._callbacks.values():5  » &  ¾ ñ._remove_reader(O b  - Œos.close E k fclear(<    e ! =*
„ �def add__ö (- ,Í $, R w, *args» Pexist,=è 0get  ~ 5if / ¿is not Noneq …s[pid] =9 8[0]�  Ž Ã  ;elsM ;a = os. Z_open•  9  ê  ._ ._y,Ø qdo_waitÓ > ² q ¬ ­  p_Q gV<  c:popÎ Ê F
:tryx’_, status/ ì 0pid^ 6, 0ñ €except C5ÊProcessErrorM S# TheZp&  ” alZ�y reaped A  ô# (may happen if � )9  ]0ed áywhere).= ùreturncode = 255 alogger1>ing4"ö § `pid %dpt· Id: "^  ¼ ç" will report � N255";7pidP´@ =—€_to_exitæ ( )¾ ƒ  9 vÈ[ ÉB  �.œ:­ï£B?Key9 ¢ e FalsehÕV ñTrue


class BaseÆWú˜(Abstract &):!�__init__±ž ! =Ð¸ ƒ Y&{}P Á > M  atµ�(!è ¦œis_active† ã  O Ê 7bC andÇå`is_runI(\ ’ ÷ H °, expected_³âñraise NotImplementedÌN M_all° D 
À   def attacÐh_loop(self,  C):
  aassert ð is None or isinstance(1 ð, events.AbstractE eLoop)
K 0if c .n  M 2notQ :andb   , –callbacks“  š �warnings.	 (c     %'AP þbeing detached ', ðfrom a child watcher with pend> ­handlers',> ‚RuntimeW� î 
É æ  Dó .remove_signal_t ( ‡.SIGCHLDa : ! =î œ !if c
u o ?addl ,¯‡sig_chld|  dA# Pröõ
 a race condition in caseU¥terminated¤ B 0dur`¹the switch.! ã ó do_waitpid_all(‡ @def À › ¼¶:tryò J  †   ÷except (SystemExit, KeyboardInterrupt`  4 Uraise¯ B QBaseEM  jas excŠ #V „ö should always be available her^  p e# as 'ó 'ßPadded "a ( 7˜ : `in 'at}
 � .n_Ë 5ion„{O  S ð'message': 'Unknownë $ep °� : 'h  ':< 
\ð})


class SafeC�Wœ(e ™@"""', 'Ë implementa� .‘ZThis  ° avoids disï ™ ot�code spawsÑ processes by@poll- ô explicitly each)   á Apead of w1ingN oÔîI(-1)® Ðs a safe soluÌ ¡ but it ha ðignificant overh^ Bwhen… £ ac ¡big number}  [’ren (O(n)»  Ó ± 1is ì!d)> 2"""C ‚\close~Q Õ ºr.clear(>  =‚super().= Ð _em,__R areturn:| c__exit- “, a, b, c h Fpass/  ðä× ¨ a, pid,‚ ­ w, *argsE  % %._Í ”[pid] = ( !, 1 h  v  ‹ Ävlready %} 4(pi‡ ~2K Ö Å Ðdel self._cal×lbacks[pid]
  µreturn True õexcept KeyError:  8 1 aFalse
 òdef _do_waitpid_all(self):   6 ñ for pid in list  R._cal˜ )d  > .S R(pid)M m I °, expected_) L iassert B > 0J  — 6try.   ópid, status = os.Õ (b , �WNOHANG) ; 6ÏChildProcess? p# The c% " p& õ is already reapedT  X ô# (may happen if “ )9  Céed elsewhere).=  t=	 Í©code = 255 ù logger.warning(  ™ ‹"UnknownÎ  s ÷%d, will report h ]255",L  ¸  Í 
—!if>J== 0  ˆ S st� Zalive 4 ‘ 	  e€_to_exit ( õ 8 2if ±û loop.get_debug(Õ + S  ' 0%s a xed with->%s', I  
˜×  ª / ( å 4 P, argè¿  Rs.pops ?   Üõ  # pragma: no cover¿ 1 9# M´�.remove_ù—_handler(Â> Pafterg ˆSpid()sÌ|Ï"©ô watcher got an unQ qO: %r­  á  4�exc_info=J Ëf a,Õ  ±0, *Žá)


class Fast¤ W£ X(Base `@"""', 'ˆÒ ò implementation.ìZThis  tôs every terminatedž`es by ¶ 1ing¦ð-1) directly, possibly breaking ot\ ß P spawHX M 1andÑ .  %Utheir‡ ¹ 0ereñàno noticeable y¡head when X J  a big numbFf1rens ò(O(1) each time a u #esE1"""1 tq_init__qz 0supÉ$._  üV�lock = tháœing.Lock(& `zombieŒ!{}t \ �elf._fork · � ]closeŠ .  © Üðs.clear()
      ó
  self._zombies.clear()
  ñsuper().close()
 àdef __enter__(A !):  5 CwithU Flock    , Â._forks += 1P     areturn=  i 3xith Ÿ, a, b, cq !-q !ifm ’ cor not 
À ¦ ¡     ñ	collateral_victims = str^W 4 g yHõ logger.warning(  ; ù)"Caught subprocesses termination from unknown pids: %s",E ´ ßòadd_child_handleÊ ,L ÷, callback, *argsŒTasserBçö, "Must use the context manager"H9
?tryŠ@coden	Èzpop(pidrþ except KeyErrorQ 0# T£  ø p is run|.7 €»‡s[pid] = 6 ßñ n ó	dead already. We can fir8t�   è ", ]  –i  CoremoveÐ¿f3deln í 	Ü { U True k
1 VFalse¦ ñ _do_waitpid_all;œ `# BecaGðof signal coalescing, we miAkeepŠCing P U() asœ ñ# long as we're able to reap a ÷gQwhileÝ 
0,  pid, statu4os.� ï-1, os.WNOHANG—CwPÏ rNo more¥  ýVexistµ  Œ   jú   JelseÊ    ifÛ^ == 0  ! :# Au  !¾still alive|  6 € 	�   ®! =¥4€_to_exit ( ” 5   %
 ! —  Á , �1 /s.3 : Ì
 !   #o@ò  $ 
oh ( 0# I!yŽÿbe registered yeæ  4   —R•rU R” À              ðif self._loop.get_debug():
  rlogger., ÿ'unknown process %s exited 'F 
	^ ÿ'with returncode %s',? Gpid,> ): �continue! îcallback = Non$ OelseI 
E='	í 5if è !isé Ô � ‰warning(A ¸´"Caught sub¾ õtermination from _id: "G ½%d -> %d", º l   ~Ì (< ø , *args)


class MultiLoopChildWatcher(Abstract þb"""A w( ð
 that doesn't require run >¡ in the ma	 aread.
ñ âThis implementñregisters a SIGCHLD signal handler on> ‚instanti8 ñ(which may conflict )aother : « ; 0ll �V Pfor t‘ n )¤ ae soluºðis safe but it ha¦  0 òificant overhead whe¦ _ àing a big numbÃ fñes (*O(n)* each time a¦ ÿ Ñis received). 2"""B:# I?3not‰b# The âòkeeps compatibilityåA ABCf Â# To achieveô Áempty attach!“() method8 5andò accept explicit@arguô0  |Padd_c�_3¼er()/remove 5  …@retrŸ sbccurrenc 0by ·Š§ 6Ðdef __init__(çØ L  $._<as = {}q  “saved_sig© '  \ œis_active] ÆZG ais notx¨ MclosH ¥ v.clear(Üud  Á
Ø— t  ç Ø  Ü al 
 ( .›	r 6 $!=á zig_chldm A"K Þñwas changed by outsideÁ"p óš  ¨ ,’ ºP À self._savedñ_sighandler = None

    def __enter__(self):   preturn  	. 3xit- ¢, exc_type
 2val	 'tbH FpassA £add_child_‘ w ÷, pid, callback, *argsE ðloop = events.get_running_ %()¶  ¯ $._I  s[pid] = (' a ` —  í A# Pr] ñ a race condition in case the º û is already terminated.ƒ ò do_waitpid(pid)k  qoremoveô 6tryŽ ¥ 1del�à z  % ·ETrue ú except KeyErrorV 1 GFalsbattach^ T , Bž ²# Don't sav   ð but initialize it< 1 ifÛÆed first tim� ð# The reason to do it hereiXthat � )  à N 5romå ñ# unix policy only for·pmain th³§6# M  U `requirW ±or subscripõon SIGCHLD signalu #if’ dhais notmp ± "-._@ =k .r ( .ˆ ,w vig_chld’ 
 û
Ž  logger.warN ("Eiousñ §õ was set by non-Python code, " Ñ  �"restoreÜtefault U öon watcher close."É  G vSIG_DFLMð# Set SA_RESTARTu ölimit EINTR occurrences
[@sigiMruptoÆ_àA_allÆ z0pid=Alist ·* ç R 2l I  eppected_[Ñ–assert ex F > 0SwÄstatus = os.´D , vWNOHANG UCÍProcess^ Þ8p&  l@ireaped?Ð# (may happen;“ úPelsew$)Ç J t=	\ rÔ µi = 255 	  \ ƒ"UnknownÎ  s ÷%d, will report h ]255",L  ¸	 @debuÍAg = l  ë ã ‰  if/Z == 0   qÀild process ûis still alive.
  yreturn
  ð
code = waitstatus_to_exit ( )8 õdebug_log = True Etry:  � ôloop, callback, args = self._ –s.pop(pidf ùexcept KeyError:  # pragma: no coveri ñ# May happen if .remove_child_handler() isŽ +ed> �after os.bpid() sKðlogger.warning("C` ù watcher got an unexpected pid: %r",p   àpid, exc_info=R
:lseT0if WÊ.is_closed()!  Z ¨ ÒLoop %r that s�    I !",Z , ‚  O e†   6if 1and> Q.get_ ˜  7 œ $ À'process %s used with~ ƒO %s'?
 T $  s_N½ ? 
É  , > }ð_soon_threadsafe( ©E 0, *»)@àdef _sig_chld(Í÷ , signum, frame‘ / S._do_jV_all(¥ úÀ(SystemExit,çboardInterrupt`  Ñ Frais…B QBaseEG:ion!�Å€'Unknownƒóeption in SIGCHLD--r'¢‘

class T@!edW
˜(Abstract ¶ 4"""3  Ÿ? implementa… .m5The! ruses a ²S per >^1forÆ@ing  4the  s finishS òIt doesn't require subscriþ �on POSIXÕ!al] 6butz 1cre£  Oƒnot free\ ¯ °has O(1) coÚ �xity, itsº …formanceŠ Rdepen—ôon amount of spawnÈ e�2"""‹q_init__Še jPpid_cM ñ er = itertools. &(0z/ \ ¥&{}c œis_actived h( ‘ —* _ 5joir(O	  , É 1"""ûó	nal: Join all non-daemons ù   È [  ì ßAlist£ .–.values() I  #iff  xd0() ô  b .Ž ] 7 …r % s‹ .þ 	 _eìÔp !à

    def __exòit__(self, exc_type
 2val	 ctb):
  Qpass
 •def __del@ `_warn= Pings.	 : ²threads = [ S for  qin list‰ "._ ±s.values())q ‚  #if= Å.is_alive()])  s¼  : ¤ @(f"{ó õ..__class__} has registered but not finished child processes",k  W  ÿ ResourceWarning# ! =~ )HAadd_a �_handler	÷, pid, callback, *argsSðloop = events.get_runz _ (7Q# =2Qing.T�q(target� �._do_waitv Þ  ä  sname=f"2 T-{nexÁßpid_counter)}+G 
  Ú  =(· ö   )L:  ¶daemon=Trueû  jRU[pid]ä w.start(—oremoveš‰ñ # asyncio never³ O?  U) !!!z ñ# The method is no-op}Àis implement�gecause9 áabstract base Èet •quire it., preturn sRttach) $ , }Ô êœ /  !ppected_5ø «µ{–assert ex. B > 0�  Â6try.   P Pstatu3oOš(D 6, 0ê€except C©P¨ZErrorX rmÎ y alž…y reaped; Š ó# (may happen if ò ()9  žÖed elsewhere)x = 0pid¢ø 	\ ›©code = 255 aloggerHIing(  \ Š"Unknownœ 5÷ %d, will report h ?255’ 7pidJ:lse6@ = š€_to_exitÁ ( F  £ !ifWœgdebug(b !   è   'c@ %s [ xed withÂ ?%s'
$½ Ü u š œis_closedš –  Æ ~ "Lm%²2at §slrE "GÄ
 
P =.;T_soonñ@afe( C¼ ÿ4 ·ÛI.popA)


ð _UnixDefaultEventLoopPolicy(eðvents.BaseDefaultE ðLoopPolicy):
    """UNIX e q loop p  ñ with a watcher for child processes."""E _8 ð_factory = _UnixSele x 
, ódef __init__(self‰  � …super().  )3  Telf._� g= NoneQ P  V É à rs._lockú  V   0if ‡ ] !is^ õ:  # pragma: no branch‘  ;   
< °= ThreadedC,W=(È  3   Aif t* Âing.current_ W() is Emain 
¼  J   	… q.attach•ö  al 6op)6Aset_+ ,“§"""Set the#.D  z óAs a side effect, if a*‘ð was set before,N •n callingQ.� `) from,  Q will<  è  ‚E) onO  ² °† .  · t~ P ç 3if KN  £1not*E andP    ÌÞy D ×Ÿ  QAget_í "­ N C"""GÇÁ Ññ 0If ß 0yetº?, aÙp object€automati×šy createdt Ó   r	Eý 	Ù¼ D jreturnº¾   Í,Í
à		3dassertM  ý  Žó  or isinstance(N ¨, AbstractÉ  z S 
íX w.close(I 	 $ =Ÿ =


Š£,0  
$í  !2s@bWindow8Ð
import sys

üys.platform != 'win32'†Qcover(qraise IF bError(3 „ only')
a _2 elapped dwinapi Terrno Emath Tsvcrt Vsocke Etruc Dtime( ‘weakref

À#. é js ƒbase_subT lfuture4 œexception Ðproactor_evenýts
from . import selector_even Ltask2 Äwindows_util 4logQ ólogger


__all__ = (
    'Sk Ej ÀLoop', 'Proa€ 	 DIocp "',> uDefault( `PolicyC W‘ _ " @ & W H ð
)


NULL = 0
INFINITE #xf þ
ERROR_CONNECTION_REFUSED = 1225  SABORT  ó636

# Initial delay in seconds for connect_pipe() before retrying to " 
„ `_PIPE_ª `_DELAY¯ ÿ .001

# Maximumj :7MAXi ñ100


class _OverlappedFuture(f "s. !):‡b"""Sub3 2of  Ð which repres†U an oP Á operation.
E ñCancelling it will immediately c O theE  Ž2"""M ódef __init__(self, ov, *, loop=None¼  7 …super().2 %   )›  $  ifVòf._source_traceback #   ?del( E[-1]N  “ —._ov = ov³  .Q_infoµ £   5 = ª ) £   ov is not é 
¡ õstate = 'pending' Ú 3ov. õ else 'completed'¹  ä  Œ Ö.insert(1, f'Ö1=<{a D}, {ä æ.address:#x}>'¯ preturn N è_S 
‰æ â X ² ;try0elf|.k (’ úexcept OSError as exc= µcontext = {b    Ç'message': 'Î
÷As failed =  '… Pion': )   'C !':i
  }• Ú´ U Ø ,['+  ']w3 	l î 4 .c#Ç “_handler(c o3  Æ™   ], msg°� & *[ /+ (K Fmsg)j Eset_ª j,u ep™x
0 : y  ´ "._p 
› . ˜ D cresultq  n  ( h Àelf._ov = Noñne


class _BaseWaitHandleFuture(f "s. Ò):
    """Sub7 2of  ñ which represents a wait hP Q."""
> ódef __init__(self, ov,' ,4 _4 ã, *, loop=None}  � …super().G %   )c  $ 0if ] ò._source_tracebackÄ  #   ?del( E[-1]N ð# Keep a reference to the Overlapped object k- àit alive until- O õ is unregistered ¹ {ov = ov # =1  W >( =L| ò õ# Should we call Uƒ  ÿpEx() if¯ @ ¥ completesk õ# or is cancelled? º Ó r = True~ úApoll÷Ðá# non-blockingw ö: use a timeout of 0 millisecon,ðreturn (_winapi.Ä ¡ForSingleO’o .u, 0) ==²    @ ×AIT_OBJECT_0)¹  ÚQ_infoO ¾   5 = •) Ž@nfo.&Rnd(f'Ä"={. W:#x}'1 ¿  o@not 	
Áðstate = 'signaled'¾Z l€) else 'Iing'ú  ¼ ˜ J ‚   9 =‡ I fl 3 æ F ë Â B o_; !cbxW, fut}Q# The2: waOp: it's 71saf±qdestroyÝ¹#Ã G‰ zŸ œ — "ifx Velf._
»ù m - s = Fals= ¤	=· J  ! =:! :try‹ 4_ovÇ.(G úexcept OSError as excS  if Q.wine$ 8!= f úERROR_IO_PENDING=  î µcontext = {¹    ð'message': 'Failed{8æ ¾ +/',G Ì Pion':² & 
!':w$ }\ �Î î ,['° ']]I t ° 	.Û_Û �ðr(context)
       vreturn
 õ+  # ERROR_IO_PENDING means that the unregister is pending
E fself._% â_wait_cb(None)( °def cancel(/ a, msg=  :H %()  ¼ “ super().O  I 7msgh Óset_exceptiono  )p i 
P J Ú  " cresulto  l $= ( ñ)


class _WaitCDÀFuture(_Base bHandle u b"""Sub: 2of  ð which represents a ­A forêT la:Q of a}z d ñ using an event.& 6"""ƒ__init__2ov,+ ,p !_h± �, *, loop
ãF @ =   ÿ Ø `ð._done_callback = lŸ è � 0 : ñraise RuntimeError("ü vÃ must not beÓCled"�  èà * î ˆ   ?if É !is{  Î É 0 -  ß õ  n ¾ %,  ø p   ¤ 8äjä
 m#  , )] Új�proactortK  p= › } $._d 4 =   ," %" { = True) Xð = _overlapped.CreateEr[,9 �, False,â’ G M_fut° ¤ W, futäK    û€Ò_winapi.CloseÂc!._9 ™  ™     ˆ 8 ¼  $ A# If¯ âF wasˆ, �may never©Õsignalled, solù# it's required toì t. Otherwi`SIocpPF .cç w() willO ‘ 1forw  U#z / • Bcome9Ó E Ý p ð  already receiv« $heRÄ @safeÀ  óð
        # _unreñ2gister() because we kept a reference to the Overlapped object
    ð# which is used as a uniquN %y.) óself._proactor._unreƒ  ?ov)- † = None
  upº E Ò_wait_cb(fut)* Gdef g " (l %):J pif not  $._‘ &ed!  å ereturn4 - w = Fals  Œ ƒhandle =]  J  ê  v   :try‹ %_oŠ%.UBwWaitEx(I ,v VeventX0excâpOSError­:excb ±if exc.wine$ 8!= u úERROR_IO_PENDING=  ´ µcontext = {é    ð'message': 'Failedfq Ë  B/',G Ì Pion':² & Pfuturl  ¶$ }\ #if;þsource_tracebackê  Ò î ,['/ %']û t  œ Å._loop.call_Û _#r(g Ê |   œ  ,# ¥ ž ç1an Õ,dFwas |"ed; G • A0_fuÐ Ã ¥q_cancelX!._. f O  _ � ±ò	_cb)


class PipeServer(‡ÊA"""C! ñrepresenting a pipe s1 .Ù @Thisðmuch like a bound, ln9 bsocket»1"""¯Mq_init__í “, address„  à Â  $ =" A   �free_inst:ös = weakref.WeakSet(æ # r aialize´Ò ðattribute before 5 ¹ _ì _& ;	M êtðfunction can raise  "  1ands `destruµh sÎ # åclose() method  ‰ Ô  acŠª ¤( B 5 ß  HTrueðñ get_unconnecteda °§Ô# Create new ‰ ð Nñ previous one.  5jensureþ ‘at (until
ž  ^ d)  re èalways at leas>2one§ê  f—Yz "erãøif a client attempF 3to ó � it will×ðfail with FileNotFoundError.
  ÷tmp, self._pipe =  aserver  ó _handle(False)
E Á return tmp
 _def _7   i ‘, first):*  B 2# R@ ña wrapper for a new – v .2 "if§ wclosed(L  P Ž ENone2 õflags = _winapi.PIPE_ACCESS_DUPLEX | õFILE_FLAG_OVERLAPPEDJ "ifÁ À  t ` |a D aFIRST_q …INSTANCEM h“ õCreateNamedPipe(%  `  :±._address, o ," 	Ú ÇTYPE_MESSAGEÙ … wREADMOD  H OWAITg ¤UNLIMITED_Ú S. ÿwindows_utils.BUFSIZE,  ‡ 0NMP… _ …FOREVER,ªFNULL‡,=^  LH¶h+ Pðfree_instances.add(D ' K  Úv C z+ ( ª@ is ˆ)> & = Ñr_acceptl`futureC 1notG 
tj 2  .cÏ &l(Ç B. ! =[ }0# CVU all À which have � þbeen connected to by a client¨¹Ì  ñ f2 inÛ_œ
ú  Ð  . .‹é   Û  7 5I! 
~ s.clear(Æ¡__del__ =  ²


class _WîðSelectorEventLoopî  _e ms.Base& 3"""H ¡ version oïB  B • loop."""| JProat p t & t 
B t ² using IOCP  Sîp_init__ë 4f, ; =ý½%if      L 9 t = Iocp± ã”super()._r 3 ž Ž ±run_forever‘ ç  a :tryr cassertu –_reading_€ ¨ ! F  ( ¡.call_soond  ._•_ B �¹ � " kfinallœ V ˜  ‹ œ 
Ò  ¡ %ovË< Àing_future._Kov
  `self._ ý	_reading_future.cancel()3 /# /  ¢ was just 8 ÿ	led so if it hasn't beenN  Ðfinished yet,/ ðnever will be (it's possible that% ?hasL   alÆ %y T ÿand its callback is waiting in the queue,M  Pwherel €could st’ `happenÙ  <  event loopY ¿restarted).O   UnregisterT òotherwise IocpProactor.closeü  § 0 fo. N  0for' Pif ov� �not None:#   Ã4._pw %_u� >(ovô/   '! =e 
e ðasync def create_pipe_connection(A Á, protocol_fô ¶y, address)¬ 1f =g¤ H U (2 x  Ñ  k B = a6 l - =w ÛUtransr ±make_duplexm _ Pport(f Á 5 Š  
€extra={'À $':ù }rqreturn s j `hP_serv² – \ 7 ö er = PipeServerP: Ç Ùq_accept
0(f=S¨ í      6tryÑ Nif f   G ‡f.resultŸ   ½ °._free_inst§‘s.discard¡).2  3if = e+d(Ç (   p# A cliÝwPed beu4I õM Ó K Adrop6 R (3   ô  ) ¥Eexit| 8   '  - :ü s F   «/._­ 
º/, óB  ç † “…._get_un€‚*ª 1if 9 !is‹Šh ð Y 
r  exþ  OSError as exct •  Û E þ .fileno() != -11  Î t ª_f Ýion_handler({. 2   À'message': 'Ò Á ð failed',
           ú'exception': exc,
   €'pipe':  & /})=  1 ~.close(! ÿelif self._debug:C ðlogger.warning("Acµ ‹ ¢ failed on ?%r"ž Ê 
  – ,ò ª_info=Truež  "  þs.CancelledErrorª !ifƒ   q  p Nelse3 ‘server._aê _> ½_future = f%ø	f.add_done_callback(loop@ %)
7 q ) __soon*   ²   ‚return [� ]B ðasync def _make_subprocess_transport(c ÿ, protocol, args, shell  ~ €  stdin, 1out Ïerr, bufsizeI ðextra=None, **kw� )w‚waiter =‹ccreatepµÞ Å = _WindowsSú Tù < ÿ ý 6 M â =  ù F I >N6tryJ # af   %er& P÷(SystemExit, KeyboardInterrupt“ I \raiseB TBaseE¶
y ¡g” ! _œ Ùl m ú1 ô


class IocpProact4""" ° implementaQò  using IOCP."""<6s_init__$ó concurrency=0xf 
 K ._Ï0 = Ã¥  Ëresults = [] @iocp°Áoverlapped.CÝ@IoCo®  © P°9  _0 ÷INVALID_HANDLE_VALUE, NULL, 0, ¾ @˜ @cach¯%{}]  ÷registered = weakref.WeakSet–- )un/ ã 0stoØ _£ pR € {acheck_Žd€hŠ6!isl
a‘� Runtime(('B is ] 'ov S_reprñq 0nfo¶'o±#=%s' % lenŸ !._F)¥'÷1  &s)Àif self._iocÇp is None:
  õinfo.append('closed')" ð'return '<%s %s>' % (self.__class__.__name__, " ".join(T 1))
F Ádef set_loop;  ,  )† P   ! = 9 Clect7 €timeout=Ä ? rif not F vresults]  ê  Spoll(D á Ztmp == · 8 S U = [] 6tmp­ _* ® Wvalue§ 5futi  ì ö .create_future(’ @fut.1N H y 6futy Crecvv ÷conn, nbytes, flags=0† ðregister_with_iocp(9 „ °ov = _overl5d.O V(NULL* :trymÑif isinstanceW ’, socket. Ž  e  pov.WSARÇ  ˆ ›.fileno()Ê v  5 ;elsË  ¢ov.ReadFil} L E úexcept BrokenPipeErrorÎ è7 ]C(b''Ü q  àqfinish_ˆëtrans, key, oví . B d cov.getö¦  " ª !OS¢ z as exc©  '  if P.wineÊ X in (ÅõERROR_NETNAME_DELETED,[ C  G ûOPERATION_ABORTEDë J ñraise ConnectionResetÈ ª(*exc.argsî  : Ý  P ü ¡¡ØP(ov, J', ›µ ± ªY_into7?buf4¡IÈ  î ìË 
\X5M F Œ60 µ ƒ™(4ÿGÀ       raise3

  òreturn self._register(ov, conn, finish_recv)6 @def  Pfrom(8 + õnbytes, flags=0):e  & ^ °_with_iocp(d )' õov = _overlapped.O V(NULL* 6try^  Ê °ov.WSARecvF—  X ¹.fileno(), š F úexcept BrokenPipeErrorY  ósult((b'', None) ƒ  .÷ (trans, key, ov - Á   l �ov.getrel ®  " ² !OSª z as exc±  '  if P.wineÒ X in (XõERROR_NETNAME_DELETED,ˆ C  G ûOPERATION_ABORTEDë J ñraise ConnectionResetÈ ª(*exc.argsî  : Nelseá   P “ É"isendtoÇ5bufÄq, addr=ë† Ï6r¿aSendTo½� Ž s É sÿ… ›µ $  q<f6   Ñif isinstancef’, socket. }  0 •- “±© @ rriteFilo 
B  j  ;;ÿCÀ           rsaise

  òreturn self._register(ov, conn, finish_send)6 °def accept(6 0, l4 Uner):V   O µ_with_iocp(, +  g # =� Bget_\ u_socket1 ….family)8 õov = _overlapped.O X(NULL* !.A° 'ExO rileno()è #.f ä   è þ “ ÷ (trans, key, ovï  / Öov.getresult(}   ð# Use SO_UPDATE_ACCEPT_CONTEXT so getð õname() etc work.í  F 0buf(ö truct.pack('@P'Ä  /   `".s` o´XÉ.SOL_SOCKET,f 7  bÂ Z, bufó v gtimeouÇ4get )3 Š : •rgetpeer} — `async Ÿ˜Â_coro(future: ›ó# Coroutine closing theÆ zQet if H Ù is cancelled!6tryè �   bawait ; 	.  ex)  dions.CV ^ErrorK   .¦ eF h r½q  ¿jÃ-t 6# =D È Òtasks.ensure_s (= r, loop=ì  \ Ì- º ° Ü $ec8  —, address³!if|ƒ.type == .®j_DGRAM5ó# WSAConnect will complete immediately for UDPN sv…we don'tê  c¤# need to ù any IOCP operation2 #‹ (ß ”è 	; 5fut¾ Be.creatfQ š 0futÉ_dJNone! vs 5 žË Š Ÿ ? S# Thesðbe locally bound before we   vFEx()¬! PBindLS  � ä71 OS,Z as eü�if e.wineLú != errno.WSAEINVAL.  B 
  ú# Probably alreadyõ ‘; check u8	ªõ  M ¸	# 0[1]Ä0Š Ïx7½ef wàfinish_connect÷(trans, key, ov):
  éov.getresult() ð# Use SO_UPDATE_CONNECT ùTEXT so getsockname() etc work.G bconn.s) @opt(1 éet.SOL_SOCKET,/ œ  Ï_overlapped.Œ :, 0¼ preturn | 
_  ñself._register(ov,( �, finish_5 Bect)9 Ðdef sendfile(;  , Â  .  le, offsetB 7unt\ * e ¡_with_iocpÿ ¬ Xov = ã Oî W(NULL* i c_low =v   & 0xffff_ ç “ ’_high = (  >> 32)3 0v.T&AmitFè @ock.ò Ono() `msvcrtA°_osfhandle(7 < = ˜  Ñ F³ n �count, 0íî   ¹§ò
:try gþexcept OSError as excI  if Q.wine( Hin (àÿERROR_NETNAME_DELETEDô  œ  G ÷OPERATION_ABORTED�6   ñraise ConnectionResetÈ ¦(*exc.argsj 2   Nelseá   P ‚<
òW)WžX acTD_pip[  Å 
T F( ‚ FÜ edE#v.`NamedP†  X ½ ò !if$Zected#X E D �) failed õ ñ5PIPAåED which meansÅ  g °# that the Š 6 isw p. There ðno need to wait for4 K `compleð0 of  L :ion£Â € « š g¶j
Nr  e e 
õI (  rI€ ¡ `async £ àSwaddressV„delay = Ñ�@INIT�%AYG›while Truð # Unfortunately[˜0way—fdo an »{5 to_  W1# aêá.  Call Create„ñ) in a loop until it doesn'tb`N nÀIPE_BUSY.
    Utry:
 	 ýhandle = _overlapped.ConnectPipe(address): Ybreak þexcept OSError as excs  if Q.wine( !} þ ERROR_PIPE_BUSY@  º iraise
~ (# · ì) failed with T É retry laterE Âdelay = min( Â* 2, CONNECT– šMAX_DELAYòawait tasks.sleepA )¦ ðreturn windows_utils.eH…(Œ1 @def R R_for_ r(self,  ö , timeout=None)'@"""WŠ fƒ- .… R… òa Future object. The result of the f! ’is True i  ” 3ùcompleted, or Fals( ” did not ( D (on¸ %).G 5""" r   ë  ._m û ,s 22 ccancel/÷event, done_callback/ofut = o ;  a,òi# add_U `() canï ñ be used becauseN Ë • may only÷ ò# in IocpProactor.close(), whilD � � loop isYvrunningKJfut.— * =ü s j2fut r@sb, _is_fKEacheck_¾ #d(› ³ @² ½  T´    ms†õ winapi.INFINITE­ Jelse0  # Registerï¡ForSingleOÐ€() has aÓpolution×å1 millisecond,]   ñ
# round away from zero to†´ *at least*À F s| G Æ £math.ceil(¤g * 1e3C# We
àreate ov so weC =C ov.{ I`a key Ó šVcachex  ov:ÀOËV(NULL¶ …M3 L©WithQueue("}çWiocp,¦ 7, m%'if#
¸fz  ³C¦‡6(ovÙ¦ ,î=s  ùÌ Z PZ  U 
 Á  w ‚ ðif f._source_trace\
î ?del% B[-1]v p  zmfinish€`trans,þ mm 8 P# Notsat this“Ð wait means t÷	hat we should only use
  û)# this with handles types where a successful wait has noE ð
effect.  So events or pro; @es aK ûll right, but locksG ³or semaphor5  noV óAlso note if the« , iA Ðsignalled and* òn quickly reset, Pwe ma Kturn„ QFalseÅ p thoughC@have� ¹ timed out.7  reJ µ f._poll()
 ðself._cache[ov.address] = (f, ov, 0, finish_`R_for_Š)E _ W àdef _register_»`_iocp(k u, obj):: €# To get½ Óifications oft  Í Rps onð objects sent to.K `compleB € port, w#Tmust �  2 ž" if–  ƒ @ in § .À &ed­  ˜  2(Ô ˆ  & õ_overlapped.CreateIoCž @Port4 £.fileno(),u  'q0\ O ¡# XXX We c*ao¶use SetFileZ 5NotFlModes(I €to avoidC@dingö 3 sTF Œ,opÉt¼{ÿ ed immediately. ùvý§, callbackVÈcheck_closed¤2# RÀòa future which will be set" {`result¶ &thLa# oper^ :Sn it é ƒes.  The\ õ's value is actuallyÜ �e  õUed byÓ &()Vef = _OFº (RRloop=ó   £ if£Àsource_trace(
�?del% E[-1]§  if×p ov.penæ
C #ï  31d, ÌP need€postpone:a •awork. ˜�annot tak(  isÔ`rt cut#weN ‘B ö NumberOfBytes, É2Keyg's h€ ¦PostQueued9 hStatusˆ j :try  ç=½bNone,  &ov— - þexcept OSError as eR bf.set_+ [ion(eD /ls5 ·(” 
6 `# EvenH6GetPRèa() wasÃ  edñ "to?for¸ n&)0ion/GeY ›é h  ÷pð
to keep a reference to th7e
  ÷4# OVERLAPPED object, otherwise the memory is freed and Windows may
N ó # read uninitializedA %.
y ¡# Registera ðoverlapped operation for later.  Not‹ 'atB Ðwe only storeº ö to prevent it from being garbagø õ# collected too early.\ ðself._cache[ov.address] = (f, ov,n µ, callback)9 ‚return fé ƒdef _unrê (W  ? %):1 E"""U! H an 
Œ5ò*Call this method when its future has been cancelled. The 5canx  al¦ y be signa, ` (pend/!in–ƒproactor@  queue). It
EalsoO qsafe if6 m ˆis never_ pbecauseœ6was¥ )z6"""U †Æheck_closed(j L.]0ed.@gnd(ov)óget_accept_socket†gfamilyŠBs = " . (# � Ö.settimeout(0‹ õsv Cpolli 1 W=Noneo  -K  M   Om� …INFINITEƒ 'el8 :< 04  ra±óValueError("negative † "¶ Jelse? `# GetQåpdComple†�Status()\€a resolu õ of 1 millisecond,¦  À Â# round awayŠ@zero¢ô wait *at least*›  F s G £math.ceil(Ç f * 1e3Ì  * ”if ms >= 5
Ý  #  P  Cbig": - ›while Tru&sF = _«.9¨�iocp, ms³ N >is  † YbreakY0l "   óerr, transferred, key, ¸ Ùµ 	H >try"Þ ? Š S.pop(Y 
Î  exfA Key}] 2if Ploop.™gdebug( Í  ,  i_` Ùion_handler({Ñ 8   ß'message': ('�") ¼Ó/ 'O  S  b'unexp;ë*')ú)   'à‡ herr=%s§  tkey=%#x¬  ˆ ?% (ö)— À         })
+
  ð# key is either zero, or it ÿused to return a pipeE  óhandle which should be cloA Ýavoid a leak.A !if‡ ýnot in (0, _overlapped.INVALID_HANDLE_VALUE):E  Ú �_winapi.Cy H• ](key)- ™continue
 `if obj„ �self._sto‚ Ž_servingt šf.cancel(b ñ# Don't call the	 ðback if _register() already  ) ™result or˜ #8  H ¢ has been ‚ 9led3 Pelif Qf.done(1 >tryÒ  Fuvalue =¶ Ð(transferred,ªJ, ovò  7 ÿexcept OSError as e` bf.set_/ ^ion(eL  P „ s.Nnd(f, ?elsi 
B (Ö > j 	R´# Remove un¾¥ed futures& ffor ov?- 

Û ÷
cache.pop(ov.address, Non* J ‚.clear()»Adef ¨¥(2 ,Èó#  Ñpa sockebÌ º§.  It will·%inÚ ò# BaseProactorEventLoop"z )H ‡make anyD öpending operations fail quickly Ã \ 4ped_  "G(objù `ñ ì 2if @ @iocpô  Q
#yB 
:ì^ 1# Cäp remainÁ Ì ¿  Ï@(fut0“,T)'Alist¿ "._witems()Î  ‚  ifkk?ledÍ`# Noth� ¦to do with @ 	« W   6pasÀ  8`isinstö ¾ R_WaitFô¡  9 -# & Q must…  O l§ : „  Ñ¯3fut‡ ] f	•*xc '   91loo9 ?= +   Guext = {è  Â'message': 'Hl«a˜Oed',E Ì Ÿion': exc. žà': fut,
        -}
  ÿ
if fut._source_traceback:2  9 œcontext['7 O'] =Q P óself._loop.call_exception_handler(n %)
D ÷8# Wait until all cancelled overlapped complete: don't exit with runningP 7 ÷)to prevent a crash. Display progress every second if theN  Î ” is stilln .! õmsg_update = 1.0 �start_tim   Å.monotonic()& ·next_msg = 1 &+ W + bwhile cZcacheØ5if M <<= r 
-  ùðlogger.debug('%rå rMó after closing for %.1f$5s',•  I   ¤ ,‚ ' -ã > ½ ¼  	| "# Z` a fewËqnts, or 9out.  ™ v._poll(aŒ  Æresults = []¨á_winapi.CloseHÏ(0 FiocpÐ  r = NoneC ±def __del__7 )‘2  lõe()


class _WindowsSubprocessTransport(base_s _.Base(  '):{ ^z ñ, args, shell, stdin 1out ðerr, bufsize, **kw1 ± _— B = w¨ Ù_utils.Popen(u = n =t =z   �    ˆ 	J ” = œ é  K h | ù'(fµ   �returncod”wÆ .Ã +  @ess_o6ed(@ 5f¼ù R ãactor.wait_forýA(int�.# #c. )x µf.add_done_Ã 	  @SeleZ EÑfLoop =( JI! qPolicy(sDuDefault_ " D×!_fÛ My = � q 1Pro- O q &P ?


² 3 = õ 4 Ó ´
"""Various* ð specific bits and pieces."""

imz€ sys

if ð.platform != 'win32':  # pragma: no c‹Ãqraise IF bError(3 u only')a ð_winapi
import iôtertools
import msvcrt o •subproces „tempfile, ñwarnings


__all__ = 'pipe', 'Popen	 1IPE ðipeHandle'


# Constants/globalH ðBUFSIZE = 8192
PIP ‹ . §
STDOUT =   ô
_mmap_counter = iï . !(){ ðReplacement for os.· ¡() using h§ ð s instead of fd  Adef * ð*, duplex=False, overlapped=(True,  ³), bufsize=Û ç):
    """Likez ‡but withJ A sup¤;andš 0not“ A."""P ¤address = ¦0.mk (  s Ðprefix=r'\\.\Å €\python- R-{:d} †'.format:  > ùos.getpid(), next(kA)))
j #ifè ; ñpenmode = _winapiÇá_ACCESS_DUPLEX=  .  act, åGENERIC_READ |C  UWRITE>  obm1, i $ =ˆ* Oelse  qINBOUND9 ¡ 
Š 0„ L   |ðFILE_FLAG_FIRST_ï•_INSTANCEal?[0]È  Q ¯OVERLAPPEDH 1H ðflags_and_attribV¹¡ P  
SC 0x áh1 = h2 = None
6tryÆ   o ú CreateNamedPipe“ô$, J,8QWAIT,a  ¡   :1, !2 0NMP0 _ wFOREVER 3ULLá H ¿ 
¤ ?FilŸ Ò:, 0P  ÚOPEN_EXISTING² I6 N” 'ov4vConnect9hû £œuov.GetO aResultÇ)% preturn I !h2 fexceptº�if h1 is � Ý  503los	6(h1a  ? 2? 2? QraiseÞ WrˆrÚa¯Ñ�


class L‹£ 9"""5 n… A ` which¤ €vaguely Ò-object like.å°The IOCP evdøloop can use these[rsocket F !s.\Ø qã__init__(self,‹ H Y  "._´ \½ˆ ? Ðrepr__(self):#
  õif self._handle is not None:%  ,   B= f' (={9 E!r}'0 ?els> v'closed, £return f'<P ò_class__.__name__} {r A}>'
d ‘@property Bdef ! (’ )¸ \   á A  3 lfileno3  ðraise ValueError("I/O “ ’ation on ç q pipe")§  E‘ 
3 � `, *, C)H–—=_winapi. ç ´  Ä? h ¡  ¥ /! =6q__del__? €, _warn= Pings.	 ˜ !G Q(f"un!d ò!r}", ResourceWarning,  =¦ ¸  A (()± Senter³ ž Œ	. 3xit- §, t, v, tb7  x .f ñ%
# Replacement for subprocess.Popen using overlapped²As


ð , (= y ?"""g +.ã  The stdin, 1out qerr areêò or instances of Pipe†.Ç1"""  CG__in.AargsQ 0in=5 6out 3err c**kwdsß  vaassert}  ö
.get('universal_newlines'ô2 . ñbufsize', 0) == 0©  ] ô c_rfd =ù $_w 3err  ´ 3 &wh2 r  1  	0  … Z y FPIPE†� h1in_X  (ñ=(False, True), duplex= — M Á pmsvcrt.iD_osf Š ö_rh, os.O_RDONLY: !%inq Ø ?outÙ 1outk 0std Û  Æ !, á )‰ Î 7 Ï # hÚš Æ ( K � . È  ë?== ¡Ø¢  È  7 } —# È 	œ mSTDOUT?9 \ Ù  ´Ý 	2 ð err
        try7:
  ñsuper().__init__(args, stdin= A_rfd 0out ‰out_wfd,G R  `stderr0 1err0 … **kwds)8 jexcept� ¢for h in (| $wh{ "_r  O :rh)7  t  if: ®s not None"  & ö_winapi.CloseHandle(h”  # Vraise¦ +lsK "if__wh ip 	Qself.È d = Pipp  +_ww W  ^rX =outY @ 
Ñ Z 9² =errZ @ Z zfinallygk ªin == PIPE  ^@os.c|á6rfdS    B Û C  ð wD Å D  Ú D ð# -*- Mode: Python ñ,
#   Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp; ÓAuthor: Sam R <% ÿ@nightmare.com>

# = 2€
# Copyr_ ˆ 1996 by‚ !
#œ  r PAll R: ¡s Reserved0 ð.Permission to use, copy, modify, and distribute this software ð
# its documentatK  ô¡any purpos( P with0fee²ñhereby
# granted, provided that the above� õ Ðnotice appearSPall
#! 0ies� ; Bboth
  Ë 
; n_ Eis pø  
#`
X psupportó	Ù   pname of…%
#	 ® beLd¤ pdvertisM Àor publicityƒ @tain Fto
#f B!ofj>ð
specific, written prior
#O Ê.Úð<SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDC  9 xIMPLIEDA ð!OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHG š ð
BE LIABLE FOR ANY SPECIAL; �DIRECT ORûóONSEQUENTIAL DAMAGES 4  ðWHATSOEVER RESULTº ð	FROM LOSS
# OF USE, DATA= ðPROFITS, WHETHER IN AN ACTION. €CONTRACT NEGLIGENCE; O0 ƒTORTIOUS3 `, ARISv 0OUT@ OS ¿ "NEV t0THEŠ  I �PERFORMAX F„.>À============= ñ6

"""Basic infrastructure for asynchronous socket service clients and ð,ers.

There are only two ways to have a program on a single ð+cessor do "more
than one thing at a time".  Multi-threaded>  R m( ð is the simplestž Ð
most popularŽ  �  do it, but0 ðre is another very different technique,• ¢t lets youÑ  nearly allI ÷ advantages of m© ðing, without
actually u(  plí  Ô ¡s. it's re$ JÀpractical if~ r÷ ú	
is largely I/O bound. I&  à 2CPU ,« ò	n pre-emptive
scheduled WsÄÐprobably whatv “ Ôneed. Networkÿ 3 @
rarŠ ACPU-Š Ä, however.

” `operat¯ãsystem support¼ƒelect()  c\`in itsá ç
library (and 3do)Ù  � can use itï0jugh�ðple
communication channelsf€once; dož ã Pwhiler„  Nð taking
place inS� "backgr‚P"  Alî ghÄ°s strategy ›  se÷ atrange¥ co²‘x, especiù�at first,Æ  isf @manyÄ€s easierÝ punderst and
contro�"anZ+€. The moöÁ documented Áqsolves
n !ofÜ  PicultyQblems#ayou, m' @taskûPbuild!`sophis»^ üigh-performance nD&nd[` snap.£@

im#! s ” $ys  + …warningsD ãos
from errno Y ñEALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET& €VAL, \
  @ENOT °, ESHUTDOWN$ S CBADF@ õABORTED, EPIPE, EAGAINI ´errorcode

¹ .	 (h 'µ—%or¾°is deprecat—'*  reê en'!re¬ ç ÀE Aio',. D@ BionW/ ñstacklevel=2)


_DIÓ ùECTED = frozenset({ þ }  @  E5�})

try:) ƒð_map
except NameE2! ñ  = {}

def _strVR(err)) S  x ©return os.* s h R(Valuj ¡, Overflowy ,„ \  S  if^ ²z  Ðy     t  Q[err]r  €"UnknownL ñor %s" %err

class ExitNow(Eðion):
    pass

_ð*reraised_exceptions = (ExitNow, KeyboardInterrupt, System" ò
)

def read(obj):
    try	   °obj.handle_' �_event()) s / _„  A Ÿ /  [ cerror(� _write� ( ‘ Q\– Oexpt• Q Ž ” , flagsÁ"if ö & select.POLLINˆç   F ?OUTG œ 		H ?PRIH PG (Ö XHUP |ç :ERR CNVAL& H   ‡ZcloseÝ0OSEœV as e¤ öif e.errno not in _DISCONNECTED) a è    7elsV   Ž k=ópoll(timeout=0.0, map=None% if @ is  Ø ñmap = socket_mapá- % “r = []; w e +  ë °for fd, objBólist(map.items()‚  *   0is_P    û4ablª    0is_j  "  }"  f G ¢  7   ²r.append(fdÛ    A# acX#ngî �s shouldù4be k ×  7 ii Bw an(  ” I  w H @r or¹ w: e:  if [] == r w f ód.sleepþ
÷ ureturn
Ô `r, w, Àn (  , Q Fout)3 Þ Ùr·  ï=VM.getq"ifq V  …continue›      6 @ ±ÿ {€ 0Ànue
        ð(    _exception(obj)

def poll2(timeout=0.0, map=None):
7 ‘# Use the, ñ() support added to ñselect module in Python 2.0F  ifX @ is [ Z  ^ ômap = socket_map- ’  1 ;not5 '#  ñ in millisecondsA  Z # T= intâ a*1000)$  ú @ster ½ . ( ¯ § °for fd, objÝ ólist(map.items()+ w   ‚flags = û      if? «.readable(5  # 9 2|= O˜.POLLIN | 1PRIÀ  0   A# acØ#ngH�s should :pbe writr 	7 Ž  R() an2 Eobj.S  l   ¤ <OUT] ' >  d vP.regi	 (W- %)
D  •*  	 Àž‡ ’;  ”rm  ª=tv.get(fd:  > þ  ^
�    …continue’    º 0e@!, z 0)

  13 =2(  €# Alias Lòbackward compatibility“Dloopð !=3“@use_g f=False£x, count¯ºÚ iÛ 4if \  ‚hasattr(€0, 'v 'ª  D_funð F Felse~# Ö"if« ™ Pwhile©B  AF 
õ #
p A Â O > 0O  j  : =¨ ò- 1

class dispatcher:Í �debug = Ž™connected F	 , +inC <los 0add ¤g ð ignore_log_typedófrozenset({'warning'}( á€__init__Ó!f,"/P
 Þ= #Pself.£ 1
°  
”  1  ÚÂ  �fileno =ÜX  !if¤ 
¾P# Setk€nonblock)1jus ‘make sureZÚcases where wÀq# get a` ¥et from a P usource.§  Ž  ™D.set% (ó
Lè @set_- 0et( ^'  ü(+Tr`ò# The constructor no longer requires thatr„	® ð# passed be connected.
     Ttry:
  ùself.addr = sock.getpeername()/ þexcept OSError as errR  if þ.errno in (ENOTCONN, EINVAL)4  Ž ù!# To handle the case where we got an unconnectedœ  A   #Å ?et. í A � = False+ Oelse¤ #hec   is brokenæ ýsome unknown way, alert\ ¥  à ñuser and remove it fromü ïmap (to prevenF ¤polling of‰  ÂOets)ÿ ú del_channel(mapã ž   7raiIm � = None
ê Ðdef __repr__(% ì status = [ ý.__class__.__module__+"."+ @qual�1__]e  ¡ 1if (  ac”  J +dd–z ö.append('listening'ý $elR 
D & D B Nais not
I †¢ ƒ%s:%d' %ä 6ddrª  þ ŠATypeŒ
b  " 
¯  ‘�ê)M ðreturn '<%s at %#x>w ¢(' '.join(H Q), idA &))é5addJ z`, map=ö# à.log_info('add®‚0 %sp  $ •  ifI  _ L 
Ü  =E_map3mapWpfileno]Ï6elf® ø p ® #fd8 "._H a • !Pif fd:mapÇ Iclos"d:A(fd,ï µ à0del%6[fd Ö ¸ –rcreate_´Ë’, family= ä.AF_INET, type ·SOCK_STREAMÕj > P_and_2 # =P A 9 ^  U`ocket. 2et(< * ù  Ñ.setblocking(Ÿ   ¬5setÆ 7ock� Aelf,¨çÀ  n #et› ¯  d ý .@ ÿID   ‰ `reuse_m=ö# try to re-use a server port if possibl˜3€ À  0 
 Aopt(�  Ð        sockeðt.SOL_SOCKET, socke Û_REUSEADDR,
  Sself.* 0get
 @opt( < O : I  : v ]) | 1@ ) õ except OSError:  S Qpass
 ?# = 9 òpredicates for select(� ò# these are used as filter- Ãthe lists ofSsW 0to Ÿ 5 toS . ª =å Ðdef readable(œ)¶return True- Owrit- ?(Óÿ  object methodsê 1 X!enè W, numí  ü 0.acRing =÷    ðif os.name == 'nt' andC F > 53 , qnum = 5™  Ga Ú .ˆ  ‚ ZCbind› Maddrœ `ddr =  [ 	F  % )Z @conn� ƒ ,B <ess` % ¥ed = Falsef  7 .   er˜ % ß , @_ex(Š  m M 0if 1 õin (EINPROGRESS, EALREADY, EWOULDBLOCK) \9 !or9 ‘== EINVAL�•
‰“  � 7"esI •  ™a š §0, EISCONN& 3 S   uhandle_4vený D Jelse© Traise�P(err,ë ·orcode[err]Ì£(œ ¢# XXX can Õ ¤ either anïÆ pair or NonÛ:try‹  µ #  =e¬x ÄÇ EOTypeG ‡ 	m 
w ø+wh Ñif why.errno $0, E’pABORTED2<GAI¡ š |   y  }$ N X%se²Gdata�XkresultT@ : € ’ x3  > )=
æf 0a   ,el‚"_D	ðECTED:
              û  self.handle_close()
  ‰return 0 Yelse:  6 araise
 �def recv(c æ, buffer_size)8 6try  A bdata =— qsocket.E ? _  -   pif not 8 
J   A# a Ö ùd connection is indicated by signalingY @ 1rea>  di= Â, and havingß $)  .@  û ^9b''? `‹ î . ûexcept OSError as whVP# winO± sometimes «¥s ENOTCONNO  ø  ifD à.errno in _DIS% ^ECTEDgç ?
GÃH;u Ö¥ed = FalseÇ   ac « >   ·del_channel(ifŸ N �;NonÜ Z—  Š2et.× 
pÍ G 	¡  Din (Ëw, EBADF, 3  ø£Q# logÑò#log_info may be overridden to provide more sophist?oG gF @warn ñmethods. In general,p Àis for 'hit'  : H  @ 'Œ '[ *  ™ 0rma D a  - eó0logE .Ö  y1log0ˆ, messagtðsys.stderr.write(r ä: %s\n' % str(5 )R "
W €, type='£ 'q!if ›"in0pignore_ß  5 sH�print('%sŠ  ˆ (% À ‹ ¯ ™a_event” 
~ hÿ
k %#   ‹´s are never)ñed, they "spawn" new¦H#< AthatA P)ed) ‹ ´ y M#elÁ& A 
± r :ing   “ @ f ( 
a(  B	Œ Ó-  Û  cl  1 ‰;errÍ0gets@opt( ãet.SOL_SOCKET,R–.SO_ERRORº 0if L J!= 0û Îü¡(err, _str  )D  œ ð .handle_connectC()
  ÿself.connected = True Áing = False
! ðdef handle_write_event(R !):"  d 0if  ¦.accepting   4# A ñ
 sockets shouldn't get a ^  ^ .X = ñWe will pretend it di; jhappen0 breturn¾  @ bif not  
  ¿  À  G à 
( h$ Ð "()ˆ FCexpt9  S E#i# ð) is called if there might be an error on 7#fF, or7 ·is OOB data* �check forB O õ condition first. Rerr =JÇ@.get
 @opt( ãet.SOL_SOCKET,† –.SO_ERROR) ifj Z != 0Š�# we caní @whens ðect.select() says thatµ  re%%an§  ¯A# exŒVonal Ñ *š 2 XsinceR  ¥ ñor, we'll go ahead and clos, K @likeË wåô in a subclassedèbread()È »received no– 	° Û  7.f‡ êJelseR.  Y“ DÓônil, t, v, tbinfo = compact_tracebackM  —  uòmetimes a user repr methodÂVcrash¯>try­ _6 == • Ó3 1'<_> "__9 @ fai: Þòobject at %0x>' % id& £ Ã ,@log_ð (w   ö'uncaptured pythona, ;ðchannel %s (%s:%s %s)l 
M  Q  l ­ ,h   t v –= )* '!'' ˆ … K+ ±)y8 )2'un�pd incom
‚priorityÒÎ', 'warning' S   .b  - U € G V . W û0 [ =Z 5paiu" À1if   !isäÐNone:
         ðself.handle_accepted(*pair)

! Ldef    5 á, sock, addr):+  /   †.close()  e Âlog_info('unQ $d r þ event', 'warning'~ U  { o Z . W  ¥    I © O
# - 7 
#ô s simple buffered output capability, useful for. Àclients.
# [ ð	more sophisticated usage; ¡ asynchat.	 _ ]Ì <ö
class dispatcher_with_send( &):.�__init__(c'¡=None, map
 ÁC .8  3 HBout_Sf = b''y  w Biate�  ~ i 0num Ut = 0™ ‰ Ü  ?  ,  .r �[:65536]“ 	3 d &:]ª  a_write'© @ 
Ë  3 =abl6 ²return (notµ ñconnected) or lenh Ì U ñ Gdata� "ifN VdebugæAÕ D ñ ing %s' % repr(L +0 + 3 ž
«=Aused�ä @ging|70-

Dócompact_traceback(gòt, v, tb = sys.exc'9 tb4Q = []0if ãõtb: # Must have a X '  ¡õraise AssertionError("( Q doesM bexist"p †while tbì‚ @.appó(_  c ÿtb.tb_frame.f_code.co_filename,, ( Bstr(X blineno˜  n   ) 3* Bnext^0# j¡to be safe„ bdel tb"  ž `, func , f 2 = ç 3[-1hñnfo = ' '.join(['[%s| ]áx3Cx in: ˆf 2), í Ó *T_all(€, ignore c=False( if@@ is M 0map;‘ocket_mapñ  :� @list\ ð.values()):
       w try:
  •x.close() úexcept OSError as x3 úif x.errno == EBADF!  _ EpassS   þelif not ignore_all6 Uraise7 Š 1_re "d_ Jions;  7 
" | ðmap.clear()

# Asynchronous File I/O:
# ð"fter a little research (reading man pages on variD ðunixen, and
# digg+ ð>through the linux kernel), I've determined that select()
# isn't meant for doQ a¸ f¸ ñi/o.
# Heartening, thu $- ² { @/mm/2 
b showsu  É
# supports e  D ñ-ahead.  So _MOST_ ofÕ @timeq ðe data
# will be sitt±  in memory Å Pus alR ñ y when we go toª A it.‚Wôother OS's (besides NT)¦ ¥  Ñ Ñ i/o?  [VMS?]A  Regardlessœ Áis is useful† Qpipes«ð stdin/stdout...

if os.name	r'posix'xQclassr ‚_wrapper  
 � reÐ ñoverride just en‹‘to make a? Ö‘# look li Rsockeí 0`purposffí Gore.; @The ’Ped fdâ ÐautomaticallyÆ …dup()'d
5 ödef __init__(self, fd)Æ  Ê   T.fd =B <fd)B 3delA =  ifÃf@ J>= 0Z  ^ 0war¤ s.	 A("unªda %r" %A ², ResourceW1 ,Ä  F  - =½ ö '   E  	Crecv[*argsË `return °) R.fd, , 
Asend"  
ù K Qwrite* L 0get	1opt( À, level, opt–Û, buflen=None³ Aif (.  » E Ñet.SOL_SOCKET›  V 	1 o_ERROR/  ì€ {  T ç 0f  þñ  NotImplemented…e("OnlyÚù specific behaviour "J  N  &"i\ '."® º0 = êK ƒ0 = ´
Æ‹uÝ Ö<Õù b  ¥ A|)fd  Y = -1 #os§p ä)no™ À       returön self.fd

    class file_dispatcher( "):(  , Ðdef __init__(F ñ, fd, map=None):R  *   D .5  - 7 )1  R ù.connected = True" :tryd  h f+ 0fd.Ä :no(T þexcept AttributeErrorD Ipassj Œ @set_V :(fdV ú# set it to non-blocking mod² 0os.F ! (0jFalse)W % k  y  WM  ’.socket =¯}wrapper� + ¸ Bno =î: #0 ð#add_channel()
#! /usr/bin/env python3

"""Base16,  "32 Ò64 (RFC 3548) ð885 and Ascii85 data encodings"""

# Modified 04-Oct-1995 by Jack Jansenb€use binaK  b8ule= °30-Dec-2003= ÀBarry Warsaw> ”add full ¡ ˆ supportD `22-MayD 7D ðGuido van RossumH † ðytes everywhere

imK 4 re
 dstruct · á


__all__ = [jð# Legacy interface exM Âs traditiona¶ A2045p&64DE 'S¡e', 'decod
  b¬   6 ×# Generalized€ œfor otherf 2b64U  P 6b64l 7b32 $32 h y'b32hex! 4hex$ W 'b16 $16 > #ó H/  C# A'b85 ø 4b85A 8 'a a 8 ¡# Standardd W #'s _ù  i 0 Ô# Some commonR ðalternatives.  As referencedd�ó 458, see threadN PstartO"at«# ñ0http://zgp.org/pipermail/p2p-hackers/2001-September/000316.htmlF Š'urlsafeÜ  	Û A]


;¡_types = (  ,  ±array)  # T  acnqable as´!ryû!

< 4 rs_from_f _#(sípif isinh“ce(s, str  éþ’return s.!('#'¬þ0UniE¢raise Valu Q('str€órgument should contain only ASCII charactersx Å õ ?Í ¼ ”	Ú  ñmemoryview(s).toG ÞØ  uÑË  ð("argument should bÿe a bytes-like object or ASCII "
  ðX"string, not %r" % s.__class__.__name__) from None


# Base64 encoding/decoding uses binascii

def b64e( àe(s, altchars=K !):˜ A"""E! O theÇ  ts usingu ¤and returnõ ð !.
O …Optionall ” should b& õ ñ of length 2 which specifies anM ñ	alternative alphabet for« @'+' Ž @'/' Ö öacters.  This allowI `pplica› ð to e.g. generate url­ô filesystem safeñ ® !s.‘ """Íe2Dd = na.b2a_b™ jánewline=False)< &if!isó ‡† !`assert(©Æ) == 2, repr O  2 ‰Ž ±.translate(ŽQ.make f(b'+/' )’ 
? 
1P1”, validat× » ‘"""Decode–œ/edP Y/ s9Fmust7]F MQ ÜNÀused instead“ ) 'ZM ^åÓThe result is\ed as6  A"QError1 !aiv f^ s óincorrectly padded%Ifv ( P  (¦ —default),þð that are neither in—i ænormal base-64QnQ  L ñ discarded priorM  toX ¬  ‹check.  ¯ PTrue,) use non-ÅSN ¦ e inputZbiÍ.=
…Qs = _ê_ _·r_data(sâtK Œª  w© « s d !, ª iü ê &óre.fullmatch(b'[A-Za-z0-9+/]*={0,2}', sÝ ® rn†`('Non-
p64 digiWBund'7ráÜ5a2bÜ)(—standard_bv "Sž	O ÂC kûf™›¼ 6ø)Ùn  ± +('Ã± Zped with¾ < ª Àphabet.

   ð> Argument s is a bytes-like object or ASCII string to decode.  The result
   B ¥returned aN I ñ.  A binascii.Error1 ôaised if the inputL ñ incorrectly padded.  Characters that are not inA òstandard alphabeM  % ð discarded priorÈ  r  Y  × acheck.{ 1""" Ì B b64ñ ð(s)


_urlsafe_enâ_translation =@Q.make æ(b'+/', b'-_')< Q < !-_< ¤+/')

def | 2b64 A(s):­ A"""E‘ ƒ 0 usÖ  â ðURL- and filesystem-Á u Base64*!.
I 2to } 	ÍþN P 1šñ	 uses '-' instead of '+'¬ ('_ K ?'/' � A(s).v_late(¨M�MDäMO_› L<qbase-64™Ñ,º l ‘aa plusÑ or slash ' ! �N ‘ 7$ p 
3Qs = _”b_from_øP_dataÞ@    # sH, bAion)� '!
#`"32,Aing/A  –°must be donóó Python
_B32_ENCODE_DOCSTRING = '''
Ü Ð¿ £sí{Aing}‰˜ Ô„
N j /DEj ù j Q [ "ed}  `s.

Op°al casefoldàa flag specifyð whether a lower- Žà is
acceptableO@.  FOñecurity purposes,þpdefaultn ðFalse.
{extra_args}
G¯ "  «!
�  H § Ñ#re¡$n-&&
cÂ@pres}½S .¢]MAP01ôRFC 3548 allows for ox@mappboWð
digit 0 (zero) to the
letñ4ter O (oh), and for optional mapping of the digit 1 (one) to
either 0letK ³I (eye) or  ÆL (el).  TheZ ôargument
map01 when not None, specifies whichK „ �should beB �ped to (G R 'isP 9 ±0 is alwaysÞ 9 
  ¯ O« ñFor security purposesç pdefaultF « �o that
0>Q1 arey ¡allowed in8 ò-input.
'''
_b32alphabet = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ2345673 9hex6 "01 /89@ 6 ‘tab2 = {}w 2rev P
def ‰ tencode(Z ñ, s):
    global$  D  s# DelayÑ €itializa,"Ptable‹ ÌÃwaste memory@ iIAfunc7  ¦±ever called& 4if � J%in† ›  Ÿ ñb32tab = [bytes((i,))½isA ]R  1  í  É [  = Qa + b7 a7 V  b E   =§
\ "if¥ Ñsinstance(s, ” T_typeO ƒ 3s =¡view(s).to* !()K PleftoÁ= len(s) % 5 Q# Padwðlast quantum with zero bits ‹ cecessap4if T : † s÷ µ'\0' * (5 -' ñ)  # Don't use += !� 'd¯ƒytearrayµ Qfrom_Æ v = int. : 3 „‚!  m´ƒrange(0,ý 3, 5‹ <Fc = Z ò(s[i: i + 5], 'big'C + ¬ C+= (~ °[c >> 30] +"  #7a1 - 10Œ   ? (@ °20) & 0x3ffI ?  @ 2@ 1@ 2@ 3@ cx œ  € 3@ 4@ ‚# Adjustç%nyí@ parÄPa3V == 18WP[-6:]!'= '7 +el9 29  49 7 37  37 6 46  16 4 breturn™(Ë %)
,deð, casefold=False,/001=ö˜#1rev"j6rev	 n9revïð{v: k for k, v in enñ&umerate(alphabet)}
    s = _bytes_from_decode_data(s)# áif len(s) % 8:  : òraise binascii.Error('Incorrect padding'E ð%# Handle section 2.4 zero and one mapping.  The flag ñ01 will be either€ ð# False, or the character to6  ódigit 1 (one) to.  It should beI V p L (el)P �I (eye).   ifO æ01 is not None_map01A    2aassertM Â == 1, repr( u  ,  ˜€s.transl·£Q.make â(b'01', b'O' +¤ )j ¶if casefoldª O bupper(' °# Strip off«C s 	Bð right.  We need]Qcount 1pad® #; Âbecause this¹ðtell us how many nuÏ r P aremoves N  Ðefg ‘Pd str% 1l =F¡Ý r" Sp(b'=s0pad  8l -1 b# Now Z e f” aquantaa  @d = xSarray7ab32revô
 [P]9 ófor i in range(0,w F, 8)Žj Ò = s[i: i + 8?  úqacc = 0O   6try:    d cd G 
  ! B ( ‚<< 5) + · &[cg ¡except Keyº
F Ü²Non-base32 \qfound')¾µ A’+= acc.todv(5, 'biqProcess…âlast, partial Ý Q  � | žÕ Ž`in {0,C†3, 4, 6}Ç Ã Ÿi/ ‘À O MP= 5 */* �  q º  ê 
& ù eftover = (43 -L À) // 8  # 1:Ë 03: Ô •: 2, 6: 1l š P[-5:]cast[:l[ ßareturn»#s(0 p)


def	 enã#(s‘. C_b32   ×U, s)
 €.__doc__ ñB32_ENCODE_DOCSTRING.format(I Ring='0%')~ � 5(s,¦=Ì=bš 6 š D , « , « /DE« ,k µ 	Àextra_args=_c VMAP01û 1hexe|<hex; × ‚
Àing='base32hñ&ex')

def b32hexdecode(s, casefold=False):
    # base* ñ does not have the 01 mapping- ³return _b32W   ×hexalphabet, h ()
‚ õ#.__doc__ = _B32_DECODE_DOCSTRING.format(encoding='™ !',~  ¯  Àextra_args='ó
# RFC 3548, Base 16 Aº ð specifies upper-ò, but hexlify() ÿ rs
# low# a.  TheX ñalso recommends against accepting input‡ò
# insensitively.±!16þ 3e(sž@"""EŽðbytes-like object s usZ  Î c16 and¥ 1 a . ) .A1""" È ¤ binascii.â 1s).ü 3()
B#16è×	?A"""Da/‡ Å d‚ 	° Àor ASCII str¸ 1s.
’ �Optional ¤£ is a flag™y/ –whether a� {1 isK orable assñ
.  For security purposes,µ pdefaultr “  ×3res 3 edT [6  AKPErrorK ‘raised if• s ðincorrectly padded , f† µre are non-Ñ ñcharacters presentL  in1 Ú  Øs\÷b_from_¼�_data(s)+ %ifc  Q 8 sû  ôif re.search(b'[^0-9A-F]', › ' å ý `('Non-¼ò 16 digit found'� I4 &un~p

#
# A”185 FAing/Ç  ƒp#

_a85 ³ FNone B2 =  ñ	A85START = b"<~"
_A85END 2~>"Ü1_85b Qe(b, S   2,žæ , �Hnuls Sspace ©Ð# Helper funcÌd for ad šb Š k is%1ancˆ ½Htypegñb = memoryview(b).to*  © ˆ N  ô = (-len(b)) % 4h  ñ Q °b + b'\0' *ð  s0 @word^�struct.S ²('!%dI' % (` ò // 4)).unpack(b)ÈPchunk> …[b'z' if@ ñ  ` Q elsen  ¾  5b'y1 a3 / r== 0x20 = (Á!2[. Ë// 614125] +e é( 85 % 72+ R R% 85]À­    áp 0in  "s]$ifPÁ  ô 6pad} ƒ'€[-1] == +  [ G  ³ u[0] * 5Ï 
" Àhunks[-1][:-ôLpadding]

    return b''.join(chunks)

def a85encode(b, *, foldspaces=False, wrapcol=0, pad Radobe !):g A"""EJ ô bytes-like object b using Ascii85 and— a/ * .³ † ñ. is an optional flag that uses the special short sequence 'y'˜ ðinstead of 4 consecutiv8  ç ñ (ASCII 0x20) as supported by 'btoa'. ThisN pfeature— :not-  � À"standard" A# ^3ingÚ N ‰ Ñtrols whetherÊ `outputÉ òuld have newline (b'\\n') character� òadded to it. If this� Ón-zero, each Z K ñ will be at most3 Ü Gmany` 5 lo· ?pad³  in²  isŠ ¢a multipletabeforeb R NoteÈ 6 f° implementaìa alwayX s<aQ>con:Y ³&teñis framed with <~y1~>,� Pwhich,!us: ƒµ
‹ ./ 1""" °global _a85Œ&s, 2! q# DelayO ’initializÔ pof tabl¹ o @Ãwaste memory= iÅae funcñ is never called& 'ifu  Ã BNone‡ òœ A = [Žñ((i,)) for i in range(33, 118)]U 	: 2; b(a + b7 a7 Y  J b nˆsult = _Z9 .,5h, Truey)1if ñ× $re[ ²A85START +  Á 3if _4  ” = max(2 V u else 1ß)B   ÿ [ t[i: i +[ , -   Wr0, len(? )c ; † ¨  I !if8 � ´[-1]) + 2 >{ 
.  2 + ¶.append(b''Ç ~ { = b'\nú ; ƒ 2 ¢+= _A85ENDˆ? 5/de5
º�, ignore-Ö=b' \t\n\r\v'9DN 2#Ò
M2or ³0strUb5+":fien0'y'k40shozb®Paccep	  ]h¸ íI2 ._ ò	_ ü2K}	òÀce is in Adoò(be Ascii85 format (i.e.
    is framed with <~ and ~>).
  ñgnorechars should be a byte string contain áharacters to i= ’ from theQ •nput. ThiQ DonlyE À whitespace v M ,– ¡by defaultJ w _s all7 “ in ASCIIÍ  The resultø ³returned asÑ ‚s object1"""h Pb = _ð  s_Ê ñ _decode_data(b)# ‘if adobe: XÀf not b.ends[–(_A85END)$  ( õraise ValueError(B     "¼ enx d{òequences must end ®  3  "y r {!r}".ú† g É  : ¦if b.start¹ [START»  ñb[2:-2]  # Strip off < /“ umarkersm 7els$ m E  D % # € We haveEÁgo through t5°tepwise, so»hs6s+Rhandlq�# specialÀDrt s:k  ppackI =Ñðuct.Struct('!I'). % øhd = [] @_appí #= " . $ Fcurr2   /   , P_clea2   H Pfor xÐÆb + b'u' * 4K ´°'!'[0] <= x  % 6[0]$  o V � &(xó  pif len(" j) == 5:  # qacc = 0‘    �  = 7  ' ; P85 *  š+ (x - 33„  * ?tryC ^¿  ˜nI(acc)D dexceptÏeYT 'n¢overflow')À2NonP ¤   ð ²(… `elif xC0b'z“
{ 0if 7 
  Q Œ vz insid¿†5-tuple'm  9 Bb'\0 ( • Gfold%¤ y¤ *y¤ %Gx20\ ¬ íA s0g# Skipö	” 6inu°xmDNon-ýòdigit found: %c' % x)r@³= b''.join(”@padd	V= 4 -QŸ 3if  Í À# Throw away$d extra( 7  ãv 	 3[:-J ŠËÜð

# The followingùh code is originally taken (with permission) from Mercurial

_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ñ&b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")~ Æchars = None 2 4dec  
def b85enõ ñ (b, pad=False):– A"""E ò# bytes-like object b in base85 format and return a2 - !.
O  Ifb  ^ð true, the input qpadded fðb'\\0' so its length$ Ña multiple ofS 4h qbefore Ë Aing. 1""" pglobal  ", 2! s# Delay‘ óitialization of tables to not waste memory= !if: Afunc4 ñ is never called& 'ifu  Ì  ¤f ýœ A = [m`((i,))[  ik " a^]S 	8  år[(a + b5 a5 ó H ³ H  E °_# )$)
5"de5*D 
-Ž"ed£	=òor ASCII string b!‘The resulrK]ed asP ü ß 1decÑW P!isr
Î  0= [çq] * 256š  ¹ €for i, c¢ enumerate(váV -     ¢dec[c] = i,Qb = _*_‰_‘�_data(b)l  S ^ñ = (-len(b)) % 5  ? b.P'~' *˜Ading  ou¿[ ppackI =©ðuct.Struct('!I'). 2 Ñ  Î €range(0,´g(b), 5Ê òchunk = b[i:i + 5b  á  ac–0M   6tryN   b 0E 
    A   a* 85 +m3U úexcept TypeErrorF  b j•o Ä  l   Ïb Ï #  ¢raise Valuw T('bad: ŠÑacter at posiA5%d'¶ G  0% (Ij( � m	9 |  V°out.append(ÌbI(acc)< o 1sô..e4_ Û €overflowöPstartŒ!at ã 3% icÖ Å â= b''.join(out° i\ Ä×/ 	 3[:-y`à result

# Legðnacy interface.  This code could be cleaned up since I don't believe
# binascii has any line length limitations.  It just doesE ñseem worth it
# thoughŠ ¤e files sh‹ 0opeŠ !inr ð ry mode.

MAXLINESIZE = 76 # Excluding the CRLF& 3BIN% (4 à//4)*3

def enþ ñ
(input, output):
    """E ! aš !; & C and) D are› ¼ A."""< ¢while TrueL  P 2s =B P.read‘ Ÿ )3  # †if not s5   Ubreak$ [ Ãlen(s) < MAXG 
5 no -< v  d z n{   
   us += ns“ ÿ=
öscii.b2a_base64(sg ]p.write(3 ")
„/de„	D „4 w 	‡  (¤   
O
 \bD.a2bî  8 M 	ñ "s)í _EÓ_type_check(sp6tryt äm = memoryviewG÷except TypeError as err7 ñsg = "expected bytes-like object,aõ%s" % s.__class__.__name__ÔVraisej  (msg) fromq & ±if m.formatU °in ('c', 'b #B'Ø  2m˜ (™ asingle  “ elementsœ rg ¤ i  A  (� ,Ù )˜Û i Ò œndim != 1V¾ ƒ1-D data² d ¹ & t · #UÆíO¿  trainto ays€ contain �multiple Ëâ0of Í1-64ô äÊGPpiece#![] ðfor i in range(0,+G(s),½,÷chunk = s[i : i +' Q  e ….append(�{H ÷òreturn b"".join(> 
�%?z ? MO!Ž B  '�
# Usableß±a script...±Smain(.�"""Small  „ programƒðimport sys, getopt
  ƒ  try:
  òopts, args = getopt. ñ(sys.argv[1:], 'deut')9 dexcept/ Æerror as msgY  > “stdout =  1err@  | ’print(msgS  õ"""usage: %s [-d|-e|-u|-t] [file|-]E æ-d, -u: decode Pe: en – (defaultf %-t 3and; ð string 'Aladdin:open sesame'"""%Â &0]K   bexit(2 cfunc ={ Ž Àfor o, a in k îif o == '-e': :  $ d$ ì $ u$ ñt': test(); return§ "if  P[0] !œ '± Pwith (" p, 'rb')úf'  ¸  Î 4(f,÷¢out.buffer'Felse1 -  JSstdin) < S

def¿ @ s0 = b"µ "Ø e‚repr(s0)~ %s1£Pbytes - 1- 32 =#- 1F Z 2- passert • ñ= s2


if __name__ìƒ__main__W  ô()
"""Debugger basics"""

import fnmatch 4sys óos
from inspect 1 ñCO_GENERATOR, CO_COROUTINE VASYNC" p

__all¡ Ð ["BdbQuit",   Õreakpoint"]

Y F_ANDY €_FLAGS =n #   | }  ~ s
class y !(E[Bion)â5""" ñ to give up completely.-G 8 ÷Generic Python dc!e v !.
ùBThis ð takes care of details ñthe trace facility;< “a derivedA `should‹ñ	lement user interaction.7 °The standarƒý• ð (pdb.Pdb) is an exaì ­ eJ ional skipºuk pmust be4 ip !blÆ ’glob-styl!pmodule –À patterns.  ’ #Ðwill not step¾ �o frames½ àthat originateÛ2a mV  °Qes on€ Vthesek C ’Whether aX  ê  consideredè_ scertaing C  is °ermined by £n!in ¶  2als{/ ¦ MÀ__init__(sel±ƒkip=None~ '   .i`= set( B) if} Ì 2 ” 0 b6 S*{} ­fncache =   a_• ‹=W 
? b_load_^ "()¿ È scanonicÇ  ' àÆ À   """Returnó canonical form of filename.

  `For re$  ls, the= õ	is a case-normalized (onH   Á insensitivel ôsystems) absolute path.  'Fn e' withG ð(angle brackets, such as "<stdin>", generated in interacr D õmode, are returned unchanged.& 5""" i‘ == "<" +Á  -Õ[1:-1] + ">":3  ?_ )  yô = self.fncache.get(‚)- dif notp
a I 1os.;0abs H   ‘ 0  ® ›( x  0 Ÿ [› 4] =Ž ¥ ê E > def reset(G )º Ð"""Set valuesw attributesËù
ready to start debugging.’¡mport line=Š  a.check (Ö  ‹ õ.botframe = None<  à_set_stopinfo(  ,& )Ö €trace_dik!chß !, R p, event^gò D. 1 a ? � function}å "edF ¡s based onkS “FThis?  isW`talled? �b í ° cs. Its’1 isv ;newª ¥, which isE ¡usually it<ñ The default implementaç ådecides how toB F" aü ´, depending @type'P (pas inî aI Àstring) thatÄ PaboutG�be executÞ/  ª Q ‘can be one  ?–following´  [@: A    ” @coden  go±  toJ n  6  @call> ø 3¤     ô¡r another \ Ublock¶ M  t eÜ Õ   Ë	i <or Q  ? !½ú O Pexcep¸U: An  ¼ has occurry  c_Â  y C�g b5 ¦
j "c_€ :  i  i � 4  aiaµ ; Î âbPython­ FCpeciµ as (see¤'_*J`method¼rÙ $  a C\ 0no € ontWtaken�  †`arg pa�3terþsü‚previousO :	fH]quitt¶E! #ÅÀ
        if ÷event == 'line':
  ðreturn self.dispatch_( u(frame)- 6if I OcallI  ( I _, argN „ P * R ŸexceptionU - X  c_Ò U dtrace_I=_r J .G åprint('bdb.Bdbúò: unknown debuggingö‘:', repr()É� @ý þ Ddef X k", ^Œð"""Invoke user funcÀS and d _  @for ©¡ !.
o  ÚcIf theÂ ±er stops on @curr : 1, is :  › .€ ª ò). Raise BdbQuit ifé Pquittuis set.A RN¯ Ð to continue  ?  ”  D FcopeF 5"""R s  Å R_here¥B) orŒ Xbreak T Ó w^  " b Õ 8: rõ , †Q  Á ç$ 	ê '(+ êÿ› ï# V ï&is/ < ñ  (ñqð	# XXX 'arg' is no longerdiµ1botÓ + FNoneb & €# First Ý & o‰Ö since reset(Ì 3  ´.V =¨ð.f_back # (CT) Note that this may also be „ !¦  Q r' qif not 0.éGanyw)ñ pNo needo¥£ Os š #µ  ‚# Ignore5ïò s in generator ¾æ when stepping½O È › Ã
 ú!.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGSÜ I½ÀÀcall(frame, carg)
  õif self.quitting: raise BdbQuit( breturn, ñ trace_dispatch
$ Ddef  _- (Y �, frame, v :+  z ò"""Invoke user function and >  f  4for bevent.x  M öIf the debugger stops on thisB X 1, iy ‹  ¦ .† · H). R $… is set.C RÁ to continueÒ Sing iš VscopeF 5"""R s  Ë a_here(GB) orQ2 ==�Ö  _ ‰# Ignore6s} ögenerator except when stepping‘  F ‰ e £
 ú!.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGSŸ  ] r8	 ' >try< ·ˆ ¸ Z=	>  B - ä9 •	- ofinallo INoneA 0P – C# Thð issued a 'next'çÿ 'until' command— ê j ð  <Ïlineno != -1DP_set_, Pinfo(Ñ  ,  $§ü 	üS?ionÿ?[  8 ü$ (ÿ‰
Ã8# W¹` with @/;/¸Vin a ôûAskip¾ Š  #Eð internal StopIt( ˜" (f oÎVeback)G  ri‡Áed by a subiH  Á"un¦  °ñ'yield from' statemØ F  rif not þq	ß R  b`arg[0]Ç
æ  2 
r E \LŸ O  0 #s1 atˆ
™ Dor GµCExit¹ š¼ O “ ò A# ha¥àframe in a genóerator by issuing a return command, or a
  Ä# next/until# ñ
 at the last statement in 4genf Pefore O ¥exception. ò
elif (self.stopframe and 
 zis not   = ¨ 0 
# ÿ!.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGSS `arg[0]Ü p(StopItÜ dion, Gè yExit)):? Š Uuser_ð (Î i, arg), "ifÜ õ	quitting: raise BdbQuit
- ©\ âtrace_dispatch$ ñ# Normally derived classes don't overrid“¡ following` Ñ# methods, buß€y may ifÀñy want to redefinC 9  iÓ@ of ÂpYò nd breakpoints.¤ ñdef is_skipped_moduleü",  W_nameO""R @True� &   mý pes any S ¡ pattern."œ  (ifX ó is None:  # some  "fPhave ‚ sB  F {UFalse 4forq  !˜ † 
Qif fn© . (Ã ,B ò  q   u  ù t  ‰   R uD_herJkR D   Pbelowâ Èr~uÍWstackNa# (CT)åD  $±now also be]d, see œV_callíB  @Àformer test L ™ • tÊ ;@remoÇPfrom  H 6 qý\ 8 �l¸ ñ.f_globals.get('_v<__'É	pY  †F  ­ f  € û Êlineno == -1&  V g  ] 3.f_F ">=3 x  ý !ifÈx : 
q m XÀY
"[½ Çan effective	êPthis ¹  ê QCheck    †AfuncW‡ Gê ifo] ÷Delete temporaryt s²0 Öive() says to= &""2@file ercanonicÀU( Î ë …"in§À s…É     ú  %…ðÝ#  
_ [¸ ]i Ð# The line itðself has no breakpoint, but maybe the line is '
  r# first  ÷of a function withR v set by  Yname.M  e pno = fr ¡f_code.co_d  	1 !ify  no not in Í .Æ `s[filed )]:4  ½ Õreturn False
 õ# flag says ok to delete temp. bp* A(bp,- ä) = effective(r ,– ,É )8 Zif bp� ² õcurrentbp = bp.number6  ² Aif (ž 0and#  “ jorary)O  , S Õdo_clear(str(T )Œ  * ETruen JelseT & .Fdef a ‡elf, arg‹ ‚"""Remov<© .tÑMust implemenÃôderived classes or get NotI' vedError=5"""À _raise/ Q("subV š of bdb m} Ò 2)")¢  è N _anywhere(]Ø'ð T L0 if)r27anyû B for4's 0É ¥ q ž.canonic(ä)ý¿ ;# DMâshould overridÛáuser_* methodsH#ýÃgain control² / Hcall uÃZ_list
`CalledÐwe might stop³ /.ÄBpassÃ r  þr c rwhen we_ "orxQ at a’d éf ",  o_valuet a( P trap( í 0s Pexcep/
v �exc_infor æ Un an G p P_set_y Y o   Té     rJno=0„ 0SetÜ± attributesÓ 1 Cping) ]!IfˆG  Àgreater than×Pequalj 0,S n/  ® 3 ˆ G 6  — w  . =.  o "-1W J Cdon'{ /llxq Y ! =—  J #  # =  
' £quitting =p Õ   #Y  ¾ áno >= 0 means:   é %no^ 	@ $-1> æ 1 ¶  Ù Ðlineno = stopðlineno

    # Derived classes an óients can call the following methodsA ‘to affect& Pstepp% bstate.f òdef set_until(self, frame, � q=None):R  — Á"""Stop whenW  ' U with âno greater tha& Òcurrent one i   N ¢reached orQ `return¥ Tfrom 6 ’ E."""‡ #n aname "¼ á" is borrowed > 5gdb0 #ifÐ  '  Ó Ò  ˆ  Å Bno =ü 3.f_ 5+ 1C   ._-‘stopinfo(˜ 1)Y vXD  af$  o ‹ of codeè òIssue #13183: pdb skipsª "s D @hitt6Áa breakpoint00runOÅ  # ‘ § commands. qRestoreYótrace function iÅðaller (that may not have beenHO ÿ	for performance reasons)é Æ
íJ i¡1lf.l$_r!
À 1er_$ 1 = « 1 u.f_backX  ÷!ifE:  b Ô O 1.f_
q  > & } 3 •_dispatchu ™ 
D � ,  :Anext:aA o˜ * ß ©�or belowÈRgiven+	Wˆ  /‰ t‹ *  ‰� Ö‚ #if— !f_õúco_flags & GENERATOR_AND_COROUTINE_FLAGS‡È U, -1)|Oelse> +x
ÑÚ"¥art debuggaw ?I ’ u§specified,: Pstartí ' 6ame»W U  T
ñ ƒ  £qys._get #()ð *Vfreset(?Rwhile´U  & ] Aelf.&  ø ^ "bo} s|  " —  � †'ep  qsys.sety Ÿ„ ^�continue+ [Wly atPs¦ŠfinishedÍÈthere are no7 ,Žqsystem £ ]À to None.
    A"""
	 õ'   # Don't stop except at breakpoints or when finished<  self._set_> Qinfo( õbotframe, None, -1)4 rif not (  e %s:  ” H# no~ ö; run without debugger overheaŒ  < Ðsys.settrace({ w   ” 0 = ' 2_ge¤ ™().f_back† bwhile 1 3and
 'is¼ ä 
¾  g 2del0 1.f_‹ 	Z  " X =&  & @def PAquitL)` p"""Set  ñ	ting attribute to True.
D  b ãRaises BdbQuitØðion in the next call< õa dispatch_*() method.L .· íÃ  ð3  dreturn)  �
  É =¾  Æ à# Derived clasß  š@clie¥3canÑ �he follow%Í sA Øto manipulatefƒ.  Theseý "s ½ 3 an: ðerror message if so[  c ¢went wrongð   Zris wellIa# Set_V2 prW!utŒ k` line Ö Pfile: $no@ CT YQget_*6  ¯kto seeJ µcbetterÁ `for bp Bvp À.bpbynumber:¶ ‘bp: bp.bp¢ #()Q •r_add_toÂ s› , ¦ nè« 
­7Addc i´  s,k  palready» 8re.g2bp_R s¯ f;  Þ†default(} &[]è!ifE!noª6in K J " ‚.append(r )E ô  ‰x ï ð	, temporary=False, cond=ë,w i  @func/! 
, ÙXa new2 ³æ :ž ’ T Iê @doesÃ`exist 6  ã: ,Ì ÆY K T30ile�   should be,�canonicalW m2 ­i «4 ¡� .t¡’cache # I 1as “µas possibleA ú & =6 @.get a , 'noi e & 
ö× 'Li`%s:%d >-?O' % Y € ‡ Vbp = oX A;$, $Ì ³  U›X_load�
O`Apply 1ð breakpoints (seót in other instances) to this one.

  ’Populates 0 ð
's breaks list from the B Õpoint class'sJ  ) ò, which can haveE 0 ²s set by an› 5BdbŸ V. ThiK ð is necessary foÇ ðteractive sessionsÑ Akeep˜ ­ h ‘ 0 ñacross multiple call= erun()./ 5"""  t ð(filename, lineno)W0.bpó ….keys():<  YÑself._add_to_œ sO …¤def _prune)  = -, ~ b @"""P1 	^ ³ 4 :± çAÈ)of4 Ðis maintainedÞ ã˜0 an Ü   w.  If aY J %noF Õlonger exists- W ,Øån it's removed‡J 	D Ê>if z1 no$ÍdÆ¾[["].� (c)u !ifV  ½.4 
W Odel ' Rclear(+ ZDeletnI® ³Ps wer\ðt, return an error m‰/ge*%" =Ô ucanonict	!E*"in2 -
#ƒ 0'Th– iare no® …in %s' %'ˆ›e  Æo 	 ~n � at %s:%dp Ù z # v e'f lyk4 bpâ .ÎAthat¹ ,ª @ Cpairøf ø us entry-  ß[ Åæ £ J][:]ñ Abp.d36Me(¢ j.Œ²K - £MNone¸“pbynumber½7arg!3"""°	5Aby i0dex3	Ø Q Ó u@rg iB_validº<tryÅVget_bÅ  ¿ yÑexcept ValueE  as)
L vstr(err6y0bp.|P, bp.&C [ yÀlear_all_filóe_breaks(self, filename):
  á"""Delete all . •points in0 %.
0 õIf none were set, return an error message.3 5""" ‚ 0 = “ ”.canonic( )* %if @ not� 2 £ sÁ  È ƒ 0'Th– lare noÌ U%s' %S g ‹for line` [‘ ]j �blist = BW)0.bp 1 ,O ]a     e  bpc @ 
S  ! Abp.d†6Me(2del&ô c ] ù BNone£Ødef clear_allýóˆexisting0ð7i/tÆ 
ý Á º'HD	|ŠbynumberW Zif bp gWU = {}s � 
^dget_bpw Y:argaRVQ by iX0dexÈ 2ybpÈ {ðFor invalid arg values  Xf the\ �doesn't Î,Â €aise a V; EŸ—§:arg5r@ > &('µ  ± ¦ expected'¹:tryH + `= int(-¢ gexcept¡ 
9 � ¸Non-numericb æ b a from ¼ û  — ,bpËØ[P j¨ QIndexI¨ )ð %d out of range�f )¬  Â1 isÂ l ²%d already Rdh vÚ&bp6Ø ÖÓÐ/noàaTrue iŽ re® a” ³G :e?no.#° M  >¶Uand \Ý  ën ( A-  -÷ $ø 
,ê [ � 4 s £=Pmpty K£ü :À return file÷name in self.breaks and \
  klineno( P[file@ ]2  BK Åpoint.bplist. ", N �] or []
i €def get_S _‡ (“  ,   e !):)  • Ñ"""Return allN qs with 9 u Us for< .e  < YIf no) £are set, rT €n empty ¶ .u  ” " =8„canonic( )* %if… >Ï  — |  ó †0]M Oelse7 F8allE;0Sthat E."""v › Nò# Derived classe8Ðclients can cŸñthe following method\ @# toôð a data structure represent2   “ack traceÉ.Tstack(?, té É¤ of (frame€)‘	^ ÇTa sizi  ›£List startf�originalà  £ W ö if there is one;ðSize may be numberŽ 6 ps abovevbelow f7 …ê   =0 ”    o ² Qt.tb_N  z f"At = ! Anextx < pwhile f0 {not NonYp ò.append((f, f.f_¸)Þ K  â H »!ot‰ 
„  ' k€   1f =V Eback x †reverse(j ñ i = max(0, len(' V) - 1# Ô tŒ Ô ­ ,!Þ ?ô 8¨ rgÃ 2, iM Òqformat_ d_entryÛ ·~ï, lprefix=': 'ñ0str˜"inX 0ionl4ut ôc R ‘0Theè1ck   w  VaAµtuple.  TheÂß ƒ €contains  '%al, Pfunct   èI Òor '<lambda>') 0inpÀ @rgume q bvalue,�  Ö n÷code (if it exists)û kaimportWPcacheUprlibš G Æ % i$ - 0.f_‘ 1.coò ø Éõ s = '%s(%r)' % Vr *  ˆO  K 
~Bs +=Ìv Àco_name
         else:

  õ s += "<lambda>"  E'()' úif '__return__' in frame.f_localsY Krv =! [@ ]Y  ‹ o &->o  €reprlib. E(rv)8 pline =  �cache.get ¡(filename, 5no,ˆ vglobalsD !if$ 
» � ‘lprefix +! v.strip(9 1 s
� ó(# The following methods can be called by clients to use<  a debugger  ó a statement or an expression.8 DBothc �given as9 Qring,7 Ò code object.¬ ódef run(self, cmd, @=Non5Î )@"""D¦ a š ðexecuted via the  �() functª «  Ìd r defaulò __main__.dict; G	" 6 ò  G &""¤$ifº @ is ½ ¯  , timport f ‹   Y % = 0.__‡ %__(  _ ¯ =… 8  Zg.reset1áif isinstance(w7stra – Ãcmd = compil%  "<{png>", "_"…Ásys.settraceÐ. –_dispatch* :try J † 
,4 êexcept BdbQuit? Epassð kfinalla PquittR= Truð è   	½  ½) AevalÔ ,ú¥0–
§ ] §ÿ	–ÄS¹ ­³[}3ctxZ‡êð"""For backwards-šñatibility.  DeferÎ R().žQ# B/WÌ2 2Y 3 �  T#isK ‚@more69ful(UinglesmëÀef runcall(sóelf, func, /, *args, **kwds):
  ñ"""Debug a single3 µtion call.
* ñReturn the result of  d 1 Y E """< Æself.reset() Áys.settrace("  –_dispatch* ¥res = None= 6tryÅ  s $  Œ (ì 3 êexcept BdbQuit> Epass) kfinall` ¡ æquitting = TruŽ  � sÏ  ¬ À ;áres


def set_í (‹ """Start d�gc `with a¯ á instance fromt œ´er's frame.lPBdb()U^ ó


class Breakpoinù 6"""  $ ìõImplements temporary b? ð	s, ignore counts, disabl³ 1andEr(re)-en °, and condi&3alsi € ós are indexed by number through bpby  L !byf  Šð(file, line) tuple uÈñ bplist.  The former ÿ as to aA  ) lx ^"of	-A OlattA   c  Esuch¥sI ce§°re may be m1Tthan ÅRA perÂ ‘When creaja|ð, its associated þ Òname should b“i½qnonicalý Q.  IfÚ. Èis defined, ` ” hit willI ã@ed w“  pQfirst­  ø AthatV  Ùñ is executed.  Ac÷È s alwaysB  ax .0  É	  # XXX KeepY@stat© U¤ò
is a mistake -- this meanÈû# you cannot havƒy active^€next = 1Ô  0# N  bp9 beBigneêgP = {}, ( #Æ�#noŸÝ Ð0= [,à] # Each entryK  e or anZ s1BptC n  u   08 @unusØî€for markF/an;  Beffe’¥ .... see  "() ¹�__init__°,€~,-q=False,ó=Ç ‡ z ó ½ U ´  ! =L  ¨  }jeded i¿ Ö [ 6	K _¤_‹Pable_@z 0ilev   `   # TE!beíbq(caH!™ @ Y   
 9=
#  ! =%
 8,edcq iz:= 04 hð = 0
        selóf.number = Breakpoint.next
   U += 1 õ# Build the two lists ’self.bpbye €.append( )% ðif (file, line) in ! 0.bpM :(  �  [4 ]Y Oelse? @ = [Z !]
m Ñ@staticmethod –def clear6s()\  ; " Ò Q = {}W  Ò 	 ) ‘ CNone‘   ‚deleteMe={ A"""D ƒbÄQ from  Fð associated to a =:p.ô  ‹ ‚If it is6 Gast O ðin that position,, Ralso š õ ‘entry forL m  h   6"""y �index = Ü .. , ¡ ) £N³¿@] = 1à   # No longerK þ mB   [u s].removV( bif not„ µ/ x Å k smore bpí Åis f:l comboO  , ?delP   àSenablˆ f q"""MarkF�2as 0  d.I `   ß  v = Truea ?disb 1 c 
GFalsd qbpprintÈ`, out=•)@"""P" Ñ ÷output of bpformat()�`The opl alL ø argument directs whereK fis sen»Àand defaultsø€standardO Eput.¢F if   ½ Œ bö out = sys.stdouj ø .Í ,gV=out)ˆ  ®
òReturn a string with in`ion ab�  a2/ rincludeÑ2  Žµ, temporary ú"us¸ ðA S condG  À0timf ò€ignore, �' 7hit´ z .˜ 
}€disp = 'K% '´ ç) Gkeep) "if‚"] ; w+ 'yes ; d 0 8no 0  re(Q'%-4d7Wó   %s at %s:%d' %ñ! , L ,×  o 24ô  ·ñ À      ret +=ó '\n\tstop only if %s' % (self.cond,)
  1if  uignore:   bret +=P   Ç next %d hitT  V   ' 
T p   J > 1  v ‰ss = 's'‹ ;els� + 
* µ ðbreakpoint already¹  À Htime � F, ss±return ret
Š ±def __str__I)º ""R,  a ]ö
ensed description of the Ž !."S  Ã g ' ¨ %s at %s:¡ rnumber,­Cfile ¦line)

# - 0endt Bþ Vclass! 0


Ï ócheckfuncname(b, frameÙ $""× @TrueF£ ò should happen here.!’Whether aé ) ¡depends onÊway that b (‚ówas set.  If it  P via ó  Ä ž . !is` qsame asg ` Rone i{ å Y  ± %, [ fthis iM eright . 0and� Eit ià ñfirst executableµ .� """þ�if not b.I  r Q'# ¼û M  CBif bý "!=Ã0.f_&noS  ) W 3at Spwith a pstateme8!ndQ ¥  Ã  M   #- @inedú Òcalled: don't¤  . ëUFalseG   dG	¥ 1setó~  (V %ifì €code.co_ ? !=SAIt'sra» ´ �, but ra½²µ	
v È É u# We arc! N7 	ì__k  ­«V# The¤ áis entered for�@1st Â]  ” FZ  i7 Y6 Mr# But wô  Å!at˜ Ù ë õ
 Ð
# DeterminesZ šecñ an effective (a )kæ ˆ Bis
#… 1of "  ¢s, BP or 0e Anoneb (g J¡ h whichX ¥0is ? :>  » óto be acted upon5C5©pwe knowM NsM	Þ P locaŒ.Ø Ð
    the breaòkpoint that was triggered and a boolean! ò%indicates if it is
    ok to delete a temporary breaa ð.  Return (None,  )G ±there is noM ˆmatching=  1""" Öpossibles = Ba ñbplist[file, line]. •for b in 7 :  ¸ öif not b.enabled   Œcontinue/ ÿcheckfuncname(b, frame)= ð
# Count every hit when bpû € j µb.hits += 1 ­ ;conª p# If un �itional,¾PignorKPgo on¤¢next, else_^  ñ Qif b.4 Ze > 0Ñ  !  -™     0   k I #~ { hcmarkere:t'sS&ifT	²  b rW…b, True)! {  „#nd#E bp.,  I 0# I01e c©Àapplies only;0tho6 pt½s¾Vre thD …a evalu-zto trueo >tryQval =: 0(b.K ^¦.f_globals flocalsð  €   nif val\  Åã %   & ë "   /# õ    ‚   ¹! #©É ?#  x oexcept1 !ifU@ faiC@mostC €servativÉ ( isêystop on ” 	¶ãregardless of 6:ƒ.  Don'tG  !€, as ano! hˆjo user+ } .CFalsè  NTo


# -  P testæ   ó-

class Tdb(BdbÎ1def� £_call(selfc, args&  Ÿ  " =°.f_code.co_ Â   :  … = '???'" °print('+++ r !',' m & ’  â’ Œ it7cac¢t °¥ 'Pfn = œ.canonic(Q  „ l œ ® & =“ @.get 3(fnR0.f_ &no òF ?', :  u R, ':'‚.strip()B ;Ðreturn(self, óframe, retval):
   print('+++ Eurn'% $ ó
def user_exception(self, Q Ÿexc_stuffT 6 6', + Z  �  K ð.set_continue()

s Sfoo(nS £   ¡', n, ')')C Âx = bar(n*10 , 3barÏ ced', xV  , aV   G', aV ¢return a/2Œ Stest(6 ‚t = Tdb(n ðt.run('import bdb; .ª  10¥ ÷"""Macintosh binhex compression/de ò.

easy interface:
3 ±(inputfilenÅ7out �)
hexbin& ñ"""

#
# Jack Jansen, CWI, August 1995.# ñThe module is supposed to be asÄ Qatibl @poss ú. Especially the
# Ñ ñ8 should work "as expected" on any platform.
# XXXX Note: currently, texðs appear in mac-6 F %llF sG pWe seem½ lú ða simple character-translateM `python: 4(we² €probablyÄ ISO-Latin-1r 0butò  Š ~ )D Å  Ou óroutines are too� :> y « @hold k0letM Âs in-core. SM…be fixedn AIt wg`be nicg ð handle AppleDou¹ 1 atÁ ñunix
# (for servers 0ingÑ sÉ ð
I don't understand what hŒñns when you get 0x90 timesÉ ñ same byte on
# Ô . `resultn ó code (xx 90 90)È  ]  arb¢�terpretedŠaL ñescaped *value* of} `. All T ars I'v	n8pto igno‡1his*@ty..Ñƒinascii
  ¥dextlib $io
 $os
 dstruct ¤warnings


 .	 T('themj�deprecat¶D BionWF ,ö 9 òstacklevel=2)


__all__ = [";2","ñ","Error"]

class  $(E×áópass

# States (ßòve we written)
_DID_HEADER = 0 €DATA = 1? `Variou)n'ðts
REASONABLY_LARGE = 32768  # Minimal amountj  ‡ 6Arle-Âð
LINELEN = 64
RUNCHA} cb"\x90ÛTÊ /  ·‘no longervô-order dependent
RFInfo z�__init__ç n«ÕType = '????'� Creator QFlags+ß!geÄPinfo(Ôh f 1 = “ dÁwith io.open, p, 'rb')ý"fp¸    à# Quick check ËÐtextfile
    ð	    data = fp.read(512)
   ±if 0 not in( :   õfinfo.Type = 'TEXT'  ·fp.seek(0, P @dsiz- ‚fp.tell(j €dir, fil òos.path.split(name$    ò.replace(':', '-', 1% areturnK  Q Qnfo, s ò, 0

class openrsrcË ò
def __init__(self, *args)  æ Qpass
Ø  - $) ~ 6b''/ _writeY Bclos* | ð
# DeprecationWarning is al� ðy emitted on "import binhex". There- ó
no need
# to repeat the wP Àat each call# ds  edM  ascii func„ ó s.
@contextlib. €manager
(„_ignore_F Cion_j (á Dwith~ ts.catch# s$  �7 „s.filter "('c  /',"  B dyield
ò _Hqxcoderengineê@"""W¬ç ÿ  &  üö3-byte chunks"""á=3ofpÞ  x  (¡.ofp = ofpD w .    / ?hqx ölinelen = LINELEN - 1‹ l C ‰   1 = f  +í —   _ 1len´. G€todo = (  ) ™// 3) * 3C c  [:4 ]  | ˆ [$ :% !ifs f œ   aM @h ;   } _	 +ä�.b2a_hqxæ ü . –_flush(0)u   w, forcew–first = 0´ hç 5<= i— 2) - ë
 !laN > +) a é Fofp..a [= :J –] + b'\r'å =  j	` D 0 = F   f 
u 	â+
ß B · « :¬ q  b1"if=.Å Ô  ’ !in2Á  z R $¥Y  ë Å 0 2delÁ  0²A_RleŠ°ARLE-*  ´×suitably larg¼À

    def __óinit__(self, ofp):
    `.ofp = 
 ±data = b''
 “def writeJ    K   1 = W   +  @  s aif lenA . ö) < REASONABLY_LARGEž  2 ereturnA ÷with _ignore_deprecation_warning(’ ?  leh  È ÷inascii.rlecode_hqx‰ b ¼ Bofp.ì rA )  T Bclos„ &if
Ù Ê Î # 6 Ò  ò Â ë 2del¾ òofp

class BinHexË  )___üname_finfo_dlen_rlenu $ !, %  , &  , ' 0 =  > yž õ_on_error = False ÷if isinstance(ofp, str‹  ofc î  ‚io.open(' f, 'wb' ( … 6Tru„ 2try +    VHñb'(This file must be converted \« 4.0)\r\r:| @hqxeø @_HqxÂarenginì 
¥ ñR = _Rî, D .  ucrc = 0N ½ "if¥Š is NoneÛ  " Ä Š_Info(W   Þ! =å	[ ¢ õ   _7 I(³0c  Pstateê ¥DID_HEADERN jexcept¸ :if Å
  ×  ¶$ Ó Vraise£  Ð ,¿© V Anl =ö È Á ¦if nl > 63+  } e   Eä`('File7 — too longdÕÁytes([nl]) +€ 0.en ("latin-1" Ub'\0'Ptp, cI¿S.Type¶ ….Creator+ 
U 9 Tt:.tpy F /crš‘ /crF Âd2 = tp + cr… /°# Force allðpucts to]DpackZ–big-endiaJ d3©`truct.+ T('>h'VFlags¬-d4, Bii', ä  Ë6  ½ ýP + d2 3 4 5.E(, :  Rcrc()ï o¸,[á6 ÉÐbinascii.crc_óhqx(data, self.crc)
   ‘ofp.write' !)
 Qdef _ @crc(( !):  : ÷# XXXX Should this be here??%  6  p ° = binascii _’ o'\0\0'” %if© F < 0v  z ¥fmt = '>h'h Oelse% H% ‹ é ÷ struct.pack(fmt‡ vcrc = 0 , V¹ ústate != _DID_HEADER¡ ñraise Error('WritingN û at the wrong time'‘ bdlen =" S- lenº "  î ¾ . Ô`close_º Å ¿  V ,!=z	´ ’Incorrect¶ ñsize, diff=%r' % \ {.rlen,)Á —  U 76KDATAu3_rsŠz<y C 
w� »B 	¹‚resourceÂ Â Â!a½ Ekis Nonareturn	 $:try
E < I  
I M , 	QCœ
 3 _ <¨ # V "¬©-ÿ	´"´ O ï ¸kfinallH. ˆ=‡s L 4ofpý9ofp 2delØ  ¸·@()

Åó binhex(inp, out5""" �filename   `): cre�( ð-encoded copy of a + 1"""˜ °finfo = get    s 6È qBinHex(* k >Àwith io.open4 æ, 'rb') as ifpxIaDo texf ñ translation on non-mac systems™  H›while Truæ0d =c Â.read(128000±  5   õ if not d: breakQ    iád5   ~6â iÈ à —‹ä Q ž š 
–  } ’ þ—   “ (§ Difp. ð
class _Hqxdecodeð0rengine:
    """Read data via the decoder in 4-byte chunks"""

6 òdef __init__(self, ifp)S  !   `.ifp = j  veof = 0J CreadF ‡totalwtdK ¢ Ðat least wtd • ðs (or until EOF)ž  e   1decÒ U= b''  : $= d  #
 ÷, The loop here is convoluted, since we don't really now howE smuch toH:Tðre may be newlines^ m�incomingƒ.F Qwhileì 6> 0Y Ý 1if `°eof: returnk  ñ ?  ( ï  (( é+ 2) // 3) * 4'  8 " =S Aifp.� „	& % [ è# Next problemâ 0notæ úa complete number ofP Äpin whatV@pass7û
a2b. Solve by yet anotherA  ¨1— 	" C3Truì "  :tryU ÷with _ignore_deprecation_warning(›4  vBcur,Oëðbinascii.a2b_hqx(r)« B ]break uexcept H I3]Ä  IE 0newx ê1Š 0if Ç2 d ðraise Error('Premature‰0 on« žhex file'` ˆ  + 
 	± J$ =Ù$ +
 *cu ÞÕs - len(@ 
{ ×  A andç L	‚  ’ä !�T  /QcloseæA{  t P)

clC_Rle…­ARLE-¯  o ž&ºpre_buffer =¬ Opost ðÛ RK#ifÜ ®[ " ‡ Q_fillËâ � )ì$rvå  a[:wtd] T  2 Fwtd:2 Ù&rv¹”  Š ,Î ·   .K +" ýqF + 4Æ æ "  ê»  ¿ ¦À    self.posõt_buffer = self.pos _+ \
   òbinascii.rledecode_hqx(@ #reR )<  i = b''" ureturn
 #
 À Obfuscated o ÷ ahead. We have to take care that we don'tD ðend up with an orphaned RUNCHAR later on. So,A ×keep a coupleI òof bytes in the Að, depending on w†    w 'of?   3 Ç looks like:! p'\220\0 P' - K‡ 3s a: repe  Ð (escaped as  &\0v@# '? D 2D Øsomething-elsã ƒ  ; Eb  K :� I .´ k ?1 ƒComplete« ² sequence: ,G all: ±otherwise: q1¦ \ , ¯mark = lenk#ifÇ‡…[-3:] ==è”+ b'\0' + | ìf  5- 3~ /el\ 1\ J 	2J 2J  ¦ R +(-1ú 
L �pass # DÀ	” 
, !=  6- 1¤Mú_ignore_deprecation_warning()I cvr [:¢ ]o ä [1 ":]Ñ ‘def close_º G Bifp. P)

cl>bHexBinâ  = �__init__@ W, ifpE ÷if isinstance(ifp, str!  }Òifp = io.open% F'rb'Ò PFind r Ÿial colon6—while Trud k  chj –fp.read(1c   ’if not chÝ    úraise Error("No binhex data found"K 1# CYñ for \r\n terminÄðlines (which show¡ Ë`n\r, h66 € #¨ 6 RstartÎ*\rs 0if Þ  c>\r'Ã vcontinuñ \ 5 :4  Rbreak( . 2hqx¬B_HqxØarenginÛ� ;T = _R.* E - ucrc = 0ø B _¥ ôBer()† q  n7lenM�] º)  # ð
        self.crðc = binascii.crc_hqx(data, self 3)
  preturn  
 àdef _checkcrc(1 !):  1 `filecra óstruct.unpack('>h'^ õ	ifp.read(2))[0] & 0xffffD #T  … § T'\0\0K 6crc© õ# XXXX Is this needed??W V  | 4if Ã %!=à  ä ðraise Error('CRC e ð , computed %x, â E %x'  :  !% < è ,t )Î £ 7= 0x W aheader> zClen ² _& &(1M Zfname word(lenr Jrest$ S1 + 4 2 4V £ 
)§  ä 0typo  R U[1:5]¡creator =  65:9 Pflags� 9 . P9:11]3O ‚ dú 7  l'…�st[11:158  r8 B5:198 
q "FNNV €Info = F (+ %.CB  ".TA H F+3w@stat}²_DID_HEADER"  ¸ ' G, *n="ifì= 7!= > ýAReadö  at wrong time'ù Jif nA  ¦6n[0ø 1  Smin(n$ ÔE NelseE  Ç .) " rv2'tü while len(rv) <‹ 0 Brv +ý 7#n-0 € j  ž ! v F - nz %&rvk`close_7ªm$Q n	¬ 
1Tdummy¿ é * é Ò œ  , FDATAí  X3_rs]
=A ›
¦ g è A4 … 
B 	œŸ�resource¨B D?¨ ) .ç   ‘ P ) ®n_ Æ"Vgis Non6À    return
   Rtry:
  Êif self.rlen    sdummy =# •ead_rsrc(2 )L  ¦_checkcrc( kfinallz . Îstate = NoneL òifp.close()

def hexbin(inp, out)² 5""" �filename   ð) - Decode binhexed  1"""u ¢ifp = HexB] º €finfo = † SFInfo, @ not~ }  '4out( QName
) öwith io.open(out, 'wb') as ofp= ñ# XXXX Do translation on non-mac systemsU  n ¦while TrueE   d„ ²read(128000É     !if» …d: breakQ   ²ofp.write(d5  ö |P_data� ' d i Fif d” oV ÿ 5y u  c ß {  :   ä  1  „ è ã ù ±()
"""Bisec“°algorithms.9’ðinsort_right(a, x, lo=0, hi=Õ�, *, key °ðInsert item x in list a, and keep it Z óed assuming a is .d If> @s alõyI Da, i] � to the ž 6 of cmost xF  Opà ñal args lo (default 0)‘ &hi Ðlen(a)) boundQ ÎPsliceb at Ábe searched.  0 m if Ç  +lhbjK I‘7elsñ2 `key(x)‚ 7 x2key@ "a.‚(lo, x)
Àu À`Returnÿ À index whereü e ÚÇT¤R pvalue i#ñ such that all eÝà[:i] have e <=n 1  lEa[i:$  > x.  So i*'pappearsR   |%,  iQ willP Ñ  ju¡Afterö SF~tTZ¡ f´6< 0Ppraise VL°Error('lo mÂ !beX’negative'Aif ht
—Rhi = ñj q# Note,ðcomparison uses "<"ÿ1mat¶Îð# __lt__() logicr n.Û(]‚in heapq*"vlo < hié  U mi–á(lo + hi) // 2¯ À        if xË < a[mid]:
  ‰hi = mid Nelse+ "lo+ A + 1/ 
' Úwhile lo < hi> ñmid = (lo + hi) // 2B � ²if x < key(© )A  ( ª )ð$return lo


def insort_left(a, x, lo=0, hi=None, *,�  ‹ ð"""Insert item x in list a, and keep it Y óed assuming a is !.
õ Ií  is alreadyI  a,“ ] € to the � 5 of cmost xD ÐOptional argsu±(default 0)� 5hi  Ðlen(a)) boundP ‡ Pslicea ar Ábe searched. 2"""¯  if Æ  ˜[bisecI G)D 
!1  ò x) 6 u2key? 1a.irr(lo, x)»r »R X°index whereù c ÕÂRThe rR pvalue iñ such that all eØÐ[:i] have e <h + $Ea[i:# ¡>= x.  So "pappearsR  Â  w%, iQ willQ Ñ �just befoç OCytQb&0Lpraise VL²Error('lo mÂ â non-negative'Aif ht
“#îp# Note,óð comparison uses "<"ÿ1mat¶e1 à__lt__() logicr n.Ö(Z‚in heapq', 3%   H S+ˆ    
o    â
# ¥ , ½© )ª ?`³ð	# Overwrite above definiðs with a fast C implementa B
tryBbfrom _> % ñort *
except Import{. Àpass

# Creau sliases
? "= 	 r_right
N  =Ä W 1aterfaciºabbzip2Ž`ressioFðbrary.

This module providesÚ  Y#inL `, clasÃ‚for incrï `l
(de)çY Àon, and funcð0tions for one-shot (de)compression.
"""

__all__ = ["BZ2File",  C, #or $De?   &
  P"open& !   d/ !"]h Quthork ñ"Nadeem Vawda <n  .v ð@gmail.com>"

from builtins import m S as _ _ 
 $io
 $os
 _— 3ionT D_bz2P 6BZ2ì X, BZ2ê ó


_MODE_CLOSED   = 0 0REA   ó1
# Value 2 no longer used, PWRITE3°= 3


classl  r(¢ á.BaseStream):
gþ"""A file object providing transparent bzip2èC Al € can actB‘a wrapper*€an existW m ¡, or referI ódirectly to a named› rn disk.³ •Note thatx ´ Òes a *binary*9 ñ	interface - data read iso €returned¯ ¢bytes, and( ðto be written should Ugiven1 .H "í ñdef __init__(self,†  É €, mode="ñ4*, 6‘level=9):I  D P"""Opc s-*  * %If^   iû Sstr, É ¤or PathLikÙP, it ¿ Us thep  � 0 of O  |!be	Ñed. Otherwise? a- F <À, which will- £ P u!orO ºe eoÖ  'Habe 'r'> @  :Ò(default), 'w `(over)¨Eing,� "'x Acreau±exclusivelyu"'a!  £nîp. These{ F �equivalen”!be>ý@'rb'„  x  9G'ab'Ê !Ifô œ 'w/  x'ï;'a'  t  /õa number between 1Š  _ �9 specifyAthe = ¼$`ion: 1ÂAduceèe leastH * í9ÔU
8 Emost§ÔE Ù 1r',;Qinput@ mayÎ  ¢ �concatena45 ofC ymultipl	s˜sT á X     N¦._fp = Non¿ Qclose LFals xmode = kI Y @if nÂE1 <=ð Z8<= š . Rraise�tError("R3 @mustý ÂR99")q ‘ Pin ("Í G"rb" k %  =  7 (_cÓ  +# 4elix a wb w] 5wb": ] \Ð
            õself._compressor = BZ2C ( ƒlevel)
  õ
elif mode in ("x", "xb"):"  ) ! =   _c> Ù= _MODE_WRITE$ š 4aš aš 9ab"v  ² š G*se ñ
raise ValueError("Invalid[�: %r" % (• E,))
ª û"if isinstance(filename, (str, bytes, os.PathLike)˜\÷fp = _builtin_openK  t ï Í5 Qclose: ETrue’ !  9 ! =Á I# 3whasattri ¿"read") or   \writeWŠ … ü f ‰ ˆ4Typ‡W ¸ must be a [   ± `Š object"£§ èLREADw‡hdion.De rReader(J 9fp,ç  ë 6BZ2. àor, trailing_eQ1=OSYÊPbuffeñAio.B #edp 6raw2 ,el/� rpos = 0–Adef ¬ oÂ"""Flush and" P the B.;  Ç 0MayfPcalleýñre than once without Ò 0. O D 5 is€ ðd, any other operatioI ’ it will uaw.C &""2if é 
Â\CLOSEÄUeturnF :tryäK  u ž.Ô (� ! I& 
› E
z  0 + 1fp.M¡ó .f *()e 9 Œ6Nonõkfinallì ý  J Ð .fp¥  & © & ö m 6 9 = ž     V S 3FFalsÄ  "   & P”êÖ &   *  t % 0@prq!ty dr
 <� if this2 is(d.„rYˆC l  R/nol  RD 2Ðdescriptor foór the underlying file."""
  õ	self._check_not_closed()! rreturn ( 0fp.B Qno()
" Ðdef seekable($ !):  ^ B"""R= bwhethe�  @ ‘ supports< 9ing“ r Aread\ S) and† ubuffer.x Œ 0 Œ ð was opened for B ’  M %ömode == _MODE_READ,AwritÐ  S ,   B   9VWRITE¡ ApeekÉ_, n=0¢ ðed data without advancd sæ’position._  rAlways ãñs at least one byte ofW q, unles" EEOF.UðThe exact number1  9 T öed is unspecified; ÷@can_öõ´# Relies onBpocument& ~ athat B‰‘edReader.<:?# aî p(exceptõEOF), independentó #ä  UAvalu"n I
‡ nÔ|size=-1Ø�ad up to   Ñ uncompressed–as from
 ÙÐ"If3 ñis negative or omitted,N  until EOF›Xreach—$…s b'' ife  ,  al˜yÊ"! U (ê $1%+¡, while trk…to avoid¬0mak�multipleZ¦€stream. XsšaH €€'s worth‰i‹©f	tœ^"t 6< 0ø è ^õ
 = io.DEFAULT_BUFFER_SIZEÊ r "._× .�1žCinto¡bÀ  % / bø   @2Qad (0÷ "Ä  Š +(bb2lin',7Š a '  Ø‰ ðterminating newlinóe (if present) is retained. If size is
  ònon-negative, no more than+ õbytes will be read (in whichE 0cas4  e line may, ðincomplete). Returns b'' if alJ •y at EOF.I 5""" ðif not isinstance(¼ u, int):&  Ç * shasattr' »"__index__"/  3 ùraise TypeError("Integer argument expected")l  „ ! =.b ($ ðself._check_can_è  r & pbuffer.#  9¹ !)
o 1defm   s(/ ,t 7=-1Î @"""R’‘a list of�s	 u~rressed Åâfrom the file.h  Ó 0canµñspecified to control4 `numberZ “ � A: no®  F sfurther‚ 	12oncQtotalÈ  I  ‹ M I ñ	so far equals or exceeds8 +ôs,Swrite(Jdata%W ! ap stringà �¨  óM  q Bten,
Raalways5`lengthì ” 1 in‚ `s. Not`at due‹ Eing, ƒ  ž � on diskX qreflectb X Œ Ç until closesŸis called< \± M 	? fƒ p 1, (Q,Î garray)p ù `= len(4 !Jelse¿Ð# accept any -  ’t supportJ • protocol% m 3 Ë= memoryviewr  $ ‘  - !.nÀ  ©+=œ 4or. W 92fp.2& &edì # Qpos +&gt4
™ ‹  õM Î7seq]4"""ÍPsequeZ!of‰ÙsO<æÚ.Cseq  ¢àiterable yieldK N~ r Láseparators areÒ0add”aetweenÆ õ "teI  ¸  6_nðion.BaseStream.wriótelines(self, seq)

    def seek ñoffset, whence=io.SEEK_SET):0  4 ò"""Change the file position.V  & uThe new ô is specified by l °relative toQ g pT ‚ indicat6 š Ã. Values for­ V are:  ƒ ó0: start of stream (default);€ ° must not b° g‹ „  F ¤1: currentE š 	' f2: endk a : &ve¨ pReturnsú /O0Notp!at¯0ingP@emul°, so depend !onO µparameters,ª  this opera¯@ mayø õ extremely slow.. 5"""  :Á._check_can_6) rÈ  & qbuffer.# ç¹wAtellw
[Á w
• ¶not_closed(— ißölf._mode == _MODE_READÑ æÀ ¢ L 	# `pos


?Popen(£ `name, i ö="rb", compresslevel=9†P enco«Ó=None, errors 0new¬ ô"""Open a bzip2-Y "edñin binary or text† � ‰Ÿ ` argumË0canú‘an actualI  Â 0 (aè±, bytes, oräðPathLike object) � an existu c   Ê�read from“ QwriteG 'to–  +’ R"r", @ "w wK "x x $a"• A"ab"þ  Q ™ 0"rt0 w  xt1 B "at- ! ú  7 Y€ 1andˆ wÐ ' 9Í 4For�ƒ gAfuncf is equivalzçr BZ2FilÄconstructor: SN@). Iæris case[ �ZU Å Slsö‡providedÍ #4, a‘ Ý s "rew ] Ñwrapped in anå¡io.TextIOW ñ r instance withS
± A PhandlU‘behavior,Ç   ecing(s)¯ `if "t"†  ƒÝ  b   ûRraiseKEƒ‘("Invalid	�: %r" % (Q ",)	Ielse] À   G Ò! f A†'> 'ƒ`supporêÒ } "|  M #if.p ÀlueError("Aró!gument 'errors' not supported in binary mode")
  Ñif newline is5 UNone:   ' Àraise ValueE^ D("Aro = p Q 0bz_ ! =† ó .replace("t", "• § ð_file = BZ2File( cname, D ù, compresslevel= !)
o `if "t"ü  v Ô ôencoding = io.text_ (	 "`return* çTextIOWrapper(© $, 7 ", €,VH 7elsTR A e


defÓ \(dataâ "9)Â C"""Cû À a block of 3 .ø 	ó, if given, must be a number between 1 and 9@ �For increR%al— pion, us@ 4BZ2… ñor object instead.}1"""  � É1 ( ¼#  .   1) +‚ ƒ.flush(),*de& D ß J 
á I ã Áresults = []ô  wh¾ ’–  Ef 
Z (ÿ  # 6try0    reU : . j  & ‘except OS�
B 3if ž 
  8 ñbreak  # LeftoverDòa valid bzip2 stream; ignore itå G   
à    81 # ™ ÷ on the first iteration; bail ouS ³ .ifnd(res% ±2ot J.eofÙ t ¬w"edà �ended befÉ  ‘ ¨ ±  ‚"end-of-ó marker was reached¹ =  ó$ =� punused_ ­ã€b"".joinØ  8ñ)
#! /usr/bin/env python3

"""P á interface forH�'lsprof'  Ailer“ î ²atible with* " 'w@ule.X �

__all__·@"run„`runctx
 0Prot`"]

imE" _p  T s as _py _

# _ (–
# Simpleð �run(stat“ , ›  =­“, sort=-1!g– ƒ._Utils(Ô /).N I )r 8ctxu Áglobals, loc † /b 6 X À            ð  filename, sort)

run.__doc__ = _pypro% .  % ?ctx(  _

# _ (’

class P† @(_ls‘ . ³r):
    """ Ð(timer=None,  Cunit òsubcalls=True, builtin !)
I �Builds a f ñiler object using the specified_ ±r function.A ³The default  iO Bfastq ñ-in one based on real+ A ¡For custom ` €s returnˆ †integersã A can� £be a floatª y1 óa scale (i.e. how long each M  *C ò is, in seconds)˜ 2"""#‘# Most ofþ €ality is9  & ß  ¼? p# This ƒÑò&only adds convenient and backward-compatible methods.� òdef print_stats(selfÀ3=-1 �import p& Ù    %.S; ð ).strip_dirs().Y  .k & ‚ Ddump( �  &~ umarshal  with open(0 Â, 'wb') as fÊ £    Õ s.createf )D    X .‡ .ç 7, f¤ 	@  R     –.disable(\  tsnapshoaR   . T  entries =  A.get• _  |U = {}Ó  ˜persdict?   #  € informai5 @for s yu 	 :iesF ž� = label(" fy.codeï  KBnc =H .k Pcount  0# n  §@lumn÷BÊ (before '/'P cP Cnc -U 0recC X P ^afterO %ttŸ `inlineÖœ �   # tot *co  & + cD Qtotal2     Q# cum D [allerž @  Ý ¼8[idh1] =¿9ers� [£' Àc, nc, tt, c o 7 #<?all$#if� ¯ ' Æ  ˆ +)  or‹ Nyy:V   1 :try–    Ž V
  G1subd ²]	:   ÿ except KeyErrorg ðontinue
               ò	nc = subentry.callcount
 
 c, Fnc -1 ?rec4 (tt` ¯inlinetimea 	- _total, °if func in ‚ Oers:T  Ã dprev =( [8 ]- `nc += 3 /[0& c& 1& %ttL 2& c& 3& â º ñ = nc, cc, tt, ct
Ì ò# The following two methods can beòd by clients to us�À# a profiler  ñ a statement, given as Rring.} ödef run(self, cmd)Žñ import __main__­  –0dicð 0.__ ! preturn T Ð.runctx(cmd, '  )~  !  - � ÷, globals, locals’  % •.enable()� 6tryµ  ¡ Bexecr K 4 kfinall8 _ ;dis` Ï ·  ²#is¥ 
 0ore�;ful‚Qingleñ2tioò.… y !} Þÿ, /, *args, **kwü ­  M (I u  ú -  ¢ ‘__enter__¤ Ž }  H*D 3xitC ¼, *exc_infoN yO
# _ ( 

w £label(codei Ñif isinstance S, str  ¿ ‘('~', 0, =   ¥# built-inË s ' ò sorts at the end–Felse“W  O @.co_ªBnamea  0rstb&no  # /)
2 Á(é Ö!oså )sy Xrunpy  pK# ãfrom optparse @  OpßP r8 ²usage = "cP›á.py [-o output¡_path] [-sG 
 ðm module | script,Á] [arg] ..."] { Hr = w (s = †'  .aY _iÈ€spersed_ac = FalD+ Add_oË Á('-o', '--ou… “', dest=" !",‹  ¡help="Saver�<'  >"8 ªfault=Noneš o so  Ql   ð",
        help=ð'"Sort order when printing to stdout, based on pstats.S £ class",
  ¦default=-1 ø choices=sorted(@ . £_arg_dict_> !))P ðparser.add_option('-m', dest="module", ac Ç="store_true� õ	help="Profile a library > s �=False)
y ñif not sys.argv[1:]:  å – #r_usage(¯    3 cexit(2K (º ´s, args) = @  Ý  ú s?  ; n A:] =. � ñ
# The script that we're pÔ  ¥ñmay chdir, so capture the absolute pathÂ #Ó  routput ¡t startup.% 3if · A.out# !isFNone% P= os.k @.abs þ G rif len(6> 0R z ¢  _Âcode = "run_   (modname,   
 Ñ='__main__')"Ï  :   ™globs = {   '= Q  ':J 6py. Ê ,   'v !':©9[0]S } 7els0 ; @prog§ ä;   :¥.insert(0,T0dir9 (B & U   •with open! Ú, 'rb') as fpI 1 Mðcompile(fp.read(),[¤ †, 'exec'à 8 G __-F__':D  <   0'__È & ¬e ‘__package+  {% ocached$ ‹:tryprunctx(!, Õ !, e ý,  ®ðexcept BrokenPipeErroro:excl Á# Prevent "E6 ðion ignored" durÈòinterpreter shutdown‘ 7   �! =¬ 	]  }’exc.errno¬ 
…€ ã	Àcreturn P

# WpinvokedÖ  VØRram,  g‹ era«D
if éF == ê M æ()
"""Calendarvfš¢ions

Note” ¨a(sthese c7 sÒ2nesD Ped by! ƒ(1): By
å,® 	; °have Mondayâ  `first   of0 Ø week, and
Su) `last (3 ÀEuropean conåÑion). Use setP  D °day() to
seÉ!e  j B (0=‘ B, 6=r  )."""

imp¨4sys „datetime  lo Ê _ ó
from itertools C ð repeat

__all__ô
 = ["IllegalMonthError",  uWeekday ’setfirstw F",
  " € "isleapO   @days < 0 "mt [rangeJ  qcalenda� !pr  @ 	 Pprcal ) 	� `timegm! 3 V_name 1abbZ 5day    	I C‰ HText HHTML  LoŽ 
& 	M ! 7  ñ2header"]

# Exception raised for bad input (with string parameter%  details)
eÌ� = ValueÂ	Y sZ Œ
class I(F !):Ð ñdef __init__(self, g    . " = : 3str9 2 €return "ê 9 önumber %r; must be 1-12" % _ *

¸ ·º  7dayŠ ]  3 = 
 À 3  Â  `0 (Monq ‘ to 6 (Su Ö < 
²‘Constantsßós referenced later
January = 1
Febr 2B ND0of „B perŽ1 (egY 5 0in ¯‘ years)
m4 Â= [0, 31, 28 3  51,   ÉÐThis module uÉðto have hard-codÂ Rists Ÿ C andž  °Ps, asTnglisó�s.  The ­e@llow0emuð a read-only versJðof
# that, but supply l±Qized p q.  Note( ` the v?ðs are computed
# fresh on each call, in cas; ë @r chÛsc @e be8 % Dlls.³_� _Ü!:
e s¢@dateÌ.	 ð(2001, i+1, 1).strf Ãiƒ OX(12)]H ò	.insert(0, lambda x: "")m Ì lformat   =o 8mat> sgetitemÔ7, i< @funcË UÚ "[i¡  )aif isiç·ce(i, sliceA  % ![fn.‹ )Š   fù e T Belseª =   A ( 	D Ç 3lenÃ  : %13i¶3day´$# † (¨bwas a í.‘P Î »×Ú×87)]­ 	~ô n ²À    def __geótitem__(self, i):
  €funcs =  •._days[i] ÷if isinstance(i, slice?  F ‘return [f_ ñ.format) for f in c T Felse€ A ( 	D 
‰ “def __lenÁ  { ð7


# Full and abbreviated names of weekß P
day_ Ð = _localizedú a('%A')   B   ?a')j ñmonths (1-based arrays!!!)
 ~   T('%B'$ ‚ $ b„ !Co—0ts iÞ Ñ(MONDAY, TUES	 CWEDN BTHUR 1FRI RSATUR
 U8 ð ) = range(7)


{³isleap(yearzB"""RôATrue€  #  # rs, Fals Fnon- A."""Ñ¶ / ‘ % 4 == 0¹e € % 100 ! !orU  & !00( –  W  Ï}(y1, y2š `numberù * F s�Ý # [6 .� õ   Assume y1 <= y2« qy1 -= 1' &y2 Ã ñ(y2//4 - y1//4) -   À  b100) + 4400* $00È ¹ú !, ä], dayÑ ) ò  (0-6 ~ Mon-Sung J=  w112)D   531)Í ñif not datetime.MINYEARó 0ear   AX © d ‘ = 2000 +P–>  	 Ó .Ä (ý ï ’- û  ìè q (28-31™ !  « 
î…  ü &12î àraise IllegalMÑaError(- )[ dday1 =XÁ 2, 1# n” 0= m [< ]
  Ï�Februaryþi@ W ¯M ”_B 8lenw 85 t !ñQ_preva ^  "if¥ ¾ 10 %a-1, 12#
ë™  $ �$-1Ð Onexts ¤t +t s +s óclass Calendar(object?¥cBase c#  2 b. This ð  doesn't do anyñmatting. It simply’ €providesx�a to subO "es r *  nc__initês, first7#=0£  4° ) =- à # 0 = Monday,ñ 6 = Sunday

    def getfirstweekday(self):  # preturn  (._) F % 7F sF  (, 0 T M  =, X > Ë = property(² +, } )?  Ý CiterÙ sÚ 5"""æ Ræ 0an 2 Ðator for one ? 1 of õday numbers starting with theM ¢configuredÕ  G . w  d ¡i in range¡ .ö  Û )lf G + 7K £‡yield i%� Æ ’monthdateú �, year,  B � 7 V. The#Rwill ~  h Ptime.	 ì ±values and , calwaysA òe through completl‚s, so it2 ^ P  ] €s outsid? ²e specifiedØ gpy, m, dm"Oys3(^ z à (M i#?dayp2LikO;  ¬X), buþ  vP. For -th – - ´_ is 0"`day1, 2s =K“k  ä °_before = (= " -#¾ ) # D  Êð  from repeat(0,� sJ )_ * › 6+ 1' † Pafter… Õ~   -^ 21 -× � Q Ù2£JÚ ;�,aè ntuplesúÞ  0ò{ƒenumerat‚		� JæAd, iýÔ‰å o ®G8¦T$) 5f Can bœ us–D%teE à	â‘,fÛ*ð, m = _prevmonth(year, monSth)
  õ
end = _monthlen(y, m) + 1" õfor d in range(end-days_before, end):.  W `yield J 5, d H @1, nH  l @ Qear, ™ G  W  ² Anext &(y) Ø n  m o_afters 0, ml ´ �def itere  = ˆ4(self, p ù 1"""7  HLike< òtes(), but will !¹ Q, day õ_of_week) tuples.V ÁCan be used ß ð
ates outside of datetime.	 ¯>    > 1i, í@, d)Þ‘enumerateæ .ú 3« )®;", ? PfirstÇ Ñday + i) % 7
Ë  XT±tescalendar7 \ðReturn a matrix (listþ   ð s) representing&  Ù4's h †Each row2 @s a ´ ; Ë entries are[Hvaluš\ |@s = � Õ K 	?°r× [j �s[i:i+7]çiž|00, ¤c }), 7) ]T4ys2ì  T!DBý (qnumber,j õR Day $ sãBthisL  œFzero×
Œy‹:ys2ÖT ‹yŠ/ys‰ˆs »C ×;%:D Ý:wwidth=3ì!th­a;  ‘specified¸a ready `format'q. The r‚ä  i Ë b¶ 31s. > ñ contains up to « «Á4 0  be'‘n 4 and 6s e  �] 51-7   ×.'¡gobject{ Ð"""
        m·onths = [
  `self.m ùdatescalendar(year, i)- ó	for i in range(January, 	 6+120 ]: �return [f Ûs[i:i+width] P r0, len(( 1), & A) ]
K @def – Udays2¨  À , 0 A=3):0  å 5""" R‡ �the data}   ‘specifiedF a ready õformatting (similar toP Œ 4°)). Entries% ] åweek lists are< Ð(day number, $  µ) tuples. D$ ñ s outside this !	P Uzero.^ ö , ÷O Õ ÷‡ö£ Ýs¥Þ Ö,.Õ{Ä
class TextCn	 »Á2Sub- 4of # P that puU æ ñ as a simple plain text¾ •ÀUNIX program@ • u .  i pr–(^0the a¤ _QPrint‚ AngleÕÒ (no newline)e 6 p6 g .o i (q –, end='')	- 1day< ,cI¨  ,D 0ted> Ÿ  if V == 0U Ä  R!''/  Oelse!  a%2i' %C  &  ð# right-align si1`-digit+ sV 9’s.center(2©z « in¼!trî·š �' '.join…Á ”@d, w  æ)L( #d) ³ Í   = Ë ?dayÈ C  Cð name.
        """
    ñ if width >= 9:
  Ànames = day_  Oelse+ Eabbr+ preturn ? �s[day][:o ‘].center( !)
1 òdef formatweekheader(self,¤ )u 1"""3  « Rd "a 2  C 0 a C .$ 0 ” �' '.joinb .x Tday(ir M Pi in ˆ P.iterY mdays()· Pmonthì T ‘, theyear	  W    th _=TrueØ œ Ated E NÛ  ¯$ ±A[the ]ï{ M E : Á"%s %r" % (s´  ¢ )< 8s»!prm ü =0, l=0ð rPrint aå ¿'s calendarë p. l ¼} sÏ, l), end=''´H ó 	 O ?, w´ |/ µ ÿ string (multi-line)É Æw = max(2, wml 1½ ƒ ¦‰u p÷  ö 7 * (w + 1) - 1[ E  .r¡ (p( ·+= '\n' * lr "+=üs  þh?(w)E 1for�H¹  E2å(Â &¡‰ (Ž  7‰ 3 Ò Çt í0w=2²·1, c=6, m=3– T@s a G a /c!F2, cÅ1colR% =ü0* 7 ÒVv = [Åa = v.append$ da(repr”)ò^ ¦*m+c*(m-1)„  a(t&*l 1 Iy  * ~@row).‘enumerateš.]7'm)› þ#IsG …this rowh  ! … ð	range(m*i+1, min(m*(i+1) 613)È  6 Þ    … K § +`   HT, k, Dz, False]  K   kº E s& "a(a  Â0ng(c sY c– W Ða('\n'*l)
     ²headers = ( ô for k in months)
+   ãa(formatstring3 ðs, colwidth, c).r <p(); j'\n'*l ñ# max number of weeks„ ‰this row€ €height =6 ‘(len(cal)/ 0calµ :rowa  Ï j Range(A )):V  Ú y M= []  C _ ;  ? „if j >= ” &  * i ª.append(''®  !   OelseC Rself.– [  k[j], w€ W ¿ 0 ½=  Á7 * Ãñreturn ''.join(v)
>°def pryear(Ÿ P, the €, w=0, l ‡c=6, m=3Œ°"""Print a . ñ 's calendar."""Z  ‰ p$ Y ø  - (c ð, l, c, m), end=eÓ

class HTMLCU (	 ƒ d Tzz  ã ¡s completeC q pages.“  7 	 a# CSS h eÄ±e day <td>s$ 4css! à= ["mon", "tue 0wed 0thu 0fri 1sat Bun"]^h 	hh _æ@day_à6 = ‚ N I!th´ òs before and after current	Î 0_noç 1= "	 "Z U0's � 
C  ¥  /thH A  ? = < Ïyear's table‰    ˆ   ‡ Qwhole­O 
’  =  ‘   E  ­1dayÄ,",ù3day‹ ç X    Rha, R as ao R cell† & 2 !if, J== 0I# woutsideÌ A   ðR '<tdÌð="%s">&nbsp;</td>' % ×.Kÿü  B ½T %%dP Q 3es[¶]W=  3 [  9¿ - C?rowB Ùï {  ¸Rd, wdx(  inå ] Ò÷ ‚r>%s</tr< 6  W  f ð ³Ô1 X nameÌ  V/erÏ Ðreturn '<th c÷	lass="%s">%s</th>' % (
  �self.cssc, ðes_weekday_head[day],  Aabbr !)
?  def format1  - 0er(L !):   b 5""" ’Return a +  < 0 a < õ as a table row.3 ? ±s = ''.joinf .| aday(i)Q Pi in … P.iter] udays())T r‡ B'<trrsÕ ‘monthnamen ‘, theyear	  `, with _=Trueö 4  Q ï %if_ O SQ%s %sÊW _W A[the ]¤  ™ ö OelseH  E 6 D 0ñ<th colspan="7" 2	^2</tPc_p  =, sN u4$Ated V zeev = []ü Æa = v.append 2('<¬õborder="0" cellpadding Espac  \* r±fa('\n'Ëaÿ×  þ( 	©V  8 Ÿ(er:‰ 2for¿s�  pž2calendar– ' Î	Í  w ( ¨ % 1'</ƒ>
& é4vi "L0 ÓWdth=3¦ „ÃX E W2 ofÉsa'Áwidth = max( 8, 1ÿ.Ë +ü_Í 	j y5	/%dÍ Ÿ	t k†þ cÓó range(January, 	 3+12³± 2#ðs@thisWö   "= Y “i, min(i+£ '13…  Q aõro   Ÿ md úsa ! 7 d7  I? ,mÕ [[False� @  [  q Ð/tr>')
      ó  a('</table>')
  ñreturn ''.join(v)
 ðdef formatyearpage(self, the ñ, width=3, css='calendar.css', encoding=None):S  q 5""" Rz ah @ted Z ð as a complete HTML € .9 E %ifl @ is o n  r Š ô = sys.getdefault (ev = []h Æa = v.append õ('<?xml version="1.0"… Å="%s"?>\n' % b  „ñ!DOCTYPE html PUBLIC "-//W3C//DTD Xõ ð1.0 Strict//EN" "http://www.w3.org/TR/xF 17  !-s4 P.dtd"ˆ 
}  .   >ead Pmeta u ò-equiv="Content-Type" c p="text/Y ð ; charset=%s" /R  if5 °?not´  &ólink rel="stylesheet" typeq ‘css" hrefsn :cssò stitle>C  mR %d</ ¨Ô
8 //h@bodyÙ -  ..(P $)+ ?'</B !'<A
Y ›.´!e( �ing, "xmltðrefreplace")


class different_lo  Úƒ__init__Ô §Ñ  2 = 	 s__enter? 7 2old1 3 = y  v ( vLC_TIME ?set+ ', – ¦G__exÌ W*args” X · @L6DText>( e ŽRThis yó can be passed aA€ name inC =òstructor and will ñkRmonth aeekday> s? “specified\ `. If t‚ =‘ includesM %an‹P all "0ngs… �taining p ˜ #be› e¢as unicode• i \ bfirstwÄ 3=0,° X.žB 0#ifK  G÷	ƒù ÷Xî ØÂ 14dayÝU jMwitht1 .s 1 ,   r ssuper()@h b y‹ « L\ ’1the › à, withyear=TruSe):
  òwith different_locale(self. ,  3 ñreturn super().formatmonthname(theyear, the p, width  th ±)


class Ll ØHTMLCalendar( y 1"""­ RThis 9 òcan be passed a ©  � 0 in{ ò constructor and will ¼ N œ  aeekday> s? “specified\ `. If t‚ l �includesM ðan encoding all strings… @tain p ˜ #be› "edP ¡s unicode. Ádef __init__£‚, firstwÃ 3=0,¯ H=NonåW.B )o  ç#ifK @ is N 2  #= 1².getdefault (K L# =V 
i  Ð AÂ Õ 3dayý l ¢2a  [ } œ = Ä½H=TruYœ 2€ z õ%)

# Support for old module level interface
c = TextW8)

)@ = c²  

Ž8set ( “ùif not MONDAY <=ƒ   SU 0âraise IllegalW«ZError^ (c.r  ] !

* ¡ -Æ  Ddays 0
prì  
 l aheader*   1
prZ   ~  / " 
y  ¡year
prcal !pr Á0pac1of > � columnsÒbmulti-  3  \ Q
_colH  = 7*3 - 1 °# Amount prRd by ú S()
_sr 1= 6.  À# Number of ' Pes beMn— 
ï `(cols, Š =” ,> Ding=n +@"""P” )s Û O t É	ê sìÍ (+ P€ v )R ½- ­ RÜ3s aÂ –Ómatted from n  eneYUthin 3.Á  R ã a*= ' 'Þr` .‘.join(c.cK  Þ X)v   cŠ q Ý áEPOCH = 1970
_ ð_ORD = datetime.	 ( ð, 1, 1).toordinal(C Ðdef timegm(tuð#ple):
    """Unrelated but handy function to calcu! ñ Unix timestamp from GMT."""M ðyear, month, day, hou ñ
inute, second = tuple[:6]7 °days = date] .	 (L ð1).toordinal() - _EPOCH_ORD +j A - 1L  q M qys*24 +ƒ  m†   % b*60 +    ž     s"  " creturnÇ ós


def main(argsRñ import argparse9 
 5r =  .ArgumentP$ 1r()' Âtextgroup = 3 c.add_a, _  ('' P onlyO F "s'A Ahtml% A  ' A  [ A 	y (ž /õ -w", "--width", ötype=int, default=2 ahelp="3 1 ofé“ column (/ 2 2)DÉ ˆ lˆ _linesˆ 
1ˆ `number‰ = æ for each week‘ 1‘ s‘ spacing“ 
6“ 5 ‚ betweenCsŒ 6Œ mŒ Š3‹ 4 † per rowƒ 3ƒ  B(cƒ (cs€ íº="calendar.  )0CSSx1useœHpage ¡Ly  lod ‡| LNoneõ -  u rbe usedÜA andŸday names� e� Zencod� 	/  ‘ ooutput{ t{  ™ "b “choices=(   "ã,")*‡  V   (D @ or + 	£ Û{ n=Q='?',W FX 2  ¸(1-9999p Çq 3 r B12, î 5nly{ ¦  op) 7ö   µsa[1:])
+ 3if . .r \5not ú� rN ãr.error("if --< ô is specified --; Ò is required"N H Ðsys.exit(1)

ò    locale = options. ,  encoding

/ %if ñ type == "html": # L    qcal = Lw ÒHTMLCalendar(- = )O OelseB 	< / ¯ Ò Â     4if  { is Nonb  ô= sys.getdefault (q  optdict =  (" =	 d, css=^6css; @writ{ d ástdout.buffer. uOyear´ 3 °(cal.format* àpage(datetime.	 �.today(). C, **¿ )– 'elp _monthq ì c 	Ôöparser.error("incorrect number of arguments"«  Í =bexit(1 
0Ë YK�_TextC�$	< ˆ  œ ]w…width, l Gline· ‚_ W["c"]ð@spac± ‚  + m+ ] siPresulð
lhl go fa eK  (L   $[ l ¹ ! À
y‹ 	 .& e‰  6ingK Éd 
w 0( (Z ñ )


if __name__±ƒ__main__µ  (Gáargv)
#! /usr/0ÿ/bin/python

# NOTE: the above "* "1ðOT a mistake.  It is
# intenk@allyQ E  i Benv m °".  On manyƒ0tem< û (e.g. Solaris),¨  v ÿnot in $PATH as passed to CGI
# scripts, and?   Ú ë0 di‚±ory where PÅ ²stalled, soH À ð would be unable{ CfindØ ñ.  Granted,
# binary inN aô	s by Linux vendors often% ‡ 5n
#y õ .  So let those: Àpatch cgi.py‰ ð match their choôLice
# of installation.

"""Support module for CGI (Common Gateway Interface) scripts.

This9 ðdefines a numbern ‘utilitiesW ause by^ C ð
written in Pyth” ò"""

# History
# - õ
#
# Michael McLay started th‡ ñ.  Steve Majewski chang%  iÇ û to SvFormContentDict and  ð.  The multipart
# parsing wasQPpiredÚ �code submÕ  ð'Andreas Paepcke.  Guido van
# Rossum rewrote, reformatÔ  Š pdocumen tƒ ¢  °is currentl#“responsibÁ`its maì ðnance.
#

__version__ = "2.6"


# ImÿRs
# = ±

from io i ð StringIO, Bytes	 ÒTextIOWrapper0 `collecXTs.abc= ƒMapping
L 4sys o
 purllib.WeM Remail rJ „FeedParsq $ tmessage% M d Dhtml dlocale ftempfi €warnings)1all%ü["MiniFieldStorage", " ·   	 _)F",
  " `header. @test °print_excep= lnvironG /  (* Pdirec. 1arg;s? e[  _u; "]@LoggÔsp==

log2 >"Ù À  # FilenameUñlog to, if not empty; Žp = None;  object>   0 @

de¹pitlog(*¾Qrgs):^°"""Write a y ~ pthere i’   » !.
5 ²Even though<1funº . ’called inp ñ), you should alwaysE  Î ‘ !);z h Pvaria…@thatM `set eiŠ  Ý T ? ( pially),  do¥ `(once í   ³ ñ	 has been opened), or toE n5 @when… Á`is dis† #d)ð  Àdfirst  œ a•`mat stà;w rV 	+ Qs (ifn ‡any) are !to6 %� árator, so e.g.2  ë $p"%s: %sŸa 1b")  Pwill €e "a: b"
þ ‚, follow`“a newlineØ !If~ `global fpÙ  w 9D, it¹b"Pl‚ @hich; P data>  �  te ¾ c _  ª } �ile may l Ud 0givZ a € ' Î,ø C ndF R ( ¹ D Qworld+ ÚS!!!  › - Pcan'ty  W ðed, logging is
    ñ"silently disabled (since there is no safe place w ñwe could
    send an error message).
 1""" °global log, Bfile	 p �warnings.	 °("cgi.log()� ðdeprecated as of 3.10. UseJ áging instead",M  •  D? BionWf ñ , stacklevel=2)4  ifM  — � and not !p:  N 6try   Ðlogfp = open( Ô ò"a", encoding="locale"e  6  except OSE/
R Apassp /if‚ ±log = nolog& FelseA  d  @ñ *allargs)

def  q(fmt, * >  """Write aô Â0 to  °.  See init[ ´) for docs.ä 0p.wK  e %c s + "\n"� ¼ (–  ð	Dummy function, assigned„  Ø @when‰ ís­{ :ä Qclose¡ ^ C 
Ì ³ — Ò �ile = ''s' # !p.v (æ q = None9  Æ ==)

   Á# The curren‚ò �


# Parsô \s
# =  ) ñ	Maximum input we will ac€RàREQUEST_METHODlðPOST
# 0 ==> unlimixC ²
maxlen = 0O�parse(fp=æ  õ±viron=os.en ø, keep_blank_values=0¤pstrict_I  .õ0, separator='&')Ã õ   �query inÎf m+ or from a ¬ò (default stdin)Œ d@Argu1 �s, all opq6al:"  fp(  :R “pointer; Z a: sys._ v.bufferC ™ D #:   z 1 diæ7aryM 5G =P: flaîPdicat0whe© c c1 ins �percent-• ed¸Pms shÁt be tre]G  – Œ	F bA truec 1 in‚ res that~ S PretaiÀaÐ‹ 
`  íP_ fals` 	ˆ C ê 0are#€be ignor"(ndÑ  if*Ry werˆŠ  áƒincluded«   û ‘p atr ƒdo with ºü)s.ª #IfÔ D(the7#),,  ¼ ~¿ A  t2 @raisVJ? N8ionÄ Cp: str. R`symbolº ð use for separat÷ing the query arguments.
  ÒDefaults to & 1"""# áif fp is None:  9 ñ fp = sys.stdin
 ð4# field keys and values (except for files) are returned as strings
[  # an encod¼ °is requiredž adecodeÒ @byte ñ ad from self.fp‹ ô if hasattr(fp,'N &')Â  d = fp. > 7elsë  Å = 'latin-1'ñ Óp.read() mustÓ  š J Ðif isinstance‹ ç TextIOWrapper� Q’fp.buffer` ð
if not 'REQUEST_METHOD' i XvironÏ  [- ]· @GET'[Ð   # For test^ ™ td-alone° /enI †= 'POST'v õctype, pdict = parse_header(I ñ CONTENT_TYPE'])i  Ž 1if @ ÷	 == 'multipart/form-datah  / 0d / U€ Å, separator=
 n )elp ñapplication/x-www-x 1urlð+ed~ Þclength = intÜ hLENGTHÞ  ³ ‘if maxlenC > G ,   praise V7óError('Maximum content †  RVeded'à  @ "qsÎ”o ").4(Ø 6ing3 
èA ',   ”# Unknown� -ýÎß'QUERY_STRING§ O qif qs: ­ …qs + '&'G  !  D	Z ]. Õ ‡Šargv[1:]Tj E ^ 
~   =¼ LñXXX Shouldn't, reallyž š ì ç 	
¥!ifvï L É 	Ñcã  ‚ ë ™qurllib. ò_qs(qs, keep_blank_,ñ0ct_- Aing,3 ˆ  ¾=	 ï_

def%	@ °="utf-8", ek¸s="replace"Z $'&4@"""Pß {r input.¬AZ‚bfp   :" õâ ¨ : .aionaryK0ainŒPotherº ¡ameters of 1entj XI Å ½ :%1est9Àding and erróor handler, passed to
  ÑFieldStorage
 ð*Returns a dictionary just like parse_qs(): keys are the fJ Á names, eachN pvalue iO �list of  ¢s for that9 Ó. For non-filM !s,Y 0 M 	G �strings. 1""" á# RFC 2046, Se¿ ð 5.1 : The "multipart" boundÛ ’delimiterË calwaysM òrepresented as 7bit US-ASCIIy G 0= p0$[' ñ'].decode('ascii')U wctype =Œ µ/form-data;– P={}". 4at(Q @ @head¬ ©= Message( P.set_c (i  Atry:}  õA õ['Content-Length'] Ã ñCONTENT-LENGTH']< ö except KeyErrorQ  U" Xfs = QS(fp, p = ´, encoding=	 0, eR "s= ,M  « õenviron={'REQUEST_METHOD': 'POST'}, separator=
 õ rÈ° {k: fs.get€1(k)yñ k in fs}

def _Õ H Bm(s)Ú  whˆÂs[:1] == ';'  ˜  è Bs[1:  ó end = s.find(';ì  H    ð> 0 and (s.count('"', 0Ud) -  '\\ V) % 2{  S  M m B B + 1ù  # 0if & ?< 0; Vlen(s- f» V[:endÑ yÎ f.fpc Y û Rend:]<;_ÝS(line@@"""P+4 a i —E/ .qëcmain c˜/  1	ŠPof op—s? û × ž Ía';' + – U0keyæÓarts.__next__Ý ¾Q = {}*  žp%W Ei@ ç=ç|if i >=p  2 D[:i]Lc.lowerw  T  å* Ei+1:, Œ      0if º+ )m 2P ![0§ -´"´ A   " " =†V[1:-1õ     	$ ø.replace('\\\\', '\\')  ®''" D P[  YR Í —Bkey,2p


# ClšIs”?# = 0

c7 X Miniw:X@"""L²  , ÙÁuse when no obupload�possible.Y³ ò# Dummy attribute :  à q = None+  d Ä   4   _Ð}pdisposiæ-  4 S ð {}

    def __iónit__(self, name, value):
  ñ
"""Constructor from field0 B and3 E."""5  Q .P ! =' 
 c " =8  !# 6 ñfile = StringIO(- !)
' £def __reprµ 
¨ ðReturn printable * ©esentation¢ r, `"MiniFÏ ñStorage(%r, %r)" % Ç ,œ Œ x
class 8 :¢ 0"""I ò e a sequence of1òs, reading multipart/form-data.A RThis _ €providesB�ing, typ  #ðs stored on disk,Š%ðmore.  At the top level, it is accessi0lik© 0dic¡ary, whoseG �keys areF ñòs.  (Note: None can occur as aé  ± 1e.)G ‚The itemL ð	either a Python list (ife Cre's"leQs) orG 1ano: sL or ¿ð object.  If it'” RsinglÕ  0hasv p follow•£attributesÍ Á:%  "× ñ, if specified; — AwiseÄ  <  le : 0; túi• ó  €Äclient side V s, *not*˜ !le—  RwhichæA %B(tha‘temporaryP ó you don't deal withlìþ  à!*s˜@*; f ¬�uploads,Á y ÑtransparentlyøÚ v ¡every time� r*s°l F  ^ª–s *bytes*c�   (-Ë)ý¤ à  £ y2 kE *asc V ! ;À Ý 6& id’a simple þ ƒ Btypeƒ €content- ,–fif not,6 0_opq6s: { & 3  Ö � a ¹ BlineT pdisposiT $: ,  ” + › ‘correspon¿© ~ §headers: aÏ ’P(someðòs email.message.M  5aÚ 2sub óAeof)Õ 0ain¦c*all* u ‚  d1 4is =  P, mos€ ­ Iapurpos“`overriÏ x   Qmake_P€) methodUñs called internally to come up8G  qle open" x ¶  É¡writing.  å n s¯#po�!toD š zÂdefault choiL ÓS !llNus in a ÙD @dire°yp unlink5 ðthem as soon as ñthey have been opened.

    """ ódef __init__(self, fp=None, headers ñouterboundary=b'',A  M  ³environ=os. ÿ, keep_blank_values=0, strict_parsing=0L  Slimit| Pencod) ÿ	'utf-8', errors='replace� Ômax_num_fieldÆ õ separator='&'):Ã ð"""Constructor.  Read multipart/* until last  H û ò	Arguments, all optional:j "  fp  õ: file pointer; default: sys.stdin.buffer   < ù(not used when the request method is GET)6 vCan be ë  K ù
1. a TextIOWrapper object; S2. an P whosq óad() and readline() æs return bytesþ H x  :ZA dic+sry-likej 	� ³taken from \@ as º †CGI specr 	¬ö   : terminatingÖ Ï	i Q(for ™0nalpf only)^  Í ^   Õ É  G Â: flag indicª �whether ? ?9 in¯ �percent-$ð ed forms shouldùptreated-G  |Ings.F bA truec ‚ res that~ S aretainT 	E 
` T  TheÛ_ fals` C  ê `are toÅ Pignorq 7nd Ñ  ifiy wereG  *eincludò ® û wp atr pdo withé  n
2#IfÔ (‰Â)š ¼ “silently ¿ A  t2 �raise a V&EàQ exceNn  :™d§ ly·  ’ ´ Vts ofç/R-data
mrto exitZ Ë  F  'Bloopj°reached. Itc %  diŸ:encx@betwl #  v P contžalength8  @numbtf,0 alv yÄ  .ß5ing/:û  Z ‚ handler!�to decode. 	_ `binaryŠ0eam>  P Mustu © @same;  pcharsetÓ þ	N  4 $ €page sen® s r$ (`type :0êa http-equiv oé1r
Ë:÷�. If set,f nÄÀ throws a Va§lueError
  õ&if there are more than n fields read by parse_qsl().
B 5""" åmethod = 'GET' ý
self.keep_blank_values =  
3 pstrict_x jing =  
- ƒmax_num_µ *=  
- �separatorU  # õif 'REQUEST_METHOD' in environ:(  Dó  [: •].upper()7 õqs_on_post = None 4if U I8 or ZHEAD'†  ² ÏQUERY_STRING°  ´ q|° 	8 ]‡  ) úelif sys.argv[1:]v  # L # @ /se3 6G ñqs.encode(locale.getpreferred ö	ing(), 'surrogateescape'] M ú fp = BytesIO(qs Ñif headers isz¢ ! û= {'content-typev l  ñ"application/x-www-form-url½ Eed"}_‡ ƒ 5  m 
OPOST–  è# Set default Ã P for 6 ð to what's tradi¶ %al   k   ˆ [O] = ï 	N  ¤ÏCONTENT_TYPE¤x ¹	M 
y l 	ØÀ ä ‘d 	E d ƒ oLENGTHÒ plength'Lp Q r ,elKóif not (isinstance(5þ, (Mapping, Message)))ç’raise Typ#("@ ¢ must be mF  €4an g F of ô A ‚"email.m€ .ˆ "�vr =•3_if fp£: å y¶stdin.buffeØ## % .¾"()Ó €return bi åEÐfp, TextIOWra»:Y \ = fpw ¦€hasattr(^ '” }') and  _line'®"fpÖ ÷ be file pointerc ˜Ðself.fp = fp
#
  ôself.encoding =  ! Prrors 	 
 õif not isinstance(outerboundary, bytes):1  w °raise TypeEO )('4 ‚ must be; ,` 9%s'B  F  [% typ| µ).__name__)< î 
n )=  Û , ¿ š_read = 0H �limit =  8 õ# Process content-disposition headerI c `, pdicK e"", {} Oif 'E  Q' in Ÿ N s_T bparse_* (6 [\ ]. ¡ ½ != \   N ! 0_opå  )Ò 
)  �u = None  â   Ó 4 
Ì b  ! " =% [' %']B " @file _  c 
% g  k €_binary_  " =‡   !is¯ã ¢  ­
#0 ð Honor any existš; ñ.  But if there } F 3  ö, use some sensible defaults.  Assum�# a P"" atp  ± level, butV  th¬ ˆnon-falsJ õ	inside a multi-part.  Th€ ! fó p inner    p ·text/plain,Ú  o / ½/ €t should=1urlË!edg $is XcatchL ðogus clients which erroneously— Áget to incluÄ ZK d. 
   See belowQ ¶ what we do¿Bdoesð% a;ï it happens� b×t�Z �n't under™d–  sÁ FÀ N ƒ ¢N 1 'GBelif(­ú or method != 'POST'ýcJ { "
'Oelse: 
€'applica�Æ/x-www-form-%'x } 1 = … É ë _ã [Öé* x "']—e´Í6ing  À self.errors3)
  Uelse:   õ
self.innerboundary = b""
& •clen = -1 ñif 'content-length' in K zheaderse :try  z X Hint(: [[ ]¿  7 þexcept ValueErrorZ Epass­  4 `if maxÈ Aand y > > Wraise` £('Maximum ô  ô  Š Veded'¡ É  =i ˆ "if!ælimit is None � := 0Œ L . K L  Bst =U afile =S 
% de 5= 0 ðif ctype == 'application/x-www-form-urlencoÛ “  Vread_# (þ $el^ Q[:10]c ¿multipart/'L # ð(environ, keep_blank_våøs, strict_parsingq Ï¢  * Ble()É±def __del__n)� �^ RP.closC  D   ò¿pt Attribut€|ns ^enteru Rretur3¡ Cexit- w, *args© ˜ h ?repg  B"""Rj Àa printable , QesentúA."""I  â r. ò"FieldStorage(%r,  e)" % (.  2   š Vname,� Ç	‰i	  ¥y.keys(): dgetattë  , g $!if Q != 'w vÝ
Á(D Õ © &ç   v.seek(0‰  o ‘.ˆ % *C = 1lis!1notÒ
… 	g  + ¹ Ý,  k' ã |ugetitem7keyY`"""Dic* #éstyle indexingB? › ç
Â „2Typ@ ("é L  ž"Vf’U = []½ @for ¦ p g 
_ !if" .Ö ƒQkey: K €.append(A f  3"ot" 
J © 1Keyh(‰  if(X )g 1< I  &[0Á ¥�* �1get¢	 °y, default=Ï›Ðget() method,ó including 'value' lookup."""
  õ if key in self:   6 ! = Y[key] áif isinstance(, z, list)F  J ¡return [x.( ` for xu  
X OelseB 0 E � 1 o �default
* Ðdef getfirst(ì ,ù #, % W=Noneº R""" R¶ Athe 7  ~ Ÿ receivedHgˆ ;[0]	 j  8 5 1 - 	> ß=/ $ 5 of'6s.gv/[9­:&[]5Akeys2
-ðDictionary styleŒ�s() methoZ ¯.X0is ©
 ñraise TypeError("not indexable")  J á(set(item.name‘   ”n &))È Á__contains__Ð ?Õ 5 Û S7anyÖ  ==XÝ Ü 3len× Ò élen(x) supportÔ7 " Bú
CNboolh !ifbá0Canäðbe converted to ` .ð  ´c Õñ read_urlencoded$ 
 Internal: , P data#1queºr^Zforma#qs7@.fp.: [ v.length�0if Ç G—qs, bytes‡ ºãVÇä£%s should y7 µ, got %s" \ö @  "% “ ð fp, type(qs).__6__)£ Ê Pqs.de#4 /Bing,¸eus3 Ðªqs_on_post¯²qs += '&' +A ) ´ aâ= urllib.parse U_qsl((  Ø  4rÀep_blank_val÷ues, self.strict_parsing,
  ‘encoding=*  ƒ, errors  
8 Ómax_num_field( 
  } rparatorG #se )‚ u Ðlist = [MiniFO ö	Storage(key, value) for  ª in query]K Ñskip_lines()
 Q ÂClass = None ð def read_multi(� ñ, environ, keep_blank_†  P	K!):d  OÁ"""Internal:S ð a part that is it^  i   E."""> Bib =¬Öinnerboundary  Pf not4id_ 7(ib�  … praise V2E´¤('Invalid 4  9ƒ  Uïm: %r' % (ib,)šf"if§ ¦qs_on_post ‚ •  = urllib.se U_qsl(Ñ  ,    .M  4?lf.yÉ N ¿p Í < 
½B 
  � Â Ñ  J Ô  Õ�.extend(Ù!¿ P k·X Ð"or“0__c) %__eQfirst^0fp.ï "¥() # bytes0 if¶isinstance(B ,, qò"%s should return7 µ, got %s" \n  Û  !% …ˆ.fp, typ‚ ¬).__name__§Æ _Ù w += len¸ H‚# Ensure“�we consum ñe file until we've hit our ‘@¾  wh1 i fò p() != (b"--" +™B �U) andF  ha Ã	I  ªPropagate æá into the sub SÖ appropriatel•8 Á
 ¡ -ifh sÔ �
D
B " -ÓÞ  VÒ…JTrueB wö r = FeedParser(Û uphdr_texxbˆ  U   Odata‰ * a 0+= 6 	    m  ;
Å  %   Ybreak? ; c 7 À       break'
  ù# parser takes strings, not bytes. Qself. ù_read += len(hdr_text)- Y U.feed" �.decode(I ¢encoding,  jrrors)E “headers =¨ ™.close()
k ð# Some clients add Content-Length forB #t Q Ù, ignore themL Sif 'c= l= D' in8 :,  I4del [9 ]§ ò limit = None if÷  "is \` Helse* - †	2 0parb Rklassf4fp,  ù, ib, environ, keep_blank_values,K  Ý   0ct_Ô²¶ 0 	 *áó, max_num_fieldsþ›separatorÛ+if0 1 isž EŽ
\ ] -= 1Õ !if^.listB  ó F  ç \5 
£ 1 ¦ ?< 0\ praise VqEòò('Max number of « exceeded'+ý ƒ˜  	ð /  é €.append(- 
À d–,or_2 >= / >Ù Ubreaky u ¤skip_lines®@def 7b_singl)%Á"""Internal:( ¢ an atomic°5"""c >¢ ¤ o„ n zbinary(õ  	£  Ç   p•   , K Ï      ³file.seek(0¬ðbufsize = 8*1024+  °# I/O buffek )  ž€copy to O 70Â  n 0
( h data.- 9 .X  ËPmake_ Dtodo  ëm ,>=übwhile    ò  ‹ U 0fp.EP(min(2 ù-O)) #r  E !ifñ°isinstance(W ,.  ,  fò"%s should return? †, got %sZB  &% U2typŠ «).__name__½ C |� ° L Â 
’ - ê   
ƒ    N ©>= -Ú # 
‹  ð     self.file.wËrite(data)
  qtodo =  S- len( ) ñdef read_lines(self):  F Á"""Internal:'  ' õ until EOF or outerboundary."""? 0if Q Ö._binary_file]  a    # =+ % ð = BytesIO() # store Þ P as b P for 9 sn ?els^ cString_ Aas s sV @othe\ 6eld] Ë 	í Ì  LI_to_. (›« 
= aeof()
ß  ¦1__wå 3,ˆ
© š“ is alway&S, notÝ ™n!is( ;NonAö _( ‘.tell() +E p Š) > 1000	ÙAmakeF  )   Ú	Ÿ.getvalue.   .û. > [ P   & ¸ 0 = Û J  Ö —b# keepj7  ; V | " ×³# decode to‡- O .2 ‹¢.encoding,werrors)3 £ 
Ã	²zwhile 1Ð å  0fp.s   `(1<<16 ’Ù  _/ 6 +=4	) !if{ P 
u ™done = -18   Ybreak  ü .) T *
š 8 4	; .€ @Data€ð §#: qies and¸õ ends must be convertedJ "tozŽ¶comparisonsl ÌSnext_f ²y = b"--" +1	¬ a 9las3 
C +C . QdelimY ÚB  aÕ_lfend = True3 õ5= 0 Y  ÂŠPlimit= ¯ ¬,30 <  1<= Y )
 œ ´E… ÓU3if � Û6\r"þ À        lineû = delim + line
   Y= b"" !if0 ð.startswith(b"--") and last_P y_lfend:;  b €stripped$ " =K r -()- 1if  0 þ = next_boundary_  c _breakL ­ L Ýself.done = 1T n o; 	5 =4end;n\r\n")Ê =  €" 	G  x A^[:-2]! 
‹j = Truè/el‘ � n� 1� 8rð# We may interrupt %ð sequences if they span
 m 2**16$t# byte   …ö 2LFals„/seþ	w  ÙV ¸ƒ__write(‘é!)
æ �def skip­ s(0 …@"""I[Anal:' ©Õs until outer5 l—defined."-pif not Z .2 f2 or  X
û areturn¡  W	íR--" +> 	T 3 	Ô 01 + ¬
.  J¯$Qwhile7
§  2 " =‡ afp.reaÐj(1<<16Çÿ  e s_' € += len(B 
) /  
m  	F  /N = -ˆòØ ¤+ˆ£¶& kø  .—G'\n'*Ÿmake_file) ÒOverridable: Á0 a í  0 & …  A . Õ@The  ö	 will be used as follows‘- data isL •ten to itÇ†- seek(0R2  ‰ ð from it

        Thñe file is opened in binary mode for"  s, Atext #
     @othe& Uelds
 ÁThis version]  s a tempor^ w  > õreading and writing,E   õ+immediately deletes (unlinks) it.  The trick (on Unix!) isG sthat thí ðcan still be used, but it can't %byC "anç �process,° @it wH Ðautomatically@ ¨ •d when itF Âis closed or  – ƒcurrent \ Æ terminates.Pð
If you want a more perman:  N,  õderive a class which °overrides tžšmethod.  \ {visible­E Múis nevertheless 	ÿ  â Vscripá @, tr×1fin’ __del__ œ  u"a Ô dÓ ˆ Û  	Þ
^sÇhave createdN5"""I ’if self._ù_M:  éareturn  $.TÇµFile("wb+")1 Oelse? &+"ò o   @enco=›  ú, newline = '\n')


# Test/debug code
# = ó

def test(environ=os. )­ ‘"""Robust( R CGI ¶P, usapas main§CgramNñWrite minimal HTTP headers#àdump all infor%oB �vided to7# ñ@HTMLyb ¬ðprint("Content-type: “S/html‚% ŽÓsys.stderr =  "ou‡2tryø  m š ò = FieldStorage()   # Replace with Y Co*QthoseÇ  K € ²_directory(Š  �arguments  … ( 3 ¨» 1_us· Š  ó#f(Þ �   `exec("
 o­ óexception() -- <I>italics?</I>X =  R [g(f=fU fÌ p("<H3>Wvpfollowsb ÿõst, not an actual ~ X:</H3o gW " ®¶ %  z �1>Second[¹@a sm„Ðmaxlen...</H1k -rglobal    Q = 50 -­
BÀ  print_exceòption()

def print_exce ô type=None, valu #tb Qlimit  ):
    if 4 @ is 7      E ò, tb = sys.exc_info()> ñ mport traceback ” !  d"<H3>T% ò (most recent call last):</H3>"Z flist =Z ñ .format_tb(tb, È Q) + \s  ± .  . g_only(Ô f Ÿ €PRE>%s<B P/B></ U" % (_ ðhtml.escape("".join(¥ �[:-1])),) !     )z idel tbÅ‚nviron(e C=os. «ó"""Dump the shell   mH±as HTML."""‹ @keysµTortedU . (ƒ ý �  ¨S[ E†  [ 	˜) $DLª for key in sB+ XT>", @¬key), "<DD Ò Y[key]§ 6"</s Z 	 ( - àcontents of a %  . # +cForm C^ 	'oif notBP>No‡ sfields.ô× &"<é \- +]ò  + ":", end=' 'ä %! =~ e,  } ;i>"Q Arepr;(>  ))xD"</i?  Ó@ ; p l Ó¯directory(Ô0urr÷% Óe û  ßC9 ”Working Df 	À7tryÉãwd = os.getcwdÛ\€ OSError 7msg5  š#("  �ƒstr(msg)äLelse; / 3pwd* Ê 	û@argu¨s($ ˜ôH3>Command Line A5 	÷ :  õHargvH	~ ²d_usage‚ « a  x'  ¨ ð variables used by CGIA	ÁŒ  Ï>IheseñF òcould have been setÖ ñ
<UL>
<LI>AUTH_TYPE éCONTENT_LENGTH $ �DATE_GMT  RLOCAL @OCUMA 2NAMR D 3ROO3  1URI5 òGATEWAY_INTERFAC9 ÑLAST_MODIFIED( #PA“  	 ð_INFO
<LI>PATH_TRANñSLATED
<LI>QUERY_STRING ¸REMOTE_ADDR HHOST IIDEN 4USE1 ²QUEST_METHOe ±SCRIPT_NAMED mSERVER 2PORS   ˆPROTOCOL4 9ROO$ ðJSOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environm/ ð!as well.  Here are some common variable names:
<‚  U y b_ACCEP¬  ¡CONNECTIONÐ  V fPRAGMA SREFERV!  d1_AGzï ô""")


# Utilities
# = ò

def valid_boundary(s):
    import re ôf isinstance(s, byte+  / ñ_vb_pattern = b"^[ -~]{0,200}[!-~]$"J Belseb 7 6 ÷return re.match(o @, s)ã ø Invoke mainlineé ñ  % ð Call test() wheÓóis file is run as a script (not	"ed Ðmodule)
if __Ø�__ == '__y 2__'Ü c q
"""Morðprehensive traceback formatting s Python~ ‘s.

To enCRthis } a, do:
M¥qcgitb;  .1 a()

atÎ³top of your[ �.  The opäal arguments tq  ()Ïg pdisplay±¶ - if true,È s,  & +Á web browser® alogdirF G =setF Pwritt™o—sxÁis directoryL qcontextM €- numberæ  ûs	 Psourcz deÖ Ashowdqeach st~2ramßˆM @ - 'Z À' or 'html' m ArolsO`outputL îmat

By defaulË @but Lasaved,G  T  Á Qis 5 ¶ A
and 	b  ˜‡ P(for 8PwardsfPpatibÚ`y with> Ð
original use	:P)

Al£€atively,Ìñyou have caught an exce “ Bwant\ IÕ @ it
� `you, cV~Ÿhandler()d D %  Ý ða
3-item tuple (etype, evaleàetb) just likeâ  ²uÛ ðsys.exc_info().
Õ� d –#s V�as HTML.
�
Atinspect tkeyword  žTcache $os
 Tpydoc %sy @tempV 5tim> vtokeniz �creset(†B"""RûPa str)0tha— se¯ahe CGI§j `pa knownçRte.""zDð '''<!--: spam
CHðnt-Type: text/htûml

<body bgcolor="#f0f0f8"><font  ÿ  size="-5"> -->= *A /g => < `script Qobjec
  blockquote ±pre>
</tabl 	 n ÿ'''

__UNDEF__ = []  ò# a special sentinel £ ð
def small(text):
F 0if     ‘return '<+ A>' +! c + '</ : Nelse7 "'
h _trongi , j  k Ogreyi  _4 90 "w  # />'u ñ lookup(name, fr clocalsXð"""Find the value for a given 8 1 in  ñ environment."""‚ %if) \ o 1',   s[X ]< Ÿ ®.f_globalsE  'É * 
O à'__builtins__'¾ Y ( " =S 
F ¬  w ˆDype(; `) is t #{}S '   . Ô  !   Ç" 3', 
 % ) 
Ç  ¥if hasattrŽ ,‰ˆ  , g ?get; •. eNone, Ó2ãcanvars(reader�Ú{ ð"""Scan one logical line of Python and ž2 upys @variŠes usedb q ò, lasttoken, parent, prefix,B t", ·  (''Á  
 ßt±#, L ²start, end,¥  ñ g Ñize.generate_- ö ç  P   O 2 ==Q  6 áNEWLINE: breakT, 1AMEb @ not´êkeyword.kwlist8&if w :'.'! l % ¡ U È,  0 ý$= = %> )Î  6   ¡’.append((• ‘ F¥)A × S VwhereÖ (1up(!q� 	‹ 3 P �  el¾ ¥ GÈ =oð+ '.'
            pó arent = value
  Uelse:   p) õ, prefix = None, ''& Álasttoken =   òreturn vars

def html(einfo, context=5)m B"""R0 ða nice HTML docum¦ ñdescribing a given traceback."""q �etype, eÑ �, etb = p  ãif isinstance(-  3 ƒ  ì   6   ‘.__name__? õ pyver = 'Python ' + sys.version.split()[0] + ':  ’executabld@date' ime.ctime( . 1())j @headi ð	<body bgcolor="#f0f0f8">z `pydoc.R./ Aing(<  Å a'<big> A%s</  5' %% wstrong(H ¢escape(strE))),/ 1'#f â', '#6622aa', a+ '<br—  Þ ) ó''
<p>A problem occurred in a C Ôð!pt.  Here is the sequence of
function calls leadQup to- `error,U  ; Porder yp ‘.</p>'''
Ê 0indNa= '<tt± ñsmall('&nbsp;' * 5¿   </& : ±frames = [] `record òinspect.getinner* E(etbæ×Afor  à, file, lnum, ä p, linesÉ 0dexÏ `  Õ!if6     H à = os.path.abs ( t  %   AlinkS€a href="# p://%s">$aa>' % 9  Ö\ . � N $ !   =Æ g ?Pargs,	 ›kw, local>1argº!s(&Á  ý ½ U  ªunc != '?'. i£è xÔ  Ø W ª"<module>"^  ' b 4+= úfformat¿ ê 	 ó R J  B þ r=lambda–K: '=îQrepr(* "))Õ E €highlighÐ!{}¢   vpreader(m =[ ]ð % <  …[0]] = 1D  # Stry: Ð ªPcacheò  6 [ 6[0]· 9 �finally:ì[  p = scan (« ,&%æ 0row4—['<tr><td`d8bbffÍ0%s Ò`td></t–ô ’   ("å !'ƒ!k,j)ä +  5n”Qs notü
iø`num - _x9 ô $ Ó  s<  b  ; -= ˆa(5-lenŽ0i))• ™i
 ¯	k  L  ®  k Óo À      line =ÿ, '<tt>=&gt;%s%s</tt>' % (num, pydoc.html.preformat(line))
   ñrows.append('<tr><td bgcolor="#ffccee">h ad></trm R Q ]else:  v  0 " =» b&nbsp; Â D° Ogreyui += 1
¸ õdone, dump = {}, [] úfor name, where, value in varsü !if+    S ¥: continueN    [S  ] †    $if_ ú s not __UNDEF__h  / "if‘  m þ('global', 'builtin')3  7  x � = ('<em4@em> MÞ °) + strong() A%elx ¯== 'local'j 
O ?  # =ã 	• þ .split('.')[-1]¤  Èá"%sw@= %sç Ø 	5Qrepr(Õ)2Ý_ ¦ @+ ' Nõundefined</em>')
ös}taasmall(· È`.join(m )˜ VframeÀñ''
<table width="100%%" cellspacing=0 Bpadd ¡border=0>
ä > 0>''B'\n'x  ² )Â ôexception = ['<p>%s:NÞ„õescape(str(etype))),	 ‚ @ –ŽŠ òRdir(e ~P[:1] ž/_'‚ 5 ( =7Pgetatµ ! ,ÉZ`\n<br>Ïb#\ncbindentC 0Ló return head + 'nÕ } o  ò'


<!-- The above is a descri�°of an error"òa Python program, 2ted� Opa web bîðer because the 'cgitb' modu^Pas en+ò d.  In case youL 1are°0reaeR this… `  , A ¹  a òoriginal traceback:

%s
-->
Žm A)> .ß _:", 'P, etbIñ
def text(einfo,¤Sext=52B"""R¦qa plain. “ documenttÆbing a givenÃ A."""¥ û	| 1 = q  Ôif isinstance© .ÎÀ  etype = etô2ype.__name__
    pyver = 'Python ' + sys.version.split()[0] + ':   ¡executableG Ðdate = time.c ( . 1())# Ähead = "%s\n ò" % (str(etype),�  , O )q ó''
A problem occurred in a ± ñ.script.  Here is the sequence of
function calls leading up to- `error,U  ; Porder yp a.
'''
Å ±frames = [] `record òinspect.getinner* Ò(etb, contextAfor  à, file, lnum, § p, linesŒ 0dex’ ` :m  ° 3 ! =: ð and os.path.abs (  …) or '?'5 •args, var	 ›kw, local» ¡argvalues(£ ²  x  = 'U !if´ 0 !=l ¢ . iQ Ü �    < ª"<module>"C  ' u 4+= \fformat¤ Ï 	 Ø ,q  N   B ã �=lambda  @: '=Û`pydoc.­a.repr( "))ý A åhighlight = {}d °def reader(Ï =[ *])Ó <  …[0]] = 1D  _ ±try: returnPcacheT Ý06[0]œ 9 �finally:N®[ 0varé@scan (« ,ˆ
æ 0row0 �[' %s %s'§ Z,E)ü w Qif in¬ªs not Noneõ 1i =” " -* 	ï   Ú  ë  s<  b 0numx@%5d ‡ i@  !  ¬ À.append(num+H t.rstrip{ '  0i +G ¡done, dumpÒ,Ú 0  Ÿ  ,p, whereC0lue­  F
¬ 0if +    S :õ2inu  N     [( û"if‹ Ä Kš__UNDEF__h  F "if‘ Ò == 'global':  Ê j ê  :   %el@  ¼ý? ê ! +N þv'.')[-1ö F    6{ '%2, x  ÍM
¹;els2Z  M  » undefined'«„ �\n'.join(š x O Ís'  � O'2  GéQexcep4t= ['%s:«  /Bir(e À < = fPgetat! ,|¾ � 	Á pR" "*48 ¥Ë ð return head + 'ó'.join(frames) + ' ’exception ñ	'

The above is a descri# ð of an error in a Python program.  Her8 õ
the original traceback:

%s
''' %�  ….format_’ Ð(etype, evalu ò tb))

class Hook:
    """A hook to replace sys.I  –hat shows� sÃ ‘HTML."""
K ò+def __init__(self, display=1, logdir=None, context=5, file E  ”  Ô ‚="html")±    ] .\ $ =f    h# send­ õto browser if truen M ž # =§ G  # L  µ sJ @not Ó 
N ß $ =é J   €# numberñsource code lines per f
P  o ! =+1 orŸ¢stdout  # ³#toô  ;[utputC  E 	 ²Ecall²6 xhandle(` ä  	&  ]a, infoäÄ  ! = Ô @exc_ %()¼ 0if C ÞB == ”  q # ðile.write(reset(ï    Jater = œR =]P and h �  œƒ Æplain = Fals6:try„ 5doc^@ter(É ,½ Ö \:™  `# justbõ
case something goes wrongŸ  A | •*– )‰  = à TW yf
ì  ifv*in  M Š `pydoc.Nº.escape(docv  - · '<pre>' + G P+ '</ :\n'< Nelse{ N D 	> : 6 P'<p>A“Ðblem occurred‹°Ò.Y 0I4is 
ª ñsuffix = ['.txt', ')2'][‹ Ÿ—]`  0ð(fd, path) = temp@.mks (Z =  {!r=R ’ )ò G   ¿  áwith os.fdopenn q'w') as{
É  1   „ wå‘msg = '%sPains ßBthis.ß å 	û 2	  ~ ^ PTriedÂFsave¬  æ%s, but failed^ 	K î' gÐ'html':
       öself.file.write('<p>%s</p>\n' % msg)
/ y  else:   G ¦msg + '\n'> :try9 5 fflush(+ òexcept: pass

handler = Hook(). ò.
def enable(display=1, logdir=None, context=5, format="html")Š â"""Install an v Bion a cr that9 ñs tracebacks as HTML.
	óThe optional argument '” ð' can be set to 0 ñsuppress sending theL e  & òthe browser, and 'Ý S °a directory7 KcausN s 0be å0ten  õsx are."""~ Bsys.DhookqÉ = c� ,:    …Œñ)
"""Simple clas¥ öread IFF chunks.

An ¢ (used in C `s such�qAIFF, T ñRMFF (RealMedia File
F Q)) ha÷ p follow}ëstructure:

+- ÿ+
| ID (4 bytes)   |& Gsize( & Gdata*w|
| ... _ 
f ID is a 4-Œ @ str¿ ò which identifieÞ rtype ofG!.
? ¡ ðfield (a 32-bit value, encoded usS @big-š ºãyte order)
giv_ K  of@@ whoÂ °t, incluÓ" 8© ðheader.

UsuallynAIFF-¥  ‰ ©Psists³  onq R more¿ @s.  ÿ Ñproposed
usagÞ  "Cy AÀdefined here+@to iá`ntiatew  `ce at
> Pstartv Beacho kˆAfromã 6  until it r0 !esD ²end, after ŒSa newz $ceE Š ad.  At[ Cend
I 
p, creat…F àwill fail withÌ ’EOFError
´1ioncãage:
while Tru®	~\1 = ;(w |H  X % ›Qbreaké; ¸=.ƒ.getname¿x  > ó/  Y (nÀsu  " pif not ) u    	   °# do someth  3 Þ�interfacù Ô S-like;f ˜0ed @ Pods añ � ù, close, seek, tell, isatty.
Extra4 õ skip() (called by@ 1kipÆ Z0endX  55),
+‚ (return¬ ?Z (ID)0 × ƒ__init__ƒ ¿ "…requiredrE, a ÷ ” object
(�Àg a chunk inðLstance), and one optional argument, a flag which
specifies whether or not chunks are aligneP ó 2-byte boundaries.  The
default is 1, i.e. 6 à.
"""

class CU ò:
    def __init__(self, file,8 ó=True, bigendian òinclheader=False)L  P Ñimport structb    Y ¡.closed = 4 
 ¦ " =v  2 5  ##to ’to word ( )O &if¯ —  S 1strrU= '>'0 Oelse( <( Ã  ! ="A  cRCname ….read(4)& aif lenb.- Z) < 4} åraise EOFError? :try( v 0sizv rÓ.unpack_from(ñ B+'L'Ö– E)[0][ Texcep² .ew 
k 
“  [ U NoneB 6if 
< § 2elf¸ ò - 8 # subtract UY >  ( _OE = 0 ‘offset = :  ®f.tell(ˆî ¡(AttributehA, OS	 Ê3 ® pseekable
º; 0  ?
´  h0get#i à"""Return the " � (ID) of rcurrent
.Æ š   r6 ì T	o  <o  " j   7 j Úh !ifÁž û
Â Ó . Gskip³  kfinall  1 €  Z
poisatty˜  5 
” ëBValu°("I/O operaÀC on l  \"W‹ ñ : `, pos,ÑZnce=0ý„Seek to d- ip Binto `.Y  ö Dè3pos)  s 0 (startÎ)0 IK µ  @not œ  Öñ , this will res>Qn an 
C  y€ "ifbD41ž [ «T("canÊ ‹#ifhZ == 1A Ppos =_" +Á  È]Û )elA 2A j F Ð
        if p÷os < 0 or pos > self.chunksize:
  õraise RuntimeError 7 ¡file.seek( €offset +Z J, 0)-  _ p_read =! 
 �def tellA )~ #if™ Vlosed  � – BValu” ñ("I/O operation on c7    "‡ breturnY Ž ˆ  œ ˆ  ,  7=-1‘ @"""R¼ qat most" ñ bytes from the F.Ø  ¨ "If&  is omittedv negative, p  \l> 5end; !of Q 2"""®  ^ "BU   ¬">=0‹   ŒS5b''¼  D 0izef
,  >  O " -`   r H £2 f *Ddata•  /.–(Ž 8Ý  ¡ .  `+ len(J 4   Z& =û Uand \ð "  
malign  š©8 & Ÿ Tdummyž Ì 1•  & Í  L 9 : ã ‚ ¸Askip– 
'ASkip¾_rest ÊðIf you are not inte. Qed in< ‰contents@ ,,ñthis method should be called so thatH  @ poiK 'to@ ee star  LnextÀoXkeekabl~:tryÛ ¿ná‘æ  0   Á# maybe fix ^Mment& ²" €Ýs
 ^    – ]n + 1V o †(;n, � ? % *	 =+ nY “	 ‘except OS«<Epass1 \whilei < \
D  æ ›min(8192,* †= â 	œcn! !if
( 
v  ? ó1EOFÚ ð
"""A generic class to build line-orienqðcommand interpreteðhrs.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as D ôcommand 'EOF'.
2. A   0 �arsed outO ðeach line by collect  I `prefix< €posed
  2 acharacÓ !inµ Pident ¸s member.
3u ñ`foo' is dispatched to a method 'do_foo()';P 3do_  s ³ s³ ña single argumentT!is± !of< �remainder«  Å  Ü €.
4. TypÙ ‚an emptyõ brepeat80lasR =ñ.  (Actually, it call'  “ ¸ `I  a ð
', which may be overridde¨a a subé°.)
5. Thereóa predefined `help'ù ¶.  Given anî p`topic'�  † “  ¢òC _& @.  Wf%noA s: ± lists all ) sK �‰  ˆ a_ func~a, brokÊ Pto up»Sthree@ Q; doc�#kðs, miscellaneous W 3  ,  &un9 Ã As.
6! 1 '?;Óa synonym for, . K* !*  Ù - Pshell7qf a do_ i0 exp.
7. IfL 0pleø   …enabled, n˜!`s willìÐdone automati” y,z  â 1comN  ngŽ �s_ :  w0all›/ e%J îqs text,¹ñ, begidx, endidx.   V 0strM w'0e mp1ingI qgainst,ýPreturx" qes mustV nz Q it. l  U  JpcurrentJ } ú0 (lq Tpped)• Þ˜ A are˜ ¯  nn™  !enN ©0xes a  ß 0 be% • dWPcouldmu toõ@videŒ Pdiffe™ ¦`on dep� sng upon�AposiÛ m Dôis in.

The `default‡Ð @to i×5cep.s•tÝ`
is nolg` ãh I!onk 
K�that haveo ] >u Cdata™ó `self.ruler' seú ¼Ó `ádraw separator#s
ïÉ messages. 7	,„ [ 0  7 G n# #t ò s?0"="²Pvalueœ Bintr.1nonX B wheiscmdloopT a  pSed,
i ›Ü {� startup32is u ®@
vias op( al«Û ¶  6‚ #()„ 	cÀembers `self÷.doc_header', `self.mis Band
 'un- ’ set the = £s used for ðlp function's
listings of document/ " 0s, u ñellaneous topics, and w 2 
T òLs respectively.
"""

import string, sys

__all__ = ["Cmd"]

PROMPT = '(Cmd) '
IDENTCHARS = ? ó.ascii_letters +V `.digit ñ'_'

class Cmd:
    """A simple framework0wri’ line-ori @commã €interprek !.
K ð These are often_1fulL Ðtest harnesse%�dministraP tool !ndI ð%prototypes that will later be wrapped in a more soph® ca¢š Cface— Aí ò instance or sub Kis aé G á • ó.  There is no good reason toh Rtiatex t¡‘; rather,K 1it'} az Rsuper“ gof an }   ð you define yourU L rn order| Pheritx ¡'s methods‘pencapsuD! aâ % � ’prompt = rc Õdentchars = Ix ±ruler = '=' plastcmd  Áintro = None"  ‘l¾U = "" •  Dnn0s (q help <j2>):<  † = FMisc•1 0 s/ ›0 U"« o , !no@ ’= "*** No€ Ron %s| °use_rawinpu41Ðdef __init__(©,Y ðpletekey='tab', stdin= 1out )— ŒA"""I¶N¡ºÏ ? `The opÎaal argå @ 'coì‹ 'Ã @readç@ nam¾! a— F / °ion key; it‡@aultó:0Tab H. Ifé 5 isF 1not�	r QmodulL‘available/e} J ðis done automatically.’í seu estdoutG  ‰ ify altern­Å Û0outÐðfile objects; if Å 8 2iedÊ "Asys.Íh  1out
 c”g 8 #ifŸ H ý "  <[  ä5dinÀ Oelse- 	† 1 n  — o  % p 1q / r 3 ¿ €cmdqueueÎ]¿  Š( =:Gðcmdloop(self, intro=ƒNone):
  õ4"""Repeatedly issue a prompt, accept input, parse an initial prefixL ôoff the received8 ðand dispatch to action methodsX Pssing< mM I ’mainder oZ õline as argument.
0 6""" åself.preloop()$ 1if  quse_raw×  ž  ¶completekey  '+tr   °import read– d     S Dold_W 5r =. F.get ¢  :   W ).s) U Q Ø  2   6 ª©_and_bind(7 tkey+": F "G !exòIÞ ZError g Epassð ðif intro is not qD “ ( =0 R  c ª" > òstdout.write(strç 2 [)+"\nÚ astop =� 	k Qwhileª  " l ‹ Žcmdqueue"  ±  " =_* j.pop(0` , ?elsF l ¡p  H {   • èÙ“ 6 ÿ?EOFü)   _ Y'EOF'S    é   
Å· |£ 7 _flush?  _   ¢ 3 4in.#5 !if@len(@ - S   # ? =  1 	 " G   î.rstrip('\r\n'	 $ kbprecmd¨ ƒ Ð) /on) @postS  =  , l 
‚ L % \kfinall)Ðq Ýy = æ?	”
Ü  ; 
 ( r0def63elf6¸s"""Hookñð executed just beforeü “mŽ u& icñinterpreted, but after3 Û¯ qPgenerÍfÏð d.

        """#
  Áreturn line
 ñdef postcmd(self, stop," !):#  ; õ6"""Hook method executed just after a command dispatch is finished."""N †  j † areloop† z ñonce when the cmd= )¢ {is cally Gpassr 1ost6  ù s 2‹about toê .t I Ž @arse™‚P" ï  ' W intovPname õa string containings  ,Ñarguments.  R—s a tuple3 # (Ïc, args� .J ' 't '$ ö' may be None if« €couldn't pÆ dI "Ø =}.Å 5p()q aif not ˜ SN u ,{ ¬ 9 Aelif7 ª[0] == '?'A v ’'help ' +- ?1:]C !C £if hasattr¾§'do_shell'Y ®   q ! r  ' Jelseª   ï ài, n = 0, len(k D±while i < n·  p[i] in õ.identchars: i = i+11cmd  B[:i]iM[i:]®¦ 5 *  s6oner † &Á"""InterpretC±ð as though it had be @ypedÃ …response³ !to@ gprompt…DThis¬ðoverridden, but sh¬kõnormally need to be;\ 3see] Ê )PJ‡Ãs for useful5–ion hooksQThe r‰` value8àa flag indicatÎpwhether÷ atL %of“ ’As by› iF$er×  s	|
«" =® ¡JŽOQempty= ƒ if­ ã  ±
ß< {defaultw  !la°‰ÿ æãZEOF' ] ; (''9 1cmd8 ×‘ ¤:tryy  µ«func = get$ o6cmd  . þexcept AttributeErrorU ž À        retuñrn func(arg)

    def emptyline(self):   ò"""Called when an+  , ò is entered in response to the prompt.e  L àIf this method> ñnot overridden, it repeatsB �last nonž “ tcommand{ a 5"""& 0if Ë .D 6cmdÒ  Š breturn! aonecmdø - qdefault ,ö oQinput% . ® dprefixõ §recognized¿  aprints‰õrror message andü ß s[ ðstdout.write('*** Unknown syntax: %s\n'%èŠcompleteŠ*ignoredMçc?4to =  ½ +n  Ø•-specificÏ 8 G_*()=—availableè  ByÏ ²M è. âH lis’52 []± y Snamesotext, ò   do � = 'do_'+ Â \ °a[3:] for a2ŠBget_a ò) if a.startswith(T )“  	Ž Zstate}Râ ‚Ônext possible…1ionˆ '¨ 'B@If a%  ‹P has ¤Dbeenp,›n# 
€ against 4 c f  pOtherwi ry  , = #_<>  ge=Tst of" Uions.G¯ à ÷ Z == 0ÞPimporJ ad¿?  � @orig R = re  .‚  ™_buffer()2   4 = 9 {.lstrip%  ¤ped = len(- 1) -  D 
V lbegidx†  (7 R 	Œ ?end6   6 2if Y >) òcmd, args, foo =Pparse¶ ( 
»  6 `if cmd|*''}     < iR   :	×  0 OelseJ ?try  7  W g sgetattr'  q @_' +­ Å  @ ðexcept AttributeEUo ½e 	Ö Ò  2 ± 	B 	@  Ñion_matches = D (½–,ã", î ð try:
          ó  return self.completion_matches[state]
  õexcept IndexError:  " M QNone
 àdef get_names(e )2 ñ$# This method used to pull in base class attributesU  j õ# at a time dir() didn't do it yet., –  '  ‚ 1.__W 6__)¥ û ae_help© w, *args° ácommands = set% 3eá 2 )z Ttopic0 °a[5:] for aà ‹ 5  ß  ðif a.startswith('  P_' + � F[0])9 è Ulist(¬ "| … ì (doæ 7argä õ'List available H  ~   "~ à" or detailed    u cmd".' À &rgô Ù °# XXX checkÆ u syntax3  # :try4   `func =P €),  0 ­A>±  ' l   xdoc=getm $do|™).__doc__¸  7   nif docÃ     ý÷stdout.write("%s\n"%str(docÖ /  æv í  J 6pasI    ’ 
 !noì�% (arg,)£  ›   ´(—Jelse9R?lf.@cmdsnF = [� ·  @undo ¯ I= {}- � u  „  s�  U 0if  t[:5] ==c(  ,  e [. i5:]]=1l   gs.sort 6  ûùere can be duplicates if routines overriddenV @prevZ F = 'j W Ü 3Ü  ÒÚ  r )  z ‰continue©     ? ! =X$ @cmd=Õ :[3:â A    if\ ¶ sŠ ,¶.append(cmd€ I  1delÂO[cmdw 1eliÃ § ÿ‰ 0£ âÒ ŸN  ªðleader))
           ñ self.print_topics( ðdoc_header,   cmds_doc ‡15,80)
  2 D 7misE ÿlist(help.keys()),J (un� Ž  #, D � Mdef † $, Ç  7 ,Ë Ñlen, maxcol)::  Ì  if s   Ú ò	stdout.write("%s\n"%str(Y )"ifSZrulerM Q n 9 e * lenb 
c ' ¢columnize(Ø Ð /-1+  
À Q\n")
ö  0G  V  , ¦÷, displaywidth=80&B"""D ! a- ð of strings as a compact set a "s.s  REach  € is only: @wide ¡necessary.¥  2 Cì ö+s are separated by two spaces (one was not legible enough)J 5"""V "if, :ist¨ 
.5q<empty>< ’  freturnÜ 4nonð= [i for i in range(Ô b4N   – °isinstance(1 @[i],g*)]¿ n 
Á óraise TypeError("C ð aH 6ingœ &%s ƒ  ö% ", ".join(map(str, ê )Î asize =¼ t �  := 1­ n'c'c E 7[0]b  � v    õ# Try every row count from 1 upwards7 ’Vnrows–&1,± ë [ �ncols = (Ù +8 q-1) //  V  , 1col1 0 [¨  1tot Y = -25  � 6col� r †  C ^ I = 0B    F  ú iž F   - 1i ='+Ä M*colQ ( pf i >= û 
³   _break@ x	Zist[i: Ò Dmax( �xó 5 " …s.append3 g '   q +=k}*+ | ) 5if , >øó ï B /<=C 
? Jelseg ¸ 8!enø
Ú I = 1pV = [0lÀ            Çtexts = []
  ù	for col in range(ncols):%  0 þi = row + nrows*col$ ¾f i >= sizeB  F mx = ""9 ?els1 jlist[i¸  M Ó ©.append(x)V awhile " ‚ and not N[-1]œ 6del 	I !Alen(X )&  s[col] =Q   ñ.ljust(colwidths" 
± õself.stdout.write("%s\n"%str("  ".joiz ò&)
"""Utilities needed to emulate Python's interactive €preter.
B ð

# Inspired by simila de ¡Jeff EplerEôFredrik Lundh.


import sys ótraceback
from codeop ( òCommandCompiler, c
 "_c �

__all__¨&"Iº  ¹ 8",  pConsole ê (",Á"d ¡"]

class U  ` ‚"""Base *  # . t !.
h CThis( ñdeals with parsing7™ ^ 0 stž±(the user'sD ðnamespace); it doesn't P O Àinput bufferW ’or prompt E $ fø0nam g    ` ð is always passedô³explicitly)Ï 2"""Ø Ðdef __init__(ž×, locals=Noneü0"""`tructoY œ  âThe optional '= ð' argument specif¿ 1dic* Qry inÐ  C QwhichFò will be executed*pefaultsûõ a newly createdD Z ›pkey "__p__" set> B"__cL   35keyD `"__doc /  2 ¨  6    #if) r ( S    F = {… :‘  , p  : B }‰  ‰.C 	 
 ð; = o&()Ù“runsourceÚ $, -1="<OÀ>", symbol="Ð<le"úÌè’run some N  ` Úÿ2A�s are as e¼ (• 8ñOne of several things can h:Þ  + 01) |Â  …¬incorrect;r`() raiauAexce·ñ
 (SyntaxError or Overflow q).  A s"  ø �   ° pr_@call˜ Bshow< e^ —() method#2Ç  qmplete,p0morÔ pis requÈ;Ðcompile_commaónd() returned None.  Nothing happens.

  ñ
3) The input is complete;
 šile_commaV ea codeD �object. J    I ðexecuted by call €self.run$ •() (whichG óalso handles run-time exceptions, ÷ for SystemExit)Î  Ë ü ` value‰  Tr àn case 2, Falsñ ¡ the other –s (unless� nq 0ionI sraised)è 	g åcan be used toB ¡decide wheg  to" ³ sys.ps1 or ±2 to prompt• EnextD Glineâ 5""" Etry:  Ð X1 = g Éõile(source, filename, symbol): bó (OverflowError, Syntax VN )s 0# CX1N  ˆ � QshowsD eQ (� y  + G•–!ifb v Âs 2s H  íG � 3* ™ � .� A ‰ 0def‡ ' (9 ,”  B"""Eæ  
‚ hWhen aIroccurs,¥ $°traceback()ð  ,F•isplay a + f.  AllŸÃs are caught ô *!, q f "reÎZóA note about KeyboardInterrupt: this\  Amay Ì i ƒelsewher]M€de, and .  not always,­ MC ý €r should& aprepar× deal with it¸ 
 †(Âqflocalsöü$
k%ž - 
"  .Çÿ ?   . ‹=Ü
PDì œ9  >¢ that justu7redT›“doesn't dC ra stack5€ because` ¡*  ¬  ŠEIf a& $�given, i stuffed inC uinstead%@of w¬ 0was* ´re before (ƒ ô Python's parser6use| "<string>">`n readBPfrom Ú   ú3outÆpwritten| s. §e(), below:	=Bype,8@, tbIÆys.exc_info(5 ÁÀlast_type =    �=Q  Ì A b  &if„ 9 \  �Ž
�ð# Work hard to sñtuff the correct filename in ·exception
  Itry:   Ämsg, (dummy_G ò, lineno, offset é) = value.argsI p   V ^Errorh Q# Not� ùformat we expect; leave it aloneZ  £ ;paso ?lseb SFrighU Ê ‘ = Syntaxµ ()K ”sys.last_T  ' 0if " $qhook is &__ *__Ñ  �âs = traceback.73 âion_only(type,—
™ ñself.write(''.join(T )' eGñ# If someone has set« © ,¹ leËúat take precedenc»v# over ‰  Õ
È a, tb)
- …def show(N )+¡"""Display[§  ioòat just occurred.S  | ‘We remove5 ñfirst stack item becaus‘÷ is our own codeD  The outputÏ igten byð —(), below7 1"""Ú  ‡  8Å ?",  „b = ei =‡f_info(Å6 $$ =; j ú_
Õ(ei[0], ei[1]� †.tb_next€  É â" 9  Î¥ ' ©  ­:Q ±	 "  md È#vfinally® C ÖNñ¨ ì Geäj, dataêWÎ— a stringU Œ ba²�mplementaý O As to=pstderr;A ±ubclass may|  ™ `replacùis with a different iZ | Ñf ÕÄ 2


n ÷InteractiveConsole(  cpreter÷ ð"""Closely emulat� Âe behavior oiW � Python  L « RThis ‡ ¡builds on s ‘  2 ñ and adds prompting%Rusing2qamiliarW1ps12  Aps2,  in bu?¬ ,K  ìƒ__init__ïplocals=,ÐB="<c*Ð>"):
        ó"""Constructor.

  õ#The optional locals argument will be passed to the; ±Interactive ÿpreter base classg †filenamei àshould specifyf   (& )' q !of ó input stream; i§ øshow up in traceback‚ 5"""I ¯ º ó .__init__(self,)6   .–  • 4 =  
! Òresetbuffer()hHdef   I %):7 @"""R5 Ý @ .´  5 . V = [][ iˆ· ñbanner=None, exitmsg 
s ó Closely emulate} Òÿ  Python consoleËm ÉÂ1iesP  …to printò Rbefors dfirst Ã ð ion; by defaultÝ: Bs a M D ssimilar•B onee  edA „the realÇ a ¡,C ffollow1 @curr÷½ æPin pa ö heses (so as noÌ  to$0fusÐ qis withý  x õ -- since it's soˆ c‹/!)dÄe  v messagœ6qed when‚ing. Pas™PemptyC0ingB…suppress“ @   a? a A. IfP Qmsg i
¡ given or sC aÆ�  0 X 'edë ä6try ¡usys.ps1T ÿexcept AttributeError3 † = ">>> õ] 2] 2] 7...] ñcprt = 'Type "help", "copyright predits"*ð "license" for mpinformaŠ%.'” #ifø = `í ³elf.write("± %s on %s\n •(%s)\n" %R  W (c�version,  @plat‹  , Õ .5  ‘!__-P__.__16__)1%el¿ ·  ¦ 0" %�(ãB 5= 0¾ zwhile 1O Ú   !ifX
*     Ppromp±ñ s    Oelse; œ 7   Ž   qline = 8Araw_È(‹ 5 *   ë?EOFå  !   L  :\n"F À        brea;k
  ]else:  % ùmore = self.push(line)+ þ	except KeyboardInterruptQ F �write("\n1 :\n"Z  � 4 Îresetbuffer(# ¤ 0– ûif exitmsg is NonÝ T ˆ A'now- âing %s...\n' %ñ ö__class__.__name__} 'elf Z!= ''ð d "%sU • !)
ª Adef S + !, YD ‘"""Push a � to the i]rpreter.F  $2The& ðshould not have a trailÜ 0newb �; it may  ‡  A W Cnal & Es.  U °is appended‡ "a ‰@ and” 
E œ ð's runsource() methodŒ¹called with< ð	concatenated contents of% p "s R @.  I 'is|  diA as that6 @comm£ �was execu[ ±or invalid,% Ë G !s k²; otherwise( M äis incomplete,¢ G pleft asn � Qafterr  …  TkereturnC Pvalue2Q1 if âPinput °required, 0  V UdealtF hð in some way (thÃ  '`e same¤ «)V5"""I  £.-.	š× = "\n".join(4 7Ê Px > ,v@filen5 !ifÓ < ! ¸c ²œ P:) oAraw_G� Æ, prompt="")X @"""W£# a æCreadŒ# $i "ed‚Adoes­ qincludeô….XAWhen# `user eÞœð	EOF key sequence, EOFErrÁ‹s raised‰ `base i›Òmentation useP Ðbuilt-in func ƒ �); a subñ!`replacÁ "is±@a diƒ&enb
p ’ ># j tP)



“{°act(banner=® , o ª  Slocal E ·ð"""Closely emulat¶ -ßactive Python@ TÀa backwards áSatiblD f‚ßU qConsoleJ81.  Ñ¾  ­ Œpspecifi²°it attemptsM`importF  9 Ë`module" 0enaˆ 1GNU  ifX ˜@vail  y@Arguý�s (all opêðal, all default tó'o None):

    banner -- passed to InteractiveConsole.i !()6 €readfunc8 aif notU ¯, replacesD “raw_inputE PlocalB z … ó preter.__init__9 exitmsg; µ  ¶ 1""" cÕ / =¦  (– æ 5if é %isæ :E  =I .Ú % =2 % Felse/ 6try  @ aimport3 Aline3   �except I ZError8  1- � ŸÏ#, #ò)


if __name__ == "__main__"T „ ‚argparse Dr =   .ArgumentP% r‰' c.add_a  p('-q', >ñon='store_true',²  ß  ò"help="don't print version and copyright messages"žsargs = „   † sœ  if½ òs.q or sys.flags.quietú  ‡ 0Q = ''Ÿ 
±  2  iÀ)
""" codecs�€Python C á Registry, APIÌ  ê òers.


Written by Marc-Andre Lemburg (mal@l Õ.com).

(c) C°CNRI, All Rð
s Reserved. NO WARRANTY.
¡ #

å„builtins …sys

###« ¦ & ¢ statelessá  ñutions

Êcfrom _f .*
Àc as whÿÁraise SystemÞb('Fail}”load the ‡ ] ð: %s' % why)

__allÐA ["rgÀer", "lookup
 @open  En@ PdFile 3BOM I_BE"“s"BOM_LE !32!   &32 &64 !64  M!  / S_UTF8G   )16 4 ) !16P D '328 „  U   	8 w@Info8   	 PIncre»"al*  De#r¢StreamRead[  ·  	x  + ! $ " ] Agete™Œ Dgetd„ f "geti³ ' 	r 
$ 
=  ³ £ J @writ 	> T  :  
  '     	; €strict_e”s8  gnâ # 	? ¯xmlcharref' 
œbackslash&   "É 	c �  £ ð lookup_error"]
ðT
### Constants

#
# Byte Order Mark (BOM = ZERO WIDTH NO-BREAK SPACE = U+FEFF)
# and its possible bN ðstring values
# for UTF8/UTF16  32 output B ð	little/big endian machin= 0

#< p-8
BOM_F ô = b'\xef\xbb\xbf'$ B16, L H 4 L³ = 116_  A iff\xfe= ‚ : B:  : Fe\xfw /32w \UTF32n @\x00 v  < v 9 m 1  « u Áif sys.byteo·B== '÷ ‚':

    3 cnativeAness  ã5 =  8_LED    D  �&32> ð o

else‰ 0B‰ * > ð# Old broken names (don't use in new code)ï¾ Í + �# BE "64Þ ?  0 032_Œ {ádec base class‘ @efin/¡the API)

 ñ CodecInfo(tuple):»1""" ð details when lookD 0up G  Ô Ôc registry"""ÓaPrivath ð to allow Python 3.4 �denylistI Ðknown non-UniV „ #5 csC o  Oódard library. A more general mechanism toB ôreliably distinguish test encodings from otherq ãwill hopefullyK @be dE!edjÏ 5   ñ See http://bugs.pö ñ .org/issue19619, ”_is_text_Š ô = True # AssumeŽ @are ) ³  byŒ Baultsòdef __new__(cls,+ Pe, deOô, streamreader=None Dwrit —  Ù±incremental� !   Z M  ÷X E =*, ã # c i qself = z.Á (y Â 
½ %))t  P .Œ ! =Š
 S # =
 Ð # =3
 ø E 8r = 5 ] 5  
5 ©–# =¸ ) Ò)  ) .ifƒ€ is not ì ‰  =³. =D a ðreturn self

    def _ó_repr__(self):
  õ#return "<%s.%s object for encoding %s at %#x>" % \; B  S ð.__class__.__module__, n 	 pqualnam I .   A, idW A))

X � Codec:
5 ñ
""" Defines the interface¹ ’statelessÃ Òers/decoders.@  º QThe .ä Re()/." ñ() methods may use different error€  @ Phandlñschemes by provi4 – 0 õs argument. TheseA 0str? Pvalue& ae predÖ dè  h   ') ð ct' - raise a V4 E� • ¡ (or a sub,)d € 'ignore= 
 0ñcharacter and continue with  GnextD areplacE  +  r sitable   è  ^ ;D Ê  ±Python willa +ÿofficial U+FFFD REPLACEMENTD ‘CHARACTERñ B °builtin Unië  _cs on@ î ~  b'?' on-Fing.2 þ 'surrogateescapqprivaten è points U+DCnnF 0xml3ref' �RUJ Â €appropriP 6XML† 7  R Ä!re¡�ce (onlyÙHing)ˆ •backslash‡ 9 - ˆ " 2ed ó ¨ sequencesJ  ¤E › J �\\N{...}G Ø Ä 5  ¶ó set of allowed AÐcan be extend Áia register_‹ý1"""O 2defôej‚, input,R$s=w)Œ xEx.9 KrN€s a tupl‘GutpuL#  c€, length~csumed)Ÿ M#  ‡  çÆ  yÀto apply. It( �aults toÞ G Ç 7 g  Qóò¡not store F1 in}Ç instance. UÈ j �StreamWriT =öwhich have to keepX \order¯ Bmake– že <¸ o  µ âper mustù‡"toè de zeroc 	¬“ an empty˜ Z Žo¹ 0typfY thisE —situationWa ª ²€NotImple!ed¹Ñ  „Œ„DÏ„	Àuple (output'
  ùobject, length consumed).
' òinput must be an 8 ù which provides the bf_getreadbufE óbuffer slot. Python strings,  X És and memoryC ðmapped files are examp #of” s� ‚ing thisp 
Ï Ãerrors defin·  a handl: °o apply. It( ‰aults toŽ '¾ 5ct'7 6ñThe method may not store state in1ùCodec instance. Usef SMÐmReader for c1 s|Æhave to keepX  or- ¯  make decodâ Ÿefficientµ  % &erñ!ble de zero29and´ `return)Sempty›1 ofò 0outOìC typ)isE —situation¢ 5"""$  raise NotIpmentedEÚÐ

class Incre @alEn6"r(t !):E M /An+  ! e3  ‹ å  in multiplÂPeps. â 1canT óbe passed piece by	 !toü V #()C © L  ½ BmberY5CG  Çðprocess between call©¿ 1().K ë ñdef __init__(self, ú$s=Í $5   PCreatu,¾h Ø 	`use di2ent€ C¦ schemes bú` î  a° Ð keyword arguäQ. Seec module doc !ng Ä  =`a listŠPpossiÙbvalues( ' ÷  #.r =« ¥ ¹B= ""ý  cŸea!ß, final=Falsed¥so H 0res~#ngN±  Ü  � Qresetœ ˆ R! u É rb | 92iali
� f _ 1get«b   S @curr4  ˜  w 
b  À   & 0oss ,ž Ü 1Set%w 
B ÿa2beeß€  edÜí h    @‚Bó.ed	( ²  ?  G T½"ubÌ/of¤0can‘upa²Bbase3 ï· Àincremental ô encoder if the  òmust keep some o óoutput in a
    buffer between calls toF 1().& 1""" ñdef __init__(self, errors='strict'):)  [ ÂIncrementalE£ .< )2 B# un¿ @d in¨ Ïthat is kept¥ A  “ .Ó Q= ""
 ¶  __ ¼ d Ã w, finalÁ ð# Overwrite this metho› ñ subclasses: It l[ ¹ x  ò# and return an (�õ	, length consumed) tuple8 Ñraise NotImplF0edEkÓ p 
Ë Ã i=FalseÉ , œ � (taking.Ö into account�xdata = V+D ¨ ‡(result,É 1 _[ r L ,K 3pK #®Quntil¬ Anext¢3 š  = c [Q%:]& ~ª @Qreset?+µ ( S 
y iŒgetstateY … 9 For 0� s9 !, E ™ 9 = 1 oräŠ º !Des(objectE Ä/An+  ! d3 s£ "òmultiple steps. TheþA can@be p£d piece by	 !to²V #():C © L  ,Qmbers: ÿ µG  ²~process
" e¯*  ¶`Create­ ¢ instance.¼ 0  *   may use die2ent.` handlÐ ¡schemes by K `provid Í ó ÿ yword arguR@. Se”Àe module doc�%ngH  for a listFò possible valuesÖ o ö c�" =« sä  Bc % ,ÂoT ‹0 å’ ì ª— £€‡ RìYÇ rä a Ì2ialQ
€ K ú Ó
a â S @currìÃ)er4 R ¥bbe a (/1ed_€Ñ, additional_J S_info'Ð.
        bufófered_input must be a bytes object containing cthat
  ð	were passed to decode() % À have not yeZ  enM uverted.B ÷additional_state_info� õnon-negative integer= �representŸ Athe C @ of  Ž ‘r WITHOUT‡ ehavingA Rproce¾  heŸ PtentsA 7bufQ.  InU rinitialj H  and after � �t(), getŽ "()Î ö return (b"", 0)5"""H % 
 Tdef sN Rself,~ !):  ‹D 1Setª rcurrent,  Ó .Z  ; ¥ £ ±Rbeen ˆ Wed byÉ  .  The eff%of ž Þ ô  be equival‰ $to
ý ƒ
class BrÁIncrementalDP.r( ü ø ‚This subJ >of 2 @ canàu¬!as#Bbase3 afor anÑ i€ Ñ:r iR,0bleøPhandlŸ�completeI  H¢ sequencesô ±  Ô __M2__(Ôó errors='strict'â  £Í .< )w  2 B# unÿ"d ß’`is kep� twçPcallsÁ , (A  “ .b = b""1·  _4  * ,e ", Ä w, finalÂ Ð# Overwrite t¬Pmethoœ ¶Ses: I‡[ U Ô  fšð an (output, length¾²sumed) tuplƒ  raise NotIœ Y0edElÓ p ˆ0Ã i=FalseÉ , œ T (tak| ¤–o accountPpdata = -W+D à ‡(result,É 1 _[ r L ,K 
pK m# keepQuntilùPnext þ3 š  = c A[conQ%:]& ~ª @õ C +¶ ( S  6 jC $ Z &# 6ß6µis always 0_ ² Üg  ¼ ¼ e Z�# ignores g  = _  ç Ê�[0]

#
# 4pStreamW i"d  rReader „ðprovide generic wor] 
#TÙerfaces whichÌDto iÚ  new encod–ðsubmodules
# very easily. See encôtodings/utf_8.py for an example on how this is
# done.
#

class StreamWriter(Codec):

    def __init__(self, stream, errors='strict'2  6 è""" Creates a ^ ¢ instance.`  .   sU ñ must be a file-like object openØ {writingA :Thei òmay use different±   handling
w  ðschemes by proviOB the4 ù
s keyword argument. TheseD úparameters are predefined:ë  2p - raisî `ValueEQ  (»A sub›)c Â 'ignore' - 
 ¥ €characteôñ d continue with  KnextH £replace'- 
 . ¤a suitable  î  a F 0xml 3refF  ™ R[ Q  Dú appropriate XMLD ‚
  V Ò !re¾ 1	# ¥'backslash{ 9 - | " Šed escap°	O  ªsequences.© V'namel 1 q ƒ\\N{...}n  K 	L  ¬õ set of allowed =  vPs can	Éextended viaD  register_e6¬ 5"""( Sself.Z=¸
 = 3s =è© ô eeñ�à.s`! !'s{�ents enco¶ 7to … ¦ Pdata,; rsumed =2 B ([ ,  ë s[ ±  L )Æ SlinesË OlistÉ Ðconcatenated ,  £0str]1 toí PG rusing .ƒ )æ ¬ " €''.join(a )® Qreset© £ R l X@c buÕsád@keep… Üinternal state0Calúñ
method should ensure thatæ  I 7*th5¡output is  ²nto a cleanr ,C ×ps appenL	/Ñof new fresh i  ªpout havÅ @to r±n‹ Jwhol… ƒ ‘rrecover| FpassAseekdÀ, offset, whðE=0):§ ®g .2 
, ƒ#if? “ == 0 andW  Q  'U åö•__getattra i,‹  :  * = Àtr):

      ó.  """ Inherit all other methods from the underlying stream.
  5""" òreturn getattr(self.0 �, name)
+ Ñdef __enter__& !):  S D  < 	. 3xit- ÷, type, value, tb>  7 s ñ.close()

###

class S¾ âReader(Codec):g  charbuffer^   =é  ¯ 'in� Õ ô errors='strict'L  È  Z™Creates ax ¢ instance.`  .   U û must be a file-like object open for readingA :Thei  may use diØ Aent ± • handlingu ð chemes by provia ý4 ù
s keyword argument. TheseD ó
parameters are predefinede h  2p - raisî VÏEQ¡ (or a subµ)c Â 'ignore' - 
 ¥  ¿ñacter and continue with  KnextH £replace'- 
 .  y ditable  î  a F “backslashE  ˜ RZ P ! úed escape sequences; Á`set of�Uowed RïPs canÉextended via’ PregisZ·¨&é5eamE  = 2s =1s Bbyte+G = b ; p_empty_0%    b(×  “  :I 
† 6lin† BNoneL ®adecodeZƒ, input,É «‰#  �€NotImpleí!edˆQ  pO �size=-1,s
 Pfirst� l=FalseDŽ fs dataSîü   ºrCs´ï  © `result�û \qs indicr µ`numberM Ðde points or ÈKs toi  Ä.cÀ() will neveu  R moreÌ `than rÌYsted,G Òbut it might Õ � less, ifÝ ðre is not enough availvÚ  pÙ ýapproximate maximum í 
Ž y‡0or !toå Q" R „ )erC  xñ modify this set�1as � apriate‚ default³	F (-1Ì �  øs € as much °possible.  	G iì tohvÞ0hav"3to O AhugeG 0  $Ð            swtep.

  ðIf firstline is true, and a UnicodeDe ÙError happensC ’after theJ  K Ñterminator in ¡input only v , 	M ñwill be returned,- qrest of H (  kept until 	K ûnext call to read()ý ñThe method should use a greedy4 ù strategy, meaning thati $it?  f Ð as much data ò is allowed with	A ¤definitionå Pencodm  Š [ùgiven size, e.g.  ifD  op@ 5al ;  enB ús or state markers are availableE «astream{$seÜ •uad too.5 5""" Á# If we haveÙ`s cachÄíPmerge§öm back into characterU€if self.Iubuffer:e  »  8  " =/ v_empty_ a.join(. K )K  v = None#!if¡ Zs < 0… ñ# For compatibilityßa other<#()^s4y take a€ ú# single argumenY Ë sß 'iz” #] õ`we getUð required numberK A ]F (ifõ¬while Trueß "ca W  ñbe satisfied fromu b  �?ß ?,>=@ ÉSif le¢ I C B) >=v
“  2   Ybreakg #w‘need morey	   Q>izeÅ O 1newªFü.Ê(' ) ;els%  ?  ®
C 1# dMñ bytes (those remai[W3las¼ŠincludedI ²  L :3 + � ÿ 1notRN>try' 0new¢#s,Â dv œ ªÖ (– ,�e/sµ 0exc®W nas excv iž ˜ \ +  ² Ï[:exc.start]¾ ?  . ù Q.spli@°s(keepends=Q
ý ? ôF O)<=1×  . JraisŸ  †  0 ð# keep undecoded ÷bytes until the next call
  Pself.+ ðbuffer = data[decoded 9s:]2 ñ# put new characters ind   O 	9 k  "  0 +=F   s( #K ‘re was no� © available* Qif noŒ  µ :  ä Ubreak !if² Zs < 0, õ# Return everything we've got@  R ›result = Í 	%  . p_empty_ñ 5 Oelse’  ºSfirst¼  > t> ˜ 	 [:1 sÂ   * ™ [ ørþ 
z Ðdef readline(R ò, size=None, keepends=True):3  © Ð""" Read one < P fromò0 inY³stream and v *thöœ.Z  ^  ‚ ñ	, if given, is passed asŸ À argument tou Ë  :    Ï —() methodZ 5"""( ²# If we havÀ ‚s cachedÈ ¡an earlier,Ä ? õthem unconditionally "ifY ‹
  O  $ *[0à<delG # aif len¸.I j) == 1s  0# r5 w ` mode;@migh‡qed morešÔ  A   #‚:timÏ   @.Z `š À 5 # 0 = |	x !ŽÚ  ? ! =‰`.split $s(1 |=False)~ ™ , € > €  •ize or 72Ž  ,    o	^E $isÄ!we¶P¶() only oncE`while i
à  s  � (  ] !, R “  ¦  W!ifÀ
L   � ñ we're at a "\r"– ÌQextra¥Ÿ� (which 	` K !beB 0n")Š geQ aproper�€ ending.n i*K ðtemporarily exhausted—§ @ YwrongZ ” ð if (isinstance(>a, str)Œ  .ÒPwith(û  ))ã\H /  H  IJ bK n Ü  u  ' ¾(¿1=1,hFs=1) 0 Ðline += data
  €lines =  `.split
 ÷s(keepends=True)
2 1 if. )s:  "   1en(B ^) > 1#  ' ñ # More than oneN ò result; the first ‘is a full r O Ÿto return   � â Os[0]$ "dea ! Û � @cachà ±e remaining¿ s|  4  ¤ ÿ	s[-1] += self.charbuffer5 (  : ( ä 0 X  = None/ Oelse½ ® a# only¼
á ö, put it back into p i  O È ( È _[0] +tif not ´¹  -_ íoFalse)%]breakÆ  T ƒ0withend\ F( :out+ ‹  ‹5inet !¾ o\ P: # W}±ally have a�M endÁ  ƒQ# Put|3res¿Átogether and\ ÙQuntil) Ÿnext callQ Ô v_empty_íC.joi2Ÿ[1:]) + \Q  ¦ 
 Q J 6 !ifº  ÊE% à F ‹– Ið# we didn't get anyth7ò or this was oury9tryX  ñ data or size is âú CÚ:Ú «é qif read£ n< 8000ž ! E*= 2é râÇ
 "deL  Ÿ  s(,û Phint=ø ,üÆ:8  F£""" Read aZás available oná inÍastreamq  9    Ž `them a¤Vlist.a  ( QLine ðs are implemented usÞ í codec's de
 
îamethod§A ’ncluded i¢  t ‹ entries|  a 	,¯ð given, is ignor÷ed since there is no efficient
  àway to finding1 õ true end-of-line.
2 5""" õdata = self.read() preturn " `.splitG ²s(keepends)Q  def reset(D "):  œ P""" R s‘ ðcodec buffers used for O  ´ Øinternal stat®  K 0Not atðstream reposition? õshould take place.È  A °This methodI primarily w @nded?pbe able yrecoverD ‘from decodoerrorsV R.byteï G = bt Echar  v_empty_ ~   ~1 BNonej €Aseekõ, offset, whence=0):F  �1Set�binput J´'s current R×  >Æ½ 5   jÅ r .± 
« x) Sd�__next__è g«@the & ¦0ed 4 ¸  õ .› '   	!ifI J Û  + bð raise StopIteraœ¥f__iterÁ  E   I  ö - dgetatt0 u, name,j  9  * = ÐInherit all oKsqunderlyH]='ª h ‰.ÑŸ 	®eÐî 4exiÜ÷, type, value, tbÃ %s ñ.close()

###

class S¾ €ReaderWrp�ü   instances†ow wrappus whichvÐwork in both .` and wi X mode The designqðsuch that one canŠÀfactory func1sn oQed by* A•.lookup()1  ¯�construct) A Þ ÎË@# Opj 0al b¤ibutes seti Bfile ªQbelowT #enü¸= 'unknown'³'inÅ�", �", 8œ='strict'®@Crea� aÌ ¯Ñ k ` must Ä; Ë-like object2 
• : ŒA or Ze— v Qprovi Xv,} ï _Prface$p† EC` handltðis done in the s÷ame way as defined for the
  õStreamWriter/Readers.
# 5""" aself.s0 2 = 	 
 r@ 2 = I ($ š, errors)- wt 2 = } - B # =K ¡ @def s (š ², size=-1):  å preturn   .* !er (+ )' E HlineI ONoneK 7 ?izeO  sP _hint=T s¤  6 Y �__next__X � R""" Rì @the & � decoded ¢ P fromüc input½.Þ+ ; _ ))er~  %~  a  :  eSÞI h, data® 1 .( r () D  ¿ IOlistI 4 . N Qreset’ C  ¶ ë ." § Ä 4AseekN ñ, offset, whence=0):&  _ .2 
, l £ ª  #if[ “ == 0 ands  m q UÐ Ž  ´ “__getattrÅq, name,   =  * = 4 nö
Inherit all other methodsk¤underlyingpi y h SfŸ ‚#¿Pse aràeÚâto make "with ÊzSð ...)" work propŽ d__ente´Ÿ	. $xi{÷, type, value, tb> òõclose()

###

class§  �r« Q¿  ñ instances translateG^�one encod\Qto anƒ¸€They use5ò complete set of APIs æ Ped by% › € ð
cs.lookup() function to iH @ment2 wir tasku ±Data writte/  ‹× us first�!in¿ ~ i“@mediñ Ñformat (depenì  ‡ Bhe "Ü!" ­ )EthenG … Š0 us;%ani  ° …providedK K ½ì  InûAdire%ì  i_"ad­ V � e a2�  å Ó è!edä ´!to~ ccaller– ð """
    # Optioñ<nal attributes set by the file wrappers below
    data_encoding = 'unknown'  6   ñdef __init__(self, stream, S ñe, decode, Reader, Writer,?  €  õerrors='strict'):
$ €""" CreaÓ 1a Sb RX õr instance which implements a two-wayH  l ³conversion:¤ C and§ ‚ work on2Érontend (theD  4ñ visible to .read()I  .wá 0())‘ #leø  û 	J p Dbacko —3 inO&). Å °You can use«  se objectsŽ édo transparento  ëðs from e.g. latin-1= Qutf-8®  � w Ü¡ must be aUD-lik€ 0 N ; Qadher9 ™÷Codec interface;2	¼ >B ñbe factory functions or classes proviÑ»= �™  ] † ks respÏ E¢` handl,pis done¦ È ðsame way as defined for 	È q /si 5"""/  R.u=
 b=Ë
 t=Ý
  ³Cer =o(g ", ‡)- Ô - (- B # =K º * s &hize=-1åU!= ô  * "erWFsize�  & r, bytesü #d 4  (! F ‰ < areturn[
• Hline™ HNone› 0if † @ is  : Œ q „ ¸ T | Oelse8  n <  b ô Bsõ Phint=Þ ù  z Ü  (œ >`.split4ös(keepends=True)ªT__nexi¦  RÜ ‰ & ó d S ê  SinputI.jé  ; {/erè >Î  7)¥ Á- €™ ,¿þ Ðdata, bytesdeð coded = self.de b(data, “errors)
  breturn qwriter. 4 !)
( Adef  `lines(Z ‚, list):!  L  d Á = b''.join(  ?  r, bytes” £ @Qresetž ˜  ® ‚.reader." ý  Ú  ³  ò AseekN ñ, offset, whence=0):&  Ù ò# Seeks must be propagated to both the � Rs andK'rsC  as% ¢y might ne= ®   õir internal buffers.> Ä _ .³ 
­ í ) S  ú ³__getattr__Qname,   ô  * = zð""" Inherit all other methods fromÝ ö underlying streamÜ 5"""u r©h ˜ .0  , Ÿ ¬0__e/¾ ­D  3¹î Cexit- ÷, type, value, tb>  7 s ð
.close()

### Shortcuts

Q �open(file— ò, mode='r', encoding=None, ‹£='strict',Ü ! $-1I ErOpen an@ 0ed \ 0 us2 \Qgiveng _å 8ða wrapped version£ viˆ Â transparent] Aing/ Bing.# í�Note: TheL  wiÙ¡nly acceptÒÕobject format‰ ¡defined by%  ™Àcs, i.e. Uni  : s; 0 moReuiltinE  & ñcs. Output is also  p dependÍ g › ¥usually beC l was wellç UŠ«kÐs are always ÝÁed in binaryx² $rdefault§ þ § Amean¶oH Í!in"M « †  1 �specifie(«` which^  k@e us²  orX D  ` ä u0 ma ;2to � 9 —` handl0 It  Ò ³4to ·… €causes V8Ed Pe rai— –in case aÌÞ ” P occuÙº ë ÿ h!d same Ea' b&Uf() API’¿  ’ #-1±  G  Oa´µu ` size ÝŽ `K ìmeÕe oÇieöp extra UFibutŽ.Í±allows quer ß Ø( V. ThiŠR Àbute is onlyó available if an encoding was specified as
  ±parameter.
 1""" &if= ñis not None and \" a   'b' „in mode: Ð # Force open �of the fiš �n binary4 3  A ! =   +Z  2 °= builtins.Q ( Qname,. Á, buffering)4 »  · š areturnŠ ñ 6try äinfo = lookup(>W  1ñ	srw = StreamReaderWriter“  , ? !.s r 	 w+ †, errorsU ð# Add attributes to simplify introºAtionß ˆ .ž % =ª  æ 1srw fexceptç  Av.close(‡ Àraise

def E7cedFileÚ Tdata_r ,? =b× ²='strict'):`R""" Ruña wrapped version ofK Ð which provid¡ransparentÀ  ó }   t  la´  0Dat_ PittenA on  ï � is decodÿ@ccor] !to igiven ì ñ3theL$ed] ¥underlyingF h  usñ  !P. TheÊ‘ermediated U type= ðwill usually be Uni® ñ  but depends on§  É " 'cs ByA }Q from/  Œ E are £  ç � ´passed backó bcallern2ed G 	.Š IÛ � Fd0, iÖ QfaultðF ,1 ma<  Ž adefineÞ " Æ handling. IY Ì 4to —kÑcauses ValueE� W 1be €d in casïE �r Xoccur{ äx%edé|gobjectß‡wo extraõg .˜.F I-@reflV  éB Ós`   Psame 2Šk0canmuë5forD 	w  by PythonÄ Dgramø .
¤ !is/
sÃ = w ø  B� xªg 
&  
& 'sr§ %¢R  ? ?"e,‰  ,�  S g ) 
â çã+sr0!srÀ_encoding = ð4file_encoding
    return sr

### Helpers for codec lookup

def gete= 4er(E 1):
H Q""" L+ s up the?  I   dgiven 6 C and{ >  Š 2its  Âer function.]   ƒRaises af ÑError in casep \ ó cannot be foundD 1"""k ñ × Ç .? eè  deÿ è E^ è a{ è ²incrementaló EIi EDÿ class or factory:í 9!or Ï÷cs doesn't provide an �4# =7= & y $ifK ‘ is None:  ‘ rÊÇO $ ¢O zj ÄªPDª�ª ª& n3if  ª&@ TOread#FqStreamRc ˜K[—9s‘ ô OwritLWc xô  þ Á( Rator,`ing, e¾òs='strict', **kwargs)'­*Ding E ” !esÙ`input J ‚ngs from 0terw Ð using an Incû6rementalEncoder.

    errors and kwargs are passed through to the IncE C Áconstructor. 1""" ej v = geti=  ( Ring)(† B, **… )@ ñfor input in iterator:  » 0out != H 2er. (3 B  ' 2if * :   Syield S %  O ‚"", TrueR N  	J A
def¬  deg(· ,¦ Cing,t—='strict'÷ £ @DC 1ingP  ü ´ !es”í  J ‚ngs from .0 usA (an½@ ,E ;r 6P . .G rO bÀ### Helpers Ä charmap-baU 1cs
)ò	make_identity_dict(rng):œO""" " @ -> / )  Ð�Return a ñ ionary where elúAs ofÀrng sequenceîÃ C @mappöîsmselvess“rf A{i:iÛ i›Grng}Ð ‡�ing_map(K Ø `CreateyB mapÂ$a 7   ƒ  ¢ °If a target pÜ!inÖ 2 õ occurs multipleâ `times,0  5 $atL !isO ý ñ None (undefined  ¦,G %caW�exceptionmnÌ  untered byi  þ øC 0dur½ ptranslaA ç °One exampleW �re this h Ðns is cp875.pã2ich/%es^ ù } PacterÄs\\u001ai Óam = {};  ­0k,vÔO Å‚.items()ž ˆqif not * m   �m[v] = kQ   Oelse#  h& U0m

:â handlers

try?  å1ct_  ¢s = lookup "(" "¦Rgnore + i + oreplac,  - 0xmlÏ3ref c ) A Ÿbackslash@ ( ? Oname: # à")
except Lookð$upError:
    # In --disable-unicode builds, these e0 ñ handler are missingC qstrict_% �s = None oignore  oreplac ¯xmlcharref$ Ÿbackslash# Oname ð
# Tell modulefinder that uÑ  þ ðcs probably needsò encodings
# package
_false = 0
if  Xgimport5 0
##{ Asts
, _¤ ñ__ == '__main__':
9ó"# Make stdout translate Latin-1 output into UTF-8 = Csys.: 0= Eµ vedFile( B, 'lK ´', 'utf-8'){ 1Hav{ /inz  +iny  x ?in w %ink  ð)
r"""Utilities to compile possiƒ in ñlete Python source¬s.

ThisÐ ¸0vidI  wo ð	erfaces, broadly similari "thèÄtin
function~ °(), which tŠðprogram text, a fileÀð and a 'mode'
and:

- ReturK Áde object ifD@comm3 !isi Ô   Vvalid: ONone3  	 + ±aise SyntaxÐq, Value Â or Overflow � Qa
  s? à(2  ˜ R `can beaô)duced by
  malformed literals).

Approach:

First, checkÒ ¾ðnsists entirely of blank lines\
1Pents;= Cso, Öñ	 it with 'pass', becausefñbuilt-in
parser doesn't always do& àright thing fosese.

C€òthree times: as is,s 0\n,œ  ð\n appended.  If it·  Äs8 6it'ò& BilesJ  ôL €,
we exp>Emore6 Î   (Ðeither way, w mp¢Athe
“  pget whe” ] ó > \n*'\nx h  > #s
M Q samex0 isTpken.  B�â5 $�different˜ 
Ë !No¿ðuitive; not even guaranteed¢ðhold in future
releases; b÷@atchïhú ôiler's behavior from6ð1.4
through 2.2, at Q tõ aveat:

ItÚ |0e (j  ž rlikely)+ \`stops  UÀa
successful™ñcome before reacr C 0endô  ;í €this
casm@railX °symbols may…Y AsteaE  þ * "anÎð.
For example, a backslash ÷followed by two newlines may be   ñ
arbitrary garbage.  This will- ñixed once the API for ñparser is
better.

Thes ñ4interfaces are:

compile_command(source, filename, symbol):

    Co0 ³s a single : 1 in} òmanner described above.

Cb A $r(R `Instan’ @of tã ñclass have __call__ methods identical in‘ Àsignature toŒ Î ;’ pdiffere*�is that ij e@ i < ðs program text containing a __fuk Ñ__ statement,F  ƒJ ö 'remembers' andZ éall subsequenti sG Awith´ _  W@forcB Å°module also@ 0vidËqnother 9:k cract likBôbuilt-in function¸ â Abut Ÿ €'memory'š  ÷ ^senseð·"""

import8 0warTas

_fe¿Ös = [getattr(i0, f‡) �  ê  … - .,P _7 `s]

__ __ "îC", "�   ñr"]

PyCF_DONT_IMPLY_DEDENT = 0x200Œ  ñ# Matches pythonrun.h.

def _maybb•„ ?r, l U €# Check í +  Ž@sistŽâof only blank Hm —!s.2 <    (D Ñ.split("\n"):$  l $ =G v.strip(r!if Ë ( ¦[0] != '#'@  D Pbreak	  @# LeÈ‚it alone– Felse< #ifd V f"eval"  L ¹ � = "pass" Ã # Replace i˜0a ' '›²6tryO UreturÚrïðexcept SyntaxError:  Ó #t q>@() e <Spagaté  «  • Š 0# C%! sP  R afteº@firstdƒ #× emå 3" (� W �, Depreca³ ‘) at most t¼s  .c‰ _  ) «    ñ .simplefilter("à "")É  ( pcode1 =ù  r2 = NonW # 	z  4 0 + �u  : ŠG as E% !rr‹ ¥ ‚  ¨ ‚ ?\n"„ 1 ` e„ àtry:
        i÷ f not code1 and _is_syntax_error(err1, err2):
  Praise 1 Kelse% ¡eturn None& vfinally%  _   =G 22 =( O
defˆ ¢rep1 = rep¥ )a 0repI  2 ð	if "was never closed" in> ø  2¬ rÍ BFalsÎ "ifA =‡ * 2Tru) 	: à ócompile(source, filename, symboln: . ñ, PyCF_DONT_IMPLY_DEDENT)
n ? �_commandu ¤="<input>" ”="single"ˆ B"""C³ 3 a H 2ðdetermine whether it is inv alete.
›¢Arguments: ú ƒ -- the  ñstring; may contain \n charactersK - = …optionalB´ from whichV  üÑread; defaultF Í  ƒ	^ Ógrammar start¤$; &# (Y ‘), "exec"H b ’or "eval"ü RKÁvalue / exceÇ !s Wd##- )  sÁde object if3† is‘pk’Qvalid€ @  �7  ¤/ ÕSE 0, V¤  Â or Overflow ‰ aI "  D ØJor (6  hV ócan be produced byD ñmalformed literals). """_`_maybeÝR	 ,þ\ ƒ

class Òãà"""Instances oc Y( ñbehave much like�built-in}"ilê@func�A, bu©0onetused to, @ texwá²ing a futurE Pstate+,L±"remembers"ß Wðiles all subsequentA ¥[ 'Awith« Q  ôdforce.DmÃ_init__(selfñ »  �.flags =aÏE CcallE |m _  vDob =—�&, Š  , V× E pfor fea< Ý _ sg  & !ifäbob.co_Ò &7 .Qr 
8  < | ? |=5 – , ’Ú f vmrb nl"__Oñ methods identical inp Bsignø X ü l ;÷‘differencƒ1tha’Ðthe
    instaöNnce compiles program text containing a __future__ statement,
    the instance 'remembers' andZ éall subsequenti sG Pwith L _ á in force."""
% ñdef __init__(self,):  ‰   .Ë Rr = CÖ (()< Dcall< ÷ source, filename="<input>", symbol="single"h Cr"""\   aâ Amandî ðdetermine whether it is in— Rlete.Œ  ¯ @ArguF&s: ‘ 2 --
Ÿ Ä string; may”Ò \n character@ S È  A …optionalÝ ³ from whichù ¥ was read;D F  …default & 	f  70mar#rt=$; ># (M E) orG i s  "evalä  ñReturn value / exceÏ ‡s raised3#- -  ‹Áde object ifC1comž is©pƒªUvalid‰ D ONone;  À3  Š ð  SyntaxError, V°  Â or Overflow ‘ aM 1  sG   eH * (:  ^Z `can beB‡duced byH õmalformed literals).  G ^  rbp_maybe_Ÿ1ileSC,' ñ)
'''This module implÔs specialized®¢er datatypcðviding
alternatives to Python's gen» ö purpose built-inP ñs, dict,
list, set,×@tupld * Ïd ð    factory func W` creatÝ& ±subclasses ‹A ° fields
* d¹ 9   v @-lik:$"er5 Áfast appends‘ ¡pops on eiàend
* ChainMapK È L   
› "a ð
 view of multiple mapping› qCounterN O  iÌ M   ´ing hashabl# ; ËOrderedDict ; Uthat ÎMo. ` entri&€ere addeÓ ß •I  w>s aŠÐto supply misí õ � BUserš P   wrW�r around¬  ß#ryñsì @easin Ð Ñ k * M AList&M  ÏG  G S�” ¨I  K  BA

__�A = [¦''\'Ü °  Ù  &  é  ²  àdefaultdict',
Ñ    'deque',
 �namedtupl ô]

import _collections_abc ósys as _sys

from itertools ; Qchain% 
 & arepeat'  ( qstarmap)  * tkeywordv $is  Ÿ  , „operator- !eqP /eq ¡itemgetter'  / treprlibM  recursive_ 2 
 6 „_weakref7 Qproxy. 
 a

try:”W�3 ¹‘
except I©RError7 ’pass
else A  Â�.MutableSþÑnce.register(W )� Ÿfaultdict‡ ?

# < Q � OrderedD€ ` <§#

class _e �KeysView(M 1):
´òdef __reversed__(self)Š hayield Ú% # ¯._mapping)€ OItem�  ‚ ¿for key in ‚ ® ² `(key, Í ª _[key]¯ _Value°  ± K« Y³Link(objectšð
__slots__ = 'prev', 'next 0key _¹4__'K #(O '™ðionary that remembers inserN  oÄ'5ð # An inherited J P maps¨as to vQ.- <The. àprovides __get©’__, __len	 €contains xand getO òremaining methods are£ d-aware- ‘Big-O run- `times R9all; €the sameÙqregularØ Bies./"# Í cternal` - 
@linkA  a doubly  ied lisÍ Bcircq '  ;0ts ùends with a sentinel elemenO    nÞ B`s dele³ð(this simplifies  ¤algorithm)> í O iÍ ¨”_hardroot‘ % ¬(  $ N  ­²7  ‡ @(to # ðent circular refò0erences).
    # Individual links are kept alive by the hard ref? ä in self.__mapK LThos* ñ(s disappear when a key is deleted from an OrderedDict.
� Ðdef __init__(o ñ, other=(), /, **kwds):-  Î Ð'''InitializeT oT ð dictionary.  The signatureŠ  à usame asK vregular: ñies.  Keyword argument b  E ’preserved� P 6try¨    Ð u.__root% 0excyïAttributeError7  � ; ¥ = _Link()E ] 4 = ) QproxyI4.__B 
9  + S.prev7 S.next b …map = {} × qupdate(¯©ÖusetitemÙµkey, value,L  Ê   Â_5 = $._ A__, Û !=_  , =(od4 õ(i, y) <==> od[i]=y'z ð# Setting a new « ƒ creates  -1 ataend of   ved listÉ Q# and `inheri÷ Ä “ >0ad with)  v Akey/V pairX!ifD4notˆ$¡map[key] =Ú! =* ñ$ =Í   {4lasÿ
 1ink ,a ,  ä = > ,,² 
= 1ast2 Ÿ 	  ˆ Z " =Û(X« =ÿÑ` A)h0del½
h?  M -__3 (00del4(y]2DÐ3an exis? | T usesb 1Sto fi Ø ¦ which get€�# removed� [  ª 2 sù  ±predecessord3suc Vnodes4ó 2R V  Õzpop(key# _ / ¡·  _.  Ü
  <  ó/ 
#  A X #  4 	#  JNone  < 1 =   @3terÿÛi   H(od)Ö�Traverse• Ø Ý �üc µC  †  GCcurrF awhile  0is Ò 8 
ÏQyield$ E.key; X  @ X  ø !re¹ ðd__(self):
     ô   'od.__reversed__() <==>  s(od)'
  Q# Tra+ ô the linked list in4 u order.5 °root = selfk 5oot pcurr = " U.prev awhile  ais not$ :   � Qyield$ I.key 9 = X   def clear(Œ )N   ö) -> None.  Remove all items from od. ¹ Û   Ô à 0nex  Ž  Ã  ˆ s.__map.€  Cdict  & !)
  Ã 0pop� Å ¸, last=TrueÐ $''½ ònd return a (key, value) pairÒ  Ê n rionary.i  ž “Pairs areC  edæBLIFOã1 if Ù is true or F Vfalse
&'';!if× Ü ‰ v öraise KeyError('›  h qempty'). ]ž 
^  ³ r M   _0! =ÜÀk 	" .Ï "  à8 D P D Oelse‘  T +  M ‘   M v 	" o " _ 	" D –  3 " 4key\ E4del±…map[key]3 A0 = ™C.pop‰7key—tqV ¿ Uv_to_end: ÈMƒñn existing element toƒàend (or beginn! ÷ -)ÒR\ À ýS 2doelm · Nò  òU N:  ¡    Psoft_#  Ëµ#   _ 	( 
#  X : # 	‡  Ä   > =£$asºU . £  k &asÜ  � s	:  y : ü 	"  Üê  G6fir¥  r , ˆ  ˆ  Uf G 	;  § É  t  6inkì¡__sizeof__ë£ ² = _sys.get { nL "en7 @ + 1Ç   ±# number of³€s includ
 ˜ Q  ` ð = sizeof(self._—_dict__)  °# instance  tionary
! €size +=  ôof(self.__map) * 2&    F aternalF á and inherited S €hardrootX nX ï# link objects? 
;  @ }# proxy@ areturnÑ 
U ¶update = __ òcollections_abc.MutableMapping.) @ �def keys!):T  � 1"D. ó ) -> a set-like‘  ž ñviding a view on D'sK "E ® ò_OrderedDictKeysViewp „ Oitem…  † 5 ‡ 
Io ˆ _value‰  Š n. ƒ 
Vj „ `__ne__ÐÅ) A Ôcrker =˜ "()  Þ1popm,�¤, default=4 ô`'''od.0 Qk[,d]ë ðv, remove specifiedH #ßÐthe correspon A.  Idð is not found, d C õed if given, otherwise KeyErrorP ¢is raised.ß  ©6'''  h  n ëÍ ( �result = U[key]7   ?del £  @ 4 $ifJ Ç  o Z †x  ± Ë U(key)E [ “Ô  ³3set ºJNone¶aInsert˜@with” ]' o¥ ƒ0in ¶3QRc   ÀA for[ iC ? d, else.á �×:elf› Y $ =^ ] >ò@_recursive_repr(m U_ !__S@5od. q) <==> ; 9od)[ ¼ � à/‘'%s()' % _ ò.__class__.__name__,Š  l¹  3 /%r5 R listS Õ7())Û · OduceÕ  Æ stpinformaÎ‡picklingß 1nst`c = varS.copyC ¹ 
2 in# Ö'()Q *  –P O!, µ» N+Q, (),Ð: ð or None, None, iñter(self.items())

    def copy !):   A'od. á) -> a shallow, u of od', qreturn ^ ’__class__Q e @ amethod6  v øfromkeys(cls, iterable, value=None� ð''Create a new ordered dictionary with Q  Z Q B andT ‚s set to .‰ ë 'Ë  Ä … = cls()! 0forY 5 inV ) B  6 r[key] =] ;  ú C__eq!z, otherê 3od.# ðy) <==> od==y.  ComparisonÈ !an= b OD is¥-sensitiveƒ zwhile c: ö regular mappingA %inC .³  â '$áif isinstance(ƒ 2, O‘GDictÍ  ;  ª×  0ú  Áall(map(_eq,H …G « ^?ior_ { c.updat» b  " N M oif not  í ÒNotImplemente % Ô=ú .B    ?new¹ 8new¸ r¹ gYº  ] Ô¹ B
tryV¿a_colleÝˆs importd‘
except I RError= ð# Leave the pure Python versionÄRplaceÿ�pass


# < Q ° namedtuple b :
-_{ ogetter.% ð = lambda index, doc: property(_8O (! )" p=doc)

yñ P(type €, field_ qs, *, r p=False,~Qaultsïy, modulüA"""R^sù1subM „â ø a dm s··>>> Point =Œ!(' Ò', ['x', 'y']‘0 €.__doc__u #0str2  f »“ r_ b(x, y)W X 2p =Œ ©(11, y=22)Z "# P tiãÊ poÈ€onal argß „Qwordsi W ©[0] + p[1]O  À# indexable ñ
like a plain tuple
    33 À>>> x, y = p  “# unpack K wregularM F S �(11, 22)   Ÿp.x + p.y] ý   # fields also accessible by nam° d­ ­._asdict()V ð # convert to a & eionary’ ad['x'] !11  ¨ žPoint(**dS d X NfromZ @  x= *y=ì_replace(x=100a %#   B) isiDstr.6 Ñ) but targetsd5¾ z B00, {  A"""
	 â# Validate the; G as.  At ðuser's option, either gener8 ƒan errorP ó
message or automatically ³ S Øh � with a v‡  .I áif isinstance(0 _ô�s, str):%  ~ " =Á ) $ò',', ' ').split(�
8 Ølist(map(str,F ). @type à = _sys.intern. ( "))SAif r, ¤ ”seen = se} ¹ ‘or index,÷ � in enumUñ ì  7 qif (not4 Ó.isidentifierØ  $  àor _iskeyword(À Î     "orK `startsŽO('_'(  §  Ï –  J R[Ù ]‘1'_{ %}'³ -  D 4.ad–  fŒ  d [W8] +�U0if $ ×   6str"  h °raise TypeE¥ (' ò Cs an- pmust beaGings0if ^  Btn OValuo û
 » 	 &f'ê@s: {‹ :!r}¤ í� (0canò b#› b	— Ò æ	ùã0©  jKame.�¬ ‘ [ %ävF8ÖÊ Q nïn underscore: ß m ‚ ª ä À � pf'Encou4�ed duplic;§ 	; D    Z $ Ú á_defaults = {}j5if  !is®FNone™  Àlts = tuple(³defaults)
  uif len( ! > Õfield_names):-  4 óraise TypeError('Got more D Ñ values than H  H 'u  _0 ös = dict(reversed(list(zip 1 G )),�  “  Y r ) 
H ñ# Variables used in the methods and docstrings3 � ò
 = tuple(map(_sys.intern,ù Aù Anum_;  ñ  t # Y @arg_ü Ý = ', '.join(& 8if K 6= 1¡B +C 'V €repr_fmtV H(' +\  '{T‘}=%r' for© u  2 )K ì D_newø  ._ !__i _Æ1, _& ó, _len, _map, _zipç,2,g!,  4zip�¡Create all†Rnamed1 ’�to be add o' Qclass½ RspaceM  <  A = {¡  ('Ÿ  · "':Z   Uù'__builtins__': {}  V   f' dí `_{type "}'. }q ôcode = f'lambda _cls, {¦#}:- ‚ ( ( )vd€ = eval(U ,í ]$  �Pame__í » a.__doc  #f'm ÐÆinstance of Í � G $ifçÖs is not None‚h lm z›@±c)0def*1ke("@iter“{PresulÄq;new+ H  â!if{(2 G) !=0©  + ÌÆf'Expected {dð} arguments, got {¾_ }×rreturn  ê ç_make.__func__~ (f'Make a sð object from a seque˜ µ  D'or 7"')} Vøreplace(self, /, **kwdÖ° 0 = # .² (·(( I.popÎ,' )w Œ 0if ) ZV
'f(4uneacÇ0: {÷p ?)!rSÒ 
MR|O4 ïing specified S'� as with Ó	X_X_X¨'‰ PicelyW0matS 1 ²esentation S… >…_"2 WP__ + @ É%ƒä as{‹ À a new dict ówhich maps field names to their values.'
  ñ	return _dict(_zip(self._> 0s,  1))
0 ñdef __getnewargs__- !):  Q "'RO  6 ÿ as a plain tuple.  Used by copy and pickle�  2 _ } ð# Modify function metadataÞ òhelp with introspe$  d ‘debugging§ 0for: �hod in (  » †__new__, pmake.__p 	 wreplace* Y_repr$  asQ# 7 8Ðmethod.__qual³À__ = f'{type 5}.{$   D__}'€Build-upãb classöPpace ‡ aionaryÙ #v@use Z  ()<b@ = bresultD / N _q sN 1= {  1©'__doc__':© Ò({arg_list})'é . Qslots0 (() k G  ²n   •_defaults(  + Ä=': Î '_Ï    4 Ï    Û    ç  
  	) # 	 	* bmatch_Sà v' }u ºaindex,à ¿¡enumerate(E<Xðdoc = _sys.intern(f'Alias M 4 ‘ number {[ 1}')l  ³ý[‘ ]O œqgetter(6 S, doc%rD=a f 8 1, (6 2,),_«  U8 R# For0ing˜Qwork,˜ñ	__module__ variable needÙ`be set1 ‘the frameÃ q# whereA  ƒ d†ð is created.  Byp0’this stepU¢vironmentsD P  G Åd  H ñnot defined (JythonYÏexample) or 5 P ;  ŒBargur g� ñ r than 0 (IronP\  ),Q Ö ƒuser hasO  õPifiedw¢articular ;.% #if  ¾ FNone»6try  ÿ8  ð	Ã ñ(1).f_globals.get('_Íç__', '__main__Hð
except (AttributeError, VŒ ² z  “¯  m
³ k.=ß Ü' O


# 4 I P  CouS  X 2!

`cW A_eleà(mapping, iterù,ð'Tally elements from thôe iterable.'
    mapping_get = A.get µfor elem in9 : < [" ]>  L ( à, 0) + 1

try:2  ð# Load C helper function if availº € ±from _colle" €s import @unt_€ Ñents
except I RErrorÁ ò
pass

class Counter(dict) ²'''Dict sub$  c( €ing hash‹  ñms.  Sometimes called a bagª ðor multiset.  Elem˜ � are stor,  s z ñionary keys and their t sJ 3 �values.
& u>>> c =Õ `'abcde ²abcaba')  #W ÜŽ O‡a stringH ü .most_common(3)À€# three &  & T � ñ[('a', 5), ('b', 4
 qc', 3)]#  ° �sorted(ca q û# list all uniquef e ` '[ †'d', 'e'a „''.join(i . 0())u a  À with repeti€€ 'a ¢bbbbcccddeBÀ Rum(c.‡(Q ¹  ¡# total ofÄ Ô'15nS['a']3   ¶Âof letter 'a„ 5J § Æ  ²ˆ'shazam'{‚# update"s ùÞI 1... cÛA+= 1  €# by add”1 to each—"'s` N  !cÛ 0nowò"reEevenß 7H �del c['b'�# removeg"'b� 5  Ö *# � Tzero A 0¤dZ simsalabimU G ã # make anothe¾%erÀ "c. (dv2 	 #S ¼¢the secondJD LEnineK9Ë �c.clear(Š  %Pempty–„ Ò 8)U ²Note:  If a1 p is setP¤or reduced �, it will¸1ainW (int a until PentryU ¡deleted or P er Ó 2ed:’ ú²�aaabbc')h  MI-= 2‰  Q ² h  Å0'b'ÿ6twoI 	+T#N ¢  stï £in, but it+   %Q 73-1
  A20)]Ü "''ÞÂ# References¼ð#   http://en.wikipedia.orgðH/wiki/Multiset
    #   http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag. M ódemo2s.com/Tutorial/Cpp/0380__set-m‹ Ž/Catalog L.htm\ ñcode.activestateb õ recipes/259174/4 ñKnuth, TAOCP Vol. II section 4.6.3
, ñdef __init__(self, iterable=None, /, **kwds):2  ?ð('''Create a new, empty Counter object.  And if given, c • elementsM Õfrom an input~ p.  Or, š £ialize theC 2 Õother mappingO %ofc 0 to6 "ir8 "s.ô  Â t>>> c =³  ()  #æ Ç %erq K ®'gallahad'U K � 3er Ê ö U ø{'a': 4, 'b': 2}[ U ¨ ˆa=4, b=2K S Ækeyword argsJ5'''¶ …super().R) ´elf.update(bZN Œumissing�8keyzTé`not iníÒ– is zero.ž  # Needed s0at ð[p °item] does N Öraise KeyErroí†return 0² Qtotal;§ aSum of‘ 0s‡ C 1sum6 ¦.values())T ±most_common$ 1, nŽb a''Listb  n 1  1 þ0and ÿn G / š7 ,P leas»@If nD`then lp 4allb ÆV�('abracad 0').s Ó 3ñ[('a', 5), ('b', 2
 r
 ] •f`# Emul~ ‡�sortedByx ã S¾ä iÎ Ç Y ŽF m.
 s(), key=_ ógetter(1), reverse=True² G Ð# Lazy importxöspeedup Python startup time– . Uheapq ‘  Á.nlargest(n,®œ 	Ž  FdÐ 
5IÞ„tor overÊñ	s repeating each as many¯ s 2itsïD†'ABCABC'Þ s 5(c.• )! b['A',  B
  C
 'C'ÿ!# Ñð's example for prime factorsoð1836:  2**2 * 3**3 * 1c7**1
  û!>>> prime_factors = Counter({2: 2, 3: 3, 17: 1})9 Šoduct = Q Bfor O : in_ Á.elements():ƒ ¤# loop ove4 sd 1...$ "prh $*=W   õ# and multiply themL é H  U1836
 ÃNote, if an ¦ @'s cõ has been set to zero or is a negativeJ tnumber,F ös() will ignore it.v 5'''8 ñ# Emulate Bag.do from SmalltalkÞ MÞ ’set.begin" EC++.E àreturn _chain.B ò_iterable(_starmap(_repeat, self.items()))— ò# Override dict methods where necessary- b@class# „ 1def– ¤keys(cls,  ¡, v=None):)  ¿1# TU ô is no equivalent  J‚ er�PcauseØ– semantic-ð# would be ambiguousÔcases such asÜ¢ €'aaabbc'� &2)Gâ# Initializing … ýÆvalues isn't2 be¤  !æ  (Qlread–‘ default E å  ikups.  J `to oneyô	easily accomplished withä T(set(|‡)).  ForJ mŒqexotic %P, cre~aøð ionary first us J  � �rehension 7cVÂraise NotImp	…edError(O  'ƒD  ò õ undefined.  Useé å £ instead.'Ë �pupdate(êŒ‰·, /, **kwds”b'''Likü.= ’) but add	 Yi   of replac qÛ¡Source can•n	I,2tanotherÓ É GanceO  ÂcŸz'which'“c² @'wit  O #Á Ûs¥ x C‡ n dn aP 	! n #d)d  n 	Ó
L V['h']@ 
  # four 'h'Òø ,ì1ch,wœ N 4š A 
^±The regularâ,€) operat¾Amake�asense žÕ&thä#øðe behavior result£0ome ð original untouc§ » be@€mixed-inÛ Ph all? Bthe 6 /åa mismash thatú Q# doe’ðhave a straight-forward intóerpretation in most counting
  ð!# contexts.  Instead, we implement straight-addiN ÷.  Both the inputsO pand out ñ  are allowed toj �ain zero ( ‚negative— 5s.
H õ	if iterable is not None:!  ¿  % ¤sinstance(0 �, _collec« ês_abc.Mapping)? C Nself     p_get =  I.get€  $   ’for elem,È  m� .items(z   9    Z [> 3] =@ +o  z ( M, 0)x ;els M   ò# fast path whenU  erH]emptyL  6 Ösuper().updatM
y u _U_« Pents(Ò ,¿B zif kwdsl - u   )Ëdef subtractQ =	q, /, **2 Q Ä'''Like dictU U) butL s s 7ðead of replacingÑ%m.C,ñs can be reduced belowÃÕýK #dSource� %anT1, aä ñionary, or another µ  íTt>>> c =# †('which'¡! .w@'wit    #Kó ñU from� úü V ¡ A('wa^ )[ V c*erU P['h']?  0# 2‹æ ‘, minus 1  Ø 
  Œ ] 0
 ¼ ?['wg U  M
U g "-1ì ¾ 5'''u  ×ü 8 "œ E ,×& œ Ó   © Ë" -„ð   Z‚  µXî 8   f s 
1o ‡úW� ‰Acopy…ÇÁ'Return a shÞ & .Ær   ™ ¢.__class__F Z "__W Ý ? 0, (ÛF ,+ð__delitem__(self, eleSm):
  õ:'Like dict.__delitem__() but does not raise KeyError for missing values.'R ö if elem in selfk  r ysuper()l  . !)
@ °def __eq__(< x, other¯ óTrue if all counts agree. M‘  úre treated as zero¥  Ø ±isinstance(j 0, CT 	s  · ñreturn NotImplemented²  1all¶ b[e] ==»    .c Ô Ee cý /neý $nyý ?dis u Q ¶ý Ôl× Ô=ñ are a subset of thos5¯ÑX<Ñ&/ltÑú opropereÎú A andÒ# !àgà+?perâm>Ö ³gâ2däü äCreprÌ“!if# H 
ì50f'{ õ.__class__.__name__}()'E:try? #–ð() preserves the ordery_ õed by most_common()S  œ2d =H „ 	( ) ±except Typeá‰ òhandle case where öŸ ÷• Oable| n ¹  	r{d!r})'að# Multiset-style mathematical  òations discussed inÃ #ð   Knuth TAOCP Voðlume II section 4.6.3 exercise 19
    # ð   and at http://en.wikipedia.org/ ’/Multiset9  ò% Outputs guaranteed to only include positive counts.:  á To strip nega&  ‹ Czero/ ò, add-in an empty 3er:B Â `c += Ca Ber()  ° When the mÁ ñplicities are all m ror one,$ �set opera:sG  / 
æ Ðbe equivalent÷  e ÞcorrespondingF åfor regular seÅ TGivenß Š šs such asñ V  cp ó Óa=1, b=0, c=1 U   'cq* c* d* e*  Th£¾ © œ would be‡ s‡ £{'a', 'c'}. w   s{ 0{'c e aAll of™`follow02reluo Mholdq üet(cp + cq) == sp | sqy & -& -& |& L && &L  • $==$ (L= sq� ' !' !' <' <' t <s >L >L >L >L Yò	def __add__(self, other)� êb'''Add¿“s from twÆQers.
H  * 5>>>«–'abbb') + Bbcc'5 - Ôq{'b': 4eÖ: 2, 'a': 1})X 5'''d ñif not isinstance(° ,g ¹  f õreturn NotImplementedM gresultDŸ  ÐRelem,ù @ in {.items(f 1new# =. +F[B ]o  ‘  À . 6> 0g    ” : 4 = [ E ™  š 0if „ 4Ã ¯ � * ~ P¥ ¢B?subB	’ Subtract!¢, but keepSP ns withX~ aTc') -ûo('bccdc[¨Àunt = count ÷ - other[elem]
  ùif newcount > 0:  ( bresult: % =- ( @for W ", E "inl Š.items()R !if- ó not in self and< <� 20 -. ‚ rreturn © 
 °def __or__(c ,“ Œ ð'''Union is the maximum of value�  ei4   " Rinputz Bers.h  !P>>> C@Æer('abbb') | Qbcc')•  - ) ö
{'b': 3, 'c': 2, 'a': 1})X 5'''7  ¦ 2¡sinstance(Ð,g Ú  f åNotImplementedM )$ == (Ÿ Í  @Ìƒ _ö=b'j  Œ ^# 1 "ifL" <:  Belse 	E   ¦v'Ã �yâ¢?and£	¨ Intersect«$in«Òcorresponding7š&ö'š	ŠÌŸ „	ÝÇ ÏŠ.3posÎâ'Adds an emptyãper, eff°vely stripp�negativeSBzero1 sIƒü/;8?neg ý''Subtracts from@.  Sos posiÿ ,Â kBflipõ…sign on 7B„;>î;Tkeep_ð(self):
        ñ:'''Internal method to strip elements with a negative or zero count'''
    qnonposi% 0= [A A forJ ,/ ó in self.items() if not E> 0]N :  3 Z :!  t 1delP m < Rreturj 
0 Ðdef __iadd__(� †, other)O ñplace add from an& Ÿ õer, keeping only í 
"s.k  — °>>> c = Cou_�('abbb')‹   +! <bcc  . F ö
{'b': 4, 'c': 2, 'a': 1})y '�A{Î |û  “  F2 +=ñ � O .__û (| `?sub`ssubtrac÷ X1but\YTresulzk ” fG* -gdh`G-`&/or_òunion is the maximum of valueÙ eiþS/erº|SR3º±_`  À$ = ß"ifñL >û 
 ( =2 /anli!Hsect´$in´ correspondwå �/ &¯"Y 7˜³vRgR wŸ<ŸD/
# 4 I    ChainMap Y 2u

classY b(_collðs_abc.MutableMapˆ¿U''' A5 ñ groups multiple dicts (orÑÀr mappings) ñ#together
    to create a single, updateable view.
* ñ$The underlying mappings are stored in a list.  That ñ is public and canO ãbe accessed ort 0d u… ñ the *maps* attributeT 0ereP Eno oÃ Sstate¥ áLookups searchH ´ !su{ ðively until a key\ afound.¤ ôIn contrast, writes!s,Î ðdeletions only operL!on{ QfirstJ .¦ 2'''Tòdef __init__(self,÷ !):6  ¡À'''Initializ¥ðChainMap by settŒ+!tov Ugiven Ê  J UIf no ¸•provided,þ  empty dic× !arCused»  I  ¿      µ .ª! =î( )Ò@[{}]"  �# always €east one� 	0misÿ7key
ð raise KeyError( = getitem= 0forn  ³ §· i ¨ :try   UreturQG[keyØ @   #Ô�'t use 'E- à' with defaultUØ Z eexceptÓ { Epass2 ˆ » &__, 	 N  ð# support subclasses t�wdefine = A3get‚Dkey,³ X=None„ „ 	"if8 n  T else< \ S__len™M ðlen(set().union(*J T!))Ô P# reuÅ gøhash values if possiblep Niterq ed = {}Q�reversed€ 
’"d.(É�.fromkeysò W­ ¬ Ù 3   Õ ° 8(d)Ã  zCainsÇ ,h=0any
 Ô!m Ñ   BR CboolN I 7 ñ@_recursive_repr()<¶  N 1f'{M !__�ð__.__name__}({", ".join;(H ,>t3)})@< emethody wPcls, 8 ©w, *args× $'C×2Œçãü d V =Q !.'r  §£;clsù, } ¿AcopyH’ ENew � %orŸ%`a new 9 0 of¬As[0]e@refs© [M[1:]› 
kx L@[0].Q à(), *self.mapsð[1:])

    __copy__ = 	  ðdef new_child(self, m=None, **kwargs):? ñ  # like Django's Context.push()d  ) ð'''New ChainMap with af ð map followed by all previous %s.F PIf no ð is provided, an empty dict Fused6 ñKeyword arguments update theM !or‰ D < 5'''~ @if m^  	:  Þ Bm =  Celif , .~ (1 #preturn oñ .__class__(m, * Cmapsµ‘@propertyn  ®0parÙ ¬š ™  ®(op­	«@from's7.° ­  / ±  £ ±__setitem__§ Ö, key, value)#ì ¢[0][key] =$ ›\__delJ C 6tryP  2delW DX <  ú except KeyError; Uraise ñ(f'Key not found inEPfirst$çping: {key!r}'þ 0pop² ú « Ã'Remove and P0an * f pair |Y0]. R�  ‹Ñ   ¾Ÿ` a.— †0'NoÅs.û*H‰Y*key*û  2its"f ;    in�Os[0] (›  Ÿ (&Qclear%&C Ð ’, leaving §1:] intacté 	åT �U__ior‡Wothern 	< ¬$ K—U iº œ‘instance(S ð, _collections_abc.MapF‘  ¥r €NotImpleÇ%ed�  €·  ÄÉ#m.!tu íV mÅ rÆ j Â¦ Afor ‹ orreverse—ß *mì 3 F À return selfÿ.__class__(m)


# < Q � UserDict ` :!

½ a ñD(_collections_abc.MutableMapping):

    # Start by filling-out the abstract methods0 ñdef __init__(self, dict=None, /, **kwargs):0  d  ' ¥.data = {} !if; € is not B 4 8 pupdate(e ); f 1   )æ ¶ 3lenµ � ¡return lenÏ ¨ 	6 sgetitem: W, key?  if E in æ 
” `  X[key]É rhasattr~ „÷ , "__missing__"r  U 3 .1 N ¬ l ð raise KeyError(È sè  , ú | 
Æ ! =  E 0del3 -6del'	ž ŸCiter9 s ë   Õ ¡÷# Modify __contains__ to work correctly when  swpresent€ C i >Í‰ 9keyîþ °# Now, add ;m2 )  ¹Qs butå:in ˆ€ ?rep   —  8o6 w, other=áif isinstance( ,#( Ts " |^ €  2   b  ô ^ #ãoâNotImplementedm÷ rø J,ì & |´Ÿ ø +^ Y ø iø 4Ì7 |=Û‘ ÚFelseþ  2 - ¶  " ¤NcopyÓ ‘" =V¾3new- Œr`nst.__\3__. q  , °# Create a ƒ ð and avoid triggering descriptors
     ýinst.__dict__["data"] = self €.copy()
9   preturn D 
 Adef $  ? !):  ) $ifQ öclass__ is UserDict'  + T  (J .— } ~ aimportp i  ) ¾    :tryh X U = {}(  ƒ 1c =V r  ) u ofinallL 	v �c.updateÆ E ä c5@amethodˆ  F÷fromkeys(cls, iterable, value=None_d± 'lsš¥for key in< 
ÿ Pd[keyéQ w  û š _d


# < Q ô@List ` :!

Fa ð(_collections_abc.MutCtSequenc?ò8"""A more or less complete user-defined wrapper around list objects."""Ê ¹�__init__ó ,   - ³ V×U = []€%if2  #@not ì
¼ó# XXX should this accept an arbitrary sé ?]  á„if type(˜ B) == ’ Y 2     [:4= 	Z  el½ s6ancb ,”Y &[: … Jelse	  › ! =–Ú ”Crepr”† î  ¯w )8 lÊ^other= € <äBast(/ 	L e‚ ",  Í ‰ L ‚cM /eqM =M gæ >æ gæ >™ ý  3J¸  | ?y•…containsNNitemæ   M Œ n D 3len? 9 ?len[0getV : 7, i= 
Ë ei, sli³ ö  5!__ÿM ¢ 6[i]r ý ð:
            reðturn self.data[i]

    def __setitem__(" P, i,  !):$  (   : ! = A 0del1 A ; ?dely 5add4 Wother8 áif isinstance( §, UserList(  Ÿ &reà s__classX µ 1 + @  )Õ /eld Atype	/ k #f œ Blistá ())VrK& +¢¹ 8k f 
7 ½¶i5Ý7 +=)k  ^	"U P &se[ b 	- ü 3 &"3mulè7, n©/ .3* nj1__rE Q = __
 ` i 
a ± O*= n§ Ccopy¨ ¥  Ü" =z¥ c.__new- ¼ – 6 ó .__dict__.updat® , °# Create a ƒ õ and avoid triggering descriptorsÈ 	e  ["3&"]¬ }  5[:]9 y @ HcappendF (I.&   < dinsert< ˜.) »B 4pop? 7=-1{ ¬ ‚  * i cRremov]y & ¸ Qclearx r k  l   / ¡ !% ß Ecoun 7temo @  Ã., ª QindexV å , *argsH 	3  H - � brevers6D û ! ý %soã/R x, **kwd‡ C 0 ¦ ' � 3extnÀf, other):
   òif isinstance(other, UserList):
&  òself.data.extend/  )) Oelse7 _)


# < Q ½ `String b :w

classc ñ(_collections_abc.Sequence):
Ðdef __init__(BW, seqZ
‚‡seq, str!  } 9 i  =? Z   /el?   ¿F Q 7[:]N ¼ x 0tr(» Ø 3str× k `returnÆ ñ g )6 ?rep7   8 $inEn ?int6 Ofloa8  : complexâ   > Ohash;   8 ¯getnewargs> : I[:],\#eq6 G7ing+,%î/È÷0 ==Õ1ingÓ7( õl„™ @<˜ ' 	— e0G<0( ™ g0H>0' 	— 0H>0( ™ tcontain5X, chaG
ý  û  ! =C ì  5in ˜Š 3lenT|%6len½	¹sgetitem: ~, indexA r !__‰, ¢ [0 ]S 3add# ð, other):
        ÷if isinstance(other, UserString):
  ñreturn self.__class__( qdata + B . ): /elf ?str_ #Z � 2strÖ 1))
‘ £def __raddº ,´ ‹ ® *" +$
® ¢ 
6 ® 5mul­ n© Q  ž z C * nö 1__rE Q = __
 &moOargsc !% 1 N rO �templateS 5tr(- ! %@½ ò*# the following methods are defined in alphabetical order½ ò¡capitalize®Ž D.: C�casefoldO 8 	M QenterK ¡, width, *XÂ  ‚ì".cD 	> @Countb øsub, start=0, end=_sys.maxsizª
	7 ‘sub = subý½·  ”".c‰ ƒ � © Ãremoveprefix°  7, /·
› " ž ! 2 = 	 ¤ Ö .“ A ¾ 6suf²  ² 	" ² ! S Y ² !C ( ² Rencod
 ÷coding='utf-8', errors='strict'v9  ƒ#= . E if  Åis None else W 4 = Y < l  :  8 úCp !e( 4ing± EƒendswithAôn  L âF  8dr “xpandtabst   Wize=8?\ ieE ? ¶2fino,gˆ Â!ÀerString):
   ô sub = sub.data
 ±return self ñ.find(sub, start, end)
0 °def format(0 ñ, /, *args, **kwds):(  \ X 9 
0 X C_map\ mappingS 4 . Q SindexL Ï !=0Ñ ß=_sys.maxsizec 	F qisalphah H 
( J ; ?num;  ( 
; Oscii; ( 	; decimal= * 
? 2igi ð d( 	; ¯identifier} - 	E ?low@ ( 	; numeric} * 	? ŸprintableA , 	C Ospac? ( 	; ?titz ( 	; ?upp3( ; Ajoiní _, seqð	* q= Bljus)s, width-G ‘__class__q ŒC 	= a 
S 5 )G DstrivŸchars=NonT B < Z �maketransu5tr. ¢†partitiocp ²./ pÀ DreplVÀ, old, new, Þwplit=-1W áif isinstance(. zUserStrm ÄPold =R ŽÛ
C l C Pnew =� 
C RÔ   b Î ` Œr¬@elf,Ù²ã
¾ ¾ 4‰ &rGª %G h ðjust(self, width³, *args):
  ñreturn self.__class__( ôdata.rjust(width= !)
> ádef rpartition3 _, sep] N 0 pI SstripE ¯chars=NoneL © B < )Z SsplitY 1sepW Q, max ?=-1d ° $ F(sep2 [ r !lfú \ > ] \ Slines½ ßkeepends=Fals¶ ; 5 ¶ £startswithY �prefix,  Ð=0, end=_sys.&/izl N 	H F 	v à,ßqwapcaseÌ Ë/s8 ,OtitlJ 5 	G rranslatK 7tt@ ®G_upperì 5 ¢ QzfillG !, Ü:< 6 à)
from _collecïs_abc import * __all__% òCallableGenericAlias
"""Conversion fun} ö2 between RGB and other color systems.

This modules provides two J ‰for each= P ABC:ÿ`rgb_toì ð(r, g, b) --> a, b, c
  abc" Crgb( " / Â

All inputsª "ut 0re  › ðof floats in the range [0.0...1.0]
(É PexcepƒQ of IT aQ, whiÄ  +ò a slightly largerQ B).
I‰ qoutsideP Rvalid! µ may cause f rs or in& o½ `.

Supû)ed8ó)s:
RGB: Red, Green, Blue components
YIQ: Luminance, Chro ’ (used by0 Psite ´øo signals)
HLS: Hue,C `SaturaC
HSV   p, ValueMð

# References:
# http://en.wikipedia.org/ O/YIQ# 0HLS�or_space/ )SV/ 
S = ["n“yiq","yiqY$", •hls","hls £äÀ  "rgb_to_hsð8v","hsv_to_rgb"]

# Some floating point constants

ONE_THIRD = 1.0/3.0
 SSIXTH u6.0
TWO( "2.( ð 
# YIQ: used by composite video signals (linear  ðbinations of RGB)D ò: perceived grey level (0.0 == black, 1 Pwhite7 ¡I, Q: coloZ @poneÒ °#
# There a  Q Äat many vers| 6theÂ òin these formulae.K a ones   is library3 sB @from? D FCCi  ä àNTSC.

def rgbšñyiq(r, g, b):
    y = 0.30*r + 0.59*g	 A11*b! i! ñ74*(r-y) - 0.27*(b-y)  q  #48   E '41  òreturn (y, i, q)� 0yiq� 5rgb � �# r = y +ƒA27*qŽ p41*i) / q74*0.41  27 8‰ 6# b: A74*q¬ /48: g: -` '30Ê 1Ê  |  
ó ¢ ñ0.9468822170900693*i˜ ñ6235565819861433*q8 f  Bñ478764629897834*i® ó63569107918738019 Ù ñ- 1.1085450346420322q #1.€ ²284064666*qª ¢if r < 0.0^ ò ¾ 10.0’ Lif g   ¦   b   �   0r >
` 1`    `   b@  `   =´
VñHLS: Hue, Luminance, Saturßa
# H: 2ion<äe spectrum
# Lº�lightness« sI :;hls:¥maxc = max T1min *in 0sum (8 +% ·Urange - @l = 4 &/2M   — D rcp0.0, l,î‰ `if l <ß5, Cs = s /_ + Oelse$ P(2.0-ˆ ¯ « rL E g g b b £=Hcƒ ‘h = bc-gcZ !el©& „2.0+rc-b* É  F ‚4.0+gc-r    �(h/6.0) %¸` gh?s¢4hls¢ 2@if s„
UƒlB lU ò m2 = l * (1.0+sT
~# c+s-(l*! ñ m1 = 2.0*l - m2_ ´ à(_v(m1, m2, h+>R8),   -( �- #ueê `hue =  +!if ð< ONE_SIXTH:
     ñ!   return m1 + (m2-m1)*hue*6.0
    if hue < 0.5:   6 2 $ žTWO_THIRD* ` (( U-hue)l V ð1


# HSV: Hue, Saturation, Value `: posi õ in the spectrum
# S: color s; ô  ("purity")
# V! òbrightness

def rgb_to_hsv(r, g, b)Í ¥maxc = max ý 1min *in v- c% 2if ( A cR IQ0.0,  v0 Ps = (r -7 0) /x K rn  r  ' ; g  g  b  b  lif r =¨ ‚h = bc-g„ oelif g& „2.0+rc-b* &seî  F ‚4.0+gc-r    ³(h/6.0) % 1u	rh, s, v™0hsv™Crgb( ™@if s‹ 60.0j B 0v,  �i = int(hpá) # XXX assume Á) truncates!1 f…. 1- i ñ p = v*(1.0 - s) q "*f t  3 2-f) ‹ !%6> Aif i¿ ½ It, p& 1& qã 
& 2& p& tL 3&  O 	& 4&  •  — À¾ qv, p, qL ð4# Cannot get here
"""Module/script to byte-compile all .py files to c ó.

When called as a F ówith arguments, this S s%ñdirectories
given@ 2 Ñ recursively;0 Q-l opf@prevV “ it from
,  ng?'o Z  ¢ hithout� &if‹  ß mð s on sys.path, Â <out] 8sub` @  (E¼  d  gh’ ðshould do so for
packages -- ð now, you'll haverAdealr  . òseparately.)

See § C py_IO ¡details of'hactualÃ°.é¤
import os
 %sy  „lib.util! m  dstruct  Pcmp

‰² functools N ‚ partial  X4lib óPath

__all__ = ["× e_dir",  c   F ""]‹P_walk/ P(dir,›ö levels, quiet=0š ò < 2 and isinstance: 0os.� CLike3  T°dir = os.fsv  + 7 f ET – prÖñ	'Listing {!r}...'.format> ? ðtry:
        namesñ = os.listdir(dir)
    except OSError:   Æif quiet < 2   Ðprint("Can't P Ñ {!r}".formatZ [  - ¡names = []Z  b.sort($ @for  1 in sl !if ö == '__pycache__'"  a �continue_   AfullR ð �path.join˜ ,Q y  +  b  ot'  is@ )h dyield  n ñelif (maxlevels > 0 andi ! !ƒ lcurdir $pa L  “  Ž @ 	® Tlink(’ )° ¨rom _walk_Ü %, ² =
 [ - 1,� “ 	 = á)

def compileb 8dir] ²None, ddir= ¾force=Falsel #rx& ^ £=0, legacy0 ÿ optimize=-1, workers=´  óinvalidation_modeW …*, strip� î gprepen° Ólimit_sl_destG @hard|b_dupes� ~ƒ"""Byte-À all modulesâñthe given directory tree.
Š ð Arguments (only% â is required):' Cdir:“ Q K 7o b~ T ß:ôñ imum recursion µõ (default `sys.get! þ 2()`3 y x Ãhat will be C`ed to (  \ ’ »    file as itè 5´d into eachÏ 0de + .@ Cˆ ‘if True,  ‰÷0, egòif timestamps are up-to-dat2jM  J` outpuÍ 1th ¦€ or 0, e!s —Owith+ )no> 2­ Áa ­ sproduceÝP pyc $ "òstead of PEP 3147 K þ : ! ˜ }$ofù Ôs  -1 1 ofE  v  œðinterpreter. Multipl™ ÌPleadsºm ¢K  �s²?one•  ¿¸ 1max‘`number÷ „parallelÞi ÏQ: how\Î@nessB  Ö  R�qcheckedI ýp:  part/  y ã Qleft-    f4Rsourcvƒ@ Û€9   D �beginningY �original¹C s, appliŒ …  Uafteršj ywÀ: ignore symx s ×1heyÑ0poig}HsideêÀ           tõhe defined path
    hardlink_dupes: � duplicat- �yc files2 1""" ñProcessPoolExecutor = None áif ddir is not ¼ and (strip œor prepen4 !):N  « ðraise ValueError(("Destination S (? P) cant ‚be used °  C  „"in combF Uwith £ 	— 1"))Œ Ú  ¥ ; =‘ 0  u Ý =  ² 8¶workers < 0Y þ '' õmust be greater or equal to 0'´ / F!= 1W ð # Check if this¯ÿ a system where è€can funcy.Ë ò
from concurrent.futures.p*  import _cr _e b_limitZ )6try�   . (Õ   Pexcep_ÁtImplemented
G þ 5= 1° Jelse& Â º  M ±if maxlevelB Y  =ZÑ.getrecursionþ Ï cñ	 = _walk_dir(dir, quiet= ,g =V 0sucŽe = Tru‚ö  ô~Â   ó .
µ T# If ? Ÿ== 0, letBhooss  ’5 ? !orÿ+"  dŠ  S(max_? = c) as e`T G •results =  ð.map(partial(compile_W,|  9   ’= �, force= C Zrx=rx»‚ rlegacy= y ”optimize=	 > qinvalidPm_mode= P =	 > 4= B ^™_sl_dest= H 
%= )K  †s«³Cmin(Î,£Pault=È1 
¨1forŽ1 in s!ifpþÀfile(file, dÿ	dir, force, rx, quiet,
  ÿlegacy, optimize, invalidation_modeE ”stripdir=	 �, prepend  J élimit_sl_dest= = ú hardlink_dupes= -):ñ success = False  sreturn  ñ

def compile_file(fullname, Ý CNonex=F  ~= ƒ/=0¹  v1 |?=-1,  �^ 4*, o i Ñ 	 	Q%  '” -ƒ"""Byte-P one !.
[ ôArguments (only â is required):,  R:  thF W to b_ T  U:´ ‘if given,2  directory ~”@d inH "th¿:  [ dm .^  _ dif Tru¼P õò, even if timestamps are up-to-datl ßM  Þ Â output withQá or 0, errors # æ)no> 2­ %a ­ ‚produce  ò pyc paths instead of PEP 3147 K b`:  int˜ @list-  ù p levels  -1L 1 ofE V  Ãðinterpreter. Multipl™ C Pleads™m DdK  Pbs each: d• ¿Q: howœnÓ!of   âwill be checke€ 9a:  par	 G ± Qleft-  ² from sourcDQÀ j:  9    ‘beginningbqriginal:. s, appliŒ R UafterÖj 	²À: ignore symés¥1heyŸQpointu outside¸  f  ¼qdefinedŽ [
:� duplicat. !ycÅ sš 2"""Û!if ö@not üa and (F9dir 'or t £ Àraise ValueE=’(("Destin§ S ()P) cant ‘be used "š  C  0"inæbF ‹£ 	— 2"))Û ! =,] "if[A < 2ç  is|8anc·os.PathLikeØ  '¾p= os.fstQ)_    P.base & ' d7Ð = None

    óif ddir is not None:
  ðdfile = os.path.join(/ �, name)
* �if stripG @full0 ”_parts =  t.split(_ Asep)R   S 5  5 	 œ 1 Tlist(k  ²  ` Pfor s‘ 0, o „ in zip(g 1 ,¬  ) E  û = "==F 
  # “ �.remove(v Š f*8 + �if prepen ° Í³+isÊŠ  ÎS ë …7elsE Î ³ ÷	isinstance(optimize, intI D = [ ][ò # Use set() to AÁ duplicates./& Rorted) °create pyc õ sÝòa deterministic orderA v B = sF  s  )Î õhardlink_dupes and lenÚ V) < 2óraise ValueError("H@ fing ofÉ ñ	d bytecode makes sense "ß  w `"only Æãmore than one ¶ Æation level"À /rx9åmo = rx.search5	Vif moÚ  � âreturn success°øif limit_sl_destn .ë isGi [ ‰if Path(H ±).resolve()§"in% Þ  †.parentsR ­ Ropt_cE= {}Â ¤   ¤  v > _ \u, ZegacyŒ  �  > |  ó_I ]i + 'c'ÿŒ I  ifòA ^ >= 0l  ' 0optÈ#pt* 7  1 _ * 's  :   ª ù = (importlib.util.cache_from_source(²  ; 	 ¯ s¦V=opt)k2 '‘ l  Ã ÿ 0 ? = À ¢ � !� Áhead, tail =)R[:-3]4U[-3:]* #if' z= '.py'¾ !ifíKforcZ $/trX   @mtim¶!in[6stað).st_mtime)
       ú,expect = struct.pack('<4sLL', importlib.util.MAGIC_NUMBER,
I  ð0, mtime & 0xFFFF_ )A ñfor cfile in opt_ ¿s.values():6  } ¡with open(3 ÿ, 'rb') as chandle;  ? „actual =. �.read(12§  2 3if >2!= ? c _breakÀ ?elsŸ íreturn successA ïexcept OSErrorƒ +pa9 Îif not quiet3 úprint('Compiling {!r}...'.format(fullname)>tryM  Óaindex,ÑPlevelÞÿenumerate(optimizeÞÐ! =>   s[I ] ›‘ok = py_cÁ #e. · ,d0, dko, TrueÑ   Œ ³ =Š @ ýinvalidation_mode= 
[ ×   1if Mþ > 0 and hardlink_dupes 5   ‚previousROÎ [[ O- 1]Y I 0if 6tcmp.cmpn
_ ï, shallow=FalsÙ N   Pos.unÄ M ù  )   1os.+ q 
; 	"PyÔe, /er3 k1 = ¿ d"if:_ >= 2sµlD ? ‚B*** « ÃŒ ,X` š', end=''= @ Ñ# escape non-3 @able#practersÈ=msg!Pencod­ Õ= sys.stdout. !or ¤getdefault („ Òmsg = err.msgC $e(0 , öors='backslashreplace').decod, [ Ò J(msg 7q(SyntaxP, UniN  m_º @|Àror compilinûg {!r}...'.format(fullname))
  ]else:  % þprint('*** ', end=''@ & àe.__class__.__k p__ + ':: 
5 q ¯if ok == 0� ñ success = False± sreturn  ñ&

def compile_path(skip_curdir=1, maxlevels=0, force=M ¡, quiet=0,W  ü  dlegacy( ¿optimize=-1,  òinvalidation_mode=None)Ñ ƒ"""Byte-¡ ð all module on sys.³ !.
ƒ °Arguments ((  w bonal): Ø °: if true,  ò current directory (default True‹	0:  ± recursion !4 01 -@: as7dVdir(), L0 P0 \ b- ]   …3 "-1� —9 !r_Ê z1""" U! =7 0forW& i¯Û -aif (nox ( b== os.Q) and¢�: > 3J < 2   cž'Skippingä—^Ê 
  ‹ ‡ú Þ  i  >dirß5  ç 5 é =  =  û=	 # î= 
5 %LMVmain(ÀpScript  ” program.0ò import argparse¨ 5r = .ÙP% %r(z1des] ñion='Utilities to supZ pinstall @Pyth«“ibraries. o c.add_aA�('-l', ac”ñ='store_const',  ö	:Ç…, dest=''G3  ³help="don't[Ae inÍ b™Bies"{· Är', type=int| §| Ð('control theâCimum‹ æ5. '€·  �'if `-l`½P`-r` xÿons are specified,I Qthen B ótakes precedence.'•f¾ í'dð',
               ð)help='force rebuild even if timestamps are up to date')
B ò%parser.add_argument('-q', action='count', dest='quie �fault=0,G  K  — ÿ output only error messages; -qq will suppress 'N ^ K'theF Ÿ as well.Ñ 
bÑ ¥store_trueÖ legacy'Ì Buse + ð (pre-PEP3147) compiled file loca<s“ 
ód', metavar='DESTDIR', hAddirŸ gONonež °('directoryäpprepend •  paths for Æ /ink# 'Õ -Cñ tracebacks and in run ³' '; ð in cases where Î0sou¸¤ iÿ  'unavailable')Ä	s`YSTRIPaQstripes/de}€part of h uQleft-e R from ,(o -±�example Ú_root.½A`-d`ªq`-s` op�¯ cannot beA €specifieBgether.pppyPREPENDr’t: thl0add`prefix …m+/H ?mak+°it absoluteÙqn some ¯is removedr7by ­äpäSxäaREGEXP¥ r 3Askip2¡s matching¡regular exOion;> Lðregexp is search‘ or­  Ofull‡qof each� “ considerN ái-EFILE+_flistn!('×!ll  Ðs and directoÿries listed in '
  
Á'FILE to the7 ÿ considered for compilation;N ñif "-", names are read from stdin'))’ òparser.add_argument('l ñe_dest', metavar=¤ P|DIR'Y �rgs='*',G Ü óhelp=('zero or more file and directory£  #to”e; if no ° ÿs given, defaultshÿ
equivalent of -l sys.path
õ-j', '--workers'y /=1¡type=int, D'RunÐ 0allí¢currently'šqinvalidò _modes = [	 .Öñ.lower().replace('_— > ‘ I B  ’3py_èW.PycIn QMode]×(--› -P ø choices=sorted(; Ö )5+¸('set .pyc =  x ;ô/to÷à"checked-hash"G nÿSOURCE_DATE_EPOCHI penviron.ñ variable is set,ßÏÿ"timestamp" otherwise.x`o', ac¶='append', Y ®Ï='opt_levels•YqOptimizc 5  ƒrœ _with.D Ñ-1 which usesÓok Q !of; ÿPython interpreter itself (see -O)8eÄ¿,ƒlimit_sléó9/@'IgnÃð
symlinks pointing outsiteD P b Ã?@hardC P-dupe@Õ¯store_true¼» D _D ¼ Hs € duplica– R �As')
? 0argd¶   "s(Î .- (  / . F  ifšQs.rx:V  Q•import re = trx = reE ( � I 	¦f == ""Z 3 " [ None� `ecursiGQs not# F 3maxÿ=½ 0 ± Oelse- > À

    if argós.opt_levels is None:
  9arg! q= [-1]
  {if len(# ±) == 1 and  æhardlink_dupesZ óparser.error(("H' ñing of duplicated bytecode makes sense "‚ ¥  ñ"only for more than one optimization í E."))È ª @ddir1notÄ (i $ \strip( "orë lprepenG A )ù p"-d cans òbe used in combin­ ãwith -s or -p"³  # if flist± ñprovided then load itw "ifš + ƒ 6try  >e  (sys.stdin^ ï 8 ¡=='-' elseT  0  $op. ú
, encoding="utf-8")) as fr  B  §@lineó    # ðcompile_dests.ap`(4 .Š5())”  except OSES
n šquiet < 2  j qprint("= @ reaÂ a file g¢{}".formatñì ~  C �return Fa+˜ x qinvalidÒG_modb1ivl " =«+ ö
.replace('-', '_').upper(û 4 c = py_=W.PycI� TMode[w ]¨  ÝO  /Òsuccess = Tru	P ifÀ¶X  $ ô Í ô  Ý
'  + Ðif os.path.isŠ(9 J %  0if ES / ,V • Sforce 1rx, F  	A= olegacyA W= M ÿAdir=—  @ ¬B  D UeB GB �limit_slG 	 J 
gK 
 9 óÓ¼   
 w1dir¥Q, maxgs-�lÔ¨È€H §ð	 workers=args.workers,
   ýinvalidation_mode= /,
J ô  stripdir=args. ? uprependA  C ‚optimize‚ ¯opt_levelsA Òlimit_sl_destF 	 I âhardlink_dupesJ 
 /):Xù success = False( sreturn #  JelseQ ) òcompile_path(legacyŽ  c, forc1 ã Cquie 2 Tf)Ë ö	except KeyboardInterruptÛ 1if _z F < 2  §´print("\n[i< Bed]"^  ! Y òTrue


if __name__ == '__main__'g  ex@tatuž k @not # "()d @sys.& ( !_s+ ð>)
# This directory is a Python package.
# Copyright 2009 Brian Quinlan. All R  s Reserved5 ð,Licensed to PSF under a Contributor Agreement.

"""Execute !utþðs asynchronously using threads or pro—ðes."""

__author*) '« 0 (bº ð@sweetapp.com)'

from concurrŒ ÿfutures._base import (FIRST_COMPLETED_ Ø"  7 ŸEXCEPTION7 ?ALLl ïCancelledErrork Timeout4 I¡_State9 bBrokené£ F’Ñ ^ Owait\ 0as_žaleted)n!llk(*'ï&'X   	æ 
Æ ¦ 
M -   í  Í  POLPool; Tu `)


de cdir__(AÀð__all__ + ('__aut÷Dhor__', '__doc__')


def __getattr__(name):
    global ProcessPoolExecutor, ThreadP 
4 0if B _ == '9  'Z  ^ rfrom .p]  importl a as pe]  7 U  ( =! `return 4 ‘ Tµ � t# � 1  Ž tŽ !  '=   � "teðraise AttributeError(f"module {__<°__} has no ”*   { ð}")
# Copyright 2009 Brian Quinlan. All R òs Reserved.
# Licensed to PSF under a Con� ñor Agreement.

__aut1I = 'd 0 (bs ó@sweetapp.com)'

Ã´collections tlogging d 5ime ðypes

FIRST_COMPLETED…  '$ –EXCEPTION$  Z'
ALLF 	 Z'
_AS  	 ô$'

# Possible future states (for internal use by th' ðs package).
PENDING¡  c'
RUNN  U'
# T@ ä was cancelled\ ò user...
CANCELL  B õ...and _Waiter.add_F #()V S ‡a workerQ »_AND_NOTIFI^ 	  ~BNISH$ "FI ñ'

_FUTURE_STATES = [‡ø , ñ  ¾  	o  g B
]

a ¡_TO_DESCRI�_MAP = {f s ²: "pending"F ~ v: "runn ‰ 5: "34  	– )  £ à: "finished"
}GLogger 6³.
LOGGER = >B.getD �("concurr«•²s")

class UPExcep…Ì‚"""Base $  … 3allÒ¤-related e5 Qs."""EDpassZ CŽc  ¾_  »F"	»K TimeoutI Popera¿ ”  ed¹ÿhe given deadlineZ €InvalidS¥_ ihòt allowed in thisä` Yv(objectÿ �Providesðevent that wait() ”õas_completed() block ong ‹³init__(self^  ÷  .W %= A .Ei !()«' yð_futures = []

 ó   def add_result(self, future):
    ¢.finished_ ’s.append( !)
. P ŸexceptionS 7ŸcancelledS +òclass _AsCompletedWaiter(_ ÷ ô """Used by as_c, f()."""ì �__init__” ;  50supS f  , L%).8 )73 ûelf.lock = threading.Lock(]­Awithf M Åd — × 7   ¼ ¬.event.set— ôš -a � >� -a � ˆ_First‹ûwait(return_when=FIRST_COMPLETEDžÏ »Ú').* ¿  : õ(
b Áe \ ( Ç - Ê …?Allƒ-ÿEXCEPTION and ALL•ûÌ @num_Hõing_calls, stop_on_/Y &4 = =  
YT . =h 
3 Œ<Ñ §ª_decrementÝ (v
ë E-= 1©  Œ bif notó
  /  wÐ\Í* eÿ # sâÙ- t "ifþ å
þ ðself.event.set()#
  Uelse:   ñself._decrement_pending_calls()
- ðdef add_cancelled(7 –, future)R Šsuper().- ' K t ñ class _AcquireFf ƒs(objectn ò"""A context manager that does an ordered aF B of J  7 ¶ditions."""ã ‰__init__Þ sq ¹ Î ³s = sorted( ‡, key=id4s__enterR I 3for=@ in M.F L q  R._con² .Î šG__ex· H*argµ l 'preleasel  ó_create_and_install_waiters(fs, return_whenë (if ö == _AS_COMPLETEDì G    ±sCompletedW\ !()8.elM _FIRSTO _FirstR ø@ountÜ1um(y  ‡ Àf._state not¹ñ[CANCELLED_AND_NOTIFIED, FINISHED] ~ , #fs M Ì –EXCEPTION / ,llÎ 	º ð , stop_on_excepåR=TrueE L I?ALLG / { +IFals| s _ ó
raise ValueError("Invalid9¬s: %r" % f»c7$f.œ0.ap#(Ê …¬  1


àò yield_finished_}Ü)  äif_coll‰(@Iterñon the list *fs*, W Ding Z û�s one by !inF rreverse½. fBeforeF a? 2, *– ó* is removed from itsÛ sC 1and• Ò / qeach seÓ ¼ á 0ion52setF 5*reý "*.|pThe aim( �this funcu d Ðto avoid keep  3 e referenc¦After¢  w ž 2 »Bnd bÿ  !  kÂator resumes  Ã K‡while fs‘ = fs[-1]d  % ,P_ò Ö ; , ( ._&(fHgwith f›= €< ­A Udel f™ ‘# Careful\!to5& a.1 toÄ€popped v3> 1p fs.pop¯ð 
def as_completðTed(fs, timeout=None):
    """An iterator over the given futures that yields each as it completes.

M BArgsW   ófs: The sequence of FQ ñ(possibly created by different Executors) to¨  Q   ª e© . Ù p àmaximum numberv ðseconds to wait. If ,ë n %reL f Ás no limit o! 9 A.ì gReturnï Gt0Ný  ass $y ?Õ (finished orˆ ¡cancelled)° 3any•G �re duplicAÌ ±y will be rŸ %edO Donce» Gaiseº T`Error: ³ Öentire result!�could note 0gen8f  =`beforeã ± ž¯1"""” !ifNPout int’>@end_9 % =( +
 Â.monotonic()‹Áfs = set(fs)\ dtotal_½U= len Ówith _AcquireK  z �U R  Ø  Ýf for f in fs °if f._state" ò[CANCELLED_AND_NOTIFIED, FINISHED]³  ] ô pending = fs - ˆ c  ¼ber = _5Ò_and_install_ sèÒ_AS_COMPLETED` M u = listr 6try èq from _ _= S> ,5er,¤  È  Àref_collect=¯ )Ç 7 cwhile 	“   
1 ¿
   $  6 W=R	š Oelse6 z-p e  !ift >< 0`  1 rt j(š  $  µ'%d (of %d)†$un‰O' % @  óG9), p s  5�er.event. ( Ó �-  ?   ~er.lockî ¤ ! =4er. ?ù P ( _ = []- ¯ Tclear     �# reverseñCkeepK \Forded . v .5 (    H d ªgfinall£ƒ# RemovebŸ 2Àres
        çfor f in fs:
  úwith f._condition  * òf._waiters.remove( Ð)

DoneAndNot
 ðFutures = collecO Õs.namedtuple(z '/ 9 Ð', 'done not_	 p')
def o ò(fs, timeout=None, return_when=ALL_COMPLETED)Ä €"""Wait ü Sthe fŸ 0in  ñgiven sequence to complete.
© 7Arg-vfs: The1 4of ñ ñ(possibly created by different Executors) to[  W   Ú e upon. ä m ðmaximum number of seªs¯  = R. If 1theÙ %reL  c Ñis no limit o! PLv LÀ: Indicates \‘ this funÐs should}.!opê	w Bare:G …   VFIRST¥A - RÁe 3any¡ù  finishes or isV  H 
 –cancelledÌ  ! m ŸEXCEPTIONm ßby raising anu Aexceô $noº  A ees an " J µÐit is equival19to Ñ
Ü 	 J -  I#ll� sJ HGare +– ã!A ¬1 2-¯o"tså£first set,& «°', containsUX  €lEthatX0d (Jßd— “ €) beforeE  J •d‡  	ˆ .Œ %un8 J ” a. Duplá)€to *fs* -êåd and will be J .Âed only once¢1"""$ fqset(fs) fƒ_Acquire6  © 1 ïQ = {f¯«<     if¯PstateÐõ[CANCELLED_AND_NOTIFIED, FINISHED]}F )€ = fs - t  Bif (Ø RB == EW 5 ·  ™ 6  Ó(/ ,Ñ 5 /elq ¶)q wif any(+ f Ê  _   if{ 5 f.i(U %f.¢ ()~1notH<@  à † aif len )M  +fs_ [ # ùber = _oÄ_and_install«ð (fs, return_wheðn)

    waiter.event. ‘(timeout) Áfor f in fs: 4 öith f._condition   0f._I ²ers.remove( r ¤done.updat ò.finished_futures| ðreturn DoneAndNot
 F" (F p, fs -  ’)

class   ‚(object)™ ð$"""Represents the result of an asynchronous computaÖ B."""%ódef __init__(selfY  î Ò"""Initialize^ Æ ð. Should not be called by cliŠ `  C    V Rä = threading.Ch(0 õ state = PENDING¢N æ k= None Pexcepæ   ²ks = []:  o_Í Cback" # &finvoke  / Q=  Xª 
T ¶ æ   :try   C _      Ú $ Eá = rLOGGER.) Uion(' ¦1ing  á  ± P%r', ª ÃNreprw , Î
ƒ !ifL #._¾ª= FINISHED(  Í , ¢ $  ( r,Á'<%s at %#x ^ ù=%s raised %s>' % (- <  µ _HÏ__.__name__,1 "id" ò_STATE_TO_DESCRIPTION_MAP[m ¤ ]@ & ü -._ž Ç Oelse% A'ªï$+!Š»
jbcancelkÙA"""C ÑsÒ if possible.» RÜ`s True#  1 Bwas ` ò	led, False otherwise. A ) 5canÐ —  ÓÐif it is runn=�or has alÂyTeleted.G  [ ›   2Åin [RUNNING,<] U   êÕ ð

            ifõ self._state in [CANCELLED,  û_AND_NOTIFIED]:
  Éreturn True
 ] =P $  öcondition.notify_all()N J õinvoke_callbacks()K „ àdef cancelled(@ )º F"""Rµ ö if the future was: E."""e Cwith2± U  ‡  o Vë  µ running³ ÿis currently executing¼ /¦== RUNNING  Odone� oPÏ or finishedª 9¼¶, FINISHED]Ð Ì__get_resultØ #ifïPexcep 
ï:try Laise8 D " ofinall;  ñ# Break a reference cycle { ¥Š  ¯h 	e  i    u = None Jelseµ 	µ	@add_óv$J, fnP°Attaches a  ñable that will be xed whenn"s.s  ¶ JArgs¢ Qfn: AB X  œDthisÇµas its onlyü  ^   �argumentŽ �completes¨ VBB. ThÄ  ‚ Q å galwaysì °by a thread® ¿Àsame process ]whichO !it†‰added. IO`has alT $y ¯ d¯ MbeenJ  tyŸµ š±immediatelyî s4 4  ; Bs areÚ Rorderó¢they were Â – M~Ÿ0not2£ç
G Ã  .Ò¶s.append(fnQ ,   Â ò!fn9 Ž/ E2rLOGGER.% Uion(' à1ing  à‘ for %r',M#­ , timeout=å
“ã wÖ ™Àe call that ó
the future represents.

  UArgs:   ðtimeout: The number of seconds to wait for ] ‘result if k 	P  T ðisn't done. If None,0 n ñre is no limit o e  Œ ­ kReturn°  § … o… �call that^ þ 
[RaiseP ð CancelledError:°  è Ú d was c" .é T97 0didñfinish executing before¨ YgivenQ  : :outj •Exceptionž ó rÎ dM  CDat e( ’ will be # N 5"""s :try
°with self._üir /  ž   i $ õstate in [CANCELLED,  ê_AND_NOTIFIED]i  G   ž  �-()r +elt ¿== FINISHEDY 9Ì R_get_2&()
 �   ñ .î(‡/  ‹ ÿ � ò  OelseD ^ å›kfinall@ñ# Break a reference cycle Z V¢#inŸ 	ø –! =:³6defà( #, ¦=`)Æ 2""": 5 1 by C64.ã 7	ê  Žm7$O  G˜ Šd2 or™ »  V‘completedù1out{8ing•  _‹› =lÓ ‡-*4›%
À elif self._ûstate == FINISHED:
  ùreturn self._exception
(  Pcondi ê.wait(timeout)+ #ifK { õ in [CANCELLED,  ï_AND_NOTIFIED]–  ùaise CancelledError()• +ell ç !OelseŠ Tí ˆ ‰ ð8# The following methods should only be used by Executors and in tests.
ƒ  de7ñt_running_or_notify_c(‚)� �"""Mark t� “uture as >   or procesk "y C  Q 0icaÂ&s.¶S¯ ¢ implement: ¾ DunitÀ  Å (If� ƒhas been Rled (Š �() was caÚO „%edK PTrue)N àn any threads x j on " fú  co¢ t q(though\ sN cto as_' @ed()" L s()) are!ed� ”False is – ,
ã  Æ 7notâ pthen it> 1putå%he˜– (¿ talls to'  3ill   3 
  Z ˜  CThis€!be
|Íebefore” e¤ J Zðwork associated with tk » !. { š yKP  82be q 'eddR‘sí \J ibFø RAled,)¨ otherwiseQ  LP 0RunÀÐ!: X Ç  Y  als =¦ or% «set_resultŒ £ 0or   C Èçç ' 5"""oQ Û%._]
ø ãC
)  [ J f/ =l|  1   1forX er¯C  +er3 -    C.add�2led \ #Ý .…py_all()Ì  ne« ar.Fcaus� o   H íÓ() triggers a»Öe 5   ‘ >	ž =PENDINGXyRUNNINGO l  ¦	 WóLOGGER.critical('Õ %s‡punexpecuÏi: %s',W  s  ðid(self),
         Üself._state)
% ñraise RuntimeError('Future in unexpected @ 1')
B ð def set_result(b ",  !):"  h ð"""Sets the return value of work associa_ Awith) f} .h  F ø0Should only be used by Executor implementations and unit tests.Ž  n  ¶ p._condi: ¸  v iá 8 Å{CANCELLED,  °_AND_NOTIFI šFINISHED}M  Q i€InvalidS�nò {}: {!r}'.formaN° , ¥ )·  .{# =wÛ  l " ²4 = • 	#  for waiterÜ 1  s¼  C.addw ò– NÆ.notify_all() h ûinvoke_callbacks(VPexcep“g %,  \ † V jA‘ as beingUVgivenH ^ÿs& =7	AËdB}  >Ûg*ñ__class_getitem__ =  ñmethod(types.GenericAlias)

! us(object��"""This i}â abstract baseY  nóconcrete asynchronous eÇRs."""õ]Bubmið, fn, /, *args, **kw
 }   i1 @s a Wpable to0a 1ed ô !@argu6srchedule³I las fn(Ž xæs)%a Lôstance represent›  4ionÀw ˜ R=™A\ S á  H .Š  ^ +  ‹DNotI;"ed�‰1map** V0s, *úout=None, chunksize=1’µ A an =  ¬ equivalentž c  Ü  )ï ;Argì Wfn: AÚðhat will take as manûy arguments as there are
  ùpassed iterables." ð)timeout: The maximum number of seconds to wait. If None,q n r  Ñis no limit o% =  l 
~ ’chunksize€  
  v Bthe   b » ù will be broken intoÍ  ú Óbefore being ü õ	to a child process. ThisC� is onlyN u;Bby P7 ðPoolExecutor; it8 žignored b> hThread5 %.
c …Returns:  ¾ "Anî õtor equivalent to: map(func, *ÌQ) but$Šcalls ma… ø
be evaluated out-of-orderˆ Kaise‡ T`Error:ô ’Öentire result§ �could notšPgenern 	Ö  Ú ˜ I QgivenIout.* ‘Exceptionv ±fn(*args) r¥ � for any Ô Ê5"""G $if[  ž ˜  ±
g@end_Ž% =, +
 Æ.monotonic()«ófs = [self.submit(fn, › ” ·rgs in zip(ž]C ±# Yield mus)AhiddÃò  closure so thaÎ`future "e r 5tedâ '# MGfirsŽ ù r?6red`3def½_AZtor():try  º�# reverse°keep finishaM™  .   3fs.3 -() {while fr 7   ‘# CarefulR1to q ¡a referenc…  Erpopped *e  K 
	 $  y�’fs.pop().ä½   0 Nelse&    J q-g
"ofinall†  gí  i?" w.cancelÀ rmÿ¡ �shutdown(ç,±¢=True, *, P _^ ws=False;±"""Clean-up�presourcÁPssociQ with A„IJ1safß Ì  t €method s€!al;@s. OíPwise,ho 2 s²  � K ‚ed afterS 7oney ;Arg‰ ç} ý  ° $n € ROõuntil all running‡  
  2S have7Aed eC @0andd  ™2r.thËÀexecutor hav÷e been reclaimed.
  òcancel_futures: If True then shutdown will + É all pendingJ  U G 2. FP ò that are completed or runningW mnot beK n l° 5"""' Qpass
 ñdef __enter__(self):  ‘ preturn  	. 3xit- ¢, exc_type
 2val	 'tbH  A .`(wait=')i óFalse


class BrokenExecutor(RuntimeError\ Ó €Raised wv3a e2 ò" has become non-functional after a severe failureÜ U ð# Copyright 2009 Brian Quinlan. All R €s Reservip# LicenŠ ¡to PSF undg pContribÇ ð Agreement.

"""IÙ  Ôs ProcessPoolõ Ð.

The followôñ	diagram and text describsð data-flow through‰Ï system:

|= R In-p}  " §|== Out-of( U|

+- +0    " - 3 1+
|E  ô|  => | Work Ids    0| CSQ5  |H+ |P  � -} #  G 	 � # 0|  ’ ! P P| ...{ H …   	 " k a ð  c   6;   ?    ²5, call() |   ð 5| 7 	 X   	    ! 
L¼  . ( t| Localß @Ø  LP . ç  ó#er"  ‰ 	 ‘|  #1..n P ).  — oThread" È P k    "- ¢  ©  - " !      #  1| <Í Ý P ItemÒ    ©  <= €Result Q '<=· Ðo0 ‰    ‡ D| 6:^J G ð !   ð P 2   × Ï  	 b| 4, ró K     P pP 3�>ept  ¬� È À------+     &+- V+     ðJ+

Executor.submit() called:
- creates a uniquely numbered _WorkItem and adds it to the " ñ  Items" dict
- # ‘the id of' D 
8 ñds" queue

Local worker threaš   s ‘ ids fromR "y A  � �looks up" ðcorresponding
  1  © D ½ 2: i°  ‡   iô àhas been cance0 ] 0n
 öis simply removed\  ³, otherwise. ñrepackaged as a
  _Call—  Á `put inb   " † Q". New' os are (  …
  until9 ñ  is full. NOTE:U Dsize”a  ( ñkept small because
 Œs placed–  Ð no longer be  Âwith Future.6b().
- Ëp_Resultó Ï" � Q", upd‰ ?fC @ sto‡.
 sû@deleÂ 9  |ð entry

Process #1..në†  ^„   ‚ e'!es0 "!s,a 2put rÀ T	Í 6in Ë ð
"""

__author__ = 'Brian Quinlan (b ñ@sweetapp.com)'

import os
ì²concurrent.#s " T_base/ E bmultipù 0ingk$mp*  ².connectionq   Z u Q­h ¦ 
 rweakrefI …functool< tpartial‰ Aiter   4sys Òtraceback


_g Ãs_wakeups = h ¡.WeakKeyDiÀ ñary()
_global_shutdown = False


class _T]WN  :
(òdef __init__(self)     …._closedL       SBer,   wrÚ ñ = mp.Pipe(duplex=† %)
q S n cif notJ " d‹ r  ` = Tru«   „ .' !()s   [ ³ ! "  d– $ú ù .send_bytes(b""ò ?ear\ Zwhile· Wpoll(¤Ü Crecv‡ @)


Þ  _python_ex Y/ 7 q  Œ\list(¤. "(){cfor _,ÕÇ Q% †  Â #r Óprotected by ÃEPoolÄßÀ_lock
      ò  thread_wakeup. ñ
()
    for t, _ in items:   ñt.join()

# Register0 ð`_python_exit()` to be called just before A óing all
# non-daemon’ ðs. This is used instead of `at^ #.ry  g ú4for
# compatibility with subinterpreters, which no longer support d~ ñ
# See bpo-39812Þ ’context.
6Ting._† _– ( ðControls how many m  ðs than processes will0Aqueuõ 2 th>  €.
# A smO‚r number5 0mea;'atN Rspendn àtime idle waitx2@work€le a lar	W ò ake Future.cancel() succeed less frequently
# (+ s3
º ` cannoþ 
  ceö0).
EXTRA_QUEUED_CALLS = 1


# On Windows, WaitForMultipleObject!to× ¤M�to finish6 Itx ' òon, at most, 63 oO  r0eresƒan overhr4two% Q:
# -–bresult˜ Eeƒ   O ð_MAX_WINDOWS_WORKERî `63 - 2ò @Hack1ðembed stringificationúÐremote traceb- †in local ¡

class _R, T+ `(ExcepI )Çódef __init__(self, tb  ã  �.tb = tbø1 3str0 , sreturn 3 ƒ s EWithŠ  ;exc„  Ã ”.format_eÊ Ä(type(exc), = «  À < "''©"tbÓ  ¦ Pexc =5 0  5 ú \n"""\n%s"""' %oreduce€_rebuild¦ !, Y.œ ` 1)

I'  Â ù þ exc.__cause__ =ÊÍ v5excr’WorkItem(Ó£q 
ëfÓ0, f³rgs, kwargs2 (( 2 = 	 
. fn n  F 0 =  
 a # =j ´ RH¶  ®1_idîÍr=None, Œ Â 4 3 = 
 
– MV 
# ] # =f ¹ OCall· n¢ ¬ p,À_SafeQueue(Qðueue):
    """Safe Q ð set exception to the future object linked �a job"""H ñ:def __init__(self, max_size=0, *, ctx, pending_work_items, shutdown_lock,N  š  Óthread_wakeup·    f .Q / =f  V 5 	r * =‚ 
+ 	} 9 =  + uuper().ü ÷ a=ctx)
- '@on_qoÓ_feeder_error5 e,iæ ÷if isinstance(obj, _CallItem'   tb¡ õraceback.format_Ðô(type(e), e, e.__t+ 1__)ž  E     ôcause__ = _RemoteT. ó ('\n"""\n{}"""'h Ú(''.join(tb))O í k?elfµ @.popÝ ., {d, NoneG Nith ÀÈ ·  $ 	©.=(Q "# n ¡tem can bev ù if another process terminated. In this2q# case,0òexecutor_manager_‹ ¦ fails allw E wã rBrokenPz IPoolj &if? q is not¶ Ý .Â8.se^Jelse@ sÑ¬¦1


Ñòget_chunks(*iterables,  'izl  I õtes over zip()ed 5 3 in7 .›ú Ait =* \ È—while Tru½ t  Puple(X °tools.islic — G  7!ifI> 

areturn‰  ) Ryield£ þ $3(fnb �C""" ÌBes a;   oc÷ R passUBmap.+ARunsPAfunc�	& X() onP 1the¦  ô  �U UThis Q `is runt¤a separateó† àð [fn(*args) for 
  ? 8]@send‚‚_result( ô,¾2d,  =é,v < �0ly S  T Sgiven@ 6 or= ® 6tryÆh  q.put(_R˜  B(%Ž - ,J ð 
[=
 û e BaseEP7as ª0exc] FWithd£	¤ Ñ ƒ 0ion� à))


def _procôess_worker(call_queue, result Ðinitializer,  ð	args):
    """Evaluates C as from @ ó  and places the\ Cs in ' !.
P RThis ’ p is run) óa separate process/ BArgs‰  �  € N �: A ctx.QÐ Ð of _CallItem… �at will bŽ  ad¢ }  D   eÒ Ad by´ ‘ .%  k R>m uwrittenD  i /tob  gta qallable •, or NoneS  5  œ 2 Ptupleú   A forÉ  " ? 6 1""" (ifZ  z1not] ^6try  ¾ M  (*  k )P   Áexcept BaseE :ionA õ_base.LOGGER.critical('.  û X ² ö:', exc_info=Truel  p ³# The parenà±notice thatþ <~ stoppeøb# mark+ ‹ool brok²RreturÅ`while ˆ Ö ‚gitem =«.get(block· "if& 2 +isqÕ �Wake up ›€ managemã ethreado . ˜p.put(os| Zpid()-È  9 ÜrÁ  › U.fn(*Û .ç7, *  kw b ûV as e* v uexc = _ðôWithTraceback(e, e.__t &__a  > P_send* _÷ ( ,Y.¾1_id=¦eption=excM ;els™ [ | &=rV  £ Rdel rÙ  a# LibeÇ
Pource@soon õpossible, to avoid holding ontoîÀ# open filesÀshared memor´$atÅAneedìFymor, › Ó€


classŒqecutorMh!rTd(kBing. ý(  U°e communicac  between tÒz  û  “$erÍeÏ Áâr¿ þblocal † ú"ex·  úpreferenùoÌP3SPoolE( EownsR ¡¬ g ¥ A weakref-4own°¦ šas well aI „ sÈóinternal objects used brospec  stâ+of” $e ß .  µ	 `def __"p__(selfã	¢ Õ „# Store ” Àes to necessóary internals of the executor.

  ð# A _ThreadWakeup to allow waking  ñhe queue_manager_t2 P fromZ O Rmain Q ð and avoid deadlocks caused by permanently  "ede %s.O Rself.l "_wŸ =Æ _Ð — + 
F �shutdown_k  F 	 
°weakref.ref DÃProcessPoolEOà that owns thi  Oe. Used… #A ²determine i’N ù	has been garbage collectM  [w  ” –§ can exit.v @When£ -^ gets\ ,% ñ — callbackI @wille | Rment ©2 so!it‘ ò 7ateL þ Ðre is no pendk–work itemÁ Cdef • e_cb(_,F Á } û=99 	ÿ9 	 )):s õ mp.util.debug('¥�: triggerÒ HY for'H ¸  0' Q`M_gIup')2 Ywith › 
š  J 	.3&()Õ
Ä_reference =e ë(! , 7_cbE  4DlistWCctx.É± instances ç0as Õ,erÕpG)es‹ ²  m  a  YŠ¡be filled ñ_CallItems derived�Ar# _Work" Cfor k  ¥!byü ±  Ê_	²  ³ bSimple¹ ¢of _Resultƒ rgenerat
 Ä~ r; €   
‚ ¬ .~  ‡’ ids e.g.nÖ([5, 6, ...])s$ / O_idss   
o �dict mappR # m (tox { ’ ±U{5: <›~...>, 6 E...}: ¡ 4_k _4JS ¯ ôsuper().__init__! l@run(` ö0# MÔ@loopÇ,"ÿrüYªwhile True¦ ] Q.add_: ¹ 2_tofˆ    Ü $ Â, is_broken,C1 = K Rwait_* À_broken_or_w§akeup()

  Ùif is_broken:  % ãself.terminate' }(cause)- ireturn ÿif result_item is not Nonel ‡process_6 ( u ù# Delete reference tou öto avoid keeping* s¬  ð À# while wait+ con newO -s.0 3del á 
[Q pattempt– ó increment idle ì m count[ ±executor = † _é (4if ( m œ *  ._� ÿ
_worker_semaphore.releaseg   ÷ > 
ô "if® pis_shutE_down()ñTflag_L 4 
\  ´ @# Siä0no ™ ´  [ðs can be added, it 1saf ‹  † eð# this thread if there are no pendf !ifÓ£0 Jsõ  Å - Fjoinù Ÿinternalsn  3 r\Á 0defç Q_callg  _to_queue(Z j`# Fill"ll" ô with _WorkItems fromé ¹ é 0# T#afuncti—ver block7;TruÙ¬ ¤ _.fullã  î  >tryB Ž4_id sà Q.get(� L=Fal¦rexcept ˆ OEmpt_  ‡  ;els×  ¡ y  ×¢ÿ[$ .d]É2if  ÿtem.future.set_running_or_notify_cance2 †  ò.^�put(_Callß(c !d,8 /  ; ž n@ +OargsB + kwD )E  �$Î  ×PÊ	 )  ‚continueç   AÅ] Òwƒ d 	¦£Wait for aN .0be –@y in— ç§…checkingß Ðaat all^àer processes aóre still running, or for a wake up
  ô# signal send. The#  øs come either from new tasks beingL ’ubmitted,* Âthe executor- Ð shutdown/gc-(  š  U 8theI & @ of E õpython interpreter.. óresult_reader = self. cqueue. 2 ¢assert not-  th= _¥up._closed.  D ` 3  @ %er3  Ss = [‰  ,]#upM ]1 ñ worker_sentinel: $p. ¼¡p in list(á öprocesses.values())O  n ðy = mp.connection.wait( lers + t %)
� ¶cause = Non–ö is_broken = Tru ã Mitem4 #f  x  Ä  
 %y:l  ‰+tr   9 W   = ™er.recv()D  3 £ FFals¤   Áexcept BaseE Šion as e�  + òtraceback.format_D õion(type(e), e, e.__+ '__JJelifõ» Þ Bwith©sZ_lock¶ 
–gclear(� dreturn’ Y%, x !, õ Cdef b_z / {,A )† 2# P”²¨received a/  b…is can bU á0PIDìaõ # à that exited g�PfullyÒAa _RüBItem¸  ¼çif isinstance(¾ ,@±  - u# Clean—… { Õusing its PIDš 7 À(avoids mark&  Å ë(
 u¨0is_ËPting_Ëpfƒhes.popË 
[ kp.joinE &ifáH ® Æ   �  ? _¾ _fKnalsR  / C;els>6# Rú 1 so,`future|–completedÐ g  œ_r
0end. . !d,¶
!MQ | Ûq if anoÚ#€ terminanª(see aboveN  Ò2orkO !isg O ]iÿ Ì .=* 	õ . 8.seqÊJ š À         elsOe:
   òwork_item.future.set_result(   !)
E ödef is_shutting_down(self)e ô# Check whether we should start =  = á the executor.d  ¬  0 = ^ . Å_reference()-  # No more Ô  Ô øs can be added ifŸ û  - The interpreter is˜ 'OR` 2 ‡ ñ  that owns thisx ÿer has been collected G * * %ñ return (_global‰ " 5 orF Ì ENoneÀ  Q  $ .: w_threadàò terminate_brokeày, causeçT) 	Å1 be+ 0 itŠ Rin a I   1te.|# ¢ ¤# argument¸ò used to displayßâinformation onv Arror�M Blead Y ëo™ Soming� .Ó a# Mark3 Ãprocess pool) 1 sob ö submits fail right nowž¶)if²@not ¶© ™ R .ŒÔ = ('A child « ±5d ' >  ®'abruptly,ï 0is ‡ E  usable anyx'Œ s µ Áej = Tru™- ! =ÿ ”€All pend³�tasks are‘be markedŠqed withÏ •following1# BÆPØP×e5" ^bpe =& 5("AbimqUwas "E  ø  "�zb while° { L @runn$or&."{"if¤ v ÇNabpe.__{ý__ = _RemoteTraceback(Ï ñf"\n'''\n{''.join(> c)}'''"4 ÷ A®*5ed.X 1for-C_id,	 btem inç@ _È~!s.Î(x o   ¼PexcepF(bpe 0 •# Delete ?sHõobject. See issue16284­  : 6del¨  ”­  iclear(%QremaiÀ ¿ Ñers forcibly:`queuesÊUtheirm °# locks mayÒQRdirtyP` and b#  P ðever.
        for p÷ in self.processes.values():
  åp.terminate()
 õ# clean up resources Y ôjoin_executor_internalsE †def flag# àshutting_down(D ‹ ´# Flag the T D as 4  4 õ and cancel remaining tasks ifž °# requestedC Pearly	 õpossible if it is not gc-ed yet.A � =C �_referenc*C4if   S JNonee"  ._Ñ  Ì å_thread = True{  V 2# Cä @pendâ �work itemç Ý ±  6 ˆ "._%_A Š_futures”  5 k Call .  . ndupdate _Š _Š 	² K Åto only haveE ðthat are currently run¹
¿  C 5new³ j ] = {}o Bfor $ #d,	 6temö;± .· þ w   !ifR Btem..I6  : µ [J Fd] =ž Å  .w« ? = V A s# Drainc ÿds_queue since we no longer need toB  3add]!to€cI £Qwhile³M ?try   ï « Ý.get_nowait()�  5 rexcept � OEmpta ]breakF ¡# Make surdæ "is¬o)"toýÿaste time loopingK  $onÀ ZQ over/ 	 5þOåe’s = False~ 9& .<ers.ón_children_to_stop ¬P Haliv®±n_sentinels
 E = 0æ a# Sendõright number of 6 e, to mP +‹  çL Pprope{`dH(� .< Û T     Lí G > 0Z 2  .inrange(d < - Œ C  G ÞŽ  8�5.puÖ Úq ] += 1í 	 OFull`ðbreak

    def jóoin_executor_internals(self):
    õ.shutdown_workers()  ð# Release the queue's resources as soon •possible.= ] Qcall_9 g.close]   j´ gthread& Qwith + ¨ FlockÄ  Ë   ; }_wakeupn `# If .d  () is not � Qed onß ðcreated processes nÏ À# some ctx.Q	ð methods may dead—  L †Mac OS X
‚for p inÈ ` ‡.values(‘ Í p¦ 
{ ü	def get_n_children_aliveË`# ThisÚ Õan upper bounÞ ¤number of H  H ¦ ó return sum(p.isg /) ¾ ú)


_system_limits_checked = False  pNone


Þ . 
B zglobal  1 :ed, !ed1*if Ž 3# &ed  ‚ùraise NotImplementedError(‰ "ed*	 o q = True” 6tryb Ãimport multiâing.synchroniz4 �except I. ~ C 	r P(h  ½   "ÿPython build lacksu 	ú , usually due "P ðto named semaphores being unavailableýt…–platform.F * œ ]	;ònsems_max = os.sysconf("SC_SEM_NSEMS_MAX"o C¡(AttributeG0, Vx {## O Õ `r settì  4 !8 7if £ F= -1´ñ # indetermined *p, assum_"at  Â' V  6U# by | Å memory only# ˆ h>= 256‰ †minimum ×e Y €# accord…to POSIX v – " T0vidShoo fewH6(%d( ì  "ô ,Æ 0 neœvary)" %mð[{Ðain_from_iterÆ¤_of_lists( %"""§ ÔSpecialized i!Pation^ 5 Étools.chain.\ m�Each item*1  x à* should be a ‚ ". ÔAfunc_ !iswqcareful¨ð	to keep references to yiñelded objects.
    """ ñ	for element in iterable:  )  ¥.reverse() Twhile= 1  5 Tyield ò.pop()


class BrokenProcessPool(_base. ’Executor)Q § ò Raised when a p=  ± 'a J = ñ terminated abruptly· ³ Àa future wasD ñthe running state.-  | µ e  · t ± ò def __init__(self, max_workers=None, mp_context o  8  A rializer#   sargs=()k  - r"""Init+ s a new¥instance.
m BArgsf J   ª P: The» äimum number of{ðes that can be u�%to[  M   eÎ e bðgiven calls. If ‚ or not  tÞRs man¯ C  B€ @will| 2creé “  ³ ”chine has- #orõL €“: A multiS ›¡ to launch¿ € }s. Thisé \p shouldx ñvide SimpleQueue,  D and f”  àÇr•  ( ‰[    ‹  f  CeÝ  I  ) F Ptuple·@arguäsÖ p‡!to×  . W r�  ú˜ ð_check_system_limitsÎ   if&á1 isÙ
X '._^ð = os.cpu_count()	1Vúif sys.platform == 'win32'\  ˆ ` ù
min(_MAX_WINDOWS_WORKERS,f  >  V û7els# A N<= 0¨ rÆØ ValueError("@mustÑgÑraFn 0"v  h oelif ( ^ß c /> P c   ª W  & fÀ O<= {g 6}")} ? a( =L-  ]3cÓ E Tp.getd³r L =Œ	p  q  ¥± À   () HD4Typí+  ía êé§ / = rŒ(  ñ %   ð 

        # Manóagement thread
  òself._executor_manager_& … = None
. õ# Map of pids to processes# Q  X = {}A ôShutdown is a two-stepI .H s. ‘ _False& clock =ä «ing.Lock()/ ùidle_worker_semaphore7 S ,(0= Ÿbroken = ‰ û queue_count = 0x qpending{ b_items‹ ;tcancel_- `future* q T A# _TÌbWakeupPðcommunication channel used®€interrupge waitN ñ of the main looçÃfrom anothernV (e.g¿ô # when calling I §.submit or äÀ). We do not³  �   �_result_d Î bsend wý asignal“ Å o ÐN Âas it could Y ¡ in a deadFRif a %�¯ dies with› 
awrite E çstill acquiredŠ #_s _3 bmust b@ ¶ acc
îK 5ñ _=> (()’Create ;@s foâe¯º @Make
æ ˜Ñslightly larg!an$ anumber<47 toN Bprev¡ex1es q idLÐ. But don't m‚ §it too bigN „because ?i†  �ª 0cani2be rl¡Í @_sizc1maxºõ	ers + EXTRA_QUEUED_CALLS} /  j ¬€= _SafeQ('  ö T  e =p b, ctx=D ¹mp_context,7  ŸI1  
9 	k4 	 
/ E/ j.Ž# KilledÌ0canRó duce spurious "XUpipe"í À# tracebacks  Ü+0's D e Ô±we detect k€ L •òanyway, so silencÈm `Î ._ignore_e« l = Tru�QþÇc.Simpl
,î Í _X=¢.1¬¯def _start®(G %):ñ àif self._execu÷tor_manager_thread is None:
  ñ# Start the processes so tha ùir sentinels are known.E ¿self._execux  C= _E M’ T‘ (7 )I  .sª (2 Ý  s_wakeups[U Œ Y] = \r  3 
Y 
6 Ãdef _adjust_.b_countÌ [@# ifTµre's an idl`ö, we don't need to spawn a new one^2if ž  A ö_worker_semaphore.acquire(blocking=False)ˆ  ß breturnÁ   	¹ a = len¿ .Ó &esd$ifé # <‘ 3max� so 4p =# ²p_context.P[(F …  ttarget={ S ,( Sargs=§ ®call_queue( X 4oresult* ¿initializerS  )  ‹ )" r /p.œ† o€es[p.pidƒp� NRsubmi? , fn, /, *b `, **kw
 ÏCwith]�shutdown_û
‚5jbroken  ¯ qraise B šCPool_6 
á S w U\ ñRuntimeError('cannot scheduleçäfutures after W 'w „_global_" r 5'c  ›'interpre¤ 	< ±f = _base.FÔ ¢w ¢WorkItem(fæ Ø#, à{ 6aendingT_itemÚøŒ Kw‹ <  'r_ids.puZ.6 
b2 U Y += 1U ¡# Wake up '  W0men  Z	. Q M.­/()ú _µ sv…! f« t€.__doc__Ÿ¾¥.  ¤  ¬1map#ÃÀ*iterables, ì@out=`×, chunksize=1¼A"""RŠ = ±tor equivalN o c   \ ").{  ;Argg`fn: A  „ ¯À will take aûs many arguments as there are
  ùpassed iterables." ð)timeout: The maximum number of seconds to wait. If None,q n r  Ñis no limit o% =  l 
~  chunksize:Y Ôgreater than e ¹ à will be choppÓ 9ntoÍ  ú S ¼  iz, b à and submittedÑ úthe process pool›  L It, Ž Bms iÖ Elist– 0senï ce at aì ž …Returns:  _ "AnÝ °tor equivalD õ to: map(func, *¹P) butsP callyO �be evaluaà åout-of-order.
( [Raise‡ TQErrorˆ Öentire result§ �could notˆPgenern _  Ö   abefore¬ Qgiven:outc‘Exceptionv ±fn(*args) r¥ P for è Ô ·5"""q 2if ñ ì:< 1aI a ValueÞ &("- 1musÅ v>= 1.")#ó Às = super().�“partial(_2_J e, fn),Ž  û  B_get/ &s(Î,¹ =L  L  CCout= ){ raÔ _chain_from_9@_of_ª#s(Û í ñdef shutdown(self,§ö=True, *, cancel_futures=False)bPwith 8 $._G V_lock"  ! K tpendingS + =d Ï : [ �thread =   	) i§òlf._executor_manager_4 �_wakeup ˜tÀ
¤  n à# Wake up queu C  ` F 	s  2 Ú t .{ (s 7 ® § µ y
° z 
f.join(¢# To reduc‘@risk²opening tooPðfiles, remove referenceýü €# objectqpat use 7 · descriptor`§ 
! =‰Z -  Ú_�  7Å% Ó,
5 g.close"{ # � ûe ¼ 
S 5 Õó.__doc__ = _base.EÂ." À
# Copyrightø‚ 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Implements ThreadPoolExecutor."""

__author__ = 'BŠ 0 (b ó'@sweetapp.com)'

from concurrent.futures import _base
 ”itertools Equeu t• 4ing Etype+ tweakref bos


_3 !s_H Cs = & ð.WeakKeyDictionary()
_shutdown = FalseGÁock that ens¸  ð(new workers are not created while the interpreter is
# a Pting f Ô. Must be hel7 Amuta" » Eand ¡ •.
_global  _l© "= ñ òing.Lock()

def _python_exit():
    A T  _with \ 5  9 t q = True9 @item`[list(¼ . 1())* Áfor t, q in  Z ¯q.put(None+ `t.joinà p# Regisd [ `ì ` ²be called jrPfore A  Œóall
# non-daemonDÀs. This is uHàinstead of `atJ#.ry ñ	()` for
# compatibility N7sub s, ñch no longer sup
~ ð
# See bpo-39812b  Hftext.
è_† _– (p)

# At< âk, reinitializ¡`ë!` Mi
÷e child process
if hasattr(os, '} c_fork'^%os1_at 0(bex=t ‘.acquire,$ g ‘after_in_‘ F l _ë N  pa–O órelease)


class _WorkItem(objectî d_]’__(self, çà, fn, args, kw 2  Þ  ) # =1 ÿ   ‹*fn  F ! =U 
 a # =j 
  › 1run– | !if´f ’ô.set_running_or_notify_cancel5 ·   breturnb   6tryÇ  ’result = b 1n(*	  ¼ 2, * ° ë 4 Áexcept BaseE ªion as exc] K a¶ 9 vion(excP  T ò
# Break a reference cycle� ¦> a 'exc'6 ;    j 0 = “ Oelse� ý ( )&!__B@_getö_A qmethod(ÌÐ.GenericAliasvàdef _worker(exòecutor_reference, work_queue, initializer Øargs):
    if Â is not None   $ 6try   Q  (* Q P   Áexcept BaseE :ionA õ_base.LOGGER.critical('. 8 in— õ:', exc_info=True)l p  R = ex (, %if$ í  Q   J  ._á ?{_failedT areturn“ 	+`while ° 
þ œgitem =¨¯.get(blockã  "if* 6 ¥ ´   ] K.run©    •# Delete -ñs to object. See issue16284Ô  6  6del‰ 
 �# attemptS ýincrement idle count2 g ¼ … À - ]  ._‚ ÿ_semaphore.release  á 7 ­ Šcontinueù / Ã š# Exit ifð#   - The interpreter ùshutting down OR“ 6 ƒ Ñthat owns theªÿer has been collectedJ . ˜  “ .‘ Dif _ 9 orj S .* 
 ¸a# FlagÃ Ú 0as [ ñas early as possibleÏe#K Øšgc-ed yet¸  t Y$ ”  	! =é	 W ã# Notice other’s' ¶¯P.put(-
¸ L rh    ¯|x ‹ .errò


class BrokenThreadPool(U  E€^1"""ë ÓRaised when a! tC  ë&a O B  kAing.M  U � 8 � G "):­0# U‚ ôto assign unique… Rnames  — _ t_prefix>‚supplied‡ _Ññ er = itertools. ²().__next__} Qdef _HÒ__(self, max_j s=î,Š x A='',ò  ê �Àzer=None, inÓitargs=()):
  õ#"""Initializes a new ThreadPoolExecutor instance.
; FArgsI  P ñmax_workers: The maximum number of t[ õs that can be used toY  K   e} ùe the given calls.) Q ð_name_prefix: An optional    1 toH D our‰ 
M iAr: Ao 5abl¢     è G  k D Ptupleú �arguments‡ 1pas  Û U rŽ 5"""ç  ifIZŠ is None{#µts oftenb3 õ* CPU bound task which releases GIL…  ‘x# * I/O2 (3 ,î zcourse)? 
 ! WYð cpu_count + 4 for both typeÀ š õð# But we limit itT 32 ûavoid consuming surprisingly large resource� °on many corºVchine‘  àõ  = min(32, (os.Ä €() or 1)Ì þ ÂJ<= 0Œøraise ValueError("l @must)`greate¼fan 0")Œ'ifœr#1not'P and   < Í(p	 à † 4Typ… +  … a� hself._µ =µk(  =‘_queue =  €.SimpleQ (9/ °idle_semaphœ=vTing.S ,(06 }s = setT Öbroken = Falsq shutdow h_lock � MLockk ‰ £O = (  %or( � .("¡r-%d" % ¿ N\er())Ñ=3y B  (  Â %   m°def submit(*  , fn, /, *# `, **kw
 YCwith˜ W8©, _global_ 
#if; ¯
   ³BÍœ "._5 ' 2 S w U cRuntim@'canF�schedule (Pfutur6f–P 'up â k 5'¯ b  ð'interpreter shut—down')

  ùf = _base.Future() w ð	WorkItem(f, fn, args, kw O úself._work_queue.put(wT $ ûadjust_thread_count| �return f‘ àsubmit.__doc__– µ šExecutor.  ä _def _h  ‚ !):X  ¢# if idle Ž ôs are available, don't spin new& @ 0if R  ._D ÷_semaphore.acquire(timeout=0t  x á ¬   Ã# When the eØ ± gets lost, õweakref callback will wake up‘ #, Torker® .  H ’_cb(_, q=À ¸ª qÈGNoneð3num¿‚s = len(F Eõ8if , <.1max*6ersŒ A ù_name = '%s_%d' % `  ¡_prefix orT ,ä  G  � ¥  . 3t =/Qing.T›(‡ =“ “, target=½ u  )#=(tA.refÊ #,  O_cb)F  ¢  è b9 ¿initializer:   É )4\.star¼	
j.add(t7 :'ms[t] =Ü  °_¸ q_failedD¨CwithB @shutíZ_lock\™ Ãbroken = ('Aò b  b sû pool 'a
 'is not us7š anymore'ù €# Drain l $ñ and mark pending f‹s‡ 	t ªwhile TrueØ  >try    l __itemd ¬.get_nowaiÄ : bexcept¨ _.Emptb Ybreak©  > !ifç {  E¦ . R.set_� Qion(B´•APool "._Ë)˜ ,sþ!  , Ú =1Â, *, cancel_b s=FalseE$h ! =�	þ i£j ó 	aÁ@ork ¡as from¿,tº   )irl  jÄ# associated?ð.
               ï while True:
   ?try  , ñwork_item = self._ ÿqueue.get_nowait()[ rexcept . OEmptj _breakF 1if u ‡ ¯is not NonÏ 	¶ ù.future.cancel()
a û# Send a wake-up to prevent threads calling8 p(block=dñ) from permanently  Iing.E N@put(× K ù :aitžƒfor t in�¨ 
$  ct.join™üshutdown.__doc__ = _base.Executor." ð
"""Configuration fGÎparser.

A c ð consists of sec7 ó s, lead by a "[ ñ]" header,
and followe& ð"name: value" entries, withs Atinu�  s : ðsuch in
the style{ °RFC 822.

I? Ànsic defaultÑÂn be specifit ðpassing them into
 
ÿ Pò  { ñstructor as a dià Úary.

class:
3 p-- resp@ble ¹ ? i ™a list of ·  Z!s,î Pmanag@  ï  L qed dataËÜ`methodŒ  J ”__init__(ÿ =b,½ s_type=_ _Ð 0, a‰A_no_€z=False,¥ ðdelimiters=('=', ':'), comment_prefixe # ;;')A }inline_1 › astrictL8 eA_< Bs_in¢ s) ß_`«='DEFAULT'D �interpolC€=<unset>½ AnverÔ  )R`Create t“r. When `;ð s' is given, it  vvializedP ‘   j�ionary or )ri£ñ . The keys must®qtrings,… ›s•$ €appropri¬  lP%()s N nge ÷ .* ‹ È 1ictÉ @will~ @usedc	Ä ˆ qobjectsè  â	 –   !opÔDin a# åP . fs½ �¾ 	!as; seuB subF£that divid{Çkt »z Ý ‚  z 6Esàï ï2. C^¿H Šindented£ Àn `inline_coó*mment_prefixes' is given, it will be used as the set of
  �substring 2at J 1 coY õs in non-empty lines.
= `When `@ 0ct`{ QTrue,g ðparser won't allow for any section or op
 P ð&duplicates while reading from a single source (file,  Vng orG ia Ôary). Defaultž ¾ Ú _Ú ƒ_in_valuH‚False (dA  : Ý �), each 6 v @markE³e end of anà ÷. Otherwise, internalC s‘pa multi‘ ? � are keptÃ0parÀd¬ Ñ m2_noË  º É Ù #),_ •s withoutÊ X sw –accepted;q  #asentedÒPthese^MNone� =_ôŽ   �@name+  uspecial%is‘  ' pd accorsly. By \  éñis called ``"DEFAULT"`` but th nN ðbe customized to point	  žo«e valid‹  € Ë. Its curren+@ cang°retrieved uª3"``
£_instance.· %``™ ðattribute and mayU `modifiÀŽt runtimfT@polaN‰d�it shouldJ @an I}) † subclash¤ / I=qhandlerùo¼ *%ueÃ ¡pre-procesw!ògetters. RawConfigP#‘objects d+%doL  Ž"soï	â ©, whereas I @usesuÆ VYBasicþ ð
. The library also providE ç ``zc.buildbot£ùinspired ExtendedT ` imple’Š`conver¥% d¾ç q5keyPrepreƒo ž Eua type e F®Ñ ¤a'6abl²³  h ˆ@ s¢w`!toÐ1des @datao f. Everœ >  ter gets i4€orrespon¼  Ñ*() method onV $  ¸ ì 9 œ%xi} 5s()) `ReturnkR cc!ur‰	Éƒs, sans '¥4has’(^ \ 1whe &aX Texist K J kR 9  Q  ~m à.

    options³(section)
  ð	Return list of configura& 0 op ós for the named D !.
E �read(file øs, encoding=Noneh Áad and parseN €iterablex  = d~  U ±s, given byn  ¶  , À.  A single (   ñ is also allowed.  Non-existing( sF ‘are ignor) Ðsuccessfully â = ó _v 1(f,  ~ ð ?oneÞ  Ý Aas aI … object.¦ 'Thà àdefaults to f.u @; it÷ õonly used in errorB ðmessages (if f has no `> Á' attribute,’0str)p`<???>'Y  T )÷ # ( ß
=cfrom a¿0 I Pdict( oionaryK . p. Keys ÄŽœ%s,÷ Rvalue" 7 ¡ies with k= 3nd & õthat should be presentL "in<A. If   ] Sy typ< ´rves order,.y nd? "ir‡ @willu 2add¿8 6. VÁ Æautomaticall�converted`sa4getê,Åñ, raw=False, vars°ø, fallback=_UNSET‡"a [ +
  ŒÑll % interpol=|CSexpaná  Jrw€@, ba¼ohç0pas @into2M ±constructorS Q tDEFAULTo ” 0ddi¿°al substitu …s may beN Pprovi› uP i   `!ñ' argument, which must«öFwhosM ðcontents override anyQ‡ß H`Cla5 inš ‡ ›* T žó-inös÷PLike @`), butµ fÿQto anè6gerz Ofloa| R j y |booleaní÷ A l ç (currently caûñinsensitively defined as 0f xqno, offF‹ v1, true½qyes, on( ‚True).  ¢!s 8 @ or  
TitemsÊúÀse, vars=NonCe)
  õ4If section is given, return a list of tuples with (name, value) forL reach opM Tn the\ ¿. Otherwise^ L (– _n  `proxy)v  n  ñ
, including DEFAULTSECT.
P sremove_, Z R  ° E fil» Ã and all itsÝ sX ò W ,% _ 1 W fromu Ÿ \ <setR tÔ  ¿7Set@ V ? ÷write(fp, space_around_delimiters=TruW0 M ‘configuraÇÐstate in .iniwumat. If„ `` 'O d   (¦default), ƒ D Ábetween keyso\‘s are sur» Red byÍ �s.
"""

@BcollÀýs.abc import MutableMapping+ ' ÔChainMap as _ 
D ”functools %io
 9ter o% $re% %sy ò
warnings

__all__ = ["NoS» ñError", "DuplicateOF 
1 Bk   "No5 �InterpolÊK 	 SDepth 	M 	& Missing_ 	oSyntaxJ 0Par=  # "M É cHeader 	‚ Cˆ > eLSafe :Raw 	B 	Ä  ^\Basic « "Extended 	L kLegacy" # "Æ P– b “Convertery)",F › . óMAX_INTERPOLATION_DEPTH"]

_1€_dict =  
? C = " ?"

I ñ  = 10



# exceS‘ classes
  z$(E !):° r"""Base,  ö gM 0s."‰ Œó
def __init__(self, msg=''S  $    .message =  n   ‚ .E )Æb Creprb Z ±a 5 Q__stro"__; #

û 
~(
S ô"""Raised when noÈó matches a requestedð
Ü_ ñ  óí %'Nj …: %r' % )Qç S $ =œ L fargs =? Ð )


class DuñplicateSectionError( ò
):
    """Raised when a s* ñ is repeated in an input source.
> �Possible+  tic €s that rU ° this excep ð are: multiple crea J ðusing the API ort ïstrict parsers¡   found moreu an onceN  ±  R #le· `file, R  ng_ !diAary.2 2"""Ó ôdef __init__(self,,ü Ñ=None, lineno L PÃmsg = [repr(Kñ), " already exists"]u  1 #ifW  r@not ^ œ    pmessageX A"Whio ad0pfrom ","r(š)[  < #if© _  ' c °.append(" [ß ð {0:2d}]".format( Eno))¾ < :1/ ") 0exte ;msg  <‹ c Kelseãsg.insert(0, "Ün â.Ç€"".join(x y  ã.ª$ =» ~  ô  	 
 # =h
 targs = C>Ã)


class DuªO+Á ©!byÈ1n o<  ê»ñCurrent implementŒ¸ Ä	¹Conly€f €ñ 
„ ½a€z2Ú ?uD ‚7 �$inÜ1ë!),Ã  Ë ¯Ü&@ ˆ.®<àm ì­7Î =ÜÊ=h “ŽÒ"Noë ß Ë€A reques^I P was  U.�	1 ˜ül Ð.__init__(selðf, "No option %r in sec Ÿ: %r" %
  (4 ,/ %))* Rself. # =\ 
 c $ => 
 }args = c ð


class Interpola© aError( !):I ‚"""Base -  fo× 1 Ñ-related exceú as."""
< Ðdef __init__(Ê ,Â ê S, msgj  z .4  # P  "  G AŠ �MissingOà £ (6Æ ð"""A string substituZð required a sett  ÿwhich was not availableAórawval, reference‰  -0msgü©"Bad value“ :ŽW {!r}® ¥contains "| S ˆ   "an i6B key5 Ò iÑ  t $idf _name.N  0Raw) 1ue:D Œ".format²â ", õ (�FEzÛ WC& =O
# O’ ¥ )LoSyntaxEõRaised when the source text ›‘invalid sU .vñCurrent implementÚ  rQ fs this­` Ainto÷ ÏÇâs are made doeè0con³1 toª é–  7r_Depth� 0nes„¯too deeplyC!8 `RecursÏQlimit8@eded-P7éÇP|F 0can.bÌ‘ ¬{} steps. RÌ † "dü	MAX_INTERPOLATION_DEPTH,C J /  ‹Dh]0ParœB È8"""DaoRfigur7filÃÄfollow legalN³ è Ç Žà=None, filenam£e=None):
  ÷0# Exactly one of `source'/`filename' arguments has to be given.H 0 õkept for compatibility.- 4if ] R and s •  œ ÷raise ValueError("Cannot specify both u  I ½ 5. "m  M  E"Useë 5."). Pelif g 	¡   ¥ …Required4f V 6p l 
q % =,¥ ñ.__init__(self, 'S¹ð contains parsing e?ƒs: %r' %lñ  = .k 	 i  @ Z = [] ‚args = (5 A, )
  ‘@property &deíª }ù"""Deprecated, u”"Ã�warnings.	 (W Òd"The 'Að' attribute will©ûremoved in future versions. ''Ï É' instead.",r ² BionW˜ å, stacklevel=2- dqreturn N^ *¸ q.setter; 10, v8
rg/."9¸2" =: %aappendT‚, lineno *A Á.0 (+ ¥+ ðmessage += '\n\t[- � %2d]: %s@
? À


class MismÑSectionHeader§"(P‡ š @"""RßÑd when a key-åò pair is found before any sZ ! h[ æ/
V Œ @H Q 
ñV'FileW+noŒ @s.\ns  bs a: %d\np	\ ('  S' š …#ù � .“Cno =ôb   
 ­ƒ r


# Us( :Aer g•ñ@indi¦ô the default behaviourÇ›pic
# op Ê <Î it<Ùqan exce& P. Cre  €enable `¨€' as
# aú°id fallback õue.
_UNSET = object()Žð
Interpolation:
    """Dumñbmy interpolation that passes the value through with no changes."""

    def before_get(self, parser, section, opt U ,5 qaults):D ¢    returnv 
 dZ /seZ P _read(« Q _writeR +Ø
class BasicIš( ’ 9""" ð as implemented iÑ!e T °ic ConfigPa—._3The—uô"s can contain format strings which refer to other7 !in¯ 4Vsame õ# Stspecialÿ* ‘ pFor exaÅ :£  òsomething: %(dir)s/whatever% Àwould resolv°3e ") "«  — vÒ of dir.  AllË Aence¼ ð%expansions are done late, on demand. If a user needs] puse a b4 #% aDRfigurX‘file, she`Ðescape it by 6‘ing %%. OSb% usag•  isJ tsidered{ Ðerror and rai«`pSyntaxE% %'.¤ò_KEYCRE = re.compile(r"%\(([^)]+)\)s")OvÐ*aL = []^ÇVelf._r e_Ù()o "L,V;1def,E, 1)O .ž''.join(L½ 3 Btmp_+=† ò.replace('%%', '') # Âõ d percent signs™ D  a.|•.sub('', !  L qvalid sµC aif '%'Â‘ ' Lú  V êB("inJ ` ÒX  I u%r at "c  F  Q"posiq%d" % (² ½.find('%'))Š, Bê ð`accum,¾tóOmap,¬ Sdepth Æ ’rawval = N.¸zöraw=True, fallback=restÉ 1if Y ÿ > MAX_INTERPOLATION_DEPTH†	~D™ “á ¥ o Qwhileù 
W p¦"stm6"%"3  ì Šif p < 05   KŠ.append(Û   ð    return
       ¢if p > 0:
  ýaccum.append(rest[:p])'   0 =  I[p:]  ù# p is no longer used" c; :1:2< ¿if c == "%"œ ?"%"— 2— %el] (]  ñm = self._KEYCRE.matchh @if mä NNone¨  Nðraise InterpolationSyntaxError(op Q, sec	 	 @  h"bad iG ñ
 variable reference %r" %Ž¬ Òvar = parser.x þxform(m.group(1)5  Ù¥ m.)O ¡ ?tryþ ºv = map[varà 6 ¡except KeyB @ �MissingO;; (7è `€ rawval,=p) from ¼@  if{_ in v˜ #‘re_some(_$, x GM, v,b    ;¾, depth + 1ž?elswx ¿v: 6 i ©À æ ± % ñ"'%%' must be followed by  Ÿor '(', "= cfound:Ù†ù,))


class Extended`( )À°"""Advancedüziant ofRñ, supports the s¨¶1 byŸ ð`zc.buildout'. En€sF „ betweenÔas."""
? SQò.compile(r"\$\{([^}]+)\}"), ð def before_get(p,¾Ï‚Pvalue,cfaultsõ  `VL = [} H /._¸L"S Ü2 de\ ,Šþreturn ''.join(L½ s½ ³ Atmp_Ñ 1 =  ñ.replace('$$', '') # escaped dollar signsf ö C ó KÎ…sub('', !  K SvalidðC `if '$', K `   2Vz†2"inJ _3ionX  I _%r atê R  P"posi0 %dÎ(² §.find('$')±‰, A	éÀsome(self, pòarser, option, accum, rest, sec omap,
  udepth):" ¡rawval = p^ U.get(L j ðraw=True, fallback=v )F 1if Y ö > MAX_INTERPOLATION_DEPTHr  › ð raise Interpolaº D™ dError(w ˆ ¥ o Qwhileù 
W 1p = –.find("$"3  v Šif p < 05   KŠ.append(Û     ereturnò   P >P J[:p]�  A  j ³ I[p:]] ù# p is no longer used" c; :1:2< ¿if c == "$"ì $— 2— %el] {]  ÿm = self._KEYCRE.matchS@if mä NNone¨ Š (oSyntax)	 @  h"bad ioq variabGÑference %r" %A«þpath = m.group(1).split(':'- Ø m.T)G ™  ß/º¼ Sopt =í ?try2pif len(¯ )1'  € a øtQxform= /[0°  6   v
jap[opty    &	ˆ 2ˆ  ³ /[0P  T ¯ 1¯ ç ßF$, ÙÃ r ?els˜  Ä œ³ 4  n¶- 
ó
"More than one ':' found:±^.,)Ä ±except (Key0R, NoS( OM ¨   è  wMissing< (Â ë  tÃval, ":".joi¬p) from K  ifÊ_ in vFràre_some(ôëã2, vu#	 õ 	 CdictM a.items">)O  êO + 1² rÀ        accu×m.append(v)
  Yelse:   ýraise InterpolationSyntaxError(0  4  op' Q, sec	 % ð
"'$' must be followed by  Ÿor '{', "; ùfound: %r" % (rest,))


class Legacy³ ( )ç ø """Deprecated iã 1 us ñ old versions of ConfigParser.� ™Use Basicc Ê or Extended Áinstead."""
A ò_KEYCRE = re.compile(r"%\(([^)]*)\)s|."). ñdef before_get(self, p� q ‚³value, varsõ   ‘rawval =  …   õdepth = MAX_INTERPOLATION_DEPTH( awhile . :8  õ# Loop through this until it's doneL  < J Y -= 1 "if  Â and "%(" in ¿ ;  ñreplace = functools.partial#)._ß_0 ,q M  f= 
< 3 M0 = “.ÕT.sub(m ½ 9 >tryÒ R Z %Ç² ¡except Key’O as Ç  O Ë �MissingO±@ Ò ? TÖ Gü, e.args[0]) from NáZUbreakÏ îÅ  D¸½ ¤ tSreturGQsQKP Ñ@staticmethodß  ³€d(matchÀW As =  †.group(1Â qif s isf
7Ü 8 7 „/ €"%%(%s)sKÛ.Fvxform(sX8Rawÿó (MutableMapping¾ 8"""% Ð that does no	 
hò# Regular expresr1forÝ4ingN� headersª sg _SECT_TMPLK _ ¶   \[  
1# [E  % B(?P<e @>.+)  #`y permB5ve!> -\].  5# ]/ ¨ ?_OP½  Ž ç O>.*?� Ž 	ðs*(?P<vi>{delim})\9s*  ù# any number of space/tab,
(  Ñ# followed byR oof theD aC ¯delimiters… ,Í ˆ ï(?P<value>.*)$Õ õ# everything up to eolB 1""" ô_OPT_NV_TMPL = r  T  f °option>.*?)   # e Á permissive!V  ' `\s*(?:
  ¶ „ Avi>{M<})\ùR   # ¥ HallyÁŠ €  Š î Á@ ¡ î…  FI î/)?ðî°# Interpola×  algorithm‘be used iô  ðr does not specifQotherÓ ú	_DEFAULT_INTERPOLATION =e !()- ñ# Compiled regular expression for matc®0secž s8 pSECTCREœ2e.cC  (_ ´Ï, re.VERBOSEi 8ò	s with typical separator€ /OP   5 2�.format(ý="=|:")’ 7Ÿ 1al ë� !# l pited usÜ¸ 
;_NV: » ð¾ >@lead“ QwhiteÈ’ in a linD�NONSPACEÑTr"\S"ÀóPossible boolean  L Áthe configurÃ.%öBOOLEAN_STATES = {'1': True, 'yes Ftrue $on H 
 �'0': FalsI 'no f  4off !}
N ódef __init__(self, defaults=None, dict_type=_ _ 0 ”A_no_=’ *R f¿=('=', ':')A  ðcomment_prefixes=('#. p;'), in£_$ ¦ Ì  rstrict=_`empty_@ Bs_in  s : æ ã=B Ï´  i­Ð=_UNSET, convóerters=_UNSET):

  Ðself._dict =  [_type ¶sections = 0 +()& default& BconvŽ D = C €Mapping(_ X oproxieW % [… _³ R] = S¾ QProxya +, & r `delimi2– = tuple( - 6if  õ  == ('=', ':'): h Ö „._optcreDòOPTCRE_NV if allow_no_value elsej& M   
[ ÷d = "|".join(re.escape(d) for d in¤ »  – x 
Z  # ¹ ¡re.compileHò._OPT_NV_TMPL.format)E=d),µ  I  ªre.VERBOSE¢ ï  H • ’ Ax ácomment_prefix—" Vor ()Ñ ? }inline_- h  M 2str¹	 rk U=f. `empty_� Bs_in‰ t 
< N= 
-  _interpolaS9 =  , "if/ 2is Ä
¬ñ 	J hÿ_DEFAULT_INTERPOLATIONh ONonef IÐ 7if ìois not½ , †.update( Esgœ Sread_$s(	 )ï de°= À¦creturns8 7 Ns7 B"""R: €a list o·-ó names, excluding [ŠE]"""€#t b ö will never have6  Ë%it9 ²  v – .ó`s.keysz,  ö 4add , #, o ô """Create a new"  v 0theËQfigur¶. �ó Raise DuplicatelQErrorÙH 0by H ‘specified ¢  G  al»¢y exists. W VL  QC is G.= P8�À== self.defaçult_section:
  óraise ValueError('Invalid / Ä name: %r' % %)
D $if ” in self.i sj ¢DuplicateSŽ u l )W 
I [  3] =c \dict(/ xproxies. f `Proxy(U ,¯ Ä tdef has´ $ Â a"""Indº Á whether the, is present   �configura{.8´The DEFAULT’ õ is not acknowledged.5""" PreturnÑ k  Û yg  Û  opx s× 	RM ¢a list of 4 Ú Bs foè Fgiver  .’ 6try, _Eopts®¿šW.copyÀ¡except Key
K £#NoÌ" (S µ) from None { q.updateø ¦._defaults1B ó (0 gkeys()Aread? `, fileò Às, encoding=r )¨ õ"""Read and parse a7 ð  or an iterablecR àFiles that can	ð be opened are s† õtly ignored; this isù Pdesig/ "soH 0youL Œ specify† •potentialB 	®Á A loc¼Às (e.g. curràödirectory, user'‡ Whome  —systemwid !),+Ïall existing… sã ND€will be ¦¦.  A singla� may also- Ärú  •ÁsuccessfullyY sƒäif isinstance(o ÷s, (str, bytes, os.PathLike). !3 E = [ ]j´ = io.text_ (	 ÐPad_okL C  ¼Z  B ™¼ Ÿ Awith~Ü ý€ f as fp :  “ ¡6(fpE´  ) ù!OSÖI vcontinuÙ 5 |
nK þ   =—efspathÝ 
–  µ ¯_ok.append%  r4( o  i :�, source0  ga() butNPargum^@must³FÇ-like objectÀ DM`f' 6 'Àle, returninóg one line at a time.
  ñ$Optional second argument is the `source' specifying pname of L pfile be# òread. If not given, iU Àaken from f.F ' ¥`f' has noN ` ð' attribute, `<???>'› FusedÅ 5"""7 2if ³  ' UNone:  ó :try   1 =’ 	1 „except A‡ _ErrorC '¥ D `self._3(f,› !)
 @def  €_string(+ ",  + 2='< 6>')v ð"""Read configuraÅUaoG .s¡a= io.Sr 2IO(] )�  ¯ •  - (3 Œ · Cdictµ    H$ry- 0='< ·  . C . � €Keys areŸä  ‚s, value 8 ¡ies with k5 #nd& Ü ñthat should be presênÆb � ú c ] ey typeK < ´rves order,> Ps andO "ir‡ @willm ‚added in0 â 1All[ Qs hel"  } x  þ Ãconverted toÚ@s du6“  µ°ing, includ†8sec5oì C¨  )‹ 9Á ­ —0eler"s_$f= set(’4for^,T'in˜w.items( 8ú =.( T  # 
 ÿCadd_3 ; ²(DuplicateSi0, V� –  w    e õ!ctˆm  
ò ;  Frais‹  
6 O.add¹  L3key@ p C X @key �2lf.=Pxform5Z(key)Q 1 "ifu } û� &   Â ] 1tr( M  .+Ø )Â 
ü 2 ¯é¢	P ¼‹ 
e a	:  »  ËÞ² zJ#fpG@fp, x £=<A€"""Deprepbd, use= 0 P instsXÀ     warning—s.warn(
  ú$"This method will be removed in future versions.  "@ ùUse 'parser.read_file()' instead.",1 õDeprecationWarning, stacklevel=2- )
 Gself\ °fp, source=l aname)
- €def get(1 P, secf B, op ñ*, raw=False, vars=None, fallback=_UNSET):N  &“"""Get anE ô value for a giveng .ƒ  5 @If `^ ð' is provided, it mustaAa di� „ary. The_ Åis looked up… $inP 5(ifQ C), `ã Q', an¯À`DEFAULTSECTƒÅ that order.P  If the key¡ ‘not foundD `½ ¥is used asJ a;0. `RP' canè ý g as a \ G
3�interpol ™ Penablp !nd° Çñal argument `raw¨ Ó— 9ll O Âs are expandØ breturnº s� A` sa ,~eÅ  T Çkeyword onlyC  Ó� “ Ó vspecial‹&""O6tryy H@d = Ë�._unify_5#s(X Â&¢except NoSøZErrorQ &if°2is î
#  x UraiseM  Oelse(  @22 ©½  bxform( ´ ó ã R = d[+ ]U ß ?KeyÙ ,A NoOH “ .œ ø ¤  ifa2 orT ò 
:v: a'  	Í�.before_êG
x Ï  dJa GconvQw*kwargs1·  ( ‡.¦ í9  o _8 ‘5   /, ÅKå ™×>, *° ‚Á x	½ € ˜J2raw†=ïp} ª Ó(³,¡\ Ú ÃÀ         retðurn fallback

    # getint, �float and ðboolean provided directly for B Áwards compatM 0def: òint(self, section, op ñ	*, raw=False, vars=None,?  �  ¥ õ=_UNSET, **kwargs):+ 0retÐ  j ½._get_conv(s Ý  u 3raws  x s z  ‚ 	 „ ;î 5ð - —ò 0’ iô Dö /ø :
 sert_to_§ ë �ÿ
ZitemsÀ V è¾B"""RÁáa list of (nam±lue) tuplesnCeachDT in aY.Š ´ð All % interpolao°s are expanÀ‚in the rv ñ values, based o [Àdefaults pas Ainto= ñconstructor, unless à¢al argumen ˜ ð`raw' is true.  Addi� °al substitu †s may beoPusing] – `¸'c À, which must: Aa dioõary whose contents overridesM Ðany pre-existj ô T4Thej€ DEFAULTÊ …special.L 5""" %if3 2is ¿´ �‚super().D)A Bd = Ê’ Vcopy(" :tryR �d.updateŠ#._#s[	 ]; ú except KeyErrorG » !„ ƒ S 
0 Í ‚aise NoSêV „w ±orig_keys =í0(d. &()# 1# UÄ P with÷q entry m0fic-GiablÃ if s•  �0keyê0lue. 6f
,  Á !d[mÁáxform(key)] = #˜  h0terÇ Sambda•:²	p.before3 ™
‡œ"d[„ F], d if1
· Š H º À  return [(oñption, value_getter(o r)) for  ñ in orig_keys]

    def popitem(self):   ð """Remove a secd õ from the parser and return it as= 3a (4 d_name,B ô_proxy) tuple. If no õ is present, raiseO ’KeyError.¶  Ÿ 5The9 pDEFAULTA Snever”  ed becausež ±cannot be r× %d._ 5"""  00key- .Ç 's( € n0 = % U[key]B   ?del r/3key²8 ó  ë ê   ¾Bxfor¤,Ð7str” X - ¶str.lower()H Bhas_ ë”P M �"""Check> ðóexistence of a given‡  * -Z!If/³specified `# '­`None oGö  empty string, Ñqassumed4 ’ S Pdoes å¯ ,ˆs False.æiytA%or =Ó“.default_°  ßGþ. ¡ )·  . 	› / 4#._b 5Eelifˆ  Ç !inE.… s† X Þ q Jelse' “ ­ A® #s[	 
ð ç   	m
ç Š?setƒ=
�TSet asËŒ
õ  ô  _interpolaÆ�.before_† M Ó  q øa, eEdictÂ - è:try º I   ?ionÈeexcept…P ¥2NoS–ë)  ½B o  É [‹	*2] =º©Swrite!úfp, space_around_delimiters=True&W:  (P.ini-2Sat reVþ Á @‚configur Wstate^OIf `w º {   (H ™6), š þ €between r-&‘s are surÒ  ¦yä s‚ `PleaseÎð e that comments“àthe original cóonfiguration file are not
  ùpreserved when writing the c> Uback.7 5""" õif space_around_delimiters:$  n ÷d = " {} ".format(self.0 E[0])3 NelseA 3  2  ‰ R [fault€ ;  â Pe_secQ(fp,  !de3  ,U  º  : _; Æs.items(), dÆ Cfor m 2 inl e   ¬ “ � n #s[	 ]˜ Ø Zdef _	 < ", o P_name Ü %, Ü)›õ"""Write a singleñ !toIø specified `fp'.<1fp.ˆ ‡("[{}]\nx  † )O¢key, valueR) ¡ •  ³$ =u�interpolr.beforeˆë  s  , f - J  w ³  < $if± s~� None or  z±._allow_no_> 
È  B  & =�q + str( ú).replace('\n', '\n\t'ƒ OW Ï  —G{}{}— Ë •ÅQ\n")
6 c‘remove_opk è e",  
GR1 3 an 	+#if/ð >á# =ã‰_
E - Sdict - ·¯  õ ":tryE  ' I   6ionqR  / þ except KeyErrorP ’raise NoS“& (T a) from/U 9Ç  xQ( ÷`existew / O 3if ( 
› 1delÈ - [@ ]5 dreturn9 ò¾ 
Xë–1 	ð– é ó@� Å  eb ¥í  ( oproxie'  ó P__get}#__ð 7keyì  ifK# !w¤C and×dlf.has½(F  J)I! ž ðself._proxies[keñy]

    def __setitem__(self, key, value):'  + ð)# To conform with the mapping protocol, overwrites exist L Gs inN  > …section.  if} @ in Š A and	 ‚[key] is• ”  ˜ XreturY €XXX this0 õ(not atomic if read_dict fails at any point. Then again,� ð# no update methodœ  €igparserf b nx ŸmplementaÝ !==Ô “.default_
Ö  ÿ #._# •s.clear()˜ *el*.F sG b sGL k b({key:i(})&<del&� Ý praise Va Error("Can«aremoveYû  ¼ &."ý 0if - ¸ 4hasû G(key‘ i 2Keyg  ! C? q 	B ó ˆcontainsc {²ø 2 orí¨ f 3lena \ 1len•á) + 1 #%U NiterV  # ð does it break wøpunderly­õ Per stø…changed?:÷  b Âtools.chain(¨ ¸S2,), ˆs.keys()[ }> @, fp 8nam{@"""Pm$ a!ed‹Aigureb file.  ùDEach,  ²a/    Þõ a header, indicated byð  a �  G ðsquare brackets (`[]'), plus/é0 opùsO `N 'Ü`0  ' [RmitedYða specific substr—@(`='O8`:'� p)ý Yðs can span multiple lines, as long Pthey Ó Pinden� edeeperü 0thaÖqe firstB 1 of}¼ €. Depend¢ o* å's mode, blankP ƒ ± may be trel€as partsZ ­  & ƒsó wignoredã JConfýsU °include com�‘s, prefixÑVŽ �characterË#”;`  žC). CL a rappear ë Vir ow{Àin an otherwáSempty3r> 0be f!reG æ Qs hol>O ï ž û~�s. Pleaseû "%atå P get &‚pped offÓ V —c,Àation files.#
  5""" õelements_added = set() ãcursect = None@  # õ, or a dictionaryF  C CnameG  ?opt ¥lineno = 0* Éindent_level T ” 	 ¡ pn excep¤ _ Bfor v , õ in enumerate(fp, start=1):4  a 0com>_  =©ys.maxsize(  # strip inf  7 s$  ð_prefixes = {p: -1 �  ; s self._( D 0 }M Twhileh Ÿ 6= s  C and� D 
Ý  á Enext  “ 
g  # Ÿ µ  , §x=¥ Í {.items(> >   6 =zb.find(8 P &+1� /  #ifp ^== -1¼ ( zcontinu’ 	á [x 2] =Z 	S2 w 0ó(À 1> 0T â[ ß-1].isspace()ü  V ËFImin( 	g9 = Ð 	À „Afullk
‡Ï Ès� .esl!ifS .ç1().Ë SswithÌÿ Z 0 	Ù  YbreakÍ $if¾ Ý¡ i  Ï	R @valuM¿:/ ]× 	1 qif not 8 p #if¯`empty_V Qs_in_/ A  ë a# add 1 Nr to thec Ð, but only if ™re was no–  H   # 0 on. Q * :if n1 isÐ Î2  ` i‚ t0 ë?andT [, ]‰  c ¬@‹ 7 ñ.append('') # new} \­ed at join„ NelseÆ _ #’Âmarks end of˜J  4  ÿ¯w/ ž ¾µa§¼?: ‘first_non^ z ðNONSPACECRE.search(line)
       ûcur_indent_level = first_nonspace.start() if ‚ else 0
I  ñif (cursect is not None and optnam 	4  : ‡ (> – /):2  f [V ù ].append(value)/ @# a , Ðion header or�  ?1  Ù r ‘ < = ³ 	B  Ô #-it} 
l  * ÿmo = self.SECTCRE.matchÌ  / ^if mo     ç eÂ= mo.group('ô ' .   !if5 "in† _G Oionse 7 ¡lf._strictá 6 H ïelements_addedH  L ôraise DuplicateSectionError(T @, fp\ ,g B  olineno @ ·Š[ƒ ]{ 
í E.add¸ p (elw=s tdefaultz 5« 9 s¡ Í ò   K Oict(µ  / ¥¡ s *„ ; jproxie: ñ`Proxy(b ,“Š tA# SoX  Ùq can't Üð with a continua} .Ë p! =Ù# 5# nf m¾in the fileü†!isV ú'sMissing4HÏ+!» 1no, @D# anü å ’ /se‚ ¨_optcre¨ ö¬  NP, vi,–  va‚» opŽa', 'vi  ÞÊ P !iftW Æ  (   eu‘_handle_erekBJ D   m N ³ cxform(  .r&>p()� A    9 ûQ] )  b8 Z) in 8À            ò    raise DuplicateOptionError(sectname, op	 
2   "fpH lineno)G þelements_added.add(† )@ ÿ# This check is fine because the OPTCRE cannot‡ ð# match if it would set¿val to None? $if* ais not. :/  P0optZ =9 .strip(é  4 0cur¢[�@] =  Oval]l OelseŠ °# valueless� Ïion handlingV Ž %† ð# a non-fatal parsing e“¡ occurred.� upÕ— a# exceÑð but keep going.8  owill bÒ#'Bd at: Qnd of ‘file and D Ÿcontain a• @list> at Pogus s2 ¡e = self._‰!e_J(e, W,H 44  join_multif _ÝsZ#æ:anyisj,û 6 an0« ;if OO!e
# _def _�  � )Š„defaultsë  _áCion, ,4all$  < ôitertools.chain((1 1,),’  ª  š .U w.items(tEfor — o^ s ó‹ Ù  m  2   ä#inXs\ 
.  2  yÐsinstance(valÜ'st1 &   V p= '\n'.m 0 ?).rC³ [’  4ð �interpolaÿÐ.before_read(  =“  2†A   · ,¤)d © _ì²   5q"""Read¸ p passedÂ !Åinitializer.¬ PNote:t 0ues<1 be¢ ceng."""+  ì1key¢  ueV i î ^.» [ ¢ xform(key)¦¸ò 	 6 ,Ÿaàif not exc:
    ôexc = ParsingError(fpname)
$ ñexc.append(lineno, repr )' ±return exc
; ñdef _unify_values(self, section, vars):,  k ð"""Create a sequence of lookups with '5 õ' taking priority overI Sthe 'f p' which1 *es0  ( ÂDEFAULTSECT.· ‹ N I •dict = {} 6try½  6 
*  í #._ #s[	 ]? ¡except Keyv
K $if'A != K tdefaultR 
0   ’raise NoS`V (w µ) from None� P# UpdoY àentry specific eiables3 >var if* s‘ pfor keyåalue in$ w.items(õ ¹   E * Qs notª 
R  &   Lq = str( ‚    § [8 opnáxform(key)] = 8 Ö ¹£_ChainMap(@ « ô   Clf._‡"s).åóconvert_to_booleanëh î B"""R&#a * Œ � translatÖ«õ
other types if necessary.· 5""" ?�.lower()D"in:êBOOLEAN_STATESV5V 1U'Not ž r: %s' %¥ i2`
^ [ó ‡ ]%@valio_Ú '*]R="", ² N ;=""D ê�s a Type·  ppnon-strC8 sÒü The only legal +  c‚we allowí 6lesø’ As is™ð, so we need to checkC  E{  * až• &if|-@ !do¨v  Fs, oÔ0 ) A butÍ{ B àFor compatibil3ðreasons this method¶  ; @used³Æclassic set(ý k�RawConfig9pers. It> Rinvok= ¡every case�@mappš…protocol acÚ1 ans V .x ñ ª ¤isinstanceê,/ ý å-#(" è�s must be9 Vings"ë  yoÙ f 
e +  c K_á2_no$2 orŒ7 Î • ø”  / ý ÀeError("optiñon values must be strings")

    @property ñdef converters(self):  , preturn  &._' ø



class ConfigParser(Raw G 8""" ò implementing interpolation."""£ ø_DEFAULT_INTERPOLATION = BasicI5 (Ö  È 1setÁ P, secR B, op S=None—  Þ “"""Set an' ».  Extends Ì p.set byZ1ida» …type and,	Ì à syntax on the8 !ueà  x   S0valP !e_  _T "s(´ = ,< =! )m psuper()˜ (í Cadd_% 
 
ÄCreate a newB" iÁ cé"ur©(� 0s 8!if� … name isI a¯-H = "Š *Ò_read_defaultÿ$,  
QReads¼   t passed$Áinitializer,çdicitly_5ingæ ÎCs toî as like] brest o%BAPI. 3úDoes not perform>õ for backwards compatibility.y  c L   6tryê  Zhold_Ç=ü	 N  5 É	  < = ¤ *  2 xQict({ T¨:…}Ókfinallµ > ¶ Ë ´HSafe’( óµ_aliasb	‘ purposes¸! ’ __#__w�*args, **¥#gsm  Ð1 + S  * @warnÏ.	 (   \"The ß  ª°has been resd|ù * "K òin Python 3.2. This @willWRremovþûfuture versions.L I Use+` direc©instead.", aDeprecmWð å, stacklevel=2- )×óóProxy(MutableMappingh`"""A p  Ê…a singleë�from a pÎÈ
# ,½] €"""D€s a viewÿa` Õ°specified `Š`?`R `v  K   Ú # =˜ ú   B à = name
      ð  for conv in parser. —erters:
  Ñkey = 'get' +5 	 ò$getter = functools.partial(self.get, _impl=getattr(q y, key))M s"  :   ", ` !)
( Ádef __repr___ )¬ ñreturn '<Section: {}>'.format- i._nameK sgetitemN s S pif not Ž "._¶ p.has_opa T 9  ?ð raise KeyError(í Ä  ¬ 	Y (ge¦ R ö s« w, value² 	R �_validate	 ’ue_types(½ C=key? =E � 
s� > 	O?delO8PE and–  7  	â oremove� : ‘_ V�contains_	 º3lenU ’ P 3len˜9s()R?iteì� 9 3.__/ C   - € #ifØ 3 != –“default_sL( E  »  Q f h ,   Felse¨  B s #s(½ ‘@property|  ¤œ /É S# TheÅÀ object of t ñroxy is read-only.M ƒ ´x  "v   m + on a pz  B x  â ", Pð, fallback=None, *, raw=False�"rs ×  Û n1 w*kwargs1“"""Get ane E.†  @ „Unless `| `C°provided, `Z ±` will be rÌBed iuº ‘ !isDWfoundd 5"""# a# If `¶ k �it shouldi ap methodiå¿M @thatˆ ¶ s€desired ÉfersionðŠ 
±  %5getw é,É ·3rawµUvars,=  u v=	 4, *ÅÑ


class Conv­ó Mapping(Mutable îP"""En ð s reuse of get*ô-() methods between the parser and section proxies.

    If a& ñclass implements a getter directly,U ‘value for QgivenL ðkey will be ``None``. T‡ ¡resence of4 `converZ ñname here enablesJ ¬ � to findÈ 1useD ¨ a× oñ Ë .L 2"""ë ðGETTERCRE = re.compile(r"^get(?P<Œ r>.+)$")2 ódef __init__(self,+!):[  A  #._h=   •data = {}  =\ in__ H _  c Am = g Â r.match(B )V  - ±if not m or	 @callY - Iattri ,á)r  I ‰continue^ ‡ _Ð  [m.group('7`')] = ó‘   # See ƒ£ docstringpSugetitemV7key‚ breturnó l Hkey]“s@ !, —G 6try§ Ò õ k = 'get' + keyÙ úexcept TypeError6 praise Vô @('In<`atibleI  : {} (type
 %)'Y  u  À''.format(keQ0ype
 &))Ècif k =­ Ž 0can )@"" aÈ¤™ Ç [" ==  pfunc =  Ùtools.partial=`._get_Ë ,  =�	E . êd ?set� !k,v  * ³4y im.o 's(ò l½ G p.get, _>=à j  > • + 5, k!~?del¾w
 ê š *z �2Key ,d=del( È    :@inst9BiterÊichain(É3,),E Z[Ú  f 1delÇ j 6, kÕ   Ù �Attribut_ ' ‚# don't k si* ¾±entry was pAË –, silentlÆ I   ¥# clean up&    Ó ‹ ˆï ƒ  + ô	?len8 9len7 Á"""Utilities9 with-statej ?qtexts. ;€PEP 343.»³import abc
 2sys Àt _collectioòns_abc
from collections import deque …functool Rwraps Etype ÿ.MethodType, GenericAlias

__all__ = ["asynccontextmanager", "  `losing Cnull! F",
  ¢"AbstractCQ MQ  Ap  
D  " �ExitStackp / �Decorato¡ ! 	> ð redirect_stdout?  !er> €suppress #acÚ ¤]


class ­ y Ç ±(abc.ABC):
s s"""An aó b base @ Cfor ! URs."""8 !__& �_getitem‰ m²(­)3 ñdef __enter__(self):„  |°"""Return ` q` upon - ô ing the runtime• Œ  ;   r<  ; m @è × ” l … 3xit„ `, exc_u
 pvalue, [eback¤ €aise any6  epàÿ triggered within­ CNone­ :¦ 1sub Àhook__(cls, ¹ ñ   @if cCì^ . #_š ¯‚._check_$es(C, "¦ [1__e.!")› K �NotImplem§dy& ~×thronousö‹3Z  a¾ ’h
Œ k�™´ ž(³
¹ š O"__aÓD½s(object("A8aor mixžat enable¿Ô to work as d#s.^š±recreate_cmn  ã .$a ' àd instance of 
.^ 1 ðAllows an otherwÆŒone-shot[U likeì_Ê ²I Á ð support use as
  óa decorator via implicit recreation.

- ñ This is a private interface just for _GeneR õ ContextManager.G ñSee issue #116477 vdetails& 5"""2 ²return selfŽ Ðdef __call__( …, func):3 q@wraps(   7 ÷inner(*args, **kwds7  ë Awithl #._[e_cm(&  * ˜  e R s # v ã


class AsyncD�s(objectg ‚"A base 1 ðor mixin that enables aG " cg" mhÆs to work asÞ7s.":×  >t  Ó B"""Rnaâed instance ofà §AØ ­, ³Qawait4¹ÝBBase|‘"""Shared]  AQalityä@«ªa and @Á 
 .Ub i__initè", ¿½ Ëa.gen =} Ú '  ´,ÌL   Q > d Œ  1# I¹Ü19330: ensure‚.õs have good docstringsM Ñdoc = getattrªõ, "__doc__", None)-  ifC  ~  l ’   I Atype#).E = Ü    =I  ð# Unfortunately, tåóstill doesn't providÉ ÷help output whenJ ñ inspecting the B/ed@, siUWpydocH ñcurrently bypassesP …LBBshow!  L  “� y C 6eadf # Žñhttp://bugs.python.org/¥Q19404¿Umore ¨d  Nw# _GCMBÌare one-shotPs, soë \  Ú`# CM m['be�¥each time Áq& id # %%edR rÝ^[.)º(a   ," ƒAbstractý  #,
˜‘"""Helper‡FÂ7e�Ý ð ):
        # doó not keep args and kwds alive unnecessarily
  ñ # they are only needed for recreation, which isc õpossible anymoreM �del self.€ ,  ‚  Efunc, Etry:  � Áreturn next(E Egen)" ñ except StopIter— @ ðaise RuntimeError("gen, ñor didn't yield") from None
b Ádef __exit__} ö	, typ, value, traceback)s  if#   G   Ë Ü   Ù   Ý  & !FFalss  Jelse�   rWstop"fJ "ifé  h �# Need to5±ce instanti£÷ so we can reliab{ =   �# tell if* 0get’b same @ion }ª 1  ž  =ˆ(Ä   �U.throw(á	e € 
u0 as˜ p«# Suppress1 ß*unless* it'sÝ Ithatx  Ã ¢# was pass]µ ú).  This prevents an H  	d˜1ide€ ò"with" statementsbeing sÅ =ed.L ‚0exc nƒ	( 4ˆ3 Do–1re-¥ � ó  ing ep€Ú. (issue27122ê + if+  “ � › % ¼ >  u# Avoidý  	,if\ f ‘ 	ò A ®„Àlater wrappe‡Ito a¨N  À(see PEP 479Xe sync ÏKs; a _ alsoJ  0havõðis behavior). But do tJ÷ Îhq¯ Q  !by§	á±is actually� (Až )ª Ð L  Ö^9692)nMif (4  m"isd1ce(ñ,t m ! 5  Õexc.__cause__0d æ :  B
À	J 	QBaseE½ È=‡	"if.Q*not*pO  D  / n À            û)# passed to throw(), because __exit__() must not raise
  ø# an exception unless@ ôitself failed.  Butp M  0has‘ l G the[ ðto signal propagaq 0, s¿ /isL  QfixesE ñimpedance mismatch between ÿ  X _tocolL  1and+ 1pro. ./  if· 1 is8mvalue:%  Hç  «return Falp/ ô RuntimeError("generator didn't stop aftergp")

cla—dAsyncG3 ñ ContextManager(‰ _ QBase," �AbstractL 
C !  e  ADecoŸ 2,
)ð"""Helper for @a- c‰ m‰ $ d5 Q."""
u ' ð def __aenter__(YV  NA# dor keep args ·ñ	kwds alive unnecessarilyX 8 ñthey are only neededŸ SrecreiTwhichÕö possible anymor@del ˜ .€ ,  ‚  Efuncy 2try †   ú±await anextä U.gen)6 mQ Stopƒ It;ionL  ¯-ÿyield") from Nonen
 Õ q, typ, Ò , Weback„ if#  & N 
’ ï  ó ì  " ð  + @:?elsƒ P"~J "ifõ  — B# Neiáforce instantiY Á×we can reliabš =   ð # tell if we geAXe sam ‰$ 5   ª  =”(Ä   � ê s".aô	l ¤0 as
	 € p# Suppr- ÊÅ" *CR* it'¾é Ithat} O >wasÒñ.  This prevents a8n H  d¤1ideôò"with" statement.sbeing sÅ .edŽ0exc C�	t 9Ô3 Doâ1re-¥ � Åi…Ù. (issue27122öÀ     if exc ¿is value:
   Íreturn False! ð$# Avoid suppressing if a Stop(Async)Iteration excep
 H  ðwas passed to athrow() and later wrapped in  ß RuntimeErrorO  ð(see PEP 479 for ‹ @ genŒ kors; a _ alsoJ  òhave this behavior). But do @onlyõ 6theâ ¯ Q  0by + Á ¿ is actully: Ï K  Íissue29692). Mif (  á±isinstance(ø0, (¯¨,„ ½ /))K  ŸÐexc.__cause__Ê U / )_ ;raiuCd BaseEN0 asy` !# œ1re-I  ¥¡it's *not*…O  œ�that was¸ #—–A, beð ñ __exit__() must not l G  ax unless@ ñ itself failed. cp M  0has(l Ê ñ o signal propag|2, s¯L  QfixesE Pimpedñ mismatch between �  X _tocolL    Þ1pro. ¢0exc3 87Å ²ç n š/  a%("ûð  didn't stop af[nó")


def contextmanager(func¿J"""@ Á decorator.
£ âTypical usage:  Å 8 ,    q Usome_£ Ã(<arguments>x  )   u<setup>=   >try7qyield <U
/ ofinall3  `<clean^ _ Tô1mak'isÊ _with ³  ‘ª<variable>œ b<body> equivalentÌ de ê æ b / =é k  #  ø ô  # 1"""û @msø  ¤÷helper(*args, **kwdsžŽ$_GdCEME", = ; Y 6 \ ~š
e‹ J ƒ#  ˆðasynccontextmanaSger
  ñ async def some_ õ	_generator(<arguments>):5  < y<setup> :try%  ) Êyield <value/ ofinall3  `<clean^ _ ñThis makes this:
  \ ¯ _ with¿ 0 as† zriable>¨ b<body>X Üequivalent toq ö ò 3<vab   =o õ k  ¾     # 1"""ñ Á@wraps(func)  ¶÷helper(*args, **kwdsª�return _AçG×áContextManagerR ", B @ ^ ; a ú



class closing(AbstractK z 3"""  C�automaticíA e®òthing at the end of a block.‹œCode like‡ò‹ Ù<module>.open²)ôfë a ì?is ï
fÅ_ ' ¢Æ îæ f.Â 2e()í ç Öà__init__(self,þ #ng\ p   .?= ‹ : Senter; 4 Ï; 3 xm —*exc_info= 6 ´ aÅ kÿbJ 1""" " c€" m�Á for safely *!iz!n à¡hronously Qed-up½ Ðresource suchëa2  Á , v N aits ``® Ïe()`` methodj‚ b<  ê q^fetchrOagenu( ? xf þ  	y#`await g .Ô ƒ8/‰aŠ
: ‘Ã —É ˜ÿ _RedirectStream±M!_s& r = None‘Æ 	‰£new_targetÓ …† _ 6 =  ^  & ð # We use a listíBold N s( â Îõ s CM re-entrantB h 3oldƒ hs = []¬ qðself._old_targetós.append(getattr(sys, self._stream))
  s$ 2 ¦new_target5 creturnS ! 
V Ðdef __exit__(v ‘, exctype	 Ainst	 Atb):1  Š ‡ 3old‡ ós.pop())


class redirect_stdout(_R Sí f õ"""Context manager for temporarilyI Bing L � to anoth. Bile.ã  ² P# How  ±send help() UtderrÙ EwithY ¢ Qsys.s(  U G Odir)h  Wwritei ja filei `open('F ò.txt', 'w') as f d   – f�  )  K B(powü2"""™ HB = ")"Ž?errŽ60err_	Ž� 6err� ósuppress(AbstractMô  4to <   specifiedËreptions
–After the 5 is:  edì0ecu3 ¡ proceeds € 5 AnextÃðstatement follow„ ! *  €D ¢ ó(FileNotFoundErrorÙ  Å àos.remove(some;Ô D# Ex¥ ñstill resumes here ifâ  5 ° was alread1 Q dÁ Œ 'in C*exc6—  &._ & =D^L SenterM@ :pas' s°# Unlike is”áance and issubZ–, CPython˜ ‘ handlingô  <ñ
# currently only looks at3�concrete  ú hierarchy (ignorH  ï	Š ˆ ` checkh\ ÷	). While Guido considers“ Ñthat a bug ra¾ðthan a feature, it's àairly hard oneb7fixJ !du �various i‹�nal impl°aÚ…details.ù ìJvide– 1e s9 rfù based semantics,³ 0tryù 'to” @exaco‘reproducekQlimitŽ As of ¿¶ pˆ&r.H 
 ñ See http://bugs.p÷P.org/ae120290Smore î A ç  Pnot NQ
R(# ]ýÏâ_BaseExitStack¸A"""A( ™Š # ð and AsyncExitStñack."""

    @staticmethod ñdef _create_exit_wrapper(cm, cm !):+  A �return MA SType($  - )e &cbc ÷
allback, /, *args, **kwdsr ¡ 	š ÷exc_type, exc, tb.  ¤ cW (S Ä Û Œ º l Ç_init__(selfZ   .4 a £s = deque(ú  @ |pop_all? ð4"""Preserve the context stack by transferring it to a new instance.Æ à   Bnew_;  = o %()å ! ´  Ë 9  è  }   	g AApush�   'itCô """Registers a GQ with é bdard _i"_ ª² signature.h  ‚ ÀCan suppress
reptionsI }ame wayI Ecan.ë òAlso accepts any object� -an= #(r¾  £À L !toy °  ´aead of X  it])� Òô# We use an unboundþ érather than a  •to follow‰ #r Jólookup behaviour for special` s‘ 1_cb[ V xÜ s6try     _ô $= > .¿•  exeú  AttributeErrorK P# Not�manager, ¤”ssume it'8Fable·  ‹  [ ._}<^(¤ Jelsey 9 Ì3 ¾Ý @ ø U P  # A|· › “decorator¨ center_ð*cmE$ »uupplied"	R  ë ðIf successful, aÇ ù mes its·aš 2 anù I Í x dresult²"__· ‚l´ b2 upw
Y1 on  ¢ ÑBmatcê ó#ftementh 9_cm‹&cm…â q$ qÎ 
#  e8__(J ý  ùa p ( U ‚ ÚTÕxÏ

¶n arbitrary€and argus÷oCannotô6žÀ      _exit_ówrapper = self._create_cb_ ó(callback, *args, **kwds)

  ð# We changed the signature, so using @P ÷
s is not appropriate, butL @sett1 _‚ õd__ may still help with introspection.A S_exit; (r.E $= Ë - ô Bpush7 ! (  ³ Eper)0 ereturnH ò  # Allow use as a decoratorQdef _` !cmT (s @, cm  %):_ `"""Hel�õto correctly registerx as to _>  ¥ethods."""J  À Ý"(Š ?  ¥ .¸ - c, True	ê 
2  K ,º ¡, is_sync=; û  ' .¶ m  s.›Cnd((4 G ñP))


# Inspired by discussions on http://bugs.python.org/issue13585
class ExitStack(_BaseExitStîóAbstractContextManager®3""" " m Ã for dynamic °ment of a sb    "s.%¶For exampleä�  ()_G #  ‘files = [ ‚.enter_c³ Ñ(open(fname))   @ in 7   %s]ô N Ï 7 !ed$ 0s wv€automati›áy be closed atðkend ofJ  	Å Pstateñ, even if attemptÈ n l [laterG !inc €list raihvn excepø ú7 …__k° Ý ½ jx.  0- é, *exc_details; Àceived_exc = % 4[0]ÔBNoneY  n `manipu× Å ·   te it behavesáathoughË D ñwe were actually nes‚multiplecs< Sframe° @sys.Ù †info()[1õ0fix) R=0new A, olø œ yÔ ´÷2finUchain£  G zwhile 1Õ   ° È3 = � $._Ÿ )__G  2 !if™5 0is ’ ]c8  ­Ñ t  F $# Ø çis already set�Q(see Jf 20317  A  o¦ ª‘ ]breakG �ô 	& 1# C“y	„Àain to point÷ to the exception
  0# w ppect it, ™reference( ð
new_exc.__context__ = old 
+ ð# Callbacks are invoked in LIFO orderf Qmatch˜ Çbehaviour ofH snested n • managers" ‘suppresse‚ v = Fals´ Ýpending_raise ôwhile self._exit_c¶ :a  %ßis_sync, cb =0 i.pop()5 sassert < 	 :trya e þf cb(*exc_details)%  ) ó 6Truò  "  þ &   v ¦ = (None,  
Ú C� ¿  +0ys.[ Kinfo v ¡# simulate†stack of¤Ás by setting# 	N J @_fixƒÛ�(’ @[1],] ¢ :[1]Ú  K 5^ Õ ¦; = g ž 9if N 
30# b1"±g à[1]" replaces (•carefullyp  ¿   #44-up7! »fixed_ctx =Ú7 • 	% d BaseEh
õ  Ÿ 
Ö r 5 = › 	Y  7 ~  Óreturn receivþJand “ def close(ìWø"""Immediately unwindi ”E."""y  C "._0_* À

# Inspired¿ð*discussions on https://bugs.python.org/issue29302
class AsPExitS"(_U ¡, Abstract' C�Má 1""" =Ã for dynamic @mentyað    ô .M¶For exampleÛa­ \ with¸ B) asV .  Î`connec‰¢s = [await( q.enter_S Ê0get 3 .()¸ Ö ib‘range(5)]¿  l   ¢# All openOJ ð s will automatií ðy be released atK 0end$ P§ ú PstateKð, even if attemptsì | + aJ  rÁ  W Qlist ò0 an¤Ú.?  �	 @s �icmethod  ëð_create_async_exit_wróapper(cm, cm_exit):
  óreturn MethodType($  - !)
( �@staticm$  ódef _create_async_cb_wri ÷
allback, /, *args, **kwdsx 6  H  ’ = ÷exc_type, exc, tb4  ³ sawait cc (_ œ  & Ö í [ Ì x Tenter¾ ±ontext(selfù !@"""E* ò s the supplied H c8 ’ manager.d  ‚ ñIf successful, also pushes its __a÷ "_ VU as a× K andÌ  ‘result of�  E  › _F .5 5""" 1_cmS0 = ZF(cm)  † 4 = $ $._™ # t "= {	* ~ 	R  C ._ë \t€‘~ §b < =  Ÿ –  ±"""Register;ñoroutine function with(�standardvä —signatureÂ1Canï@ress� epV ˆ�same wayR F can†Aöòaccepts any objectš .an> #(rÓ 3ing¤ !toÍ 0tinsteadY  it)‚ 
bQ_ &ryõ Â  _n  != -._! exá ú  AttributeErrorL �# Not an7ÿ , so assume it'Ï©  œ  æ e§   v, FalsegJelse� @ É Õ ; (  {#itû F ­ " Ò  # Allow use»ŸdecoratorÇ   y ,è"

áÞn arbitrary cìÚand argumentsÅ?notÈ$ ß 20 = ° .êˆ­Á# We changed¿jõ usé@:Ps is ¬ ÷appropriate, butL @sett1 _¢ dúÒay still help[�introspeé ~; (r.E =“n ú ‹Ã	F l&. *€	aacloseî
èPImmed‚ly unwinK}hstack.êð await self.__aeÆxit__(None,  ð)

    def _push_async_cm_exit(self, cm  !):0  4 ð"""Helper to correctly register ð outine function) 0__aZ %__H ¥method.""" k P_wrap_  = ‡ ƒ._create¢ E " (¡ E 5 Õ - ™callback(^ s, Falseþ ‘_aenter__ø areturn” =
5 h } é, *exc_detailsB ×ceived_exc = % ¡[0] is not¤`  mð# We manipulate the8 !epX st õso it behaves as thoughñ# we were actually nesting multiple with O Uments< Sframe° @sys.´ •info()[1]& G0fix) › À_context(new A, olø à C) A may  beB U’, so findö Qnd of Uchain}  G vwhile 1¥     ° ‹ 3 = � $._Ÿ _� .    ifa!  – 6< or Ñ t  F $# Ø äis already setÜ ùly (see issue 20317)Ò  E   v ¦ ª‘ ]breakG �)	& s# Changz„ ÙPpoint	 	›D w¶@pectªÉto reference( Ž Ÿ$ =9CÓò
s are invoked in LIFO ord�Qmatch2uiour ofs #3ed ø  hFagerþ…suppress³4A ò pending_raise =R ” .z‰s¢0is_|T, cb ó	¹js.pop(:tryF  ,3if M     4cb_Ò i = cb(¨¹  +   OelseI ^awaitO P 7if ‚ Z   r:Tru% š   } "   �? =  )   nexcept� œÖ ª	î V# simµPstackÁa aions b‰ =‡J _Z
’ A[1],£ð details[1])
     øpending_raise = True
!   ÷exc_details = new_ . 9if N :  D :try   ‚# bare "~ U ù[1]" replaces our carefullyV E íset-up context! Êfixed_ctx = d 3.__5 -__7 • 	% Áexcept BaseE >ionä r 5 = › 	Y  Ö ~  ð return received€Ò and suppress Ó


class nullÙ ¢(AbstractC”Manager,  ZAsync )Æ 3""" " m6 ñ that does no additional processing.
µ ôUsed as a stand-in for a normal¬Y ñ, when a particularG ðblock of code is only sometimes ug OwithZ :� rcm = op¯ P_cm iT nÁ Y else5)~ Y "cm •ð # Perform operaN 0, u÷ \ &isU2"""� ódef __init__(self, enter_result=None† x  " .!  Ê0 U ' V C BJ 	; x� ‡*excinfoD Bpass0 a5 Æ ar "
B y Tfrom °Ãvars import ¥,	 ôVar, Token, copy4 ó 


__all__ = ('7 4',  0Var ;  	 = ñ')
"""Generic (shallow…Qdeep)j 6ingPs.

I¥ face summaZ Õ¾  e U   ¤  . 0(y)   `# makeOy     ;  �   ? ;   § 8 ò
For module specific errors8 .E  v�üd.

The difference between f  ²€relevantô
compound objects (	 _ ¹”ain other$ ó , like lists orè in^¥ces).

- A‰  ÿ  d@strub a¶ y ½tx`(to thùôextent possible) inserts *the same’ ’* into it? PorigiÅ   ˜ {?con• ,î¶ursively,
 Š fcopies€  of½ ˜ ! f\"in ‘ Àl.

Two probò&lems often exist with deep copy operations that don't+ 
+ |shallow. õ:

 a) recursive objects (compound  X ô, directly or in ñ#,
    contain a reference to themselves) may cause% u Âloop

 b) be Ú òcopies *everything* itI  ú átoo much, e.g.ˆ €administóve data structure!ñshould be shared even betweenF y ¯

Python'sn` avoidS �ese prob©#byXõkeeping a table ofOpalready‘pied dur) ´the current… y Bpass"@lett ðuser-defined classes overridet Z <  ´1theY 0setŽ æPnents/ ðied

This version does not òy types like module,z `, funcó, method,
nor stack trace, pframe,   fiA âsocket, window ²any
similart C.

Cã @can @ *Ðsame interfacÚo„1rol°  ' ¶ y5 &
t! ’pickling:  W NÂ ñs called __getinitargs__(),
 Pstate 0 an& 5set R.  Se†�documentžC for;!
"‚ !e" binform$  on“ $se‰ Ò.
"""

import Áweakref
fromó Creg ) ‘dispatch_{!

$À Error(Excep°!):_e " =# à   # backward 'âatibility

try8 x Qorg.p%T.core€ @PyStÔQMap
ep ! IÃ ƒ @ $ ñ = None

__all__ = ["+ @", "å    a]

defô #(xÆ O"""Sçâ on arbitrary Ñ‰!.
¯Ø 's __doc__9 H¹ Þ 2nfog–øAls =™2(x)O =Pr = _® _Œ‘.get(cls)t iÀ 2ier K `return× 5ierN �if issubÃ @ ,n ÷  8 p# treat!as\ gu>2 _ • Aimmuh ¶ rgetattrk ""_0 1_",£½ " i" ¾j R a preductoŸ* ^ Dv = #  ^  Helse� k Î ax, "__7 Ze_ex_Ñ  C %ifV ×  % r} 4  
�   l ð … ‚  6 † Àctor:
        õrv = reductor()
 ‰   else:   ñ,raise Error("un(shallow)copyable object of type %s" % cls)
L öif isinstance(rv, str)h �return x-  ð_reconstruct(x, None, *rv)


_z ò	_dispatch = d = {}

def  Pimmut� #(xj Y Àx
for t in (® (Z ñ), int, float, bool, complex® �, tuple,£  ñ  bytes, frozenset,ý ø	, range, slice, property:  w òs.BuiltinFunctionTypeC £(Ellipsis) @NotI‹ ~mented)K 
D ³weakref.refû ld[t] =Á
t = getattr€s, "Code‹ "s@)
if-Qs not…·R a
d[lism   .¨a
d[dic    !se 4set  QParray¬    ‡ ÞPyStringMap i‘   A  C ‚del d, t'@deepŸ  ]Pmemo=“, _nil=[]9€"""Deep )  Éa«ó on arbitrary Python"s.óð	See the module's __doc__ú@ing „¡more info.V2"""< 0if ‘  ä  ” q t é   õBid(xÃ1y =7 b.get(dÉ  @if yM  Â ß Q yx Qcls =Å T ” `copier;/vh ä Œ  if$ , š   � L o› 
p(Âsubclass(cls Œ H    L _� jatomicV  & 
Z   € óVx, "_J _ó .  Ù '  • a (¦Þ  Œ   ƒ ¿Ê_²
Z +  %if¹Å   
Ü   ‹   � ! _e_ex_" =   � n
¿ %  
­ 44) ±  " œ  to¢µ ²  B ¶ S %   
® ­  ( ±  " Of    p ímD Àif isinstancße(rv, str):
   ]y = x Oelse0 ñ_reconstruct(x, memo, *rv)
J ñ# If is its own copy, don't, Aize.) @if y) Vnot xp  P q[d] = y'  · ´_keep_alives ð) # Make sure x  ðs at least as long dG ð return y

_deep– ö	_dispatch = d = {}

def ! eatomics ¥ J àx
d[type(None)° 8 ! �Ellipsis% 
ïNotImplemented+ ?intj Ofloa Obool7  cou x _bytes ?str  ¯s.CodeType%  Orang7 	ÿs.BuiltinFunctiong /s.) ¿weakref.ref— �property 97lisq=	 � ![]ŸöAid(xúúPappen™"y. * ˆfor a in4 (_ "(a—!))2 ±@y
d[˜ 
À   ÷Etupli$, W ¿  t  ¡ Û €# We're èñgoing to put the k  Î    ñ, but it's still important weÏ q# checkh 0it,= GcaseO ðcontains recursive mutableructures…2tryÖ g) ‡ [Œq ö except KeyError0 Apass"  ó @k, jŒ 0zip1yä X Dif kêj?    "(y­    Qbreak] 
� 1 ³®  ×B 
Ø Ù(di´»Ø!{}| ‘í �ey, valueó ‡x.items(ó $y[^  (k,  I Û > ¨l Ð  ¨ 
Ï   ô 
if PyStringMapR €U'd[ @  ¥`method­ž ò: # Copy instance ! ãž  Üæ(x)(x.__func__  @self S )1s.Ml ©c  ¨0l d /f íà ð"""Keeps a refere¥ !toúðobject x in the memo.ð

    Because we remember objects by their id,! Ahave5 õto assure that possibly temporaryC �are kept7 PaliveV °referencingb !m. ´We store a ! @e at" a id of
 ñmemo, which should= ñ&normally not be used unless someone tries to deepcopy: @the U ’ itself..Ž 2""" 1ry:	  . ( @[id( Á)].append(x)! ö except KeyError6 á# aha, this isÆ `first • ":-> _ ñ
=[x]

def _reconstruct(x,¯ Ñ, func, args,€  B  óstate=None, listiter 7dic ; =	 )Ë   ! =}  Ç  i ` A !ifUA and’ 2  Ž    @ = (>  tB(argÂ P) for. 0 in s	1y =Û  (*;  _ V  � ‰rx)] = yÌ1if ÷ ž 3 D  ž 0 =½ ž    Ú  & ñif hasattr(y, '__set) 3__' '   (y. (& Ä   Felse’   Òif isinstance/ �, tuple)M2len j) == 2=  A b R, slo“ " =½  % x   4 Ê    M "    ï  Pƒ__.updatÃ ò  %  K Ÿ !is£ p Í   key, value¤ {.items(o _   4setŸ@ ) ‹  s  … ? ± " ?  >     y0 % "œ{ O   ãÝê 5 ð  Ò 1ð  keŸÌ7  ŒÏ  ê   Â @[keyË& ¼v ) ­ yU `return1�del typesÛðakref, PyStringMap
"""Helper1ñprovide extensibility¿£pickle.

TÞ@only~0ful: Badd $ � support7 I "on„ á defined in
C,!sýTuser-( €classes.§ â

__all__ = ["m E", "33or""À      "add_eøxtension", "remove_e Vclear ó#_cache"]

dispatch_table = {}

def pickle(ob_type, ð!_function, constructor_ob=None):
    if not callU (K ; &  * ñraise TypeError("redu`  i •s must beP !")f 
º [© <] =« 
/ [# Theµ e ñ is a vestige of safe for un¾ Fing.G  re1 ‘no reason) t^ ò	aller to pass it anymore< ,if€ !is* <; Y( B_ob)› s(objectSy	  [ pK iò
# Example: provide_±ing supportÿ  co% ò x numbers.

tryÔ  ²
except Namî  *b
else:¨|_9 #(cß Â ceturn  ò, (c.real, c.imag)E ´%e(&  Q  ¼® P PunionQo "imÞ  òáools, operator
rŠ ¨  .¼De, (' ò.or_, obj.__args__)

m (Uµ(int | str)`… g)

# S^5  s�new-styleW Bects7_reÊ (c­ §base, stat˜   ¼‚ WSobj =T €.__new__G kŸ (   ,  J * k  ' 3if $ ‡init__ !a  €  1 	.  ˆ	S oñobj

_HEAPTYPE = 1<<9
±  S0 =   Z� MPPytho7d× 2.__µQ_ex__Èõprotocols 0 and 1a0ducU`(self,#to)bassert A < 2`cls = - ¡.__class__  V ë ö  in cls.__mro__°if hasattr(( €, '__fla@!')•  ^  . 5 & J VAreaky   Tnew =˜æ õif isinstance(new, Ww Pew.__Ó  __E ƒ m 
3 * `! #õ · lyC ch'‰ 5 ^ £` Ê0 = -, 
c : 6cls7  ö ÷Pf"canEX2e {ˆ“name__!r}	i B }  É  Ö0 = *,V	³ B 4getE  B4.__ ˆAttribut$ @ aif get @ ð , "__slots__", ‡None):
  ù+raise TypeError(f"cannot pickle {cls.__name__!r} object: "G R  ÿf"a class that defines __slots__ withoutG : óing __getstate__ ¤ #be§ dH  p ± protocol {
 �}") from Ï :try#àdict = self.__ %__. ò except AttributF@ e Felse"  P 4 = Ý !()[ 0if  ' ñreturn _reconstructor, args,+ 7 
[ 4 ö

# Helper for __reduce_ex__'ð	2

def __newobj__(cls, *v Hd &*ew$ @  ^ C  B @, kw J £"""Used byÕˆ È4, instead o� ’ to allowl!esW
Àkeyword-only&`uments1 5¡correctly.4 """ÕÔ 
C, **¸ Þ  Ó  sÛ Í R²`a list¸  (  ) tra given» !.
‚ ‘This needª Pfind 6 sA2the4 ñ and its bases, so weG Ócan't simply Î  7 a°ñ.  We must walk downD  0 ñMethod Resolution Ordery Àconcatenate , \ qof eachF Pfound& are.  (æ rassumesË Pes do´ `modify+ !irA W ³  ÅÂmisrepresent. )Pafter Y 1 isG G2ed.^ é A# Ge@ b value¨a cache inH ’f possiblcÈ"= ù ¬‚__.get("²   2__"q #ifù ß!otqÜ3 R# Not‡ ´d -- calculk¬ À 3 Q = []  g `ot has- �#, � sŒ s !# …Ÿbhas noAH  Ã2pas;
T0# SÂ Ó‘-- gather= ä S1all˜‡eK  X  oc\:Vmro__˜  " (ifµ + x
*  .  5= c$ "['ƒBs__' (  B# if•  (‘ a singleÁ 0, ivCn be� as" UtringJ Pif is˜Qance(ˆ S, str'  ! 3 = *      Ñ ò - í  ' ö# special descriptor_ "   Ðame in ("__diÿ	ct__", "__weakref__"):
  �continue! ÿ # mangled names$ Aelif ò
.startswith('__') and not 7end ‘ ð stripped = c.__y A__.l _('_')†  Þ 1if & ?ped_  )  T ôs.append('_%s%s' % (> ,² )j Oelsec  p M I  8 ¨   !)
ý ñ# Cache the outcome in òclass if at all possiblß6try¶  cls.__slotZ Qs__ =÷ æfexcept. pW ð # But don't dieg ‚we can't™ creturnG ð-
# A registry of extension codes.  This is an ad-hoc compres& ð*
# mechanism.  Whenever a global reference to <module>, <Ð >W `bout
# ±be pickled,((0 p) tuple7 Ñlooked up her] Psee
#ï  it! a× KeredÖ º for it.  Eî 0 arD ñuniversal, so that� pmeaning&a© Q does? de©` on
# ¯ ex` !(Tž  are also sY‘ reserved� €local us/aÀ0hav  is. Ðtriction.)  Cœ ®  <@itiv\ ts; 0 is
#/ ] E.

_Ò_è@= {}d �# key ->ø¯
_inverted5  í  de7 8keyl cýi '  6 Pobjecñ D±<Ârebind those§": p ~`grabs ÞY€them whe~àit's initializL ãw` 1see;  a Öing.

def add&(¤_,šA"""R* ànTA."""ø Þp = int( S ~qot 1 <=R   B0x7f Âðraise ValueError("D  @ vbrange"R  ­)= ­  Fif (Î ¿³.get(key) =ƒ 1and±  ï0  } 1  9 ¦ B³# Redundantl ra¡s™abenignb !if\?in ™  W ý  å %}clreadyh Ô ÄMQ%s" %j  Ì   ÷ ,{ S[key]B"ifL  ¥ ü¤ 	 $ ¥ !inË fÂ Ÿ À              ð(code, _inverted_registry[ @]))
- ¦_extension  pkey] = ' $ C ö = key

def removeN á(module, name,L !):N R"""UnŒ eer an ‚ & ñ.  For testing only."""; ikey = [ Æ Fif (| Ê ².get(key) !Ï 1 orI ú Ö /  ö 0  8 ²  . ðraise ValueError("� ¤%s is not Ñ qed withË e %s" %q  G 	  › Ç Odel Ç  [‘G ! ¸ Ñ! "ifz (inI VcacheÌ F v_ D ÌWclearˆ ! (¿ .. ë()

# StandardÓÀ assignments' áReserved range ñFirst  Last Count  Purpose
#4t1   127 C Äfor Python s~ qlibrary: 01284 9@ Y 64  : 2Zopa �192   239m +48' ±3rd partiesU 0240.  55. +16. óprivate use (will never be	2ed)G „56   Inf 	œ Tfutur3  < ;E®ç5s a" ”ed by thePSoftw  ò
Foundation.
"""Wrapper to. ³OSIX crypt 9� call and° Àociated funcD Balit’ò	
import sys as _sys

tryi _Z ‘
except M1Not” I. f@ ò.platform == 'win32'!  j„Iv < S("The¼ p�0supœ âed on Windows"e7elsT ’required À  ^ "waîPbuiltõ  R of C„4")
Terrno 0strÍ& P
from Cdom +�SystemRan  +  1 Qcolle‡s6  `Pdtupl+& _ ò


_saltchars = _… õ.ascii_letters + Pdigit €'./'
_sr4 ƒ  ä÷ 
class _Method(o #(' @', '† p ident ƒ _„ ñ total_size')):
±A"""CS �represenöa7 ! mf  ®"he>Aar C­pFormat ,!heL �legacy 2-o TacterH G)  ± __r s__(selfÜe�eturn '<¹Ð.METHOD_{}>'.™!at1 .â ")
ü mkå (® °=None, *, rxs ` €"""Generã fÀ £ specifiedõ .!If^ ,´@stro:ðt available methoñ	d will be used.

    """ ñif method is None:  #  =! As[0] �if rounds3 1not7 P and  ²isinstance(& f, int)W òraise TypeError(f'{) ð.__class__.__name__} object can] Abe '„     ðf'interpreted as an{ aeger')6 !if£ Ù ñ.ident:  # traditional(  Z Rs = 'm Aelse( ymodular$ Hf'${Q 2}$'bZi !) ¡[0] == '2'\ õBlowfish variantsf 	p
£ © Blog_AU = 127 ¶  * ãint.bit_length¬"-1) .   { †!= 1 << n Ò *   ÚCValuÛ'˜ @must€Ãa power of 2“ 8   ›G4 <=d   /31j 0out^ ðthe range 2**4 to '31t ‡s += f'{Ð 002d½ Ž ,el¾Ñin ('5', '6')±FSHA-n*!ise©ã @1000Ø s<= 999_ ë )Y (toO ñ  × õ z =w	ô  Ù’ ß#f"úñ} doesn't support �%¢argument")… ð''.join(_sr.choice(_saltchars) for  2 inÈ(: $ _ "s)ªðreturn s


def crypt(word, , =‡}B"""R. ða string represent  ´ Àone-way hashIba passP awith aW WuprependSPIf ``u $``AÀspecified or  ``� 1``,!‘strongestO “availablep¶QselecÓ#nd€ ñ generated.  Otherwise,H „ 0mayu0oneÊ  Þ !`` Ð.METHOD_*`` v® s,  a|[ded by :  mká N()``H   å  ã  P 
  A, _Mj�‘calt = V  & 	Ö_¯  Õv)


#  1 9 Aing/) o@1s
mo  É"[]R_add_ (bƒ, *args,Ñ.& $ =¶ 0 ¥ ³globals()['Q@' + W ]Ô } ’ Ÿ   <Y s rR Aresu C; 7try� è 2(''ä< ‘except OSVÀ as e:
     ð   # Not all libc Òraries suppor óencryption methods.
  áif e.errno == 	 ….EINVAL:$  + Åreturn False 3rai òif result and len( )V u ¶.total_size[  ’s.append( )a v 2Truu 	† b
_add_3 ý	('SHA512', '6', 16, 106)$  25 #'5$ ô63)

# Choose the strongestCped vers>ôof Blowfish hashing.
# Early% ós have flaws.  V; ’'a' fixes Q of
#p ðinitial implementa©L, 'b1 @ 'a'o a'y' is= psame as- ð, for compatibility
# with openw$#_bÃ  .
2 R_v inA  'y?a '£9if e€BLOWFISH# ñ2' + _v, 22, 59 +÷ò_v), rounds=1<<4)I  Cjbreak
’ MDŠ«'1', 8, 34±ðCRYPT', None, 2, 1°1dely › ñ 

"""
csv.py - read/write/investigate CSV files. 1
im#Àre
from _csv‡ 7“Error, __ûA__, P !r,] e õgister_dialect, \¹ ð  Lunre' 6get4 5lis sC Qfield8__limih ò QUOTE_MINIMAL,  %AL ¤NONNUMERIC ONONEp ~__doc__Dè  q_ 
& $io9òStringIO

__all__ = ["� ž 3",  6ALL ¢ 	 8E",V"š " ‚   ²   Uexcel	 K_tab@ N ,  / er
 ä3 Â ) Ä  	Æ  PSniffT 	½  , f  €DictRead>   " WÊr– DunixG£"]

class vÑ"""Describe aþ«!.
— ñThis must be subC €ed (see MN)Çóalid attributes arÆ!de• óquotechar, escap adouble c, skipóRspaceÝÀlineterminatx - ]§  Û M _nïA= "" !_v• =•á# placeholders&   ! =G  ` ž  ´  ¾  È  
Î   x 4ing Œ `def __w__(self30if  1.__›ð __ != Dialect:
  ôself._valid = True
  aate()
 Bdef 0    $ !):  7 6try   ‘_Dialect() ( úexcept TypeError as e: õ# We do this for compatibility with py2.3U  p araise T ð(str(e))

class t #l(� ´ ñ2"""Describe the usual properties of Excel-generated CSV files."""} ñ delimiter = ',' �quotecha " adouble lòskipinitialspace = Fals‰ÑlineterminatoM B\r\nP  J óing = QUOTE_MINIMAL
register_d}"ü "",
Q_tab(  (DTAB-d	?\t'Ÿ D-tab£  • § EunixË ÀOUnix¿y½/AL¹ ü 0",  $)
Ò¢DictReader;›_K!__q÷, f, fieldnames=None, restkey 2val » H C=CÓ*args, **kwds3 .  á&._m ' =z �   # listQ2keyÒ rEdictv D Ÿ $ =©  ^  þ	# key to catch long rowsA 3valA  
 > … Ñdefault valueX_shortG  ZF  	 C(f, *, 
 % $ =/ 
  Ñ‡_num = 0R_@·Vpreturn - @�yV  òsô= !if9 	–0is 1·   t 	; R= nexÊ!.rw)…  -    E�pt StopIt-:ionh  & ;pas°t \ . d ˜ q.setter8 ! ,ü(v 
»Z  C  __û Ÿb¬ Z == 0ô ±# Used onlyoñits side effect.§    Š Ê  Orow 	8 … ÷	HÀum

        ó-# unlike the basic reader, we prefer not to return blanks,
  �# because2 ÷ will typically wind up with a dict full of NoneE evalues õwhile row == []:  v  ² next(self.³ )$ 1d =l B(zip" °fieldnames,U ), Œlf = len( " r" 6row ªif lf < lrœ #d[“ €stkey] =p U[lf:]Ÿ "el= >= ±for key in F · K[lr: 
#d[e / urestvali ²ód


class DictWriteµ Ádef __init__V, f, v #, S ö
="", extrasaction="raise" �  ödialect="excel", *args, **kwds)/´ m ' =z  J `# list,Pkeys  § Fã D ¥  l >  #7 Ñwriting shortj)ifÙ �.lower()öDin (é — "ignore"Â  d   V¿xError("(ñ  (%s) must be '- b' or 'N %'"Ë  M  %� ø 	i =* V )   eÇ	 C(f, ¦ž
9  + h÷  e
w Üq•! d Brow(R )~ _æ@_to_€ ¹  ‰ "if(
	#= ´k Xawrong_” s+ owN .\B() -J  )	 8   8if ? 
Y  ! Ù	 ] ’ containsÚsUf /:  ] ñ+ ", ".join([repr(x)Øx*™ ]i#(ré ‚get(key,é 4H t�© ·ŠÖ.4 .Ñ” )c  sî1e Cs(maì	j ¬ sl ð# Guard Sniffer's¬pe check  ag­òt builds that exclude complex()
try 
éqpt Name	  ×Dloat„| $ 1'''h" !s"ˆQformaøpa CSV f°(i.e. delimÀ², quotecharRžRs a D€� object.` h ðdef __init__(selSf):
  ð# in case there is mor õ
an one possible delimiter< ðself.preferred = [',', '\t ;   Q:']

6  def sniff(< –, sample,\ gs=None  1""":  ¯ ñReturns a dialect (or 1 ð corresponding toÏ _ @  L  ñquotechar, double ‹ õ, skipinitialspace = \@  ‘   Ì �._guess_F U_and_0(æ )G fif notš ] D � x * n b  H  !R "s)½ E ¯ óraise Error("CouldÝ gterminD"T TclassÓ"(DÛ x @_nam€">&ed  Blinec Ùator = '\r\n' ™ ù = QUOTE_MINIMAL$ q# escap F 'ù r.,( =:I * 0 (  & ð# _csv.reader won't accept a ¬ … Fof 'È [   =, Nr '"- Æ  ç rc�¶ß	—elf, data>sÁ x §  òLooks for text enclosed between two identicalÝ s5 (the proba‘ ) which ar õeceded and followedA $by e üjacter W ø%).8 aFor ex­
¡ Ó  a,'someÙ %',< 2TheÈ Q with€ ‘most winse | {  If3 š"noJ  »   70 caBbc
ö †this wayU  ’¡ pmatchesÀ]  ¢Prestr q(r'(?P<ž À>[^\w\n"\']) 1> ? “!>[ q.*?(?P=   =? Æ)', # ,".*?"$C	  n P:^|\n7 <A T “ �',   #  n Ü , :$­ n Ü IÒ  Û S %):; 	  Û B (noQ, no “c 9 Ðregexp = re.cð
ompile(restr, re.DOTALL | ÇMULTILINE)
  úmatches = regexp.findall(data+ 3if . :C  N ebreak
 oif not/ ñ# (quotechar, double ú, delimiter, skipinitialspace‹ öreturn ('', False, None, 0( T  Ù %{}˜ a  _   0' ¦groupindex ' �for m inè Fn = 5 !['� e'] - 1B  ;©key = m[n] nif keyjG ’s[key] =  €.get(key + +` /trF  � �  ¡ þ except KeyErrorª �continue×  a and (u  ïAs isÁ0 orö  T )[   /
 ê & Õ½ g fs += 12É  "ax# s,= sà )1 "if/sa D  D  D  Õ h# =W [2 R] == ± Ç    ù '\n': # most likely a file with a single columnH  ‡ I 5 '' JelseØ p# there)B*no*¥  <l, it'se 2 of d ÉY p   
 0oò# if we see an extrab † between“ ås, we've got a| #í7 …d format 2dq_ƒt#.cÎ   ¤   Rr"((%K¢)s)|^)\W*%?E)s[^ ?\n] 9\W*N $)" % \„ !{'Ä³':re.escape‘ #, ÷:Ä à}šŽ
e Ôr.searchˆ
4W = Trc9
- -q Hž ‘�C ±def _guess_ �a(self,vÑsÅ5"""Q6The8ð  /should/ occuròÀ same numberÔvtimes oEÀeach row. Hoó*wever, due to malformed data, it may not. We don't want
  �an all or% ðhing approach, so we �ow for sm+ õvariations in thisM unumber. ð  1) build a table of the frequency ðeach character on Õ hy lineM 2M  I 0iesK  � ] d(meta-$ Gy?),œ ñ   e.g.  'x occurred 5 timeÛ ¨10 rows, 6 0 
I 7# 26 '  a3) useø 5mod
œ  ¿‚determin, §/expected/L '  ß  •Fthat=* ð4) find out how ofte°e. ñ actually meets L GgoalG !5)¹ Ÿ% Cbest5 @its 4   iA µe delimiterE pFor peršÑance reasons,Y  © ; �evaluatedVachunks‚eit canL „try and / D ™ ’ 0porš
e¤ possible,4 5ingO @addi2 2al t Ö as necessary}E"""
5 ³ ñ= list(filter(None,p æ.split('\n')))5 ñ ascii = [chr(c)Qcì ö
range(127)] # 7-bit ASCII< #EÉMy¼ ðLength = min(10, len(¬ %))»  ˜½E = 0  ÝF’E= {}  ±)s  á  start, endY ,M‘ K awhile * & <� :!  “¡ I+= 1  î  5 × [K Z:end]D  H  -  ×  - {#  '  „ú  3  P.get( F, {}D 8  À# must count¶Gn if¡'isf4    Ê C1ne.= h d  e% ; ’	 P   	Ì [b ]:etaÒ   k, 0) +a E    ó 3 [ I œ 1 m / = ~.keys()|@itemCD	3 p .! (º h   !if;  a) == 1 `[0][0] 0s  = �continue@Q# getL _@ * ¦&iek G   
ˆ ?> 1r  O sÔ  �1ax(ª ÿ, key=lambda x: x[1]þ0adjdüà - subtract thïe sum of all
   ÿ# other frequencies( ÿ
items.remove(modes[char]). ! 8 = 0 W[0],  ?[1]B « -È (… €[1] for  1 in .s)‡ _else:[ ~ " =@ I[0]
, à# build a listAúpossible delimiter) V L, =ß .¡ *s(™ ðtotal = float(min(chunkLength *� ûration, len(data)Ü p# (rows“ ±consistent *   / (number  & ‰) = 100%Ü 7  cy ).0 ¨# minimum ( ™threshold,  i = 0.9 RwhileÆ  1¹s) == 0 andY 5>= F ¯ é@k, véa&  ,“if v[0] >d v(?> 0. 2  ((' /–I) >=š *aní  4  (	Ð is None or k¬  /))‚  N * ‰s[k] = vA  ƒ-d*01¨,ifc1p d ! =Ë¶ �s.keys())ù i  ðskipinitialspaceÂ `’[0].countD  Ñ± H  
< r"%c " %GÜ 2 rreturn d ,, � ) Â# analyze anÉQ;linÏ›start = eÝwend += = h bif not± s^­ W'', 0› P# if Xñe's more than one, fall back to a 'preferred'¡SÛ+> Ú dmUself.F 
¡  R1if ( ú'  + nû ÷ P û÷  . Nd÷
#ŽPhing ãÒ indicates a €ence, pib0he §Pacter„t_p# domin: &(?¦¶‘ = [(v,k)jP(k,v)iA# &()¸ W.sortï- `0-1]ê~ i 6maÀ% delim))
    ðreturn (delim, skipinitialspace)


( ñdef has_header(self, sample):"  & ð# Creates a dictionary of types	 ÷data in each column. If anyG  ! i3 �a singleE ÷ (say, integers), *except* for the firstM @row, n  @ row^ ñpresumed to be labels�  I  µ H Pcan't' àdetermined, itH (asG €a stringè 0whié 7aseJ  ] `length  1 s¤ a  D ãfactor: if all0 L Rrows 
A areN Rsame o  ° 'žÈ.H ðFinally, a 'vote'Ø �taken atH 1endb »P, add¦ 'orK €subtract Afrom> £likelihoodÄ Š be+ $a – L rrdr = ruSU3IO(x , ‡d.sniff )¯ �M ò  = next(rdr) # ©{ #isv 9 }0s =5(G )“  TÐE= {}  ióbrange(( 3s):æ2 §[i] = Noneo ©hecked = 0L £Vn rdra Ø €# arbitrZ`numberQ@to cN ,Ð@keepŸ6san| A "if& zed > 20^  ! UbreakŒ   V ved += 1º   !if&srow) !=ì sT ¡continue #d � ìöat have irregular Ó B
p  f0colhClistg]w.keys()� ¡   @this#  ¡  ´xÞ # .ryµ  < –(row[col]    ~ñ(ValueError, Overflow “   8  # fallback°¢ Ì£  3 Ê 7len” . 5if - ™ sÆ í  ”)   ±:>cdd newæ�x  ¦   ¾H =� 4 Oelse•  N #m  Œ ôinconsistent, remove‘  m] C 9 @dera™( 3delP ½ „4# f)@compd D·lts against]Pand "M"n ÷ # on whether it�# AhasHò@col,œ  ™  d{.items(j !yp� 4 Ð) == type(0):û # it's a length
   if ý
(header[col]) != colType:0  ? AhasH0 ] += 1# ?els9 -9 5 ý # attempt typecast^ ?try– ³ 	Ë > ðexcept (ValueError, é  )Y ï 5� vreturn X ð
> 0
"""create and manipul aC dataòs in Python"""

import os as _os, sy 4sys  J 
 ñ

__version__ = "1.1.0"

from _c%  Z ÿUnion, Structure, Array, �_Pointer �CFuncPtr©  * ž  Ö ‘ ³ 3 ÁRTLD_LOCAL,  oGLOBAL, �Argumentñõ sß ô �calcsize«  X

if › $!=,› =qraise Egbion("Vlø number mismatch",O ,M )q ò os.name == "nt"c ©TFormaÕ âDEFAULT_MODE =Å T aposix"rÑ_sys.platformq cdarwinu ò# On OS X 10.3, we use\ o 0Ádefault modeïe# beca* † ô does not work at least on som8 ¶libraries. x Q is D— ` 7, so‡ “check forq athat.
 Àif int(_os.uHP().rem òe.split('.')[0]) < 8] à@ä 1&àFUNCFLAG_CDECL_ 1, \�   šPYTHONAPI.  2 šUSE_ERRNO2  2 žLASTERROR6   

# WINOLE� ¨-> HRESULT  _(ú)
#
# STDMETHODCALLTYPE (j)( = #,   5API@ R
def þð_string_buffer(init, �S=None¢,. ñaBytes) -> character a² Øb ŸanInteger7 k /, ? 1"""ý �“sinstanceÙ b° z!ifì  ç ï   ¿  ! =¯ &)+{½ðaudit("ctypes.createó_string_buffer", init, size)
  ñbuftype = c_char *!   3 = & (8 P.valu:  X 1 `return2  ðelif isinstance(,  Š 1t):   ‡ Ð_sys.audit("cŽ �s.createÂ @None> )itŠ  4 Â  e ^ ?bufÂ © ñ raise TypeError© ƒ)

def cC A=Š P):
##Á ÿ"deprecated, use ¿  Cead"5 ó import warnings  .	 $("{ O is e ,P  Ÿ  D¨ BionWx â, stacklevel=2VÅ ‘)

_c_fun³P_cach!{}4ÐCFUNCTYPE(res `, *arg
 ss, **kw?""", 
ÈÆ ñ use_errno=FalserP_last "or Q) -> � �ion proto| !.
P ” Ð: the result   § ñ: a sequence specifying4 rargumen6 sU ?Ther  ð can be called in di� = sways to/! a  ) Âable object:] Â ò(integer addressé eoreign I 3 S , ×b and r¬1a CŸ v 4Efrom Q „ ñindex, method name[, paramflags]q f� U  ISa COM= a ó(ordinal number, dll)c  ex]ced by K b é  · a * A ^ 1""" ý @ = _¡FLAG_CDECL µif kw.pop("É1", Ë êC |D ŸUSE_ERRNOH  M –LASTERRORQ •Vãô"unexpected keyword �(s) %s" %Ü bkeys()K7tryS o6[$|!, !)]› ¡except Key‹ R €class CF…0ion¾!(_ 7PtrN R_\ 0_ =¹  ðs_     _ !  
  ”   	  Ñ * =° F �¾ tÍ �

if _os.c‚ == "nt"ÿ Ÿ_|#s LàLoadLibrary asü' _dlopen
    from _ctypes import FUNCFLAG_STDCALL as _ 
? �_win_funA ±_cache = {} pdef WIN: €TYPE(resh `, *arg
 ‘s, **kw):/  � ô# docstring set later (very similar to CT •.__doc__)B flags =±   `   ÷if kw.pop("use_errno", False‹  + M |N •USE_ERRNOr P @lastU /orU šLASTERRORY  ‘ ð'raise ValueError("unexpected keyword argument(s) %s" %ð fkeys()(;try[ oeturn Ò [º¹%)]­ ¡except Key™ 
\  class WinF+ ionType(_C ;Ptrv é _j 0_ =Ñ /m  "   _S %  $ ª  " 	 	  í , =Ä 	N rBç # i
¶%' . =ç¥.replace("G", "> ò")

elif _os.name == "posix"o òè /

' ðsizeof, byref, address Palignt@, re' @ !ge0no,Ý %/no) à_SimpleCData

Hp_check_[ `(typ, „code=Non·0# C& @ if ) 1of(˜ s_- ð) against struct.calc' q.  This¨õ
# should protect somewhat= ña misconfigured libffi.> 4^ Le   %if· @ is º ” Ìq# Most ¬  _ Û °s are the sÉ£as used inÂ T  ;  ß  1   =` .C  `actual•0qui¯ =dtyp), Ÿ  TeC !2if : b != re< « †aSystemî ("Ið of(%s) wrong: %ª °stead of %dˆ\•  ³   ƒ ,w ± B))

>¨py_object(;ó a = "O"d 4Ã_repr__(self)  x û”super()._8  3 Þy  ú°"%s(<NULL>)î  —| 0.__Œ8__
ÈÒ @, "P¹é oc_shorç )h"K 4 -9c_uE ÀCData):
    õ6_type_ = "H"
_check_size(c_ushort)

class c_long(_SimpleCData):
    _D lD  3 B u C LC 4 ±)

if _calcž x"i") == #l"� Ð# if int and q ð  have the same A ’, make c_( £ alias forç Ø  = u2   ˜ b
else:. &?intâ  )!i"4 
q inn ) r m M IM  ; zOfloa˜ fz4 D odouble� E dE 5 F  ’ J  g"ó ­2of(}7 ù  „¤  ¥ =l=q= £ > C     ? anH    ”  	 þ!c_D    R  !   0 .~q
 ;   ")
v ¨n   W QW  ##n ôdef from_param(cls, val}$  ( Ñreturn ('d', K(' - Š P L   � vmethod( )/ 
-¿ [Oubyt QB"
c_( A.__c¹0le_ b ð
# backward compatibility:
##c_ucharÀ \ J ˜ ¨   vÉb§  ' ¦ 	 ¥   v   u  ¢ u cu  ' u 	 u   u   u /_pw z^ XÓ__repr__(selfRL±"%s(%s)" % "  ¨  1ñ__.__name__, c_void_p.@abuffer. �).value)²  w_p, "P"¹ D ¹ P0 ) pú 
 6_p )s*¬ (to a bugƒ : ~ Obool| @?"

á  Åós import POINTER, pointer, _
 ]ðcache

class c_wñchar_p(_SimpleCData):
    _type_ = "Z" ódef __repr__(self)  - ñreturn "%s(%s)" % " ñ.__class__.__name__, c_void_p.from_buffer. ¡).value)

5 @ c_wŸ � Au"

š Ãreset_cache(š ‚_pointerË  �.clear()Ò q_c_funcé  pif _os.· ‚ == "nt" ñ O_win= 	(# S.Ë 1_p_õ Qparamƒ ƒPOINTER(! )  $ =, 7 _  )^ 	   ]   \ 6 a[None]‘ ¼täcreate_unicodeË°init, size=7 Œ?"""/ ÀaString) -> ‘ ±acter arrayë 6 �nInteger8 n ?, aA """øãif isinstance(Þ #trØ  !ifï @ is ò & %ofä N2%  ) ñ# UTF-16 requires a surrogate pair (2 ñ _t) for non-BMP( C  #Jñs (outside [U+0000; U+FFFF] range). +1N �trailingO  6NULS .!  íð = sum(2 if ord(c) > 0xj b else e Pc in EY) + 1J  & d32-bitú 5 (1 Rper U~Ÿ Ñ 	]  $# ã  Ñ 1lenñ
¬ Á_sys.audit("=/s.¥!",é r † 0bufrNÎ! *?¯ cbuf = ' «9 "! =Y 1 ~1buf /el³7int³Ä  ÓÊ Ä  Õ€ ¬ Ä « ò raise TypeErrormñ


# XXX DeprecatedãBSetPÑ 1 (ÝS, clsÚ  ³ ô�get(cls,ž)§1not oŠ cRuntim� a"This ¬àalready existsÃAthe 4" sd”  ) a ?in L s ãWhat's this???\ Ó .á �  Í v `  @[cls«5 ’7del‹ Àype_cache[idÿ<(pointer)]

# XXX Deprecated
def ARRAY(typ, len):
    return typ * len

### *ó


class CDLL(objectm ò"""An instance of this / r® ñ
sents a loaded dll/shared­ ðlibrary, exporting functions us @the _ ádard C calling> `conven- ñ (named 'cdecl' on Windows).
, 3Thee 'edd ñcan be accessed as attributes, or by@ Pindex� Pwith • ©  { Â.  Examples:q á<obj>.qsort ->¸ Rable @T # !['$ /']& ' Có 	u ¡s releases àPython GIL dur§  ¢  ,2 ankñ
reacquires it afterwards.d 1""" _Ö ÷
_flags_ = _FUNCFLAG_CDECL# prestype% Qc_int ð# default values for  _)ò = '<uninitialized>' ¢handle = 0 âFuncPtr = NoneU ö __= �__(self,~ò, mode=DEFAULT_MODE, P == ,R   ÿ use_errno=False" @last' /or' 1win}  h  e  � .ò  ù ƒ ]2 = " p" 5if Ÿ Õ R   < |™œUSE_ERRNO? ¼ D ˜LASTERRORH ð_sys.platform.startsg("aix"ï  � q"""When‘ ò ð  contains ".a("Š` ends B M ")"uóe.g., "libFOO.a(	 bso)" -[`is takf o¹n¯  ƒ ñ
   archive(member) syntaxŠ‘dlopen(),‹  " ºÂ is adjustedJ   ’Otherwisei , 0preÕded to S 9ê file argumentL a U   !ifºŠ  -. Q(")") 6!in) 
Ä B ¼ ö|= ( _os.RTLD_MEMBER | UNOW )#!if  p Š == "nt"X 3if Ð ê 1not|
$ | =, `   Nelse1  imà ( (  Ç ô= nt._LOAD_LIBRARY_SEARCH_ÔIDIRSh  @ sif '/' # ®5'\\ †  4 wv °getfullpath Wº9 9  ± |² "LLÊ 2DIR¶ : _Õ3(_C
 DÀ_flags_ = flWags
  õ_restype_ = self._func ,  ³FuncPtr = _ 
" õif handle is None:  p A " ¢= _dlopen( µname, mode)5 ?elsC L � Ádef __repr__T )~ ôreturn "<%s '%s',¨ õ %x at %#x>" % \z  ¯ 1   H Ð.__class__.__§ 3__,)  ,5 6 � þ	 & (_sys.maxsize*2 + 1))7 !ido )2 ç dgetattê  , ‰ ð !if ò.startswith('__') and 7end * ù ñraise AttributeError(b ë  "/«_getitem__& s¦ × ¤  , : â™  ß Q  ; ·_or_ordinalê  : ‰ ‘(‡ 0 ¯)w   Þot isinstance2 7intg   k ! =He 	Ô :³ PyDLL(CDLLT ‚"""This   µðesents the Python library it².  It allow¿”accessing0 1API^ð tions.  The GILŒÐnot released,­ h Qexcep5 C areÁd correctly.- 1""" Pflags1ö_FUNCFLAG_CDECL |  ðPYTHONAPI

if _os.E’ == "nt":ñ;Win" r&Àa dll export ›Â u1the­  E ðWindows stdcall   4 `conven6 á  , å   é rSTDCALL¿ ñ"# XXX Hm, what about HRESULT as normal parameter?˜ ð# Mustn't it derive from c_longn*   _c @s imñ ƒ _check_f á, _SimpleCData_ T  ( à  T  Ã""lÚ  #] pretval_= 10ed F ™ dñ's result when it| F pis used^Àº Qs forK ¦FAILED bit–A „qs an OS�0 if-fis set²#u  ñ¿ `methodÆ #ðmented in C, so t´-## 2 `defini€ D  GbincludE  ­—traceback‰  Å eD" -q "is-�we want (–�E @does"Òhave a way toS  ¶ Î  ‰ §"r'Efuð).
        _checkñ#_retval_ = _check_HRESULT

    class OleDLL(CDLL):   s"""This$ ðrepresents a dll exporting functions us 5theE ðWindows stdcall   $ `conven6 À, and return   .C  ð error values are automatiT ð y raised as OSE+ A Pexcepk sU 5"""  _Á a_flags(ûFUNCFLAG_STDCALL) prestype+ › "

HóLibraryLoader(objectQðdef __init__(self,E H !  r  P._dll $ =" «B ugetattrE GnameB 0if  ¦[0] == '_'Ï a $¡ Attribute'(1 )ä  Û)= Š " sƒ Æ  > Ì C Ì ¾ º Oitemº 5 à ] )E  Yd! ä E ¾ á !__©B_getŒ " =ß€method(_yòs.GenericAlias)

cz  … "er-?
py  PyJ�

if _os.# �B"nt"¬ Ápythonapi = - "("  5ð", None, _sys.dllhandle)
elQ   �platformV ocygwinZ 2lib] P%d.%dQ 2" %] ðversion_info[:2]d /se¤  – /)
× ?win1Win ‚?ole# ‚ëqGetLastž2 = V ¨.kernel32. Öqfrom _c¼0 im—¡ get_last_69, s S1Winh `(code=â q, descr 
Z # 1 isž$ Ò    (= š ("ifS < n ‚ = Formaõ � w).stripH Þß(­ 2 ˆ )¡àsizeof(c_uint)( cvoid_pÛ  c_  _t	, R7c_s 2int|  U OlongV  - W   Ô
X   \  1 `  &
#£/

.ð _memmove_addr,   1  ˆTng_at cY  P

## P# *B ( s, const  , â S_t);
' @ = CgpTYPE(c_5 O_p, 
 = (— ¦ )| 5set{ Àint, size_t)ø
memset = CFUNCTYPE(c_void_p, 
 0int ’size_t)(_9 å_addr)

def PYC Ðrestype, *arg
 ñs):
    class CFunctionType(_ 3Ptr$  ( _8 D_ =  B  `     Pflags _� ÖFLAG_CDECL |  ‘PYTHONAPI8 jreturn— `

_casØ �py_objec&  !)(>   M “(obj, typê x +  ! ¿

_string_a„ @c_in–4 z  `(ptr, Â3=-1ƒ 6"""   Í[" b]) ->  
%R%3the @ at 2 A."""" Ï 6 6_atq b)

tryqfrom _c¥ import _w5 º ‘
except I RError= ’pass
else 8 ( =‚Š µª&m )¾  ¥ » , {7"""%  ÿ 1 / 5 & 9Z «õ)


if _os.name == "nt": # COM stuffÀ pDllGetCeO¨°(rclsid, ri 3ppvø w ’    ’ccom = __–q__("com©â.server.inproc ó", globals(), loc
 R['*']U V Ë    þ °-2147221231Ü €LASS_E_C ÁNOTAVAILABLEì  7     I  Æ .
Ø øÿDllCanUnloadNow(%†…0 # S_OKô 
Æ !

lk„._endiansABigE ûStructure, Little ð


# Fill in specifically-JdÏ1es
[ò8 = c_byte
c_uint u €for kindG q[c_shorGY@long¬    ]á!if±0of(< )ÿ12: n A16 =R /el+  4+ /32+ 8+ $64+ ± u²  Ú  « u¨ 	   µ  9 ¶  , ·  , ¸ 2del-ð

_reset_cache()
©àLib/ctypes.utiñ*l.find_library() support for AIX
Similar approach as done! eDarwin4 óby using separate files
but unlike 2 Ð- no extensioA Y ðctypes.macholib.*

dlopen() is an interface to  ð initAndLoad() - primary documentata ó	at:
https://www.ibm.com/î À/knowledgecea ñ/en/ssw_aix_61/com2 Òaix.basetrf1/™ O.htmZ =AloadX D
AIX]Ás two styles|€ ð(): svr4 (System V Release 4) which:ðcommon on posix
platforms, �¢also a BSDb ñ - aka SVR3.

Fromlð5.3 Difference Addendum (December 2004)
2.9< `4 link0aff¨ñy
Nowadays, there areØ Ámajor object5 ã Àmats used by0 p operatQ sí às:
XCOFF: The 
 r enhanc3 �IBM and ol !s.% ‚original. !(C"
Oy ñFile Format) wasu  ñ0 ofÑ 3O  &C4.2 „ ñ.
ELF:   Executable' Lü P Q thatT @deveÔÖ AAT&T.  Þ
k  yàSVR4 UNIX.

Wh– ³the shared ¬€ contentß�identicalâ 5 - £ is located¶aY±path name
(8R)„  d , S 	9 mÞ ofƒ�archive (\ 4  
o 
@).

¦Vkey dD arises whe{ à`multipJ%bi‘(i.e., 32® Â64 bit).
For eiéQ onlyÿ 0ABIÊ ä`ed, orÓx¶directories 
–¤ � 2CSmost QAsolua ¶µ y  
f  O†  »  (iEAIX)z º2 0y ( bÁ
äsufficient
as i 
"Ðies can be inø  G @- evp0harm ÄAsameK.
In=   ;  ¨ -PreferŽ to\ # "¿"œ  ®
®Ü?is ; a"ÛÎZ(readê)Ñ QcallsEs§ó	.
Default activity occurb1no   inýàis provided. Wˆ # 
#  œ °does not seB anyj ½3iesÑ Ð-³ Å X ¥ 2 !of'  9  expected:/ aFOO.soîâ 3 N  is4 0res50as ’(\) ðsearch is for thñe
base (e.g., libFOO.a) and once the # �is found `shared0 ûrary - identified by
memberV ñ	so, or shr.o) is locatedl ò:loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to us² óVAIX (SVR3)
naming style.
"""
__author__ = "Michael Felt <aixtools@felt.demon.nl>"

import re
from os  áenviron, path
 &sy ƒxecutabl8 Uctype óc_void_p, sizeof? …ubproces( õ
Popen, PIPE, DEVNULL

# E^ 0 E P - 32i�64
# Usedbfilter¼Àearch in an  aive by‚ ", 	á-X64
AIX_ABI = 4of(® s) * 8

­ ì 0max‚ ñ
def _last_version(libnames, sep):
    & <num%   # ñ# "libxyz.so.MAJOR.MINOR" => [ !,  ]S  4 pparts =œ s p.split(w # 0num" [5 2try•  B   awhile L 
    @ ñ .insert(0, int(* ….pop()))i úexcept ValueErrorL Epass, preturn \  ¾[M¤  `max(reU%edT‡), key=_K!)
„äget_ld_header(xð# "nested-functi»€but placŽt€‘ule level  E q = None €for lineJ†p.stdoutà !if 0.st�Òwith(('/', '. G./')ë Xg  Z g   Àelif "INDEX"o   k  " !B Â.rstrip('\n'�" ¿ __info#)@# asQ‚ 3 wa2#, | Qknown'$s,z 5 "d 1#¦!se?!s @ @� a digit ¯ 3 = Ã‹ðre.match("[0-9]"ë+ne T `.appen]"ne8 ^Jelsepq# blank¥  ^ò arator), consum¿ ÛAend ¡ 1oop¼  R   Qbreak   � º Ts(fil­  Á = BParsìß0 of8 IAr seÚ  e$ Öòl Th×0 cacñ/usr/bin/dump -HÙ% s”²  J ¶ €s a listk (þ%,  [‘) tuples.> Å )# £sqBsingl‘# 1. Findb nî "atsQ/, ./V�../ - set® { m g# 2. I@Àn occurs in ð(a following line - return ld_header
    # 3. get info (+ ps start: ±with [0-9]). 3ldr= as = [] ð p = Popen(["/usr/bin/dump", f"-X{AIX_ABI}", "-H Qile],=  „ Ñuniversal_new‚ ñ=True, stdout=PIPE ²err=DEVNULL� ð# be sure to read àthe end-of-filú 1getÏ ±all entries}  wh   l :  �   =_ "(pt  % &ifG;   "•.append((C ,R _tF(p))Y JelseQ Qbreakž "p.r.close(5 cp.wait â¦Q

defv fsharedŒ "s)h 1"""^ €extract >, öable objects fromó >0cha2 Ñer "[" is use�‘strip offM Apath^�rmation.o QNote:   = …and "]" S ðs that are part of R¡ -H outputE   ònot removed here_ Ö Ê d¬2foråg, _) is Äñ# potential memberC�s containð € - ðotherwise, no process>eneeded*  if9 u +inæ6# S5@rail@ ‚colon (:ê m   Ó ] /[ ã.index("["):-1°3 ò one_match(expr,Þ @Must^‘only one 1 %, î p resultù3Nonx@WhenÖ re a5 @leadØ òté ""]„¶#wPnames2 –Gs°between squrbracket¢ Þ   = rf'\[({ Q})\]'’Ï eÇÀlist(filter(Ê ©, (re.sear! ) = k ‘   sº 3en(S f) == 1O… ²[0].group(1Ø
ó-  ˆ €

# addi5(alY�to deal Ÿ²AIX legacy / § c64-bitGs( (Õ�This rout/÷provides historical akaj  Ê@sche¢1ë‚in AIX4 uó library supportE ˆ ¸ ¹Pe.g.,aJ lib/libc.aUÏ / a shr.oN !32ì 0binh "anrcshr_64# # i l if¯    ·&64¸#  ; «  Õ  of€  _ ,	 i @, or 4 d ¯ v „Ò'shr4?_?64\.oƒ  X l˜ s( . #if¦   5Àmember
    eclse:
  ð# 32-bit legacy names - both shr.o and
 §4.o exist.= " ñis the preferredF ð  so we look forC ‡.o firstA ` i.e.,  ` ðis returned only when ².o does not… C  [  µ a in ['� 0', 	 V4.o']ê  ñ ðmember = get_one_match(re.escape(J 2), ( %s)f  = #if 
T   µ  5  ‘None

defr qversionf e O 1"""9 ´Sort list op sƒR  highest nuË 3ed U s - if is¥òThis function is calledWSan un> Ãed libFOO.a(	 qso) has•  wÁbeen found.
 VÎ 1ingà 8ÿñis expected to follow9 ðGNU LIBTOOL convenŸ !s:Eà ™ @ (x, Un X.y
 3Y.zœ€* find [µ �oo.so.X]e    /.Y 	2.Z]Ù `Beforev  « £ b becam ñstandard scheme regardless of‚ übinary size AIX packagers used[ q"as-is"K“E sarchive[Rs but? òan "distinguishing"x !64Ô�­ Pinser™ðeither 64 or _64 betwé P!OOy1.so‹ ³- generally-q_64.so,• @occaÝ  ; Ý#U`expres- D end@ñÓs must start 0# 'Ús[0-9]',3* aºa.‚ne digitãð# while multiple, mÔ€specific›„ ³s could be  !edµ #· se‚– p 1X,  $.Yc.X.Y.Z1 Qafterä è` requiR'dot'  + `ny com% þ î@addi 7al 0 õs pairs are accept  @anytúÜ Cthan™ ¤ )s. | %shò  ìCas aaCàoutside normal,@ecta›  ÁÀs = [rf'lib{6q}\.so\.¤+ Q.]*',q "* O_?64. º À a  Ñ  s  E #2= [-    1 @line1 ò3  ! rm = re.Ë(T  , 1 C #    >m8   s ö.append(m.group(0)> $if…¬  = rÌs _last_J ( bs, '.'E ( 
-Ë ,
R` 0an ¥' × Y •ðrequest in name.ð
    Name is the library n ñwithout any prefix lik% U, suf A.so,K ñor version number. ðGiven a list of me ñs find and return‚ ñmost appropriate resultH €Priority® gT  to generic» 0XXX‹  H  o ‹ &ed a.a.b.cM  x ðfinally, legacy AIXû ¢ing schemeÀ 1"""3 õ# look first for a~ pmatch -(1penr Ú !ap 1.soB àexpr = rf'lib{fa}\.so' ± = get_one_U (4 ,4)* iD:  ÆrCD  @elifÒ ¦_ABI == 64.  T ˆ &64Š  Q J Ž 6ñ# since an exact Ý  dt .so asS`was noa1undÊ xrÖ ?  DIf a{ edÄÓG ,º orïã H  �h ( #&seqŸ Úl(m qs)

defó¢libpaths()8 w Onµ ,×ð buildtime search1  ‚stored iE“executablÁÑas "loader he Âinformation"å€The commð	/usr/bin/dump -H extract%0is = 5 PŒ ibrariesÙðLD_LIBRARY_PATH (Geerred)11LIB ðif defined. These Ü Ps are�ended to û toÝt  ÂPpythod alinked” ¸ °This mimics\ó dlopen() behavio¹‚šû = environ.get("à "ž1 gis Non	 K C ![](ellc  “.split(":` @objeÏë2ld_&s(:Ì  æ (_, lines)`; £ ) #       s   #² second (opsÀal) argument ñ it includes a /Ü  D    ô! =‰ Î 2)[1ÿ     `if "/"ˆ  - 
‡    pextend(& L  ò ª, Ÿ ªb_share6 !s,d© P sÐ ëqdirecto#toµ< n Á#iv¤ h <  Å`abbrevÿÌî‰ ¦"()Í„Process:^ "ˆ "f qrchive,�ðif an archive is ñfound
    return the result of get_member().' ñIf an archive is not F  ; nG ANone0 1""" ñfor dir in paths:  y `# /libK ða symbolic link to /usr •, skip it7 !ifP @== "! "Q  U rcontinu„   p# "lib"g €prefixed` ñemulate compiler nam…olution,p °# e.g., -lc9 Elibc Ðbase = f'lib{B E}.a' -=ú °.join(dir, 7 )' "if  sexists(6 )Ø �1s =›pshared(¦–ld_header: [  : 9  °(re.escape(µ 2),  s: #if  = ï Ý
—  a rA(Ö J 
I Oelse8  V  ,  6 P    ò
def find_library¹ U ð"""AIX implementaÁ ÆÉctypes.util.= i HFindÕñ that will dlopen(). Ifð’availablepalso se² è¡a file (orÈ ) with a .' quffix.
÷ ¯ Ñsupports two ©  ³ rschemes… ²can be usedK ‘ F ðThe so-called SystemV Release4 (svr4)™ 0matÃ¡commonly sŒ e ¤  ¢  wh½  ¡(default) © “ 0 ha– #e � ©Œ bending¦  C c 1 .a (Ash J ƒmultipleb2s (fÐ32-bit and 64 ):1one[M  _ @arguë@ pas#to­ð must include bothŸµ aõ D ï se ó a single string«
8° looks firsþr× 5(.aò@suit(ß C$noC+  pasK,`  ³6 P=  Pÿ 1libIÒ (Ô
† œ 50, ,î1 !if�  ã‹0f"{Ý2}({µ 2})"È@# To‘ƒ here, aï N- ð \ Bbeenè É ð# In other words, ei Õ@# a)T'war? b! 1did£{have a �2 /Sob PCheck+` Ò  „" QNote,Qrinstallkt`prepar| Ä@fromÀ #so< æto a versionedÏ`# This€ ð practice by GNU‘ dtool o.‘platformsZ  soÂ ê é†-so~àlibpaths:
    ð    # /lib is a symbolic link to /usr  , skip it
3   °if dir == "! %":   …continue  she õ	= path.join(dir, soname)' "if" qexists(6 )[ creturn: 9 ð# if we are here, òhave not found anything plausibl› M óNone
import sys
from ctypes   *

_array_ 0 =   (A ó	)

def _other_endian(typ¹ B"""R´ 1the7 ` with  '4 ò' byte order.  Simpl* Rs lik« ñ	c_int and so on already é !__® Q_be__$  Ale__%ðattributes which £1ain‡  Ì ñs, for more complicated± sC  í s_ ¡structuresv0sup<1ed.) 1""" õ# check _OTHER_ENDIAN Š � (presentÀ0typ„‚primitivÿ `if has7  V,O e uÍ?get, –  ifÖ  o Ò Óif isinstanceh  ðf î.) @_) *] ‚._length}¢â ;w ‚subclassw S\u 1typ6 ðraise TypeError("Thisw ae doesø” b –p: %s" %* 1)

t à _swapped_meta‚ &e(‚ ƒ ß"_sY�__(self,É ¿s, value,  Š%if "š_fields_"Ë Q = []×  ;    ˆrdesc in[ 
7  #  x 0 = & *[0>    l 1 Drest= .2:  ˜ .@nd((l ,ß @) + K ¦ w   2 = E Ø —super()._G §] 5 O)

# ,å

# Note: The È Üï’së �*ƒPce* (.Rthe
#uv!) of a! ¥!s_ÚJ !‘determineH2bitÆe in
# ësn ‚ % P.

ifq.[ ÿ/clittle-
=4= "Û ì!"
aL1 Ezõ =' ;Big* ñ,*=Ý6"""d Ê3bigaÉ Ö__slots__ = (/b  þ s ˆ?
el?big îæ  Àcture
    clõass LittleEndianStructure(
 ð, metaclass=_swapped_ C):
  5"""0 q with lU ! eV å byte order"""6 æ__slots__ = () e  5 s ¢None

elser ñraise RuntimeError("Invalidj i ñ8)
Files in this directory come from Bob Ippolito's py2app.

License: An/ ãponents of the( ð suite may be distributed under
* ò	MIT or PSF open source l` Ps.

Tœ ñ	is version 1.0, SVN revi B789,¯ à2006/01/25.
Th{ ‘in reposiÙ öis http://svn.red-bean.com/bob/macholib/trunk  ”ñEnough Mach-O to make your head spin.

See�relevant Der fkÁ/usr/includeb ð-o

And also Apple's documentation.
� 3
__Q'1.0' ‘dyld emul-  ±
import os
Çtctypes.à ³.framework )  __info5 Tdylib1  - ”itertools! R*
try�ƒ _„  _¶ ñ_shared_cache_contains_path
except IÉ ÄM Odef = g(*args€NotImpleY!edT q

__allR[a'™ †find', ' #   . ( ò',
]

# These arðdefaults as per man i ò(1)
#
DEFAULT_FRAMEWORK_FALLBACK = — 0os.ô	.expanduser("~/Library/FÐAs"),¤ "  0Netý# 	oSystem" %]
² LIBRARY° 6lib¡  	`local/ œ  " 1ib"S ù 3Ó_env(env, varä if env is ) z  Á= os.environ`rval =1 P.get(F  1if  F ‘return []'   + Õ.split(':')

  Àimage_suffix© =” © "x 1env© ù'DYLD_IMAGE_SUFFIXw • )y ¶ 
AR vIPATHT l`’R P Ÿfallback_­ ',f ¿ $ÀFALLBACK_LIBöLRARY_PATH')

def dyld_image_suffix_search(iterator, env=None):
    """For a potential path 1 ðadd DYLD_IMAGE_SUFFIX semantics"""
I p . =„ Q(env)$ 3if ' 0is … „  ? treturn w /  Ò u_injectÁ =" ,K =R Ï  K 3forÄ P i  " !if! ÷.endswith('.dylib'F  (   Qyield/ f[:-len, 3] +„ 4 + B ¹  8   Jelsez   R A 	6    	ê„overrideæMnameâB# IfÁ‘FRAMEWORK4ð is set and this¹0ib_D   a} À# framework  ð, use the first fil Âat exists in 6 F pTpf any. ‘ Pthereh ânone go on to ¯C t5LIBåK iF 
 ž =ª `_info(¯ )& &if t t4EY _» Ã
Ê¦0os.  `.join(
 ,j  ['ƒ #']… ˆÕ  �  †Othen\ñ #b m KB—�original®.3 Ü libraryÚ Ö é @base× _�¡executableY ”
 ‚Àwe haven't d3any1ing£ƒfound a ½  1theâ #¼pstarts Ø; "@–  /"\°n construct D Z  ß :"ifGS  R -('R !')Œ i  Ø,nog_ 8 ,r [ik  :N ¥{defaultk
ás  Ô Ù 2,…allback_Q ÷f Ip 
š1 u,V Ý¤  ¢ ž + œ e$ 7 ÿ —P =¾ dÀath:
       ÷ for path in DEFAULT_FRAMEWORK_FALLBACK:
  �yield os.9 `.join(
 ñ, framework['name'])
9 ð	if not fallback_library_6 [ ‹ LIBRARY‰ œ @baseŠ ( ñ))

def dyld_find Á, executable‘ ¡=None, env
 )¡ 1"""Ë sFind a Â 6 orõ a using_ ¡ semantics5 = â † ñimage_suffix_search(chain(8 tW ”_override,  × « /),1 Ü 8 
ù D {default< +nv0 )‰ :ó » %if%aisfile'Q !   areturn„Ã 2tryv !   Aif _1ñshared_cache_contains·\  ; ` úexcept NotImplementedErrorw BpassÏ ±raise Value( ñ("dylib %s couldàÂbe found" % \sx/fnv#G k Ãòa very loose manner.Â öWill take input such asñ ePython„ .s  ñ/Versions/Current* óeV0 = U 	Ü�Û’ÄgQ=env)P Ì›V as e× � e. ñfmwk_index = fn.rv 'ç 'V 8if + F= -1S  r len(fn6  phfn += R y 5n =3 ë ¨Ffn[:_ "])X 4NÜ é5¸ Winall� ÑPBtestžMà�env = {}F bassertÄ% ±'libSystem.Ið ') == '/usr/lib 	 F $ ¥/ N  "/Lo$/FŸs( ÷ 0'

k_X!__“ ’__main__'$í 
épGenericà !ibË |‘ipulation$ ð
import re

__all` 1 ['ÿ ð_info']

DYLIB_RE = re.comp7ñr"""(?x)
(?P<locV ²>^.*)(?:^|/  µ >) ' Qshort B\w+?Hð(?:\.(?P<version>[ù^._]+))?
    (?:_(?P<suffix>[ ñ\.dylib$
)
""")

def  ñ_info(filename):L 1""" A$   ò can take one of the following four formsC  “ ñLocation/Name.SomeVersion_S¥ • j / 
( 	K é 
h �returns NÅ `if not» Ànd or a mappÎ Öequivalent toÑ Qdict(H  °   lã $='í )',!  ;/='
2 Vshort7  vB'='O# "='e )§Note that D R and 2 p are opº!al amay be5Ý 9�present. 41is_pö = DYLIB_RE.matche0 D / e£m  ) a.groupŠ")
ÉBtestu ÎÆä(¢ ó,Ë= i [ F  P  ð�  Ç     g 	   Õ
 ƒ 
 
! ”  
 £  Ž )
 bassertÀò'completely/invalid') i4 e_debug; RP/Foo»æ') == d('P', '  '² C p I 	 O ", #='ª Ý _ /.A[  W /'A« R ­  X   ^ ".A, ° 	 ^ X %, `
if __Š __•¢'__main__'‚Lõ:
#!/bin/sh
svn export --force http://svn.red-bean.com/bob/macholib/trunk/ / .J 7Ðñ
Generic framework path manipul„( 1
im¾ �re

__all5 ['8 *ð']

STRICT_FRAMEWORK_RE = reÝ àpile(r"""(?x)
tô²>^.*)(?:^|/  h> ' äe>\w+).v /" : s/. óƒ>[^/]+)/çÀ(?P=shortnamñ6e)
    (?:_(?P<suffix>[^_]+))?
)$
""")

def framework_info(filename):C 1""" A(   ñ can take one of the following four forms:?  Ž åLocation/Name.w ã/Versions/Some $ !_S¸ A ':  Š f  , 
R �returns Nû `if notñ Ðnd, or a mappÖequivalent toQdict(I    l$='$)',!  r ='‚ 8D VshortI  v…'='…# F"='– )§Note that D R and 2 p are op!al amay beHï Lqpresent €5is_2ö = STRICT_FRAMEWORK_RE.matchÀ? R > ‰È  - a.group²/Ftest‹ 4, N%d(Í ,-= ‚ t _  P  ” ‚ Ò     g 	 2  î
 ƒ 
 
! ”  
 £  Ž lfassert&ò'completely/invalid') i<B 8 /_debug? 6P/F*3  m '÷/F') == d('P', 'ˆ !/F '1
	º %/Fõ S !  j 2', ›#='+b	
i xs,!< //A> +;	d FO, 'AKB 5©,  a 'AÄ_`
if __g __õ¢'__main__'f-¤
import os
 eshutil †ubproces  ðys

# find_library(u ") ðs the pathname ofñ8 a library, or None.
if os.name == "nt":

    def _get_build_version():  " ã"""Return the ! ñ of MSVC that was used to H ‚ Python.d  F 3For É 2.3 and up,S õnumber is included in‡ Csys.} 0.  O tearlier“ ‘s, assumeU bcompilO © %6.K 5""" ñ # This functionË ôcopied from Lib/distutils/msvcZ 5.pyF öprefix = "MSC v.` Hi = » Rfind(/ )? @if i˜5-1:  5rx6  N }i + lenE zs, restp ö[i:].split(" ", 1u qmajorVeð÷ = int(s[:-2]) - s )f * Z>= 13§ 	  E+= 1° >mind Å2:3]) / 10.0* ñ# I don't think paths are affected by P ñ5 in ° K== 6¯ 
• „ ië ; ‘
ñ – JÑ selse we× `know w.Æ C RP ù Es isB m  ÁH ¬ @_‡?rt(¥è!of	èVC runtime dllûˆ =‡ %iff!isO
Oð # better be safvan sorr ÍÏ     \ <¨AclibÊ 2= 'ò '• *el; “< t%d' % (ô F* 10 ªÕ 0CRT‹ð no longer directly loadable. See issue23606 fors¥  â �# discuss]öabout alternative approachesŸ 7 ü  a# If pZ¨ k`t with¥debug mode� rimport  ·lib.machineš°if '_d.pyd'E +  ú.EXTENSION_SUFFIXES,lV+= 'd¤Ä  {+'.dll'Ë«(éÐ0if   “ —('c', 'm'  _ 	ú #œDMSDN–ö REAL search orderr ¹ß0oryt ôos.environ['PATH'E1os.š+epŽ f¯ =f ! e.join(T ,Î q À “- qisfile(D X  * ê  c â   1if 4 Ð.lower().endsû with(".dll"):
  ‰continue ‚fname =  "+ > 	# ñif os.path.isfile(- b  breturnL C  ‚None

elN v ò= "posix" and sys.platform == "darwin"Ê ðfrom ctypes.macholib.dyld import  ¥_find as _ ˆ @def  �_library(€ Á ppossibl	p['lib%s[ `ib' % + ,F P/ '' Àframework/%sU � ,\ %)]] 1for D in “ þ { :try   bô ^ )W  $ þexcept ValueErrorG  X º ”emscripte¾ ��_is_wasm(D V�2# R<ðTrue if the given . ö is an WASM modulÅ R õ_header = b'\x00asm'þ  U openx p, 'br')(0the` 
ø  €.read(4)“m 
a  Ø Y so  V€ k ) ]m  È ‡0s =’öenviron.get('LD_LIBRARY_PATH', '' Y1dirXÜaths.split(":( )  › * 
 … 0lib6‡  ’ “.join(dirÓ°  /   ÷, EE  (  uif not 4.  6 ¿™   ÔG    ä‡p.startsCT("aix/ò# AIX has two styles of storing shared n1ies“ ð
# GNU auto_tools refer toí se�Asvr43aix4  ñ(System V Release 4)� regular&€, often ¯ A .soR 5uffL  µ ­ A useR¡archive (s( B .a)? ðmembers (e.g., shr.o,Ñ bssl.so[ñ# see issue#26439¼ €_aix.py LÂmore detailsuÈ * ¿F(‹ñ# Andreas Degert'sÝà functions, us‡ñgcc, /sbin/ldconfig, objdump_;€re, tempÕ¦  Ø |5elf7ª"®1ELF—"k  �:elf«_7fELF«+Àturn thefileñ$.read(4) == elf_header

    def _findLib_gcc(name):    ð0# Run GCC's linker with the -t (aka --trace) option and examine( L €library e ð it prints out. Theh P commB ÷will fail because weK ð
haven't supplied a proper Bgram¨ ÷
main(), but that does notK umatter. öexpr = os.fsencode(r'[^\(\)\s]*lib%s\. Ò' % re.escapeA)^ B�c_compileT õshutil.which('gcc')w  if˜  0 †H G `# No Cf” õavailable, give up‘  v ¶return NoneÓ ptemp =  ð file.NamedTempoÞVFile(× :tryÉ †args = [é  , '-Wl,-t'
 1o',[ .&  Al' +3]ƒ  œ öenv = dict(os.environy # ù['LC_ALL'] = 'C'ß Ÿenv['LANG »  S  proc = sub
  ess.Popen(× ,]  .  xstdout=F ?IPE@ 8err@ oSTDOUTB {env=env0ð
xcept OSError:  # E.g. baÓ@ecut+æ &ò + '
 # 3  =®"c.¨‘ kfinall>” ŠX.closy f eÐ  “‚NotFoundÚ Ã °# Raised ifµ Ùp was al?±y removed, ½1 is' onormalN  Ábehaviour ofØ!ifA1ingÖs4 6pas  re$0re.œ@all(•!, 6"3:resa�h 2forÖ =in 2 t# Checkþ  n. @s an8 €: gcc caC 6porG na# some(  aat areö �er scriptM dèKactu:ð# shared objects. See bpo-41976 Â ¶more detail. } €_is_elf(ÀÈ "   vcontinuJ  /ñ!deñ? 
pð if sys.platformG†"sunos5"w # £ö/usr/ccs/bin/dump on solari® t`get_soã+(f¨ Ê f]  ¥   © 
Ž  À    proc = sÿ$ubprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
  ‡stdout=sb ?IPE@ 8err@ ‰DEVNULL)ƒ ùexcept OSError:  # E.g. command not found6  Ä ¹return None Pwith :  3 adata = .à j.read(“ ð res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', U 
A !if· >resƒ ¶  ò	os.fsdecode(res.group(1)a FelseS ödef _get_soname(f)  î ù# assuming GNU binutils / ELF± f@  D — e0obj\P = shV ƒ.which(' '°  B   `  f ##  1 is;ùavailable, give up°  T š 	 >tryb   ­ Î0y `, '-p' j Ÿ.dynamic'4š bad execut;	2   1	?ump1#+?ump+;ú ðif sys.platform.startsì  (("freebsd  ádragonfly")):
F  $hð num_version(libqoñ"libxyz.so.MAJOR.MINOR" => [  !,  % ]]  a pš 3 = X º.split(b"."-0numš[> ðawhile Y  t  L ñ .insert(0, int(. c.pop()p )   ¥RValue¨	À  # Ipass   h P or [�Šmaxsize]\ßfind_library(Y e ’bescape% 	n @expr# °':-l%s\.\S+w@\S*/¯ a)' % (P !,  
aF …!en…  )°  ë qa0'/sŠ€ldconfig^?-r'‰)À.PIPE,
       østderr=subprocess.DEVNULL)
= ùexcept OSError:  # E.g. command not found6  B ©data = b'' Yelse:  - Pwith ‰    L  ! ù .stdout.read()
J ðres = re.findall(expr, > 
Ö !if¹ >resp ðreturn _get_soname(_P €Lib_gcc( )O ü
res.sort(key=_num_version' Z óos.fsdecode(res[-1]È öelif sys.platform == "sunos5":ì Edef ” Acrle• z, is64)Ò ê ð
os.path.exists('/usr/bin/> '4  rFNonex   üenv = dict(os.envirè úenv['LC_ALL'] = 'C'D !if« 
ª  ] 0argÂ  z, '-64'NIB b e     j à    >try—  x7 = ,`Popen(m ,‚G  ¹rOPIPE@ ²C {env=envIãíbad executableç "ï Ë±for line iníÌq P ) =0 z.strip(·  $   $if$ @arts~ ÿ(b'Default Library Path (ELF):î H   £ ˆ Í).split()[4]Ë 9 È $	A 
1dir	Caths` ?":"Œ ¤libfile = Çð join(dir, "lib%~A" % ›	h  Õ %if8 ÿQ k   0 µ % 
ï  7i  � ""_lnŽ‹ = Falsek G d ’B F) orí�   »  Š S¹‘_ldconfigP „ Õimport structB  F  … à.calcsize('l')�4ä@machÔžuƒ4(). o+ '-322 G *64G  1 ð	_map = {
               ð	 'x86_64-64': 'libc6,x86 ;,
  K'ppc, o64bit'+  Ospar- @390xt „ X +ia‚  IA9 ‚ }¿ ð	abi_type = mach_map.get( Cine,ü 9')
7 ù!# XXX assuming GLIBC's ldconfig (with option -p)= ÿregex = r'\s+(lib%s\.[^\s]+)\s+\(%s'1 Âos.fsencode(E ô% (re.escape(name), Ó )v Itry:V  Å§ ô
subprocess.Popen(['/sbin/Ï Ž', '-p']M D  gstdin=W DEVNULL@ ?errA +8outA OPIPE Àenv={'LC_ALLþC BLANG ~}) as pM 	0resÚ‚e.search§û, p.stdout.read(š 8   oif resX    qreturn #de›s.group(1U îexcept OSErrorU FpassÔò def _findLib_ldK
5 ù# See issue #9998 for why this is neededd@exprÅ'[^\(\)\s]*lð K' % Å	D  cmd = ['ldˆI-t'] �libpath =qenvironÃú'LD_LIBRARY_PATH'3if ; 
è  j Ú Dd in" ¾.split(':')-  1 úcmd.extend(['-L', d]o 
" 0o',¯ pdevnull_0l%s	 Ä: Ùresult = Noneû ÓGp = {ÒRcmd, ƒ$;std”Súuniversal_newlines=True" Hþout, _ = p.communicate() h µ@all(jT#fs;out b  Û@fileÞnò# Check if the given 6 �s an elf ù: gcc can reportž n   a# some0 ð	s that are linker scriptU Ïd not actualH áhared objects.‘‘bpo-41976�Ïmore detailsE !ifg €_is_elf(Ô ÓÀ              ’continue
 
 ù	return os.fsdecode(file)- �except E Iion:  Q úpass  # result will be Nonw o ' 
G údef find_library(name)g õ# See issue #9998>  � Y _F  So? ’_ldconfigM Y or \3  7 ‘   _get_s3 (? rLib_gcc7 )8 # #ld" ?

# ,€
# test  

  (ñfrom ctypes import cdllÌ  if» ï † == "nt"5`print(+ v.msvcrtÕ bload("! ,")#  O•& } Wposix€ #ÓP and e �_version;  |… b ƒ c! 0bz2# f #}  ñ if sys.platform6gdarwinº ž >SLoadL™°"libm.dylibg  *  Ð 2 ocrypto7 _Systen 4 ¢framework/ ­ #Fó-26439 - fix broken‡µall for AIX9+el;ó.startswith("aix"¯· ECDLLQ  ( S ö maxsize < 2**32Ã $   [€f"Using G |,ýñ RTLD_MEMBER): { ý 'libc.a(shr.o)'( &}"é `   
d Ç \  h )X  # Õñpm.so is only available as 32-bit shared- 9ary'Ÿ %H"rpmØ '   Ê ­  »rˆ 5 Oelseu:?_64xUk ){!f"{i\t:: {k' '8 JI J oƒ o„ : … ð o'))}")
       ‡ else:
  ÿprint(cdll.LoadLibrary("libm.so"))/ _crypt3 dfind_l^ ,  \ ò
if __name__ == "__main__"§ ò$test()
# The most useful windows datatypes
import c s
BYTE = È.c_byte
WORD �ushort
D Élong

#UCHAR1 \char
  W w IUINTB Kint
   i
DOUBL³ ¹double
FLOAC ðfloat

BOOLEAN = ì  i Ã àclass VARIANT_3 ("â._SimpleCData)n_<q_ = "v"÷ deŸ³repr__(self)  Añreturn "%s(%r)" % " 1.__t 4__.Ù , ; è.value)

ULONGª u«   i
USHORþ ´ Ë•
# in the"Ðheader files, ðse are structures.
_LARGE_INTEGEñ 4 c_–   <
_U$  5 á 6 ‘
LPCOLESTe P 	 4 > _p1 W/ 	 $ #  "  ƒE 0VOIû#LP	 # ðvoid_p

# WPARAM is defined as À°_PTR (unsig  & ”L0  Ç0 	. $if‹dsizeof†R)ü’     y£ Ø\­�  s/el|  % € - D „  €
ATOM = lQ
LANG� Á
COLORREF = ŒQ
LGRP   @CTYP 7
LC /
# , 
# HANDLE Ú#s
 I„ \T :  Ã *

HACCEL =N ˆ
HBITMAP GRUSH ø @SPACÜ w G
HDC" HDESK WO ‘ENHMETAFI8@ !FOr gGDIOBJD XGLOBA§ 8HOOd 0ICOU@ iINSTAN¢ 7KEYP KL 9LOC\ GMENU, ¯  IMODUÀ `MONITO!ƒ QPALETÏ E£ )RG 'SRBÀHSTR = HANDLø	E
HTASK = HANDLE
HWINSTA &ND 2SC_)  ÝERVICE_STATUS /
# ,ô-
# Some important structure definitions

class RECT(ctypes.S) ñ):
    _fields_ = [("left", LONG),   $  _("top 	Origh@ 
dbottomC P]
tag� @ = _ 1L =­  Á a_SMALL# È ß'Left', SHORTÉ O'Top  
RÊ " 
BË # &]
¤  Ï  Å _COORDÀ XX † %'Y ]] OPOINäx[  $"y œV  Î 	  –
	 ~ OSIZEÙ /"c~ 
c  W 0 =   |   ó

def RGB(red, green, blueÐáreturn red + (  ` << 8)  (   416)» FILETIM¿ ÿdwLowDateTime", DWORDa}"dwHigh+ 4]
_r 4 =  � ?MSGG¯hWnd", HWN~ `messag¢ ?UIN`"wPara‹oWPARAMÅ l$ L$ t
p8)Uô	MSG = MSG
MAX_PATH = 260ÿWIN32_FIND_DATAAÿdwFileAttributes�
`ftCrea$È‰ÏftLastAccess0 5Wri'_ 
n¹ �SizeHigh· 
* ?Low) 
¿dwReserved0( 1( 
c£ !NaótCHAR * ¼2®cAlternate9 514)¶ëWëfÀ      ("ftLaûstAccessTime", FILETIME),
  ß("ftLastWrite/ ÿnFileSizeHigh", DWORDY * ?Low) 
¿dwReserved0( 1( 
c£ !Naû ÿWCHAR * MAX_PATHª ¯cAlternate:  14)]

# ,ô
# Pointer types

LPBOOL =  c �.POINTER( !)
 oEAN =    @EAN)I 1YTEI  ) aYTE)
P	F    C ŽCOLORREFh   & í j 	 k   ) r ,  /  Ž)
PFLOAT}   Q QHANDLå 
 M  ~)
PHKEYJ   I Kt<  KL  INƒ P # ÀINT)
PLARGE_¡>GERe 	  / ?CID&  0CIDo @LONG! q    & !MS%  $ 0MSG# 3 J 	 '  1)
P ÿ    J 1REC H   &  G P  	 (  Q2SC_— p)
PSHORw G   p 1SIZû ' 4IZE&  � P'  	 (  Ln PMALL_» –    R U
P P   I)
PUõS 
  1 øO ñ!PU÷ H   2)
PÓÊ  ¶ ðWIN32_FIND_DATAA   " J  WJ    J WJ  OR	P-Û   ´)
import re
 4sys Dcopy ' tinspect tkeyword ubuiltinG …functool 4abc, Â_thread
from¤ ’ F6 ùionType, GenericAlias


__all__ = ['dataclass'ik'field F ûrozenInstanceError6 lInitVa ðKW_ONLY',
       ð    'MISSING',

  ø# Helper functions. ™'fields', masdict [tuple Ümake_dataclasH lreplac3 /is1 ¡]

# Condiª ñ  for adding methods.  The boxes indicate what aß u the
# ’ ð  decorator takeA FV Pll of- ð'se tables, when I talk
# about init=, repr=, eq=, orde ±unsafe_hash ð frozen=, I'm
# referr½  toj ³ arguments  @§  ð .  When
# check? ³if a dunderò already exists, I mean3 7 B �entry in~ ¡@s __ÝÃ__.  I never7 pto see n  n attributM is definedL qa base O .±”Key:
# += 
   +8 ð  Value   | Meanò ½ |8 U p ã| <blank> | No7D: no\ isu6ed. p - +	   à |N K ¿| Generatedl  + p +BraisPÑTypeError is  Ö  j  p +0Nono D | A6 p 0seté  Kq p À"P
# __•�__
#
#   Ž§¡ parameter  e 2  vq   c	    ý 1yes B<---â0 ha3r  ÿ??ƒ� Â
# | False |e   8 9 »    8  Tr7@ !<-ÉpdefaultH Cx   — __µ'(  =( *o ¹   ) a /__)˜Q0setñ -  $el I;Þ=I‡ 8 orˆ OÀ====+======="+= â+
# | False |   ò<- the default
# +-  H ÀTrue  | add  0raiX  8 o =x  A
# R& °because not@ 0ing{ ðse methods would break ñ "frozen-ness"
# of ðclass.

# __eq__
#
#Ø  ² â eq= parameter | v$ ú      A  noÖ @ yesÞ a <--- p C hasp ß in __dict__?ú z 8 i-¸    j£  Â²j # lt#S __le	 g g  ~ o orderAHãany comparisonùP2.   U/--`Ê!óto allow this caseÄñinterfere with using
# functools.total_o3ingÍ`hash__¶%  ˆÅ  € unsafe_) ¦"	9 ( ùjT , /K9    $  ¤c .    . 	n 7 o explicitly ained _ü ÈiÿŠ= ™  ‘  C| Noê , °  bÜ	ƒ –b  {-ƒ Nx q
 ƒ P{ BNoneüƒ )<-,¸ zOable¿	ý z  K ÿz F÷@, sovhp ,iŸs overrid� !q ó  � ` | Has_U, but‰ ù  x  x ?À--------+
# †| True   ÐFalse | add   Arais" òNot frozen, but hashable
# +-  - G-+
#m } u Fq )sop = + =  =p ðFor boxes that are blank, __Å ð__ is untouched and thereforÞ �inheritedÿ m ö base class.  If  is object, pn
# id-. dÀ 1ingl Ósed.
#
# Note— P õ may already have¥ ñ=None if it specifi­ ð
# __eq__ method in| O  body (not > €was creaÒ ¡by
# @dataÎ )– BSee ðaction (below) for a coded vers oÿ @is t!.
� Ámatch_args__è !  %  Ñ= parameter
#k v   	 |  R|  no 0yes£S <---ð fhas __g  Ý°n __dict__?­5 +$|  k " |  € Ä 	ÓÃ8 A  <-Ždefault€ º €s always�€ed unlesÇ})àdefines it. Itcöa
# tuple of __init__sÀ names; non- ò  fields must be¨ð ed by keyword.
ÛRñd when an attempq ðmade to modify a-2zen—!.
_ ÏòInstanceError(Attribut p): passl £A sentinelTIP valuÓ„o signalF  ð 
# factory willÔ uv`  This"0givÅ ò nice repr() which1 Pappea›O2funo 1turZ:°es' construv sò ð_HAS_DEFAULT_FACTORY_CLASS:
] deŸ  ‚__(self)   “return '<Ê ?>'
O ? =  f /()K�to detectRa€is suppl]°or not.  Us	aÍ æ = ‰�a betterAô ÂMISSING_TYPEÏ Ô  °  " £ dindica#`followD® ËŸa-only Ï·  ¯ ¨µ qKW_ONLY“ µ   µ  " µ ñ Since most per-—  ‡aHPbe un{,u 8 5 z çº RproxyÄ0can¯@sharáƒmong all£ð.
_EMPTY_METADATA = types.MappingPJ qType({}ýqMarkers>ð the various kinò	ds of fields and pseudo- ò".
class _FIELD_BASE:
    def __init__(self, name)  "   . ! = 7 Crepr7 1 ureturn 8 
u ( =~ "(' #') Ÿ_CLASSVAR(  1 OINIT0  ‘')

# The¼  #òan attribute on the áwhere we store FPó
# objects.  Also used to check if aC °is a Data Cp.Ý ±S = '__datak _–?__'ž Bthatš s› õparameters to
# @^ �.
_PARAMv 3 sv   ¡function, j ñif it exists, is called at~ …end of
#= u @OST_xR_NAMEó Cpost_ì ÂString regexi s `annota� Rs for@°Var or Init ömust match.
# Allows "identifier.  ["9   ["4 ñhttps://bugs.python.org/issue33453} ðdetails.
_MODULE_IDENTIFIER_RÚ ôre.compile(r'^(?:\s*(\w+)\s*\.)?  òÄ X÷__slots__ = ('type', )
[	’ ! aZ  0 =  8 “ Í‘sinstanceç.9 ,? )/_not i$ ÇGenericAlias†   E _– !._ !__Ï  ' Belseù     #z  	Yõ, e.g. List[int];  - f  à Á )( u%f'3es.8%[{B 8}]'.›ã_getitem__(cls¯ Z L (K TIOx(0 arRðly ever created from withimÁis module,
#yBonly$ † q6() Ž’although d Æsn p
# expoŽðexternally as (conceptu q) read-i pR.
#
# , Õ  P 1 fiå�in afterëafact,  nïVAy're @knowY2 0tim? 5  >·  tið, but it's
# convenientH1theS ò available later¯ ’When cls.;SX ±  bp a listç.ï  Ôuñ …ð will have been popuu d4J 
¸ ù%',ƒ « Ñ  default5  _o?ory$  þ À         'halsh',
  _'init compare �metadata kw_only ð_field_type',  # Private: not to be used by ~r code.· !)
 `def __Ã õ__(self, default	  _factory, ' ã, repr, hash, ã  á #, Î !):q  ? h Ê.name = None  Û  ™ $ =£ 
8  ¯ '  
/  Í ! =Ô 
  à ! =ç 
  ó ! =ú 
 $ =
 õ = (_EMPTY_METADATA)  	 5if 8 !is'F els,	.    8ôs.MappingProxyType(F %))m €—$ =¡
 h�! 1 $1Ø return ('F¤!('1  ›   f'ö!={�   O!r},'  Ì '   ' ó*  - 
5  =  .2   '  '   '  J'   ' X*  - è.  / ÿ.  - 1  }Á3')'`�# This is�d ðsupport the PEP 487 __set_à__ protocol in% Eð# case where we'råaing a ó that contains a descriptor as aE "ù value.  For details on‡ B, semð# https://www.python.org/dev/peps ó-0487/#implementation-\ #… BNote° ðin _process_class, t.?p object;³overwrittenD @with
Ò A, so ‘end resul? 	 )E 9hadó p called
Bit a£“right timE ¯5powner, Ãð func = getattr(Ë0 .‰H), 'ü!',éª0if D ; J T ié?  2!hoÁ  ^,Û ÷  A   B# it˜     i 	ž ð, owner, name)

ñ	    __class_getitem__ =  ñmethod(GenericAlias)


 a _Data ‚Params:
L QslotsD �('init',    _'repr /eq Oorde1 ¿unsafe_hash: ofrozen !)
™ `def __ª �__(self,   , ¤ a, eq, ~ ', k ", X )ö  Ù  ; .: ! =A ]   M ! =T 
 zeq = eq q " =y 
 … ( =“ 
' Ÿ # =¨ ë  ‹ ë ¿ œreturn ('Ø%('Z  Î   fÙ%={ó O!r},'  k '   ' #eq% /eq# &  )  /  5 .0  >!r}Ò 0')'ñ'# This function is used instead of exposing Field crea+ ñ0directly,
# so that a type checker can be told (via overloads) 0 t} fis a
#„ RwhoseI €depends š @ts pŸpeters.
íf’ õ(*, default=MISSING †_factory  ×R=True  ~â=None, compare# “ metadata ekw_onlY B"""R~ðan object to identify A i » %s.Î ¿  ~4theÎ ` valueƒ  1 $.  Ú  4 aÀ ¦0-argumentKacalledƒ ²nitialize a} "'sa V.  IfèAis tu P willÈa� S  ! Í &'sw)Œ P\  1 ¨ X aincludvA theB =!'sh"()I  �I & = I ÛL 	� / Eison[5s. ò, if specified, must0qmappingE Pwhichr ðstored but not otherwise examin *ú oI ¢0comß€keyword-¡	³? ")~ It– €an errorÚÌ dy bothqD and }.Q 2"""Ç$if!  Q  Ü �< # ~ raVüE‘ P('canM –  Àt and defaulót_factory')
    return Field(default, 	 , ñ, init, repr, hash, compare,F  J  ðmetadata, kw_only)


def _ff Ps_in_P r_order( !):I 1# R‘ bs the  R as _2 Ð_ will output# cm.  ItÆ ¤s 2 tuplesM E ð	rst for normal args, andA q second  qkeyword! !.
� (W !(f' Df in› Pif f.Í P dnot f.ö 
B >  TBF ã_str(obj_name,‹ A‘ a stringµPesent Beach1 D of D  ba;w ð # member.  So, å ºá is ['x', 'y']ó C ’is "self"÷ #”0 "( 1.x, 3y)"Zð # Special case   ®!0-ã .ˆ 1if S} Ô •A'()'' a# NoteÎPtrailé Ðcomma, neededÂ Pthis ìs?¨ to be a 1p Y ôf'({",".join([f"{å P}.{f.u!}"± 
À])},)'


# Tj ðfunction's logic;ðcopied from "recursive_V$" 1 @ in
=Àprlib module® òavoid dependency.S
G d(user_K �DecoratorI 0makù  v u ú B"...Û %a Z dBcall— ; P_runnir= set()/@{ «ools.wraps� J  
  1per¦  Ù‚key = id ð, _thread.get_idenh  (   0if / !iná� % $ Ö B'...* $pr/ ‚.add(key  <tryD ysult = [¢ Ð  6 mfinall: i kdiscarm    rec M   8 create_fn(},¡õ, body, *, globals=None, loc T  ¡  _ Ó_type=MISSINGDÃat we mutateL Á when exec()È�alled.  C	 re ð # beware!  The ÷ 2ðers are internal‚‹mÚs, so noC óworries about ex3 H }$if– 0is ò ¯ú Q = {}Q Ñif 'BUILTINS'J#in= 5 [) Á] = builtinsG 5`annotaÔB = 'P#ifçS  °Zd _K  €'h  k  § 
o )->< -  È ‹ ",'ª  É   !\n Àn(f'  {b}' fñor b in body)

    # Compute the text of ñentire function./ ðtxt = f' def {name}({args}){return_annota3 P}:\n{l "}'m ñlocal_vars = ', '.join( ˜s.keys())h "g ñ __create_fn__({. E  })a rtxt}\n ~ ” "E ng !{} òexec(txt, globals, nsl : Ins['k Q'](**n Qs)


‹ ðfield_assign(frozen, à, value, self_ !):y Ò# If we're a 2 p class,f"n L � to our ` s¤ƒ__init__E ðvia object.__setattr__.  Otherwise, just usi csimple< c BmentÅ# «   is what " " `called‰ Ethiss: don'tA “hard-code9 `, sincK at might bŽ Ö '� #if
# ˆ…¾f'BUILTINS.î  ({Ÿ ]!},}Q!r},{y1})'• H , ., #}=* 'Í g3(f,’  m u, slotsÑRé ¿	1Bline1eb IÆ  t_Awill¦  # v Pializ. a Y.'qdefaulté n�_dflt_{f.X}é  D.* pfactory¹¶not MISSING^-  s   u1# TÝ | ` has aØ |  R  . ¿áa parameter isÂ  ?   P# giv x"it0 Pnot, B$K 	8 †[Â  Ú ]í Ô 	6 ëx = (f'{: B}()  ” 	 Tf'if ; !ÿ_HAS_DEFAULT_FACTORY= Eelse? '1 `   MiFñ ô0's ’!inPRs, buL S   #‡€ `pt needs3bã :   W‘d here by‰1ing� ŒP ,_`# becaÊ Ue¼   o @ wayq  D·#it¯ z   P# ForåO* fd with\=ºÍ… R dictÓ š ž8 j4 Q(cls.w J	c s).  Butƒ ¿p work f® G c (ž   m`!beQÐF band we0 }} !to¨ @.  WP S G  °# fall backv ý "'se, both³<it'›ðnot set, and bec÷ause it might be different per-class
  ù+# (which, after all, is why we have a factory function!).
G ôglobals[default_name] = f. C 	6 Pvalue& $'{'  9 A}()'( Qelse:
  ² S# No ( ’ . –if f.init1  5  5 ªis MISSING%  ) µ# There's nf ö, just do an assignmentu  9   É .À ”   ,elƒ ?not‡ I	]  a | 
< ) ‘# If the ° has slots,  n <úialize this fieldë "if2 F andÛ /Ô D¹O	ù Þ â Tº @ doeÌft needÞ aÀà: reading from1Iwillb P   T8€attribut'°at containsEž
6J ñ Signify that to/ ðcaller by return‘ NNone@     y²# Only test¯`now, sX  atºð	can create variables fory é #® £  However,ˆ h  ¥  òµ `we're êSgoingE °to actually) (*` state4{ ‚InitVarsà _gP_typeHæ_FIELD_INITVAR¦  Nñ { Pgenerí  � T ±D r ¥ ¡(frozen, fº!, Na, selfv�)


def _’_param(f)™ 1# R· S" _" !_ $ eL0strÒuRS  For=qexample‚€ equival¬ðof 'x:int=3' (except instead  Sint',E !reâc©ë1 sefAint,®=  3'é5 G ; '3)§‰ £BV ß! $ý[ Dk_ sPoutpuÚež F ¢  e€  7¦  " ¥ 4= '@d iÁ   a ’ 0illF Uu  ¾p's used Glook¡ _it up� ¢f'=_dflt_{h}   D f¨ 
/ð function.  Set ³a marker.
  ñdefault = '=_HAS_DEFAULT_FACTORY'* ô	return f'{f.name}:_type_ {G ô}'


def _init_fn(fields, std_ ukw_only ñfrozen, has_post= ,y ¦ p  self_{ €, globalT alots):) "# ^ ô contains both real òand InitVar pseudo-4 #.
C ôMake sure we don't haveA ƒwithout í ³s following" G  ( % ð.  This actually would be caught when exec-I 3theF ðfunction source code, but catch- óit here gives a better errorF �message, þ ñfuture-proofs us in casï Ôbuild up the | E  usn 3ast*Sseen_r = Fals¶ Pfor fV ïŸ È`# Only¡Qsideri pnon-kw-D >  ƒ _v__ call°Pif f.]X  \ ¤if not (f.— ¢is MISSINGû  –_factory ! C H  â 2Truá   Xelif % 
�  ' °raise TypeE�0(f'í Ÿ “argument CB!r} l <  'rs^ G "')ÄÊlocals = {f'£P': f.µ ¥þ}å9 ‘.update({  † 'E$':O™'1/:  6 }§ �body_line« ![]n — Q ( 2 = /D(f, 5¹ ,!sU  Ã !# B ðis None means that t™P doesðfrequirí # maializaŽ@(it'lBù).  Just skip it¯ } Í  ‘ þ €.append($ P# Doe  ‚is classƒ a -� ž?ã *if9l  params_strß‚,'.join(ÂK  �  w‚Eõis _FIELD_INITVAR)B ß 5f'{À�}.{_POST8 †_NAME}({ª $})Ë0# IÕ O ÂÒs, use 'pass'c÷ # Oý  B = [5 ]%D_t    6(f)Å¢:if »n Q# AddÒrkeywordÓ°args.  Beca»  Øa* can ñµbe added if=#E  rec€t least µV ,' � needs toPRa tesO Ð(instead of jóust concatenting the lists together).
  ÿ_init_params += ['*'] / ò(f) for f in kw_only_fieldsA òreturn _create_fn('_@ 5_',c ˆ  â[self_name] + . � 2 ¯body_lines" rlocals= % @glob&  ' Ô ð_type=None)


def _reprã #, H !):é Kfn =	1 	 ('?',)ˆ "['ˆ  & ð.__class__.__qual>±__ + f"(' +� _ ð', '.join([f"{f.5 A}={{R  _!r}}"@ J ü /])t O)"']Ò 0=8v æ ¡_recursiveg5(fnwò
frozen_get_del_attr(cls, Œ ˆ° = {'cls': , k Ð !'FT ÿInstanceError':   }: #ifm ë I } €_str = '…3 ',o ø(p@2 �) + ',)'X FelseS á# Special caset Øözero-length tupleÚS … V S(–0set;_�$  ’  '* >ovalue'¢€  (f'if )(T@) isn@ or B  5{£ /}:Ÿ  ' raiseƒò(f"cannot assign toŽ  {f _!r}")Z cf'supe2¦ 5.__(B !, è )é  U`á

�?del�†vodeleteƒ- ƒ|MM0cmpÃ÷1op,__W0, o9 ¦ 1# Cãñ a comparison function.  If…ï ú »¡object areï#àd 'x' and 'y',6 n†  D ; cstring7 ð'(self.x,self.y)ñ' and other_tuple is the string
    # '(" 2.x, Qy)'.
 ñreturn _create_fn(name,  < 
 ¡('self', 'H /')) R[ 'if—  .__class__›  @  /:'A C f' œ {4 Ý a}{op}{|  A # '@ ÿNotImplemented']s ƒglobals= Ð)


def _hash„fields,   :%� 2 = • E_str*6 ), ‘ m"'__ _È I kfé  © (.)í "is®òvar(a_type, typing)ð @# Thc£est uses a  ¡ internal ï’, but it'�b0 away to0# t @if tO iH C'AVar." -†  <ˆ .' &  @or (® / )0 Ù_GenericAlias5  =  ?é ’.__originªn )xis_init"Adataö 'es'ñe module we're checking against£ h% Ÿ ÷# currently in (^ O.py)' qInitVarO  æ    orªe"3  )ö£is_kw_only1 ', . æ ¤@ Ð # „.KW_ONLYG!isOñ(annotation, cls, a_m' 
  Ã#, + £_predicateo r# Givens&e J îô, does it refer to › n#m  ?  For exaf, when¢Hthat_ PdenotìF ƒ,knU  7,—} v#5ingÁƒ0# I&€possible¶ vlook upY gø BZ„ involve^  5  _rin sys.U1s (o"!)“ ó	seems like a waste sinceÙ  :õcaller already knowsŠ ´ - ¿r å ›Y -ì "he! eþÉ´was found i³-} @ Û € we want1Umatchk x Ÿ‘ "inp ; { t `a func³ °d with (objµT ã2#  i €determin�Pf objI oï‘e desiredš QS‡Ëð not do a local œàspace lookup (ò<and
    # instead only a module (global) lookup), there are some things it
G Ãgets wrong.
Z ó-With string annotations, cv0 will be detected as a ClassVar:C e  CV =  `@datac-   6 C0;  i D: CV‘ òBut in this example cv1Œ ?not� z 1z ·  ’ 1’ QIn C1\U codež @func-² (_is_type)¦  �³ up "CV" inþ 4the¹@and Ë âfind it, so it=   �considerù  tC z@.  T i�ðfairly obscure corn: Pase, i  x 4bes¡way to fixs @ouldS�to eval()DÁ w"3the„ ‚correct |b ñlocal namespaces.  However that we dinvolvG ao Àpenalty for 3 óy single field of M Z ò
's defined.  It was judge_ƒworth itíñmatch = _MODULE_IDENTIFIER_RE. ()ð 1if  7 F‚ns = NonÉ   mŽ_ " =/ ‚.group(1E  % !ifò, S    D# No J p, assumÄ!e 7$'s  "di 8   …# "from #ñes import InitVar".Î  -   Ä Bsys.� Âs.get(cls.__ Å__).__dict__: Lelseµ @Lookë7  º  µ 
� / ? = … |  ¶  ŒkuC ¦ Ã  Š ) Ï 
¶  L aÅ Ès� ôÂ_predicate(nI1c2)), a‡ )ˆ ¢return TruL ñFalse


def _get_	 Ÿ J  b   o,þ€ault_kw_a 2# R[ 2a FE bj³ cXR ±Ê  L %. Áß z#@sTRalso ¦ Âed, but markÂsuch (see f.³ N)ù#«  Ÿ šPvalueæÃ  œ`use if‰¢re isn't a(Q#Xüsâ1# I7 m  ^ C �derived +Ôcn it'sZö jnormalF  !`onvert83to ](â 0def‹ª = getattr²rMISSINGÀ Pif isÔSance(: ,­Àd):
        ñf = default
    else:
   ãif isinstance(( ö, types.MemberDescriptorType)<  @ ô# This is a field in __slots__, so it has no‡ u value.„  H z ¥ = MISSING  À Z ž =, !)
$ °# Only at tŠ ñpoint do we know the name and  Ü P.  Se2 "emˆ !f.$ @= a_	 Z  f.+    	 o  Assume it'õ cnormalü òuntil proven otherwise.  We're nex„�# going tPcide ˆQ ðClassVar or InitVar, everyth4  ÀŸ #vxjust a † Ñ _6_» ” = _FIELDÄ °In addition… Pcheck] ¢for actualÁ here, also % C for~ 0str3 `annotaJ qs.  getr ð_hints() won't always workB 3 usE ñ!(see https://github.com/python/typing/issues/508> “example),E Bplus�‚expensivîÀwould requir 0 ev«"orP Â E È  ðo, make a best effort+ ° 1if lö°G ¶0 us Pregex+"ndC  !th°eH Óng referencedF  Z ‡@ly on ‘e correct˜.È1ForÔ coð te discussion, « [Rbugs.U3.orRT33453K  If[  � ®ðt been imported,h nf  assible�3any· D +b?Uo¬2loo 3 ifB ñ1	 ô by any module (not necessarily cls'Tm$ )Q b= sys. rs.get(' !')z  Ólß�if (_is_c‘Qvar(aÚ2ing8  ¼  Gor (I;,b
(  ,  ‰ Y  š(* 4clsZ  .è ;   L ¥ +))¡/f.˜_CLASSVARþ heeWy'or›Amatc„9 ï¢ #$$an¾ˆ:if ‹ #is”r Meãw3u •0aga§ �  ÒÊ % Á °# currently‡Q(dataeü )   ![_ÿ5__]U HinitD 
ã3_ ',  .›¡  Ñ  À  _is_initvawr))):
  ñf._field_type = _FIELD_INITVAR
, ñ# Validations for individual > ós.  This is delayed until now,E ðinstead of in the Fz ó() constructor, since only here do weC Aknow: v ò name, which allowž ôbetter error reporting.Í ö Special restricÖ ñClassVar and InitVar.z :if )Cin (+›CLASSVAR,<i?  default_faè y+ºnot MISSING–°raise TypeEÅ 2(f'ñ 0{f.ô P} can= �have a '¥ Ö	 'z  z %')/ ñ# Should I checkÝRotherØ@ set<3s? E ¿ C Qseems–ö most serious toT Ñ.  Maybe add `  27ForG ñexample, how about init=False (ËBallyO â #! “<not-the-£ -7 ð-value>)?  It makes no senseæ y ÷ ¾ s(#fye •anything>H1kw_¦v9¯assignment<33# Fò U Ž–ds, if  rwasn't ® iy seŽâ  –  @—G /is‹$f." = b Felse½µ# Make sure¡ i   etx ns>  ‡ lassertasO`0 ·  	F#Eis a‘ 6 buFsT$')V¯ªas, dis”„ mutable>¤ Ê n us‘Ö Œi is?sance(f.Ðp, (listk 0ct,¬ÞDVEŠ   {€ P !)}¢Á  	%f'ˆiVt}eed: usè *#ðreturn f

def _set_qualÐR(cls,ž6A# EnE@thatÎC fun«I ðed from _create_fn} ˆRprope\5# _g @__ (wcè U Åy belong to)†j03, F{  �   ¸ ._ ‰= f"{cls 4}.{+  í A__}"ÌÈ ÷ Ònew_attribute 7  ð	Never overwrites an exis¯ @ ð .  Returns Trueñ if the
    # attribute already exists.  ñ	if name in cls.__dict__:  A ¢return TruQ �_set_qual7 Á(cls, value)2 0setp   " 	 L ðFalse


# Decide if/how we're going to crea¶ ð hash function.  Key is
# (unsafe_! ð, eq, frozen, does- -í P).  V¦ 0 is! aL ñ to
# take.  The common case* ðo do nothing, so instead of provid¬ 5a
#Ÿ P that< ða no-op, use NoneÓ qsignify% q.

def ½ UBnone9òfields, globals)Ž> L ; ?add6 	ð flds = [f for fé_  &�(f.compar„0 f.2 ½  d S else !)]Þ‚ ® 
Æ 0fn(o ¹ )© PexcepÃ¯ 	µ# Raise an 0 ªr ðTypeError(f'Cannot overwri+ë_‘ 1_ '¹  É !f'ðRass {÷ ¬¨__}')

#
#,   /+-  �?F |K /  M ? eq= D A H  n‘-explicitCL |ò m 
 	 �@ q  vc B  v
þA= {(Œ/,   !):·,A4  ! 4  - ", v 4  ; h  & a Þ +):lÚ 
>   r  - y r ?addm 9   m   _ Ø  m 9    m p¬   * x  x 9   x  1  ­x À            ³   (True,   aFalse, û ): _hash_exception,
  ? F ? ?add9  @ x ñŠ}
# See https://bugs.python.org/issue32929#msg312829 for an if-statement
# version of this table.


def _process_class(cls, init, repr, eq, order, unsafe2, froze0 ñ   match_args, kw_only, slots):`ð# Now that dicts retain inser‡r ó	there's no reason to useF "an) !edH ò.  I am leveragingd o¿    N f, becaD �derived ÿ ù fields overwrite base ’, but the{ Š Ñis defined by 9 ñ, which is found first.: p Q= {}
 ò
if cls.__module__ in sys. sA ¤˜globals = [= @].__b!__] FelseA à# Theoreticall¶ Àis can happeF‘ someone sD  { à# a custom strZ+to·  Œnù #ca²< ’such datas°won't be fu† ‘introspec¦s ñ(w.r.t. typing.get_type_hints)–pwill st @funcJA ’correctly{ � D€�setattr(´_PARAMS, _D¯ �Params(i"m  \  M "))§# Find our es
rÛbse MRO€Ä, and exclud’ourselves…4 d1 2 soYmore þeâ#ÿÂride earlierâiVŒ âj ”As long aF Àwe're iterat$ U óm, see if any areL—Bany_\_a != ²[Ehas_9  ÿ   ÿb'Øro__[-1:0:-1]ùSOnly ùÞ"es”have been Ò1our‚  Õð # decorator.  TÆ0is,Ú !y ?  a _FIELDS KRibuteÜ  >  Õ _÷go$b,4 u, None)n !if3 it$ Ñ  X  oK  '  #f#ˆ ƒ.values(ž '  © É[f.name] = fN 8if Â /").À
   R Ü  S ‚# Annota_ V"in¼4D(notÅ >  ðes).  If __annotañ0tions__ isn't present, then this class
    # adds no new annota? ’.  We use2 öto compute fields that areG Red by/ a .  " F7 ÷are found from cls_v ô, which is guaranteed to bh ð	ordered.  Default values‹ S òass attributes, if a· Œ rhas a dA P.  If R  „ a¶ #()=#itA €contains>i0`al inf¨ ðyond (and possibly including)g C jactualt £.  Pseudo-eC©PVars Q BInit w[  ed, despit¯be fact¡òthey're not real”s.  That'òdealt with later»�  =¯ø.__dict__.get('_¿“__', {})
ä `Now fiìýbin our aàhile doing so,x”idate somðqthings,  seÖ e4Cs (aÒõU) whe&fwe canÕ ^C= []ª ð Get a references*Pmodul²r»ò _is_kw_only() testU òKW_ONLY_seen = FalsÁ Adata¡es = sys.mR ¢s[__name__‚ @for  �, type ink[‘.items():± »0SeeÜ© iÒ`marker½ Rchang C of ¹ ²  B Hif (Ò  { ', ³ )m  / ò or (isinstance(. :str&  *  ­ Y  # ( 9cls[ 	 .@,p  J 	  S Å '))
 % �# Switch§Ú 	0 R=TrueFPignoriþ >   #ÿP: it'8; 1 3if ¸ øš    ðraise TypeError(f'{ä0!r}]< T, butI / 'A   '½€lready bpªspecified'Ša � 0 = 	^  JelseÌ €# OtherwÎ N U «´
 ;fÑ.append(_get_ ( 
î,š)9 f3 s‘  0[f.A R] = fn q## Ês% (W+th@ n  C#%r) exist{ isí  Ð! 'ÊÃ', replace i:"thôŠ n‰o isö"so™bnormal` introÇ Kˆ  seÙ¹K  % Ê ÑŸzÀ     if isin÷stance(getattr(cls, f.name, None), Field):
  úif f.default is MISSING%  0 ó# If there's no 4 €, delete p class € iibute.j E ðThis happens if we specify fŸ  (repr=Fals² ?forD  Àexample (thaµ ,F Ried aJ Ï object, butE  Ã â value).  Also• ´'re using aê D  Üfactory.  Theþ ÿ should not be set a‰ aall in@âpost-processedQ E0delcã)� NelseÁsü!)
C @# DoN‚have any4‘ members qpdon't a,' ¡notations?E Bfor yZ Þ ÷cls.__dict__.items(‰sif isinÃ5 ®2 anC Q J 5_anr 
è ðraise TypeError(f'{8 0!r}Üabut haÆ0typè O '£Check ruleö Rapplyñ are derived from*Adata"es´ iff _ f_bases± 1# R¯ €an excepB a  wqof our 2 o afrozenÍ0 weŸ2noth  Y if„ _& i 9 w  / (!'cSÒ inherit non-8  ¿ ê ! 'ä F  '7 4oneM ' ì Ë 4 Ý \none ÿ 	é  Q=anyí F é 4 å  é B# Re* Õo0�As onÒ"€ (includ`ã } [#\@mark|"is	` as be3 a° 	Ûƒ_FIELDS,y Ò)WaN Ñdefined with ƒñplicit __hash__?  NoÙ ef› `__eq__NA ¼¥ ,Èón python will automaticallyF  h 1 to¡F is[ Àa heuristic,÷ Óit's possibleC ‹esuch a³ 1 ==K ! wÞt| ¢-generatedai…â# close enoughH�ÿ 9 = ³Tget('² $','xbhas_ex?>  ¥(P [ Ô  # 7  ½Í'|'ð .__dict__))

  ð  # If we're generating order	 ùmethods, we must b( `the
  F 3eq , . "ifE Á and not eq:  / ðraise ValueError('? _ Utrue ? 0is  1')
> ñ# Include InitVarsa ñregular fields (so,u PClass& ³).  This isH ðinitialized here, outside of the "if % ð:" test, because std_ _n P ðs used with match_args7 2low8all:   = [f for j ½  .v1s()X  . Rif f.| ò_type in (_FIELD,  ¡_INITVAR)]E (² , ˆ kw_only’ B) = [ Bs_in (» �#Q 	`Does tkc}Ð have a post-6¥ function?5 @has_  p ñ = hasattr(cls, _POSTÑ S_NAMEy  �_set_new_- Ribute2 !'_I 3__'é  -  % ,fnÛ 5 
G S 	 r n ofrozen, 	N3 Ð# The name toÇ•Uself"ª×  p# param���.  Use "E  if,Rsible5^  q'__datan_j 0__'@' '� ¨G 
 Relse B Cglobals- Oslot+ 
)çQ# GetŽÄ € as a li� Yi ÈT realEî›din allàgfollowåoi _c Ÿ cˆs]¬vif repr÷fœô n Ø 1 µ �â )  â! _
 0fn(^ #, ˆA)ifyó # Create __eq__³Ñere's no need ea __ne& Ûð# since python will cZV  š0negh "itV Î  ¡ Tÿ vcompare Ä`_tupleš	 S_str(› T *_other/  ð', flds)
        _ÿset_new_attribute(cls, '__eq__',
  …_cmp_fn(- O '==3 M óself_tuple, other o 	< ƒglobals= 1))
6 ‘if order:  - ò# Create and set the$ Åing methods./ õflds = [f for f in field_list if f.compare]4 È 2 = Ä `_str(' 0', T ). ê /  0  ˆ 0nam$p� [k lt˜_ '<')ž* e* =+ gU >* U >U ]‡ ‹Oif _ká # -  n0 P op, dtEd DL
·  & ðraise TypeError(f'Cannot overwri`=  {ž ?} 'Ð ðf'in class {cls.__: ð__}. Consider us¨L ñ'functools.total_Fing'ffrozenÞ  [ fnU_ �_get_del
þ#, ))B  ×%fnÔ K, fn9  = YP `*ð	# Decide if/how we're gosCto c:a hash a2ion-  p_actionÇ Ð[bool(unsafe_ £	 !  2 /eq) ¬- Áhas_explicit‰ ³!ifÐ ½ Ì # No need û ?all® ñ  here, since byMEtimeë#D (  ! S is uncondi7"alJ þ -H__ =  †ò ˆ0get¾. —'__doc__'qr¬doc-string‡ < 0 = M À% +ä  ±   ëñinspect.signaturB÷
)).replace(' -> None', ''®¨match_args‰ðI could probably tÆute this oncqR6'__\  ¿ À            ñ( tuple(f.name for f in std_init_fields))

    if slots:   ±cls = _add_ Ã(cls, frozen5 ðabc.update_abstractmethods- % øreturn cls


# _dataclass_getstate and s ‘re neededÀ ƒpickling… 1
# H res withÀ ð.  These could be slighly more performantò ðwe generated
# th7 ðde instead of it  u Rover 5ð .  But that canf �a projectª ð 
# another day,k y ø	ce becomes an issue.
defb(self)“G�[getattr ", Þ)u ß¡  L)]

Z [! !, a " `, valuX zip(R 
2  &r# use s•  Ú a ä@ may7\ ob+3.__9 #__‘ m ²† )Ä ˆ2is_T ¾ Ñ# Need to creTB new! , since we® 't¯ " _Ö!__• ¢#  after a3 “ has beenO "d.'¶# Make sureB à isn't already^ .U Eif 'g '}Âcls.__dict__× Dòraise TypeError(f'{)  º6__}Z †pecifies| 'f8# Cø  c 6our	— 1clsƒ 0 = '  «• )¹ †_~  H$ è5 W [ô 2] =3M ]  Š h  K  �# Remove Â  òbibutesMpresent.ëÑy'll still bea  S ÐqvailablÉr_MARKER ! ® 3.poã� e, NoneTƒ ³0 it’F 	B '# 'B ³And finallyKg H @qualk4 = Üj4'__ %__W ¼ p = type¼) !._¿ 0__,iƒ.__bases î¥4if U q is notñ Œy$ E__ =1 5if |7 1hisw«U
©¬s ôs % / É/  ­ 5| e™ 5=ì€, /, *, ³=True, repr #eq	 Åorder=False,‹  �Ó  unsafe_hash! ¡ ¢match_argsM @ tkw_only. m ÜA"""REs<sÐúð as was passed in, with dundeò"r methods
    added based on the fields defined i qclass.
5 ðExamines PEP 526 __annotations__ to deter& P ; ðIf init is true, an __ C__()›   ™ !to“ } 1 If @repr# A 0 __ @ —. If orde0 ArichG àcomparison dun$ B are@ ·unsafe_hashv C _ z @func * Ã C `frozen ´ c1mayG Ànot be assigs`to aftµ ±nstance cre]N ¥match_argsR G  ½&__  ‰@uple& Œ pkw_only � bthen bŠ ³default all¸€keyword-9 ƒ Fslot~ 1 an� !__ ·__ attribut| " 2"""Cádef wrap(cls):  �ñreturn _process_ù $ ,7 , êR, eq,×', ž,G  K  †&, "#, !, º )� ñ# See if we're being called as @dataš 7 or 1().‚ Qif clFNoneÝ 1# WP J ²with parens8  ²  Œ 	5 
  C 9outF B  9@)


ms(· S_or_i[}B"""R|1a t5pdescribû  Y@ • of this Ø–Accepts a  4an i  ; aone. T_ `elemen2 Bre oÙ`type F.‘# Might i(¢worth cach� �is, per Ü ?ƒ6tryx» P= get™¡, _FIELDS)>  exÍ $ AÅVErrorP ¡raise Type Q('mus™ Ù	Ø %or'hò Exclude pseudo-ª Ä.  Note that†pis sort¬yH  erf® #s-ð©eÌ is¸ÇDwereâl7üp(f for «€ �.values()1f._© _Ø #is=jE_is_hL(objlQs Trui0obj‘/D.!1hasË ƒ [ Ãñ† " Áé} »
alØ �  ê!= À Df isî r  , ž `) and ã ñGenericAlias) else1  ; ˆ”ì =clsæ `asdict3 P, *,  �_factory= sÀ """Return tò2he fields of a dataclass instance as a new dictionary mapping
   ? “ names to �values.
" âExample usage: 5  @l % "  x #C: §    x: int y  ³c = C(1, 2) �assert as­ ò(c) == {'x': 1, 'y': 2}� °If given, ', ð_factory' will b® !ed0ead�built-in.p T>!unü applies recursively‘ that are>  f  lrs. Thisƒ �also look%o  ¢containers*ñtuples, lists, and¢ s£ 1"""m µif not _is_x _äR(obj)N  vóraise TypeError("O€) shouldŸcalled on3 "s"�‚return _? `_innerk ,¡ r)


def'   /ifÄ ¡esult = []  Ø ‚for f in¤s‹ ö  " ·+ =Œ cgetatt»  f.ë)Ä  >  r| ’.append((2 !, ] ) + ~(; $ xelif is¥!, î)æ6has— "'_Ç'Ò q# obj iÀAamed< A.  R¢eXÑit, but the r±%ed2B 1ectE anotherêK   7 ²same type. À'isB psimilarBhow E  ­B- orÐ ‚-derived%es# 'ò# treated (see below)´ Àwe just need` c)  Ë m� ðdifferently becauseÒ±'s __init__J Çb¤� íI Œ “po-34363)ê/ 1I'mmWusing0 i (â/ tmethod,œ è ‘- it doesP Z ¸ í  z ‹Œÿ û `  conv@them6  n2s (›   ‡0x ðI don't actually wantA $ +rict heröie main{  hAcase%  B“json.dump§¤it handles§ T†  <• 6Às.  Admitted— qe're lok8som·�  informa·† Ðwhen we produÝ • <†ìaÉ  'r.  NoteÂ ifD 
eo`  ­D 	B ¨ s,; cGnàPnger aµ)UŠ	D °structure wv	Ã’ was used® ± G key–­ ¦Ð(obj)(*[_asdiñBct_inner(v, dict_factory) for v in obj])
    elif isinstance(obj, (list, tuple)):)  - ñ	# Assume we can create aQ ðect of this type by passings aF ñgenerator (which is not true¥ Qnamed §s, handled@ uabove). areturnv  Á Q)(_asú  C þ f g ko,   <
 ¡ ” 
2   Ã%k,Æ‚.items()2 Uelse:v ° �copy.deep	 ‘


def asb  3, *ï-= þ C"""Rc�he fieldsìÄa dataclass B¡ as a new B  ' 1 ‘ values.
  ò Example usage:: 5  @P & "  \ CÕ ƒ  x: int   y  ¢c = C(1, 2eassertë cc) ==   1 ±If given, '°  €' will b£ !edÞ 0eadÎ ‚built-inà …Tòunction applies recursively to7‘ that are„ õ g  ‡@s. TH„ �also lookø %o € ¢containersÀ 0s, ½as, andÿs£ 2"""f!iflE_is_y _¾ õ [ôraise TypeError("4€) should!Ÿcalled on "s"ˆŒ_@ ¡m· w)œ) ô ?if É ¡esult = []s Ý  Kf› sû  " ³; = Ž pgetattr1 @, f.­)?ö  D   r~ �.append(V ! 	(2 % £/ )å6has� "'_Î 'Æ#ð d a ¬ YA.  R¡eWÑit, but the rí	s0objá§is anotherK   7 Asame…". ¿%ism�# similarBhow E  ¬B- orM‚-derived÷%es" E1# toÒd (see below)´ Àwe just need` ˜Gthem� ðdifferently becauseªk±'s __init__J sK b£� êI Œ �po-34363”	+*[Gv4û #À      # Assuó*me we can create an object of this type by passing in a
  ÷(# generator (which is not true for namedtuples, handled@ uabove). areturnv ‘(obj)(_as> ¢_inner(v,  �factory)e v—  / H ð elif isinstanceH �, dict):   ½ h i ki /, ‹ )^  b 
  4k, © ‚.items()3 Melse› �copy.deep	  Ä ð)


def make_dataclass(cls_eñ, fields, *, bases=(),€ÿspace=None, init=True,® Brepr 3 eq	 ó	order=False, unsafe_hash G cfrozen! ³ match_argsR tkw_only  Rslots ¢B"""R	óa new dynamicallyª%d !.
ƒ 6The ÷ ¤ will be '$R'.  '''ª±an iterableD °of either (S"), ,� ) æ   0, Fq)2Qs. If) 2 isN ðmitted, use the strC°'typing.Any‘ F E E areã !byH  ; ‘equivalenš 
J Ì ¬ ” # [– ƒ-info])'\  C =:ð 'C', ['x', ('y'tó "'z R(3 5))]\rBase,))}7is ¢ 2to: 5  @§Ë !  µ0 C(? î*8x: /   gy: int z " =ò  w 1ForpA andò  parameters, se˜cbuiltiv£) function< Y6 A , )a, eq, 	,s Ð <Qed toÄ (ø2"""¸ 'if© 0is ² zÄ B= {}2 `# WhilÆ€'re lookqthrough"W p, validè@that a#¦ �identifi ‡ È`keyworVGÒot duplicates¶²seen = set(Î`annotaA!s ª  Äwdefault    »¥ së 
À & ,=	0 Õ   =ÂmY h   Otp =L@len(S f) == 2u  ;  d\, tp,X : 3: Lspec?  \ [e ]35pec¹ 
 0 ñraise TypeError(f'InÁ÷0: {Æ C!r}'… 5  C(otþ n > Àànot name.isideÇntifier():
  ó raise TypeError(f'Field names must be valid ideF @s: {" U!r}')P Óif keyword.is
 (' t !nox E o  ] � in seenØ ¹ duplicatedÈ É  O B.add½  Àannotations[z q] = tp
  ó# Update 'ns' with the user-supplieUðpace plus our calcul‹  eAues.O ÷
def exec_body_callback(nsKAns.ut § sX Œ ˆdefaults G['__Î 0__'Ì  Õ WÃ ò `types.new_class()` instead of simply&   ñto allow dynamic cre8Ü #3 Ágeneric dataS ú 0clsWp @cls_sÏ, bases, {},! )¸  Ap‘  ‚ònormal decorator`freturn~ °(cls, init= p, repr= ñ , eq=eq, order= ,È F Çunsafe_hash= ’, frozen= = ¶match_args= £, kw_only= �, slots= @)


)ô	replace(obj, /, **change-B"""Rð Àa new objectã °lacing spec0d fýsÀ + 1val”ñ ‘This is e0 @allyàsful forå  Í€  ExamplABage:š5  @ò(T=True�> ( CÌax: int� gy  ¥c = C(1, 2D 31 =Ý „e(c, x=3 ðassert c1.x == 3 and y 2R 2"""­  # We're go%ato mutã_ð', but that's okay because i aQ #tÐdict, even ifö2ledg'¿S**my_` 2)'.‰ 0if E_is_>_€"an÷Ñ"_ €) shouldÐ QGed oÐ P %s"FIÆ 0n e‚ to have&TFalse/Cin '´ '`b# If a   3 ¿ &  abad its÷ >m2`provid� #bjÿ ^ çrgetattré’_FIELDS).¤Ùó# Only consider Ý£or InitVarm Waif f._" _í µ b ˜_CLASSVAR• ] Rtinue¢C  ç  f.B
- !# ^ ûtEh  c Jf3in CB R   ™  û " 
]  & öV®j ð(f'field {f.name} ÿis declared with '
  ÿ'init=False, it cannot be specifiL ¹replace()')z •continue
  if f.name n µin changes:"  ¹ & ð_field_type is _FIELD_INITVAR and f.default  zMISSINGI  M òraise ValueError(f"InitVar {Œ Y!r} "�  8  O'mus"þ Û [e ó] = getattr(obj,)ð# Create the new object, which calls __µ@__()ÿ ± †# __post ñ(if defined), using all of\  B  Zss we'veG PaddedW Ó/or left in 'žQ'.  I@ €re are vNps suppl*#inG 1 P that* 3n'tn ò, this will correctly �a> 2Typ¤. `returnÓ.__class__(**d ð)
"""Concrete date/timeÄ � related =ñs.

See http://www.iana.org1 ñ-zones/repository/tz-link.html for
X  ' ] 0DSTo  a sources.‰ à

__all__ = ("Ž 1",   =    Tdelta  Y  qzinfo",ü ~€"MINYEAR  1MAX °)


import T P as _	  Amath  	  ósys
from operator C Qindex/ 
 ò

def _cmp(x, y)PŠò0 if x == y else 1 > C-1

² S = 1
³ ð = 9999
_MAXORDINAL = 3652059  #Oðe.max.toordinal()

# Utility functions, adapÛÍ áPython's Demo/#³es/Dates.py>ñ 
# also assumesðcurrent Gregorianc`endar f'�ely extenÀin
# both di¼ � ô.  Difference:  x  L Àls January 1|ÿyear 0 day
# number 1.  The code here9 19 
7 ñis is
# to match× ùi* t  L¦"prolepticì "h í ° Dershowitz)ðnd Reingold's "Calendrical Calcula^  s"\ ² 2it'R1basÀ X  
#8xbcomput6 0.  Š ˜ Cbook$  �Athms pconvert¶`betweexÄ   (s“¦many otherÛ `systemþ@# -1#!a §aholdern  ìxl `purposÌò_DAYS_IN_MONTH = [-1, 31, 28 +30    	 2]

G hBEFOREK ]ï� ð dbm = 0
for dim–[ À_IN_MONTH[1:ñ]:
    _DAYS_BEFORE_MONTH.append(dbm)# ñdbm += dim
del dbm, ò
def _is_leap(year)T " � -> 1 if    ¡, else 0."W areturn á % 4 == 0 and K € % 100 ! %or& !00( ")
} Àdays_before_c ; †  number of /  / À January 1st  > ™ 2y =p 9- 1ª Ð*365 + y//4 -  ¢  (00’ �in_month� !,  –   #� rin that3   � ³assert 1 <=% S<= 12R ¯ #if A== 2R¥ ýƒ!298  "IN[½ ]Þ Aâ ( Ï ð preceding firstœ ˆo ‰ì '& € must be'n1..12'Ç ÙË B + (@ >\xymd2ordÄ,¦ É   Îðordinal, considerà à01-Jan-0001 asC / 1â *pdim = _Î_k>0day1pdim, (' 
<P%d' %Õò
(c ð ¶1) +a  B  	& Z' “. Õday)

_DI400YÇ d @401)X .# 1400œsB 1B 1B @   "L     ´0  "@ O4Y  ‚ 5€ 4  #; E @ 0  4U €

# A 4-ò cycle has an extraö i`over wÔòwe'd get from pasting
# together 4 singleâ #.
Â ,Y÷B4 * ƒ1 ÿSimilarly, a 400Œ &$
#Ž Œ 1R s� y = ‘ 1_DIˆ!+ • @OTOH� 
> –one fewerYthan Œ )25i	‹ |  éB5 * * ·”ord2ymd(n´  «¤À)¶úð# n is a 1-based index, starÕB at õð 1.  The patternâsL ðrepeats exactly everyÑB àbasic strategy ³to find theJ pclosest< Pboundæðat or before n, thñNen work with the offset
    # from that boundary to n.  Life is much clearer if we subtract 1@ K  n first --g n ô	 values of n at 400-yearm ó ies are exactlyI òthose divisible by _DI400Y:"   Á ‘ D  M   Y  n  7n-11 B-- - -    -    = ±31 Dec -400+ C   -›   	u ³ 1 Jan -399( 9 -+1G ( = 8...’ 0’ ' 0’  P  *  (-2/ Á /  Ë 0 ¸ 6 00T 
 0 	> ¸ 	! 2	L 2C  ¨. 3/ 3* 	 Ù ç ¨C: %   ð 4ð à§8 H ð Rn -= Ì �n400, n =Ïdmod(n,z )— = (   * 0 + ba# ...,2�, 1, 401, 
6 p# Now nŸ Òã(non-negative)á¡, in days,¥ Nuß1Ž w C, toN  E ádesired date. a ôcompute how many 1Àôcycles precede n“BNoteO‚it's posÃ€for n100]°equal 4!  I%ãat case 4 full‘ i 
© Ðy, which implL I 0day&°December 31ˆ ( 0end
au•Õ Ê  ¬ ¸ X100Y)ƒ"4K  #itW 4U  4S vAnd nowqpsingle ¯ñs.  Again n1 can be 4, and a smeaningù Ô è Ø
 - ¿ ³ 1³ 3365 — 2 +=Ú*P + n4É 	  if± T== 4   Ë F`assert%1= 0¾   areturnú ¨-1, 12, 31{ ¯ � ¢is correctéþ¡.  We findk #§ómonth via an estimaÈ’'s either¤ Ã Òone too large%AleapŒ  Q == 3˜‰(n4 != 2ú 3ùö : `= _is_ (K & ™ ñ = (n + 50) >> 5¹ {ðing = _DAYS_BEFORE_MONTH[month] + (ð8month > 2 and leapyear)
    if preceding > n:  # estimate is too large
/   O A-= 1B   C ñ-= _DAYS_IN_MONTH[/ Q] + (
 ? ==‰ Fn -=‹ Z ñ
assert 0 <= n < _days_in_I (Å !,  !)
1  # Now the  î  Ñ are correct, nÛ àhe offset from9 G Òstart of thatc á:  we're done!( areturnl ˆ ¡, n+1

# Ms oðday names.  For localized versions, see} ò calendar module.
CðNAMES = [None, "Jan", "Feb 0Mar !Ap 0May QJun",¥  Ÿ	 @"Jul# 0Aug 0Sep 0Oct 0Nov `Dec"]
É| !Mo| 0Tue( 0Wed 0Thu 0Fri !SaK ñ.Sun"]


def _build_struct_time(y, m, d, hh, mm, ss, dstflag):» w<´= (_ymd2ord4 ¡) + 6) % 7' cdnum =dbefore"0, m- d( ¯ .‹ X 
Œ  ~  , ] ˜ )Ï SformaÉ À @us, Þ ³spec='auto'Ì   Qs = {‹  ‘ö'hours': '{:02d}'°w'minute :$ nsecond$ +  _milli0 \.{:03† ?cro7 A6d}'× }‡%if îÓ ù À# Skip trailv&mig Á when us==0.S  1 RH = '- '¾”us else '© 7 ,el… 
%  \ ±us //= 1000 6tryª afmt = »[… ]' ö except KeyError3 ±raise Value –('Unknownv ' » = QBfmt.b(]¼D(offe "‹ ifÛ æ@not 9g  .NF < 0  ¡sign = "-"é     ¥off = -off 
¼  % < +< Á � = divmod­ #adelta(2=1) D 1    |0 	2 Ðs += "%s%02d: P" % (Œ Ñ^ Èif ss or ss.KR L 3ss.]à §   M G  $ � œ'.%06d' %w L˜bs

# C¥ñly substitute for %z¸ð%Z escapes in strf " Rmats.mðwrap_strftime(obðLject, format, timetuple):
    # Don't call utcoffset() or tzname() unless actually needed.
A ð freplace = NoneR ðthe string to use~ 1 %fq z0 z0 Z0 !Z
1 `# Scans 0mat ò %z and %Z escapes, U  ¢ 8as Ï 2new+Q = []Q upush =  q.append âi, n = 0, len(: ) ²while i < nj -cI & "[i^   ai += 17   f ) V= '%'<  R      1  í 8matZ     b     ij fj     5if â!isã
“  %  *  » ñ06d' % getattr(ob‰å 4  ò'microsecond', 0b: ¡(� / &elú zú ¬ú * O= ""ä hif has% "t"’×  š2 = J.9 (à 4   3if ; ois notÄ 3   0sigÚ?'+'Ï  '   b Ÿ.days < 0# 0  — 2= -
 i  9 ˜ -˜ hèÂst = divmod(g ïdelta(hours=1)C x mM 3resPK ominuteM @s = @ .Ôsú uø›.8 Oif u�Ât'%c%02d #.%Ë(|Ï, h, m, s, u6is‚ - H
} z /sex )t q `assert¨Z4in GÒ¢. ^ 9 Õ_= 'Z'É 5if 
¢À              âZreplace = ""
  ÿif hasattr(object, "tzname"):6  H Bs = 3 .1 /()0 
ÿif s is not None^  b  # strftime8 ÿgoing to have at this: escape %| 
 N #s.¯('%', '%%'¼ ônewformat.append(E / ?elsÓ @pushi 4  —  *ch M + '¬ ( $ O ¿ e.join( r €return _f.o%  ,  ñtuple)

# Helpers for pars“òhe result of iso3€()
def _' %e_ ³_date(dtstra@# Itá£assumed thÝñ function will only be called with a÷) ‹ ñof length exactly 10, and (though5 m  †Àused) ASCII-] L ¢year = int¥ R[0:4],1if ¸ ¦[4] != '-'Äðraise ValueError('Invalid ð õ separator: %s' %I !)
v Ymonthw C5:7] x 7x ''L 9dayg D8:10h r[!, “ x, day]
ÊÉhh_mm_ss_ff(Æ`Parsesb0ngs0the)ñ
m HH[:MM[:SS[.fff[fff]]]]ú `len_sts2lenQ  yP_compiC[0,  7  po 0C  � ) ã in range(0, 3^ dDif (h ¦- pos) < 2½ $ Á U Alete  TonentL 7 ¦ [  ]] ¤[pos:pos+2a 1  ¹ A+= 2º   qnext_chv	7 "1]	 % !if8, !or� < >=É Zbreak: b  ¶:¶ [ ù º Ü 	ºcº„ R D Õ 1w  ifd  <Œ Üi4if ã Ë.� ±microsecondú Š     cos += •  $    ƒremaindev ¤  • * iM_-  4‡in (3, 6^ ,   I¼ 	o  nð-[3G‚ g   › À== 3:
        ðtime_comps[3] *= 1000

  vreturn " ð

def _parse_isoformat_! q(tstr):8 1# F ø supported is HH[:MM[:SS[.fff[fff]]]][+HH  H Òlen_str = lena   if  2< 2t ° ôaise ValueError('I¤ Å Â too short')â `# Thisž ñequivalent to re.search('[+-]', ß Á, but fasterŠ ‘tz_pos = ž ñ.find('-') + 1 or6  + )8 2imeÚ  X "[:H r-1] if  ‘ > 0 elseE ¯  i¬$ =‡Àhh_mm_ss_ff(   ‡. ‘zi = Nonet 	Z 5'tz‰ { ":]A  T#P"id@özone strings areF !# Æ 2  alen: 5~   % 0:SS  % 8%   &1fff( % &15˜ (¾ ó) not in (5, 8, 15‰; M   r0Mal½eÙ  < /tzn
 :Ð - ðif all(x == 0 for x” D “ t� ± UE.utc õZ [ ±tzsign = -1!Bstr[«P - 1]r 2'-'.1$; 1d =½Ädelta(hours=” ·[0], minute 51],Œ  C  gsecond0 2E =cro #3]hC 
ö  ¾ Ø C* td)  t³.append(tzi � s
# Justá2Typù%Áhe arg isn't ‘a¿.ÊÐcheck_tzname( ¦0if    [ DB andh‚sinstanc2 ,R 7  ç l‹ “("tzinfo.e 1) m± [Y  orC oing, "y"ˆ ²'%s'" % typ} U))

#« òthe offset-producing method, "utc "	ƒ"dst".
#1  ê ‚what it h ed &If! H ¨R,|%s ò 7 |,V s  # EÛ‘  } Š!ed8 be¹ €in range-  If™ ðis, its integer vê = ² !  W   þdòButc_| ö,å ÇcassertW7n (;!, 9öiØ ¶’ Î L Ÿ7z ,—x ?	?%s(; 0 ~3ime¥ðnot '%s'" % (namòe, type(offset)))
    if not -timedelta(1) < % 8 <  :2  6 õ&raise ValueError("%s()=%s, must be strictly between ">  B 	 " ×hours=24) and  ?" %J c(name,¿ ò))

def _check_date_fields(year, month, day)Ü   ‘ = _index% &)    6day  I œ V±MINYEAR <= Z `<= MAX o  K'+ Gãin %d..%d' % (Q ,G !),Y ‹ u 1o ¢  	 /12k 	' l c1..12'W 0dimâ �days_in_3 	& }  o<= dim| 	 & 
z å 2dim“Jareturnæ p  	Ù ¤Ù 'ð, minute, second 4cro Cfoldð .  Ý ð  ô @    G    %mih !  & ,0  t   /23,	& -€0..23',  T ®  V /59V 	( 
X  59ÿ@Z ì Z ( Z   Z % _ 9 ½ k
h ; Æ # q  ýòƒin (0, 1
‹. ^ ðeither 0 or 1',  X ¥ Ž l|
¼Ãzinfo_arg(tzŒ �if tz is¨ ANone §ñisinstance(tz, t= 6 Â 4Typ—" • argumentžV sor of aG ¥ subclass"71mpeÞ4x, "¯b ñcan't compare '%s' to "²Å ›  tˆPx).__¯#__šy »ódivide_and_round(a, bò 2""" q a by b'& p resultŠ ñthe nearest integer
• PWhen  Pratioo1exa²vhalf-wa»4two< !s,=  8 Deven  ? 1ed." """ñ“# Based om àeference imple•  Ðn for divmod_¯ D ñ# in Objects/longo ".cc Pq, r h 6 7 àup if either rñ / b > 0.5, or r  == ó and q is odd.
    # The expression0 @  ) ðequivalent to 2 * r > b if sD “positive," <  " @nega m ar *= 24 øgreater_than_half =Z á> 0 else r < b2 >if 5 á C== bÛ ‘% 2 == 1:3  á qq += 1
 òreturn q


class timedelta0 P"""Re
ï ðhe difference between two date; ’ objects._ òSupported operators: ö - add, subtractx — ð- unary plus, min "ab]�- compare€ u ° 8 òmultiply, divide by intu  Inv fition,³ s¥ s�  õ/ofØ f 5Ving a¸ ,p1add_  hÜ O ar E  y? B givR KCa· ñ : (days, second3cro ñ).  Why?  Because Il Âfelt like itx1""" à__slots__ = '_[ S', '_P  &mia  ’hashcode'Uð def __new__(clsYEys=0£   D 1=0,{  ‹ Smilliu 0 AnuteF Ahour	 ‚weeks=0)™ : @# Do4òthis efficientlyŠ€ccuratel   Cºg. 2o bÈUicultŒ #7 ñ error-prone, dudòubiquitous overflow possibilitiesü8thaN ñC double doesn't have enough bits of precifDto rj” :~ ñ 10K years faithfully. µ –0 he@ries GmakeO ¡explicit w' àgo-fast assumpaPs can!@reli¸çn, in order toK  gu_0the]�mplement¥ð; it's way more convolu Ýw speed-K PignorÊTauto-dó-to-long idiomatic Python could be# XXX Check ‰À all inputs + inqer floaŸ9 ¡Final valuÊ8 Rteger+% s`us fitÐ32-bit signedbas; d iécboundeO ? �d = s = u 07  ð# Normalize everythtPå–  ¯ Ì%*7QI   ;‘tes*60 + KU*3600+ 	_8+= ‰I*100­ pGet rid¸ ^f¹3ionÿnË ,ª ð # Take a deep bê†h <wink>% Óif isinstanceç¯ó 60day{ iÑ = _math.modf5 )Ý À        daysòecondsfrac, days ðwhole = _math.modf(day& ÷ * (24.*3600.))
  nassertG P= intA ^ ù)  # can't overflowM /s 7 	% r & =0 
— dJ  Yelse:M ÿ é Z= 0.0! ! =Ý   §isinstanceå  D v, floatu 1 ;abs* g) <= 1p * [ ,GL s? P24 * ˜  #¯ 0 isfõreferenced again before redefinition
; 7if | ¹Ð 
8 ñ  
< ¼  5â  ¿ 
+  È #  … " +§Ë  Ö x  „J  # B� . 	b  s }’ l • p. ¼ ( V D ó#, Ù  Õ civmod( A, 24ékd]k s  à5 )dÚï  “ " ã •? * Ûp aÞausdoubãG  oe * 1e6Ú Š 0 ’) < 2.1e6å õ	exact value not criticalC #\_ ˆtSmicrož 	
y" ™ = round( %+ º ”  » W 	. 2= d  A, 10  B :5  , : 
�   ’  • 
 
Ÿ O (, # á á d ‡ Á˜ÝD" j Ð, int)
      ó  assert abs(s) <= 3 * 24 * 3600
  ' °microsecond2 u 3.1e6
* ø# Just a little bit of carrying possible for L S and X .O  è, us = divmod(7 A, 10 )4 4 +=J  gdays, E `s, 24*æ : d:  * Ð ú öisinstance(d, int5 " s" Ò 0U4s <m ‘ 7 u8 u9 à “ !if°dd) > 9 :Y  ³ðraise OverflowError("timedelta #“ è ö is too large: %d" % d)l ö
self = object.__new__(cls  # !._N 5= d‡  ÀK = s ÅL = u  Õhashcode = -1< preturn ] ¥ Ðdef __repr__( )
0argñ%[]? !if; ¯ )  3 - �.append("Î = T 0 ó G ß J " 	M  P  U ' 	Z  	_ @not â U 6'0'2 g "%s.%s(%s)_õ.__class__.__module__,a J D9 qualnam;  ', '.join(¿ )›ö/stõ Pmm, s÷-| sF, 60æ ghh, mmXm   F r"%d:%02 6  e J  9
d « ‡plural(nœ%j!n,Ôqn) != 1:™"s" or ""] ” À("%d day%s, “ _ ê  ‚ G)) +qž 
¦  W ‘s + ".%06N 2 ˆ ´ s‚ctotal_e(ë @"""T  ”÷ in the duration."ä \ (E .Í € * 86400Ó Celf.f µ) * 10**6 +™ U¼ » 2) /- ³ ò# Read-only field accessor†‘@propertyZ  Â ‰ “ 
Ø   ¾  € p P Å S   V   Y ö ^  àmicroseconds""3"
  ñreturn self._microseconds
# Àdef __add__($ ‘, other):  D áif isinstance( ·, timedelta)  - õ# for CPython compatibility, we cannot use` 7 öour __class__ here, but need a realu 	< á ’ Ç ‚._days +Î  ,7  w 	  þ #._:  = _B  )„ · âNotImplemented”1__r‘$ =› ¬?sub¬Â-¬&: ¬&B ¬”r•6-ŽC4ˆ 3neg˜” /# �#¾ ŒÈ & ¿) 
¦ >pos •  RH/ab,  #if*?6< 0 -K ‡ w   Oelse' r 3mulž f7intÈ l Ì 7 Ð# < ô Ô × Ó" *´Þ4 é9 CšLfloa6cusec =Ú)to(P  î ba, b =× û.as_integer_ratio, ñ	0, 0, _divide_and_round(€  * \ )o ? -
 ºÁ  �ð):
        returòn ((self._days * (24*3600) +  Ñseconds) * 10 K +
  + Tmicro0 
% ñdef __floordiv__n ‘, other):#  K ñif not isinstance(" ÷, (int, timedelta)4  8 õreturn NotImplementedV cusec =È 8to_  %()' /ify  s ¦ r [ "//É /._] ?intÉ v y(0, 0, g )SOtrueR(OfloaYˆXMð_divide_and_round(j˜<Àca, b =· ÷as_integer_ratiolCì” 1b *I, a)ý?modK	Gl · r# %Î ÝÎ rE¥?divÒ 60q, Õ S nž ,}  ¾  y4  Ð  4 Ô qœ³ù ö# Comparisons ofãÓ objects withƒù/eqû4;º2cmpre) == 0Oelse r1 Í/le  K<  -t  L?+g?Là>= 0
        eglse:
  ñreturn NotImplemented
# ödef __gt__(self, other)@ áif isinstance( ·, timedelta)  p i  J R._cmp0 Q) > 0n  $ eŸ  I  S � oassert¡ 
x œ —  N Ã._getstate()Z  ) Chash"ò 2if I   ¦code == -1< ï "  - l
n  ,   § 
7 Œ NboolŒ 7 Y Ådays != 0 or ^   [ osecond& Xmicro+ ÷# Pickle support.¢ W i /£ ,@a  u p §oreduceý „_class__O � E))

ºf.min =Ê4(-9 )& )ax&  Z=) ð9, hours=23, minutes=59y ]   ƒ è T { šresolutio¨ 	6 A1)

ï C datö±"""Concrete S type¡ÒConstructors:´‘__new__()ª @from$Sstamp Stoday    ƒordinal(œYOperaQ @repr€q__str__Y B__eq #le t g  …@, __!5 2add& r
 °sub__ (add/ ¦ only withÍC argž dMethodí  Û StupleÏ &toÍ  •Fweekí 5iso Ð, isocalendar2“isoformatK c\  Cstrf ý ðProperties (read³ ñyear, month, day0 1""" à__slots__ = '_+ Q', '_. 
 1day  4 ‚'Ô/ØPcls, ; f Q=Nonek 
 ‡  ý 9 2  @Argu5F  R M  Ù âquired, base 1Q , Ï   Aif (À @ is ‹ A andí     oe Ð(bytes, str))/ P len( )r4 	B �1 <= ord$ `[2:3]) '12í  j Æ	E 
ù n ‚ 
ß G >try    5 ! =}0.en –('latin1' )    except Uni) E/ _Error\ ’# More in…Àive error me�ssage.
   ÿraise ValueError(&  9 ð"Failed to encode latin1 string when unpickl "J ÿ a date object. * N Âe.load(data,| Ring=' ù') is assumed.")v dself =i ¾__new__(cls' ÿ.__setstate(year" Ahashú I= -1i preturn p   F ð, month, day = _check_þ q_fieldsl & x  M ½  #  ._i 0 =  }  } " =…  ’ ;day å á 1 ñ# Additional constructors
 Á@classmethod ðdef fromtimestamp‡Q, t): bCG  " 1 • a POSIX : a (like . F()).Dñy, m, d, hh, mm, ss, weekday, j 0dstŽ = `.local
 &(t|ï Ccls(P )Ø PtodayÐ Í  i µ ´ Ž    (ˆ .  =t� 	 + pordinal– 8, n™ /""hóproleptic Gregorian H .ÿ  §ÁJanuary 1 ofu  1ƒ PÁ1.  Only the ÚA and5areï±non-zero in0 fresult§-""Õ µŸord2ymd(n&® ’isoformat ‘È* Þ `output = .Q ().¹ ðif not isinstanceÇ"e_l ,<q  ^‘3Typ�'¯ ð: argument must beC ' @ 6tryR  ¨assert len{ u) == 10� * õ…*_parse_× ´	A �except E :ion€ Ñ b¥f'Invalid ^  Å `ing: {M4!r}Ù N is¾RendarÊ ït]"ø Î3ISO° *q number¶  7day @Thisñ 8 pinverse   ¾  2cal” `) func&`# YearD PboundU T ñway because 9999-12-3\( v, 52, 5x\’MINYEAR <  ð MAXYEAR:
        ñ$raise ValueError(f"Year is out of range: {year}")

8 õ	   if not 0 < week < 53:  & qout_of_B v = True?  ! "if; -==<   `# ISO y ‘s have 530 Ãs in them on ù starting with a‡ K üThursday and leap:  on a Wedne' B `first_ê  E °= _ymd2ord(  ½, 1, 1) % 79 Kif (= o= 4 or  3ž B  Á  @_is_Í † :)))�5 ‰NFalsŠ% G ) qInvalid“0: {! 3:< 8W S Âday: {day} (C¨is [1, 7])ˆÐ# Now computeô  offset from (Yœvin days„ Cday_+ 0= (¿   -Åp* 7 + (´   ³”# Calculah `rdinalW Á for monday,% 1Ç h €1 = _isof 1( ³& @ord_s =O A_1 +   ƒ óreturn cls(*_ord2ymd(; )�ò# Conversions to stringE ÷def __repr__(self32""": t6 cformal= ,á  7 2().J  ]p>>> dt ´ ³tetime(2010rÛ  & ; 5dt) 2'da3 .	 < �, 0, 0)'j �, tzinfo=‚ †zone.utcj  %W ¡ .` 'Ë 5""" ¡²"%s.%s(%d,  Q)" % qõ.__class__.__module__,A  W  ²	A qualnamC ¶u _month¨ 2day‡ð# XXX These shouldn't depend on Y`.local
  (), becausÐ!at§ q# clipsápusable ˜áð[1970 .. 2038).  AtãBst cP 3 isE ±easily done, æ us:Cstrf. ô-- that's better too’ H .  "%c", ...)5Ä Âe specific.
Â v‹  ÁsRÑz Sstylet.V 7 @ B.too{(s Lx‚± %s %2d 00: Ð %04d" % (
    õ_DAYNAMES[weekday],
 ’   _MONTH" »self._month&  Rday,  ayear)
J Ðdef strftime( q, fmt):  k Ö"Format using+ 5)."# Þreturn _wrap_M v  b wtuple()| 1__f` /__~ ðif not isinstance(fmt,‡ £  § ð	raise TypeError("must be+ ,D ‘%s" % typD µ).__name__)È `if lenb f) != 0b æ  $.å  ,@ 1strÌ æ 2isoç  Y B"""RX ’the date )  ted accordwrto ISO.³ � ÷This is 'YYYY-MM-DD' ¦Referencesk ð- http://www.w3.org/TR/NOTE-y   Ë 	- ð	cl.cam.ac.uk/~mgk25/iso-2 U.html7 -""’"%04d-%02  „ ._†· 3day<_OU__ = Bñ# Read-only fiel-aessors� ‘@property  å n y 90""" Ÿ (1-9999)¿  ï« y Y rZ    [ /12Y % Z ?dayX  0dayV /31V 2dayT ð# Standard conversions, __eq__ #le t g g =ó# __hash__ (and helpers¢ [ Ú .`Ü`local '  ( ñ compatible with .&  % (]PbuildAuct_&  m F
- 8 20,  (-1Ó oz/al� Õ óproleptic Gregorian 5  Ä Ñ ^!, å <7day¦ÐJanuary 1 of +   1Ô áP1.  OÝF b valueì Ô Ñcontribute to{ qresult.Ã " Ü �_ymd2ordä Jdreplac- · S=Noneç  1day
 ëRa newíþ  Ð 9’specifiedÞ(s.¿ i.0is z ã è  ‘ ' =é#ifŠ8 ¥9  :  •8   6  x „   p ª )(š &&, äð# Comparisons of dòate objects with other.

    def __eq__(self, !):  ! áif isinstance(; g, date$  ( preturn E R._cmp+ e) == 0M % èNotImplemented‰ /le‰ F<‰ t‰ GgG>gG> Z d©oassert­ƒ“y, m, d =«Syear, Tmonth 6day5 ²2, m2, d2 =""._9 #._:  ; ó(} U), (yS ())Chash{bu"Hash."‘ #if³  / @codeh&-1· “ (&._"   çÕ._getstate())U « 
7 œ â# Computations ;3add¯ “a"Add a.ú  to a timedeltaË a)  Ó o¸Ótoordinal() +“EdaysÍ  . úif 0 < o <= _MAXORDINAL& ) ú Atype d).fromb o#- öaise OverflowError("result out of range"7 ` ø1__rCQ = __
 ^?sub^á""Subtract twogTs, ors an~K9.""Av¿  & +Å"(-ð xì 1 6 1Ï 	Â % tõ	&   ê (7 @1 -  2› ( ‡ Írweekday%""RÛ0dayÜ@the * °, where Mon  èt ... Su 6æ{ \ .È ’ + 6) % 7öÐ# Day-of-the-f  Å 	  w1accžgX2ISO>  Å ðisoweekday(self):
  ð"Return day of the week, where Mon ´== 1 ... Su C7."
D ó # 1-Jan-0001 is a8 ! re ñself.toordinal() % 7 or 7
* ðdef isocalendar(/ !):  j $""­ ña named tuple containing ISO year,Å Á number, and Bday.k  P ‘The first7  ö  C  È  ‘(Mon-Sun)B � u  &  2 #'sO ðThursday; everyth› Åelse derivesF Ÿfrom that— “ Sis 1;P ” 	ˆGis 7;  ÿ >ð algorithm taken l y ôhttp://www.phys.uu.nl/~vgent/C /�E.htm> õ(used with permission) &"" 0 = Ë ._ &  Þ #1m`W _iso (+ R !to†‘ _ymd2ordP ,\ Tmonth 6day= Ã# Internally  R Ùhave origin 0š ,’= divmod(� -µ 6, 7d !if F < 0± e È U -= 1^   ê / =ü 0 ’ $el” Z>= 52– 2if Ò >~ :+1)1  … Ë +Ë    Ï ' =BðS_IsoCÎADateÖƒ!+1Ð 2+1)‘ô # Pickle suppor `_getst?  F™ •yhi, ylo § ! 6256 ‘ tbytes([9 /<2]),–  (_s€ �, stringˆ  O   4 ¨ à = yhi * 256 +Î z �reduce__ðr Ï  ¤.__class__€ 0’))

_date"  (óate  # so functions w/ argsU"1 Á" can get atc  

 C.minK @(1,  ) $ax Ã9999, 12, 31 `resolus ð = timedelta(days=
d r tzinfoò"""Abstract base # 1forA ` zone /  #es1Sub* ñes must overrideË  <ñ (), utcoffset()" ds
 �methods.¬ÊÓ__slots__ = (² !tzM  ÏG, dt¢F å 3 ->2`c1ime» Còraise NotImplementedError("# sÔ Ò ƒ ')"— Ú 	š À      "datetõ!ime -> timedelta, positive for east of UTC, nega %we 3"
  ðraise NotImplementedError("tzinfo subclass mu@ ñverride utcoffset()")
P ñdef dst(self, dt):  j p"""dateµ  ½ BDST > ? asË .b  K ÀReturn 0 if H ø not in effect. ™ ³ °include the1 ” � . /""0  	fromutc in°  Qlocal&." 1if ó äsinstance(dt, 8 t -ßCTypeÕ� Å) requires a= P argu%")cif dt.!is|  áÜh DValui 5 * 3 pdtoff =^ L
x  " is Nonep Ù @non-= 	æ ‡  x"result« B# Se@€long com%‘ block atZ0endw‚this fil�%anÐ Õ# explanation* –algorithm‡RdtdstMB Š  2\  ì S~  |!- Ž 	ƒ  t
�adt += : *  P < L .n 	 Î  ? ¼Tä:6 ÿgave inconsistent Þ Y â`s; canL`converó    re Ú ½ ó# Pickle support— ù¡__reduce__ëˆñgetinitargs = getattr% W, "__ A__",í	! 
xR ` (9 ;els4/ $ �getstate—  ”  
‘  M  k � " - 
Fdictv 1 or€ ›2if ; ¹_1.__º0__,Ús	ñ8 ,q A)


P ò	 IsoCalendarDate(tuple):¤ònew__(cls, year, week gday, /!| §super().__= (> À week, weekdñay))

    @property ñ def year(self):  & preturn  ?[0]: Oweek: 	1: 
?day= 	2=  £ ¬__reduce__2 ð,# This code is intended to pickle the object without making ñ õ&# class public. See https://bugs.python.org/msg352381> /‚(tuple,  « ,yÈ .prÆ @ 0f'{s1.__Ž Õ__.__name__}'m     0f'(»=3 `[0]}, ‘ 1 3day û2]})')


_IsoCalendarDate =  M
del r_tzinfoœ 2 =  !

¬ R timeAq"""Timeo b zone.FÒConstructors: ƒ__new__(¢YOpera  re5‘, __str__
`__eq__ #le t g g bhash__k dMethody @strf· !()S “isoformat „utcoffse  tzŒ  ds 8 PRÓies (readonlyLðhour, minute, second 4cro Fa, foldO 1""" à__slots__ = '_J R', '_M  C  %miS  V        f '‘{Pcls, c  =0Ÿ  ¯  
 a  
 `   _ ‚=None, *½ #=0õ  �7"""êü  „Argument„   y w  Cbquired•   ‡  " å � (defaultêFzero. œ 	!  ¨ !    (keyword ®/, N Ž ˆ ò if (isinstance(· ñ(bytes, str)) and len `) == 6 Ð B   1ord ÷[0:1])&0x7F < 24> ' 2# PÁysupportD =if ‰  � � ?  >try    ¾ ! =õ0.en!–('latin1'+ )    except Uni) E/ _Error\ p# More . PPive e. ™ message.Í  a   ±raise Value\ (&  * R"Failæ»  º  … Úqwhen un  Q :  ""a¢"/. * N Ñe.load(data, | Eing=9 „šassumed."G Ù# =‹ Øô>cls' ¤.__setstateõJ or Ë Ï  Y $._æB = -™À        retu“rn self
  ðhour, minute, second 4cro õfold = _check_time_fields(F  M J )5 Q ±zinfo_arg(t "  ª ú = object.__new__(cls#  ._| 0 =  _  = "._Ú # =ã  ã # =ù  %miA  ( · 2 = 	  Ûhashcode = -1 [   Dretu¦ Á# Read-only y¡ accessors  ‘@property 1def( !):  Ÿ0"""¥ (0-23)""" q J
 W LY    [ /59[ & ] ‹]   ] & ] Êb    g 9 È 		*	k   >Pzone ôÙŒF Ô  5b 	Ë ! = ð# Standard conversions, __�ô__ (and helpers)4 ð Comparisons of » ² Òs with other./  wa__eq__” , €áif isinstance(; ,T $  ¨	Ã 4cmp+ ñallow_mixed=True) == 0€ 7 Felseí  I èNotImplemented­ /le­ D?) <› -t› G5+g5G>5,g5G>5* Æ Ž(, ÌWFalseoassert,ðAmytz¸Clf._) ö  !ot dð._tzinfo
       ² myoff = ot sNone

  õif mytz is ottz:    õbase_compare = True  Jelse. i õself.utcoffset()3  S † _other& y Z Ä 	½ * 
� Ñreturn _cmp((” r_hour,  dminute ysecond,«  ¯  5 2cro, )- (Ý o  p  E D  ( &mir J¶ Ï0is Ð3 orà 
êif allow_mixed  â +÷2 # arbitrary non-zero valø 0 ü  ô	raise TypeError("cannot AÀnaive and awQftimes"Õ ƒmyhhmm =¡ ­s * 60 + C" -Ó //A bdelta( 6s=1N #otN IO  6 " -;P $O« =¦ ²à  Dhmm,ä 
ó“Ádef __hash__Ì)Å±"""Hash.""",  ‹#if�  3 ¦code == -15 % ?fol t‰€replace(' &=0a C 	; �  +  tz°?= tõ0if /) Q:  # ~!orâ	L  P ‘à   ÿ(t._getstate()[0]¯ 0h, vvdivmod(U 2!s=h   ", 0  A) - ± ê ©  W *1)›  & aassertFm % 3 l  ßƒ, "wholeŒ ò @   _m //=; Bêif 0 <= h < 24 K   þ yFf@ime(7Á. 
¿ E  2 " = k g ¦
L 1ò# Conversion to string `_tzstr^ RI‘formatted^Rzone â� (+xx:xx)†ƒan empty_ 	–œ ¼ _i _] W(off)¥ __reprÞ ðt to formal strinóg, for repr()."""
  õif self._microsecond != 0:#  * �s = ", %d R" % (6 1 ,D )? %eld . _ 	 [ Z F /se“  É ¢s= "%s.%s(¥ 0%s)M ¨ õ_class__.__module__,\  á  ‰ ; qualnam= Fhourvnute, sûtzinfo is not Noní öassert s[-1:] == ")û  ¼  ¡€s[:-1] +ªQ 0=%rÉ    < ‚ Jfoldat  C '=1] ‘return s
kÑdef isoformat˜ö, timespec='auto')‚ B"""R? 1the(  Ãò	matted according to ISO.b  	ƒThe full.  S±'HH:MM:SS.m ð+zz:zz'. By default, f ¡fractional±  O @partD 1omiz 0/K== 0‚ "opH ‘ argumentÂ  ê   Qifiess ânumber of addi5 } Pterms  �  + ï ò include. Valid j bs are E0, 'w&s'â0'mi|Rs', '… Tmilli g and 'Ø 5s'.Š 3 k_Æ_• Ë ._t ë[b Ž  X
 ¡| -Ctz =iftzstr( Vif tz< ] us += tzÂ 
Œ–__str__ =’C@)amethod<  ¶Ffromº2clsŸ  D :ingµ±Construct aô = ë`outputÏL � ÿ°isinstance(`g W, strl  å ðraise TypeError('m ^ :~pmust beC "')ê  @ :try6&Åcls(*_parse_O í’ )��except E ;ionV § CValu¨ Qf'Inv¿^  › ging: {b 0!r}¯ ‰@strf sW, fmtA"""F\0 us- @).  Qdate Ñ!of’ K pstamp píñ˜o underlyI q should£be used"#o Tyear yð>= 1000 else Python'sô Ð ` imple(að  ˆ b# can æ‚a bogus k6ion|  È ðtuple = (1900, 1, 1,
          Âself._hour,  dminute ˆsecond,
4  •0, 1, -1) ðreturn _wrap_strftime(Y p, fmt,  qtuple)
5 ædef __format__* !):  k ñif not isinstance(J 7str%  ) ñraise TypeError("must be str,D ‘%s" % typD ¦).__name__Á `if lenb f) != 0‡ b ß  Ð .Þ 6fmt@ 1strÌ æ ö# Timezone functions ’utcoffset3 s B"""Rr 1the;C - 1 as õdelta, positive east of UTCCa (nega %we U)."""$ #ifætzinfo is NoneŽ   9 � =? .Õ  - !²_check_utc_9 %("+ 2",  / P 3 tz¹0 + .<  Ä  Note that V   ì P100% ù  Š€ional --" ðre's no requiremen9 %at ð)it mean anything in particular. For example, "GMT", "UTC V-500"^@"-5: B "ED' �S/Eastern. õAmerica/New York" are all valid replies.› à2"Þ€Û  7 È  Š ù/dsó€0 if DST� Àn effect, or™ ( (ÿ 	Wward)T iP @Thisp jpurely;t õ
has already been added to€  `3UTCÕ Ìeed by ô(” €applicab# soj wL !ne\ � consult <ð) unless you're interested„pdisplay’ ‰ 5DSTM  è&<‰( ¦ % ?dstú ä$acT ¹=a ", ¸ · Xmicro    óá=True, *, fold= b�Qa new|Q with ƒvalues f›üspecified fieldsj ¸  i » 
b F  ¬ #ifã 8 ÿ  :  < Àf second is wNone:
  âsecond = self. ! ‚if micro N is A ! F  K `tzinfoF ;Tru‡  A  < @fold: €  8 _ 7 Àreturn type(Þ ò)(hour, minute, Ö   ã ", {  , J = !)
Q ò# Pickle support. Âdef _getstatf Ö, protocol=3)lñus2, us3 = divmod“ '._,a, 256)n  ¡0us12 22 D 	$ h¹_Û ; "ifÏE and” F > 3•  g …h += 128= AbaseÏ ° = bytes([h- lf® ;  A:  O  Å  Ê &3]Ý ¢ pÛÁ(’ ,A ;elsC. c È±*_s²dstringý¶#if ¡ 1not Q  ²isinstance(d 2, _	 g_classI  ôraise TypeError("bad_ qFarg"ã v [ Å �ªif h > 127ð 
.5= 1/  ¡   Ji = h -q/  $O = 0J  2 ó÷ = (((us1 << 8) | us2) 3< _# =8…Á_reduce_ex__\‰ˆ%Š §$__ßÉÃ)6b _ U T & ˆ ’2)

_timej  ¸ ðime  # so functions w/ args named "1 ñ" can get at the R 

 C.minK @(0,  ) $ax b23, 59 9 $ `resoluy + gdelta(–qs=1)


r P dateu (	 õ 0"""  0yeaTÀonth, day[, B[X -[] d j"[,Ë] fGThe O h0dayóuments are required.€ may be q, or an5œT of a, 1sub×  . m —remainingc N Qints.H 1""" �__slots__‘Fate.  +  —¨new__(cls,Ü =® 3day
  4$=05 
 ^1=0,~    « ) IH *»0«à    if (isinstñance(year, (bytes, str)) and len p) == 10 '
  �1 <= ord% °[2:3])&0x7F I12):- ù# Pickle support —if isinst�  ˆ 
C  { >try    Å 1 = Å ‘ ¹, 'latin1')l  - ñexcept UnicodeEn Orror\ ð# More informative e. � message.a  e Àraise ValueE. (&  * Á"Failed to eŒ  º  ŒÀing when unpA  "J ÿa datetime object. . R Âe.load(data,€ Eing==Ú is assumed."Kdself =i ¾__new__(cls' ¤.__setstatp_month) @hash‘Y = -1ê preturn w   ø!, M ð , day = _check_	s_fields& x ðhour, minute, second 4cro FfoldW  \W †  ÆJ { ¨  tzYR_arg( "  ê a #  ._0 =  ”  ô " =" /;day  Ê 0 =   ( O 1 1# =G %miTA  ( 2 = 	  ì ©  6 4 Á# Read-only ¡ accessors  ‚@propert1def(b Ó0"""– (0-23)""eq  ._$ 
W LY    [ /59[ & ] ‹]   ] & ] Êb    g 9 È 		*	k   Œ2zon›ˆŒF Ô  5b 	Ë ! = ±classmethod²  %P_from� PstampÊ, t, utc, tz:§Construct ¯ @ • a POSIX I a (like . B()).†  sA ò
 may be passed in as well¨À    """
    ð    frac, t = _math.modf(t)
   °us = round(+ f * 1e6 ±if us >= 10 :9  = it += 1 Eus -.  "elI << 0B  . (  U !usV o %0
 �converterË ptime.gm  Z �tc else _ `.local
 = ñy, m, d, hh, mm, ss, weekday, j  ds&g %s%@min(7 059)§ ð	# clamp out leap seconds� õthe platform has them� Qresull ?ls(š ius, tz†ªtz is NoneAõ## As of version 2015f max fold in IANA database isˆ Æ ð23 hours at 1969-09-30 13:00:00B «Kwajalein.< ãLet's probe 24H  inï ú past to detect a transitionÂ @max_¬ _A=L W* 360ÿ­ µOn Windows å__r ûan OSError for negative values,½ ñthus we can't per® Š ´  O H ?  e TL lesD2thaõ  x%  G à. See commentsIP_date  |module'H Åáof this methodÍ @more˜ Jails‡`if t <ó
G„and sys.‰ú.startswith("win")ˆ brreturn ¢|  © 7 = /- -„ Y)[:6]w,19 ü | ; ¨:-s@1 - MŽdelta(0, 	{  ( ƒm.days Š h ä +Ç: //{ .1)ì  R ð 2ð  : "ifæ C2 ==‘° ) ­.ý � 
3 + â = tz.fromutc( l b@class�S@def @  ~€stamp(cl³ ¶=¤[¡"""Constru@ � a POSIXLI a (like .^ F()).ˆA Ðzone info obj\`may ber!seóaÙ&ll(1"""¹  0�_check_tzC P_arg(k  Zcls._ä tß  †1notŠ  )ž #:utcB & na¯0UTC°)'.Ñ 	² Àromtimestampñ(t, True, None)

    @classmethod ñdef now(cls, tz=, :  0 ð"Construct a datetime from 
 . ñ () and optional Å zone info."M Pt = _2 7  °return cls.[  # PstampÃ /tz» 	3utc¾ )µ ?UTC¹ � ;utc  œ 	rcombine[ <, g =�¶  /  kqa givenÈ l  # Ä iÌÐt isinstance(H 0, _ _ûq  àðraise TypeError("* ó argument must beü W %")»s  ” ,ès  1 s  s  tzB1 isâú Ó  =m. ¯ ja.year,Xc.month Eday,4  U   “ R.hourËs.minute csecond Smicro J Â q, fold=W  
 O	 z–isoformatUw_stringØ/""¶	Áhe output ofù } Y F).""³ß !t W, stry  %Q'· :èCstr'÷  @ à# Split this a µe separatorIadstr =¿ Œ e[0:10]! t! B11:] h :try7Ø  components«eparse_F({ ÿ²except ValuB
U  µ(f'Invalid W  Eaing: {ƒ Ï8!r}0if Ò 
] Ã Ø Oime_Ç  ñ(O Ç  : Ë  # Ï , C   KelseË ¶ E[0,   •¼Å*Çñ +ø )^ ê û §tuple(self»""Rƒ4locÂ(  K±atible with] .&  L '()~ dsá Y V.dst(^0if  !isŠ
ú   E= -1º"el/ ' & CI À 0
        rñeturn _build_struct_time(self.year,  Smonth oday,
  8 5houC SinuteD osecondG Qdst)
o udef _mk  !):  ‰ B"""RÌ àinteger POSIX , •stamp.""". Àepoch = date" Å(1970, 1, 1)% `max_fo« Õs = 24 * 3600% At = ,1 - V A) //v `delta(V S  Á wlocal(u¼  À ðy, m, d, hh, mm, sp ‹.2 § eu)[:6]}  9 rö (Ë J  )� 
O ð# Our goal is to solve ã ƒ ¥(u) for u.3 Ba =  te t ¥u1 = t - a t - ug0if  6= tÎ Ù à# We found oneŒ ñution, but it may not be the$ vwe needŸ H ALook¹ ¥an earlierO ` (if `ç`õ g0), orµ B Qlaterc 
/ *1)l Ìu2 = u1 + (-?,,  !)[" } 
ÔbV u2W%u2E � šif a == b1  %u11 Jelse(  ^ Wt1 - &  < Õassert a != b@ Ó  É tæ É2Ý É2˜ É” Å  * 1* ¾ 4hav
òboth offsets a and brneithert2 no
 Eb isË 5# aøð .  This means tü!inI6gapÕ¼ ˜(max, min³–(u1, u2)
� ¥nã�•– as float›"ifpp_tzinfo™ ;NonÃ <† Ê¶ 2s +L Rmicroqe / 1e6< Á ò - _EPOCH).total_D 's(�0utcö Btupl5ö  1UTC & ñ compatible with 0.gmG 6().è" =Å 2utc (í #if
â 3 -= í Q Ý2 	� V .Ï9 FX … é7, 0Q É~I  é   W part*o   ; '._Ý _»ð_day)

    def tÃime(self):
  õ"Return the time part, with tzinfo None."2 r1 M p.hour, X s.minute csecond Tmicro Qfold=1  
 !)
\ 1def‚ /tz¤ Csame© ¤ :“ $ ³ _ , ¼ Æ breplackp, year=Ds, month 3day
  @ u P  > P — m=True,I *¯  ˆ þ" ¡a new date   ¡values for#öspecified fields.""!ifí 1 is4e A " ='  £ "if7 38  9 ?day7   m 8day3  n4  5   6 ‰8  :  < ¸<  <  < çA ! F  K   F  #
� A  <  ë :  ?
:  8   6 '"yp	 )(öp, day, f", 2 (0B  6
 Ú ,õØ { Hp_local_Ë3zon� ¹ "ifˆé Ù $tsv0_mkI %()š FelseN  ¤ . ¸Ñ - _EPOCH) //Ñbdelta(Ü6s=1G ¥ Qtm = ª .  X+ts& % =œ"(*( Vm[:6]' À# Extract TZ, a® “gmtoff = 8 B.tm_ #  %
!    Ì0ime (
Ö P 0),   ‰ as,    ¶¯„_if tz„z„¼ 'M ø ðelif not isinstance(tzi  ½h  §ôraise TypeError("tz argument must be an J   o�  I "Õ  F 5myt™ C* Í  8 ¢Ñ b �offset = 5 B.utc F, ‰"my) : Àtcoffset(selGf)
  ùif myoffset is None:!  , ðmytz = self.replace(tzinfo=1 ú)._local_timezone(d C e  = N B.utc (V %)
t Pif tz‹  ' 
‹ areturn‡ 0 ‘# Convert ð to UTC, and attach the new ž  Ÿ … object.t autc = Š % -)ì 'tz¨ x @fromu  | Qtz's o c ¼ 0tz./ sutc(utcO `# Ways? òproduce a string.è Pdef c¿ £ )""R t) style< "à tweekdayÃõtoordinal() % 7 or 7, © @"%s  …2d %02d: ¥ %04d" % (3  à£_DAYNAMES[m *],  RMONTH"  ò{._month&  :day=  Qhour,æ„._minute osecond4 Cyearf E‘isoformatI ? ap='T',­¸spec='auto'c"e H … C qted accKg½3ISO° ƒThe full. ñ looks like 'YYYY-MM-DD HH:MM:SS.m '2±By default,Ãð fractional part#@omit‡ "ifRmicroW == 0� I# · = 1notï^ BUTC ‘  Calso?¥ed, givingÐ ) aà /ofØ 	+è '‘ #OpÍ pargumenÀ p „Qifiesó ðseparator between dateÜŒ  ‘,)8 'Tc  ƒog  2  g l ânumber of addiœ f @erms òto include. Valid j bs are F0, '´&s'š'¹Rs', '© Tmilli  à ' 'Ìs&""×sµ"�-Ÿ !%cœ2 þ å#lfo  bu sep) +ä  µ" _ÜÊ$ ._Ã 8 ¾  ± Ý B 	 ‡ Ë j)— 0 4offœD}š ¥7(ofÉ4 S rs += tz@  Øs  �__repr__è 
òS"to¿lT,  7 8().‹RL = [î u� # These'ªnever zero†I yõ__]H �if L[-1]À:
          Ó  del L[-1]
  "if e == 0:   - ùs = "%s.%s(%s)" % (self.__class__.__module__,L  P  6 qualnam8 õ", ".join(map(str, L)))k 2if [ útzinfo is not NoneÜ Ðassert s[-1:]ü 5")"F  ©  ë Âs[:-1] + ", Q 0=%rö 	d (+ < ‚ Ofoldt , C '=1™ ‘return s
« ±def __str__‡)o P"Convá àto string, for 6().ê Q  Åòisoformat(sep=' ')g @Üemethodx ðstrptime(cls, date‰ h 7mat� '‚ ¡mat -> new5  C à parsed from a£  ing (like   .l A)).'‚  ¡pimport w Š  Ô  .
 _¨  S ¶ ó  Z€utcoffse'lfÏ B"""Rˆ"th¢ Rzone - 1 asµ ñdelta positive east of UTC (nega !we º vUTC).""ŸM~ ÏËð   J � =.Ó . ²_check_utc_9 %("+ #",Ú eq + 1 tzÁŠ. + .<  Í Note that T   ì P100% È –€ional --" 0re'Ù° requiremen9 %atÒ Ðit mean anythO ingðticular. For example, "GMTY0UTC V-500"¾@"-5: B "ED' �S/Eastern. õAmerica/New York" are all valid replies.› à2"Þ€n Û  7 È  Š ÷/dsñ€0 if DST� XÐin effect, or™ ( (‘ 	Wward)T P @Thisp jpurely;t õ
has already been added to€  ` †¥ Ìeed by ô(” €applicab# soj wL !ne\ � consult <ð) unless you're interested in display’ ‰ 5DSTM  è&<ðoffset = self._tózinfo.dst(self)
  ò
_check_utc_offset("dst",  ) creturn 
@ ò# Comparisons of datetime objects with other.3 ¡def __eq__ˆ , !):P  “ áif isinstance(; ,X (  , “  Ñ T._cmp/ õallow_mixed=True) == 0c �elif noti e çNotImplementedL &se½ • XFalseô /leô H?) <â W kYerrorÃ	ì tì KÍVë g×K>×yg×K>×w M W (, SÛ&_asserN Epmytz = [ 1._t”K!ot ó ¢myoff = ot 3Non^ t1if Z 0is F 
‘abase_c©@e = t ,el¿i £ 2utc(Ã  p † ¬ & Ø# Assume thatBb means ówe are called from ¤  q (if@ 
à   ¹ !]Ðreplace(fold=ìÐ   ').° J  N X2ƒ   #if�!Š Öh i )°Ø =q 2offfŒ * 
Ê Â À _cmp((self.ô_year, self._month oday,
  1 6hou= Tinute> osecondA Rmicro, )- s(other.¬  ­  ® % ¯  m°  … „  ( ² ) ÷if myoff is None or ot :+  Rêif allow_mixed    ùreturn 2 # arbitrary non-zero valueP OelseF  ðaise TypeError("cannot compare naive and aw ¦datetimes"Ù Ð# XXX What fo³ Às could be dé õmore efficiently...› adiff =]" -A Þ õ # this will take offsets into accountF 0if I š.days < 0é +%-10   4 Ý 1�!0
  Àdef __add__(Ã,– )T t"Add a B Ña timedelta."H  Ç 0if N¢isinstance§,- W  1 ™ åNotImplementedO _ & => ¡ ¿.toordinal(!   Û s=Ó  ._ É ú.  0 	0  0 	#5  \ò "+=„	¿ á rem = divmod(* .z vs, 3600G Á   5 grem, 6) rif 0 < M NÖ= _MAXORDINAL®AtypeŠ ).combine(T.fromšR ¤
 V   Q(ê 
À Y	=  y ]s? ctzinfo6 )Xr?ƒOverflowCòresult out of range")\1__rY$ =c t?subtÅSubtract two{ s,¹‹+ « kŠi©· n» `A + -±! Ü#  n1Ó	! #2 " EsecsC _í+]"._Dd * 60   ^! *-g  E Ð2 = other._seö
cond + other._minute * 60 Óhour * 3600
  ð
base = timedelta(days1 -  %2,( /  1sec(   (  lf� Qcrose¥ -¥  )i Pif se3 ”tzinfo is/  :*  Œ preturn Æ  rmyoff =G ¦utcoffset(c "ot! ," 3if F != . v 3 ¢is None or;  Â   C ñaise TypeError("cannot mix naive and—¡zone-aware "È ý å Ö -¹ 
Ðdef __hash__(V)… h  ¦code == -1!  _% Jfold   te€replace(' &=0¡  % Oelse; §  '    tzÂ O= t.” " 2if % eY  æ .ó Ô  ß ÿ(t._getstate()[0]£  ± = _ymd2ord@b.year,ZSmonth :dayS  ­ ïs%~# +C 	¦» 5 	L   Ì 	× 	¶ Œ  as	 Vlf.mi_" -9¦ =u 07ò# Pickle support. NG 9 Ç, protocol=3[óyhi, ylo = divmo<_=6256† Œus2, us3+ ¼ +, 2 12 22 D 	$ mt_¥NÏ_©aÀ J > 3M…m += 128=  dB¤ = bytes([é 3, mtO_day5 ø_2 «  C 
"us 3ËÞ )x1(Î ,�«%. Á c )$_saƒstring, * ]ÄÛ ó �  ²isinstance(: 2, _	 g_classg rG3bads  ­7arg3(³× ˜ò ¡ †)qñ =  f > 127û  ²  .�5= 1/  ³i = m -€žÐself._fold = 70
  õ self._month = m  ûyear = yhi * 256 + ylo% ÷microsecond = (((us1 << 8) | us2) 3< ’tzinfo = 	 
 ðdef __reduce_ex__(Ž Á, protocol):'  Æ qreturn ! À.__class__, 1 µ._getstate(: )b  _ U D 	ˆ ô2)


datetime.min =  @(1,  )! (ax! ò9999, 12, 31, 23, 59   '99: �resolutiob  m gdelta(k1s=1�  ,ð isoweek1monday(¶Ï ñ# Helper to calculate the day number of M>   starting S ! 1kñ# XXX This could be done more efficiently. ²THURSDAY = ðPfirstq ¡= _ymd2ord¥ 1 Ê$  s ( (   ñ + 6) % 7  # See—  æ q) abover  8 þ 5 = ; -   "daœ )if 4 > ® U 0 N A+= 7c j 1


p¢ timezone(Å{ò__slots__ = '_offset', '_name'ˆ Ò Àntinel value§Âdisallow NonÞ p_Omitte^�object()“ (²new__(cls, e  , b =6 �  dôif not isinstance(2  Ã c.  2 òraise TypeError("1 P mustaý : "•  6  h @ame /4ls.Š b% #ot´ 
   pqcls.utcð      ß & =    elu 
Ý  ( _, strÕ  ) Ó kstringÐ 0ot Œ C_min#<=½ 3 <= "ax 
Ï EVáF) "ë  Û 	 "� åctly between -¼ï(hours=24) andJ 8  .õ �@_creGÝ `J@amethodº •0 • ÔŽ cý5.__ÌL # .? rj   À=÷ ¿  ! l™  ƒinitargsX� ö"""pickle support""�#ifVn !is€é	Ž.Ë “ ­ U S© #eq  h, otheÄ)ifÃ  ,ˆ …Ï  !t À self._offseót == other._offset
  ñreturn NotImplemented
 ñdef __hash__(self):  : 7    X ); Nrepr; ð"""Convert to formal string,  7 2().J  m õ>>> tz = timezone.utc‹   3 5tz) P'date/ . 4 '   5 	S (( ödelta(hours=-5), 'EST'V  6 k "k ( U •-1, 68400V "� &"" 0if k1 is  ê v zá H `._nameN ONoneJ ã"%s.%s(%r)" % Îõ_class__.__module__,°  ‡   » '._= @qual‚ ? ¢vò ¨ /, ¬ },¬l	/st Ð , tz(�9 2utcŽG, dt{ôif isinstance(dt, o) or dtî
v öaise TypeError("� `) argu¥ must be aq  ‡ À"”  ß "à ö  Œ Ý 3î ™ z­S_fromlÈ 0  8 r:Û 7B1dst¥ 43Õ  œÏ  s Ì B y?utcÐ 
ÁÀif dt.tzinfoõ1not‰
&  Å§DValuâ€ :B Å C  D"is f "¢  OAdt +… J\ƒ (`>ð_maxoffset = timeò(delta(hours=24, microseconds=-1)
    _minoffset = -_max 
 Ñ@staticmethod ò def _name_from_- (k !):"  V qif not     Èreturn 'UTC'/ + q < time '(0P  : –sign = '-8   -  ¼ 	 S Jelsez @ +@ P, resþ bdivmodÌ ,‰ & 2=1)1 t |minutes:  H 9 ' 	; €! =v . · ¤$  ) )ifÐ
ë e (fg{ù !}{Æ s:02d}:{™  „   è  Hf'.{† f:06d}'4if E ¡  < ˆ ‡ )C 0'

>¡zone.utc =Ä €_create(  (ð(0))
# bpo-37642: These attribÝð are rounded to the neaä @ñ for backwards
# compatibility, even though> ð0constructor will accept a wider range of
# values. This may cha iQ –e future.ï  mi Þ 	ï - ð ÿ0=23½W=59))B /ax1A Ð_EPOCH = dateo �(1970, 1 ptzinfo= ™ Áutc)

# Somež  õ algebra.  For aL � x, let
#M0 x.å ñx stripped of itsH G !-- Bnaiv^ .: Po = x±ð), and assuming that doesn't rai@n ex¡cion orK Š  –CNone 1x.dc Odst(] @s]  's standarü  ´ð, x.o - x.d
#
# Now s\°derived rul¨ where k is^@uratÕ !).? !1.P  +2s +V  ñ ‡€follows øÐadefiniJ bof x.sE q2. If x`@y haŒPhe saóp member½  Ø y: h  ¤ ðctually a requirement³²pu w‘�“make abou,Rsane }s classe� 3T"e #1UTC=± correspond0o x* p [oG ž Jgain› -a w �4. (x+k).î  x.+"  Ü	U #2ã d�P.=0tz+ Ë£ preservesâ e 5e Àk).n = x.n +ð: k
#    Again follows from how arithmetic is defined.
#
# Now we can expl? 0tz.: ñutc(x).  Let's assume i ðn interesting case
# (mean ð4that the various tzinfo methods exist, and don't blow up or return
™ ò ne when called)° óThe function wants to6 ð a datetime y with  ðzone tz, equivalent4 `x.
# xâalready in UTCh `By #3, e + að y.n - y.o = x.n  1[1]8  ³ Aalgo…ñ starts by attach1z‘ n ñ   H`y.  So« P.n = � ^J @.  T%&it0add1ura&k] ay, so š˜ à becomes true;û eeffectó  5 ñsolve [2] for k:Ï �   (y+k)

 
"[2 Rp1, thisu  same asW  X 3s +l ,d)q&[3W #5,' " + k, whichõ1als­0+ k÷ @ause =L±
# SubstituÙ/”into [3],§  ø K -u $s 
 d¥ ;ý ' òterms cancel, leaving«k6 
@ ô 0; rearranging,- =m ;E$#4ü 0s =sé6 'y._ Â !OnŸ 4RHS: d¢  ‡ð
e computed directly, but F  #"be¢wð°approximateYry ignor¹e¯  d ò at first.  Noteˆkw ò
# very large, since all offset- Z C æ°of magnitud� @lessg ðn 24 hours.  For tb�son, if y�Qfirml1std5°must
# be 0[æ ðit has no conseque· BthenCaIn any ÷Õe new value iô  zÕ! +cK "[4ôI…qhelpful¨€tep backi1loo 2[4]òa higher level: ÄÐsimply
# mapp[ ô   Q @tz'sªBndarÓ AØ€is point?R ž zz5Ç  we have an¦›#imf ar@most(eëò  insecurity herL ø Q ]Á of daylightÌð.  Picture US Easter&r¹€cretenes  ªawall
#8 S jumpG@1:59C3:00 ¡Z q  ~ �form 2:MM¯ ð't make good
# sensø#enÇ 0docUk‘%an˜ -Pclass¡ Âsider such a— tÐbe EDT (becauõ^se it's "after 2"), which is a redundant spelling of 1:MM EST
# on the day DST starts.  We want to return the9 N ñbecause that's
#' Fonly#   Ä makes senset ñ6local wall clock.
#
# In fact, if [5] holds at this point, we do havep Õstandard-timey `,
# bu9  > € Pa bitRproofç ðfirst prove a stronger result# Ú  h ò
# difference betwee?°LHS and RHS^ ‘[5]?  LetÒ 1   8 ± = x.n - (z @z.o)  1[6]8 QNow
#  0 =
  cby [4]) Ì(y + y.s).n 1 Sby #5( 2y.n) & @  siÞ  " ° 2  º [ 2 zfy are šðame tzinfo member–Æ   y.s = z.s ¹ 2‡ 1z.s"PPluggÔcòback into [6] give&  \  ¸' =E B- ((Ô qz.s) - Ž4™expanding0  .  ' 0s +- Bcanc]1 '  ˆ  Ò 1z.dÌ $So%3z.dÄis true now,$ ñ0, so z.d = 0 too,~w{%
# = ÛBed i¾ðendcase described aboveü0e'rkn  ContrarilyÄ$if ,nW ÷àa UTC equivale®  œalso doneß >notã  Ý B!= 0Ú    	�he offsetp Àneed to
# ad	 ° z (in effeBz ä Dz's $ $T 3we B P shif*Be
# ˜“Ot@ �daylight@ )Â â z'¯ •2z +¬ò
 "[7â ñ	we can again ask whether 7 "z'.3'.oB   "[8Y PIf so'¿aIf not­’Rclass%°sane, accorú ø thðassumptions we've madT�Órí rep_ÒAs before, le `comput1e!N@8] (+Pskippï0somn’justifica¥ 0for‘` kindsŽ‚substitu Ä  †� severalÒ »•already):| 7 Øü(‹) €  replac› # Avia ä	¦ E þ@- z'xE  w  E  E À- (z.n + x.nà - (z.n - z.o) ' H=
#  x#  )   %+ 5 � + z'.o =0 «cancel x.nA  ` n+ I o 7  ;  A zA 5 ; ¬  #1 twice| 0z.sÚ ".du s d³ = û
z and z' have same tzinfoL Bz'.dL p
#
# So4 ðis UTC-equivalent to x iff h ð%z.d at this point.  If they are equal,
# we've found X !so/ @doneB ð	n fact, we stop with [7]Í ð
# return z', not botheringŸ qcompute¡ .Ì ¡How could ®  d differ? è 0= z; .dd ð , so merely movW ðz' by
# a dst() offset,Ž ` start% ñ*from* a time already in DST (we knowƒ Q!= 0)– š‘to changecresultn î 2s: 3artV � ¤ ž  little furð	 into it takes us out of‘ ñ
There isn't a sane case w tÕð	can happen.  The closestX Ágets is at
#· 3end` ,D `ere's F 0our¹ 2UTCÐ€no spell=°in a hybridL ¢b classðUS Eastern, that's 5:MMG@ = 0 qEST = 1 pDT.  Du O Àhat hour, on‹ K  Ì "ck3 !is'sn as be“ ‚standardÓp(6:MM
#t ‚) becaus®°docs insista    R, but˜ Z qdayligh9 / (4¸ BUTC)g—’ no local€ @mapp™ %toü - % #
#Ð `jumps Ž  1:59 back¢1:00 again9qrepeatsº7 #  iâ	ù p.  Sincì ywO2thew u a*does*²"wa)1map›3�¶ “ M– $MMÜÏ þ Z mbiguous
#;`sß�goes -- i ˜ 1wayÕ / ²clock worksö…When x =F Ä 8 Ainpuãúñ	algorithm, x.o=0, y.o=-5öPy.d=0ÃPso z=€ . ÜÐ=60 (minutes)… nO@[5] ! iAholdD  Êeep going.
#ŠË3the¯ ¢ †  =  ®p = -60 S ¸ð[8]
# (correctly) concludeè atd !is6Ú  BÛ   ³�said z waé ¾˜`(else ã wÐ"heæ û   Ð!pe"n)‰i !!=º U (8]<  U  é nd8O À), and thereðŽ are only 2 possible values dst() can
# return in Eastern, it follows that z'.d must be 0 (which it is in the example,
# but the reasoning doesn't depend on   e3 0 --q  s ære being
# twoÀ ¹ ñoutcomes, one zero andˆ  other non- õ).  Therefore
# z'Ç ñin standard time,C !isF Pspellº pwe wantñthis case.
#
# Note aga a$ ð
not UTC-equivalent as far  õ ðhybrid tzinfo class is
# concerned (becausePtakes· "as Š 	¸ 1 raó 1thaW±
# daylightØ ° we intend 	0),  rõ â rit giveø ðreal-life "local˜ ðlock repeats an hour" behavior when mappM  â 1"un?Pable"2  „ oÎz?W7  / Pinput;Á6:MM, z=1:MMŒRz.d=0—°we stop at ',y@withT 1he 6 
†  – wÅy `So howü Òábreak?  One ofþµassumptions/€violatedQwÉ S�ilities:ð1) [2] effectively sayZPat y.ép invariSñ	across all y belong to a� ™"  Á@zonew  € isHð true if, for po„ Bcal q@s orNàtinental drift™ð   a region decidöpo changnPs bas�fset from¿7"2)I0 ma® Q vers!pof "dou]x"¸ wpQPtail ‚Pof
# Ø ±he analysisð ñs up a step too early.  I haveô 0houÔ@abou`"atK  en  :2say¬ aIn any¬ Ì‚'s clearÌ tbdefaulã Putc()€0strƒP Phandl6p"almost«Û  “qs:  so ¸aå ¤Q!ofCið Š  œo›matter if®`transi|t pointsŸ�yÇ  o  n, or
#B ¡is skipped,1ome/  s;PŠ  
RlargeL  smŽd è@get dáin its bounds;�4it L !evÐ 0som50per$e 1j€s a nega"‰ ¦SúŒ ² g{ó
# pretty bizarrªaD2subGÁcan override¾Ûfù  is.

try:
€MP_dateûñ import *
except I RError0 ’pass
else p# Clean´Áunused names[ ðdel (_DAYNAMES,  äS_BEFORE_MONTH &IN PI100Y  I4	 J  © P _DI4 @EPOC: ÂMAXORDINAL, ? h ðbuild_struct_timDe,
  ó_check_date_fields,  5tim 1 ¦tzinfo_arg0 Uzname  utc_offset "mp Xerror€ z @clasy ødays_before_month, _ Dyear #in# œ pformat_º 3, _ … àindex, _is_lea‘ øisoweek1monday, _mathž ”ord2ymd, T  [ _¯  �wrap_strf% ¨, _ymd2ordP ð divide_and_rounY “parse_iso¯  <, _ T ë   ñhh_mm_ss_ff, _IsoCalendarDate)/ ò,# XXX Since import * above excludes names that start with _º à# docstring do. óot get overwritten. In the future, it may be„ ÷appropriate to maintain a single module levelq 3andB 0rem´ e Pollow� Qline.! @from- te*ê Ø__doc__

try:( decimal' * B  1d 
< ¿__version__F 	‡libmpdec. �except I•E£ :pydi ¥  § #  © '  «  R"""
M¢ðdifflib -- helpers for comput”ðdeltas between objects.

Function=`_closep`ches(w(ò possibilities, n=3, cutoff=0.6)ðUse SequenceMatcherRáreturn list ofŒñbest "good enough" m1 	� €context_Ø S(a, bh qFor twoR sS 3s, k !a ê C in D  D  8matð n \ R­ B :®  $  erÖ ;Ð`a` and `b` (Ú ˆ )b �restore(’ s, whichÈ l 0oneÅ  ? Ö sBöÑgenerated an ¯ Ý d unified)*D )CÿÕî±A flexible g ^la�BpairÐ âof any type.

[ bDifferR  Ø`produc­°human-readad @!s é#0of ii  ,X @Html\ Z ÂHTML side by  #barison`ð change highligh$ hú
__all__ = ['get+A', '¡ 	 ÷  '¼ ¶ð   'Differ','IS_Cõ	HARACTER_JUNK', 'IS_LINE öcontext_diff',
  ƒ'unified   '# `_bytesI QHtmlD5 ô 'Match']

from heapq import nlargest as _ ( µcollections. ’amedtuple0  2 Etype, áGenericAlias

ƒ U = _n4 (˜ ð, 'a b size')

def _calculate_ratio(mÂ Áes, length):
#if   Óreturn 2.0 * 6 # /' 5 " ñ1.0

class Sequence¤ Aer:
( 1"""  ò  is a flexible B ó	for comparing pairs of sY   L @any %�, so longG5the* ò elements are hashable.  The basicH ð lgorithm predat2andœ ô
little fancier than, an a5 C Ðpublished in ƒ  nð 1980's by Ratcliff X ÑObershelp undT eE °hyperbolic Ø  "K²alt pattern‚Hing"Ã P idea¬ qto findK ƒ  onA  õeiguousA D subO Ó t% Òains no "junk¯Að(R-O doesn't address ( )Œ Fsame‹ ¢hen applie� árecursively to"PpieceÌ Ž s Aleft./ QrightÜ !of2 � !Ì Œ !is© ò not yield minimal ediC n R, but/ @tend} 3 #a"look ‚ "# rpeople.ÚÒAtrieÆ  Ãðute a "human-friendly \Ñ" between twoØ • ñ.  Unlike e.g. UNIX(tm)7 ,ü PfundaÚ alç 1ionhH  …*ú1* &®_-free;‚at's wha&cï qs' eyes( ‘e Windows˜ 0winÒ  añ another interestingÝ  noû,Î µ&up�@that.�ear uniqu&uin eachÌ.G @ThatdÄmethod here,A $toõ0ore‡ auitive= er™I  re±sàn  Ã Ý 3is Y aappearÍ!ber Àleast vulnerLL sto sync× �on blockÛKp lines"»aough (ÜRblank 1 inI �ordinary ¥@ filŠåor maybe "<P>"1 R HTML$ ƒ at( " b`becausµ #isT onlyÛ E3tº 0�cept* of� ¾ ƒ" <wink>ï‡Example,¢`two st­sœpconside  ç CQ |>>> s =1ò(lambda x: x == " "ª0...” À  "private Táhread currentT °;",
    ...  ò"private volatile 8 F )F A>>>
	 ð2.ratio() returns a float in [0, 1], measuring the "similarity" of J Ðsequences.  AH Qrule ! uumb, a l àvalue over 0.6` .nsH ò are close matches:´ ô>>> print(round(sY B, 3)à Q0.866— ê ð
If you're only interestedë Pwhereƒ  Ç u uAget_… ÷ing_blocks() is handy˜ Afor    V /s.8 :™ ÉÊ Á"a[%d] and b
 n  O â%d elements" %^ æ 4a[03 "0]° 2 81 j 4a[8' (17( ,21) $29* (38* 0) S 0Not/!at4£last tupleGoed by þ  6�always aL ðdummy, (len(a),  qb), 0),@this5  }»@case_Uwhich� L … /€ (number… s&!ed½"0.Qð want to know how Pchangë ue first  Ao} bsecond)2use÷ ›opcodes()  ¾  (  Ó@%6s :  	  7 ñ  equal a[0:8] b ¢insert a[8 Q8:17] 3  8:ò‚b[17:38]"Seð ÁDiffer classWð	a fancy human-friendly fmd-   1r, ™i cuses SMÆar both\0ompäsƒof linesù2o c# L 	' ócharacters within —q (near-?Bing)Q é Û àalso function ¡dß ² �tcmoduleÏ ` shows�  imï å` build-onì °can be usedó  do ƒful work– ðTiming:  Basic R-Oï cubic time, 1st ÷ !@quad· �expected˜  % -. ‡ ;is 6  Z R woÖ 7 m1hasH U - ñbehavior dependen aŸ@licaF`way on!R manyF ¸(!A havÁ¤common; beß ï !isµ1ar.E 2"""™ñdef __init__(self, isjunk=None, a='', b Aauto RTrue)r aì"""Construct a(‘ )  Op  X#rgg  – j   (9ðdefault), or a one-argu¨·  E g th+0akeÉTyÐreturns true “iff the
  ðelement is junk.  None pequival õto passing "lambda x: 0", i.e.L 3no O ôs are considered to beb ÁFor example,Y B  • a µx in " \\t"" qif you'^ @mpar” õlines as sequences of characters, and don'tH @want– õsynch up on blanks or hard tabs.
2 àOptional arg a"�the firsto 7two€ ð  co£ ued.  ByI pdefault– � empty stÈ f.  TheC�of a must;Öhashable.  Se¿ñalso .set_seqs()ê  ?1()À bÀ osecondÁ FbÁ  À 2À ð autojunk should"!seÑPFalseÚ0dis1	î"8 QmaticŒö heuristic" that treats popular‹aÃð(see module docuCað  for more infork 6on)#6"""R¥# Members:Y 7# a  bÛ b * Ì+ ‚; differ‘`mputed, "wñ ,doE Rwe ne² doH0'a' öchange it into 'b'?–\# b2jJ  Ã b, 0[x]uCa li2h& di°(U ,b)D òat which x appears;º Ò§cdo not* K –fullbcoun #2¯¤ &  «  ==:0 nu¢ gimes xW C —  «ñb; only materialized if reallyWŒed (usedF 8  1 3 utÖpquick_rW(()ü matching_blocksK aý(i, j, k) triples, where a[i:i+k] == b[j:j+k];H PscendŠ à& non-overlapp Ain ikÐin j; terminaZbècða dummy (len(a),  ÷ b), 0) sentinel| oopcodeÖ 	øtag, i1, i2, j1, j2) tuá ]tag iD  Ù'ofl Á  °'replace'  W1:i2][ @d by0_1:j2]G QdeletF G  ü� `insert€ b �  7; Qequal: u Ù© À       # isjSunk
  # ü'a user-supplied function taking a sequence element andF `return0 ¶true iff th2 üis "junk" -- this hasD ðsubtle but helpful effects � ü	he algorithm, which I'llG ðget around to writ— üup someday <0.9 wink>.< ðDON'T USE!  Only __chain_b&s» ñ.  Use "in self.bÙ K  [  ãitems in b forÄ  isA ‰ is TrueH |popularK 2non3 O ±treated as  !by€Ðheuristic (ifÃ Ed).
O ¿  "= 	 
 3a =å { = None 1utoo 3= a 
! âset_seqs(a, b)z Edef   ƒ !,  :; a"""SetÁ 5two€sÐ·be comparedÊ “>>> s = S«•Matcher()T " .x ì"abcd", "bcde"' Wratio= E0.75J 2"""É  @ À V 61(aI  /2(ü   1(# O, a)ù Ufirstû ú ¯The second-  ZŸnot chang6 é/, #(	m/1(e51.0d6>>>dÕ @utesˆð caches detailed informÀan abouGX *ð, so if you wantg^0 onYú•S againstJ Emanyr s,\ 	`2(S) o2…and call 61(x$1rep¶!lybeach o9Vother` ë Ses\)	Û62()C	«@if a w&.au Ç¿Ý # J = a mW�ing_blockq* `opcode  :¹æ2êbê” „å ë
 Þ êi"2(4â	Oê[Àuence, so ifó you want to compare one sequence S against
  Emany  ðs, use .set_seq2(S) o8 …and call E1(x)D örepeatedly for each of the other` %.
5 “See also m @s() g  E1()., 6"""9 õ if b is self.b:%  Ñ ereturn # J = b òmatching_blocks =M `opcode JNone3 Þfullbcount =  ²__chain_b()ª 4# Fð element x in b,ñ p b2j[x]¨da list0’indices iÅ ñ# b where x appears;X(  âòin increasing order; note thaê#5 anumberk FimesT ™  TBlen(› B) ..�#‚ n"`isjunk* ‘defined,  ã ñs don't show up in thisJñ
# map at all, which stops› ñcentral find_longest_§s methodD  from startì  ¼%   Ìa 	” È 2b2js@does"� contain ~ 1ies¿¤"popular" Ö “, meaning…  `2 ac û1morv�n 1 + 1%l‡he totalP $anÑ 0whe%¤0is Ìõonably large (>= 200B )Uis ca(ðe viewed as an adaptiveç 0ion‰ Psemi-¯,iQyield, tenormou¨qspeedup÷s, e.g.,N góprogram files with hundreds of" c anÉBof "–w NULL;"�¤& VAonlyi!ed ` b chaA; soŸÄcross-producÝ1kin~  Âes, it's bes ºX2Ñ,u Ôè1¶ ÈÄFdef Ù M)o`# Beca/a?#r-ò (not C) functionxbwe tes»  ´#×  ˜c a LOT½ cimportÍpminimiz\&e Ç “s¦J 2Bef‚Pe triÛ described G,Ð ° was by far9 mo” °time-consumörroutineÒòe whole module!  If anyjeG� pJim Ros  srank him…÷ 0proIò.py -- I never woul!G Áhave guesseduô pThe firë ó  G€to buildg` ignorÄ  �±possibilityõ` !of3Â.  I.e., we É a à»Ä yet.  ThrowE !utIÊPlater‹ °much cheapeh"anš  �  �w"right"Œ â « æé b¦
ÌÀ.b2j = b2j =c {}

  õfor i, elt in enumerate(b):$  + ÿindices = b2j.setdefault(elt, []). ¦.append(i)q õ# Purge junk elements= aself.b =# f= set(_ #is +  ? 2if  
½  å â  ¾ [keys(à ä >  Õ     $  } A.add# x   e  % €: # sepaNÇ loop avoids pist of � 	J  N 0delj^[elt]=upopular@Ñ that are not8Q 'b1 &= 
 
X—n = len(bk!f > @autoÓ Ú and n >= 200bõntest = n // 100 + 1ƒ  Ð `, idxsk ‰OitemŠ Œ  , A) > ^ 
q  T   Ï “(  –ð ditto; as fast š ¹1% deletion¶  b Šðdef find_longest_match(,ò, alo=0, ahi=None, b b Xƒ"""Find G  G 0ing3  ck%¡a[alo:ahi]|¶b[blo:bhi].3By Œ� it will� J theZ  Q   €entirety|aX O I1 isN†defined:r óReturn (i,j,k) such�p[i:i+k]; ù	equal to b[j:j+k], where`�alo <= i  +k 9ahi# b# j j# b#  “ Âðall (i',j',k') meetJ°those condiÝ)s,\ kÌ)k' Œ 
  e  [‚ == i', � 'ñ In other words,Z�ll maxima 0tch� ’blocks, rB1one9� Àstarts earliQQin a,£0of ã Ð X L  K y  }  u  b@>>> ø�SequenceMí2er(Þ " abcd", "  B< ., ¦0, 5, 0, 9- Y  (a>·b=4, size=5;	›—~, firstîo& i_`determÏ ÿ@abov¡u7tÄBe ad* al restric8Z5 no©¾ æ!arÖ Yår.  Then9  –xtended a” 0far� ¶possible by	a(only)Ñìöon both sides.  S—   Qresulýw ðnever matches on ð
junk except as identical  #
  ðhappens to be adjacent õ	an "interesting" match.
; ðHere's the same examplem óbefore, but considering blankm H òjunk.  That prevents " abcd" fromz  @  l  !at{ EtailK aend of ñsecond sequence directly.  Instead only, "l 5canJ í R, and~ eé “leftmost 3 !inA m :%“>>> s = Sˆ MEôer(lambda x: x==" ",ò ,[ ÿ )� H á.find_longest_£ ¶(0, 5, 0, 9- e ö(a=1, b=0, size=4)– ÂIf no blocksà à, return (alo, G, 0)î� É  ANone´  Ã &c"… 1 ² 2² 1- ² 0² 0  6"""¾ ð# CAUTION:  stripp`commonB fix or suf
 PwouldÝPincor.Vw# E.g., [   ab c L7 y G0 is¹"ô:if � 'isT ´ ped, it'7 ü" (tied with "b").  UNIX(tm) diff does soE ð, so ends up claim‘ tJ ab“ qchangedÐgcab byC PinserÜc "ca" Ìcmiddle‘¡'s minimalÌÇunintuitive:I "È ‘obvious" € ‚someone e ƒed "ac" µXfront‡1Winè Ì ( XAplacV " `aby paiS'up‰   ±unique 'b's¿Fthen­ " çfirst two 'a'säàa, b, b2j, isb˜¢ = self.a, b  $  ' Õ.__contains__� `if ahi‡ %1 {  v= len(aæOif b1   1 b1 bœ ,  j  ë7 = Å�  # ? ?R-free' !duZÄan iterationVñ loop, j2len[j] ‘ 0gth X H  Ab  © Ÿæaa[i-1]¡Eb[j]6 [ U = {} @noth8 6= [( Pfor i³ráµJahi)f`# lookv0all‹`tances¯ @a[i]@ rb; noteµubecause{  ª#@ has3 Ó a keys,ø  à€skipped òX s_	H Ú Rget =@I.get! 1new$ 
þ  ƒ  í j­  2j7 (½ ,¸  ô À        # a[ûi] matches b[j]
  ½if j < blo:  + �continue 9 o>= bhi: ]break7 ñk = newj2len[j] =  ý get(j-1, 0) + 17 ÿ if k > bestsizer Qesti,% j  , ² = i-k+1, j 
•  • 
| Á# Extend theU ÷# by non-junk elements on each end.  In particular,L @"pop "C  ÷aren't in b2j, which greatly speedsJ  � ðinner loop above, but also means "&  /" w so farG @doesv  â�ain any Ú S*or* ® ­ .C BwhilÀi > alo and t j« \0  O�  not isbj 1(b[. A-1])< , a  †i-1] == . 
ÿ D ÷  U 	 j	  +bÆ +(   a < ahi“   j b ¬ Ø  7 ß ' æ  í £ H+= 1¬ðNow that we have a wholly inter#ngõ(albeit possibly£ # empty!),G ñmay as well suck upQ2ing/ D ðside of it too.  CaiPthink Ña good reason1to,n(itG @aves¤ �t-processt  Ø(¹ @ conn Ðrable) expens| G Pfigur: Pout w"Òto do with it´ V !ca; 2 anD Cñ, this is clearlyPright 1ng e ðbecause no other kindO K Ö e	 ‘ regionsr-nÁÔ .I
' j=Ôut€return M_((…)¢�def get_êöing_blocks(self)àB"""RT @listð triples describÆD â subsequences.h  bð Each triple is óof the form (i, j, n), and means that
  ó4a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
J ! id ñin j.  New in Python 2.5, it's also guaranteed� 5 if� ² M Á(i', j', n')ˆ …adjacent� !inî Alistä I  Òsecond is not( $as<  Ÿ  % ; õthen i+n != i' orI j ­j'.  IOW, „ ænever describe  UequalH …blocks.
  dl� ðs a dummy, (len(a),  Sb), 0ÃiÀee onlyI ©§ with n==0d ñ>>> s = SequenceMatcher(None, "abxcd"	 Ecd")R  7  €(s.get_m6 Bing_Ä &()* [R p(a=0, b ”size=2),  3 =2,  5 4 50)]~ 6"""&‹if self.„ Õ É ::  ‹oreturn5 ( �la, lb =__ l &b)€ `# Thiso ¡most natur°expressed a¹örecursive algorithm, bujp# at leññone user bumped into extrem P caseéµat exceeded¼ #Éo ¡on limit oðir box.  So, now we maintain a ÓH Ò('queue`) of Û 1 qstill nž‚o look a]× append partiÛë# results to `ª`iaH !p;»   XIsortÜ a¨Eend.ª ¦ € = [(0, »  b1R   + Nawhile D 
)�alo, ahi,ü r, bhi =( V.pop(ä VIrk = x =]³find_longes#(S 
F ö# a[alo:i] vs b[blo:j] unknowJ q  +  ›pk] samee kÛ ( T+k:ahU Pj+k:b W  if k:   # 
  × 0,–Pre wa( M %ck… l    .*(xé  * ƒif alo <b j„ (   ŸL G˜jn +   €if i+k <¿)j ?bhi_ 3i+kùj
 7bhic à  ¢(IÈ‚possibleÁPwe haûŸûBs 5theJ#cD˜ ¯ ¹t\"ngÎ8t€2cod¢+adðo collapse them.#
  `i1 = j k 0 õnon_adjacent = [] õfor i2, j2, k2 in matching_blocks:+  e ¡# Is this   U éto i1, j1, k1?4 €if i1 + ” €= i2 and¦  *j2d h ò	Yes, so collapse them --~ Ðjust increase’ ¹e length of} M “the first·  byO 3  qsecond,Ÿ 1 M  ú #so? ²ened remain‰   t» €mpare ag -t.L ‰k1 += k2 Oelse5Noto±.  Remember» Ü ù(k1==0 means it's^ òdummy we started with)ÿ 1makq 6?theL  4new  ó ^if k1ß  — n¥–.append((U-))}   YÆ( m  e > + Ö (la, lb, 0) ‘ [self.9Ð = list(map(MT ._W(, X Õ return K 
” ðdef get_opcodes(* )KB"""RC  w ñ of 5-tuples describing how to k ’a into b.`  „QEach 6 0 isD 	‘orm (tag,ä/ ìe2).  T[7 ª  J 0has÷=‘2= 0Z) Š / cs have)  l pi2 fromÖK * p preced: "itL �likewise Å ÷=7  ) ‡vious j2Ú  ¨ Ptags ’�strings,ô 5 !se1  :ó'replace':  a[i1:i2] should be  Æd by b[j1:j2Ya'delet; <  d <0Not�at j1==j—uFcase3 p'insertž € Ÿ  Sed at‚ &1]=  h  p _i1==ip Qequalo Q U2] ==| 9õ>>> a = "qabxcd"Ë  b jabycdf Ás = Sequence2Öer(None, a, bn E  ó’  Á(s.&"0...ò øprint(("%7s a[%d:%d] (%s) b 5" %· :  > +  ý H)Þ ñ  a[0:1] (qn f0:0] (Ù !  b² a[1:3] (ab& 2 � ð replace a[3:4] õ(x) b[2:3] (y)
  ðequal a[4:6] (cd' 23:5 ( ¡insert a[6(  & 5
 fM E"""
2 õif self.opcodes is not None:%  † ireturn-   •i = j = 0 	T Õ= answer = []# ófor ai, bj, size i^ úget_matching_blocks()� õ'# invariant:  we've pumped out correct diffs to change{  Ð ô# a[:i] into b[:j], and the next ƒ  ƒ = is? `ai:ai+¼ Â] == b[bj:bj p.  So wL  edƒ  Ÿ B  « a¥  ! ¤ 0 a[V ˜  R !],Ý  Û B  ­ 
¨ Å ó move (i,j) beyo× * 	B ‰tag = '' ‘if i < aijj < bj @; zreplaceB %elD 9 _delet8 q â
p nif tagk wñ.append( (tag, i,wjz&)  Õ !i,ÈÖ " Î	##{list of&@û terminated by a= Òsentinel withù7„ f Î ''Ï IjÒ ³ó@def `ƒgrouped_÷(°W, n=3i³""" IsolateA� clustersÙ 1eliç Ping r_sÓ no"s.t  Õ R>°a generator=† 7  uppn lines …context.@QEach 3  ¦!inˆò same format as ó z è à )Œ ó>>> from pprint import n  & @a = é’(map(str,é v(1,40)); , 0b =Rà P[8:8]ø@'i']	² # Make an Ê9iont Áb[20] += 'x'1  3  mLment4 23:2i f 4 he 3e ye onotherk 4(�SequenceM­0er(5`,a,b).{ªc15[[(¾`5, 8,  R), ('' 8 9 íõ 8, 11, 9, 12)], S P16, 1" g7, 20)% 3 ('E'#  20# K, 21' p ! 2! K, 23% ]Pe', 2"  n 3&  K @7, 3p  % 6½ À    [('equalõ', 31, 34, 27, 30),
  �('replace' P4, 35#  3 ' Pequal%  ! 8!  T 5)]]M E"""
 ñcodes = self.get_op %()# qif not  :  š  a = [("w r", 0, 1 )r ð
# Fixup leading and trail õgroups if they show no changes.q "ifƒ ±[0][0] == 'u '” õtag, i1, i2, j1, j2 =: N ¿ L  6 Bmax(: 2-n)A   E  %j2A � /-1� &&-1$‘ R-1] =’  Ž @min(Ì 0i1+–  Ž   jß 6+n)Ì¥nn = n + n¦ ] ¢i 6for]  Y  R Rj2 in&
O0# E­²he current S  Ãõ	start a new one whenever~  Ô #×ð re is a large rÚ_ withé 6  'agå4ªi2-i1 > nn¥  2 — ‘.append((Ð>)è F   Ryieldç 	Ê   f 
P     n Pj1 = 4  !i24  c*-nm M ³ ”G ,j2� "if’  �Q(len(B A)==1  ),Þ ß  def ratio(. ñ"""Return a measure o¦ð sequences' similarity (floatIv[0,1]).›pWhere Tðthe total numberT €elements< Fbotha ,Ú ¨  dMA ; Ðmatches, this –2.0*M / T;•Note that% 1pi   a¥�denticalw U 0 if| ž@havehº2Gmmoné .K)Š €expensivð € computex @you I ´n't already do �Ý ñing_blocks() or  §,4°which case ] 5mayH ôwant to try .quick_£  L Zreal_ Afirs3 Vget aL·upper boundñ @>>> ASM�ör(None, "abcd", "bcde"ÿ6 ,¬ E0.75 # 	›  )  É . 51.0 	ý_ÿ um(triple[$  ^ u0 �Ñ r*£_calculatef3  Ÿ ¯I Sa) +  Àf.b))

    dóef quick_ratio(self):
  ò"""Return an upper bound on 1 Â) relativelyJ Ely.
A ÿThis isn't defined beyond that it is\  .] U, andM õis faster to compute. 6"""x °# viewing aC ð b as multisets, set matchesM õ the cardinalityT ð# of their intersection; tØ `counts  p number. V C àwithout regardo �order, soþ {clearly@ 0if •a.fullbr  5 FNone§ ®% '= 2 E= {}R  . ¢for elt in^ bM # q h[elt] Q õ.get(elt, 0) + 1\ 	t “ %  # avail[x]Ë  |?ð times x appears¡ q'b' lesiD 4 ¡we've seenWPn 'a'cÕfar ... kinda@ ‚   Ehas,=© õ.__contains__, 0E FaF"if@ 0has-X `   Ä  f f[   ;elså  4 j�	@ Ñ W ! =¢' -« L "if :> 0»   Ê% =êr£_calculateB6 Q, lenO .a# 2b))§Ÿdef real_€,?verzb Â”n either ±X or .Ñ )¡ˆla, lb ='4%b)Ê@# ca@•have more�Kthan~Peleme•i E @shor;…sequence É2in(¦ £), la + lb»ñ__class_getitem__ =  ðmethod(GenericAlias)


ë£get_close_"ó(word, possibilities, n=3, cutoff=0.64ƒ"""Use S¼ Mº¾ @list~ Môbest "good enough"2™ y  z$a  Êawhich ¤ 1 ð are desired (typical¬>sstring)V 	É _ – g @s agF"t l "toi  ’ S d  ? h si  Op„ðal arg n (default 3)v  qmaximumÜ–	Ö À to
    retuñPrn.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  PossibilitiesK ñthat don't score at least  ósimilar to word are ignoredŒ àThe best (no mB øthan n) matches among the p L �returnedŒ óin a list, sorted by ‚ 2ity¡ d, most c first‹ ã>>> get_close_ ð("appel", ["ape",  l	 Ppeach �puppy"])‡ ñ['apple', 'ape']  \ ¢import key3s _ #   1whe , 0.kwä l Hwhile B  A� %",n 
B   ;  oaccept< 0'ex  ä 2"""`áif not n >  0:Ý  wùraise ValueError("�Â: %r" % (n,)Þ H d0.0 <=©_<= 1.V 
ÒøiÁ0.0,7 ]e % j 0resü2= [Ñs = SequenceMˆ"r(” °s.set_seq2(Æ Pfor x*	¢ú 5 21(x2  õ
if s.real_quick_ratio() >ì Uand \@_   s.+ P ‘   ô .ßcnd((s.0 R, x))Éa# Move|¤ã rsÏqhead ofp¢ O ò = _nlargest(n,  ô r# Stripˆ s 5 ÖZ nïL  ×1 [x% v ,aP p]


defÒò	ep_original_ws(s, tag_s)ì ñ"""Replace whitesp 1ithÕ :   charactersÑ0`s`×0• �''.join(©   Ac ifu �c == " " ·Ac.isn r() else" 5  ý c¬ ch 6zip¼ & ò)



class DifferÒ r�  ª' T £omparing s¿s¦!ne	 Ptext,¡ d `produc. ñhuman-readable dr  þÓs or deltas. Š 3 usÿ$0 boZ1o c‡ e…  }  A# ˆ 	¬ �ewithin­a(near-™£ing) lines½AEach  ï a© ¹ € begins N ò a two-letter code:ë Ê@'- '  X p uniqueª ž ! 1­  " /'+* 2*  * `commonT )Y s. ?.  Dppresent#Åeither inputY½ L	ç Ànning with 'ð? ' attempt to guide the eye ðBintraline
    differences, and were not present in either input sequence.  These L sM ñcan be confusing ifz s3 s ñtain tab characters.
? 0Notª Aat D– ð  makes no claim½ ñproduce a *minimal*Ã P.  Tol I  coä Cry, % $ ðs are often counter-intuitive, becaus� �ey synchL €up anywhðpossible, sometimes accidental matches 100 pag Qpart.H €Restrict^ p pointsÖ  ° eiguousD ~Arvesk ¡ notion ofL Àlocality, atõ ò occasional cost of * n �a longerkð Example: Compar' „two textŽñ First we set uph   ,si °individual ô0le- î "ng0endb €with new  ws (suchK  =@alsoB ob&ped fromz ÷ Q`read=  ()` method‚ !fiu Âke objects):Q1>>>Ó ò1 = '''  1. Beautiful is better than ugly«ü...   2. Explicit+ "im / @3. S e-  cojx, !4.x?lex- ficated1 ’'''.splitü ákeepends=True) é @len( 1 4  q[0][-1] A'\n'	  7   2 !3%ó Ü ÷ e$m5. Fla{?nesæ @NextÈ instantiat@c203d ="()F—Vwhen G  Ôa- { h Ðmay pass func· äŠ 0filo@out ËpÓ 'junk'.  SeeV ó.__init__ for detailsÃ€Finally,s  d Ý ç7twoÏ óresult = list(d.* *,#2)é '- 'ža1  ^É ô` let'sptty-pritn ¯p cmport  Bas _ 
 z (v ¶ ['•§A\n',H ? '-«3 ¯0 O+   î2 ?Æ 7 ++  ¨ ø5 H M 3  ^ 
 ð---- ^\n',
     'ð+   4. Complicated is better than c �ex.\n',
   '?  c++++ ^  ^4  i |5. Flatb `nesteda !]
b ò"As a single multi-line string it looks like this:7 ñ>>> print(''.join(result), end="")^  ¥ Ì1. Beautiful� Qugly.* �-   2. Exi¸ i4&it- @3. S eT EW  O3.  , k!++9  � ­/exd Ä’ <  ï /  £a---- ^]  – ] F a .ex] 
] þ' 2"""Ëðdef __init__(self, õ junk=None, char !):?  ë  C     ò%Construct a text differencer, with optional filters.€  > vThe two# àkeyword parame. ƒ are for> P funcP ’ G 4- `» E`: A$  ^àt should accep§ öëƒargumenty O ö and return true iff th s  . ¿ Åmodule-levely +ô  `IS_LINE_JUNK` may be used toÕ 1out}s2  wvisibleI  Ž acA, exÌ  �at most o¾pû‘('#').  IN·recommendedM �to leavev  Í  ó;æ punderly@SequË÷Matcher class hasK àan adaptive no›± of "noise"` sˆ'ô§any staticL 0def‘1ionŠ `authorp ð  ever been able;WcraftL0- `# Í é±of length 1ÏŒ ÙÏŸCHARACTERÔN ¡whitespaceWÉð (a blank or tab; **note**: bad ideaë hinclud0newò  i)0is!ð0Usez:IS_¡  d\ è È£  .T ajunk =¹  
! b! =Ç ! "  N ‚3areMGa, b5rn  v     Ø üsds½  �  s; generat{1e rb �WdeltaóTEach @ ó	 must contain individualæàs­ Q   ¿  • TWs. SuX Ps can´ obZ qed from Q`read³ “()` methoeÀ   of file-ló.ike objects.  The delta generated also consists of newline-
  atermin- ñ
strings, ready to be prinJ ðs-is via the writeI %()J `methode †a file-l  %.
' †Example: 2>>>g ð$(''.join(Differ().compare('one\ntwo\nthree\n'.split„ …s(True),c 3...Þ  0'orQ K ?emuP )R fend=""ö U- onez E?  ^ O+ or U- two) !- Õ  6?  ¡V+ treG U+ emu* 6"""Hðcruncher = SequenceMat `(self.,¦junk, a, bÃ ðfor tag, alo, ahi, b
 tbhi in W õ .get_opcodes():„  d ifB Ú == 'replace'!  % Ag = ‰ s_fancy_* )(az } ¢  > 'ele _deletd �dump('-'î Ú S oinsert· 
S _+', b¦ _equalR  ¥ .seLñ
raise ValueError('unknownˆp%r' % (Õ9))
ªÂyield from g Qdef _Û  �,A P, x, 'hiéC"""GZ ™Ðison results Gða same-tagged range.¤ Á   $ U (c  $ ¢ e'%s %sÇ S x[i]Ë ± UplainCº I@ asæ ê  <ë@ andîe < bhi* # ëpshorter% ñck first -- reduces# ¡burden on - -TK pmemory ¿"heH Ps are+avery dï•ent sizes;  if•   -4 ¯ -» Ï  0“ \ ¹ /('¥
ksecond2 *,el�r @  ¤ r ¤ ù  'g|j ", ? 
÷ 'É
[r¦0Whe× È0ingá ‚ ck± Eàs with anotherŸ BarchFlockÂ É ¡*similar* < ;( Pest-mž b ðpair (if any) is us½5s aðsynch point, and intóraline difference marking is done on the
  ðsimilar pair. Lots of work, but often uth it.
9 †Example: ‘>>> d = D} %()+   õ%results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,A 3...¯  A xdefGhijA 
‚ ãprint(''.join(� –), end="", (- � „ ?{ 0^    +, z  , 6""",#�ð't synch up unless› Â“s have a  �ity scorež%atj ò# least cutoff; best_ratio trackR   ? µseen so farE   5 ,I € = 0.74, 5( ð cruncher = Sequ_0Mat æ(self.charjunkLñeqi, eqj = None, ñ    # 1st indiceqSequalú ˆ(if any).¡search for# ®q that m� sù ± without beò…denticalÁ D# (i m 0mus0  ¸  c, & we uwant to¨K "on5 $--½"we¶&to ² õj in range(blo, bhi):J  Xb"Ib[j] pÆ.set_seq2(bjZ  8  ^ i^ a^ a^  * Šai = a[ib    nzi == bj•     `if eqiA Ä$  ( íIi, jË      vcontinu€    ì J1(aiì  & €# computßÐis expensive,Þ1use(]quick‰ ò# upper bounds first --½! this speedœ_messyF   Œ ðares by a factor /3.-  0not” 1at Ÿ ()QFonly»  i T u* e™ K  ðtime it's calledÔ3a s“Ë;ÿ F par5 J  #­ 3theU 6n– `cachedÖ –… 4if  a.real_jEA() >� m and \B  �  E @ -Uz «î "i,®  „Õ  I(), Ë"if+ n # <.
h –# no non-ká"pretty close"¡	bS O þ0eit‹ð -- treat it as ûa straight replace
  óyield from self._plain_/ ð(a, alo, ahi, b, b Mbhi)I ireturn ñ# no close pair, but an identical ù -- synch up on thatG Pbest_   1j,  õratio = eqi, eqj, 1.07 Uelse:  ó ¹# there's a“ �so forget  š z(if anyí µeqi = None
b A# a[— òi] very similar to b 0j];­ 1 is< @ iffs vy're noò #… ` âpump out diffs±`beforeF AFpoinJ ÛÅfancy_helperÚ· Ýf)| òdo intraline markingªey 5air@aelt¦Flt =,	* (if±ó �a '-', '? + p?' quad»ÿ 0ed ¢ s_  ø“atags = b )"" öcruncher.set_seqs(¾ 
÷Àfor tag, ai1 `2, bj1 U2 in I Úget_opcodes()Ó  � `la, lbBi2 -M  bj 9bj1›  .  ift S == '’'S  ) ç ½+= '^' * laK  & & b& 'els odeleter -r 	L oinsertL ˜ +L ˜ _equalK 	 K 	& q B A  ñ
raise ValueError('unknown«p%r' % (*)A�wqformatr!, ¿ ,®? Ï} WW	Öw p'  ' + Ý
 %# cVVafterV UP+$4R  9 Ydef _� ~/, p÷ag = []F  � £@lo <£%  b :bhi    G  t .‡ `ò’
T Qdump(¶Ò Ñ ifL= < � ™ E  ñ	zû Û¼gÖð def _qformat(seÂlf, aline, b €atags, b C):
  Er""" õFormat "?" output and deal with tabs.
/ †Example: õ>>> d = Differ()+   ñ results = d._qfl ò('\tabcDefghiJkl\n',  rdefGhij I 3...º  `'  ^ ^   G    
Ž @for C in š Ð: print(repr( )3 5...„ ='- ¶  C? \t‹ 6\n' +5 ×  5 �Áó = _keep_original_ws(é! ‡).rstrip|ó9 ! 9 — Âyield "- " +O 1if p J w1 Qf"? { F}\n" !"+O | O † O  O 0# W�ñBrespect to junk, an earlier version of ndiff simply refused to
# *start* a match ãaM ã element.  The ð was cases like this:
#ø q beforeAòvate Thread current ;, pafter: m, volatil5 ðIf you consider whitespaceý !be³ Ð, the longest, �tiguous Ý €
# not sò 2ingÏ 7_ is "{ c".  SoAÐreported
# th$#e ¸ "@inse  � betweenŽ 1't'B š 0'e'k@"priö p".
# Wh÷ €an accur8Pview,Ö Ppeopld³at's absurdŽUå�
# looks Òí  á bblocks¬ Áare entirely,Q-free1€n extend* eJ @0one=Àthose as far òpossible but onlyIv  R Ù  7Cow "«  "l+ )ed} ‘€ suck up9’
# precedÊ @ank; %n >	K  ¥Ç J mfollowJ ” ;¬fV)ly÷söô-e ö  # "V ª"`quibbl]`remainŠ ipÑat perhaps itE`reallyë h¾"iAe"
#' lJÒ.  I can liveš¬°<wink>.

imÅñ re

def IS_LINE_JUNKðñ, pat=re.compile(r"\s*(?:#\s*)?$").À@<±Return True†`ignora( F : ‚` `¸�blank or¥óains a single '#'`\s] @	¯ B'\n'ž v HÀ>>> IS_LINE_ñ
JUNK('  #   \n')
    True	 Â>>> IS_LINE_* Uhello) BFals* A"""
3 ðreturn pat(line) is not None

defQ ’CHARACTERV âch, ws=" \t"):G  Q  Œ RP  “ ð for ignorable character: iff `ch`m ò a space or tab.– ’Examples: Ø ‡ /'  ( /\t) R){ xR )  Ïch in ws


# 4 I à  Unified Diff ] 2ëò _format_range_ui Ã(start, stopî‘'Convert ) À to the "ed"ôAmat'
Q# Per dòñspec at http://www.unix.org/singls  x_( ¡ification/J Ábeginning = � @ + 1o0 # ·s `number( Pwith Ä & alength< Bop -- Y 4if  2= 1Ì 2 R'{}'.(„ u!if(> 9 & 3 -=£  ¯Rempty0!s %   ¼ Á just before-Už † ,‰ ,¼ )¾°_mõ(a, b, fromfile='', to  1dat n  ø  -   Q n=3,j`term='Rô rø 6 PCompaÂ ñ wo sequences of6 ¢s; generatã ³delta as a ¶  ¶ þâ   s U 0a c_ `ct wayU @showçA ch°±s and a fewÏ   � âcontext.  The # D  ¡  ‹ñset by 'n' whichG ‚defaultsæ3ree¥ 3By  ,¶ ­  S 3rolS q(those ‹�---, +++,é0@@)× ` rcreated& pa trailÚ 0newÂ ¶  isŸ �helpful so™at inputsE  Ø æP.read@ �s() resul0 e`s that€ Q suitœ1forH ; Twrite< ¡since bothæ t j0out€ U have· F » s*F¬ z !do:	8  4  , † O ‚  nS €argument†%"" ( ˆ � will bePTormlyS & fµ 1uni¬×  nóQlly h�`headerÇHBnameY5mod•“ °times.  AnyÔ0allU�these mayŒ Ê@ed uá0 stœs^ C '° tB', 'r 
   ~ð ', and 'tofiledð:ate'.
    The modification times are normally expressed in the ISO 8601 f# 1t.
K ‚Example: 0>>> P line8 ñunified_diff('one two three four'.split(),M 0...Ÿ  a'zero 7 2 ÿ 'Original', 'Current'I ð2005-01-26 23:30:506 ÿ2010-04-02 10:20:52B  Ò ™term=''):­ `print(  )¹ 	 ñ# doctest: +NORMALIZE_WHITESPACEI D--- Ë 9 °  , C+++ ë +  Å  , �@@ -1,4 + !@@ +R
  W	 C-two	  ˜ Q+tree
 §
 2"""åò_check_types(a, b, fromfile, to  5dat   * J)V âstarted = Falst �for groupCñSequenceMatcher(None,a,b).get_' Ãed_opcodes(n� sif not b µ     b = Truv      º  ª ± = '\t{}'.fñ(  Ý   E) ifö   � else ''Õ  G   !to I $  G  E pyield '& {} ‘ € P ,z^ …   D  > B Õ }  ¸@ Ê Òfirst, last =™C[0],
 7-1]* Òle1_range = _8 _(N 2[1]Q 2[2] ¦  ]2/ ? 3? 4? å  ÷—{} +{} @@ê  ^ �  ,  k 4Ê ðor tag, i1, i2, j1, j2‘s
N if- º == 'equal' Ü !orœ B Ža[i1:i2]&  * Ç A ' +2 ”     kcontin¶ƒ Àin {'replaceáŽdelete'}k  e ‹‘ -‘ x oinsertx ob[j1:j	+x ?

# 4 I à  Context Diff ] 2[

defü ²Aext(vc, stop¨’'Convert 5t`e "ed"H2matQQ# Per† Jð spec at http://www.unix.org/singleoðx_specification/ð
    beginning = start + 1 ƒ # lines `number( �with one? alength< Bop --  rif not ! :  W p #-=i ò   # empty ranges• 1 at‚ ò just before the% Q #if` V <= 1e õreturn '{}'.format(x ): " ,% ,ƒ +d ð- 1)

# See http://www.unix.org/single_ ô'_specification/
def context_diff(a, b, fromfile='', to ¢  - ) 8dat-  An=3,-¢term='\n')Ar"""O PCompaAñ wo sequences of6 ¢s; generatb¤delta as a¶  ¶ #.
K É   s U  ' �mpact wayU @show, B2 chÖ‘and a fewF   � r.  The h D  ¡ ñ is set by 'n' whichG ódefaults to three¥ 3By  ,5 À Í 3rolS q(those Ð°*** or ---)Ò [ rcreated! pa trailÕ 0new½ ±  isš �helpful s„ ™at inputsE  Â áP.read@ �s() resul0 M@that€ Ñ suitable forH ; Twrite< ¡since bothá t  e0out€ U have· F » s%3For¬  z !do´	8  4 ,� � ‚  iS €argument�%"" ( ˆ À will be uni�$lyS & f° üò¬ + @at n¿Qlly h�`headerMPnamesô ‹ 5modtÀ times.  AnyÚ0allU�these may‘ ¥@ed u¼D  ståsb 'µ yB', 'Ÿ 
   ~ ',~   .H  Ð � ÜÓ Áexpressed inÄ€ISO 8601~ 2matJ II­ Ð¨ å ~TblankÛ‚Example:³ó>>> print(''.join(lŽ±'one\ntwo\nDð \nfour\n'.splitð�s(True),Ý 3...›r'zero\n@ ?ree:   'OriginalE�Current')S bend=""§ —6 z C--- ;  *  P 1,4    ¯Q! two !.    ï   `  < A----  + â  	G "re<  k) Ë_check_typesêçü 4   o _ðprefix = dict(insert='+ ', dele-  replace='! ¢equal='  'F Ûð ed = False
    ñfor group in SequenceMatcher(None,a,b).get_' óed_opcodes(n):
  æif not started    u = True3   ð
fromdate = '\t{}'.format( @file X) if  ‰ else ''K  to, I )toG  E Ðyield '*** {} ‘ ,Š  k ¹, lineterm)‰ D <---D } ", « @ A Òfirst, last =™C[0],
 5-1]* g * 5' +— 
,  `1_rangj_d ‘_context(z 2[1]} 6[2]Ö k @ {} q ª3ile\ Ò  if any(tagbð{'replace', 'delete'} …etag, _  - qe21or + bi1, i20 - 
y 0  if/ Î != 'insert'$  (  ƒ  Ð K �a[i1:i2]*  . ³prefix[tag]w
s2c? = s	3s4sE[ ----s\ ss#ž`j1, j2( %sâ$  Esob[j1:js#ódef _check_types(a, b, *args>0# C  Aing # ð is weird, but the alternative ñgarbled output whenOó"# someone passes mixed bytes and str to {unified,`ã}_diff(). E.g.K Qwitho€ 1is Â ,W  ¨  ´0namV s_ presults{— 2likQ0#  &` b'old; B.txt!  œ+++ b'new àbecause of how½ ‚°) incorporaÛ á robjectsÀ  Úó  úÁisinstance(a²3str} ìðraise TypeError('ls)ð compare must beƒ ,L¡%s (%r)' %. F  (Íp @).__.@__, € )¾Oif b£ b£ \ p £  £  !ar ±+SY0rg, X \Ýall argumentsYà: %r' % (arg,)õ )

def diff_bytes(dfunc, a, b, fromfile=b'', to *
  ) 9dat-  ñn=3, lineterm=b'\n'):G Ar"""	 ñCompare `a` and `b`, two sequences ofD ñs represented as ¼ q ratherL ñthan str. This is a wrapper for `è €`, which  Åtypically eiG €unified_!Ó() or context �. Inputs ¸  losslessly& 0ver� !to� ô strings so that€ ð	 only has to worry about»  0 ,	qencodedI @back- ò –on returnè �necessary& cS ¹as withE punknownÐ Ñinconsistent i  ing. All o" iá ñ(except `n`) must beL ‰ { Ü w ÙceÄ #(sõ ?2try    Ë B s.d- ñ'ascii', 'surrogateescape')`  4 — àAttributeError:err^ ômsg = ('all argumentsË Bõ, not %s (%r)' %f  j  ö(type(s).__name__, s)�  & ’raise TypŽ Q(msg)L2 erŸÒa = list(map(î 3, aG b b j2 = 8 ( „ ¥   *  –"  ( 4 
&  $ ËH  !)
7  s  Q(PLb m   n/r  · U 2 inßQyield .Ã/e(;	ónÓ—  V ñ junk=None, char óIS_CHARACTER_JUNK½²	  (Øªô#);¤ò	 a `Differ`-style delta.0ðOptional keyword param/4s `¢ ¢ `x Cfiltû p K  s,àpcan be Ú :i -) á D: A .  »±t should acìƒa singleŽ6 •ä Ú µtrue iff th. 0is e P.  Thë Pfaultj Œ Ù%isG ¡commended;D Ãunderlying SþÑMatcher class4¢an adaptiv‹ ¿0ion'q"noise"ì sc-Ûú ó  ' ]racter (Â O Cleng=B  1)¿ °)s þ ? 
 ó  *Æmodule-levelŠw¦åSs outE ¡whitespaceÛ ·  s (a blank @tab;ðe: it's a bad idea to
  ðinclude newline in this!).

! ñTools/scripts/ndiff.py is a command-9 Áfront-end toC “ functionJ ‚Example:X @>>> M 1 = U ð('one\ntwo\nthree\n'.split^ ñs(keepends=True),œ 0...£  0'orD > ?emuC 
)C  ‡ àprint(''.join(• ’), end=""% Q- one/ A?  ^	 K+ or Q- two !- Â  A?  -	 R+ tre3 Q+ emu 1""" àreturn Differ(ò  junk, char
 ð).compare(a, b)

def _m¬ P(from2 Ss, to	 àcontext=None,   F  q 4` ñ=IS_CHARACTER_JUNK):( Qr"""R� ðs generator yielding marked up † ²/to side by    serences’Arguments_  6  ž Ðs -- list of º ´ sKù Wà š ì 9  be¡ 5< k > ! > `numbery  ’ òto display on eachÕ !of¹Ø ‰N  2if u5allÒ twill beM1ed.�  s  £ ‘ `passedu "toS (see 1docBa[ Æ= { EThis¬ Šss an itïVwhich 1 tuÈ ï ~­  „	 Òboolean flag)û Š + ô 6  ¹ öB num°ß  h , 0num* Pinteg²rkÑ (to indicate–üg separ&G Ž³-- original° õ ext with followß²rs insertedµ I   P'\0+'‘  as starÀQaddedÀ ` +   O'\0-/ _delet1 ^1 _chang1 10  ‹1of Ž /e /< Ÿ ¡ Í  ¾O$s N , ƒ# F  á €either "à’" or "to"] F 1ain5¾ 0, o- £wise False 	�/‚%as¯ ly developoJž{• Gfile¬€ for makÚ¢HTML pages\@Html~a class* e°J TusageZNote,ãÄ utilizes th©ÿ Å;e #Y  'Qpup.  Opà#alöa8@ may@%lL q a…1heyÍ XuÐpassed to ndi±ff.
    """ ¡import re
 ð## regular expression for finding intraline change  1ces>  ô_re = re.compile(r'(\++|\-+|\^+)')l ðcreate the difference iterator to gen $ o  4 _Œ %s_4 0= n Q(from 2,to   �junk,char	 ‡ ‘def _makeK ('  s,ô ñmat_key, side, num" ‘s=[0,0]):ó L€Returns > ô of text with user's.¢markup and+ ²formatting. P  E �s -- listN   Ó ,â (’produce aW %of�  Q  “  D ‚.  When 4  Õ � d  l ' Ato rÒ ,q L  - sÛ àd are removed ^ @ thi"sti | æ  M Ö 3'+'^ b first³ "inï 5d"add" -^round…  Z   ¿ aentireK x   /'-x odelete{ ??{ Badd/~ /Gñ …#(†t obtain‹Csecoj)O 0NonÀ ¾Ž#no‹D   Ëw  o)$Ì0(0=V,1=to� I B    £/to curren number.  TL`is NOTe PendedEbe a� á 	 ápassed parametE `It is Î a °as a keywor½0gum /toO @mainRq memory!/he® âs between call¡ ‘ 	   Ó ‡functionõ@Noten4is  · ñurposefully not defá!atræmodule scope sÆ òthat data it needsž0its ô g (tÁin whose con%it$isw a) does‰  U ŒGof mˆ �f ÷[>e] += 1b ð# Handle case where nobr| 0to ú�dded, jus¸º � õ#�# ‰ ¶ Pallowæd usageÙ& �  if)  ˆ  5ÿ Ý r.+ (å ,P Æs.pop(0)[2:]
ò  ofà	ZC
€ j== '?'  ±,)Qers =w à, lines.pop(0)'
  ô# find intraline changes (stor q type a) ùdices in tuples)O Ùsub_info = [] ´def record_% ä(match_object, =	 )):A  µ  ˜.append([B Ù.group(1)[0], zspan()]«  P yreturn - F 	} ‹_re.sub(È {,markerâ# process each.ð inserting our special @ ù s that won't be~ ù# noticed by an xml/html escaper.. ðfor key,(begin,end)¯”reversed(E` ptext =  1[0:@ ±]+'\0'+key+  @:end "1' Jend:ï , J 2 ð# Handle case of add/delete entire ‡Ñ JelseZ  & ˜s.pop(0)[b  ØA# ifH  b 1 Ðis just a new< ,Œõ a space so there is~ L `somethµ [ñthe user to highlight:seeŠ if¹O
Ä  X — [= ' 'o $ N ` ñ\0' + format_key +‘ f + '\1| 2# R 7P, fir6Allowö "'sXP tVdo it6"# .€(such asä > :^ pnumber)p`n repl€  #`with w  &  ~#'sª" &upyÔP(num_n €s[side],!)
[  Œ §_iterator(ñ"""Yields from/toò s � a ²indication.]  Ü�This func 0 isµk P.  It0‚elf pullRn ! a¡  D �differenc;= ,Ue0!emxy® õthem.  When it canL 3it % €both a "Û "> aa "to"ä 0, o@wiseB Bwill8 6 on’ or¹+  Í nàê "to0  ³  ª€ 9 o  J …,å Àboolean flag(¦  ed\YeË L  ; ¦ v(s) hav‘ *˜ ŒPNote,’
’ÀpurposefullyX± defined atß °module scopK¦@data"3nee' Ñv parentù(+Áin whose conÄ %itM $isw a) does‰  U  b mˆ å5"""E e	q üpblanks_(àing, num_blankós_to_yield = 0, 0
  µwhile True:   û2# Load up next 4 lines so we can look ahead, create strings whichN ðare a concatenation of the first character @each   { P ‰ ùdo some very readable comparisons.; ñ Alen(Ò Z) < 4û  ÿ  €.append(a(diff_ ù_iterator, 'X'))_ Ðs = ''.join([/ q[0] for@1 in *s]5 ðif s.startswith(W ” â# When no moreI Ð, pump out anÿ Òmaining blank$  µ9the§  ä À# correspond3 “add/delet\ À get a match  S ? soN  1allq a pairs> sQed atê Ij level” Ž Anum_b 	¬  ‹9ingy -el;o-?+?')>Àsimple intraš s.ngµ a _makeñ)�,'?',0), 11),E	ž  × zcontinuf · ?-++· 3in –±block, add   å@ing:“àdo NOT want to}‹ €# caughtÕ)on"ñyet, just process¯w  ,M ™] -= 1( M-MONone:+Â('--?+', '-- ? ') I½ and see anÑ or unchangedÕÙ  >m~ã  «1^ t°Õ@ Afrom_1,to / =[ 'B ƒÞ, 0> =  6-1, §’HiA$ìBH?Añ<É ò/ïDOFROMyÎzÀyield _make_Pline( ûs,'-',0), None, True
  kcontin ý
elif s.startswith('+--'):? ò# in add block, delete ÿ coming: we do NOT want to getK  ñcaught up on blank È ñ yet, just process thew    J Anum_? ís_pending += 1( Syield`_make_O <_+',1)6+Ï('+ ', '+-')=Àwill be leav§ aM":   Ê  ò   ¤ Ë Afrom¾ A, to	 / =Ú C 61to_| , J.=  I+1,0P A?Xside ù ,ù ä“/' Ù äunchanged textÔ iÿPboth ø s6 ›x ŽA[:],Å<0),  1),Falsás# Catchk ifopso when¸�  ! Pnext g9/to¶ p# pair,¡Qy areE Yd up.' gwhile(<eO < 0 * Æ­('','\n'),ì > -Ez § PX6ireturn7Nelsew— Žì,ô÷ @ Adef  _ž§_iterator(j@"""Ys×ºAs of³ ù2 a ÇÑ indication.
b  ®�This func 0 isÈk ó.  It itself pulls`  ·  . K 	7 Ás differencež @ thaM Æ  j  t€ K balwaysF1s a  Ö  y 2/toÞ  G1s (å  àç D ï )É @f neyqary it ¸Òcollect singl§  ^ Y H Puntil3  ha‹ mw ê –Ú  3  "to² _@NoteYeðpurposefully not defined at thóe module scope so
  ó6that data it needs from its parent function (within whose context it
L ò is defined) does noU ™ to be ofˆ .† 5""" ùline_iterator = _ %())  ¨   As,to e=[],[]  µwhile True:  ª Ñ# Collecting 9  ™ Ì ñ until we have a‰/to pairD \ U(len(‡ €)==0 or  ’   )~  ‚ >try    L ð C, to	 ðfound_diff = next(´ " A   Áexcept StopIG?iono ireturnÙ  A !ifù €  Ô Æ;NonG *    ´  ’ ‘s.append(= ,¼ )¨ $ifå e Pc a g# OnceË ÃÑ, remove themä  
 # cÈon and yield×æ Ô 8 D�ü Zpop(0ä ¤  æ ¿Ç .  v <?  d o $orJ !)
´ö	# Handle case where user|Ewant© „ âerencing, justë L 0up å`out do 0anyô@g eld 0ith3m» ÷_YŽ°	 µ%ifŒ :is Rÿ  ì “
V ¢ î  å sZ æ p.  We mê sdo someJ astorag‘ Ä %s ùÀknow for sur( atð 0y a Åª "ed \A+= 1j  :a Õ_to_write = 0 F¢QStore
Fs upŸ ufind a å  e,d÷ Åa[  z ð# circular queue becauÇae onlyð ›pkeep ariF whaÑF "we*  ã þ     dindex,ƒPLinesè 0, [å3]*(6 
 ¼r = Falsž Q   (% "is& QD	²
ª  � V/1 = )$ %*	® e (Bg[i] =  þ M&, ¨ c ð += 1
          ð+  # Yield lines that we have collected so far, but first y5 '
  ù# the user's separator.$ ùif index > context:   O Z g None, ' ° ´_to_write =Q 	) Nelseb ; ” 	9  ‰  I = 0 jwhile(C )d 3i =ë %š a I+= 1b   $L›=[i]& 
† , -J R# Now«�P ìRafter Yhange_ [ _-¬ >tryü # è Pfrom_l C, to	 ñfound_diff = nextn‘_pair_iteW)­  J   á# If another cÕ r withinç sˆ, extend O 6if Œ ç  r    ¿ sŠ + +   ”    M Ó $   !?	Õ Áexcept StopIE>ionÔ ‚# Catch . @ion c †ù) and return normallyd  ™   ñ 


_file_templa¡ð4"""
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
a  ð"http://www.w3.org/TR/xV 1G  '-tD �.dtd">

<&  Aead>Â `<meta T �-equiv="C-xnt-Typey D@nt="¾/J ;k rset=%(cha
 S)s" /Z ‚title></ n £style typeH qcss">%( 2s)s& / Q>
</h© b
<bodyW ò%(table)s%(legend)s
</   1 @tml>q!
_E @s =  =!  = .dñ{font-family:Courier; border:medium;}‘  = 4 _�  er {backgr° -color:#e0 0 *td2  6Æ-align:right* (  ðX  c0 . ?add- laaffaa- ?chg- lffff77- ?sub- Paaaa}K!
_Eâ %< € class="fB" id
 ðlib_chg_%(prefix);pbñ cellspacing="0" Dpadd prules="yBps" x 1col 5></ % <  Àroup> <colgr°oup></colgr #
  <    J å%(header_row)s à<tbody>
%(data 3s)s} 3 </   ð</table>"""

_legend =    ñ	 class="diff" summary="L. 7s">x ór> <th colspan="2"> (  y  h> r2 d7  ‰ — border="h XColorg  š  ’<tr><th> (  a g .  
 2 d× ò_add">&nbsp;Added ‡</td></t²  A  K Áchg">ChangedA  “ B ¯sub">DeletB Àh ˆ  /<tV
OLinkUÉ 3  Í `¡>(f)irst c£  > o>(n)ex7  Ot)opf 	/Œ   ø
îñ HtmlDiff(object):^ò"""For producing HTML side by Ðcomparison wiþ Ñ highlights.
K BThisƒò
 can be used to create an^ „`(or a ]   AfileL pcontain‘ Athe 2 `) show a™ ¡ Q, lin¯   R ¯ J @of t}» ainter-' ’and intra ÓÕ 4  Tz  Ð M °be generate> ð either full or ¶ pextual [µerence mode#be follÇ °methods are�’vided fori Bion:`Qmake_
5 --ˆ s.  7  Ingle<¾ A  c
@  1
ƒèO 	P ðSee tools/scripts/ö 1.pyÅ �an exampl@age Š#.B Ÿ Ý_— `_templ**=  - £_styles = 
  	; 
 & 
 òdefault_prefix = 0kðdef __init__(self,tabsize=8,wrapcolumn=None,NBjunk X  Ò  Achar  óIS_CHARACTER_JUNKƒ * 4""" ` insta9 € rializer—  * ’ArgumentsÀ  œ  ÖÀtab stop spaÏ#, ã sˆ8v 4 Æ  7 Ð Ñ number whereUð s are broken anÇd wrapped,
  ôdefaults to None where lines are not: .:   �junk,char	 ð -- keyword arguments passed into ndiff() (u %byL  � RHtmlD  òto generate the side by PHTML I éerences).  SeeL i 1doc‡ •ation for™  õ P valuç  nd descrip, sè 5"""\ óself._tabsize = 
    e�column =8 & @! =j B" Y$=  
# àdef make_file(• `, fromS Ss, to	    Õ 0=''  D  s òcontext=False, nuL a=5, *,~ Õset='utf-8'):B ±"""Returns ˜ ‘ 2 ofª²ð comparison withO ânge highlightsÖ  Ž A8c  Å Ð  `@list` " "9s� ø 	( ,to&  :  
 ' G ¶ ¥ç header string[ 3  R 1 Q e 0setZATrueƒ 8ualÇ# (’‡ˆ~  ù which shows ful< )®º y `number/s 0„.  When  0is £    
 ! @rolsI ‰ñdisplayed before and after¯fchange”  ¿ r á ,„ c  ç° g zto placÛ ) Q"nextØ”k anchorsŠ     eÉ(so click ofPD AjumpwHjustJ Ê _ ˆ - --a r !ofõ ÿpj  = r* ±.¼`_templçu% dict(,  4pstyles=à"._ 
¡clegend!  
! Rtable  0 (b 	    ã   	Š  Ž     5 7†)� >= c £)).encode( `, 'xml QrefreX').de% )7  “@_newÍ _0 g,Ø   #s,½ ' 1/to! es« á‘ expandedçf ¢s removed.†  pInsteadq1tab!Aacte�Cing ™ dË¨ VspaceÉ0neeo  to fill in@2 0extu  stop, thi nc³  w,  1 Xðthe space with tó&ab characters.  This is done so that the difference
  ðalgorithms can identifyQ õnges in a file when tabs are replaced byL ò
spaces and vice versa.  A~ aend of‰ ñHTML generation, 5tabK Ð w will br ñwith a nonbreakable { .? 5""" °def expand_¾ u(line):  P# hidb "alJ s  2 0 =  .ø ©(' ','\0')* #j (OintoP š ™ Qself.¤ <izeX x O S froml "edn Qback s t¡ d(we'llÀ y!m Römarkup after we do0:ing‘  tkreturn=÷\0',' ').rstrip('\n7  Ý  a Rs = [!»A forO  œ+ ]ç /to< ) : « T ," 
\  Hp_split_a (¯°,data_list, —_num,text` """Builds ' 1extÁ Qs by R Pting 9  Òat wrap point  ¨Ù@func5²determine i[VinputL ¶ needs to bõ \ Qped (} )6‚separateƒ ‚.  If so›Ifirs“  Ž   �‡ dÿ m4  p append© ��e outputV E ù #Áè ðis used recursivelyÐ VhandlÔ  s ±second partih"lin 4 rfurtheru? it2#LQblankq or con¦ %ð or, just add it[  € Ø Æ Ý Rif no‚  
y?.#(ã ( G
u ¨ aœ qdoesn'tò?Oping¨ @sizeÒ0en(N z `max = î ._9hcolumnà (< p<= max).( -J q.count(-S*3)) ) 
;s¾ ¹ P lookO ' • ´ IP, kee1 tr-2 ! Ï #+  ?0ins &erUi = 00 n  , U = ''   wh<0n <@i < 1
  ¾ ext[i] == -
   (bi += 1[ À           mû ark = text[i]
  ii += 1 Delif0 ™ == '\1':"  D 9    mo )''1 OelseC n“ A ñ# wrap point is inside¢ õ, break it up into separate linesE   1:	  2 Ei:]
3 O# if{  å ò ers, place end  1 at ‡of firstL  h § and start0 ñbeginning of second¼ Ü because eachI ñwill have its own table tag[ Õup around it.= !if 
Š ™   +ï2  Ó   "a'\0' +B ! +£ 2-rtack onù    o‘×the output liPdata_ �.append((i P_num,	 81))^  	òthis routine again to¢ e QremaiI íÃ Àself._split_Y (y A,'>'l 2k Adef $ _r@per(= v,diffs)6ñ
"""Returns iterator that e 0s (> @s) m9 ¨Hs"""Ó Ðpull from/to • Qflags @ c Ñ 1for   3 1,to  6 @ in r sª  ¿€# check 7 0con%1orst öpass them througo A 2if _ _s NonÈ _yield“ ´  H    � Iinue ( ›,	  ¡ Q),(to !to , =` 	B #Þ  )'  Q > ‘  atà ,Qcolum;KformH  ‘ ‰ v ¶? Á  ¢  $ ,  šst = [],[X 5	r5 	 &neé 	 9 e l 3ne,	3 &# ~÷ qin pair+0ert\RblankÑ & a Ó ñ# necessary when one c�has more82ped@ 	€ Qwhileu  
o
 
„ g  G?rom  !   Íì ) y.pop(0)r  + P  E ~('',' '>  ß¥  C S % „ A ‚ ´ ñ Å!‰bcollecµsŠC& s.jÀ into separa³te lists

  ñBefore storing the mdiff from/to data into a< õ, it is convertedK % Psinglh õne of text with HTML markup.5 6"""�  t    1,to @flag	 a = [], 9 j# pull§ @and 4 s É åstyle iterator@ 1for&  à 1,to  < @ in %s:+  +:try   #8eÚ ó hÿ s8 T Æ sQ  @ ð ð.append(self._format_line(0,”  ,**  £ -))E ,C 1C ä A ÿexcept TypeErrorä $ °ions occur ; ž ps whereæAsepaeMs go¨  Ã  ª ONoneÎ $  F   F areturnØ % HjIdef e wR,side* Û @num,Ô )A"""R_ sð"Û ‚" / "to"ñ D f ] ð -- 0 or 1 indicatq< &or= : Ü  6 / Qes ifœ erence on h 0   0num3   Õ number (usedµ fcolumn; î :  Qto be±Ued upg  ³ ¾   y  „ �= '%d' %¢ 5num>  6 ðid = ' id="%s%s"( ýpprefix[1#],M ¥ ‹¯á# handle blankz £J  ¹0'>'†/''“   à# replace thos ðings that would getúf^wáfsymbolì K= .Q Ö("&","&amp;") > )gt < l º <�# make spœ ðnon-breakable soÀsy don't  Pmpres !or0 wrm¶ › ! =¶� ö' ','&nbsp;').rstrip()„ gÀ'<td class="3ð_header"%s>%s</td>!  nos "=" " 9' \�„   % (idõt ² ÷ _,
›òCreate unique anchor .  es²m P# Gen?e a0  H multiple tZÎ°# can exist ÛBsameApageë"ouVlictsì '“ 1 = ùó	%d_" % HtmlDiff._defaultè ´ &to8 /to6 W Àff._default_Óprefix += 1
  ‚# store  ões so line format method has access: bself._8 ‚ = [from 2,to	 !]
. ðdef _convert_flags(= ,2 qlist,to   	 °context,numŒ 1s):H  ³ �"""Makes )   of "next"´ Rks"""r  * ó+# all anchor names will be generated using the unique "to"t Ï 0 = ¸ õ #[1à n 0pro € change Í $s,k  f Ðmiddle column»  º ¡ fs/link]  0_idX€'']*len(Q  õ )˜ % Ohref' ³um_chg, in_� ¥= 0, FalseM …last = 0 `for i,v � in enum4ˆ • !ifó 
  6not} " & œ 6Tru˜    ¤ i¤    A# atÊ`beginnrCof a�“, drop anq` a few7ev G  0# (‹) P) bef. è!orv previouM  ß· Ôi = max([0,i-ñ]å�   ñðid[i] = ' id="difflibáÄ_%s_%d"' % (³ C  P 3 ü Ak toç  ƒ È #i nƒ
{ Ò   W _Ë[äß 0<a  >="#ä a>n</a>ê p W Nelse‹#
  à 0eck@ casN@here‘re is no - nt,ö avoid exception0if  X Î
ƒ   Ñ ]ß &  0 ; *''8  T	Ü  "if° *xt„   šM `<td></ òtd>&nbsp;No Differences Found )   R ã4 = [ 	¾ �+ 5 = ? /['�  ¯Empty File… ## v� on firstÜe  k˜ 3 “:[0](� r/[0°D0">f¯”f R# red[¦ ( @  j5top0 v  / y ðtop">t</a>' % (t³oprefix)

  ñreturn fromlist,to Aflag	 ¡next_href,
 "id; òdef make_table(self,D 1nesE     ¤desc='',to
 åcontext=False,Š ‘   Ånumlines=5):  A"""R­ qs HTML z ² of side by òcomparison with change highlightsÀ  f –Argumentsd  ± z @ --   ` " !"  Ž  (9nes( ,to&  :  ÷  ' G ÷
file column header string[ 3  R 1 Q e óset to True for  ð
ual differences (defaults- ˆ~  ù which shows ful< %).+ § y `number/s 0t.  Whenˆ @ is £    
ú 6 Vrols I qó displayed before and after theà”  ¿ r á ,„ c  8 g …to placeÝ  I  ) "øØ”k anchorsŠ     … Ù (so click ofH D AjumpwHjustJ ª_6"""­#o` uniqu ‰  Îòes so that multipleµs may exist� A# on9‘same page(0out VflictM ×!._èk (:#÷ 1tabÑ 0spa\§�it gets m´ |Sicultºˆwe inser˜ emarkup©  ;N2 = � ptab_new 1_re¶(. 
© Qreate²s iterator æ0gen  EH Q …/to data”  if% ½3 ( ½ ( “ 0s =Ä 9 Oelse3 6Non| / H  _m
 Ý ,q ,l Rjunk=  
a ¨  Gchar/  	2 ¥&up,rto wrapÕlõexceed desired widthñ #if­ 6 î
  Ù  ã ³ _+ Aper( 	Ž ¡collect up© ˜ å s «as into²ps (alsoþ1matë, )œ  Û ÜY0st,A   ao _8 �  tprocess  @ 3s, I†ing middæ1of &>o/linksŽ pz  anvert_y (J  ÞÜ  Àglist,contexãt,numlines)

  es = [] sfmt = '  õ<tr><td class="diff_next"%s>%s</td>%s' + \F 8 / '6 4 …</tr>\n'7 õfor i in range(len(flaglist)):'  ^ 4if  º[i] is None$  ( 0# m± b yield% á on separator ù skip the bogus oneso K  generated ª  / QfirstD / Žif i > 0”  M •s.append(k€</tbody>    \n   < I\n')f ?elsò  Z  Ì0% (¬q_id[i], @href @from[  	X  t  	E #toC )œ  œÐromdesc or to
 
 header_rown <t >i"%s "</ ]' % (£ N'<th•p><br />; ?>',5 ©olspan="2"A  † 2er"¢ h>w  % ¿ J  <<[ó´ J'Ùátable = self._ ú_template % dictT@dataH Ês=''.join(s)÷ l = 
# rprefix=u  7[1]pqreturn � ð.replace('\0+','<–	’�add">').\ A -A ?subA ^A ?chgA 1@ /Ã ² ðt','&nbsp;')

del re óf restore(delta, which Ar"""ÕGŒ ¬1 of½ötwo sequences that ³!a O ."‘Given a ` ð` produced by `Differ.compare()`Ç `nIÁ()`, extractˆ @Àoriginating 3p file 18 02 (lqmeter `Ì  `), stripp0 6offB3#es§ ’Examples:¶ @>>> † 2 = Ž ñ
'one\ntwo\nthree\n'.split— @(keeecs=TrueÍ3...= 0'orD > ?emuC 
Š‡  þ(“  dprint(DÌòiff, 1)), end=""1 1oneG2two  Æ 
  e K 	2K rK "re	 ðemu
    """
    ctry:
  ñtag = {1: "- ", 2: "+ "}[int(which)]- ö except KeyErrorB ±raise Value ñ('unknown delta choice (must be 1 or 2): %r'Z Š  "%  ¡ from None. àprefixes = (" ³ Atag) £for line i| ¥ !if @[:2] E !  ~ Ryield( ò2:]

def _test())  import doc ‘, difflib} dreturn .! Cmod(# ò)

if __name__ == "__main__"\ i ð
"""Disassembler of Python byte codà óto mnemonics."""

œ 4sys Etype ¥collection Aio

\"opV Þ * Â__all__ as _/ s $

 @= ["F Ã_info", "dis Ì  #tb	 Aco",; |€   "findÀQstart>  Aabel Pshow_e 8 ¢get_instruá  ` I   AByte: :] +Â :del a
_haveh  dFÒ.MethodType,  1Funn  ACode × ‘   classmC „, static  M ø
)

FORMAT_VALUE = opmap[' )']% °_CONVERTERS¦ q (%R, '')X¥(str, 'str 0rep    �ascii, '   ö )
MAKE_FUNCTION� 	 *']' Q_FLAG� ø 'defaults', 'kw @anno !on ¤closure')
nðry_compile(source, 4�ó """Attempts to * ´ the given 4 Pfirst®ñan expression and*   4 n! ‘€ement if  = ô pproach fails.
9 “Utility f ‰ !acpstringsb ò s that otherwisÄ   • 2ectÏqobjectsa  Ì 	¥4c =ì 	‚, 'eval'ÿ¢aSyntax‹Z O B 	3xecB Äc�ódis(x=None, *, file Qdepth ˜µðBes, æ%s,- s,„Ó #d dÀWith no argu— h¡ãlast traceback7 C7N ô currently include generatorr v, async „� « `coroutV  ll—Ÿ` store– (irÎI ñin a special attribute. éqif x isá°adistb(s  á É£B @# Ext^,vh ðif hasattr(x, '__f£unc__'):
  ‘x = x.__f  ñ# Extract compiled code objects from..., ðif hasattr(x, '__* b �  # ...a Z �tion, or4  z w /  +elM !giN a'):  #K “generatorŒ S  5 R +agR ÿ n asynchronous ` C ` +cr` ¢ coroutine/û + H ò
# Perform the disassembly5 e__dictdñ Class or moduleQ  g ð items = sorted(ä8 . 5())+ ñfor name, x1 in ! #N ñf isinstance(x1, _haveï N +   †print("DË £ of %s:" %k Pfile= ˆ  :   :try~     1dis|  7 < �, depth= I ÿexcept TypeError as msg] ´ €Sorry:",) %, j ] 0 ! Å!co$ Å6# CG}_ð°e_recursiveN[ æ  h ’ , (bytes,  áarray)): # Raw  ju  1 sq í d  0strŽ ÜaSourceW sÆ &se�Vraise­÷("don't know how toCe %sEs" %ƒ  '  type(x).__â€__)

defI Ótb(tb=None, *ê  Ï'""¿@e a öeback (default: last Q)."""Š �if tb is Q â Ù tb¢0ys.I _b D  Æ Á‚AttributÆP  # 6bRuntim  K("noš <!")Åž l ðwhile tb.tb_next:Ã = * ®(, qframe.fç,/  Ï iT ó)

# The inspect­ð interrogates this ¤`ionary´ ðbuild its
# listFqCO_* coŒ`ts. Itiñalso used by pretty_flags to
# turn^#co 0fie[ ñnto a human readablek ñ
.
COMPILER_FLAG_NAMES = {ò 1: "OPTIMIZED", Ô2: "NEWLOCALS ¥4: "VARARG 8 tKEYWORD !16? %STQ 3Q “GENERATORQ 6Q bNOFREE  12P ƒCOROUTIN  25N ðITERABLE_COROUTINñ$E",
   512: "ASYNC_GENERATOR",
}

def pretty_flags(  ):7 £ """Return# ñ	 representation of code 4 A."""6 ¡names = [] ófor i in range(32] 1   9 q = 1<<i,   !if 1s & Š     \ ñ.append(COMPILER_FLAG_NAMES.getÃ Q, hex
 5)))\  C ­ 1 ^=^ 	 aif not sw  8 Qbreak0 Felse  	“ u su r?¡", ".join(. )xP_get_A“_object(xò"""Helper to handle methods, compiled or raw‚A ås, and strings‘à# Extract funcºds fromT .Ö ðif hasattr(x, '__- 3__'”  dx = x. 6 \ ˜  Ò  ‘ h /..b  * b …  # ...a¡ A, or` w /  +el¯ !giJa'):  #K “generatorŒ S  5 R +agR ÿ n asynchronous ` C ` +cr` ¢ coroutine/û + H 2# Hasourceÿ0 Ðif isinstanceÄ;str½S_try_© " ò "<disassembly>")ñ# By now, if we don't have ao QPwe ca F 5e xŽ O$coî Æ  Ü x òraise TypeError("v €know how	e #%s… As" %A  R   type(x).__s#__tDHinfomðFormatted detailsÚq 5 BZÃ !_fA â _] Û � , #co¦8lin9 ìh"Name:á 0  %ý a co.coå ¿
7 @File; 7 f ; áArgument countA ; 1arg ; @Posi3“al-only aK )s:µ 0pos J 	/KwB 
/kwA `NumberÑ{locals:8 Å –Stack sizx s   < FL3³< 	l»‘0iR ÐWconst†
ÖC Sants:´ f ià_c in enumerat÷e(co.co_consts):
  ñlines.append("%4d: %r" % i_c)* 2if @ Vnames> 
: N "3  ` ôfor i_n in enumerat‰ I ˆ sˆ nU ˆ 1varB ‹ ’Variable & ” U — 'freevar"cFree vœ /s:— U — 'Ocell— 	OCell— U — ñreturn "\n".join(Fð )

def show_cod(ã, *, file=Noneh ð"""Print details of methods, functions, or G P to *D 1*.
Ë#If ð is not provided, the output pf Ñed on stdout.@ 1"""  (c “_info(co)­  n ¡)

_Instru� � = colle  s.•ˆdtuple("' !",[ @ "op# 0 op` @ arg 0val ðrepr offset starts_Aû is_jump_target"‚ .S õ.__doc__ = "Human read* ² op©Iion"Ä .Ž B NÔ"ici; 	?arg8 €argument¥v ð (if any), otherwise � hargvalW €Resolved&a valueL YknownN psame as( U  `V 'pdescripf {· Í R ªQ Sµj indexB ±within byteø‹sequenceR õW BLine¤ed by thisBS
C] rTrue if’ð msºHhere¬ðFalse"

_OPNAME_WIDTH = 20 5ARG —5

class +(ôDî fa#Ý÷   Defined field‰ O - hø… Áó1 - ¾ê-  §*  "¦ �Ü	F  é?- rÎ 	G Àrepr - humanñ readable description of opera ¤argument
  úoffset - start index4 ö	within bytecode sequenceD ; ‘s_line -   Ñed by this op< ÷(if any), otherwise NonL Áis_jump_targ˜ rTrue if1  F  ! ˜s to hereK BFalsL A"""
¡ ñdef _disassemble(self,¥ ñno_width=3, mark_as_current=J ", ' 14):S  ;€"""Forma2Qstruc_ðdetails for inclus‚6in � ‚y outputž  K *1Œ ±* sets the œ  ‹   $ õ number field (0 omits it)— *È ñ* inserts a '-->'é Ðer arrow as pö!ofr  e K ü — &iný 0 ž F  ˆ å   ¸ es = []  ò# Column: Sourceá ‰ î * )ifµ‹ [ 0if Ø.wŠais not_
-  1  b ùno_fmt = "%%%dd" %b z  0   À ‡.append(B %} ’ 9 Nelseƒ 
O Y' ' *€ D %CŸ Öu•indicator± !ifçÐ
~ z  m ­ / F   '/ œ SJump · ‡e‘ Ÿ
Ý• 
'>>e ” . “ IŸ 3romì"ofnÑ
ñ Arepr6.â‚).rjust( )Oô2nam” 
[  op" !.lU ß_OPNAME_WIDTHV 	ÊOarg û
 Ú 4arg× m_OPARG�  ½ YÛ …  ù‚ . ‘  i 
î ! 
� R'(' +I0arg2 W + ')Øòreturn ' '.join(@ Ð).rstrip()


îGget_˜Ñs(x, *, first¤=rÌP"""It!or¶ l¬ñs in methods, funãAs or6À0Gen= e``series±w Üñ d tuples givingl21 of5Feach¨|  ‹ �supplieds .t EIf *Í Àe* is not Noð0ne, it indicates the line number that should
    be reported fo  Óe first sourc= !inI ñdisassembled code.D ¡Otherwise,& 
9 ñformation (if any) is taken directly fromK  ¯ f r objectm 1"""*  co = _get_‰ _# 2(x) óell_names = co.co_cellvars + @free 1  #Pstart1 –dict(find B(co)[ "if _  Ë ‘not None:I  T  ˜_offset =. -{  a & !no5 ?els? 0" breturnð pinstrucTƒs_bytes(ã Code,c 1var   L  £  L `nsts, 7J,H%,I  á b)

def¿ ´const_info( 0dex¨   Rlist)Kp"""Helpµ€o get opô ñal details about F Ä references
� R5%de!  »ànstant and itsAr if¿O 4antF  ’  èrdefined†5   ö �h >  ƒ)exa "()< Âaargval¡ ú Qindexu "ifÔ _{ c<  ) [{ _G ]H ˜  , ,å ( � �
 Ž  W � 8 d� 2 á as both value65rep“ # Ò 0   ” � : ‹ 0 Cp 1if  u ‰( [
 ‡ l1argÑ =Ž^ 
÷#  * © > É* 
U =£,Î s 03ant “  n 
  " C ã&=0* Iterate ov½8he Ÿ ` in a ¸ ¹‚ string.µ1Gen: €s a sequÐV of IóÃ ádtuples giving·qof eachÎ  opc s.  Addi< y’@ t ( ó's runtime environmeá(e.g. variableƒ   Ê AP) canKÀspecified us™ ²Ž @arguR sí Plabelxs (� pqn=iM  ¬cÐ, op, arg in ó_unpack_opargs(code):
  ö
if linestarts is not None#  *   _+ ' =2 Á.get(offset,7 )Z  7 8if : _  , ) +d _Z S òis_jump_target =   ¥ in labels* �argval =”  •repr = '' oif argû `#  Set$  R ñto the dereferenced value of Õargument whene  á ð#  available, andT � U pstring   esentationX Î .N ñ  _disassemble_bytes needsŠ O  E >theA òraw name index for LOAD_GLOBAL, ªCONST, etcƒ —   =È 	[ Pif op–ŠhasconstM < ,;  ð � = _get_. ±_info(arg,  JantsX(elc  Á b  - a   ] 
Ojabs] û )*2ý Þ Ö q"to " +Õ Ó ?valË 	Ojreln ðP+ 2 +;{ 9Oloca| © 8G0var J
kcomparY. [ß= cmp_op[arg]S;	! 
?fref É OcellÆ ÿ == FORMAT_VALUE§b 0 °_CONVERTERSâ o & 0x3è .`, bool 2 *4)? @Ânval[1]– "  “   $ 0arg! v += ',     $ @with1:mat- �þ== MAKE_FUNCTION{ O r p.join(sT P i, sA©enumerate(K n_FLAGS
¨  ‡ & (1<<i?Ðyield Instruck0(opÅ™[op], op,cS  |è1val  :0 	¹,*, Ïw)

def Òð(co, lasti=-1, *, file=žÂF"""D0 a Þð  object."""
   ð cell_names = co.co_ cvars + @free à
    linestart1 –dict(find Q(co))* ó_disassemble_bytes(a ³ode, lasti,c 1var…   G  u  G Wnsts,Ã ,ž p, file= y)

def � ó recursive(co, *. ÀNone, depth= !):ƒ É /  U Z  š "if3 @ is 6 3 or 2> 0B ' 1not+   " y # == 1- 1~   ƒfor x in/ coû 
= ð if hasattr(x, 'ÉCode'Ã  E  @prin·  ! %"DÀóy of %r:" % (x,)/ ì:   hx5 dñ Ÿ/)T=-1, &œ0, n· ) �  )Bants' , ´ D 
 6 “_offset=0]¡# Omit the�ù number column entirely if we have no* Ainfo Pshow_c  no = bool( qk7if & 0max+ 9 7max8 Á.values()) +w À r  -6if > g>= 100¸ " Z õ_width = len(str(6 ó + Felse–   = 3x 
' # 0# 2maxir ‘code) - 2 µ ! µ ¶  ²  ² 
‡  5 4i  |Pinstr€Q_get_ uuctionsÚ «¡œ,@   ©ÐsËG  HÞ= ¨ † ¡new_sourcehG = (OO andn 	ú .�@ 4is Í= dB > 0Ð • ;if ˜ 
B‘ ow9 ƒs_curren•2 = £ f "==hÔ J $ ©/"noû;, iX ", Q   )Ùš k )r£, **kwargs‘¡"""Compile=& € string, 'n |   ± object."""Ù É _Úb_try_c` (\ ð, '<dis>'), **kwÿargs)

disco = disassemble  ð"# XXX For backwards compatibility

def _unpack_op` €(code):
Q ñextended_arg = 0 òfor i in range(0, len6 3, 2:  > Pop = N 1[i]:   òif op >= HAVE_ARGUMENTo      n : h+1] | ‰ K  +  @ = (; b<< 8) i °== EXTENDEDm S elseÈ ? ?lse| ONoneh 	
 B ðyield (i, op, arg Òef findlabelsf ð"""Detect all offsetsLaa byte.ñ
 which are jump targets.
‘ ôReturn the list ofG ! 1""") } B = [} ·q «  y ý Þ  ifÓ € is not È     eªin hasjrel  " ‡ # =¥ ` + 2 +T !*2¦  #   )elK ?absK =arg> Ç T zcontinuÉ2if “  Ñ "in m ‘s.append(3 )² r� sAìŒinestartðAFind¯}î?  ÑlL  � æcsourceÝòGenerate pairs (T  , 2 "no¡  st ! =¹½  g R, end8  i  l@.co_0 's(Ä /8ineA andq b != lae 
® ! =) {  ’  1…  p  VÐ


class Byte” W a"""The"  0 op@ions.pa piece   '€Instanti,ñthis with a function, method, otherñiled object, string ofŸ  Y b, or a£& R (as º Ted byF 3())°!Itª  I Aver Š s ô [ Ò 0as ½ !ru¨ ! iÉ Aces.‰ Ý¸ñ
_init__(self, x, *, firstÈ=¯¢, current_+ à ; .ƒ 1obj®€ = _get_ _ç "(xY ¾iÚb   e ¦    S ‡ V  \  ñ!noË  ,   0 ² ¤ j   ±` Z B Y + _ - co˜ ” ¥cell_namesÅ   dvars +> 0ree z ;  è ä ; ]dict(%)V4 ƒoriginalwð = x
        self.cùurrent_offset = c ñ


    def __iter__(self):   Pco =  ….codeobj ðreturn _get_instructions_bytes(co.co_5 ",  „varnames  P  n  D rconsts,’ o_cell_G Ë Ï_linestarts,€  3 G=E  )I?repI /ñ"{}({!r})".formatqÁ.__class__._Ñ /__™ ‡ ó original_object‹ @P amethodã  å÷from_traceback(cls, tbîP""" Cc Íp a ByteÃ : µ the given D A """_  ºöwhile tb.tb_nextF  Gtb = 6 Bcls(; tframe.f<	±=# Slastiê  Ù AinfoI
Ì R£i@ted (  u‘ion aboutÔ â >.Ð š _@ � _B j † 1dis … "a G  ‡ qview of}  .� AperaB	… �"if
ÓÊ is not None�8
6 Ž?els7 %-1& ûwith io.StringIO() as outpuöÏ_disassemble =ß ýõ5   Usnstants +´  „   DsÒ   B<  ½  + 9=  > Rfile=k, (=ù)
ÜH à.getvalue()


Qc_test(Ép"""SimpÜ÷ est program to Ý0 a š ¼ò import argparse! 5r =  .ArgumentP% "r(¥ ' c.add_a  @('in` „', type=X ð.FileType('rb'), nargs='?',Ø‚ault='-'X   3 = _   a sw Ö $ .l  Ô
 I€source =Kƒile.read? Æ¢= compile(* ,ë sQ .«‚, "exec"“  4 9 @)

i† " ò__ == "__main__"~ “Ð
# Module doc¦À.
# Released”àthe public domð^ain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
#     Jim Fulton
#  ñ2Edward Loper

# Provided as-is; use at your own risk; no warranty ð<promises; enjoy!

r"""Module doctest -- a framework for running examples in/  st· ‘s.

In si t‹ Â, end each m] €M to be b ð ed with:

def _ @():
ç `import\    — . òmod()

if __name__ == "__main__"E R e

Then¼ 4the� ðas a script will ca@ " eâ sthe
docæ  Á  get executzând verified:

ïP M.pyz ðis won't display anythE”unless anOð fails, in which case ~    3 – 1(s)4 © ³    of+ D 0ure €are prin¥ ðto stdout
(why not qerr? beD    iõlame hack <0.2 wink>),u ðfinal
line of output9  "T9 ® Àed.".

Run i]!thž û-v switch instea1ñ -v

and a detailed redof all+ps triedt â €, along
\` assor�summaries 9Ðend.

You canÞ ceÇ1bos eË@passx@"ver `=True"†ÿ, or prohibit
it5 ðFalse".  In either6 thj  ã°s, sys.argvÑ @not
é@inedP k .N@ere ×0a vÍ  tyJ oS @waysš 4run8L@cludÄ  rgration @unit` èå1supvõQnon-PÌ€ text
fiacontai¢es.  Thª ”lso many ¡ ôoverride parts
of¯ ð's default behaviorL !Seð
 Library Reference Manual¼
/ðs.
"""

__docformatð 'reStructuredText en'' 1all! [cp# 0, Op#a Flags ±'register_o bflag', ÿDONT_ACCEPT_TRUE_FOR_1 ”BLANKLINE õNORMALIZE_WHITESPAC „ELLIPSIS, DSKIP �IGNORE_EXu ¤ION_DETAIL õ COMPARISON_FLAGC ÄREPORT_UDIFF,  C  N  õONLY_FIRST_FAILUR° I :INGt  & S_FASTq ð# 1. Utility Funcjeb# 2. Eu` & DocKe E '  @# 3./ ÆbParser6 '  - 4- KFind-  - 5- CRunn- À'DocTestRunnöer',
    'OutputCheck äDocTestFailure+ ôUnexpectedException •DebugRunnD P# 6. E P Func, sq ttestmod:   5file órun_docstring_examples. �# 7. Unit6 ‚ SupportW ³ ESuitL yDocFile Sset_uB 0_reA Fflagb 18. Î Jgingc ¼script_from™ '‘ Usourc} dC_src¼ ' €',
]

imx ´ __future__ tdifflib 0insq ”linecache $os
 %pd5 r %sy  ”traceback1 
Ï C io ” SyðIO, IncrementalNew| rDecoder3 RcolleÙ< Ànamedtuple

û¦Results =  '(' ò,', 'failed attempted')

# There are 4 basic classes:
#  - ER: a <xõ, want> pair, plus an intra-Q Ç ‚ number.J 9 J Ó D of |‘, parsed *%a M f  F á  info about w» 6the* R came@ ( , ó
  ’ :no)Ž  Finder: ex¹3ts ¦ sE ÷a given object'sj 3and’ Ãts contained* &s'* sr ½U: runn ð cases, and accumulates statisticD `
# So ï ¨0picÔ  i«‹  i plist ofÔ!+- +(   ?--- 	R+
# |C| --1ID-> |C  õ   r«C|
# o l 	Š Ç   |½ n    Ÿ|   ...  ) ) Û  J eOÄ &ñ!stants.

OPTIONFLAGS_BY_NAME = {}
def register_o9  8Ï!):„ð # Create a new  � unless `ìñ` is already known.8 return {  ±.setdefaulti ¿, 1 << len(.  ÿ))

DONT_ACCEPT_TRUE_FOR_1 =¼ '. )')G €BLANKLIN		F - ÿ')
NORMALIZE_WHITESPACD , ¿')
ELLIPSISÁ   ')
SKIP'   Ð')
IGNORE_EXCù EPTION_DETAIL = register_optionflag('IGNORE_EXC/ ð')

COMPARISON_FLAGS = (DONT_AC- ÿ _TRUE_FOR_1 |
   - ŸBLANKLINE, ÿNORMALIZE_WHITESPAC+ �ELLIPSISJ OSKIP í ÿ )

REPORT_UDIFF+$ $')3 C3 $ 3 N3 $ 3 ÿONLY_FIRST_FAILURE¦ 1 0')
; __FAST= !   ð 6INGÿ 'õ" ò †" á " 
Ã / µ ó)

# Special string markers for use in `want`! 5s:
›Å_MARKER = '< 4>'
q  ...'

# 2ÿ
## Table of Contents\ 6ð  1. Utility Funcüðs
#  2. Example & DocTest -- store t Acase, %3." `Parser) ¢extracts eG ds fromY c 47 KFind7 c 9 Pobjecû 6  59 BRunn9 Kruns˜ 16. · Ù  ˜ ôconvenient wrapp  p 0ing™ p7. Unit € Support �8. Debugg; 9+_Usageû9ŸZ3c
def _¨€_future_ù‘s(globs):¹1""" ñReturn the compiler-. ñ associated with# O @ feaW as thatG Àhave been imZqed into5 ógiven namespace ˆ .9 ˆ t 1= 0  »f2  ½_Æ c_.all_} _ sÍ  ‰ 1 = ç Q.get(C q, None)X  ) $ifÀ Æ is getattr(e !, 7 ( 2     $|=< ..\] rK* 
‡ònormalize_module( “, depth=2e �)   sÛ’fied by ` ð`.  In particular:
      - òIf `module` is a  Ó, then return 1.
  -- 5 cstring5 ¤import and@ 3the<  L ÿ  with that name[ CNoneW Œ ³the callingL = =  T Ô Àssumed to beØ 8 5 of–  V ástack frame at) ágiven depth in  |  + x 1"""F Òif inspect.isE( !):!  <Ä    el9 “sinstance3 ^, str8 "__\%__( ãglobals(), loc
 f["*"])` p   P� Bsys.#  s[ A_get(ú C).f_g @['__°S__']]` 'seQ ðaise TypeError("Ex'edY,0or Ž ó")

def _newline_convert(data#Ú$IO¹pprovide¯óhandy decoder for universal R  R Asion³ …ÂIncrementalN{ DF (— ‚, True).Z �  ¯ àload_testfile(  £, package,¬ ó_relative, encodingÕ ,if# HE â = _normalize_£( 2, 3â X  1 ' x V_path5 * < @if (Í Öer := getattr1 2'__ A__',².))J … 6tryÂ     < $ =0.__%2__. ’ )   ò except AttributET Epass8 aif has´ R p, 'get_?'k \    ý  `‚tents = 1 ./ Æ6 	F !Ý™  ; #P‹ �() opens > ñ
s as 'rb', so one must dob«equivalentL È @ è¢s would doš �   ða Š !),š  Äv   ² Á=í  ˆ f¡j xf.read(S ã¢indent(s, 
 #=4¡E1Addxðnumber of space charactersÌ ³`beginnÌðevery non-blank R ºK`s`,’r result,�  jñis regexp matches“ PstartŒ 
] sþ ú ôre.sub('(?m)^(?!$)'ì 0*' ïîëûion_traceback(exc_infoR…a ë acontaiö %a > � message DÌX ð tuple (as returned ñby sys.exc_info()).
    """ ò
# Get a traceback message' ñexcout = StringIO()7  P `type, 
 2val	 Atb =  l ) X ð.print_exception(9 C r, file={ o `returnZ õout.getvalue()

# Override some¨ ô methods.
class _SpoofOut(Ê !):¡ Edef Q Cself  %Xresulþ { * A  ) ò$# If anything at all was written, make sure there'stWilingG ³newline.  T'  no way for: ÷ expected output to indicateG  th„  Õa  W ² is missingß ¼ 3if è sand not ç.endswith("\n" 5 2 0+=  z ¨ 
  `@trun¢ (6·, size=NoneU   `.seek( ö i ®.D ù°Worst-case 4àar-time ellipsê 0atc� .
„ _  _m £(want, got… ±EssentiallyqÀonly subtle l 6L>>> R ò'aa...aa', 'aaa'Å BFals›b ñif ELLIPSIS_MARKERv0in ” `  û M  0 ==« Rñ# Find "the real" s�sÔAws =J {.split(l – ôassert len(ws) >= 2] PDeal øq exact /ðes possibly neededæÀone or both .� �startpos,  po� !0,k  nw£ As[0] ¡if w:   # ; s~ &   if.'  ¤ #(w¿     u Ý ï     Udel wx   Felses  rl¸­ ,-1®  ó ¬  % ª 0end¨ !-=w© t  ˜ ª $"ifC Y >Þ 1# EÒ5endÖñrequired more characters than we have, as inc  ‹ #ü , 	OB 3# FÍPrest,e e X ÐfÞ Ýôleftmost non-overlapp0#Ã �each piec9 If¸c0no 7  �Æ Õ tOcalone,� ’/ bperiodÖ � w ¥sR°w may be '' ‚Cs, i„   aU”onsecutiv�aes, or~  #P# dueú &an¾ atÇ Ï e µ@of `` rat's OKŸ H ðSearch for an emptó"y string succeeds, and doesn't change startpos.
   å = got.find(w,) •, endpos)1 %if U < 0:  Q Åreturn False c ¡+= len(w)
 - ð	True

def _comment_line( )_ ""RX #a " ðed form of the given 1 "Z  
 ! =  .r"p(Á !if V ± P'# '+6 ? Oelse#  '¦ Q ó_exception_details(msg° �# Support¦ ò	 IGNORE_EXCEPTION_DETAIL„�# Get ridÌ peverythÇ_ Þ  ñion name; in particular, drop· #. ñpossibly dotted module path (if any) 9[ pmessage# M  ) ð.  We assume that ƒ€lon is n¯ ‹  ¼ aq  ¥ A, or nM i   û RE.g.,¾( ò   "foo.bar.MyError: la di daÝ## 9"!  !Oro�"abc.def"„  E:\n"8   .„œåQ = 0,  È� JThe » ñ  must appear onsQfirstYÙ ri = msgME"\n"}Hi >=4send = in rIwn up toY  coq¼, 	b @':',¼ ?endi jË 
 ž	b r/'.c K Î !+1B ¦Amsg[ :Kó]

class _OutputRedirectingPdb(pdb.PdbG"""ÛðA specialized versüò python debugger¦rW �s stdout‘ Bto am ,ñ eam when interaƒ Q withz�user.  S>  íQ*not*G \ "ed@ °traced code) ‚executedÃ ßó_init__(self, outè  ‰  €.__out = k  à @_use4
cð# do not play signal games. ã5pdbS f*._‘ +ð =out, nosigint=žV � ð# still use input()¬0get r h Ô quse_raw. B = 1x Aset_=®frame=Noneÿ  — h 1if <   ? ¼ ´  ¡= sys._get •().f_backE – ²¶ �continue¹ ­ `# Call¿ F & € uncondi-ò
ally would break unit tes£ ° p# cover� reEÉing, as Bdb.X Àcalls sys.seó ttrace(None).
  õ	if self.__debugger_used:!  ( ðpdb.Pdb.set_continue(7 !)
( Adef ^ ‘_dispatch †, *args)M ö# Redirect stdout to the given stream� Ssave_) b= sys. u  ™  $ =È 5out  Â# Call Pdb's¢  ¢ v methodm 6try©  ] treturn ý á p kfinallH 
¥ Ó ð

# [XX] Normalize with resp"ðto os.path.pardir?
ið_module_relative_" ( a, test v‘if not inT 2.is) 0 % î ðaise TypeError('Ex† Red a 4 s: %r' % )õ &ifr p.startsÄ M('/'\ DValu] MÄ -Ä ¡ files may® àhave absolute à #s'k#. 9  ò
. On Windows, replace "/"P2"\"æ% =Zujoin(*( a.splitÀ )s AFind§Rbase Áqory for … shasattrbP, '__Þ (__Q# A n÷O�/packageF  � k 7dir« š Œ.U A)[0]4 CelifL À.__name__ == vmain__'ÞÀ# An interacC‚ session' ~ pif len(»±argv)>0 andƒ  ‡[0] != 'T  6 ´ G 5[0]°  0 Felse–   	B  cuöÞ * ?if f  †
f R  ¤²&in$0 
€ 2 0ull {&F fž  6  %if\ƒexists(fP -   g& R   $m(T w/o òò	 (this includes builtins‘ 9 rËo`"Can'tY3olvQ |ƒk "Ò  S  p"%r (it|& n‘ )3 .“TqCombine@ öW j Ü •þ˜)” : 9dir’/
# 2ÿ	
## 2. Example & DocTest_ 8-ˆ""eb ð	" is a <source, want> paÞ rwhere " )  Ÿ â  fragment of  a code,®à"want" is the òFexpected output for
##   "source."  The Example class also includes information aboutB ³where the e= ‘was extrar €from.
##. ñ
- A "doctest" is a collecU $ofC Ës, typicallyK  G ò  a string (such as an object's doc ").× wDocTest× G Ü  × K  Ö 
(60:
 R!"" €A singleŽ  ð Ü �, consist¿ 2of �¤ code and «E ¯C.  `d ‘` definesr`followI Áattributes:
: 3  -[ %: ‹ ðPython statement, always endF ó with a newline.I D ¶ °tructor add¼( ¶ if needed.| Qwant:TÑ |€rom runnr  8u(eitherz  >� stdout, z  Xáeback in case 80cepE ò`| `Ô sH 
Ú � unless i.`empty,N RwhichT  1an  F Utexc_msg° ð  message genera£!byÜNE, if€  .  >Z%to@  	#ex^ ;3h`None`G  it> 5notm B ì iÐS Œ ¹ ñis compared againstÀ °return valu£8 `Á!.fP_¯ €_only()`ð/Ç ¿D yÇç ° ec­D µ ö"no£  q number !in× K i 0taiËY EthisIGÁq begins¨ 8is f i¯±zero-based,} @ resÂ ¨ E  v  ý  — �Findeƒ×2's  a+ ò; RõQI.e.,ô  ­�pace chaÝr†‘at preced§p's firs$ Gompt  o°sž!di€ary mappø# ` flagsú  TrKrFalse, ·pis used( €override,Rault I s÷ Ÿ¦ c.  Any' p  0conÞ"ed,6is « D ¡are left aù%irw ü@(as ½bified Þ= ¸ƒRunner'sƒ ò  Ë$ByM C, no  s s 2set¬"qðdef __init__(self, source, wüant, exc_msg=None, lineno=0, indent=0,
  qoptions3 %):  õ# Normalize inputs. ÷if not source.endswith('\n'B  i # @ +=  A �want andJ   H 
 ! F ð 1 isH  ÷ U  X 
$ [ ÷# Store propertieþ Sself.Ù =Ú  ®  =  
 ‘# =š
 ¤# =­ 3if ¤ ç  ã : E= {}) | + =$ 
 ñ =+
  °def __eq__(F w, otherÍqif type )ˆ   *  ÷òreturn NotImplementedj   j I=s   \›  1  1  V$ =/  - q/  1 …1  1 p2  3 „3  !‹Chash�†X  (‹/%,  é  Å ü  X: ‚ ò))

class DocTest1"""‹€A collec1ð  of doctest exaçñs that should be run in a singleD ónamespace.  Each `k €` defineF òe following attributes:!5  -r  : the list� ˆ .) µglobs: The z ` (aka  Bals)µ  G ? Â ¯  "Ê X  M 1: AU   i]0ify¯  I Ò Á (typically,¨  5 5 ofY  , Àobject whoseQ2strG i…÷ was extracted from)‹ @fileZ æ   \   ß O �  W `, or `c ` ò0he D  ^  ôwunknown| gz   € number &in= †where th† x obeginsz  P Ðis unavailabl;EThisC * ±zero-based,‰ P respe!to‡r nfŒ ì Ý 2docŽà  Pe„  wÜ 
 lQG Ò Ì hCinit Ùc,¸!s,yÐ, filename, lóineno, docstring):
  5""" õ)Create a new DocTest containing the given examples.  TheA 4 ð's globals are initialized with a copy of `( 5s`.B � ôassert not isinstance({ •, str), \< Ò † ð no longer accepts2 T; useÝ pParser \ 6ead	Tself.i % =ï k ! O& =[
# ß ! = s.ö *()" pname =  
 @file 4 =  
! lÖ2 = 	 
 Ðdef __repr__(¦ ëaif len Ý f) == 0 Dù 5'noý 'a ! lK 1K 1J I /se1 $%d2 Os' %¼  ‘ õreturn ('<%s %s from %s:%s (%s)>' %,  Á   À__class__.__n=__,*  H. , � €,­ ())Œ#eqŠz, other‘AtypeŠ A) isë *  ± å @NotI|bmentedj  ¬ Â=u ðN and35 Ï6  7 ã3  /  G tâ U“ i1  b �3  )Chash•Ž`  (“.ÿ é ¼  ˆ  d ùñ# This lets us sort tests byêô� #lt‹  ý6,¿½ !    ß Û Ë A, id)° F   <"(˜ ÎÆ .! "W  )-# 2d
## 3.Ô
Z 21#


\ ¾ª"A # �used to pT jHings>0doc'õG 4ðregular expression\ @findk	H Q in a“#w ð.  It defines thròee groups: `source` is the  ñ code
    # (including lea òindentation and prompts); ` O C  0 !ofh ófirst (PS1) line  € ;\ B T`wantV ÿ expected output£ !).E ñ_EXAMPLE_RE = re.compile(r'''" ð S� consists™ Ra PS1§ ñfollowed by zero or more PS2" sn  L B(?P<Ð >`   :^ °> [ ]*) >>> 0.*) #s ;  \n    ; @  \. @ .*)=  ; Œ < 5\n? j# Wantá Âny non-blankÇ ð that do not start with— 
â  š€> (?:(?!� $À fNot a R € »  5 @>>>)m5 t  vw A b.+$\n?M ñ # But any otherÊ 7  5)*) @''',°MULTILINE | ‘VERBOSE)
) °# A regular}@ressü�for handl§ £`stringMadCtainD ·Pexcep>ó s.  It divides C óinto three pieces:A A   ->ãtraceback headé r (`hdr`Û #-  st3 !(` ) — ð message (`msg`), as generav&by� %  Œ ….format_G d_only(� K ñ may have multiple¤ òWe assume/require‚$th‰X Ÿ ´L ÀR!edU ¶ ›Bca wordº ¢character Ñ &  ÿÍ Yð®_EXCEPTIONB1"""Y  uo# Grab§ð.  Different verEaaPythonH esaid d1 !thY!on\ õ °  4©  … `dhdr> T+E\ \(]  $ ù(?: most\ recent\ call\ last) ’|   inner.   R) \) ¤ X ñ 
 P\s* $	  `# toss7i8³whitespace Û ÔÍ  ,³Q> .*?_ ,ödon't blink: absorb stuff until..B  ^ D €msg> \w+)Û — a,*o"s*å†alphanumB 1"""'%4gDOTALL3 P°able returneða true value iff its argum.is3#c0conI   single com3 ¢ û_IS_BLANK_OR_COMMENTåÀ'^[ ]*(#.*)?ò$').match

    def parse(self, string, name='< A>'):.  2 5""" óDivide the given? ð into examples and åervening text,D   `returnH ðm as a list of alternat7 EP ™ %s.G ðLine numbers forM  3 õ
re 0-based.  The optionalA  argument `ü 0` iˆ   � identify… Cthisæ ,Ù es onlyG Aused€ ×error message© @Æ # =R Õ.expandtabs()R 0# I	ñl lines begin withã psame in£ aÒ , ‰Fp it!Bmin_(  p Velf._ (Š u 6if  F > 0 / ö = '\n'.join([l[2 !:]2l i‹ �ng.split(0 2)])} J µoutput = []ò qcharno,ñ •no = 0, 0 ö# Find all doctestkiEO³  mŒ ø ôEXAMPLE_RE.finditer4  � P# AddQS pre-ÑÀR to `¼ `d 4  s.appendW [Ò �:m.start( ,  „# Updateò (ë0for_$isã ¢ <  ' Eno +ABcoune", t %, u 
< ñ# Extract info fromê qregexp $
Ú ƒ(source,<õs, want, exc_msg) = \¦ Ÿ   \!._h_F"(meæ� 0Cre$anÅo`add it~ u '
¤ rif not q óIS_BLANK_OR_COMMENTÄ Ð¥ 
¸v 0 ë ¾>  ž= 3 ¡=Iâ+len(m.group(' ?'))N ä#s= ,) ev2insÕv"n y )u Ÿ
¾ Q = m.; N‰‘any remaiGOpost”
Ø¹�]œ ƒ. Ÿ Cget_f"TglobsÄ@file,ÎHðr¼‚Köpcollect¨ Ïòto a `DocTest` object.½  ‘`¤ à`, `name`, `fiólename`, and `lineno` are attributes for
  ðthe new `DocTest` object.  See  Ðdocumentation= - G ñ for more inform+ . 5""" sreturn o ð(self.get_examples(string, É •), globs,? ·   % B, fiø ", ò ", E !)
8 Jdef c 4elf$ i 2='<3 A>'):5  b ¸ ôExtract all doctest ´ Q from,Sgiven~ …ð S òthem as a list of `Eú zðs.  Line numbers¾? ô0-based, because it's most common inŸ ås that nothingC ñinteresting appears on¾ AsameC ¢ @open$ Ætriple-quoteˆ `!so6 hfirst W  †Ñ is called \" 01\"0 "n.– a`The opXaal argh  `Ö`A a‘ identify� 5hisÌ ´iiÇ qly used¦0err–essagesŽ
![x2 x>’Zparse‹u  ¹   óif isinstance(x, É")]á  w_I Ýî2, mt®qGKða regular express„Rmatchuö`_EXAMPLE_RE` (`m`)¥|ò a pair `(source, want)`, where ` q ð^ %edð æ2's ) ñ code (with promptso in§ûepped);G  2`z i Y ó expected output] Q F  òY F0 ¿  " Ang's;	iã_Y  A — Ð starts; both…ZP# Getð&7's Ñ f level• ò = len(m.group(' #')É v„# Divide�Ainto´‚s; checköpthey're¡Uperlyè #† 1ed;¶#th±p­ #ir Ç&@  á© _ÒEs = «  å').split('\n')u T_Ÿ _3c_blank’N ,{ E Iefix? ¢[1:], ' '*6o + '.'M 0 = © ¢.join([sl[; A+4:]!sl, ¥ ]‹ Ö ‰¡1pro†â |Ú #{7†' „ ‰�paces befb £@last· †Ð should
     ó*   # be preserved, so plain rstrip() isn't good enough.
  ðwant = m.group(' )') �_lines =  §.split('\n& pif len(  - ñ) > 1 and re.match(r' *$',E % e[-1]):k  ‘ ;del!  ß ðforget final new� õ & spaces after itI ÷self._check_prefixš õ, ' '*indent, name,9  ‚   k Ano +à bsource½ )$0 = ¢.join([wl[b Ç:] for wl inÙ 5])
u `# If `;ð` contains a traceback message, then ex Ft itÄBm = õ ÃEXCEPTION_REx Z ¬ Jif msxexc_msg7msgÝOelse3 HNoneË Ež Àoptions from¸  ;³ ! ¹ Sfind_ (- ž ƒ2creturnS #, 6 Z#, Ð – ð# This regular ex'¡sion looks�@ ° directives¬1the¢#g   code of aƒ‘ample.  Oç ; Äare commentsA ðtarting with "doctest:".  Warning: t¦ Ômay give fals Bposi–  I Ñông-literals that6hStringz ("#m qElimina‹ Cthesh  b @woul²Dquir€ Ðactually parsÆ Bthe ‡ �; but we Y t �m by igno… C any‰  Ã§  D ™ Ã Ðis *followed*E Âa quote mark6"_OÙàDIRECTIVE_RE =`äcompile(r'#\s*ó ÿ\s*([^\n\'"]*)$'ç
öÃre.MULTILINEuZdef _¢0elfi ¨+1"""  ] R´Pa dic8ary„”overridesç!edCG ( ¬8Ÿ. ~ `è0` i1¾"'sþ¦`¢%no#   u number| Pwhereæ1 ex  sÚ€s; both ú us± „or errorºsÁ ‰ Ì  X%{}e ‚# (note:- lpcurrentÄ0exp�is will Xæ at most once:é .mÊ= .Ò Ip‹Ÿ _ë ¦ #á1).replace(','P)  í  ƒ F  ˆ 
 P & *   Bif ($ p[0] not5 f'+-' o„ ) à        optionÿ[1:] not in OPTIONFLAGS_BY_NAME):
   ÿ"raise ValueError('line %r of the doctest for %s 'F Y ÿ'has an invalid option: %r' %C (‰ ³no+1, name,D -))? oflag =õ [x  ]7   s[? R] = ( ¦[0] == '+'j #if~  Õ ûd self._IS_BLANK_OR_COMMENT(sourceld<� rð'directive on a 6ÿ with no examplexpnÊ dreturn
Oñ# This regular expression findsApindenta  Tó every non-blankG ¶ iÀ qstring. ð_INDENT_RE = re.compile(r'^([ ]*)(?=\S)', ¢MULTILINE)œ ’def _min_� (µ7, sœ""RÓ  ç‚minimum - ® 'an¬ \qin `s`"¡  ø2 ’s = [len( )0  ‘ } .Ï .fall(s)˜6if A js) > 0´‚$mif sžOelse. 0Ñcheck_prompt_ #s,ý   (no0"ö QGivenà ' sÚ"a 4 ÃÂ (including s =81lea %r1), £ ò to make sure that 7H 5 isF ðfollowed by a space character.  If Ä ¥ 1 is 3 G ; ,Ü ,n »˜ ÷" %i,‘enumerateSr 9 ç ’ C) >=ua+4 andC [ª+3] != ' 'Ø D — ¶† œ ¸q'lacks P afteñ; “ ì Eno+i±]    ï :ö I)Çz_prefix³ ³CþN ~  �  gÐ²list startsD Í q 7; iY1doe[	5aV74 š & æ ½ Ð.startswith(p›refix):
  ý(raise ValueError('line %r of the docstring for %s has 'H W ð  'inconsistent leadD ÿwhitespace: %r' %I (‘ àno+i+1, name,  o))


# 2ÿ
## 4. DocTest Finder\ 5d
class] \ ‡1"""þ "A # ñ used to extract~” ðs that are relevant* qa givenF ÷object, from its¹1andM ËsÝ $ —containedC 0s. ® ôtests can currently be� "edi  "—followingE ò types: modules, functions,î   ô methods, static G   Â ±properties."  ?	 ódef __init__(self, verbose=False, parser=MP 1(),> 	¹ñrecurse=True, exclude_empty A  < ÀCreate a newx <! fG%.
f `The op€al argum`� Ò` specifies a#5 or< ?`should�4c‚  € æ  7s (G  NQimple„  Æõsame interface a³u).  The‹ ‘signatureÅthis factoryå ¡ Qmatch{5 G _®  ,0truH 3I„6 ª!`  æ`then `wf` willk €nly examÚ ì 6!,]…not any  s� 	)“ Ž  › 1 in[ *sI›Qwith r J{ò ow ì"._@# =æh  
$ =  H3 = 
   	Û * =Ü € v|2obj¨c=None, Sglobs è \ÐReturn a list¸ Á60defÈ1 bypâË \'@, or,  ô!of0ûå9	Ï²parameter `ó «  ¸c s™  ! « o3.  ó7 0is ›d· 2is Z ñ	K  Nxð will attempt toó automatically determine the
  ócorrect module.  The object's ¥ is used:
7  > ð- As a default namespace, if `globs`; ënot specified.C  To prevent— ô DocTestFinder from extracting sD  ' ´ ós that are imported CtherÐ s…  Afind‚  Ç 1 of Àfile contain€ tB  Uhelp G lidnumberN ¢ ­ within itÇ File.cCx #ed�ss whoseÄ ` does [rmatch `Á`û @gnorl)&If" öis False, no attempt to¼ K Ö will be madeð @ThisÖ€obscure,Þ u— ñ stly in tests: K t %or• ð is None but canÍ Šbe found¼,ŽUn all(arÄ€nsideredÇ `belong
  ¯ã(non-existent)=A, soN Ü%ed” ¥sý Ð(recursively)`searchTaor docë ´ = ùÄals for each¶ 5âformed by combU*‚ Qand `õ J Às` (bindings]	 ”override " E $in‚à).  A new copy®  [  ¥  dictionaryŸ WcreatÃ 0.  I = Û ¦%it† s�me`'s `__z 1__`-u, or {}A o¶0wis™ z iÿ< 0theX’`Wto {}§5"""c #Ó õ/waR u Rct itK @'!if  E Ó:_  )^ ð= getattr(obj, '__ A__',)2 O 
 S ùraise ValueError(":.ˆ:“ @must¼fgiven ù  G   "w?Dobj.› dPn't e@y: %r" %¨ @  P(typeæ F),))Ð # Ö Ê†«ƒ ¹"e ¤ ]@ (ifï& iÉ3# a= mmR=¶  épNote: t£�may fail,6Uwhichº A# ca² óê!be†	Ñ\  Ó»
Ô =7 Z Celif¡  8 7  in¹Rt.get 1.2Rea’  €'s sourc‘d‰ š2 by„ À   # DocTestðFinder._find_lineno to  P the  ó  number for a
  õ# given object's docstring.$ Etry:  8 ð	file = inspect.getsource U(obj). úexcept TypeErrorH 6 ± †s = None: :lse. pif not e 
  “ p# Checkö €see if iÎ °one of our ¬ àial internal "J %s"r  G   0# (C ‚__patcheQ�cache_getK&s) 2    M 
  
 (   Ê @[0]+) ñ [-2:] == '<]>':æ ;  / 1 is/	T	 A eX  �if moduleY  f Œ]  + �# SupplyYm5 ø globals in case =wasbG òoriginally loaded via a PEP 302 _r andA 	 ° qa valid8¿system path: # Òß É   s(Z ,–.__dict__Ö À   L  °# No access“aÍ ², so assume �a normal¨ #Î 8½ …ñ" “° Ó# Initialize ,´` mergePextra s6!if- sok	Ž  aP U = {}‹   ’- ®Ñf.copy(= 9  / 6if Û  É  ˆ® < vupdate(1 w Ñif '__name__'ã"in
�I [+ 0] =9 @main9 ó # provide a defaultÃ ] 
)ò# Recursively explore `obj`,Ó ×cting DocTest·t U = []M Bselfy( ,K,r B ö é,Ü F, {}a# Sort8F ð  by alpha orderÄ Ä !s,¿åconsistency in‹ ñ# verbose-mode output.  This was a featur0dock  ¢fPython¨ñ# <= 2.3 that got lost” pccident6 �2.4.  It[ Šrepaired�  # 462.5þ x gs.sort~qreturn  ¬¢def _from_¹(lUÀ object):
    A"""
	 ö!   Return true if the given object is defined in @ umodule. \ 2if   F UNone:'   r{ ETrue òelif inspect.get@ (� )H Onot L /  ' D k ¤isfunctionl ¬ ` �.__dict__i › Ï.__globals__b ÿmethoddescriptorj ”if hasatt  ú, '__objclass__')š  J“obj_mod =¶.1  ._ 7uleš  5 kk  ä i / ö \ sí  ñö # [XX] no easy way to tell otherwis= o ±.__name__ =ô  â � Ù  !is8l‘ T  ‚; ^ 7d &£isinstance½ «, propertyc  IX S -gbe sur£,el�òraise ValueError("Ö± must be a FD or (1")
rðdef _is_routine(self,ˆ¥ ÐSafely unwrap( ôects and determin‰Uy arep sdTmaybe} —  3:try,- %� ( )G gexcept
U Epass, ‹Y $is\ 1 ;Cfind5Qtests< , ß,?ð, source_lines, js, seeneQFind O F for·po‘any contaÝñ s, �  A0add< m›`O `†0if ø|._verbo_pprint('• 3ing˜ �in %s' %ê L t ð# If we've already÷Pcesse� #isÄ ,š ¶n ignore it™  Bd4)³ &
±¤å  ! "[i1 R] = 1ØŒ  ´ ! a³ J�  µ # it! ;qlist of0 ± ;# =#@get_  ¢ èÚïˆ Ÿ!es“ Ø V �s.append( WÀ      # Lookó for tests in a module's contained objects.
  Òif inspect.is1 õ	(obj) and self._recurse:4  ;  k Àvalname, valr úobj.__dict__.items()6  : 6 å = '%s.%s' % (H  	 ))
k  5 2# R† ÷ to functions & classeÑ  .   Rif ((Á ÷is_routine(val) orô A  ô z  L G Sfrom_# ú )ä  5 Aind(”-   ä ,žÿ , source_lines,  N  ·globs, seen&o# Lookÿ __� 0__ ›oionaryCpgetattrA4, 'w o', {})ñif not isinstanc¦$?str^ôraise ValueError("DocTestFinder.find: ƒ  keys "^eÿ"must be strings: %r" %= E(typÁ M),))7 ï (w�= orJ ¯  Í—Îæ	S,Ñ ®PvyR&,Ã¯, methods,Ÿ²0es,â ñ £$Ÿ
ŸA¨‚ )ô7ðî0  ¬ùíCñ# Special handling¦bstaticú/ˆ  —R  Æ(> ,? Ý  =¦0.__=/__bO °s, propertio bnestedt vÚ5
� !y)±À              òself._from_module( �, val)):
%  ðvalname = '%s.%s' % ( 6  	 )8 m ‘ind(tests/   4 $, { ßsource_lines,J ’ Ñglobs, seen)
- �def _get_e (u z, obj, f 9 m ð 1"""M  j ðReturn a DocTest for the given\ àect, if it def¸ Õ a docstring;J Âotherwise, rU UNone.  v ‘# Extractk †object'sV B.  Ir ö oesn't have one3#; nk P (no Ä #is¿ )…  È ¡sinstance(:7str Ý   =B Â Jelse6:try  ?  if6 À.__doc__ is 	(  , k %''j     r     9 4objn B  , †if not iù > ., ÿ  3  )   =* ( 
òexcept (TypeError, Attribut b _ K  l'ß  `# FindÞá's location in 7fil] P no¥ õ1indd#noå
l  Do_b½ æ ûš ‰is emptyA v¡._exclude_  A andd; 
ï} }¹	w BO  ! =l@@# __. ‘__ can be1 2 A æspace packages€  ™ 7  $ ¥ = getattrQ'U !',P C) oró0.__5 %__•  L 4if O ú [-4:] == ".pyc"9 , ) & =4 E:-1]Q ^˜pparser.$0docµ#,  ’ K e  	� ", gŒfj � �çüý U ¡ number ofÝ}7Not…øthis method assumes thaXH has²ÕŽ  … A ¬¤� " §  %�$ \’nspect.is  }ÿ  e G i 0f XclassŠ!#  ú PcouldÅð fooled if a claó	ss is defined multiple
  õ
# times in a single file." õ	if inspect.isclass(obj):!  J Ðif source_linO js None%  ) areturn 	A ñpat = re.compile(r'^\s*p ©\s*%s\b' %3  O 	 pgetattrŸ ù, '__name__', '-'))< pfor i, ­  û ¨enumerate(Æ ä  l Ðif pat.match(> $   (   ino = iw     ebreak
 ¢# Find the’ pnumber ¥ ÿfunctions & methods›  ý €): obj = 0.__C %__m 	Ð   _ 7  Ocode7 �traceback8 vtb_frama
o   4  f_l ¡   1    A`
ô‚co_first !',h?)-1kQwhere�÷docstring starts.  AssuÒ ±# that it's2 r ¹ ö	begins with a quote mark¸ò# Note: this could be fooled by a¨ Æ  ¢ÿ Ò# signature, ¸  a continuaÌ‹ †  C 
� !if4  no+1not7
¼á ¼ Eno+1t  ¶å þ(^|.*:)\s*\w*("|\')'«N  ªQrangezzno, len²� 	³ß[V ]4   ­ ª% A"We´_n't f¸ èC  
?

# 2ÿ
## 5. DocTest Runner\ 5
o] \ 1"""Ê"A # ´used to run/   t‘ ðcases, and accumulateKctistic½“The `run`Ô xS vprocess�ì  [ Q.  ItŠ \ ' ätuple `(f, t)`0`t`V  TO'of£ D Rtried­ /`f/ 
óvfailed.1>>>T 4s = ÊPer(). (_¦C5Õ 5 r¸6 lê(verbose=False2  ^ñs.sort(key = lambda : .ð5 À     >>> for� test in Cs:
  1...
 `print(% ñ.name, '->', runner.run %))9 à_TestClass ->  ÿResults(failed=0, attempted=29 Ÿ.__init__B '?get= 'osquare@ 11)
ù ñThe `summarize` method =Bs a  Áy of all thep± cases thatG �have been`1 by) kñ, and returns an aggregated `(f, t)`D btuple:—  Â0>>>N  ®† Öize(verbose=1â4 items passed§ 7estA   2· s0èw  k ! Ð* "ge
O 1p . M 7% Å . Ð Rnd 0 ƒ  Ÿò 
 ´	7õ†`numberãÐtried example­dy  !is£ ñalso available viaó`B !s`ó`´ 0ure Ÿttributesà6 X  ?7
 M  0* Áð comparison betw‡PexpeccboutputÌ tactual  qis doneR  by›!`O. ÷Checker`.  This ` ñ	may be customized with aE Iñoption flags; see’documenta @or ` �mod` forD ±more inform' Q.  If> T  çÐinsufficient,# n F ² ®
· !by?1ingæ!bcù!of? 0 toZ Ö constructor.~ Ã ©£'s displaye0 ca” : ptrolled‚‚two waysºPFirst&4 Afunc"d(`out)D "to£  RÍ@`; t«< Awillªav ¦gstring·`should' ·  edp`t defaû ú ð`sys.stdout.writeI)PcaptuU  Y� is not �Ê #¤XRby su— ¥6Docò  .d= poverrid"  œ¿ös `report_start`, �uccess`,= & 3une/Q_exce¼`d 9 `³1"""A # ‚divider `  uŠ±to separateGÂure messages^ Ì#( !seûsŽ$he€w ÐDIVIDER = "*"ó$ * 70

    def __init__(self, checker=None, verbose ñ optionflags=0):C  G 5""" ò
Create a new test runner.r  / OG óal keyword arg `y ò` is the `OutputC� e` thatf ñ
should be used to compare; ¡expected oC Ås and actualB  aof doc© �examples« 'ö' prints lots of stuff if true,k Ànly failures �false; by�¡ault, it's7 � iff '-v'%inE �sys.argv� §argument `¢Z` can"�ntrol how&Z ü ¥F+s C bAT,T5howG µit displaysí R.  Se”1doc¤ aC` for `y @mod` G ±more inform+ . f ¬#._3$ =¶I or 7%()? $ifÎ Z ßÁ –Õ# =~$n sC v ) 
 
  ƒ7 =  ' ‡riginal_" 0 1 À# Keep trackh ­` we'vee*¨ •tries = 0G  ˆ Ö_name2ft = {}®%# ÓCfake p target»¥ capturingJ]‘ _?  ou` ²_SpoofOut()i /#/ -æ €# ReportŒ rmethods ^ -/§  0rb c_start4Aout,ì#, —ž Ë ƒ4  »0ner• ab’to procesFgive` P.  (OWs�a messagea™V=TrueA1if _+ 
$ifÉ Z.want  -ôout('Trying:\n' + _indent(¡ ‘source) +� 4  !'E£?  w )»  < OelseŠ I³ nothing\n'–ï uc’ñ_, gotöÒab ran s^ TfullyÛ8ã1Àbose:
        Ðout("ok\n")

 ñ#def report_failure(self, out, test, example, got):7  ; 5""" RC ô  that the given9  Z 5ed.. :  ’  r .€ ‰_header(| 5) +>  | 2 øchecker.output_difference(³ !, . Îoptionflags)ý ñ unexpected_exce, 
�exc_info"¦raised an v  v '9$'EÌ  u ö :\n' + _indent(ì µ_traceback(Ü 'ž S pout = [% •.DIVIDER]À!ifX–.filenameR Ú ôlineno is not None andS. 
G  K $ =o  +C 5+ 1›  6 ;els“   > Y= '?'/ ðout.append('File "%s", 0 Ù %s, in %s' %5  R  è9 "no[.%)); › ~ ILines  ./+1W E UFaileg&:'} …source =@ � F _" Á óreturn '\n'.join(outŒ/#/ -Š ò# DocTest Running \ -/.S__run¤qcompile[9
ë1Run�s`C ‘`.  Write ô outcome of eachpÉ  5Pwith !of0 `ò  ñ 3er.Îð*` methods, using, D  n `r funcP `out† `Ì `~ Î0setŽ  rF ò õ°should be uÜ¤to execute¿ Rs.  Rÿua tupleG õ`(f, t)`, where `tz `number} 5atried,5`f`E  isá  1  •ƒF  Th“ † are runE ¡ w@spac‹ ¯est.globs`™p# Keep ?k¨  0…  w Aures¯  º sF  !=  B = 0g æS# SavŽ nr(since Îô  directives canÐ À # to modify“ them).
  ÷original_optionflags = self. 
1 ö$SUCCESS, FAILURE, BOOM = range(3) # `outcome` state= Tcheck_ _ 1er. v_output, ö# Process each exampleº 4for Dnum, ó in enumerate(test.; 6s):^  ÿ ó# If REPORT_ONLY_FIRST_Ù € is set,2¥n suppressA ð reporting after, × first failur°  1 œquiet = (`/ &‰ 9andw  J  d ls > 0)Ü PMerge4the2's ÕsH J � /= 	† $ifV ))s:   X  ¤(r  Z`, val)” “: Ž.items()B  F  if8     ¾ #|=ç  u •  3 OelseQ F&= ~Ç j›If 'SKIP'3…kip this(	‹ -iff0 & H ™ wcontinuJ Å ð# Record that wen0rte u ¬tries += 1Œ Anot Ÿ~ `ê�_start(ou5estwðUse a special filename Ðcompile(), so¸ `can reœ )ve˜ #Qð source code durnðinteractive debugg <(se@ ð__patched_linecache_get s O¤ p= '<doc<Â %s[%d]>' % M Æ ö =numù 1Run¶ ã î ‚`given Éñext (globs), and rÆù �any exce—âñ
gets raised.  (But don't  + D ‚keyboard! yrupts.)$ >tryð1# DW �blink!  TÄ�is whereÜ buser's’– *unR QTexec(í.Í,¹, "single",š  A 	 I  Ó s, True), ¤.L> ·per.set_~ G(¥b==== EV  Finished  J ˆZ= Nond # KlIš kX»	] < *  0ion,Êys.exc_info(¾  æ À Example Fin×ished ====

  ù$got = self._fakeout.getvalue()  # the actual output@ 
: ¹truncate(0)& ðoutcome = FAILURE Z úguilty until proved innocent or insane° A# If“ ù!example executed without raising any exceptions,� Ã# verify itsÖ .! &if< ™ is None:"  D“if check(� ².want, got,So} nflags)?  C |SUCCESSï  Thä ì  Û Ved an� ": ƒ ú if it was expectedÒ ?elsÂ  õexc_msg = traceback.format_<u_only(* Ÿ[:2])[-1]Ÿnot quietï  o7+= ] x (a ) '÷`g¶ `š,Ãn we weren't=ing¤ #?
$ j úo.g f Ò ÁOBOOMº WÁ“	| à:  see whether¾~matches• -elk� , Ãr5 Q# Ano• `chance]€they did^pcare abn odetail¶ !ÿ & IGNORE_EXCEPTION_DETAIL`ù g_strip:w s})ë Ð 	 H @ Ñ Ù t Ý`Report¾ † #
F$if  …E (?if xµ rn ð_success(out, testDò»
ºzÈ $isÀ„ -failure„  K1 is += 1Õ¢  ‡Ÿ -$unEp¬ 	‰  §  é0 ç 	Àòassert False, ("unknown6Àme", outcomeG)

  ùif failures and self.optionflags & FAIL_FAST::  E VbreakQ â# Restore the F  G q(in cas õy were modified)W } ²= original_N M 
q Acord» areturn{ ‹number oÝ jtries.o @__reC å_outcome(test,!, 5 ¤ f ÄTestResults(A, b Mdef ]  â #, c F, t)T1"""8  XR“ Ë €fact tha °e given Doc€ 0 (`J õ`) generated `f`F ˜ @ out1`t`Î ˆd exampl~ ‚f2, t2 =Á_name2ft.get. v, (0,0) Ú ., [˜ ( q] = (f+S ;+t20 ¢ E+= f¸ K wR += tïð__LINECACHE_FILENAME_RE = re.compile(r'<doc} % 'O  Q 
`r'(?P<Ö O>.+)9  \[; OÒnum>\d+)\]>$'ê ðpatched_linecache_get  s(ì `, file€ ,÷ule_globals=None$m• .mj (O „  ü Aif m%�m.group('o C') =æ 4±‘ 8 Ú w &  es[int(P  ynum'))]}3" Ã.source.spliÖkeepends=Trueµ Jelse� J  5_.saveRý Lù ’3runy Ñ #, ?]s,3
 Qclear‘  “ 5"Ru{æ Rs in Ÿ,yqdisplayÔr9` using /°writer funcƒr `out`. �5The½€ are runj  p ÒRspacex .Dfs`.  I[`Î °` is true (? �default),‘  Ì 6is S Ewill¦ 1be H Ped af°  @  K � õs, to help with garbage= QcolleÞ › ð  you would like<  C!in+‚ j F r  ¼@letew ˆhen use æ h=FalseD`3 1ileï`Ssô 1 se' s!sh™  beW Id by€ dPython>0r w€ CrunnÖªé 5not? Aspecýn0it b …  â ’ ¶uture-imporD ¨ Papply5 `õ
2Àoutput of eaóch example is checked using
  ñ `DocTestRunner.% õ_output`, and the results are formatted byG  % K õreport_*` methods.. 5""" Àself.test =  
 ð if compileflagsÄ UNone:!  Ã 	" ñ= _extract_future_: (X v.globs)_  save_stdou{ Bsys. _ 0if  >is w ·encoding = H . D  £ 4if  Ä 5 or ú.lower() == 'utf-8'ã  D  ‰ 
k Ywriteh ;els : ð# Use backslashreplace error handlÇ >on Q  ? !de>(s)•    sBtr(sü $e(ë <, 'u 5'),ö )»  J   L� &(s) £ t  7†_fakeoutÕð# Patch pdb.set_@e toÂWtore E 0durû @inte3&ivO€# debugg  ð(so it's not still redirec1to Â‹ )æ±# Note thatEi  YPput wN  go¡ U*our*#W‘, even ifL Š  rGrealÒ g; thisD �allows usa Pc` casesÉ˜ (†behaviorÄ ‘E=j 1get (˜Im=}� 'Wqer = _OfRLqingPdb(q ‰b  í; g.reset€ 
ì=�. Þ %Ðlinecache.get ð s, so we can se¼eCˆ's sourc%òwhen we're insid1 { 
û Ú  f s _s 5 =  ˆ :  ü _pê5ed_$ T ë sMake suûñdisplayhook just printsAvalu,„ ¹ 9 
 + 7ys.  ¬ Wys.__ &__ž :tryVPretur{�lf.__run»,,=kfinallH æ	6©  m8	È	+ P ú†  P ˆÇ   »2  § 6   c ' ;  �  	’  Qlear_×FÀ        testû.globs.clear()
  ý import builtins   ¡._ = None
# /#/ -G â Summarization Z -/G Sdef s] ðe(self, verbose=È !):'  5""" sPrint a; õy of all the test cases that have been run byD ö-this DocTestRunner, and return a tuple `(f, t)`, where `f` i‚s °otal number‹ ò failed examplesW  `t8 £  0 ˆ 8 7tri7 .Ä û `The op|Cal ` ò` argument controls how det€ 5thee d‘y is.  If‡ H  it ð  not specified,  n A 	)#'s¥= Uused.+ ©#if* Ae isšÑ Ú „ @e = ü#._ L  noÐes = [] jpassed t	( thAt = 	 Uf = 0D ƒfor x inx çname2ft.items(v ¥   ", E = xE    Œ ™rt f <= t v ?t + f f0 šif t == 0# e €.append(‘ 
%oelif f> 0=  ?  Ô D .se{ Y= x3 Û
5  ifMJests  È p¸S(len(Ò A), "tq had no¿6s:"g  7   1 _.sort"  ÐPthingÔ, €  I „ P"   "è:ingm 2if 1? ;  ¿ " ¾  …û Â  $ Á p, countÈ 2 ˆ Ç 2%3d5 1 q%s" % (A Ý Þ  #
R Ö €vDIVIDER3 j  ö ö  ´  =ure´  /edî «T2in / 
™ }  " ç !of 3in è  šç G
O è –2, "YPin", Ü  _Z52ftã .ÈD # -Y2, "ª @ U xBf, "Õ D  ä ð :
            pó!rint("***Test Failed***", totalf, "failures.")
  Õelif verbose:   pR O hpassed8 preturn  „Results(h  1t)
N /#/ -G ò* Backward compatibility cruft to maintain doctest.master.? … -/G Àdef merge(seRfother)7@d =  ‘._name2ft6  M@for  Á, (f, t) in > + w.items(N  8 !if7  / dh     �# Don't «õ here by default, since doing‰  7   # þ so breaks some of the buildbots6 j gA Docþaunner.b: '" +² @+ "'· ~both" \K  �  " «úers; summing outcom¥ +   °f2, t2 = d[M]U ­f = f + f2 št = t + t J  8 ò	, t

class OutputCheckerx1"""T "A # @usedxc% 70whe `actualÍ ¤put from ašG ñ example matches5 ƒexpected7 I.  `‰ `Û in. !woF ¡methods: `‡ !_o¸ ‚`, which+ðres a given pairæ( !s,E Band Ï�s true iyœ  ;   `2 ´_differencee C ? Pa strÆpdescrib  R7 Ós between twoé s¥b fƒ_toAsciiis'  tConvertv óto hex-escaped ASCII c  4 @ ¸  # ±(s.encode('7 ñ
', 'backslashreplace'), " "Þ « z¯ ÿwant, got, optionflagÄ RJz{ ?$n 4f(`got`ÄD0 (`�  `).  Theseì �ings are» ò always considerÙV öare identical; buÜ`dependëson whatõ  ö Ú æ! r*’ is using}  òseveral non-exactz@ typ¼ðre also possible.  SeeX Á �documentam m`œ`  moÂ Rnform& 7aboÅ ¨³ 
,e R# If O + mspöcharacter such as "\u1234"ì #¸ nG i›3uof six E ös(e.g. [\,u,1,2,3,4])› ð# On the other hóand, `got` could be another sequence of
  ó# characters such as [\u1234], so `want` andX  shY B ðbe folded to hex-escaped ASCII string …compare.< õ	got = self._toAscii(got)!  | "   %)
$ ÷ # Handle the common case first, for efficiency:8  if4 Cy're¥ ÷-identical, always return tru¸ 1if »  = Œ S  U1 HTrue¤ °The values  PñFalse replaced 1 0‚ Ë rz ¯ ? Ï pbooleanî öparisons in Python 2.3cúif not (optionflags & DONT_ACCEPT_TRUE_FOR_1)Ê 0if Ž,ä p) == ("» «\n", "1\n"0 þ    L  þ M 0M ð <BLANKLINE> canã@used8–a specialíÇto signify aE ðblank line, unless	g  7@ is g [B *2# Rõ Ì !inO† with a ¢ s  O �ð = re.sub(r'(?m)^%s\s*?$' % �( •_MARKER), I 
 1'', }   a# If a( b öðcontains only spaces,=qn remov‰	i #& 
È  L Ç À[^\S\n]+$', ‘ 	 � z	   5c
~"isÆàcauses doctest–Pignor&€y differ$P5theÈ  # ø Ñents of whiteû :ps.  Notü xat this›F i¶Pnjunc�ì î�ELLIPSIS¦ ):if ºúNORMALIZE_WHITESPACE·X€' '.joinÂŠ.split()ÛH)   * u&)e ×   sRPto le$e¥P"..."an00mat•cny subK"in‹'x 
Ñif _ellipsis_Z (ö ,Î£MñWe didn't find any L ;-fØ� ”ð•1# SEÒ we do a fanc?ü ¡def _do_a_ _™((¤± ,Àlags):
     ó   # Not unless they asked for a fancy diff.
  õif not optionflags & (REPORT_UDIFF |- 4  - C- N- )):Z Õreturn False
 ÷!# If expected output uses ellipsis, a meaningfulæ 7 isG ðtoo hard ... or maybeý ÷.  In two real-life failures Tim saw,I aC@ wasy óajor help anyway, so this is commen¹ u¤# [todo] _Ä ñ_match() knows which pieces do and don't ( 	Ž °nd could beóc basisò‚kick-ass² "in™ Gcase� ;#if �ELLIPSISx  ö _MARKER in want¼ ##¾npñ  does intraline� áerence marking70canÆ 0useÉGevenw Ä+1-? sÈ Æ ˜k® ¬ 9Trui‘The other  ð types need at leastE0ew … @s to­  û6fulˆ 	 $ñ.count('\n') > 2P<got î3defà_4 ø(self, example, got,®D5"""/RLða string describ (th€€s betweee? p |ta given‹ 3 (`• !`)Ø  X eactualG ®·(`got`).  `h`! 5 Tset oƒ „EusedG  toI`pare `W`p U wþ  % $ =ª . M PÐ<BLANKLINE>s X  be v ,Eò n replace blankñC Wwith E   Ë  Æ|£ l(õ  & DONT_ACCEPT_— × ±õgot = re.sub('(?m)^[ ]*(?=\n)', 8 ¥()W @ ñ# Check if we sh0"us		¡  oq._do_a_/‹(BT |e QSplit  &ª òo=e  +  P _F=0  .s;   (keepends= )v 8 5got7  H6 3# Uë 0lib·@findçiêjK k O
O /  ²! =9¶lib.unified>· D :n=2Þ H Plist(T q)[2:] #Lp´ c ð header
             ÷"   kind = 'unified diff with -expected +actual'
  ùelif optionflags & REPORT_CDIFF:-  8 Z =a Àlib.context_ õ (want_lines, go On=2)H Plist(= ñ)[2:] # strip thec } header> ð  , ð ï Ïfollowed by ú Nú vengine ü ðDiffer(charjunk=Ç  ÿIS_CHARACTER_JUNKþ X �.compareE)C nw ì.seÑÓassert 0, 'Ba:
*‚return 'ö òences (%s):\n' %‚ò+ _indent(''.joinÛ%)
Áñ# If we're not using¾,ô�n simply    ÏA xoutput à /ä  .0 0if —@ and”
 Ô E$�:\n%sGot  Ö (Ð  D %),ß 7got“E " ^  ú Bhing9	b · S ?gotR J µ R  ¥ Q ýý 	M  ñ'

class DocTestFailure(Exce8)¤ D"""A$ ð example has failed in debuggòRmode.TThe eL ‚ instanc: ¢variables:+ q- test:Ž   object beW 4run* ‚ - E� - Cthat— /  kX 	G>1""" ñdef __init__(self,� ,í ô * # .± ! =) E    $ =? 
 Pgot =±¡ | 3str{ g Ç1str• r )´$UnA¯¹õencountered an uL °ž Ãs‚exc_infoóS!fo]ÉK gÎ*P î¦ :Ø%ÐDebugRunner(Dò2ocTestRunner):
    r"""Run doc tests but raise an exception as so ñthere is a failure.
M P   If7 §unexpectedB poccurs,  U  Ea "isw %d.L át contains the  ,
 pexampleL d †originalo :“ q  >>> rö ‚ = Debugô (verbose=False)x 1   / 5ðParser().get_doc !('Y ,æKeyError\n42',J 0...g ’{}, 'foo' |.py', 0’ "ryµN Z Ù P.run(• 4  " Á qOas fP  ÓK = fC .g  ÿ  ê OTrue1 ¯V.want1 k'42\n'3 €exc_info \ : w ó[1] # Already ha1†raceback; T ó (most recent call lastb9 á° We wrap� to give  ^ °ing applicaPY `access. â0 an6á !rm2 	d - ñoutput doesn't matchRn a D·FD ®Ôd Äæ$''®    T „_x = 1   2  _''', ÿ0  o t ÿúß zå9 þobjects provide ¾`U 4pAs wellj!to88T  W	V M -ractual 4Q (goŸ1ž ØîP or eí Ó b üglobals are left intactl 1delÉ.0 ûs['__builtins__']ñ2est(  …{'x': 1}£®È
œ u7 þü  	Á¬—&‹.á ð: <DocTest foo froôm foo.py:0 (2 examples)>

  ú>>> del test.globs['__builtins__'], (  …{'x': 2}W €But the P ðals are cleared if õ re is no error::    ‘  e ð = DocTestParser().get_doc F('''� 2...Ð  = _x = 2  â''', {}, 'foo' ‹.py', 0)€ °runner.run(m )N  � üResults(failed=0, attempted=1K  @ XE {*2"""| @def p Qself,Žó	, compileflags=None, out
 P_b…s=True):a r<RÊ Z U v, Falseê "if²b \  hÔ .† (7 ‡return rÕ òeport_unexpected_exception(“ 4outò £¨, exc_infoÖ eaise UH EG  �  3 ß 	 < …  ²?urex =gots ‡@Fail= n  2 ?

# 2p
## 6. eP Func%s\ 6ñ These should be backwardsjåatible.

# For  ƒility, aÖä instance of a¬pñ
# class, updated byÔ mod.
maste¤ Ó 

ú TSmod(mÝCname â + ƒ, verbos ï “rf	1, o^707traG 
9  VA_on_‰= 3 `clude_Öy ?"""¥  ™ y   / r” = -ex› è6Aás in docstring fPB andŸÁes reachable_ ðfrom module m (or«„ current Bif m½ñt supplied), startingI €with m._¯2__.¡ AAlsoŠ  { Adict7   __,‘it exists· !is_ @not (. . Pmaps :Us to ð ,í  ù ;H $ \ ²5 ¶ ‰ ped evenŽ  Õ b   rprivateJ W ê4 pdirectl3s< gy wered R6#(#¡@s, #F #s)! “See help(ÿó) for an overview( ð Optional keyworðd arg "name" gives the  1 of ðmodule; by default
    use m.__+ A__.
 ó Optional keywor^ Tglobs_ Àa dict to beE 2d at  & 1alsH øwhen executing examples… ,= ‚  P ²__.  A copy¸ iI   À is actually5 ûd for each docstring, so that 'G � ÿ
 start with a clean slate 
Pextraß  +"ryw ‘should be  merged int–  e =  al(Sat ar9#to$e"Q.  ByC ¬0, n& 5traE @ p.  This¯new in 2.4É 
ðverbose" prints lotsoãstuff if true, † Ðonly failures" IfalsMa, it's: � iff "-v"“ ¿in sys.argv” 
ereport“ Áa summary at¿Aend Oœ • Celse¥ P nothc. c.  In ë a mode,I X Z‘etailed, O ðvery brief (in fact, emptyö ÿall tests passed)Ó 
oF�flags" orpogether� áule constants,Ñ 4andœsZ0Ûð	3.  Possible values (seeÝ F   dÛ 2s):Õ îñDONT_ACCEPT_TRUE_FOR_17  •BLANKLINE öNORMALIZE_WHITESPAC …ELLIPSIS. ESKIP �IGNORE_EXz ¥ION_DETAIL  ÌREPORT_UDIFF C N òONLY_FIRST_FAILUREú Ïñraise_on_error"  0s a²!ce¼5 onWõfirst unexpected ex& r.‹dallows Ìópost-mortem debuggedEñAdvanced tomfoolery: oñ mod runs method¬‘a local iBQce of9Pclass ¨q.Testerù!n Ž }’e resultsšÁ(or creates)D § = b 1docU  maU F.  M� 
 F 0canðcalled directly too,Lqyou wanCPdo soÝ  Ã�unusual.E @Pass  =0 …  ”is especi0ful¯ n,& CdelaC`isplayG WEvoke+Ö Cize(;{Pyou'r2 ²ne fiddling§ 1"""¯ :L }@# If½m€A was¡ ¥   €`__main~ …@if m:QNone:V   ð# DWA - m will still be None ióf this wasn't invoked from the command
  ñ# line, in which case* ðfollowing TypeError is about as good an e P õas we should expect ñm = sys.modules.get('__main__')
) À# Check thatK òwere actually given a C .2 Pif noí sn 2.is A(m):   ì VraiseË £("testmod:J õ required; %r" % (m,)’ Ib P nameZ… ,'3n u0t !'s& ˜  3 vis None� I `= m.__ $__ú ð
Find, parse, and run all ® s¦ Åq j ðfinder = DocTestH ùer(exclude_empty= Û 1if A_on_Ê¥ BrunnT QebugR “(verbose= ç, optionflags= )y7elsö Q ¥ S T 1for ÷ . 1(m,z�, globs= q, extra = × P.run(c\eport¶.summarize(+ Qmaste
æ =Å1ner¾ 
" r.merge(W preturn ÌsResults  £.failures,W Á.tries)

defPfile(  [,ßâ_relative=True+=¯  nRckage ¥  0 9' ò' ! rM ø:=0,C v:  ‰o@=Falìó#r=¿P<r()L qncodingJ Å1"""q  *‹ example) B.  RS&(#B#ô2s).OËòal keyword arg "g@ " e ifies how ]  is† ÷ò be interpreted:_ o  - IfQ  0is •  (Üƒdefault)^"` æ –� -Þ³ path.  By I  H !is " i¥ E 2  toÈP callíï ð's directory; but iYeå @ 1"pa7"&Pument› dw Aen i 
l a E ð.  To ensure os-Î¦pendence, W(usŠ ò
/" characters to separateö 0segŸ sQ¢'no†  beÉdabsolu6 `(i.e.,Á 1may_0beg&tith "/"5Ö	ÜIthenÅ 2pecA%anQ3os-=c·  hÂ  ‚  ¤ ¡ 5or Sð(to
        the ð8current working directory).

    Optional keyword arg "name" gives the  @ of  ñtest; by defaultG 1use °file's base4 e  um˜ ó"package" is a Python  0 orU a  N  ‚ $ VwhoseØ ñ should be used aÁ C  • ) ðfor a module relative Á  l ….  If noŒ !isE  specified,› n P call]mL ''se (is‡ G ˆ ‡ 9 … s† tPn erro@ ‡ 'y @2f "H _Í U_Falseˆt "globsî›a dict toB & "al°when executø ˆexamples,ø À {}.  A copy½0thic4 òpctually- dú	each docstring, so that  'ˆ y ÿ	 start with a clean slatø Pextra× ý  "ryw Nv merged int– e+ #ars#to$e ¡ Q.  ByC 5,[� E @ ¬
ðverbose" prints lotsZãstuff if true, q Ðonly failures" f
«Ait's: � iff "-v:¿in sys.argv” 
ereport“ Áa summary atAend 2œ • Celse¥ P nothF.  ö#n ë  ¢emX ‹`detailŠO ðvery brief (in fact, emptyö @all º�s passed o�flags" orpogether� áule constants,Ñ 4ands=ò0.  Possible values (se% ß øÂ 2s):Œ �ñDONT_ACCEPT_TRUE_FOR_1d  •BLANKLINE öNORMALIZE_WHITESPAC …ELLIPSIS. ESKIP �IGNORE_EXz ¥ION_DETAIL  ÌREPORT_UDIFF C N òONLY_FIRST_FAILUREú †‘raise_on_û!"  0s a|!ce£! oƒ’ õfirst unexpected ex& r0. T…dallows ³!beF ÿpost-mortem debuggedÿ
‚parser" “ ieÈ�DocTestP A (or[ ’subclass)1\þ70tra~‘ests fromA ”s„ 
�encoding† Àcifies an enð#coding that should
    be used to convert the file ‘unicode.
- aAdvanc. ð mfoolery:  testmod runs methods of a local inst7 1 ofF �class doc9 €.Tester,v €n merges ñ results into (or creates)D rglobal = b U  maU F.  M� 
 F 0canðcalled directly too, if you want	Pdo soÝ  E�unusual.E @Pass €report=0.  Ú  Ðis especiallyi0fulÞ  n,& QdelayD pdisplayG õa summary.  Invoke+Ö   ²ize(verbose@when³  'r2 nÄbddling§ 1"""k :L ×ñif package and not module_relative:;  0óraise ValueError("P; €may onlyRô ƒfied forM -€  E  "i ’ paths.")š 2# R‚ 0ize8 Œ Qtext,§Ðname = _load_y ¼(   ,Û ,‡ Ô ,H ‹  #en9–or "utf-8œ `If no f � was giveÙ ˆ"us°  ‡ !'s$ ‡!if w is NonYG P= os.P.base É `AssembŸ2he Îs\   s]  A= {}õ 7elsz   b.copy(R�if extra  U  
¶  †.update(- @ 0'__Æ 1__'W!in² sPA [' â] = '__main__'1if wP_on_eu? ñ runner = DebugR =ç, optionflags= ¦ 
Q  oc^S a ¸!ad² ,\iMa4,nbrun itÁ ¾ã = parser.get_µ(ï-,Aü2, 0É » P.run(I 1 =š5.H+  ì
è =å1nerå 
9" .Â(‹ W areturn¬RÕ  £.failures,W @.triâ@
def  ÿ òstring_examples(f,C#, ßb=FalseŸ="NoName"Ý
rcompile è 
""0)+2  € 1 in×í� object'Î© ‘ (`f`), u`²`/ "¶Qs.  O’Ðal argument `(`z�3in ƒ messageå!If€ Ç	A D ðtrue, then generatñe output
    even if there are no failures.
$ ð`compileflags` gives1 � set of  ð that should be used by( E sPython K àr when running% ð examples.  If not specified,! nG ðit will default to Š Èuture-import˜ �apply toD s`globs`Þ ñOptional keyword arg `o Ú `‰ "s  Ps forx O @testÅ 3andZ`.  See!   documentae 7 `0 Amod` AmoreF ainform' . 1""" ð # Find, parse, f €run all J As inj  —‚n moduleB ðfinder = DocTestH ³er(verbose= ñ, recurse=False)u  ™; ORunn; o'= E %0est¢ Œ . ¡(f, name, ˆ= !):x  “| P.run(á ,4�=A O)

# 2°
## 7. Units @ SupB^ 53
_uZ 0_reY ¾ � = 0

def¾" (( b"""SetyO �êÐqThe old à is returned s+Aat awAer c¬brestor®1old‡Pvalueo‚shed to:c  >>> c0doc15   { =÷  .× . @ O.set+ ó (REPORT_NDIFF |: 0...) 2 ðONLY_FIRST_FAILURE) ==E HTrueÒ ‹ ˆ  ; Œ  ¢ • Ž ROnly ' V@ canU9set†´ ?‚ELLIPSIS‘ð  Traceback (mostûPent cNClastlB  ..D0  VŸError: ('ž Ïallowed', 8)SŸ 1old–[O ŠR q?al é¿ 2if |2 & »ÑING_FLAGS) !=\s²Gaise)/("'	"",@ ”0Œ  µ   ƒ =áÚt

classñQCase(,Àest.TestCaseð+):

    def __init__(self, test, optionflags=0, setUp=None! barDown G  K  qchecker h   @unit] ©.TestCase.z )J  ˆ W._dt_… ( =“ + u 3 = 
 #  | ! =à  á " =é  "teô @  A< >%):; n Ì   3  5if  ? € is not cE  + 
( (H )I  ½™  'B ‚ + …  £  ” ×.globs.clear(¡ 0runð   L   0old‹•ys.stdoutUö new = StringIO(3
*3 3 ^ !ifj( ÷ & REPORTING_FLAGSÊ 4 S# The‚ ò don't include any reporting" ,· B  so add thewLault2 	1 Ÿ D|= _?_g … Õ Àrunner = DocpR ä =Q 
›  Ÿ  E=J ó , verbose=Falseè = :try¸’ ù.DIVIDER = "-"*70ä ófailures, tries = 6 Irun(* c šáut=new.write, q_}”  ,   kfinall— sV S&ldC4if � Ê Baise°! AExce!×ƒ.format_ (ž ³getvalue())% ®)  ^W, errn L ý1elf  
!if¿p.lineno²0 °= 'unknown  … number'K Jelseç  ' ¸no = '%s' %j 6 Plname# q.'.join
. ö.split('.')[-1:]œðreturn ('Failed docÕ ` – for %s\n™  º  Ò'  File "%s",Ä a%s, in0 N\n%s4 &% ‘  ©pst.file  C Ano, Ä wØ  q   ¬Qdebugàžqr"""RunÅÅ °case withouÏ•sults and Pcatche4ss!  X Û„rameworkYAs a Š ¢ method on*  y sÀ  u “ Ðsuites to sup’ð post-mortem debuggöing.  The test code
  ñ is run in such a way that errors are not caughtK !is& aH õcaller can catch theC ðnd initiate post-mortem debugg¢ 
L  ­ òDocTestCase provides a2 r method§ hraises? ôUnexpectedExceptionŠ  if˜ ¥re is an u* @ e6 :– R  >>>E#= Ÿ ðParser().get_docc ('( — P KeyEGh\n42',e V  ...‡
 ’{}, 'foo' Š.py', 0)8  ^ c†  %({ *  Jtry:@ x  D .‚(8  "  LOas fT ¹failure = f< ÒK €contains–[,
 Èexample, and½  T’original ¢ ?ion§‰ . í  J i  True¤ à9 ƒ Z.want9 o'42\n';  €exc_infoþ . 
B  Â   ó[1] # Already haŠraceback? T À (most recen¡Žll last)�
A –	Ä Ið output doesn't mÌ•4n aöFÞ  XÇ d‚ r £)*''™  y
 "_x = 1  	 2 _''', b/
^  © cbJT]š ^	¹A tobjects5¡ access toZ –®] 0€As well ­] 4` 	# WV anãƒe actualš] 	,go«1ª6"""=§self.setUp`runnerº �R !(oFaflags=6 G_dt_ ÛÄ vchecker;  ö , verbose=False‡… U.run(o  »Ü, clear_globs5 * ðtearDown()

    dãef id(self):
  preturn  ñ ._dt_test.name
# ¡def __eq__9 w, other@ qif type ‚) is not *  q n âNotImplementedj  	� 2 ==u Ÿ a and \Ÿ  5  5 ºoptionflags<  C ZsetUp=  7 ŠtearDown:  = zchecker<  "ŒChashŽ‡Y  (Œ.ò ,ãË  ¡ ,SZY� ())� Nrepr�  A& =s Vµ.split('.')n ¼ Ð"%s (%s)" % (A â[-1], '.'.join D:-1]� ó__str__ = object. Ÿ ±shortDescri6@"Doc¢ _: " +µ  ÷	

class SkipDocTestCase( U £Cinitƒ, module   RP # = S 9.__I GNone{ÆÑ \ @skip¤ (Ø  	 ¡Suite willžÑwork with -O2Mgabove"]  _H a Opass` 9Pping X �s from %sé± 0.__ö"__` Í FÆ
�_.à P(unit` .ó "):K –`remove qAtIndexÛ 0, i Ÿâ 
4 	_ ¥ =†s, globs Xextra  …  _fX r# Þ ÿ "**›sy 1"""% ’Convert d‘0Cor a*d to a ì !   sà.ì bThis cG `s eachM uja@ strŠ'inS 1hat €contains3  Æ _ ss ñcase.  If any of theC  7 !s ^ 4docn Pfail,$ n W  C   ±s.  An exce¦H àis raised show² @the !n P fileê  ²    ~ ÒE õ(sometimes approximate) line number72e `ãQ` arg1‘ providesµ   !beÂ …ed.  The0 t �can be ei)dÃ Æ x UIf noA  @Qgiven,P callÚ z sis used: AÁ  M@ may| · ðd as keyword argñuments:

    setUp
 0  A ó!-up function.  This is called before running the< ðtests in each file. TheR UQ ó
 will be passed a DocTestF aobjectw ;  can accessw  q ¡ globals a E   æs attribute of1 x .ü ƒtearDown8  A  _-down_after U  f T > ?1!diü¡ary contaiêsinitialrå variables for_sY op>SflagsW \ ‹1doc»$  % b expreÑs an integer.> 2"""°!iföp_finder–QNone:%  Ì X  =ZF- "()C ñmodule = _normalize_m ( )N  J 8s =o .v % ,!s=9q, extra = q aif notI  Ú ad sys.õ .†mize >=2Å s# Skip 'es wheno�with -O2¥  ó AsuitÏ HS (Å   @.adde(Z ) CCaseÎ )/ qreturn V 1
S.sortV   AI r “ 0est	: Ø pif len( ö .examples) == 0$  ²  t4inuX'  B.X7namô 3  2 = Å0.__ !__•  #   !if˜ @ P[-4:]} j".pyc"‚  ,  ?  ) & =4 I:-1]Q Ì *  % ,~1z ; @, **Cons).
€PclassÈAFile7 C )ÁÆdef id(self)È I �'_'.join P._dt_y .Ú ¤.split('.'}  J �__repr__1 P  f G û * ? fU‘t_failureE ^, errJ P('FaiRé"M`%s\n  ó õ "%s", line 0\n\n%s'\ ¦  !% g –  Ý /, ª � D 0)

¾ 0Docw +bpath, Oð	_relative=True, package=~,M 	 ƒ parser=·P .()4 ‚encodingS Ò"ifqóm Q = {}ˆ Belse3   ð globs.copy()

 ó   if package and not module_relative:
  óraise ValueError("P; ó
may only be specified forM %-"E L  "i ¡ paths.")
- 2# R‚ qize the . Adoc, ð = _load_testfile(D   Ó , Ì ,? | 
 ôencoding or "utf-8� `if "__d 1__"(†in globs! [' 1] =§ Ñ AFindË  G prread it×  name = os.Æ P.base Ô ðConvert it to a ú ,L @wrap òin a DocFileCase]  ( � Àrser.get_doc (N»  , p  ?ath, 0).hreturnQ (7 ô, **options)

def" pSuite(*Ã s% 2kw)"�"""A unit?   s' #0oneoSmore ”  !"s.8Tü ð Ieach% ð is given as a string;e½  interpretaª ƒ of that' ° depends on1 ñ keyword argumentB ""– €A numberT  °be provided“ T "s:Õ V k ]  If p  â PTrue,¤ © ñ  $_Ss areB ñ  Ros-inç $enÛ-rC  By? qdefaultl ss^  3  toˆ P call(È $'s@ Ðirectory; but^ º"c"[ Õ )n nB @theyÐ r $at¨Ù.  To ensure à $ceà" Ìð" should use "/" charactersOrseparaté � 0segýsU Ó b s absolu0 p (i.e.,s& B  begin withs )1ÞOFalsß&Fc
 %heº ˜  º ·   &or](Ð0urr"@workØdÉ¿ ÃC „A Python• Á ê t a  ewhose V G � be 0 E  ù+ $g· ^ÙXŸ "Y °"ed]´ < "us9ˆ Ç n`s.  ItG @an e#e&y #if9 í5SsetUp- ÐA set-up funcÏí isp  �`ed befF@runnÅ$th sðs in each file. Thñe setUp function will be passed a DocTest
  ½object.  Th; ñcan access the test globals a E   æs attribute of1 x !.
+ �tearDown @  A  U-down± ‹  is is call³ Àfter runningY >  � ás in each file<  © f T  “  ¤ > ?1Ç AA di«¡ary contaié sinitialrà variables for�sY opíUflagsW 0setŠ0doc* #  $ b expreÃs an integerN eparserI 2P ð (or subclass) that shouldfud”to extrace € as from¹  «¹ „encodingm $n  [ ¿Y vconvertH Á to unicode.E 1""" “suite = _¿ S "()‰ð# We do this here s øat _normalize_moduleŠx BrighÛ ð# level.  If it wJ · ink@Fileo,² np œ§ 4# w= e=  r and we mj 4 guƒòpackage incorrectlyõ Áif kw.get('m¶ ñ_relative', True):n  ôCkw['I  ']!ò (K & )6 z@pathu  sU n@.addí D(Docù () d, **kwG qreturn 3 ?

# 2Ð
## 8. Debugg(Support_ 5À
def script_É³_examples(s[Rr"""E÷) ò”ext with 3 fB   CÎ=s t%  Øƒa PythonP B.  Ev „ input ií 8  ed7 �regular 4 0out5  [åall other wordF :areJ ’comments:6b   >>>­ T= '''T0...Z@   H H í  ƒ si+R math¯X   .. >   ó �has superƒ@uratö¥P addiï~   D   ­ _2 + 2 5  =   öAnd very friendly error message Î  ƒ ?1/0_ `To Inféy! ?And EBeyo À ...
       F...  óYou can use logic if you want:
) 7...    0>>>1 0*    l Oblah@ ! :  b   oHo hum D'''
  ­ ôprint(script_from_examples(text))- ´# Here are " ` of si- U math#4  � ðPython has super accurate integ uddition8 	 T2 + 2 ¥# Expected^E## 5 	  u ö And very friendly error messagesD 8 41/0 k µTo Infinity) #i  eBeyond 	 ” ]?6if I8   7 4 #i 
´<BLANKLINE>� 1""" ±output = [] €for piecœð DocTestParser().p	 5(s); ë±isinstance(9 2, EA'  ” …# Add th?õ's source code (strip trailing NL{ ?  ª r.appendk .@ Z[:-1]- m 3@ »  U  Ô" =ñ .     *ifõ   
‹ '-'‡  . - Ð += ['## '+l eAl in_ Á.split('\n')Ê ‰ ; Jelse± Ø Cnon-„ ¥y 5 é q þ _comment_line(l� 1  ‘ Â’  ò	# Trim junk on both ends Twhile} 3and ¶[-1] == '#'Ë R.pop(” = 0< 
0= ‘# Combine^\  , ƒ ’return it£ >àa courtesy newð to prevent exec P chok‰ò(see bug #1172785v \  ¸b.join(y @) +  ¢

def test¥Ó(module, name¡"""Extractº  - sƒ Qa doc 0doc ‚ng as a °.ÊbProvidþ f ± (or dottedp  © z �) containÞ 1theÝf áto be debuggedC 7  ³ � (withinª H !of aobjectG  %  Cdoc ²   
 ia –‹U â = _normalize_ <x © 4s =�AFind�Mfind)  Ùtßtp< ð if t.name == nañme]
    if not test:   ð	raise ValueError(name, "* �found in3 1s")5  ? ! = "[0Y   ðsrc = script_from_examples( ¢.docstringF SreturY òrc

def debug_src(src, pm=False, globs=None)¹ @"""D- Ð a single docg   g ,¸ õargument `src`'"""Ã ° 2src¥ ‘ Ô Æ ˜ ’ )· & " º ¸ ® /".   s is theE@, asà 5.¹ ±import pdb
É "if Ï+" = b.copy(Ì Nelse' %{}I &pm 6try  W 3exe–a     WexcepV  òprint(sys.exc_info()[1]�  !   0p =Ï û.Pdb(nosigint=True' c.resetÌ  9   àp.interaction( +, p 2p 
ÿ ?pdbr  a.run("ë q%r)" % Î
ò ª’(module, 2¯£.|qProvideûS ± (or dotted] 7 of À) containing 
ORto beGpged and  C P(withË2he f )W aobjectG  % 4 ¯  Zests ` .2 TT â = _normalize_ (Ñ ¨ {
 Source! I' zT ß.__dict__)

# 2‚
## 9. Eµo Usage[ 5Àclass _TestC \:ÁA pointless * ð, for sanity-checkê&ofÝ~3ingBrMethodsW  gsquare.g<±7>>>‹ Q(13). ( + 3-12 5 1  ; Fhex(Ê ? n H Áa'0xa9'6  è 	  äó__init__(self, val0 · ˆ"""val -¡  ž‡passociav² @  @    tƒjB(123‘   –t¬   1123¤   ±    ¨ .– =m ² É õ   
Â  )Ç   � <'s Ã R  j  ¾ Z
¡ 5169 ­ À self.val **C 2
  Áreturn self
 €def get( !):  + 0""" S) -> 4 òTestClass's associated value.M  : •>>> x = _0 U(-42)Z    �print(x.c  &-4© 6"""T ‚  ¤ ö.val

__test__ = {"j '":w ,s  — °"string": r[    ÒExample of a 1 ù	 object, searched as-is.] J  Þ  þ g1; y =y#  
 ' ¯+ y, x * yN G(3, ; :  F""",#  ÿ"bool-int equivalenceò  7  €In 2.2, H ÿ
ean expressions displayed¬ F  
 ÿ0 or 1.  By default, we still acceptI ðthem.  This can beŠ ÿabled by passingK ÿDONT_ACCEPT_TRUE_FOR_1 to the newF ÿoptionflags argument 
  õo4 == 4i 1& U OTrueX >¬ 0T @OFals¬ 
¯lank linesB# Zömarked with <BLANKLINE>Í   zÉæ'foo\n\nbar\n'Ð. ?foo$g   ?bar 8  ellipsi	!If'  Ü� is used, tn '...'&  . tÏ ’elide sub:@s in> ÿ  desired outputMðlist(range(1000))) #docð¿: +ELLIPSISù[0, 1, 2, ..., 999](  ðwhitespace normalizaà5,7 < 	‚  `differ›"K ¿are ignoredRs&3$ðNORMALIZE_WHITESP_ACE
   ð[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 ï1, 12, 13, 14,G ð 15, 16, 17, 18, 19, 20, 2] ÿ2, 23, 24, 25, 26E ¹27, 28, 29]f 9"""2 ñ}


def _test():- ñimport argparse
  5r =  .ArgumentP% ðr(description="docR — runner")C c.add_a< ñ('-v', '--verbose', acD  'store_tru Ùdefault=FalseÃ 	‹ðhelp='print very  W ð output for all � /s'— 	o— oÑ – append'ƒ ôchoices=OPTIONFLAGS_BY_NAME.keys(), Î /[]H Ë Ä('specify a T“ ñ  flag to apply'a		 '* 1theù  –’; may be ` �ied moreH €han onceR | ¢ multiple š ?s')Y	fY—fail-fast\òÑ 0topÉ AningÖ às after first _ Ÿure (thisÖ áis a shorthand'à-o FAIL_FAST,  I `n addiÂ!´ny other -o) 
0filð�nargs='+i	'0 r contaiås 3runå O 2 = Æ.  …"s(«  J sá s. ƒ2# VšP usedU 0be %pled by U0"inG3ñv" magic in DocTestRê€# but siA�we are usÃn  1pas ñit manually now.• -­   „A = 0  ò  ’  . ì & _s |= µ [ H if  s.__¾F 8‚  O@name„ l< 4if " ó .endswith(".py"“ §   Q# It ­ñmodule -- insert its dir into sys.path¸atry toŒ  D   ## å�it. If iV ûpart of a package, that possiblyC ðwon't work because= ; a s± t   0dir,ï B = o« t.split(˜ 4   Ð .í 0(0,ì  K 
( bm = __Ü %__M Z[:-3]* 5del&"[0Þ j    Þð
ures, _ = testmod(m, verbò
ose=verbose, optionflags= Cs)
  Uelse:   ðfailures, _ = testfile( ùname, module_relative=False,D  H  • � 4if Ž 
¤ �return 1u  �0


if __¦ ò__ == "__main__"?  sys.exit(_× ð%())
# Copyright (C) 2001-2007 Python Software FoundaJñ
# Author: Barry WarsawL ñntact: email-sig@pG ñ.org

"""A package for parsing, handl
 âand generatingI ð messages."""

__allá ! [ Â'base64mime'‡„'charset …encoders 6rro @feedŠ $er  � o Fhead  itŸ B   ?  `_from_8 obinary  ostring; 5yteÍ ø 
Ç hquopri  Dutil9 ð#]



# Some convenience routines.  Don't import PT r ¢M‘ó as side-effects
# of/ ¾ siV óthose cascadingly( P most7 ethe re #
#ý1T.
def
["€(s, *arg R*kws)ì1"""± 2 a ( „ into a ¼ `objectÎAel.
JO*‘al _classë  = 0ct  passed to ¬ ^ r:‘structor.E  ¤ ü þÃ .—ñ 9 , rÈ (Æ 5 ~str(s)
ü bû ' }B¼ ô  Ë  d?(fppRead a & Ó�@ its½_tents¢?(fpX…’6Àer(*args, **ðvkws).parse(fp)
""" Routines for manipulating RFC2047 encoded words.

This is currently a package-private API, but will be considered i ðpromotion
to a public API if thereb €demand.
© †

# An eŒ ó looks like this:
#
#  @=?chè Ót[*lang]?cte?Ê ‘_string?=1  �  moq `nforma– s about C 0 seb e ¡module.  H© t¬ qone
# o¾ p preferí EMIME8 ðnames (hopefully; you never know when  ðing).
# cte (Content Transfer E’ #  y  ei0ð 'q' or 'b' (ignoâ Ð case).  In
#WQory o/ òletters could be use›  +Qings,Ç in practic
ãis
# (almost?)Á ±happens.  TÀZ 	ß n0add``entrieK  to� £ CTE tableu QYAGNI˜Qnow. ã áis Quoted Prin. ,õ ” bBase64ƒ P meanh $ofÃù4 shö `obviouµ '''Q opàal
# as indicaq !by¦ ðbrackets (they are not¶tÿrsyntax):"s )#
#) [@unteX.ŽÐThe general i% Afacea dr¨ Ñthat it takes›  Z 3dedç À òts argument, and returns a tuple (cte_X ; �, defects= ThÚ% „ ðe original binar%dat wasv0 us‡tG �specifiedÛ Ôi zQa lisF�MessageD† • instanceŽ P Òany
# problemm V"duþ�onversioni Í'î ½˜ ‘correspon›!Ps extö 1romd1EW,W äoserved¹œ¹ a8psequencmx1put¬ °0the5_J «Pwhich�âan ascii-only Ä � REach ãðr must also suppl¿°length funcü [XÙ4
# £ Y¨ Q QresulT¼  K „Ÿ  õAmain… ’ õ ojÄ ", ô Bcallú Ar
# z G#d ± Dwr‡ G 2addF  appropriat…ARFC “"chrome" ¨> dbR Dcan 9 S0utoK ¢  §aselectAòshortest possible(ring.  Sjbir docÂps below�
# detail‡£import re

 bý !inÐ
import functóools
from string import ascii_letters, digit) Temail( öerrors

__all__ = ['decode_q',
  ?'en . b.  =lenY   ( V T 
 ò]

#
# Quoted Printable
#

# regex based R ð
r.
_q_byte_subber = functIö.partial(re.compile(br'=([a-fA-F0-9]{2})').sub lambda m: Y  s.�ò hex(m.group(1).~ “()))

defŽ 2_q(V1d):l 3 = 
 ñ.replace(b'_', b' ')* zreturn Í N P, []
�dict mappž ” to theirc ð form
class _QByteMap(9 1):
l úsafe = b'-!*+/' +_.¬ !('uC') +p N  ÿ ó__missing__(self, key s if @ in  .� !      À[key] = chr(? ¬   Oelse/  "={:02X}".ù *at< X` 
0Wmap =")`ñIn headers spaces areq edj6'_'r€map[ord(Å ¹ 2'_'AB_q(bÆ
Œ „''.join(ì G  x]·  x#5 L  NI lsum(leI )J U`Base64K ´Ã%_bec²# First tryR jðwith validate=True, fix €the padd ¡if needed.¼ò# This will succeed only if[ ñed includes no inc p characêH `pad_erÛ î ]ad) % 4g {†  Úƒ==='[:4-; ]s   OA b''= 2tryø  i¡(      ob64.b6420; + z ,#)R H [œ".Iæ �P:ŽDefect()¨ &[]F *¡except bin  .EóÄ ô# Since we had correct£0, t“Éis likely anw ¥ w µ # Íçe non-alphabet¨&àignored as far ’D �goes, but  ðdon't know how manyË reO Q.  So† }Bout +M _  ˜0seeã†it worksÁ 	à Ò ä  èÖ[False× ; ÛCÆÞË 6 Ïà    except binçascii.Error:
  ð# Add as much padding ôcould possibly be necessary (extra. P Éis ignored). :try|  ‡ ‰return (*     ðbase64.b64decode(en ÿd + b'==', validate=False),G  [eø As.In/ BV ÿCharactersDefect(=  = P(: ]x )Š ¯except bin‰ ð ô# This only happens when the ü ù
string's length is 1 morer O ñthan a multiple of 4, whic8 i
§: L  óbpo-27397: Just º› ` since´ re's noM  rway to ×€ \ ó /, ÂL „S

def&B_b(b()sQ Q[ & .Š !(' "')M =lenJ õgroups_of_3, leftover = divmod(lenU 2, 3ó	# 4 bytes out for each 3 Ð(or nonzero f•!ioó‚reof) in Ã € Æ * 4 + (4 if‹ ò else 0)


_cte_Ù ars = {‰C'q':y"_q¹&'b b }> 3(ewHA"""D‹i¤d word and(xñ, charset, lang, df¡s) tuple.
Œ úAn RFC 2047/2243V 0hasF 1"m:1  �#=?[ *Z R?cte?Î"d_| "?=- qwhere '' A' maÆ±omitted but] ±other parts# Tnot b  �Pfunct“ðexpects exactly s3"a u ð (that is, it doeúpt checki ð asyntax/ � Sraisea Ä LN i? Awell Aed),8 sO  0 
û Ùðd first from its Content Transfer EJë$ndL n0  V 0res4#ng£€into uni0 us9  ' ”specifiedîT.  IfP R cte-Bd&0sucOSfully¶ Y L  ð¬ QaM ûPaddedK � dQ list-  Òunknown octet8 are replac	yŸÝ '0 'Ó v s\\uFDFFµMThe ù o  �Ruage a  ÚPed.  2 bdefaulþ( k�`rarely	eT Ú€untered,ë  Í SemptyL� 1"""%_sðcte, cte_string, ô_ = ew.split('?')
    charset, _, lang = Ô.partition('*.  te! ’te.lower(D ñ"# Recover the original bytes and do CTE decoding.z Rbstriq 2te_ ó.encode('ascii', 'surrogateescapeˆ < ñ, defects = _cte_b “ers[cte](& ¥ ATurn¢ Œ #ed¥ €into uni} ž Atry:§  %� 3 = R .h (=a ‚except UF VErrorB ¨ �.append(e As.UnI PableB-DÎ 1("E…d word "‡  ‹ “"containsº 2notX E 0 usR${}Ä…".formatª )¬  J Õ |è kLookupç T Ð � $if¶ ]ö != 'unknown-8bit'Q 2 UCÒš 2("U? [ ; {}Q I B"in zt;Sced as � pQ0ret^ ,n S¦1


¦k r¶{ÝC'q':� 2_q, b b }? §_length = D 9lenA   > 3deff (© ’='utf-8',  ‚ing=NoneÀ B='')y#""› @ p ö TØ  �Ñthat producessñshorter result.
ä P" òan RFC 2047/2243† e�1 ofC  Ê:9  ´#=?~*·Q?cte?€ #edL"?=- qwhere '' ò' is omitted unlesŸ 'D €' parame¨ òis given a value Op´al argumenté° (defaults I L“) specifi®   !se #toé à Sñto binary before:Ú  Z]it.  ‡ N '% å  ”5cte… Br fo '  ¦ñshould be used ('q'N àor 'b'); if it7   (X ì )· O YwhichöI ú#stë  d sequenceT  t #, R� !'q¿ –preferred€ !upP qto fivezßacters longer ÙŸA '')Ù÷P y t DuageÜ#to=2y i8ë –Ã"""Ÿ½/ =µ?# =d ïBelse‚ úF bâiëÀoding is NonCe:
  õqlen = _cte_encode_length['q'](bstring)0 b0 b0 õ# Bias toward q.  5 is arbitrary.Z ~ Ñing = 'q' if œ !- s Á< 5 else 'b'3 / *ed¼ 1rs[ ;ing¼ vif langù    k A*' + V ò return "=?{}{}? ñ=".format(charset,1 $, l 
 ðed)
"""Header value p1 °r implementá ñ
various email-related RFC.  " ¢rules.

ThB   ömethods defined in this moduleb  _  _ 
‰  G [ ð  Principal among themš ‡ °5322, which ñ the followon
toª ð2822 and primarily a clarification ofU  ;Æer.  It alsoª  s
m B2047Jñed word decoding.
!  Ž @ goeFñ considerable trou ñ o maintain backlñcompatibility withN  ¸ ;Zqe phaseî €le clean'!up½ °structure ooqe generà 
9 @.  T† _ñer supports correct,Á 9 € by taggg àwhite space
asf ù  { ¥ only when  @ Žð e non-obsolete âñ
sets.  Actually,Î ¥ ³is even morÑ  Žc Qaccep¥ input thanÄ 
Ä �mandates,‹ 0lowÂ  `spiritñÁPostel's LawT ch?  ?  /@uragÛ°Where possiÂAdeviVas from®  sto Árd are annot(‰ð'defects'
attribute� `tokens¸ "t U eHº'l Ó¡âs¯ ,ßñuses its terminology
w½ t  �1 diíõÂspondence.  æ  #æ ÷ requires a
somewhat different£ €t Aused:�ñrmal grammar, new  !s
+ QmimicCÁclosest exisÖ Æ  ~ e P ½�us, it re(Q helpi°have
a copyX ªÅChand�RstudyiòdkI8o€ [$Jšñhas already been unfolded accor!to°u  ÓÏ a  — A  � iþ°e very firsO!epÎ
+ • @leavT#he~  = óstep to a higher level messag2rÙ`
will (Ì PdetecÍ ó line break’ wat needl `while
3  Z ~  6 Qbeginƒ ^0end~aeach hXÎ0out dÓ hT³List object® À is a list sö@ubclass.  A
TokenList is a recursive data structure.  The terminal nodes of the& d
are T$ ð objects, which  s{ e< 2strX öse do not correspond
directly tox T 1 inz ñformal grammar, buth ñ instead more
practical higher level combinationŽ 6truá †s.

All =andÛ ô
 have a 'value' attributeô €produces­ a
seman‰ ály meaningful =  Lrat part e ”se subtreƒ. @
allZ�tespace tÉðs (no matter how manyA - ñthey may contain)÷�
single J €, as per´ � RFC rule- This incluüd'CFWS'é £is herein
! d£�general s Ù :whi´  re‹ �one excep—q to
the� _ thatð   V€collapset 8to Í  ± aQs: inO B ¹ùbare-quoted-string' (a  ð
 with no leading or
trail Î 0), m ³ ò appeared betwee¸ ` zñ marks
is preservÅ {‚returned¿ r.  NoteT 0in þjº s· a
pairsB  inDpheir un| V çDalsoìl • þ p@mpts±b`"canontA" reÛ "ntñ èeY°-compliant È  î3subd  ó
Cd0parç,Ž ˆ@mini0useI å  
fing.
Wz2run"u@¤.

CommentOú '47entèa provi» Bx found
ð‚parens ( °  +`nested‰ s "s)iA9 Ž0defy¨ ƒ ãð
possibly empty lü N™= Å  q€le creat¶  å JB.  Df 
Nå1 on"   » 0d aê bpositev !ofÇr Ô
Ý €availabl÷QroughS'all_5 ä  O 0ny ›….  (For
"ƒnotes x.7 g == x.H ’.)

Each a ½ a Á  � PcalleÆ 'à 'Õ e5  ha< u_type'
²2giv¡ name fromÌ  `D5322Ã. &it6as.
Not)-  ã ¿� t„ ¬  GFnon-2 Àode that
mayô
 be produced: 'ptext'.  A ð is a string of printable ascii characters.
It. ðreturned in place7 Plists	  (cc ý/quoted-pair) and
(q p.

XXX:  àvide complete M  L ôtoken types.
"""

import re
 4sys ò urllib   # For  ‘.parse.un‘ T
fromí L ’hexdigits “operator  ¢itemgetter  Temail ÿ_encoded_words as _ew(  Serrora 	A ðutils

#
# Useful constants6ð functions
#

WSP = set(' \t')
CFWS_LEADER =  | Ã(')
SPECIALS3 ðr'()<>@,:;.\"[]')
ATOM_END" - |G X
DOT_  -a ñ .')
# '.', '"',¬ ð'(' do not end phrases&Áorder to supÀBobs-  }
PHRASEˆ h "Ë TŸ 5= ( ì t/?=')) 1 „')
TOKENR < Û A@ (=   WP"*'%"eTRIBUT– 4 D ¼EXTENDED_AT* 
 • ‘%')

def …_mÒ(value):
    T LC+str 1.re`@('\\if\\\\')  yðr'\"')+'"'

# Match a RFC 2047 ˜ð, looks like =?utf-8?q?some `?=
rfc.  _m? €er = re.Ž€ile(r'''¤ 0=\?ª  À# literal =? T[^?]*  „ 90set 
:  ; : UqQbB];  ÿ'q' or 'b', case insensitiveW ).*¯ 3 # ¬e
  \?=t  	 x p?=
''',�VERBOSE | ²MULTILINE)
³T AList Ñits subclasse±  & (Ø0):
¼  Ü_Üa = NonÒ ò syntactic_break = Tru ôew_combine_allowed P  _ó__init__(self, *args, **kwg è …super().- ' K & òelf.defects = []¶ f 3stre X Ãp'.join(Ç€x) for x “ )E ?repF á{}({})'.formatÑ 1.__QÅ__.__name__,°  ´  ë m )‚ 0@prè!ty@  Õ �g Ó !x.& 
Ô C if  ] Call_Lc wsum((x.) 
f 0), A’j  ¹ ástartswith_fws_ À):
        rñeturn self[0].startswith_fws()

    @property ðdef as_ew_allowed(> !):  / ð"""True if all top leve
 õkens of this part may be RFC2047 encoded."""P r¤ @all(3 .} B forJ iÇ ´ Œcomments¯  U = []u  W ctoken X à  ä 5 �.extend(+ . )G ¼  P B2fol9·, *, policyD8 0_re) ±_parse_tree¾ 1 =8 W cpprint% —indent=''Y   s.ppstr(%  )> ¢   Ü",  
J £ ‘'\n'.joinu O._ppS   Q õ	yield '{}{}/{}('.format(M yŠ ,  S ÿ.__class__.__name__%  §V_type£êâif not hasattréh, '_ppW ›   Ä @ + ' à!! invalid ele… UŒ ) 'Ê  .  µ'list: {!r}D )Ì  < Jelse­  ™ Qfrom 5 ©+¥ 'F !ifŠ.defectsM ³extra = ' D & {‘ ‹8 Q “ F  ¢ G'{})P ï 0 A)


åÀ WhiteSpaceT¤UList(
 "):·BvaluBÈ/ '7 ¾â: ¡[x.content�xÝ  !x.ns3=='J %']Ê ÅUnstructuredÂ 	Ì  ¾E  zu4 'J oPhrase; p% 'H?ord2 Fworde ACFWSn‚ 
¬ Fcfws? OAtomp Fatom1 2 q H?_"… = False!E\Wô G "d-ü  �¡cte = None° ch‘t Dlang _ÉQuotedStringÅ E ¸  Õq, !-s- ‹iŠ Äx
°8if …ð == 'bare-quoted»-string':
  ñ return x.value
  ‘@property ±def quoted_$ f(self)J �res = []-  ^ �for x in ) (   ò
if x.token_type == 'bare-a § 	õs.append(str(x))o  X Jelsej   %re5 à 6 ø Ï''.join(res)ý  </ppÿ  î Ò ò  ö $�A }á


class BareQ–SÛ( "):Ì 9 ji'  â~__str__Ý‚ Ÿ " Ding(4‰ ï)F¿ _ R 
ó ðComment(WhiteSpaceTJOListñ c1 'æ ‡ Ium([` N o["("],#  þ.9:(x)&; /")^ T], []m Ài  t !, k¢"if „ 
: ÞI ç  õ.replace('\\', '\\\\') 9 ;
 Ÿ'(', r'\(7 )7 /)'p@cont. Ä ëM
žS �sÆ[k .x ]©pAddress¦(°a+ S-listµ‹% e† xÎ  t3=='C "']d mailboxd usum((x.' é	† )Ë‹ Eall_h y� 	+ “ 2lÃ¿ºÌdisplay_nameÊ !if.<[0]¥[group¹Å p 2 Y HÀperty
    deóf mailboxes(self):
  0if  ó[0].token_type == '3 ',  3 ƒreturn [5 ]I /elK �invalid-S L e d .7 1es
n ‘@property …def all_% â ˆÑ é 	È ’

class M»`List(T£ 
 "):´³b-list'! -)v±[x for x inW if x%==]d 	É ‘h Î c  t  Œ (w <, 'R4)]
0PGroup$.g) ,$bif not !or C!Cd H§d"  O	ã
}y"y"Ø ù 8`2« hQ f/2][4’ 9X ÄÌdisplay_name'_l.+ §�NameAddrª'` _-addrN_ Š bif len  S1ENoneü½ 
¢local_partj e M F-1].* |Sdomai² H & D Orout•
 ‹ % B  q__specÑ ) ÙBAnglÚÀTokenList):
ñ
    token_type = 'angle-addr'
 ‘@property ñdef local_part(self):  K �for x in     Xif x.k  l šddr-spec',  0 –return x.n � odomainŒ Qj ˆ _route‡ ,Aobs-H 	‡ sˆ  ½_WŒ , H ŸÏ›À	Ä J ’ *    Oelse= 
Øquote_string(n) + x.Z R Kñ'<>'


class ObsR¯TþbList):P¤& '� �lu 2[x.!   @k 2= ') %']¥ �Mailbox(¤ m' °½display_namŸ!if¬<[0]� . 
 Ù  â 6 ] #(&M ) K $G % C _B .V s ¦w M( Invalid
i. -)“ BNoneÏ •2 = [1 = ð 5 = ³   iÂ DžÄX ' óas_ew_allowed = FalsŒ XP''.jo÷uper().value.split())£ YtAtomh �  Ÿft-atomE!Do8 OText< _-textæ ETrue’ ßNoFoldLiteral\ ’no-fold-l. ^ Dð 
class AddrSpecð(TokenList):

    t ñ_type = 'addr-spec' òas_ew_allowed = False8 ‘@property) ñdef local_part(self):  d preturn  F[0].) K ldomainG Sif le F < 3a e ONoney B-1].X v _valueu "Ú B ~ 10]. ¡.rstrip()+4 1  2 #.l% ª  §_§® Ânameset = se‡n)š J. 1) >Y ç-DOT_ATOM_ENDSÇ f°lp = quote_¤ !ng‚ e Jelse£=  ø 0 ”  ¤€ is not Ï
E M¡lp + '@' +XÛ ¤   & Ð


class ObsL¢P¡Aobs-¦-Ï
^ ÿDisplayName(Phrasead( -lX ¯ew_combineiD _D ¤eres = ß  d BŸres) == 0Z2res¬7 0res».Œ= 'cfws'E vs.pop(0n	2if Q T Ñ � 	Ü C 61:]l Z  í¬ ? « O-1][U ­ =-1]®  F 7:-1° ¨tu]=Îpˆ— y   #iffefects/   3 6Tru'ö rfor x i´
B  F [if x.`Z "d- 4   $  ~ � ý¢) != 0 andd
z  pr¤0posà'> V   õ 
P"==¢1 or?[0]! 
h  P l /' f 

g  ç# i  Ï j Apre+5	n )+6 ¸ ËÐreturn super(ð).value


class LocalPart(TokenList):

    t  _type = 'l) a-part' òas_ew_allowed = False9 ‘@property) Adef t q(self):  ` 0if  H[0].k ö= "quoted-string"2  6 ereturn: + _a Z Oelse6 
/ 0 ­ ê _ê ² ð# Strip whitespace from ñnt, back, and around dots.f º •s = [DOT] ©last = DOT e_is_tlV >   0for–% i " +Q 
î  if' Vj'cfws')  U …continue�   @if (œ ‰  Ô <tokR @dot'ð 	;  ?    ? <[-1Ý‡  ,   0res/ 5 = Šƒ i[:-1])c ö isinstance(tok,9 / 2f (3  È  ˜ É >tok¤Ç 	v.appendR ž Z[1:])˜ §A :tok2  ¼ 3 = +	  ®!= î   reyV ? 1VV;res ÖDomainLiteralÒ $d- "-l. ( A w� ã''.join(super(ÉŸ.split()){,ipO  FxD
Lif x_ptext8 – x1¿MIMEVersion/bmime-v, -²major = Non�6min ´ŸParametera p) ^ wsection¯ pkextend `charse›¯'us-ascii'bW |_numbernð# Because the first�1en, òattribute (name) eats CFWS  esecondË#< ¡ is alwaysE ‚  ø@here 8one{521].ª  /  �.? 0ed ’/ 0é Okæ @Thisx  81 of˜ ‚"handle ¥ jI  Ávs" hack©  œ  ¤Ð¤À token.strip·ped_value
  ‘if token. ù
_type == 'quoted-string':4  ? 2for9 2 in	 $  ( ` _bare-e  A   m  ,   u ÿ Í   4  Sretur× .p=$ õ''


class InvalidParameter(
 1):
Ad2 'i0 $-p1 K °Attribute(T�OListD a) 'b ‘@propertyp Jdef ¿ f(self)«	Z    I °.endswith('} Wtext'Q  6   ò .x'SectionÚ s' 'É Õnumber = NoneqVÎH | $¾ 0 = 1[0]‹  Ý  5Kcfws_	C 1C 
Zi  m   (�!, }#Ð', 'extended-“ )•	‘
o $  ï ´ÜEMimeÏstFmime×sÄÿsyntactic_break = False¸s°ð# The RFC specifically states that the orde¹A of I  �…s is notï ñ# guaranteed and may be re@ Qed byO ötransport layer.  So we havN±# to assume5  ¥ ð2231 pieces can come12any¤ Ø.  However, wL QoutpuÍ m1 Õ ä ñwe first see a given name, which sé @us a&Åble __str__. "ò s = {}  # UsingŸ € preserv õdict from Python 3.7+D I2not)kó'…  §Nocontin»7[0]S 8 !=
Ð LL  <" =   P 6û%()å  ? !ifi I ™· sf  [X V] = [ú E  ‘.append((+.ø_ó,“ )„  i V ,Ù&ts„ y.items(÷À  parts = so÷rted(parts, key=itemgetter(0))
  áfirst_param = 4 i[0][1]& §charset = 0 . 	* ð&# Our arbitrary error recovery is to ignore duplicatex ‹ameters,N ùto use appearance order if there aI €rfc 2231R tM 7and ðgaps.  This mimicsS ² Sof ge".� iif not�extended j 2len…i) > 1:<  ‚"if¦ ¾[1][0] == 0%  ) –1–�.defects.1nd(_ñs.InvalidHeaderD# (p  K   'x f name;’3(s)¦+d'2 C   – 4:2 " @# El¼Qssume\`*0* wao°ssing...not @at tˆÍis differentÁ f# from�ð, but we registery "B forS zearlier¼Pvalue÷jts = [îYi = 0~  M ð section_number,¼Pam in	 .tsº:if 3 ^ != i( *€We couldÞ ’ fancier áqnd lookÒ ©a complete   D   #Â ŒÝ ]–|0theŸ oond onM �seen.  Bf1'reð¡doing that=úe old code didn'ti –   -Œ .›  / ( Ëí* M ñî H continu.OelseÐ Tp"inconsódnt RFCòD ¢Oing"» mi += 1>Î1am._ * ·/amÆ?tryZ � = urllibo ñse.unquote_to_bytes(& 
¯ ‡   except Uniz!En  kt ð# source had surrog{�escaped s a.  WhaTmdo nowþ  }   #Ëða bit of an open ques%a.  I'm/0surá_is isN  �²best choiceÛ itf w’     i�algorithmnP À            ñ value = urllib.parse.unquote( ÿ, encoding='latin-1')
   _else:  - ?try  ! n " =“  .decode(ch’ ÿt, 'surrogateescape„  I ÿexcept LookupErrory ÿ"# XXX: there should really be a custom defect forä  ~  # unknown ¼ ð
acter set to make it easy _find,M �because oŸ Iwise_  Y ¿is a silentL �failure.' 
‡¯'us-ascii'Šåif utils._has_ÂsZ)—bparam.v s.append(eÏAs.Un ¡ableBytesDœ.()™Ï U_partD  
*  ¢ = ''.join  6 
) ²yield name,©
M÷def __str__(selfÛ Ç as = []+  $8forD @ in 6  :ams"ifi 
  F Z ò '{}={}'.format(£ È ˜ 2ingÕ )$µ
[  L   -#; / # Òreturn ' ' +  4 if
  s Ð ''


class Péð eterizedHeaderV—Â(TokenList):g0# SJðhis false so that¼&ñ doesn't wind up on a new line even†#� ait and= ¥  „ 1s w!fiV  re but notJ ‘the firstN Hðsyntactic_break = F› ± ‘@propertyu  &i s% tî  Œreversed%  ô1if ( . ñ _type == 'mime-\ Å '.”8 i•  V  %{}”ÏContentType( åR Š 2 'c9 -š 'a Õas_ew_allowed w @main(  LBtext0 4sub Vplain)• ¿Dispositionœ #dA s £ Ï _3 } = None+ƒransferE.	¾ î (7 -f’ t°V'7bit6_Labelx àheader-label'
ð%    as_ew_allowed = False


class MsgID(TokenList):
4 t ñ_type = 'msg-id' N  5 ódef fold(self, policyQ    Ñ# message-id b Ás may not be; 1ed.f  / ¡return strQ 3) +S †.linesepÄ W 1ID(Î s b Ä $ È ü ‚InvalidM  ? 
 C i/ -Æ 'ƒ oHeaderHh%  5 Ñ#
# Terminal ‰ôes and instances
#¦ ( q(str):
 †ATrue §ew_combineò ñsyntactic_break =  :  ¾ò__new__(cls, value,©G œ â¾ = super().8 )T + .Œ 
% Ådefects = [] 2elfû ¨ brepr__³ l - ñ "{}({})".format& 1.__h __® game__,À P &))e Rpprin= ú  R  � + '/' +  õ V ‘@propertyÞ  É Call_÷ ¦ i Ì 2lis„ .( L  > 1_pp6 ¾, indent=''A r["{}{}/%{}„  5  @ , Ä 6 % ÑB _
  Q'' ifÿl á ¹ else ' {}'Á )D ')]²áop_trailing_ws‚# This txýtes the recursionzBNone] ¹}commentd rµ[– Ï__getnewargs³ Ü¯ ,< «¥WhiteSpace	 © Æ[ (2' 'à  MÎstartswith_f<Ø /� V!‚ (	 ‹ # Œ 
È/EW  ž #'(O__st{ * __�EwError(e "s.*QParse ¡3"""0 ò encoded word found while parsing HÐs."""


# XXXËðse need to become cð6lasses and used as instances so
# that a program can't change them in ‘arse treeL õscrew
# up other p  ñs.  Maybe should have  tests forq þ%, too.
DOT = ValueTerminal('.', 'dot')
ListSeparator* ,* dlist-s% ÿ')
RouteComponentMarke<  @< r+ $-c, !-m- �')

#
# PÔ Dr
#
 ð strings according to RFC822/2047/2
 ±5322 rules.H òThis is a stateless0ð
r.  Each get_XXX functiona 2ept3  s  uÑ
# returns eiu$a 6° or a Token4¡ represent¤  he¥ ð object named
# byàp methoda ¡ n tcontain= 3rem !unéd!áracters
# fromL °input.  Thu¼ , rb �consumes* ð next syntactic  òtruct
# of a given typpù 0a tä à A A pluc  ž® Á 0der] Athe © Ï¥ñ For example, if¥ Ðfirst element;  Â ¦ €ured heaR Ù‘'phrase',Q1en:ùB     0, vå! =ë ( )* à  œ  �Clete; ^Astar‡  & ‹W ,õ Wany
#š� left inÌ 0 @afteƒ^ ðis removed.

_wsp_split& P= re.Ž ñile(r'([{}]+)'.format(''.join(WSP))).7 ð
_non_atom_end_matc
J 0"[^J "I 
(•re.escapeX  ATOM_ENDS)_ K _ Ðprintable_finƒ_ ð\x00-\x20\x7F]").( 2all? BŸ /_TOKEN  Ÿattributee /ŸATTRIBUTEi Ÿextended_r 8ŸEXTENDED_{ ñ
def _validate_xtext( !):ËS"""Ifcm ß PÅs ASCII non-Å€s, regisrÑa defect."""
L  O+ 1 = a  2  if` _# s•  d¥ .c ôs.append(errors.NonPXD… (| $))_ óutils._has_surrogatesƒ m pUndecodÄSBytesq a  ©   R"Non-03cham` foundÔ~`B"))
– IÐptext_to_endcðhars(value, endc õ):
    """Scan printables/quoted-pairs until5 â and return un) � ptext.
O àThis function ( ós a run of qcontent, c
 ñ-without-comments, orI dU  -g -¢ ó	 into a single string by“   1anyG < Þ S.  ItÃ Ds th? , `remainA .1andH ða flag that is True iff5 Íre were any o ƒ decoded1"""O @fragð 2, *s ôder = _wsp_splitter±!1)3 v¶Q = [] áescape = False ihad_qp ôfor pos in range(len(~ ) 4if  Ò[pos] == '\\'& "   2if x 
    	}    œ  ;®  OelseO 0  8  ?2inu÷   ™ • -elï %inå
� Ubreak± †u.appendI2§
Î  {=�1+ 1E =‚''.join(P 4),  [†e:]] + "2), GÃ

def get_fwÙËç"""FWS = 1*WSP”Pisn't¯° RFC defini¤ .  We're uNò fws to represent tokens whern@fold! 5Àbe done, but# Án we are parO  `D*un*5 ¢has alreadŸAbeenC 0 so<  do¦ @need†  watch out ÇKCRLFG1new¨1 =   .l"p(‹ Ì ò= WhiteSpaceTerminalY [:7  )- M ’)], 'fws'F ±Tfws, # €!enßR_wordX ‰  - � = "=?" Æbet "?"   L 0ed-øR "?="½2bew = En Wm ž cif notþ `startsSS('=?'Š  ð
raise errors.HeaderParseE (™ '   ’"expectedŸ 1ed ¿  âófound {}".formatñ Š ;tokÎ\Q[2:].Ós('?=', Ï if[ f' x¯ PPremsttyf1if ,( P) > 1ý  ' 0[0][Ÿhexdigits# 1# ÷tok.count('?') < 2µÑ# The ? after»ðCTE was followedôa¹…©óÐ(=XX).
      ó  rest, *remainder = remstr.split('?=', 1)
  `tok =   +  ! +D   £if len(tok> q)) > 1:  @ ñew.defects.append(errors.InvalidHeaderD# (6  : ò"whitespace inside encoded word")¢ áew.cte = valueB 
 µ = ''.join(ë 2 6try  ótext, charset, lang, ² A = _À  v w('=?' +N �except (V EÜ Q, Key
 )h sraise _ö !Ew  ñ ß ’ format i'‚: '{}'". (õ À $ =Ê 0ew.Ð ! =×  Ý @.ext� Í `while º !if ¦[0] in WSP  §atoken,# ° = get_fws(C S  $   $ew2 
 ccontin¿ . ‘¦Q_wsp_¤1terb 	§vt 1 = ‰“Terminal(I ' 'v _~Pate_x8 (   ®   - [7# E£ñs should be followed by a WSŽ"if¶B and
  f no÷
j‡G#Ðmissing trail	 XTafterW-W¢return ew,™ Q

defßÑunstructured(kç8""" Ð = (*([FWS] v‡ä) *WSP) / obs-+ 	)   ñ = *((*LF *CR *(0  z#)  )G 5FWS²# c = %d0e øNO-WS-CTL / LF / CR
q   0is …1rolCsacters Ý¢WSP/CR/LF.> ÿSo, basically, we have printable runs, pluV ±or nulls in� 0theÿ òolete syntax, separat2³ò
.  Since RFC 2047 uses thû8obsG  ²öits specification, but requires \ ¡ on either— s of\ #zðs, I can see no reason to need s¼  ; K Enon-- v @from* @ yò hey occur, so wå p­@ thiB1to Â ™:ens83WSP ºÄBecause an '‚ É'æP must£`defini. qstitute¥ Rentirˆ ý,‰ ð'get' routine does ÈGac0ain6 @onlyQ  Ò 0d TLCList® 1""" a# XXX:·ñwhat about bare CR=`LF?  T.Àmight signal` ð  start or
    #ðF end of an encoded word.  YAGNI for now, since our current parsers
    # will never sT ðus strings with bare CR or LF.

6 ÷unstructured = U ±TokenList()+ Áwhile value:  @ "if ¦[0] in WSP    tE ,$ ± = get_fws(F W  &   Š �.append(> 
' …continue‚ ×valid_ew = Tr š p.startsk('=?')¡ *ry  Œ x 
¶ ›_›¿ ¡except _In‘ ~EwError[  ¯ FFalsÈ  x E e; �s.HeaderPäM ð# XXX: Need to figur"Pt how õregister defects when; s   ý# appropriate here.$ 2pash 1   7els    |have_ws�    xif len(ì^) > 0(. * Q[-1].›ï_type != 'fws'=  A > .\e°lD&(ý  L  ù"missing whitespace before¿*")¸?   %   4if # ?and21õ 8if ô 9[-22C== 'É-É; y` = EWWó Só �Terminal,
Œ 21],±) ¡ê+ òtok, *remainder = _wsp_splitter­6, 1K 0# S  ±£the middleƒ�atom if tÙ is a rfc2047ß##±ch does notº ó on both sides. The† ©4be ž'edO  ’ ðnext time through� V loop™À# This needsëð only be performF1hen9 óW Ó „;t oî Twise,?  á itÄ Ban iÔ	‡ can cauÂ#m ” ’  gob@ kfiniteÂ ¢½ èhð _matcher.search´òP¢.partitionéá  vtP0= V¼º8' '_Pate_x6 (   ©# Œ µ = ''.join(šF ðreturn unstructurñed

def get_qp_ctext(value):
    r""" ñ = <printable ascii except \ ( )>
0 ñThis is not the RFC @ ô, since we are handling nested comments in P  and unquot-   ðed-pairs here.  We allow anyth& —   A'()'H ðcharacters, but ifŠ @find8 õ ASCII other than¼ …defined û N / „, a NonP`Defectý �added toF ‘token's d  s list.  SM Õ  Õ  `converC #ir1ed œas, whak Pretur¡ !isM @a 'pÅ!' x @.  IÍ ‘is case i5 òa WhiteSpaceTerminal, so it'sc M ris ' '.Ú1""" _ ,& p, _ = _> p_to_endmsG , ƒ): / =}  (> ,¼ / °_validate_xÒ $  ö  6 ÈjcontenÈC"""q @ = qQ 2 / {På M
pDQUOTE Þ KJï NyJH N3AnyÍ H
P OL/soO KN `is a V2J0-""'åÞ* =] *4a¨ï1"""  î‘matches _ _ rè)à non-ATOM_ENDSÂ2  adb1 InÎSAText)!toA §¬$£ a T }!s.> –mˆ€non_atom„° ß - !if˜mÛßð	aise errors.HeaderParseE (5  '   `"expec–Š  Fôfound '{}'".formauÂ) ¢= m.group( ¯" =BQ[len(( 1):]p  ÷ 1, ' !! d ! ¬!Rbare_ûs_string%0"""" -" -" 3 = ÿ„*([FWS] O")   GA�= bwithou@lead¦qor traiw�  s� ²tÌ)"isG ext betweeÑeb P markAith F E I€preserve€d/ ðd pairs decoded.
€    """
 ñif value[0] != '"':   ð
raise errors.HeaderParseE ('  + ñ"expected '\"' but found '{}'".format(j !)): ñbare_quoted_string = BareQ S (, 8 # =ª 11:]B » C and K0] =Å btoken,  ä = get_qconten� M  Å “ �.append(E Œ SwhileO 	y >Ÿ  Zfin WSPZ n T 
™ 3fws$” %elH ":2Þ '=?¤ J õvalid_ew = False=   :tryx  Ìencoded_word…  3   ! tdefects)-!In” 4D# 
0 N   "w  w ‚ inside  "0 .  ] ñ :Truð oexcept¶   ø# Collapse the whitespace between two Ö ùs that occur in aŸ # U-ó -ó ."  á q@len(4 
=^) > 1Þ ?if -  Q[-1].€Q_type4@fws'J	|  ò  t =[-2G ú -Ð.')‘  N J €1] = EWWPSP�Terminal8G 0, 'Ë ­ ' Jelseˆ ú 
zó« êE f bif notj ;  -$‘"end of hƒ&areturnX
$ó â% [fA
def2Fcomm1ä 3""" ó = "(" *([FWS] c_")  "")k%   £ = ctext /íƒ-pair / R 
¤ ÐWe handle nes\ ps here,®	? ¢in our qp-] rroutineOñ> Y ¡ ½(Wû#(úÆ C = CWG� æp	2")"Œ è(ÊpÀ  token, valóue = get_fws(value)
  Qelif  µ[0] == '(':  % btoken,$ H ~commentL /se< }qp_ctex= T �.append(v § bif not� _ 0 tdefects8 ñerrors.InvalidHeaderD# (Ö ‘"end of h" ƒ inside U "")z  ÿ dreturn K  ‘[1:]

defqcrº ô"""CFWS = (1*([FWS][ !)  �) / FWS
c 1"""  H 0 = ; RList(Ÿ RwhileB and
  Ç!in+ r_LEADERz  Ì ëfin WSP    uã ëÁ ‰  & /elçJ# É «n Ê K3fws DÓquoted_stringP · 2""" - @ = [#‰] <bare- > Y'! ñ' is an intermediate class defined by this
aparserx ž ðe RFC grammar.  ItT Bthe ‹  ¨ @ ñwithout any attached¶. ú9 þ A = QS=ÖŒ Ëveä •Y|  å	x ² G   S_8 U 	 Q  Æ bx	œ �CatomÊ x  o01*aÓ	b1An % €could be[úrfc2047 encoded wordï3 0= As ÞH g „’ATOM_ENDS !craise ohPE�lrxpectedôbut found '{}'".forma
õ p.starts,f('=?')€ 6try  ‘ ’ h_hÂáoexceptÁ 
[ ð# XXX: need to figure ¾0how €register* ŽU whenk  ž ‘# approprWBhereù    ¾  T· 
y2 À)
    atom.aòppend(token)
    if value and
 ñ[0] in CFWS_LEADER:*  . 9 ,( Á = get_cfws(C Q  ' matom.al preturn  D Q

defG @dot_ S_textP x €""" dot- a = 1*a
 T*("." !)
£ 1""" 	M ° = DotAtomT[ ¦ cif notÉ "or	 ú ’ATOM_ENDS€  Ñ ð
raise errors.HeaderParseE ¡("expectedÛ ò  at a start of ’  E   "Ê  è Ï ôbut found '{}'".formaÿ ª Rwhile  
¤ À ?in ®  ¦ 4W# � 	'°  $  f== '.'  * N 2DOTÇ  "   *" =Ñ A[1:]Ž  ifã¶[-1] is DOTe …0end�
r��A'.'+ª )¾ º	ã Ãg¹ ¾ ô@ = [W]í -  ÃðAny place we can have a2 ^, Ãould instead" ñn rfc2047 encodedYQword.
 (ä ê ©  %(T f .!²swith('=?')/ #6try   ¯ovä _à pæ  / oexcept®
[ ð# XXX: need to figure out how õregister defects whenk  o ò# appropriate hereq    Ž  íT Felse¡ : S s
?ã,p -¹ë´ì 0""" ! =âò / quoted-stringbEither! *or" C mayq P»R.  Weñto peel off thisj ß` firstæðdetermine which type<—  @  íÀ.  Afterward†aspliceN ±the leading~ ,X any, into  pC ad sub-Ø.Ø SIf neÜ [ or aá #is'abeforeQ ñ next special, aˆ › DÐraised.

    ð\The token returned is either an Atom or a QuotedString, as appropriate.
    This means the 'word' level of  àformal grammark Ðnot represent~ Qn theP Ðparse tree; t\ ò"is because having that extra layer when manipulat# N  w ²more confus% Pan it ‘helpful.
„ 1""" ñif value[0] in CFWS_LEADER:  ²    leader,) Á = get_cfws(: )( Lelse2 b = Non¦ 0if 2 ( áraise errors.Hg PE (Y  �   `"ExpecJ`'atom'½!'q¼!-s½°' but foundl bhing."ž æ V=='"'‚ $
Û U _U 
ä H  .†SPECIALSO Ñ Ä — ò  "í a'{}'".ƒt° ÷ 
•ë   J2 m#ifí 1 ° ÀÞ B ‚[:0] = []8 dqMQ

def+cphraseg M B"""  ò = 1*word / obs- U    1 = ' !*( q/ "." /±)ÓTK§a^ ðcan be a sequence± A ñ s, periods, andH  Ó1any} 0ord)`s longðit starts with at*ast one™  .  If anyty! oiAthanO s  U1detÆ v ’ ObsoleteúQDefec«€added to2UA's d N õlist.  We also accept õ =­  Öñ followed by a dot;L � registeredî ¨an Invalidœ @, siDQ  `suppor–b81eveé ÍÜ xèB = P±2try! ünNv GI½  ' J �.append(5 M !ex^h A `sI 7  ˜? P doesw&% ¯ "")Ž SwhileC q
 v G×in PHRASE_ENDOpG=='.¸ú 2DOTj     ™ .Ø {
Ù  C "$ 'O 'Ð     È " =Ú 2[1:  
~  	ß    ²ç + ÒÀ
             ðif value[0] in CFWS_LEADER:
   btoken,4 Á = get_cfws(E )3 ñphrase.defects.append(errors.ObsoleteHeaderD$ (G  Š þ"comment found without atom")~ OelseÇ Yraiseg ¦ ž ç Q rreturn   ú Q

defý £local_partp A"""  - p = dot-§ ö / quoted-string / obs-, 
– 1"""  _ @ = Ll Pk š l4b = NonÍ Î6 É Ãbif notæÑ  ~5 ¹±`ParseEË
µ˜"expected$bu¹´'{}'".forma8Ó 6tryp …
© @dot_Gm$oexcept˜ O \  Ð `  Hword\  ' `  , �²!= '\\' andJd¶PHRASE_ENDS�  =   d×     ¦ @ = TzRList(+2if Ë1 is® Q 7 ‚[:0] = [) ]X S‹+ U Êµ 	Q[0]==É &orÈ  7in Ì )| Fobs_g 
Â
 V(str(+ 2) +c Ž  ÿ  if!O .¯ ú_type == 'invalid-G'Ž  F c ˆIF Ö‡"G ÓuØ,×@, or¸ Ù"¡™Z é¡ )¢  a|‘(containsè)’ €  ¦=¼ t9	œ0 .1ò .encode('ascii'À:0Uni E" -�H !…NonASCIIý�è Anon-? µ charactersø Úƒ ªÞ­ê è â
s0 = ?a *("." Ì
M e = ObsÖ Õó
last_non_ws_was_dot = Fal®Rwhile#£"À
        if ÷value[0] == '.':
  úif last_non_ws_was_dot$  / ñ$obs_local_part.defects.append(errors.InvalidHeaderD# (n  J   ""i* � repeated™ 9"))- s k :DOT' ¿  y = TrueN 1 =  I[1:] gcontin3 Celif, {0]=='\\9ž Vl’Terminal(l 90],l   û'misplaced-special'\ Ð ž ¯("û ð character outside of quot¡ ptring/cD<entÇ JFals¡ ? 	ƒ:if Ç K and ÿ[-1].token_type != 'dot¬)pmissing°è between words÷ :tryB¢ ,Pp = get_5 !Ï
/sexcept vo`ParseEˆ
{ Çú not in CFWS_LEADER,  –;rai™½  Lcfws½ 
¬= â Jif (% )[0½   ½9 or15 	0=='� '5 		'!==%)þ 
c ß%"T lead&1in 9 9& Ê
6 (-2yN_trailƒ£Yõ3= 'PQ-obs-n-n'kreturn9�Q

def�SdtextÔu Qr"""  ó = <printable ascii „€\ [ ]> /_ -- t  J Œ  ! = ´NO-WS-CTL /;Qpair
1 àWe allow anyth,a 0thel Vluded‡ðs, but if we find8 I ðASCII other than tôhe RFC defined printable ASCII, a NonP ðDefect is
    added to the token'sJ ðects list.  QuotX ð airs are conver 9 !irL 2unq* àvalues, so whal ` returž ¢is a ptexto ñ, in this case aJ VA ÐTerminal.  If  ‚re were f -è ÿs, an ObsoleteHeaderæ ‹ 
ï î 
€ 1""" ¨ !, Ð ñ, had_qp = _get_ Ó_to_endchars(' V'[]')? 9 = Ï (9 1, ' * #if^ :9  š !.d®ÿs.append(errors.ì (:  > "%Pfoundmòdomain-literal")¬ °_validate_x�¦  1µð


def _check_for_early_dl	i _i )Û "ifO  « _ QFalseÄ 
8 û !In© æú ò"end of input inside O ð  � e 
ªb']', '* @ S-end'4º BTrue / Y ü ;"""Ž ñ = [CFWS] "[" *([ d‚")  3"]"$ 
œ
h A = DØL×(»n0[0]û k v_LEADER€Ø0 = Ä 3cfwÏG  §
p 1= % mif notÞSaise ¸¶`ParseEÊp("expecJ_ f"S U ¿ f!= '['· rY À'[' at start
i  é á  R"but .Ã'{}'".formatÊ™ – " =í A[1:]¹i# y K� =•\ 
 °[° ù ²6WSPQËs !G  Ð@Í : `JIP¿ OÀue[0] != ']'3:
  ð
raise errors.HeaderParseE õ("expected ']' at end of domain-literal "O V ñ "but found '{}'".format(value))0 E _E �.append(V" ò Terminal(']', '* o S-end'D P 1 =  A[1:]Z "if B and
 ö[0] in CFWS_LEADERbtoken,( ³ = get_cfws¬ Q  × … ¯ = Ð creturn( X Q

def[ G ] … 3"""6 Ó = dot-atom / ÷ r / obs-@ –  1 = 8 Q*("." 1))
( """¡; A = D¿(· lõq = None0 ?5	6 Þ 6bif notYê  Hr�  '   » V½ f== '['{ ­
´ Y ®—… 2if é 1 isÌ  $P  ¤ T ‚[:0] = [- …  ^ Û+ u  	0– z 6tryd 5  h@dot_ë® oexceptÉO 
K B
> L@LÇƒ'Invalidk'ö Oë KG« .« ? tdefectsŽô‚ObsoleteüD$ (‡ ¤  "@ a£‘(containsY#)"• 5 #if¿A[0].Ù `_type Gã£  3 g  [:J 0KRwhileL™î K ê 2DOT€    � 
T F
/ � N = ! Âê“addr_spec¨… í  - ô = local-part "@
¸ / I € = AddrST ‚ � 
Ê Q _Q x ÍD Ç  ¨2 ore ýH!= 'ôE LõK B ú §  § ƒ with no1Fa 6 ê Ò :@: : ðess-at-symbol'))
  ñ  token, value = get_domain( ñ[1:])
    addr_spec.append(:  freturn# P Q

defS ’obs_routeV !):S �""" obs- ! = } ‘-list ":"(    (  ò= *(CFWS / ",") "@"   € *("," [ 6] [ 5])
O R² As anv ‚ Ò ñ with the appropriate sub- µs (that is,M ±there is noN ˆ Ä !inL Áparse tree).8 """Ü q = ObsR%VSwhilešBand <²[0]==',' or p[0] in ï s_LEADER_ 7/if% ƒ $   Ü ·Bcfwss �  '   ² 	    (elu j== ','m B ÚListSeparatorn †# =Æ 11:]>bif not 		W!= '@o ðraise errors.HeaderP‹E (L  ´   ‘"expectedÄÊó but found '{}'".format° Ô ÊãComponentMarkeÛ l h Q sT : p (oC k? g kX   UbreakCõ
�
6 Ä j3s  hù ¡ ý ” /   ž  œ -   d B ¤;“‘"end of h¬ ç >6ing™"a ¹  ú:ú î€':' marka } › ß   "|	!V[õTerminal(':', 'end-of-Y -� Ber')Ø P\/ T`angle_—8ö U - $ =	1"<"¡-Ä5 ">"/W3 Ò ž  
J    f T hãD © @ = A¶ RAddr(ë Ä7S�h š ŒÀue or value[Ã0] != '<':
  ð
raise errors.HeaderParseE ('  . ñ$"expected angle-addr but found '{}'".format(value))@ . _. �.append(V ñ Terminal('<', '& T s-start'> J 1 =  A[1:]T ó2# Although it is not legal per RFC5322, SMTP uses '<>' in certainF ácircumstances. #ifl ‡0] == '>.¥ Ë 	>Ë 4endÉ  C@ tdefects‚rInvalid‰D# …Pnull MP-specÒ U :"4 k 08  breturnÅÌ ,ñ þ 6tryStoken a = get0 _z ã5 oexceptFP ]  ‹ a  ˜obs_routea  ,   ë „ .@�ObsoleteA G #"o'  j  Ð ŸificationSç  c X / \2ddrÛror obs-£ h H !lc‰ !  ÓI 
#B and<[- ‚Felseg ÑÐmissing trail	 S'>' oà	m ‰¾ó æin CFWS_LEADER× f LcfwsÓ‘ 9 ®§A
defŒ´display_nam.ƒ C"""  - ¡ = phrase
¯ÀBecause this<�simply a , ô-rule, we don't ‡ 	Q G ¬ @ conP yaf ,‰rather a9  5 BwithD !heB £ent of theD .« 1"""( Î ë B = Dú Nù .X 
Øó tF @.extŒ9 2[:]G 	" ’" =¶ s[„3 � %

¤ S±ˆ ¡  ŸC = [E ®]› 
 3 M 0 = ü RAddr(¹ a# BothA opÇ"alyÀay name and ñ&the angle-addr can start with cfws.
    leader = None ñif value[0] in CFWS_LEADER:  6 ,) p = get_T (: )( bif not' >  B áraise errors.H… `ParseE (A  +   Ó"expected namÔ òbut found '{}'".format(Ò )… Í f!= '<'‡  æin PHRASE_ENDS$  | « G.ª  j ZtokenV€display_÷ ^q£ ] ³ $ifC!isì H
@3 ²[0][:0] = [¡]ä ‡ ]  õ _À�.append(K 0 
,ð0 *¢ H › } 	areturnŒp ˆ Q

defsmailboxˆ C"""  ! =< œ / ã a-spec
1""" ò# The only way to figure out if we are dealingÚaY Sor anJ c 0 isJ €try pars9 ‚each one£ MÅ q"ryÈ  š6ö  0õ y oexceptèP ] a  Ã _&a  , e  , Í&vËôif any(isinstance(x,rInvalidòbDefect_ �  Pfor x„na.all_d2 &s):˜ .$ ¢_type = 'ig - '� M Ð! ØÎN _  €”, endcharŽ  àÀRead everyth[ upmpone of ”1  Ô = .ô@This›qoutside, Ñ±l grammar. Aœ  T3ÁList that isê Ð ó ed acts like a 3  , Ã Œ ñ data attributesM ¿“ ‡þ : = „ (ÁRwhileëB and
  E %in.»�� ÀV¦ð	Terminal(value[0],
       ø'misplaced-special'))
A �value =  E[1:] Uelse:  4 btoken,+ á = get_phrase(> 
Y ñinvalid_mailbox.append(D * {return ) ` Q

defc A S_listi — C"""  - C = ( U *(", Ñ)) / obs-mbox+ × 	 ô = *([CFWS] ",")^ N [] !/ $ !)
G ñ<For this routine we go outside the formal grammar in order to improve errorP òhandling.  We recognizI aend ofT � ú qonly at $ O ›0 or pa ';' (“ ðgroup terminator).  TÆ  is so thatÉ @can ¦K ª’es into IêMé âñs and continue parsing anyJ `remain %R õ  also allow  € entries7�be null,N  k ‚Ñcondition is Hâed appropriate%ò a higher level.Æ1"""L Wn3 = Õ L|¶Swhile y ``[0] !=^›.&ry  ?n ×�  *    ‰ =  # bexcept;às.HeaderParseEM
} l y = Nonei "ifÎ  Ä !inÛz_LEADERB  r F £OcfwsÁ  0 bif not`  „-~in ',;'b  6 û z ƒ $  	0 tdefects3e¢s.Obsolete%D$ (Q à"empty element°c ="C : -    
2H=,á 2if   Ø Q Å<s ‚[:0] = [9 × !  Ö d	+   	/ hg	á$in i(el¬_== ',B ¦ 
-ð if leader is noŸt None:
   ýtoken[:0] = [leader]) ñmailbox_list.append(9 )+ tdefects3 ñ errors.InvalidHm D# (H  « ""i*  € 4 in -‹ &")€ Âif value and
 p[0] not5 J',;'ÿ Ä# Crap afterT û; treat it as an  .¥ T# The; Ð info will st Êbe available8 Ì =< V:[-1w' .g“_type = '’ - '’ + ,ý s = get_0 _0 (# , ; k! O.extÝ" ® .Ù(Õ/[== ',Ð	ž ¢ÚListSeparatorï " =,2[1:|Ureturcê Oa


defSQgroup N)YA"""  š Þ Ö/ CFWS / obs-' ¿
 p = 1*([3 r] ",")  
0 1""" G ‰ @ = G–  ñ (é !ifüè ¡  æ3 Â%‘"end of h½w beforeù "“Ou M ‹ k! =›Ð Â!in;v_LEADERË @ R îCcfws•R  h 	   Áñis should never h; 3eRñ  parsing, sinceŠ ¥-only is ad N ÷legal alternative to U a p, whichE @the Q L HplacW ˜ :arsKZÏ% º Ó"in¥ ¹Ï , r  ’ 2nd(ˆu "   ù
 ! ë £ Îžg 0  ÒÆ'bif lenÑD.all.fes)==0s(  ! ¹ ZV¹ " l! f�Obsolete@ð"group-list withó empty entries"))
  ñ	return group_list, value! ñif leader is not None:  ? Òtoken[:0] = [) ] N �.append(+ v r ‘
def get_? (‡ )n 2"""£ ñ = display-name ":" [0 -½ Ñ] ";" [CFWS]
‹ 1""" $ @ = Gé (Š • ð ! ={ ] _] ‚ ? !if ” 2 or$¢[0] != ':'¦  áraise errors.H=`ParseE  ("expected5 £ at end ofÜ ª  F   "Œ  Œ ó but found '{}'".format£ Ï ã q 	 VÝñ Terminal(':', '! -o X"-t" Ctor'-û =ú "1:ê"if B and
  W== ';a š ‚ ;‚ u  0­[ Â l ÊÀ ‚ 6 4ØÅ. tdefects6 ÔrInvalidÛD# (c  ¬   "Ôhý# i]"H$el4 * ?*?h L-;'L0/{}.”	0in Œv_LEADERa‚ÍzHcfws² KˆCF 
>daddresL t  @ Â = mailbox /x)ôNote that counter-intuitively, an A õcan be either a single !or§ a ‘ Ý8 Res (ar €).  ThisW‘why the r‰Bed AÀ ³ object hasP '¸  esïþtribute which treats� a ‰ alengthN ðone.  When you need to differentiate between ñtwo cases, extractµ û R ƒelement,‘ &is!¸  8 .z£a# The Ù€l grammayðn't very helpful w¶ 0par} ˜$. Ù� #“BÂ, especially> €allowingn ‚ obsolet{ Ás, start offw M àsimilarly.  It¹$onN  B�reach oneòP@, <,ï :R ! CknowL wfõ	you've got.  So, we try H 0in ›�  ­ Awithw2mor¡€# likelyu  E0two×ðe could perhaps mðBake this more efficient by looking
    # for a phrase and then branching based on ó
 next character, but thatL €would beQ ñremature optimization.) ²address = A
 !() Atry:	  š ñ
token, value = get_group( 1 ðexcept errors.HeaderParseE L Y ] xmailbox_  * c  , _raiseŽ (Ú  +   ¤"expected  Oófound '{}'".format“ ó + �.append(& dreturnL :Q

def=9 D_lisR !4"""5  C = (- U *(", �)) / obs- -H Ó 	 ô = *([CFWS] ",")^ N [?  ÿ!/ $ !)
G áWe depart fromnÿ àl grammar hereÀpcontinu�@to pða until5 1endP !of Áinput, assum2 1he  0 toªáentirely compoëAf anC © ë @.  TOÐis always truK   e:‡ Aing,C‘allows usG åto skip invaliî esƒ ¿ @addi  alñip2es.1"""G Ž ¤;LÏPwhile@ "ueÚ e	T XZ hm  *    u t  # "0 as‘  3 lªy = Nonep "ifÁ a[0] in!z_LEADERB F é#OcfwsÈ  0 bif not` 2 or	  i n== ','a  5 ¿ u $  	0 tdefects9¨‚Obsolete°D$ U "R †ð  entry with no 
^ent")Œ 7elsM   3
6š_Ê,Y  C 2if 1 isT È@ / r ‚[:0] = [9 ]ö %   ë 	nè!([F ]ë  : wIv¼iZ‰s(elºQ	à ¦ °"empty elemÙð in address-listW"))
  Yelse:   ñtoken, value = get_invalid_mailbox( Z, ','Q  ? ÿif leader is not Nonf   + j ‚[:0] = [5 ]� òaddress_list.append(A !([B ]×  [ 	6 tdefects> ‚errors.IÕ H­ D# (~  L "ÿ  U 4 in -– W#if92and
 `[0] !=,
kÄ# Crap afterO ô; treat it as an z y.  c# The  Ð info will st Êbe available8 2 =w \j[-1][0€* .g@_typ'• - '• + >#P @.extåJ 
`�° .Ö(Ò! :  # Must Zú , at this pointb	¨ ´VPð Terminal(',', '>»-separator'Èf# =G"1:œUretur�oa


def±ò no_fold_literal±)�p""" no-  -  ñ = "[" *dtext "]"Ó""" M £ = NoFoldL] ¤!ifîµ i  <craise rk`ParseE„
o�"expectedž óbut found '{}'".formatÕ ~ z n/['„ ,2'['â�e start oà 
6 ç   "§ K’[£-† #ì 2ºÒ*Õ‚ ; K ·c #orÆ]X.]X?endVY]V4endTY!O[_cmsg_idWi�"""msg-idÌðCFWS] "<" id-left '@' Áright  ">" [% ”    ( ±= dot-atom-Œc/ obs-F - I . 6à / obs-id-righ2t
  ñno-fold-literal = "[" *dtext "]"( """ ñmsg_id = MsgID() Âif value and
 ñ[0] in CFWS_LEADER:*  r btoken,( Á = get_cfws(C Q  ' j �.append(5  cif not@ "or	  q f!= '<'i ð
raise errors.HeaderParseE (�  m ó"expected msg-id but found '{}'".format¤ ˆ 
¡ Vò Terminal('<', 'L ‚-start')6 æ # =¶ 11:]ˆ !# š ‘ id-left. 6tryÍ 
6�dot_atom_ª› 9 oexceptú T a  c# obs-… ò is same as local-part of add-spec§  9   ¢  Aobs_; _; £  1   Etdefectsî´‚Obsolete¼D$ 
¸ C #"o' > z{"u '  , : / >@dot-“-“8 orPA 0  "geJ
@d
Invalidc"K€ with noeXright\ð# Even though there>. @, if J « b# endsa à`>` let's just( ‘se it too^greturn; Ralong< Bthe I™›W== '>" † &pÏ>Ï4endÍ 8   Õ  °  V3_id¿¾ o 
@o ôaddress-at-symbolv n C D_¢ê ß0no_b_bš e´ U	Õ     x  ldomaino  -   ‚2{# G 	z€ , ê 
å  0 ˆ 3 Œð, no-fold-literal ÿor obs-id-right"
   ñ" but found '{}'".format(value))5 òmsg_id.append(token 1if ( B and
 ±[0] == '>':;  s # =! 11:] Felse$ c tdefectsk ñerrors.InvalidHeaderD# (D  ^   à"missing trail	 ï'>' on msg-id"È Vâ ò Terminal('>', '0 S-end'4 ã æin CFWS_LEADERÇ ,ê ³ = get_cfwsN´ î QQretur· 3_idH ó


def parse_message_idT | 3""" 0-id‚  =   "M/ S-ID:"Q CRLFŠ """: c_id = 2 2ID(ã2tryc  V ß  Ë � W  ) S Ë; S sexcept ÝÖPÞ Eïk as ext L´unstructure s  3 = 2Í    sP  ' £ N ª €" Ve: {!r}>3ex)@
ç!# va afterÓ ­a1 idK  …õ should be None.’ ‹ ¤ kË ¾ T  B   º"UnexpectedÊ ½ Í 3  Wð_id

#
# XXX: As I begin to add ‘itional h¼ò ð ers, I'm realizówe probably
# have two level oüñ r routines: the]ðXXX methods that 1 a îR in
#* qrammar,§H9  ó  an entire fielÔp.  So
#\ ó_address_list above ¯ Î  ly¶aç _š ,Òß .  
#)  Ó9.
#ì³ime_versionaû“""" mime- @ = [�”] 1*digit 4"." 
 
ÎT# The) Àis implicit Ëò he RFC 2045 BNF�óDThis–ó is a bit verbose,ì P fact�Aut aE3intN  Ì é  ƒCIMEV÷ 2`if not&u4 .ü³M�RequiredƒA# P MIMEÁ  tó number (eg: 1.0)"Ô 1
„ T¥ 	&-\ G  † À          miú0me_version.defects.append(errors.HeaderMissingRequiredValue(
   ó "Expected MIME Y ñ number but found only CFWS"))E ±digits = '' pwhile vf B and
 ª[0] != '.' anot inP �_LEADER:E  œ Y %+=C  ^  11:] 0if P 8 1.is	 &()R /mi3rInvalid:DV
,(_major.Ñ{!r}".format(� #s)8 ã 	‘ ¼ ƒTerminal4 “, 'xtext'< Oelse× ‘ E= inq o ¬ p "if„
½¹ctoken,2 ±= get_cfws(¶5Ž ; # Î5  d RHÿ 9if H!is7Non*w 8 H ¹"Incomplete3;)Œ E1 = QÆ   	Ç  ; ireturn	÷S c'.', 'ð¤-separatorûr  k  	âW8þ¡­uK çmE 7Œ inÓ¾e7`‘ 7�À  mime_versiñon.append(token)
    if value:   ômime_version.defects9 ñerrors.InvalidHeaderD# (@  D ó"Excess non-CFWS text after MIME ` "")†  4 	x © V› ‘Terminal(© @, 'xN '; xreturn > ²

def get_i© ¢_parameterD )î ð""" Read everything up to the n³ Q';'.
Û ñ This is outside# óformal grammar.  The Ps   TnÁList that isP ¸ õ ed acts like a 5 @, bu0 óe data attributes are None— 1"""O ê - =Š (mRwhileöB and
 ¢[0] != ';' ’  æin PHRASE_ENDS$ ( f/¿ A[0],±  9  ô'misplaced-specialE # =Ï 51:]g 7elsà 0 ,+ ! =+cphrase ;  - [ß F TÎ + d ’t¼f F1""" Ñ = <matches _ _ "r>‚ÁWe allow anyZQTOKEN�A in 3 8Cadd ºÎ¬ '{ l”¡if we findT F á characters.  x €so regisÂ@ 1for)Q*any*>  printablesT�n though,ñRFC doesn't excludÏ 0 of mqbecause’ oì  Š`spirit*  E K5322ý‘m = _non_æ D_end;j§ ‚if not mw Úcraise ÕÎ`ParseEçÒ‚expectedhŸÁfound '{}'".to K“= m.group~
§Alen(( )° : = ; 1, ' '_ _„Aate_G ê Ž. ‚ �©  ‚  @ = [®A] 1*<   Ü €‘equivalen’( !is•�US-ASCII@sçóept space, ctls, 3tÅ`?tab?
ý� pimpliesF ¾ ›i| iñ plicit about it)che BNFG Am<" =¯­
(!ini r_LEADERD OB pVCcfwslš ' j E n ém ¼À     "expectòed token but found '{}'".format(value))
   ) !,  ´ = get_ttex% $ mN �.append( = #if9 2and
 ñ[0] in CFWS_LEADER:C k Ccfws� ' n rreturn   ³ Q

def¶ Gattr¹ w 4""" ñ = 1*(any non-ATTRIBUTE_ENDS character)
ˆ ŸWe allow 0 4in X ,fñadd defects to theH ,%'s ñ list if we find‹ I … As.  ‚ ±so registerO b ‘for *any*A ðprintables even though„ ñ RFC doesn't excludÙ 1 ofP Ñthem, because• oö Ñthe spirit ofE R5322.1"""= �m = _non_Á øibute_end_matcherÖ‚if not m” ð
raise errors.HeaderParseE (_  '   •"expectedrq×O{!r}× ”  ² = m.group(³é T[len(+ 1):]y  @ = V)…Terminal) 4, '$ 'U °_validate_xu *  ¸4 º@4'P""" [HD] 1*<  ‰ÀThis version¨ ¶‘BNF makesÿ ? ° explicit, ¦€as usualî õaô # tê  ` N 0act+ !ru` %  1The�equivalen+L ¬ i… ÝR, witŸ@subtxÁ ‚'*', "'"ª A'%'.Q RWe in¼0tab_ œ ÏÐd set just asÕ "do¿  ² š i©q = Attr ËBq <
› 	4"}# ¾ ÏÌ  7Ò  ‡%q 	Y” Z�extended£Ë U“ plus '%'&�ðis a special parsing routine s at˜Rget a%Q thatÛØ°s % escapesÆ a E `le strN `(whichE @decoÃt Binglgð string later).
�
    """ ñm = _non_extended_attribute_end_matcher(value)3 ‘if not m:  M ð
raise errors.HeaderParseE ('  + ¤"expected q  q ótext but found {!r}".format{ | , ¢= m.group(   1 =  T[len(+ 1):]‚  @ = VÍ …Terminal) 4, '” -- '^ °_validate_xª 3  ereturnÈ ,… Ÿ

def get[ Ô BÔ""" [CFWS] 1*‚ ‡ l  
Ä ôThis is like the non-3 ñ version except we allow % characters, so thatP ò
we can pick up an encodedÃ ò as a single string.‰ ?Ð# XXX: shouldr @haveH EOAN± TokenList?{  bg5 = % Í$if€ nŠ p[0] in &r_LEADER< StY u! =rCcfwsdm  ' q �.append(8 Âq öEXTENDED_ATTRIBUTE_ENDS} û"z ïO'{}'ï) 
Û î!è ä "UEéÈ 
ssectionÁ T ¢'*' digitsmAThe Pl BNF Ðmore complicaMðbecause leading 0s artqed.  WePcheckQ ñ and add a defect) ° also assumF y y Q¡ed betweenP  ˆ ³  I   » �, though§0RFC>  7ñcrystal clear on… .I  è dcallerQ�already V¥dealt withç  »’UC = S_ã   2 ora Wb!= '*'~ (Ò$"EÀi ¶´Ð  N  � )£ R  
¦c'*', '# ƒ-marker'9 E ý1ñ¨ !orµ a[0].is§/()ù 'anumberÇLì 3  "ß)‘ Ç ’ as = ''@Rwhile©¦, ½ < +0õ “ ðvalue = value[1:ó]
    if digits[0] == '0' and ! ! :+  / ðsection.defects.append(errors.InvalidHeaderE (:  >   "C ò number has an i; Ñ leading 0"))< / ./ b= int(³ 
! ‹ ÓValueTerminal) 2, '2 'U sreturn \ 0, v5 ±


def get_ ( )ý à""" quoted-str¢ Á/ attribute
ª 1""" Av = † (¡ bif notd M  craise 92RParse7’"Expected7 ò but found end of … "b  5‘er = None„ "if9  Öæin CFWS_LEADER‚ 6 ý ! =ù Ccfwsø H ¼ 8  þ  ò"only {}".format(« ½Ü  ²&"'Ô ZtokenÓ ¶_1Ü Oelse: 
•extended_é? !if­Qer isá }P  [:V" [À rv5¬ Á�vº ‰“parameterz `  �” # [Ç�] ["*"] [îR] "="ž1The ® ñimplied by the RFCa êñmade explicit in! ¡BNF.  Thiss@ fB    � G �BNF from3  T 1is O ato con+ Ewith  1BNFP °through som| ðtra checks.  We do it this way because ¢makes bothIN �recoveryÇ@work­x `result pnÑ tree easier.? Æ@# It,spossibl=áwould also be °citly allowSRetwee7˜W #�  ''W-Ã¡' marker (! Q*') ,’Òwe've never sW #atP œ wi‘  nd we will^ refore ign  T Æ Rilityç YE = PaŠ•‡§ „€ @ Ê í2 or‚ † ª;ªA H Dek%("ª  Mjtains P¡"name ({})<"no} EÛ )E �vŠ ó Ü a*· 2try„ A   V > 1ø/ *   l .! ‚ed = Tru³    # Î^ š  bexceptí,s.6
™ 2pas¯ 9 —Àvalue:
       ð
raise errors.HeaderParseE ò
("Incomplete parameter")
< õ  if value[0] == '*':  $ 4 �.append(V* ñ	Terminal('*', 'extended-*  ^ –-marker')f  J g # =o ?1:]h  M q = True" ¢ W!= '=¢ ü Pñ ð not followed byF · á =á ! Ø  se %toÛ Ó l„j = NonÃ C and ö0] in CFWS_LEADERwbtoken,( Á = get_cfws(n T Œ m¹ 4  ˜remainder‚ ÁBto =ZE w  
ª  "wñ4# Now for some serious hackery to handle the common invalid case of�  õ# double quotes around an – ù ò.  We also accept (with defectû P a;‡õd as encoded that isn't really.‡ ˜qstring, ? {— "d_ „ainner_  3 = D ., Bpped c @semi ’id = Fals µ "if—Ð.section_numbÂ6= 0* u  ± Æ:"'"6  : 	 ^    Nelse4 W #stŠ—attrtext(v } J   qif restF 	 ˜ 	 0 œ ˜ ?try© >_²  exPU Epass¾ § �   !if_ è D  ! Þ 6if  
= šÞsçæILíD(©  v  "QQ d Ž#ng ´s Ú4 is "¶‡ ?(á
ð S tÍ 
Ç  Š Qif t.KQ_typehRbare-\-¢ ` 5  Št[:] = [/ ™ Øt % Ybreak ®Á  áÐ Y   ¤)¢®RP but á 2arsTàve a "
         ð"quoted string value that is non-encoded"))
4 #if$ 2and
 ±[0] == "'":"  & Átoken = None Kelse ,? q = get_y ( i ónot param.extended or ösection_number > 0_ 0if ; M  2 	  § !§  « ’appendto.	 (» ƒ     Âif remaindertÚ r  &   fassert~ ä     ’ & =W 	" breturné B tdefects´ ñerrors.InvalidHeaderD# (Y ô"Apparent initial-Y-’ ú but attribute "=  waÄt marked as >  e Z  ¡8”8p# Assumràe charset/langg@miss” jAthe š    ° .¡ +Mj Šrequired‹ ¤delimitersÍ  Ç/84 
ø  A æ
+&ifø  AH @for Ñ( 
d  h  B .<P_type¬'¹-í^text'8  < Ubreake  tK B 	' 
R¯ñQ = t.ÐC fµcraise ÷ðP=E	p("ExpecÖqRFC2231ÐXÏ V
Ý Û  " , #ófound {!r}".formatºæ VYó Terminal("'", 'ž -^ 'e Š " =%M[1:] ' 'öBh¯± U  s ´ ? Ó  # ¹¢=qº % € 1 ÏTÇÅ^Ø€# Treat êerest owzs bare ·vcontentAv = s(ÀÀwhile value:'
  ùif value[0] in WSP:   + btoken,( ± = get_fws(8 ). (elP o== '"'P @ = Vy úTerminal('"', 'DQUOTE'W  … n " =† K[1:]y /sei 
¹ �qcontent¾ ‘v.append(ñ ƒ   { s (elk  
c ª ` V /to_  ÷if remainder is not NonÌ aassert Y l ‹ G  Äreturn param2 @
def �se_mime_ DeterËA0"""&  am h *( "; !)
a €That BNFµ ñ+meant to indicate this routine should only be called afterK f7 ð	ng and handling the lead °';'.  Thereo Áno correspon  qrule inM  8 ðformal RFC grammar, but it? ñmore convenient for us  = aset ofL ! Ý €be treat¼ °s its own TTList. isf u'parse'pbecause„ �consumesä · æ Þ© € w8Wnever9 toŸðse a full header.  Insteadc $isg!toK Ž  J 0ythn ‚ Enon-ê _ô of a specific MIMEg æ 1"""W H€ = MimePv >"s(ERwhile[ d ¹6try   K­g˜ O ,   } ^  & ñ except errors.H-PœE 0 as 
‰  xAer =Šè  I   Þêin CFWS_LEADERB  , F 
Ð c8&ifáJ é a b q  ü6 È  ¦;¦ !if�˜n   k Š¡ / tdefects7 «rInvalid²D# (Å  z   "&Á entry with &ë*")$
Á B   É i‚ )† < +¼  [ ‚[:0] = [
¾ % 5‹ *   . CÀderDefect(
   ô"invalid parameter {!r}".format(token)))
; Âif value and
 µ[0] != ';':&  . �# Junk afU Ðthe otherwise8 s Û.  Mark it asD   P, but! °will have aG 9ue.1 Ç � = mime_  Ô ^s[-1]( .Þ “_type = 'k -7 '3 - ,u s = get_2 i (. O s.extendP	X « À.defects.app2 ‚errors.I¨qHeaderD# (G  k "l  ò c with   ï trailing textáÍ`Must bwú';' at this pointƒÐ È V6õ Terminal(';', '¯ 0-se Gtor'l Ó Q" =w2[1:ÇlreturnæË

def _find_† yClistÂ)à ð"""Do our best to >  ¯ ‘ us in anNaMIME h‰
ƒ1""" AwhilÝE ;âin PHRASE_ENDS–  ù   s µ 
Eÿ[0], 'misplaced-specialH e Oelsew  (êophraseß¤  bif not¼c ½2, á &@ ]parseý)R1:]))$' qcontent_Ñâ ­ �""" main!q"/" sub g*( ";"4)	6The1  !Asubs2 Aare ­ ðs.  Theoreticallylqy couldðbe checked again– =0ffiØ` IANA 3Q + x-T !we@ Ãdon't do thaš c‹ 2= Cø RType(©ârecover = FalsI ½D ¤�ñ MissingRequired³
«"#  � ˜ ¹—fication"0 z ã 2try¡ ¿ã­ Ê1 sexcept K§ P*E]L c Ý �•"Expected× < ¼Zfound|´ ]»– �¯ ø ' )ð)
    # XXX: If ðBwe really want to follow the formal grammar we should make
    # mantype and subt ñ%specialized TokenLists here.  Probably not worth it.O !if ‘value or 	 ±[0] != '/':%  x ñctype.defects.append(errors.InvalidHeaderD# (9  = "" ` conteö eype"))% "ifz p  7 ñ_find_mime_parameters(Š ,0 B qreturn  W 
 B.mai.0= t.á ò .strip().lower(F 1 Ú Vó Terminal('/', '½ -
0-se“ Ctor'Ç Y " =˜ A[1:]† 6tryÔ ‚ º q = get_ (< † sexcept ZS`ParseElL ® �%…Expected‘Iñbut found {!r}".‘t¡ ê ›4jü Ô ‹ ²½
]×;×6POnly ›@ are …id after^ 2 , \" B  "kñ# The RFC requires that a syntacticOi†u §µ be treatedy ð # as text/plain gerhapso²postel this¸ ŠpMP o"do—  ifH Ñwere checkingÛ×ìÒ against IANAŠ 2delÂ¸, > u 0€ê;êÓç¤< p™¡â  0	‘@
def33se_Pá_disposition_hDpÔG""" # Ø`*( ";"I 1 )
"""b 1 M B = CwDi ôB= ò˜‚MissingR—dJù# •É " ù#y Î >Fi â ²é ÔD U ÈìÝÀ".format(valsue)))
  ö_find_mime_parameters(disp_header, value2 wreturn # M  Ò.append(token9  €content_ ¡osition = - .l ò .strip().lower(B bif not� :r  Â � "if) ¦[0] != ';'3  w Ü „.defects± ñ errors.InvalidH D# (r  v f"Only 0@ areq “id after ã %ã z, but "H ñfound {!r}".format(¢UVÛõ Terminal(';', '× 0-se Ctor'1;ä]parse@Å C[1:]9 § @
defC3se_.ó_transfer_encoding§Ãá""" mechanism
O"""Wò# We should probably—aate th¤’ues, sinc álist is fixed.O 3ctey B = C­T› Eš •
A aZñ MissingRequiredŒh# P" ""a –e~ Î 2try9 # eÒq = get_ b1 sexcept « PæEL h æ G�Expectedà 5&Oelse˜ ¤ã F ¹ ?cte{-N >Cwhilh“ r%«Extra textc
æin PHRASE_ENDS� 4ŽÐô0], 'misplaced-special H   ,   =y ue  
¨  š
�hphrase‘ )   j°? Ùýb

#
# À@ folQ   ýðcomplex, with lots of rules anŸ rnÖÀases.  The
#S ñlowing code does its best to obeyuH Rhandlx coS @
# cU áyou can be sur( !re\¡few bugs:)Â  Th²ð older generally; €onicaliz¸  Ž 0 goïÐpreferring thòe stringified
# version of each token.  The ðs contain informat/ ôthat supports the
# folder, including whiS ós can be encoded in °ways.
#
# FA òd text is accumulat. Ða simple list° É Ás ('lines'),Ã `
# one!  `should{ 0les¬ àan policy.max_< ð_length ('maxlen')‘ ð
def _steal_trailing_WSP_if_exists(= ñs):
    wsp = '' 1if  B and
 J[-1]  bin WSPB F <      Q    & =T Q[:-1]# `returnˆ 
»  re“Æ_parse_tree( C, *,À B"""RB Y B û@ents < êd¡!oréáto RFC rules.
Ž 1""" ,# f00/N¡ðmeans no limit, ie:cÑinitely long.B ”# =¯ ¶`or sys Asize3 e ‚Ä= 'utf-8' if@ òutf8 else 'us-asciiµ`b = [''R last_ew = ² Z òwrap_as_ew_blocked = 0 Gant_z DFals� d1 ‘not_allow5 îTerminal('', 'X !')V  pab ñ'stÀ awhile # C   . 9 b.pop(0-  C !ar_,en• C  + ’ Q -= 1•        2inuæ   `tstr =d ¬ ty .`°_type == 'pí'@set(? Ê) & SPECIALS’ 1# E= Ì * šòs special characters; “   w›(Tr´ *ryh  \ .É!e( 6ingÊ  P  h Rset =Ï5ing except Uniè± ZErrord ðif any(isinstance(x, e( ÷s.UndecodableBytesDefecL ‚  Pfor xL õa.all_d- •'  µ Ò'unknown-8bitü" !  
ª   :# I?@is fßc this c`reallyjÅtaken from a I   3# '‹ Ð' property onF£4 1  aÐ	" ß
óz°mime-parame0'õ Q# MimZ  ó Q0(us €RFC2231)¨Textraƒ
x_� k  †K s,Â,Elen,Ii9onta:if î  aNnot ¯Ò À     if not ûpart.as_ew_allowed:
  ýwant_encoding = False& Þlast_ew = Non 1if l þ syntactic_breakn  } m 0ed_2 " =9 Âfold(policy= s)[:-len ­.linesep)]›  S  € = ( ˆ not in l Ž  ? ð# It fits on a single s n  3 0if ž ` Á) > maxlen -  A os[-1]){  L Q# But² `on thi‡ ÿe, so start a new one.�  G 0newr ð = _steal_trailing_WSP_if_exists(% /s)K 
Ù# XXX what ifE± has no lea1OFWS?K 
n ƒ.append(£ } .  39 +=x d ~continu”‚# EitherRi¶  Kemajor © ©m�we don'tk  # %2 it ¤ ð  by itself even&iCo, or iE adoesn'& I $. ± ÿway, fall through’  �to unpack¶pthe subQ³s and wrapp m6!ifj€hasattr(4 2, 'È'©  '=úTerminal, do each piece individuallyo  ™ d �s = listq 1) +÷sÙ Nelse)€ 5a t|  Þ  Žaí &ù  word, possiblyZ  … €# combinùit with previouslyF sÏ1Î _¶_`a(tstr,3#s,#, + ,�  ‘   (B.ew_© e´š, charset7 ”¹µ ¬ C) <=¨ ® ïÆ “ ; 	Î d 0# TÂ Ì ð  is too long tob¡.  The RFCT0s u# …& a6?# "©!s"«tunless ²s considì  #u  be: D0eckÙý llŽ  ‡ <Anext¼×ø1if µ.4Ý ik Í  $ â1cXª! ¿è!orE.%sÑð_fws():
          ðlines.append(new “ + tstr)
$  ílast_ew = None vcontinu ùif not hasattr(part, 'encode'):A a# It's0 ða terminal, try folding the subG )s.= 1new q = listj 
¿ ‹  & ê.as_ew_allowed†  ë Rwrap_$ Éblocked += 1q  ( u >0endX 4not\ 
ƒ  | Ds = 8 1 +  	Y D & 
µ A and+¬ 
Ð  Vñ doesn't need CTE ‚‚ing, but ùe it anyway so we canš  # m : it{ � ±s.insert(0,Ó 
ø Twant_s W = Tr# Iô 1# W€ ñ't figure out how to† P, it,¨ vgive up“ Ãð= _steal_trailing_WSP_if_exists(ès¨  ý!orÄ û.startswith_fws(¯@ úu 8Lelse�Ú 0olduAontoÛPnext X – either..×  '  Ps[-1]� ¡Ÿáreturn policy.$ sep.joinä  g	 p

def _Vç2(to !e,€ ³s, maxlen, òÄ, ew_combineÝ“, charset@"""FÓ 1str­T   iá ™ 3 asn‚d word, T  0 3if ’ö RØ  ôÖnew value for“ !or‡? ifž  ± is False.
' Ifd re ©already anŽ 0 in$ a 1 of ñ s (indicated byP `a non-› )Ÿ2 | €true, de n M ” $ew� } � ö1re-LPe.  O'Swise,É N 1 S.  InM0 ca' VsplitS  ‘�necessarøFthat— ©ð d segments fit ” #in!]1"""z !if= #iË! · ± q = str(L  ò  òget_unstructuredÖ [� :]±o)Õt * !ne=#[:7 ]g &if0[0]6WSPœ  ‹@'re Q ¢@this† þˆRd texŽ dog ^  Á #PA leaÄRblankâ   i_wsp =Š @  2[1:À  E cif (leð ð C) ==¢� ' Ð    lines.appóend(_steal_trailing_WSP_if_exists(lines))
   À[-1] += lead3 1wsp! D �wsp = '' Áif to_encode: qin WSP:  W ô# Likewise for the J u space.+  _b 	X % n ' =z A:-1]# Ànew_last_ew Ä nå  › T) if  Äis None else 
B Ì 0_aså `utf-8'9 òcharset == 'us-ascii'?  ? ð# The RFC2047 chrome takes up  Ñaracters plusalength~ A# of U C nam#L C_lenÚ ª R) + 7 Gif () æ+ 1) >= maxlen– ra‘àerrors.HeaderPà E (Š  ½  P"max_ z ògth is too small to fit an Ž ‚d word")Ž Vwhile§€ Pemain_ ¢ X - le´‹ Ttext_- r? -i £ 2  ›5 F<= 0€  Ù  Ô Ps.app)6' '  ‚continueÉ   �_ã 
ž ‡ 0 . B_ew. (J #, ì= 6_as‹ Pexces‹   dR K) - ú w; >ø s# Sincef0unkÅ[  Ü guaranteed  Ý`into l‡ �than 100² Æ,v  ô ð# shrinking it by eñat a time shouldn'tV long  A 
eö [é -   ¹ ? = f#I j!D ] 2‹ Ñ Ì [Î Ú 6):]k »èµþ	’ 	° p xreturn F òif ew_combine_allowed÷ @ð

def _fold_mime_parameßq(part, r ,�,&Bing)× ð"""Fold TokenList '7 !' t -'A 0' l 0as f  f .5 Usr 0  de‹d0 'of+ À and values,Œ0matpm accorì1 to H pRFC rul, Qinclu  ug  Ý5231Ì   3 \ ¡ cannot beK áexpressed in '"@ing'Œ /Í +A ` ‚J @withD Ë'ù 1""" ð# Special case for ü+RFC2231 encoding: start from decoded values and use
    # : Â iff needed.#  ñ Note that the 1G °2s being ada !to ôlength calculations arq paccount6 1for1 ’possibly-x S spac© psemicolC €we'll bem 8ingž  I Rname,ä ñ in part.params:Â ï PXXX WÅ ñif this ';' puts us over maxlen˜ �first timù Prough N òloop?  We should spli!cheader� àonto a newlineŸ IWcase,O €but to dGQat we‰  €recogniz‰  ñearlier or repars N ‚ °, so I'm gos€to ignor- qat bug =pow.  Itb@only7 usN °one charactu 2ver� Wpif not Ü ös[-1].rstrip().endswith(';')ˆ 5 . 0 +=†l  f Uset =Î ðerror_handler = 'h 5ct'! :tryf ô.!e( Eing)0  ‰  ó _required = Fal"" �xcept UniIEd eE‹ 
l I 2Truù H   ñ
if utils._has_surrogates(ª $ 1 Ç'unknown-8biô  %   ] fescape&. :lse¿   m Ftf-84 %if�)
@ ÿ 1ed_É � = urllib„™se.quote(x p , ±, safe='', Ä !s= è
®0tstúò"{}*={}''{}".format(Ã ,¯ � E eù S 0'{}R 
N ¸ s_string£K uif len(Ê1) +  Q   31 <O
*1 & =5� + ' ' + > 	) co/H#elz  +  i O2 <=j †.append(_ Ã  …` #Ò ŒÑ multiple secÉ.î°are allowedž4mixn ½ c# non-C  , è we5n't™[  �1  kmf h… E = 0d áextra_chrome =£ =e+ "''"& Rwhile�
‹9 _ò=¼ E S ÙCstr(t ) 3àt 
K#if‡ ‘\ :+ 3x  xgAroomˆ [0leaÃp blank,` trail¿ð ,
             û-   # and at least one character of the value.  If we don't
  ñ# have that, we'd be stuck, so in ÿ case fall back toI   s ýRFC standard width.* ¹maxlen = 78 ðsplitpoint = maxÐ s  0 ’- chrome_ 2< ¹while True:  î ’partial =&[:i ]- �encoded_<ý = urllib.parse.quote(4 e ñ, safe='', errors= �_handler)< yif len(w 6) <Ð  o ]breakM Ù Y -= 1  þlines.append(" {}*{}*={}{}".formatÙ òname, section, extra_†*, ³ 
Ú * Y = ''‹ Q , +¤ u [Î :¨"ifÊå @[-1]\ ð%';'
# Copyright (C) 2002-2007 Python Software Foundaé 5 ñntact: email-sig@p0  .org

"""E � address @ing <ð+.

Lifted directly from rfc822.py.  This should eventually{ rewritten.f Ñ

__all__ = [DÂ'mktime_tz',  | ]edate % º!  ]

import J `, cale±p

SPACE°à '
EMPTYSTRING u'
COMMA" €, '

# P0 a € Ð field
_month; ½À['jan', 'feb 0mar !ap 0may !ju# 3jul£  ã @'aug$ 0sep 0oct 0nov ?dec2  ajanuarZ Dfebr Pmarch6 Papril	  e OjulyO  Qaugusv �septembe¼ Cocto 5nov 2dec v]

_day	!moæ !tum 0wedt 0thu 0fri "sah @un']_1The¥zà@tablÇÐes not includ»¡e military-  . °s defined
#ÅÐRFC822, otherÓÀn Z.  Accordº±to RFC1123,<pdescripP in
# �822 gets! ±signs wrong*ñ
we can't rely on any such” "
#–  . I  g   recommendP ¡at numeric/  Â ° indicators#usÌ Qsteadã1ime) c@.

_Ð   yÒ{'UT':0, 'UTC	 #GM Z >eÐ   'AST': -404 !AD 3 Ð # Atlantic (‡  QjCanadaöB  'EE 58 "'EE R ¬ # Easternx C3 63 C3 @ ð # Central
              'ñ MST': -700, 'MD 6 Ù # Mountain
  "'P4 8' "'P4 û 700   # Pacific3 ñ}


def parsedate_tz(data):* Ð"""Convert a   ñ
 string to a time tuple.
/ 0Acc› ás for military' azones.% 1""" ~res = _{  ¢if not resŠ  ê Rreturö  if ¸[9] is None& s 1= 0I 5 § R(res)ò x  C ó ñ ±to extendedÊ J ñ ðThe last (additional) element› 2the6  ñ offset in seconds, except if­ / . pwas spe¸ðed as -0000.  In that case 3 ƒ v K  ñ.  This indicates a UTC’ RstampH öexplicitly declaims knowledge o› RsourcÑ  ¢ ,• Poppos +¢ _ ~ 1theœ H € really ñ 3UTC\(
 –¢úR     =£‘a.split() =  bhappen¦òwhitespace-only input©h  # ó‘FWS after~Wcomma °day-of-week"opñ , so search andŸ �# adjust13thi#!ifÊ õ[0].endswith(',') or plower()Mx_daynam+¨ 0re'ò á here. Skip it  â 4delT  7elsMiU ‹ Qrfindˆ )  = –if i >= 0š   Ž6[0]< a[i+1:]7 bif leneð == 3: # RFC 850‰ €e, depre°% R VstuffP ä2'-'ç # Y * )Z q      • 1 =     +k /a[• 4Ð  ¥ ; "[3À  K  "s.+ƒ iz &-1@ 0 ³ ?i >> 3:?Ö[s[:i], s[i:]€ 
¤ b  ¢ .×ñd('') # Dummy tz & V) < 5Ÿ  .*  # h":5s ð[dd, mm, yy, tm, tz�  + 4 ƒmm = mm.“ Qif mmÃ›in _month£U : I, dd>  Ó B  & À Œ p ç.index(mm) + 1› F> 12„mm -= 12! `dd[-1]Ì6',''  ddRd[:-1 
#yy:×9! =>$yyf )yyf À        yy =ð yy[:-1]
    if not Ñ0].isdigit():    ñ yy, tz = tz, yy öif tm[-1] == ','.  tm* m_  ´.split(':')B plen(tm)C 2A ¡[thh, tmm]I -  ‡ ‘tss = '0' Welif A 3A  W, tssF 4 À1 and '.' inÏ &0]E ñ# Some non-compliant MUAs use4 ñto separate time elements.¡ ³ $0]þ .þ   
Á     
0g Ø  / K   Felseö   ±return Noneb 
"  6try? ²yy = int(yyå P #dd &dd 3thh 7thh m2 B 7tmm û "ss öexcept ValueError† £ ñ# Check for a yy specifiedø1wo-ó   ðmat, then convert it to  # appropriöKfour< “according6 ó	 POSIX standard. RFC 822N Pcallsy E a t‰  q1but, ñ2822 (which obsoletes 28220# m^   3a 4‘ ðyy. For more information, seeÐ P docu°  „ ” #thÐbmoduleÎ if9V< 100iñ# The year is between 1969Yò1999 (inclusive)J  N F> 68M   –yy += 190Üd A2000d O2068d 
·^  ; ê ¦tzoffset =ìçr.upper(_ ëz*_æVzones¶ E  2[tzZ
„ 	+ ‘ = Üzq   ß  ApassÅ   ¡ Ì "==÷tz.startswith('-'Ï 3 z è3# CôaÐ ê  W  Ô îóconds ; -0500 -> -180­†  7 < ;… •sign = -1Ì  v 4= -© ! 
S/ G F 6  Az T* ( ( Ö//100)*3600 +   %ßB)*60ˆà# Daylight SavÔTç@flagð ;ðto -1, since DST runknownîŒ[Ó`mm, dd`à�q, 0, 1,G   ó]


def parsedate(dataÃ:"""¨@ str�  toE ¢ ‘tuple."""6 áðparsedate_tz(datña)
    if isinstance(t, tuple):  ! Áreturn t[:9] Nelse ó


def mktime_tz(dataG @"""TD Qa 10-` B as Y áed by parsedat: ð ) into a POSIX Q ‘stamp."""‚ 0if ^ §[9] is Non� ð	# No zone info, so localF  . ñbetter assumption than GMT[ ò Bime.Ð Í Â[:8] + (-1,)<

Ðt = calendar.o !gm8 , Y $ -À 6–quote(str1ñPrepare string to be used in a 2 d !.
¼  dòs backslash and double/ ² charactersbE Ñpairs.  TheseJ  y ˆthe only6 “that need� A ninside–  ô ÐDoes not add T €surroundÖ ž !s.{ ä á ö.replace('\\', '\\\\') " ð"')


class AddrlistC ¬0""" 2essm"r + Ôby Ben EscotoIpo under0d wõ Cthis2 àdoes, it helps
0havþ ñcopy of RFC 2822 inÓ Pfront 3youb gNote: U �interface¤¡deprecatedÄ0mayýRremov  Hbfuture5óUse email.utils.ê PList Ü2ead)  ^”  ¬ó__init__(self, field� ºÀ"""Initializß 1newM  )Ç  ' `8 '¸ Ran unË ïrmbheader] Á, containing†  @  «tor more5 e   ²      ¨ õ.specials = '()<>@,:;.\"[]'S (  po# 0 0LWS8 ; \t.  CR K\r\n F2 R  = !+  *CRX patomendr   ¥ 0 ;  ¬ te�t5Anow ? €fies `.',ð obs-phrase, meaA7 %it‰ #ƒöobsolete syntax. Y ‚requires9 �we recognÝ6 L @ @�allow dot7 ‡ ¢ñ  ©.©'9 >" =!€  pcommentÉR = []æ º�gotonextº
³€Skip whipP 0extù R sJ V&wsb     Rwhileë HQ< lenm .° s  . "if+  [¼ @pos]ª þb'\n\r'Ž 6  >  5?in 7  ? » w.append  „ nð        self.posw += 1
  ñelif self.field[ Épos] == '(':.  9 " ñcommentlist.append( 3get 9()); NelseM Ubreak( ðreturn EMPTYSTRING.join(wsi !)
) °def getaddr x )Z Ð"""Parse all % besses.<  À Re @s a ? ± containing2 hof the9  4   1"""€   µresult = [] RwhileK‘pos < len� Z£  B Bad =- Ì Jess(2Vif adÙ  6   | U+= ad}   b/ ¥w('', ''œt' &b –  Ù¾ a (Dnext-." 5 .h	, @goto@ (Ù Ä 0old=5posâ Toldcl4Y ! pg \ €etphrase a  z  u    . ÖW  — />=Õ¥# Bad emai{õ	 technically, no domain.`  } 1if ¾ í — b(SPACEÉ "),D R[0])]È [ àkin '.@á#¾ ¡is just anæIspecº ù # this isn't very efficient since we start over< Â  W"= ÷ à  & )cl%  à ” L  M
àIW I )*:'¼#/ es‰ a groupº 
� ± µ‹Mlen p	D AÖŒ s L ’   %< ¡ 2andÆ >;P l  ù¸ " 
 	4 +ƒ ý ³R ¸<£ e# Addr¸D ‚n a rout	‡  3† | È HÚ
: % Ü 8= [­'©) + ' (' +ˆ  :  ð' '.join(self.co÷mmentlist) + ')', routeaddr)]
  Yelse:   `returnA ð = [(SPACE.join(p )P ? M 1if 2 c vself.coÄ ,D =[0]½ 1if / afield[ rpos] in Žspecials€ , e += 1
Ã  ¥gotonext() i ¡pos < len(* x R) andp  ˆ j== ','~ 9  H z  o  s   e” udef get¿w )Q ¢"""Parse aã äaess (RÄÒ-path value).S  n óThis method just skips all theK QstuffÜ – s  a  W.5""" (	[!= '<	V • Rexpecë … = FalseX 5 ®  adBU = ''B Rwhile¦ }ÅT !7if � 
    z ‡etdomain)    > Í   l+ 4>+ 2 s  » 	8    Ubreakí   eb 
@b 
Ò 6Tružo :o I b Ö
4get‹ # -0 JJ¥ | ¬”~  < “¡n RFC 2822—-7.#as¨"[][  ç  O .‹     Áípreserve_ws = ®}	.¬ 3if ­  ì3not ·[-1].strip( ¯  7 O.pop§  ¦append('.'r@ Ê
ç 
4 B "ê  “ Ñ"%s"' % quote~B.get *))¯ m �atomend� a.Àpop()
        ebreak
 ‰   else:   ùaslist.append(self.getatom()). Rws = ! Šotonext(! ÿif preserve_ws and wsr Ews)
g "ifa ¢pos >= len’ ’field) or  [‹ ºpos] != '@'j ò	return EMPTYSTRING.join(ð t  6'@'Õ b U += 1¥  gedomain$"et %rif not  
¯ “# Invalid #, Á óan empty address instead of# Uing až  Ôð# local part to denote failed Ysing.3 n /  	J# +³ ÇUdef gü  ,)ê ó"""Get the complete= Ô name from anì E."""‡  sd©U = [] Rwhile 3<2z  ^?"inC :LWS1  5  Â .] 	  /elQ [== '(� 2 L pcommentÍ u 3get yi [i ,_ xliterale .e  ,ì 	ƒ ''.W  Ô Í 2 ñ# bpo-34155: Don'tÊAõs with two `@` like' ?   ú# `a@malicious.org@important.com` 3 ý	V Ç U J?end ¢ùÍ X Ä© ¦> ð�relimiteðð, beginchar, end	 ƒs, allow’js=TrueÉðParse a header fragØ$ d] À by special T racters.' \`x A' is st³. A for ^ ¡I+ 9  TAlook	t@ $@ance%f EthenÀ ¦¬ ?… p1str&0 `® sa sequee -@ableA- � Ë s»  :  Ñstops when on¬ PtheseÓ ·encountered1AIf `j —Š Ànon-zero, emóbedded RFC 2822 comments are allowed
  ðwithin the parsed frag0 .$ 5""" áif self.field[ õpos] != beginchar:.  e ¥return ''
 Åslist = [''] Õquote = False b U += 1 Rwhile‰ ¡pos < len(+ ˜ )‚ 1if ] 
  œ ‰ w.append@ Ø )s  /   J §   /el`in ends„   O Æ 	â  Q   Ybreak… g ÇÙ"ndþ ¾  == '('t   �	ø 3getO .()õ €continue’   P# havMð ready advanced Ç Vfrom O ¼ ¨ª /\\«  p6Tru „ OelseÚ 
Ý Œ  ¶ }¬ ´ñEMPTYSTRING.join(0)É0defç   <v‚"""Get ax‡-delimit] & ~ 1's ¢ .f€    E.get@ Â('"', '"\r',)
� Ã 9 � ¿parenthesis• 9(• )•  §
” ßdomainliteral) Pw6 an±2 -3 ‚'[%s]' %ö
"[� ]� K
Ž Aatom…  ,  šends=None.”  - .ù }…OptionalE ð specifies a diffejp set ofþt token Ë%rsm(}ódefault is to usÞ w  ¤ €).  This  u¦ue.g. inE �getphraseÚ’() since    ñings must not include÷¥`.' (whichM ³is legal inC )s)‡ —  i Ä&if0is Y
£ 9  Ð " =» ZÛ ì�%in‰ 
�  ½TL �  æ 	)­¹O*a 
£µ y ©š` sequeãðof RFC 2822 phraseSs.

  ó4A phrase is a sequence of words, which are in turn either RFC 2822
J ñ atoms or quoted-strings.  Pc sF õcanonicalized by squeezing all˜ @runs†  continuousŠ `tespac‹ qto one  .6 5""" ¦plist = []î ñwhile self.pos < len( ufield):>  Õ "if+  [' @pos]	 :FWS1  5   ] I+= 1O /elQ n== '"'L Ã r.append§ 1get^?())\ (\  ¨ pcomment*g  i "in.PNendsÑ [break¹ .se( ù  `c &))Ý!reŸ< ð

class AddressList(  ê C ëX"""An& À encapsulate 1  ˆeparsedõ" aY 4es.tÁdef __init__§ !, 9j  	‚ .- "if? 
¶| › =u0get   (,el]@   À 3len¿ ¸ Z- k 0essn €= 3add= 0, o%D µ# Set unionä 0newK ( =‚V(NoneÄ $ .) t  õ  5[:]V Pfor x¥ƒ 9 
Lbif not+ 
*  ¼ˆ  3x® *- œi¯, in-placeÑ Ló Î  * Ë ?subç`differJÅ ì
º r ¹äº2ð ¿+·ý  Ò " Ž.remove(‰ * »À def __getitóem__(self, index):
  b# Make õing, slices, and 'in' work/ preturn L Ñ.addresslist[W ð]
"""Policy frame; ñ4 for the email package.

Allows fine grained feature control of how? 9 q parsesŸ °emits data.z ó

import abc
froms  oheader   chS ct as _ & s.utils E ñ_has_surrogates

__all__ = [%' "', „Compat32 c ²]


class _8 aBase:
< LÆObject basicY.' RThis D Ñis useless un 1sub ted.  A    should de~n ' ð attributes with! QaultsÅñ
any values that are to beA ¡managed by¯Ï ! o» Q.  ThÖÐstructor will) 0n aC pnon-defr i  ` A set‚ Xthese¥ ¢at instanc… Ócreation timev ! s ðbe callable, taking‡ bse samE ókeyword argument ; Za new„ �identical ù p %ed% d excepÑ 4oseì qchangedF€ C.  Iñ ðs may be added, yield” 1newD ù Ì ¿b ) § ’right han‚ @operaoverriY  th®  in1B lef.  * o ‘"s,š bÏA + B == A(<}  bof B>)/  "@reprõ&an/0canæ @usedRRreconGˆ bñ fqonly if Q  á ¼P E å , c2"""£ ´def __init_PG**kwO@"""C„e·, possibly MEsome`i  23SeeÏ`docstrÒ C a i E  ÃC  °  K    ; Rname,f× in kw.items(¸  + `if hasþ, 8 $  ( gsuper(±,p).__set? 0__(; s )W 9    elá 
  ùraise TypeError(3 ) p"{!r} iüœ invalid !'¯{}".formatI  Q ¡  ¹ 1.__ýP__.__ 3__)“ð Dð@argsöP "{}=š t  D ü  x ¡ "  ‘† ddict__œ% ]o i E({})h 7 ½ ð, ', '.join(args))
ñ
    def clone(self, **kw):   õ-"""Return a new instance with specified attributes changed.
E :The= Æhas the same; ƒ values  õ current object,N ¡except forD o °s passed in@ ÷keyword argumentsŽ 5"""L Ànewpolicy =  ñ.__class__.__new__ );  €  ö ,·  y B ×dict__.items(L PÍ `.__set> 5__(„ ,P i 
/kw^  if not has\ » U †  Š õraise TypeError(Ù    ü"{!r} is an invalid \Š¯{}".formatI  Q  ” ,g fame__)ñ  , ( r¨O€ àn ¤d, nameií+if; ' ;bmsg = ¥ ¶ü .–read-onlyjFelsej  ã J   +noQ D ³Ak¸4msgz Ü « Â[ï ())3addÜw, otherç â"""Non-defaultßòs from right operand override those" Gleftm û'  £sM!ofË1sub~@ ­A A³!**¼ 2.__tA)


ññappend_doc(doc, adde ç ñdoc = doc.rsplit('\n', 1)[0]	1 & == ., 1, ˜  T  + I & +4 ‘ 3ext‘ ³strings(cls� i‚sÅ Poc__ Z%cl p.startspC('+'4  A% G = _ô  ¤bases__[0]\ ",  di q Ç ç( Æ# Å!ifŸR ®  Ù ¯  ³  n ce !(c7 £   t   1s__ &   g.mro()÷  H    p2= gH( cî@, '_ 2__'é  3   ifü
� Í WK4ttrí Z  F QbreakFacls


Û! Po"(_ ¡Base, meta â=abc.ABCMeta):°Ár"""Controls how messag,Àre interpretˆ nd% EmattƒSMost cÀclasses and ñmany of the methods in ú*email package accept
    Policy objects as parameters.  A! ð  contains a setm ¡values andP áfunctions that0 ð rol how input i” �terpreted8  3out ‘rendered.P ÁFor example,Ê Ÿ ô 'raise_on_defect'n ñs whether or not an RFCP Pviola¡ p resultŽ    Áerror being X d= ñ
, while 'max_line_length'O  0rolî ¢e maximum !  Ö  7 • €n a Mess…°is serializí O ðAny valid attributV ð y be overriddenÞ  I »pis creaM¡by passingN  itÐña keyword argument toKÎconstructor.
Ñre immutable,P œbut a new an¢ † Ðwith only cer. Ó  $¡changed byO @callo ¯Ì �nstance D ¸  ‘) °1canL @also„ Ðadded, produc] ° iC1ich¢non-defauly Ÿt@ñ right hand oper ó	verwrite those specified4 ˜ Dleft2 !.
 1SetTã"s: xÐ Ÿ¢ -- If truÿ"n ì€s shouldô 7 dëÅs9>  Dë s: False“  )ep. `-- strC ä0ain  «ñ C0useu  se“ Sß 	E  ˆbetween 3.  � S '\n'� †cte_type<  T ¡of allowedìÌòransfer encodingsM?  A7bitP QASCII§· 	8/ “Content-To #-Eo !: $ $isš  
ð 5  ` ¸ aEpdisposiP? ofœ 	q(RFC in0Ð) binary data�°headers; se¡eI 	1docAP S_foldM \/--ý Vp, exclu™! ' 2ep'O:  !duv• p.  None“°0 means no O Ø 	Pwrapp·wis donepUis 78Ñ ¤ngle_from_� ‘-- a flagÇ ñen True escapes F/  ƒ C/thc
7bod› ®0utt¡ Pa `>'·@fronW× 	€them. ThJÐs used when tÿhe message is being
  ñserialized by a generator. Default: True.
F [ �_factoryX ð-- the class to use ¥create new‘ �objects.K <  !IfN AvaluÂ QNone, d�  × Mâ • 2"""ž ñraise_on_defect = Falseo álinesep = '\n' €cte_type B8bit @max_- Á_length = 78/ Émangle_from_[  = µ “ £def handle• Â(self, obj, § !):_  ñ"""Based on policy, either Ü 2 ó or call register\  J   
x r œ  $ ƒ À should be aø =1subÓñ, but in any case must+ n¹ ¤Exception 7  . ä  ­ ú × TwhichÐh { M Ö €ed if itE 2notCd.  $ï!is«.M á #is? ð  as an error, o\ wi² he±  ’ 8and¡ "arB /0pasŸ/to{°This methodº €intended!be¸móparsers that discoverâ$àThe email packØ9 aalwaysR  &Dwith½—instances ' Ä   0if ˆ.CŠ %  ‘ P7 
x(\ øÈžú‚Record '²'-W'obj'Ã BCall=	Ü '­ 
ý:.  ‘Ê qpart ofëPmr API so’ Ðeiõn implement customN ¶ ì1ingw e= D7 a% ½ ù„e append/%ofP  6T °s attribute¯ 3obj] Usq¾ 3 
*%byP >nFget Ët±Swill Y0hav† J Ž r*anÅ ¯r · J .õ ( )� 1pheader_‚Scount2Jname%aReturnºðmaximum allowed number)N  s ? 0d ' L rwhen a -  °#ad­#a gy %ed® §0Ÿ #, J@re a Plreadf¥  KO  É ¯ µ ` equal@  l rƒ ð, a ValueError is³ raised.

  ó8Because the default behavior of Message's __setitem__ is to append the
N ` value  P @listD °headers, it: @easy# Ðcreate duplic
 ( œ ó#without realizing it.  This method allows certain B  ^ ¥be limitedP !inç QnumbeÝ �instances¦ CthatA   Àmay be addedR aI ó programmatically.  (Thy  ë ñ not observed by uparser,M ðwhich will faithfully[ Ãduce as many™ s  exXÍ m N  be(d 6d.)è — àðimplementation returns None forUp u names.^ 5""" 7 6 g Ò@abc.abstract - 3defO �_source_Ÿ r(self,  qlines):0  L´"""Given a F# ðep terminated strings constitutü znÕP ƒa single‰ ,õ ‘(å ,»`) tupl�at shouldNstorIQmodel‘�e input ¤ 8 !re”Utheir¶  ¢ & %ep� 0cha33ersM ! ¤ passed in:àemail package Ÿ0cond J àsurrogateescapt¯inary dataÆ T NotIedErrorÔ 	ÓPÓ  ¡©_1 anD� ù vir/"ap5ionç xÆ	 ÍÀ K } ¸N 	Õ._fetch7Afrom¦µ 	ò lÆ  to©•° ë > Z ®Ý“is reques4%atJ œ‹e ‹=1 ifÔ èQwere $�a BytesP'µ ÁÞ – à e	 +þà ð4CfoldÄñ*âaÞ· ã A 9ÕÄ^ ¡ ð ing of the headCer
  ñ*according to the policy controls.  The value passed in by- UemailL ¢package ma@ ñain surrogateescaped binary data ifF §lines wereK rj óby a BytesParserŽ ƒreturned— ¡should not·  w 5anyL ƒ  | %.
  5""" ò
raise NotImplementedError/ ñ@abc.abstractmethod; ’def fold_Þ Â(self, name,¤ !):(  u�"""Givenû aheader* A and lAfrom rmodel, ô ?M  Ë õ  ÅK`ep cha£ ¤ers that iÏ S  «  . o€M � *M  —ñ
@_extend_docstrings
class Compat32(PÔ"):ÅA"""+§ ô This particularûi4Áe backward cG ‚ibility L Q.  ItE “replicate6 ‚ehavior \ Áversion 5.1.>  |	 pmangle_ö‚_ = True®  [¢_sanitize_£`
1# I× , €$s‘sT2a H‡Qusing�  ©#,Áunknown-8bitW0set,aencode# b¡B as  rd wordsá  I !ifœ±isinstance(ãW, str + ð# Assume it is alreadÍ Robjecy /   S ¼ …if _has_üst o < ] .) ,ì  =_Lõset.UNKNOWN8BIT,i  ‚  T _= )3 Felse = ‡ Ã (  öB €source_pù ìÑ Ø S  µ w  F; d¡`verythü upÆ ò1':'|† Öed unmodifiedÄ P    Q pdetermi‚ byÆ0ippT 1leaKÑwhitespace of�Õ  ˜ rnô!`first Ì `, joinH Òall subsequen °s together,­ P  ò} �any trailB PcarriŒÕ 1 orc AfeedÙoactersn 8¸7 = mö[0].split(':', 1Ô=m!.l– Ð(' \t') + ''.Û (K 61:]? ¦ (z #.rE v\r\n')):tor> À      The naóme and value are returned unmodified.
  5""" ) r (name,A !)
 ødef header_fetch_parse(self, / :/  \ E"""+ bIf theS ð contains binary data, it is ñ verted into a Hv u objectP QusingS ð unknown-8bit ch— Ót.  OtherwiseX Û  Ú ²._sanitize_ü OfoldÑ sš :  ” Î     á õalgorithm, which preserves
Pexist, áline breaks in,öwraps each resul3  to, P @max_K ø_length.  Non-ASCII°¿ ˜CTE encodÄ J šO + ž u ý j$, ‡W=True’ * _E€È°If cte_type"ù 7bit, non-ascii•eis CTEWœ ”. ¦õ original sourceO  „ ÿ used, with its „hand/orŸ .ý ÆOed =ÿ 0=='%')  FP .ý !('&÷', 'surrogateescape'I_4 Cz)Ø¥parts = []y  ñ.append('%s: ' %� ãif isinstance(š7strZ  …if _has_­ s, ' + ž    3h =µ.XK ,¸ )  M#=_	 Ï.UNKNOWN8BITD 3_"= t Oelse¿ ñ# If we have raw ã - àåa byte string,( no ideaã `# whatî¶ 6‘is.  Ther\ðno safe way to spli0 io·   #~  . ª Qit's m€-subset,j nš pcould dÏonormalŸ > v `, but 5 W m±ð 7theS ïð the
             ô.# string.  There's no way to know so the least harm seems to
E  @# be< ‘not split> e ÿ and risk it being too long.M ÿparts.append(value)( ‰h = None Yelse:  ¨  + �header.H X ",  `_name= j I €# AssumeÈ Ris a K Ê-like objectÑ  v À � `if h int» 
ª #ŽV ð class interpretp L 1 of; ð for maxlinelen astj  ö ¥# default : 078,* úrecommended by RFC 2822¿ ] 9= 0Z Àif self.max_� o_lengtÛ  � 	P ? 	c 	�h.encode(m Asep=?  ,=e )Ì	L ; # ñ return ''.join(2 ó)


compat32 = C ÿ()
:mod:`email` Package Architecture
= Ã

Overview
- a

The V # pU €consists÷Àthree major ˜ �onents:
8QModel
  l#An’ êu“ À that repres8 3 anl �message,ª¶provides anN !PIoñ creating, query
  ÞPmodif 3 a M .– eParserI 0TakZ � sequenceÖ ðcharacters or byt" �nd produc   mÜ  , &thî(o Ø Òothose [  ˜ ŽGenerato› l  Ö  sí_nto aµ Më ã chPither% Ñw ¿`human ãöumption (a printablê 0uniý ËFing)'1sui* ��transmissH @over– wire.  IÍØðatter case all data˜’properly oAd us° he¦ Qtent g fÔ+ Äings specifi‚ e relevantañs.

Conceptuallyž æiüáganized around  �YŸòboth
"external" API/^0useÝqapplica_‡programsØ �library,
ó"ŸP  @×0J“±.
This diviŽiš  „ ü Áa bit fuzzy;é ´API describ?²is
document½  tâll a public, sý1API#  1owsðan application
withð: special needs to implement its own parser and/or generator.

In addition; ðthe three major func õal components, there is a third key
! I ñ
architecture:

    Policy   âAn object thatÊ ðfies various behavioral settingsÆ … carriesI ó a® Ms ofC ó-controlling methods.

The– ð framework provideà s[ u `onveniY0wayæ S  
«  |  GÀlibrary, maks ð it possible for4  $  K òbe used in a
very flex. ðashion while leveragS  g ðcommon code requiredP óÁ,
represent,Ã ûãe message-like„°s.  For exaA,‹ dô
default :rfc:`5322` emailQ ! pâó, we also have a çñmanages
HTTP headersm # fê  K£liant withn ó2616`.  IndividualV 
‡¡s, such as]°maximum lin6@ngthÙ�duced by$ qor, can² C
be Q l�n ló3mee©Ñalized applicx� | \]tModel
- r  m  If 8 œ ‘:class:`~a.3 ".Mº!`  .d G © µ, Q intoè 0twoÌ dac  9°arts discusvQ
RFC:0 –1 seþ; mpbody.  4`ˆ Â@acts{±a
pseudo-di= 0aryTnamedî Æ€ " �interface£| ÖoRaccesÜý¤ sË ] `.  HowT, allk ¡ are kept
c Qnallym`n orde.plist, s*aŠ‚e informÔBabou 0  Ì Dthe
~ !in1vorigina1is zCrvedg3! g’`payload`#0holÌ3he s&A " 0can¥1one� w¹  Ð: data, or a Õ   u  æ À`latter{ wE
to +ô a multipart MIMEÝ�.  Lists,pbe nestórbitrarily deeply
i^ ŠX  C›,Ú ©Aterm;`leaves2 Ý@non-Å 
Õ  Vz¦ Lifecycle^
fÞ4l l)  aÎ 3 is–1CreìO,A 7ó c+ ¤1a PWq#it" D ‘instantia# ·e empty 0by s?.$zManipul’  ³jÀn may examinóe one or more headers, and/or the
  qpayload ï it may modifyC B > Cthe B q.  ThisA Abe d� nl õ top level `Message`B pobject,¬ ²on any sub- !.
' ÁFinalization  » ñThe Model is converted into a unicodåbinary stream,@  ë C ñ discarded.



H2ÿ Policy Control During Lifecycle
- 0

O�fPmajor±  R Bs ex¸ !by q !is Ômanagement ofÆ"
d†  {O$ l” á.  Most applic4s�ó't need to be aware of
this.

A^ c enter~ ^nñ	f two ways: via a ParserºPby beøset to
a specific value by an” Ñ program afte’Îõalready exists.
Similarly, a¥ ?xit¤ “  ri?ûed by
a Generatoº óretrieved from a� ¹ ï#e
±° Õ ñvides hooks for all four o s0 thH0.

Åmgqstorage3 ¯ ÙQa lisþb(name,Op) tuple¹ B ‰� identifi ¿#s +rparsingäQpasse>m ñ :meth:`~email.põ.Ú .� €_source_J 0e` 0 #odÓ &Qresul² Dthat* ÑÅ   „ 0be  ¿ù `.

Whe9 suâ&esk(vðexample, throughV 
.¯Ð`__setitem__`;perface)7  e q ð < x 5@ H
‚;?tor:
á, which
return› *9Û+( qšP dict‡ r 
i sæ:s	 /
_fetchQ	 IRobtaiEk $È €ç0ã‡ requestú "se!ðj Eare
ì Õ  Õ 	OfoldÞa‹ ,0conÝ   Ãline breaks ï óappropriate placesa† Àcy.cte_type`ñP Policy control determines whether or
not Content Transfer Encoding is performed on the data in ñheader.  There is
also a :meth:`~email.pŠ .‘ à.binary_fold` ( òod for use by generators
that produce 7 ñ output, which returns�  Q 2ed ” 4 as2 ó data,
possibly ' �at differú PplaceF !anK ‘corresponð	string would be.


Handl BÍ  Data
-  ò

In an ideal world all messageNZ ¡conform to„  RFCs, meanh Áthe
parser c� adecode/ Q #in@ r �ized uni' # L Asendòiginally wrote.  Irµ ,e ÏP pack¼ Qmust ñpbe
able» è qith badotrmattedó �s, inclu[“ s¦ aië ñ
non-ASCII character›At ei·àhave no indica[ )   set or ar" xt
validH ¹; ’.

Since é ž  O ñ*primarily* text»€, and op²tions onè   
: 9 8 . q(exceptÿà°payloads ofåBrse)|Ámodel
storesC…  ìä¬qs.  Un-™] @insi0@ext
 áhË ed{"uskòe `surrogateescape` error - r� Athe §
]€c.  As wù  q qfilenam\eD Pwas iœ ßRd to
^  ï iã  owùŽw¡to "carry"”j Ï ±received
du³ - Ó ±along until4 E£ stage, atNptime it#reˆÂed
in its or' ®�m.

This ‰ i>† ½ Ñmost entirelyÐmplementation� ;Q one
„ › I„  vi²#e ´0APIš  à"internal" API~" P —"
dEÈ Ü$of!HinpuÏ0pasx " ì0to
Ò´appropriate[½ÿ ‘ › @faceÔZ A GÙ¤
to access­ãvalues preserv.¼ pd` byteÜPAll o
k CAvertá6@backpoF  &,aa safeÕA
(loiŠ©àin some cases)ýÿBackward Compatibilityÿ --(�e :classG 432`X�provides ´  j (
cj f@versI45.1�Ðemail packageð$.  It does this via the
following implementation of  ò8 four+1 Policy methods described above:

header_source_parse
    SplitsK Áirst line on 0col
 ro obtai ñ
name, discards any spacesO Vafter<  , and join× ´e remainder¿ n ƒwith all I *  ø  #  s, preserv 1the§ ùsep characters t¨ avalue.L PTrail9 pcarriagˆ @turn� 1/orL HfeedM ðare stripped fromÕ N `resultO c & 6ng.c8torb Rel   = v  ; ÷exactly as receivl q applicí] Wfetch¿IO 0con§•ñ`surrogateescaped` binary data, r—  Ö � Ü àas a :class:`~­"l.:!.HAÀ` object, us ‹ƒA setG ó`unknown-8bit`.  Otherwise just| »  .
éd= OUses„ q's fold€ o  ¥ "s ¥H �same wayã Ë ò5.1 generator did.

_P 6 S6 aa °, but encod—øo 'ascii'.


New Algorithm
- 
m] ö legacy behaviorßs<Ž 1 
Ãis already a"¿ÿHs itŸ!, šžì2new# rÛG  $ ×  D Š•�ytes get '°ed into univ Iš  › mpoints: r  ¦  )a¬ úAspecÂ - p;0set s© =! b§  d`ð`® qset for« À``cte_type=7q` or `` #aM œ�At some ê  Ç÷re will also be a Z 3"``š foˆa‘ä  æB �serializeW A ide dx@mess)›rRFC-lik1 D °ing, conver4o2Î gŸ Ö_glyph�  ? Ó]£ ÂÑtÆBbackË: �­ûÀ`.
    ReturðFns bytes.

    At some point there will also be a ``cte_type=unicode``, and for that
J òpolicy binary_foldI �serialize^ ðd message according to :rfc:``5335``.
# Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield
N ðntact: email-sig@pyI ð.org

"""Base64 conteÁransfer enco¥ ñper RFCs 2045-2047.

This module handlesä G ðmethod defined inU T 2
ton ñ
e arbitrary 8-bit data us,hF3ree Ê G `four 7/ ²
charactersQ  8 ’known as é ².

It is us† ñthe MIME standardsÜ0 ¡ñattach images, audio,Rtext
� H³ „ P setsB ø w7ðprovides an interface0 zec ðdecode both headÚ ó and bodies
withØ ñ a.

RFCYmCs a ~‘for incluÚ	« € informaR WBan
`Š qd-word' † 2.  Ë Õ²is commonlyX h ñreal names
in To:, From:, Cc:, etc. ­ \@s we€ps Subje¸1lin±o q±does not dou $ ` wrappño¼Qd-of- å àconversion
nec�!ryì0proå…nµdí as; it Ý z Edumbo §
§0ing0o dó › \�various � ¥ @issuO usÖeŸ.ã!
mç .žÑ

__all__ = [¶a'body_r 7e', ­ 
!  dstring" m _7  clength* ¢]


from b+¢import b64<  „inascii  22a_1 S, a2b ñ

CRLF = '\r\n'
NL àn'
EMPTYSTRING ‚'

# See�óCharset.py
MISC_LEN = 7



# Helpers
def³_Á (%qarray):*’"""Return8æ   of s whençi;eÃ#thô A."""A ÷groups_of_3, leftover = divmod(lent A, 3)6 2# 4zA outseT3 Ð(or nonzero fÁ!io¡ ‘reof) in.E Gn =  A * 4 %if‰ å  ’Cn +=  rñ n-#½(ò *0s, .öset='iso-8859-1'<E  ’ ú“ÛŒ 3TgivenZ |h �  ¼ 8  K« P.  ItÛQaults6to ° (. Àding is defiñ	ned in RFC 2045.
    """ ñif not header_bytes:  % vreturn + ¸isinstance(2 f, str)8  ) =] ñ.encode(charset)l  rd = b64 	` A).de6 r"ascii"6 ž p'=?%s?b T=' % [ ", J òd)



def body_ ó
(s, maxlinelen=76, eol=NLÇ Qr"""E«   aÞ ñing with base64.
¹ PEach D ø will be wrapped at, at mosti  ø ñacters (defaults toN '76 )c $ofÒ R texts 2end˜ ·eol, which X ± "\n".  Setc 0thio â "\r\n" if youJ Pbe usç áthe result of 2 ñfunction directlyM ¿in an emailUJ: ±encvec = [] bmax_unš š‘ * 3 // 4( Pfor iÍñ range(0, len(s)cB Ä ÃÓ# BAW: should@ò () inherit b2a_Òð()'s dubious behavim nx J 0add Qa newõ0to -¸ ustring?2  enã c ps[i:i +y­ ]Þ s iòP.ends|€(NL) andªf != NLs / p  enc[:-1] +( � @vec.žind(encEðEMPTYSTRING.join! 6vec;�ã `A"""D˜c a raw.1, r>2Ys objectÙT‹Y1oesŠpÃ a full MIME?c valueÂôÜ ¾ð (like =?iso-8859-1?b?bmloISBuaWgh?=) -- pleasêe»AhighG SlevelÌ¿p class sTthat « _alityð ” ü (oWelif FP@9 4a2b�( =€'raw-uni”-escape')a -se‚ I  Øñ# For convenience[ðbackwards compatibið @ w/ ùDdardèqmodule
U2 = 	 
 ¶  ð!# Copyright (C) 2001-2007 Python Software Foundasð
# Author: Ben Gertzfield, Barry Warsaw
\ bntact:Æa-sig@pW Ð.org

__all__uò"'Cƒ"', ˜add_alias  ¯9set Codec r]

fromóools import partial

 %¬Jmime aquopri P / L gerrors rn �ð	_7or8bit



# Flags forõ types of header encodings
QP  ò= 1 # Quoted-Printable
BASE64& ð= 2 # Base64
SHORTEST ð= 3 # the shortern �QP and b/ ã, but only forŠ ñs

# In "=?charset?q?hello_world?=",V �=?, ?q?,Q ñ@?= add up to 7
RFC2047_CHROME_LEN = 7

DEFAULT_CHARSET = 'us-ascii'
UNKNOWN8BIT ð	nknown-8bit'
EMPTYSTRING ó'



# Defaults
R `S = {
ÿ p# input   g`  bodyq@ out# Aconv4 ð'iso-8859-1':  (QP,<    kNone),/ 2/ 3/ 4/ %# ½ Ò5 is Cyrillic ñnot especially usedÃ 6 66 AArab4 @lso 5 ¯particular7 77 áGreek, QP will9 Ámake it readµ Fo 88 oHebrew9 š9/ O10':É—  11˜ OThai– 1Ó01Ó/ 5Å ô 6/ ïwindows-1252':� 0vis¦:Ç×1 (6L  	 J0bigä ] " (á1  / Qgb231u 2 / `euc-jp9/  U g >@2022) – ‘shift_jis; g 8  ŠL :Î 8  	 g akoi8-rd )  / ý Tutf-8. $ (ô4,  / '# ` }ÒqAliasesé other commü-C nam  ö ac0±sets.  Map
ImÝ Q‘real onesIö in email.
ALIASE…p'latin_Na\? - 	_ä: )2':  	_‘: 3:  	_œ: 4:  	_Ã: 9: Ð5': 'iso-8859ù-9',
    'latin_6': 'iso-8859-10 - 
*_7< 3<  
*_8< 4<  
*_9< 5<  
W_10':ð 6<  @cp94X ô  'ks_c_5601-1987? øeuc_jp':  'euc-jp %kr $kr Pascii R 'us- šð}


# Map charsets to their Unicode  ò	c strings.
CODEC_MAP = {ßagb2312a  î2euc 4_cnƒ Dbig5! 0  ' 3_tw ô)# Hack: We don't want *any* conversion for stuff marked Í �, as allŽ ð# sorts of garbage might be sentá Pus inç ` guise, U7-bitR .K ƒLet thatx øpass through without¢ tto/from;F t:FNone}P
# Cã ñnience functionsî ‘extending¬  above mappŠ“
def add_º( Ñ, header_enc=m W body doutput8 $ !):ñ a"""Addôacter set propertieñ global registry.
= €   i#Pe inp5harK ‘, and mus�ñthe canonical namˆaL 7 `  Op'alà P Þ  y ‚either CÍ0.QPGR õquoted-printable,% `BASE64) À base64 encov$ €SHORTEST& O  ½ €shortest?^qp or@ 0or ƒ 7 5 noY 4.  R N Ñis only valid- Äð	.  It describes how messÙ& sH  0bod¯äŠ Ï0are"beŽ Àed.  DefaultB!noJ |
< 1  
 û¯1  - ¡ should beZ Bin. óÖ`s willeQceed ?	± ,® Œ "thI ^  |  Ø 2wheÓemethodßA0t()­ Acallò RThe dö – ÝS 8s“ _ Û aÜBBothíR � K  õDhaveWBentr«‡  6�module's‡rset-to-„ûR; useûFodecù&  I)M o% i ¸ [ ð does not know about’!eegF "s , !'sK �documentaƒ¡0moräAform ìÐ"""
    if boódy_enc == SHORTEST:
  ôraise ValueError('$ ò not allowed for boI !')> ðCHARSETS[charset] = (headero ,0 “, output_) ñ)


def add_alias( Â, canonical)  �"""Add a 9 €acter se” Qias.
… : ‚ is the  ñname, e.g. latin-1* ] . 	U &'s~  B ƒiso-8859E 1"""M �ALIASES[r  ù ^ Ü `codec(g Qset,   [ Þ  ( – that mapí As inØ Qgiven  ÿ °to/from UniS 	g Ý KÍ < ofF&. ‘ 5  � ß / bPython& ñ, as appropriate sñsecond argument to² uœ (*Äbuilt-in, or"  en½ ’() method¢ Ó � string.Œ s˜CODEC_MAPp D c· ñ


# Convenience function¬ o 3ing[ `s, tak âinto account
#†ñ.they might be unknown-8bit (ie: have surrogate-escaped bytes)Û Bode(É üø"ifT �¨UNKNOWN8BI“Seturnª .º Åe('ascii', 'y x ŽBelse6 ÙrC - }’
class C¹7 H"""M~ ks®�ir email Tertie€RThis N pprovide¶Qforma|Qaboutprequire&Âs imposed onY ê d¡a specificðõ@.  Iú so„ h cí€routinesíM   rtãSbetweAQ 2s, W ÆÀavailabilityŠ1theE ¢applicable³Qs.  G�”ñ, it will do its besN &in`on how_2usev ÂŸ  ûa C óRFC-compliant wayþbCertai$D Qs musÃDñd with quoted-printÛ  ÛQase64c `when u�i€ Õs¾0bodý/  r J ƒ ç0utrO1, a-e\h  ä‚nstances†!isI �module ex5M fo˜ ÝUm›:)'in‚Ú: The initiali€²ed.  CommonXeŒ  ^  arpnvertedÏòtheir `official'à†6s (–_–K    M ÖN ±).  Default– 7-�1us-©}Àding: If theÿ" character set must be encoded before it can be
  ðused in an email header, this attribute will^  j /toL ôCharset.QP (for quoted-printable), # aBASE64' L bbase64Í …ing), or> �SHORTEST f ÿ the shortest ofO  QP@ v "ðing.  Otherwise,)å aNone.
J Tbody_1 “: Same as& ð, but describes ” 5 ¥ O ƒr message's m ð, which indeed maywàdifferent than` O ¼5.. 2àis not allowedœ I  ‰ Ý 
poutput_ušset: Someƒs„vconvert†Otheyˆ	‡„s³°bodies.  Ifö 7 in… ? is¾ a one o0 mÉacontaiH  nÓ. M ñ   	ã /toIM 7be ]Í ˜odec: TheŒ € Python Í!c  3to v  ` O †p to Uni? >n> %siW @0nec‘/ry;
Â _f Ã � Ç  º  A\ Ð Å 	 ´ O Ê @haveE  sþAvalu× w F •.N 1""" údef __init__(self,Žñ=DEFAULT_CHARSET):7  óñ# RFC 2046, $4.1.2 says?�sets are˜÷case sensitive.  We coerce v2# uÚp becausæ0s .Óør() is locale inL C‡argumentž  ë„lready a\ p, we le)Ait aztéPensur@ Z#Ñ  ƒ `ASCII,- V standard (
ÒXXX) requiresf '6try4  pif isin= 3ce(šW, strc /   	% .…¥e('ascii')ó  * Jelseo   	@   =f y N dexceptoZErrorY praise e #s.' 
[   †  Àarset.lower(3)
  ñ # Set the input charset after filtering through* ualiasesD Qself.? _? é= ALIASES.get( ,j + ‹ ðWe can try to guess which encodˆ àand conversion' `use by™ ‘ #Ç ð_map dictionary.  T\ óhat first, but l×user overrideM 5it. qhenc, b  ˆ ¢ = CHARSETë ,< s ö	(SHORTEST, BASE64, None)#aif not:W ‹ ~ & éðattributes, allowX �argumentsW Yw defauli uheader_œ = r $ Hbody"  :
" doutput : Ø ,ð `# Now ¥ µ ðcodecs.  If one isn't± Šined foroŽ#a R rPa UniN   Rc witï`same n $asM  u ê å   �ODEC_MAP! aˆ  =  B{ " |  a ? !)
ÁÐdef __repr__(' )“breturn= < y.lower(C #eqA , otherH  "trb ‚ == str(( M Iget_r7 ™ B"""Rœ <õ ntent-transfer-Ë#us= N ~.ú  ™ This is ei³ %!st*ñ`quoted-printable' or `base64' depenË!onH N  � 	| ,4  itb Qa funÂ3 inùcase you should callM 3 Æ”a single â,± õMessage object beingF �  ed3&heƒ q 0theß:"CoGTGE®M *0 it( ^�whateverá §ppropriatea§<s "OB" ifZ œ\Vis QP”@ y6 l:  |gOyFwise/ 5"""è oassertž 4!= Þ. È V== QP² O''K /elM ß à:
            óreturn 'base64'
  Uelse:   * ñ encode_7or8bit
# ödef get_output_charset(self)E B"""Rn Bthe ,  , ¢acter set.O  n €This is D ., X € if that ðnot None, otherwise i ˜  I A 'in˜ . 5""" ß / p o� 9lf.F «  ú rheader_õ Š, stringý H( -( # a$ à by converting½ éfirst to bytes¡e type of F  1 (ºð or quoted-printable) will be $ Ed onî t_ |xset's `Ä Ging`v c:param® p: A uni P for ÑC  .  It mustx …possiblex  ’"to¾ !e † +ð 0 us×  R    )'sE £ ‰ cÑ:ÆS: Thee d¨ ö, with RFC 2047 chrome; V * =}@odecf–'us-ascii-û _°5 = ,¥ )¿ p# 7bit/?¤ Rings º Jóunchanged (modulo(VsionsO 
1er_$ e¶ _� (  9 iF< !isM³ ¯™ • Å  b } .i  	w B 7i_lines=Ï, maxlengthsI>]`imilar|	²e()` exceptj Ž u1fitÆ  @into© Pimum Å  ³ � as givená @ xargumenå[š”\: Max÷ ð iterator.  Each eleõ 0 4<red from7 ²`provid ie nexta	K m1.  0£ eMpis used…4an { é�built-inY ( ™ ðand should neverÃ‘exhaustede e‹ ì5 	š  š@counBew ± ;ese2™re only aJ Rhint;@plitß Adoes @best46canËLU.eÀs, each withó RFC 2047 chrome.
  5""" ÷# See which encoding we should us8 òcodec = self.output_ Õor 'us-ascii'\ ñheader_bytes = _` ¡e(string, ; ).  „r_moduleg C_get9 (r(Q 9 º = partial(K .7  «, charset=€ ñ
# Calculate the number of1 ±acters that ]U willË  # contribuL ¨o each linL… ç  æ R (á ³xtra = len(½ 0) +à ß·_CHROME_LEN� €Now come³ ae hard¢.  We mustî"e ž0butöçcan't split onO & ¶ecause someð sets are variableª qgth andü I …bd wordˆ  st' ñ on its own.  Sodýproblem is you have toM 3 toÆ Àto figure ou§!ish #'s‘  , è  L è O &onÕ ‘s.  This ò cs two � �s: first,2 do2‡know howM �many octÒ specific sub  Y0uni…v HG getJ 31to,Rosecond~   t WASCIIS J Tthose•  ² j 	Ðd to.  UnlessÚ `try it1WseemsL  inefficien$ !In²€interestÝ  beKàcorrect rather@¹n fast (andO A 0hop~e"reebe few¨ ÏPs in dGsuchI Àmessage), brQforceÉ %:('  Œ “%[] €current_ 7 =  âmaxlen = next( �gths) - e›D 6fory   ë:!  �i q.appendÖbõ + Dthis‘ øEMPTYSTRING.join(H 
7 0len~=2S (V(e )O #if?2 > þ 
Ñ  ª #-lÚ £Í P does°fit so pop Y&ffŒ =   Î G.popÿ    °# Does nothZ U ow�a?k 6  if2  s?Hnot n Í  7  sŸJNone # Oelse= ðseparator = (' ' CPines 4 > ''M  Q  ×/edñ  =   Ðheader_bytes ð= _encode(joined_line,  Oc)
    ! ’s.append(< þ r(header_bytes)8 qcurrent] í = [character]c âmaxlen = next( Õgths) - extra2 ± ð  = EMPTYSTRING. (t ’ ©  ý ñ qreturn 3 
ª ƒdef _getgˆr(self, ˆ !):*  l0if   . _Öing == BASE64+  / o õemail.base64mimeO /elQ /QPM oquopriM ŠSHORTESTS Œlen64 = ¡ à jlength>½  á UlenqpA • A 2if … < *qp   c D $ Oelse: œ Á 6 l FNoneCbodygstring�"""Body-Be a " ° by convert%Áit first to Š.e  Â ÁThe type of F  1 (3ð or quoted-printable) will be $ Ed on× ¡µ ™ing.  If  @ is ç æ, we assume thšpoutput 	0set. ea 7bit� r, so reó  ­ `the de™d‹ )4 us! Rascii¾� producesx „ correct9WversiÔ #of& entent.a 5""" Tif noB 
Ø–1 , ë Ëâif isinstance(J ,¯  É     =  Ñe=.Y_Yù 8 § Žºz 8 C&  n<is A#F0pro6.. ue takes¶õ, but operates on it as if: ­ # 0werï@listº ÖÞðs.  For a (minimal) historyQ ;whyL @this{pso, seey0nge{ô0cf700464177.  To,"ly�&e t™  ]¿P set,:nè mu} Óit into pseudŽ@ via, š `latin1‘ rN Rwhich~ØA anyÐ % a ì!lek pointP òbetween 0 and 255, S ðis what body_encode içs expecting.
  ùif isinstance(string, str):(  3    =  I ùencode(self.output_charset)< 8 !de8 Š'latin1'- ôreturn email.quoprimime.body_r § 8 Jelse¯ × D.» _asciiº î ±
import bin,  Ø '
 zmessage ²errors
from Y ñ	

class ContentManager:
„Ádef __init__ªØ¹ñget_handlers = {}7 ï Øs    W Gadd_> ^ s, key, Q l 	t[key] =+ ®  S cË S ÷msg, *args, **kwW ) Ç_type = msg.@  ((9if 1 =in 
HŽ& [H -](¢ % EOmain�  
¡   � (D ™ 	_if ''e )/''_ 	 raise KeyEÁ(/)ì Cbð 0G	2 #s[- K ) z [ ©?objP-ifDMú() == 'multipart'*ñ # XXX: is this ¸õ a good idea or not?  We can remove it later,3 7q# but w* f't add) ` so do fT wÒzBType{" ‚ ¥ valid on Ë "#º å ÿ`_find_B  ë6obj3  udclear_l 6 
x	h  s,� , n mâfull_path_for_he= NoneB 0typÞ (A †.__mro__I  h3if )  p .é s)  - *  „]}  * @qnam� typ.__qual )__% 0mod û = getattr(typ, '__module__', 'eþ Ó = '.'.join((K !, y ð)) if modname else wqname
  ùif full_path_for_error is None:,  7 - =C 	0 \ þ in self.set_handlers_ _retur*  [x ]c Ô _ -E 
[  +� = typ.__ ,__{   z - D y !ifxU * ¸Q  raise KeyEØ(Gìò)


raw_data_manager = ContentM (& âdef get_text_c  a(msg, 5Âs='replace')Ú$ p = msg.; ñpayload(decode=True)Vycharset+ Sram(' ¢', 'ASCII'0 ÿ b .P (- ‘ ˜ )à P.add_� Š ('Ô -',ß ÷ =nonû é Ž æ 
Àfor maintypeàô'audio image video application'.split(a ¡Á Z Ã « Ç xmessageÁe }Æ 00)
¼ 5sub» ÿrfc822 external-body² '‰ 3/'+[ ¼    » ûand_fixup_unknown_-  ŽÍ ó# If we don't understand a 5  w ñwe are supposed to treat it as @# if Hwere¨€/octet-s0 cm, per/ ðtools.ietf.org/html/rfc2046#secäà-5.2.4.  Feedp `r does± ƒdo that,N àso do our best¡ ñfix things up.  Note3  ¦ €is *not*ª `ropria oM Tmodel“/partial KR as M#° objects, sŽ !ey&3dL hÐs well.  (Howž �reassembl”  emPÐout of scope Qéthis comment :×nbytes(‰)ÊÞ'; ´  T�À_prepare_set› ,Î,J0heai„Smsg['Iö-Type'] = '/'.join((µ‹)3if I H Á ó if not hasattr(  `[0], 'Dt ,   #mpLÀpolicy
       âheaders = [mp. ¦_factory(* âsource_parse([( B]))
F  Bfor % 3 in
 %s]. Etry:  = 0 
#  ' #ifL Ž.defects#  ' [raise* &[0  $   3msgË ƒ.name] =5 œ ñexcept email.errors.H3D� z as exc‡  `ValueE3 “("Invalid^ Õ: {}".format(k  ‘  Gò.fold(policy=msg. €))) from… ð


def _finalize_set(msg, disposition, fileî â, cid, params)Â (if, Å is None and7   1not 5  µ b ñ  = 'attachment'à X C  �¦'Content-D² '—` Q È ‘  #0set±Dam('- !',?  ³ 
 !   †=¡ 4 Âreplace=True* ifu² [_ !ID÷ 1cid° #if¨;  >`key, vt rÖs.items(Ýñ 
8 ð )


# XXX: Thisk ð6a cleaned-up version of base64mime.body_encode (including a bug
# fix� °the calcula† D "un6 ð&d_bytes_per_line).  It would be nice to
# drop both t   –mquopri‰ €in favorh ðenhanced binascii
# routines that acå�ed a max… r_lengthvReter.\³ _ l(data,4 n* dN _ö , =H ‘ // 4 * 3 ãiJÁrange(0, len� ?), U ‹  ù 2 ^0 = ¶ _[i:i+7 ª  6 	Å „.append(HD.b2a
_ @).de!('k'"ù return ''.join(W  w¸ ð_text(string, chqƒt, cte, ôw Î  Y+ .> (1 q).split$ (| Cep =G . : ² o ‘ �embedded_ã(. 3): Ë  "epÐ  A) + 	 %epC nälA Cb'\n6  ?  =  ) teƒ �ñ  ‘1# UÚðuristics to decide on fq"best" Aing.O  ; ð if max((len(x) ðfor x in lines), default=0) <= policy.max_! §_length:
  :try   ðreturn '7bit', normal_body(I ùs).decode('ascii')S  except Uni$ D* ^Errori Ipass< $if¶ àcte_type == '8‰ ? ¨  ¨ ÷, 'surrogateescape» ÷sniff = embeddedð V[:10]å * ð_qp = quoprimime.0_enô (" %©latin-1'),ì  j ½… Ábase64 = binŒR.b2a_ † 2 ò# This is a little unfair to qp; it includesRReps, M • doesn't.Ã bif lene g_qp) > 5 )³rcte = ' 'I Oelse) öquoted-printable3  7€ ‘ ï*10F  % "Qcte, •1_qpy 1if � =æ; odata =õ'elJ ˆJ —	] i �¿š–		® å¤ "£m $),¹Ê
.±raise Valuecñ("Unknown content transfer ›�ing {}".fÓbt(cte)W ) ó


def set_text_O °(msg, strin  ub£ð="plain", charset='utf-8',d_=Noneú²disposition' “ filename 2cid
 µ Ò	 bparams" r header zÂ_prepare_set» 'Î B', s» ,6 (¤payload = ­ 4 (õ ä Ü b, msg.B    5E (  Sram('J 'cemail." Ó.ALIASES.get( mVÅreplace=True| 2['C#-T -E°ping'] =­g‡_finaliz7©,¤r, cid, …`)
raw_;À_manager.addy€_handlerB,R)jzmessagem ³Àe="rfc822", ¿cte=None,
  ²disposition) ƒ filenam8 B cid B bparams$ r header !):3 òif subtype == 'partial'  • óraise ValueError("message/, ò is not supported for M% ¯ objects")n grfc822m aif cteO Ain (³ '7bit', '8 sbinary'Â  ¥   ð# http://tools.ietf.org/html/rfc2046#secMñ -5.2.1 mandate.œ  D   ñ 	  " À  	As do¸  È ò={}".format(cte) B  # Ì ð will get coerced on serializa¨ ð  if policy.cte_§=U.  Weš ó# may end up claimingd øhen it isn't needed, but the only negativO òresult of that should be a gateway  P Cs toÂ  
  ®™ 0havŒ ñ to look through} ó whole embedded X D ÷discover whetherP !orgáit actually haƒ ¶do anythingÒ O=; N  0is ZP else¨^ +elßexternal-body¤’-3’.	µ ™  =r  5pø4 says all futurp„sjprestricQ0to V±, so assume~æ % '· ó_prepare_set(msg, '_$',ñ,˜ómsg.set_payload([1 ] õ['Content-Transfer-Encoding'] =K@_finÃ~ É,Ä,¿,¦ð
ams)
raw_data_manager.addÀ ó _handler(email.— .b , µ  "_c¡ q)


def Tbytes  f `, mainR ‘�'base64'•Ê V“‘º¨  Éš5 ¿» ¥ ê P = _e¨"e_  (   àx_line_length=m)ma h "  j ÷quoted-printable!ð# XXX: quoprimime.Bƒ Ð won't encodeó newline characters in data,
  ð# so we can't use it.  This means max_G ÷_length is ignored.  AnotherO ðbug to fix later.  (Note: encoders.quopriI  broken on b u ends.)M  ª ð = binascii.b2a_qp( ô, istext=False, header íquotetabs=TrueQ  A 0.deŽ !('[ '$ üelif cte == '7bit':� < `in ('8= 0, '¼ Ory')H ó, 'surrogateescape— ñ msg.set_payload± ðmsg['Content-Transfer-Eiping'] =Ï Ä ð0_finalize_set(msg, disposition, filename, cid, params)
for typ Ö pbytes,  óarray, memoryviewâ @raw_#À_manager.addq à_handler(typ, Í  F 2s_c¼ ð#)
# Copyright (C) 2001-2006 Python Software Foundaµ ñ
# Author: Barry WarsawL ñntact: email-sig@pG ”.org

"""$€s and re¬`d funcZ ñs."""

__all__ = [D'ÃB_7orá	 rbase64'\+ Knoop ÿ ’]


from > s import,$b as _bz + A 
+ astring, +  ²



def _q #(sªrenc = _ - O(s, ;T# Mus” P spacPwhich0 Ipri.G `) doesP!do"`returnÕ ñ	.replace(b' ', b'=20')

¤ E _
 £« ¯óe the message's  ÕB|!.
o ðAlso, add an approOate *@.?  û porig = ~g~9Z0encót = str(«(? 9), a L  ýº (; Í''×3O(msg3ê¿d-printable=m¢9Š/.ä 9Ê
:1Setj/ è &@ or 5:0if í  
FNone%`# Therä$noçð.  For backwards compatibilityÄð use 7bit
      ó  msg['Content-Transfer-Encoding'] = '7bit'
  areturn ò# We play a trick to make this go fast.  If deS ó from ASCII succeeds,N ð
we know the data must be ‚ ñ, otherwise treat it as 8bit.A Atry:	  ª Qorig.u ¡e('ascii') öexcept UnicodeError6  q Oelse<  É °'



def eg²e_noop(msg)L ñN"""Do nothing."""
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry WarsawL ñntact: email-sig@pG ‘.org

""" ’ package 1±ion classes” !

 r MessagH!(E\6ionË BBase9 ` for epAs inå	i W CPars\ i _ mŽ ƒ parsingo 	Z nHeaderY  ^ e whileS h@ 
Bw!ry0 (ª Q ðCouldn't find terminatª bC 	¬ ùMultipartConversionc  R, Typ%º 1  ” JJ é is prohibitedn  ChntU Å  W ÂAn illegal c. £ was givenL €# These �‡pdefectsJ!chú  !er= @able¥ pwork ar.]D? \(Valuè _$a s ”   pó	__init__(self, line=Noneà  ' !if  &@not  –    …super().L  F Z @elf. ! =I '$No$%InÖØ 0 Œ E"""AÌ pclaimed%8be Í´but had no A ©bameterý §TStartƒ 1Not)r ë € !Th¹z s? c  ôqnever f¯ ¥³_Closei /A _  Y  , á  ‰ �correspon›  ci “ ì RFirstç`LineIsà1inuæ ô t Vda cont: Ð rPits fd   � òMisplacedEnvelope� { `'Unix- 'Z  i
2´middle of a$ [block  ýu ðBodySeparatorDefect(MessageDeð(fect):
    """Found line with no leading whitespace and ñcolon before blank: ñZ."""
# XXX: backward compatibility, just in case (it was never emitted).
MalformedHeaderDefect = MissingH ÃBodySeparato# ñ

class MultipartInvariantViolationDL ‚(Message 2A m ô claimed to be a mS @ but0subb €s were f? ƒ  z 5lidŠ ðContentTransferEnco]� � €n invaliG@ # tA # eB A§set on the© hitself• ÿUndecodableBytes~ HgÀ contained b4   that coultU  edþ
þ ŸBase64Padë b+ Ö ðed sequence had a@corrolengthl ŸCharacterÜ o 	cD 1 no­. �alphabet} L› UK ¾è ìã ¡ (1 mod 4)p ð# These errors are specific¥h­„parsing.
Ä“  ¦ ð“ss for a L d+@ &Ðdef __init__([Ó, *args, **kwE ) …super().- ' š !	¡  P 2""" 1 is�,¨Ògives details¬ 6 2âRequiredValue( g Aø ám¨0havüv6 ŠAnoneŽd €NonPrintQO \ WSCII Yqoutside²tascii-pI S rangRl  S| Enon_5 sÈ  , * ó)  
 : =  
.  3strún �return ("}`follow5Aò 6nonÙ  _ e#inj1: "^  Œ   ±"{}".format`.‹ $))<ˆObsoleteÉz# ó uses syntax declared oG Á by RFC 5322rÞÆ ŸLocalPartã
l& _2 °!n-C û a  í  Ðiº ˆð only occurs durBƒunicode Ó,þAwhen4# 
 K  0 Õd from binarynÀDateDefect(HñeaderDefect):
    """H ñn has unparsable or invalid date"""
# Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw[ ðntact: email-sig@pyV ò	.org

"""FeedParser - An) ` feed ¶ ˆer.

The   implementn Á interface fß !cr AallyC Sing aY ñ
message, line by q.  This-¡advantagesO ð certain applicaý ðs, such as
those reade ä  b ös off a socket.

é .Þ û() is the primaryÈ @pushU 0new«a o0 
ð  It returns when �re's not; ðmore it can do with$ ` avail�
data.  W> Áyou have no :   @ to Š ~ R ïñ call .close().
@ co™#teØ 0arsÂ  ¨  ð Droot&` objec äeother ‚P of t˜ò 0 atÓ ñwill never raise a™ �ing
excep¨².  Instead, Òit finds some#°unexpected,W  adds a 'deMP' to
² ecurrenµ 2.  n s Ájust instancû ‘at live o“ë 
ë B's ._ Às attribute.
æ

__all__ = ['/—', 'Bytes €]

imporc

from9 gerrors À._policybase@ ;  ¯Bat32' `collec9s! Rdeque $io ðStringIO

NLCRE = re.K òile(r'\r\n|\r|\n')" L_bol& (' )( e( %\Z* _crackT ñ# RFC 2822 $3.6.8 Oðal fields.  ftextXò%d33-57 / %d59-126, Any character
# Yð  controls, SP, Ýa":".
hp0^(Fžð|[\041-\071\073-\176]*:|[\t ]ðEMPTYSTRING = ''
NL ó\n'

NeedMoreData =4ð
()



class BufferedSubFˆl£A file-ish> B thaôfbloadedïi˜ O1YouE3als ÷ 1pop>Q-matcq@pred%pes ontoþDtackb1thežO/  B <$e   ¡ò, a false EOF responsE Ñ(i.e. empty s“QiÂ ûÛ6let–e@hereßa” sTP abstñ`ion --| D1til† óL « ó.J  T 5ódef __init__(selfŽ  0# Tybstreamç`e lastÆAtialYzË tú#is¼ð.
        # See ó,issue 22233 for why this is a text stream and not a list.
  õself._partial = StringIO(newline='')- ð# A deque of full, pushed + s( U  " =2 (F ‘The stackH üalse-EOF checking predicates© 2eof9 E= []p  ˜ qflag in8  D ðwhether the file has been closed ora  0= F— 
c 1defè Ð_eof_matcher(ä ,ª !):&  Q  .' ¥ €.append(Ï )K  op# 	J D {return K Gpop(D § „ : p# Don't
Ðget any trailâ •ô  v.seek(0©ƒ  á 5 sn +R.read )2 NP  @trunäq _Ü †d = True7q ˆ ö  ifÈ0’ � ”#if X 
  ! q%''Ç ÅNeedMoreData  Q# PopZ p A off õj¢see if it /s  wcurrentG feü $ó�\ =½   —s.popleft3ð0# RFC 2046, section 5.1.2 requires us to recognize outer level
ê   â# boundaries a<"  ¢ñinner nesting.  Doeö, but be sure it'A# inó PorderD @most‡ QleastL &edë  ¼Pateof8 �reversedéNó ² 1if 2 (    p# We'reÍ  j¡ EOF.  ButÐ¢ l�  D   b‘8fir J   š ' sÖˆ  þ )   Q  / Ñ)unÓ,EÊ Q# Let¤ ‚consumer¶  Ã"ne¯ 0int�†e bufferRaassertS   ûËÙ 
ªþ�g, data¥ ñ"""Push some new   — Ñis object."""M  s uawrite(V " qif '\n'Ø"inS  Á9'\r 
ÌA# Noƒ �completeþ as, waiV more# Œ ™”  @# CrÁ  ¯sä@servF J Íep character¥Û P  $s Ò  8ialI
#
H À  self._partóial.truncate()

  ó# If the last element o ðist does not end in a newline,8 wn treatP ðit as a partial + ñ.  We only check for '\n' here because a- L ô	ending with '\r' might b+ ð  that was splitŸ  Ì `middleÆ aM 0'\rr õsequence (see bugs 1555570 and 1721862).: !ifÿ  Ð  s[-1].ends“ (Â %):)  S`self._,  r`write( …s.pop())- ) @push s$ ˜Fdef   ) ,sl   !._< �.extend( C �__iter__(, ; preturn   p n__next-  U ! =- P.read (Æ !ifš j == ''
õraise StopIterationý ƒ  M ò



class FeedParserJ ð """A feed-styleR0ser×˜email."""Á 4iniÁ Ð, _factory=Noª÷*, policy=compat324"""/ ¢ is calledupno argu`s to cí ~ò new message objˆ  3Thek ñ keyword specifie†  3 2ect¿pcontrol Anumbâ *a=  tsõ  ÚpS's opT0.  s tdefault{ •maintainsI ’backward †ibility.¹  N Á    .1# =T J  Q_old_—;u= False( %if† W ‰Ø b   #if[ .JK >is /  3 Rfrom þ4 ’ import M�~  .   ® / =( Jelse› : ¬ q E { ß 3  f >try{ * (t =J  | > ó except TypeErro9   Ð# Assume thisˆTan olS	’  : q ä6Truã' ðinput = BufferedSubFilg K   ( Õmsgstack = []s  Ùi @„segen().™0 Qcur =% È qheaders†¬= #H ñ-public interface¤0sup^ …š8's H AflagD DGset_ yê ! 1 = OB  í6 j, data¤‘Push more  © o‚ l  j Àinput.push(dcata)
  ñself._call_parse()
 Hdef   ( !):  : 6try      .C     úexcept StopIteration8 Fpassr `close(L l @"""P› õ+ all remaining data and return the root message object."""·  Z ‚._input.l 

 Ã   W "= > Cpop_c (> £assert not' …msgstack| õ# Look for final set of defects( !ifÇ Ð.get_content_ô õtype() == 'multipart' \8  © !   †  ´ E.is_, (S , x ´ = errors.MU ÑInvariantViol³D£ î  @ âpolicy.handle_S ({ ,Ø "§  ñE_newN R ¥ #ifKü old_style_facto{Dmsg �! « Jelses0 È =‚ . ¹ ˆ 1cur_& I_cur¤ �/digest'� @.set/Qault_: 'T�/rfc822'€  S
N Ž  ö [-1].attach(msgF 
' .append#  æ U= msgZ; Rlast   " ' ¿eretvalš¡ G.popŸ]  Ý “  ` $._(  é ˆ  Œå- 9 ENone+ ‡ž ‰þ<gen~å# Create a new] y�start by <  “…headers.m † ä‘- U = []1 ‘# CollectÏ# €, searchc  ?ñ
a line that doesn't match5 7RFCO R2822 H @ or Q1inuÖð pattern (includ_ �an emptyb )É  w u #in•E
­!if7 ú is NeedMoreData%  ¯Yyield$ ²     © ¸  !ifaÏ 1RE.õ (˜ x )   ´# If we saw ”Cinedý /body separator„ p# (i.e.ød P, jusšðrow it away. Otherwis‘eL   ° ð ¨y `o pushJ Fbackm ¾   ï ?NLCì  . }ÐqissingH”ÀBodySeparato¿rDefect()
   òself.policy.handle_d0  b_cur,  A ð_input.unreadline( 1 Ybreakˆ ëheaders.append7 ó# Done with the -  , so parse õm and figure out what we'rej ð# supposed to see in< � body of …message.6 i _{ ( Û 2# HÃ Q-only— õ!ing is a backwards compatibility hack, which wasq P# nec† $ry¡ QolderV $er3 ÷	could raise errors.  AllH `remain‰  ‰sN §0 ar9˜rown intoý 2if ÷  ã :g  O_ I= [] ªwhile True/ 3 # =Y ’ .7X *   0if d  QÎNeedMoreDataW  - hyield ( 	–  #   vcontinu     m _== ''c Ã 9  £ Å  Eñcur.set_payload(EMPTYSTRING.joinþ*s)ereturnÇ ’ M @get_Ì °ent_type() º Éû/delivery-statusÑ /# (  S °ains blocks  Õ separated by”  â #ïAlank®ó.  We'll represent eachÁX   a#Q M 0nese ¢ Á object, but®0pro( àiËit differentK Õthan standardô  * 1rs becauI ree!no@ fork M 
˜ x% b÷ s; – subpartsP *	(ñpush_eof_matcher(NLCRE. 
# V  ¯ `retvalìH º_gen()Ë4if 3 s5/  g a +  Fe  F5msgCpop_ÿ» r# We neÐ1poppAEOF  er or; àbell if* a! Ž #? 0endë i0curJ’ file, nov! BlastÇ	!M $ofgñ & ¢ê)opéÞ@# Th´Ðput stream mu‚ `e sitta¤ ðnewline or at the
  û0# EOF.  We want to see if we're at the end of this subpart, so
N ñ # first consume< °blank line, Rn tesV Anext w 
O 
‰ ~ !'s¹ 2 ½while True:  ^  ‡ ð = self._input.read /()2 "if£ ÿ is NeedMoreData_  c Yyield, X  + �continue! ]break á Îp_== ''fP# Not±bEOF so­Bis aÀÐPgoingo]need.^%un 
ereturn@ #ifS€cur.get_Úð ent_maintype() Ñ {messageØ c# The  p claims¤ Dbe a 0/* H Cõ what follows isˆ  Uô# another RFC 2822D 
ð Ófor retval in¿ ®parsegen()z%if/  )å�Cpop_+²”%@ultiÒ–…boundary/Ü  4if   -/on„ 
ë/ì/íŒ ù  but it has notáå•defined av ð
.  That's a problem whichÌÏll handle byN   ë peveryth Puntil² j� and mark  ƒ* a}œ jectiver  ódefect = errors.NoBh4InMþ D% ` > rpolicy.Ï _Q ( b_cur,  
° =  Æms = []   
 H ¢ åZ ¢ �s.append( ä ð.set_payload(EMPTYSTRINûG.join(lines))
  ireturn ø2# Make sure a valid content type was specified per RFC 2045:6.4.
c óif (str(self._cur.get('P þ-transfer-encoding', '8bit')).lower(´  `  not in ('7- 5 Ù, 'binary')):Õ  4 ñdefect = errors.InÝ ¢MultipartCå T” E“ D7 ˆ  Ô âpolicy.handle_c î ",  
Å p# Creat_ ˜Ð match predic Rwhich Ðes the inter-¥ 	Ö ð# boundary as well  1 „end-of-mÜ ) Û.  Don't pushM “this ontot ðput stream until we've scannú0ast* F p1 :ble	õseparator = '--' +“ 	@ Ñ ùre = re.compile(%  Î�'(?P<sep>K ¥re.escape(h @) +
(  0r')6 €end>--)? ‘ws>[ \t]*  � T ê\r\n|\r|\n)?$'¾¤capturing_ê y = Trueo  )[] d z = Fals6 dclose___seen( Qwhileu ç ` 1 = ž°_input.read Å 0if  þ is NeedMoreDataW  HYyield( 	Ú  #    Þ+in  m _== ''c ]breakV Emo =01re.2Õ
œe /mo] @# IfÅÁre looking aÃE end` ,# Šdone wit' c   !# /b . ] Bther"Qa new[c -ofÛ L  e ý “ ÿ,]ðn we need to initialize K repilogu»  ( ` emptyÊ ^ º(see below)¢ ‰   ÿif mo.group('end'K  (    ³ ° +   Wsep =f  i2     ·# We saw an'ÍA.  W“ Eš?@>if áN ~  if¸_amble%  ) p# Accorä Ê26ä  lJ/ œ?ngsž  J   #D  è,	ËÀ              ð	lastline = preamble[-1]
  ô
eolmo = NLCRE_eol.search(M )? 
1if B :& 
 } ’ 4 = _ q[:-len(E ¯.group(0))´ ¤self._cur.U ô = EMPTYSTRING.join( Á ¤capturing_, � = FalseÎ { Àinput.unreadq( h oontinuV ÿ'# We saw a boundary separating two parts.  Consume any¡ ¦# multipleK  š ÿs that may be following.  OurJ ÿ'interpretation of RFC 2046 BNF grammar does not producã BbodyÇ ö within such doub­ Oies.Ž ¯while Trueg è 8 =  žš1if 9 ÿ is NeedMoreDatag  ÊYyield0 ¶  +   cþ	 ! €ü`re.mat€?ine¹ 
 v/mo« ¯ ” _break× ±# Recurse tš 	 phis sub¨a; the !0 st† pointsM !at1 > �'s first–Ó ‘push_eof_3<er(FA°for retval ŠN¯parsegen()R%if7 0iœ	xBecause°,a1newêaprecedZh'�ˆ or actuallAPlongsý éq,/thupreviou'ñ's payload (or epilogue if® / ˜  iS is añOart).#if pP.get_�òent_maintype() == ':Oart' ¦ hU  ¬  L $à  k b  / á	[   ,on\À          elÿif epilogue is not None:
  ômo = NLCRE_eol.search(H )< 
_if mo_  z ÿend = len(mo.group(0)Z  7 ´self._last.� % =â [:-end]  ?elsö `payloa“ b _ P  Ž ãif isinstance(. o, str)aA `L 3 = 
 <[:-n) Ù   R 2 ÿinput.pop_eof_matcher(Ù 2  , message( ÿ)# Set the multipart up for newline cleansing, which will§ ö# happen if we're in a nesteda .= ²  …2 =  =cur+ r°# I think wÎ Ast b�  Ý �preambleO  ”ÿassert capturing_. 
 .ë  d($
„ñ# We've seen eitherbREOF o  ©Äboundary.  I0,st\#˜ E  ,æ ‘never saw  st¾W :Notò ñ# that as a defect and storeC aed tex( =Ç
·&if™ 1 f  = errors.S¤ Bú @NotF D‹ ¢ âpolicy.handle_Q ( S_cur,É 
ƒ ×# D.setvô(EMPTYSTRING.join(Q( [× $ ý ål ¡ � 2if , ïs NeedMoreData-  1 Yyield, ¼ + zcontinuë  – 8cur×æ Bireturnx #¬ ö`proces?L, n¢ƒmight haL  pwithout.2ing¡	!..µuis alsoº� � dclose__‚cC â”C5 ”À        selfò.policy.handle_defect(self._cur,  ;)
  ireturn ñ## Everything from here to the EOF is epilogue.  If Ëend boundaryP ðended in a newline, we'll needZ pmake sug %he] k isn'tM INone 0if S Isep:  ê § y = ['']  Oelse2 
0 1fori  É Z^inputC ‘  'ÎNeedMoreData)  ¢ hyield ( 	¥  #   zcontinuú   â €.append(
çÑ# Any CRLF at«sfront o¸Ê ¯ ðnot technically par( 	’ #C w ð  Also, watch out (Àan empty strG/ ,K ôwhich means a single$., %ifIPfirstú % =& *[0¿ -ðbolmo = NLCRE_bol.m· (@ 
: 3 1if 6 u   Ø e[0] = G Q[len(7 º.group(0)):� BDcur.D ô = EMPTYSTRING.join( 
˜ µñ# Otherwise, it's some non-multiÆrtype, sÅ entire resß Ñlp# file pÀents becomes$ † payload™ ss\Ü  þ  &
" ª  ‚ syCset_Ó (zB 1))
ñdef _parse_headers\,&s)Ò# Passed a li]I a that æ!upLH . X±current msgs  ^Blast( Y = '' _value{"no™  ƒ‘enumerate«  a q# Check… HJatio­ ã†in ' \t'ñ  F   0if =² #  ' R# The(<…æ @s wa‹ u.  Thisü  F  #´qillegalÜ leþAnotedõS, stoZ- N  «�, and ign3 iÎ€purposes® ª �   q  …prrors.F˜H2rLineIsCÇeD¥ u 
ß J   ªÙÀ_cur, defect?)
   �continue þlastvalue.append(lineD @ 0if ? }header:[ ñself._cur.set_raw(* rpolicy.7 à_source_parse(O Ž )ƒ   4 ,w ( ™ = '', []~ ô# Check for envelope < éi.e. unix-from8  Ñ þine.startswith('From ')ß - ~no == 0   †ð# Strip off the trailing newi	~  1   ÿmo = NLCRE_eol.search˜ 0 _if mo€    h 0 =  ú[:-len(mo.group(0))9 0   ¨» - ,„   J )el(   Š os) - 1µ €# Someth(Alook Vike a·1 atQ¯end - it'sK¡# probably. Qfirst
" o‘ðbody, so push back) L  ¹ ¯ and stop.% 9Àinput.unread5 9mreturnL OelseçWeirdly placed k ý	.  Note this as a defectb  �#Î Ÿignore itÓ @ Ò = errors.Misz EZH Dg ê  R sr ñ ¢ Xb# Spli ô 0 on¶à colon separat6°field name À 3
æ ð# There will always bkM ±, because i0 ) Basn'| ypart of[#Š Îñr that calls us would have a0ed (  ©   ‹
œ i·».find(':')
l I– ù $is	_ ã" a » is clearlyM ñmalformed, but we mightÐble to salvag^Pe resþ  ð I £essage. TrQ<W «keep goingí ?f iJ!‚yInvalidxP"MissKæ  õ.."U†‚	å Òassert i>0, "½_z Rs fedd AQ no :gpno lead¤ 9WS"N Ûò:[:i™ " ¾@ = [Ò ð # Done with allò the lines, so handle Óast header.
  rif last :   ñself._cur.set_raw(* rpolicy.3 à_source_parse(K ðvalue))


class BytesFeedP# &r( )p †"""Like  ð, but feed accepts bF Q."""
¤ 1def  (’ c, dataN º puper().B ( ðb.decode('ascii', 'surrogateescape'))
# Copyright (C) 2001-2010 Python Software Foundation
# Author: Barry Warsaw
L ðntact: email-sig@pyG  .org

"""Cò%es to generate plain text from a message object treeÒ__all__ = ['G@  orÛ Dì d … Ä]

import re
 4sys 5tim �random

� Scopy : @deep  $io ’StringIO,ú"IO! d.utils* U_has_‰ðs

UNDERSCORE = '_'
NL	 ñ\n'  # XXX: no longer used byÛ ÝÁ below.

NLCA ùre.compile(r'\r\n|\r|\n')
fcre = !  ^Fp ', �MULTILINEÆÈ>¶ pes outp² C ?a M³ ·¤This basicópor writ%heí!to× •given filÿ"as# 'Ê  ù# ò# Public interface „  ;ƒ__init__?àoutfp, mangle_ê`_=None xè3len !*,N  o  ! ‡ ä re× ”äeor forê ²flattening.Ÿ  T � 1 is\Pile-l(
 F  ;1ing( )uto.  It¥  mu÷Rave ak—() methodr  OpÎ)al ‚ Pa flaa ð at, when True (Ò ²default if t Òis not set), b s a_› å©he body ofÀ ¥by puttingO Pa `>'4 Sfront1 m¿ °ƒ specifi\7‘st length…õ a non-continuedp ó@.  Wñ a5»  J õr (in characters, with tabsH €expandedãö8 spaces) than ma© , u Ö will split aJ pdefined zHÆ ai.  SetQ  p @zero bdisabl \g @rappve  The Ëñs 78, as recomme¿ (� Ñ•required)ã ·by RFC 2822� S ‡ keyword�a.Ó@hat …õrols a number ofe aÊ#tsù;ð's operation.  If noó policy is specified,
  4the! ðassociated with  ð	Message object passed to D àflatten methodi eused.
! 6""" ð if mangle_from_/ UNone:.  š 	" ”= True ifª 0is 3 D els¾ .2 K ûself._fp = outfp 4 ) =— 
* Ámaxheaderlen)  
) l=ª ö  def write(� F, s)í ó # Just delegate[D filu
a C_fp.L )^ ‚` �msg, unixað=False, linesep=9€ �r"""PrintÒ* mï€tree roodat msg  aoutput§   ^Q whenP ðGenerator instance was creg"®  ña flag that forcesL p¦ ñ ing of a Unix FA•delimiterŠ abefore6 Tfirst¿i– æ  ß Q.  If* „originalN lhas nom P, a `Ô �dard' one¼ õcrafted.  By default, thisO 1is “ Kbinhibi|	à ,nyp - No)B subž&s,§  î � U 	Œ  5sep]°characters ¼œ 0dic“Qa new@5 inÇ  d.  Theî @ val­ñ s determined byc‡M 1@ or,nn IJ Ñ ôm Ö7msgO ž t  @# WeB q_XXX coº tsŒ0 opÐ†bn data§åcomes directly× %# Ž ”Ïand _encoded] N  ŠÀalready been� 0verŸ£(to bytes åB €W) andJ 2ins8 õ	into a temporary buffer., ´=þ. 0if Ê � D !if? wiLt¿ z[ :s.clone(®= )S j 	š] @max_Y �_length=Q o  E_NL    9 ,seRÝ* 5  ›L._NLT ¥EMPTY = ''Ü 8 $d_!  N  Q ð# Because we use cloneó (below) when we recursively process message
  ó4# subparts, and because clone uses the computed policy (not None),
J  K ` ÿs will automatically get set toT  · ˜ „they are» õed by this code.+ ƒold_gen_› r= self. 	% 6msg% <msg$ Etry:1  Ö I # =û 	! E   ºif unixfromZ  ^ u 0 = E Dget_* )()d  + 0if q2 I  "  ð = 'From nobody ' + time.c ( . .()c ì bwrite(L +H:_NL- ) _* 6msg 0finç
  . Œ: = «	ç  	( ®
) 2def–(T V, fp)k A"""C² ágenerator withmñexact same options."""Y  ?creturnò ¶_class__(fpÞ &   ‹ �._mangle_Ð_2  5s, # UseR õting, which we've adjusted£ }   3=ˆ  )/#9 €# Protec»ðinterface - undocumen ";/, 9   Note thatE '_ ó'^     Aing ™m
  	S |bsource`J @_fp.6 eM # aO `bufferê§ œPBytesÇ·ñ
 has already had a chancewƒransformO  ? Âdata in its • `method �case).  T{ãis an entirelyG Apragçò  split determin³`experil;Q@coulhb more «4l bL �always usI�  ˜0hav  ± ð $ ´  z !ctWœ )itt!edœáinput; but, si' ç @whol t  ó M £hack anywaŠòseems good enough.E ­R_new_±³¯!# Å G¨qoverridn is«’( &IOî “StringIO(ïq  enm ?, sp < ! sX ‚ bXy sá {c_linesu  	y jWe hav~z + † endingsf ê  sß êù ‰  " Ð = NLCRE.spli£t(lines)
  @for  1 in us[:-1]:   ' ¡self.write> =  ( 6_NL! #ifU T Vs[-1]8 õ4# XXX logic tells me this else should be needed, but the tests failÂ ñ# with it and pass ò
out it.  (NLCRE.split end ÷ a blank elementO !ifJ ponly ifw ðre was a trailing newV.Ó  º X#<j Rdef _s Vh, msg)> ‘We can't %  … ñ headers yet because o  p follow™ ˆscenarioL ñsay a multipart message includes^ Áboundary strI pomewher' ³  Ñ ð# its body.  We'd have to calculatÇ ·%w Q ²/before/ weÎ O  ÔØ pso that' 2can+ › øcorrect Content-Typeà ¦parameter.Z 
 0 Th¿yX dc �is, so as¸ 2mak³ ÷_handle_*() methods simpler,M i6 Ñcache any subT§`s into[ruffer. | ÷  Ì J ÷  ¶ b4 " cå s=  5ay,f ¤  rsK !Doi ÁRight Thing,Ã GÀstill modify‚ 
FU7 ifO 0nec"&ryP€oldfp = ­E._fp. 6try‹ #" õmunge_cte = None0 # P   �R_new_(W0 �dispatch(+P ofinall„ [ ¹ .  N › ­ 	( 3delï 2   @# IfP dW‚cte, copecQagainŒare-fix+ 6CTEZ1if F  -
J msg = deepW 
÷  É ’# PreservÁPc order¸D CTEâæalready exists€  J  „ ƒsg.get('€ñ-transfer-encoding') isÍ
§  A Umsg['Ÿ: E: 6] =å 5[0]H < 
8    Âmsg.replace_Ú › 	,_ 
>J 
Hype'= 
¥W³ƒ  •AFirs¤4seegî0obj¨@want'ç "# ¹à!itw DÐnot, we'll doÄpgenericÔ¤ �  = getattr
2, '?ð _headers', None3)
  õif meth is None:    öself._write_headers(msg> ;els3  M (8 %   Q._fp.I ñ(sfp.getvalue())
r Ñdef _dispatch@  , j � ñ# Get the Content-Type: for €message, ”n try to R 1 tog  Õ "# ‘ ñhandle_<maintype>_<sub
 p().  IfK ‚re's no . ro N  full MIME < € y o e J ÿthat's missing tooN KuBody().B  Ê   =8 a"_c(_  › (“/ub)  ÿ ( ðpecific = UNDERSCORE.join((W ö	, sub)).replace('-', '_'j  £ = getattrÚ"'_Oc_' + sd ,�: š
Qgener˜  ‡ €  ò„ O ƒ  = ‡ 
 ! ^ U˜•2eth5 # „ DefaultXs J v ^  úqh, v inô¶raw_items()7 ¢  = } ÒÀpolicy.fold(A )uó# A blank line always separates ¡ from body¸ e 3_NLÜó Hq!rsD ß å€ypes andJ ¦
,Ctext@
wpayloadÑ É3if  êereturnÍ óif not isinstance(> [, str_ðraise TypeError('strÛ 3 ñ expected: %s' %'P {àif _has_surrogn 7#._G u ycharsetõ Sram(' ƒ ž3if     Ü î ( ð# XXX: This copy stuff4 Àan ugly hack[Àavoid modifyî 5the? J   p# exist Ÿ­      msg = deepp  ó Ž     0delâ#['Óý-transfer-encoding']} tmsg.set@r,	g j	T[I �   TÐ_munge_cte = » ¢ 
,£  I  7msgE Vype']© #ifMpmangle_†_ìÄ ðfcre.sub('>From ', payload)
  ðself._write_lines(payload)

# ñ# Default body handler 6 B 2= _ R_text: 5def  multipart(p q, msg):E d ñThe trick here is to •   out each ? ÷ separately, merge them allN Ðtogether, and!  n make sur0  at ÷ boundary we've chosen isn'tL ¡present in5 ." 0msgó ps = []
Î   0sub¯   ƒmsg.get_: %()% 5if ( vis NoneF \ ôelif isinstance(D W, strV B à# e.g. a non-sbtHõse of a message with no startingè  N  ¼.–u Î  ! ereturná ª ?not® Mlist¯ sScalar -J  ] è  j r fo6 r© N1 = Â ·_new_bufferŽ c g# zclone(sÞ  g.flatten(Üñ, unixfrom=False, ?2ep=e *NL> m)�.append(svvalue()* à# BAW: What abü§Qies t Pre wrE d•ð double-quotes?
Æ   6 0y =l k _ ô 0if Ÿ 
0¥# Create a‚ 0doe% „  ar… 0anyQ5the�  … #a#
M0all ró_encoded_NL.join(m0 S « 7  ÙÛ U 
4  ‚6set& E ' @# Ifàóre's a preamble,„ it‡,(pa trail'PCRLF
—   !ifk<  Å ]× øvpmangle_D_| P I ñ= fcre.sub('>From 'B." È  8 ;elsH  ,  ¾  $ ¹á	
b ( ' Ï(._ìt# dash-d -½nsport-padd6L f'--' +m+¯
^  ‡-�» y MsF\ 3_fp´mRi.pop(0uÖ*encapsulatioÁþ # --> delimiterÌ 
7  *  (
¡  œ · _·  0mŠ 
¯ #j 	 \ 
k  Þ 
†? + E	À            ×# body-part
  ð self._fp.write(% _% )& õ# close-delimiter transport-padding, N J  ö_NL + '--' + boundary $ m õif msg.epilogue is not None:f  ¿ 2if > Êmangle_from_#  ' I ù= fcre.sub('>From ',k „ 8 +lsq  — =; 	™ – t_lines(„ !)
) ðdef _handle_multio€_signed(> ˜ )Ì ò# The contents of -  9 ðs has to stay unmodified in ord®ao keep|  Å Q# theC ð ature intact per RFC1847 2.1, so we disable heaM —wrapping.O ðRDM: This isn't enough” ñcompletely preserve}  ¹ æ, but it helpsP 2p =Úepolicyh  . á = p.clone(maxf–_length=0Ç6tryD ù B zF(msg5 ofinall9 { Ç pessage_#¿very_statusÎPWe ca)Qjust *c s directlyB ´ Ö's file objec¾€# becausSðis will leave an extra newƒ� betweenf 0last Î\±# block and$ ªv.  Sigh�' es = []= 1forŠ r ¼Çget_payload(Æ‚ÜÆ_new_buffer(} # g# às ’.flatten(C@unixú€=False, î @sep=7J._NL> @text_ ›.getvalue| > 0 = ( a.splitÂ�._encodedQ ±# Strip off8Punnec ry%±iling emptyš 3 é !if suz c[-1] =þt ZEMPTYÉ ? Šb.appen7§ b.join(V Z:-1])	eÞ
S  6 `# Now V A allí / Q withrç ". ™†he lovelÉ�# effectÉaeparat'3ach‡S - 
q#{ íaone af  u  ç6one¼ê Ú3Õ )« Ø!ge¢ P ØÔÛ. 2a mh r/rfc822ZÅshould be a 3• sequenceW#B 	ð 1.  The zeroth eñlement of the list should be “Message
  Á# object for! ósubpart.  Extract that& ÷, stringify it, andJ ×write it out. pExcept, Pturns  Ó, when it's aV € instead ±ich happens* O �and only ð HeaderParser is use B a më  ˆmime typø  ä/rfc822.  Such5 ñs are generated by,"‡example,� ’Groupwise� õforwarding unadornedV ÷.  (Issue 7970.)  SoK "inm caN  e just emi„e%Fbody^ó payload = msg._ T Pif isWSance( ,%):&   g.flatten(I 4getL ð(0), unixfrom=FalseA ù nesep=self._NL)L h æ = s.getvalue(# Jelse} 1 Q Uencod° : o 1fp.kÐ !)
~ D# Th toñða module level function; we(á a classmethodàCthisM  gà_compile_re so7 òcan continue to provid\mm N  _@back V óatibility by doing* ò  _make_boundary = Gˆ:or. 2 a eùŠ ô.  It *is* internal,Ç Adropr"..R@] ;def� ÷ (cls, text=NoneFô# Craft a random Â  ˆ f3  ¡Àgiven, ensur8¾ achosenu  �#> � doesn't 1ar %eO µ  / stoken =z .� örange(sys.maxsizeG™ ñ	 = ('=' * 15) + (_fmt % N   E'=='“ iÄ  ú 
Â reÛµ 5 >b = 0cou�E = 0) ›while Tru§cre = cls.�ñ('^--' + re.escape(b° €(--)?$', –MULTILINEù  +ðif not cre.search(ÍÈ %   Ubreak   Í P + '.ƒ Cstr(Ñ 
i  U += 1G (³p um‡s, flags¤ G 3re.- (% A


Çe Bytes<(
 H 3""" e„b. € version5#a -ýb tree.¹ FKàally identical xbÀ\ Aor e icsoutput jx  n —`@.  Wásurrogates werµd inE ð to encode
    bðytes, these are decoded back to b! ð for output.  If0 ð policy has
    cte_type set9 A7bitY n. ðmessage is transformed such that% H “non-ASCII{  • óproperly contentC Qer en¯ p, usingE � charsetM áunknown-8bit.
 0TheË ófp object must accepts ñin its write method.< 2"""E 2def ¡(self, s):!  	  Q._fp.@ 2(s.¤ ö('ascii', 'surrogateescape'))V ±_new_buffer\ Y €return B’8IO(5 c  { 
� 4 … < § �_headerst W, msgy `# This»Qalmos¬� same ass0str~±version, exN 6…handling"# . ps with šwc B8 `, v inŠ ·.raw_items(•  )  ð kBelf.—÷.fold_binary(h, v))‚ óA blank line always separates ¥ from body: p 0(H._NLJì ae_text  H; ; Jòoriginal source wasE, soˆ 0# jµŠ 2 it­6outC!if:€_payload¼FNone¦ ?V †if _has_“ T(msg.D ¡) and not h÷0=='ò'b "if- €_mangle_S_#  ‰ g ð  = fcre.sub(">F„"I‰ ²  < � __Ðsµ , ;elsÿ asuper(O Generator,O 8)._Ë ¡‘# Default % rc ‚ `Body =G2ndl
: b@classL0  Bø	_compile_re(cls, s, flagN¤C re.- Q)5 ð



_FMT = '[Non-Š@ (%(˜Ä)s) part of �àomitted, filenÑ$%( a)s]'

· " D&(
 ‘3""" Qes a x àrepresentationw ay ‹ALike@< �or base u F V  Ã sª±substitutedROa«3mate …   1the' Í AŠs_init__·xoutfp, µ=?  x3len 3fmt
 !*,‰  U  '! ,  1"""ý ù $._‚ )>ø pan addiBRal op	 g Pargum£is allowed\ f @WalkWPrough  ð subparts of a messóage.  If the subpart is of main
  Àtype `text',, °n it prints ð decoded payload@ R %.
I ÑOtherwise, fmk ña format string tha ¦used insteP umessageN o $. M Pexpan‰ Awithš `followY §keywords (Ù #%( #)sˆ &):® ÷ Á: Full MIME  o5@non- ;™  =& �  : Main9 3sub8  : Sub-q �filename q F ¤ 
ædescription: D Å associated Gç Pencod\ v õContent transfer  ‡ ,ðThe default value‰ÑÖNone, meaning™$[Nw0(%(11)s)‚ z&¥ omitted, $%( 5)s]� 5""" ðGenerator.__init__(self, outfp, mangle_from_ µxheaderlen,D 1	 rpolicy= )* (ifè :  <  w  ._%e= _FMT Oelse+ 2fmt'Ódef _dispatchÅ Fmsg); 2for4Çin msg.walk(   † É=+ b.get_cé_ (Ñ  3 i< –P == ''v  #   >(6U Ë(Jr=False)»=
d ,elf PmultiN k  õ# Just skip thisK ˆ   :pas d'  ñK™=% {K  ( 'ü '
 � – ä 9  /()1'V @ :u	@ B ?  @    ! @ ?  U('[noQ/]'Æ ]'G #('%-p'É ? � _ „ €
Ë „ T©#-EÇŠ !e ‡ }Åà


# Helper uã7by uó!make_boundary
_width = len(repr(sys.maxsize-1))
!²'%%0%dd' % 4 ð

# Backward compatibility
_make_boundañ:ry = Generator._make_boundary
# Copyright (C) 2002-2007 Python Software F3 ñtion
# Author: Ben Gertzfield, Barry Warsaw\ ñntact: email-sig@pW ó.org

"""Header encoding and de @funcq òality."""

__all__ = [
    'A "', ; 1e_hV  ò 	 Ä]

import re
 …binascii ´ ¥.quoprimim)  abase64 R
fromã ƒ.errors ^ � `ParseE * #  ch ct as _ #
C = . ð

NL = '\n'
SPACE D '
B 3b'  8 ð * 8
EMPTYSTRING ð'
MAXLINELEN = 78
FWS ó \t'

USASCII = v Q('us-`')
UTF[  ò tf-8')

# MatchÌóed-word strings in the form =?é ð?q?Hello_World?=
ecre = re.compile(r'''
  =\?î ó# literal =?
  (?P<Z ñ>[^?]*?)   # non-greedy up toŠ ‘next ? is 7 ?
  i  j i ²€>[qQbB])i áeither a "q" o	 ÿb", case insensitivef Bed>.Ì Ï =Ð ž eq ==  × €=
  ''',}�VERBOSE | PMULTI-ãFèñ name regexp, inclu½PtrailÆðcolon, but not separat òwhitespace,
# accor; Áo RFC 2822. x°acter rangeÖ dPtildeÂpexclamað	 mark.
# For use with .mŒO()
fS â[\041-\176]+:$¼rFind a '� embedded¸`a puta¹ Àvalue.  UsedŽ PcheckÜ$
## Ainje¼¤ attack.
_T žè \n[^ \t]+:‘ ó

# Helpers
_max_append =i˜ Ó ‚



defD	(Ö !):%@"""Db´e a message¶ Ù A¡out conver· !.
B òReturns a list of (è#, ) p) pairsC @tainú@each+  §dM Tparts © 0setú1Non9ÈÙ6  oƒ0wisÞ alower-  �  ˆ È%oft1setš rspecifi / } M ³ ` may bu  Q that !or  0con êD2047* *s¿ 2r i8 M A0 obNq #Anl.$ eð  may be raised ÷&when certain decoding error
    occurs (e.g. a base64) ¡xception)./ 1""" ò2# If it is a Header object, we can just return the encoded chunksO Áif hasattr(hE B, '_! 1'):j  ¥ F Â[(_charset._N Ó(string, str( +)) G  K  0for5 = 9 B in † .„ ]; ì "noÁ 1 Û 6 “ with no P ã ó not ecre.searchë à I t, None)~  First stepo@to pI allXñparts into triplets of# CformË (9$d_: Ö · ¡).  For un #ed(!s,L ClastL !twŒ ¡ts will be¸ ÷ ’words = [Æ  oGlinedPsplit 's(Æ =0 # ($ )s  ½fe= True Pwhile&ts6 . Å = f.pop(0O  % 1if V 
;   ?   .l<*p(E  / F v = Fals�   &ifPg -•.append((i  )n "ifÏ L Æ ð o.lower³  ä 0 +ed_ ‰ ì   
Ò e 7ed,C§ × ñ# Now loop over ? ³ and remove Àthat consistÜ’whitespacm # between šu ¾—Pdropl> 	š@n, wš¡enumerate(� —aif n>1’ Bw[1]	  ã\[n-2] �1][0].is› Þ ƒ ð2n-1Ü $d‡ ”reversed(+ ‰ 2delA[d]
w™# The nex$ëbe eachv!ed8 � by applyô —m K  ð or quopri trans@ration. 1ed_" ‘anow a UoK  5 " (ˆ / ,M ,½¦ (ƒ "ifê  Ú !isŒ  z * is´ &an� %   	™ ¨:
Ã 8 (el„ j== 'q'ƒ  ³ ’ = email.cRmime.ù_y j  `   # Qsœ  X _À))
        e÷lif encoding == 'b':
  Ñpaderr = len(* ðed_string) % 4   # Postel's law: add missS 0pad[ 	S 2if V 
j  u 
a ã += '==='[:4 -5 ]L >tryF üword = email.base64mime.decodeÆ 	P þexcept binascii.Errorb €raise HeQParse( 1('Bm  i  ÿ e? *')c >lseR 3 0ed_¼  s.append(( @, chc &t)H eD ’ “Assertion� ¥UnexpectedæU: ' + S ð# Now convert all y ðs to bytes and collapse( ñsecutive runs ofá ²# similarly` "edH . @  ›[ÆAlastò  `  ê q = None7 1forF 2 ina.MÓif isinstance=Fstr)"  e Ü " =Ú % €'raw-uni w-escape¶6if ª !isœ 
S  =­ º  l    Ú 
 # e„ 2 !=k  
f B [  Ð ,7 *�  &  ž $g “  º+= BSPACE +´W ˜ +™ æ ereturnŸñd



def make_h¤(_ðseq, maxlinelen=g", % R_name � ?  €continua\s_ws=' 'V³"""Create að from a sequence oñrirs as ® Sed byÆ£ !)
v ª  @ tak�¤ r value �—Q sp J  pat æof the format 	ÃUt) wherek å 6 h N   Ê    ¢acter set.¸ �This func#¶ !oný _those#nd ¿ Nl ÃP.  OpP 'alµ	°,Ÿ@ arem!inO  ³ ^ ¼rtructor–1"""$ 3h =¿( 	u =1,?  $ Œ = r Ös~Ó6seqö ™Áne means us-•° but we canràply pass it on´h l  ˜ &ifÛÀs not None aònd not isinstance(charset, C	 G):
   $ =  1 )' Ãh.append(s, /  ò
return h



class Headerc õ
def __init__(self, s=NoneG  i — ¢maxlinelen" ! hW R_name 4 ÷continuation_ws=' ', errors='strict'ü ó"""Create a MIME-compliantm   that can Z �ain manyÅacter sets.
‰  Opz Àal s is the ú 4ialP ²value.  If $ M ,  H  Í‘set.  YouŽ  la} ’1 toj d with ­£ Sðmethod calls.  s may bù Pbyte äng or a Unicod �, but seee œ a ‘ documentt0 foomantic<ò serves two purposes: it ha8Òsame meaning  } D 1arg{ • î  hat also¨ Á ‰ defaultL Ë¿ æall subsequentK<AomitO ‹ O “  { f( seŠ‘²provided in= ±onstructor, …us-asciiO _  �used both5s'sZ$ 0and  Qå  Ï K Ó ÀÀThe maximum }q lengthtðbe specified explicitly via4  / †len. Foru PplittÃ — RfirstX �to a shorÈé( `ccount¹ UfieldN âóhich isn't incluSàs, e.g. `Subjeê  p�n 85 ofN ’ !el�[ \0.  D‡ † 78d¦recommende� ·by RFC 2822Q 7‘P mustw+  r@fold*õwhitespace (usually´ Peithe¤  ¯±hard tab) w@willc 0pre± edˆ N  ³¥) ç  8 9 `hroughA  .` G.H 5""" iö ä „  ®•= USASCII: Aelif'¸: s&._v 
 v   
8! =ð¹0 ¥hunks = [] "ifö ®ø h ±C�¨'ifM ‹K ’ð= MAXLINELEN
        söelf._maxlinelen =  #
  õif header_name is None:   ' sJ ' I 0  ;els. õ$# Take the separating colon and space into account.N n Blen(~ ¥ a) + 2
4 Àdef __str__(¦ )¹ ’"""ReturnŠ  tr† �value of S A."""L | µnormalize() Åuchunks = [] Plastc  4	 å =M Qfor s‰ Ð, charset in ¹ "._` À  � ò# We must preserve>ñs between encodedYDnon- Ewordx K ð	boundaries, which means – °us we need —Bdd aj P when +goO efrom aÈ !toì á/us-ascii, or $   _ J â.  Only do thi˜ E2conâ ²subsequent /
:—# Don't aÀ iì
… …Ë already has“ þ `(trail:por lead Qdepen
 Öon transition, p2nexÞ 	a 4if   3= _" Ê.UNKNOWN8BIT P Ðoriginal_bytesÄ .ñ!('uú', 'surrogateescape'—  K : : = T 0.deLK lreplacC 3if ¦ 4hasúf ò@’nonctext( >[0]› 3if T!no(¹4, 'W'â Ì  R>in 5  të¡ » J Ü 0.apæn(SPACE© . Çý	ä " &el˜ Ñ œ  ú � ™ A # =h\ `+-1€ > ÍÔ 	Í | ÂrióEMPTYSTRING.join(7 )­0# Rvòcomparison operatoríðequality only.  BAW: does it mTrsense t‹`# haveg€explicit=öisable <, <=, >, >=g ?Õ 5#eq4w, otherY# ± may be a H" k aY Ÿ ñoth are fine so coercec  ý±# ourselvesö@ unia# (€"un½d‚ žp), swap¢K AargsÍQdo an±  IÀreturn otherñ == str(self)

    def append ñ, s, charset=None, errors='strict'):8  < A"""A;   aW òing to the MIME header.h  0 „Optionala ò
, if given, should be a C€ Á instance orV Ename} Aof aI ðacter set (which willI �converted– V U).  AO �value of õ   (Å ñdefault) means that‡ º 0 in H ÷constructor is usedPs mayœ da byte6´or a Unicod €.  If itE 	- j „(i.e. is&0(s,P )2 pfalse),š n% iÄ pe encod¬%ofL Ü ’ V, and” EX`raised¼ & %ngJ `cannotã  deÏ bd with=9Û s¨ ö ² M 	ðs a hint specify¿  }  R   ofñ ð  Es inL  / ¬  € ðn either case, when produc[ õan RFC 2822 compliantJ Ø0 us+ ( ‘047 rulesÀ  †  ˆq#ed1 'thÄ`utput (c| ¤  Ó 0set¥ Ï µ  YP l— oM ,¼’”`è'—0pasâa1 þ s argumentN © à @callØM.$ 5""" 3if ë  r  vY -  = ®#._ @ Pelif k$ ,B¬
S b(1 )V T V
� Tinput“ $ =Ê . @odecµ¥'us-ascii'a  ˆ 3if ) à4== M Ê.UNKNOWN8BITt  : bs = s.z(^ ö, 'surrogateescape'Ó  8 OelseN 	’ öF ‚# EnsureÊ   â`s we'r´ oró8canû¢ š#/¢ ·0, oŠÒwise an earlyu mCL .{ |#if‹ ? !y?try< .‡(x Ë9TxceptâE�eTX ¤ &!=è/  ^ #^    ÛÐ = UTF8
     ð)   self._chunks.append((s, charset))

    def _nonctext(5 Q, s):    ñ"""True if string s is not a 5 R øacter of RFC822.@  ðreturn s.isspace() orP  n ('(', ') 7\\'� dencodeš AplitÂ ð=';, \t', maxlinelen=None,  ‡sep='\n'Ê Qr"""EM ð
 a message header into an¾ ò-compliant format.) ðThere are many issues involved in convert(ta given7¥for use inƒan email† Ð.  Only certaL 2harXAsetsw preadablF U mostK H ó clients, and asX ‚ qs can ob !onb µa subset ofJ á7-bit ASCII, cì ðust be taken to properª î o ¨e (withM `Base64æÀquoted-printÂ )� ñ.  In addition, tkEis aM 075-ûðlength limit on �p‰ d` •field, soH   `-wrapp§mÞ 0perðPed, e· È Ö double-byte |  � Op³ 'alŠ  specifiesÉ   Simum µ ùof each generated› °, exclusiveQ4theÒÉ+‚dividual @ may£elongerO @than}  ò 0lenÅ`a foldù Ppoint Ìñbe found.  The first[ L @willc @shorì!byÛ Ó  © Oâname plus ": "w  O # 5was*bd at H�€construcXS time— Àdefault valu± ê  ž‘determineU z  ›U ÙÃsa H ar <  1 7õs which should beÜ ˆÃxtra weight ._ ±lgorithm duWnmK §i{ðin very rough supporÂ ½õ 2822's `higher levelM ñsyntactic breaks':  ’   s preceded¯ a  ï {wpreferr­¹  ],  Ù !, 9  ; ­Y =  $  "orwœ LPthey ­a”av@.  S3k4tabñPinclu²  in. O 6  ­Àindicate wheU å vference»«¹to one overN o9 3as 0 R "n  G ò Bs do6ppeÇ  &ž  beJ4 Ù ÕC doe\RffectÓD047 Õ G s|àlinesep is a sðtring to be used óseparate the lines of
    ñvalue.  The default  1 is6 @mostP õ ful for typicalE ðPython applications, but it canŽ 0set� @\r\n õproduce RFC-compliantP  ¦  ¸ õors when needed.% 5""" õself._normalize() `if maxQ 0lenÐ UNone:    "= J  * 8# AJ ðof 0 means don't wrap.  For all pract%§ purposes,K Pchoos«òa huge number here ac0she~¡at and mak eF  _V¹Fö 0ttex ögorithm much simpler2
O== 0	!10 o fg += y (5§headerlen,)ö  k A qcontinuAö _ws, splitcharsÑ�lastcs = Éž °hasspace = !  	$  ºs"!, U Set inòjchunks5if X ais notu 
%  Ó & "= a ³Õ ’nonctext( 6[0]Ì  <   !if¶ cd @in (¹ Þ, 'us-ascii')u 9  – € %orÚ   J  N ã°.add_transiÍO '   Oelifk  ‰ ”Ç y F  h+-1i > 9ü< Ð Bf= Falsf   > rÂ.–  Ç `å á ‚feed('',Š5[0]Œ
;els§ Š H   L Ò 
B  ï ¦  ä  _s[1:]› 	0new( Õ  w ì.å`_encodÁ
 < ³ êQ' ' + .lg?p():ú  w @  så  (5inem 	 &    fwö / `[:len(
  )-
 D /)]6 ).ìfÉ ; ê 6] os) > 1¤Ðif self._chunWks:
  õformatter.add_transition()' †value = + Æ_str(linesep( ñif _embedded_header.search(C )z qraise H( ÂParseError(":  3 õ appears to contain "™ Ç D"an y  ? ‚: {!r}".´ € « breturnd 
P `def _n—lize(self° ´# Step 1: N# ð the chunks so that all runs of identical chÞ !tsh  ´ õ# get collapsed into a single unicode string.6 l E= [] Slast_` | = None Iunk 4 3for\ ,› @ in ò "._e 
©%if( 8== s 
(  Û  @unk.»2nd(Ç { & Nelse< )if] q is notÕ -  G ­ i Æ(SPACE.join(‡ )),U )‰  F ,  (¯ b "   & Ê$ =m¼ :unk® ¦ +—x  qÐ



class _VžF– Æ{ Íq_init__Ë,�len, max  Q@inuaï¡_ws, splitNû� 4 # == ø  J  ¨ 7ont\ 0 »_len = len(J ®i ¢ ' =¯ _ š ÍÇ? €current_! ò = _Accumulator(8Glen) è ;  , 3  îa   @.new .[  2sep�+ v s^  G¡qA 4  � 'NL5 q   5 aend_ofc  Xelf._î G.pop¥ 8if 2 ·!= (' ', ''T å J Wush(*? ¥ !enr
 V) > 0; Z $ifs•ó.is_onlyws() and# M
?  C  .ô €s[-1] +=Ù ! 7 ~M R } KC w.reset(±W 3 d  
+ .p`ŽŒAfeedÛ 1, f­ÃT C# Ifž¯Àhas no headeõr encoding (i.e. it is an ASCII 3)
  ð# then we must split ’ header a ÷"highest level syntactic break"O ðpossible. Note that^ ÷don't have a lot of smarts about fieldH c  x;< jš btry top ð on semi-colons,± sn comma I ðwhitespace.  Eventually5 ðis should be pluggaº = ²if charset.__…is None:,  PÁself._ascii_Jâ(fws, string,   W † = ereturnP ð# Otherwise, we're doÙ ei ð a Base64 or a quoted-printÄ G ³ °which meansV’@needX–  HQ lineaäL îðs.  We can basicN ¤±find enough9`acters_ 0fitT 7theN qcurrentr q, minus‚ àRFC 2047 chrom·WF@make! ·is trickierM !thw    - "wem#toÔö	at octet boundaries, not© M $ ð but it's only safeÐ /a> X h so atO  :w3G ¥get close.& §0ed_1s =— ye (QÆmaxlengths()Sð# The first elemi`extendD*e }æ fé  Ø ˆŒ@noth}0morU Í	F  ÷ ±start a new×à :try-› Ñ " =™þ f.pop(0Ë úexcept IndexErrorI ê ”re are noK   }o>nor "if/” !is 
o ÆÂappend_chunkæÐ º õ Blast` ô 9 ó #wa˜1oneñ pá  º 0newc(l  _� c.push( Àontinuation_ÎÃ B #X"ry#2elsŒAfull• @s inQvmselves¤ 1for!    	 r ¶ "s.xœ ! +N !)
UWdef _ Ï )Y 6ñ6 2's FŸ y“¶I   -% ~ ¿2›while TruM  ” :._ccG_lenÃ O 0 *, UÀplitchars):
  ð,# The RFC 2822 header folding algorithm is simple in princi Cbut
J P # co" x# ñactice.  Lines may beZ óed any place where "r M ñwhite space" appears by insertž   l[ Àep character{ Çfront of theP QFWS. î § picationÙ Âthat not allq ÷
s or tabs qualify as FWS,P ðand we are also supposed to prefer
 ÷break at "higher levelG Asynt+ + ðs".  We can't do eit7 Ï øse without intimatâ “knowledgeý ‘ structur  dæ€s, whichÆ  doo 8havP  šP.  SoJP best+ 0can˜    =ë   th¸xecifiedë @plit«0s, >Qhope }2we ‚ achooseú‰ ( L 0are² Plegalš€.  (This“ Àat least betAthanÃ 6oldÓÌ…ðwe would sometimes *introduce*f 0 afQ 4a sË ,*	i5Rbeforã  l éd AturnqèP runsÚoê PsinglQ5ace%.)" ±parts = re.– ö("(["+FWS+"]+)", fws+string5 1if 8 E[0]:J  É ¥:0] = [''] Oelse+  f.pop(0Y 0forq ,_  Ž±zip(*[iter(\ Z)]*2)I `self._ãÂnd_chunk(fwsC !)
‚ Jdef "  5 Ü ,ç Ý U    ._current_%R.pushV  Nlen(4 B) >  fmaxlen`  )a# FindW|À point, work¢Ñbackward from, Aend.Ò  D   �pre migh²ñ none, on a long firstê
9  j chc¥ � ^
©  e  , i+ _rangeì  .œû_count()-1, 0, -1¨ J   �if ch.is¢(%  )  fw™Ÿ ŽV[i][0[ +   ifC#®fws[0]==chÕ 3 <	X @prevÝ # =Í
‰ _-1][1‹  $=  ¯J ?[-1’ Ž B¤ vcontinu| I E /æ ¤ð )
             ÿ   if self._current_line._initial_size > 0:
   ð# There will be a header, so leave it on a W a by ito O  0new, /()# ¯if not fws’  ¥ ñ# We don't use continuation_ws ² @beca ïthe whitespaces S Uafterá â should alwaysû B .C �fws = ' '" ÷ 
€îpush(fws, partireturnJ ¿remainder =Òªpop_from(iN }  rÒs.append(str( )8 ! u.reset(ˆ ñ)


class _Accumulator(list):
¼ Qdef _l!__s (, y6=0)æ’  ) =. R  ­…super().Z )n Y K ,DŒ, stringg 	‚# E LI i¨ cpopped…F[i:]˜ 0elf F = [ Ë 7 © !op› « «_count()==›O v('', ''´ Gpop(Ò S__len„r 5 `m((len )+	  ƒ R) forF  1 inx%),ñ  �  *
V	~ ?str~ þEMPTYSTRING.join(( +ò z  ¶ � È ²   ·artval=None Œt @ is  « s s 	í U 0[:]  -  
"F = 0œis_onlyws¥Æ �==0 and (2 _ 0 orñA 1.is²'()û  É[ 1 ñ f \1€)
"""Rep4 ggr Pmanipð@ing ˜lñ)s via custom objects.

This module provides an implement½@ of °HdüRegistry API.
The. ðis designed to flexibly follow RFC5322 rules.Ç 
 ` typesL òort MappingProxyType
$ Ó 0imp$ _utils  _error _%°_value_parsZsë4ser5Address*Ðdisplay_name=ïEuser  do ‘addr_specÅÀ):
        "ó)""Create an object representing a full email address.

  $An ð can have a 'display_name', Duser  nd Ådomain'.  InP ðaddition to specify† Dthe B R and = õ	 separately, they may beO C ôied together by usT  Ñ _% ð keyword *instead of*S K  5 sÄ fBP 0stre #isÇ  „ %itN ðmust be properly quoted accord: ðto RFC 5322 rules;a ¨error willç úraised if it is not¤A¹âHhas £,],Z,fÏ ¸ ñattributes, all of which are read-only.  The^ ³ ÄN PvalueD   ~ I ObothF, buRðwithout any Content Transfer EncoV6"""Çÿinputs = ''.join(filter(None, (,1ddré 5)))Ý ³if '\r' in _ gor '\n :-  OÆ  VEçð("invalid argumentÊPpartstönot contain CR or LF")Û à# This clause &p its po"Qial 'x '; ½æ happen when a›‘# applica ‘program c>sœefa!î #o)^Àlibrary code¤ Aelf (Àalways suppl¾JN  _. 'if€ Ï
t%ifû ;E 
# ›CTypeš 8   ifÞ0&U/or "�  G  "t D alsóFied"H 5 ða_s, rest = parser.get_† Z(
 
8 !if6 Ñ lIlÌ!; O'{}'Ç q "couldÔ ¡ pd from > Ÿ".format(ë Ï Ð ÿ a_s.all_defectsÛ ' 9[0]~ ¨ = * `local_T	& ›$    hself._) =U* r  " a  F Ã@"!ty- 9defd († )preturn  
œ 	M Àty
    def uósername(self):
  preturn  3._u% 
 ‘@property ¯def domainC 
# A œaddr_specD u"""The   $ (Œ @R ã) portion of t+ ±ess, quoted¤  Ô õ4according to RFC 5322 rules, but with no Content Transfer Encoding.L 5""" Blp ='š  ÷if not parser.DOT_ATOM_ENDS.isdisjoint(lpx « S 6 Æ p_string* ] �¹ A ½¢lp + '@' +¡ + B  Ÿ /lp= E'<>'+ Q Á ôŒ__repr__²+ À"{}(display_`t={!r}, $ ’  ¥)".format(v  Ë  ð ±__class__._Y ?__,1 † ,	†  † )Ü /stÛ   J í  Ü € 
ñySPECIALì 7 î  $ =&	ð  )^   
®r= '' ifâ   ==É[ else X  c¶U <{}>Œ q ,� 1 “m B#eqw, otherö '±isinstance(" —, Address+ œ ¸NotImplemenØ‰ ‡.¯ –2 ==z 
 &an ^   Æ 8  4 :2  A)


¥x Group:Einit¯ R=NonekQesses 
ð"""Create an object ‚Pesent×!an¨Pess gw .w  à A � consists5(a ‡ õ	 followed by colon and a.Alist7 ¬ues (see»’ terminatB qa semi-I 0.  ÌO Ais c× q  1ifyÏ 
— … ó possibly empty Œ M @Rs.  Aƒ  c`lso be„d>• a singleI  Ò Iqthat isÇBin aZp, which pconveni0Ðwhen manipula’N  § !s L  are a comb$·sh¤individualReÇ %InM  th31aseî	»`shouldã 0setâ  SP.  In^ðticular, the
        stñ)ring representation of a Group whose display_name is Non £the same
  0as  ðAddress object, if r4  ; �and only  
- 5 inN  K aK •es list.
 5""" iself._¦ =µ * U …= tuple( )­  S else# )| ‘@propertyT 9defi (‹ !):  preturn  
¡ M { J 
& G  †  __Æ/__8 H"{}(!u={!r}, I  •".format(À  Ä  Â ¡_class__._?__,* k ,ÿ k Iµ >str´ "if3 F x =1lenè .U 6==1w ³ {+tr+ E[0])·  c . =o ! iá  2notû ƒ   ñparser.SPECIALS.isdisjointl ‘ k 5 €quote_st�. s àadrstr = ", ".P ó (str(x) for x iQý ; c' ' + J $if
 Ð 4 )u"{}:{}; ¯  ! Œ 	³#eq²w, otherç 0if ±isinstance(" ,N)  x ìNotImplemented– ¼ Œ �"==x . &an<  ^   µ& 9  à)


# Header CÜaes #

çR Base  €"):m0"""  $  ’‘message hH s¥Õ ðs generic behavior Aáprovides toolsÛ1subV eD $A  â must define a} pmethod –1d 'Xó' that takes an unfoldWbvalue sƒ Pa dicóð ary as its argu‹`s.  Thü" Awill qcontain¿ðkey, 'defects', initialized to„ Rempty¿p  After3 caN  çˆ é b 0two¤i¥ �l keys: ê P_tree[tg "th…   0 ob¤ qed from4  ë m ¨,�'decoded'K (5oÂC ideÛ  m
3 Z Bdatap   ; .2 (T—ais, enp P wordn#e ‚ � 4  Fòat have canonicaz
w @ &soÁ3ed.¬¼– 7 Àðintended to collect ðparsing defects, which the message
    ' ô%er will subsequently dispose of as appropriate.  The9 ±should not,P pinsofar4 òpractical, raise any errors.  D˜  A °be added to¤ L Ãlist insteadv ó standard header† ¤s registerï � for RFCH ñcompliance issues, €obsolete( Á syntax, and Âunrecoverablí 1ingN Â 
 
° method mayÉ   Ãitional keys× A dic òry.  In this cas� �Ðsubclass mustÏ  in:s 'init'g Î·b   ss<hH f  ˆ0its„ Ðword argument‚ ¼ ¶ …ñ use (usually byâ @settH@themN  ¤ Avaluñsimilarly named attributes)J¥remove allÕPextra� s$`ed by ¢ ‰ß  ‡Pthen “ PsuperBcI - 1ent  -2witÜ`remain± ë Š 0key&s.¸jþ öalso make sure that a 'max_count'ß 3 is›d… , ðis either None or 1. XXX: ne�So bet¤ Õü3API“ 2"""œ ñdef __new__(cls,\!, u!):p  º“kwds = {'âe': []} Acls.T(9  , 0 ) ð
if utils._has_surrogates(' ·['decoded']q u  $ =F �sanitize@ r ¹self = str.Þ q 1 1delµ p   M .(y@, **G ß preturn ' U0   S"*,A`_tree,Ò +ó  -  ._c ! =‡
� _a> ' =K & ¡$ =b “ @S2erth ö i (t ƒ Ê Š = f @ Qtuple #._* )J  y ¡__reduce__#  (Ó  _‚nstruct_Šþ    
/    Ö 1.__® __Zame__7 ) _bases* "tr® 
E ) y  #__ó @‡ üÙ Õ x9Â( NAfoldš  , bWolicyG e"""FolÃ`accord²Ato p-   ¥fÀd representaC ™ Œ ‘àfolded accordisng to
  òRFC5322 rules, as modified by the policy.  If •arse treeE ñcontains surrogateescapD tW  H õbytes are CTE encoded usingI  (  cha õt 'unknown-8bit".
% àAny non-ASCII / ›acters in¡ n  ; óset utf-8. XXX: make this aú ‡ setting‚ ðThe returned value 1 !n “ ó-only string possibly $  ulinesepÑ  ˆ Ã �, and end' swith a . é 0.  � a …includesN  D±header nameR   ç': ' separatorÎ 5"""= €# At som÷õint we need to put fws here if it wauusource.I ‚ 0= pÎ1r.H’ %([!  €	 [Label! % VgàTerminal(self.ß 2, 'k - 9'),a @ 6':': ksep')]; %])J 1if p _° _û:  c ‚ ‰.append(   7 Ãr.CFWSList([ ¥WhiteSpaceØ  ' ˜ 0fws‘ ‚ 
a � ( • / Rfold(¿= ò)


def _reconstruct_. P(cls_DP, basµÙ)ê Y Ntype) H{}).R (: £


class Uj Bured:Îò max_count = NonQ= kór = staticmethod(9Wget_uU )O @o + … ë 3  ´ ,ªc, kwds×  ž  !['' Û˜'] = cls.‰ Ó  1   5 !deÅ2 Bstr( K  q– ~ Unique( ) 1NIDateF2""" b whoseç  p°sists of a fÃle timestampÿ`Provid—ðn additional attribute, date6 p, whichèâeither an awarµ' Ð! aj õzone, or a naiveM  ? “ Y  % ­¾ iniÝðs -0000.  Also acceptœq ƒ2put{ '¹'Æ  µ  o ð normalized form   † <è Pmeansä!isU0out˜ !of; 5at_� ov ˆ  TÖ ã 0# Tc�is used 1@for ²€ing, noti P crea}$ 'l` ã %Àured)

    @ñclassmethod
    def parse(cls, value, kwds):!  % bif not     ) ð!['defects'].append(errors.HeaderMissingRequiredVc 5())^ H ÿatetime'] = None$ aecoded# /''!  Î B_treG  Êr.TokenList(y ereturnG ãif isinstance(7str¯ ‹ + G  $ :try,  ' ‘ = utils.œ €date_to_  ý v 
¦ qexcept ;E\Z ŠÁInvalidDateD­#('  x Û» or format'Ÿ » a £
( Û † 8 Šo  =d! „UÂ O( ¸ Z ª Acls.i _ "r(& dh !)
‚  8÷init(self, *args, **kw+  .Š ° = kw.pop('t ì'� �super().U O p •@property~ D ‚ u H | 1


úp Unique�( "):k Õmax_count = 19 rAddress6 *  ¯� {@statice	T ´ a] S_list…" =˜hr.get_! !fassert¢á, 'this should h˜.$V ü @&» 	 6ó"# We are translating here from the RFC language (  †/mailbox- 0Ç# to our API4 cgroup/: !).’ /   ËÏ ›+ |= =  ¬	H d is = [] @for O 1 in 1essW . ^esses¸L 9G¾ ø é.display_name,g  Ë  [¤9(mb>  Ø/''D X €mb.localtB %bdomain> 
¾h 	  D$mbBS.all_ÿ;es]—x0 = 97s3ll_  À)
        elWse:
  ù# Assume it is Address/Group stuff/ úif not hasattr(value, '__iter__')^  i $ A = [	 ]O gg s q û (None, [item]) m   B, 'a£ Ies')L  l  0elsä /em4 @for o O in ·  adefect¸ Ð bkwds['Ò R'] =  p   ; !  " Qcoded" ð ', '.join([str(“ () � d ]
ñ if 'parse_tree'®0in } 
›  [+  ³ Acls.ð _D "r(& #de“ !)
­ ÷def init(self, *args, **kw   "._¡ ô = tuple(kw.pop(')¹ / Ý0 = o  Ö�super().w q ’ ‘@property1    y ¢ • rreturn m # A ‹ D #if@ "  : ® 
be %  Èƒ  f-  sÄ  õ   R "inu. &es`	ú   ó 


class UniqueÿyHeader( "):)Õmax_count = 1? _Singl? ©Œ f 1len Ï :!=1epraise Vˆ�Error(("ÁQ of s•  a ! hÖ 0 {}¯ Æ"i+"a5 ‚").formaëW.name´Tf Ues[0]V  b²MIMEVersionŸ� 3Âò = staticmethod(Ø. r_mime_vU Û@-  L. R(cls,,PW'' x M = = Z¥ ŸB i· r® R * ƒƒ'].extenÙ + S.all_\7 Qmajor[ ° b¦ @.minøsz 2  ;  d° 2 O )  G ) <if  € ƒ 
ÎV ’X t'{}.{}'†! Æ ‡#['† ì  » Y À   kwds['verñ sion'] = None

    def init(self, *args, **kw):!  %   P._verA ³ = kw.pop(' +')* Wmajor(  & *in&   & quper().Ÿ ™ º ‘@property}  È g É ¼ rreturn Ã " ?  € ?  " ? A 
$ ò


class ParameterizedMIMEHeader:d ð# Mixin that handles the p7 ñs dict.  Must be subV aed andD# a 'ñ value_parser forK ¡specific hz  . bvided.ƒ Òmax_count = 1 @e Rmethoe  {V R(cls,g g, kwds‡  !['' Q_tree‡ x = cls.£ ( [B qdecoded? Fstr(C * çfects'].extend+ q.all_de  7  ifY!se  .d!is- ‹ " Š !{}o  Jelse. `# The Þb RFCs sy×E  õ ordering is arbitrary.X  \ x ð
utils._sanitize(name).low:
‡  A  C w3 !  @ m ð> in=}1  Ä „cs: )B –ñMappingProxyType' .$Eams)§pContent" ¡(¹)ºD G  k‚= static3‡r`Bse_cZ b_type_ƒ)6#· t`._mainc < = ï! G., # ?subC + Ê ©� o%¬% E e D 
$ C ~H 	‚ + '/' +N] Í&¿Disposition-Ddb 4À, **kw):
     ðsuper().init(*args, **kw)
   õcd = self._parse_tree.content_disposition2 - "  � = cd if ñs None else utils._sanitize(cd)
O ‘@property Odef W  (q !):#  ² creturn´ 0  ¢


class CÅ òTransferEncodingHeader:‚ Òmax_count = 1 RvaluerÁtaticmethod(#!r. _| ta #_eb !_hc å Ž A Å  è B a(cls, p g, kwdsæ   !['' “V'] =   l1ls.< ¬ ( ÚB qdecoded? 2strÂ R * Ófects'].extení + q.all_de  Ö  Å V ž(, \« > }._cte =' ô C.cte~ 9 /te)%teŸMessageID jQ^

mQ %_iÙô¾r
# The ÚÀ factory #

Caultõ�_map = {ê 'subject':O òUniqueUnstructured’,> Odate; 2   > IDate6 resent-= 0 Oorig. f osenderž œ ßSingleAddress¥ F 9 /tot  `x r @ 3 /ccl +@ l b-  Ö †9 ï@ 3 OfromÚ D@ l oreply-vÄ9 Ïmime-version­  RMIMEV YÀ  'content-tlype':  ðContentTypeHeader,
# "'c È-disposition> 7 D > òtransfer-encodingD > T E 	C ¢message-id4  –  M (ID5 ’}

class  ¡Registry:
Ô a"""A hå Ã_factory and # r. B."""1 ñ	def __init__(self, base_d D=Bas3ƒ default ÂUnstructuredŠ U¿  Duse_= ¡map=True):¯  # ³"""Create a§ º òthat works with the Policy API.Â  D ³ 1 is' À  A aill be Rlast  !in c| d� =$ P's __\ ªs__ list. n P óused if "name" (see __call__) does not appear • ¨G E ¼ñ rols whether orH  #mÀ mapping of } Es toP ²specializedì  esÍ @copi° An toŠ  h 1W%isM Dd.  The" O  ë§ v ¯   l.^ E= {}O   wl' =“
% ê ( 	 + ;if „~‹ ….update(nR_map)q 3³map_to_type6 bZ, clsÛ  er " aœ|  for handl¯*x s?[} °.lower()] =m ¬ •__getitemâ / § acls = v‘P.get(' V ,  	a)bqreturn  '_'+cls.__@ ƒ__, (cls@ ÖW), {}R	O?val,’ instanceDú  'z �' from 'D 'GnsoC 1by Ë †/a §uparsingû  ^�represent9  ‚; fJÆ Z Tombin" FG ë  Ð  _ ¦ õ5theE 	ž,ù0pas¯ Ì  â#coËe" 'sfç'orAÇú =†]6!, c ð#)
# Copyright (C) 2001-2006 Python Software Founda„ñ
# Author: Barry WarsawL ðntact: email-sig@python.org

""ó"Various types of useful iterators and gen ô."""

__all__ = [
    'body_line_9 "',  Y �d_subpart Cwalk* ð# Do not include _structure() since it's I  ª ñthe debugging API.r ó]

import sys
from io  ô"StringIO



# This function will become a methodi ðMessage class
def » q(self):x Ð"""Walk over œ m3 °tree, yield© Seach !.
; 1TheO ò is performed in depth-first order. ´ � Ais aB ¡ ¥ ˜u  ¥ & !if �.is_multiJ(¿  / 4forš  ~  8 È.get_payload+  / ^ bÐ )^uese twocSs areŒâ !to+Inñ.py interface module.obó(msg, decode=FalseË 2"""Q e� ë �s, return‡s
 Û  s ½@-by- — Op#ald ¢ (default m ®úassed through to 1
�`Bmsg.1B T� $ =‰	P í  )Ô 5 ãif isinstance(C S, str %   ²
/  µ ×°l@main  €='text',¤  ?Non}	ñs with a given MIMExoTUse `c A' as  +  b�match agaò 0; tÄšAs to"¡ E".  Ä@`sub¬ '· Ÿ  W  !ifI Öomitted, only‘  J  I Œ /edç Šà€content_í  [ d() ==   Ä;  &  �  z ·	N Ý M  
L  P £º }g0fp=k ¤, level=0,§_{‚wA handy¢4aid˜Tif fp¿ “  fpø‘ys.stdout�Ñtab = ' ' * (} B * 4ü`print("  + M ¬K !ò(), end='', file=fp9  1f¿ … U •' [%s]' %Y è _Y 	Q LelseC 	! !ifI zÍ Ëy�¸C, fpœ-+1œð)
# Copyright (C) 2001-200ð<7 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@pyG ñ.org

"""Basic message object for the 6 W pack ò	model."""

__all__ = ['MC ”', 'Email Ä]

import re
 $uu
 ó quopri
from io * ôBytesIO, StringIO

# IntraŒ ) s9 §  _ util Xerror Ä._policybasey P ¯, compat32`  Ãcharset as _ & ô ._encoded_wordsX  de C_b
C> == . ð

SEMISPACE = '; 'õ ðRegular expression that matches `special' Œ ðacters in parame ,Êð
# existence of whichç ce quoting  ô: “ value.
tc ps = re.ñile(r'[ \(\)<>@,;:\\"/\[\]\?=]')


def _splitQ (  ):
    # S w header¬ ó.  BAW: this may be too simple.  It isn'tG ðstrictly RFC 2045 (secQ 5.1)Çó liant, but it c8Cmost€ sM fP < ‘wild.  We‡ ðeventually need a full fledgedÁ Cser.H òRDM: we might have a Hë Phere;x  now just Ä ‚ngify itC °a, sep, b = ;`.partiÜ Q(';')m `if not. Y ]�return a.Y ‘p(), None/  b& "
²Xforma³,=E ,,ce=TrueË¡"""Conveni[2fun toæ „mat and y Q key=Wq pair.
— TîBwill_  °u  à €eeded or  «�e is truf) 1s aL Ðthree tuple (Óset, languageÍ  ),r 3be ±¢ accordingI oU 2231 rules}f7 cSÙins non-ascii{!t X rlikewisxe + ta @, us‡ ~Qutf-8W j!nd“ 0a nvÍ - ˆ ÷i  °|Alen(sV) > 0(3# A(pis used± ô  õ ¸ Ij0s wÄR item9 }  # ‘p%. Í @is aÖAing,½$a  J   �# instancãÚ †‘ Ì sq Rnever5`d, per¿  H Tif isK ,ó ½ %   1# Eµ ÔF v !   	y += '*' ‘ " =y.§ @_rfcGv 3[2]z%[0
 "1]Ä \   $ð	'%s=%s' % (param, value)#
  Uelse:   :try   ùvalue.encode('ascii')7  except Uni$ E* ^ErrorM Éparam += '*'D j ƒ = utilsr ‘_rfc2231(‡ Ë, 'utf-8', '…  A ñreturn '%s=%s' % (p !, = µ ð# BAW: Please check this.  I	 n õat if quote is set it should» q# force' €ing even7 ånot necessary./ Q òor tspecials.searchâ )4Ò H"%s"Ô &  ; á ÛI 
6 2 BÁ

def _parse #(s© ð# RDM This might be a Header, so ò now stringify it�s = ';' + "(s¾ ¡plist = []5Ñwhile s[:1] =/   @ Bs[1:*   ÷ end = s.find(';"H    õ> 0 and (s.count('"', 0, end) -  '\\ V) % 2{ m B B + 1É  #  ifV O < 0; 4lenö  - f» V[:endÑ ºif '=' in fB çi = f.index('=é J `f[:i].uÑp().lower() +O …+ f[i+1:  k : ~”.append(f? Ñ s3endu$ µ
%!un”s™¼ #'óis different thanð„collapseò_B �) because~qdoesn't° ð # try to converL eé  2a u�@.  M‡`ge.getÃ@am()F  s °re both cur©  ly defined] ÷ Ãthe tuple inM   Àface of RFC » 2RetersùÒif isinstance#,I U ‹d 3[0]ÄC[1],0h@ 2[2]¦Ä+	1 ´)



class ¦¢"""Basic m6‘ object.
â A  �as someth	õthat has a bunch1822J h#s‰  a payload�òt may optionally have an envelope ; F p(a.k.a.| x-From or  _& )S  f ˜Ñ i• ñcontainer (i.e. aO �multipartG aì �/rfc822),G n °  ÿ  a þ à JJ 6¢s, otherwiÀ{  •#ngQ4 f€s implem‡ » €`mapping0terbñ , which assumesu  k ­ðexactly one occurrence of thôe header per message.  Som õ4s
    do in fact appear multiple times (e.g. Received) and for thosK ,L ñ you must use the explicit API to set or get all# ¦ bs.  No !ofM  @ ñmapping methods are implemented.) 1""" ñdef __init__(self, policy=compat32):)  ÷    . # =( 
 _š [ = [] û unixfrom = None payload @char: ¡# Defaults]„4art»­º ¡reamble = Ê pepilogu ‘ zdefectsÉ q Ì content typÊ d” _ ñ = 'text/plain'
õ t3strsb‘"""Returnç`entireÜ dmattedØ Â as a stringÏ ä Ó  rE ç 2as_+ &()€   $ $, �²=False, maxËUlen=0 (¯ , ¤ ¤Optional '} °', when truƒ ²eans includ÷Unix From_ envelo|® ò.  For backward Åùibility reasons, ifá & i*ónot specified it Ïs‹e0, so ²€override' ¶%lyá !if+ Ðwant a differ4\B.  'R°' is passedk &thXðGenerator instance-' ‚serializ!³;á  itQ 5not� ×  'v € associa^AwithxG n !isq .@ ½)If* aobjectôains binary data tha‹ … encoded“ `accord®pto RFC ß adards,` @non-Ä liEO öwill be replaced br0uni`   "unknown 9qacter"  opoints4œvemail.gqemport ‚º ?K #if { ,S else ; afp = S¾EIO() 6g =i 2(fp  n
 pmangle_° _°D * Æw[ È = š 0.fl‚n#±=	 + rz¸fp.getvaluew‚__bytes_lJ$C  sË…  Û2.ast ‡  ð self, unixfrom=óFalse, policy=None):
  õ+"""Return the entire formatted message as a bytes object.
C ñOptional 'unixfrom', when true, means includeg õUnix From_ envelopeN ¢header.  '± á' is passed to? Bˆ òGenerator instance u$ K ‚serializu Ë ð; if not specifiW #he€ associaû EwithK  A p !iss .& 5"""  † email.g« jmport Á 3 ñ ƒ = self. $ifœ 0is ½D els° ; Bfp =W EIO() g .À(fp, mangle_£ *_=v B 0.fl n(• $, ã=	 + rHÒfp.getvalue()&ñdef is_multipartL …@True¡pÂconsists of C 0le G (s.q $isf ó ._payload, list‘ #"'# ‰2lin…  ³ Dset_ç M ÿ ½  .( % =#ü gI ? · 
F ; Š 2# PÂ  ·Pipulaou"  ¬ cattach¦ ó f a"""Add>cgiven # Stcurrent ÞKThe  ñ will always be a[ Ÿñs after this methodp sðis called.  If you wantˆ 1set¡ › ƒa scalaru,pK  Ÿ, !()–2ead j "ifT T L 2 „S C = [ ]s  {
4 :try I ƒ.append(M 0 * þexcept AttributeErrorQ ’raise Typ! 1("Aï Ç  Ë¥valid on a± ¾& a� m  b" non-W%ar") [ ¾½ `iF‚, decodeB
mT€a referež½J b ZheitherZsÆ or a string>Rmutatº à  9 é2 bamodify]Å$'sëÄ in place.  Êð"i Ÿÿ s that index inË A   `a flag; picatingà  « ø †should bÉ \dõ °not, accord@ ~ ñContent-Transfer-Enco! ð header
        ó(default is False).

  ð
When True and the message. ñnot a multipart,  õ payload will beJ ñdecoded if this header's valuO õ`quoted-printable' or `base64'.  IfN ðsome other encoding’ Pused,6  ª b   qmissing € — ¯ óhas bogus data (i.e. �  V !uum !ed% )ñ “ J ÷is returned as-isOIý 	D@c+A flaÕ  k Vn Non» i .† 5""" Q# Her[ alogic YB for† ” , â Ad onÁ°email5.0.0  :O 1  i¡ T is_mþ‡  result/ - !   -    G ö "  ‡ ‹  - £  5 !     -  P"  ÷Z _Ò�(a list)g  1: âelement i (a M:G 	O ® rerror (g‚ á ; ÷ 
; ÷ î 1 l 1  ˆd (bytesè ðNote that Barry plan Ñto factor out~'E ‘' case, b aVòisn't so easy nowY €we handlh qe 8 bit¦ø, which needs to”�# convert˜an both… „ �Cnon- Fpathiˆif self.&(). Ã#if
   #
‘  @if i³ r6 y w¨ ? Oelse7 5[i]: ð# For backward compatibility, UsDtinstanc	2is ŸL  * Sead oíAore }*al2ItestQú  ï þ  ˜ R  | (ù ,–
ï °raise TypeE>p('Expecá Aú, got %s' % typeQ )³û=ålñ# cte might be a HÏ,˜ ] —·stringify iç  8 R= str| ñget('content-transfer-göing', '')).lower(Ÿ $# ¡ 0may� rZ hereQs;1 ,{ Ð):
          û  if utils._has_surrogates(payload):
  b 3 = 
 õ.encode('ascii', 'I �escape')F �if not de: e  t ?try   { 4 = � .L ð	(self.get_param('charset—   ¯), 'replac™  ] ÿexcept LookupError‰ !n Oelifý ï lÏ 0UnimÐ ô!# This won't happen for RFC compliant messages (
 Þ Eð	# containing only ASCII „ ò points in the uš � input).O £If it doesœ R, turB 0strg ‘into byte[ _a wayM ¡guaranteedˆto fail{ sCraw-¾ -ìä!re» Æ¤ úif cte == 'quoted-printable'ƒA cquopriû(¯ 	jY kbase64O €# XXX: tÿóis a bit of a hack;§õ_b should probably be factoredÆ þð
out somewhere, but I have]€figured % ! J yet~õvalue, defects =„ •(b''.joinê æ.splitlines())ø  ‰  ÀD  n
 sL ' 6âpolicy.handle_, P‡ 
[ „© ý l’in ('x-uu €   ! 'g°in_file = BÌ%IOê 
� <out) 
! F#uu0(h ,‡I Ê, quiet=TrueJ  $ð v  eü (+ o?uu.kb# SomeÐ ¶ M5lemC l   p Ð  Ôif isinstanceª[, strHA  ~Y Qdef s6ù÷# #, FW=Nonef a"""SetÅ+ 1 to agiven  !.
b  Ó „OptionalP  s s0 L 'sòAault# Pacter% e.  SeeH  ª “ !()¤@detaÉ# 5""" ðif hasattr(payload, 'en—code'):
  úif charset is None   + óself._payload = 
 	H  ( ireturn Pif no[ “instance(n 2, Cw �  H # $ =$ 5 )\ ‡ ‘ 0.enã . ƒ.output_O = ³if hasattr(D P, 'de< û .. ö('ascii', 'surrogateescape'n ;elsTU Ý 
” @˜D %seÞ õ !)
G Hdef   / ,ês¤"""Set the 1 of ± to a given" Pacter[ .i °„can be a· õà, a string nam aM A, or¸  O  í p.  If i:< pit willd ’converted  Lq .M Ià,ß p parameÔ [ Àremoved from+ K ðContent-Type field.  AnythÒ  çŸ pgenerat	 + WError.²The message0  3BssumÍ !be‚ d rtext/* Öed with� À 7.inã 6$0 
O 5andh  properly, ¾Ãeeded, when Ú  ï  2`plain ¦ H árepresentationÊ ï ð.  MIME headers ( •-Version,D h%,  �ransfer-EåFing)>‘dded as n­ ý5"""V 
U d
é "Q.del_#('1É œ& R! =1c  !  B w ü	„ 3 ‡ Hif 'Z'ƒ n 9 õ  Badd_“(8 g, '1.0 Z �?ypeZ 	8 0, '7/B'û B ß = Z.get_Æ/()n ÙR 9!!=·?set4 \ 6À Rbody_Ô(’ZÅ 	høuJcte £ Ðbody_encodingG()
  Itry:   Šcte(self+ þexcept TypeError8 ý-# This 'if' is for backward compatibility, it allows unicode… ñ# through even th �that won' ÿrk correctly if thG pmessage’ ½serialized.p  payload = û #._ ( 3if   =R    : $ =D 0.enþ ú('ascii', 'surrogateescape'… E   �U=� )   v ó charset.output_ r 	3 = ) c.body_Â e = ðadd_header('Content-Transfer-E±ing', cte)
tedef ge• ‘s€"""Retur2e CÉ ð
 instance associated with 	%'s}i  "5""" rW ô ê “ #$ ò# MAPPING INTERFACE (partialþ (  Á __len__½ òtotal number of (ÿ	s, including duplicates.«  1lenb .csC“__getitem† y, name)ISGet aw r value.ñ  fCNoned* pis miss   x0ead¾ 1rai 2an ¥7ionO QNote Æ±M ñappeared multiple times, exaàQwhich� – poccurreëRgets µ edæñ undefined.  UseF€all() to  zI 2theó ps matchÎ Qfield10€ +Aget([;þs| ,p 
�1Set¢| E‚ 90: tañdoes not overwrite n0ist¿ @øQsame Ë ö  © S__del!p) first(AdeleX Iy exY s”max_countBrpolicy.Ž _ % Å  5if  •  l¥ " =[lower¼@foun°0×  7  vsk, v inÊ‚ s^  + Sif k.Z A == r '  + l I+= 1m     2if " />=Ï  '   $0e Vj»ð
("There may be at most {} ¿  ¢G  T"in aðà".format(max_cãount, name))
  ñself._headers.append( rpolicy. Ð_store_parse(C �, val))
I ñ def __delitem__@ j :!  m ò"""Delete all occurrences of a h Ò, if present.]  < ðDoes not raise an exception1 3the@ È is missing.z   ¼ ! =v.lower(2new† es = []4 Áfor k, v in 0Ý  ¥ Dif kT " !d 
"  & e n(\ “ ¬ — n�containsoireturné  À [£ × ]h Citerd )Î  < Qfield ue[ y+  1 \ Akeys+X B"""R¹ aa list0ll â”message'sìP â s,ðThese will be sortedŸ  C PorderM  y ë(ar eiginalöo ð, or were added to@   ƒand may �¶ duplicates�2Anyý 1s d d 7 qre-inse¡ aa Qlwaysš nk ”˜  [ 5""" ó0[k Ÿ V ø 	—Û_value�+C |ún
;Sfetch; •q   ¯ [®1GetQ ß•"sm¬ÿ y°±#1getÞ	ê, failobj=NoneòÃÕ¨S Like __get“__() but ìU € instead/ ` ð when the field
     ó   is missing.
  5""" pname =  ….lower() õfor k, v in self._headers:#  R Dif k< " =L 
"  & SreturH rpolicy.N Ð_fetch_parse(o � 4 �failobj
v # ð$ "Internal" methods (public API, but only intended Ï ‘use by a o rL òor generator, not normal application codeD#Š Àdef set_raw(,F†, value)�"""Store B and"  Vðthe model without #ifs .h  >@ThisÌ@an "Ñ ù é   à î å  µ  F ù ² Ñ�.append((Â )  ç ‘raw_itemsé 
Ü RÙ Ë 	?  ßo pairsà Cµã ?Aiter¸ ï ccopy()á R@Addiêò al useful stuff$qget_allR ó¢K=Nonúàa list of all ,&s•   yyd field÷ôese will be sorted8PorderK y§8ear aiginal»  ù�message,~âmay contain duá‚es.  Any‚ `s delel 5andE qre-inse„ ¡are always} € toŽ ÷ ð Ê ¤If no suchc sexist, ; Ý°ñed (defaults to TáDE= []¦  IÑR} :OØÙitN×  u �3add•�_ 1, _) @, **Y:ams´#Ex¤Asett#p  G  ” œ% � ’ðadd.  keyword arguments can§@used' 5setO a\–parameterýa ,+0 uniPcores­vwO qto dash¶N«!ly}] 5 adü as° !="…" unlessO   î  l,a¢which caseE :keyV u.  If aG } Q eñs non-ASCII characý $it1Çspecified asO °three-tuple9(< ¡set, languÏh )² Àse it will b3e
  ô+encoded according to RFC2231 rules.  Otherwise it will be : UusingP õthe utf-8 charset and a language of ''.
1 –Examples: õ8msg.add_header('content-disposition', 'attachment', filename='bud.gif')c P  < ' g !('æ  ˆ õ', FuÃŸballer.ppt'))@ | A'o 5"""{ ¥parts = [] õfor k, v in _params.items():%  ì  if% js None   Z ð.append(k.replace('_-ÿ  . ?elsD q_format’ Q 7, vTÿif _value is not¦  ¢ “insert(0,0 —`self[_1ñ] = SEMISPACE.join(= )�Cdef à � < !, = Y $B"""R2 a Âî  '°first matchx, ` found  # ø message, retaini/ QorderdÍcase.  If noV 2wasZ õ , a KeyError isõuraised. Ië " =ó v.lower(K T@i, (X)¹ àzip(range(len(..;Zs)),  9 +Dif ka # =r 
#  ' 	C  [iÃ rpolicy.`_storeæ se� 3¸  I   Ubreakø ­4(#7 ‘# Use the ðree methods insteadô Î th Rabovei#dCget_èQ_type8•W@turni  3's 4  4 h0The4�urned strai. PercedäÇ 5Ÿ  „Ñ  P`mainU @/sub '\ 
 e OCno C™CTypeì &th`ª ,· qdefault­ Ð as given by þ  þ )g‘  reþ ­ed.  Since²d 2045,ós always have a ^ O  Ó R thisi - e 1 a _P1RFC`  H dines ai  's ×  toõtext/plain unless it|  9!ar id� Pmultivq/digestÖ`ainer,PRwhich« €mould bcr/rfc822Z ÃÃð missing = objecSt()
  övalue = self.get('content-type', missing2 2if 5 $is :O  V ù# This should have no parameters- ereturn �_default_~ § c ‘ = _splitL († §)[0].lower. õ,# RFC 2045, section 5.2 says if its invalid, use text/plain� 1if u ú.count('/') != 1ì ¿ 'A 'B  F 
 ƒdef get_cP_mainÙ (~)Z B"""Ràthe message's 0  =  9 .X  vt0is 2 `)    'wAt of rstring ˜ Qed by–  > –  9 5(). 5""" Í /Ë 5 ( d B´B2[0]² 
1subB 	Ø 
Osub-	X ~1	÷Å`+ '	DMost4s#a 5 	4 ùÅ, except forÇq ~ð at are subparts= Pmulti q/digest^ Õainers.  SuchI 7 � q /rfc822„\ &.0[9set a,�
h?SetWúÕ¶be either "új" or "Â ö ", although thiüÿis not enforced.  The§+ �stored in° YC®¿Type header6/" =7_]£s_preserve;ƒfailobj,d Ea# LikeØ; t() but A  =`e quot}o> "6BAWô#1 '9 beºõpublic interface? Ÿ� = objecÛ
Ó!s} ð U = [] Pfor p¦a_parse# «í  s:try   Pname,`S = p.9V=', 1� (    , 0 =  .Ûp     ðval = val.strip()
     ôexcept ValueError:
  ý# Must have been a bare attribute2 ýname = p.strip()! ‰val = '' ð params.append((E f, val)@ # ò = utils.decode_ ( - rreturn  
k tdef get2 ö)self, failobj=None, header='content-type', unquote=True)$B"""Rg ó the message's C> BType‚ òeters, as a list.’  eðThe elements of K ½ !ed,  oq2-tuple" Pkey/v³B paiW à  N �split onG °`=' sign.  f 0lefÉtnd sidel  % !is0 Ekey,J Qwhile Hrigh9 . ƒ A.  I´ �re is no P  u 5 inL  Ô Š T =  2   `empty /#ng¬   %asF ²described ià Í—() methodX„Optionalâm ¢object to f* iÀ ½{ 5.  V  U  õto search instead ofD Y 7W E  Z, %d.B 5""" ¢missing = Ñ hj@s = â%._&³s_preserve(> ñ7"if±s• & ñ b68� $if&/ c[(k, _Ó ÝÐ(v)) for k, vÒ· ]R OelseL ) B	Ô(ñ ,Á Úm  Ú  ¤ ìƒ ÍÌ  DEfounšìU›KA, or?z  1 hašBsuch º ÍÇá Õ	ãÚ PÆ ^ Q keysºðalways compared case£ensitivelyóYŒ Yó can either be a%î 2a 3 ~ G•uwas RFCL p2231 en0Àd.  When it'ŽD |ˆ„  €È k ðform (CHARSET, LANGUAGE, VALUE).  Not>ƒat both + E and– 6  å 2be ƒ‚in which)àyou should con¸rd  Áb}Ý  H   ðus-ascii charset.  You can usuóally ignore LANGUAGE.
  ò#The parameter value (either the returned string, o ÕVALUE item inN  2 õ3-tuple) is always unquoted, unles  # åset to False.
J õIf your application doesn't care whe¥ Á Åwas RFC 2231L Pencod~ i<  n Ò Ý ö cinto aè Æ as follows:•  41rawo ± = msg.get_ u('foo')u  ,  ð = email.utils.collapse_rfc¦ _t(W )n 5"""N õif header not in self:  m ª… failobj „for k, v5 %._³ ³s_preserve(6 ,f )[ ò if k.lower() ==1 
+  Š $ifò    ª _v; ( OelseB 
væ S Ç DUdef sŸ 1,º ,òí ñ='Content-Type', re¯e=True,c  ’  ñ	charset=None, language='; aplace=ÏF‚"""Set a� l!in„| ~
 TI6 àalready existsÕ   R, itsÜ … will be¾ !re™ ad withy 2new, 
o K  š	š qand hasÐyet been defi dEthisn pmessage‘ Š  ‹ éÐ"text/plain" V  À  Œ ä %ndJ D €appendedŸ2perë7045Ã ÃAn alternatePú can be specified7¡ argument,� 5all~ ” sƒ � 0necç $ryÖ8 < – 3If 6  ‰ ,Šf e ²  according:5RFC™  :P.  Op%al…ä sZ   ,´uaultingM !to- Sempty u.  Bothµ  ©éq shouldRsO´­¡sinstance(Í#,   T 
æ' C = ( dº%ÈÉ¦ ·#'cètè
t c F = 'Ÿ'!‰/  V (n Ä!if+  $êx4 
‰ 9 a 
  } ¡ = _formatP ( ¾Àote)
         `else:

  ýctype = SEMISPACE.join((  4 [- ñ , _formatparam( õ, value, requote)])B x G U = ''%  _ ƒfor old_R   V Â in self.get ’s(header= ,G  K  !un¯ =·  Sappen” ³  h &if¶ Á.lower() == Ç  Y  ; ] Xê ^ Y   ] 	 \  ,¼ g½e qif not ¸Ê  8 = u G ¬ ? †qV Z"if“ 5 !=!)§ Ÿif replac [ _QE ,_ Ë WÅ 1delƒ [A ]ü  f  " =Y 
& rdef delÚ(( ,<", M  ='content-¬'¨W=Trueé ò"""Remove the givenI ñeter completely from$ CX Tm .•  ê 3The‚ ð will be re-written•Q� withoutQ To aor itsá  L bR. All*sS �ôd as necessary unlessM& iH ôFalse.  Optional¡ ðspecifies an alternatio™ ê • ò  ¡   5""" $if[  ú‚
Uereturn2 Dnew_ÈÚ Ö@p, v1 ÝÆ ŽDif pO òl 
š  Í ´– "  &  + =×5, vj
 8   R Ï ²
	� 
d  $qÑ- « µ
 ; ±W   µ@set_’´  ³q³
"Se;Pmain D � and sub  > ÎO ™ª+ @must¤ða string in the forð m "maintype/sub ó", otherwise a
  õValueError is raised.
 ð*This method replaces the Content-Type header, keeping all% F áparameters in F Ð.  If requote{ €False, tq Cleavh …existingL l 0's : m „s is.  OÞ  E 'e t qwill be2 ued (theO ‡default)ô ÔAn alternativÝ @ canD �specifiedÊ  	� õ argument.  When`  # ,  ò öset, we'll always also add a MIME-VersioM l .] 5""" ñ# BAW: should we­ etrict?$ pif not õ.count('/') == 1:%    P# SetÜ	Ÿ, you get¹ #if$q.lower(t #'cD � '� òdel self['mime-v	%']‰  ¦ ! *¥'] = '1.0') { û !inW 
m H \ @  � ?  h Vretur†Z1s =J R.get_ (C = @, un£#e=å)T Ý * Õ ‰ 	a# Skip{RfirstáR; it'’2oldÚh €for p, v«£ N[1:]ü $.sÄ (/ ,¬,Ÿ)0defä _filename(¯ ö , failobj=None)] A"""R8³ 4 ñ associated with ð payload if presFr  }DThe r  6`extrac@ Afrom@ `³DispositionÃ %'s`E ': �€, and itX ®d™CthatD   Hmiss… ÖQ À1ðfalls back to look° –‚`L• ß‚ ¦ = object(OÙ ’$(' 3', A %, wd/'N )ifo7 Ø ”W r  Í n  Vg xaÊ ð	utils.collapse_rfc2231_vÑ(¢ ‹).strip(Ã�boundaryÃ4 Ã#> ?is ÃTOD's `6 ÏÈ¼Àted.
       c """
  õmissing = object() ôboundary = self.get_param(' 3', A 7 4if  4 is  :W  y åreturn failobj ô# RFC 2046 says thatM õies may begin but not end in w/sE \ ôutils.collapse_rfc2231_value(¡ ±).rstrip()
@ „def set_  (ù ,ƒ &y)Æ ¥"""Set the  @eter“ öContent-Type to 4.l  @This%ð subtly differenX €an delet� f 	P ¡header and·  K 0add+ ò a new one with  Ï ¢ ‚via add_J …().  TheN Emain�  ce¤ �u- � 	'ð) method preserve¼N  or® !of/É !in ÷original message*Hò  ParseError’ ‚raised iX 4 � has no g  .ß Ñs _$s_è (ÿC, 'cñYtype'G #zOre w¹ ,êð we don't know w l Õ  #káset it to, so &Ö an exception 3   eU,s.g?('NK  fç 3newç E= []” ' †p = Fals for pk, pv+9 \ – ÷if pk.lower() ==@
)  - } ‰.append(¢…'"%s"' %©)ž >   ¨ 6Tru§   Oelser Ï [ !if¢Z 
B ò î« @ hadÆºšattribute½a# Tackð!onDðend.  BAW: should8ä¢ ä É# instead??? Y'’# Replace• 1xisÊë © S º „ 2new¡ …	WQr h, > £.ÈshIif hD	¤
,  Kpartj      ²kr B  + Aif v²'   $ j ®k� $ z    	B `'%s=%sä(¥ † + ð     val = SEMISûPACE.join(parts)
  ònewheaders.append(self.policy. ù_store_parse(h, val))
K Yelse:  h ] ? )‡ m _g Fs = 2 ` ðdef get_content_ch… t¥ ö , failobj=None) ã"""Return the 3 Ñ parameter of CT b-Type ƒ .v  ¼ QThe rF ñed string is always coerced to lower case.  I[  re+ %nok  `, or i/ #at~ ~ has no² ,I ò  _ � . 5""" @miss³ –= object(t!= ~ _#(' 3', ? 5 %if— $is s 2‘ •Š ãif isinstance(c h, tuplµ B ð
# RFC 2231 encoded, so de ð  it, and it betÉö end up as ascii
 M pk $ =º 0[0]uA'us-0 '¤  0 :tryÐ   ò# LookupError will be raised¾aÖisn't known tü G   à# Python.  UniÒ U 	 Y text§ K  aains aÝ  acanot inÜü 
 ; pas_bytel$ B[2].n r('raw-u� †-escape' ?   8   =(Q $, q
2 ‡except (H,)vb 
 5[2]#ò 1set ú Ps mus ÿ Þe range7 ß[ ü 8 ò ¼ ¯
­ óÈÑ046, $4.1.2 s6¾`s are ® 6– sensitiv¬ W ¢ b(rL sa list 9 Q(s) uÓ ? áoessageK ñof items describes{ì sjÔ Žffor tht ä1allM 1sub¹ Ù5itsÎwpayload  AEach� ¦`either­a§ ð (ñ Tvalue� ` GÌ  <  atÂ  t)PW E '®', |�(defaults;¸,H é @ doe…t have aL °main MIME t¯@of ""G ‚ Ì àis not definedC.

  õ4The list will contain one string for each part of the message, plusL  6  /  " J $er, ð (i.e. self), so that a non-multi` K a –  stœ ‚return a¯ Åof length 1.6 5""" / [W P.get_’ ñent_charset(failobj)â  & 1 inŸ ‚.walk()]%Hdef ? Ádisposition(Í :s B"""R¥  Ã !'sVGent-; û if it exists, or None˜Ã ôvalues can be either 'inline', 'attachment'I “ `accordÈtrŸe rfc21834j " =Sget('5» %')^ 2if 3 !isÀ  ^¿  Ù 2 ñc_d = _splitparam(A ¶)[0].lower(^ @ 2c_dŠ0# IB ‘¢~2 ..Í ðfrom email.iterators import 0 ò


class MIMEPart(MÆ"):`  Y �__init__Û�, policy=Ã )Ý #if  ø ‰ @ † udefault %" ,=  0sup.’ * &)
­ 2as_¥® @unix} ñ=False, maxheaderlenÄ Ñ 
¹`entireemattedÂCas aª OpDal '€ °', when tru† Áeans include>õUnix From_ envelope± ). ½  h reš ed˜ ð backward compatibility withb N Sbase ç þT, butmAs to¹a, mean' – ¿oàP  Þ@max_{_€ #@rolsy  ¿  ½ Cimum£B.  'O E' isM `passedƒ  p 2Genµ³ instance u ‚serializ>X;CN àis not specifiX $he§passociaÌ#Õn š  y U £VÇ # D els} ¡ f!0lenÔ XW l ³# =À .sS "+Š
ÿ)C_BïâY Felf.V ï =x. ÷.clone(utf8=True)[ 6is_š¢a J h� × ÷ > {k@c_d.ˆ àf%==Àent'

    deóf _find_body(self, part, preferencelist):
  !if" ÷ .is_attachment(!  ( ereturn4 Ðmaintype, sub	 " =E Àget_content_ Õ().split('/')? 4if B ¦ == 'text'’  q %if[ +in½ 
*  . zyield (ä s.index(¢ )	…  8 × ˜ �!= 'multi?�' or not R * )Ç  Q {relatedì 0forí  i  í �art.iter_ sb  ¸ ð Bfrom’ ô ub7 ñ} @ ø '› ‚ 	,
o{ kE mõcandidate = NoneŽ Xstart>qparam(' 
3 
� :‘ "#['©P-id']ˆa   -  À sbÃ     Ubreak 6if 9 !isú 
Á L sjyload(«I =-Vs[0] Ñ as elsee ‚  Ä €
† ÔOw Qe @def õp	>%=(÷, 'html', 'plain')fA"""ReW best8Amime] îÀdisplay as 't á' of message.
“  Œð Do a depth firs¹aarch, ä�ing with=`, look  ` 3the2  $P Pmatch$ @eachs  ( ^items0b, and c ( 	J  correspondO !to" ¤  P Á that has a u ,{ ³ ê0no % s˜ Dhave* e.  If n1 is³�included© …considerP  ¯ Brootquof any í/%À encounteredŠa¯J ½  “ BgnorÁsu"'C!æ-Disposition: |%'.E 5"""  »_prio = len‚- f Ú ;  
É7+	»ž T )  <¢‹ 
G % ¦  r ¿     Ÿ 	    b N== 0[  " 
`dÀbody

    _bþody_types = {('text', 'plain'),
  & Ohtml% �multiparP related- áalternative')}ƒ ñdef iter_attachments(self):   ¦ Á"""Return an- ðator over the non-main ” us of a ¤ %.
G ASkip1 Pfirst( ð each occurrence  (/%!,   .X /ù F, orn /â 1 inn 3 … (unless‘ öthey have a 'Content-Disposition: õ
' header) and include allN  rering sub‚ r=%ed<õ.  When applied to aH ° ã A  n daexceptß Aroot 5.  ¦M Uemptyx , wv ;'or‘ àt.[ 5"""  ú  í,ü  	 0 = Eb.get_cZÕ().split('/')? 4if B U != ''Þ2subS 7= 'à'¡ ¥$S xpayloadˆ  (x `# Cert»òmalformed messages canÀ  … 0set¯`£ 5/*`u ²# but still; asingleŸ` body,•�which cas ¦ p.copy()s L ö	fail with AttributeErrorƒ:tryw#= ë X T 7
O 
B #< ð is not a list, it ömost probably a string’ Šv Þ=Þ LßÕÛc# For  ð, we treat everyths x Œ as©¼
Ÿ a# The ) Àmay be indicFp by 'st[@; if`0re'   Ž%weÙ  í #µp't find0 0 naF/ ,¨  ™ ô1 as,  … 
� 8 
µCram(• º { "if– 
Á  @founûJFals¯    œ)[]Ð  ! 2for³Ôb  ' !if&  ä#('%�-id') ==š  8   ¢ >Tru¡  ! Oelsew   Ã €.append(û
  ) 1if k K §yield fromê  A  _   r ss.pop(0y À       yield× from parts
  ereturn ÷4# Otherwise we more or less invert the remaining logic in get_body.L ðThis only really workI ÷ edge cases (ex: non-text related orH ñalternatives) if„ @send‚ õagent sets content-disposition.G ð seen = []   # O– AskipL öfirst example of each candidate typeJ 1forJ ÷ R:e  Z  1 P, sub	 ! =/ .#£ _ Ù().split('/')C ]if ((H )q Qself.jD Ys and<  ƒ   2notw ð is_attachment()1 š  % 0in )Æ  C   ƒ.append(Ì 
¨  %  Ò Iinue… Qyield 
 ‘def iter_0(Å p A"""Rˆ1 an' ðator over all immediˆ1subA  £pa multi .e  Ž H VemptyN  µah7  2   1"""§   0if Ÿ E.is_* (­  $ ß S,  Ú’payload()�  ò     x ( „, *args,©÷_manager=None, **kwi ,if( @ is + 
ªb M " =À {policy. ç rq ¤¦³ � Û Cset_< 
(  Ž Û aƒ .¬ Ô W_makeõ³ùÓ, disallowed_ ºs, boundary¸ : K_Ìu() == 'Y'Ë„existinga ÌI (Š�  / =³ 4 + Ì,C =if € /inD 
µ   ra2ð ValueError("Can]"co6õ{} to {}".format(‰ ?  € C)« Ákeep_headersÐJ    ýpname, v£ HH 
Ñ 0if - .ìr¥t7cwith('\'-'ñ¾ € 7(J w Å  3 Jelsey   ß E !ifbó 
L ð # There is exis÷ting content, move it to the first subpart.
    ð = type(self)(policy= . )2 À._headers = B  )  ¡payload = R _ 	* 	 @ = [T ]# Uelse:  ½ 1 -  Ÿ MkeepŸ  % 2['C/ð-Type'] = 'multi} @/' +1 z ÿif boundary is not Non› ´set_param('2 %',= !)
S ñdef make_related€& =\ )ø  ´ !._1 § #('< ö', ('alternative', 'mixed')R x 0 | "@ € q ,r " l ":  f ^ V_add_ ,`, _subÁá, *args, _dispXg, **kw^1if ˜ S.get_HP_mainA H() !A' orÃ Œ  t 	> ~ = Œ s  9 qgetattr{  ³  {/ (} ˜« . .ˆÍ (ø ½ "ifc and '+ -'�osition'ç!inç� ¼  b EDDisp4  Llh pattach(8 ‹ ºÆª s C èÿ5 w p='inlinï ˆ  p m ·q = 'Xe ì Omentd ì
Ó > R  y  ¾GBcleaE`1
[%‹! =ÇN ¿ V 	°(n, v) for 
 3 inêz | 0 !if]õn.lower().startswith(Œ/')· ö
class EmailMessage(MIMEPart):×  
¿i"upŽ 
='i X-Vers, ^ P  ø   [-  %ñ"'1.0'
# Copyright (C) 2001-2006 Python Software F ˜ð
# Author: Keithòx Dart
# Contact: email-sig@python.org

"""Class representing application/* type MIME documents."""

__all__ = ["MIMEApplication"]

fromw ö import encoders
 ô.mime.nonmultipart- „MIMENonM A


c«   Ak ( ) u):
    Û ¯for generaÝ   =  Ø  > ðdef __init__(self, _data, _subñ='octet-stream',u  ;  _ð = "s.	 ó_base64, *, policy=None, **_paramsÃ  J  Ç �reate an™%.
† ® � is a strÖc in xthe rawP  Þ @ ç  C  / ) C @ent   ! `, defa¦Ung to� 
Z rZ `a func2ð which will perform x bactual; » 5forc QtransZ"of- Ð œ  yM • €Any addi‹ ñ al keyword arguòá are passed tom  M  “‘ Ãconstructor,Ñ Pturns0 qm into á€eters on £…ent-TypeJ uheader.  q   %if… D <ó    `raise P éError('InvalidðÑÄ%')i   N.''ÊÑ  ™ 	 î}  iÑ.set_payload(Æ� R’)ßñpyright (C) 2001-2007 Pä` SoftwºQFoundÑÐ
# Author: An	�y BaxterN -!_udio/''^A1 C']

csndhdr0$io wBytesIO, @G&2
_t _� ÿmap = {'au'  : 'basicÏÀ  'wav' :'x-	 ä`'aiff'# 	 $ c$ ¡}

# Therez0oth22in º ò that don't have  —Ps. :(åÍ@onesµ beãÁG ð? midi, mp3, realaœ�, wma??
€whatsnd(—`"""TryR  id2 fye bQ file[g .E P() ha�Ðpretty cruddyðerface, unfortunately.  Thisá1why"Àwe re-do it ð.  It would be easier to revðerse engineer the Unix 'file'
    command  1use$ ðstandard 'magic' / ñ, as shipped with a modernT .N 1""" ñhdr = data[:512] @fakeJ ò  = BytesIO(hdr) ðor testfn in sndhdr. !s:   « Sres =&  : $, R D  $ 0if ' ¶is not None@    ‚return _b ò_MIMEmap.get(res[0]K '  @ °



class . `Audio(
 ÒNonMultipart)f A"""C* ðfor generating a5 !/*A ° documents..Þ ñdef __init__(self, _4  B°, _subtype=� ,2  Ì  @_encŠ= "s.	 ò_base64, *, policyB £ **_params¸  J  ¼ …reate an±  v 
¶ %.
€ £ � is a strí pcontain  q2rawO ¡.  If this L �can be deÉ Jd by‰‚Python `·'y@ule,% n H *P willQ ðautomatically includedd œ òContent-Type headerÈ ð Otherwise, you ¢ €specify s   #icÞ z 0via ’ ½ rBeter ¬agiven,ˆ4no N  v %beM °guessed, a ´ PError}hraisedœ òa function whichpperform¬ � actual 4  ¸5fors °transport o¹qe image¾ É ñ t takes one argÚ,h !isêK I:  in`"ce> pshould {Ñget_payload()	s %toJ Rchang­2 1 toË Ä 0ed Ü 	b palso adêyH  å Pfer-EJ @or os` @mess %asE 0nec pry.  ThÅVfaultOAis BŠ¡0AnyŽ i—¥al keywordC€s are paî{  Î Š{ ´constructoru à xvem intow ¤#õ &ypZþ œ   %ifƒ m †ð    Ì¶= _whatsnd(S ( I ÈÛ1('C Ì fi¦ I‘"'^ •.S'S'PZ  µ 	 :„ °.ªú £Þó)
# Copyright (C) 2001-2006 êPSoftw`Founda&ñ
# Author: Barry WarsawL ð	ntact: email-sig@python.ð.org

"""Base class for MIME specializations."""

__all__ = ['&  9 ò']

import email.policy

from    Âmessage



o E ( ".M# ):
    œ  0 òdef __init__(self, _maintype, _sub
 2*, ¦ ó=None, **_paramsx  L ñ"""This constructor adds a Content-Type: and a5ñ-Version: header.
Æ  N ;The7 # ¡ is taken /6the² Z µ J ðarguments.  AddiŸ1al À BeterÄt» c ;ared M †keyword U   ñ º   #if0 ¯  3Ÿ    L" =î•.compat32R ä.ªF = )6 c³ï = '%s/%s' % (Ô 0  ÷R.add_þ (('®1', P ój  : ØÉ ']y ð1.0'
# Copyright (C) 2001-2006 Python SoftwkQFound6ñ
# Author: Barry WarsawL bntact:2a-sig@pG .”C�ñrepresenting image/*  :C doc ®ŸI1  oimghdrš‡encodersµô.mime.nonmultipartÇ { DNonM Ðv (% Z2"""Ú  iogeneraÜ  hßFdataàÕ× :  _æ = "s.	 Ÿ_base64, ŸCreate an’û_£  >Pa strÎpcontain  ö2rawO  Í a.  If Å  Ì �can be de¯Pd by < „standard‹`é�' module,% n H 
P willQ ñ	automatically included i6 	¹ÛSð   Otherwise, you ¢ <fœ  H3ficÝ y 0via‘ ”š ÈB¨r@@funcõb whichÃ qperformS qactual 4  ^5for^ Qtrans¬o_e–  d st(Us one,h  ©5hisK ç0 in}"ce> ñ	should use get_payload()Ês %toJ achange¼ 2 1 to Ä  ed–mb @alsoŽE anyH é å Pfer-EÖ @or o§ð  headers to theÓ message as
  0nec õry.  The default encoding is Base64.
5 ö-Any additional keyword arguments are passed to the base clas{ ð	constructor, which turns0 ðm into parameters on Õ Content-Type� uheader. 5""" °if _subtypeÌ UNone:   à= imghdr.what() Õ, _imagedata)5 R `raise ¢ ñError('Could not guess U c MIME › '_   ñNonMultipart.__init__(self, '> %',× ’, policy= ,©  Þ  1**_[sw  ] ß.set_payload(û _!er‹ ð)
# Copyright (C) 2001-2006 Python Softw`Founda0ñ
# Author: Barry WarsawL ñntact: email-sig@pG  .org

"""C@  representŸÓ"/*O2docƒ.Ð
__all__ = ['XMì¢ge']

fromj t import ¤.mime.nonm�,  M ¥Q



ßˆ h (' ){Ë ! ÉKdef F_msgÅ='rfc822', * Êy  E  } treate aó 1/*   ¯  Cð e  =1 ó object and must be an instance of e, or a“rderived

' Ptherw9a; u NdŽ  OpH%al µ1ine9Q \  x”containedì è‘ ðBis "<p" (this{ 1def; !by| â �dard, eve”EoughO  s FtermM ÿis technically outdated by RFC 2822)º o d	üÞ!if$is£(Ô,®' +{Ž3('Aâ  ÏôÍð# It's convenientAuse cò  method.  We ne8Udo it[#4 0wayS€we'll ge„Q exce- .Ø q.attach· , û P# AndÁ€sure ourOõis set correctlyc 13_/ #('z /M'%2%I ®`ð for MIME multipùVart/* type messages."""

__all__ = ['MIMEMultipart']

from email.mime.base import MIMEBase



class @ ( àBase):
    """  + 1forB $ mp Ÿ  : ðdef __init__(self, _subÍ ò='mixed', boundary=None!  Æ s ‚  L  ƒ*, polic1 !  ƒ*_paramsÀ  : Ï"""Creates aº %.
M ßBy default, c9  ½ ‘Õ, with properC �Content-T»1and6÷-Version headerss ƒ is the )1 of o" cY ,§ eing to} `¡ '_ g_ P  –string.  þ e it isW ÷calculated as neededd  Ã ¼ e  a sequenceÃ  0ialÖ "  H ç Åpayload.  Ith ðmust be an iterable object, such~ öa list.  You can alway¬ ¦attach newu "toLIa by us:2he 0 ˆ() metho× ±Additional Ydeters Á 	è×± are taken ‰5theÛ ókeyword arguments (or passed in¢ Â& %).A  ý Ó  ª.f'Þ'R s8?5, *)ùã# Initialise _�0 to‹Qemptyv € ½MIQsuper '�p# impleå a?%s_› p assumeî&atl i£ Û bö #¶ws \.® F= []Ò !ifuvÑ :   ÂOp in   $ Z %p)� %if¸
T 0 Dset_V(	 ð)
# Copyright (C) 2002-2006 Python Softw<F 5ñ
# Author: Barry WarsawL bntact:ça-sig@pG o.org

¶ 	AQ that­6nota`?Nonc è¯ort errors|!\ Fnon-K	× À  ¾ �½ ™#, Ñð# The public APIÇchibits  i l•I }�# derivedq ’ @s si 1non@themo,z1def0on,ÖM À    # type mÃultipart/*
  äraise errors.M! °ConversionE (/  6 ð'Cannot attach additional sub_ ¤s to non-mP ð&/*')
# Copyright (C) 2001-2006 Python Software FoundaU ñ
# Author: Barry WarsawL ñntact: email-sig@pG ñJ.org

"""Class representing text/* type MIME documents."""

__all__ = ['MIMEText']

from i ò.charset import C " …mime.nonþ ,  r 5Nonfa



c¦   PText(	 $ !):|Ï ¯for generaÑ  °ðdef __init__(self, _	`, _sub³='plain', _ß ñ=None, *, policy Œ  T  � reate aU!.
¼  0 q ° is the str� Ë øthis message object6   9   e� contentÉ`, defaj á1o "Ì "G Õ G   `acter É`parame Padded¼ ¥ Cc U-TypeÇ  header.  T¸ x ïð"us-ascii".  Note that as a side-effect,O d Ðransfer-Encodi Ð will also be­ .; ¯ Z  u# If no¾ð was specified, checkÙ `see if„ 0re j ¦· Y %# #s ;.` „t, use 'ë �', otherwC  Vutf-8¤ b# XXX:,0canÄ ðremoved once #7304•Vfixed8 &ifÊ 0is ‹ ì   :try   c .eB&e(¤ )Ú  %   ä' =Ë 	& áexcept Unicode•e	v   . G M  ÿ 'õ ¯Ì.†'† uçmt,”  º  C**{'‚  ':Y(Þ 6)})Š  öÑ.set_payload(-ï�7�ð, Thomas Wouters, Anà�y Baxter½0A phòr of RFC 2822 and·‹8¼ P< Q', 'H² [Bytes 
$ v['Feed.  $ioãSÛ@IO, Î¨IOWrapper
 CfeedÝ ES !, ¡  9 _Dbasep £compat32

I­ ¨ùÀ_init__(selfó, _class=None, *, policy=compat32):
  õ """Parser of RFC 2822 and MIME email messages.
8 ú"Creates an in-memory object tree representing theK u, whichO 0can% ñn be manipulated‰ ñ
turned over to a Generato  re   = M vtextualƒ Pationá  ˆ Í Ì pThe str© @must„ aformat‚ �s a blockA "`header "d    coõ uu �lines, opƒ óally preceded by a `Unix-from'H e.  TheN ] ‚ ‘is termin`eitherH  Ø 0end¢   Í o aK `blank ’ ý + Z 1he 8 fôinstantiate for newçQs whe¶yb ?cdË #isV  ñ have a construcÅAhat &akø ð	zero arguments.  Defaultª M�. — Ëíð keyword specifi¬Á ! ty `ontrolæAnumb	Ð a= $tsXp*P's op�1ionâ 3e dœ { •maintainsI ’backward ƒwibility‡5"""- Sself.˜=Ì
 h =Ñ  Adef ¢ (A S, fp,Sºsonly=FalseûÆ% aÛ•@ure “ V÷  data in a file³ –Reads all' 5  + ½Ÿs# DrootK†× sure.  O-¾  ÷ca flagÑy¯1wheuto stopN      after read  O s Ó+ot¿1is %,I @mean; "it[É  Ö reÅt�Ô  õ .; Ò@feed” ’er = Feedt©ê¥ ½.á)M (if¿ Æ] c._set_ã  ô(B ªwhile True> ßP= fp.'V(81925  _ aif not
:   Ubreak¦   Ž   (` Q   ‹.close()Ã1str , ÍÈ.aà	¾ 8Ð™  1 ?uct‘ú ™= H‘	M n™ ‘Àtire contentcs of
  •the file. 5""" ÷return self.parse(StringIO(text), headersonly= Ñ)



class H# P? "r( !):c Bdef W  b J, fpQ CTrue+  ¯ Ž C � 9 - 
X Bstr("  ¯ ] > b Ø RBytes� :x ƒ__init__x ·*args, **kwÊ 2"""9 ò of binary RFC 2822 and MIME email messages.d  	ðCreates an in-memory object tree representing ã	K q, which+ O 0can% ñn be manipulated‰   ñed over to a Generato r 5theM  i6ualƒ Pationè  ˆ Í Ì àThe input mustƒ aformat� �s a block@ !h   ~  coô ut �lines, op‚ óally preceded by a `Unix-from'ÈG.  TÌ ] ‚ ‘is termin`eitherH  × 0end¢   Ì o a˜ `blank ‘ û _  Y 2he  ôto instantiate for newåQs whe´yb >cdÊ #isV  ñ have a construcÃAhat ÿ&akÃòzero arguments.  Default is MŽ. € 7 s Br = ê(
ËÿHFals 2"""ú% aË @ure È Ç€ data in;Zàª –Reads all. <  + XÚs# DrootßÁM € C.  OiM 4àa flag specify“1whe?uto stopN      after read  W‹ s !otÞ6e d˜,,I @mean; "itaÉ   retÚÔ  õ  ðfp = TextIOWrapper(¤@encoš õ='ascii', errors='surrogateescape')’ 2tryõ r  b\r3b ï  WC 0finÆ
G  fp.detach(t Y Wb¡ˆ —
 2
”^ a S ! sÉRd-  1 oucture%	*-Ñ Ü%	M n-Àhe default ió$s False, meaning it parses the entire contents of
    Ufile. 5""" ptext =  õ.decode('ASCII', errors='surrogateescape')> Áreturn self.Ž r @str(S ñ, headersonly)


class BytesH PÄ !r(  !):_ 2defá (^ I, fpM S=True+  é Š H Š > 	
i b– 0 ½ p E ñ
"""This will beÁ�home for ñpolicy that hooks in @new
¤ �adds all ðemail6 features.f ´

import re
 ‘sys
from 0 "._k Sbase , P} Õ, Compat32, c
 ù_extend_docstringM TutilsG U_has_:	( „registry1 R :as  · ètmanagerB “raw_data_ 2 emessagå E.M Ñ

__all__ = ['ü "',  $ M 
 tdefault"  -c DSMTP %HT ð
]

linesep_splitter = re.~ ÿile(r'\n|\r')

@Š \� (” "):éA"""+Ï ²PROVISIONAL �The API Þð sions enabled b‡2is (  aeàurrently provi0 "al^�Refer to’ÑdocumentationÜ„details.v X  Ë3new0ú æ�and fold ôlgorithms.  Insteadépsimple h5ngs*° °stom objectvQth cu ¡attributesQdepenl opqtype ofÏ €field.  -“ a fullyE Š  ø Às RFCs 2047 È C5322û qIn addi.@setts ” À listed abov&±at apply toj  ûã`ies, tS§ OùQollow>p 'alb @utf8E R-- ifu  (K Ó$) KÇ QÇ“ B  €serializÍ !s `@, us˜  enÑpd words; N 	�any non-H ¥ character&Usourc -•   J ?eÚ  ¿ µ � 	L ïÞ1not•Bain Ù ê @(see!L À 6532 for moð%re on this serialization format).

    refold_source ð   -- if the value2 ° a header iU ñe Message objectK >  ‘came fromR òparsing of some y ,© ŸattributeP 	óindicates whether or not a generator shouldÞ N 	Cthatç  when trans# ¥  mé Ÿback intoN 	`stream1ó m.  The possiblKbs are:z( Anoneƒ3all  ð s use original ·?ingŽ 	AlongK eG ó áhave any line  /isM 	Ÿ    V  er3 `n max_A ï_length will b¿
H z/edu 	  �  ŒA×#edÄS 
	  Àdefault is '¹ '3 Í‚_factory8  -- a calla°ÿtakes two arguments, 'name' an» 
'°  ',¦$re5 &isJ`field M L  Æ Pan unü$ed’H o ,J `return… ¤string-likÅ Ó€t represê  ž	ET.  A h X¿is providedN ²understandso„zRFC5322î otypes.� 	ñ(Currently address )s#T date  J 	€special Üt Ô@ile –o‚Z rû
A ñed as unstructured*is listBð completed befor¾€e extensàÀis marked stÊ".)pñ content_managerô ónÄá with at leastõÓmethods: get_@ *	Vand s+ A.  WT(heB ? orE 	A  �  -ar  ¬?ed,M 	!itÒs| correspondÝ\ %ÉM 
1pas¼!itO :  Ö ite5rst/P 
 / ƒ\ Êpkeyword² €at were x  A{
ðit as additionalÿ arguments.  The default
  ÿcontent_manager is. 	ã:data:`~email.< ; P.raw_  L 1`.
L 2"""	 ðmessage_factory = EH M , Áutf8 = False ñrefold_source = 'long' gheaderN H ¡Registry()& ¥ • < = ¨ � ñ
def __init__(self, **kw):F  Aò# Ensure that each new instance gets a unique ž  ì E ñ(as opposed to clones, which shaa e9 %).; Bif 'V ô ¶' not in kw§  « õobject.__setattrÓ A ,, 56 E …super()..Œ “max_count6Gname6E"""+Ã  •Pimple¦õation for this class returns the Z  Ä ¥ibute fromO  % ´specializedtJ ¦¤would be uo£onstruct a/ N �of type 'Â 'x À   Ÿ   . â[6 %].´ (#ˆ`logic ` ðhe next three methods þ ¢hosen such` it ±possible to¨ ³# switch a 7 ìô between a Compat32 policy and a sderivedM  N~ + 0havãðe results stay consis+\³is allows aK �  0 h`ed witÕ $is…  to“3pas•“a libraryL »Æonly handlesÔ î 0s, 7’o receive8$an$anâ  convert itm"usÛ ônewer style by just changing it© @.  I‡— balso c©@becaN €it postpÅµðrelatively expensŸ Ãfull rfc5322M ðparse until as late ñPwhen %  “ ¨@, sindin man2aapplicR!s :Sa fewãð s will actually} in93ted¥ ÿÑh _| eÔ _linesÛ	 ¶ Ü dÏ peverythÄ  up‚ ³1':'•rì°ed unmodifiŽ  f   +PvalueQ  determined¯`strippT @lead àwhitespace offˆf H r¬Dnder€`first Ì `, join@ Òall subsequen °s together,­ P } �any trailB ƒcarriageÁ Ÿ c @feedZ`racter˜7(Thdiê1samþ»)– Á  a", ð= sourcelines[0].sãplit(':', 1)
  �value =  ö.lstrip(' \t') + ''.join(sourcelines[1:]? Óreturn (name,E rE �\r\n'))
l ÷def header_store_parse(self, > !):/  ž E"""+ 1The' B is u òed unchanged.  If the input‰ € has a '^ 'I ñ	attribute and it matches>  + ñ  ignoring case, { O ƒ ‘Otherwise4 L  d = Ôare passed toufactoryN qmethod,›  Î aresultŒ Sustom8 x object‘ ! aÂ J u  an thisÌ @ a VïQError=  ai� i;…containsP òCR or LF characters.Ú«*  ify g(… ,‚)Ö  .±.lower() ==Ú  Z ì	a~Ôif isinstancen 2strk 2len  .sû¾Z())>1b R# XXX%eömessage isn't quite right when we use T ú  ° P# (se< ù&sue 22233), but I'm not sure what should happen here.K rž²1("HAÞQs mayR ¬ á ifeed "G  – 	 �"or carriå `Ö"_ Ý «.Ã¸ Ôé _fetchéÈT  IÂ Sº,·Öto unmodifiedE� Y_ �with any;7sepÝ… removedK
À D 
 ¼J 8 Ä `.  Any"ð	rogateescaped bytes get m” Aintolõunicode unknown-Ïo glyphª
!3Å p# We ca"
ÉP beca "it)€s on morQan \r&\n­_ % =s ÎAsep_h2terÅÑ)¤�« …Ofoldwr 5  † Iqontroll˜} re _$° policy set¸ Ó4ã D Rsider beä? $ A' if!@only pit doesïN 1hav9  L'P (hav¬ úÀme' attributó	e means it is a header
  õ8object of some sort).  If a source value needs to be refolded accordingP ãto the policy,v óconverted into a customŒ  „ ˆby passiN ±he name andX Œ ðwith any linesep characters removedª 5the˜ ÷ ð_factory method.  FolÀ  — ¥is done byM Àcalling its 
O  ˜  ÿ scurrent%.
: SS�s are spl› Î   u  Ž V ý %isN 0notè ’,&8 ^ ƒrejoinedV  F  pep from. N ´kpreturne!ÐThe exceptionC@ € contain•non-asciiJ °binary data¾ °n that caseq Qi¬ >Ðed regardless‰¸k_‹ñsetting, which causesT s µCTE encoded™ \ Áunknown-8bit?7set¨5"""5 p self._± (“,Ç ,_� b=True)ð1def (A ,Ï< %):d E"""+  ssö_°if cte_type‚S7bit,•[ Ò § "ed˜  'WbytesÝ IO   , ÆbASCII Ê ¾ n ½AbackÂª Z 1  HUs@  â ¦Ç ed/ëª ëAsinc8rý `no wayä Á‡ whether�   ¨AsistX YlÉ!teó2€or multiÍ  
1@utf8Strue,¹Ád ’  % 0, o‘  wií!o ˜ j0uni p renderPs³X wordµ’ …Oed =” y.A0=='@%')�  =pset = 'Á B' ifY   q else 'Ç '3 lÞ2ed.(H ÷, 'surrogateescape'A ’ 	  Ö ,g=False ±if hasattr(0, '…'#  Ñ˜ # .P (Õ=q ò dmaxlen@@max_Õu_lengthÿ  
¦sys.maxsiz\ = 2s =y.Ñ (r  1 = . Ö¦== 'all' o˜ Î   » 1  Plong'­•/ ð      (lines andð  len(lines[0])+ ÿname)+2 > maxlen or
  @any(1 &x), ’for x in T e1:])))? Ãif refold or
 õ_binary and _has_surrogates(value):?  … ðreturn self.header_factory(¹ ƒ, ''.joiÕ 0)).o €(policy=6 Ž K  7 ’ + ': ' +Y ½ (epI  ñ


default = EmailPc ä()
# Make the #  2 us Uclass 
Æ D
del á `
stricq X õ.clone(raise_on_defect=True)
SMTP =K + Ù ¿='\r\n')
HT% ,_9 ³_length=Non` pUTF8 = k Œ Cutf8� ðV# Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@pyI ðN.org

"""Quoted-printable content transfer encoding per RFCs 2045-2047.

This module handles ÇG `methode@inedø1RFCT 2
ton ûe US ASCII-like 8-bit data called `q¸ �'.  It is2´d to
safelyQ �text tha# ñin a character set similar to†7r † 
, D, buL ´ncludes som§ ,  	0at ®ònormally not
allowú —p bodiesàØMs.

˜ðis very space-inefficiª @¥`files; Ï 
h ´.base64mime² ; znstead.ÑPproviß Àan interface#o e�Ãdecode both ¿  Õ l
with ­•ding.

ýCs a " � ia ~W¯0infS   BBan
`” qd-word' � 2.  ¦y°is commonly  d h bPreal Üð
s
in To:/From:/Cc: etc. fX s, as well PSubjec ï ºl @doesô" dW $ ` wrappÓ o]Qd-of- â ð
conversion necessî § 0pro†Œnþcalizedê `s; it Ú 
z Edumbl–® y`  To dð ¢ ³€various � 
¥ pissues,+ K KêG.IÑ

__all__ = [a'body_r 7e', ª	 ' 
4   É$ng" € ]  
_  
a ‘L (un ð]

import re

from string import aò
scii_letters, digits, hex ñ

CRLF = '\r\n'
NL àn'
EMPTYSTRING ð '

# Build a mapping of octets to the expansion Bthat  ð	.  Since we're only
# goD ²to have 2565 °ese things, ñ&s isn't terribly inefficient
# space-wise.  Remember { òheaders and bodiesj °different s» ðof safe
# charac*ð.  Initialize bothô as withé Ffullî ,d pthen ov¨ dO   Z W byte< ðmore compact form.
_QUOPRI_MAP = ['=%02X' % c! õ c in range(256)]0 cHEADER7 E &[:$ OBODY" ‚
# Safe )§ òhich need no encoding.
forˆ Èb'-!*+/' + a^., 1e(' C') +o d:
    ® Ã ó[c] = chr(c)
# H¿õone other specialš ;°s become unõVcoresXe €ord(' ')l !'_×Obodyñ(b' !"#$%&\'()*+,-./0123456789:;<>'ä  è ú  b'?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`1 úabcdefghijklmnopqrstuvwxyz{|}~\t')Eä	C
³ÂHelpers
def èq_check(¹G ñ"""Return True ifä" ò should be escapedL ± quopri."""ñ rF  Ä> O) !=ê 1]

—  z• 3 J “ 8	‘ Ü €_length(¾]array-aR s Õted-printable� D !.
0NotÛ"atØðdoes not include any RFC 2047 Ï�added byA `š j#)`Y a:param¾ª Q: An 
  S Á ’s (a.k.a.‘1s).Q :±S: The¬  k2 o  M wâRit isâ K  ì:quo 5´ sq )�sum(len( ’)  ™ Ø )<e©

Ÿ H …B N‘ÉMÀQUOPRI_BODY_ñMAP[octet]) for  òH in bytearray)


def _max_append(L, s, maxlen, extra=''):
    if not isinstance(s, str)  # ¨s = chr(s)2 L! #L.j ¢s.lstrip()+ ñelif len(L[-1]) + Ss) <=� E  # 2 +=¡ A + sn Gelse% j ò “unquote(sÙ  """Turn a “  ng'0the8�m =AB to  ñASCII character with value 0xab"""ˆ 0retN  ô int(s[1:3], 16)s c 0 �_QUOPRI_ºcrd(c)]¢ãheader_encode(  È!s,Ž ô set='iso-8859-1°A"""E3  Ù bingle < R line¾ Š ñd-printable (like) l Qing.
Ó pDefinedõRFC 2045, this `Q'- ° is similar3\ Q, butO ðused specificallykd email£ `fieldsG Tallowè s· �mostly 7N 1bit •ðs (and some 8 bit)D r\ ñn more or less readó ¡in non-RFCO  Ý q aware ‘ sclients
 þ‘set names  {   `to use) 2-6Ö B.  Iqdefaultá º.� H2# RJSemptyC ‚s as an  °7 iŸã_d!''b ñ# Iterate over every,Ì²f necessarya Ced =‹ d 1.de—ô'latin1').translate(Ó`HEADERÚí‘# Now addA %0chr²rto each† �ed chunk Ñgf S ñ¢# together¡ å `=?%s?q `=' % (¢3setÝ  ed‡› °BODY_ENCODE  9 =   �0:]
BcÕrb'\r\n'Y	* D 3[c]"c)qDbody¿  cóinelen=76, eol=NL¸aG±wrapping atI ¬EKì%ofSÒtext will endN¸eol, which ˜¢"\\n".  Se´ðpto "\\r  2youM Pbe us”  ¤’result of$ñfunction directly…"inÈ=ail°   1be ê aed at,í 8ost<ó @ befÞ1the^ 4eolÎ(Ð$à '76@  Ï ñRximumÕH Ðpermitted by ª �).  LongI “qll haveÏQ'soft b breaksÆ{ R "="  ed­rthem, st^%d ·– €be ident>3 ð  original text.ñ>

    The minimum maxlinelen is 4 to have room for a quoted character ("=XX")L ðfollowed by a soft P ñ break.  Smaller values will generate aC V bError.  2"""	 (if  A< 4:1  Ä fraise ; '("Ê ómust be at least 4® ·if not bodyK Qeturn w #ó † specialú s  > ! =0 ò.translate(_QUOPRI_BODY_ENCODE_MAP)S  _Á = '=' + eolO #¤ �ve spaces1the$ 0at  �end of aY3 ë 81 =#2- 1p ƒencoded_¬ ![]8 0appM (=  . 8  òÀi`.split 6s()3#à1 up¢    ü into pieces no longer than¢  À  ‘start = 0�   Dlast @len(Y w) - 1 -E / bwhile 1 5<= > ©  U cstop =' +H 1I  ' ö# make sure we don'tç ùan escape sequence= !ifž[l a- 2] =è
Š  g nÚ [º :4 91])S  - ! ¼ iop - 2! +elv 1v r 
#OelseÒ 0] +ÅÔ u ê Ð# handle restï û,ƒCase ï á ends in white7# 2and‘0-1]+ Z' \t'» â-=L  — "if
J>= 3?   ‡# It's aŠ - ~rend-of-Ì  ” &we_	i O   ófthree-rƒ·Ming.; 2q =µY-M,ò ?= 2Ê rThere'sï ˆ bØ $ndëÒŽ  ô [~&+ ý	¸ N#ŸŠ Aonly]r Ä¥ 	_ Rq!be§L ¡content on 2subÑ¸Ì Á / +g
Ýqö 5 ]6ð# add back final newX 
qpresentó !ifŽovin CRLFãÀappend('')

ð@    return eol.join(encoded_body)



# BAW: I'm not sure if the intent was for  `signat$ o$ ñis function to be
#: ðsame as base64MIME.dey P() ori ƒ...
def  — ,© `=NL):
½ A"""D7 ñ a quoted-printable string.
* ð	Lines are separated withP ð, which defaultsª A\\n.9 1"""  if–  ˆ   ƒ @7+ 2€see comm##in: ð() above.  Again, we're building up!H ý dË ± ×   concatena\Â ócould be done much moreN ²efficientlyÜ _ B= ''' ÇUline ± pd.split #s(w ø   0 =   .r” 1p()h   -  *  r  +=y0   ‚continue‰   Ui = 0$ nn 0en(U j ºwhile i < nj c/ eine[i]C U ªf c != '='1   Ÿ c6   ii += 1 ð# Otherwise, c == "="Û€re we atÌQ end e/Û?  If so, addO aa soft' b break©    €elif i+1j ð   ¢    Z   ## : R ©n form =AB� o 2^A and˜ P[i+1] ˜hexdigits 2 c
!un´Òv[i:i+3]Ù¨ Ô 3— 	v ”iÀ ù, pass literally9 Oelse’ 
õ	G  2‚A1eol6 Ñ# Special cas;„original×3did\”; #if6Qd[-1]$ ‘in '\r\n'uo P.endsÎG(eol¤ # =FRd[:-1·" ç0ForV�veniencea �backwardsÊópatibility w/ standardÄ€ module
8_W x 
  &&ng !

â_q_match( Å @"""Tž!a   v e­ ©  ò ASCII character(¤value 0xabÃ2s =H ‚.group(0n†  (sö‚# Header9 ˜"isUÁa bit differKÄ h. ø &(s¿ eaì@£ �RFC 2045  D B `Q'ö½(ThHAdoesÉparse a fullC û k OnÀd-printable ñ`(like =?iso-8859-1?q?Hello_World?=) -- please use
    the high level email.header class for that functionality.> 1""" ñs = s.replace('_', ' ') ðfreturn re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)
# Copyright (C) 2001-2010 Python Software Founda¨ ð	
# Author: Barry Warsaw
L qntact: ï p-sig@pyG ð.org

"""Miscellaneous utilities.ñ Á
__all__ = [â ò
'collapse_rfc2231_value', Ûdecode_params 1  !en+  ¤formataddr(  5date  _ 5tim !ge8 Eesse{ ¤make_msgidO  mk4 4_tz Xparseq   ] 	"   6  oŠ ä@ Ä]

import os
 $re
  Ž  drandom dsocket  l , qurllib.­ b

fromâ.}Ñ  w q# ÷AddressList as _ 9 O„ ¨  Ä %,  R_tz, ¯   ó_tz

# IntrapackageÂ s„  ch±t " C ð 

COMMASPACE = •À
EMPTYSTRING ='
U @CRLF ð\r\n'
TICK = "'"

specialsre =Ñÿcompile(r'[][\\()<>@,:;".]')
escape, 0\\"! ñ	
def _has_surrogates(s):6B"""R9õTrue if s contains 0 -e Ñd binary data¤ Ûñ	# This check is based onôBfact×`unless 0re B^ qs, utf8� 2# (j±'s default ®‚ing) can âe any string. � i] ƒ fastestN cway to� 6forÔ òs, see issue 11454ƒqimings.@ 2try' è !s.‰ "e(p  t3Falç except UniaEgVErrorG 4  o s0How¡ ³deal with a× ‡ðing bytes before hand  it9 Ðthe
# applica�€ throughj0 'nÔÒl' interface.’sanitize(D0# TD \ò{ binto uÖ ° 'unknown' Q.  Ifm 3 :#´ `happen©  beæ -8+ òy will instead get ¾pd, evenˆCtheyK âwere invalid iY {  se\°e source wa³0ppo€@to b5 J aseems Â it­ðnot a bad thing; aw2ectN t§ àregistered.
  û8  original_bytes = string.encode('utf-8', 'surrogateescape')
    returnF ;.de= `replac5 ó


# Helpers

def formataddr(pair, charset=| !):j ð"""The inverse of p' 8 ñ), this takes a 2-tupl% 1theb D ð(realname, email_> ’ess) and Ì  s 3 ñ  value suitableD ñfor an RFC 2822 From, To or Cc header.
, !IfM Òfirst elementº °ir is false¼ !en) esecond* !isF ˜ Óed unmodified`  „optional7 X  Â  Fàacter set that ‚used to ß_ ” in case % 0 ðnot ASCII safe.  Can beqinstancfastr orO 2a CÀð-like object which haž#_ƒ ð method.  Defaul¦ H þ. 1""" ¼¶0 = 1  #  �MUST (per§)° ðscii, so raise a Uni¥ Error if iz 2n'tq J a@ ô0if ˆ — 6try     ;   eexcept€ h† 
D  “ sd(Î@set,Ÿ L   $ =}1 ¦' s d_  $ =2.‘( 
7 !reåØ"%s <%s>" % (K #, /7 JelseÐ 2quoa!''²” òif specialsre.search„ 
@  0 D "E  ´ 2 = ›H áub(r'\\\g<0>',±ž  L Õ 0'%s Ù 'Ù d 2 $,  	á ;  "

È!geÅ±esses(field>s¯B"""RHQa lisð(REALNAME, EMAIL)«f each A .ý0alláòOMMASPACE.join(str(v9 vÃ9 sñ òa = _AddressList(all È .Ê  — Í _–Q_timeL¥_and_zone(  ,  ß L ñ'%s, %02d %s %04d :  1 %sfP['Mon`0Tue 0Wed 0Thu 0Fri 1Sat Uun'][€ U[6]],I  2 A['Ja_ 0FebC 0Mar !Ap 0May FJun'I P 'Jul 0Aug 0Sep !Oc„ 0Nov 9Dec‹ g1] - 1y � F0],  3 4 5@ [Y‹2dat|ð val=None, local[ "=FIbusegmt ˜w z D Ð string as spò0ecified by RFC 2822, e.g.:

    Fri, 09 Nov 2001 01:08:47 -0000% ñOptional timeval if given is a floating point% ñ value as accept‚ q  gmE Â() and local ô, otherwise the curreN ‹is used.� ? ˆ ñag that when True, interprets™ @val,{ Œ `returnÃ ñdate relative toƒ _ 6 ñzone instead of UTC, properlyK 0takò daylight savingt  „ o	LountÄ Pargumé Âusegmt meansÆ   ~ ñs written out asw ðan ascii string, not numeric µ ˜(so "GMT"¿  "+Ür"). ThiI ñis needed for HTTP' YAonlyW — �==False.‰ 1""" à# Note: we canŽ 0usež f3 p() beca ¨Phonorî ee› ©L  ¯€ require' aat day% Òmonth names b3ðEnglish abbreviaµsŸ !ifÈ¼qs None:c   ™   =# . !() "if—   0 or6gmt: Pdt = ; ! .	 1froå`stamp( v     ÔB.utci 7els‘ W ?utcZ C ¬ ¢ Dt.asu Û  ù r!= Èò r Dmat_² C(dt,ý o)

def! )ƒ •"""Turn a&   5Tas sp© in ©+#If|  �Õpdt mustù AwareR  å ð  with an offset¯‘zero.  Inä ðthis case 'GMT' willJ ˆrendered* ƒqnormal 4� QM 0RFC¥!. K ¢ ¡to supportGà headers involª  ž=0nowQt„Stuple®iW ½Àif dt.tzinfow  Ô ¤ !œ sD  H  rarV¯sError("oõñ  %1UTC¼  M "v B  X " =M/el� w 1 b'3 ! bdt.str93"%zs £ _f— t_� +P_and_: `(now, 
 ")
®Òmake_msgid(id*=0�, domain ³R ò , � suitable÷žñ compliant Message-ID\[ð<142480216486.20800.16526388040877946887@n2ûshade.la.mastaler.com>ñ¾ �§  #ð to strengthen tð8he
    uniqueness of the message id.  Optional domain if given provides3 I 0por+ F ` after( ñ '@'.  It defaults to qlocallyI ñdefined hostname. 1""" àtimeval = int( . q()*100)# òpid = os.getpid(  randint = 
  om  
 rbits(64% ñif idstring is None:T  + A= '' ?els  E.' +K , %ifDY \€= socketš Cfqdn¹ 1msgÑ Q'<%d. ¡%s@%s>' % ‘val, pid,Ú Eint,z ,t Þ qreturn Q ð


def parsedate_to_ MRdata)ù !  r_tz = _ 3 !z(* à  , Aðraise ValueError('Invalid z   v ð  or format "%s"å 2strh Æ ‘*dtuple, � 
t Š .tz¿þ  k  å .	 (Q B[:6]b * ,k    ttzinfo=S “@zone¸ en   ødelta(seconds=tz)))‡Paddr( {óP¤   ôðo its constituent real)¡ and email-  Óqparts.
¬ Rþ!a ? ¨9 P, unlA  c¡ fails, inM Äwhich case rX %2-Z Š('', '')¼ Ã sC²AddressListñ . qesslist` aif notÈ s‰ gk ] (   ? ð@s[0]


# rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3.
C 6str”qRemove ] ’s from a 4.³pif len(8 F > 1Â  if+ 0.st™‘with('"')º…str.ends 6 ü ðstr[1:-1].replace('\\\\oH\\') " ""'Ô C }  <} #>'ï  6   g} |Astr
xðRFC2231-related func0s -h0amePencod` ®"de Œ Pe_rfcG #(s„ @"""D' e:9 AccorC pto RFC / zòò = s.split(TICK, 2—$ f) <= 2dã  ó,ù8, sç 5 ¯Ä ª @, ch¥"t=? �language Ç Eû Ç ¬¤If neitherZ T nor X  Ý‡,>0n s Á €ed as-ishfÀ › ð is given but noðt language, the string is encoded us   ”empty
   & 5for? . 1""" òs = urllib.parse.quote(s, safe='',` `ing=ch" Ñt or 'ascii')D 4if  µis None andq  ¤   :-  – �return s /if* ô Q = ''/ < A"%s' S" % ( ,J ñ-, s)


rfc2231_continuation = re.compile(r'^(?P<name>\w+)\*( €um>[0-9] c?)?$',~ ð .ASCII)

def de{‚_params( )è A"""D   ñeters list accord¬`o RFC £ !.
` , s2ða sequence of 2-tuples Ê 0ain> p  » ,éjvalue)ã3new¢ B = [b A[0]]q V# Map£ !'sP R to a® !oft >�s.  The i ss are aI 3¤  ¯  … ª 6 y numberºB ,*ca flagG pspecifyâ �whether a¡ ð ticular segment$#%-üñ îã Q = {}T  þ&t 0 inP rams[1:]® –L ! =Ã.endswith('*è % B B= un)    mo_v p.match(‡ . Vif mo�  A  ! ,/Ð = mo.group(' w', 'numŒ  0 !if- ais not|
P  $ Önum = int(num~   
3±.setdefaultª Ð, []).append(= ,ø6ed)N Jelse{ xC èame, '"%s"' % CK :if ” T Ç[sÏ
3 s.items(‰ ç   ª ù    Pexten?q= False2    �# Sort bye9ber 	† f.sort(> ‚And now CB allAµ Ðnumerical ord’convertin C   ## èPings  _® ˜cIf any€	« #Äà 8dˆ 1a *™nXTentir_[, aft÷ #ö  | Å�concatenaÁ ±, must haveV ¡ ) ™ âøi'!at5 Qbeginë!of sôí    enum, s– 	�D 2   "if×.ed    ## ½Pas "lÓ q-1", soˆ  Î !acÒÂin s directls ?  €# repres´ ¹tpercent»c octet
Û Ð        # colÿ(lapse_rfc2231_value treats this as an octet sequence.
   ÿ s = urllib.parse.unquote(s, encoding="latin-1")D ý extended = True$   š.append(sD  2 = u ñEMPTYSTRING.join( )3 4if r :l  chÆ Ñt, language, D … = decod6[ A ¤new_params² �(name, ([  ‚'"%s"' %d )© Nelse¢ a M › vreturn 5 Ÿ

def col Ô ñ, errors='replace',K þ   “fallback_à Â='us-ascii')¾ ôif not isinstanceh Ätuple) or le¬R != 38  ^ À VŒÏr# While;² comes to u¾@ uni¯ð string, we need it& ¡be a bytesÛ ñ# object.  We do° Bwant$ ó () normal utf-8
rU & ag SaightO ðinterpretation of the% 0ing^ ,Ractera \  )se|btext =ä [ 3if ' w is Non"ö # Issue 17369: + /Í0 ,¿ ÿ¡ couldn't Áf  z#³ q0, sYe ð¼  2 ™ ,= $ U 1rawr" =õ (Ý s, 'raw-®‚-escape'â=try	Dstr(I ,²7 àexcept LookupEËF #3   •€a known ,cË w ª ð )


#
# datetim'!es7ProvidQQlocal AfuncúyÐCso p% ñ
one.  Code
# adapted from\¡patch in iÉ€9527.  T“1may–ð be perfect, butÐ€is
# betOAthan( 0havlRit.
#ôž @(dt=:£, isdst=-1©B"""R0,  Ë Vawareü /
ÙóIf called without arguments, JqcurrentS ñ.  Otherwise *dt*F 4 0 sh‘ £m;A, anÅ�is converA to?G º  zone accor† ÷…Qystem‰  " pdatabas˜!If� " i naive (tha¾°, dt.tzinfo> B"),€€ assumedd  beÁ‡ U"InZÐcase, a posit^ ror zeroãa for *–‘* causes J Š!toâ 0prem ± initially ¡ bsummerØ (H ðexample, Daylight Saving TiÐme)
    is or ðnot (respectively) in effect for the  áified time.  AE @nega5 a value. á*isdst* causes= Plocal8 ñ() function to attemptJ ñ	to divine whether summerp  § ” 
H 1""" Pif dt8 QNone:  ö °return date‘ .	 Enow(   Äzone.utc).as (; \ p.tzinfoc  Bg t= ö# We have a naive� ‘  Convert% (8)ñtuple and pass toÖ °# system mk§ B tog@Awith‘™ hint.  S- Rwill M ñeconds since epoch. €tm = dt.e Š ±()[:-1] + (b ,sA =´ .– 2(tm Ó  K  H . Cime(7 & 6try³Pdelta| ´ :  5 =G ²m.tm_gmtoffG  ñ,tz;  Ù(@ ', 9   7 öexcept AttributeError� ñ# Compute UTC offset–…compare y@impl9aby tm_+R Ÿ A# If¥, Ás match, use  • o name F 
Î  è 6t -OÏ (*20.gm 4R)[:6]ð  ˆ Cdst ²rdaylighÔ !º A > 0 5 lP = -([ A.alt±  |Pst elÆ  /    p  # Ø=±  ' Ë ¥ =b )} w Ó E 0.tz5G[dstä  � J ¬  ø‚replace(÷ò=tz)
""" Standard "encodings" Package’" tPython ( � modules 4`storedycthis pA  ï ¢directory.P UCodec= BmustO ò Ps corÌ on‹  H¥normalizedz Á/ „as defin| %e 0 _© ¶¢below, e.gÄ�'utf-8' ‡ b§€emented ñ#heª  * c_8.py'È gEach cÍ E @expohOòllowing interface:ò* getregentry() ->J !s.I™Robjec];The1 2APIo á,a 9 Ç`er, de« !r,<Aincræ %al!  , Ñ streamwriter# areaderJ aeàs which adhere¹ w3œ $ IuJpIn addiW4, aq`may op Ðally also defñine the following
    APIs which ar! ‘n used by. ñpackage's codec search function:
F ð'* getaliases() -> sequence of encoding name strings toi C as 9 K AF * ‚s return� 	a õmust be normalizede �  i s[ CdefiA , _� À().

Writtenð ò
Marc-Andre Lemburg (mal@l @.com2 ð
(c) Copyright CNRI, All R òs Reserved. NO WARRANTY.

"""#"

importNs ³sys
from .   ó_cache = {}
_unknown = '-- R--'
_6 ó _tail = ['*']
_D $ =b. �

class CÓñRegistryError(Lookup �, System !):Y–pass

def{OX)T""" N¢5 an¤ß.ð …% aSQ work½ªñs: all non-alphanumeric�  = ñcharacters except¸0dot_Ód for Python Ì~ sïD Pollap÷õ$and replaced with a single underscore, e.g. '  -;#'F ñbecomes '_'. Leaô Q PtrailC € P remo+t†*at-€s shouldõ£ASCII onlyC1"""„ äif isinstance(Žs, bytesÁ 2   =�) ‚"ascii")�  YsN]^ pó� = False  [6c iØ$ c öif c.isalnum() or c == '.'$ ( X  'q 
   $  Á.append('_')}     j  º (å     	> c< { Ó  2 Jelse† ( 2Truú ™‘ ''.join(d )!_!^1# CÑliË ‚entry = ëE.get6 $, ôº iN . eis not ° › T È2# It þSmodulß #~ €# First V pto find¬+> 7 =i#M ¾Ñ }e   u9 M !ed- , no ‚ < 	 ÏDdardàscheme, i.e. f» E  Á  in^ <sôu Òat top-level.7   ß È/ =Ý
1 Ñ 4 oÀ	Q  \8  ` 8 .‰P('.',V)€ 3NonÝ f Ðmodnames = [aÿliased_encoding,
   Enorm# ]# Qelse:
  0 Ïmodnames = [-  Cfor # 4 in s@ dif not w or '.'+ *  n …continue :try" ò)# Import is absolute to prevent the possibly malicious i5 Eof a\  q #š ñ
ule with side-effects thaf  ¿ !inY 'M¹s' package.O ‚mod = __o 6__(2 @.' +m  N´, fromlist=+ Otail£ §  …level=0)r cexcept_Error, ÷ may occur because � (Åq)' does´Zexist” #Á? #itW@s a × 3
@ ö (see mbcs and oemÀ  Ö FpassÑ 	{  Qbreak  —� = None
 	(Ðgetregentry =t. / :‘Attribute"=Ð# Not a codecA &ul“ä{  if"  �  E ¶Cache misseä  _c [J]Ç  î   greturnÛ  � Qw askƒpmodule x ëPregisè î Ü ø ô (tŒ±isinstance(6 ,è 0s.Cï VInfo)Æ 4 ‚4 <= len2 ) 7% ¸ Qaise C R• V2('m³ ð"%s" (%s) failed¶¿ 1er'º  G  
 % ¨0.__n0__,y¢.__file__)å  A µ scallablç @[0])¿ Ð 1 \† ê 0[2]Ú 4  ÞÄ  A 12])\ B 3B 3B r1> 4~ ³/[4U 4U 5U 5U 75])  orûÃincompatiblefüEule ÿ?9 <7õ66á  É
¼ P += ( f,)*(6-B :) +xö.split(".", 1)[1],{K =í S!(* )¯"#  Ãe
1ry ' ‰*   "# g�er its aïÀs (without oñ verwriting previously registered
    # aliases) Atry:	   Scodec £ = mod.get (1 öexcept AttributeErrorC ApassP Felse 2forx H in g #  � #if& 0not* _| 
&  *  [" ]® Qname
~ Ã# Return the�ry entry  r  
. %0 ð search_function‰  G SPytho¾ T 
Í $s.f(= ò)

if sys.platform == 'win32'× Bdef Ï ò _mbcs(encoding)  î 	¦  áimport _winapiÓ     Pansi_– ô_page = "cp%s" %. s.GetACPÐ 3   4if y  ¢ 
F Š  +   � 3  s.» 	ˆ  & gÒ &  T1reg|… YIÚ V L "#  ñs may fail while we are shutüIdownŠ ”  c­ws)
""" E|" A%@ SupjV@Thisáule is used by4	P packy	 F!toƒ 5mapi s ²Ds toV  .n ‘Note thata O ¡normalizes € R abeforeq  do Á¡lookup, so3 @mapp ‘will haveˆ 5ap [ 2[ ­ ’Contents:¼  ± The followf ¨Qes diU°ary containÑŠ 0s o al IANA¼  G Ócharacter setß  OQwhichÉ ™pre libr\ rprovideŒG  Ü¡s. In addiÙt	£se, a few I ‚specific©‰ Â +�also beeN @ed.
?
# 2= {ð # Please keep t@ðlist sorted alphabeticallyLtvalue !> Wasciiˆ P'646'Ï  1: '( !',¬ '¼’x3.4_1968/ $ _$   # some emgaheaderðÃ Ánon-standard’x 8§ x Rcp367“ Ã $ sÏ ! <   $ =ibmI $ ‡so646_usp $  Ð_646.irv_1991+ $ 3ir_Ò – $ 	e # ´ =us_Ù H E�# base64Â‚'    _ À'base64_codeðc',
    'base_64'  : p64_code+ , q# big5   ' =_tw= 4ig5`  cs% 	"  ` # G X ]hkscs]  > :  Â  ¼  ( g "z2Ò 	g &z2` > ¡ , 3',
? Xcp037; ?037; (  ;ibm) 9: '$ Äebcdic_cp_caQ $ /nl$ /us$ /wt$ ²  	´ $ 9B 8´ 3H10264  
6 \  ÓQcsibm Y   ]  % # 
J ƒ )12¶L1125ƒ à  _ ) …   & kcp866uN & oruscii& ¬ )40/;1408 « $40d 
( „ % ^ *25^ /25^   ã �windows_1  Š h  I1251¼ ?251¼   ^ - ¼ % ¼ 2^ ¹9 2¼ - % ^ 3^ 3¼ 3^  - ^  % ^ 4^ 
rS4^  - ^  % ^ 
à-25à9 ˜- % ^ 
Á?2566¼  - ^  % ^ 	S=125T9 7^  - % ^ 8x8¼ 8^  - ^  % ^ )273%27&(  î0ibm    	 \   $ ý     $  )42T%42&5    [ À 'csibm424'   °: 'cp424',
 à'ebcdic_cp_he' <   $ 0ibm2   $ I Ñ# cp437 codec D'437R 4 [ $37 Pcspc84 Cpage1 [ $   K $ m   8500 ?500   þ Pcsibm ¡ þ   $ "b"$ $chu £ $ j 	l Ç 8775Ç 4775R ¥ [   £  F“775baltic. $ 0ibm2 D  	 $  )85F/85F   ò850multilingual'E% 0ibm  w  €   ',
€ 2ÿ 3852Ñ 6 [ 2Ep) [ $  K $  	~/85~  ÿ ] 	) [ 5£ " ýH  	C/85C  
 	)  g 	"   $  8}8}8Ú C)85)  $  	"   $  6|6|*60 
)  $   
"  $  1þ /61þ %61 Kp_is&  $  e8M $ £ o $ £ 
6Óc%86ú ä862latinhebrew�$  K   H  3"3ü Y3"þ 	) [ $  	" 	H  4 4 àŸ6)  $  	"   $  
6ó [ ø 	) $  	"   H  6þ 6þ ð6',
    'csibm866&'  °: 'cp866',
 @'ibm    $ %  # 3 q9 codec H'869V ; 7 9[ [cp_gr& $ s� 	M $ " '  $ ‘  £ 8932£ ;932} 7   þ  ms ¾  [   $ YkanjiL $ _% $ £ 4F)94ù ƒ 7 4F.ms& $ 9uhcŸ  I $  )50"/507 $50Å=ms9& [ $ [ Èeuc_jis_2004b ˆjisx0213g 8: '/ i `eucjisA - +  n 	, + 
› ‡ › p  q E  (,
E p? p9  q^Ú pÔ Kujis$  º%  Ì & ‰  J ƒ +krƒ k`  ^ $krƒ jkorean_ ^ % isc5601& %  ;_c_' % R_1987Q %  ?x10o +x_' J igb1803×  �à3: ' 'ÕYgb2313rchinese· Ô °) Rrcsiso58 8b _  N %  …cw5 % $ o 2euc6 _, o " #19�  ¼ % # ³< ” —iso_ir_58J wk‹79360  ~ [ kX .cp$ X "  ŒF " w Ahex_†} ?hex} , ò˜hp_roman8?  
B 5: ', Â rã  ®( QcsHPRf T P Zcp105tP =ibm) P zØ À 'hzgb'       €: 'hz',
 p'hz_gb'  ! V_2312& ! C ñ# iso2022_jp codec 3'cs %jp: 3: ' 4_jpƒ  ' /  ) _i R | “ (_1• l /_1C '_1— n - 	— + p 2p ?
E 2p - + p  ;004s ¸ @2004è H    , }_ .,
y 3v  ›@jp_3q M
v 3é - + p ?extr 3extt 
G   ç      - v (krr Ò#krp 	,'krâ  ' ) — + — R “ }8859_10“ klatin6“ - “ _  ý   j  * A_199Š) eir_157z ·? { l›  v  R È ) 	ÞFthai� @ 	“ 	Ü¦  1	. ¼  R “ xëj lGº )  î- “  R “ !} m A 4¹3iso¼ 48[) `celtic# Q 	x	R  4/99) lm J  { 4- ) 5Bå 5” A 5l´ “ )  ¡- R “ 6“ :A 6“ ¼ 6žÀ6',
    'iso”_ir_226'  ð: 'iso8859_16',
 F'l10"   ?   ) Katin- ) S $# f q2 codec p'csisolE 2q @ 2‘ Piso_8¤ ' ‘ (  Q_1987T P air_101# ã ( lp % 
	x Ã + P ñ 33� ? 3' (   8T P 9# · P lp % 
(  Ê, x 44� ? 4' (  	(  1öx lp  P , P 5˜cyrillic'ß 5 � 	¦( =5VP ( /	P  /4ã ß  ( ß 6ß @arabÓ µ 	· …rasmo_70¾- g ( DZ ( wecma_11µ x &x (  /l	(  /2# Ê   /7/ß QgreekÃ? 7ß /( olot_92( n ²  x ( 	N 	Wx /(  W	( W§ ( W8W`hebrewXß 8W  ( ß (  ß - (  ß 3# x ß 9ß à5'        : 'ióso8859_9',
    'iso_    :  ( `_1989') ( air_148#  '  ( &l5  % /  ( Katin, P É Ñ# johab codec z'cp1361g 1: '( ÿ /ms$ 
I ‰# koi8_r\ s r] 0: ' T_r',
9 Xz10489 0kz_ 9  8 ( • ,rk#  k$ "st& R_2002N H € l>'_1� # éNote that the ( ó is implemented internally in C and aG  lot fasterM nM rcharmapu # irÁ1 which uses' CsameF Àencoding. Th} ðs why we discourag¬ e< 1 of> W C ø› ¥lias it toØ ‚instead.-  'à9€‚ŒBcp81î& 
Asiso: p1: ' $_1L =ibmM &  1	› & _p ¾ Þ' L 1Ü7z &  Ú!00! & lj # Ø
 G ) L   ¾P 	& Éâ# mac_cyrillicv D'mac l  :  / « E [greekB  ? Î , 
? @icelŒƒ  C ƒ  - V 2ƒ ÐcentraleuropeH B - ^ ?  *  '  %  U) :  #  ) ¾ Z[roman’ dintoshf , ‘  c  h  	ú {turkishi  j A  C 8bcs< Fansi6 |  EDmbcs  d    _   X xptcp154[ #cs ` 4: ' 1Wpt154"  c & ] & Ýb_asian/ 	L ¯qquopri_€² À'quopri'      ð: 'quopri_codec',
   ÿted_printable'   + 
	* +  W ‘# rot_13 l  `'rot13_  x   :  a_13',
& ¸# shift_jis< !cs 6jisA 1: '  , Î  	& Î  	( $  � P 5    ( · X_2004¼ } 0jis ¾ D 1 Á 2jis q  ¼sž  . Z £ :x02›£  ¤ I  v 2jis u  D  ‘  -  . Z £ xtis_620?ctis620• D 3: '* 8 _) & D2529+ & 1z & ¢iso_ir_166"  › 	& Ó hutf_16Ò 'u13  7 s) Ñ =utf' 5: '% 	^ 9_bea  nixÀbigunmarked'¢< 7_bed A_16bôˆ ( 
g lg olittlej lj ^j ( j )32Î &32b= 
'32Ë ' % 	^ /_tf_32"32/
? ? Ü <32_Ü 7Û 7Ú �7Ú & Ú $ ñP_1_1_æ 1 $ ¾ 8 8 8 % [ $ J $ H_ucsÌ$ 4r $ ccp6500–
 � ë uæ	î uW : + ‚Nzlib? =zip@ 6: '- 2  * ) § ò&temporary mac CJK aliases, will be replaced by properÔ �s in 3.1J ð'x_mac_japanese'      : 'shðift_jis',
    'x_mac_korean'   š: 'euc_kr& ú	simp_chinese'  : 'gb2312& Jtrad& ñ:big5',
}
""" Python 'ascii' Codec


Written by Marc-Andre Lemburg (mal@le ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
„ �
import c| bs

###ˆ Â APIs

class ($ .§ 1):
5ð$# Note: Binding these as C functions will result in$  X 3notF sconvertC ðm to methods. This  �ntended.4  en� # =» .E_ ! /de!  Ù ÁIncrementalEP ræ  #):W "f f ó
(self, input, final=False*  ?oreturn¤ (8  E ¿.errors)[0]š  DÉ š  p Bdef ß š %> š `Stream¥1er(,i8cs. ” 5pasF ORead9  9 C#2er(I ‚ , < ¤ Þ !  ! 7  °ings module 

cÃgetregentry(­ 
æQInfo(l  Sname=èn  d !e=0 .  £    i¸8 .r=±/ J 	/ F/ sârwriter=`mÑ # rÌ# ƒF )\ßqbase64_%æ2 -  0 coÖ¢t transfer\aing.

ù7 B de/é Às from bytes&	 .5 K"""
þš œ üsý gÃ¾“='strict'rassert  D ==   E3(Q þÍ V c), len )} Ã ,` } *Q } ®  ê  ž
yû ›  úþ ý N)& Z ž Z #< Ñðerrors)

class IðncrementalEncoder( Mcs.I Á):
    def e, ó
(self, input, final=False*  . passert * ñ.errors == 'strict'Q  ' âreturn base64._ abytes(^ —)

class –  Deª °  †  ° d, ° F_ ° ðStreamWriter(Codec, · 8cs. « ñcharbuffertype = S ü 1 0Rea¦L  L 2###¿ðings module API

)Ãgetregentry(I ›¶ x UInfo(¼bname='»%', Å= _  3   i}9 'r=úª/ J 	/ / s•w•=V¢# rl# ^# ‚_is_textÛ 2ingü! ð
)
#
# big5.py: Python UniG E‘ for BIG5+  � ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _Q Tcs_twY PmultiB# ’ as mbc

 =: A.get  ('² 'n¨  •" =Ì°ú€  ÂÄd(mbc.M©   N " ² ¨  ‰ ‚  ‚   ‚ 4 &‚ pM	! Ô-6 ^  Mp^  ! ^  ^ ,>ig5Q#()>h4=   Qù
?û_hkscs _HKSCS2$hkÓ
Àc

codec = _Ñcodecs_hk.get ð('big5hkscs')

class C' (  !s. �):
    en 0 =  "c.   de   P ÁIncrementalEB þ r(mbc.Multibyte  ,U  s   h >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	ÑStreamReader(T), ! ,a(s. ^ OWrit^ 
! ^  ^ ódef getregentry(& dreturn¥ Î UInfo(¶Wname=[N4=4 #()C 9   iJI .r=	/ J 	/ ¶/ s¤r¤={# wi# @# ñ)
"""Python 'bz2_Ž'Rò - bz2 compressionQ¢ing.

ThisRB de/Þ ps from $Cs to	 ñand is therefore usable with
, Ð.transform() /  'un ò.

Adapted by Raymond Hettingerz BzlibÄ à.py which was òten
by Marc-Andre Lemburg (mal@l `.com).‚

importå s  6# tþ AneedÞ ‘ optional7Ómodule !

###Q`APIs

¥ l4ó(input, errors='strict'ºcassert D ==   »Ø@(bz2¸ §P c), len )t W t / N R v Ÿ 	oself, 
 Zñ >) W  š ?de(W 9 	Š i¼v Á � ƒ__init__� ê ß î "  Ñ .A # =õ  ¯Pobj =ŠS.BZ2CÄQor()
0  ˜ |³final=FalseÂ  Z 1if  W    Ac = ‘ t ˆm  -   ¿>c +8 ðflush()
        else7:
  õreturn self.compressobj �(input)
5  def reset(0 )J   3 äobj = bz2.BZ2CT ðr()

class IncrementalDecoder( >cs. e  z �__init__} ó, errors='strict')  Û cassert! D == $ Å  " ° A # =) 
 'deÏ  ° %Ñ  M  œ  / #deš 3×, final=False� 6try8 ? ‚ G _ 6bj. † 0   °except EOFEQ /''µd 	·è ¹óStreamWriter(Codec, º î àcharbuffertypeDDytes1 0ReaÿL  L ð### encodings module API

–Ãgetregentry(I n¶ x UInfo(þµname="bz2", b be=bz2_   @d   iç6 'r=àE¶ /er/ J 	/  ‘d/ sŒwŒ=M™R # rc# U# ‚_is_textØ 2ing°! ñ)
""" Generic Python Character Mapping E.m‚Use thisñ directly rather than through the automaticlðconversion mechanisms supplied by uni»‚() and .X`().


þ 0ten& ò
Marc-Andre Lemburg (mal@l  ª 3 ð
(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
¢#"

importé 0s

Š
 æ Þ "):*°# Note: Bin½ ðse as C functions willrPult i:"e Š1not2"# 4t‰ðthem to methods. TŠÁis intended.4 5# =» .¨2mape# �#  ÃÎê   –È2, mXH=Non9 ø
#C.Q )É  -íU $ =_ † � ¼
=
8£,J[ { O)[0]: Ù:  :1Àdecs.IncremeóntalDecoder.__init__(self, errors)
    ³.mapping = 
 
  Qdef dG = ñinput, final=False):*  M preturn v ³cs.charmap_@ : n ƒ !,  q ó)[0]

class StreamWriter(Codec,U  &):¥ 
ä s@ ,g £='strict',j H=Non· [  4	P : en[ :ÿ ’ <í .9 4 ,,
)ORead) )B[ )3# ã ,õ »)9 4 )A### Pðings module API

ÝÃgetregentry(e 
Æ‘UInfo(çcname='ß%', f !e=2 Ã ª    pincremeµE 6r=I EGr/ J 	/ ÷/ ¾wN=A# rH# à# ó	)
""" Python Character M5ò ð6 cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with?  4`c.py.
v £#"

importX 

Òs DAPIs (= !s. ÷W‹K è_B 	k ¦ing_table)�—o )B 	o  o .+ ä û½ e¤  h Ø@ :  ».Þ, § Ø� ¦ª   ª ø ª (@ ª  ª '‚
 ø5pas‡9 =9  Ý 9  Ð4¢)À(
        naÓme='cp037',
  ò encode=Codec().  )de   ²incremental: 6r=I E\ r/ J 	/ Dl / ástreamreader=S R R # Ewrit# W # �)


### [ ±ing Table

~ Ping_t A = (a'\x00'õ #  0x00 -> NULL 1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ & (9c& 4& dCONTRO› t  "  º 5" ôHORIZONTAL TABULATIONx "862 0 60 
R 8x7f" 7" dDELETEC (97! 8! C (8d" 9" e" A"  (0b" B" oVERTIC× 0)C. “FORM FEED¸ rP +D$ åCARRIAGE RETUR%0ž E* †SHIFT OUÁ	'F$ IG 1V1Võ DATA LINK ESCAPT1b1bsDEVICE [6 ON- d1d- 3TWOö (x1i1i- 5HRE\ 9»1r 2x85IB1r¤ s (08" d…BACKSPACh 8E1fF 1F gDANCEû8x19g fCdMEDIUM� 9/l8Ì1l� `1`ÔILE SEPARATORm 1@e_GROUP*  e1eoRECORD+  	  lNUNIT) 8r2rÉ 8i2i" /2^" S2S" 4›2F n  �2FHLINE±(x1$2HáõTRANSMISSION BLOCK€72X
j8W2W	S(x8X2Xß a¿ 2R	‡ R8R2Rf 0i2KtENQUIRYí 0Í2CðACKNOWLEDGE
    '\Px07'  ð#  0x2F -> BELL
 W'\x90  30 fCONTRO" 1" 1"  (16" 2" õSYNCHRONOUS IDLEo 3+ 3+ o 4" 4" 5" 5" 	‘ 6"  0f 7" õEND OF TRANSMISSION¶ 8r 8. ¶ 9" 9" a" A" b" B"  1¶ C" sDEVICE � T FOUR¶ 1(D. öNEGATIVE ACKNOWLEDG›e DE ->V Q 	Ã K“SUBSTITUTG  D 1   p4QCSPAC  8\xaq4O™NO-BREAK ) "e2L I VôLATIN SMALL LETTER A WITH CIRCUMFLEX­ e,4j? •DIAERESIS> 	¦ †> EGRAVà e/4ž: %AC:8\xe4¶: FTILDt ê4Î: ‡RING ABO³ #4ß?  CjdEDILLA)fï ù<  N< 	µ aàsENT SIGy.M’FULL STOP‚ <$ —LESS-THANM () ÆLEFT PARENTHÿ++ GPLUSO |$ ÃVERTICAL LIN�&( 5’AMPERSANDÄ 8\xe?5F EF
5”5&: & t5&? &5&> 
&dÝ5&Iñ §5&: ñ  fy +? ñ c> *> 	ñ dx (òSHARP S (GERMAN) !u 5,òEXCLAMATION MARK+ ð$'        #  0x5Bð -> DOLLAR SIGN
    '*'   p#  0x5C& ‚ASTERISK# )# D# òRIGHT PARENTHESIS, ;, E, ƒSEMICOLOs B\xac' s F$ 7NOT– -  1   #  60# ³HYPHEN-MINUn /' 1' TSOLID" B\xc2% I 2" òLATIN CAPITAL LETTER A WITH CIRCUMFLEXÑ H\xc4A 3A VDIAERH\xc0@ 4@ UGRAVE| 1< 5< FACUT< 3< 6< FTILD< 5< 7< ‡RING ABO¹ 7A 8A CvdEDILLA÷ d÷ 9> N> 	» (a6z A< ¢BROKEN BARa ," ^B% CCOMM� %  hPERCEN¥_' sLOW LINJ># ÇGREATER-THANô?, ÃQUESTION MAR�B\xf8+ Ó7ÓESMALÑO STþ ù H\xc9; 0; E= 
Qa< J< J bA JA J	ø J@ 
Jd| JIù e< J< ù  fA OA ù 07N@ ù `y ë7L  0 ACÐ:' 7³#  2XNUMBEL@& 8 X‘ERCIAL ATn 0"'"p  Â90APO«#PH;=M ;gEQUALS5"& 5=OTA6d>86û8 ùF88	s@ç/ +	/ B'Ý/ 	/ C/ É/ 	/ ðD
    'e'        ð#  0x85 -> LATIN SMALL LETTER E
    'f'   / 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ B\xab2 ¼ A/ ôEFT-POINTING DOUBLE ANGLE QUOTATION MARKD bD BD ORIGHE (f0‰ CE täTH (ICELANDIC)‚ (fd= D= ³Y WITH ACUT¼H\xfe: E: _THORNy (b1? F? ô PLUS-MINUS SIGN£ bà  90* gDEGREE& jM 1   � 91&  JU k/ 2/ ©l/ 3/ L^ m/ 4/ M/ n/ 6o/ 6O^ p/ 6P/ q/ 6Q/ r/ 6R/ B\xaa2 §6ðFEMININE ORDINAL I¢5ATO5 b5 'oMASCUL6 
(e6k •IGATURE AÓ(b82 tCEDILLA¿ cT õžCAPITAL LV (a4V ê‡CURRENCYÂG\xb5( AèWMICRO% ~" çAçCTILDÃ s  ØSÐ t/ ØT/ u/ ØU/ v/ ØV/ w/ ØW/ x/ ØX/ y/ ØY/ z/ ØZ/ 8\xaÏAØÿ INVERTED EXCLAMþ A×4 MQUES/d
AÒ~`ìdìAß#? îdîAùÐETTER THORN (ðICELANDIC)
    '\xae'
 ò #  0xAF -> REGISTERED SIGN* ^' "  *  B0* òCIRCUMFLEX ACCENT, B\xa3/ V  B1, HPOUNQ H\xa5% 2% 7YENt H\xb7# 3# –MIDDLE DOm 9% 4% ™COPYRIGHTN aN 5) kSECTIOu 6P 6' yPILCROWN (bc' 7' ¢VULGAR FRAV ´ONE QUARTER(bd6 86 EHALF3 £/B93 ETHREk S9 [i ²A9 `LEFT S” ƒE BRACKEG]. B. C/  B\xaf2 ãC/ SMACRO0H\xa8! D! ƒDIAERESI¢ H\xb4$ E$ [ACUTEOd¹¥«MULTIPLICAÀ{R ÷ C©÷ ZCURLYö A- ªòLATIN CAPITAL LETTER AUB1 ¶1 B1 C1 Ä1 C1 D1 Ð1 D1 E1 Ø1 E1 F1 â1 ƒG1 ì1 Gb H1 ç1 H1 I1 å1 I1 8\xaICÝ¥SOFT HYPHE…faCÕW ESMALÝvO WITH Ïe fCå? Þ"f2× #C> CGRAV¡8\xf@C: 2² UC+: CTILDt }« 7D7 8 J. 8J™ K1 8K1 L1 8L1 M1 8M1 N1 8NO1 8Ob P1 8P1 Q1 8Q1 R1 8ÀETTER R
    p'\xb9'  ð#  0xDA -> SUPERSCRIPT ONE
 X'\xfb* B* õLATIN SMALL LETTER U WITH CIRCUMFLEX? c? C? •DIAERESIS> 	§ D> FGRAV· ax E: FACUT: f: F: Yñ ² \< !  Y E0> æREVERSE SOLIDUÜ 7, * 1* ÒDIVISION SIGNS%  R 2( �eCAPITAƒY T1 31 Tb U1 41 U1 V1 51 V1 W1 61 W1 X1 71 hY1 81 Yb Z1 91 Z1 B\xb24 °34TWO* (d4* 3²OD5(d6A 5A …)xd« 7@ 	9(d3| 9< 	;(d5< ;< CTILDw09 çF9“DIGIT ZERZ1% 4 % ±ú I 0I ¢â $ #$ 3HRE“ Å& & BFOURíñ % % IŽÎ%  % #SIÂ$ ó$ 3EVE8è& CEIGHÒ5L Ý& &NIÚbÑFÑ8\xdFÓdFÓA ÓÕ ­ Ó@ 
ÓFÓ< 	Ó9FÓóCONTROL
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð! cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP- ð
.TXT' with gencodec.py.

ð"""#"

import codecs

### C Â APIs

class ($ . à):

    def en ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âåname='cp1006', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[ Ping T• E5codå2 = (`'\x00'ßñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ðSYNCHRONOUS IDLE
    p'\x17'  ð#  0x17 -> END OF TRANSMISSION BLOCK
)  4 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( ¥SUBSTITUTE% b% B% VESCAP! c! C! åFILE SEPARATORJ d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & 1   j 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 0"'"H  u“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ Ã\3Q$ 3EVEèµ& R& E-L º& M& $NI):• FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 ÀTTER I
    '3J'  ð#  0x4A -> LATIN CAPITAL LETTER J
) +'K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ o5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL<AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ ãk/ Ó	/ ál/ ÔC	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ À#  0x75 -> LðATIN SMALL LETTER U
    'v'   Î#  0x76 -> L/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# ŽF  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ ‡Ø 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÔNO-BREAK SPAC©Au06f+ ÊAEóEXTENDED ARABIC-INDIC DIGIT ZEROÀ ; ‚; \; 	O�\: ˜: r: 	(TWt ®: ˆ: 
8HREë Æ<  < 	GFOURë Ý; ·; 
(IVv ô; Î	; ÀIC-INDIC DIGð+IT SIX
    '\u06f7'   #  0xA8 -> EXTENDED ARABIC-INDIC DIG: GEVEN< 8< 9< WEIGHT< 9< A< FNINE; &0c; B; ª f COMMA' &1b' C' „SEMICOLOÉ 0xad) D+ ˜SOFT HYPHï  1f( +E& x ÔQUESTION MARK€ Ffe81/ F/ ÷LETTER ALEF WITH MADDA ABOVE ISOLATED FORML £ { /B0L ; e‡ /B1; \FINALs 8 28 &.B38 ?BEHå 91/B4: LNITI« 6b56ã 59 Ps &b5Â/B6: s 6e93s 79  TE×_RBUTAî 5B yN B Ò9³Bw:  µ 'b6(t9 t 'b6)t® ; u &e9éB‡: Hž&e9ÂB—° ; u 0«u OJEEM˜À· ; u 5b7aÒC¥ !TC° á&b7ÔC¦ < w &ea7C© /HAqaÅC« : s ¼Cª K: é &ea½C¬ ; u IC¬ ?DALÓ6b84™­ <DAH< Fufea…C¨< ¶Y¶C© Rú'b8ª R; &eaÀCªÀABIC LETTER ÿ0ZAIN ISOLATED FORM
    '\ufb8a'   #  0xCC -> ARABIC LETTER JEH : 6eb1: D: ?SEEu 6eb3; E; jNITIAL¯ 6eb5: F:  Hv 	7< /D0< w 9; 1;  /AD`6ebb: 2: s d9 39 Ds f: 4: s cÒ.D59 /TAc—.D6: Z: Z7: º&ecº/D8: =FINBc‘97 IcWA9 >MED³cÉB8 /GHä 	et ž < æ � 9 è &d0t � ; ê d@� FLdE› : •dyE™ ?QAF™dE™ : s ²E™ Ks {E™ : s 5b92“E™ Gs 6b94: ™ : s &ed¶E˜ ?LAMY{E˜ : s eyEš  9 wewE™ ?MEE¬ exœ ; ­ &b9šEš ¿NOON GHUNNA(e»£ B {e¼£ ðNOON INITIAL FOR÷<M
    '\ufe85'   #  0xEF -> ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORK %edK /F0K : 6ba6: 1: ŸHEH GOAL ? 8? 2? 	jNITIAL· 6ba9> 3> ?MED=  a= 4= ¯DOACHASHME:&80F 5F  |ý 'e8¿ 6< ?YEHÁ8Í 7K <FINR6e8bÏ 8H Iœ6ef1J 9J &f2: A: » &f37 B7 ª 'bbÃC9 oBARREEŽ6bae‹ DR 
&7cA EA oSHADDAM'e7Æ6 ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð* cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP6  .TXT' with@ ’ P.py.
x ±#"

import  sÕ u ÁAPIs

class  ($ . 1):
IAdef ö ñe(self,input,errors='strict'):,  ycreturno B = , 4ing(C  o Ao *B 	o  o ú ±Incrementalì$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Dcª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¥Ðencodings modð ule API

def getregentry():
    return codecs.C QInfo(  ! åname='cp1026',  en3 =1 2().  )de   ²incremental: 6r=I E\ r/ J 	/ Dl / ástreamreader=S R R # Ewrit# W # �)


### [ �ing TableE€coding_t 2 = (`'\x00'.ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ & (9c& 4& dCONTRO› t   º 5" ôHORIZONTAL TABULATIONx "862 ê 60 
R 8x7f" 7" dDELETEC (97! 8! C (8d" 9" e" A"  (0b" B" oVERTIC× 0)C. “FORM FEED¸ rP +D$ åCARRIAGE RETUR%0ž E* †SHIFT OUÁ	'F$ IG 1V1Võ DATA LINK ESCAPT1b1bsDEVICE [6 ON- d1d- 3TWOö (x1i1i- 5HRE\ 9»1r 2x85IB1r¤ s (08" d…BACKSPACh 8E1fF 1F gDANCEû8x19g fCdMEDIUM� 9/l8Ì1l� `1`ÔILE SEPARATORm 1@e_GROUP*  e1eoRECORD+  	  lNUNIT) 8r2rÉ 8i2i" /2^" S2S" 4›2F n  �2FHLINE±(x1$2HáõTRANSMISSION BLOCK€72X
j8W2W	S(x8X2Xß a¿ 2R	‡ R8R2Rf ÀL
    '\x05'  ð#  0x2D -> ENQUIRY
 `'\x06'
  " E" µACKNOWLEDGE& 7& ”F -> BELL '90  30 fCONTRO" 1" 1"  1‰  32" õ SYNCHRONOUS IDLŽ (93M 3+ o 4" 4" 5" 5" 	‘ 6"  0f 7" õEND OF TRANSMISSION%8r 8. ¶ 9" 9" a" A" b" B"  1¶ C" sDEVICE � T FOUR¶ 1(BŸNEGATIVE ) (9e OV Q 	Ã K“SUBSTITUTâ D "  –4QCSPAC  8\xaq4O™NO-BREAK ) "e2L ß4VôLATIN SMALL LETTER A WITH CIRCUMFLEX­ e,4j? •DIAERESIS> 	¦ †> EGRAVà e/4ž: %AC:8\xe4¶: FTILDt ê4Î: „RING ABO³ {g³ßôLEFT CURLY BRACKETfà êl  N—	¦ cŠ4: eCAPITAÓC< rCEDILLAx .¥ ’FULL STOP$ <$  ÓLESS-THAN SIGÑ() ò vPARENTH
++ GPLUSO !$ òEXCLAMATION MARK£ &+ 5’AMPERSAND$ 8\xeM5#)	úE'
C¢54: 4 ‚54? 4&54> 
4dë54Iñ µ54: ñ  fy 9? ñ c> 8¢> 	ñ dx EÀMALL LETTER õ>SHARP S (GERMAN)
    '\u011e'   #  0x5A -> LATIN CAPITAL LETTER G WITH BREVE
< &30< B< I< ƒDOT ABOV@ *;  J | C@ ‚ASTERISKŸ )# D# òRIGHT PARENTHESIS, ;, E, ’SEMICOLON$ ^$ F$ òCIRCUMFLEX ACCENT, -,  60, ³HYPHEN-MINUw /' 1' TSOLID" B\xc2% d 62" dA(‘ Š H\xc4A 3A VDIAER1\xc§å/64@ 4GRA¥H\xc1| 5< CACUTáH\xc3< 6< FTILD< 5< 7< HRING^[> Ú!68A óEFT SQUARE BRACKEí9\xdç 9. N¤« Pu015fo àDESMALBS: rCEDILLAÛ,7 6DCCOMM  %  $0PER§C SIGØ_' (sLOW LINQ># ÇGREATER-THANO ?, 'ÃQUESTION MARŸB\xf8+ ú 7#Ú	ú Oú SSTROK� H\xc9; 7; yE= 
Xa< Q< Q bA QA Q	ø Q@ 
Qd| Q6
ù ¬É7Q< ù  ©A VA ù c½ U'@ ù Au013e-c	-’DOTLESS I":p È7^ÓB\xd6# W BI†Ó  ¾V@ b@ À 1"'"½ž y0APOë#PHì=  % {gEQUALSu9\xd\u‰ UÉ (xd•ð80 -> LATIN CAPIðTAL LETTER O WITH STROKE
    'a'   õ#  0x81 -> LATIN SMAL; A/ b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ ë f/ 6/ F^ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ 3\xa{§A/ ôEFT-POINTING DOUBLE ANGLE QUOTATION MARKD bD BD ORIGHE }¸ CE â CURLY BRACKETs `. D. ³GRAVE ACCEN' B\xa6* Þ E' B¥RN BARL H\xb1% F% õ PLUS-MINUS SIGN* 0*  90* gDEGREE& j# 1   u 9úJU k/ úml/ úL^ m/ úM/ n/ úo/ úO^ p/ úP/ q/ úQ/ r/ ú÷a¤§úõ
FEMININE ORDINAL INDICATO5 b5 ëoMASCUL6 
e‡9Ü	“IGATURE ASB\xb8Ï � àcCEDILL19\xcT ÛT ACAPI�V (a4V ê‡CURRENCYÂG\xb5( AèYMICRO% f� Aç’DIAERESIS­s` %Aö/ t/ öøu/ öU� v/ öV/ w/ öW/ x/ öX/ y/ öY/ z/ öZ/ 8\xaíAöÿ INVERTED EXCLAMà ãÐ#  0xAB -> INðVERTED QUESTION MARK
    ']'   ò#  0xAC -> RIGHT SQUARE BRACKET/ $/ D/ ²DOLLAR SIGN& @& E& ÃCOMMERCIAL AN B\xae+ } F( §REGISTEREDR G\xa2*  B0* JCENT$ 3$ 1$ KPOUNI 5% 2% 9YENH (b7# 3# –MIDDLE DO» 9% 4% CCOPY<9\xaN 5) 1SECˆ3H\xb6P 6' zPILCROWœ c' 7' ¢VULGAR FRAV @ONE ¼2TER�H\xbd6 86 EHALF3 ›/B93 ETHREk S9 a¢ A9 (NO©|Œ 1   ÷ BB#  £•ICAL LINEK f+ ( œSMACROhH\xa8! ŽuIAERESI� (b4$ Œ€ACUTE ACBl d§‹­MULTIPLICA®e. C�òLATIN SMALL LETTER C WITH CEDILLAj AŽ þ C§< PCAPIT> 1 B1 ³1 Bb C1 Á1 C1 D1 Í1 D1 E1 Õ1 ËF1 ß1 €G1 é1 G“ H1 ä1 H1 I1 â1 I1 8\xaFCÚ¥SOFT HYPHE”fpCÝW 	O’IRCUMFLEXe ~– ôCTILDI8\xf	Có_ FGRAV: C	: #” 8\xf4C: ® Au011ÄÂD(G4BRE® JD&J¥ K1 &úL1 &Lb M1 &M1 N1 &<O1 &Ob P1 &ÀAPITAL LETTE°R P
    'Q'   ò#  0xD8 -> LATIN CAPITAL LETTER Q1 R1 91 R1 B\xb94 b A1 ô SUPERSCRIPT ONE* (fb* B* Œ ESMALŠ óU WITH CIRCUMFLEX? \= "  i C? ó REVERSE SOLIDUS* )xf“ D* i FGRAV£ af d E: FACUT: f: F: YÝ †DIAERESI² c> /E0> > 7> 1> ÒDIVISION SIGNS%  B E2( — T1 31 Tb U1 41 U1 V1 51 V1 W1 61 W1 X1 71 hY1 3Yb Z1 3Z1 B\xb24 fE34TWO* (d4* 3²OX5#> ó5gNUMBER9\xd‘ 1g 	3"d3e Í 3< 	5(d5< 5< CTILDq09 Ú F3“DIGIT ZER@1%  % —ú I I ˆâ $ 	$ 3HRE“ «& þ& 3FOU0ñ % ò% Iˆ6¸ æ% #SI¨óI Ù$ 3EVEô8J Î& CEIGH¸/L Ã& &NIÀbêF·8\xdìF¹Ó¹"¸ ¹`QUOTATÕEMARK#¾ – ¼j 
¼ïF¼< 	¼9ñF¼óCONTROL
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð for CP1125

"""#"

ðimport codecs

### C Â APIs

class ($ . à):

    def en ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌF€s module× 

ý Ãgetregentry(7 
�ž UInfo(¾åname='cp1125', e !e=1 2().     ie: .r=^/ J 	/ å/ sqr8=E# w”# ¡# )Z ping MapB0codâTmap =Ðñmake_identity_dict(range(256))
° 5 ‘.update({Fð 0x0080: 0x0410,ö #  CYRILLIC CAPITAL LETTER A5 15 15 &BE6 26 26 V6 36 36 'GH7 47 47 D6 56 56 I6 66 66 Z£ 77 77 m 86 86 I{95 95 gSHORT ; a; a; K"b6 b6 &EL§ c6 c6 M6 d6 d6 N6 e6 e6 O5 f5 f5 P³9dÀ0420,     # ð CYRILLIC CAPITAL LETTER ER
    0x0091: @421, ? # 6 S6 26 26 &TE6 36 36 U5 45 45 &EF6 56 56 &HA6 66 66 'TSØ 77 77 'CH7 87 87 S¥ 97 97 C9 a9 a9 –HARD SIGNb= b= 7YER¿c8 c8 KSOFTu d= d= We5 e5 Y¨ f6 f6 1"a06 .306 ESMALr3 q3q 	3 BÓ ao3o 	4 V4 m3m 	4 G“am3m 	5 Di k3k 	4 I4 i3i 	4 Z� g3g 
5 i d3d 	4 Iêa`3` 	3 gSHORT 9 `3` 	9 KW3W 	4 &EL¡ S3S 
4 M4 J3J 
4 óaI3I 	4 Og F3F 	3 P£bD6259—LIGHT SHAgb86259lMEDIUM( ,6259øLDARK& 6250N ÒBOX DRAWINGS ‚ vVERTICA{b 6252 7 • AND LEFT b,6256ì 	@ q u SINGLEA g DOUBL4@=256¿ ÀWINGS VERTICðAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556, ÿ #  BOX DRAWINGS DOWND 8D 5D x ˆ ˜ ˆ 9D /63D Ç …VERTICALH A aA /51A 8 b8 78 
E= c= d= 
/UP°  d; c; /UPweB bB ufB /10B RLIGHTû #c0< 4< 	ú RI 6"c1; 3; ¦HORIZONTAL@ 2@ 2;· B 3B 1B 
	mÃ 4A 0:
z 59 3z F 6F /5e}º Á TKÿfI ¯ÇI Z I aI @ ü5< ƒ� z ù/69z M6{ C 6Â — NÆ B | 6R| G 6#UP;A Rd/68�
ØH Qd%6/WN’ /6Ÿ	& ™” 75k
Ü á£ ®d95	gC œ C C/52bÀ DOWN SINGLEð AND RIGHT DOUBLE
    0x00d6: 0x2553, ó #  BOX DRAWINGS DOWN4 E HSINGE 7E /6bE ˆVERTICALI ¼HORIZONTAL N 8N aN 8 — N á 9N /18N L!UPG FLEFTa: /0c: 	!_= b= 8w ¦FULL BLOCK& c& 4c ¬LOWER HALF, d, �  ¯ + e+ %90W ýW f, 8, ?UPPƒ  e0, 6044, õ	CYRILLIC SMALL LETTER ERã #e14 1Œ 4 S4 24 24 TÉ#e34 Éh Ug 43 ~3 &EF4 54 5› &HA4 dO04464 'TSÐ TO04475 'CH5 ;6044vÒ SŸ "O0449j 8SHC7 6044§l –HARD SIGN60440; 7YER¯-60446 KSOFTq <O044dã KDO044e3 Y¢ LO044f4 fT0  @CAPI!V%IOBfV56  	Š4 V@j æGHE WITH UPTUR¹fe9w A s0s „ ¶UKRAINIAN I–f5@  	ø > ‰0‰ ~ ×BYELORUSSIAN-M ‚ 5L  	Š J µ0ê – &YI€ ¶56  € À LETTER YI
 ¡   0x00fa: @b7,  à#  MIDDLE DOT
 & b& E221a& ˜SQUARE RO' c' 5116' ¶NUMERO SIGNN d' E00a4' ‹CURRENCY) e) E25a0) bBLACK } Q f( '00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'þ " #(¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXl x 3* 3* 0ENDU 	( 4( 4( ¢RANSMISSIOv X 50 50 UQUIRY¦ 6$ 6$ µACKNOWLEDGE( 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& öHORIZONTAL TABULATÅ n2 a2 •LINE FEEDŸ b( »b& oVERTICV :x0c0 c0 HFORMV r$ ® d& æCARRIAGE RETURme. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ 4TWOX1›1›/ 6HRE` 
¤1¤1 EFOURa 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µfNUMBERm-'$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSAN¬0"'"  *2•“APOSTROPH(M †òLEFT PARENTHESISf)- �ðRIGHT PARENTHESI�S
    '*'   ò#  0x002a -> ASTERISK% +% b% ’PLUS SIGN& ,& c& RCOMMA" -" d" ³HYPHEN-MINU– .) e) ’FULL STOPO /& f& TSOLIDJ 0$  30$ ¢DIGIT ZEROK 1' 1' 2ONE& 2& 2& #TWL 3& 3& 3HREN 4( 4( BFOURu 5' 5' #IVN 6' 6' 2SIXM 7& 7& 3EVEÌ8( 8( REIGHTP 9( 9( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sÃQUESTION MAR4@* 4y ƒERCIAL ADA* |óLATIN CAPITAL LETTER IB3 ‰3 BªC3 –3 C3 D3 ¡3 D3 E3 ­3 ¹F3 ¹3 Ff G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 [L3 1Lf M3 f M3 N3 3 ÅO3 3 -P3 5'3 ÷Q3 0QÌ R3 0wS3 0¶T3 0üU3 0UÌ V3 0V3 W3 À  #  0x0057 ð-> LATIN CAPITAL LETTER W
    'X'   ¯#  0x0058 3 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 òEFT SQUARE BRACKET0 $\\1 É c0 ò REVERSE SOLIDUS, ]+  , d, ?IGH] ^1 e1 óCIRCUMFLEX ACCEN‹ _. f. ‚LOW LINE„ `%  60% YGRAVEN a) 1) ÕESMALÓAZ b1 21 B1 c1 31 C1 d1 41 D1 e1 51 f1 61 Fb g1 71 G1 h1 ù	WH1 i1 ÷	1 I1 j1 õ	1 J1 k1 ó¿	1 K1 l1 ô L1 m1 ù1  M1 n1 ù1  N1 o1 üÄ O1 p1 7b  P1 q1 Q1 r1 R1 s1 Pt1 "u1 U“ v1 V1 w1 	x1 y1 z1 {1  ZCURLY|/ `VERTICù|}* R Z  ~0 CTILD°3\x7³R7÷TDELET# Pu0410J # 8éŒCYRILLIC Í\6 16 î6 Bm À '\u0412'   ô(#  0x0082 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   7 37 	(GH8 48 48 	D7 57 57 	I7 67 67 	Z¦ 78 78 
o 87 87 	IK96 96 	hSHORT < a< a< 	'KAs b7 b7 	'EL7 c7 c7 
M7 d7 d7 
N7 e7 e7 	O6 f6 f6 	P»'207 /907 	&ERn (217 17 
S7 27 u
T¥ u9u
Um s9s
'EF7 s9s
H[2s9s
(TSÜ s9s
C«2t9t
S¨ v9vC: t9t
‡HARD SIGÖ2{9{
8YERÇ}9}
LSOFTw „9„ƒ9ƒ
Y« „9„
Y;3„a„ESMAL‰A¢ 3�a�	4 Bl3a	5 ò3}a}	5 	ð3}a}	6 î3{a{	5 ì3yay	5 êÀ'\u0437'   #ó&  0x00a7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #5 85 I4 94 94 hSHORT : a: a: 'KAo b5 b5 'EL5 c5 c5 M5 d5 d5 N5 e5 e5 O4 f4 f4 P«G25915  b05 ¨LIGHT SHAD( 2( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS … uVERTICAƒH2524_ 48 ” AND LEFT&9256ñ 5A s u SINGLEB g DOUBL6Â 6I 9 I Y ’ (56Ó c	CDOWN~ E 5E sE z E š Š 6¼„E   #^5^ŒB 	{ (57À �9 w  db™> %UPü z Õb 	< /UP}Mb®C {(10 ½	C ÿ 1cÅ=  þ Rßÿ 3< Ù< ‰HORIZONT’@cñA  º C 1C ÄÆ 0?c| 3| y	óG 5±c	Ä ]‘5Çc‹ ¾²J cÏà54'   #  0x00cÿ29 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca ? !UP= §HORIZONTALB 6B b� D 0D cD �VERTICALŒ É 5C dC ~ c~ e; 	~ H 7H fH ‘UP SINGLEÀ B ¤S8I /d0I × ÒI _ I 4I 1I 5 ” 5K 2K – 5t-d3K #UP” è9Ú 5#4D Ø D ž D 2Ó 5D F 3F 6F { Ð (6bF 7F }J ù	aO 8O %O e *1neLU %7LEFa0]da; k Ídy 8y ]§FULL BLOCK' 	è@­LOWER HALF- 	’ * ³ , 9Vd¢ - 8-  ?UPP† 8044- eäô	CYRILLIC SMALL LETTER ERè G0441×eÐ5 S5 çeº5 'TE5 Öe¤5 U4 †e”4 'EF5 Xe…5 'HA5 tet5 (TSÔ  ed6 (CH6 ƒeK6 S¢ äe26 C8 ¹e/8 ðHARD SIGN
    '\u044b'÷(   #  0x00eb -> CYRILLIC SMALL LETTER YERU
    '\u044c'7 c7 —SOFT SIGN< d< d< E4 e4 e4 Y¥ f5 f5 Aj '015 )f05 eCAPITA&IO7 57 17 	H5 (90l 25 l çGHE WITH UPTURN9y 3D 	y B (04† 4B † ·UKRAINIAN I�5A 5A 	ƒ ? (06€ 6? € ×BYELORUSSIAN-N ˆ	M 7M 	Œ K (07˜ 8K ˜ 'YI‚ 	7 97 	‚ 5 !xb3 ‡ fa5 ¤MIDDLE DOT\ H221a“ ®—SQUARE RO( )11ŸhNUMERO‹!xa¸w ‹xURRENCY* Iu25a«�bBLACK € £ x' S uóNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  ”100:œ000,~ «FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXiu 3) 3) 0ENDS 
' 4' 4' ¢RANSMISSIO¬V 5/ 5/ VQUIRY¢ 6# 6# ¢ACKNOWLEDGsJ 7' 7' (BE8  8  2ACK€ GE 9% 9% pHORIZONäyTABULATÀ a1 a1 –LINE FEEDÂ b% b% ŸVERTICAL T c/ c/ KFORMT d% d% µCARRIAGE REÕ e+ e+ ‡SHIFT OUßf% f% I­1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. "TWZ Ñ 1‹1‹. 7HRE^ ”1”0 ðFOUR
    0x0015:� 0x0015,  ð	#  NEGATIVE ACKNOWLEDGE
 ( "6:0 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCKa 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) —SUBSTITUT¦ b& b& WESCAP" c" c" æFILE SEPARATORr d* d* _GROUP+ e+ e+ oRECORD, f, f, OUNIT*  "20* %20* FSPACÌ #21! 1! €EXCLAMATŒ6MAR‹#22, 2, OQUOT* 3* 3* µNUMBER SIGN#24' 4' \DOLLA' 5' ”{PERCENTO Œ2Œ–AMPERSANDt …2…—APOSTROPHv2vöLEFT PARENTHESISR €2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k¥DIGIT ZEROI 3p3p& &ON~3i3i% 'TWJ d3d% 7HREL d3d— 6FOU©3c3cM 7FIVL a3a& 6SIXâ a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– À047: 0x0047,  ð#  LATIN CAPITAL LETTER G
 ‚0x0048:  ,  2 H2 92 92 I2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2 22 22 R2 32 32 S2 42 42 T2 52 52 U2 62 62 V2 72 72 W2  /582 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5uOW LINEÛ 66\GRAVEL 6÷6÷ESMALéAX õ6õ	0 B0 ó6ó	0 C0 ñ6ñ	0 D0 ï6ï	0 í6í	0 F` ë6ë	0 	6é6é	0 6ç6ç	0 6å6å	0 6ã6ãË	0 6ä6äû	0 ÿ6é6é0  ý6é6é0  û6ì6ìÀ ù7ø7ø`  ÷7 7 ÀATIN SMALL LóETTER Q
    0x0072: , ò #  LATIN SMALL L0 R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENc. c. ÖVERTICAL LINEW d) d) ORIGHX e/ e/ GTILDP f! f! VDELET" "a0" f" ×NO-BREAK SPAC* Cfœ ÕCURRENCY SIGNÅ bÜfL•MIDDLE DO3401y 0› àCYRILLIC CAPIT÷$IO\ $40… È6 µUKRAINIAN IÅ #40¨f¨@ ×BYELORUSSIAN-M Œ è ”L %YI6 1q8ø A5 -/81-Bí 1U/826 V6 [8[× 'GH7 š8š¡#41h8hm Æ1Æ8ÆZ£ ±8um ZÙ {8çæ€8€k gSHORT ; ‹8?; K"‘8‘6 &ELX™8™6 M6 ¦8
»E#41­8­l ð1Á8Ÿ5 P³2d9dET#42e9eEZ#42e9eÀ TE
    0x04À23: 0x0093,  ð#  CYRILLIC CAPITAL LETTER U
! c0x04245 45 &EF6 56 56 &HA6 66 66 6TSE7 77 77 'CH7 87 87 S¥ 97 97 C9 a9 a9 –HARD SIGNä b= b= 7YER¿c8 c8 KSOFTu d= d= We5 e5 Y¨ f6 f6 1"306 .a06 ESMALÐ3 13 13 BÓ #324 24 V4 mam 	› G“3mam 	5 Di kak 	4 I4 iai 	4 Z� gag 
5 i dad 	4 Iê3`a` 	3 gSHORT 9 `a` 	9 KWaW 	4 &EL¡ SaS 
4 M4 JaJ 
4 ó3IaI 	4 Og FaF 	3 P£4DeD%ERh 4EeE&ES4 EeETœ EeEI4CeC®4CeCÎ4CeCª4CeC¨4DeD¦4FÀe9,     #  CðYRILLIC SMALL LETTER SHCHA
    0x044a: @0ea, _ #  C7 –HARD SIGN; b; b; FYERU6 c6 c6 KSOFTq d; d; En e3 e3 Y¢ f4 f4 G"514 /f14 %IOœ #544 54 ¶UKRAINIAN IÚ #56> 7> ×BYELORUSSIAN-K ˆ 7J 9J %YI4 #904 24 eCAPITApæGHE WITH UPTUR?933C 	±A 4211JhNUMERO63221âf§³SQUARE ROOTÒ 3250Ò %c4� öBOX DRAWINGS LIGHT HORIZONTAL9 2bÈ 9  hVERTIC7 dy7   DOWN AND R t 1­ b£= 	6LEFé 1w/c0é 	/UPw 8ë d*w  ; 
u î c%{  2¶ bŸ
fA 	� 2� ±»  oè 3‚ cãB  ý @ ‚ ï@  	Â F  5úc	F oDOUBLE¨£bq: � l5àd¸ 4aSINGLEwª N E 3:6uE 4 E V E ‚@ L 4"55ƒ /b8ƒ r ƒ  ?Ç sbu~#WN4 D T Æ ob�D ÂÆ  ˆ = ‚àUP SINGLE AND ðRIGHT DOUBLE
    0x2559: 0x00d3, ó #  BOX DRAWINGS UP2 R AND C HSINGC aC /c8C r  J C  b< /be< 2UP n  >LEFÁ cB dB �  ~ B R „ dB cB ? %UP„ ; e; /c6; ˆVERTICALÅ DU I fI 7I 8 Š I Í #60I Í ™  I ‹ "61B /b5‹ z ‹ W› H 2H 8 H X H 3H 9� ? 	Ò  � A 4A /d1A (WN¡£HORIZONTALûJ 5J 2J �  YJ Õ 6J /cbJ  ¦Q DOWNJ � 7C fC 
;A Õ 8H /d0H Ó J/caH E G� Ñ HdHâL× ZdR• œ fc¨Ý £ 
þG 8žd´öUPPER HALF BLOCK, ·Ê?LOW, ÄOLFULLR Å d+ )} 9© ð &, 1ALkFSHADj9‡{MEDIUM ( ðeKDARK& a¡ f¡ ð<BLACK SQUARE
}
""" Python Character Mapping Codec cp1140 generated from 'py6 "-m, @s/CP'  .TXT' with1 cA P.py.
i ±#"

import  cs

###f ²APIs

class ($ .… 1):
ó`def en ñ(self,input,errors='strict'):,  ªcreturno “.charmap_B = Àors,encodingñ%_table)

    def decode(self,input,errors='strict'):,  0 preturn 1 ³cs.charmap_B = , 5ingo ðclass IncrementalEnG  r( >cs. x  ¤ e, ¤  h Ã final=False* ¢ @ :  ê .ä , § ][0]

ª D"ª  €  ª ø Nª !@ ª  ª óStreamWriter(Codec,T ¤ Dpassã  ORead9  	9 D### 4às module API

ý Ãgetregentry(7 
2ž UInfo(Såname='cp1140', e !e=1 2().     ig: .r=`/ J 	/ å/ sqr8=E# w”# ¡# @)


K[ Ping T• E5codå2 = (`'\x00'ßñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ & (9c& 4& dCONTRO› t   º 5" ôHORIZONTAL TABULATIONx "862 ê 60 
R 8x7f" 7" dDELETEC (97! 8! C (8d" 9" e" A"  (0b" B" oVERTIC× 0)C. “FORM FEED¸ rP +D$ åCARRIAGE RETUR%0ž E* †SHIFT OUÁ	'F$ IG 1V1Võ DATA LINK ESCAPT1b1bsDEVICE [6 ON- d1d- 3TWOö (x1i1i- 5HRE\ 9»1r 2x85IB1r¤ s (08" d…BACKSPACh 8E1fF 1F gDANCEû8x19g fCdMEDIUM� 9/l8Ì1l� `1`ðILE SEPARATOR
    '\Px1d'  ð#  0x1D -> GROUP SEPARATOR
 X'\x1e* E* oRECORD+  f+ F+ NUNIT) '80)  20) tCONTROLv (81" 1" 2" 2" 3" 3" 4" 4" n  !  ( 25" ”LINE FEED¬ "17& $ 6$ õ
END OF TRANSMISSION BLOCK4 b4 74 TSCAPE! (88! 8! #9" 9" a" A" 	‡ B" cD C"  (05" KtENQUIRYÌ (06" C¥ACKNOWLEDGò 0G>5BEL943494341‰ 34õ SYNCHRONOUS IDLŽ 9=3=9=3= (x93=Ä9‘ ;" 0f )]j96369636963696361¶ 6sDEVICE ß F FOUc	(BŸNEGATIVE ) 9’3OV 1Ã K“SUBSTITUTâ “ Û4QCSPAC  8\xaq4O™NO-BREAK ) eŠ4VôLATIN SMALL LETTER A WITH CIRCUMFLEX­ e,4j? •DIAERESIS> 	¦ †> EGRAVà e/4ž: %AC:8\xe4¶: FTILDt ê4Î: ‡RING ABO³ #4ß?  CjdEDILLA)fï ù<  N< 	µ aà‚ENT SIGN^ .M’FULL STOP$ <$ —LESS-THANM () ÆLEFT PARENTHÿ++ GPLUSO |$ À #  0x4F -> ðVERTICAL LINE
    '&'   ò#  0x50 -> AMPERSAND$ B\xe9' $ 1$ óLATIN SMALL LETTER E WITH ACUT^ H\xea: 2: ¥CIRCUMFLEXy b? 3? •DIAERESIS> 8> 4> FGRAV· d: 5: Iñ e: 6: ñ  f? 7? ñ c> 8> 	ñ dx 9: òSHARP S (GERMAN)i!u 2    A> òEXCLAMATION MARK+ $+ B+ ²DOLLAR SIGN& *& C& sASTERISI )# D# ÖRIGHT PARENTH	;, E, ƒSEMICOLOs 9\xa<F$ 7NOT– -G 6+³HYPHEN-MINUw/' .TSOLID" B\xc2% 06PCAPIT¡RAa'(c4A A )(c0@ @ 	+(c1< < 	(c3< < ETILD”(c5< < †RING ABOÕ(c7A A CvbEDILLA“9\xd÷ "> N> 	» (a6z  ¢BROKEN BARa ," E6CCOMM� %  hPERCEN¥_' 7LOWó># ÇGREATER-THANô?, KQUESØ8\xfl7# O STþ ù 8\xc^70; Z`c`7J< J b7JA J	ø J@ 
Jf7Jhch7JÀI WITH CIRCUðMFLEX
    '\xcf'
 õ" #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS@ c@ 8@ RGRAVE< `9 #  | 9<   r ACCENT' :' A' RCOLON  #  B  £NUMBER SIG& @& C& ÂCOMMERCIAL An 1"'"• D( “APOSTROPHº =M E% gEQUALSs "& F& âQUOTATION MARKÂ B\xd8, … 80) …O… � KŒ a: ± &81= ESMALÀAl b/ 2/ B/ Ý^ 3/ C/ d^ 4/ D/ e/ 5/ ë ª� 6/ F^ g^ Ü	G/ h/ Ë	/ H/ i/ ¾µ	/ I/ 3\xa{äÆÿLEFT-POINTING DOUBLE ANGLE (bD êORIGHE "f0» ‰ 	¸  ô ETH (ICELANDIC)Æ fã= =  Y¨CACUT¼3\xfî: 3:  _THORNy (b1¶ L˜PLUS-MINUv8\xbà 9MgDEGREEœjM K96Jø k/ 6Ñl/ 6L^ m/ 6M/ n/ 6úo/ 6O^ p/ 6P/ q/ 6Q/ r/ 6R/ 3\xaà696ðFEMININE ORDINAL I¢5ATO5 b5 'oMASCUL6 
"e6� k •IGATURE AÓb·9cCEDILLm9\xcT õ^V Au20awˆ êGEURO¾G\xb5¬ Aä9MIC% ~" ãÀxA1 -> TILDE€
    's'   ò#  0xA2 -> LATIN SMALL LETTER S/ t/ 3/ T/ u/ 4/ U/ v/ 5/ V/ w/ 6/ W/ x/ 7/ X/ y/ 8/ Y/ z/ 9/ Z/ B\xa12 xA/ ô
INVERTED EXCLAMATION MARK4 (bf4 B4 MQUES1 (d01 C1 ÝeCAPITAßô ETH (ICELANDIC)p (dd? D? ÅY WITH ACUTE< e< E< _THORN} aA FA ò REGISTERED SIGNk ^h 1   K B0* óCIRCUMFLEX ACCEN‘B\xa3/ , 1, HPOUNQ H\xa5% 7YENt H\xb7# –MIDDLE DOm 9% þ™COPYRIGHTN aN ø1SECÏé H\xb6P ðyPILCROWN (bc' è¢VULGAR FRAV ²ONE QUARTERF8\xbíBï6 EHALF3 £Bó3 ETHREk F[Ÿ ²ý`LEFT S” ƒE BRACKEG]. ÷C/  8\xa&BõSMACRO0B\xa8S ×ƒDIAERESI¢ H\xb4$ ¿ßOd¹¥’MULTIPLICÀÀ{R ÷ C©÷ ZCURLYö A- ª¼AŽB1 ¶1 B1 C1 Ä1 C1 D1 Ð1 D1 E1 Ø1 6F1 â1 ƒG1 ì1 G“ H1 ç1 H1 I1 å1 I1 8\xaICÝ¥SOFT HYPHE…faCÕW 	xOZÏe fCå? ÞÀS
    '\xf2'  ð#  0xCD -> LATIN SMALL LETTER O WITH GRAVE
/ `'\xf3'
  : E: FACUT: 5: F: CTILD: }7 "  t  D0: òRIGHT CURLY BRACKET¢ J. 1. Ü eCAPITAÞ J1 K1 21 K1 L1 31 L1 M1 41 M1 N1 51 N1 O1 61 O1 P1 71 P1 Q1 81 Q1 R1 91 R1 B\xb94 [ DA1 ãSUPERSCRIPT ONH\xfb* B* ã	¿U¿¤CIRCUMFLEXi (fc? C? •DIAERESIS> 	§ <} 
<ax <: 
<f: <Yñ ² \< @E@ÖEVERSE SOLIDUÜ 7, ƒE<ÃDIVISION SIGoS% ’E3Y T1 3ÆU1 3U—V1 3V1 W1 3W1 X1 3hY1 3Yb Z1 3Z1 B\xb24 °3#TWðH\xd4* 3ô5(d6A 5A …)xd« 7@ 	9duE9< 	;dwE;< y0ñ çF9“DIGIT ZERZ1% 4 % ±ú I 0I ¢â $ #$ 3HREûÅ& & 3FOUJñ % % À FIVE
    '6#'  ð#  0xF6 -> DIGIT SIX
 +'7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& BNINE% B\xb3( • A% õSUPERSCRIPT THRE, (db, B, óLATIN CAPITAL LETTER U WITH CIRCUMFLEÞ H\xdcA CA ”DIAERESIS­ dÕ ­ D@ FGRAV½ a| E< EACUT< (9f< F< óCONTROL
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
ŸAdef ÷ ñe(self,input,errors='strict'):,  ícreturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  šTñ
~ å2 = (W'\x00= 00=ANULL0  1 1 õSTART OF HEADING+ 2+ 2+ 3TEXù8\x0Ô 03( 0ENDQ 	& 4N 4& £RANSMISSIOsH\x05. 5. UQUIRYž 6" ßÐACKNOWLEDGE
     '\x07'  ð#  0x07 -> BELL
   8 8 ƒACKSPACE$ t" "  C 9$ óHORIZONTAL TABULATION0 n0 A0 “LINE FEED$ 2x0b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ äCARRIAGE RETUR  2x0e, | E* •SHIFT OUT  f$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ 1+ öEVICE CONTROL ON- 2- 2-  4TWO¨ (13- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ –1–õ
END OF TRANSMISSION BLOCKŽ «1«UCANCEÌ(19€ ¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt0"'"ó  ø2u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þ[3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3F4COLzð ;'        #  0xð3B -> SEMICOLON
    '<'   p#  0x3C$ ÓLESS-THAN SIG) =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK£ @(  40( ÒCOMMERCIAL AT( A( 1( òLATIN CAPITAL LETTER A1 B1 21 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 ÙêCL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ ó5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëð g'        #  0xð67 -> LATIN SMALL LETTER G
    'h'   #  0x68/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f#  7×TDELET! Pu20ac# ! 8ÉƒEURO SIGf\ufffe$ ¾’UNDEFINED· f\u201a$ ³óSINGLE LOW-9 QUOTATION MARZ ºZ ~ ¯ODOUBZ F2026� ¶óHORIZONTAL ELLIPSI ¾ &20. µSDAGGEc! 1! §… 
( 
+ Ñ  3m •™PER MILLEx7016) �@CAPIÇ µS WITH CARO´F2039± œ�áEFT-POINTING A¤ž7015Ô³Œ€ 6ACUXF0164€ Ç< T¼  F017d< Õ< Z< ø ñ< 		´ 	½9½ %18œ 9Lô]I6201• 9Ô6  ÀRK
    '\u20ö(1c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d5 45 ORIGH6 &226 56 gBULLETW 3! 6! wEN DASH" 4" 7" M" Ffffe" 8" •UNDEFINEDF 1‰ 9$ QTRADEä T SIGN* F0161N A* õLATIN SMALL LETTER S WITH CARO: F203a: B: qSINGLE *±-POINTING A hF015bE CE  WACUTE¹ 5: D: T¹  7017AE: Z: ó F: ® 0xa0¬ … A0: ÖNO-BREAK SPAC× 02c7+ ® A1) 	vF02d8  2  FBREV@ &14ÐAîÐeCAPITAÒLß TSTROK= !xa{¦ ö‹CURRENCY50* ¥ è¶e Ae TOGONE[0xa6À e B… SN BARÞ!xa% 1SEC§¾!xa' •DIAERESISK 9p ACOPY¥Ö 5AÖ eEDILLAg È‹  gp!xa©D 8NOT¥ !xa—# ÷¤SOFT HYPHEœ!xaÉ & ã¨REGISTEREDP Au017¹ ËÓõ uDOT ABOp(xbÙBÙhDEGREEf !xb”� BÖ¨PLUS-MINUS* Fu02d� Bà	?Fu014dBá	±ßbµ† ß¥d ACCEN¥!xbX' ÞXMICRO¨ (xbÆBÆzPILCROW' ÈBÈ–MIDDLE DOq ÆBÆC]Au010• ¦BÄq	õ oPu015f; Ö	; Ôb‹
Ô7ÕAu013´� Õ¼ b³î< îG 
¹ j øð#  0xBE -> LATINú+ SMALL LETTER L WITH CARON
    '\u017c'   #  0xBF -> LATIN: Z: –DOT ABOVE> %54> &C0> eCAPITAz R@ DACUT< 0xc1: z /C1< A< 2< 2< ¦CIRCUMFLEX¹ 0C ÷ /C3A 5BREõ !xcó ¹ 4< –DIAERESIS|  39¿ | 5@ ¯5Vu0106< 6< C57: ¸ 7< vCEDILLA¶ 0)/C8> e!xcð z 9< E¶ Pu0118¸ .A< cOGONEKµ 0xcb; y B= «  1aB } C@ Z0xcd: | D< Iõ 8xce< E< àC ¹ ×™D} ¹  r0 < DÕ< TSTROKÖVu0143= ÖNy Ý4£y Ö< µ !xdv nDÑOx (xdÑDÑ< n52ÒA xDOUBLE ü !xd×À ÙC U!xd:@ Ý÷MULTIPLICATION SIGö5UDÍ¸jFu016[DÍUjIRING5!xdS« ÒA ' ¯jÑ< jÇ ÔC jØDØY ¿ 6wDØT< 
ƒ0xdfZº Õ	æÀSHARP S
    ð0'\u0155'   #  0xE0 -> LATIN SMALL LETTER R WITH ACUTE
    '\xe18 : 1: A: 2: 2: £CIRCUMFLEXy Pu0103A ³ 3? FBREV³ 48 ³ 4: –DIAERESISx  3a@ x 5> Lñ  ² 7: 6: C: !xe8 ² 7: vCEDILLA° &0dv 8< CARON: 0xe98 v 9: E° Au011< $A: eOGONEKu bu B; � 1@ y C> Cí %í D: Ií 8xee² E: ÈfA ³ F? Dy ³  f1: Fµ: TSTROKAu014u F¶Nu ð : 8u ¶: ¯ !xf¯bF±Ot !xf¬ : ±: b5(²? jDOUBLEä f6ò € ¹A 1(xf½F½ÄDIVISION SIGo „5F©„ZFu016CF©UZ†RING ABOfÐß ®? 7Z­: ZcZ°A Z´F´Yø ¹ 6Ž ´T: Q'2d¨±3DOTSó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð9 cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' withñ gencodec.py.

"""#"

import  €s

### C% Â APIs

class ($ . Â):

    def W ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o  de‰ o )B 	o  o ú ÁIncrementalE>r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø eNª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âåname='cp1251', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[ Ping T• E5codå2 = (`'\x00'ßñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘À16 -> SYNCHRðONOUS IDLE
    '\x17'
 õ #  0x17 -> END OF TRANSMISSION BLOCK4 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! åFILE SEPARATORo d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  j 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'"ru“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ ÃQ3Q$ 3EVEèµ& R& E-L º& M& $NI):• FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼ÐLATIN CAPITALð LETTER I
    'J'   ô	#  0x4A -> LATIN CAPITAL1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ o5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL<AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ åj/ Õ	/ ãk/ Ó	/ ál/ ÔC	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðàT
    'u'     ð   #  0x75 -> LATIN SMALL LETTER U
    'v'   / 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# ŽF  TDELET! Pu0402# !  80! àCYRILLIC CAPITŸ ã(DJ6 36 16 	G6 F201a6 26 òSINGLE LOW-9 QUOTATION MARKW\u045l 36 ¢ 	ƒ
j ej 44 ODOUBj F20266 êpHORIZON„ELLIPSIS˜ F2020. égDAGGER! 1! Û… ( &ac( Ô–EURO SIGNL 3m É™PER MILLE) F0409M Ã.ÐLš36 ÊšáEFT-POINTING A®¨0Þáz Nz 7040ý ï6 K6 bæ ÷6 8TSH·í7 (DZ7 5$9$	‚"E2018¢ 9"LWC6201‡9!ü6 C9!k mk d  "k 6 2
"DBULLæV\u201­9vEN DASHÊ&14y )EM" 6fff½9•UNDEFINEDF 1‰ QTRADE:5T
	½
Ë9$5E 
	y 	5Ë
	4 	59	4 

5
9
5 ÀTTER DZHE
  �  '\xa0'  ð#  0xA0 -> NO-BREAK SPACE
 p'\u040e+ ) 1) öCYRILLIC CAPITAL LETTER SHORT U: 5: 2: OSMAL8 &08r 38 r J§ 0xa43 "  § 45 ÆURRENCY SIGN• 9ú ( 5( Ï äGHE WITH UPTURB 8xa6j 6B £BROKEN BARg 8xa7% 7% {SECTIONŽ  01) Ž 8' ]%IO\ 93 ë 95 ŒOPYRIGHT^ ^ A) ì ¶UKRAINIAN ISbh B? ñLEFT-POINTING DOUBLE ANGLE QUOTAá EMARK¬ cD CD )NO¦ 8xad# D# ¦SOFT HYPHEvKõ E& ¬REGISTEREDö }ö F* T$YI¨ b_ BhDEGREE[ !xb­& ¨PLUS-MINUS*  6'… BüÄ×BYELORUSSIAN-ˆ› Gu045K 
	GI 9À ” #	I ù'b5©B;XMICROù !xb¬ #zPILCROW' £'  §MIDDLE DOTú ± 
	± Au211� ä JNUME¥  SB	Y �bB{ ‚ äB¥	‚ â S�Û (3 S$DZ®  i 6 86 	i 
4 Ÿj 
B	4 @Au041B3 C@g � Aß1ßCN4 BÐ  12‡i Y
V5 35 
Cž (GH6 &C06 D5 pC%Õ j >¶C55 Z  §CD6 ÀE
    '\u041ö&8'   #  0xC8 -> CYRILLIC CAPITAL LETTER I
    '\u04194 94 	YSHORT: a: A: 	'KAo b5 B5 	'EL5 c5 C5 
M5 d5 D5 
N5 e5 E5 	O4 f4 F4 	&PE5 %205 /D05 	'ER5 15 15 
S5 25 25 	TŸ 35 35 	Ui 44 44 	'EF5 55 55 	HE&265 65 	(TSÔ 76 76 	(CH6 TDT
S¢ VDVC8 TDT
‡HARD SIG¼2[D[
8YER·]D]
LSOFTs dDdòcDc
Y¥ dDd
Y'3dEdESMAL2 aEa	2 B 3_E_	3 V3 ]E]	3 G‡3]E]	4 Dg [E[	3 I3 YEY	3 Zš WEW
4 g TET	3 ¦3PEP	2 ¤3PEP	8 ¢3GEG	3  3CEC
3 ž3:E:
3 à39E9ÀIC SMALL LETð#TER O
    '\u043f'   #  0xEF -> CYRILLIC SMALL LET2 &PE3 %403 /F03 'ER3 13 13 S3 23 23 T™ 33 33 Ue 42 42 'EF3 53 53 'HA3 63 63 (TSÌ 74 74 (CH4 84 84 Sœ 94 94 	C6 a6 A6 —HARD SIGNb: B: 8YER§c5 C5 LSOFTo d: D: Ee2 E2 YŸ DFDóYA
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
Adef ÷ ñe(self,input,errors='strict'):,  ¬creturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðzà,
        incróementaldecoder=Incr D 3,
  �streamrea) S R # rwriter=# W # �)


### [ ±ing Table

~ Ping_t A = (u a'\x00'~ õ #  0x00 -> NULL 1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t" "  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ ÀF -> SOLIDUS€
    '0'   ò#  0x30 -> DIGIT ZERO% 1% 1% 2ONE$ 2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOURo 5% 5% #IVJ 6% 6% 2SIXI 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& $NI):% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@( 4YÃCOMMERCIAL A4A( \òLATIN CAPITAL LETTER AY B1 i1 B1 C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 óP1 51 P“ Q1 Q1 R1 ;S1 Sb T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ ©5ãREVERSE SOLIDU¯])  * R¦Ð SQUARE BRACK ET
    '^'   ó#  0x5E -> CIRCUMFLEX ACCEN, _, F, ‚LOW LINEO `#  60# YGRAVEJ a' 1' òLATIN SMALL LETTER AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ Ùc N/ o/ Ü’O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ðS/ t/ ðöu/ ðU^ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðô EFT CURLY BRACKi|- î‡VERTICALB}( çORIGHV ~. æCTILD~3\x7�ß7×TDELET! Au20a1! 8ÉƒEURO SIGQ\ufff÷$ ¾ƒUNDEFINEQ\u201×$ ³óSINGLE LOW-9 QUOTATION MAR`\u0192Ä 6 º¥F WITH HOO9 7201“ ÄODOUBo F2026o ËóHORIZONTAL ELLIPSI( Ó &20. ÊSDAGGEx! 1! ¼… 
( 702cw µ„MODIFIERët d 3… Â™PER MILLE¥7016) ¼ðCAPITAL LETTER S WITñ)H CARON
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING A äQUOTATION MARKD F0152D CD ô
LATIN CAPITAL LIGATURE OE4 Ffffe4 D4 ”UNDEFINED$ F017d$ E$ X »ETTER Z WITØ 
` F< ` 	$ /90$ E2018„  91$  %6201U 925 _RIGHT6 ck 36 k DOUBLE k $ 945 k 6 2² 956 dBULLET{F2013Œ 6! wEN DASH" 4" 7" M" 702dÐ 8" ¥SMALL TILD	(21‹ 9& QTRADEbE SIG«F0161r A* V LS F203a: å,ææ ä9ä9äV Õ â7017šâv< Y“DIAERESISÁ0xa0úAþÔNO-BREAK SPAC¢!xav) ý INVERTED EXCLAM!xa_4 0CENÐ!xaO$ ðXPOUNDõ!xae% àŠCURRENCY( 5Î Ò:YEN# 6# Ô¥BROKEN BAR7% ×1SECóŒ!xa{— Üa$ ÚACOPYs
™ �) Ùö
FEMININE ORDINAL INDICATO© b© Ô .Ì¹!xa y Ó+NO¥^# Ä¤SOFT HYPHE›!xaÄ& Æ›REGISTEREÐf· ¶6MAC‘(xb—B—iDEGREE3b”B”ªPLUS-MINUS* ŠBŠô SUPERSCRIPT TWOûb�B�	* 5HREb—B—€ACUTE ACèS –B–ZMICRO¢ ˜B˜zPILCROW' šBš”MIDDLE DO¸(xb˜B˜ð CEDILLA
    '\x@b9'  ð#  0xB9 -> SUPERSCRIPT ONE
 X'\xba* A* õMASCULINE ORDINAL INDICATOR6 b6 B6 õRIGHT-POINTING DOUBLE ANGLE QUOTATION MARKE cE CE ±VULGAR FRAC/  ON= FARTE{ d6 D6 EHALFi e3 E3 ETHREk S9 f9 F9 ÑINVERTED QUES¤ Ó 'c01  C01 õLATIN CAPITAL LETTER A WITH GRAVŠ(c1< 1< FACUT< 2< 2< ¤CIRCUMFLEXê (c3A 3A FTILD} 4< 4< …DIAERESIf(c5@ 5@ R_7ABO:6A 6A ³ 72 72 C¨uCEDILLA-8> 8> E> 
æšCš"< 
æ¬C¬< 	æ ·C·A 	ª²C²@ Iù ¸C¸< 	
ù ÁCÁ< 	ù  ÉCÉA 	ù dØDØ4ETH%dÏDÏN,	RdÏDÏO< 	adÊDÊ< 	hdÊDÊ< hdËDËA 
õ ÆDÆ< ¤ÔDÔpMULTIPL¼ }ESIGNŸÄDÄn USTROK?dÅDÅU ÅDÅ< 
 ÀDÀÀTAL LETTER Uð WITH CIRCUMFLEX
    '\xdc'
 ò #  0xDC -> LATIN CAPITAL LETTER UA •DIAERESIS@ d@ D@ Y@ UACUTE< e< E< UTHORN5 f5 F5 ESMAL¯ eSHARP ¦ 'e05 /E05 A¤ EGRAV¤ (e1: 1: 	Þ (e2: 2: ™(e3? 3? FTILD³ 4: 4: Ñ(e5> 5> ‡RING ABO06? 6? ­ 70 70 CštCEDILLA(e8< 8< E< 
Ö9: 9: 
Öa: A: Ö b? B? œ­E­	üIñ §E§: 
ñ ¥E¥: ñ  ¯E¯³ ñ f¸F¸4ETHf¯F¯N"	6f¯F¯O: 	MfªFª: 	\fªFª: \f«F«? 
í ¦F¦: –´F´ÅDIVISION SIG«f F f USTROKf¡F¡•
Ž¡F¡: 
ŽœFœ: Ž �F�? T¡F¡Ff¡F¡ÀMALL LETTER ðTHORN
    '\xff'
 ó8 #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
e  _t ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
CPdef e÷ ñe(self,input,errors='strict'):,  icreturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  šTâ EÎ2 = (W'\x00Y 00YANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& ¥RANSMISSIO(05. 5. UQUIRYv 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  ª 09$ ð HORIZONTAL TABU¹» n0 A0 •LINE FEED— b& þ 0B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ ÖCARRIAGE RETUz"0e, | E* †SHIFT OUÓž0ž$ I¢1h1hðDATA LINK ESCAPE
    '\x11'    ð #  0x11 -> DEVICE CONTROL ONE
    '\x12'
 - 2-  5TWO- 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  N 20) CSPACÇ !  ›€EXCLAMAT‚3MAR�"+ ™LQUOT) #) •²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'"Vu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[“DIGIT ZER¡1% `% òï™3Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:MFCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 ð 4 -> LATIN CAPIðTAL LETTER D
    'E'   ÷#  0x45 -> LATIN CAPI1 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ d5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çESMALbA,b/ å	/ B/ c/ ã	/ C/ d/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó		/ ál/ Ô8	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ ÀALL LETTER O€
    'p'   ò#  0x70 -> LATIN SMALL LETTER P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# ¨F  TDELET! Pu20ac# ! 8É’EURO SIGN“ f\ufffe$ ¾”UNDEFINED$ F201a$ ³ôSINGLE LOW-9 QUOTATION MARK6 F01926 º¥F WITH HOO9 7201“ ÄODOUBo F2026o ËóHORIZONTAL ELLIPSI(f\u2020. ÊSDAGGEx! 1! ¼… 
( 
@µ@ 3m ªŸPER MILLE�¤M 9™ ™�áEFT-POINTING A¡›
µ °h 
$ ¬$ ¢$ ¦$ 9©$ E2018ø 9©L‘ý é 6201-9ºq6 89º k k d  ¶k 6 2%9¶DBULL[ ˆ&13W ©tEN DASHhF2014" ª)EM" 	Ë9¤1‰ ¤QTRADEÓ¥9¥29¥¦ 9¦9¦9¦À
    '\ufffeð'   #  0x9F -> UNDEFINED
    '\xa0" $  A0$ ãNO-BREAK SPACE) Pu0385+ M  A1) ÷GREEK DIALYTIKA TONOS0 60 20 ù
CAPITAL LETTER ALPHA WITH@ 0xa3> ™ 3@ £POUND SIGNe 8xa4% 4% ŠCURRENCY( » M 5( :YEN# ® # 6# ¥BROKEN BARp 7p 7% kSECTIOL 8' 8' „DIAERESI 8xa9$ 9$ ˜COPYRIGHT™ Pufffe+ yA) Æb" ½ B$ ñLEFT-POINTING DOUBLE ANGLE QUOTAµ EMARKÜ cD CD )NO‹ 8xad# D# ¦SOFT HYPHE•¯ � E& ™REGISTERE¿Au201™Û ¡pHORIZON!xb¦B¦ DE*7xb1Ÿ B£ªPLUS-MINUS* 2* �ô SUPERSCRIPT TWOb‡B‡	* 8HRE#�Ï BŽ ¤ KÙbó BŒZMICRO¡ ŽBŽzPILCROW' �B�£MIDDLE DOTÃ  º�— Ž— Š~EPSILONŒ B ®B ¬B TÊ  > ao> Á> /IO? (xbÜBÜ%Ý „ ß„ Ý„ O‹ (xbüBü¢VULGAR FRA‡ONE HALFyeù 	u Uy	fB !B OOMEG{9:÷ C8@ ESMALƒyÌ9AND·Au039_K ]K FÐ9j5 h5 GBETA4 t4 r4 HGAMM5 {C{ž 9DELj Œj Šj ¡ ž7 œ7 ZÕ «4 ©4 
3 ·C·*TH5 à9'   #  0xC9 -ÿ%> GREEK CAPITAL LETTER IOTA
    '\u039a'   #  0xCA -4 HKAPP5 b5 B5 HLAMD5 c5 C5 'MUœ d2 D2 N2 e2 E2 'XId f2 F2 vOMICRON7 %a07 /D07 Pi &a12 12 4RHOe 6fffÎ  D23 ”UNDEFINED$ F03a3W 3$ ôGSIGM‹&a45 45 'TAZ&a53 53 YUPSIL(67 67 (PH)73 73 C3 83 83 (PSf 93 93 HOMEG8-D- aè WITH DIALYTIKC ;D;HF LDLESMALèRALPHAB WTONOS4XDX	> EÊ@ ˜f
@ T| pDp	< A¹ bvEv	= ;\ AND N ’E’	N E:%b26E’n	3 (BE`b E 	2 8GAMžbžEž	3 9DELf žEž	3 ÒÍ œEœ	5 ZÍ ›E›	2 
1 ™E™	1 *TH3 ™E™	3  !È –E–	2 Áb†E†	3 ¿bsEs½beEe»bUEU¹bIEIÀ SMALL LETTE÷*R OMICRON
    '\u03c0'   #  0xF0 -> GREEK SMALL LETTER PI0 10 10 7RHO1 21 21 ·FINAL SIGMA9 39 39 3 43 43 7TAUd 51 51 YUPSIL365 65 (PH471 71 C1 81 81 (PSb 91 91 HOMEG_a3 A3 øIOTA WITH DIALYTIKA bA BA <D cD CD ³D WTONOSÀd@ D@ 	„ @ e@ E@ 8~  7fff> F> óUNDEFINED
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
§Adef ÷ ñe(self,input,errors='strict'):,  •creturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ Àdecoder=IncróementalDecoder,
  ástreamreader=S R # Ewrit# W # �)


### [ Àing Table

dk Ping_t A = (u a'\x00'~ õ #  0x00 -> NULL 1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t" "  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF Ð0'        #  ð0x30 -> DIGIT ZERO
    '1'   v#  0x31% 2ONE$ 2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOURo 5% 5% #IVJ 6% 6% 2SIXI 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& $NI):% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@( 4YÃCOMMERCIAL A4A( \òLATIN CAPITAL LETTER AY B1 i1 B1 C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 óP1 51 P“ Q1 Q1 R1 ;S1 Sb T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ „5ãREVERSE SOLIDU¯])  * R¦Y À'^'        #ð  0x5E -> CIRCUMFLEX ACCENT
    '_'   #, F, ‚LOW LINE# `#  60# YGRAVEJ a' 1' òLATIN SMALL LETTER AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ Ùc N/ o/ Ü’O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ðS/ t/ ðöu/ ðU^ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- î‡VERTICALB}( çORIGHV ~. æCTILD~3\x7�³7×TDELET! Au20a1! 8ÉƒEURO SIGQ\ufff÷$ ¾ƒUNDEFINEQ\u201×$ ³óSINGLE LOW-9 QUOTATION MAR`\u0192Ä 6 º¥F WITH HOO9 7201“ ÄODOUBo F2026o ËóHORIZONTAL ELLIPSI( Ó &20. ÊSDAGGEx! 1! ¼… 
( 702cw µ„MODIFIERët d 3… Â™PER MILLE¥7016) ¼@CAPIß USMðCARON
    '\u2039ñ'   #  0x8B -> SINGLE LEFT-POINTING A öQUOTATION MARK
    '\u0152D CD ô
LATIN CAPITAL LIGATURE OE4 Ffffe4 D4 ŸUNDEFINED$ E$ F$ /90$ E2018�  91$  ù F20195 25 _RIGHT6 c6 36 k DOUBLE k d5 45 k 6 2š 956 dBULLETcF2013W 6! wEN DASH" 4" 7" M" 702dÐ 8" ¥SMALL TILDñ(21‹ 9& QTRADEJT SIGNr F0161r A* OV õLETTER S WITH CARO: F203a: Í,ÎÎ Ì9Ì9Ì7017„Ìù Hû Yû “DIAERESIS90xa0ý ÌAèÔNO-BREAK SPACŒ!xa`) íý INVERTED EXCLAMå!xaI4 ì0CENëº!xa9$ ÚXPOUNDß!xaO% ÊŠCURRENCY( 5Î ¼:YEN# 6# ¾¥BROKEN BAR7% Á1SECÅv!xa{— Æaî$ ÄACOPY]
™ ‡) Ãö
FEMININE ORDINAL INDICATO© b© ¾ ¶ë‹!xaŠy ½+NO¥H# ®¤SOFT HYPHEK!xaž& °›REGISTEREÐf· ¶6MAC–(xb—B—iDEGREE3b”B”ªPLUS-MINUS* ŠBŠô SUPERSCRIPT TWOûb�B�	* 5HREb—B—€ACUTE ACèS –B–ZMICRO¢ ˜B˜zPILCROW' šBš”MIDDLE DO¢(xb˜B˜uCEDILLA“ –B–æ &ONä —À0xBA -> MASCðULINE ORDINAL INDICATOR
    '\xbb'
 õ' #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARKE cE CE ±VULGAR FRAC/  ON= FARTE{ d6 D6 EHALFi e3 E3 ETHREk S9 f9 F9 ÑINVERTED QUES¤ Ó 'c01  C01 ôLATIN CAPITAL LETTER A WITH GRAVEm (c1< 1< FACUT< 2< 2< ¥CIRCUMFLEX} 3A 3A FTILD} 4< 4< …DIAERESIf(c5@ 5@ R_7ABO:6A 6A ³ 72 72 C¨uCEDILLA-8> 8> E> 
æ9< 9< 
æa< A< æ ·C·Ÿ¹ ª²C²@ Iù ¸C¸< 	
ù ÁCÁ< 	ù  ÉCÉA 	ù Au011ƒ ðDØGù 6BREždØDØN< 	[dØDØO< 	jdÓDÓ< 	qdÓDÓ< qdÔDÔA 
õ ÏDÏ< ­(xdÝDÝpMULTIPLÅ †DSIGNÍdÍDÍn USTROKHdÎDÎU ÎDÎ< 
 ÉDÉ<   ÊDÊÀATIN CAPITALó2 LETTER U WITH DIAERESIS
    '\u0130'   #  0xDD -> LATIN CAPITAL @ I@ †OT ABOVE@ &5e@ E@ S@ sCEDILLA> 0xdf< ~ F> ESMAL| dSHARP ³ !xe± 5 /E05 Aq 5GRA­ 7xe1o /E1: DACUTç 8xe2: 2: ¤CIRCUMFLEXè (e3? 3? FTILDy 4: 4: Þ8xe5> 5> IRINGÝ8xe6? 6? ­ 70 70 Cš(e8< 8< E< 
Ö9: 9: 
Öa: A: Ö b? B? œc> C> x
ñ d: ´	6: 
ñ ¬;®: ñ  ¯E¯y ñ Au011@ kF¸Gâ6BRE¸f¸F¸N: 	?f¸F¸O: 	ef³F³: 	ef³F³: ef´F´? 
í ¯F¯: Ÿ(xf½F½ÔDIVISION SIGNÌf©F©f USTROK fªFª«
ŽªFª: 
Ž¥F¥: Ž ¦F¦? T ^»óª“DOTLESS IcGu015*§Sð ff'     #  0xFFó0 -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . Ð):

    def e÷ ñe(self,input,errors='strict'):,  0 creturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  šTñ
~ å2 = (`'\x00'.€ #  0x00YANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ ð HORIZONTAL TABU¹» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1tðDEVICE CONTROL OÐNE
    '\x12'
 õ #  0x12 -> DEVICE CONTROL TWO- 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  N 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ ™LQUOT) #) •²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'"Vu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[“DIGIT ZER¡1% `% Oòï™3Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI):MFCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •À 'E'        ð#  0x45 -> LATIN CAPITAL LETTER E
    'F'   1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ 35ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çESMAL1A,b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó		/ ál/ Ô8	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ À#  0x70 -> LðATIN SMALL LETTER P
    'q'   Î#  0x71 -> L/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# yF  TDELET! Pu20ac# !  80! ’EURO SIGN“ f\ufffe$ ¾”UNDEFINED$ F201a$ ³ôSINGLE LOW-9 QUOTATION MARK6 F01926 º¥F WITH HOO9 7201“ ÄODOUBo F2026o ËóHORIZONTAL ELLIPSI(f\u2020. ÊSDAGGEx! 1! ¼… 
( 702cw µ„MODIFIER*óCIRCUMFLEX ACCEN7 d 3… ÂŸPER MILLE¥¼¥ &39± ±¥áEFT-POINTING A¹³
Èh 
$ Ä$ º$ ¾$ 9Á$ E2018ø 9ÁL©ý é 6201-9Ò‰6 P9Ò k k d  Îk 6 2=9ÎDBULLs <&13W ÁtEN DASH€F2014" Â)EM" 702dÐ ¼Sãg8u21‹ ¦QTRADEí§9§L9§¨ 9¨9¨9¨À   '\ufffe' ð  #  0x9F -> UNDEFINED
    '\xa0'
 $  A0$ åNO-BREAK SPACE) 1) 1) õ
INVERTED EXCLAMATION MARK4 24 24 •CENT SIGN$ 3$ 3$ XPOUND% Pu20aa' Ê  A4% ¨NEW SHEQEL* 0xa5( ô  A5* :YEN# 6# 6# ¥BROKEN BAR— 7% 7% 1SECâ 	¾ 8' 8' •DIAERESISK 9$ 9$ ŠCOPYRIGHdt A) ’MULTIPLIC]	{ bW B. òLEFT-POINTING DOUBLE ANGLE QUOTD 	¡cD CD *NO• (ad# D# ¦SOFT HYPHEÆe& E& ™REGISTEREË8xaf* •UMACROK b’B’iDEGREEÅb�B�ªPLUS-MINUS* …B…ô SUPERSCRIPT TWO©b‹B‹	* 5HRE'b4Ç B’€ACUTE ACãS �B�ZMICRO¢ ‘B‘zPILCROW' B“¥MIDDLE DOTq ‘B‘uCEDILLA" �B�æ %ONä fq �PDIVISçŠbŠBŠÝ‹b‹B‹¢VULGAR FRAy ONÈEARTE§bžBž6 EHALF eº«3 Tê1 QUk ÈbºBºAQUES^2u05Ì¶CÊqHEBREW ¤ ¿V— - Ó- Ñ	- ³HATAF SEGOLÊ  3 Ü3 Ú3  WPATAH3 å3 ã3  QÍø  g í4 ë
4 GIRIQa ó- ñ	- DTSERa Z û- ù	- î �- ÿ	- è 	- 	- â . 	. THOLAMâ 1fffB- V Ù $ 	Q XQUBUTaý. û	. ÙDAGESH OR MAPkþ7 ü7 ÀOINT METEG
 õ$   '\u05be'   #  0xCE -> HEBREW PUNCTUATION MAQAF
 3 f3 F3 –OINT RAFE, %c0, (D0, _ WPASEQ3 13 13 _ ‡SHIN DOT0 20 20 / 3/ 3/ ’ ‡SOF PASU– fÉ 47 öLIGATURE YIDDISH DOUBLE VAV£ fÓ 5= 	wVAV YOD: Ý 6: 	w 
= ë 7= ÜgGERESHq 484 dSHAYIM7 6fffG D97 …UNDEFINEÌ 
$ A$ B$ C$ D$ û´ ì$ 605dEä§LETTER ALE=dEÞ- 'BEÚdýEÚ, TGIMELƒ605dîEÙ. 9DAL\ èEÐµ HÄ%d5E¾+ 	ê&d6, 	°, WZAYIN³ 7. ¡³ H± 8, ™, T, 9, ŽÕ, 	%&da, –
, xFINAL K &db2 ¤
2 
, c, ¬
, 6LAM"F05dd. ¶
. Œ %MEx605dxEÄ
2 
, ¸EÌ
, ^ 'NU eÚFÚ 
, ÙFÙ WSAMEKheÜFÜ 
(eÛFÛ º P³eÞFÞ 	+ ÞFÞ \ VTSADI¸eæFæ . æFæ 'QOeæFæ 
¬eçFç  +´ àa'   #  0xFA -ÿ(> HEBREW LETTER TAV
    '\ufffe'   #  0xFB -> UNDEFINED$ C$ 7200H D$ ôLEFT-TO-RIGHT MARKQ F200fu E- %  .  6 	- 
¢ F- ¢ ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
VAdef ÷ ñe(self,input,errors='strict'):,  ûcreturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  šTñ
~ å2 = (P'\x00j á 00?ANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t" Q9$ öHORIZONTAL TABULAT» n0 A0 uLINE FEb2x0b& †0†oVERTICR 8x0c. �HFORMR àr'       #  0xð0D -> CARRIAGE RETURN
    '\x0e'
 € #  0x0E* •SHIFT OUT$ f$ F$ IG '10#  10# ôDATA LINK ESCAPEN (11+ 1+ öEVICE CONTROL ON- 2- 2-  5TWOZ 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% Ôc! C! ÖFILE SEPARATOFd) ™_GROUP*  ™1™oRECORD+   1 LUNIT)  { "  í2¦CSPACè !  ›€EXCLAMAT‚3MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDø1"'"õu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æƒERCIAL A¥A( À1 -> LATIN CðAPITAL LETTER A
    'B'   ú#  0x42 -> LATIN C1 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 R1 S1 S1 T1 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ ÷5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Óœ	/ ál/ ðC -> LATIN SMALLð LETTER L
    'm'   ô#  0x6D -> LATIN SMALL/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f# 57×TDELET! Pu20ac# ! 8ÉƒEURO SIGf\u067e$ ¾dARABICu2PEH¿ f\u201a, »ôSINGLE LOW-9 QUOTATION MARK6 F01926 Â¥F WITH HOO9 7201› ÌODOUBo F2026o ÓóHORIZONTAL ELLIPSI0 Ó &20. ÒSDAGGE€! 1! Ä… 
( 702cw ½`MODIFIçîóCIRCUMFLEX ACCEN? d 3… ÊœPER MILLE­9� Ä
­(TT®3- Â®áEFT-POINTING AÂ¼5¼Ù˜@CAPIP¥LIGATURE Ov7068
å¥ &CH¦ F0698Ó å
. J, 8, ñ
, 3DDAS Ùa ý9ý
- 4GAF£6201Y 9Lí06201`9Í6 ”9 k Uk d%9
k 6 2½9
DBULL· x&13W ýhEN DASò4" þ)EM" 706aø
g"KEîÀ  '\u2122'  ó #  0x99 -> TRADE MARK SIGN
    '\u0691'  * A* ôARABIC LETTER RREH- F203a- B- ñSINGLE RIGHT-POINTING A ‘QUOTATIONw E F0153E CE ôLATIN SMALL LIGATURE OE2 F200c2 D2 ÷ZERO WIDTH NON-JOINER0 d0 E0 
, 706bÓ F, 
 ³NOON GHUNNA` 0xa0^ 4 A04 ÕNO-BREAK SPAC¹ '06¹  A1) ] FCOMMP 2P 2' HCENT¨!xa4t 3$ ZPOUND% 4I 4% ŠCURRENCY( 5( 5( :YEN# 6# 6# ”BROKEN BAi8xa7% 7% 1SECòd8xa8' 8' •DIAERESIST9$ ²ACOPYX™ Pu06be+ ÛA± äHEH DOACHASHMEŒ0xab6 A¼7LEF´oDOUBLE»	!xa‡D »+NO¨z# ¬¤SOFT HYPHEv!xaÃ & ¢›REGISTEREÓf·  UMACROK b�B�hDEGREE6!xbåq BŠªPLUS-MINUS* �B�ô SUPERSCRIPT TWO³b“B“	* &HR~bšBš€ACUTE ACëS ™B™ZMICRO¢ ›B›zPILCROW' �B�¥MIDDLE DOTq ›B›eCEDILL�b™B™æ $ONbAu061dšBšwSEMICOLµ) ��êBŽbŽBŽ¢VULGAR FRA†•ONE QUART(xb¡B¡6 EHALF%e„B®3 Tík Õ ¿½ AQUES( ‘h Au06c§/ CË/ Œ ÛFGOAL1 21 Ö1 4AMZÊAu062Ü_ Ú
. ÷ALEF WITH MADDA ABOVÞ2ð> î> Hv > >  	g2WAW{ = = { ÀMZA BELOW
  ô.  '\u0626'   #  0xC6 -> ARABIC LETTER YEH WITH HAMZA ABOVE
  = 7= 7= GALEF- 8- 8- 7BEH, 9, 9, ·TEH MARBUTA4 a4 A4 , b, B,  H� c- C- GJEEMZ d- D- (HAæ e, E, K- f- F- 6DAL… %30, .D0, )TH- 1- 1- R&32, 2, GZAIN† 3- 3- 8SEE- 4- 4-  H. 5. 5.  'AD‡ âDâ D, !xdÏDÑøMULTIPLICATION SIG´ 0 <DÒ Tì3þDÒ Z, þDÊ 
eöDÊ )GH. 4ËgTATWEEB4Ç F4Ç 'QA4Æ K, !xe« �EÆ´LATIN SMALL Až8GRA˜4MEÓ $LA±!xe¼ f Óf ¦CIRCUMFLEX^4ŠEå M4‹Eå 7NOO^4^Eä 	£4^Eä 3WAW² !xeV ñ äñ  CWdCEDILLd!xef < ò<  E< “!xeÒ:  : DACUTe!xeà: : ¡!xeé? !? “DIAERESIS-Au064¹ ãE1 ât MAKSUR& 5 ´ 5 = Y=!xeŸ =Ÿ  IRÞ  ? P? ð DIAERESIS
    'ñ\u064b'   #  0xF0 -> ARABIC FATHATAN
    '* c* 1* KDAMM* d* 2* KKASR* e* 3* ~ { 0xf4% ¥ 4' óLATIN SMALL LETTER O WITH CIRCUMFLEX?  ä fA ä 5? ä º ' &50' 6' · ' 0xf7% � 7' ÇDIVISION SIG0 51* v 8( v eSHADDAP 9& P 9( Ý  UÝ SGRAVE: Pu0652< b A: b 4UKU‰ !xfáa B' a >!xfö? C? ”DIAERESIS¤ 7200âD> ÷EFT-TO-RIGHT MARK- ©E- %  . :LEF- 706dþ F- þ óYEH BARREE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ±#"

import  sÖ v ÁAPIs

class  ($ . 1):
eAdef ÷ ñe(self,input,errors='strict'):,  øcreturno B = , 4ing)C  o Bo *B 	o  o ú ±Incrementalí$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Ddª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¦�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±bname='”%', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  šTñð
decoding_table =Ð (
    '\x00'
 õ #  0x00 -> NULL 1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ TÐDIGIT THREE
 s   '4'  ð#  0x34 -> DIGIT FOUR
 +'5% 5% 2IVE% 6% 6% 2SIX$ 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& 3NIN• :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 31 C1 D1 �“ D1 E1 �1 F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 ;S1 Sb T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ 5ãREVERSE SOLIDU¯])  * R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# 6ñYGRAVEJ a' À  0x61 -> LAðTIN SMALL LETTER A
    'b'   Ý#  0x62 -> LA/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ ðR/ s/ ðS/ t/ ðT/ u/ ðU/ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�:7×TDELET! Au20a1! 8ÉƒEURO SIGQ\ufff÷$ ¾ƒUNDEFINE`\u201aŽ $ ³óSINGLE LOW-9 QUOTATION MARZ ºZ ~ ¯ODOUBZ F2026� ¶óHORIZONTAL ELLIPSI ¾ &20. µSDAGGEc! 1! §… 
( 
+ Ñ  3m •ŸPER MILLEx�M 9™ „xáEFT-POINTING AŒ†›h 0xa8f "  à—gDIAEREF@02c7& $ �DCAROH)xbD �ÀCEDILLA
    ö'\ufffe'   #  0x90 -> UNDEFINED
    '\u2018$ 1$ ÷LEFT SINGLE QUOTATION MARK5 95 25 ORIGH6 c6 36 k ODOUBk 	d5 45 k 6 &226 56 gBULLETÂ 3! 6! wEN DASH" 4" 7" M" 
_8" _1‰ 9$ QTRADEOT SIGNp 
N A* N 603a” B$ ¨¿-POINTING A½
i CE i 0xafg :D$ UMACRO® @02db# [E! UOGONE#
f F! f 0C f A ïNO-BREAK SPACEA¥M ñM ”0CEN“d!xaô$ ‚XPOUND‰!xa÷% rˆCURRENCY( 
^Ad• 6â g£BROKEN BARÞ 8xa7% j1SECu!!xd¨˜ oðLATIN CAPITAL LETTER O WITH STi d °= ˆACOPY7	Ö 1015´ ÙA‡f Rf uCEDILLAg g ¡ ã™¶ !xa%D  +NOÈ# Ÿ¤SOFT HYPHE¤!xaý& ¤šREGISTEREócó * ­õ A’(xb»B»hDEGREEM7xb1ÚB¸ªPLUS-MINUS* ¾B¾ô SUPERSCRIPT TWOcbÄBÄ	* 6HRE¦ ËBË€ACUTE ACS 5§ ÊZMICRO¢ $BËzPILCROW' ÍBÍ”MIDDLE DO~(xfËBËOSMALÉbÉBÉÿ $ONý Au015Œ ÊBÊ	e ÈbÈBÈ+ÉbÉBÉ¢VULGAR FRAà ONcEARTEbÜBÜ6 EHALFÀeÀÀ  0xBE -> VUðLGAR FRACTION THREE QUARTERS
    '\xe6'
 ó #  0xBF -> LATIN SMALL LETTER AE0 Pu01042 0 &C00 fCAPITA2 Æ WITH OGONEK= &2e= 1= I= &00= 2= A= fMACRONz 0é · 3= C= DACUTó !xcñ  #/C4< y …DIAERESIc c5· @ 5@ ”RING ABOV� Pu0118C ½ 6A E½ t&12= 7= 7c= 8= 7&CAs0xc9: ÷ 9< ¶ sAu017> ò A< Zò < 1ëB< x <DOTn21C@ G| vCEDILLAi3~ D> K>  2a6ø E> !­&3b= Ë›L{ 6_DÙS> ëUu0143z DØN< ¯4 ó D×< 
o!xdx eDØOz ÝDØ< 	m!xdµ y Õ= DTILDÐ!xd"< Ð< Q d7m@ Ó¡MULTIPLICAì7SIGû7ÐDÄU#> 41m žÅTTSTROKè Fu015ÎDÆS6< Æ¶ �Ø!Ã= a JDÅC &7d6Ç@ 	7 df: ¼ Æ	‘dSHARP c –�à#  0xE0 -> LATü,IN SMALL LETTER A WITH OGONEK
    '\u012f'   #  0xE1 -> LAT; I; &01; 2; v fMACRONv &07; 3; Cv SACUTE: 0xe48 ° 4: u •DIAERESIS> 5> 5> ”RING ABOV} Pu0119A -6? E· h&13; 7; -d; 8; -&CAg!xe® -9: ° gVu017at A: Zê : 1ÛB: t <DOTb2'C> Gx sCEDILLAÝGu013z D< K< &2bð E< Ÿ&3c; F; Lw 6C/F0< S< ÛAu014
‹F¸N: ¡%46° F·: 
c!xf�QF¸Ov ÅF¸: 	a(xfµFµ; DTILD°!xfé ¯ °: -fN> ³ÇDIVISION SIGÍ7‹ U&42Œ¡<TSTROKÜ Fu015²F¢;6: ¢° ‹êŸ; Q U@ )¡U &7e,£> Au02d	x ¢^ ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð+ cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP7  .TXT' withA “ P.py.
y ð#"

import codecs

#ò## Codec APIs

class  (c !s. à):

    def en ñ(self,input,errors='strict'):,  0 preturn 1 ³cs.charmap_B = , ¦ing_table)o  de> o )B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø eNª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9 2### °ings moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âåname='cp1258', ¯!e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# @)


K[ Ping T• E5codå2 = (`'\x00'ßñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –À#  0x17 -> EðND OF TRANSMISSION BLOCK
    '\x18'
 õ #  0x18 -> CANCEL! 9! 9! EU eMEDIUM( a( A( ¥SUBSTITUTE% b% B% VESCAP! c! C! åFILE SEPARATORJ d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  6 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'">7$ ƒPOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ 7$ Q$ 3EVEèµw3R& E-L º& M& $NI):q FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 À  0x4A -> LAðTIN CAPITAL LETTER J
    'K'   ß#  0x4B -> LA1  K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 óEFT SQUARE BRACKET$\\/ >5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL<AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ ãk/ Óã	/ ál/ Ô	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ ðÀLETTER U
   S 'v'  ð#  0x76 -> LATIN SMALL LETTER V
' +'w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# ŽF  TDELET! Pu20ac# !  80! ’EURO SIGN“ f\ufffe$ 1$ ”UNDEFINED$ F201a$ 2$ ôSINGLE LOW-9 QUOTATION MARK6 F01926 36 - ¥F WITH HOO9 7201“ 49 ODOUBo F2026o 56 ôHORIZONTAL ELLIPSIS� F2020. ÊgDAGGER! 1! ¼… 
( 702cw µ„MODIFIERóCIRCUMFLEX ACCEN7W\u203… ÂŸPER MILLE¥¼¥ &39± ±¥áEFT-POINTING A¹³5³È³@CAPIG¥LIGATURE Oe
AÔœ 
$ Ê$ Î$ 9Ñ$ E20189ÑL¹ù 6201=9â™6 `9â k )k d  Þk 6 2š9ÞDBULLƒ L&13W ÑvEN DASHÒ&14" Ò)EM" 702dÐ ÌSÙw8u21‹ ¶QTRADEý·9·\9·¸ý ¸¿ ¶9¶9¶7017n¶2YçfDIAEREˆ!xa!  £AÒÔNO-BREAK SPACg!xaŽ) × INe�ED EXCLAM‚!xa34 Ö ¤!xa9$ ÄQPOUND% À
    '\xa4' ð    #  0xA4 -> CURRENCY SIGN
 `'\xa5'
 ( 5( :YEN# 6# 6# ¥BROKEN BARH 7% 7% kSECTIOL 8' 8' •DIAERESISK 9$ 9$ šCOPYRIGHT™ a) A) ö
FEMININE ORDINAL INDICATO© b5 B5 ñLEFT-POINTING DOUBLE ANGLE QUOTAÆ EMARK¢ cD CD +NOœ d# D# ¦SOFT HYPHE~e& E& ªREGISTEREDì f* F* UMACROK 'b0!  B0! iDEGREEG (b1& 1& ªPLUS-MINUS* 2* 2* ô SUPERSCRIPT TWO(b3* 3* EHREE, 4, —ÅACUTE ACCENT' –B–ZMICRO¢ ˜B˜zPILCROW' šBš–MIDDLE DOq ˜B˜uCEDILLA“ –B–&ONä —B—oMASCUL˜
b˜B˜ò™b™B™¢VULGAR FRAŽ ONÖEARTEb¬B¬6 EHALFeÈ¹3 Tø1 QUk ÝbÈBÈÝINVERTED QUESlcØCØõLATIN CAPITAL LETTER A WITH GRAVŠcîCî< 	Šâ c C < 	£CIRCUMFLEXA Au010C ‚CA 	7BRE¹ 'C'< 	Cc@C@@ 	Rø7ABO� \C\A lgCg2 C¨^c€C€> E> 
æšCš< 	
æ¬C¬< 	æ(xc·C·A 	ªAu030á&²@COMBÅGÍc­C­q ÀL LETTER I WðITH ACUTE
    '\xce'
 ð #  0xCE -> LATIN CAPITAL LETTER I W< ¥CIRCUMFLEXA fA FA “DIAERESIS@ Pu0110B � /D0@ D� USTROK¾  d1;  ¾ /D1= N= DTILD< Pu0309> y 2< ôCOMBINING HOOK ABOV/ 0xd3- k 3/ )Ok 	e(d4< 4< eGu01a%5A CHORN`8xd6| 6;  8xd7@ 7@ öMULTIPLICATION SIGn 8. 8. &	Î�c9= Uc7GRAŸay A< 
Ÿb< B< Ÿ8xdcA CA d ßF‹D@ ß Æ™; ÀÆð!xdc ^©ESMALèdSHARP ž!xew5 Ež	5 A‘ e›E›: 	�'e2NE™D: �Fu010E©? 6BREDe§E§: Å8xe5· ¤> Re	`e¨E¨
? �e˜E˜& CštCEDILLAe¦E¦	l E< 	ge£E£: 
Ö¡E¡: Ö(xe¤E¤? œ &�&E¡&§ u ACCENT"dÍ’	o A : QE‘˜ : è  ¦E¦? è &11è F¯ÀTIN SMALL LEðTTER D WITH STROKE
    '\xf1'
 ñ #  0xF1 -> LATIN SMALL LE; N; DTILD: Pu0323< : 2: õCOMBINING DOT BELOWh ,  h 3. h  Oh DACUTh 0xf4f : 4: £CIRCUMFLEXy Au01aã § 5? CHORN9 8xf6x 69 •DIAERESIS> 7> 7> ÆDIVISION SIGf 8( 8( »9; 9; USFGRAVSa: A: 
�b: B: �8xfc? C? TPu01b0@ ËD> ËAu20a¸ 9 E9 JDONG‰f[ gF$ ‰ YN› ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ñ	 cp273 generated from 'p5 "-m+ ðs/CP273.TXT' with0 � P.py.
g ±#"

import  sÄ d ÁAPIs

class  ($ . 1):
âAdef å ñe(self,input,errors='strict'):,  `creturno 	B = , 4ingC  o 0o *B 	o  o ú ±IncrementalÛ$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DRª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ”�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±aname='‚%', d !e=0 2().     if: 'r=Ïy/ J 	/ ä/ À streamreadeór=StreamReader,
  s Twrite# W # ó
)


### Decoding Table

d  _t A = (R b'\x00'[ õ#  0x00 -> NULL (NUL)& 1& 1& öSTART OF HEADING (SOH2 22 22 –TEXT (STX/ 3/ 3/ 0END_ - E- )9c- 4- 0STR„  TERMINATOR` _ t0 "  æ 52 ô	CHARACTER TABULATION (HT5 3x867 5 65 õ õSELECTED AREA (SSA8 )7f8 78 ¦DELETE (DEU)97( 8( ô UGUARD] &EP] )8d5 95 õREVERSE LINE FEED (RI� )8e2 A2 ðSINGLE-SHIFT TWOÁ 22 )0b2 B2 \ )V)0�C0 CFORMŒ $FFZ rX ˆD* ôCARRIAGE RETURN (CR0 *x0¼ E0 µ  OUBO* 
uF* VIN (S1ñ1ñàDATALINK ESCAP§%LEZ 1ü1üðDEVICE CONTROL ON4 &C14 	þ1þ4 v&DCv114 1HREj 3j 91`OPERATõSYSTEM COMMAND (OSC: #85Žß1N™ë'(Nª)08+ 
ÖBACKSPACE (BSU 	Ô1üÔ2E21` 
µCANCEL (CAN^ )19ˆ ý^ ¥MEDIUM (EM. 9…ù²PRIVATE USEø&PU‚8D1ø
*€&SS€1ü1ü’ILE SEPAR‰5IS4• 1°ZGROUP1 a 	1jRECORD2 Ç 1Ç JUNIT0 ­821PADÔ%E(PADÆ 82öHIGH OCTET PRESET (HOP3 	Ž2pBREAK P´TL0HEROPG822NO 9 / 'NB/ '4'Î2•INDEX (IN¿ n% ‡2ûö=L±)x1Ð2úr�TRANSMISS8¥BLOCK (ETBñ 1F2`EˆýÀ#  0x28 -> CðHARACTER TABULATION SET (HTS)
    '\x89'
 ï  #  0x29 -> C: ÒWITH JUSTIFICM F(HTJI aI AI MLINE~ V~ b5 B5 �PARTIAL = ÆFORWARD (PLDk c6 C6 DBACK7 U7 )057 D7 ÆENQUIRY (ENQ) 6) E) öACKNOWLEDGE (ACK- 7- F- •BELL (BEL& (90&  30& ö
DEVICE CONTROL STRING (DCž)917 17 õPRIVATE USE ONE (PU1h 1»  321 õSYNCHRONOUS IDLE (SYN2 793'!332 àET TRANSMIT STn '(S·)944 44 gCANCEL<F(CCHf 	| 352 ÁMESSAGE WAITú &MW0 
È 60 õSTART OF GUARDED AREA (SPA7 0™ 77 0END5 Ð  SSE(EOT5 )98Î 85 l –'SO–	434çSINGLE GRAPHICIÞ¶DUCER (SGCIw 	131F �	> = 	939IˆEQUENCE = &CSz 1&@�@FOUR‹4¯ 1Â>™NEGATIVE &NA)9e\KPÁ4CY  6(PMf 
N�SUBSTITUTº#UB, " '· »4TTSPACEÜau4>™NO-BREAK * #e2N 47 2°N SMALL LETI!A ¢CIRCUMFLEXj {= ‹ EòLEFT CURLY BRACKET. :\xe˜ ?n EGRAVÓ e4H; FACUT; 	é4S; FTILD; 	ü4W; Ç7ABO¶ 	$4b@  C_dEDILLA.fó n=  N= 	¸ cé4c; PCAPITe	Ù’DIAERESIS| .Øg0FUL­"OP% <% OâLESS-THAN SIGN* (* D'vPARENTH{ +, :7LUSQ !% àF -> EXCLAMATIð ON MARK
    '&'  ò#  0x50 -> AMPERSAND% C\xe9( % 1% õLATIN SMALL LETTER E WITH ACUTE; a; 2; ¥CIRCUMFLEX@ b@ 3@ •DIAERESIS? 8? 4? FGRAVº d; 5; Iõ e; 6; õ  f@ 7@ õ c? 8? õ ~8 2   ê9; ETILDd\ A! eCAPITAU� $b BA ²DOLLAR SIGN¹*' C' sASTERIS¼)$ D$ ÖRIGHT PARENTH
;- E- ƒSEMICOLOv ^% F% Ÿr ACCENT£ -- 6;³HYPHEN-MINU„/( >TSOLID# C\xc2& w6&VAV” � [? ¹6(óEFT SQUARE BRACKE¼ C\xc02 q q %I\xc1= = 	)c3= = 	~)c5= = †RING ABOÖ)c7B B CjbEDILLAg:\xdû  ÿN? 	¾ )f6| <	GO; :,< ã:CCOMM� %! 40PER´\_( 8sLOW LINè>$ /ÇGREATER-THANQ ?- 7iQUESTIn9\xf�73?SSTROK’ 9\xc…7G< º‡c‡7a= a9\xc‰7a ¿:\xcü sƒ 
s	�7s�Ðce'      #  0ð)x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'
 Ÿ  #  0x77B •DIAERESISA cA 8A RGRAVE= `:  ~ 9= ! r ACCENT( :( A( RCOLON! #! B! £NUMBER SIG' C\xa7* î C' vSECTION( 2"'"˜ D( “APOSTROPH¾ =K & E& fEQUALSM ,'"' F' QQUOTAw BMARKÆ C\xd8- Ÿ  80* ÏOÏ � K� a; � &81> ESMALAn b0 20 B0 ç` 30 C0 d` 40 D0 e0 50 ð ¸� ý	ð F` g` ë	0 G0 h0 Ú	0 H0 i0 Í¾	0 I0 4\xaƒîÕÿLEFT-POINTING DOUBLE ANGLE 3bE ùORIGHF #f0¾ ‹ »  ô ETH (Icelandic)É fì> .>  YµCACUTÄ4\xf÷; C;  _THORN{ )b1¹ \˜PLUS-MINU‡9\xbä 9]gDEGREE®jO V9FJý k0 Fäl0 FL` m0 FM0 n0 Fo0 FO` p0 FP0 q0 FQ0 r0 FR0 4\xaùB9Fõ
FEMININE ORDINAL INDICATO6 b6 7oMASCUL7 
#e6  m (AàbÒ9cCEDILL‡:\xcT ÄV $a4‡ À  0x9F -> CUðRRENCY SIGN
    '\xb5'
 ù  #  0xA0 -> MICRO& )df& 1& òLATIN SMALL LETTER SHARP S (German)e s<  e 2? 0 t0 30 T0 u0 40 U0 v0 50 V0 w0 60 W0 x0 70 X0 y0 80 Y0 z0 90 Z0 C\xa13 åA0 ô
INVERTED EXCLAMATION MARK5 bôB5 MQUES2 )d0g C2 &eCAPITA(ãETH (Icelandic'I\xdd@ D@ ÄY WITH ACUTE¯ )de= E= _THORN aB FB ©REGISTERED(a2m B6JCENT% 3% 5KPOUNK 	�B9YENJ )b7J “MIDDLE DOI\xa9& ˆCOPYRIGHš @' �B ÅCOMMERCIAL AS #b6, 9BùzPILCROW¡ c( ñ±VULGAR FRAC*´ONE QUARTER´bñBø7 EHALF4 	¦Bü4 ETHREm S: a¥ (NO|Æ õ ( IC¾$INoBu203‰ ìVOVERL$ 3xa8P $ Ð…DIAERESI– )b4% ¸Ù0 ACS¾ dž’MULTIPLIC¾ØeW C¢Œ	²AJ– A“ C¼? ËA  B2 È2 B2 C2 Ö2 C2 D2 â2 D2 E2 ê2 ÙF2 ó2 ’G2 ý2 G– H2 ø2 H2 I2 ö2 I2 3\xa\À #  0xCA -> ðSOFT HYPHEN
    '\xf4'
 ô"  #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX@ )a6@ C@ ¤BROKEN BAR& )f2& D& f UGRAVE; 3; E; FACUT; 5; F; FTILD; c; /D0; U’DIAERESISµ J<  V&D1? eCAPITAXJ2 K2 22 K2 L2 32 L2 M2 42 M2 N2 52 PO2 62 Od P2 72 P2 Q2 82 Q2 R2 92 ²#b95  DA2 æSUPERSCRIPT ON,b+ C,C}= -CòRIGHT CURLY BRACKETÌ :\xfš Lo 
Lam Õ L; 
Lf; LY9\xd'EPiRH\xf7€ ERÃDIVISION SIG�S& NEI­T2 IƒU2 IUµV2 IV2 W2 IW2 X2 I½Y2 IYd Z2 IZ2 9\xbûEI#TW
9\xdŒEI%K%\\  áEKÓEVERSE SOLIDUö:\xd˜ Gm 	Id•EI= 	Kd—EK= ™0á °FI“DIGIT ZERJ1& À 0xF1 -> DIGàIT ONE
    '2'  ò#  0xF2 -> DIGIT TWO% 3% 3% 3HREL 4' 4' BFOURM 5& 5& #IVL 6& 6& 2SIXK 7% 7% BEVEN' 8' 8' REIGHT' 9' 9' $NI14\xb1A& ÖSUPERSCRIPT TC\xdbV - B- óLATIN CAPITAL LETTER U WITH CIRCUMFLEã ]? 2   B CB R¶ ã SQUARE BRACKEÅ 4\xdÈ 0 D0 r 	4GRAuC\xdap = E= CACUT²I\x9f= F= ó*APPLICATION PROGRAM COMMAND (APC)
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð- cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with6 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
uAdef ë ñe(self,input,errors='strict'):,  ¥creturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  š�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±aname='ˆ%', d !e=0 2().     if: 'r=Ïy/ J 	/ ä/ spr7=D# w“#  # ")
[  �Tä
~ ä2 = 'R'\x00K‡ 00JANULL0  1 1 õSTART OF HEADING+ âÀ #  0x02 -> ð	START OF TEXT
    '\x03'
 ü  #  0x03 -> END& (9c& 4& TSELECG t  G 5! ôHORIZONTAL TABULATIONw "862 w 60 ôREQUIRED NEW LINE, (7f, 7, UDELET! (97! 8! ÕGRAPHIC ESCAP) (8d) 9) ¤SUPERSCRIPÌ 8x8e& A& UREPEA! (0b! B! oVERTICë 0<C. “FORM FEEDã rP ?D$ åCARRIAGE RETUR90� E* †SHIFT OU  	1F$ IG "10s € 10# @DATAxK5(11+ 1+ ö EVICE CONTROL O¬(12- 2-  3TWOö (x1|1|DZ ETHRE¾9¾1…úRESTORE/ENABLE PRESENTj5’ ša(08# �…BACKSPAC} 8d1…ù
PROGRAM OPERATOR COMMUNIC€ 1] �eCANCEL9~ •‚dMEDIUM( 9[—PUNIT «  ¬  1 ÉCUSTOMER USE°�1��ILE SEPAÕ ~ 1}¢_GROUP*  ¢1¢oRECORD+  	© ©Ó ~ 8¯2¯YIGIT †(x8«2«õqSIGNIFI|Õ 8S2®OFIELª  8«2«WÓ 0UND?&OR)4Ï2¦ÿBYPASS OR INHIBIT©n7 2© ((x1†2ª,ôTRANSMISSION BLOCKå 1®2º¢2¢¶SET ATTRIBUg8©2©^4eEXTENDÔ2x8aÒ c2° W @MODEdSWITCH¥ 8¥ ³^qSEQUENCÞ5FIX2 º2ºrMODIFY � ¿ 0	2Â ENsYS 0•2º¥ACKNOWLEDGá0„µ5BELÏ9«3«¤<reserved>j 9©3©% 1� 3žõ SYNCHRONOUS IDL” 9Ÿ3ŸðINDEX RETURN
    '`\x94'  ð#  0x34 -> PRESENTATION POSI	 
% X'\x950 50 µTRANSPARENT& 6& 6& ôNUMERIC BACKSPACE, 0‚ 7, qEND OF Y tMISSION. (98Z 8. †SUBSCRIP~ 9$ 9$ ÁINDENT TABULÙ P a, A, õREVERSE FORM FEED, b, B, õCUSTOMER USE THRE× 1× C- ôDEVICE CONTROL FOUR[ 1WD. õNEGATIVE ACKNOWLEDG] (9eŠ õ E -> <reserved>T 	Û F%  +STITUTJ  G 1    !40% žPu05d0%   1  óHEBREW LETTER ALEFr  - 1- 2- $BE¥ , 2, 3, WGIMELZ 3. §
‡ 9DAL\ ~µ ¥
. H \‡ {+ ª
+ 7VAV… Ø, ª
, DZAYIª Z 7³ ª
. H± ØZ ²
, T, !xa7²²CÜ3SIG| .w  °Öª’FULL STOPÎ <$ ¡¦LESS-THAN M () œRLEFT óRHESIST ++ ˜GPLUSO |$ —ÃVERTICAL LINš&( 5š„AMPERSAN’ dì85ž (YO, , � ˆFINAL KAÏò2 £ 
, c³ , ¡ 5LAMJ ¸ d. ¡ Œ 2MEMZ¨ô` ¨ 
, f^ ¨ ^ #NU0 ^ eæ5¬ 
, å5¬ bSAMEKH¹ !ˆ ‹5¯aEXCLAM‡R MARK+ $+ ¶gDOLLAR@*& ¸sASTERISI )# ²ORIGH³ ;, ³vSEMICOLuaÛs5³7NOT– -G 6®³HYPHEN-MINU!/' ±TSOLID" ‹áé6§ 
de6¢ êPU^ À4'   #  0x64þ -> HEBREW LETTER PE
    '\u05e5'   #  0x65+ ·FINAL TSADI4 64 64 . 7. 7. 7QOFZ 8, 8, GRESH- 9- 9- CSHIN- !xa² è A- ¢BROKEN BAR% ,M  B% RCOMMA  %  C  ³PERCENT SIGl _' D' sLOW LINw># E# ÇGREATER-THANO ?, F, ÒQUESTION MARKž `\ufffe- Ë 70( ”UNDEFINED$ F05ea$ 1$ 
4TAV, 
P 2, P 
$ 3$ 0xa0r { 74$ ÓNO-BREAK SPACÁ Œq |$ r$ 6201–7jzDOUBLE «`¼ "7g€GRAVE ACú.:' aCCOLO#  \gNUMBERì@& b ‚‘ERCIAL ATn 1"'"§• c“APOSTROPHP=M egEQUALSs "& _?OTA`8`[› „8`´LATIN SMALLQb| 8c/  Bö +'c/ n/  C/ d/ y/  ;¼ /  ^f^ Š/  Ûg/ •/  G¼ h/  /  i/ ¥/  Â#xa{§­ãLEFT-POINTING �ANGLE QU )xbD ÑORIGHE 
´8ð«	d8ì$ ë$ 2xb1'õ é˜PLUS-MINU8\xb²9êgDEGREE9jM „9ìJÒk/ ìÎl/ ìL^ m/ à4 -> LATIN SMAðLL LETTER M
    'n'   ö#  0x95 -> LATIN SMA/ N/ o/ 6/ O/ p/ 7/ P/ q/ 8/ Q/ r/ 9/ R/ `\ufffe4 ë A/ ŸUNDEFINED$ B$ C$ 0xb8j "  l D$ CEDILLAj E" Ž 8xa4F F$ ÃCURRENCY SIG–G\xb5(  A0( WMICRO% ~"  “  A1% RTILDE‘ s  2  
 S/ t/ 3/ T/ u/ 4/ U/ v/ —V/ w/ —W/ x/ —X/ y/ —Y/ z/ —Z/ —A—A—A—
A—u$ ™IL™§REGISTEREDv^B›óCIRCUMFLEX ACCEN$B\xa3/ 5B¢HPOUNQ 8\xaìB§7YENt H\xb7H ›–MIDDLE DOm 9% ‘™COPYRIGHTN aN ‹kSECTIOu 6P ƒyPILCROWN (bc' {¢VULGAR FRAV ¤ONE QUARTE»8xbd6 ‚6 CHALFW(xb£B†3 ETHREk Ù[i (B�`LEFT S” ƒE BRACKEG]. šC/  B\xaf2 ã¥UMACROËa9B¢ƒDIAERESI¢ 8\xbB¢[ACUTEOd¹¥«MULTIPLICAÀ{— ÷ C©÷ ZCURLYö A- ª,eCAPITAgîB1 ¶1 B¿C1 Ä1 C1 D1 Ð1 À CAPITAL LETÐTER D
    'E'   ð#  0xC5 -> LATIN CAPITAL LET1 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 B\xad4 õ A1 ³SOFT HYPHEN& Pufffe( & B& ƒUNDEFINE?\$ C$ D$ E$ F$  }¯  Î ´  D0$ òRIGHT CURLY BRACKETâ J. 1. ýJ1 K1 21 K1 L1 31 L1 M1 41 M1 N1 Á×O1 ÁOb P1 ÁP1 Q1 ÁQ1 R1 ÁR1 B\xb94 çÁÓUPERSCRIPT ON¯¡DÅDÅDÅDÅDÅ"\\Ü  ÅEÅäEVERSE SOLIDUS"f7, EÁÃDIVISION SIGôS%  R ¸Y T1 ¸KU1 ¸U» V1 ¸V1 W1 ¸W1 X1 ¸X1 Y1 ¸Y1 Z1 ¸Z1 B\xb24 °¸#TWu¸E¸E¸E¸E¸E¸0Û fF¸“DIGIT ZERÙ 1% ³ % µ$I ¯I !3H ¢$ 3HREÿ4& À#  0xF4 -> DðIGIT FOUR
    '5'   Â#  0xF5 -> D% 2IVE% 6% 6% 2SIX$ 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& 3NIN• B\xb3( º A% ôSUPERSCRIPT THRE, Pufffe. , B, ’UNDEFINEDu \$ C$ D$ E$ 0x9fŽ "  � F$ ó ONES
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð) cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with2 ƒ P.py.
i ±#"

import  sÆ f ÁAPIs

class  ($ . 1):
†Adef ç ñe(self,input,errors='strict'):,  µcreturno B = , †ing_map)m 0m *B 	m   m ª)ø ±IncrementalÛ$er å  h Ã final=False*  W.Q
?[0]¨  DP¨  ~  ¨ ö L¨ !@ â ¨  Oª ÑStreamWriter(J,W ¤ 5pasƒ ORead9  	9  ’Fàs module API

ý Ãgetregentry(7 
�ž UInfo(¾aname='€%', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # ÛZ  „0MapA¶Tmap =Ïñmake_identity_dict(range(256))
°  Ámap.update({F€0x0080:  0c7, iöLATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? BACUT© ± #83; 2; 	A; ’CIRCUMFLE†@ 4@ 4@ ÀLATIN SMALL ñLETTER A WITH DIAERESIS
    0x0085: 0e0, ú #  LATIN SMALL ? VGRAVE; 6; 5; ˆRING ABO@ 7@ 7@ 	Cº vCEDILLA} 8= a= 	E= –IRCUMFLEX@ 9@ b@ 7 a? 8? 7b; f; 	Iº z  c? e? Cù  d@ c@ º e; +c4; lCAPITA.¼  fA 2A 4 #90B 9ƒ ùFACUT±"91= +e6= ì—IGATURE A3 23 c3 ² 5 35 f(h “Oâ£ #94@ u @ f9Ó/f2ç 	 
â9Óf
Uº ÓfŸ	º @ { Ñf
Y{ õ  Ðd4©	÷ A  ÒdA ½ A  Øaw•CENT SIGNw9¾%a3œ[POUND& ¤a(;YEN$ �620a>kPESETA' s&19– à FWEHOOK« ak%e1« :  Y
iaid; 	ã; qf!v  <; w
À; rì 
N&FTILD"and; 8= pa³ öFEMININE ORDINAL INDICATORšfb6 cMASCUL7 ÀINAL INDICATáOR
    0x00a8: 0bf, ö #  INVERTED QUESTION MARK2 92 E23102 öREVERSED NOT SIGN- a- E00ac- $ b$ %bd$ ±VULGAR FRAC� †ONE HALFX c4 X 4 gQUARTEî d7 %a1k î qEXCLAMAp 
ñ e5 b5 ÿLEFT-POINTING DOUBLE ANGLE QUOTE fE bE ORIGHF  b0F 6259À LF e SHADE#b1' 2² lMEDIUM( 2( 3( LDARK& 3& 0N ÒBOX DRAWINGS ‚  4FICAL… 47 %24] 7 P AND W@ 5@ 6ì 	@ q 1 SIyA �H 6H ¿ H Ç‰ X H 7H /56Ð CDOWN| Í D nO2555D Ð €&56µ	Ç × É ”?255YA 8 ¨O2557½ u ±6255å¶ %UP<x µ6255ì	; /UPwÂ6255}B u¿'25õ	B û cµ1	
ú û cÉ3; ‡HORIZONT„cá2;· B ý1B 
	mÃ 0/: z  3z F þ/5eµº Á T‹ÿ)	È I ? I Z I a’ @ ü5< ˆ� z Àx00ca: 0x25609,  ð#  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
- ï0x00cb: 0x2566A 
ODOWNC cC 0C 
�VERTICALG VRIGHT… dB 5B ¿ e: /6c| G fG 7G ‘UP SINGLE½ A `É #d0H 8H ’
�^ H 1H 4H �’ 2J 5J ” 3J 5k#UP$á× 4C Õ C œ 5C 2Ð E 6E 3E y Í 7E /6bE ðI :¤ Ø 8N aN 8 — N d N 9N 1iL6LEF‹"da: 0Q: € Ã¤w M8w ¦FULL BLOCK& 08Ý¬LOWER HALF, 8�  ¯ + 9Ež , ð8, ?UPPƒ eÔE03b1šõ	GREEK SMALL LETTER ALPHAã eÀE00df4 ZLATIN4 vSHARP S6 ¬6039—j eCAPITAl GGAMMl ˜603cÌ 6 	  &PIg †?03ag 8SIGg y<03c6 	g 4 h600b}¦MICRO SIGN� I603cÁ  6TAU2 -603aµ2 )'PHö 6039œ4 GTHET]603aõ6 GOMEG6 ?03bÒ 
8DELj 521e3†INFINITYø 203cø À #  GREEK SMðALL LETTER PHI
    0x00ee: @3b5, Ç #  GREEK SM2 vEPSILON6 f6 E22296 §INTERSECTI( "f0( &61( µDENTICAL TOP  f1( 600b( æPLUS-MINUS SIG{  f2+ 9226± ûATER-THAN OR EQU_ 34 4‡ OLESS1 41 53201 �TOP HALF é FGRAL½ 5- ½ oBOTTOM0 60 E00f7] ‹DIVISIONë 7) E2248) oALMOSTâ  8+ 600b±  DEÉR 9' 6221¸ö BULLET OPERATORÖ a+ 600b¦ ¦MIDDLE DOT& b& E221a£ ˜SQUARE RO' c' 607f' úUPERSCRIPT LATINrñd< O00b2< 'TWGÍ625abBLACK ” ¶ ¿'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U d'\x00'A X’00 -> NUL( ! 1! 1! õSTART OF HEADINGN 2- 2- 2TEXƒ W 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 UQUIRY$ 6$ 6$ µACKNOWLEDGE( 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  ¤c9& €HORIZONTò0ABUK�<'\n2 a2 •LINE FEEDŸ b( # 0b& 3VER§V :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETURå Åe. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ �J'\x1›1›/ 6HRE` 
¤1¤1 2FOU¥ a 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2d BLOCKM1Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áð ESCAPE
    '\x10c'  ð#  0x001c -> FILE SEPARATOR
  Z'\x1d+ d+ _GROUP,  e, e, oRECORD-  f- f- LUNIT+  ( 3   ¯  20+ RSPACE¦ !" 1" òEXCLAMATION MARK- "- 2- LQUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 0"'"¤  7& ƒPOSTROPH(M 8' ñLEFT PARENTHESIST -')- 9- ORIGH.  *. a. sASTERISq+% b% GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{¢DIGIT ZEROK 1' €' #ONˆ2& y& #TWL 3& t& 3HREN 4( t› 3FOUÁ5' sO 3FIVN 6' q' 2SIXè 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 ÀK
    'L'     ð#  0x004c -> LATIN CAPITAL LETTER L
( 0'M'   3 d3 M3 N3 e3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 ú5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. rOW LINEà `% 6YGRAVEN a) ESMALAZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 óð	1 K1 l1 ô!	1 m1 ù1  n1 ù1  o1 üÄ p1 7b  q1 r1 s1 Pt1 "u1 	ÀALL LETTER U€
    'v'   ò#  0x0076 -> LATIN SMALL LETTER V1 w1 71 W1 x1 81 X1 y1 91 Y1 z1 a1 Z1 {1 b1 òEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f%  f" UDELET# )c7#  80# ÃPCAPIT¤ ÅâC WITH CEDILLAµ J\xfc@ 1@ 	U> ”DIAERESIS@ *e9@ 2@ E@ 6ACU¼ *e2< 3< A< “CIRCUMFLE-J\xe4A 4A ½ 0@ 5@ EGRAVy*e5< <½ ‡RING ABOA ºL¸*ea Yx< bA iA <8@ x@ 
<
Ø8ƒxIù| e| ”õ	µ@ ý  ö«A 	½ cu·< rû¿ c;×B 	=cw9÷€
y6@9õ•IGATURE Aðc4 é÷ 6 f-9ãOêªfw ãA lfd9ã@ 	êf#9ã½  ¦ãA 
} 
$9áY:ù d9À9 -> LATIN CðAPITAL LETTER O WITH DIAERESIS
    '\xdc'
 ú #  0x009a -> LATIN CB UB *a2B bB ”CENT SIGNh *a3& c& ZPOUND' 5' d' 8YEN% Pu20a7' ´ e% iPESETA( 1019œ ( f( Ü ESMALFÚ DHOOK¯  e1a  /a0; A; UACUTE< d< 1< I<  f'/a2< Ï	x *fax 3< É
< ð 4< N´ ETILDð d< 5< C> a¶ 6> ôFEMININE ORDINAL INDICATOReb7 77 oMASCUL8 f%88 ôINVERTED QUESTION MARPu23105 G a93 »REVERSED NOé
QaQ% b#4±VULGAR FRAC„ …ONE HALFó Z C5 eQUARTE+a Tó qEXCLAMAr ö 0xabô eþLEFT-POINTING DOUBLE ANGLE QUOTF bF ƒORIGHG Au259Å ƒb� G E SHA‹ ( òb{mMEDIUM) jQ hLDARK' 0P SáBOX DRAWINGS L…  ?CICAL«Pu2524?_ O8 P AND ]A 6ñ T	A s 1 SI€B –I 	Â _I Ï‹ Y I (56Ó q	I CDOWN~ Ð E á~E Ó 	¼�E ™#Ì 	^¤B 	9 zb¸9 w  øþ Á> %UPAz ÿ< Å	< ðUP DOUBLE AND LEó&FT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP3 è AND LEFT DOUBC (10C fC @LIGH6 %WND € '14= /c0= !UP; RJ < 3< 1< ¦HORIZONTALA (2c} 2A #DOº C 1C 3C �VERTICALÆ 0?/c4B | 3| 5: 	| G (5e6G A <Ä 
(5fJ 7J CJ [ š(5aJ 8J A 59= ØW(69| a? | R(66B bB � D 	cD � ŸÉ 5C dC ~ 	[€	~ H 7

_B ['68I d(#UP3 UI Z6d5•5 K õ ¥(65” ?K 5 K a K 5tdG
ß è˜D 	#I
lD ž D 2Ó SÓ ½ Ó F 3F RF { F W Œ 6›dNù	SdSÌˆ ™ O ¯ ž 1neö% 8; 0]da; %Ö 8y ]¦FULL BLOCKe 8èÀ 0x00dc -> Lÿ!OWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT, (90, e, ORIGH- 8- f- ?UPP† G03b1Z  e0- ó	GREEK SMALL LETTER ALPHA» 0xdf3 »  e15 ZLATIN5 sSHARP S7 Pu03939 ò  e27 l eCAPITAn DGAMMn Hu03cÐ &e37 	£ &PIi ai 42 i 9SIGi 	7 57 	i 5 0xb5Ó 65 ¦MICRO SIGN“  c4) ü 7' ü 	\ 6TAU3 (a63 83 Æ 'PHû (985 95 GTHETd(a97 a7 GOMEG7 bÖ b7 	Ö 6DELl H221el c5 †INFINITYý cý 0 	û Œc%3  eEPSILOš9222û /¨INTERSECTI) 6+f+ÃIDENTICAL TO¼ xRf©PLUS-MINUS1226Aµ føATER-THAN OR EQUa Hu226wfOLESS2 (32Df2TOPl î CGRALÁ Iu232ê 	oBOTTOM1 0xf7Ñò ‹DIVISIONð 4 flALMOSTç !xb³ V  DEÓT 1Âfôó BULLET OPERATORÛ +xbª é£MIDDLE DOT' Pu221aÓ —Ù—SQUARE RO( !07( ÌÏSUPERSCRIPT  z0xb2c à ä= $TWTAu25ai ÝbBLACK — º x' U ÏóNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  š100:¢000,» ±2NUL-  1  1  öSTART OF HEADINGL 2, 2, 2TEX€U 3) 3) 0ENDS 
' 4' 4' pRANSMIS‚ 5/ 5/ BQUIRxy 6# 6# ¶ACKNOWLEDGEJ 7' 7' &BEÀ008: 0x0008,  Ð#  BACKSPACE
 ‚0x0009:  , ö
 #  HORIZONTAL TABULATION1 a1 a1 –LINE FEED% b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETUR¤ e+ e+ –SHIFT OUT¤ f% f% II "10$ %10$ ö DATA LINK ESCAPJ#11, 1, ÷EVICE CONTROL ON. 2. 2. 5TWO¬ #13. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 85 fCANCEL" ¸%19" W fMEDIUM) °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ†AMPERSAN�2…2…–APOSTROPH2v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k–DIGIT ZER¿3p3p& 3i3i% 	3d3d% 	 3d3d— 	÷3c3cM 6FIV3a3a& 5SIX+3a3a% 6EVEü3b3b' E<N ]3]' 'NIC3V3V5COL«À003b: 0x003b ,  Ð#  SEMICOLON
 ‚0x003c:  % ×LESS-THAN SIG* d* d* kEQUALS' e' e' GREATERT f- f- ÕQUESTION MARK§ "40) %40) ÖCOMMERCIAL AT) 1) 1) öLATIN CAPITAL LETTER A2 22 22 B2 32 32 C2 42 42 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 b2 b2 Oö/4c2 Ld þ4þXM2 	4	2 b442 Od 552 P2  5 Q2  5 R2  5 S2  5 è5 5 Ud  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷OSMAL 6õ6õ	0 6ó6ó	0 6ñ6ñ	0 6ï6ï	0 Ð6: 0x0066,   ó  #  LATIN SMALL LETTER F
    0x0067: , 0 G0 80 80 	H0 90 90 	I0 a0 a0 	J0 b0 b0 	K0 c0 c0 	L0 d0 d0 	M0 e0 e0 	N0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0  /770 	W0  7 
X0  7 
Y0  7 
Z0  7 ÷EFT CURLY BRACKENþ7þÖVERTICAL LINEW ÷7÷ORIGHX ö7öGTILDP ç7çVDELET" aÙf" ×NO-BREAK SPAC* Óaœ  INÇ öED EXCLAMATION MARøaØ9(†CENT SIG�aÍ9[POUND& “9€ ;YEN$ Ça‡ö
FEMININE ORDINAL INDICATOMaÍaGÿLEFT-POINTING DOUBLE ANGLE QUOTê äaB+NOé bmÆjDEGREEÆ bjf=«PLUS-MINUS+ `fæSUPERSCRIPT TWÃb@e[MICROQ ™fÇ –MIDDLE DOÑbh¿PMASCUÍibimßjbj/±VULGAR FRAC„ ON¨FARTEæb\a‹7 6HAL§b@a±ôAQUESm ñÀ   0x00c4: 0px008e,  ð#  LATIN CAPITAL LETTER A WITH DIAERESIS
- €0x00c5:  /8fA ¦RING ABOVEB 6B /92B —IGATURE A5 75 /805 ¸ C¸ vCEDILLAt 9? 9? E? FACUT| "d1= /a5| N= GTILD= î 9= O= q"dc~ /9aA UA fA +e1A ESMALñfSHARP è"e06 8õ 	6 '7GRAáe0m; 
k#e2v 3¬ 	v ¥CIRCUMFLEXè#e4@ 4@ leÝ6? Û eíkÙ eÙ7s 	×#e8ï 	jÕ¥8†; ¥av 8³ 	v ¥b@ { ¥ /8d 	Iõ dz a D; õ e; /8cv õ †/8b@ õ fTÙ
‚fT9Ê
€
0"f3õ a%
; 
0fŠ9Ê
; 0 fKñ 
@ 0 WfÊÕDIVISION SIGN2f9€
]aã 
; 9Ÿ ‡	; É
@ ÀESIS
    0x0Ð0ff: 0x0098,  ð#  LATIN SMALL LETTER Y WITH DIAERESIS
+ c0x0192? f? 	F? DHOOK: 2393: %e2: ÅGREEK CAPITA{ VGAMMA6 86 96 FTHET6 al 46 7SIGl #a6l ¢ 5PHI  #a94 aj FOMEG  #b16 06 	…GALPH4 44 b4 	7DEL#b54 e4 	uEPSILONÔ #c06 36 	Pco51 	
mcÏ 74 	6TAU— Ÿd2 	�3207ì%fc2 ¿SUPERSCRIPTøB20a79;¥PESETA SIG' #21 f ó BULLET OPERATORÀ B221aR fÁ¶SQUARE ROOT' e' eµ …INFINITY$ 2v e†¥INTERSECTIÊ3224>feõ ALMOST EQUAL TOS 6“f“{IDENTIC( ¸fÏLESS-THAN ORY  „føOATER4 #31‚aV0REVà YD NOTƒ#32- fí�TOP HALF DGRALç $32ç «oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi #50)b(9  1VERb  250cþdP7   DOWN AND R = 7b= 	5LEFw#51Øc <  /UPw fd®; 
u î c%{  2¶ bŸ
fA 	� 2� �»  oè 3‚ %c1dB  8@ ‚ ‘a	Â F  5§† ÀGS DOUBLE HOðRIZONTAL
    0x2551: 0x00ba, ø #  BOX DRAWINGS DOUBLE VERTIC8 28 /d58 óWN SINGLE AND RIGHTN } 3E 6E ‚ E V E 4E /c9E Â FDOWNŠ > 5> /b8> 
È >LEFÇ 6D 7D Ç D Æ 7D bD 
Æ  D Å 8= /d4= /UP‹9C 3C Â ÎÃ aC cKÃ /UP‡b< /be n <  ý LcB dB Á B R FdB cB ? À  B ; e; cÉ?‡fI KI � #60I Í P I Ô 6â; G™6*bÓ  ],� -bè—  Ò  H A )/d1à
ë$HO.l65/d2J Ï J -” ;c÷J C :/cf� 
ýA Õ E0H Ó JcRG� Ñ HdHâLyG × ZdRN d œ fc¨"£  …N G 8žd´öUPPER HALF BLOCK, ·Ê?LOW, ÄOàFULL BLOCK
   ð 0x258c: 0x00dd,  ð#  LEFT HALF BLOCK
  + #90+ e+ ORIGH, 1, %b0, L, VSHADES 2' 1' {MEDIUM ( 3( 2( KDARK& a¡ f¡ ðlBLACK SQUARE
}
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencN P.py.
v À#"

import c cs

###s ²APIs

class ($ .’ 1):
0Qdef eW ñ(self,input,errors='strict'):,  ³creturno “.charmap_B = , ¦ing_table)o  de‰ o )B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø eNª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJàs module API

ý Ãgetregentry(7 
¡ž UInfo(Âaname='‘%', d !e=0 2().     if: 'r=Ïy/ J 	/ ä/ spr7=D# w“#  # ")
[  –T” D5codä2 = '`'\x00'Þ1 # É� -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ & (9c& 4& dCONTRO› t   º 5" ôHORIZONTAL TABULATIONx "862 ê 60 
R 8x7f" 7" RDELETrX'\x97! 8! C (8d" 9" e" A"  (0b" B" oVERTIC× 0)C. “FORM FEEDû rP +D$ åCARRIAGE RETUR%0ž E* ðSHIFT OUT
    '\x0f'   ð  #  0x0F -> SHIFT IN
    '\x10'
 #  10# õDATA LINK ESCAPE+ 1+ 1+ öEVICE CONTROL ON- 2- 2-  5TWOZ 3- 3- 5HRE\ (9d/ 4/ ‚ Q (85" 5"  (08" 6" …BACKSPACh (87$ 7$ h 1F 8" TANCEL‰ (19C 9! ÔEND OF MEDIUM( 9/A( k (8fJ B"  (1c" C" äFILE SEPARATORm 1@D) _GROUP*  eS E* oRECORD+  	  lNUNIT) 8r2rë i2i" /2^" S2S" 4Ü 2F n  ?2F•LINE FEEDL$2HáõTRANSMISSION BLOCK4 bZ —2X
j8W2WcC 8X2Xß ae R	‡ R8R2Rf 0i2KtENQUIRYª (06ˆ C¥ACKNOWLEDGk0G>5BELG943494341‰ 34õ SYNCHRONOUS IDLŽ 9=3=9=3= (x93=<9‘ ;" 0f )>]j96369636963696361¶ 6D(6FOU�	(BŸNEGATIVE ) 9’3O51Ã K“SUBSTITUTâ “ Û4Q	ûaq4O™NO-BREAK ) eŠ4VôLATIN SMALL LETTER A WITH CIRCUMFLEX´e,4j? •DIAERESIS> 	¦ †> ÀMALL LETTER ðA WITH GRAVE
    '\xe1'
 ó #  0x45 -> LATIN SMALL LETTER : FACUT: 3: 6: FTILD: 5: 7: ‡RING ABO³ 7? 8? Cí tCEDILLAï fï 9< N< µ [s #  )A: òEFT SQUARE BRACKETh .. B. ’FULL STOP$ <$ C$ âLESS-THAN SIGN) () D) âFT PARENTHESIS+ ++ E+ GPLUSO !$ F$ òEXCLAMATION MARKO &+  50+ ’AMPERSAND$ B\xe9' B 51$ B ES
Ba: 2: ¥CIRCUMFLEXy b? 3? VDIAER*H\xe8> 4> 
3d: 3Iñ e: 3: ñ  f? 8? ñ c> 7> 	ñ dx 5òSHARP S (GERMAN)§]u 959ORIGH:$/ :gDOLLARÄ*& <sASTERIS¼)# 6x 7;, 7ƒSEMICOLO†^$ 7£c ACCENÿ-, 68³HYPHEN-MINU®/' ;TSOLID" B\xc2% ]6#lCAPITA¡‘ ~H\xc4A %A 6(c0@ '@ 	8cm6)< 	c^6+< «8\xc`6(< bcb6+A dd÷ /> fH\xa6o-¢BROKEN BARÔ," R6#CCOMMå%  Àx6C -> PERCEð NT SIGN
    '_'   ò#  0x6D -> LOW LINE# ># E# ÇGREATER-THANO ?, F, ÒQUESTION MARKT B\xf8+ w  70( óLATIN SMALL LETTER O WITH STROK� H\xc9; 1; eCAPITA= E= FACUT< a< 2< ¤CIRCUMFLEX¸ (cbA 3A •DIAERESIS@ 	ø 4@ FGRAV½ d| 5< Iù e< 6< ù  fA 7A ù c@ 8@ ù `9 2   -9<   r ACCENT\:' A' CCOLOë#  B  gNUMBERÂ@& C& ÂCOMMERCIAL An 0"'"5  • 90APO«#PH³=M ;gEQUALSs "& 5=OTA6d>86û8 ùF88	sANç/ +	/ B/ Ý/ 	/ C/ É/ 	/ D/ ¼/ û	/ wª/ î	/ F^ g€8Ü	/ G/ h/ Ë	/ H/ i/ ¾ë I/ 3\xa{X8ÆÿLEFT-POINTING DOUBLE ANGLE QU(bD êORIGHE "f0» ‰ 	¸  ô ETH (ICELANDIC)Æ fã= =  Yª fî: 3:  _THORNy (b1¶ L˜PLUS-MINUv8\xbà 9MgDEGREEœjM K96Jø k/ 6l/ 6L^ m/ 6M/ n/ À  0x95 -> LAðTIN SMALL LETTER N
    'o'   Ý#  0x96 -> LA/ O/ p/ 7/ P/ q/ 8/ Q/ r/ 9/ R/ B\xaa2 ¼ A/ õ
FEMININE ORDINAL INDICATO5 b5 B5 oMASCUL6 
(e6k C6 	'¤IGATURE AE� (b82 D2 tCEDILLA" cT E" T žCAPITAL LV (a4V F4 ÃCURRENCY SIG×G\xb5(  A0( WMICRO% ~" 1   @ A1% CTILDÃ s  2  ¡ 	KSÐ t/ 3/ T/ u/ 4/ U/ v/ 5/ V/ w/ ØW/ x/ ØX/ y/ ØY/ z/ ØZ/ B\xa12 ˜Øô
INVERTED EXCLAMATION MARK4 (bf4 ×4 MQUES1 (d01 Ò~* ETH (ICELAJ)p (dd? ß? ³Y WITH ACUTXH\xde< ù{ _THORN} aA §REGISTEREDãG\xa2k BJCENT$ 3$ KPOUNI QB9YENH (b7H  “MIDDLE DOöH\xa9% ö‹COPYRIGH– 	N ð1SECÇ	éEBèzPILCROWœ cw à¢VULGAR FRAV ¦ONE QUARTE,åBç6 DHALFb›Bë3 ETHREk >9\xa¢ õ(NO|Â °Bä !IC,N`aBÛUMACROaœB½…DIAERESI� bjB¥Å0 ACBð d§‹pMULTIPLw ¦®{Â C�óLEFT CURLY BRACKE+A- ˜cQB1 À2 -> LATIN CðAPITAL LETTER B
    'C'   ú#  0xC3 -> LATIN C1 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 B\xad4 WA1 ´SOFT HYPHEN& (f4& B& }ESMAL¬õO WITH CIRCUMFLEX? 6? C? •DIAERESIS> 2> D> CGRAV¡H\xf3: E: FACUT: 5: F: CTILD: }7 1   Q D0: òRIGHT CURLY BRACKETÜ J. 1. YÖJ1 K1 21 K1 L1 8L1 M1 8M1 N1 8NO1 8Ob P1 8P1 Q1 8Q1 R1 8R1 B\xb94 ç8ÓUPERSCRIPT ONH\xfb* <U<c? <? <	§ <> 
<ax <: 
<f: <Yñ ² \< @E@ÖEVERSE SOLIDU7, ƒE<ÃDIVISION SIGoS% ’E3Y T1 3ÆU1 3U>V1 3V1 W1 3W1 X1 3¤Y1 3Yb Z1 3Z1 8\xbÈE3ÀIPT TWO
    p'\xd4'  ð##  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
6  A 6A CA •DIAERESIS@ 2@ D@ UGRAVE< 3< E< FACUT< 5< F< CTILD< 09 1   5 F0< ¢DIGIT ZERO� 1% 1% #ONI ú I 2$ #TWH â $ 3$ 3HREJ Å& 4& BFOUR“ ñ % 5% IUÎ% 6% #SIõ7Ü 7$ BEVENo 8& 8& REIGHT& 9& 9& $NI)3\xbrA% ÖSUPERSCRIPT TB\xdbT , ÓUÓcA ÓA ÓÕ � Ó@ 
Óa| Ó< 	Ó(9f< ÓóCONTROL
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
"""Python Character MappV CA òJ cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
  pv �Tools/uni® `/genwiÆ �ec.py 720¡ À#"


import ' "csÿ   ÁAPIs

class  ($ . 1):
šAdef  ñe(self,input,errors='strict'):,  creturno DB = , 4ingRC  o ko *B 	o  o ú ±Incremental$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� D�ª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  Ï�ðings module API

ý Ãgetregentry(7 ¡Àcodecs.CodecsInfo(
  Õname='cp720', ò encode=Codec().  )de   ²incremental: 6r=I E\ r/ J 	/ Dl / ástreamreader=S R R # Ewrit# W # �)


### [ ±ing Table

~ Ping_t 2 = 'b'\x00'0ñ#  0x00 -> CONTROL CHARACTER> - 1- 1- 2- 2- 3- 3- 4- 4- 5- 5- 6- 6- 7- 7- 8- 8- 	t+ "  •9- 	n- A- 	3x0b/ Z B- c- C- 	r+ ´ D- 	3x0e/ ‡ E- f- F- 
1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð
8x19Â1Ð
9x1a- Ð1Ð1Ð1Ð1Ð
9x1d‡ Ð1Ð1Ð1Ð1Ð	 „  W2ÐRSPACE”!! ÄòEXCLAMATION MARK, ", ÃLQUOT* #* À²NUMBER SIGNQ $' ºXDOLLA' %' ´wPERCENTO &( ¯‘AMPERSANDt 2"'"¯À27 -> APOSTRÀOPHE
    '('  ò#  0x28 -> LEFT PARENTHESIS, ), 9, ORIGH-  *- A- ‚ASTERISKQ +$ B$ ’PLUS SIGN% ,% C% RCOMMA! -! D! ³HYPHEN-MINU¿ .( E( ’FULL STOPM /% F% TSOLIDH 0#  30# ¢DIGIT ZEROI 1& 1& #ON~2% 2% #TWJ 3% 3% 3HREL 4' 4' BFOUR— 5& 5& #IVL 6& 6& 2SIXK 7% 7% 3EVEÀ8' b/E<N 9' ]' $NI1:& VCCOLOn ;! SGSEMI% <% S—LESS-THAN}=* \XEQUAL¤>' [|GREATERT ?- cÃQUESTION MAR@) 4i ú’ERCIAL AT<A) lóLATIN CAPITAL LETTER 4B2 y2 Bd C2 †2 C2 D2 ‘2 D2 E2 �2 ©F2 ©2 Fd G2 ¶2 G2 H2 Á2 H2 I2 Ì2 I2 J2 Ø2 J2 K2 é2 OL2 ö&Ld M2 þd M2 N2 	2 ±O2 2 P2 52 ÕQ2  QÈ R2  YS2  �T2  èU2  UÈ V2 À#  0x56 -> LðATIN CAPITAL LETTER V
    'W'  Ï#  0x57 -> L2 W2 X2 82 X2 Y2 92 Y2 Z2 A2 Z2 [2 B2 òEFT SQUARE BRACKET/ %\\0 ÷ C/ ò REVERSE SOLIDUS+ ]*  + D+ ?IGH[ ^0 E0 óCIRCUMFLEX ACCENˆ _- F- ‚LOW LINE� `$  60$ YGRAVEL a( 1( ËESMALûAX b0 20 B0 c0 30 C0 d0 40 D0 e0 50 f0 60 F` g0 ë	 G0 h0 é	0 H0 i0 ç	0 I0 j0 å	0 J0 k0 ã«	0 K0 l0 ä L0 m0 é0  M0 n0 é0  N0 o0 ìÀ O0 p0 7ø`  P0 q0  Q0 r0  R0 s0  9t0  u0  U� v0  ëw0  éx0  çy0  åz0  ã{0   ãZCURLYâ|. þ`VERTIC_}) ÷RàX  ~/ öCTILD—4\x7š07çóCONTROL CHARACTETR\x80'ÏE\x81 #e9g C 8šµE WITH ACUT~ !e2; À  #  0x83 ->ô! LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\x84' 0e0' Ï  #  0x85 ->K TGRAVE; &86F 7F 7F C‘ dEDILLAH )ea= 8= E= Î )eb@ 9@ •DIAERESIS 8? A? 	)ef; B; Iº z e? C? Ç d�&8e f $90 Qu0651n è 91l ÄARABIC SHADDŽ ) 2) 2) DUKUN7!f4& 9 93( „ Oü ½ a@ 4@ ÄCURRENCY SIGi Bu064¤º ¢º uTATWEEL“ 		 96S “  U“ )f9Ó Æ@ 
Hu062_Ä¥ �GHAMZe2e³
/ BALEF¨ MžE ABOz n 3« ³? x ? }? ·
? 2WAW} > "xa{ ù¶[POUND¶'25£ DŒ
d â e SBELOWË â 6? E? ?YEH£  > ‘á F>  } l . .A0. 7BEH- &- Hé¨TEH MARBUTïä5 T5 b È- Y
:)TH� c)AG
. GJEEM\ d. L‰ (HAë ¡‰ O
[ K. . =
. $DAªGu063ÔA/ )TH. ]A. R3[A 7ZAI]3Ï¶  8SEE. 9Aû
ä *SH/ A 3SAD›"xaõWAòðLEFT-POINTING DOUBLE ANGLE QUOTATION MARK
 ¡   '\xbb'  ð'#  0xAF -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
; q'\u2591H F  B0F LF g SHADE' 2' 1' mMEDIUM( 3( 2( LDARK& 0N 3& ÒBOX DRAWINGS ‚ †VERTICAL… '24] 47 – AND LEFT@ 6ì 5@ q 1 SI3A IH ¿ 6H �‰ X H '56Ð 7H CDOWN| Í D 5D 8D Ð µ9D  HÉ YAA 8 7½ B8 u  d= C= %UP<x c; D; /UPw7EB u'10„ ¿ û 1	Cµ<  ú û 3; É; ‰HORIZONT„;Cá@  · B 1B ý½Ã 0:Cz 3z  
wz F &5e¹CþÁ T‹'5fI ÿpGI Z I aI À5üÑ� z '69z ùz M6CC N IÆ 5B €| R: 	| G CàUP SINGLE AND ðHORIZONTAL DOUBLE
    '\u2568' ó#  0xD0 -> BOX DRAWINGS UP2 W AND H ISINGH 4H 1H RDOWN 4 J ’ 5J 2J 4 J ` Ü '59J 3J 
Ü SRIGHT£ C 4C u ‹ C œ C 2† 5C E 3E 6E y Š › Š '6bE 7E eVERTIC$I ò	aN 8N † N ­ œ 1i9N Lž!UPG FLEFT: '0cˆ A: f Ã_= 8w B= §FULL BLOCK& ÝC& ­LOWER HALF, � D, ?EFT+ '90º E+ ž , 8, F, ?UPPƒ F0636X EÔôARABIC LETTER DADÜ G0637- ¹
- 7TAH- /Eœ
- Z- E
- 7AINZ NEi
- )GH/ '41¶ U
/ $FE¶ "xbP!  äE=—MICRO SIG‚ 4¨E
S 6QAF¯ 4�Eý
- K- ?EÜ
- 7LAMZ ¯ ­ Ï
- 8MEE. ëÀ
. 8NOOã ìÈ
. H6Hu064ìÉ
- 7WAW¶ ìË
- ÇALEF MAKSURA6 õÕ
6 Y� 7226óFÖBIDEN²'TOU æFÑxFATHATA¬FÏKDAMM+ dqFÍKKASR+ e+ Ë� © f( Ä~ ( 5ûF¿&{ ( (22±àF7 -> ALMOST EðQUAL TO
    '\xb0'
 ó	  #  0xF8 -> DEGREE SIGN' Qu2219) ' 9' ó BULLET OPERATOR+ 1xb7) R A+ £MIDDLE DOT&  Q a( Q B& —SQUARE RO' 707f' C' ôUPERSCRIPT LATIN SMALL LETTER ´ 1xb2: ‰ D< $TWBu25aŽ E+ bBLACK ” ¶ x& S F( óNO-BREAK SPACE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð) cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with2 ƒ P.py.
i ±#"

import  sÆ f ÁAPIs

class  ($ . 1):
Adef ç ñe(self,input,errors='strict'):,  screturno B = , †ing_map)m 0m *B 	m   m ª)ø ±IncrementalÛ$er å  h Ã final=False*  W.Q
?[0]¨  DP¨  ~  ¨ ö L¨ !@ â ¨  Oª ÑStreamWriter(J,W ¤ 5pasƒ ORead9  	9  ’Fàs module API

ý Ãgetregentry(7 
�ž UInfo(¾aname='€%', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # ÛZ  „0MapA¶Tmap =Ïñmake_identity_dict(range(256))
°  Ámap.update({Fð 0x0080: 0x0391, › ‘…K CAPITAêVALPHA6 16 26 7BET5 25 35 GGAMM6 36 46 8DELl 46 56 bEPSILOÇ58 68 ZÙ 65 ð7,     #  GREEK ðCAPITAL LETTER ETA
    0x0087: @398, « #  GREEK 4 )TH6 86 96 (IOk 95 a5 GKAPP¡ a6 b6 GLAMD6 b6 c6 &MU
c3 d3 N3 d3 e3 &XIf e3 f3 vOMICRON8 f8 /a08 Pk #903 13 5RHOg #914 34 FSIGMn#926 46 &TA<#934 54 WUPSIL	#948 68 'PH
54 74 C4 64 'PSh MaGOMEG>Mb¨ESMALµGALPH4 L+b2Ò 	4 B´9IbÛ	3 8GAMÙGbÙ	4 7DELç9HbÙ	4 E×Kb×	6 ZÑ KbÖ	3 	2 EbÔ	2 
ëaFbÔ	4 	éaEbé	3 
çaCbç	4 
åaCbå	4 ãa<bã	1 áa9bá	1 ßa6bß	1 Ýa8cÝ	6 Ûa3c3
Ùa1cþ

×a2ce
kFINAL : 8c8
a6c6
a6c6ÀALL LETTER PàHI
    0x00ae: @3c7, ø	 #  GREEK SMALL LETTER C2 f2 82 	&PSd  b02 E25912 µLIGHT SHADE‹ #b1' 2' lMEDIUM( 2( 3( LDARK& 3& 0N ÒBOX DRAWINGS ‚ †VERTICAL… 47 %24] 7 – AND LEFT@ 5@ 6ì 	@ q u SINGLEA g DOUBL6H ¿ H 8 H X � 7H /56Ð CDOWN| D 8D 5D x D ˜ ˆ 9D 6µ	/  × YaA 5YA y b8 áy u c= dú  µ5 UPø x d; c; /UPw›O255bB u«O2510B û cµ1	
ú RÏû cÉ3; ‡HORIZONT„cá2;· B ý1B 
	mÃ 0:
z  3z F þ/5e¹º Á T‹ÿfI ? I Z I aI @ ü5< ˆ� z ù/69z M6Å C 6Â —GÆ B | 6R| G  Àcf: 0x2567, ð%    #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
4 ð 0x00d0: 0x2568, H 2 H ^ H 1H 4H ODOWN’ 2J 5J ” 3J /59J #UPÜ SRIGHT£ × 4C 	C œ C 5C 2† ˆ E 6E 3E 4 Š › Š 7E /6bE eVERTIC$I :N 8N aN 8 N ­ œ 9N 1iLž!UPG FLEFT: a: /0cˆ : f _= b= 8w ¦FULL BLOCK& c& Ý¬LOWER HALF, d, �  ¯ + e+ %90º ž , f, 8, ?UPPƒ eÔ603cøõ	GREEK SMALL LETTER OMEGAã eÀ603a· 4  öALPHA WITH TONOS? µE03adË ?  EPSILONA ¬O03aeA 
T~ ¦603c‹~  $IO> ‡DIALYTIKÿ ¥O03af 	B þ ž?03c=
_OMICRþ š?03c?
U?�603cÛ 	A  „?03c„
8Ã‰K0386D@CAPI{yE�'03�Å A G	ª<038ûC É½<038I? 	Ò<038	@ 	é<038…
C À UPSILON WITðH TONOS
    0x00f0: @38f, ý #  GREEK CAPITAL LETTER OMEGA WITA 1A 50b1A ö PLUS-MINUS SIGNl 2+ E2265+ ö	GREATER-THAN OR EQUAL TO4 34 44 OLESS1 41 E03aa1 Ñ 3IOTÐ –DIALYTIKAu 5D bD rUPSILONG  6G 50f7G ‹DIVISION7) E2248) oALMOST 8+ E00b0+  DEá R 9' E2219' ö BULLET OPERATORí a+ 600b¦ ¦MIDDLE DOT& b& 6221W˜SQUARE RO' c' &07OõSUPERSCRIPT LATIN SMALYd< E00b2´ < 'TWe+ 625abBLACK ” ¶ f( '00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U d'\x00'* A¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXƒ x 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 UQUIRY$ 6$ 6$ µACKNOWLEDGE( 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  �c9& pHORIZON”@TABUKO=<'\n2 a2 •LINE FEEDŸ b( #ü 0b& `VERTICvV :x0c0 c0 HFORMV r$ ® d& äCARRIAGE RETUR¨ 2x0e. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ �J'\x1›1›/ 6HRE` 
¤1¤1 2FOU¥ a 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2d BLOCKM1Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´ð1c -> FILE SEPARð ATOR
    '\x1d'
 ù
 #  0x001d -> GROUP SEPAR, e, e, oRECORD-  f- f- LUNIT+  ( $  „  20+ RSPACE¦ !" 1" òEXCLAMATION MARK- "- 2- LQUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 1"'"š7& ƒPOSTROPH(M 8' ñLEFT PARENTHESIST -')- 9- ORIGH.  *. a. sASTERISq+% b% GPLUSó ,& c& RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{¢DIGIT ZEROK 1' €' #ONˆ2& y& #TWL 3& t& 3HREN 4( t› 3FOUÁ5' sO 3FIVN 6' q' 2SIXè 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 �L3 ÀLATIN CAPITAðL LETTER L
    'M'   õ
#  0x004d -> LATIN CAPITA3 M3 N3 e3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 ú 5c0 ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. rOW LINEà `% 6YGRAVEN a) ESMALÑAZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 ó½	1 K1 l1 ôî	1 m1 ù1  n1 ù1  o1 üÄ p1 7b  q1 r1 s1 Pt1 "u1 v1 À 0x0076 -> LðATIN SMALL LETTER V
    'w'   î#  0x0077 -> L1 W1 x1 81 X1 y1 91 Y1 z1 a1 Z1 {1 b1 òEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f% of" TDELET# Pu0391% #  80# °GREEK CAPIT¤ ÅRALPHA¬ \7 27 17 8BET6 36 26 HGAMM7 47 37 9DELn 57 47 wEPSILONÝ 69 59 ZÝ 76 66 
5 85 *TH7 97 7 )IOa6 6 HKAPPb7 "7 HLAMD7 c7 (7 'MUzd4 -4 N4 e4 74 'XIh ö;4 XOMICR(a0m R9 Pm ac9c6RHO¢ a+9a8SIG+a+9b'TABa)9`U)a)9b(PH(9^C5 (9](PSj &9]GOMEG¹b°]	Öb9\	5 
bäY	4 bâW	5 bâX	5 	bà[	7 àZETA
    '\u03ø&b7'   #  0x009e -> GREEK SMALL LETTER ETA
    '\u03b83 f3 *TH5 95 /a05 )IOi a4 14 WKAPPAž b5 25 HLAMD5 c5 35 'MUg d2 42 N2 e2 52 'XId f2 62 vOMICRON7 (c07 77 Pi (c12 82 7RHOe 33 93 GSIGMg(c25 a5 lFINAL ; 4; b; 'TAq(c53 c3 YUPSIL?67 d7 (PH@EaEC3 EaE%PSf 8259¦bC´LIGHT SHADE›8259fb7mMEDIUM) Äb+LDARK' 0P ÒBOX DRAWINGS … †VERTICALˆ 2³b#8 – AND LEFTA 6ñ 2	A s u SINGLEB g DOUBL6Â II 9 I Y ’ 5b[	I CDOWN~ E ˜bnE z E š Š 6¼€E   #^5^�B 	{ 5îb‹9 w  9b–> %UPü z §b›	< /UP}b«C {1`b»	C ÿ 1cÅ=  þ Rßÿ 3< Ù< ‰HORIZONT’@À  0x00c2 -> ÿ4BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> C  �VERTICALG RV B (00B 4B | 3| 5: 	| G (5e� 6G A fSINGLEÄ v DOUBLEË (5fJ 7J 9 J [ J aJ 8J A &UPD = 4= 9= Ø‘(69? a? | R(66B bB � D 	cD � ¡É 5C dC ~ 	[e; 	~ H 7
fH 2UP ûÈB ['68I /d0I  	I _ 6-d1I •5 ” 5” 2K – 5t-d3K #UP” è9Ú 5#I
lD ž D 2Ó SF 3F RF { Ð (6bF Nù	SdSÌý1ne<%FLEFTe0]da; % Íd> 8y ]§FULL BLOCK' 	è@­LOWER HALF- 	’ * ³ , 9Vd¢ - 8-  ?UPP† 803ceäô	GREEK SMALL LETTER OMEGAè 803a» eÐ5  ÷ALPHA WITH TONOS@ àd'   #  0x00e2ÿ4 -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0x00e3 B /TA> (ca> 4€ $IO? —DIALYTIKA� fC 5C À (cc? 6? _OMICR(cdB 7B UD(cbB 8B 	 cŠ9F OOMEGŒ(86† a@ eCAPITAOALPHB 8B bB P	(89D cD Ð8Rd@ TA 	eA 	8‹fD 	8Ø/f0D Ñ0xb1I› f1B ô PLUS-MINUS SIGNF@2265. Ç f2, ÷	GREATER-THAN OR EQUAL TO5 45 üOLESS2 803ažfðdžé a/fòE 	^H 0xf7½  û‹DIVISION4ÙfãlALMOST:xb0V Í DEUT 1éf¯ó BULLET OPERATORi+xbª ›£MIDDLE DOT' Iu221^€—SQUARE RO( )07[dúSUPERSCRIPT LATIN*:xb2à a= &TW!!5aVLbBLACK — º x' ‹1óNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  ‰100:‘000,ª  FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEX€u 3) 3) 0ENDS 
' 4' 4' pRANSMIS‚ 5/ 5/ VQUIRY# 6# 6# ¶ACKNOWLEDGE' 7' 7' ð BELL
    0x0008 : 0x0008,  Ð#  BACKSPACE
  9% 9% öHORIZONTAL TABULATION1 a1 a1 –LINE FEED% b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETUR¤ e+ e+ –SHIFT OUT¤ f% f% II "10$ %10$ ö DATA LINK ESCAPJ#11, 1, ÷EVICE CONTROL ON. 2. 2. 5TWO¬ #13. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 »fCANCEL" ¸1¸W fMEDIUM) °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ†AMPERSAN�2…2…–APOSTROPH2v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k–DIGIT ZER¿3p3p& 3i3i% 	3d3d% 	 3d3d— 	÷3c3cM 6FIV3a3a& 5SIX+3a3a% 6EVEü3b3b' E<N ]3]' 'NIC3V3Vð COLON
    0x003°b: 0x003b,  Ð#  SEMICOLON
  c% c% ×LESS-THAN SIG* d* d* kEQUALS' e' e' GREATERT f- f- ÕQUESTION MARK§ "40) %40) ÖCOMMERCIAL AT) 1) 1) öLATIN CAPITAL LETTER A2 22 22 B2 32 32 C2 42 42 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 é4éôOö4ö&Ld þ4þd M2 	4	2 b442 Od 552 P2  5 Q2  5 R2  5 S2  5 è5 5 Ud  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷OSMAL 6õ6õ	0 6ó6ó	0 6ñ6ñ	0 6ï6ï	0 ð E
    0x0066: 0px0066,  ð	#  LATIN SMALL LETTER F
 0( 27:  0 	G0 80 80 	H0 90 90 	I0 a0 a0 	J0 b0 b0 	K0 c0 c0 	L0 d0 d0 	M0 e0 e0 	N0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60  
V0  /77` 	W0  7 
X0  7 
Y0  7 
Z0  7 ÷EFT CURLY BRACKENþ7þÖVERTICAL LINEW ÷7÷ORIGHX ö7öGTILDP ç7çVDELET" aÙf" ÖNO-BREAK SPAC* b* ƒ¦DEGREE SIGZbúfú«PLUS-MINUS+ õfî æSUPERSCRIPT TW€b0f –MIDDLE DOhf& †‰DIVISIONz #38¯eO  Ê pK CAPIT–±õ ALPHA WITH TONOP#38�e A EPSILONC £eC T‚ ²e=? /IO@ ”e<@ _OMICRÂ e<C U¡fXC OOMEG9o8A Êh#39z8¥w FBETA5 t8¤àGREEK CAPITAL ð	LETTER GAMMA
    0x0394: @083, ó #  GREEK CAPITAL 6 GDELT6 56 46 vEPSILONn 68 58 (ZEm 75 65 	4 84 74 )TH6 96 86 (IOŸ a5 95 GKAPPBb6 a6 GLAMD6 c6 b6 &MUsd3 c3 N3 e3 d3 &XIf f3 e3 WOMICR#a08 f8 Pk "a13 /903 5RHOŸ #a34 14 7SIGa/926 &TA<a9PUa9R'PH
9NC4 9M'PSh 9MFOMEG¬afÒ  Mç WITH DIALYTIKD &fâ NG 7eÿESMALãRALPHAC VTONOS>Ce	? ìA Qe
A T~ [e	= F
¼ b.Ó	> û ð #b2.Ò	4 B:baÏ	3 
{b_Í	4 
yb_Î	4 ‹Ñ ]Ñ	6 	ub\Ñ	3 	ZË	2 
qbZaÌ	4  ÜÌ WaÌ
mÀ  0x03bb: 0x`00a2,  ð#  GREEK SMALL LETTER LAMDA
  ï0x03bc: 0x00a34 	&MU1 d1 41 	N1 e1 51 	&XIb f1 61 	uOMICRON6 #c06 76 	Pg #c11 81 	6RHOc 22 a2 	¦FINAL SIGMf#c3: 9: 	4 44 b4 	&TAj#c52 c2 	XUPSIL966 d6 	'PH:72 e2 	C2 82 f2 	'PSd 92 /e02 	GOMEGfa4 ›
÷IOTA WITH DIALYTIKB bB 
BE SeÀE VTONOShceË
	† A seo
=€ 3207�fHúSUPERSCRIPT LATINT‡3221¸f{ ó BULLET OPERATORç 3221¯fáµSQUARE ROOT' 4<fäALMOST EQUAL T¡32263fÍÏLESS-THAN OR1  2f2OATER4 #50icfôBOX DRAWINGS LIGHT HORIZONTALÉ #50?bž 9  hVERTIC7 Odv7   DOWN AND R t 1­ by= 	5LEFy#51Ncƒ<  /UPw ´d$; 
u î c%{  2¶ bŸ
fA 	� 2� ö  oè 3‚ %c1»B  ý @ ‚ 1@  	Â ÀHORIZONTAL
 ð   0x2550: 0x00cd,  ð#  BOX DRAWINGS DOUBLE HORIZONTAL
& : 1: /ba: 
hVERTIC8 28 /d58 óWN SINGLE AND RIGHTˆ } 3E 6E ¼ E V E 4E /c9E ü FDOWNŠ > 5> /b8> 
È >LEFÇ 6D 7D Ç D Æ 7D bD 
Æ  D Å 8= /d4= /UP‹9C 3C Â ÎÃ aC cKÃ /UP‡b< /be n <  ý LcB #UP2 B R FdB c„  À  „ ; e; cÉ?‡fI KI � 6Í P I Ô 6â; GW› H *b8 H X H -bè—  Ò 	¥6)/d1à
ë.:‹ 5/d2J Ï J Õ ;c÷J � :/cf� 
ýA Õ E0H Ó JcRG� Ñ HdHâL1G × ZdRN d œ fc¨"£  …N G 8žd´öUPPER HALF BLOCK, ·ÊÀ  LOWER HALFð BLOCK
    0x2588: 0x00db, Œ #  FULL& c& d& ›LEFT HALF+ #90+ e+ ORIGH, 1, %b0, L, USHADE¤ #92' 1' {MEDIUM ( 3( 2( KDARK& a¡ f¡ ðZBLACK SQUARE
}
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with2 cA P.py.
i ±#"

import  cs

###f ²APIs

class ($ .… 1):
#`def en ñ(self,input,errors='strict'):,  äcreturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾aname='€%', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # )Y  ƒ0Map@0codàTmap =Îñmake_identity_dict(range(256))
¯ 5 ‘.update({E 85106@ôLATIN CAPITAL LETTER C WITH ACUT¥3008Ì+fc= ESMAL; U; –DIAERESIS| ä/e9? 	E? z ÷&10· 	z A; fMACRONw 43/e4w 	< ¶  5? ?123? 	G{ vCEDILLA| 6= ?0e5= 	| —RING ABOVr7@ ?107@ 	ðC WITH ACUTE
   € 0x0088: P142,  ð#  LATIN SMALL LETTER L WITH STROKE
( < 9< /13< 	E< fMACRON< a< +56< eCAPITAz R> vCEDILLA? b? 7? 	· = c= /2b= 	Iz ¸ d< +79< ¸ Z> GACUT1e= ?0c4= A= –DIAERESIS÷ fA 5A –RING ABOVƒ #90B À ¶
À "91= eµv—IGATURE Ap 23 c3 05 35 ;14dç h •O&¡!94< ,0fq < b!95? ,12° } G} ˜!96? &0a? †CENT SIGü!97% ;15aß d Sd „±5½
; °,0dx Y µ?0dc¹ U¹ A  ·;0f8A �n9¶&0an[POUND\ ,0db ä d ¡dWëMULTIPLICATIONm �aÐŠCURRENCY) av;100ø – ùÓaw/120²a‚f8â ô
laˆ7l· í;DOTna�,171	ð? �7ù ? » ‰6201CòRIGHT DOUBLE QUOTÒEMARKaa›&0a#BôVN BAR& „&0aEBCOPYa 	ëas%aeù›REGISTEREºa]a,+NO:a@bÖ ±VULGAR FRAC¡†ONE HALF­ 8ðbc,     #  VULGARð FRACTION ONE QUARTER
    0x00ad: @141, ö #  LATIN CAPITAL LETTER L WITH STROKE> e> 60ab> ð	EFT-POINTING DOUBLE ANGL| 1OTAŠ FMARKE fE bE ORIGHF  b0F 7259É  F V SHAD² #b1' 2² lMEDIUM( 2( 3( LDARK& 3& 0N áBOX DRAWINGS L‚ …VERTICALò "b47 %24] 7 – AND LEFT@ 5@ 6010@ µAµVOGONEp#b6> c~ > C> VCARON{ 7= /18= E= { 8> 6> ‡DOT ABOV¿9A 6256—	:pr; aA 5'A 	ø b8 7º 8 ODOWNu  c= d= 
/UP;   %2e; ­Ip ?160> S> ë˜6251= 	ó Ýò cŽ1¢<  ñ îjc¢3; ‡HORIZONT]cº2ß{  · B Ö1B 
	dÃ à0:
z Ù?253z F á7–4Uö¤câ/6a4> 8MAC câ6255> 	~¡úÝ5ú< »uÚ%69¸ z 7ã6�A  C épC ;	ð?255;| ìð256c,     #  BOX Dð#RAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: @17d, õ #  LATIN CAPITAL LETTER Z WITH CARON= "d0= +05= ESMAL; A; fOGONEK< 1< y 	< C< w 2; /19w 	E; w 3< 7< –DOT ABOVE¶ 4? /2f? 	I{ 5< /61< 	S< ò 6; /73; 	U; ò 7< /6b< 9MACá8< /7e< 	9; E2518; TBOX D �LIGHT UP™FLEFTda: /0c: 	ADOWN< RI = b= 8w —FULL BLOC}c& 4c ¬LOWER HALF, d, �  ¯ + e+ %90W ž , y6258, ?UPPƒ eh,0dÿ¥OFACUT³ei/0d³
õSHARP S (GERMAN)Qem4ÿ !| Aeo4º Nº m/0f_
y GTILDõ l,0d; 2= n&0b= –MICRO SIGýeX4D	ÁÙ W%36(uKvCEDILLA“[?013Ä
= ^<013L| `<013	ö = w<014ø 	= 3ö ˆO01125ø‰›6014Ôs} ®0sÚöSINGLE QUOTATION MARhf¹aå¦SOFT HYPHEKf£bªPLUS-MINUSvf�7201€ÐEFT DOUBLE QUñ	OTATION MARK
    0x00f3: 0be, ñ  #  VULGAR FRAC0 æTHREE QUARTERS: 4: 6: ÆPILCROW SIGN( 5( %a7( "SEZ 
( 6( f( PDIVIS³ 
) 7) 6201³ ÿ DOUBLE LOW-9 QUê 87 E00b0ˆ 0DEGÛ 
^ 9' E2219' ö BULLET OPERATORÚ a+ 600b² ¦MIDDLE DOT& b& Q ö SUPERSCRIPT ONE+ c+ 3| + ‰- d- 2- &WO+ e+ 625aû pBLACK SÖ€ f( '00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (} d'\x00'Y p¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXx x 3* 3* 0ENDU 	( 4( 4( pRANSMIS„‚ 50 50 UQUIRY$ 6$ 6$ ¢ACKNOWLEDGq ¤ 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  ¼c9& ñHORIZONTAL TABULü¡ n2 a2 “LINE FEED& 2x0b( #+ 0b& oVERTICV :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETUR= !e. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”åDEVICE CONTROL¹J'\x1–1–/ T� / 
›1›/  u‰1¤1¤1 2FOUš a 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDL
¶1¶Z2R BLOCj ” 
Ë1ËUCANCE
)19È1ÈY eMEDIUMa* À–SUBSTITUTª 
Á1Áê
´1´†ILE SEPAð Â du ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" À021 -> EXCLAðMATION MARK
    '"'   ü#  0x0022 -> QUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 0"'"Æ   Ê 7& ‘POSTROPHE' -'(M 8' òLEFT PARENTHESIS- )- 9- ORIGH.  *. a. sASTERISq+% b% GPLUSó ,& c& RCOMMA› -" d" ³HYPHEN-MINUÄ .) e) ’FULL STOPO /& f& TSOLIDJ 0$  30$ ¢DIGIT ZEROK 1' 1' #ONˆ2& yM #TWL 3& t& 3HREN 4( t› BFOUR› 5' sO 3FIVN 6' q' 2SIXM 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 �L3 1Lf M3 f M3 N3 3 ÅO3 3 -P3 5'ÀLATIN CAPITAðL LETTER P
    'Q'   õ
#  0x0051 -> LATIN CAPITA3 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 .c0 ãREVERSE SOLIDUÁ]+  , d, ?IGH] ^1 e1 óCIRCUMFLEX ACCEN‹ _. f. ‚LOW LINEà `%  60% YGRAVEN a) ESMALAZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 óñ	1 K1 l1 ô"	1 L1 m1 ù1  M1 n1 ù1  N1 o1 üÄ O1 p1 7b  q1 r1 s1 Pt1 "u1 v1 w1 	x1 y1 z1 àa -> LATIN SMAðLL LETTER Z
    '{'   ò#  0x007b -> LEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f% « f" TDELET# Pu0106% #  80# °LATIN CAPIT¤ ¥C WITH ACU> 0xfc< $  > 1> 6SMA=U< ’DIAERESISó J\xe9@ 2@ E@ |  º 1> | 3< A< eMACRONy 4; ¹ 4= ¹ Pu0123B } 5@ G} uCEDILLA~ 5< ~ 6> » ˜RING ABOV¶7C  7A ´ Xu0142< 8< L» WSTROKy 1ø 9= ±	uIu015la= lR| 
7 @ 	ö z¬	n> (2bø ‰ê	> I| » 7«qœ= » Z? «+xcnª> òp+xc2ÊB 	4!xcÁ u9ê½	Ã eº> ê”IGATURE A-+xc4 Þ56   d¨9ØOi	¨+xfs Ø= h Ø9Ø³ Úa> 'Ú„CENT SIG~ Éaã ¿f Så ‹ > É9Á<  +xd Àz "*xdó9Åõ f8ü $Ç‚ 	�!xa= ÆXPOUNDb+xdd °f À'\xd7'     #ð  0x009e -> MULTIPLICATION SIGN
    '\xa4'
 # #0 f0 ˆCURRENCY* Pu0100, *  a0* ôLATIN CAPITAL LETTER A WITH MACROi Xu012a? 1? I?  0xf3=  ¨ &a2? ESMAL| O= SACUTEä Pu017b> º 3< º Z> ˆDOT ABOVB cB 4B 	~ @ 	ý 5@ 	¾ H201d| 6< òRIGHT DOUBLE QUOTÚCMARKö 0xa66 278 ¥BROKEN BAR' 9' 8' BCOPYc 	,e+ 9+ ¨REGISTERED.!xa0~ a, 9NOT% bÙ % b% ±VULGAR FRAC®„ONE HALF± bZ c5 dQUARTEé Pu0141À d8 ÀL ST-w aC¬ YÔLEFT-POINTING�?ANG•bF ojG Hu259Ì bŒESHAD¸G2592ô bu|MEDIUM ) ab_LDARK' 0P JáBOX DRAWINGS L… ƒVERTICAL=Au252h_ @8 P AND ]A 9010A AÃ}TOGONE ¼6€ DüCü)CA»(18FJ> E> } 1‹} b? 	9256žy	?
x@92551�B 	yH2557ü £9 ODOWNw ãû ¬> -UP< 1012p< °1v6¯b°¯Sµ	ó9251> ¨	¹ éö 1­cž=  õ ÿp3< ²< ‚HORIZONTkÀ '\u252c'   ô4#  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   C 3C �VERTICALG RV B (00B 4B | (3c: 5: 	| G H0172G 6G ôLATIN CAPITAL LETTER U WITH OGONEKÀ H016a? 7? dMACRON? 9255? 8? 	„ŸDOUBLE UP<(54| 9= Â{(69? a? | <H2566B bB � D 	cD 	ÈÉ 5C dC ~ 	Ee; 	~ H H017d
fH FZF'CAG0105> &d0> ESMAL‚A< ‚0{ /d1= C= y 1d· 	y E< y (17¶ ý= ”DOT ABOVEüH012f@ û@  I} (61= þ=  S= ö (73< ó	ö ñb= ñ= 
ïH017e= ï¶  %H2518< î¯®DLEFTj8250ædê; §_8y æ•FULL BLOC
8258ŽdÉ­LOWER HALF- 	’ ³ ³ , 9ßd¤¢ - 8- ‰?UPP† !xd¿exüOGSACUTEV!xd¾> yóSHARP S (GERMAN)@ Hu014e}~ L4¿ |e? N½ Àxf5'     #  ð%0x00e4 -> LATIN SMALL LETTER O WITH TILDE
    '\xd5'
 A #  < 5< oCAPITA> 
b> 6> £MICRO SIGNe Pu0144g e 7' ¡  N¡ DACUT¡ Xu0136< 8< ¡ K> vCEDILLA| (37@ 9@ 	> b> a> ~ L~ c@ b@ 	~ > 4ü c> 8ú (12| d> ¼ E¼ XMACROµÞµe?  H2019 f@ óRIGHT SINGLE QUOTATION MARK±0xad6  ’ f08 ¤SOFT HYPHE  :xb1( 1( ©PLUS-MINUS�8201‡ f2, ŸLEFT DOUB‹ *bec 37 ±VULGAR FRAC¼ @THREÌ dARTERSÆ b¹Æ ”xPILCROW› !xaž) �"SE\ E+xf) lPDIVISB* Au201¹ ºfoé _LOW-9z*b0ï k0DEGà 	` 2ÚfSõ BULLET OPERATOR¶ A¥MIDDLE DOT' +(äSUPERSCRIPT ON:xb3§ , ’Z Z 	. #WO, Au25a9óµBLACK SQUARƒ ' U ÜóNO-BREAK SPACE
)

### Encoding Map

e �_map = {z  y100:�400,�FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXuu 3) 3) 0ENDS 
' 4' 4' pRANSMISƒ 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGf  7' 7' (BE8  8  2ACK€ GE 9% 9% pHORIZONÝ@TABUŠø1 a1 a1 –LINE FEEDÂ b% b% ŸVERTICAL T c/ c/ KFORMT d% d% âCARRIAGE RETURü¤ e+ ð e,     #  SHIFTó OUT
    0x000f: , Å #  SHIFT IN$ "10$ %10$ öDATA LINK ESCAPE, 1, 1, ÷EVICE CONTROL ON. 2. 2. 6TWO\ 3. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) —SUBSTITUT¦ b& b& ßc" c" ×FILE SEPARATONd* d* _GROUP+ e+ e+ oRECORD, °%1f, OUNIT*  2¶2¶FSPACî 2«2«€EXCLAMATŒ6MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ•AMPERSAND2…2…—APOSTROPHv2vöLEFT PARENTHESISR €2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k–DIGIT ZER¿3p3p& 3i3i% 	3d3d% 	 3d3d— 	÷3c3cM 6FIV3a3a& 5SIX+3a3a% 6EVEü3b3b' E<N ]3]' 'NIC3V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú†ERCIAL A×4l4lÀ#  LATIN CAPó
ITAL LETTER A
    0x0042: , Ø #  LATIN CAP2 B2 32 32 C2 42 42 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2  /522 R2  5 S2  5 T2  5 U2  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷OSMAL 6õ6õ	0 6ó6ó	0 6ñ6ñ	0 6ï6ï	0 í6í	0 6ë6ë	0 	6é6é	0 6ç6ç	0 6å6å	0 6ã6ãÅÀSMALL LETTERã K
    0x006c: , ö	 #  LATIN SMALL LETTER L0 d0 d0 	M0 e0 e0 	N0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENþ%7c. ÖVERTICAL LINEW ÷7÷ORIGHX ö7öGTILDP ç7çVDELET" aÙf" ×NO-BREAK SPAC* £9ã†CENT SIGXa˜9ê [POUND& Ž9u ‹CURRENCY) Wa'–BROKEN BAaMf­{SECTIONN aEBCOPYb
Ç ßaYñLEFT-POINTING DOUBLE ANGLE QUOTAo 6MARôaöaT,NO0ñfX§SOFT HYPHEWéaÏ›REGISTERE\bÑå jDEGREEb¡f¡«PLUS-MINUS+ ùf•æSUPERSCRIPT TW'bÿfÿ	+ 6HREQbdeQ[MICRO~ fº{PILCROW( n–MIDDLE DOŠbf¸¡ OŒb¥*b¢VULGAR FRA¤ ONCFARTEÓba¨ 7 EHALF=b%f4 T�1 QUm c�8ïžPCAPIT¥ ÷ A WITH DIAERESIA Ëà8f,     #  LATñ IN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 092, x #  LATB —IGATURE A5 95 05 w Ew FACUT= "d3= e= O= 5= 5z = GTILDz ì 9= •DIAERESIS-"d7~ %9eA öMULTIPLICATION SIGN/ 8/ d/ \'­ WSTROK® c> a> U(®  fA +e1A ESMALõSHARP S (GERMAN)¾ "e4? /84? 	Z~ eª/86? ™ e­¾ I—e—8Ì	ñ •f•a; 
©
Ðfé e(
; 
‘fä ; cf�fc]DIVIS‰f‰bŒ	£ ‡f‡8ˆÃ…2100FaîHUMACROB2101> /83¹ 	< Àb+> dOGONEKþ#10Öd¸ 	L< ×8< –Cº	O#10Õ/87ó 	; «bp= )CAkdkdè
; "12; eèzä1{8–	j< j+b8-j> :DOTÿ#11nda
? Yb­€ d1°du
} < 2t9ÞÀ#  LATIN CAPðITAL LETTER G WITH CEDILLA
    0x0123: @085, ï #  LATIN SMAL= a= +a1= 8CAP| I| fMACRON{ b> +8c> 	{ < e< +bd< z fOGONEKz f> +d4> z < "36< +e8< z Kô p#37? 9? 	{ = 2+ea= | L| c| b? 	| = "41= ar? eSTROKEr"42> 86{ < £+e3· ö Nö GACUTy 4y +e7= 	y ; 5; e; x ê4)ß
z = «2| Oô Z"4dº 92	õ < 5· 8dRz ¹ 5à8d
= P9­rS| 
ê59c
; "600bê= (CAÇ6dB
; ð cð Uð æ6ñ d> 	æ< 7�/c6`> 7’d> z < 9l8HZô 
ä71al
; .a\= †DOT ABOVJ7“a5
? ”/cfrA 
d7ïdÜ
; ÀH CARON
    ð0x2019: 0x00ef,  ð#  RIGHT SINGLE QUOTATION MARK
# 7 c7 %f27 ŸLEFT DOUB6 d6 %a66 m 7 e7 %f77 1 _LOW-9¤ 2Û %f97 ô BULLET OPERATORÏ 2500b &c4+ ÑOX DRAWINGS L¦HORIZONTAL9 29 /b39 	hVERTIC7 ?/da7 	‚DOWN AND’t 1­ b³B­ =  ˜< 4° /c0y 	/UPw 8; dOw ; 
u î c%{  2¶ bŸ
fA 	� 2� ®2	è 3‚ /c18@ ‚ 5@ 		Â F  5ú/cdF : 1½bq: � 05ø õ8 mÏ> 7v b° 
> 	µ"5a= /c8= 
qy i/bc< 	w 6d; *m
} "63¹ b4	B 
ƒ 6A c7ð 6×cð=A ±eB
	Å G  8Nd¬õ UPPER HALF BLOCT#58ldz?LOW, �#LFULLR Å d0 i} 9© ð Ö, ME!USHADEþ94{MEDIUM ( 0žKDARK& a¡ f¡ ð1BLACK SQUARE
}
""" Python Character Mapping Codec generated fromð2 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.

"""#"

import c €s

### C Â APIs

class (= !s. Â):

    def W ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , †ing_map)m  de‡ m )B 	m   m dtable)ø ÁIncrementalE<r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö eL¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌF€s module× 

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp850', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # )Z ping MapA0codáTmap =Ïñmake_identity_dict(range(256))
° 5 ‘.update({F€0x0080:  0c7,ö #  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 4@ º  5? 0? GGRAVº 6; 5; ˆRING ABO@ 7@ ³	t±8= a} 	r79@ b@ 7 a? 8? 7b; f; 	Iñz  c? e? ù d@ Àc,     #  LAñTIN SMALL LETTER I WITH GRAVE
    0x008e: 0c4, ` #  LA; eCAPITA= A= –DIAERESISA fA 5A ‡RING ABOƒ #90B 9B Eƒ FACUTÀ "91= +e6= û —IGATURE A3 23 c3 ó 5 35 f(h cO£ ¥CIRCUMFLEX'#94@ u @ f#95? 2ç 	 
â#96; b; 	Uº 7@ Ÿ	º @ { 8; f{ 	Y{ õ  9? d4©	÷ A  aA c€ A ½ A  bA +f8A 	ü öWSTROKgc< %a3< ¦POUND SIGNd& db £ d ¾%d7d ëMULTIPLICATIONm ¬/19F
F�EHOOK§ a¤%e1i '		%
¢a¢d; 	�; ªfCv  ; °av 	ù; «ì 
N&FTILDôa§d; Î= ©a³ ðFEMININE ORDINAL INDÚ&ORšŸb6 oMASCUL7 ›b›ÑINVERTED QUES=7MARŽ%aeR›REGISTEREÕaxax:NOTŒa[b±VULGAR FRAC †ONE HALFì SbX 4 gQUARTE#da–ì bEXCLAM,
ï [a7�EFT-POINTÅÿDOUBLE ANGLE QUOTE q&0bE ORIGHF b}6259À LF G SHA}ð b1: 0x2592,    ð #  MEDIUM SHADE
    0x00b2: 0x2593,  ( LDARK& 3& %02& öBOX DRAWINGS LIGHT VERTICAL] 47 /247 – AND LEFT@ 5@ E00c1@ ÷LATIN CAPITAL LETTER A WITH ACUTÚ 6= ´ = 	¦CIRCUMFLEX 7B 0 GGRAV 8= %a9= QCOPYR*FSIGNg 9* 6256ƒ	]eDOUBLE^' aA 5'A 	y b8 7£ 8 ODOWNu  c= d= 
/UP;  d; 600ašZCENT e% 5` ;YEN$ f$ 6251¡	Á —À #c0< œ
¿ ¶8"c1; 3; ‡HORIZONTct%2cÛ · 	B �1B 
�‚Ã š0:
z “?253z F œeóœLSMAL×7TIL±c•; = •O255azkö§5ö< nq¤6	ô> z 3­/66» 
 C ³6õ„ 7	º?255B | Ï?2568| G ò600a…ŠCURRENCYdß600fª b 5ETHÖdÖ<00d2 Y	4 Ê600cPf 4 ¡d dÊE00cb×B 	–DIAERESIS· ÊL00c8A ÀAPITAL LETTEðR E WITH GRAVE
    0x00d5: @131, ö #  LATIN SMALL LETTER DOTLESS I8 68 ;0cd8 eCAPITA: Iu GACUTu 7= e= ¦CIRCUMFLEX 8B fB –DIAERESISA 9A E2518A öBOX DRAWINGS LIGHT UP AND LEFT: a: /0c: 	ADOWN< RI = b= 8w ¦FULL BLOCK& c& 4c ¬LOWER HALF, d, E00a6, ¦BROKEN BARR e& cµ ç¯$f= E2580c ?UPP�  e0, E00d3, i O#e1= Ö	�fSHARP Ë#e26 .ÃÜ s N #e3B 2µ 
"e4= +f5= 	µ } FTILDe},0d; º = ‚b= ¥MICRO SIGNùekfk	ž GTHOR4 ]d4 — 6 RK00da6 UúUO00db= ÄZO00d9B Äq<00fÎ	&Yº €d; ÷ = —añWMACROŒ|600bÝLf ACCEN–fxa‡ ¦SOFT HYPHEO fbbïªPLUS-MINUS:fWE2017QæDOUBLE LOW LINÈf@b1öVULGAR FRACTION THREE QUARTER¼f=b¾{PILCROW� *a� "SEZ 	ïff( PDIVISƒ 
) b‰uCEDILLA;fb÷0DEGÇ 
J øaJ ofàb˜ `MIDDLE[r ÄbÄØSUPERSCRIPT Os²bh+ oÐ
    0x00fd: €0x00b2,  ð#  SUPERSCRIPT TWO
  # ¥fe: 0x25a0+ ÆBLACK SQUARE( f( '00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'‡ @ #  ‹ ¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- ETEXT* 3* 3* 0ENDU 	( 4( 4( µRANSMISSIONX 50 50 UQUIRY$ 6$ 6$ ¢ACKNOWLEDGq 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& öHORIZONTAL TABULATÅ n2 a2 •LINE FEEDÇ b( »b& oVERTICV :x0c0 c0 HFORMV r$ ® d& æCARRIAGE RETURme. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ �J'\x1›1›/ 6HRE` 
¤1¤1 DFOUR¹1¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ AMê"AN¬0"'"  *2•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •ðCOMMA
    '-'       ð #  0x002d -> HYPHEN-MINUS
    '.'   ) e) ’FULL STOP& /& f& TSOLIDJ 0$  30$ ¢DIGIT ZEROK 1' 1' 2ONE& 2& 2& #TWL 3& 3& 3HREN 4( 4( BFOURu 5' 5' #IVN 6' 6' 2SIXM 7& 7& BEVEN( 8( 8( REIGHT( 9( 9( $NI9:' a' CCOLOq ;" b" GSEMI& <& c& ÓLESS-THAN SIGQ =+ lgEQUALS( >( k|GREATERV ?. sÒQUESTION MARK@* 4yÃCOMMERCIAL ADA* |òLATIN CAPITAL LETTER A] B3 ‰3 B3 C3 –3 C3 D3 ¡3 D3 E3 ­3 ¹F3 ¹3 Ff G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 [L3 1Lf M3 f M3 N3 3 tO3 3 -P3 5'3 ÷Q3 0QÌ R3 0wS3 0¶T3 0üU3 0UÌ V3 0V3 W3 0W3 X3 0\Y3 	0ÀPITAL LETTER  Y
    'Z'   ò#  0x005a -> LATIN CAPITAL LETTER Z3 [3 b3 òEFT SQUARE BRACKET0 $\\1 c c0 ò REVERSE SOLIDUS, ]+  , d, ?IGH] ^1 e1 óCIRCUMFLEX ACCEN‹ _. f. ‚LOW LINE„ `%  60% YGRAVEN a) 1) <ESMAL:AZ b1 21 B1 c1 31 C1 d1 41 D1 e1 51 f1 61 Fb g1 71 G1 h1 81 H1 i1 91 I1 j1 õ	¹J1 k1 ó&	1 K1 l1 ô L1 m1 ù1  M1 n1 ù1  N1 o1 üÄ O1 p1 7b  P1 q1 Q1 r1 R1 s1 Pt1 "u1 U“ v1 V1 w1 W1 x1 X1 y1 z1 {1  ZCURLY|/ `VERTIC`|}* R Z  ~0 CTILD°3\x7³R7÷UDELET# "c7H # 8éÓC WITH CEDILL×3\xf©@ øU> ƒDIAERESI¥J\xe9€ E@ 6ACU¼ *e2< àA WITH CIRCUMFàLEX
    '\xe4'
 õ" #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS@ 0@ 5@ UGRAVE< 5< 6< ‡RING ABOA 7A 7A C½ uCEDILLA a> 8> E> hIRCUMF<bA 9A <8@ a@ 
<f< b< I½ | e@ c@ Cý cA dA 	½ cue< oCAPITAwc;fB =)c9Á /90C FACUT¼6> 1> 8•IGATURE A4 c4 24 ÷ 6 f-&936 j ¢Oêªfw ãA +*f2ë ã@ 	êf#9ãU½ ¦ãA 
} 
$9áY} ù d9à°	|B 
%9âB À B f$9è}USTROKq*a3ºå¤POUND SIGN	dd Ë¦ f d†9ÎèMULTIPLICATIONo Au019Rs9¼	ÑF—DHOOKª )e1Ñ a´	; ®
²d< ²Ì2	< fIaº	x  
< 
gaÀ
< ð »N+ETILDýd< Àa5 -> LATIN ðCAPITAL LETTER N WITH TILDE
    '\xaa'
 ô #  0x00a6 -> FEMININE ORDINAL INDICATOR7 b7 77 oMASCUL8 fo 88 ôINVERTED QUESTION MARKk *ae3 93 õ REGISTERED SIGN, c, a, 9NOT% *bd% b% ±VULGAR FRAC‚ „ONE HALFZ bZ c5 eQUARTE)*a1m d8 ñ qEXCLAMAr 	ô b6 e6 þLEFT-POINTING DOUBLE ANGLE QUOTF bF fF ORIGHG Au259Å # b0G LG E SHAK ( 2· ( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS …  =CICAL«Xu2524_ 48 P AND ]A !xcï   b5A kLATIN RAREACUTRcµ > R> 	¥CIRCUMFLEX� 0À C ^C 	EGRAV� *a9> dACOPYûIu256Š\	cgd,Au255.õrB 	ä  9 7¨ 9 †9 ODOWNw Æ> �> ,UP< +xa¡“:CEN& a5ž „ƒ;YEN@1«‡ b	‡ £Ä 1¨cX=  Ã ¾>3< l< ‰HORIZONT%Òº c„A  º C 1C  ‰Æ 0?cª| 3| £¿  	¸G !xeþåc¬ESMAL:è	:c< ¥>  ÿC€¥	Á zþ5þ·ÀWINGS DOUBLEð4 DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP = §HORIZONTALB 6B bB � D 0D cD �VERTICALÉ 5C dC ~ c~ e; 	~ H 0xa4F LfH ÓCURRENCY SIGN4!xf« *  d0* ôLATIN SMALL LETTER ETH3 d3 13 oCAPITA5 )ca’ /d25 ô WITH CIRCUMFLEXx *cbC 3C •DIAERESISB 8B 4B SGRAVE> Pu0131@ ¡&d5> 	+“DOTLESS I9 0xcd7 d69 1Iü DACUTw :xce> 7> : fC 8C :Au251<ü 9B 	�LÌœ7LEFØ0ÔdØ; •8y Ô£FULL BLOCKcAu258ó  ·©LOWER HALF- !xa&�¡“ROKEN BART !xc· ' �·	.1258(’ ƒ?UPP’ )d3¡e†k O" dße‘	™eSHARP d2à e“u Y*d2¸ “C #:xf5> �	¸ < TTILDE�d< �2	> b> ’ZMICRO
{e{	¡ ETHORRd5 m
7 
!ebnU
ee> 	Ì ~jC 	
Ì
äe�HÀL LETTER Y WðITH ACUTE
    '\xdd'
 ý #  0x00ed -> LATIN CAPITAL LETTER Y W> *af> e> dMACRONa *b4# f# ƒ t ACCENT) aŠ  f0) ¦SOFT HYPHEQ 1Q  f1( äPLUS-MINUS SIG, Pu2017. Þ  f2, åDOUBLE LOW LIN
 be*  
 f3, ôVULGAR FRACTION THREE QUARTERS» *b6; 4; xPILCROW� !xaŽ d 5) "SE\ ¹ +xf) 6) PDIVIS† * *b8| 7* uCEDILLA  0$ 8$ 0DEGÌ L aL 9( vIAERESIî œ a& •MIDDLE DOÐ*b9u b' ×SUPERSCRIPT O|3, c, xÏ 2. ´Z 3TWO, Au25aý ¢pBLACK SÇÿ' ›¨óNO-BREAK SPACE
)

### Encoding Map

e �_map = {z  L100:T400,cFNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXuu 3) 3) 0ENDS 
' 4' 4' pRANSMISi 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGf  7' 7' (BE8  8  2ACK€ GE 9% 9% pHORIZON°@TABUÂ„1 a1 a1  ûV FEEDÂ b% b% ŸVERTICAL T c/ c/ KFORMT d% d% âCARRIAGE RETUR«¤ e+ e+ ‡SHIFT OUßf% f% II 1x1x@DATAívK ESCAP�1„1„åDEVICE CONTROL¦ £ 1†1†. z. ‹1‹.  N€1”1”0 FFOUR/ ”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°tSUBSTIT»a±1±ßðc: 0x001c,     #ó  FILE SEPARATOR
    0x001d: , Ÿ #  GROUP+ e+ e+ oRECORD, f, f, OUNIT*  "20* %20* USPACE¢ #21! 1! öEXCLAMATION MARK, 2, 2, OQUOT* 3* 3* ¶NUMBER SIGNQ 4' 4' \DOLLA' 5' 5' {PERCENTO 6( 6( –AMPERSANDt 7% 7% ‡POSTROPH8& 8& öLEFT PARENTHESISR 9, 9, ORIGH- a- a- wASTERIShb$ b$ KPLUSí c% c% VCOMMA— |%2d! ·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k¥DIGIT ZEROI 3p3p& &ON~3i3i% 'TWJ d3d% 7HREL d3d— 6FOU©3c3cM 7FIVL a3a& 6SIXâ a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 n4ö4ö&Ld ðd: 0x004d,     #ó  LATIN CAPITAL LETTER M
    0x004e: , / #2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2 22 22 R2 32 32 S2 42 42 T2 52 52 U2 62 62 V2 72 72 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 ÷EFT SQUARE BRACKE[c/ c/ çREVERSE SOLIDU¸d+ d+ ?IGH[ %5e0 ÷CIRCUMFLEX ACCENˆ 5uOW LINEÛ 66\GRAVEL 6÷6÷ESMAL½AX õ6õ	0 B0 ó6ó	0 C0 ñ6ñ	0 D0 ï6ï	0 í6í	0 F` ë6ë	0 G0 é6é	0 H0 ç6ç	0 I0 å6å	0 J0 ã6ãŸ	0 K0 ä6äÏ	0 L0 é6é0  ý6é6é0  û6ì6ìÀ ù7ø7ø`  ÷7 7 
õ7 7 
ó7 7 
97 7 
7 7 
í7 7 
ë7 7 
ÀW
    0x0078 : 0x0078,  ð	#  LATIN SMALL LETTER X
 ( 90 90 	Y0 a0 a0 	Z0 b0 b0 öEFT CURLY BRACKET. c. c. ÖVERTICAL LINE) d) d) ORIGHX e/ e/ GTILDP f! f! VDELET" "a0" f" ×NO-BREAK SPAC* 1* aœ  INÇ õED EXCLAMATION MARKÑ "a25 b5 –CENT SIGN% 3% 9[POUND& 4& cª ‹CURRENCY) 5) b;YEN$ 6$ d˜ ¦BROKEN BAR™ 7& %f5?1SECæ 
Á 8( n–DIAERESISM “bÃBCOPYà
O �%a6w ÷
FEMININE ORDINAL INDICATO­ “a÷ ÿLEFT-POINTING DOUBLE ANGLE QUOT°ªa,NO¯¥%f0Ÿ §SOFT HYPHEÖ�aœREGISTEREÛ§e» VMACROM b§=jDEGREE×b¤%f1› «PLUS-MINUS+ šfõ SUPERSCRIPT TWOºb f 	+ 6HRE'b§e§€ACUTE ACúU ¦eå[MICRO¦ ¨&f4Ñ kILCROW( ª¸–MIDDLE DOˆb¨7N vCEDILLA— ¦fÙì O­b§N PMASCUÒ¨b¨!©b©”¢VULGAR FRA£ ONçFARTE%b¼aß 7 FHALFÉ%f364 T1 QUm óbØa¶3AQUESJ	0cèbTèPCAPIT/ê¶A WITH GRAV{cþb¯= 	—æ cb�= 	–CIRCUMFLEtc'c¼ Tªc78àLATIN CAPITAL ñLETTER A WITH DIAERESIS
    0x00c5: 08f, ú #  LATIN CAPITAL A ¦RING ABOVEB 6B /92B —IGATURE A5 75 /805 ¸ C¸ vCEDILLAt 8? /d4? E? 8GRA± 9= 9| = GACUT¹ a= dî ¹ = ¦CIRCUMFLEX¼ bB 3¼ ³ cA eA Iý d= 6= ý e= 7= ý fB 8B ý #d0A 1A 5ETHr"d14 /a54 N1FTILDñ"d2= e¯O= 
k#d3= k= 
n#d4= k= n dÝeù B ù Ø96= « ä9¨öMULTIPLICATION SIGN¦Ô/9dp WSTROK§Õ/eb> U§Õeë = §Ð/eaz §Ñ9B j Õe;Yý À Õe“GTHOR®ÉeˆESMAL6fSHARP ne¾8‘	6 ­
KeÅK; 
â eÃ8Ã;   eÆc4@ 
EeÄ8©; ÙeÁ8z œÀE
    0x00e6 : 0x0091,  ð#  LATIN SMALL LIGATURE AE
  + "e73 /873 öETTER C WITH CEDILLA= 8= a= 	E= GGRAVx 9; 2; GACUT; a; 8; ¦CIRCUMFLEX¶ b@ 9@ –DIAERESIS? c? d? 	Iõ d; a m; õ e; /8cv õ f@ b@ õ "f0? /d0? 	5ETH'"f12 /a42 	N'FTILDá"f2; /95; 	O; 
W"f3; aW
; 
b"f4; /93v b "f5@ eñ 
{ ñ 6; 9; � Ä%f6º ÖDIVISION SIGN”°9
£ WSTROK•±9)
U•±aZ
; •¬9Û 	Ò2; •­r
@ Z ±ev
Yõ º ±e0
GTHOR ¥9Ú
o ® #13sd8
”DOTLESS I$19pf@e Fæ CHOOK: 4201zoäDOUBLE LOW LIN@3250BcäÀBOX DRAWINGS�ÔHT HORIZONTALd #50ž b>9  hVERTIC7 údœ7  åDOWN AND RIGHTt 1­ b= 	7LEF< Hc+<  /UPw  dš; u À0x251c: 0x00@c3,  ð#  BOX DRAWINGS LIGHT VERTICAL AND R 
- ï0x2524: 0x00b4A FLEFT@ c@ /c2@ 	ADOWN} ¥HORIZONTALB 3‚ /c1B 	/UP@ ‚ 5@ 		†  #50È dF DOUBLE : 1: /ba: 
� ø 5ø 98 
;
¸#57v b> 	µ"5a= /c8= 
ty d< /bc< 	w 6d; *ñ
} #63} 4	B 
ƒ 6A c7ð #69C ð=A ±eB
	Å G  8N%dfG õUPPER HALF BLOCKl8ldz?LOW, 8à d#KFULLR 9ö0~ lUSHADEy "92M bÝ{MEDIUM ( ÙGKDARK& aó f:ðXLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with genc; P.py.
c À#"

import c cs

###` ²APIs

class ($ . 1):
Qdef eW ñ(self,input,errors='strict'):,  ¬creturno “.charmap_B = , †ing_map)m  de‡ m )B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö eL¨ !@ â ¨  Oª ÑStreamWriter(JÐ,codecs.StreaðmWriter):
    pass

class StreamReader(Codec,c (s. 	9 ó### encodings module API

def getregentry(7 sreturn X e QInfo(�  ‘ Õname='cp852', d !e=0 2().   deQ    ²incremental: 6r=I EÀ /er/ J 	/ Dl / s7r7=*R # wy# †# 0)

IZ ping MapAWd_map =2ñmake_identity_dict(range(256))
° 0ing5 ‘.update({F€0x0080:  0c7,kö #  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 4@ º  5? ?16f? 	ù —RING ABOV¿ 6@ 0x	9vú 7; /0e; ±8= /147
L7WSTROK´ 9< ?0ebô 	®3 a? ;150? kO} {DOUBLE ü bD 1D 	7B 
cB ?0eeB 	I„ 8d@ ,17³Æ ZB ¿ e= ,0cu= ·D fA ;106¾ A 99ì» Â
» 9ê/13= ;= è;13a· 	·; èf3	; ò° 9èf2@ q9è+3dº q¼ UCARONd9å3l
; å,152x Sg9å5©ÀR S WITH ACUáTE
    0x0099: 0d6, ö #  LATIN CAPITAL LETTER O WITH DIAERESISA aA cA UA bA ?164A TA VCARON~ c= 5= ESMAL½ ; d; +41; ú Lx WSTROK8e> 50d7> ÷MULTIPLICATION SIG¨ f/ 510d/ g	¨ Ck 
ã !a0; ,0e¨ 	; A; 7ACUÝ#a1; v 
I; 2; /f3± 	v 3; a; 	; 4; /10î eOGONEK#a5> 
< 6< 7+Z-£7= eò 	; 8; +18; x Ex ò ¾;119> 	< ¹a¹:NOT·aœ7Ë
Ù Ëš0_ òÙ ôœ/5fØ 	SvCEDILLA›&ab= òEFT-POINTING DOUBLE ANGLE QUOT±7MARL±&0bE ORIGHF b¼7259¼ F V SHADMb¨E2592² lMEDIUM( •6259•LDARK& €6250N áBOX DRAWINGS L‚ …VERTICAL7b|6252|7 – AND LEFT@ ~'0cì J€
.b&0c´ .= ¦CIRCUMFLEX „1«p
Áb†5Á= rb‡6256˜	;qs< Œ6255<A 	õ  6255†8 ðDOWN AND LEFT
  ð  0x00bc: 0x255d,  ð#  BOX DRAWINGS DOUBLE UP AND LEFT
' ; d; E017b; öLATIN CAPITAL LETTER Z WITH DOT ABOVEA eA cA OSMAL? f? E2510? 	» ®LIGHT DOWN¼ #c0< 4< 	ö RI ¶ "c1; 3; ¦HORIZONTAL@ 2@ 2ö · 	B 3B 1B 
�VERTICALý Ã 4A 0:
z 59 3z F 6F E0102}9A97BRE5#c7= 3= 	5; 8; E255a; 	z
ì39< ö< n> a> /69z 3bA 6A 
 C ê6õÂ 7	ñ?255B | ê?2568| G ò600a…ÕCURRENCY SIGNddßE0111/b	%D`VSTROK–dà'01W< ×> ÞK010ez > GCARO· Ù?00cRE¹ –DIAERESISø ÙK010f~ ø | ÛK0147; ¹ N| = Ò&0cF4I= GACUTqÒ/0c3= ¦CIRCUMFLEX÷ Ù<0118	÷ 6º Ø%18÷ 	E		ÿdÔ0Ô: ’
dÐ8w ¦FULL BLOCKØ ³8ð¬LOWER HALF, �?016U	ÀER T WITH CEðDILLA
    0x00de: @16e, ö #  LATIN CAPITAL LETTER U WITH RING ABOVEB fB E2580B õUPPER HALF BLOCK,  e0, E00d3, n On FACUTi #e1= f= ESMAL© vSHARP Ss 26 46 á s ¦CIRCUMFLEXB 3B /14µ Nµ 4=  	µ ; 5; 8º ; VCARON³ 6; 6”hS³ = 7= 1x 	; 8; 5î mRx à9= ;0dax = ‹= a= ;155= 	-x b; 7-x {DOUBLE  cD ?0fd 	Y÷ d; d; ÷ = ¿œ	÷ Tx *CEüeº600b®Ö u ACCENTNf¶a¢ ¦SOFT HYPHEuf 2É ,V ™52db3VOGONE.fy52c7" 
ªf]&2d"7BREœfC&0aB ·SECTION SIG» 0&0f( ^DIVIS) &0br Vf&0bOkDEGREEs îaJ †DIAERESI½fÖ52d9;DOT�fÀ°
¾	f¾&15Œ /?…À&15¤ = 	ƒ; ¾625a+¶BLACK SQUARúf©( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (Öd'\x00'ñ ¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXN x 3* 3* 0ENDU 	( 4( 4( pRANSMIS ‚ 50 50 ðQUIRY
    '\x06'  ð   #  0x0006 -> ACKNOWLEDGE
    '\x07'
 ( •7 -> BELL! 8! 8! tACKSPACG t$ o 9& óHORIZONTAL TABULATIONX n2 a2 “LINE FEED& 2x0b( Ç b& oVERTICV :x0c0 c0 HFORMV r$ ® d& äCARRIAGE RETUR¨ 2x0e. ‚ e, •SHIFT OUT¨ f& f& IK )10%  10% ô DATA LINK ESCAPR:x11- 1- öEVICE CONTROL ON/ 2/ 2/  4TWO° *13/ 3/ 6HRE` 41 41  EFOURa 50 50 �NEGATIVE‰*161 ±ö SYNCHRONOUS IDLŽ 
¶1¶õ
END OF TRANSMISSION BLOCK” 
Ë1ËUCANCEî*19† ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  � Z2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSAN¬1"'"H•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >b3{“DIGIT ZERÝ8' €' 2/& y& )&& t&  ( t› ' sO 3FIV$
' q' 2SIX3& qÀDIGIT SEVEN
p    '8'   ð
#  0x0038 -> DIGIT EIGHT
 -'9( 9( BNINE' :' a' RCOLON" ;" b" GSEMI& <& c& ÓLESS-THAN SIGQ =+ d+ gEQUALS( >( e( |GREATERV ?. f. ÒQUESTION MARKÑ @*  40* ÃCOMMERCIAL ADA* 1* òLATIN CAPITAL LETTER A] B3 23 B3 C3 33 C3 D3 43 D3 E3 53 F3 63 Ff G3 73 G3 H3 ÑeH3 I3 Ü3 I3 J3 è3 J3 K3 ù3 [L3 1Lf M3 f M3 N3 3 tO3 3 Of P3 5'3 P3 Q3 0Q3 R3 0R3 S3 0S3 T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 Ê5-ãREVERSE SOLIDUÁ]+  , &Rð] ^1 $óCIRCUMFLEX ACCEN‹ _. EOW L+`% 6YGRAVEN a) LSMAL5b1 ÀN SMALL LETTÀER B
    'c'   ò#  0x0063 -> LATIN SMALL LETTER C1 d1 41 D1 e1 51 E1 f1 61 F1 g1 71 G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 S1 t1 T1 u1 U1 v1 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ÃVERTICAL LIN^}* ORIGHZ ~0 CTILDR 3\x7³C7÷UDELET# "c7H # 8éPCAPIT¤ hÒ WITH CEDILLA3\xf©@ øU> ƒDIAERESI¥J\xe9€ E@ 6ACU¼ *e2< A< “CIRCUMFLE-J\xe4A "A ½ Au016bý 1� ”RING ABOV~Au010€A ACA 
þ : $  < L< 
¸Au014>> YLz TSTROK· :xeb8eµ8  50B } À008a -> LATIÿ<N CAPITAL LETTER O WITH DOUBLE ACUTE
    '\u0151'   #  0x008b -> LATIN SMALC 0xeeA C cC I† ¦CIRCUMFLEX„  79C „ dA É ZC Â 0xc4<  e> A> –DIAERESIS€  06D € fB CB 
€ ¼ € /90> E> Au013@ | /91> L> aº &92> 	¾<  *xf8/93< =·!xf5ù 4A w (3d½ 5@ ÷¿ VCARONµ3x96> û < 577< z Su(5b¸ 8> 	z <  +xd49< z w60xdc| vaB U¼ B Au016û:ó„ TB < 65‚ > î< 4m9éòTSTROK¬0xd7y û ê÷MULTIPLICATION SIG#0aØ	©Öç !xe© l aÖ	< T	ev < Ô	< 	< )f3ä aÒ
< Õx Ò< Hu010aÍò fOGONEKŽ0aÌ	ó = 72SaË|  ªHu017	aÍ	{ <  18pz Ëz ¼ö 1½aÎ	{ = *xaÉaÉ;NOTÃ7Õ¡ ¬	b ÐZ WITH ACUTE
ô0    '\u010c'   #  0x00ac -> LATIN CAPITAL LETTER C WITH CARON
 > (5f> d> ESMAL< S< cEDILLA> 0xab< | e> ôEFT-POINTING DOUBLE ANGLE QUOTATION MARKF bF fF ORIGHG Pu2591� 	 b0G LG c SHADEo  ( 2( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS … †VERTICALˆ (24_ 48 “ AND LEFTA !xcï ~ b5A úA¾DACUT!xcµ > 6> £CIRCUMFLEX� Xu011aÂ 7C E� {e> 8> }Iu256Ÿ9@ 	x|yAAu255C2aB ù H2557» b9 ODOWNw d> ²¹ -UP< 1017.³ °îZs„DOT ABOVøHu0170b´0	ò@ H2510¾ ®	¾ ïû 1ôc¤=  ú u3< ¸< ‰HORIZONTqú cÐA  º C 1C ìÀÆ 0?cö| 3| ï¿  	ïG )01¯cø8BRE>0ucó	>r	< 8255/cñ	Á ±þ5þî¾w'69¶cë| 8H2566B ôD 	ýú	ÄÉ À\u2550'   # ò, 0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   # ; e; ÎVERTICAL ANDH 0xa4F H fH ÔCURRENCY SIGNr @0111, r  d0* ÷LATIN SMALL LETTER D WITH STROKE= 0= 1= oCAPITA? (0e? 2? DCAROº 0xcb< ä /d3> E¼ –DIAERESIS¿  0fD ü 4B ü ~ Xu0147< 5< û N~ > 0xcd< ¼ 6> I> DACUTw!xc6> 7> ¦CIRCUMFLEXû 1?û 8C 	û ;½ Pu2518¿ < 9< 	à�LIGHT UPžDLEFTw 8250à/da; ADOWN= RJ > 8y b> §FULL BLOCK' ÿ  c' ªLOWER HALF- H0162Í ­ ÈTŠtCEDILLAm 1016Žm ²@ U@ ”RING ABOVÏIu258F­?UPP° 0xd3® üe°° Op 	:dð> ±	÷dSHARP )!xdP7 ©u q4º (e®0¸  nƒ > ª< 6eª	ô < 	ë8016›e¨Sn> \e¨	z < 5ò ¡èRz 0:xda&£–	> Pu0155@ n¦> 	¸ z  Iu0172¤< ¸ � *xfeÂ•Yû < Ñ>  Iu016§Ï	û ðxb4'     #  0x00eðf -> ACUTE ACCENT
    '\xad'
   #  0x00f0) ³SOFT HYPHEN( Au02d* ( 1( PDOUBLR X  0 bZ 0 20 fOGONEKS (c7# 3# HCAROu 8" 4" SBREVED !xaB  ¿ 5" ´SECTION SIGK +xf) 6) \DIVIS* bs S 7* tCEDILLAw  b0— $ 8$ iDEGREEv aL 9( ƒIAERESISN  ,9P ,a& eOT ABOë Xu0171& b& øLATIN SMALL LETTER U WITH œi !15‘ i cC eCAPITAE RE 
Ž)15§ d> 	� < 125a3z e< ¶BLACK SQUARÑ' Z¹óNO-BREAK SPACE
)

### Encoding Map

e �_map = {ô  Ó100:Û400,êFNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXVu 3) 3) 0ENDS 
' 4' 4' pRANSMISŸ 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGf  7' 7' (BE8  8  2ACK€ GE 9% 9% pHORIZONJ@TABUŸÏ1 a1 a1 –LINE FEEDÂ b% b% ŸVERTICAL T c/ c/ KFORMT d% d% âCARRIAGE RETUR(¤ e+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. 5TWOP1‹1‹. 7HRE^ ”1”0 FFOUR_ ”1”pNEGATIVz1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦FR BLOCV Á1»1»VCANCEò1¸1¸W fMEDIUMÜ °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©dRECORD, ÀOR
    0x001°f: 0x001f,  ð#  UNIT SEPARATOR
  " "20* %20* VSPACE! 1! 1! öEXCLAMATION MARK, 2, 2, OQUOT* 3* 3* ¶NUMBER SIGNQ 4' 4' \DOLLA' 5' 5' {PERCENTO 6( 6( –AMPERSANDt 7% 7% ‡POSTROPH8& 8& öLEFT PARENTHESISR 9, 9, ORIGH- a- a- wASTERIShb$ b$ KPLUSí c% c% VCOMMA— d! d! ·HYPHEN-MINU¿ e( e( –FULL STOPM r2rWSOLIDH 3k3k¥DIGIT ZEROI 3p3p& &ON~3i3i% 'TWJ d3d% 7HREL d3d— 6FOU(3c3cM 7FIVL a3a& 6SIXâ a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 n4ö4ö&Ld þ4þd M2 	4	2 ±44À LATIN CAPITóAL LETTER O
    0x0050: , ö  #  LATIN CAPIT2 P2 12 12 Q2 22 22 R2 32 32 S2 42 42 T2 52 52 U2 62 62 V2 72 72 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 ÷EFT SQUARE BRACKE[c/ c/ çREVERSE SOLIDU¸d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINEÛ 6%60$ \GRAVEL 6÷6÷ESMALYAX õ6õ	0 B0 ó6ó	0 C0 ñ6ñ	0 D0 ï6ï	0 í6í	0 F` ë6ë	0 G0 é6é	0 H0 ç6ç	0 I0 å6å	0 J0 ã6ã		0 K0 ä6ä9	0 L0 é6é0  M0 é6é0  N0 ì6ìÀ ù7ø7ø`  ÷7 7 
õ7 7 
ó7 7 
97 7 
7 7 
í7 7 
ë7 7 
é7 7 
ç7 7 
å7 À07a,     #  óLATIN SMALL LETTER Z
    0x007b: , ö #  LEFT CURLY BRACKET. c. c. ÖVERTICAL LINE) d) d) ORIGHX e/ e/ GTILDP f! f! VDELET" "a0" f" ×NO-BREAK SPAC* 4* c* ÕCURRENCY SIGNÅ "a7) %f5u {SECTION( 8( 9( –DIAERESISM iaã  iñ-POINTING DOUBLE ANGLE QUOTAj FMARKE €%aaj ;NOTŽ {%f0$ ¦SOFT HYPHEÝ b08' jDEGREEN b-e-¶ACUTE ACCENb7O uCEDILLA½ bK "c1mb•áPCAPITˆãqA WITH ­ ƒ #c2= 6¦ = 	¦CIRCUMFLEXB 8Ç` cU8Ÿƒ CÀ E"c9Â 9? E? ÿ ‚/d3ÿ = ½  \d@I~ åd#ú = } "d3ý eý O dº/e2ý =  6 9èÁ B ?dü9=’MULTIPLICî	€"dap ep Uï +9+­ = ­  ìeÃA Y~ °+e1m	‡fSHARP $eÜaà	6 ÚeÚ8Û; Ü e/84± 	{ -eÚ8Ü	 ÔeÔ8š	= •
ÒeÒ8#À SMALL LETTEñR E WITH DIAERESIS
    0x00ed: 0a1, ò	 #  LATIN SMALL LETTER I? VACUTE; e; /8c; ¥CIRCUMFLEX@ "f3@ /a2@ 	O{ "f4; /93; { 6@ 4@ 5"f7? %f6? ÖDIVISION SIGNã a) a¨ 
Uã c; 8™
; £  Øe�
Yz  2102z cÞ eCAPITAA= EBREV#10Õ%c7= 	P; Õa•x dOGONEKk2105¶ /a5y < +8f< z Cò 	#108/	ò ; äa¥x ECARO\#10â9µ x ; ºdzx Dð = fid§	x ; #10; Ôx VSTROK[#11> 0¦y < 8< +a8< z ( #19> 9> 	z < bz 
l"1by d· y 
; 3´ 9lLä
Ô3µ 9!	x ; —ˆð = µ ™9L
; 4+9d¤x  4ô8i
y < óeåz Nj4õeN
; ydjÀAL LETTER N ðWITH CARON
    0x0148: @0e5, ÿ
 #  LATIN SMALL LETTER N ;  "50; +8a; eCAPITA= O= ÅDOUBLE ACUTE #51D bD 	 B 
4B +e8B † R†  5= Ã 	 ; 9/fcx 
v"59x +fd= x ; a; +97; ð Sð b= -	x ; e; b; x vCEDILLAéf? aò 
z = 6j/e6ô 
16ce1ô ; 2µ dµ ô Tl· 3? +ee· 	z = Ø9| 	Ö6Ø9�z 
; èdµ x Uô –RING ABOVÔ6ë8S
@ 7îú B X7õfD 	B 
£8üZ
X7¥a 
; £bx ;DOT"7cvbÁ	û | ?  d? alA 
17=al
; 22c7x %f3-	\ $2dq4! 6BREx#2d²fÍß #2d_%f2F dOGONEKª#2d%f1" cs ACCENT/ 3250®c— öOX DRAWINGS LIGHT HORIZONTAL9 ]bñ B9 hVERTIC7 ßdæ 7  ðDOWN AND RIGHT
    0x2Ð510: 0x00bf,  ð#  BOX DRAWINGS LIGHT DOWN AND LEFT
( b0x2514< /c0< 	!UP: RI ; 8; /d9; 
u c: /c3: 	�VERTICAL{  2¶ /b4A 	� 2� 2@ 	2¥HORIZONTALý 3‚ /c1B 	8@ ‚ 5@ 		F  5ú/cdF DOUBLE : 1ƒ/ba: 
� ø 5ø õr ;
3#57v bv 
> 	µ"5a= /c8= 
ty d< /bc< 	w 6d; *® #63} 4	B 
ƒ 6A c7ð #69C ð=A ±eB
	Å G  8Nd¬õUPPER HALF BLOCKl8ldz?LOW, �#KFULLR 9öîUSHADEy "92-bÝ{MEDIUM ( ÙGKDARK& aó f:ðXLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with genc; P.py.
c À#"

import c cs

###` ²APIs

class ($ . 1):
Qdef eW ñ(self,input,errors='strict'):,  bcreturno “.charmap_B = , †ing_map)m  de‡ m )B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
7[0]¨ ÀrementalDecoð	der(codecs.IncrementalDe Ñr):
    def d ó
(self, input, final=False*  . preturn A ³cs.charmap_@ :  F �.errors, ðing_table)[0]

class StreamWriter(C¤ ,U  z Jpass9 0ReaÝ 9   	9 ð### encodings module API

ý Ãgetregentry(7 
æ e QInfo(1 Õname='cp855', d !e=0 2().     i¢: 'r=µEÀ /er/ J 	/ ä/ spr7=c*# w“#  # 0)

IZ ping MapAWd_map =ñmake_identity_dict(range(256))
°  Ámap.update({Fð 0x0080: 0x0452,kö #  CYRILLIC SMALL LETTER DJE5 15 05  oCAPITA7 27 /53l Gl 35 05  l 	7 47 /51l &IO× 54 04  k 6 66 /54j ·UKRAINIAN IK7> 0>  t @ 8@ /55~ 'DZu 95 05  u 	7 a7 /56l ×BYELORUSSIAN-· jbJ 0J  � L cL /57– &YI€ d4 04  € 6 e6 /58j ¿f4 04  j 6 9–9j L5 –5  k 	7 –al Nl –5  l 	7 –bl 6TSH¯9˜6  m 
8 šcn KÚ ‘5  m ð KJE
    0x0098:� 0x045e,  ð#  CYRILLIC SMALL LETTER SHORT U
% q0x0099:9 09  oCAPITA; a; /5ft FDZHEq b6 06  q 
8 c8 4©  	â YÝ d4 24  l 6 e6 /4aØ –HARD SIGNÝ f; 2;  q = "a0= /30x Ap "a13 13  p 5 25 /31h B¶"a34 14  i 6 46 /46j 'TSk 55 25  k 	7 67 /34l Dk 74 14  k 6 86 /35j Ij g14  j 6 b4   	ô&EF`24  j 6 ^/33Ô GËa_15  k 	7 `50abl öLEFT-POINTING DOUBLE ANGLE QUOTATION MARKç j&0bE ORIGHF bs6259×LF G SHAòbgE2592² lMEDIUM( Z6259LDARK& L6250N ÒBOX DRAWINGS ‚ …VERTICALò bM'25Ù7 P AND W@ X4ƒ 	MH+bU24  â6 W%38/�I� T13  i 5 U6256o	HJ `6255ÿA 	® dE2557á 8 ODOWNu  kO255d= 
/UP;  q#39; À  CYRILLIC SðMALL LETTER SHORT I
    0x00be: @419, ÿ #  CYRILLIC CAPITA; f; E2510; õBOX DRAWINGS LIGHT DOWN AND LEFTw #c0< 4< 	!UP: RI ; 1; 3; ¦HORIZONTAL@ 2@ /2c{ 	· B 3B 1B 
�VERTICALÃ 4A 0:
z 59 3z F 6F E043aôS-&KA674 14  (6 86 62556 	#DOUBLE è9< è< ©&a> 6Øz %bA 6%A  C cC çÂ )	dB 5B | Ø?256*| G ä600a…ÕCURRENCY SIGN dÑE043b/TEŠdÊ?0414  T6 À'04j Mž ²'04²4 j 6 §O043dÔ ¢?0414  j 6 ’ej OÓ ‘3  i 5 �O043fh &PEi ˆ%184 		çÃ	åd„0„: B
Ád€8w ¦FULL BLOCK� c8 ¬LOWER HALF, M?041ý  2ÿ I?0446  	-Y-d66258·?UPP– e92`  – b e;4b Ñ– À LETTER ER
     0x00e2: P420,  ð#  CYRILLIC CAPITAL LETTER ER
" 6 36 .416 FSMAL4 S4 44 24  j 6 56 /42j &TEj 64 24  j 6 76 /43j Ui 83 23  i 5 95 /36h 'ZHÓ a5 15  j 	7 b7 3
 	¨Vk c4 14  k 6 d6 /4cÖ –SOFT SIGNFe; 2;  q =  f= '21jNUMEROd  f0' E00adŸ L VHYPHE‹ !f1' 544b' 	06YERÒfD6  Á 
8 F/37n ZžfF14  l 6 F8j 5SHA˜fG5  k 	7 HkDÕ H3  j 5 H/49Ô CÖ J27  l )SH9 L4z 	C¸fM25  n 	7 N&0a7 {SECTION×;625a¾·BLACK SQUAR,&'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = ( `'\x00'" #I¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- ETEXT* 3* 3* 0ENDU 	( 4( 4( ¢RANSMISSIOý Ð 50 50 UQUIRY| 6$ 6$ ¢ACKNOWLEDGq L 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& pHORIZON™`TABULA¡ n2 a2 ðLINE FEED
    '\x0b' ð    #  0x000b -> VERTICAL TABULATION
% `'\x0c'
 0 c0 “FORM FEED& r$ V d& æCARRIAGE RETURR e. ‚ e, “SHIFT OUTR :x0f& f& IK )10%  10% ôDATA LINK ESCAPER *11- 1- öEVICE CONTROL ON/ 2/ 2/  5TWO^ 3/ 3/ 6HRE` 41 41  EFOURa 50 50 öNEGATIVE ACKNOWLEDGa 61 ö6 -> SYNCHRONOUS IDL- 7- 7- õ
END OF TRANSMISSION BLOCK” 86 86 eCANCEL# 9# 9# Y eMEDIUM* a* a* –SUBSTITUTª b' Áê
´1´ÆILE SEPARATOVdN ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  � “2ÆCSPACô !" »aEXCLAM­C MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSANV1"'"y•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >b3{“DIGIT ZERÝ8' €' 2/& y& )&& t&  ( t› ' sO 3FIV$
' q' 2SIX3& q& 3EVEõ( r( EKP ú( m( $NIk:ª3f4COL†;" cGSEMI& <& cðLESS-THAN SIGN
    C'='  ð
#  0x003d -> EQUALS SIGN
  -'>( e( ÇGREATER-THAN. ?. f. ÒQUESTION MARKX @*  40* ÒCOMMERCIAL AT* A* 1* òLATIN CAPITAL LETTER A3 B3 23 B3 C3 33 C3 D3 43 D3 E3 53 E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 a3 J3 K3 b3 [L3 c3 Lf M3 dM3 N3 3 LO3 3 Of P3 5'3 P3 Q3 0Q3 R3 0R3 S3 0S3 T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. cOW LIN`% 6YGRAVEN a) LSMAL5b1 	1 3c1 	1 1d1 	1 /e1 ÿ	1 f1 ýÀSMALL LETTER  F
    'g'   ò#  0x0067 -> LATIN SMALL LETTER G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 41 T1 u1 51 U1 v1 61 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ÒVERTICAL LINEY }* ORIGHZ ~0 CTILDR B\x7f% 7÷TDELET# Pu0452% # 8éŠCYRILLIC¥'DJ6 06 î6 PCAPITÝ Ý	8 (53n õ8 
	n 	6 ú6 n G8 (51n 8 	n IúY\u0405 5 m 7 (54l 7 	l ¸UKRAINIAN IQ	? ? v A (55€ )A 	€ (DZw 	6 .6 w 	8 (56n 58 	n ×BYELORUSSIAN-º öp	K OK ƒ M (57˜ mM 	˜ Y‚ 	5 x5 ‚ 7 &58l À08e -> CYRILð&LIC SMALL LETTER JE
    '\u0408'   #  0x008f -> CYRIL5 oCAPITA7 '597 )907 	l Lm 	6 16 m 	8 (5an 28 	n Nn 	6 36 n 	8 (5bn 48 	n 8TSHJ	7 57 o 
9 (5cp 69 	p KÞ 	6 76 o 	8 (5en 88 	n wSHORT U+	: 9: r < (5fv a< 	v )DZT	7 b7 s 
9 4¬ c9 	p Yá 25 d5 n 7 4he7 	l –HARD SIGNT2< 
>  '30Va†Ar 14 „
6 (31j ‚B15 �
7 (46l €
m 26 8 (34n ~D5 15 }
7 (35l |Il 	5 w
7 4£ r&EF25 p
7 (33Ø nGÝ16 o
8 !xag³apóLEFT-POINTING DOUBLE ANGLE QUOTATION MARKë +xbF zORIGHG Hu259äbƒLG F SHAûG2592#bwmMEDIUM) bjLDARK' 0P \ð	BOX DRAWINGS LIGHT VERTIó6CAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
A H0445A 5A ô	CYRILLIC SMALL LETTER HAv 90425 65 oCAPITA7 (38l 77 	l Ik 14 84 k 6 H2563j 96 	oDOUBLEH2551B aB ± H25579 b9 MDOWN�H255d> c> -UP< H0439< d< ËeSHORT /9041: e: e< H2510v f< 	k‚ï 1¿/c0= î RÌi3< 1< ‰HORIZONT<cº /c2A º C 1C 3C 	Æ 0?cÁ| 3| ºy 	| G H043a
Ì	•K15 
Ê17 92557 Í	³ —ð5ðÔ°i6äcÑ| *H2566*ÚD 	ïà	¶É 5C çE~ 	3è; 	~ H !xa‰vcôÔCURRENCY SIGN¥G043b4dá”EÕ90415 Ú5 ^7 	dÐ7 	Ê&EM¡ 	ÂdÂ5 l 7 3¨d·7 
l 15 ²5 l 7 ð 3e'   #  0x00d6ù% -> CYRILLIC SMALL LETTER O
    '\u041e'   #  0x00d74 oCAPITA6 (3f6 86 	j $PEk H25185 95 öBOX DRAWINGS LIGHT UP AND LEFT; (0c; a; ADOWN= RJ > 8y b> §FULL BLOCK' 4e c' ªLOWER HALF- 9041d- l890447 e7 	9'YA™ 0™ f5 ?UPP™ 2b  e0- ™ d 8044d )e17 	™ $ER™ 90425 25 7 '41Ð )e37 
l Sl 	5 45 l 7 (42l 57 	l 'TEl 	5 65 l 7 (43l 
L	l Uk 	4 
Jk 6 (36j Kå	j 'ZH× 16 F6 l 	8 3@8 	n Vm 	5 N5 m 7 4êeX	l —SOFT SIGNL	< 
]s > *21fhNUMEROf 0xadz2faN WHYPHEŽ  4b* ZfR7YERÛ27 T

9 (37p VZ¦	5 V
7 4RfV%SHÈ90426 W
	8 4tJXÙ 24 X
6 (49DX9SHCÚ 	8 Z
: 4�\CÊ26 ]ÀIC CAPITAL LðETTER CHE
    '\xa7'
 ó #  0x00fd -> SECTION SIGN) Pu25a0+ ) e) ¶BLACK SQUARR '  R f) óNO-BREAK SPACE
)

### Encoding Map

e �_map = {z  • 100:� 400,¬ FNULL  1  1  öSTART OF HEADING, 2, 2, FTEXT) 3) 3) 0ENDS 
' 4' 4' ¢RANSMISSIOEË 5/ 5/ VQUIRYy 6# 6# ¢ACKNOWLEDGfJ 7' 7' (BE8  8  2ACK€ GE 9% 9% ðHORIZONTAL TABULA
� a1 a1 –LINE FEED% b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETURde+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. 5TWOP1‹1‹. 7HRE^ ”1”0 FFOUR_ ”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* ¥2¥fNUMBERF r2œ2œLOLLA' ”2”{PERCENTO Œ2Œ†AMPERSAN�2…2…ƒAPOSTROP	š v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|ð HYPHEN-MINUS
  “  0x002e:  ,  Ð#  FULL STOP
 % f% f% uSOLIDUS# "30# %30# ¦DIGIT ZERO& 1& 1& 6ONE% 2% 2% 'TWJ 3% 3% 7HREL 4' 4' FFOURr 5& 5& 'IVL 6& 6& 6SIXK 7% 7% FEVEN' 8' 8' VEIGHT' 9' 9' (NI1a& a& GCOLOn b! b! KSEMI% c% c% ×LESS-THAN SIGO d* d* kEQUALS' [%3e' GREATERT c3cÕQUESTION MARK4i4iÆCOMMERCIAL A<4l4löLATIN CAPITAL LETTER A[ y4y2 B2 †4†2 C2 ‘4‘2 D2 �4�2 ©4©4©2 Fd ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 b442 552 Õ5 5 QÈ 5 5 Y5 5 H5 5 è5 5 UÈ  5 V2  5 W2  5 :5 5 Yd  5 Z2 À5b: 0x005b, ð    #  LEFT SQUARE BRACKET
 ‚0x005c:  ,  / ö REVERSE SOLIDUS+ d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINE� "60$ %60$ \GRAVEL #61( 1( öLATIN SMALL LETTER AX 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	60 60 	F` 70 70 	G0 80 80 	H0 90 90 	I0 a0 a0 	J0 b0 b0 	K0 ä/6c0 	L0 é6é@ M0 é6é0  N0 ì6ì O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
97 7 
7 7 
U�  7 
V0  7 
W0  7 
X0  7 
Y0  7 
Z0  7  ã]CURLYâ7þ7þŠVERTICAL_7÷7÷RàX ö7öFTILD—7ç7çVDELET" aÙf" ×NO-BREAK SPAC* Cc* ÆCURRENCY SIG\aÜfÅ {SECTION( Da¾  'ñ-POINTING DOUBLE ANGLE QUOTAE 6MARYa2f™¦SOFT HYPHE” bl ½ Ym #40Ö8àCYRILLIC CAPITÐàETTER IO
    0ð x0402: 0x0081,  ð#  CYRILLIC CAPITAL LETTER DJE
# 07 37 37 G7 47 77 ·UKRAINIAN Iw 5@ 9@ 'DZ7 67 b7 ×BYELORUSSIAN-„ ú 7L dL &YI6 86 f6 /96 9�L7 a7 �N7 b7 5¤ 7TSH^c8 ÕKo e7 ÌvSHORT UNf; Ð'DZª "108 aPAm #115 NB1X/ecMV6 Wa]GØ Wa‚Dm Ma�ƒ1L/eaÙ 	{7/f47 £ 7/b86 l16/be5 Y; :cIK"9dW&ELX7dX&EM6 dŽd¥&EN6 ldØ O5 fd�P³2d/e2~%ERl 2ee&ES6 e6l T¢ eeUs2cs&EF¡ cb¡ HP2caä'TSØ cs
ÀTTER CHE
   € 0x0428: P0f6,  ð#  CYRILLIC CAPITAL LETTER SHA
# 7 97 a7 C9 a9 /9f9 –HARD SIGNv b= /f2= FYERU8 c8 /ee8 KSOFTu d= /f8= Er e5 /9d5 Y¨ f6 /e06 Œ"306 a6  ESMALÁ3 13 I 	3 BÓ "324 .eb� 	4 V4 34 /ac4 'GH5 45 “ 	i D4 54 ¥ 	4 I4 64 /e9� Z� 75 /f35 i d/b74 I@3`b@ 	Ð gSHORT 9 `c=KWdA&EL¡ SdB&EM4 J/d4Eó3IdÐ Og FdP£4D/e1› Rh 4Ee&ES4 E5h Tœ Ee?I4CŸ 	?&EF› Cb› Î4CaÒ'TSÐ CICx4Dfž ¦4Ffâ(SH¤4D9/ 	>¢4KfH	 4Meîž4Tf€À0x044e: 0x00@9c,  ð#  CYRILLIC SMALL LETTER YU
  ï0x044f: 0x00de4 A4 "514 /844 &IO4 24 04 6DJE5 35 25 G5 45 65 ·UKRAINIAN Is 5> 8> 'DZ5 65 a5 ×BYELORUSSIAN-€ ò 7J ÃI4 84 Ã%94 9�L5 a5 �N5 b5 -7TSHRc6 ÅKk e5 ¼fSHORT 59À%DZ¤ 3211ö%efö³NUMERO SIGNŸB2500– cöBOX DRAWINGS LIGHT HORIZONTAL9 3%b3` 9  hVERTIC7 ;dÍ 7   DOWN AND R t 1­ bÔ = 	FLEFT< ycT<  /UPw Ã/d9ë 	; 
u î c%{  2¶ bŸ
fA 	� 2� ö  oè 3‚ /c1ý @ ‚ 5@ 		Â F  5ú/cdF oDOUBLE¨bq: � 05ø õ8 ;
ª5*/bb° 
> 	µ5Êc*	µ{ qy dÐb£< 	w 6d; *m
} 6b4ÀAWINGS DOUBLðE VERTICAL AND LEFT
    0x2566: 0x00cb, ñ #  BOX DRAWINGS DOUBLE DOWN= ¦HORIZONTALC 9C aC 
/UPA cA eA 
	Å ˆ  "80G %dfG õUPPER HALF BLOCK´ #84, c, ?LOW, 8, #KFULLR "91& &b0R ¥IGHT SHADEy #92' 1' lMEDIUM( 3( 2( KDARK& aó f:ð<LACK SQUARE
}
""" Python Character Mapping Codec cp856 generated from 'MAPPð/VENDORS/MISC/CP856.TXT' with6 cE P.py.
m ±#"

import  cs

###j ²APIs

class ($ .‰ 1):
'`def en ñ(self,input,errors='strict'):,  ´creturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJàs module API

ý Ãgetregentry(7 
¡ž UInfo(Âaname='ˆ%', d !e=0 2().     if: 'r=Ïy/ J 	/ ä/ spr7=D# w“#  # ")
[  �T” D5codä2 = '`'\x00'Þ £ ²r -> NULˆ  1 1 ñSTART OF HEADING[ + 2+ 2+ 2TEX ( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSION| 5. 5. UQUIRY" 6" 6" ¢ACKNOWLEDGJ œ 7& v7 -> BEÀ08'     #  0ð
x08 -> BACKSPACE
    '\t'     #  0x09$ óHORIZONTAL TABULATION0 n0 A0 “LINE FEED$ 2x0b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ äCARRIAGE RETUR  2x0e, | E* •SHIFT OUT  f$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ 1+ öEVICE CONTROL ON- 2- 2-  4TWO¨ (13- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 «eCANCEL! 9! ¨U eMEDIUM( a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  { ½2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt3"'"ÇÈ2u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þ[3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3F4COLz;  CGSEMI$ <$ ÀC -> LESS-THð AN SIGN
    '='   ÷#  0x3D -> EQUALS& >& E& ©GREATER-THR ?, F, ÒQUESTION MARKz @(  40( ÒCOMMERCIAL AT( A( 1( òLATIN CAPITAL LETTER A1 B1 21 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 CL1 C1 Lb M1 îLM1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Ê5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éðh'        #  0x68ð -> LATIN SMALL LETTER H
    'i'   #  0x69/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f# ñ7×TDELET! Pu05d0# ! 8ÉdHEBREW<BALEFœ \- 1- Ç
- Bð , 2, Ä
, CGIMEÝ. 3. Ã
. 9DAL\ 4. Â
. Hà 5+ ¾
+ #VAŒ… 6, »
, CZAYI2. 7. º
. H± 8, ·
, T, 9, ´
, 7YOD‘a, ±
, ˆFINAL KAÃb2 ´
2 
, c, ³
, HLAMEŒ d. ¹
. Œ #ME£Be2 ½
2 
, Ë¨É
, ^ 'NU eÚ9Ú 
, Ù9Ù SSAMEKG ¹ eÜ9Ü 
(eÛ9Û º P³eÞ9Þ 	+ Ð5'   #  0x95 ý%-> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0x96 4 . 7. 7. 7QOFZ 8, 8, GRESH- 9- 9- GSHIN- a- A- 4TAV, Ffffe, B, “UNDEFINED$ 0xa3" C$ •POUND SIGu 
I D% I dI E$ ïMULTIPLICATIONR F. R uv /A0$ 1$ 2$ 3$ 4$ 5$ wü m$ e$ !xa–A\™REGISTEREä7xac	AY8NOTµ8xbd# P±VULGAR FRACätONE HAL	)xbV _3 sQUARTER•úp(ab� pòLEFT-POINTING DOUBLE ANGLE QUOT†CMARKh )xbD †ORIGHE Pu2591‹ FB§LE c SHADEk  & 2& ©mMEDIUM' ‘M ¬LDARK% 0L ­ÒBOX DRAWINGS  †VERTICAL‚ &24‚ ¿6 P AND Q? 	ŽBÚBÚBÚ!xa¶BÚACOPYœ’Gu256/ß	Ô Õ 7255¼õ@ 	1255î¦	7 ODOWNs G< < ,UP: !xaõ:CEN£ a5ã$ *YE{@2510% � õ	� >¼ 1CCë;  » ®23: ÿ: ‰HORIZONT¼I´ C?  ÀDOWN AND HORð4IZONTAL
    '\u251c'   #  0xC3 -> BOX DRAWINGS LIGHT VERTICAL AND R @ &00@ 4@ =HORx 3x 58 	x E Ffffe} 6E ”UNDEFINED¡ 
$ 7$ F255aH 8$ 	ŸDOUBLE UP &54; 9; ODOWN= &69= A= x  F2566@ B@ } B ¿CB 	ˆR 5A DA z E9 	z F !xa}¿FF ßCURRENCY SIGN D0( */D1$ 2$ Sl S‘ 8% $ $$ 
EI 	(Dm E2518pDí-¯DLEFT� 6250íDé9 ¨b8u å¦FULL BLOCKa 8
ÇDÈ©LOWER HALF+ !xa33D²”ROKEN BARP 
ž 8ûD|?UPPt uO EEEEß E~E~0xb5LE~_MICRO|E~E~
E~”
$ i$ Q$ P$ I$ 8xaf!HTMACRO™!xb·BE´ACUTE ACCENA7xadH FA¦SOFT HYPHEM 1& CðPLUS-MINUS SIGN
 ñ   '\u2017'   #  0xF2 -> DOUBLE LOW LINE
 * 0xbe( * 3* õVULGAR FRACTION THREE QUARTERS9 69 49 ÄPILCROW SIGN' aˆ ` 5' "SEX ' f' 6' PDIVIS€ ( (b8v 7( tCEDILLAq (b0" 8" 0DEGÂ H aH 9& vIAERESIâ 	” A$ ¥MIDDLE DOTo 9o B% ×SUPERSCRIPT Oj3* C* fV 2, D, #WO* Au25añ êE* pBLACK S±ç% ‡F' óNO-BREAK SPACE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð# generated from 'VENDORS/MICSFT/PC/CP857.TXT' with2 } P.py.
c ±#"

import  sÀ ` ÁAPIs

class  ($ . 1):
?Adef á ñe(self,input,errors='strict'):,  /creturno B = , †ing_map)m *m *B 	m   m ¤)ø ±IncrementalÕ$er å  h Ã final=False*  W.Q
?[0]¨  DJ¨  ~  ¨ ö L¨ !@ â ¨  Oª ÑStreamWriter(J,W ¤ 5pasƒ ORead9  	9  ŒFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp857', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # ÕZ  ~0MapA°Tmap =Ïñmake_identity_dict(range(256))
°  Ámap.update({F€0x0080:  0c7, xøLATIN CAPITAL LETTER C WITH ³ 7 "81? +fc? ESMAL= U= D¨ð0x0082: 0x00e9, ð    #  LATIN SMALL LETTER E WITH ACUTE
' €0x0083:  0e2, ; A; ¦CIRCUMFLEX@ 4@ 4@ –DIAERESIS? 5? 0? GGRAVº 6; 5; ˆRING ABO@ 7@ 7@ 	Cú fEDILLA¸ 8= a= 	r79@ b@ 7 a? 8? 7b; f; 	I÷ z  c? e? ù d@ ?131@ 	–DOTLESS Iqe8 ,0cheCAPITAåª¹  fA /A 1 #90B 9» B ö
h"91= +e6= £–IGATURE Aá"923 c3 p 5 Ðf(h Oß  9Ðfu @ f9ÐfO
 
™9Ðf
Uº ÐfŸ	º @ { Î,13†j7+OTL9Ïd6A ù 8 Ñ+dcA ¿ A  ×f
€ WSTROKiÔ%a3} ¥POUND SIGN‚9º,0db £ d À,158> Sàp9¾/15¶
= a¹et
:
·a·dZ ; ¿fV;  .; Å^
ð ACUTE
    0x00a°4: 0x00f1,  ð#  LATIN SMALL LETTER N WITH TILDE
'  3 "a5; d; oCAPITA= 6= ;11ex = Gz GBREVz 7= f= 	µ ; 8; &0b; öINVERTED QUESTION MARKç 92 aª ö REGISTERED SIGN+ a+ c˜ ;NOT$ b$ %bd$ ±VULGAR FRAC †ONE HALFX c4 X 4 vQUARTER7 d7 a¡ì qEXCLAMAp 
ï e5 b  ÿLEFT-POINTING DOUBLE ANGLE QUOTE fE bE ORIGHF  b0F 6259À LF G SHAˆ#b1' 2² lMEDIUM( 2( 3( LDARK& 3& 0N ÒBOX DRAWINGS ‚  2EICALlbHE2524] 7 P AND W@ Mcì ˆAFACUTbM&0c´ Å= ¦CIRCUMFLEX R50c0¿ B 	7GRA�bT%a9= ACOPYò
ýbL6256ƒ	&\^' b6255'A 	à vE2557£ 8 ODOWNu  6255³= /UP;  ƒš;CENbs5� ;YEN:R6251¡	„ —À cH1œ
¿ ¶8c\3; ‡HORIZONTct2º· 	B �1B 
	2Ã š0:
z “?253z F œeóZ	¬×Tac•; ×= •E255aUzÀNGS DOUBLE UðP AND RIGHT
    0x00c9: 0x2554, ÿ #  BOX DRAWINGS DOUBLE DOWN> a> /69> 
Uz ¦HORIZONTAL bA 6A 
 C cC 0C 
�VERTICALÆ dB 5B | e: /6c| G fG 600a…ÕCURRENCY SIGN/"d0) %bap öMASCULINE ORDINAL INDICATOR7 17 a7 _FEMIN6 26 c6 öLATIN CAPITAL LETTER E WITH CIRCUMFLEXx 3B b¯ B 	–DIAERESISA 4A 8A VGRAVE= r5: None;  Û–UNDEFINED% 6b d' ?#  £ Iå GACUTb 7= d = "8B f " À1"	ÀLî �6LEFúd¼0¼: z
7d¸8w ¦FULL BLOCK]›8Ø¬LOWER HALF, …700a
‡ROKEN BAÊq600cµ ¯	g6258è?UPP� ej/d3™OepdÖESMAL8fSHARP íepd.ps N ep/d2µ 
el+f5= 	µ } FTILD"e5Æd; *= ‚b= ZMICROú/e7ÍeN%d7Ã pMULTIPL;IONT <?00dáUä??00dÜ= ®D600d=ÌB ®/fc
àY WITH DIAERESáIS
    0x00ee: 0af, ¦ #  MACRON" f" %b4" ÅACUTE ACCENT( "f0( %ad( ¦SOFT HYPHEO "f1' %b1' çPLUS-MINUS SIG+ r2: None)  œ –UNDEFINEDw 3P ' ö#  VULGAR FRACTION THREE QUARTERû #f4: 6a «#  PILCROW‡ 5( %a7( "SEZ 
¯ 6( f( PDIVISƒ 
) 7) %b8Q vCEDILLAÖ 8# 0# 0DEGÇ 
J 9' aJ wDIAERESã"fa% b˜ —MIDDLE DO¿b& 9r ö SUPERSCRIPT ONE� c+ 3+ o- d- 2- &WO+ Œ625aõ pBLACK S¼€ ’( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (} d'\x00'  ¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXx x 3* 3* 0ENDU 	( 4( 4( pRANSMISj‚ 50 50 UQUIRY$ 6$ 6$ ¢ACKNOWLEDGq ¤ 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$ Çc9& ðHORIZONTAL TABULA²¡ n2 a2 sLINE FE Ÿ b( #Ò 0b& oVERTICV :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETURª ‚ e. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”åDEVICE CONTROL¹J'\x1–1–/ T� / 
›1›/  [¯*x1¤1¤1 EFOUR0 
¤1¤pNEGATIV_‰1±1±ö SYNCHRONOUS IDL
¶1¶Z2e BLOCK” 
Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹àGROUP SEPARATOÀR
    '\x1e'
 ö #  0x001e -> RECORD SEPARATO- f- f- LUNIT+  ( $  X  20+ RSPACEz !" 1" òEXCLAMATION MARK- "- 2- LQUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 1"'"n7& ƒPOSTROPH(M 8' ñLEFT PARENTHESIST -')- 9- ORIGH.  *. a. sASTERISq+% b% GPLUSó ,& c& RCOMMA› -" d" ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{¢DIGIT ZEROK 1' €' #ONˆ2& y& #TWL 3& t& 3HREN 4( t› 3FOUh5' sO 3FIVN 6' q' 2SIXè 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 �L3 1Lf M3 Ðd -> LATIN CAðPITAL LETTER M
    'N'   ù#  0x004e -> LATIN CA3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 Ç 5c0 ãREVERSE SOLIDUÁ]+  , d, ?IGH] ^1 $óCIRCUMFLEX ACCEN‹ _. rOW LINEà `% 6YGRAVEN a) ESMALÑAZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 óŠ	1 K1 l1 ô»	1 L1 m1 ù1  n1 ù1  o1 üÄ p1 7b  q1 r1 s1 Pt1 "u1 v1 w1 À#  0x0077 ->ð LATIN SMALL LETTER W
    'x'   Ï#  0x0078 ->1 X1 y1 91 Y1 z1 a1 Z1 {1 b1 òEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f% >f" UDELET# )c7#  80# ’PCAPIT¤ ”âC WITH CEDILLAµ J\xfc@ 1@ 	ÒU> ”DIAERESIS@ *e9@ 2@ E@ 6ACU¼ *e2< 3< A< “CIRCUMFLE-J\xe4A 4A ½ 0@ 5@ EGRAVy*e5< 6< ‡RING ABOA º7A ¸*ea Yx< bA iA <8@ x@ 
<
Ø8ƒGIù| e| ”õ	µ@ ý Pu0131C Y8«A  ”DOTLESS Iïcr´9 oµ¼ c8ÔB 	:ct9ô}
v6ú #  ü 9ò•IGATURE Aíc4 æ÷ 6 f-9àOç§+xfw àA lfa9à@ 	¤f 9à½  ¦àA }   ›¤ÞpÖã:DOT^d;ßB ý =d9áÐCAPITAL LETTEðR U WITH DIAERESIS
    '\xf8'
 ò #  0x009b -> LATIN SMALL LETTER O@ dSTROKE= *a3= c= ¤POUND SIGN' dd d' d oCAPITAf 
Pu015eh £ e? S¥ sCEDILLA  @ f@ f@ 	ã > 0xe1<  !/a0> A| EACUT *ed< 1< I<  f\/a2< ™	x *fax 3< 
< ð 4< N´ ETILDð d< 5< é>  Hu011è/a6> G| DBREV|  > æ&a7> 	æ<  !xb: ä8< óINVERTED QUESTION MARKU!xa« 3 93 šREGISTERE *ac�a, 9NOT%b,‰±VULGAR FRAC‚ „ONE HALF† bZ �5 tQUARTER8 a©’ñ qEXCLAMAr 	ô bÈ ‰þEFT-POINTING DOUBLE ANGLE QUOTF bF �ORIGHG Au259Å b˜ G E SHA” ( 2· ( „mMEDIUM) s) qLDARK' 0P \áBOX DRAWINGS L…  =CICALsXu2524ˆ X8 “ AND LEFTA !xcï rb]‹cµ > ]> ¥CIRCUMFLEX� 0À C bÞC 5GRA :xa9> dACOPYûIu256Š\	+gd,Au255.ÌrB 	ä  9 7¨ 9 †9 ODOWNw Æ> �> ,UP< +xa¡“:CEN& a5ž „ƒ;YEN@ð10'   #  0x00bf ÿ.-> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 = !UP; RJ < 3< 1< ¦HORIZONTALA (2c} 2A º C 1C 3C �VERTICALÆ (00… 4B | 3| 5: 	| G 0xe3 ƒ6G óLATIN SMALL LETTER A WITH TILDEB+xc< 7< oCAPITA> 	Pu255a| ý8> 	:DOUBLE þ5þ9= ¾=(69| a? | 8Xu2566B bB � D 	ýcD 	ÄÉ 5C dC ~ 	Ae; 	~ H !xa‰BfH ÔCURRENCY SIGN0bð* dïôMASCULINE ORDINAL INDICATOR8 a8 ë_FEMIN7 
c7 áÛŸEÝ¤CIRCUMFLEXz  cbä² áC 	•DIAERESISB 8B áB 	DGRAVbPufffe@ $då•UNDEFINEDd d$ ¦ Äé Ié DACUTd !xcb > Æ> ' f� Ëå C ' 
)é ÐG�
E0ÈdÌ; ‰A8y È£FULL BLOCKcAu258ç  «©LOWER HALF- !xaR•…ROKEN BA×c· ' �6		8258údw?UPP’ dªezk O" dße€> $ÀETTER SHARP ÀS
    '\xd4'
 õ% #  0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEXC 2C 3C TGRAVE> *f5> 4> LSMAL ETILD< d< 5< ½ 	> b> 6> £MICRO SIGN¡ Pufffe£ "7' “UNDEFINED& 0xd7$  H8& èMULTIPLICATIONV :xda0 90 xUxFACUTù b> a> ¶ 9C bC 	¶*ec> c> 	¶I½ 	< *ff< d< Y< …DIAERESI³a@ e@ TMACRO´+xbÖf# Bt ACCENT·)adŒ  f0) ¦SOFT HYPHEQ 1( 1( ¨PLUS-MINUSÛ1fS1bU1f6±VULGAR FRAC2ÕTHREE QUARTER*b6� 3xPILCROWŠ *xa•f "SE\ ä+xf) \DIVIS¸*b8| tCEDILLAU*b0$ 0DEGÌ v aL ïbœ ì•MIDDLE DOÊbÐfÐåSUPERSCRIPT ON?*b3¡ ¾, xÏ 
àf°	. #WO, Au25aý -fœpBLACK SÇƒ ' ÿ¢óNO-BREAK SPACE
)

### Encoding Map

e �_map = {z  »100:Ã400,ÒFNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXuu 3) 3) 0ENDS 
' 4' 4' pRANSMISi 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGf  7' 7' (BE8  8  2ACK€ GE 9% 9% pHORIZON@TABU¹~1 a1 a1 sLINE FE1% b% b% ŸVERTICAL T c/ c/ KFORMT d% d% ðCARRIAGE RETURN
    0x€000e: 0x  ,  Ð#  SHIFT OUT
  f% f% %IN$ "10$ %10$ öDATA LINK ESCAPE, 1, 1, ÷EVICE CONTROL ON. 2. 2. 6TWO\ 3. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) —SUBSTITUT¦ b& b& ßc" c" ×FILE SEPARATONd* d* _GROUP+ ©%1e+ oRECORD, °1°OUNIT*  2¶2¶FSPACî 2«2«€EXCLAMATŒ6MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ•AMPERSAND2…2…—APOSTROPHv2vöLEFT PARENTHESISR €2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k–DIGIT ZER¿3p3p& 3i3i% 	3d3d% 	 3d3d— 	÷3c3cM 6FIV3a3a& 5SIX+3a3a% 6EVEü3b3b' E<N ]3]' 'NIC3V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i úðERCIAL AT
    0x0041 : 0x0041,  ð#  LATIN CAPITAL LETTER A
 * 22 22 B2 32 32 C2 42 42 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12  Q2  5 R2  5 S2  5 T2  5 U2  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷OSMAL 6õ6õ	0 6ó6ó	0 6ñ6ñ	0 6ï6ï	0 í6í	0 6ë6ë	0 	6é6é	0 6ç6ç	0 6å6å	0 À06b: 0x006b,  ð	#  LATIN SMALL LETTER K
 ‚0x006c:  ,  0 L0 d0 d0 	M0 e0 e0 	N0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENþ%7c. ÖVERTICAL LINEW ÷7÷ORIGHX ö7öGTILDP ç7çVDELET" aÙf" ×NO-BREAK SPAC* Óaœ  INÇ öED EXCLAMATION MARøaØb5 †CENT SIG�aÍ9[POUND& Ãcª ‹CURRENCY) ¼b;YEN$ °d˜ –BROKEN BAfa¦f1SECæ 
Á žfn†DIAERESIƒa“bÃBCOPYà
O �d=÷
FEMININE ORDINAL INDICATO­ “a÷ ÿLEFT-POINTING DOUBLE ANGLE QUOT°ªa,NO¯¥f§SOFT HYPHEÖ�aœREGISTEREÛ§e» VMACROM b§=jDEGREE×b¤f:«PLUS-MINUS+ šfæSUPERSCRIPT TWýb f 	+ 6HRE'b§e§€ACUTE ACúëb¦e2[MICRO¦ ¨f¸{PILCROW( ª¸–MIDDLE DOˆb¨vvCEDILLA— ¦fÙì O­À 0x00ba: 0x0P0d0,  ð#  MASCULINE ORDINAL INDICATOR
# €0x00bb:  %af7 öRIGHT-POINTING DOUBLE ANGLE QUOTATION MARKF cF cF ±VULGAR FRAC0  ON> GARTE} d7 b7 
FHALFk e4 /f34 ETHREm S: f: %a8: ÑINVERTED QUES§ 	× "c02 %b72 õLATIN CAPITAL LETTER A WITH GRAVEo #c1= 5= GACUT= 2= 6= ¦CIRCUMFLEX 3B c¼ GTILD 4= /8e †DIAERESIl#c5A W:	Ri8ABO?6B /92ƒ —IGATURE A¸ 75 8w C±vCEDILLA48? /d4t ðE? ð9= 9| = ða= dî 	z ðÉdû  ³ ÄdôIý Êd°= ý Ód«= ý ÛdÛý B ý d­a­Ný 
.d­e{O= 
7d¨e7= 
:d¨e7= : d©eù B ù ¤90= w °e¸pMULTIPL§ gESIGN d /9dp VSTROKd¡en%U§¡eë = §œ/ea¸ = §�9B ÀTAL LETTER Uñ WITH DIAERESIS
    0x00df: 0e1, ö #  LATIN SMALL LETTER SHARP 6 "e06 /856 	Au UGRAVEq "e1; /a0; GACUT; 2; /83; ¦CIRCUMFLEX{ 3@ /c6@ GTILD{ 4; /84; f#e5? z ˆRING ABO56@ 9¦—IGATURE A² 73 /87² 	C£vCEDILLA*8= a= 	E= à9; 2; àa; 8; àb@ 9@ ¥ c? /ec? 	Iõ d; a F; õ e; 8v õ Á/8b¶ õ f�Ù
Nõ 
f�9
O; 
%fŠa%
; 
0fŠ9
; 0 f‹eñ 
@ ñ †; k ’fÕDIVISION SIGN~f~9Ó
£ VSTROK÷f9÷
U•aZ
; •z9Û F ; •{8@
@ Z /ed	Yõ ? #11ƒa¾ eCAPITAGA 6BRE›#11| aq
; 3F9ðx 8:DOT#13½8ø ÀLETTER DOTLEðSS I
    0x015e: @09e, ö #  LATIN CAPITAL LETTER S WITH CEDILLA? f? f? OSMAL= B2500= %c4= óBOX DRAWINGS LIGHT HORIZONTALv B25029 /b39 	hVERTIC7 c7 /da7 	 DOWN AND R t 1­ bê ­  = FLEFT< 4y /c0y 	/UPw 8; /d9; 
u î c%{  2¶ bŸ
fA 	� 2� 2» 	2è 3‚ /c1B 	8@ ‚ 5@ 		Â F  5ú/cdF oDOUBLE¨"51½bq: � 05ø õ8 ;
ª#57v b° 
> 	µ"5a= /c8= 
ty d< /bc< 	w 6d; *m
} #63} 4	B 
ƒ 6A c7* #69C ð=A ±Ž	eù	Å G  8Nd¬õUPPER HALF BLOCKl8ldz?LOW, �#KFULLR 9öîÊUSHADEy 9ÅÝ{MEDIUM ( ÙGKDARK& aó f:ðBLACK SQUARE
}
""" Python Character Mapping Codec for CP858, modified from cp850.
D  

import c3 cs

###? ²APIs

class ($ .^ 1):
ü `def en ñ(self,input,errors='strict'):,  “creturno “.charmap_B = , †ing_map)m ðdecode(self,inpuót,errors='strict'):
  ð	return codecs.charmap_de T(inpu= , ðing_table)

class IncrementalEn6  r( >cs. x Qdef e, r(self, h Ã final=False*  ¥ ¢ @ :  F .ä ,  § map)[0]¨  DÞ ¨  ~  ¨ ö e¨ '@ ¨   ¨ Oª àStreamWriter(C™,R ¤ Dpassã  ORead9  	9 2###‹ðings module API

ý Ãgetregentry(7 
Žž UInfo(QÕname='cp858', –!e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # 0)

IZ ping MapA0codáTmap =bñmake_identity_dict(range(256))
° 5 ‘.update({F€0x0080:  0c7,ö #  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 4@ º  5? 0? GGRAVº 6; 5; ˆRING ABO@ 7@ ³	t±8= a} 	r79@ b@ 7 a? 8? 7b; f; 	Iñz  c? e? ù d@ ê
 º e; ckd­¼  fA 2A 4 9çiB ù
k9åÀ0e6,     #  ñLATIN SMALL LIGATURE AE
    0x0092: 0c6, B #  3 oCAPITA5 35 +f45 h öETTER O WITH CIRCUMFLEXu 4@ u @ –DIAERESIS? 5? 2 GGRAVï 6; b; 	Uº 7@ 9@ { 8; f; 	Y{ õ  9? d4©	vA  aA c€ A ý A  bA +f8A ¶WSTROKxc< %a3< ¦POUND SIGNÙd& db £ Zd e> 7d ëMULTIPLICATIONm f/ /19F
F�EHOOK§ !a0: 50e1i 4		A: FACUT#a1; d; 	I; ªfCv  v °av 	ù; «ì 
N± GTILDì §d; Î= ©a³ ðFEMININE ORDINAL INDÚ&ORšŸb6 oMASCUL7 ›b›ÑINVERTED QUES=7MARŽ%aeR›REGISTEREÕaxax:NOTŒa[b±VULGAR FRAC †ONE HALFì SbX 4 gQUARTE#da–ì bEXCLAM,
ï [a7ÿEFT-POINTING DOUBLE ANGLE QUOTE q&0bE ORIGHF b}6259À LF G SHA}bi'25ÞlMEDIUM( V6259VLDARK& A6250,ÀBOX DRAWINGSZ0HT 2EICAL£b=6252(7 – AND LEFT@ Bcì ÐBkÀ  0x00b6: 0x`00c2,  ð#  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
. €0x00b7:  /c0B VGRAVE= 8= %a9= æCOPYRIGHT SIGN* 9* E2563* öBOX DRAWINGS DOUBLE VERTICAL AND LEFTA aA /51A 8 b8 78 
ODOWNu  c= d= 
/UP;  d; 600aš<CENe% 5` ;YEN:f$ 6251¡	:LmÀ #c0< 4` <  ¿ ¶8"c1; 3; ¦HORIZONTAL@ 2@ /2c{ 	· B 3B 1B 
	2Ã 4A 0:
z 59 3z F 6F 600eóœLSMALšFTILDXc•; ×= •O255azkö§5ö< ·q¤6	o> z 3­/66» 
 C ³6õ„ 7	º?255B | Ï?2568| G ò600a…ŠCURRENCYdß600fª b 5ETH–dÖ<00d2 Y	4 Ê600cPf 4 ddÊE00cb×B 	–DIAERESIS· ÊO00c8A 
¥dÎ&0a–KEUROK­cê£ Iå FACUT¯d¯eŸ = † d´O00cfB ð DIAERESIS
    0ð x00d9: 0x2518,  ð#  BOX DRAWINGS LIGHT UP AND LEFT
& 0: a: /0c: 	ADOWN< RI = b= 8w ¦FULL BLOCK& c& 4c ¬LOWER HALF, d, E00a6, ¦BROKEN BARR e& cµ öLATIN CAPITAL LETTER I WITH GRAVE= f= E2580c ?UPP�  e0, E00d3, i Oi FACUTi #e1= f= ESMAL¤ uSHARP SŸ #e26 .Ü s ¦CIRCUMFLEXB 3B 2x B 
"e4= +f5= 	µ ; GTILDð 5; d; x = 6= b= ¦MICRO SIGNÛ 7& /fež 	GTHOR4 84 d4 — 6 RK00daj 6 UúUO00db= ÄZ ÙB ÄqK00fd= 	ÄYº €d; ÷ = —añWMACROŒ|600bÝ4f ACCEN–fxa‡ ¦SOFT HYPHEO fb%b1é ªPLUS-MINUS:fWE2017+ æDOUBLE LOW LINÈf@b1öVULGAR FRACTION THREE QUARTER¼f=b¾{PILCROW� *a� "SEZ 	ïff( PDIVISƒ 
) b‰uCEDILLA;fb÷0DEGÇ 
J øaJ ‡DIAERESIè àb˜ —MIDDLE DOÅÄ%b9sØSUPERSCRIPT Os²bh+ oÊ ¤bà	- &WO+ ’625aõ pBLACK S¼ó˜( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (} `'\x00'e@ #  i¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- À02 -> START ðOF TEXT
    '\x03'
 ü #  0x0003 -> END ( 4( 4( µRANSMISSIONX 50 50 UQUIRY$ 6$ 6$ µACKNOWLEDGE( 7( •7 -> BELL! 8! 8! tACKSPACG t$  ë 9& öHORIZONTAL TABULATÅ n2 a2 •LINE FEED~ b( Cb& oVERTICV :x0c0 c0 HFORMV r$ ® d& æCARRIAGE RETURme. ‚ e, †SHIFT OUëf& f& IK )10%  10% ô DATA LINK ESCAPR:x11- 1- öEVICE CONTROL ON/ 2/ 2/  4TWOX1›1›D^ FTHRE` 
¤1¤1 EFOURa 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCEî*19GÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSAN¬1"'"ì•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >b3{“DIGIT ZERÝ8' €' 2/& y& )&& t&  À    '4'     ð   #  0x0034 -> DIGIT FOUR
    '5'   ' 5' 2IVE' 6' 6' 2SIX& 7& 7& BEVEN( 8( 8( REIGHT( 9( 9( 3NIN� :' a' CCOLOq ;" b" GSEMI& <& c& ÓLESS-THAN SIGQ =+ d+ gEQUALS( >( e( |GREATERV ?. f. ÒQUESTION MARK@*  40* ÃCOMMERCIAL ADA* 1* òLATIN CAPITAL LETTER A] B3 23 B3 C3 33 C3 D3 ¡™ D3 E3 ­3 F3 ¹3 Ff G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 [L3 1Lf M3 f M3 N3 3 tO3 3 Of P3 5'3 P3 Q3 0Q3 R3 0wS3 0Sf T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0\Y3 0Yf Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 ?5-ãREVERSE SOLIDUÁ]+ ’5&Rð] ^1 $óCIRCUMFLEX ACCEN‹ _. À#  0x005f ->ð LOW LINE
    '`'   ò
#  0x0060 -> GRAVE ACCENT) a) 1) òLATIN SMALL LETTER A1 b1 21 B1 c1 31 C1 d1 41 D1 e1 51 f1 61 Fb g1 71 G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 7ß P1 q1 Q1 r1 R1 s1 S1 t1 Ôu1 Ub v1 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ‡VERTICAL|}* ORIGHZ ~0 CTILD°3\x7³Î7÷UDELET# "c7H # 8éPCAPIT¤ ÊÓC WITH CEDILL×3\xf©@ øU> ƒDIAERESI¥J\xe9€ E@ 6ACU¼ *e2< A< “CIRCUMFLE-J\xe4A "A ½ 0@ 1@ HGJ\xe5< << •RING ABOVºeºL¸À   '\xea'   ð0  #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'  A 9A •DIAERESIS@ 8@ a@ UGRAVE< f< b< I½ | e@ c@ ý  cA dA 	½ *c4< e< eCAPITA|A¿ *c5B fB †RING ABOB)c9C /90C FACUT€6> 1> =•IGATURE A4 c4 24 ÷ 6 f-&936 j §O+ªfw 4A +*f2ë 5@ 	êf#/96< U½ ¦7A 
} 
$9áY} ù d9à°	|B 
%9âB B f$9èþUSTROKq*a3ºå¤POUND SIGNLdd Ë¦ f *d7f ÎèMULTIPLICATIONo Au019R79¼	ÑF—DHOOKª )e1k a´	; 7
²d< ²Ì2	< fIaº	x  
< ax À
< ð »N+ETILDýd< ·Ö> a¶ ¹ðFEMININE ORDINAL INDâ$OR¡b7 ¯oMASCUL8 
«a«ÑINVERTED QUESG5MARaÂažšREGISTEREâaˆÀaa -> NOT SIÐGN
    '\xbd'
 õ #  0x00ab -> VULGAR FRACTION ONE HALF5 c5 c5 tQUARTER8 *a18 d8 ñINVERTED EXCLAMAr EMARK6 b6 e6 þLEFT-POINTING DOUBLE ANGLE QUOTF bF fF ORIGHG Au259Å 0 b0G LG c SHADEµ  ( 2· ( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS …  LFICALˆ (24_ 48 P AND ]A !xcï  ! b5A ôLATIN CAPITAL LETTER A WITH ACUT!xcµ > 6> ¥CIRCUMFLEX� 0À C 7C EGRAV� *a9> 8> ACOPYû5 SIIu256Š9+ 	cgd,Au255.õaB ä  9 7¨ 9 †{ ODOWNw Æ> �> ,UP< +xa¡“HCENT0xa5ž „ƒ8YEN% Au251«‡ b	‡ £Ä 1¨cX=  Ã ¾>3< l< ‰HORIZONT%Òº c„A  º C 1C  ‰Æ 0?cª| 3| £¿  	¸G !xeþåc¬LSMALè5TILï+xc< ¥>  ÿaa€¥	Á zþ5þ·¾w6#| ´| 8 86¾ ½D 	ýÃ	ÄÉ 5C ÊEÀS DOUBLE HORù:IZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIH 0xa4F H fH ÓCURRENCY SIGNr 9xf0*  d0* ôLATIN SMALL LETTER ETH3 d3 13 oCAPITA5 *cah 25 ô WITH CIRCUMFLEXx *cbC 3C •DIAERESISB 8B 4B SGRAVE> Hu20a� d5> IEUROQ*cdd 6& QIé DACUTd :xce> 7> ' fC 8C 'Au251)† d9B 	†�LIGHT UP ELEFT$)50$a; ADOWN= RJ > 8y b> §FULL BLOCK' à  c' ©LOWER HALF- :xa6d- £BROKEN BART !xc· 2dz·	
!58’ p?UPP’ )d3’ es"O" dße~	±eSHARP ûd2à e€u Y*d2¸ €C #:xf5> |	¸ < TTILDE�d< z�> b> ’;MIC¹f{e{	¡ ETHOR?d5 m
7 
ebÑ U
	ee> 	Ì 9ŽjC 	
Ì
äe�5Y½ < �z > aþ§UMACRO“bêŒed ACCEN¬*xaŠ fˆ¦SOFT HYPHEQ 1,fr¨PLUS-MINUSþPu2017. 	fg´ðLOW LINE
    '\xbe' ð!    #  0x00f3 -> VULGAR FRACTION THREE QUARTERS
0 `'\xb6'
 ; 4; ÄPILCROW SIGN) *a7) 5) "SE\ ) f) 6) PDIVIS† * *b8S 7* tCEDILLAw *b0$ 8$ 0DEGÌ L aL 9( vIAERESIî œ a& ¥MIDDLE DOTu 9u b' õ SUPERSCRIPT ONE, 3, c, x. 2. d. #WO, Au25aý Öe, pBLACK SÇƒ ' ÿf) óNO-BREAK SPACE
)

### Encoding Map

e �_map = {z  B100:J400,FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXuu 3) 3) 0ENDS 
' 4' 4' pRANSMISi 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGf  7' 7' (BE8  8  2ACK€ GE 9% 9% ðHORIZONTAL TABULA¯� a1 a1 –LINE FEED% b% b% oVERTICT c/ c/ KFORMT d% d% âCARRIAGE RETURÕ e+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„åDEVICE CONTROL¦ £ 1†1†. Tz. ‹1‹.  N€1”1”0 FFOUR/ ”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* Ð3: 0x0023,   ó  #  NUMBER SIGN
    0x0024: ,  ' \DOLLA' 5' 5' {PERCENTO 6( 6( –AMPERSANDt 7% 7% –POSTROPHE& 8& 8& öLEFT PARENTHESIS, 9, 9, ORIGH- a- a- †ASTERISKQ b$ b$ KPLUSí c% c% VCOMMAF d! d! ·HYPHEN-MINU¿ e( e( –FULL STOPM f% f% WSOLIDH "30# %30# ¥DIGIT ZEROI #31& 1& &ON~#32% 2% 'TWJ 3% 3% 7HREL d+34' FFOUR— c3c½ 7FIVL a3a& 6SIXK a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cÆQUESTION MAR4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 ±442 552 Õ5 5 QÈ 5 5 àR
    0x0053: €0x0053,  ð#  LATIN CAPITAL LETTER S
 * 24:  2 T2 52 52 U2 62 62 V2 72 72 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 ÷EFT SQUARE BRACKE[c/ c/ çREVERSE SOLIDU¸d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINEÛ "60$ %60$ \GRAVEL #61( 1( “ESMAL‘AX 20 20 	B0 30 ó	` C0 ñ/64` 	D0 ï6ï	` í6í	0 F` ë6ë	0 G0 é6é	0 H0 ç6ç	0 I0 å6å	0 J0 ã6ãs	0 K0 ä6ä L0 é6é0  M0 é6é0  N0 ì6ìÀ O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
97 7 
7 7 
í7 7 
ë7 7 
é7 7 
ç7 7 
å7 7 
ã7 7  ã]CURLYâ7þ7þ`VERTICœ_7÷7÷RàX À07e: 0x007e,  �#  TILDE
 ‚0x007f:  , – #  DELET" "a0" %ff" ×NO-BREAK SPAC* 1* %ad* õ
INVERTED EXCLAMATION MARK� "a25 b5 –CENT SIGN% 3% %9cZ [POUND& 4& cª ‹CURRENCY) 5) %beO ;YEN$ 6$ d˜ ¦BROKEN BAR™ 7& %f5J 1SECæ 
Á 8( 9( –DIAERESISM 9% %b8% ŒCOPYRIGHa* %a6* ÷
FEMININE ORDINAL INDICATO­ b6 ÷ ÿLEFT-POINTING DOUBLE ANGLE QUOT°cE a{ ,NOŸ d$ %f0$ §SOFT HYPHEÖe' aœREGISTEREÛ§e» VMACROM b§=jDEGREE×b¤%f1› «PLUS-MINUS+ šfõ SUPERSCRIPT TWOºb f 	+ 6HRE'b§e§€ACUTE ACúU ¦eå[MICRO¦ ¨&f4Ñ kILCROW( ª¸¦MIDDLE DOTt ¨7N vCEDILLA# ¦%fb# ì 'ONê §N oMASCUL¨b¨!©b©”¢VULGAR FRA£ ONçFARTE%b¼aß 7 FHALFÉ%f34 T1 QUm óbØa¶3AQUESJ	0cèbTöLATIN CAPITAL LETTER A WITH GRAV‘cþb¯= 	—æ cb�= 	¦CIRCUMFLEXB 'c¼ 
ªc78 	_cP8WA 	R8ABO?l%92èB —IGATURE Aty85 ±C±oc’dà? E? 
ðÀc9: 0x0090, ð    #  LATIN CAPITAL LETTER E WITH ACUTE
) €0x00ca:  0d2, = ¦CIRCUMFLEXB bB 3B –DIAERESISA cA eA IÀ GGRAVÀ d= 6= ý e= 7= ý fB 8B ý #d0A 1A 5ETH1"d14 /a54 N1FTILD1"d2= e¯O= 
n#d3= 0z = 
n#d4= k= n #d5B ù B ù 6= /99¼ « 7A ¨öMULTIPLICATION SIGN¦8/ dp WSTROK§9> /eb> U§Õeë = §Ð/eaz §Ñ9B j Õe;Yý À Õe“GTHOR®ÉeˆESMALCfSHARP »e¾8‘	6 A§ 
KeÅK; 
â eÃ8Ã;   eÆc4@ 
EeÄ+84; ÙeÁ8z ‡RING ABOîeÄ¦–IGATURE AIe¶8ä	² C£uCEDILLAÄeÄ8Ê	= YàÁ8î; à¿8Â; àCIRCUMFLEX
   � 0x00eb: @89,  ð#  LATIN SMALL LETTER E WITH DIAERESIS
+ ? c? d? 	I? VGRAVE; d; /a1; GACUT; e; /8c; ¦CIRCUMFLEX{ f@ b@ õ "f0? /d0? 	5ETHq "f12 /a42 	N'FTILDì "f2; /95; 	O; 
b"f3; /a2; 
b"f4; /93; b "f5@ eñ 
¶ ñ 6; 9; � 7? %f6º ÖDIVISION SIGN”8) 9
£ WSTROK•9< 7e 6 U•a; aZ
; •¬9Û v •­r
{ Z ±ev
Yõ º ±e0
GTHOR ¥/98d	o ® 320aí d8IEURO$19]fd 	FÓ CHOOK>4201g\äDOUBLE LOW LIN-3250/cÑôBOX DRAWINGS LIGHT HORIZONTALd #50ž b+9  hVERTIC7 ú aÕ 7   DOWN AND R t 1­ b= 	FLEFT< 5c<  /UPw �d‡; 
u î c%{  2¶ bŸ
fA 	� 2� 
»  oè 3‚ c˜B  8@ ‚ ë@  Â ÀCAL AND HORIðZONTAL
    0x2550: 0x00cd, ü #  BOX DRAWINGS DOUBLE HORI: 1: /ba: 
hVERTICr 48 /c98 
æDOWN AND RIGHT° 7> /bb> 7LEF= a= /c8= 
/UPy d< /bc< 	w 6d; *}  #63} 4	B 
ƒ 6A c7ð #69C ð=A cA eB
	Å G  8N%dfG õUPPER HALF BLOCK.8ldz?LOW, 8Ÿ d#KFULLR 9ö0~ L¡e SHADEy "92M %b1' lMEDIUM( Ù2( KDARK& aó f:ðXLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with genc; P.py.
c À#"

import c cs

###` ²APIs

class ($ . 1):
Qdef eW ñ(self,input,errors='strict'):,  ‘creturno “.charmap_B = , †ing_map)m  de‡ m )B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö eL¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp860', d !e=0 2().     id: .r=]
/ Àementaldecodó	er=IncrementalDecoder,
  ástreamreader=S R # Ewrit# W # q)

### Z  ing Map

dh  ing_map = u ùcs.make_identity_dict(range(256))5 ‘.update({ª €0x0080:  1c7,¼ ö#  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 3@ GTILD{ 5; 0; GGRAV; 6; +c1; o¸ ó 7= e¬	mª8= az 	= k09@ c@ º B aB /e8‚ 7b; +cd; } Iï7c= /d4= O= ü dB eæ
} º e; cgº ñif= ä= º  9ßaB ¶
99Ýcè= ¼ 
ù 9Ûcî= z = Ýf³	­±9Ý+f5ó@ 
t9Ýft; ¶ Ýd#mÝfª	x ; x ÛcŸk¡9Ød+= m-Ódz · 9Ùan•CENT SIGN«9ÁaD[POUND& ¥dAÉ Œ C§620a[gPESETAd Àx009f: 0x00d03,  ð#  LATIN CAPITAL LETTER O WITH ACUTE
) €0x00a0:  +e1= ESMAL; A; 1; d; 	I; 2; f³ 	v ± 3; av 	Uv 4; ì 
N; GTILD'5; d; d= 6= a³ öFEMININE ORDINAL INDICATORš76 b6 oMASCUL7 87 f öINVERTED QUESTION MARKi 92 %d22 @	GGRAVa= %ac= †NOT SIGNa b$ b)±VULGAR FRAC‘ †ONE HALF4 c4 X 4 gQUARTE5d7 a¨þ qEXCLAMAp 
e5 bÄ ÿLEFT-POINTING DOUBLE ANGLE QUOTE fE bE ORIGHF b�6259À LF G SHA�b{6259³lMEDIUM( h6259hLDARK& S6250N ÒBOX DRAWINGS ‚  DEICAL£bOE252477 P AND W@ T6256ì 	@ q 1 SIyA �H _?256¿ H Ç‰ X H qO2556Ð CDOWN| Í D ~O2555D Ð �6256µ	Ç × É ”?255YA 8 ¨O2557½ u ±6255å¶ %UP<x µ6255ì	; /UPwÂ6255}B u¿O2510ü û cµ1	
ú û cÉ3; ‡HORIZONT„Ðc2: 0x252c,  ð2   #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,  B �VERTICALF RU A 4A /00A 	z 59 /3c9 		z F 6F /5eF @ fSINGLEÁ v DOUBLEÈ 7I fI 8 I Z I 8I aI @ &UPC < 9< 4< 
Ñ‹a> /69> 
z MbA 6A 
 C cC þ — —Æ dB 5B | e: 6R| G fG 72UP óÁA R#d0H 8H ’  H ^ #d1H /WN’ 2J 5’ Ù” 75k#UP$á£ × 95	C œ C C/52Ð E B3E y Š V Š >/6bE ðI òC6CN † — N d œ U1i%FLEFT: Q0Q: 6 Ãç= M8w ¦FULL BLOCK& 08Ý¬LOWER HALF, 8�  ¯ + 9Ež , ð8, ?UPPƒ eÔE03b1èõ	GREEK SMALL LETTER ALPHAã eÀ600dZZLATIN4 vSHARP S6 ¬6039—j cCAPITAl ÀR GAMMA
    ð0x00e3: 0x03c0,  ð
#  GREEK SMALL LETTER PI
 1 41 +a31 eCAPITA3 VSIGMA6 56 c6 	g 4 64 50b5j ¦MICRO SIGNZ 7& 53c4& Á  6TAU2 82 +a62 Â 'PHö 94 /984 GTHETö a6 /a96 GOMEG6 b6 bÒ 
8DELj c4 E221ej †INFINITYø d$ <03cø 	„	ö e2 ‚\ gEPSILO’f6 6222ö §INTERSECTI( "f0( &61´ µDENTICAL TO¸  f1( 600b( ªPLUS-MINUS f2+ 62263ûGREATER-THAN OR EQU_ 6226oOLESS1 62323�TOP HALF é FGRAL½ ù6232½ oBOTTOM0 õ%f7‹DIVISIONë ø6224’oALMOSTâ  ñ&0b±  DEÉR ä6221¸ö BULLET OPERATORÖ Ù&0b¦ ¦MIDDLE DOT& ÉE221aÌ ˜SQUARE RO' ¼607f' úUPERSCRIPT LATIN�lfÔ?0b2< 'TWGÍ625abBLACK ” ¶ ¿'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'@0 # m¢000 -> NUL( ! 1! 1! õSTART OF HEADINGN 2- 2- 2TEXƒ W 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 BQUIRp | 6$ 6$ µACKNOWLEDGEL 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& pHORIZON—@TABUK�<'\n2 a2 •LINE FEEDŸ b( »b& 3VER§V :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETURå Ie. ‚ e, †SHIFT OUëf& f& IK à10'     #  0x0ð010 -> DATA LINK ESCAPE
    '\x11'
 ¡ #  0x0011- öEVICE CONTROL ON/ 2/ 2/  5TWO^ 3/ 3/ 6HRE` 41 41  EFOURa 50 50 öNEGATIVE ACKNOWLEDGa 61 ö6 -> SYNCHRONOUS IDL- 7- 7- õ
END OF TRANSMISSION BLOCK” 86 86 eCANCEL# 9# 9# Y eMEDIUM* a* a* –SUBSTITUTª b' b' êc# c# ÖFILE SEPARATOVd+ d+ _GROUP,  e, e, oRECORD-  f- f- LUNIT+  ( $  ™2ÆCSPACô !" »€EXCLAMAT–3MAR•"- ¹LQUOT+ #+ µ²NUMBER SIGN›$( ¬HOLLA( %( ¤wPERCENTQ &) œ‘AMPERSANDw 1"'"¯•“APOSTROPH(M †ñLEFT PARENTHESIST -')- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{“DIGIT ZERÝ8‰3€' 2/& y& )&& t&  ( t› ' sO 3FIV$
' q' 2SIX3& q& 3EVEõ( r( EKP ú( m( $NIk:†fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |ðLATIN CAPITAL LETTER �A
    'B'   ò#  0x0042 -> LATIN CAPITAL LETTER B3 C3 33 C3 D3 43 D3 E3 53 E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 a3 J3 K3 b3 K3 L3 c3 L3 M3 d3 M3 N3 e3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 0R3 S3 0S3 T3 0T3 U3 0U3 V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 +5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. cOW LIN`% 6YGRAVEN a) ESMAL5b1 	1 3c1 	1 1d1 	1 /e1 ÿ	1 f1 ý	1 +g1 û	1 )h1 ù	1 'i1 ÷	1 %j1 õ	1 #À'k'        #ð  0x006b -> LATIN SMALL LETTER K
    'l'   #1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 41 T1 u1 51 U1 v1 61 V1 w1 71 W1 x1 81 X1 y1 91 Y1 z1 a1 Z1 {1 óEFT CURLY BRACKEU|/ ÒVERTICAL LINEY }* ORIGHZ ~0 CTILDR B\x7f% Š7÷UDELET# )c7# 8éPCAPIT¤ àâC WITH CEDILLAµ J\xfc@ øU> ƒDIAERESI¥J\xe9@ E@ 6ACU¼ *e2< A< “CIRCUMFLE-J\xe3A "A 	\*e0< -< FGRAVu1< 8u> 
÷ ³E±*ea| Rq5cA b½ C *e8„ tA 
<d< � I÷	<*d4> ŽÍ> O>  eò§C 	 
½ q³<  ù	scðÏ> 	½ co9ï|À ACUTE
    '`\xc0'  ð #  0x0091 -> LATIN CAPITAL LETTER A WITH GRAVE
3 Z'\xc8> 2> E>  *f4> 3> ESMALz O< ¤CIRCUMFLEX *f5A 4A ETILD» *f2< 5< 	÷ *da< 6< 5U» FACUTz 9> 7> 	÷ < 	z *cc< 8< z Iz 	> d09> s	2d| a> º ”DIAERESIS°atbB •CENT SIGN& 3ä c& YPOUND' dGd' º� Pu20a7g øe> jPESETAf � f( f 3	ë e1d #  f &a0> 	ë\
< d< š	< é	< f¶ a˜	< ´ fÝa–V
x ð ‘N�
_< ‘Û> a¶ “ôFEMININE ORDINAL INDICATORlb7 ŒoMASCUL8 f�ˆôINVERTED QUESTION MARKk dýa}°*xa}a}*NO:b3`±VULGAR FRAC” „ONE HALF˜ bZ o5 eQUARTE;a°€qEXCLAMAr *ab9xþLEFT-POINTING DOUBLE ANGLE QUOTF bF –ORIGHG Au259Å ŸbŸ G E SHA, ( ½( ‹mMEDIUM) z) xLDARK' 0P cáBOX DRAWINGS L…  OCICAL«Au2523_ _8 P AND ]A à61'   #  0x00bÿ<5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 I 9 I Y I (56I 7’ CDOWN~ E 5E 8E z E š Š (63E 9E   #B (51B aB 9 79 b9 w  d> c> %UPü z c< d< /UP}bC eC {(10C fC @LIGH„/WNÃ  '14= /c0= þ RJ ÿ 3< 1< ¦HORIZONTALA 2@/c2A ¹C 1C 3C š  Æ 0?/c4B | 3| y	| G (5eƒ	Ä ]P(5fJ ‹ ¾J [ J aJ Ï5Øƒ | (69| 	| R6cD 	SZ 5C †~ 	[; 	~ H c(UP­B ['68•d(
ëI Z6d55  K õ )¹d?K 5 K a K 5tdGß ÀLE AND RIGHTó$ SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP3 ù  AND RIGHT DOUBD 2D 5D ODOWNF 3F 6F { Œ Ð (6bF 7F ƒVERTICALÅ J £HORIZONTAL¦ (6aO 8O ˆ O ¯ O 1n9O L`!UPH FLEFT; (0cŠ a; kª> 8y b> §FULL BLOCK' 4e c' ­LOWER HALF- 	’ d- ?EFT, (90Y e, LY 	- f- ?UPP† G03b1Z  e0- ó	GREEK SMALL LETTER ALPHAè 0xdf3 ö e15 ZLATIN5 sSHARP S7 Hu039£ e27 l @CAPI?n DGAMMn Hu03cÐ &e37 	£ &PIi ai –i 9SIGi 	7 ‰7 	i 5 :xb5x¦MICRO SIGN“ ceY\  6TAU3  a6\ \e=3 /'PHû 9ªe#5 GTHETd(a9l 7 GOMEG7 bÖ 7 	26DELl H221el &†INFINITYý cý Z  	û Œ0%3  eEPSILOš9222û /¨INTERSECTI) 6+f+BIDEN#TO¼ xRf©PLUS-MINUS1226Aµ fõATER-THAN OR EQUAL a Hu226wfOLESS2 (32Df2TOPl î CGRALÁ Iu232ê 	oBOTTOM1 0xf7Ñò pDIVISIOº8224 flALMOSTç !xb³ V  DEÓD1Âfôó BULLET OPERATORÛ +xbª é–MIDDLE DO/&21¹À00fb -> SQUAò6RE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
= 0xb2; = d= 5TWOi 05a0. i e, ÃBLACK SQUARE) x' U f) óNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  Õ 100:Ý 000,¹  ì FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXXu 3) 3) 0ENDS 
' 4' 4' ¢RANSMISSIOqV 5/ 5/ VQUIRY¢ 6# 6# ¢ACKNOWLEDGfJ 7' 7' (BE8  8  2ACK€ GE 9% 9% ð HORIZONTAL TABU?À a1 a1 –LINE FEEDÂ b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETURde+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. z ¦1‹1‹. 7HRE^ ”1”0 EFOUR¯1”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«ö EXCLAMATION MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ AMý&AN�2…2…–APOSTROPH2v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚CPLUSí À   0x002c: 0px002c,  �#  COMMA
 0 2d:  ! ÆHYPHEN-MINUS( e( e( –FULL STOP% f% f% WSOLIDH "30# %30# ¥DIGIT ZEROI #31& 1& 6ONE% 2% 2% 'TWJ 3% 3% 7HREL 4' 4' FFOURr 5& 5& 'IVL 6& 6& 6SIXK 7% 7% FEVEN' 8' 8' VEIGHT' 9' 9' (NI1a& a& GCOLOn b! b! KSEMI% c% S×LESS-THAN SIGO \%3dO kEQUALS' [3[GREATERT c3cÕQUESTION MARK4i4i ú†ERCIAL A<4l4löLATIN CAPITAL LETTER 44y4y2 B� †4†2 C2 ‘4‘2 D2 �4�2 ©4©4©2 Fd ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 b442 552 Õ5 5 QÈ 5 5 Y5 5 �5 5 è5 5 UÈ  5 V2  5 W2  5 :5 5 
ÀR Y
    0x00À5a: 0x005a,  ð#  LATIN CAPITAL LETTER Z
 * b2 b2 öEFT SQUARE BRACKET/ c/ c/ ö REVERSE SOLIDUS+ d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINE� "60$ %60$ \GRAVEL #61( 1( 5ESMAL3AX 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	60 60 	F` 70 70 	G0 80 80 	H0 90 90 	I0 å6å	°J0 ã6ã	0 K0 ä6ä L0 é6é0  M0 é6é0  N0 ì6ìÀ O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
97 7 
7 7 
U�  7 
V0  7 
W0  7 
X0  7 
Y0  7 
ã7 7  ã]CURLYâ7þ7þ`VERTIC>_7÷7÷RàX ö7öFTILD—7ç7çVDELET" aÙf" ×NO-BREAK SPAC* Óaœ  INÇ öED EXCLAMATION MARøaØ9( tF SIG�aÍ9[POUND& £acö
FEMININE ORDINAL INDICATO)a©a#ð LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0€x00ac: 0 0a,  À#  NOT SIGN
   "b0$ %f8$ kDEGREE' 1' 1' «PLUS-MINUS+ 2+ d+ ö SUPERSCRIPT TWO} 5+ %e6+ [MICROQ 7& fÇ ¦MIDDLE DOTL a& &a7L öASCULINE ORDINAL INDICATOR7 b7 f7 öRIGHT-POINTING DOUBLE ANGLE QUOTATION MARKF jcF ±VULGAR FRAC0  ON> GARTE} d} b7 
FHALFk f4 ±ÑINVERTED QUESm 	� cã9¼õLATIN CAPITAL LETTER A WITH GRAVEo cù8£= 	GACUT= 8]= 	¦CIRCUMFLEX 3î %8e"B 	GTILD 9/80= Cù vCEDILLA| 8| /92? E? 89= | = 8Ì/89z 8‘9&8I¼ —8—= 	
¼ d1/a5¼ Nz 
²d1aù O= 
sd,9n= · 4°8Âô = s dÍ9¼ ù /5 Uù /9¤= ù *^z 	•DIAERESIS'd‘e_ESMAL]fSHARP 6 e•8'	6 “eb[; 
í e`+83�; ä ec/84@ 
âe� h	{ ‹e‹8¥	= ÐE WITH GRAVE
±    0x00e9: 082, ð #  LATIN SMALL LETTER E WITH ACUTE
( ; a; 8; ¦CIRCUMFLEX@ c@ d@ 	I{ GGRAV{ d; /a1; 
¶ #f1; 4; 	Nv FTILDv "f2; /95; 	O; 
± "f3; ag
; ± 4; /93v g #f5@ ñ 
{ ñ 7; %f6{ ÕDIVISION SIGNËfF%97) F UFaß 
; A
; ”DIAERESISµ #39”e”ÅGREEK CAPITAýVGAMMA6 8%e9ë 6 FTHET6 al …6 7SIGl #a6l b6 5PHI  a‹/ea  FOMEG  b+e06 	GALPH4 ™/eb4 	7DELb�/ee4 	eEPSILO_33c0$	ž Pcoª1  
mcÏ Ä4  5TAUkcŸÁ2  �B207fÉ %fcÿ ¿SUPERSCRIPTz320a�9;hPESETA‹3221 f ó BULLET OPERATORÀ 3221{fÁ¶SQUARE ROOT' eµ eµ …INFINITY$ 2v %efÙ ¥INTERSECTIÊ3224>feõ ALMOST EQUAL TOS 6“f“{IDENTIC( ¸fÏLESS-THAN ORY  „føOATER4 #32‚fÀ�TOP HALF é DGRALº $32º ~oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi #50‘bû 9  1VER5Ð
    0x250c: €0x00da,  ð#  BOX DRAWINGS LIGHT DOWN AND R 
) €0x2510: = /bf= FLEFT< 4< /c0< 	/UPw 8; /d9; 
u c: /c3: 	�VERTICAL{  2¶ /b4A 	� 2� 2@ 	o¥HORIZONTAL83‚ /c1B 	8@ ‚ 5@ 		F  5ú/cdF DOUBLE : 1ƒbq: � ø "528 d¸ 4fSINGLE¸ N E 3E 6· #WN4 E V E ‚t 4"55ƒ /b8ƒ r ƒ  ?“ ‚ 6D 7D ‡  ¶D T D 7D bD ÂWD = ‚2UP o Ã 5Ä 9€ d‹#UP2 C T † aC cKÃ † < b< /beÿ 
Â AQB Ib
Á B À d„ c„ q  À  B } e; cÉ?‡fI KI �  JZ ’ 6Í P I B â; G (H *bÓ H X H -bè—  Ò  H A )d«\u Í .Ó 5d7J Ï J ` ” ;Àcb,     #  Bð+OX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf, X #  BC ›UP SINGLEA \ H 8H /d0H Ž 
‰ ^ H 9H /caH E +UP� A aA /d8A ƒVERTICALy G × bN 7N ˜ Ý cN /ceN E £ 
N ã "80G d´öUPPER HALF BLOCK, 4, cs ?LOW, Äb, LFULLR Å %dd& OLEFT} 9© ð ORIGH, 1© bAL, USHADEÐ #92' 1~ {MEDIUM ( 3( 2( KDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
`def en ñ(self,input,errors='strict'):,  êcreturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp861', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # )Z  ~0MapAð coding_map = coñ6decs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0c7, ö #  LATIN CAPITAL LETTER C WITH CEDILLA? !1:? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 4@ º  5? 0? GGRAVº 6; 5; ˆRING ABO@ 7@ ³	t±8= a} 	r79@ b@ 7 a? 8? 7b; drª6ETHåc4 f4 	+	2 d2 +de¡ f VTHORNh e6 cM6 � fA A  9ÉKB Û
M9Ç+e6ö (–IGATURE AÆ9»c3 p 5 µf(h lOµ9µfu @ f9µfÝ	? 
Û9®fñ
â1 9®+dd[(õ Yõ ˜®f= 	± ; ©d+x m- «dÛA û A  ±fì
€ WSTROK^¹%a36–POUND SIGw9­b £ d µ620aHkPESETAe ›/19i
F¿EHOOKa“%e1Å \	¾
ùa‘ùÀALL LETTER Iñ WITH ACUTE
    0x00a2: 0f3, ÿ	 #  LATIN SMALL LETTER O; 3; a; 	U; 4; +c1; eCAPITAx A= 5= d= I= 6= dð z ò 7= ò = ô 8= %bf· öINVERTED QUESTION MARKœ92 E23102 öREVERSED NOT SIGN- a- E00ac- $ b$ b:±VULGAR FRAC� †ONE HALFX c4 X 4 vQUARTER7 d7 aâî qEXCLAMAp 
ñ e5 bÄ ÿLEFT-POINTING DOUBLE ANGLE QUOTE fE bE ORIGHF  b0F 6259À LF V SHAD?#b1' 2² lMEDIUM( g6259wLDARK& R6250N ÒBOX DRAWINGS ‚  4EICALlbNE2524… 7 P AND W@ Q6256ì 	@ q 1 SIyA �H \?256¿ H Ç‰ X H gO2556Ð CDOWN| Í D nO2555D Ð €&56µ	Ç × É ”?255YA 8 ¨O2557½ u ±6255å¶ %UP<x µ6255ì	; /UPwÂ6255}B u¿'25õ	B û cµ1	
ú û cÉ3; ‡HORIZONT„cá2;· B ý1B 
	mÃ 0/àBOX DRAWINGS LðIGHT HORIZONTAL
    0x00c5: 0x253c, ñ #  BOX DRAWINGS L9 ÏVERTICAL ANDF 6F /5eF @ aSINGLEG RZ fDOUBLE� 7I fI 8 I Z I 8I aI @ &UPC < 9< 4< 
ODOWN> a> /69> 
z “bA 6A 
 C cC 0C 
— ×�dB 5B | e: 6Rz	| G fG 7Ã 2UP óƒA  ` É #d0H 8H 2 H ^ H 1H /WN’ 2J 5’ Ù” 3J 5k#UPÜ á£ × 4C 	C œ C C/52Ð E B3E y Š V Š >/6bE tI :N C6CN 8 — N d œ U1iiFLEFT: Q0Q: 6ÈdM8w ¦FULL BLOCKc 08Ý¬LOWER HALF, 8�  ¯ + 9E…W ð8, ?UPPƒ eÔE03b1èõ	GREEK SMALL LETTER ALPHAã eÀ600dZZLATIN4 vSHARP S6 ¬6039—j eCAPITAl GGAMMl ˜603cÌ 6 	  &PIg †?03ag 8SIGg y<03c6 g ÀETTER SIGMA
±    0x00e6: 0b5, ð  #  MICRO SIGN
 & 7& 53c4& öGREEK SMALL LETTER TAU2 82 +a62 eCAPITA4 6PHI4 94 /984 VTHETA6 a6 /a96 GOMEG6 b6 bÒ 
8DELj c4 E221ej †INFINITYŽ d$ <03cø 	*	ö e2 ‚\ gEPSILO’f6 6222ö §INTERSECTI( "f0( &61´ µDENTICAL TO¸  f1( 600b( ªPLUS-MINUS f2+ 62263ûGREATER-THAN OR EQU_ 34 oOLESS1 41 5320¸ �TOP HALF é FGRAL½ 5- ½ oBOTTOM0 õ%f7] ‹DIVISIONë ø6224’oALMOSTâ  ñ&0b±  DEÉR ä6221¸ö BULLET OPERATORÖ Ù&0b¦ ¦MIDDLE DOT& ÉE221aÌ ˜SQUARE RO' ¼607f' úUPERSCRIPT LATINÎlfÔ?0b2< 'TWGÍ625abBLACK ” ¶ ¿'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'° Ã ´’00 -> NUL( ! 1! 1! õSTART OF HEADINGN 2- 2- 2TEXƒ W 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 BQUIRp | 6$ 6$ µACKNOWLEDGEL 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& pHORIZONÕ@TABUK�<'\n2 a2 •LINE FEEDŸ b( #• 0b& 3VER§V :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETURå Ie. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ �I'\x1›À013 -> DEVICðE CONTROL THREE
    '\x14'
 ö #  0x0014 -> DEVIC1 EFOUR0 50 50 öNEGATIVE ACKNOWLEDGa 61 ö6 -> SYNCHRONOUS IDL- 7- 7- õ
END OF TRANSMISSION BLOCK” 86 86 eCANCEL# 9# 9# Y eMEDIUM* a* a* –SUBSTITUTª b' b' VESCAP# c# c# ÖFILE SEPARATOVd+ d+ _GROUP,  e, e, oRECORD-  f- f- LUNIT+  ( $  
 20+ CSPACÑ !" 1" €EXCLAMAT–3MAR•"- 2- LQUOT+ #+ 3+ ²NUMBER SIGN›$( ¬HOLLA( %( ¤wPERCENTQ &) œ‘AMPERSANDw 1"'" •“APOSTROPH(M †ñLEFT PARENTHESIST -')- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{¢DIGIT ZEROK 1' €' #ONˆ2& y& #TWL 3& t&  ý3t› ' sO 3FIVœ 
' q' 2SIXè & q& 3EVEõ( r( EKP ú( m( $NI9:fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 ÀAPITAL LETTE°R D
    'E'   ò#  0x0045 -> LATIN CAPITAL LETTER E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 a3 J3 K3 b3 K3 L3 c3 L3 M3 d3 M3 N3 e3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 0U3 V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 ’5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. cOW LIN`% 6YGRAVEN a) ESMALiA:b1 	1 B1 c1 	1 C1 d1 	1 /e1 ÿ	1 f1 ý	1 +g1 û	1 )h1 ù	1 'i1 ÷	1 %j1 õ	1 #k1 óU	1 !l1 ô†	1 m1 ù1  ð n'        #  0xð006e -> LATIN SMALL LETTER N
    'o'   Ÿ#  0x006f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 41 T1 u1 51 U1 v1 61 V1 w1 71 W1 x1 81 X1 y1 91 Y1 z1 a1 Z1 {1 b1 óEFT CURLY BRACKEU|/ c/ ÒVERTICAL LINEY }* d* ORIGHZ ~0 CTILDR B\x7f% ÷7÷UDELET# )c7# 8éPCAPIT¤ MâC WITH CEDILLAµ J\xfc@ øU> ƒDIAERESI¥J\xe9@ E@ 6ACU¼ *e2< A< “CIRCUMFLE-J\xe4A "A ½ 0@ 1@ EGRAVy*e5< << ‡RING ABOA ºL¸*ea Yx< bA iA <8@ x@ 	<dxƒ µ5ETHª5 ‰5 3 *de¤ ’3 h CTHORn;\xcW™7 Ýc¹B 	cY9Ùb
[6ú 9×•IGATURE AÒc4 Ë.6 f-9ÅOÅÀFLEX
    '\x@f6'  ð"#  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
5 Z'\xfe@ 5@ UTHORN5 b5 65 Uu ¤CIRCUMFLEXA *ddA 7A eCAPITA¸ YC TACUTE> f> 8> 	ô < d09< z 2*dc¼ aB ÿ t8B bB 	À ‚ USTROKý *a3= c= •POUND SIG£dd d' è 	f Pu20a7h We? hPESETAg Xu0192( f( g 	Ë FÇDHOOKÆ e19 #  c /a0; A; 	e/a1< I<  fA/a2< ~	x *fa´ 3< ú	< cð ª’ò cò ¨> ô dô ±> ö dö ®ø *bf4®ôINVERTED QUESTION MARPu23105 ¥ÈREVERSED NOT„*xa‘a‘% b@t±VULGAR FRAC„ „ONE HALF£bZ l5 tQUARTER8 aë}ó qEXCLAMAr ö *xaVatþLEFT-POINTING DOUBLE ANGLE QUOTF bF ’ORIGHG Au259Å ƒbž G T SHAD� ( bŠmMEDIUM) …Q wLDARK' 0P báBOX DRAWINGS L…  ?CICALsWu25243b^8 P AND ]A 6ñ a	A s 1 SI€B –I 	Â lI Ï‹ Y I 5­2wðBOX DRAWINGS DOWò8N DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN 5 E U E (63E 9E  … …VERTICALI B (51B aB 9 79 b9 DÇ > d> c> /UP³ c< d< /UP}bC eC {(10C fC RLIGHTÆÿ '14= /c0= þ RJ ;3< 1< ¦HORIZONTALA 2@/c2A ¹C 1C 3C 	wÆ 0?/c4B | 3| 5: 	| G (5eƒ6G A 	Ä ]P(5fJ 7J ¾ÒJ [ J aJ Ï5Øƒ | (69| 	| R(66B D 	� [É 5C †~ 	[; 	~ H c#UPB ['68Sd(
ëI Z6d55 ” ¹d?K * Ÿ– 5tdG
ß è9¸5#I
lD ž D 2gSÓ F À53'   #  0x0ý:0d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7F ˆVERTICALJ ®HORIZONTALO aO 8O ˆ ™ O ¯ ž (18O 9O LÔ !UPH FLEFT; (0c; a; %> 8y b> §FULL BLOCK' 4e c' ­LOWER HALF- 	’ d- ?EFT, (90Y e, ÀY 	- f- ?UPP† G03b1Z  e0- ó	GREEK SMALL LETTER ALPHAè 0xdf3  & e15 ZLATIN5 sSHARP S7 Pu03939 #] e27 l @CAPI?n DGAMMn Hu03cÐ &e37 	£ &PIi ai 42 i 9SIGi 	7 57 	i 5 0xb5Ó x¦MICRO SIGN“ c/e7\ 6TAU3  a6\ /=/'PHû 9ªe#5 GTHETd(a9l 7 GOMEG7 bÖ 7 	26DELl H221el &†INFINITYý cý Z  	û Œ0%3  eEPSILOš9222û /¨INTERSECTI) 6+f+BIDEN#TO¼ xRf©PLUS-MINUS1226Aµ fõATER-THAN OR EQUAL a Hu226wfOLESS2 (32Df2TOPl î CGRALÁ Iu232ê 	oBOTTOM1 0xf7Ñò ‹DIVISIONð 4 flALMOSTç !xb³ V  DEÓT 1Âfôó BULLET OPERATORÛ +xbª é–MIDDLE DO/(21¹fÙ—SQUARE RO( !07¿ÌÏSUPERSCRIPT  z:xb26ä= $TWTAu25ai ÝbBLACK — à
    '\xa0'   ó%  #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

e ²_map = {
  C 100:K 000,  Z FNULL  1  1  öSTART OF HEADING, 2, 2, FTEXT) 3) 3) 0ENDS 
' 4' 4' ¶RANSMISSIONV 5/ 5/ VQUIRY# 6# 6# ¶ACKNOWLEDGE' 7' 7' (BE8  8  2ACK€ G �#09% 9% ùHORIZONTAL TABULATÀ a1 a1 –LINE FEED› b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETURde+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. 5TWOP1‹1‹. 7HRE^ ”1”0 FFOUR_ ”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ†AMPERSAN�2…2…–APOSTROPH2v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3kÀ #  DIGIT ZEãRO
    0x0031: , Ö #  DIGIT ONE% 2% 2% 'TWJ 3% 3% 7HREL 4' 4' FFOURr 5& 5& 'IVL 6& 6& 6SIXK 7% 7% FEVEN' 8' 8' VEIGHT' 9' 9' (NI1a& a& GCOLOn b! b! KSEMI% c% c% ×LESS-THAN SIGO d* d* kEQUALS' e' e' GREATERT f- f- ÕQUESTION MARK"40) %40) ÆCOMMERCIAL A<4l%41) öLATIN CAPITAL LETTER A[ y4y2 B2 †4†2 C2 ‘4‘2 D2 �4�2 ©4©4©2 Fd ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 b442 552 P– 5 5 Q2  5 Y5 5 Sd  5 è5 5 Ud  5 V2  5 W2  5 :5 5 Yd  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5À #  RIGHT SQó	UARE BRACKET
    0x005e: , ÷ #  CIRCUMFLEX ACCEN- f- f- …LOW LINEQ "60$ %60$ \GRAVEL #61( 1( öLATIN SMALL LETTER AX 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	60 60 	F` 70 70 	G0 80 80 	H0 90 90 	I0 a0 a0 	J0 b0 b0 	K0 c0 c0 	L0 d0 d0 	M0 é/6e0 	N0 ì6ì O0 7ø7øÐ P0  7 
Q0  7 
R0  7 
S0  7 
7 7 
U`  7 
V0  7 
W0  7 
X0  7 
Y0  7 
Z0  7 �EFT CURLY‡7þ7þŠVERTICAL_7÷7÷ORIGHX ö7öFTILD—7ç7çVDELET" aÙf" ×NO-BREAK SPAC* Óaœ  INÇ öED EXCLAMATION MARøa¨9ú –POUND SIGŽaNaÈ ÿLEFT-POINTING DOUBLE ANGLE QUOTk eaÃ:NOTi bî GkDEGREE' ë f¾«PLUS-MINUS+ ¹fæSUPERSCRIPT TWDbTe$[MICROQ fÇ –MIDDLE DO b2À00af,     # ñ( RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0ac, ñ  #  VULGAR FRAC0  ON> VARTER7 d7 b7 
FHALF4 f4 84 ÑINVERTED QUESm 	� #c12 42 õLATIN CAPITAL LETTER A WITH ACUTEo "c4= /8e= –DIAERESISA 5A fA RsGABOVƒ 6B /92B —IGATURE A5 75 /805 õ Cõ vCEDILLA¶ 9? 9? E? 4×5| I= "d0z 8®5ETH® "d34 /a6q Oq _9= â"d8~ /9dA VSTROK©"da> /a7> U¼ x/9a= ¼  «9~ Y~ e» 8ù VTHORN­Á+e1´ ESMAL�fSHARP GeT	6 Ã7GRA@e Ì; 
Ê#e2â 3¬ 	v ¥CIRCUMFLEXì e>{{ že<Ø? : eÛk8 e8	s 6e
8�	= 4¥q8å; ¥B82; ¥bå@ ¥ CaehìfÕ7º êfê'
èfŒ9Ì ÀLL LETTER O ñWITH CIRCUMFLEX
    0x00f6: 094, ñ
 #  LATIN SMALL LETTER O @ –DIAERESIS? 7? %f6? ÖDIVISION SIGN) 8) %9b) h fSTROKE< a< /a3< 	U¤ GACUT; b; 9  w  ; c@ /81{  d? /98? 	Yº e; 5; 	ETHORe31924 f4 	Fo DHOOKc2393: %e2: ÅGREEK CAPITA	VGAMMA6 Õ/e96 FTHET6 al sl 7SIGl a©eK6 5PHI  #a9Ö a  FOMEG  #b16 06 	GALPH4 44 ßž 	4 7DEL#b54 eh 	eEPSILOä33c06 j  PcoI1  
mcÏ 7› 	5TAUkcŸd2 	�B207fÉ %fc2 ¿SUPERSCRIPT†320aw9;hPESETAu3221 f ó BULLET OPERATORÀ 3221dfÁ¶SQUARE ROOT' –eµ …INFINITY$ 2v e†¥INTERSECTIÊ3224>feõ ALMOST EQUAL TOS 6“f“{IDENTIC( ¸fÏLESS-THAN ORY  „føOATER4 #31‚aV0REVà YD NOTƒ#32- fí�TOP HALF DGRALç $32ç «oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi #50)b(9  1VERb  #50dP7   DOWN AND R = 7b= 	5LEFw#51Øc <  *UPw À 0x2518: 0x0P0d9,  ð#  BOX DRAWINGS LIGHT UP AND LEFT
& ï0x251c: 0x00c3: 	�VERTICAL@ RM A "24A /b4A 	� 2� 2@ 	ADOWN} ¥HORIZONTAL‚ 3‚ /c1B 	ý @ ‚ 5@ 		F  "50/cdF DOUBLE : 1: /ba: 
� ø "528 d¸ 4aSINGLE;¸ ˆ E 3E 6} #WN4 E V E ‚t  ‘  ‚Š > 5ƒ /b8ƒ r ƒ  ?“ D 6D 7D ‡  ‚ D T D 7D bD ÂÆ  D = 8= d2UP o Ã Ä 9C ‹#UP2 C T † aC cKÃ † < b< /beÿ 
Â  ý � B Ib
Á B À d„ c„ ÂÀ  B } e; cÉ?‡fI KI �  OJZ ’ 6Í P I B â; G ™6*bÓ H X � -bè—  Ò  H A )d«\u Í .Ó 5d7J Ï J ` ” ;c÷J C :/cf·
;A Õ E0H Ó ÀNTAL SINGLE
ð    0x2569: 0x00ca, ð #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
. A aA /d8A û VERTICAL SINGLEG ` N bN 7N ˜ 
• d N cN /ceN E £ 
N G "80G %dfG öUPPER HALF BLOCK, 4, c, ?LOW, 8, b, LFULLR Å %dd& OLEFT} 9© ð ORIGH, 1} &b0W , USHADEÐ #92' 1' {MEDIUM ( 3( 2( KDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
`def en ñ(self,input,errors='strict'):,  ,creturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp862', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # )Z  ~0MapA0codáTmap =Ïñmake_identity_dict(range(256))
° 5 ‘.update({F {_&5dŠöHEBREW LETTER ALEF. ¸&5d‘
. 6BET- ¾!5d–À  #  HEBREW ð	LETTER GIMEL
    0x0083: @5d3, ³ #  HEBREW / VDALET/ 4/ 4/ &HE, 5, 5, 6VAV- 6- 6- VZAYIN/ 7/ 7/ Hµ 8- 8- T- 9- 9- 6YOD‡ a- a- –FINAL KAF3 b3 b3 	- c- c- GLAME� d/ d/ � 6MEM� e3 e3 	- f- f- ` &NU©"903 /e03 	- 1- 1- eSAMEKH½ #920 20 	49ëeë¾ PÂ9îeî, îeî^ VTSADIÁ öeö/ öeö&QOi9öeö7RESK÷e÷'SH9øeøTÛ9ò&0a¦‡CENT SIG(ê&0a�[POUND& á&0ae;YEN$ Ò620a%kPESETA' Ì&19– ´LATIN SMALLþµF WITH HOOKµaÓ&0e¦:  A: FACUTQaá&0e¡;  I; ì&0f!;  O; ù&0f®;  U; /0fì 
N; GTILDì ,0d; eCAPITAc= &0a³ ÁFEMININE ORDV–INDICATORš &0b6 oMASCUL7 *&0b×÷INVERTED QUESTION MAR.6231Ö»REVERSED NOÛa-&0aÅ$ $b±VULGAR FRAC� vONE HALáa3bX 4 ÀNE QUARTER
 ¢   0x00ad: 01,  ð#  INVERTED EXCLAMATION MARK
! 5 e5 b5 ÿLEFT-POINTING DOUBLE ANGLE QUOTE fE bE ORIGHF  b0F 6259À LF e SHADE² #b1' 2² lMEDIUM( 2( 3( LDARK& 3& 0N ÒBOX DRAWINGS ‚  FFICAL… 47 %24] 7 P AND W@ 5@ 6ì 	@ q 1 SIyA �H 6H ¿ H Ç‰ X H 7H /56Ð CDOWN| Í D 8D 5D Ð 9D 6µ	Ç × É aA 5YA 8 b8 7½ u c= d= 
%UP<x µO255c; /UPwÂ6255}	3#UP©} R „ ¿O2510„ û cµ1	
ú w cÉ3; ‡HORIZONT„cá2;· B ý1B 
	mÃ 0:
z  3z F þ/5e¹º vÁ cÿfI ? I Z ÔaI @ ü5< ˆ� z ù/69z M6
C 6Â —GÆ B àHORIZONTAL
   ð 0x00ce: 0x256c,  ð #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
3 G fG 7G ›UP SINGLEA ` H #d0H 8H ’ 
‰ ^ H 1H 4H CDOWN4 ’ 2J 5J ” 3J /59J #UP’ SRIGHT£ × 4C gC œ C 5C 2† E 6E 3E y Í 7E /6bE tI {8N aN !N d &9N 1iLž!UPÞ FLEFT: a: 0Q: f Ã_= b= 8w ¦FULL BLOCK& c& Ý¬LOWER HALF, d, �  ¯ + %90Bž , ð8, ?UPPƒ eÔE03b1X õ	GREEK SMALL LETTER ALPHAã eÀE00df4 ZLATIN4 öSHARP S (GERMAN)? µ6039 s eCAPITAu GGAMMu ¡603cÕ 6 	© &PIg �?03ag 8SIGg ‚<03c6 	g 4 q600b†¦MICRO SIGN� R603cÁ  6TAU2 6E03a6h2 )'PHö 6039¥4 GTHET]603aþ6 GOMEG6 ?03bÒ 
8DELj 521eÔ †INFINITYø <03cø 	„	ö '03‚À 	2 gEPSILO’(&22ö §INTERSECTI( f$6226$BIDENt%TO¸ fLªPLUS-MINUSf62263àGREATER-THAN OðR EQUAL TO
    0x00f3: 0x2264, ÿ  #  LESS-THAN O1 41 53201 öTOP HALF INTEGRAL^ 5- 1- oBOTTOM0 60 E00f70 ÖDIVISION SIGNY 7) E2248) oALMOSTâ  8+ 600b± kDEGREER 9' E2219R ö BULLET OPERATOR} a+ 600b¦ ¦MIDDLE DOT& b& E221aQ ˜SQUARE RO' c' 607f' ÷UPERSCRIPT LATIN SMALL LETTER d< O00b2< 'TWèe+ 625abBLACK ” ¶ f( '00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U d'\x00'\ s’00 -> NUL( ! 1! 1! õSTART OF HEADINGN 2- 2- 2TEXƒ W 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 UQUIRY$ 6$ 6$ µACKNOWLEDGE( 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  ¿c9& €HORIZONTò0ABUKO=<'\n2 a2 •LINE FEEDŸ b( #. 0b& oVERTICV :x0c0 c0 HFORMV r$ ® d& äCARRIAGE RETUR¨ 2x0e. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ �J'\x1›1›/ 6HRE` 
¤1¤1 2FOU¥ a 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2d BLOCKM1Ë1ËUCANCE
)19È1ÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´†ILE SEPAû Vdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" À0021 -> EXCLðAMATION MARK
    '"'   ü#  0x0022 -> QUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 0"'"Æ   Ê 7& ‘POSTROPHE' -'(M 8' òLEFT PARENTHESIS- )- 9- ORIGH.  *. a. sASTERISq+% b% GPLUSó ,& c& RCOMMA› -" d" ³HYPHEN-MINUÄ .) e) ’FULL STOPO /& f& TSOLIDJ 0$  30$ ¢DIGIT ZEROK 1' 1' #ONˆ2& yM #TWL 3& t& 3HREN 4( t› BFOUR› 5' sO 3FIVN 6' q' 2SIXM 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 �L3 1Lf M3 f M3 N3 3 ÅO3 3 -P3 ð50 -> LATIN CAPITðAL LETTER P
    'Q'   ö	#  0x0051 -> LATIN CAPIT3 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 .c0 ãREVERSE SOLIDUÁ]+  , d, ?IGH] ^1 e1 óCIRCUMFLEX ACCEN‹ _. f. ‚LOW LINEà `%  60% YGRAVEN a) ESMAL8AZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 óñ	1 K1 l1 ô"	1 L1 m1 ù1  M1 n1 ù1  N1 o1 üÄ O1 p1 7b  q1 r1 s1 Pt1 "u1 v1 w1 	x1 y1 z1 Ða -> LATIN SMðALL LETTER Z
    '{'   ò#  0x007b -> LEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f% « f" TDELET# Pu05d0% #  80# dHEBREWú BALEF¤ \/ 1/ 1/ Bü . 2. 2. WGIMEL^ 30 30 9DAL` 40 40 Hê 5- 5- 7VAV‹ 6. 6. WZAYIN0 70 70 H¹ 8. 8. T. 9. 9. 7YODŠ a. a. ˆFINAL KA×b4 Ô

. c. Ó
. HLAME’ d0 Ù
0 ’ 7MEMÆ e4 Ý
4 
. ëÆé
. b 'NU²eú9ú 
. ù9ù fSAMEKHÁ eü9ü 
@eû9û Â PÑeþ9þ 	- þ9þ ` WTSADIÅ 9 0 9 'QOve9 8RESR9 (SH’e9 Tð!xa­#  B9„CENT SIG4!xa¤& úZPOUND' k' ñ8YEN% Iu20a,âiPESETA( 1019œ š Ü‡LATIN SM¡³F WITH HOOK¿!xe³ˆ aã;  A; 5ACU!xe³< ñ<  I<  f'aü<  O< µx 	<  U< ð <  N< 	,d< À  0x00a5 -> ðLATIN CAPITAL LETTER N WITH TILDE
    '\xaa'
 ô #  0x00a6 -> FEMININE ORDINAL INDICATOR7 b7 77 oMASCUL8 fo 88 óINVERTED QUESTION MARKk Pu23105 ¢ 93 óREVERSED NOT SIGN. 0xac,  Ð a. % *bd% b% ±VULGAR FRAC„ „ONE HALFZ bZ c5 eQUARTE+*a1m d8 ó qEXCLAMAr ö :xab6 e6 þLEFT-POINTING DOUBLE ANGLE QUOTF bF fF ORIGHG Au259Å ƒ b0G LG E SHAM ( 2· ( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS …  ?CICAL«Xu2524_ 48 P AND ]A 6ñ 5A s 1 SI€B –I 	Â _	Â I Ï‹ Y I (56Ó q	I CDOWN~ Ð E 5E ~E Ó 	¼�E ™Ú Ì 	^¤B 	9 7À ¸9 w  øžÁ> %UPAz ÿ< Å	< /UP}ŽC ÒC {	bÏ	C ÿ 1cÅ=  þ &ÿ 3< Ù< ‰HORIZONT’@cñA  º C 1C ÄÆ 0Jc| 3| y	óG '5eÀc	Ä ]‘5JMðc7 -> BOX DRAWINGô<S VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGSA &UPD = 4= 9= ODOWN? (69? a? | ¦HORIZONTAL� (66B bB � D 0D cD SL‡ 5C dC ~ c~ e; 	~ H 7H fH #UPû‰B áÌ '68I /d0I UI Z6-d1I •5 ” 5” 2K – 5t-d3K #UP” 4	#4D Ø D ž g(52Ó 5D F 3F 6F { Ð (6bF 7F }J ù	SdSO %O e *1neLØ%FLEFT; 0]da; kÖ 8y ]¦FULL BLOCKe 8è@­LOWER HALF- 	’ * ³ , 9VdY 	-  ?UPP† G03b1ñeäó	GREEK SMALL LETTER ALPHAè 0xdf3 *eÐZLATIN5 óSHARP S (GERMAN)@ Hu039¬eÅu eCAPITAw DGAMMw Hu03cÙ e±7 	¬ &PIi ai Ÿ2 i 9SIGi 	7 ’7 	i 5 !xb˜�¦MICRO SIGN“ c$eb\  6TAU3 aÛeF3 Æ !PHû À '\u0398'   ô(#  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   7 a7 GOMEG7 (b47 b7 ESMALl 6DELl H221e5 c5 †INFINITY‘ (c6% d% È 	Z 6PHI3 (b53 e3 tEPSILON7 9222û f7 ¨INTERSECTI) '61` !f0) ³DENTICAL TOR !xb' M f1) çPLUS-MINUS SIG~ 6µ  f2, øGREATER-THAN OR EQUa Hu226w f35 OLESS2 8320¼ 42 �TOP HALF î CGRALÁ Au232Ã  f5. oBOTTOM1 0xf7] ò 61 ‹DIVISIONð  48, [ 7* lALMOSTç !xb³ V 8,  DET 1Âfôó BULLET OPERATORÛ +xbª é£MIDDLE DOT' Xu221a§ Ù—SQUARE RO( 807f( ÌùSUPERSCRIPT LATIN ³ü0xb2; à ä= $TWTAu25a8ÝbBLACK — º x' U ÏóNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  D100:L000,. $2NUL-  1  1  öSTART OF HEADINGL 2, 2, 2TEX€U 3) 3) 0ENDS 
' 4' 4' pRANSMIS‚ 5/ 5/ BQUIRxy 6# 6# ¶ACKNOWLEDGEJ 7' 7' (BE8  8  2ACK€ Gl 9% 9% pHORIZON¨@TABU?‚1 a1 a1 –LINE FEED› b% b% 3VER¥T  c/ c/ KFORMT d% d% âCARRIAGE RETURÕ¤ e+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. z Ñ 1‹1‹. 7HRE^ ”1”0 2FOU‘_ ”1”ŸNEGATIVE z1¡1¡ðSYNCHRONOUS IDLE
  “  0x0017:  ,  ð#  END OF TRANSMISSION BLOCK
! 5 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) ¦SUBSTITUTE& b& b& WESCAP" c" c" æFILE SEPARATORL d* d* _GROUP+ e+ e+ oRECORD, f, f, OUNIT*  "20* %20* FSPACÌ #21! 1! €EXCLAMATŒ6MAR‹#22, 2, OQUOT* 3* 3* µNUMBER SIGN#24' 4' \DOLLA' 5' 5' {PERCENTO 6( 6( –AMPERSANDt …&27% ‡POSTROPHv2vöLEFT PARENTHESISR €2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k¥DIGIT ZEROI 3p3p& &ON~3i3i% 'TWJ d3d% 7HREL d3d— 6FOU©3c3cM 7FIVL a3a& 6SIXâ a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á	2 À LETTER H
  “  0x0049:  ,  ð#  LATIN CAPITAL LETTER I
 2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2 22 22 R2 32 32 S2 42 42 T2 52 52 U2 62 62 V2 72 72 W2 82 82 X2  /592 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5uOW LINEÛ 66\GRAVEL 6÷6÷ESMAL…AX õ6õ	0 B0 ó6ó	0 C0 ñ6ñ	0 D0 ï6ï	0 í6í	0 F` ë6ë	0 G0 é6é	0 H0 ç6ç	0 6å6å	0 6ã6ãg	0 6ä6ä—	0 ÿ6é6é0  ý6é6é0  û6ì6ìÀ ù7ø7ø`  ÷7 7 
õ7 7 
ó7 À073,     #  óLATIN SMALL LETTER S
    0x0074: , O #  0  T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENc. c. ÖVERTICAL LINEW d) d) ORIGHX e/ e/ GTILDP f! f! VDELET" "a0" f" ×NO-BREAK SPAC* 1* aœ  INÇ õED EXCLAMATION MARKÑ "a25 9(–CENT SIGN% 3% [POUND& “9€ ;YEN$ Ça‡öFEMININE ORDINAL INDICATOR€ ÍaGÿLEFT-POINTING DOUBLE ANGLE QUOTê äaB+NOé bmÆjDEGREEÆ bj%f1¶«PLUS-MINUS+ `fõ SUPERSCRIPT TWOæ b@e[MICROQ ™fÇ –MIDDLE DOÑbh¿PMASCUÍibimßjbj/±VULGAR FRAC„ ON¨FARTEæb\a‹7 FHALF4@a±ôAQUESm 	ñd¼a9PCAPITð›‰N WITH T¯do eù¦ õSHARP S (GERMAN)® e| 08?  Az 7ACUez 
I; fv 4v 	ð fù/a2; 	Ov ¨ÎPDIVIS‚	]f«3d 	Ud  #19]9¯P F; 5HOO÷#39Ù eÙ  ç+K TGAMMAÀ#39åeµ6 BTHET6 À0x03a3: 0x00@e4,  ð#  GREEK CAPITAL LETTER SIGMA
" ï0x03a6: 0x00e86 6PHI4 94 a4 FOMEGj #b16 06 ESMALž GALPH4 44 b4 	GDELT4 54 e4 	uEPSILONÔ #c06 36 	P#c31 51 	
mcÏ 74 	6TAU— Ÿd2 	�#5dÉ 8gdHEBREW DALEF` #5d•%81` 
. 6BET- 2ó /82- VGIMEL/ "8S
\ 8DAL^ 8À
/ &HE[ ä8}
, 6VAV- D/86· EZAYI
35d7æ ¥
\ Hµ 8- ?
- T- 8/89‰ 6YOD¶ aZ e
Z ‡FINAL KAÍb3 .
3 	- c- c� GLAME� d/ ‰
\ � 6MEMÂ e3 ‰
3 	- f- f� ` &NU©eê9ê	- é9éeSAMEKH½ eì9ì	4eë9ë¾ PÂeî9î, î9î^ ETSAD #5eö9ö/ ö9ö&QOieö9ö7RESK÷9÷'SHeø9øTÛ32076fÅùSUPERSCRIPT LATIN `?420aò Ÿ`PESETA"' #21¾ f¾ ó BULLET OPERATOR43221» f€¤SQUARE ROOG3221eµ …INFINITYK 2v e¥INTERSECTI·2224ŠÀ0f7,     #  ðALMOST EQUAL TO
    0x2261: 0x00f0, » #  IDENTIC( 4( 3( ÏLESS-THAN ORY  51 21 GREATER4 23104 %a94 ôREVERSED NOT SIGNº #32- %f4- öTOP HALF INTEGRAL- ç 5- oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi 2502Ã b(9  1VERb  250c7 'da  p  DOWN AND R = 7/bf= FLEFT< Øc °  /UPw 8´ ®; 
u î c%{  2¶ bŸ
fA 	� 2� �»  oè 3‚ /c1t	8@ ‚ ‘ñ	Â F  5§d† oDOUBLE¨5bq: � 05àd¸ 4aSINGLEwª N E 3:6· #WN4 E V E ‚t  ‘ 45Ÿ/b8ƒ r ƒ  ?“ ‚ 6Ç /b7D ‡  ‚ D T D 7D bD ÂÆ  D = ‚2UP o Ã ‹9€ d‹#UPö C T † aC cKÃ † < b< /beÿ 
Â  ý � B Ib
Á B À d„ c„ ÂÀ  B } e; cÉ?‡fI KI �  OJZ ’ 6ð c,     #  BOX Dð&RAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5, ” #  BOX DB ; aSINGLEB CLEFT[ H 2H 6H “  Š H X H 3H 9H ? — H A 4A /d1A 2WN u Í ­HORIZONTALÓ 5J 2J �  ‡ J ` ” 6J /cbJ §KDOWN” C 7C fC /UPÕ 8H /d0H Ó 9H /caH E /UPÑ aA /d8A âLG ¬bN 7N ˜ °cN /ceN E £ 
N ´"80G d´öUPPER HALF BLOCK, ·cs ?LOW, ÄOLFULLR Å &ddR  ¹}  9© ð &© 91ALRe SHADEÐ 9‡lMEDIUM( ðeKDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
`def en ñ(self,input,errors='strict'):,  ’creturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ð ):
    pass

clð	ass StreamReader(Codec,c (s. ó():
    pass

### encodings module API

def getregentry(7 sreturn X e QInfo(T  X Õname='cp863', d !e=0 2().   deQ    ²incremental: 6r=I EÀ /er/ J 	/ Dl / s7r7=*R # cwriter# W # )IZ ping MapAWd_map =2ñmake_identity_dict(range(256))
° 0ing5 ‘.update({F€0x0080:  0c7,kö #  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ c@ ù B 5B /e0‚ GGRAV½ 6; %b6; ÆPILCROW SIGN¥ 7( ež	_œ8= ae Û	= ]"9@ b@ Ü a? 8? b; f; 	IÜz  c? e? ù d@ 6201vçDOUBLE LOW LINÉe+ <00cFç f= ah zSECTION9¤&e Ë
(9¢c‡= 
¢ 9 cC= L 9§/f4Œ	OË@ §…‚ 9¦cLA N9¬f‚ 	GãÂ Äf¾@ Âa=‹CURRENCY"«d) ëå h®À0dc,     #  ñ"LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0a2, Ö #  CENT SIGN% c% 3% [POUND& d& %d9& Œ 	VGRAVEc e= b= ¦CIRCUMFLEXB fB &19Ê  ESMAL	F	EHOOK: !a0: 50a6| ¦BROKEN BAR& 1& %b4& €ACUTE AC2( 2( f-ˆ  Oˆ B ; 3; ac ;  Ì; 4; %a8; í"a5% b% vCEDILLAƒ 6# ¾ öSUPERSCRIPT THREµ"a7- %afu VMACRO:"a8" %ce" Ò  I×  a9B E2310B »REVERSED NO© aa- E00ac- $ ò%bd$ ö	VULGAR FRACTION ONE HALFbX 4 gQUARTE3bþ 7 Q 9 —aañEFT-POINTING DOUBLE ANGLE QUOTAº 7MARØ&0bE ORIGHF bE25910LF V SHADb'25lMEDIUM( 6259aLDARK& 
6250ÍÒBOX DRAWINGS ‚ …VERTICAL¨b6252¤7 – AND LEFT@ !6256ì 	@ q 1 SIyA �H F?256¿ H Ç‰ X H a7255šCDOWN| Í D ƒE2555À	Ô D Ð …&56µD Ž× É ™?255YA 8 ­O2557½ y Ä u ¶6255ê¶ %UP<x º6255ñ	; /UPwÂ6255}B u¿'25ú	B û ÀAND LEFT
   ð 0x00c0: 0x2514,  ð#  BOX DRAWINGS LIGHT UP AND R 
' ; 1; 3; ¦HORIZONTAL@ 2@ /2c{ 	ADOWN} B 3B 1B 
�VERTICALF Ã 4A /00ƒ 	z 59 3z F 6F /5e º fSINGLEÁ v DOUBLEK7I fI 8 I Z I 8I aI @ 9< < Ñ‹a> /69z MbA 6A 
 C cC Â — dB 5B | e: 6R| G fG 72UP óA Rd/68H ’  H ^ Qd%6/WN’ //65’ Ù” 75k#UP$§£ × 95	C œ C C/52Ð E B3E y Š V Š >/6bE ðI òC6CN † — N d œ U1i	 FLEFT: Q0Q: 6 Ãç= M8w ¦FULL BLOCK& 08Ý¬LOWER HALF, 8�  ¯ + 9Ež , ð8, ?UPPƒ ð e0: 0x03b1,    ñ #  GREEK SMALL LETTER ALPHA
    0x00e1: 0df,  4 ZLATIN4 vSHARP S6 26 53936 j eCAPITAl GGAMMl 36 +c06 	  &PIg 41 ag 8SIGg 56 c6 	g 4 64 50b5› ¦MICRO SIGN� 7& 53c4& ÷ 	Z 6TAU2 82 +a62 )'PHö 94 /984 GTHET]a6 /a96 GOMEG6 b6 bÒ 
8DELj c4 E221ej †INFINITYø d$ <03cø 	*	ö e2 ‚\ gEPSILO’f6 6222ö §INTERSECTI( "f0( &61´ µDENTICAL TO¸ fb( ªPLUS-MINUSf62263ûGREATER-THAN OR EQU_ 6226oOLESS1 62323�TOP HALF é FGRAL½ ù6232½ oBOTTOM0 õ%f7‹DIVISIONë ø6224’oALMOSTâ  ñ&0b±  DEÉR ä6221¸ö BULLET OPERATORÖ Ù&0b¦ ¦MIDDLE DOT& ÉE221aÌ ˜SQUARE RO' ¼&07ïÏSUPERSCRIPT û lfÔ60b2c < 'TWGÍ625abBLACK ” ¶ ¿'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U d'\x00'Ê á’00 -> NUL( ! 1! 1! õSTART OF HEADINGN 2- 2- 2TEXƒ W 3* 3* 0ENDU 	( 4( 4( pRANSMISƒ‚ 50 50 BQUIRp | 6$ 6$ µACKNOWLEDGEL 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  -c9& pHORIZONþ@TABUK�<'\n2 a2 •LINE FEEDŸ b( #œ 0b& 3VER§V :x0c0 àc -> FORM FEED�
    '\r' ó   #  0x000d -> CARRIAGE RETURN, 2x0e. , e, •SHIFT OUT& f& f& IK )10%  10% ôDATA LINK ESCAPER *11- 1- öEVICE CONTROL ON/ 2/ 2/  5TWO^ 3/ 3/ 6HRE` 41 41  EFOURa 50 50 öNEGATIVE ACKNOWLEDGa 61 ö6 -> SYNCHRONOUS IDL- 7- 7- õ
END OF TRANSMISSION BLOCK” 86 86 eCANCEL# 9# 9# Y eMEDIUM* a* a* –SUBSTITUTª b' b' êc# c# ÖFILE SEPARATOVd+ ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  � =2ÆCSPACô !" »€EXCLAMAT–3MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‘AMPERSAND3"'"UV2•“APOSTROPH(M †ñLEFT PARENTHESIST -')- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >{3{“DIGIT ZERÝ8' €' 2/& y& )&& t&  ( t› ' sO 3FIV$
' q' 2SIX3& q& 3EVEõ( r( EKP ú( m( $NIk:ª3fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( ð e -> GREATER-THð AN SIGN
    '?'   ò#  0x003f -> QUESTION MARK* @*  40* ÒCOMMERCIAL AT* A* 1* òLATIN CAPITAL LETTER A3 B3 23 B3 C3 33 C3 D3 43 D3 E3 53 E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 a3 J3 K3 b3 [L3 c3 Lf M3 d3 M3 N3 e3 O3 ÊOf P3 5'3 P3 Q3 0Q3 R3 0R3 S3 0S3 T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 ²5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. cOW LIN`% 6YGRAVEN a) LSMAL5b1 	1 3c1 	1 1d1 	1 /e1 ÿ	1 f1 ý	1 +g1 û	1 )ðh'        #  0x00ð68 -> LATIN SMALL LETTER H
    'i'   Ÿ#  0x00691 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 41 T1 u1 51 U1 v1 61 V1 w1 71 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ÒVERTICAL LINEY }* ORIGHZ ~0 CTILDR B\x7f% 7÷UDELET# )c7# 8éPCAPIT¤ sâC WITH CEDILLAµ J\xfc@ øU> ƒDIAERESI¥J\xe9@ E@ 6ACU¼ *e2< A< “CIRCUMFLE-;\xcA "ý C *e0„ 4A EGRAV|*b6< ?³PILCROW SIG¿;\xe¥7£*eag Dc'*ebA TA ä8@ c@ 	$eÃ8nIä| e| Q @ ý Au201~D8–§DOUBLE LOWÂ;\xc’m P	ë ah Ð  #  0x008f -ð
> SECTION SIGN
    '\xc9'
 õ  #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE> 8> 1> FGRAV> a> 2> ¤CIRCUMFLEX� *f4C 3C ESMAL½ O½ A *cbA 4A  ”DIAERESISƒ *cfB 5B I… B f„ 6B 	Å U@ Å fÅ7A 	…aB8< ‰CURRENCY+d* 9* +n*dc,aC ì ,*a2B bB ICENT« *a3& c& YPOUND' d8d' Ò � 	:d·e> ¹Au019Ð ~fC 	úFúDHOOKw)a6ã a¹¤BROKEN BAR' bµa¢Ä0 AC8) f3a�	‹ ÜC < 
Éa†F	< aCa�÷b& etCEDILLA† bÂ GõSUPERSCRIPT THRE}a·a4VMACROecÚá@2310E áa4»REVERSED NO·
a%  bdQ  ²a¢VULGAR FRAã…ONE HALFZ 5 fQUARTE?"8 X : aañEFT-POINTING DOUBLE ANGLE QUOTA 5MARçbF "ORIGHG Pu25917ˆb.LG T SHAD ( ‘b/mMEDIUM) oQ /LDARK' 0P ÒBOX DRAWINGS … ƒVERTICAL°Au252¹_ 8 – AND LEFTA ð61'   #  0x00b5 ÿ:-> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 I 9 I Y I (56I ,7 I CDOWN~ E 5E 8E z E š Š (63E 9E   #B (51B aB 9 79 b9 w  d> c> %UPü z c< d< /UP}bC eC {(10C fC @LIGH„/WNÃ  '14= /c0= þ RJ ÿ 3< 1< ¦HORIZONTALA 2@/c2A ¹C 1C 3C š  Æ 0?/c4B | 3| 5: 	| G (5eƒ	Ä ]P(5fJ ‹ ¾J [ J aJ Ï5Øƒ | (69| 	| R6cD 	SZ 5C †~ 	[; 	~ H c(UP­B ['68•d(
ëI Z6d55  K õ )¹d?K 5 K a K 5tdGß À AND RIGHT Sñ$INGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP S3 ù  AND RIGHT DOUBD 2D 5D ODOWNF 3F 6F { Œ � Ð (6bF 7F ƒVERTICALÅ J £HORIZONTAL¦ O aO 8O ˆ O ¯ O 1n9O L`!UPH FLEFT; (0cŠ a; kª> 8y b> §FULL BLOCK' 4e c' ­LOWER HALF- 	’ d- ?EFT, (90Y e, LY 	- f- ?UPP† G03b1Z  e0- ó	GREEK SMALL LETTER ALPHAè 0xdf3 ö e15 ZLATIN5 sSHARP S7 Hu039£ e27 l @CAPI?n DGAMMn Hu03cÐ &e37 	£ &PIi ai –i 9SIGi 	7 ‰7 	i 5 :xb5x¦MICRO SIGN“ ceY\  6TAU3  a6\ \e=3 /'PHû 9ªe#5 GTHETd(a9l 7 GOMEG7 bÖ 7 	26DELl H221el &†INFINITYý cý Z  	û Œ0%3  eEPSILOš9222û /¨INTERSECTI) 6+f+BIDEN#TO¼ xRf©PLUS-MINUS1226Aµ fõATER-THAN OR EQUAL a Hu226wfOLESS2 (32Df2TOPl î CGRALÁ Iu232ê 	oBOTTOM1 0xf7Ñò pDIVISIOº8224 flALMOSTç !xb³ V  DEÓD1Âfôó BULLET OPERATORÛ +xbª é–MIDDLE DO/(21¹Àfb -> SQUAREò4 ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
= 0xb2; = d= 5TWOi 05a0. i e, ÃBLACK SQUARE) x' U f) óNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  Õ 100:Ý 000,¹  ì FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXXu 3) 3) 0ENDS 
' 4' 4' ¢RANSMISSIOqV 5/ 5/ VQUIRY¢ 6# 6# ¢ACKNOWLEDGfJ 7' 7' (BE8  8  2ACK€ GE 9% 9% ð HORIZONTAL TABU?À a1 a1 –LINE FEEDÂ b% b% oVERTICT c/ c/ KFORMT d% d% çCARRIAGE RETURde+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. z ¦1‹1‹. 7HRE^ ”1”0 EFOUR¯1”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Ff BLOCK‘ »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤ÇILE SEPARATON©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«ö EXCLAMATION MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' ”2”{PERCENTO Œ2Œ AMý&AN�2…2…–APOSTROPH2v2võLEFT PARENTHESISW2€2€ORIGH- „2„wASTERISh‚2‚EPLUSí À 0x002c: 0x0P02c,  �#  COMMA
 ‚0x002d:  ! ÆHYPHEN-MINUS( e( e( –FULL STOP% f% f% WSOLIDH "30# %30# ¥DIGIT ZEROI #31& 1& 6ONE% 2% 2% 'TWJ 3% 3% 7HREL 4' 4' FFOURr 5& 5& 'IVL 6& 6& 6SIXK 7% 7% FEVEN' 8' 8' VEIGHT' 9' 9' (NI1a& a& GCOLOn b! b! KSEMI% c% S×LESS-THAN SIGO \%3dO kEQUALS' [3[GREATERT c3cÕQUESTION MARK4i4i ú†ERCIAL A<4l4löLATIN CAPITAL LETTER 44y4y2 B� †4†2 C2 ‘4‘2 D2 �4�2 ©4©4©2 Fd ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 b442 552 Õ5 5 QÈ 5 5 Y5 5 �5 5 è5 5 UÈ  5 V2  5 W2  5 :5 5 ÀY
    0x005a : 0x005a,  ð#  LATIN CAPITAL LETTER Z
 * b2 b2 öEFT SQUARE BRACKET/ c/ c/ ö REVERSE SOLIDUS+ d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINE� "60$ %60$ \GRAVEL #61( 1( 5ESMAL3AX 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	60 60 	F` 70 70 	G0 80 80 	H0 90 90 	I0 a0 å	°J0 ã6ã	0 K0 ä6ä L0 é6é0  M0 é6é0  N0 ì6ìÀ O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
97 7 
7 7 
U�  7 
V0  7 
W0  7 
X0  7 
Y0  7 
ã7 7  ã]CURLYâ7þ7þ`VERTIC>_7÷7÷RàX ö7öFTILD—7ç7çVDELET" aÙf" ×NO-BREAK SPAC* £9ó  ?F SIGXa˜9ê [POUND& Ž9Î‹CURRENCY) Waw–BROKEN BAaM8Ä {SECTIONN Ea†DIAERESI*aÚÀ0ae,     #  ò&LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac:  a, Æ #  NOT SIGN$ f$ 7$ VMACRO" "b0" %f8" jDEGREEI #b1' 1' «PLUS-MINUS+ 2+ d+ õ SUPERSCRIPT TWOŸ "b3+ /a6+ FHREE- 4- ƒ ÆACUTE ACCENT( 5( eU [MICRO¦ 6& 8& {PILCROW( 7( ff—MIDDLE DOt 8& %a5É vCEDILLA— b# f# ORIGHõbõcF ±VULGAR FRAC% ON3VARTER} d} b7 
FHALF4 e4 Èk T¡1 QUm S: cT%8en öLATIN CAPITAL LETTER A WITH GRAVçc?/84= ¦CIRCUMFLEX ³/80B C ©cÌ9h¾ E? ¾ 959| = Á¹ a= 2¹ = û e9=B ‡DIAERESI»õý Iý ƒ s9B 	ƒ dè/99Oƒ d…ºƒ UB 
ÂdC½=  d¤93 	 Ce‚ESMAL>fSHARP »evy	6 tet3s; ò  ergò 	@ pep8/	= ²
¬eé81; 
lel8é; ó '8¦@ ãðee: 0x008c,     #ñ#  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 08b, / #@ 	•DIAERESIS? "f3? /a2? 	O VACUTE; 4; /93; º  "f7@ %f6@ ÖDIVISION SIGNi 9) %97) # U¤ GGRAV¤ a; a¤ 
; ß b; 9Ÿ v ß c@ /81¶ ™2192? /9f? 	Fõ DHOOK/#39ÓeÓÅGREEK CAPITATVGAMMA6 8p %e9p 6 FTHET6 al 46 7SIGl #a6l 86 5PHI  a/ea4 FOMEG  #b1j 06 	^GALPH4 ØeR
	4 7DEL#b5h eh 	eEPSILOÙ33c06 žj  Pco5g 	
mcÏ >e  5TAUkcŸdf 	�3201Ë82 äDOUBLE LOW LIN’3207°%fc] ¿SUPERSCRIPTü03221f¤ó BULLET OPERATORÄ 3221ùfÅ¶SQUARE ROOT' e‚Ž …INFINITY$ 2v eŠ¥INTERSECTIÎ3224Bfiõ ALMOST EQUAL TOS 6—f—{IDENTIC( ¼f!ÏLESS-THAN ORY  ˆfüOATER4 #31†aV0REVà XD NOTŒ3232- fñ�TOP HALF DGRALç $32ç ¯oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi #50-b(9  1VERb  #50£dT7   DOWN AND R = 7b= 	5LEFw#51Øc À#  BOX DRAWIðNGS LIGHT UP AND R ð
    0x2518: 0x00d9, Ý #  BOX DRAWI; FLEFT: c: /c3: 	�VERTICAL{  "24A /b4A 	� 2� 2@ 	ADOWN} ¥HORIZONTALÃ 3‚ /c1B 	8@ ‚ 5@ 		F  "50/cdF DOUBLE : 1: /ba: 
� ø "528 d¸ 4aSINGLE;3 ˆ E 3E 6} #WN4 E V E ‚t  ‘ ½"55ƒ /b8ƒ r ƒ  ?“ ‚ 6D 7D ‡  ‚ D T D 7D bD ÂÆ  D = ‚2UP o Ã ‹9€ d‹#UPö C T † aC cKÃ † < b< /beÿ 
Â  ý � B Ib
Á B À d„ c„ ÂÀ  B } e; cÉ?‡fI KI �  OJZ ’ 6Í P I B â; G ™6*bÓ H X � -bè—  Ò  H A )d«\u Í .Ó 5d7J Ï J ` ” ;c÷J C :/cf·
;A Õ Eð0,     #  BOX DRAð*WINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca, ² #  BOX DRAH E +UPH A aA /d8A eVERTICy G ¥ N bN 7N ˜ Ý cN /ceN E £ 
N • "80G %dfG öUPPER HALF BLOCK, 4, c, ?LOW, 8, b, LFULLR Å %dd& OLEFT} 9© ð ORIGH, 1} &b0W , FSHAD #92' 1' {MEDIUM ( 3( 2( KDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
í`def en ñ(self,input,errors='strict'):,  Zcreturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp864', d !e=0 2().     id: .r=]/ J 	/ ä/ spr7=D# w“#  # )Z  ~0MapA0codáTmap =Ïñmake_identity_dict(range(256))
° 5 ‘.update({F {!25;&66ƒõARABIC PERCENT SIGN/ Ž¹ÐDEGREE SIGN
 ¡   0x0081: @b7,  à#  MIDDLE DOT
 & 2& E2219& ö BULLET OPERATOR+ 3+ a+ ˜SQUARE ROR 4' 5592' ÆMEDIUM SHADEO 5( %00( öFORMS LIGHT HORIZONTAL2 62 Z 2 hVERTIC0 70 /3cb 0 O ANDo 8? /24? 7LEFT99 x ODOWNt a; 1; 	³ R(b: 3® /UPs c9 1ˆ® 
ã d5 0¨ 5 ¤ e6 1¤ 
4 f4 8†Ø 	�  903 603b(õGREEK SMALL BETA79&E221e_ †INFINITY$ $E03c6$ P 6PHI+ $E00b1+ öPLUS-OR-MINUS SIGN. +E00bd. ÆFRACTION 1/2( +700bn( 4( !&24,ö ALMOST EQUAL TO+ E00ab{  Dö POINTING GUILLEME×9600b3 «4 
6fef…`ARABICæòATURE LAM WITH ALEF
 ðHAMZA ABOVE ISOLATED ë¿ (7fefê X [FINALU cb: Non
æ  #  UNDEFINEDz c% 6fef+÷ æ 06feføG Õ f° a600a‰¦SOFT HYPHE°a	6fe8Y� WETTERÃDMADDÃ–  aÒ6fe8
J J 6à 7% à3fe8?#  ”  ƒ å%8fL
9 ?BEHÈaÈ/95; T; ñðfe99,     #  ARABICð LETTER THEH ISOLATED FORM
    0x00ac: @60c, ö #  ARABIC COMMA( d( Lfe9d( d OJEEMd e< /a1< /HAŸ f; 5; K<  b0< K0660< õ-INDIC DIGIT ZEROæ #b13 ª 	3 6ONE2 22 2e 	'TWd 32 32 
7HREf 44 44 	FFOUR™ 53 :	Ë 7FIVf 63 6f 	6SIXe 72 72 
FEVEN4 84 84 	VEIGHT4 94 94 	(NI™a3 <fedËF bb; K061bn — SEMICOLOÎ @?febg OSEENbTb££ /SH= Ub= /ADx UL061fà ÕQUESTION MARK~cI&0aä†CENT SIG	c;<fe8n� _HAMZA’ cF?fe8FÿALEF WITH MADDA ABOVEM a<fe8aŠ M ” M 
z?fe8¤2WAW™ L “LfecaxDšAIN FINAL¤c˜=fe8�8 ?YEH„  MNITIK ±?fe8Ç+c¹?fe9¥BRv ¿?fe9’ TEÙORBUT"Ï9jÕ C I} Î?fe9>; Ý9)yõ; Üaó ¸: Ùaê ó; ð f: 0xfea9,     ð'#  ARABIC LETTER DAL ISOLATED FORM
    0x00d0: 0xfeab,  ; /TH< 1< d< ?REHw 2; f; OZAIN< 3< /b3< ËSEEN INITIALî 4; 7; H< 5< *?SADv 6: í D: 7: /c1° /TAb8; 5; Z; 9; ê œ`a: ê /GH< b< E00a6± öBROKEN VERTICAL BAR¹c/ c/ †NOT SIGN$ d$ fï‹DIVISION) e) d) ¾MULTIPLICAT/ f/ Efec9| 
på pepL0640; uTATWEEL½ e^dçF^†e]Î 
Ÿ ?QAFªe[dúK: Zdú?LAMt Xeè ?MEE; Ye·
é ?NOO
eZeê H^Yeö?WAWºeYe%ÏALEF MAKSURAD cf/Y¹ a?feb¹ ‡¶m6fecm
i ñ=MEDqe‚Lfeceïš<FIN«e“?fec® : Öe¡e8Tì f¢=fe7y SHADDA è f­=065q 5 H×f�e˜´› Ÿex ÀTTER HEH ISOðLATED FORM
    0x00f4: 0xfeec, û #  ARABIC LETTER HEH MEDIAL9 59 /f09 ýALEF MAKSURA FINA 6A 2A ?YEH8 78 dy _GHAIN´ 8; 5s QAF ISO(9; f; ñIGATURE LAM WITH ú 
 ¿MADDA ABOVEX aX 6“ X [bU -ddU Õ « è c; 9; K#d; /f1;  Ñv e; 625aÔÆBLACK SQUARE®rf: Nonea  ®óUNDEFINED
})

### Decoding Table

d  _t A = (P d'\x00'õ ¥00 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- ETEXT* 3* 3* 0ENDU 	( 4( 4( µRANSMISSIONX 50 50 UQUIRY$ 6$ 6$ ¢ACKNOWLEDGl 7( w7 -> BE8! 8! tACKSPACG t$ ªc9& öHORIZONTAL TABULATÅ n2 a2 •LINE FEEDÇ b( #Ç 0b& oVERTICV :x0c0 c0  
V r$ ® d& æCARRIAGE RETURme. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆô DATA LINK ESCAPR*x1”1”öDEVICE CONTROL ON/ 
–1–/ 4TWOX1›1›/ 6HRE` 
¤1¤1 EFOURa 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCE
)19È1ÈY  USZ'\x1a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹ðGROUP SEPARATOR
     '\x1e'  ð#  0x001e -> RECORD SEPARATOR
"  - f- f- LUNIT+  ( 3   X  20+ RSPACEM !" 1" òEXCLAMATION MARK- "- 2- LQUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( `\u066a- Ê 5( çARABIC PERCENTX &+  /ú 60 �MPERSAND~ 1"'"#  7& ƒPOSTROPH%(M 8' ñLEFT PARENTHESIST -')- 9- ORIGH.  *. a. sASTERISx+% b% GPLUSó ,& c& RCOMMA› -" d" ³HYPHEN-MINUÄ .) �’FULL STOPO /& ‰TSOLIDJ 0$ 3‚¢DIGIT ZEROK 1' ‡' #ONˆ2& €& #TWL 3& {& 3HREN 4( {› 3FOUo5' zO 3FIVN 6' q' 2SIXè 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¬@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 �L3 1Lf M3 À004d -> LATIðN CAPITAL LETTER M
    'N'   ý#  0x004e -> LATI3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 b3 óEFT SQUARE BRACKEb$\\1 Ç 5c0 ãREVERSE SOLIDUÁ]+  , d, ?IGH] ^1 $óCIRCUMFLEX ACCEN‹ _. rOW LINEà `% 6YGRAVEN a) ESMALÑAZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 óŠ	1 K1 l1 ô»	1 L1 m1 ù1  n1 ù1  o1 üÄ p1 7b  q1 r1 s1 Pt1 "u1 v1 w1 À    #  0x007ð7 -> LATIN SMALL LETTER W
    'x'   Ÿ#  0x00781 X1 y1 91 Y1 z1 a1 Z1 {1 b1 òEFT CURLY BRACKET/ |/ c/ ÒVERTICAL LINE* }* d* ORIGHZ ~0 e0 CTILDR B\x7f% >f" UDELET# )b0# "80# ’GREE SIGN� J\xb7( 1( “MIDDLE DOî `\u2219) r  82' ó BULLET OPERATORS  , a, 3, —SQUARE ROT 8592( 4( ¥MEDIUM SHAï Au250Î } 5) qFORMS LG¥HORIZONTAL„ )50\ 63 ª1 (3c� Âd 1 _ AND q (24@ Ñ@ 6LEF[)52z Ú: ODOWNv 1< å< 	¶ tñ 	± ï; /UPu 	�ú: ± 
ç 0« 6 § 1§ 7 § 5 8� 5    803b291 /KÃEBETA=721ea 96sINFINIT‚h\u03c6% 4R 3PHIQ 0xb1* #  ã94ÚPLUS-OR-MINUS¶d/ ;ÅFRACTION 1/2X tX ;) 4) Hu224391ó ALMOST EQUAL TO, :xab~ , Lô POINTING GUILLEM/;\xb4  µ5 AufefŸ`ARABICúòATURE LAM WITH ALEF
 ðHAMZA ABOVE ISOLATED  Â  Y 	î 8Y ZFINALV )ffS•UNDEFINED| & ?& !ef2û /¢ ê H @H Ù P³ Àxa0'     #  ð0x00a0 -> NON-BREAKING SPACE
    '\xad'
 A #  / 1/ ³SOFT HYPHEN( Pufe82* ( 2( óARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORMK 0xa3I  s 3K ”POUND SIGr :xa4' 4' ˆCURRENCY*  œ , œ 5* œ OHAMZœ Pufffew K 6K “UNDEFINEDÂ & 7& )e8L 8& —  " Ñ f† 9: ÈBEH ISOLATED^Xufe95< a< T< 9< b<  H= H060c= c= UCOMMA>!e9udd) KOJEEMß (a1f e= /HAaf< K= G0660y bXÎô-INDIC DIGIT ZEROê 8066­ b]4  $ON�Hu066hbh	g (TWf RPbPf  HTHREh 4b^5  GFOURÏ @bh	œ 8FIVh 67Qh  7SIXg 73 ^3 &EV H06685 m	œ WEIGHTj ðbh	5 &NI¡9fedÔ` F#(1b¥ `„SEMICOLO Iufebi P'OSEEN'b«d /SH> 		e ?SADz 8061¼beÓQUESTION MARK…!xaðcYLCENTäcK€Ú8LcV> ¾N qcqN – N «cŠN 2WAWYM Àeca'   #  0xþ.00c5 -> ARABIC LETTER AIN FINAL FORM
    '\ufe8b'   #  0x00c69 þYEH WITH HAMZA ABOVE INITIL dL 7L ÛALEF ISOLATED‰ (91= 8= ?BEHx (93; 9; ¿TEH MARBUTA 7D aD ÷ 9Cb;  H» fw c< OJEEM÷ a÷ d< /HA2aî e; K< 9³ f< ?DALfa+.d0< /TH= _.d1= Rg^ah.d2< Z!›bi.d3= OSEEN¥bj/d4<  H= 	/Ö ?SADx 	ñ Ø D; cŠdÇ TXh'c5dÆ Z< 	î Ç £zcî ¾ /GH= 0xa6² dÀóBROKEN VERTICAL BAR3:xac0 ´„NOT SIGN% föU �‰DIVISION* d* Œ»MULTIPLICAT0 Hufec€d€ ê Ÿ@0640½ îe€sTATWEELÁ Hufedõen FnŽÔ f m ?QAF·dek K; ej /LAJeì h M†eÁí i ?NOOeî j 9eÐe8 -> ARABIC ó-LETTER WAW ISOLATED FORM
    '\ufeef'   #  0x00e9 -> ARABIC < ÏALEF MAKSURAE (f3E aE »YEH INITIAL€ (bd; b; ?DADw (cc< c< ~AIN MEDv (ce: d:  GH< =FIN± c± e; o1y f> OMEEMð 7{ 'f0= oSHADDAì 8065s -f16 H5ž 'f2+ ONOONž (e9= 3= H†Ê/f4< Ê(f0v 5: 	ÀÑ(f2B 6B  ½9 d{ 79 E· dj8< ?QAFif< 	³ñIGATURE LAM WITH þ 
 M"_ABOVEY 6
	ÇY '	¶â  ­ /dTâ K'	øä  Øx 925aÛåÅBLACK SQUARE2(ffIfÐóUNDEFINED
)

### Encoding Map

e �_map = {L  }100:…000,ž ”FNULL  1  1  öSTART OF HEADING, 2, 2, FTEXT) 3) 3) 0ENDS 
' 4' 4' ¶RANSMISSIONV 5/ 5/ VQUIRY# 6# 6# ¢ACKNOWLEDGa7' 7' (BE8  8  wACKSPACE 9% 9% ùHORIZONTAL TABULATÀ a1 a1 –LINE FEEDÂ b% b% oVERTICT c/ c/  ŠT d% d% çCARRIAGE RETURde+ e+ ðSHIFT OUT
    0x00À0f: 0x000f,  À#  SHIFT IN
   "10$ %10$ öDATA LINK ESCAPE, 1, 1, ÷EVICE CONTROL ON. 2. 2. 6TWO\ 3. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) —SUBSTITUT¦ b& b& ßc" c" ×FILE SEPARATONd* d* _GROUP+ e+ e+ oRECORD, °1°OUNIT*  2¶2¶FSPACî 2«2«€EXCLAMATŒ6MAR‹2©2©OQUOT* ¥2¥¦NUMBER SIGT2œ2œLOLLA' d2d•AMPERSANDÝ2]2]—APOSTROPHï N2NöLEFT PARENTHESISR X2XORIGH- \2\wASTERIS@Z2ZKPLUS]2]VCOMMA— T2T·HYPHEN-MINU¿ Q2Q–FULL STOPM J2JWSOLIDH 3C3C–DIGIT ZER—3H3H& ê3A3A% á3<3<% 	Ø3<3<— 	Ï3Ï3ÏM 6FIV3a3a& 5SIX+3a3a% 6EVEÔ3b3b' E<N ]3]' 'NI3V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES_4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4yÀLATIN CAPITAóL LETTER B
    0x0043: , õ #  LATIN CAPITA2 C2 42 42 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2 22 22 R2  /532 S2  5 T2  5 U2  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷ESMAL±A36õ6õ	0 6ó6ó	0 6ñ6ñ	0 6ï6ï	0 í6í	0 6ë6ë	0 	6é6é	0 6ç6ç	0 6å6å	0 6ã6ã“	0 6ä6äÃ0 À LETTER L
  “  0x006d:  ,  ð	#  LATIN SMALL LETTER M
 0 e0 e0 	N0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENc. c. ÖVERTICAL LINEW ÷%7d) ORIGHX ö7öGTILDP ç7çVDELET" aÙaÙ÷NON-BREAKING SPAC. §c. †CENT SIG\aœaœ[POUND& ’a’‹CURRENCY) [dkuBROKEN D&BAaš9Z šPPOINTÒ wGUILLEMŸaŸdŸ,NOÕ šaÑ¦SOFT HYPHEü bO8!jDEGREEÔ b9#ËLUS-OR-MINUS. -8| –MIDDLE DOebù #<ú bú 9çÅFRACTION 1/4˜bþ 9­( 2( dª d‘¡MULTIPLICAV 	*f/ ïPDIVIS ) #3bx9W UKDBETA„ #3c09K, 4PHI+ #60ÿ aùµARABIC COMMS #61[bƒ( …SEMICOLO#61sbs, AQUESEMARK„ 42eÛ 0 uTATWEEL* 55f* uSHADDAH* 6T bT õ-INDIC DIGIT ZERá#66] b] 	3 O¬#66”bh� 	2 'TWd bö2 À-INDIC DIGITð THREE
    0x0664: @0b4, ö #  ARABIC-INDIC DIGIT FOUR3 53 53 
'IVf 63 63 	6SIXe 72 72 
FEVEN4 84 84 	VEIGHT4 94 94 	7NINÍ a3 2 Ä PERCENT SIG– 3221b %82b äBULLET OPERATOZ3221Z %83+ ¤SQUARE ROO´ B221e� %91' ƒINFINITYØ 32249räLMOST EQUAL TO+ 2500O 8Ð pFORMS L*¶ HORIZONTAL2 22 ] 2 hVERTIC0 c0 d± 0  DOWN AND Rq f 1˜ c6 5LEF#51Ð/8e5 /UPi ,/8f4 	
g Ò a3 m  2¡ ¥	: 	s 2s ª9 E° 3t b® 9 t †t 	­ ?  9(]´MEDIUM SHADR325aêfµbBLACK þBfe7dH%f0È ­P 0DA ^ 0AL ¤ 5 8] c.5 ûLETTER HAMZA ISOLATED= 1r c½
= ÿALEF WITH MADDA ABOVEM aM =FINÔ 3— )— Þ — 
a M — cð
J 2WAW-– bã d
L ?YEHL  MNITI.7cÆ
K Åla¯<  fÀ a¯
9 ?BEH(9ut ; ê 9
u ÀIC LETTER TEðH MARBUTA ISOLATED FORM
    0xfe95: 0x00aa, ÿ #  ARABIC LETTER TEH; 7; c; 
kNITIALu 9: /abu Hv b< c< w d; /adw OJEEMí f< /cc< 
w "a1; /ae; /HAc"a3; c² ; u Øfu K; aÙ± < w Úcw ?DALbaÙ/d0² /TH< Ú/d1< RPaÙ/d2; OZAIN³ bÚb?SEE< Û/d3x < ebÜb/SHx Ý/d4x = y Þb?SAD+Þ5w  ; u ÜeñD: ÉbÜ6u ; u cÚ/d7: T´cž/d8; Z; `d>‹#ca*` ; <FIN‹c˜9®  8 I#cr eý : =MEDþcÑF GH; °#cev ü= ê ¯: ì "d0v f< î dJbw F›d#eÖ; œÀfed5: 0x00f8 ,  ð#  ARABIC LETTER QAF ISOLATED FORM
' ï0xfed7: 0x00e2; 	kNITIAL: 9: /fc: Ku b; /e3; 	u d: /fb: ?LAMê f; /e4; 	u #e1: f: ?MEEv #e3< 5< 
w 5; f›ONOONí e×6w < w Ø�?HEHv Ø7v ; u cì � : =MED†e/e8s ?WAW® 9; ÏALEF MAKSURAD #f0¸ ß	D <FINFf\/fd… Yn#f2| ä ; s “as 	¦f’2€IGATURE €QWITH ù 
 ¿MADDA ABOVEF6Ê ’ X ç 9­ OHAMZ­ 8­ 9­ X ­ :9ÎfG-9eÛG ‹ ðL}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with genc; P.py.
c À#"

import c cs

###` ²APIs

class ($ . 1):
¹Qdef eW ñ(self,input,errors='strict'):,  écreturno “.charmap_B = , †ing_map)m  de‡ m )B 	m   m dtable)ø ÁIncrementalEå r ð):
    def encodóe(self, input, final=False):
  ð	return codecs.charmap_en (:  F �.errors, ðing_map)[0]

class IncrementalDe<  r( >cs. ~ Qdef d, ¨ '@ ¨   ¨ Xtableª àStreamWriter(C÷ ,ª  ¤ Dpassã  ORead9  	9 D### 2às module API

ý Ãgetregentry(7 
Žž UInfo(¯Õname='cp865', d !e=0 2().     i¼: 'r=µEr/ J 	/ þ/ spr7=D# w“#  # 0)

IZ ping MapA0codáTmap =Àñmake_identity_dict(range(256))
° 5 ‘.update({F€0x0080:  1c7,ö#  LATIN CAPITAL LETTER C WITH CEDILLA? 1? +fc? ESMAL= U= –DIAERESIS? 2? /e9? 	E? VACUTE; 3; 2; 	A; ¦CIRCUMFLEX@ 4@ 4@ º  5? 0? GGRAVº 6; 5; ˆRING ABO@ 7@ ³	t±8= a} 	r79@ b@ 7 a? 8? 7b; f; 	Iñz  c? e? ù d@ ê
 º e; ckd­¼  fA 2A 4 9çiB ù
k9å/e6;–IGATURE Aä9Ùc3 p 5 Óf(	ÙOâ£À    0x0094: €0x00f6,  ð#  LATIN SMALL LETTER O WITH DIAERESIS
+  7 @95:  /f2? VGRAVE; 6; b; 	Uz ¦CIRCUMFLEX@ 7@ 9@ { 8; f; 	Y{ õ  9? d4oCAPITA6aA c€ A ý ‚  bA +f8A ¶WSTROKxc< %a3< ¦POUND SIGN^d& db £ d e> F20a7d [ESETAe f' ?019>
FˆEHOOKŸ !a0: 50e1a · A: FACUT #a1; d; 	I; 2; f;v  v 3; av 	ñ; 4; ì 
N± GTILDì Ÿd; Æ= ¡a³ öFEMININE ORDINAL INDICATORš—b6 oMASCUL7 “b“÷INVERTED QUESTION MAR†E2310RÊREVERSED NOTjarar$ Ub±VULGAR FRAC� †ONE HALFî MbX 4 gQUARTE%^a˜î qEXCLAMAp 
ñ U700a1ÿEFT-POINTING DOUBLE ANGLE QUOTE s50a46ŠCURRENCY2bb6259£ —LIGHT SHAbbN'25ÃlMEDIUM( ;6259;LDARK& &6250ÒBOX DRAWINGS ‚  EICAL†b"6252Õ 7 – AND LEFT@ '6256ì 	@ q 1 SI\A rH 2?256¿ H ª‰ X H D6255a	� CDOWN| Í D QE2555éD À DOWN SINGLEð AND LEFT DOUBLE
    0x00b9: 0x2563, ó #  BOX DRAWINGS/ • VERTICALH A aA /51A 8 b8 78 
ODOWNu  c= d= 
/UP;  d; c; $UPô 3HSING3eB bB 2 } R ü fB /10B @LIGHªû #c0< 4< 	ú RI w "c1; 3; ¦HORIZONTAL@ 2@ 2;· B 3B 1B 
	mÃ 4A 0:
z 59 3z F 6F /5e}º Á #c7I fI ¯JI Z ”8I aI @ ü5< ƒ� z ù/69z M/66A 
 C 6Â — ÓÆ B | 6R| G 62UP óA Rd/68N
ØH ^ ×d%6/WN’ //65’ Ù& ™” 75k
Ü á£ × 95	gC œ C C/52Ð E Bp#WNÛŠ V Š >6‚ðÀAL DOUBLE ANðD HORIZONTAL SINGLE
    0x00d8: 0x256a, õ #  BOX DRAWINGS VERTIC8 9 ANN HDOUBN 9N /18N �LIGHT UPG FLEFTˆ a: /0c: 	ADOWN< RI = b= 8w ¦FULL BLOCK& c& 4c ¬LOWER HALF, d, �  ¯ + e+ %90W ž , f, 8, ?UPPƒ  e0, E03b1X õ	GREEK SMALL LETTER ALPHAã !e14 50df4 ZLATIN4 vSHARP S6 26 53936 j @CAPI4l GGAMMl 36 cÌ 6 	  &PIg 41 ag 8SIGg 56 c6 	g 4 64 50b5Ñ ¦MICRO SIGN� 7& &3cÁ  6TAU2 -E03a6X 2 )'PHö 6039œ4 GTHET]O03a9j GOMEG6 ?03bÒ 
8DELj 521ej †INFINITYø <03cø 	„	ö '03‚ö 	2 gEPSILO’&22ö §INTERSECTI( f6226BIDEN©%TO¸ fCªPLUS-MINUSf62263øGREATER-THAN OR EQUAL _ 6226oOLESS1 623232TOP) é FGRAL½ ù6232å oBOTTOM0 õ%f7É‹DIVISIONë ø6224’oALMOSTâ  ñ&0b±  DEÉR ä6221¸ö BULLET OPERATORÖ Ù&0b¦ –MIDDLE DOfÉ6221–˜SQUARE RO' ¼&07ïÏSUPERSCRIPT û lfÔ50b2/< 'TWGÍ625abBLACK ” Ü ¿'00( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U d'\x00'˜ ¯’00 -> NUL( ! 1! 1! àSTART OF HEADIÐNG
    '\x02'
 õ #  0x0002 -> START OF TEXT* 3* 3* =END( 4( 4( µRANSMISSIONX 50 50 UQUIRY$ 6$ 6$ µACKNOWLEDGE( 7( •7 -> BELL! 8! 8! tACKSPACG t$  9& öHORIZONTAL TABULATÅ n2 a2 •LINE FEED~ b( mb& oVERTICV :x0c0 c0 HFORMV r$ ® d& æCARRIAGE RETURme. ‚ e, †SHIFT OUëf& f& IK )10%  10% ô DATA LINK ESCAPR:x11- 1- öEVICE CONTROL ON/ 
–1–D/ 4TWOX1›1›/ 6HRE` 
¤1¤1 EFOURa 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCEî*19vÈY eMEDIUMM a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  �  =2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSAN¬1"'"•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >b3{“DIGIT ZERÝ8' €' 2/& y& )À '3'        ð#  0x0033 -> DIGIT THREE
    '4'   ( 4( BFOUR' 5' 5' #IVN 6' 6' 2SIXM 7& 7& BEVEN( 8( 8( REIGHT( 9( 9( 3NIN� :' a' CCOLOq ;" b" GSEMI& <& c& ÓLESS-THAN SIGQ =+ d+ gEQUALS( >( e( |GREATERV ?. f. ÒQUESTION MARK@*  40* ÃCOMMERCIAL ADA* 1* òLATIN CAPITAL LETTER A] B3 23 B3 C3 –f C3 D3 ¡3 D3 E3 ­3 F3 ¹3 Ff G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è3 J3 K3 ù3 [L3 1Lf M3 f M3 N3 3 tO3 3 Of P3 5'3 P3 Q3 0Q3 R3 0wS3 0Sf T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0\Y3 0Yf Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 f5-ãREVERSE SOLIDUÁ]+  , &Rð] ^1 Ðe -> CIRCUMFLðEX ACCENT
    '_'   ò#  0x005f -> LOW LINE% `%  60% YGRAVEN a) 1) òLATIN SMALL LETTER AZ b1 21 B1 c1 31 C1 d1 41 D1 e1 51 f1 61 Fb g1 71 G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 ü®O1 p1 7ß P1 q1 Q1 r1 R1 s1 S1 t1 "u1 Ub v1 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ‡VERTICAL|}* ORIGHZ ~0 CTILD°3\x7³ó7÷UDELET# "c7H # 8éPCAPIT¤ ÊÓC WITH CEDILL×3\xf©@ øU> ƒDIAERESI¥J\xe9€ E@ 6ACU¼ *e2< A< “CIRCUMFLE-J\xe4A "A ½ 0@ 1@ HGJ\xe5< << •RING ABOVºeºð 7 -> LATIN SMALðL LETTER C WITH CEDILLA
    '\xea'
 õ	 #  0x0088 -> LATIN SMAL> E> •IRCUMFLEXA bA 9A •DIAERESIS@ 8@ a@ UGRAVE< f< b< I½ | e@ c@ Cý cA dA 	½ *c4< e< eCAPITA|A¿ *c5B fB †RING ABOB)c9C /90C FACUT€6> 1> =•IGATURE A4 c4 24 ÷ 6 f-&936 j åO+ªfw 4A +*f2ë 5@ 	êf#/96< U½ ¦7A 
} 
$9áY} ù d9à°	|B 
%9âB B f$9èþUSTROKq*a3ºå¤POUND SIGNLdd Ë¦ f Pu20a7h H9ÎhPESETAg Au019J( ´	ÉF�DHOOK¢  e1a  «a¬	; /
ªd< ªÄ*	< fAa²	x 
< 
_a¸ú
< ð ³N+ETILDõd< ¯Î> a¶ ±ôFEMININE ORDINAL INDICATOR¡b7 §oMASCUL8 
£a£ôINVERTED QUESTION MARPu2310ÒGa–ðREVERSED NOT SIGN
   € '\xac'  ð#  0x00aa -> NOT SIGN
 Z'\xbd% b% õ	VULGAR FRACTION ONE HALF5 Z c5 tQUARTER8 *a1m d8 ñINVERTED EXCLAMAr EMARK6 b6 e6 ÿLEFT-POINTING DOUBLE ANGLE QUOTF  4F fF ˆCURRENCYAu259¨ 8 b0* ³LIGHT SHADE˜  ( 2T ( 1( mMEDIUM) 3) 2) LDARK' 0P 3' ÒBOX DRAWINGS …  /FICALˆ 2Ü ˆ 48 P AND @A 6ñ 5A s 1 SIcB yI 	Â 6I ²‹ Y I (5627I CDOWN~ Ð E 5E 8E Ó 	¼9E  |#Ì 	^‡	×B 9 7À ›9 w  Û¤> %UPAz â< ¨	< /UP}·C µC {(10 ²	C ÿ 1cÅ=  þ Rßÿ 3< Ù< ‰HORIZONT’@cñA  º C 1C ÄÆ 0?c| 3| y±| G '5eÀc	Ä ]‘(5fJ ‹ L J [ J aJ Ï5Øƒ | (69| 	| R6cÀNGS DOUBLE Dñ<OWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICALH VRIGHTC 5C dC ~ c~ e; 	~ H 7H fH ‘UP SINGLEÀ B ß Ì '68I /d0I 
Q_ I 4I 1I D•” 5K 2K – (59K 3K #UP(èÚ 5#4D Ø D ž (52ˆ 5D F 3F 6F { Ð (6bF 7F }J Bì Û (6aO 8O 9 ™ O e O 1n9O LŒ1 UPH 7LEF˜0]/da; k Ídy 8y b> §FULL BLOCK' 	è@­LOWER HALF- 	’ * ³ , 9Vd¢ - 8-  ?UPP† G03b1¢eäó	GREEK SMALL LETTER ALPHAè 0xdf3 (eÐZLATIN5 sSHARP S7 Hu039£e¼l eCAPITAn DGAMMn Hu03cÐ e¨7 	£ &PIi ai –2 i 9SIGi 	7 ‰7 	i 5 !xb�x¦MICRO SIGN“ ceY\  6TAU3  a6hŽe=3 Æ 'PHû 9ªe#5 GTHETdae7 GOMEG7 bÖ 7 	26DELl H221eØ &†INFINITYý cý Z  	û Œ0%3 ÀMALL LETTER øEPSILON
    '\u2229'   #  0x00ef -> INTERSECTI) '61) !f0) ³DENTICAL TOR !xb' R  f1) çPLUS-MINUS SIG~ (65U 2, øGREATER-THAN OR EQUa Xu22645 35 OLESS2 83202 42 �TOP HALFî CGRALÁ Au232Ã  f5. oBOTTOM1 0xf7] ò 61 ‹DIVISIONð  48, [ 7* lALMOSTç !xb³ V 8, kDEGREET 1Â f9( ó BULLET OPERATORÛ +xbª a, £MIDDLE DOT' Xu221a§ b' —SQUARE RO( 807f( c( ôUPERSCRIPT LATIN SMALL LETTER ü0xb2; à d= $TWTAu25a8e, bBLACK — º x' U ÏóNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  100:000,3 )2NUL-  1  1  öSTART OF HEADINGL 2, 2, 2TEX€U 3) 3) 0ENDS 
' 4' 4' pRANSMIS‚ 5/ 5/ VQUIRY# 6# 6# ¶ACKNOWLEDGE' 7' 7' (BE8  8  2ACK€ Gå 9% 9% €HORIZONTð0ABU?‚1 a1 a1 –LINE FEED› b% b% 3VER¥T  c/ c/ KFORMT d% d% âCARRIAGE RETURÕ¤ e+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. z Ñ 1‹1‹. 7HRE^ ”1”0 2FOU‘_ ”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Fe BLOCK@1»1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤†ILE SEPAßN©1©ðGROUP SEPARATOR
³    0x001e: , ð #  RECORD SEPARATOR
 , f, f, OUNIT*  "20* %20* USPACEK #21! 1! öEXCLAMATION MARK, 2, 2, OQUOT* 3* 3* ¶NUMBER SIGNQ 4' 4' \DOLLA' 5' 5' {PERCENTO 6( 6( –AMPERSANDt 7% 7% ‡POSTROPH8& 8& öLEFT PARENTHESISR 9, 9, ORIGH- a- a- wASTERIShb$ b$ KPLUSí c% c% VCOMMA— d! d! ·HYPHEN-MINU¿ y%2e( –FULL STOPM r2rWSOLIDH 3k3k¥DIGIT ZEROI 3p3p& &ON~3i3i% 'TWJ d3d% 7HREL d3d— 6FOUR3c3cM 7FIVL a3a& 6SIXâ a3a% 6EVEü3b3b' E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 n4ö4ö&Ld þ4þd M2 	4	À #  LATIN CAóPITAL LETTER N
    0x004f: , É #  LATIN CA2 O2 "502 /502 P2 12 12 Q2 22 22 R2 32 32 S2 42 42 T2 52 52 U2 62 62 V2 72 72 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 ÷EFT SQUARE BRACKE[c/ c/ çREVERSE SOLIDU¸d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ %5f- …LOW LINEÛ 66\GRAVEL 6÷6÷ESMAL‹AX õ6õ	0 B0 ó6ó	0 C0 ñ6ñ	0 D0 ï6ï	0 í6í	0 F` ë6ë	0 G0 é6é	0 H0 ç6ç	0 I0 å6å	0 J0 ã6ã;	0 K0 ä6äk	0 L0 é6é0  M0 é6é0  û6ì6ìÀ ù7ø7ø`  ÷7 7 
õ7 7 
ó7 7 
97 7 
7 7 
í7 7 
ë7 7 
é7 7 
çà79: 0x0079,   ó  #  LATIN SMALL LETTER Y
    0x007a: , 0 Z0 b0 b0 öEFT CURLY BRACKET. c. c. ÖVERTICAL LINE) d) d) ORIGHX e/ e/ GTILDP f! f! VDELET" "a0" f" ×NO-BREAK SPAC* 1* aœ  INÇ õED EXCLAMATION MARKÑ "a35 9ú ¦POUND SIGN& 4& a… ‹CURRENCY) §%a6Ð öFEMININE ORDINAL INDICATOR_ ­a'ÿLEFT-POINTING DOUBLE ANGLE QUOTÊ Ä%aa{ :NOTŸ bM8$ kDEGREE' J%f1' «PLUS-MINUS+ 2fuõ SUPERSCRIPT TWOæ "b5+ e[MICROQ 7& fÇ –MIDDLE DO±bh7¢ PMASCU­ib$î±VULGAR FRAC ONbFARTE böaM7 FHALFî ÚakŽAQUESm 	‹ce8PCAPITŠõA WITH DIAERESISs ca8¦TA RZFABOVC"c6}%92WB —IGATURE A5 ²/805 ¸ C¸ vCEDILLA¶ 9t ? E? 7ACUdª/a5| N= T}dî 9= O= q#d8» ý/ú A VSTROK8d�9ê> U ce§A 	DfSHARP &e83	6 e7GRAen«; 
©e(+83l; ¥CIRCUMFLEX&e4@ ªe|+ õ  e+k e£	s ÀETTER C WITHñ CEDILLA
    0x00e8: 08a, ö #  LATIN SMALL LETTER E WITH GRAVE; 9; 2; GACUT; a; 8; ¦CIRCUMFLEX{ b@ 9@ –DIAERESIS? c? d? 	Iõ d; /a1; õ e; /8c; õ f@ b@ õ "f1? /a4? 	Nõ FTILD¯"f2; /95; 	O; 
%"f3; a%
; 
0"f4; /93v 0 #f6@ ñ 
{ 0 7? %f6 ÕDIVISION SIGNNfC9˜
h WSTROKZD%97e  UZDa
; Z?9Û v Z@
{ Z É9þ
Yõ ? $19Žf4	F? DHOOKª#39�e�ÅGREEK CAPITAïEGAMM##39àem6 FTHET6 al ~6 7SIGl a´e6 5PHIÖ aDeÃ4 FOMEG  b%e0F6 	ùGALPH4 ’eê4  7DEL"b5G/eeh 	eEPSILOT33c06 Ýj  Pco£1  
mcÏ }4  5TAUkcŸ92  �3207ìfõ¿SUPERSCRIPTl320a‚9;hPESETA€3221 f ð
BULLET OPERATOR
    0x221°a: 0x00fb,  ð #  SQUARE ROOT
 b0x221e' %ec' …INFINITY$ #29$ f$ ¥TERSECTION( "48( %f7( õ ALMOST EQUAL TO+ #61+ 0+ {IDENTIC( 4( 3( ÏLESS-THAN ORY  51 21 GREATER4 23104 %a94 0REVà •D NOT SIGå #32- %f4- ôTOP HALF INTEGRALç $32ç 5- oBOTTOM0 #50] c] öBOX DRAWINGS LIGHT HORIZONTi 2502Ã b(9  1VERb  250c7 'da  p  DOWN AND R = 7bt  = 5LEFw#51Øc <  /UPw fd®; 
u î c%{  2¶ bŸ
fA 	� 2� �»  2è 3‚ /c1±	8@ ‚ ‘ñ	Â F  5§d† oDOUBLE¨5bq: � l5àd¸ 4aSINGLEwª N E 3î6· #WN4 E V E ‚t  ‘ 45Ÿ/b8ƒ r ƒ  ?“ ‚ 6Ç bg	F{ ‡  ‚ D T D 7D D ÂK D = ‚2UP o Ã ‹Sd‹#UPö C T † ácKÃ † < bÿ e‡
Â AQB Ib
Á B À d„ zƒÀ  B } µcÉÀAWINGS VERTIð CAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7, ð #  BOX DRAWINGS VERTII 8 I Z I #60I cI @ P ’ B 1B /b5B ; z ‹ =LEFÓ #62H 6H “  Š H X � 3H 9H ? — H A 4A /d1A (WN¡¬HORIZONTAL¦#65J 2J �  ‡ J Õ 6J /cbJ  Q DOWNaJ × 7C fC /UPÕ 8H /d0H Ó 9H /caH E /UPÑ aA /d8A âLG ¬bN Rf;mcN /ceœ Ý £ 
þG 8žd´öUPPER HALF BLOCK, ·Ê?LOW, ÄOLFULLR Å %ddÅ q}  9© ð ¸, 1ALäFSHADã9‡{MEDIUM ( ðeKDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
í`def en ñ(self,input,errors='strict'):,  creturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ Àal=False):
   ð	return codecs.charmap_de ñ(input,self.errors, ðing_table)[0]

class StreamWriter(CO ,D 8cs. 0):
x Jpass9 ORead9  	9 ó### encodings module API

def getregentry(7 
æ ž QInfo(�  ‘ Õname='cp866', d !e=0 2().     ²incremental: 6r=I EÀ /er/ J 	/ D’/ spr7=c*R # w“#  # 0)

IZ ping MapAWd_map =ñmake_identity_dict(range(256))
°  Ámap.update({Fð 0x0080: 0x0410,kö #  CYRILLIC CAPITAL LETTER A5 15 15 &BE6 26 26 V6 36 36 'GH7 47 47 D6 56 56 I6 66 66 Z£ 77 77 m 86 86 I{95 95 gSHORT ; a; a; K"b6 b6 &EL§ c6 c6 M6 d6 d6 N6 e6 e6 O5 f5 f5 P³9d2d%ERl 9e2e&ES6 e2eT¢ e2eUk c2c&EF6 c2cHP9c2c'TSØ c2cCš9d2dS¥ f2fC9 ða: 0x042a,     #ð   CYRILLIC CAPITAL LETTER HARD SIGN
    0x009b: @42b, / #= FYERU8 c8 c8 KSOFTu d= d= Er e5 e5 Y¨ f6 f6 Al "a06 .306 ESMALQ3 13 13 BÓ #a24 24 V4 34 34 'GH5 45 45 D4 54 54 I4 64 64 Z� 75 75 i 84 84 IÔ93 93 gSHORT 9 a9 a9 KW3W 	A&EL¡ S3S 
4 M4 J3J 
4 óaI3I 	4 Og F3F 	3 P£bD6259—LIGHT SHAgb86259lMEDIUM( ,6259øLDARK& 6250N ÒBOX DRAWINGS ‚ vVERTICA{b 6252 7 • AND LEFT b,6256ì 	@ q u SINGLEA g DOUBL4@?256¿ H 8 H X � S6255ˆ	� CDOWN| D c6255 D x D ˜ ˆ t6256µD  ÿ  × Y|?255Yp A y €6255Ty u ‰6255U= %UPø x �6255Ä	; /UPwž6255:B uÀLE
    0x00b°f: 0x2510,  ð#  BOX DRAWINGS LIGHT DOWN AND LEFT
( c0x00c0< 4< 	!UP: RI ; 1; 3; ¦HORIZONTAL@ 2@ /2c{ 	· B 3B 1B 
�VERTICALÃ 4A 0:
z 59 3z F 6F /5eº fSINGLEÁ v DOUBLEK7I fI 8 I Z I 8I aI @ 9< < ÑNa> /69z MbA 6A 
 C cC Â — NÆ dB 5B | e: 6R| G /672UP óA Rd/68H ’  H ^ Qd%6/WN’ //65’ Ù” 75k#UP$á£ × 95	C œ C C/52Ð E B3E y Š V Š >/6bE ðI òC6CN † — N d œ U1iÜ�	ÚdQ0Q: 6 Ãçw M8w ¦FULL BLOCK& 08Ý¬LOWER HALF, 8�  ¯ + 9Ež 	, À   0x00df: 0px2580,  ð#  UPPER HALF BLOCK
 Ö0x00e0: 0x044, ö	CYRILLIC SMALL LETTER ER4 14 1` 4 S4 24 24 &TE4 34 34 U3 43 43 &EF4 54 54 &HA4 64 64 'TSÐ 75 75 'CH5 85 85 SŸ 95 95 C7 a7 a7 –HARD SIGNb; b; 7YER¯c6 c6 KSOFTq d; d; Ke3 e3 Y¢ f4 f4 fT0  eCAPITAV%IOBfV56  	Š4 V0ï j ¶UKRAINIAN Ifb5@  	t > m0Ð ~ &YIè o56  	t 4 o0º j fSHORT Áfu5;  	o 9 y&0bjDEGREEˆfk6221kæBULLET OPERATO8f_&0bú ¦MIDDLE DOT J6221…˜SQUARE RO' ;6211‚kNUMEROŸ ''0aâ{URRENCY) 625aï bBLACK } Ÿ 0( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'�0 # Œµ000 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- 2TEXl x 3* 3* 0ENDU 	( 4( 4( ¢RANSMISSIO X 50 50 UQUIRY¦ 6$ 6$ ¢ACKNOWLEDG¤ L 7( w7 -> BE8! À0x0008 -> BAðCKSPACE
    '\t' ó   #  0x0009 -> HORIZONTAL TABULATION2 n2 a2 “LINE FEED& 2x0b( X b& oVERTICV :x0c0 c0 HFORMV r$ ® d& äCARRIAGE RETUR¨ 2x0e. ‚ e, •SHIFT OUT¨ f& f& IK )10%  10% ô DATA LINK ESCAPR:x11- 1- öEVICE CONTROL ON/ 2/ 2/  4TWO° *13/ 3/ 6HRE` 41 41  EFOURa 50 50 öNEGATIVE ACKNOWLEDGa 61 ö6 -> SYNCHRONOUS IDL- 7- 7- õ
END OF TRANSMISSION BLOCK” 86 86 eCANCEL# 9# ÈY eMEDIUM* a* À–SUBSTITUTª 
Á1Áê
´1´ÆILE SEPARATOVdu ¹_GROUP,  
¹1¹oRECORD-  
À1ÀLUNIT+  � ë2Æ!" »aEXCLAMC MAR•"- ¹LQUOT+ #+ µ£NUMBER SIGh$( ¬HOLLA( %( ¤wPERCENTQ &) œ‚AMPERSAN¬3"'"2•“APOSTROPH(M †òLEFT PARENTHESISf)- �ORIGH.  *. ”sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ >{3{“DIGIT ZERÝ8' €' 2/& y& )&& t&  ( t› ' sO 3FIV$
' q' 2SIX3& q& 3EVEõ( r( EKP ú( m( ðNINE
    ':'     ð   #  0x003a -> COLON
    ';'   " b" GSEMI& <& c& ÓLESS-THAN SIGQ =+ d+ gEQUALS( >( e( |GREATERV ?. f. ÒQUESTION MARKÑ @*  40* ÒCOMMERCIAL AT* A* 1* òLATIN CAPITAL LETTER A3 B3 23 B3 C3 33 C3 D3 43 D3 E3 53 E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 èËJ3 K3 ù3 [L3 1Lf M3 f M3 N3 3 tO3 3 Of P3 5'3 P3 Q3 0Q3 R3 0R3 S3 0S3 T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0óEFT SQUARE BRACKEb$\\1 Y5-ãREVERSE SOLIDUÁ]+ §5&ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. cOW LIN`% 6YGRAVEN a) LSMAL5b1 	1 3c1 	1 1d1 à4 -> LATIN SMAðLL LETTER D
    'e'   ö#  0x0065 -> LATIN SMA1 E1 f1 61 F1 g1 71 G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 41 T1 u1 U1 v1 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 óEFT CURLY BRACKEU|/ ÃVERTICAL LIN^}* ORIGHZ ~0 CTILDR 3\x7³á7÷TDELET# Pu0410J # 8éàCYRILLIC CAPIT§ :A\6 16 î6 Bm 27 ô7 V7 37 ú7 (GH8 48 8 6 Ý 57 7 In 67 7 Z¦ 78 8 o 87 7 þ¹96 6 hSHORT < a< *< K,b7 07 Eª c7 87 7 d7 À008d -> CYRIÿ(LLIC CAPITAL LETTER EN
    '\u041e'   #  0x008e -> CYRI7 O6 f6 f6 	&PE7 '207 /907 	'ER7 17 17 
S7 27 27 	T¥ 37 37 	Um 46 46 	'EF7 57 57 	'HA7 67 67 	(TSÜ 78 78 	(CH8 88 88 	S¨ 98 98 C: a: a: 	‡HARD SIGÖ(2b> b> 	8YERÇc9 c9 	LSOFTw d> d> 	]ƒ9ƒ
Y« „9„
Y;3„a„ESMAL&Ao3�a�	4 B× 3a	5 V5 }a}	5 GŸ3}a}	6 Dk {a{	5 I5 yay	5 Z  waw
6 k tat	5 I©pap	4 hSHORT : pap	: Kgag	5 'EL¤ cac
5 M5 ZaZ
5 3YaY	5 Ú3VaV	4 Ø8259 bT–LIGHT SHAs8259bHmMEDIUM) b<LDARK' 0P .ðBOX DRAWINGS LIG÷)HT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIG8 – AND LEFTA (61A 5A s u SINGLEB w DOUBLEI 2I 6I 9 I Y I (56I 7I CDOWN~ E 5E 8E z E š Š (63E 9E   –I B 5^aB 9 7{ b9 Õ(5d> c> /UP³ c< d< /UP}bC eC {(10C fC Øÿ 1/c0= þ R"y3< 1< ‰HORIZONT’@/c2A º C 1C 3C š  Æ 0?c| 3| y	| G '5eÀc	Ä ]‘(5fJ ‹ ¾ÒJ [ J aJ Ï5Øƒ | (69| 	| R6cD 	SZ 5C †~ 	[; 	~ H c(UP­B ['68•d(
ëI Z6d55  K õ )¹Ðd2 -> BOX DRAò<WINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAK (UPI ^RIGHTD 8D /4 D  w � D ž ˆ 2D 5D Ó F 3F 6F { Œ W Œ (6bF 7F ˆVERTICALc(6aO 8O ˆ ™ O ¯ ž 1n9O L¤!UPH FLEFT; (0cŠ a; k 7ª> 8y b> §FULL BLOCK' 4e c' ­LOWER HALF- 	’ d- ?EFT, (90Y e, ¢ - 8- f- ?UPP† 8044-  e0- ô	CYRILLIC SMALL LETTER ERè G0441� /e15 S5 ç/e25 'TE5 Öe¤Ÿ U4 †e”4 'EF5 5Ó …5 'HA5 65 t5 (TSÔ 76 d6 (CH6 ƒeK6 S¢ äe26 C8 ¹e/8 —HARD SIGNDe-< 8YER·e=7 0SOF‰	s dSL< Qe4 T4 Y¥ f5 \5 '0/fd@CAPI�f&IOH57 f5 0ýffl ·UKRAINIAN I5A r	? 0Ýf}€ 'YIì 	7 5 à0e'   #  0x00fù.6 -> CYRILLIC CAPITAL LETTER SHORT U
    '\u045e'   #  0x00f7< OSMAL: 0xb08 : 8: ´DEGREE SIGNb @2219* b 9( ó BULLET OPERATOR, 0xb7* T a, £MIDDLE DOT' Pu221a) S b' —SQUARE RO( 8116( c( hNUMERO£ 0xa4& w d( ˆCURRENCY* Au25a÷ z e* bBLACK € £ x' S f) óNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  ›100:£000,¼ ²FNULL  1  1  öSTART OF HEADING, 2, 2, 2TEXiu 3) 3) 0ENDS 
' 4' 4' ¢RANSMISSIOV 5/ 5/ VQUIRY¢ 6# 6# ¶ACKNOWLEDGE' 7' 7' (BE8  8  2ACK€ G� 9% 9% pHORIZON8yTABULATÀ a1 a1 –LINE FEED› b% b% ŸVERTICAL T c/ c/ KFORMT d% d% çCARRIAGE RETURde+ e+ ‡SHIFT OUßf% f% II 1x1xö DATA LINK ESCAP�1„1„÷DEVICE CONTROL ON. †1†. 5TWOP1‹1‹. 7HRE^ ”1”0 2FOUz 1”1”ŸNEGATIVE z1¡1¡÷ SYNCHRONOUS IDL‹ ¦1¦Ff BLOCKð »1»VCANCEò1¸1¸W fMEDIUMK °1°—SUBSTITUT¦ ±1±ß¤1¤†ILE SEPAÈN©1©_GROUP+ ©1©oRECORD, °1°OUNIT*  2¶2¶
õ2«2«aEXCLAMëF MAR‹2©2©OQUOT* ¥2¥@NUMBx 2œ2œVOLLARm' ”2”{PERCENT( à6: 0x0026,    ó
 #  AMPERSAND
    0x0027: , % –POSTROPHE& 8& 8& öLEFT PARENTHESIS, 9, 9, ORIGH- a- a- †ASTERISKQ b$ b$ –PLUS SIGN% c% c% VCOMMA! d! d! ·HYPHEN-MINU¿ e( e( –FULL STOPM f% f% WSOLIDH "30# %30# ¥DIGIT ZEROI #31& 1& &ON~#32% 2% 'TWJ 3% 3% 7HREL 4' 4' FFOUR— 5& 5& 'IVL 6& 6& 6SIXK a,37% 6EVEÀ3b3b/E<N ]3]' (NI1V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cÆQUESTION MAR4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†2 C2 ‘4‘2 ³4�4�2 ©4©4©2 F– ¶4¶2 G2 Á4Á2 H2 Ì4Ì2 I2 Ø4Ø2 J2 é4é2 Oö4ö&Ld þ4þd M2 	4	2 ±442 552 Õ5 5 QÈ 5 5 Y5 5 �5 5 è5 ð 55,     #  LATIóN CAPITAL LETTER U
    0x0056: , � #  LATI2 V2 72 72 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 öEFT SQUARE BRACKET/ c/ c/ ö REVERSE SOLIDUS+ d+ d+ ?IGH[ e0 e0 ÷CIRCUMFLEX ACCENˆ f- f- …LOW LINE� "60$ %60$ \GRAVEL #61( 1( ýESMAL-AX 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	í/660 	F` ë6ë	 G0 é6é	0 H0 ç6ç	0 I0 å6å	0 J0 ã6ãÝ	0 K0 ä6ä L0 é6é0  M0 é6é0  N0 ì6ìÀ O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
97 7 
7 7 
í7 7 
ë7 7 
é7 7 
ç7 7 
å7 7 
ã7 7  ã]CURLYâ7þ7þ`VERTIC8_7÷7÷RàX ö7öFTILD—7ç7çVDELET" aÙf" ×NO-BREAK SPAC* CÐfd,     #  CUñRRENCY SIGN
    0x00b0: 0f8, « #  DEGREE' 7' a' ¤MIDDLE DOTM 3401& 0& öCYRILLIC CAPITAL LETTER IO6 46 26 ÆUKRAINIAN IE@ œ 4@ &YI6 ev 66 uSHORT U; 148ç A5 /81p BÜ "12¦ 8V6 36 3l 'GH7 ‰8ID6 5m 5m µ#166 Z£ ì/87m Z£ 8m å˜±95 9k !\#1a; .p K"b6 bq &EL§ c6 c6 M6 d6 d6 -#414/8e6 ß#1fk f5 P³2d9d%ER× 2e9e&ES6 e9eT¢ e9e;2c9c&EF¡ c9cHP2c9c'TSØ c9cCš2d9dS¥ f9fC9 d9dIHARDÏ#42k9k7YER¿m9mKSOFTu t9tûs9sY¨ tà9f,     #  CYRðILLIC CAPITAL LETTER YA
    0x0430: @0a0, r #  CYR6 ESMAL4 3 13 13 &BEg 24 24 V4 34 34 'GH5 45 45 D4 54 54 I4 64 64 Z� 75 75 i 84 84 Im93 93 gSHORT 9 a9 a9 Kb4 b4 &EL¡ c4 c4 M4 d4 d4 N4 e4 e4 O3 f3 f3 P£4DeD%ERh 4EeE&ES4 EeETœ EeEUg CeC&EF4 CeCH:4CeC'TSÐ CeCCx4DeDSŸ FeFC7 DeD†HARD SIG¯4KeK7YER¯MeMKSOFTq TeTéSeSY¢ TeT˜5 f I¼5¹fì—KRAINIAN Ò5ZfÃY15fŽj3211üfµhNUMERO¡3221„f„äBULLET OPERATOQ3221xð fb,     #  SQUAðRE ROOT
    0x2500: 0x00c4, ö #  BOX DRAWINGS LIGHT HORIZONTAL9 29 /b39 	hVERTIC7 c7 /da7 	 DOWN AND R t 1­ /bf= 6LEFé "14y /c0< 	/UPw 8; /d9; 
u î c%{  2¶ bŸ
fA 	� 2� 2» 	oè 3‚ /c1B 	8@ ‚ 5@ 		Â F  5ú/cdF oDOUBLE¨"51½bq: � l5àd¸ 4aSINGLEwª N E 3} /d6· #WN4 E V E ‚t  ‘ 4"55ƒ /b8ƒ r ƒ  ?“ ‚ 6D 7D ‡  ‚ D T D 7D bD ÂÆ  D = ‚2UP o Ã ‹9€ d‹#UPö C T † aC cKÃ † < b< /beÿ 
Â  ý � B Ib
Á B À d„ c„ ÂÀ  B } e; cÉ?‡fI KI �  OJZ ’ 6Í P I B â; G ™6*bÓ H X � -bè—  Ò  H A )d«ÀRAWINGS DOWNð" SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2, ó #  BOX DRAWINGS DOWN4 J ` J 6J /cbJ  y Q 
” C 7C fC /UPÕ 8H /d0H Ó 9H /caH E +UPH Ñ aA /d8A �VERTICAL× bN 7N ˜ 
fd œ cN /ceN E £ 
N G "80G d´öUPPER HALF BLOCK, 4, cs ?LOW, ÄOLFULLR Å &ddR ?EFT} 9© ð ORIGH, 1© bAL, FSHAD=#92' 1~ {MEDIUM ( 3( eKDARK& a¡ f¡ ðTBLACK SQUARE
}
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with2 c; P.py.
c ±#"

import  cs

###` ²APIs

class ($ . 1):
í`def en ñ(self,input,errors='strict'):,  wcreturno “.charmap_B = , †ing_map)m /dem -B 	m   m dtable)ø ÁIncrementalEå r å  h Ã final=False*  W.Q
?[0]¨  D ¨  ~  ¨ ö e¹¨ !@ â ¨  Oª ÑStreamWriter(J,Ð8cs. ¤ 5pasƒ ORead9  	9  ÌFàs module API

ý Ãgetregentry(7 
�ž UInfo(¾Õname='cp869', d !e=0 2().     id: .r=]/ Àntaldecoder=óIncrementalDecoder,
  ástreamreader=S R # Ewrit# W # q)

### Z  ing Map

dh  ing_map = u ùcs.make_identity_dict(range(256))5 ‘.update({ª Ó0x0080: None,º Æ#  UNDEFINED% 1% 2% 3% 4% 5% ’6: 0x0386à ö#  GREEK CAPITAL LETTER ALPHA WITH TONOSú 7f 8f 50b7f ¦MIDDLE DOTK 9& %ac& †NOT SIGN$ a$ ° ¦BROKEN BAR& b& E2018J 0LEFK öNGLE QUOTATION MARK6 c6 96 ORIGH7 d7 6038m CEPSILONEeC E2015z pHORIZONƒ	Ú f* 6038¤ m T®#90? ai ? /IO@ 1@ a@ •DIALYTIKAg"92D 8ç„ _OMICR09%9%#95� à U½9C/abT	C  7Š &0aÚDCOPY‚9N?38fq OOMEGi%b2A ö SUPERSCRIPT TWO­p/b3+ FHREE- w'03ÁÚOSMALK9€600al ZPOUND9o%ad’ e  m9m<03aó	¦ E€a|	= ?ac?> &a�/90þ 	€ B K AND»a‰c‰	Ž ‡!a3³&3c‹ÀGREEK SMALL ðLETTER UPSILON WITH TONOS
    0x00a4: @391, ó #  GREEK CAPITAL C VALPHA6 56 26 7BET5 65 35 GGAMM6 76 46 8DELl 86 56 EÙ 98 68 ZÙ a5 75 	4 b4 50bd4 ö	VULGAR FRACTION ONE HALF� c4 53984 ¬)THj d6 96 (IO@e5 50ab5 ñLEFT-POINTING DOUBLE ANGLE QUOTA´ FMARK° fE bE ORIGHF  b0F '25¢LF e SHADEm #b1' “lMEDIUM( 2( †LDARK& 3& 0N ÒBOX DRAWINGS ‚ †VERTICAL… N6252­7 P AND W@ XawâFKAPP#bYh6 GLAMD6 Ycl &MUŸ Vµi N3 Q6256o	HJ ]6255¡A 	¬ a6255•8 ODOWNu  j6255é = /UP;  oeW&XI« m?39f3 vOMICRON8 `E25108 	¦ ¥â cV1ª
á ¶w cj3; ‡HORIZONT%c‚2y· 	B ž1B 
	TÃ ¨0:
z ¡?253z F ±a HP$c®a3 àRHO
    0x00c8 : 0x255a,  ð#  BOX DRAWINGS DOUBLE UP AND RIGHT
( c0x00c9< 4< 
ODOWN> a> /69> 
z ¦HORIZONTAL bA 6A 
 C cC 0C 
�VERTICALÆ dB 5B | e: /6c| G fG E03a3G õGREEK CAPITAL LETTER SIGMA<#d06 »6 6TAU4 14 5j vUPSILON8 28 ¨l 6PHI4 34 7l C4 44 84 'PSh 54 …œ GOMEG>66 +b1j ESMALrGALPH4 74 24 	7BET3 83 Û	g 8GAMÙ”1	ÐLÂÏ6LEFÎd�0�: N
dŒ8w ¦FULL BLOCKÖo8v¬LOWER HALF, Y603b, š	ý 8DEL1S<03b¢	4 E B6258Ã?UPP– e8bÌ	b ZÆe7bË	3 	2 1bMû  )TH4 1bÉ	f 'IO.e0bûg  FKAPP“e0/bbÆ	GLAMD4 .Yh  Mie+de 	N1 )e1 	X÷e&O03bf1 	WOMICRÉe"603c)É  Pg ?03c(
5RHO"e"?03có

Ìe*cZ
TFINALÀ   0x00ee: 0px03c4,  ð#  GREEK SMALL LETTER TAU
 Ü0x00ef: 0x0382 UTONOS' !f0' 50adY ¶SOFT HYPHEN' 1' %b1' çPLUS-MINUS SIG+ 2+ 53c5+ «  gUPSILO6 36 66 	6PHI“ 42 72 	C2 52 &0a2 {SECTIONÂ 6( ?3c8Z 	'PSŒ 72 8ô «DIALYTIKA w81 50b0c  DE'Š 9' aŠ ‡DIAERESIÃa% 53c9L  J VOMEGA=b4 b4 	¥e WITH Ë E cE Å y  E L ANDdO /ce” 	È ’ Se? 625aSÆBLACK SQUARE¶ 0( óNO-BREAK SPACE
})

### Decoding Table

d  _t A = (U `'\x00'x0 # tµ000 -> NULL! 1! 1! õSTART OF HEADING- 2- 2- ETEXT* 3* 3* 0ENDU 	( 4( 4( “RANSMISSI� Ð 50 50 UQUIRY| 6$ 6$ ¢ACKNOWLEDGq L 7( w7 -> BE8! 8! 2ACKŽ Y2'\t$  c9& ðHORIZONTAL TABULAÍ¡ n2 a2 “LINE FEED& 2x0b( »b& oVERTICV :x0c0 c0 HFORMV r$ ® d& âCARRIAGE RETURü !e. ‚ e, †SHIFT OUëf& f& IK 1ˆ1ˆõ DATA LINK ESCAP™1”1”öDEVICE CONTROL ON/ 
–1–/ 4TWOX1›1›/ 6HRE` 
¤1¤1 EFOURa 
¤1¤ŸNEGATIVE ‰ 1±1±ö SYNCHRONOUS IDLŽ 
¶1¶Z2e BLOCK” 
Ë1ËUCANCE
)19È1ÈY eMEDIUMM ða'     #  0x001að
 -> SUBSTITUTE
    '\x1b'
   #  0x001b' VESCAP# c# c# åFILE SEPARATORN d+ d+ _GROUP,  e, e, oRECORD-  f- f- LUNIT+  ( $  Ò  20+ CSPACÑ !" 1" òEXCLAMATION MARKÓ "- 2- LQUOT+ #+ 3+ ²NUMBER SIGNS $( 4( XDOLLA( %( 5( wPERCENTQ &) 6) ‘AMPERSANDw 1"'"è7& ƒPOSTROPH(M 8' ñLEFT PARENTHESIST -')- 9- ORIGH.  *. a. sASTERISq+% ’GPLUSó ,& •RCOMMA› -" Œ³HYPHEN-MINUÄ .) ‰’FULL STOPO /& ‚TSOLIDJ 0$ 3{¢DIGIT ZEROK 1' €' #ONˆ2& y& #TWL 3& t& 3HREN 4( t› 3FOUÁ5' sO 3FIVN 6' q' 2SIXè 7& q& 3EVE8( r( EKP 9( m( $NI9:' fCCOLOq ;" cGSEMI& <& c—LESS-THANŽ=+ lXEQUAL¶>( k|GREATERV ?. sKQUES¥@* 4y ’ERCIAL ATDA* |óLATIN CAPITAL LETTER IB3 ‰3 Bf C3 –3 C3 D3 ¡3 Ñ-'E3 ­3 ¹F3 ¹3 F™ G3 Æ3 G3 H3 Ñ3 H3 I3 Ü3 I3 J3 è
3 ÀLETTER J
   S 'K'  ð#  0x004b -> LATIN CAPITAL LETTER K
+ -'L3 c3 L3 M3 d3 M3 N3 e3 N3 O3 f3 O3 P3 /503 P3 Q3 13 Q3 R3 23 R3 S3 33 S3 T3 43 T3 U3 53 U3 V3 63 V3 W3 73 W3 X3 83 X3 Y3 93 Y3 Z3 a3 Z3 [3 0óEFT SQUARE BRACKEb$\\1 `5-ãREVERSE SOLIDUÁ]+  , &ORIGH] ^1 $óCIRCUMFLEX ACCEN‹ _. rOW LINEà `% 6YGRAVEN a) ESMAL7AZ b1 	1 B1 c1 	1 C1 d1 	1 D1 e1 ÿ	1 f1 ý	1 Fb g1 û	1 G1 h1 ù	1 H1 i1 ÷	1 I1 j1 õ	1 J1 k1 ó#	1 !l1 ôT	1 m1 ù1  n1 ù1  o1 üÄ p1 7b  q1 r1 s1 Pt1 ð4 -> LATIN SMALLð LETTER T
    'u'   ô	#  0x0075 -> LATIN SMALL1 U1 v1 61 V1 w1 71 W1 x1 81 X1 y1 91 Y1 z1 a1 Z1 {1 b1 óEFT CURLY BRACKEU|/ c/ ÒVERTICAL LINEY }* d* ORIGHZ ~0 e0 CTILDR B\x7f% Ñf" TDELET# Pufffe% #  80# ’UNDEFINED› \& 1& 2& 3& 4& ²¾ H0386ä §°GREEK CAPITˆÿALPHA WITH TONOS ¸h 0xb7f $  L­“MIDDLE DOJ\xac' £ƒNOT SIGNr !xa² L —£BROKEN BAR' Pu2018N s �÷SINGLE QUOTATION MARK7 97 •k8 
9038o £JEPSILONL H2015| ·pHORIZON‹Þ 9038§ Ào T·G038ak 9Ý@ /IOA aA øA ”DIALYTIKAm1038ò¤9E _OMICR5§95958038ó95� UÅH03abZS	D !xaàç9YDCOPY�Au038ÏG^· OOMEG 0xb2³ m yó SUPERSCRIPT TWOµ:xb3, €	, 5HREF"03Õœ ‡œ 	:`+xan �XPOUNDPu03ad— g 	g }À03ae'   #  0ÿ4x009e -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03af'   #  0x009f> /IO? 'ca? /a0? –DIALYTIKA‚ (90C 1C L ANDÏ (ccM 2M OMICRON(cdB 3B _UPSILB (91B 4B eCAPITA“HALPH27 57 8BET6 36 66 HGAMM7 47 77 9DELn 57 87 Eå69 99 ZÝ 76 a6 5 !xb¿Ò ab5 ÷	VULGAR FRACTION ONE HALF  8j c5 E´&THl Xu03997 d7  @m 0xab4 ¢ ²ñLEFT-POINTING DOUBLE ANGLE QUOTA· DMARKF bF f| ORIGHG 9u25®bÂLG c SHADEo  ( Ÿb§mMEDIUM) ’bƒLDARK' 0P hÒBOX DRAWINGS … †VERTICALˆ 2ºb^8 $ ]A 8039³bhHKAPP2q)biHLAMD7 ‘bi'MU¢ Äk fN4 9256va	SP8255·bmB 	¯ 8255¦bq9 ODOWNw 	í z> -UP< @039eK)$XI® 8039ñb}ê$9 8251¨bp	© ±æ 1¶cf=  å Çy 3< z< ÀGS LIGHT UP ÿ4AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN C 1C 3C �VERTICAL G RV … (00… 4B ¿ 3| 5: 	| G 903a� 6G ôGREEK CAPITAL LETTER PIµ H03a1µ 74 4RHO5 H255a5 85 	oŸDOUBLE UP'(54= 9= D­f(69? a? | 'H2566B bB � D 	kcD 	³É 5C dC ~ 	0e; 	~ H H03a3
fH 1TSIGMAÿ803aÂ/d07 7TAU5 5l /d15 wUPSILON9 ¯dÜ¥ (PH×7n Î5 C5 85 Á5 (PSj �d¼5 GOMEGDbxd¬ESMALªHALPH5 2¡ ­	5 8BET4 äd¬  	4 6GAMâ9251
¤PdDLEFT¯8250œd ; ]8y œ¦FULL BLOCKe 8‚ªLOWER HALF- 903b- i 9DEL7	¯c5  E­8258ÕdR?UPP™ ÚeH	›ZÏÙeG	4 
3 TeA	3 *TH5 ×eA	5 )IO4e@	4 HKAPP bÔe@5 ÀTTER LAMDA
 õ#   '\u03bc'   #  0x00e6 -> GREEK SMALL LETTER MU
 2 d2 72 N2 e2 82 'XId f2 92 vOMICRON7 (c07 a7 Pi (c12 b2 7RHOe 33 c3 WSIGMA5 25 d5 lFINAL ; 4; e; 'TAq83 f3 STONOS– !xaÉý f0( ¤SOFT HYPHEX!xb$( 1(  PLUS-MINUS° , Wu03c5¯  f2, Q YUPSIL»67 37 (PH¼73 43 C3 !xa1 É 53 |SECTIONÆ 8\ 'PS� 8ù ©DIALYTIKA b­Ž  DE-� !xa‹ ( „DIAERESIÍ y9³ ýHOMEG˜b5  ®e WITH Ï H EË EfF I AND Ë 1f.Ë ” YIu25a� 3ÃBLACK SQUARE¹ x' Z)óNO-BREAK SPACE
)

### Encoding Map

e �_map = {Q  A100:I000,0 XFNULL  1  1  öSTART OF HEADING, 2, 2, FTEXT) 3) 3) 0ENDS 
' 4' 4' “RANSMISSI’Ë 5/ 5/ VQUIRYy 6# 6# ¢ACKNOWLEDGfJ 7' 7' (BE8  8  2ACK€ GE 9% 9% ðHORIZONTAL TABULAÈ� a1 a1 –LINE FEED% b% b% oVERTICT c/ c/ KFORMT d% d% âCARRIAGE RETUR-Õ e+ e+ ‡SHIFT OUßf% f% II 1x1xðDATA LINK ESCAPE
    0x0011: 0x`0011,  ð#  DEVICE CONTROL ONE
 ‚0x0012:  . 6TWO. 3. 3. 7HRE^ 40 40 FFOUR_ 5/ 5/ ÷NEGATIVE ACKNOWLEDG_ 60 60 ÷ SYNCHRONOUS IDL, 7, 7, ö
END OF TRANSMISSION BLOCK‘ 85 85 fCANCEL" 9" 9" W fMEDIUM) a) a) —SUBSTITUT¦ b& b& WESCAP" c" c" ×FILE SEPARATONd* d* _GROUP+ e+ e+ oRECORD, f, f, OUNIT*  "20* %20* FSPACÌ #21! «€EXCLAMATŒ6MAR‹2©%22M OQUOT* ¥2¥µNUMBER SIGN‘2œ2œLOLLA' ”2”{PERCENTO Œ2Œ–AMPERSANDt …2…—APOSTROPHv2vöLEFT PARENTHESISR €2€ORIGH- „2„wASTERISh‚2‚KPLUSí …2…VCOMMA— |2|·HYPHEN-MINU¿ y2y–FULL STOPM r2rWSOLIDH 3k3k–DIGIT ZER¿3p3p& 3i3i% 	3d3d% 	 3d3d— 	÷3c3cM 6FIV3a3a& 5SIX+3a3a% 6EVEü3b3b' E<N ]3]' 'NIC3V3VGCOLOn S3SKSEMI% S3SšLESS-THAN}3\3\[EQUAL¤3[3[GREATERT c3cNQUES‡4i4i ú•ERCIAL AT<4l4löLATIN CAPITAL LETTER 44y4y2 Bd †4†À #  LATIN CAóPITAL LETTER C
    0x0044: , É #  LATIN CA2 D2 52 52 E2 62 62 F2 72 72 G2 82 82 H2 92 92 I2 a2 a2 J2 b2 b2 K2 c2 c2 L2 d2 d2 M2 e2 e2 N2 f2 f2 O2 "502 /502 P2 12 12 Q2 22 22 R2 32 32 S2  /542 T2  5 U2  5 V2  5 W2  5 X2  5 Y2  5 Z2  5 ÷EFT SQUARE BRACKE[5çREVERSE SOLIDU¸5ORIGH[ 5÷CIRCUMFLEX ACCENˆ 5fOW LINõ66\GRAVEL 6÷6÷ESMAL±A36õ6õ	0 B0 ó6ó	0 6ñ6ñ	0 6ï6ï	0 í6í	0 6ë6ë	0 	6é6é	0 6ç6ç	0 6å6å	0 6ã6ãa	0 6ä6ä‘	0 ÿ6é6é0 ÀLL LETTER M
³    0x006e: , ð
 #  LATIN SMALL LETTER N
 0 f0 f0 	O0 "700 /700 	P0 10 10 	Q0 20 20 	R0 30 30 	S0 40 40 	T0 50 50 	U0 60 60 	V0 70 70 	W0 80 80 	X0 90 90 	Y0 a0 a0 	Z0 b0 b0 ÷EFT CURLY BRACKENc. c. ÖVERTICAL LINEW d) d) ORIGHX ö%7e/ GTILDP ç7çVDELET" aÙf" ×NO-BREAK SPAC* s9Å –POUND SIGYa	8I–BROKEN BA¿aÿf_{SECTIONN ÷fÇ†DIAERESIÜaì9LBCOPY9
� ¶a0ñLEFT-POINTING DOUBLE ANGLE QUOTA” EMARK¤aÍ8” ;NOT¸ Èf/¦SOFT HYPHE-b}ÖjDEGREEN bMfM«PLUS-MINUS+ H9� æSUPERSCRIPT TWÓbÐª	+ 6HREýb±8ª –MIDDLE DOèb`M†ab=a\¢VULGAR FRA%„ONE HALF•#38àez  HeK TONO+#38×f+' œDIALYTIKA1 ÏØ1 PCAPIT¿Z¬ALPHA WITHA Â8ÒA EPSILONC à8Ü „ /ET‚ Û9Œ‚ /IO@ ð9›@ _OMICRÂ ¨9ïC UÊð 98,     #  GREEðK CAPITAL LETTER OMEGA WITH TONOS
    0x0390: @0a1, å #  GREEK SMAL? 3IOT> ÜDIALYTIKA ANDL 1L 4L � VALPHA‚ 26 56 7BET5 35 65 GGAMM6 46 76 8DELl 56 86 vEPSILONÙ 68 98 ZÙ 75 a5 	4 84 c4 )TH6 96 d6  üÔ a5 b­GKAPPxb6 ®GLAMD6 c6 ®&MUŸ d3 «N3 e3 &XIf f3 e:WOMICRalcPk aSc5RHOŸ a/cfŸ 7SIGa/d06 &TA<ad=ñUa/d2l 'PH
/d34 C4 d‘'PSh dâRt9
 M‡ID &9NG 7+9b)	Ò„C 
aC9	? ìA Q9
A Q~ [9¼	= F
> baf		> @Ð b}d‘	O JÅbÎd±	4 	Ìb°dµ	3 
Êb®¦ÀGREEK SMALL ð	LETTER DELTA
    0x03b5: @0de, ó #  GREEK SMALL 4 vEPSILON6 66 /e06 	(ZEi 73 13 		2 82 22 	)TH4 94 34 	(IO™ a3 43 	GKAPP6b4 54 	GLAMD4 c4 64 	&MUed1 71 	N1 e1 81 	&XIb f1 91 	WOMICRý#c06 a6 	Pg #c11 b1 	5RHO™ #c22 d2 	¦FINAL SIGMf#c3: c: 	4 44 
&TAjc6f›
U6c6f�
'PH:5fœ
C2 5ff
'PSd 3fÏ
GOMEGf4a 
 gç WITH DIALYTIKB Bf
BE Sa‡
ÀE VTONOShca’
	† A sf©
=€ 3201H8zãHORIZONTAL BARª 3201Ø80öLEFT SINGLE QUOTATION MARK6 Ü8ORIGH7 #50âcwáBOX DRAWINGS LD ª p #50¸bP9  †VERTICAL7 Èdƒ7  ‘DOWN AND Ã = 1­ %bfò= 	 6< úcÈ<  /UPw ‘d<; 
u î c%{  2¶ bŸ
fÀCAL AND LEFTð
    0x252c: 0x00c2, õ #  BOX DRAWINGS LIGHT DOWN AND HORIZONTALB #34B 1B 	/UP@ ‚ 5@ 	�VERTICALF #50† dF oDOUBLEÀ "51: /ba: 
� ø 5ø 98 
;RJ> 7v b> FLEFT= a= /c8= 
ty d< /bc< 	w 6d; *«
} #63} 4	B 
ƒ 6A c7° #69C ð=A ±eB
	Å G  8N%dfG õUPPER HALF BLOCKñ8ldz?LOW, 8à d#KFULLR 9ö0~ ëUSHADEy "92M bÝ{MEDIUM ( ÙGKDARK& aó f:ð<LACK SQUARE
}
""" Python Character Mapping Codec cp874 generated from 'MAPP±ð/VENDORS/MICSFT/WINDOWS/CP874.TXT' with@ cO P.py.
w ±#"

import  cs

###t ²APIs

class ($ .“ 1):
1`def en ñ(self,input,errors='strict'):,  mcreturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  9 À
### encodinð&gs module API

def getregentry():
    return codecs.C QInfo(  ! Õname='cp874',  en2 =0 2().  )de   ²incremental: 6r=I E\ r/ J 	/ Dl / ástreamreader=S R R # Ewrit# W # �)


### [ �ing TableD€coding_t 2 = '`'\x00'-ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pCRIGH, ÀTHESIS
    '3*'  ð#  0x2A -> ASTERISK
 +'+# B# ’PLUS SIGN$ ,$ C$ RCOMMA  -  D  ÂHYPHEN-MINUS' .' E' ’FULL STOP$ /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% 2ONE$ 2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOURo 5% 5% #IVJ 6% 6% 2SIXI 7$ 7$ 3EVE´8& 8& REIGHTL 9& 9& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æƒERCIAL A4A( \óLATIN CAPITAL LETTER B1 i1 B–C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 UÄ V1 V1 W1 W1 X1 Y1 À   #  0x59 -ð> LATIN CAPITAL LETTER Y
    'Z'   Ÿ#  0x5A -1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ _ C. ò REVERSE SOLIDUS* ])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' _ESMAL]AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ Õ	§J/ k/ Ó5	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðV/ w/ ðW/ x/ ðX/ y/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICMB}( çRÀV  ~. æCTILD~3\x7�7×TDELET! Au20a1! 8ÉƒEURO SIGQ\ufff÷$ ¾ƒUNDEFINE$ ³$ ¨$ �$ @2026ú � ’pHORIZONšsELLIPSIïš ‘R 
â †ð UNDEFINED
    'ü\ufffe'   #  0x88 -> UNDEFINED
    '$ 9$ A$ B$ C$ D$ E$ F$ /90$ E2018D 91$ ôLEFT SINGLE QUOTATION MARKUF20195 25 ORIGH6 c6 36 k ODOUBk 	d5 45 k 6 &226 56 gBULLETÂ 3! 6! wEN DASH" 4" 7" M" 	999999990xa0@ŸAäNO-BREAK SPACEk@0e01+ ÈA„÷THAI CHARACTER KO KAI0 ÞA0 YHO KH2 ïA{2 %UA"60e0 Ay3 Wf 5È v3 'ONÊ 62 ‡2  wRAKHANG5 75 š5 wNGO NGU1 äA©1 0CHOn˜ áA·2 I– a– Æ3 
É b3 Õ3 WSO SOÇ @Aà/ Ç OY=Aî2 JYO YÅ RAû1 D)'DA• fÄ 	2 uTO PATA=10e1îB2 gHO THAŽ1 B ×THO NANGMONTH11(B( 8 hPHUTHA5 +B+XNO NE� (B(XDO DEÿ %B%ITO T� #ÀB6 -> THAI Cû$HARACTER THO THUNG
    '\u0e17'   #  0xB7 -> THAI C3 GAHAN4 84 84 Og 93 93  WNO NUb a/ A/  —BO BAIMAI3 b3 B3  gPO PLA0 c0 C0 KHO P,d3 D3  HFO Fb e/ E/  Pb 	Yf2 F2  a ‰%200 /C00   b vSAMPHAOù &215 15  GMO MÆ &22/ 2/  gYO YAK_ 30 30  XRO RU` 40 40 &25, 5,  XLO LIw&261 61 ] 
C
hWO WAE~CXSO SAs2CSSÔ2C b 	LCgHO HIP¬CiLO CHUÃ C9O A€CˆHO NOKHU@C‡PAIYANNO'3DWSARA s3D¶AI HAN-AKAT-3	D	f g 
D
1 Mb D1 ø D0 1 D1 'UE’ D1 2 D Œv3D0 1 DePHINTH1 6fff„D”UNDEFINEDè 
$ 	$ û$ ð$ 60e3áDá÷URRENCY SYMBOL BAH|4âEâ†à41'   #  0xE1 ÿ"-> THAI CHARACTER SARA AE
    '\u0e42'   #  0xE2 1 O0 30 30 §AI MAIMUAN9 49 49 GALAI: 5: 5:  ¨LAKKHANGYA¨ 65 65  ‡MAIYAMOKg 72 72 gTAIKHU3 83 83 ( Ec 90 90 (THÆ a1 A1 R,b1 B1 ‡CHATTAWAÈ c6 C6  ·THANTHAKHAT5 d5 D5  xNIKHAHI2 e2 E2  iYAMAKK5f2 F2  XFONGM1 %501 %F01 —DIGIT ZER[&51* 1* 'ON"5"F"S (TWR F) 8HRET F+ FFOURf5ýFý* (IVT òFò* 7SIXS éFé) 7EVEµ5áFá+ GEIGHÝ5ÜFÜ+ )NIQÕFÕ0ANGÐ	j5ØFØUKHOMUŽ 6fffkFÒ”UNDEFINED
$ Á$ ³$ ¥$ ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð6 cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with? � P.py.
v ±#"

import  sÓ s ÁAPIs

class  ($ . 1):
nAdef ô ñe(self,input,errors='strict'):,  ™creturno B = , 4ing&C  o ?o *B 	o  o ú ±Incrementalê$er ç  ¤ ½ ¤  h Ã final=False*  Yð.errors,encoding_ðtable)[0]

class IncrementalDecoder( >cs. Á):
    def d, ó
(self, input, final=False*  . sreturn U ƒcharmap_@ :  F �.errors, Ming_ª óStreamWriter(Codec,U  z Dpassã  0ReaÝ 9   	9 ð### encodings module API

ý Ãgetregentry(7 
æ e QInfo(1 Õname='cp875', d !e=0 2().     i¼: 'r=µEÀ /er/ J 	/ þ/ spr7=D# w“#  # @)


J[ Ping T~ DZä2 = '`'\x00'-ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ & (9c& 4& dCONTRO› t   º 5" ôHORIZONTAL TABULATIONx "862 ê 60 
R 8x7f" 7" dDELETEC (97! 8! C (8d" 9" e" A"  (0b" B" oVERTIC× 0)C. “FORM FEED¸ rP +D$ åCARRIAGE RETUR%0ž E* †SHIFT OUÁ	'F$ IG 1V1Võ DATA LINK ESCAPT1b1bsDEVICE [6 ON- d1d- 3TWOö (x1i1i- 5HRE\ 9»1r 2x85IB1r¤ s (08" d…BACKSPACh 8E1fF 1F gDANCEû8x19g fCdMEDIUM� 9/l8Ì1l� `1`ÔILE SEPARATORm 1@e_GROUP*  e1eoRECORD+  	  lNUNIT) 8r2rÉ 8i2i" /2^" S2S" ð4'     #  0x24 -ð> CONTROL
    '\n' ó   #  0x25 -> LINE FEED$ 2x17& $ 6$ õ
END OF TRANSMISSION BLOCK4 b4 74 TSCAPE! (88! 8! 
› 8x89" 9" a" A" 	‡ B" cD C"  (05" D" tENQUIRYÌ (06" E" ¥ACKNOWLEDGò 0G„F -> BELŠ7x90E  30 (91" 1"  1‰  32" õ SYNCHRONOUS IDLŽ (93M 3+ o 4" 4" 3=D 	‘ ;" 0f )]j96369636963696361¶ 6dDEVICE`T FOUR¶ 1(BŸNEGATIVE ) (9eyO51Ã K“SUBSTITUTâ D Û4QCSPAC  B\u03Q×4OóGREEK CAPITAL LETTER ALPHAË  5 2Z 5 b5 8BET4 m4 k4 HGAMM5 d5 ~5 9DELj k5 ‘5 wEPSILONÕ ¨7 ¦7 ZÕ Ð4 ¸4 
3 ¿3 ½3 *TH5 Ò5 Ð5 $IO[ ×4 âòLEFT SQUARE BRACKETþ .. î’FULL STOP$ <$ ðÓLESS-THAN SIGK() ë{ ²PARENTHESIST ++ çGPLUSO !$ é€EXCLAMATs3MARr&+ 5ï„AMPERSANÊ ¾:5óHKAPPŠ5 óHLAMD5 Y5 ô"MU�dÅ 2 ñN2 *2 îÀ XI
    '\u0ö+39f'   #  0x56 -> GREEK CAPITAL LETTER OMICRON
    '\u03a07 77 'PI2 12 82 7RHO3 33 93 RSIGMA5 ]0  ¤ Ñ A5 òRIGHT SQUARE BRACKET/ $/ B/ £DOLLAR SIGï *& C& ‚ASTERISKI )# D# x ²PARENTHESIS, ;, E, tSEMICOLb^$ F$ óCIRCUMFLEX ACCENÅ -,  60, ³HYPHEN-MINUw /' 1' TSOLID" ×4'  62" 2TAUÌ 3 53 33 EUPSIß 7 67 47 (PHB73 53 C3 83 Þ(PSf 93 ÚCOMEGuÎ a5 ÝøIOTA WITH DIALYTIKC bC íHF |A þ6þ`VERTICÊ2INE¶,( ÷4COMF%  ñ0PERt_' õULOW Lj ># ìÇGREATER-THANO ?, ôÃQUESTION MARl1\xaÕµ7ðVDIAERd “8a7íËCALPH”CTONO-@ f 7EØ�B J7E> x`ä !ÓNO-BREAK SPACË© |7|h Pu038cyè #è eB 2	º„ …7?t‚ `} ö7<9AVE':' s#  XNUMBE@&  ;‚ERCIAL A•1"'"’ Z7“APOSTROPH½=M gEQUALS"& <OTA Í�8õoð TONOS
    'a'     ð#  0x81 -> LATIN SMALL LETTER A
$ 0'b'   / 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ `\u03b14 xA/ [GREEK§3LPH«3 23 B3 8BET2 32 C2 HGAMM3 43 D3 9DELf 53 E3 wEPSILON 65 F5 ZÍ 0xb00 !  2 902  DE4C SIGX j#  & ÿJ‡ k/ ÿK/ l/ ÿL/ m/ ÿM/ n/ ÿë o/ ÿO^ p/ ÿP/ q/ ÿQ/ r/ ÿR/ Ì74 Íÿþ 081 ý*TH3 93 þ)IOÊa2 ýHKAPP0EÉ ýHLAMD3 I3 û#MU,!xb‘ÓAùÂACUTE ACCENT' ~¸  É AúCTILD.s  ëSO t/ ë~ u/ ëÔ v/ ëV� w/ ëW/ x/ ëX/ y/ ëY/ z/ ëZ/ ë	ïAëN0 
0 êXJð f'   #  0xAC ->ÿ& GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0xAD ->5 'PI0 10 E0 7RHO1 31 F1 SSIGMA3 !xa1 ”  B03 —POUND SIG¹ %acX  B1% î  óALPHA WITH TONOSc Vu03ad> 2> EPSILON@ e@ 3@ T| &ca< 4< $IO= „DIALYTIK  ½ fA 5A ú c86= &ú c:7@ U:&cb½ 8@  c~9D OOMEG€2‚ A> PFINALr˜ ,49 B9 6TAUf&c51 C1 ,5 65 ’H“71 “C1 81 “#PSb {,  /%C‘òLEFT CURLY BRACKETÀ A- ™ÅLATIN CAPITA‰ÏB1 Œ1 Bb C1 }1 C1 D1 r1 D1 E1 b1 E1 F1 V1 F1 G1 G1 G1 H1 81 H1 I1 %1 æ"\xwC§SOFT HYPHEx c9\ 1C|Š  d9dCñ L AND¸bK R¾>N 6201	C:ØôSINGLE QUOTATION MARKÎ 6201ÕC>pHORIZONÝ2BAR) }%6D6ORIGH7J. 7J_ K1 7ÀN CAPITAL LEàTTER K
    'L'   ñ#  0xD3 -> LATIN CAPITAL LE1 L1 M1 41 M1 N1 51 N1 O1 61 O1 P1 71 P1 Q1 81 Q1 R1 91 R1 B\xb14 WA1 ãPLUS-MINUS SIGî H\xbd* B* ô	VULGAR FRACTION ONE HALF] (1a3 C3 £SUBSTITUTE% Pu0387' ‚ D% ôGREEK ANO TELEIA+ F2019+ E+ ñRIGHT SINGLE QUOTAŠ 3MAR:@\xa64 "  a F6 ”BROKEN BA\# %  E0% ó REVERSE SOLIDUS… xÕ  E1* Õ SN t  E2% ®V T1 ßT‡ U1 ßU1 V1 ßV1 W1 ßW1 X1 ßX1 Y1 ßY1 Z1 ßZ1 B\xb24 üEßãSUPERSCRIPT TWœ1\xa…ß"SE×
þÓ#Ó#H\xab› ÍÿLEFT-POINTING DOUBLE AÛ	cD Û NO·0   Ø FÙ“DIGIT ZERý % Ô% #ON¨H$ Ó$ E3m Æ$ 3HREJ 4& »& 3FOU‘5% ¯% #IVJ Ø” £% #SIeÖ$ –$ 3EVEÞ8o ‹& EaO| „×F€& $NI)3\xbtFt3\xaT , vDCOPYÖÇ\SFxFxbxFxo y"9f2¸ yóCONTROL
)

### Encoding table
e _ ð=codecs.charmap_build(decoding_table)ñ
#
# cp932.py: Python Unicode Codec for CP932- ð*Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _R rcs_jp,   ‘multibyte ’ as mbc

 =: A.get !('´ ’')

classª ( !s.· �):
    en " =t .  do   P ÁIncrementalEB tr(mbc.Mª   ,U  s   ‚ >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	ÑStreamReader(T,™! Õ. ^  N^ 
! ^  ^ ódef getregentry(& breturn"UInfo(¶Sname=WJ0=þ #()? 5   iFI .r=/ J 	/ ²/ s r =w# cwriter# <# )Ò_cp949ÿ!49-  ? ÿ)$krÌÿ*krÿ/49ÿÿÿD249' Ç¶à  ¦   ÿ„Àter,
    )
#ðZ
# cp950.py: Python Unicode Codec for CP950
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _R rcs_tw,  
 ‘multibyte ’ as mbc

 =: A.get !('´ ’')

classª ( !s.· �):
    en " =t .  do   P ÁIncrementalEB tr(mbc.Mª   ,U  s   ‚ >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	ÑStreamReader(T,™! Õ. ^  N^ 
! ^  ^ ódef getregentry(& breturn"UInfo(¶Sname=WJ0=þ #()? 5   iFI .r=/ J 	/ ²/ s r =w# cwriter# <# )ÒÏeuc_jis_2004qEUC_JIS* ;  M )$jpÚ'jpÂ ÿÿA	^9 ãÒü  Â   jÀ    streamwrÐiter=StreamWr ð4,
    )
#
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
;  M ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _Y rcs_jp,   ‘multibyte ’ as mbc

 =: A.get (('Â ’')

class¸ (# !s.Å !):÷  en " ={ .  dv   P ÁIncrementalEB tr(mbc.M±   f j  ‚ >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	DqReader(T, ! Ü. ^  U^ 
! ^  ^ ódef getregentry(& breturn"QInfo( ²Zname=^Q7=#()F <   iMI .r=/ J 	/ ¹/ sër§ø´# w# C# pPJ A up	ÿÿF"p'!  ºä  ª   LÀtreamreader=ó StreamReader,
  s rwriter=# W # ñ!)
#
# euc_kr.py: Python Unicode Codec for EUC_KR/  A ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _S rcs_kr,   ‘multibyte ’ as mbc

 =: A.get "('¶ ’')

class¬ ( !s.¹ !): en " =u .  dp   P ÁIncrementalEB tr(mbc.M«   Tz
  ‚ >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	2U(T,š! Ö. ^  O/er^ ! ^  ^ ódef getregentry(& breturn"QInfo( ¯Tname=XK1=ÿ #()@ 6   iGI .r=/ J 	/ ³/ àröà®# gb18030!GB% 2$cnÑ'cn¸ ÿÿAYH¾è  ®   BÀ
        strñeamreader=StreamR 3,
  s Ewrit# W # ð)
#
# gb2312.py: Python Unicode Codec for GB$ /  A ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _S rcs_cn,   ‘multibyte ’ as mbc

 =: A.get "('¶ ’')

class¬ ( !s.¹ !): en " =u .  dp   P ÁIncrementalEB tr(mbc.M«   Tz
  ‚ >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	U(T,š! Ö. ^  O/er^ ! ^  ^ ódef getregentry(& breturn"QInfo( ¯Tname=XK1=ÿ #()@ 6   iGI .r=/ J 	/ ³/ à1k Ký{kúÿÿC&k'[®Ø  ž   ÷HÀ   streamreaóder=StreamReader,
  s Ewrit# W # ð
)
"""Python 'hex_codec' C ñ! - 2-digit hex content transfer encoding.

This < A de/ òes from bytes to	 0.

€ òten by Marc-Andre Lemburg (mal@l `.com).£ ‚

importd s Óbinascii

###µ �APIs

defµ _‹ ñ
(input, errors='strict'):(cassert D ==    „return (l ‚.b2a_hexT c), len )x  de x 4?a2bx Rclass(z 1cs.Äã  oself, 
 <÷  9 	3 ) W ê W 9 W 
Ê ÀIncrementalEg$er×  ä ³final=False*  à õ · .ú ' ý
® Dù®  „ ;® :
3® * ‡1er(&,X. © òcharbuffertype =È
L vL  L  ¾fò ings module APIPÃgetregentry(I —êQInfo(– ¸Pname=Ò'é  b &e=Ó Œ   iŠA .r=ƒ/ J 	/ /   · # rÙæ‚_is_textï2ingïg ä åòCharacter Mapping4¢ generatedµð'hp_roman8.txt' with$ qQ.py.
jÒBased on data: ðftp://dkuug.dk/i18n/Còmaps/HP-ROMAN8 (Keld Simonsen)O @Orig­ð source: LaserJet IIP Prin¹ ñ	User's Manual HP part no’ ó33471-90901, Hewlet-Packard, June 1989¿  (U¿ Ü �permissioŒ \"""#"sc©@œ "):Î  â2(f,élƒ è
Ô4ÒeI= ,V Àing_table)

ð    def decode(self,input,errors='strict'):
,   preturn 1 ³cs.charmap_B = , ðing_table)

class IncrementalEnG  r( >cs. x  ¤ e, ¤  h Ã final=False* ¢ @ :  ê .ä , § ?[0]ª  D"ª  €  ª ø Nª !@ ª  ª óStreamWriter(Codec,T ¤ Dpassã  ORead9  	9 D### 4às module API

ý Ãgetregentry(7 
2ž UInfo(Sõname='hp-roman8', h !e=4 2().     ij: .r=c/ J 	/ è/ stwt=H�# r^# Q# @)


N[ Ping T) H5codè2 = +`'\x00'âñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  ’SUBSTITUT¢ À'\x1b'     #ð  0x1B -> ESCAPE
    '\x1c'
 ! #! C! åFILE SEPARATOR) d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  §  20) CSPACÇ !  1  òEXCLAMATION MARKÉ "+ 2+ LQUOT) #) 3) ²NUMBER SIGNO $& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'"¯7$ ƒPOSTROPH(I 8% ñLEFT PARENTHESISP +')+ 9+ ORIGH,  *, A, sASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 ML1 æLb M1 À4D -> LATIN ð	CAPITAL LETTER M
    'N'   û#  0x4E -> LATIN 1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ « 5C. ãREVERSE SOLIDU¯])  * D* ?IGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL©AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ ÓP	/ K/ l/ Ô	/ L/ m/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðð X
    'y'      ð  #  0x79 -> LATIN SMALL LETTER Y
    'z'   / A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# Ò F  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ fDa$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÕNO-BREAK SPAC©c) EËPCAPITEÍ¶A WITH GRAV< ]A]< 	¤CIRCUMFLEXcÆAzA E} ºA’< 	}  ×A¯A 	•DIAERESIS½ «AË@ I½ �  ÈAèA 	� b”A³ACUTE ACCEN"Q\u02cê ¬A„MODIFIERªÖ7 ð (MANDARIN CHINESE FOURTH TONE)
    '\u02cð,6'   #  0xAA -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\xa8: < B< “DIAERESIS$ Pu02dc& ` C$ ³SMALL TILDE& 0xd9$ J D& ÔLATIN CAPITAL‹ ¶U WITH GRAV< b< E< Î } Pu20a4C £ FA ƒIRA SIGN$ 0xaf" ¡  B0$ UMACRO! (dd! 1! Â YÂ EACUTÂ f< 2< *‡: (b0v 3: iDEGREE½ (c7& 4& œ Cœ tCEDILLAû e> 5> 	ž < (d1z 6< ØNz 	f< 7< 	x : a: 8: ô
INVERTED EXCLAMATION MARKæ bá94 MQUES1 49‰CURRENCY}(a3%ZPOUND% 5% &:YEN# 	‡#1SEC— ©Pu0192L ÍB	6Fp5HOOa7 Ð  ì	„ e$ CI	] A] i0xeaš c C$	? E? f¦? 'O? (C,½  b½  UCE	½ ü 	ßeÝCA÷ 	: f<C?	t ò 
: 	k=í 	: eSC=' è 	‰eCC:  è 	: fXL:  è 
: 	\^:  è 	: eNs:  è ×)xeMŽ>  ì > fsÊ¥ð > Q> ª|  ô > ckÀ  #  0xD0 ->ð# LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xee'
 ³ #  0xD1 ->A ESMAL? I? ¤CIRCUMFLEX? (d8? 2? € OA USTROK| (c6= 3= A2 (e52 42 	® í d? 5? í EACUTy fè 6: æ eæ 7; ä (c4¥ 80 Sæ ”DIAERESIS“(ec@ 9@ 	$å 6GRAdª A: z ç z dz B@ U@ (c9º C@ E@ 	¡(ef< D< ö z d> E> ôSHARP S (GERMAN)rd²F> 8F'c1½ /E0A ó	ù (c3< Á} < ETILDÖe< ¾	5: (d0v »åETH (ICELANDIC2f? È= cÆEÆò ã
.£EÈ< 
	.É< 	x (d20Õ< 
x õEÑx 	âf< Ó	âv : Au016¥EÍS�SCARON < Ò< É	v :  8xda(Çì CdAu017¦v Å< Y² fEÇ	¶ > dIFÄ_THORN	A É	 ? À '\xb7'     ð#  0xF2 -> MIDDLE DOT
    '\xb5'
  % 3% …CRO SIGN% 6% 4% zPILCROW' e' 5' óVULGAR FRACTION THREE QUARTERS` Pu2014; … 69 sEM DASH" 0xbc   § 7" [ %ONY 6 d6 86 DHALF3 (aa3 93 ôFEMININE ORDINAL INDICATOR5 b5 A5 oMASCUL6 
(abk B6 ð
LEFT-POINTING DOUBLE ANGLÛ 1OTADCMARKz Pu25a0F :CD pBLACK SdE' )xbk D' ORIGHl 0xb1j „EE ¨PLUS-MINUS	óufffe'
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
#
# hz.py: Python Uni:   C? q for HZ' ð*Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _O rcs_cn,   €multibyt• ±ec as mbc

& ' =: A.get Ò('hz')

class¤ ( !s.± !):™2e =q .    P ±Incremental\„er(mbc.M§   ,U è — 4 ¤   £ ‚  D‚   ‚ 4 ‚ 	ÑStreamReader(T,–! Ò. ^  K^ 
! ^  ^ ódef getregentry(& breturn"UInfo(¶Pname=TG-=û #()< 2   iCI .r=/ J 	/ ¯/ s�r�=t# cwriter# 9# ñ)
# This module implóðs the RFCs 3490 (IDNA) and Å1 (Nameprep)Ú`string D, re®r
from uG@datad  	�ucd_3_2_0é  @

# m ð$ section 3.1
dots = re.compile("[\u002E\u3002\uFF0E @61]"
D ù	5
ace_prefix = b"xn--"
s  âassumes query Þ ðs, so AllowUnassigned is trueñ
def nameprep(label):
    # Map
 1new Q = [] ‘for c in  0  4 �if stringN ã.in_table_b1(cV  &   ^ ± to nothingW     …continue ‚ ‡.append(e 4mapf Q2(c))4 — ´ = "".join(@ !)
 ¢# Normalizc / Ôunicodedata.n" ‚("NFKC",ì B �ProhibitQ  c1« Q or \?  ô /  ;/c2+ O3(c)U 4* 5* 6* 7* 8* 9brraise UÓõError("Invalid character %r" % c×¡Check bidiš`RandALùsØ`d1(x) ýx!A 	"c  ùÒ# There is a /    R 3theñ. Must perform further¤  E   |# tests^  1)a S ó sY ósection 5.8 MUST be pÒ;ed.X @This  Îð
 C.8, which was already c:+ed; s2) If aÆ  Úƒains anyí 6Cat� &, ó J § 4NOTD C L> 
¸  if# ,¹2¹¡ RCQViola<óof BIDI requirement 2"J ?   ?# 3aù 	é ´ .GfirsC0 ofEE ¿U, andgS 2lasÙ Ã   #£` Òs3notÙ0[0]Ž :-1]ž [ e3eSretur…
ÊyToASCIIÉ6tryv á# Step 1: try - * 0.en‚("ascii"XiexceptU[ ApassL Felse `# Skipësz ¡3: UseSTD3} ARule\‘false, soC  9 8k£if 0 < lené V < 64s  > 	    lÀUnicodeErrorñ$("label empty or too long")

    # Step 2: nameprep 6 = ( 
4 ñ3: UseSTD3ASCIIRules is falseF ] q4: try &  Atry:	  ‚ Z 1 =  ñ.encode("ascii")&  except Uni VError? Bpass& 6lse °# Skip to sà !8.$  p £if 0 < lenÕ V < 64:  $ breturn“ 9 Yraise† ^ñ5: Check ACE prefixV "ifc ò.startswith(sace_$ )• | LÚ;  < _ ßA6: EY( �PUNYCODE… x€@punynI §7: Prependm 	G ¿ " +Þ 	i82siz%�ŒÅ æcdef To=óYŸ1“ 7for¥Òif isinstance8 w, bytes˜Qpure_¬b = TruÓ e‹	î ^­ ò	 &   _   
 ! 	; F“vif not   2 ¥2: Performþá # º ,¦   ò$# It doesn't say this, but apparently, it should berE nowf 1$9ò	Invalid character in IDN»�3)Ë X!Ï6Ó2strA%, ðp Ÿ4: Removel1´[Ëh ]rP5: DeËy using ýdresultJ 11.d* /("ÿ¶6: Apply ToÎô 2  (U 
-`7: ComR the # 2 ofŸ6˜  5one 3b Àwill already:Òin lower caseáiQ V.' e() != u2v#1DNAÕ:Âround-trip",% 2ñ B8: rF Ö ð 5Ù    ò

### Codec APIs

class (À1cs. I Ø.ðself, input, errors='stricst'):

  õif errors != 'strict':  & ò$# IDNA is quite clear that implementations must be H 	F àraise UnicodeEs Ò("unsupported† Â handling "+— )« šnot input¢ Öreturn b'', 01 <try( bsult =D 0.enŒ •('ascii')¯ eexcept¬ & ² 
N Fpass4 :lse õ# ASCII name: fast path2  [°labels = reš §.split(b'.Ž  ( Afor , 2 in	 js[:-1]r  * 0if %‘(0 < len(6 ~) < 64).  2 ™6 ö empty or too long"$ : &ifc Îs[-1]) >= 64h d [ Ò,g ø Ö = bytearray(Ÿ Á  YCdotsWA  º    ¾ 1and55  É 
Â @trai•0_do= Ÿ	Æ4del•5-1] eI '- â 
… #if%
  Ê õ# Join with U+002EW     -.extenda 
  !To»=V– q"s(3 +Ô )ªadef dehRself,{,ï$s=r“PUM;)""LballowsÒ  §Ôto operate on2ÿ@ngs,9.Œ›±isinstance(’,Ásžõ# XXX obviously wrong, see #3232V  ÞH 
sV )Ñif ace_prefixé"in‡
K?# F¥G s z .áI	 -  
YDY  / ]å š¹':"."ç '  Ðü™J== 0ï ¹V = '.� � Õ%&''�#F = [é5 @.app«#To3�ƒƒ".".join‘)’‹Ànput)

classð IncrementalEncoder( ¾cs.Buffered" Ñ):
    def _b& !_e< ó(self, input, errors, final4  8 #if Â != 'strict'S     ò# IDNA is quite clear that impl± âtions must be H ™  B   �raise UniÒ EŽ Ò("unsupported† Â handling "+² %)
F bif notÑ 
¢ çreturn (b'', 03 ñlabels = dots.split()V @trair ¥_dot = b'' 2if A 
n ˆ  J[-1]  í U .V      3del_  D u   #eld ®_ ò# Keep potentially unfinishedU ù until the next calld  h ƒ        å c QresulQ–ytearray(t…size = 0. 3for· "in	 sö 0if 5 
  … õ# Join with U+002EU     ‹ Æ.extend(b'.'Š       ] Y += 1> 
: �ToASCII(ù)D @ 3len  ¸F  ^ 2i ; ! a ßRytes(O !),ˆ)

class; Dec;	" ;d< ;6õUõ<*""ô¯qallows Ñ  QÔto operate onˆ©•ngs, too.“Òif isinstance1,+ 1 1  	^Jelseµ3# M%N W 5ing{  X ¢  = } v"ascii" ( € 1 ß7"."Q? = ÝA'ÜÐ ä £�U = [] ÅÒF Ð.append(ToUniçcode(label))
  ‰if size:      Y += 1  3lenO 
  òresult = ".".join( õ) + trailing_dot1 M ! ¢ sreturn I ,« ð)

class StreamWriter(Codec,ç 8cs. )Û Jpass9 ORead9  	9 ó### encodings module API

def getregentry(7 º ‘ ž UInfo(ý Åname='idna', c !e=/ 2().   deP    ²incremental: 6r=I E¿ /er/ J 	/ Dl / sowo=bR # rY# L# ð)
#
# iso2022_jp.py: Python UniÜ  û � for ISO( !JP7  èð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _W 3cs_w ",   �multibytï ¡c as mbc

& , =? A.get #('Q E_jp'“¾ (! !s. �" =~ Ù÷{  ª¿d(mbc.M´   j Á — 4 ¤   ‰ ‚  ‚   ‚ 4 ‚ 	kHç £! ß6 ^  ]^ ! ^  ^ ,$šú Œ@/_1/_1!�/_1#aÀtibyteIncremÿ entalEncoder,
     ˜cs.Increm4 !):5   1 =  ‡

class .  De þ r(mbc.Multibyte  ‚ T ‚ 	ùStreamReader(Codec, ƒ ! ,¾ (s. ^ OWrit^ 
! ^  ^ ódef getregentry(& dreturn¥ Î QInfo(� ¹öname='iso2022_jp_1'Qeä=7 2().  d¡   iù: 'r=¾@/ J 	/ ¹^ s§r§=~# wl# C# g)
#
# û ð2.py: Python Uni ý � for ISO%AJP_2;  M ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _Y 3cs_{ æ mí( 0 as€"

 =? A.get (Ç42')SÂ (# !s. –‚ß�  P Å£å s	 — T ¤   ‰ ‚  ‚   ò	z  b 	§4 ‚ 	q%à2%è?004(?004+�?004.À  encode = cðodec.encode
    de 0 =  "c. ñ

class IncrementalE3 þ r(mbc.Multibyte  ,U  Y  a .s.4 !):5   ‰ ‚  Dª ‚   ‚ 4 ‚ 	àStreamReader(C?), ! ,G(s. ^ OWrit^ 
! ^  ^ ódef getregentry(& dreturn¥ Î QInfo(� ²öname='iso2022_jp_2004'T:=: #()I ?   iPI .r=/ J 	/ ¼/ sªrª=�# wo# F# g)
#
# þ ð3.py: Python Uni¤ ý � for ISO(AJP_3;  M ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _Y 3cs_{ é mr( 0 asƒ"

 =? A.get (Ê43')VÂ (# !s.  –…ß�  P Å(ÿß3%ç?ext'?EXT)_À

codec = _cðodecs_iso2022.getc #(' ñ_jp_ext')

class C % !s. �):
    en 0 =  "c.   de   P ÁIncrementalEB þ r(mbc.Multibyte  ,U  s   h >cs.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	ÑStreamReader(T), ! ,a(s. ^ OWrit^ 
! ^  ^ ódef getregentry(& dreturn¥ Î UInfo(¶\name=`S9=9 #()H >   iOI .r=/ J 	/ »/ s©r©=€# wn# E# d)
#
# ]ðkr.py: Python Uni¡c€ for ISO—1_KR7  I ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _W æä mm( 0 as~"

 =? % /kr!ÿÿI2kr'; îÔþ  Ä   �4"""óCharacter Mappingðiso8859_1 generated from 'MAPPINGS/ISO# / À-1.TXT' with2 ðcodec.py.

"""#"ð

import codecs

### C Â APIs

class ($ . à):

    def en ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âõname='iso8859-1', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[ Ping T˜ H5codè2 = +`'\x00'âñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ðSYNCHRONOUS IDLE
    '\Px17'  ð#  0x17 -> END OF TRANSMISSION BLOCK
) X'\x184 84 eCANCEL! 9! 9! U eMEDIUM( a( A( ¥SUBSTITUTE% b% B% VESCAP! c! C! åFILE SEPARATORJ d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & 1   j 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 0"'"H  u“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ Ã\3Q$ 3EVEèµ& R& E-L º& M& $NI):• FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 ÀER I
    'J'  ð#  0x4A -> LATIN CAPITAL LETTER J
) 0'K'   1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ >5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL<AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ ãk/ Ó	/ ál/ ÔC	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ À 0x75 -> LATð
IN SMALL LETTER U
    'v'   ì#  0x76 -> LAT/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# ŽF  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ ‡Ø 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÕNO-BREAK SPAC©aEAE INBôED EXCLAMATION MARK¹aUAU•CENT SIGN$ UAUZPOUND% VAVŠCURRENCY( ZAZ:YEN# YAY¥BROKEN BAR• ZAZ1SECà 	¼ ]A]•DIAERESISK ]A]BCOPYT	M bAbðFEMININE ORDINAL INDICATOR
     '\xab'
 ð' #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
:  D cD CD …NOT SIGN# d# D# ¦SOFT HYPHE& e& E& ªREGISTEREDP f* F* UMACROK 'b0!  B0! iDEGREEG (b1& 1& ªPLUS-MINUS* 2* 2* ô SUPERSCRIPT TWOë (b3* 3* EHREE, 4, 4, ÅACUTE ACCENT' 5' 5' ZMICRO¢ 6% 6% zPILCROW' 7' 7' –MIDDLE DOq 8% 8% uCEDILLA“ 9" 9" &ONä a* A* õMASCULINE ORDINAL INDICATOR` ˜B˜ORIGH™b™B™±VULGAR FRACÈ ONÖFARTE{ ¬B¬6 EHALF® eä ¹3 Tø1 QUk S9 ÈBÈÑINVERTED QUES¤ lcØCØõLATIN CAPITAL LETTER A WITH GRAVŠcîCî< 	Š© c C < 	¥CIRCUMFLEXA CA 	FTILD¹ 'C'< 	…DIAERESIfc@C@@ 	Rø7ABO:\C\A ³ gCg2 C¨^c€C€> E> 
æšCš< 	
æ¬C¬< 	æ ·C·A 	ª²C²@ Iù ¸C¸< 	
ù ÁCÁ< 	ù  ÉCÉA 	ù dØDØô ETH (Icelandic)^dÛDÛÀR N WITH TILÐDE
    '\xd2'
 ö #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAV< 3< 3< FACUT< 4< 4< ¥CIRCUMFLEX¹ 5A 5A 7TILõ 6< 6< •DIAERESIS| 7@ 7@ õMULTIPLICATION SIGN. 8. 8. c	VSTROK(9= 9= U a< A< 
 b< B<   cA CA dd@ D@ Yù 
½ e< E< õTHORN (Icelandic)³fA FA ESMALõ SHARP S (German> 'e0> /E0> A¹ 	R(e1: 1: 	ó eÈEÈ	² t ®eËEË? 	LeÉEÉ: æeÆEÆ> †RING ABO‚eÉEÉ
? Ne¹E¹‹	0 CštCEDILLAeÇEÇ	< E< 
ÖÄEÄ: 
ÖÂEÂ: Ö ÅEÅ? œÂEÂ	> Iñ ¼E¼: 
ñ ºEº: ñ  ¸E¸³ ñ f¸F¸?ETH3f»F»N.	Bf»F»�f¶F¶: ÀACUTE
    '\Pxf4'  ð!#  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
4 X'\xf5? 5? UTILDE: 6: 6: •DIAERESIS> 7> 7> ÕDIVISION SIGN( 8( 8( ß VSTROK¡ 9; 9; UFGRAV: a: A: FACUT: b: B: Ž c? C? Td> D> Yñ 
· e: E: õTHORN (Icelandic)¥f? F? y · ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_10 generated from 'MAPPINGS/ISO$ / Ð-10.TXT' with3 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . 1):
9Adef í ñe(self,input,errors='strict'):,  ®creturno B = , 4ingC  o 8o *B 	o  o ú ±Incrementalã$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  œ�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ŠU-10', i !e=5 2().     ik: 'r=Ô~/ J 	/ é/ sur<=I# w˜# ¥# ")
[  ”Të
~ é2 = ,W'\x00S 00SANULL0À'\x01'     #ð  0x01 -> START OF HEADING
    '\x02'
 ! #+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& •7 -> BELL 8 8 tACKSPACC t"  9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEEDx b& [B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÌ(19f¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"Ìu“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×À  '5'       ð #  0x35 -> DIGIT FIVE
    '6'   % 6% 2SIX$ 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& 3NIN• :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 31 C1 D1 41 D1 E1 �Ä F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Ì5ãREVERSE SOLIDU¯]) 5R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# 6ñYGRAVEJ a' çLSMALõb/ Àx62 -> LATINð SMALL LETTER B
    'c'   ú#  0x63 -> LATIN/ C/ d/ 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ ðS/ t/ ðT/ u/ ðU/ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�7×UDELET! "80D ! 8É’<control>è H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ ß°G$ Ô$ C$ É$ 9$ =8=$ 9@9@9@9@9@9@ð93'     #  0x93 -ð> <control>
    '\x94'
 ¯ #  0x94 -$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ 'a0$  A0$ ãNO-BREAK SPACEÙAu010ÛÙ A1) öLATIN CAPITAL LETTER A WITH OGONEK=  12h = 2= E= fMACRON= 2= 3= G= wCEDILLA> »{ ‘¸ I> { @= ª= 	GTILD13Ä< Â< Ky 
· (xaÜAÜ·SECTION SIG3ue ße Le Au011ÿ> ù> D> WSTROKà 6= = S= )CAÓ6*< T< y 7!¶ C= Z= y !xa:  ŸA[§SOFT HYPHEV64]b Ub 44= v= 3ENG¤!xbI– B…kDEGREEì09ø B‚OSMAL€3€B€	; ~; ~	; |žB|	< z–í z; x<: x	: vb: ‰v£MIDDLE DOT®Au013Åa t	a r1‰r	< p; p	; nØ ± n	: li; ðC -> LATIN SMALLô. LETTER Z WITH CARON
    '\u2015'   #  0xBD -> HORIZONTAL BAR) F016b) E) ´LATIN SMALLc Uc 7MACd 7014; F; 6ENGl %00l &C01 @CAPI˜ Ñ An  0xc1; Ò /C1= SACUTEy 8xc2< 2< ¥CIRCUMFLEXA 3A 3A FTILD} 4< 4< •DIAERESIS| Éù 5@ –RING ABOV� 6� 6A 2 Pu012e4 >/C72 I©cOGONEK° Vu010c= 8= C= ·0xc9: ì 9< E< åPu0118> µ A< 	µ !xcÊy B= ¥ } f} C@ +OT¤d» € °‡rù !xc¬< Ã< Þ f} ÉA ý !xdÖ� DØö ETH (Icelandic)14ã<DÚNõwCEDILLA> oDÜO> 	Ã(xdØDØ= 	wdØDØ< wdö 7ÙA 	Udn< Ô< ³Fu016-Dâù
| : | á| WSTROK[7�íây 
¦'da©Dã= 
¯âDâ< ¯ g÷ ãA s(xdãDãY©
½ ãÀ  0xDE -> LAð TIN CAPITAL LETTER THORN (Icelandic)
    '\xdf'
 à #  0xDF -> LAA ESMAL? ô SHARP S (German> Pu0101@ > /E0> ÔA WITH MACRONy e9  y /E1; UACUTE: 2s : 2: ¥CIRCUMFLEX? 3? 3? FTILDy 4: 4: •DIAERESISx 5> 5> –RING ABOV} 6? 6? 0 Au012Û›70 I›cOGONEKª  Ödm ; 8; C; (CAÕ98 ›9: E: ÕAu011< t A: 	¯ 8xebu B; — y 7@ y C> +OT–)ñ D> fñ 0xeev : E: Æ Ý? ¸y õ 7xf0} F¸?ETH3 Au014Œ2FºNåvCEDILLA[42< ¼O< 
1f¸F¸; 	kf¸F¸: kf¹F¹? 	1f(¥F´: ¥Fu016FÂU,
x 8ßÁx WSTROK77h¡Âu 
ˆ(fav Ã; 
¡ÂFÂ: ¡ cy Ã? g!xf‘¥ÃYg
· ÃFÃ{Au013¨kÃóKRA
)

### Encoding table
e ð_table=codecs.chaðVrmap_build(decoding_table)
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO$ / ð-11.TXT' with gencG P.py.
o ±#"

import  cs

###l ²APIs

class ($ .‹ Â):

    def W ñ(self,input,errors='strict'):,  0 creturno A.chaB = , C  o 8eo )B 	o  o ú ÁIncrementalE>r ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZeª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  Ð�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±rname='iŠU-11', i !e=5 2().     ik: 'r=Ô~/ J 	/ é/ sur<=I# w˜# ¥# ")
[  ”T¸ IÈ2 = ,`'\x00'2ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- ÀCONTROL THREÀE
    '\x14'
 õ #  0x14 -> DEVICE CONTROL FOUR. 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  ò 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'"úu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ Ýã3T“ ×Ô% SK 3FIVJ Ê% Q% 2SIXÜ Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI):FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 ÀF
    'G'     ð#  0x47 -> LATIN CAPITAL LETTER G
& 0'H'   1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Ñ5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMALÏAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó§	/ ál/ ÔÖ	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ À #  0x72 -> ðLATIN SMALL LETTER R
    's'   ¿#  0x73 -> /  S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# F  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ 2$ 3$ ¨l 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÔNO-BREAK SPAC©Au0e0GÊAE°THAI CHARACcKO KAIµ 0 S0 Q0 YHO KH2 a2 _2 #UAÕ\e p3 n3 Wf 3 }3 ð ON
    '\u0e06'õ&   #  0xA6 -> THAI CHARACTER KHO RAKHANG
    '\u0e07'5 75  wNGO NGU1 81 81  0CHOt N2 92 92 I– a3 A3 
É b3 B3  WSO SO• c/ C/  Ç 'OE2 d2 D2  JYO YÅ e1 E1  D)'DAc f2 F2  †TO PATAK2 %102 /B02  HOŽ&112 12 —NANGMONTH1&128 28 hPHUTHA5 35 35  XNO NE� 40 40  XDO DEÿ 50 50  ITO T� 60 #T/U‹1!B!3 8AHAÇ $B$4 Og %B% *†1!B!—BO BAIMAI+!B!WPO PL�1"B"jPHO PH,#B#HFO Fb !B!b 	Y!B!a ‰2C b ISAMPµ2"C"GMO MÆ 2C ³2CXRO RU` CR2CILO L¤2CL] 
C
XWO WAÎ2C “As2CSSÔ2C b 	LCfHO HIP42CLÃUÃ C)O ¶2C‡HO NOKHUô2ðCF -> THAI CHARACð$TER PAIYANNOI
    '\u0e30'   #  0xD0 -> THAI CHARAC3 gSARA A0 10 10  ÇMAI HAN-AKAT6 26 26  f g 31 31 Mb 41 41 ø 50 50 1 61 61 'UE’ 71 71 2 82 82 b 90 90 U1 a1 A1  ePHINTH1 Tfffe'>  F0e3fe Fe ÷URRENCY SYMBOL BAH 4†E†*4†E†P1 �E�Oì 60e4€E€—I MAIMUAN9 ˆEˆA9 7ALAa4’E’¨LAKKHANGYA¨ –E–Mò7MOK¡ —E—vMAITAIK60e4˜E˜ ôEc ˜E˜ 0 (THÆ ˜E˜1 R,bd&EBd¶ 1 wCHATTAWU&4c6 C6  ˜THANTHAKH»&4d5 D5  xNIKHAHIÍe2 E2  iYAMAKK53E3Ï XFONGM1 50F0—DIGIT ZER[5*F** 'ON"5"F") (TWR F) 8HRET F+ FFOUR–5ýFý* (IVT òFò* 7SIXS éFé) 7EVEµ5áFá+ 8EIGª5ÜFÜ+ )NIQÕFÕ0ANGÐ	j5ØFØUKHOMUk“À   '\ufffe'
ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_13 generated from 'MAPPINGS/ISO$ / Ð-13.TXT' with3 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . Á):

    def í ñe(self,input,errors='strict'):,  0 creturno B = , 4ingC  o 8o *B 	o  o ú ±Incrementalã$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  œ�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ŠU-13', i !e=5 2().     ik: 'r=Ô~/ J 	/ é/ sur<=I# w˜# ¥# ")
[  ”Të
~ é2 = ,`'\x00'2ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- ÀE CONTROL TWÀO
    '\x13'
 õ #  0x13 -> DEVICE CONTROL THREE/ 4/ 4/  EFOUR. 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  ! 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) •²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'")u“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[“DIGIT ZER¡1% `% #ONt2$ Y$ #TWH æ½3T$ àÝ& T“ ×Ô% SK 3FIV” Ê% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI):)FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 àE
    'F'     ð   #  0x46 -> LATIN CAPITAL LETTER F
    'G'   1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ 5ãREVERSE SOLIDU¯]) ]5ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ ÓØ	/ ál/ Ô	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ À #  0x71 -> ðLATIN SMALL LETTER Q
    'r'   ¿#  0x72 -> /  R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# JF  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ ³H 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÔNO-BREAK SPAC©Au201— ÊAEôDOUBLE QUOTATION MARK»aWAW•CENT SIGN$ WAWZPOUND% XAXˆCURRENCY(  § § \¡ ð LOW-9 QUOTATIONð MARK
    '\xa6'
 õ #  0xA6 -> BROKEN BAR% 7% 7% ÄSECTION SIGN' (d8' 8' ðLATIN CAPITAL LETTER O WITH STi = (a9= 9= ˜COPYRIGHTf Au015´ ² A) f Rf uCEDILLAg bg B> ñEFT-POINTING DOUBLE ANGLE QUOTAè 	4cD CD )NO¥ 8xad# D# ¥SOFT HYPHE1(ae& E& ¨REGISTEREDõ !xcó  §F* õ $AEé 'b0\  B02 iDEGREEX (b1& 1& ªPLUS-MINUS* 2* 2* õ SUPERSCRIPT TWOz 3* 3* 4HRE¦ Au201MÍ B4, DLEFT†€(b5a 55 ZMICRO° 2BÙzPILCROW' ÛBÛ¤MIDDLE DOTÒ fÙBÙOSMAL×b×B×7%ON1015Œ Ø	e ÖbÖBÖ9×bŠdB×¢VULGAR FRAî ONEARTEbêBê6 DHALFO(beÀ÷3 T%1 QUk S9 eÔ	#Pu0104k SC6+TOGONEAu012¨ = = I= 0€= .= A= TMACRO · é = A= C= DACUTF!xcñ ÅCQ„y …DIAERESIcc\C\| @ R3DABOV� Au011.½ xA E½ t1g= Ž= 	7Â= ¦7&CAs(xc§C§y 	sAu017> x ¹x Zò < 1ë¹x 	KDOT n21´@ ÀG WITH CEDIL÷0LA
    '\u0136'   #  0xCD -> LATIN CAPITAL LETTER K WITH CEDILL> &2a> E> I> gMACRON{ b= F= L= { %60> /D0> S> Az &43< 1< N< VACUTE¶ &45< 2< 
¶ !xdx o/D3> Oz cz 4< 	m!xdµ y 5= DTILDó !xd"< 6< “DIAERESIS30xd7· @ 7@ ÷MULTIPLICATION SIG 720 ’ D8. ’U#cOGONEKk Vu0141= 9= TTSTROKè Fu015Î/DA= S6< B< ¶ �Ø!C= aFu017JDÅZ3‡DOT ABOVù &7d6Ç@ CL0xdf: ¼ ÆESMAL?öSHARP S (German)°0™íEÆ	> A¸ ë2{ ; Å	; z; 0&EÄ	; v 	«Au010Îv Á	; C± "7xe4)E¿	: u ã!xe'gEÀ> LRINGâ 19 · Ã	? E· -1µ; ¾�; -XEË	; -	Ve® ï È	: ° g ‰EÅ	: Ê: 1ÛÃ	: t D 2'Ä	> Gb
 …z À	< ƒüE¼	< ð I WITH MACRON
 ô-   '\u013c'   #  0xEF -> LATIN SMALL LETTER L WITH CEDILLA
 < %61< /F0< S< FARON: &44: 1: N: WACUTE: 6: 2: 
° 0xf3: ì /F3< Ov d< &/F4: 6MACë 0xf59 u 5; DTILDë !xfé : 6: “DIAERESIS)8xf7x 7> ÇDIVISION SIG‹7Û 8(  UcOGONEKc Pu0142e ; 9; <TSTROKÜ Vu015b; A; ;6: B: ° ‹êQC; QAu017@ î D> Z)‡DOT ABOVñ &7eñ E> C,F2019: ¢ðRIGHT SINGLE QUOTAT×óMARK
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_14 generated from 'MAPPINGS/ISO$ / Ð-14.TXT' with3 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . 1):
—Adef í ñe(self,input,errors='strict'):,  Çcreturno B = , 4ingC  o 8o *B 	o  o ú ±Incrementalã$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  œ�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ŠU-14', i !e=5 ð().encode,
      ò  decode=Codec(). 3,
  Ðincrementalen* 6r=I E / J 	/ Dl r/ ástreamreader=S R # Ewrit# W # �)


### [ ±ing Table

~ Ping_t A = (Ó a'\x00'Ü õ #  0x00 -> NULL 1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t" "  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  À   #  0x2D -ð> HYPHEN-MINUS
    '.'   ò#  0x2E -> FULL STOP$ /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% 2ONE$ 2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOURo 5% 5% #IVJ 6% 6% 2SIXI 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& $NI):% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& K|GREATERR ?, SÒQUESTION MARK@( 4YÃCOMMERCIAL A4A( \òLATIN CAPITAL LETTER AY B1 i1 B1 C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 UÄ V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 ðEFT SQUARE BRACKET
  r  '\\'  ð#  0x5C -> REVERSE SOLIDUS
! $'])  * D* òIGHT SQUARE BRACKET/ ^/ E/ óCIRCUMFLEX ACCEN, _, F, ‚LOW LINEO `#  60# YGRAVEJ a' 1' òLATIN SMALL LETTER AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü’O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðšEFT CURLYi|- î‡VERTICALB}( çRÀV  ~. æCTILD~3\x7�7×UDELET! "80D ! 8É’<control>è H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ õh[$ êà#  0x8B -> <coðntrol>
    '\x8c'
 û  #  0x8C -> <co$ d$ D$ e$ E$ f$ F$ '90$ /90$ 1$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ @9@9@9@9@9@9@9@a@A@ãNO-BREAK SPACEùAu1e0#ùAEøLATIN CAPITAL LETTER B WITH DOT ABOV@ ?@ a@ OSMAL> !xa<  wA{¤POUND SIGN£ 1010¦c |c £ C£ 1010Â@ ˜@ 	£ > (1e~ ²> ~ D~ (xaÎAÎySECTIONå 11e8³¥ Ñg Wg 5GRA„(xaéAéœCOPYRIGHTe íîe 	HACUTéF< 	FGu1efz  > FYß 8A8¤SOFT HYPHE&(xa:A:œREGISTEREP7>k@Œ 	”DIAERESIS�11e1l @ B\@ FÌ 3 1Â@ s	J> 6012)BqJG~ 10128~ s¾ 	~ > 71e4~ ŒM~ 71e4~ Œ> (xb>BŒ{PILCROWç5) ã sã ÀCAPITAL LETTñ4ER P WITH DOT ABOVE
    '\u1e81'   #  0xB8 -> LATIN SMALL LETTER W > 8GRA: &57: 9: x 3> A> x GACUT² &60: B: eCAPITA´ Sò fz C@ 	ò Y> ò &84z D: z ¶ —DIAERESISl5@ E@ 	z > 6ªF> ö !xc4è&C0> ¼ Aø !xcx < 1< ®0xc2ò < 2< £CIRCUMFLEX5!xc­A 3A DTILD+!xc¯< 4< ±!xc¯@ 5@ IRING^8xc6þ 6A ³ Ts 72 C¨uCEDILLA-8p ÎæE> Þ8xc9< Ð< 
æa< Î< æ bA Õ¹ ªc@ Õ� Iù d< ×< 
ù e< Óx ù  fA ÖA ù Au017åÀDØV� dÝDÝN:	`dÝDÝO< 	odØDØ< 	vdó %DØ< õ  ÙDÙA 
õ ÔDÔ< ²11e6.²âT5²(xdäDäÀ O WITH STROÐKE
    '\xd9'
 ö #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAV< a< A< FACUT< b< B< ¥CIRCUMFLEX¹ cA CA •DIAERESIS@ d@ D@ Yù ½ Pu0176> 5E< ½  f?  vFA ESMALteSHARP ² 'e05 /E05 A° 	©(e1: 1: ê 8xe2: 2: è (e3? 3? ETILD (e4: 4: Ý(e5> 5> †RING ABOÙeÞŸ/E6? ­ 7o 70 CštCEDILLAˆ(e8< 8< E< 
Ö»E»	E: 
Ö¹E¹: Ö ¼E¼? œ¹E¹	> Iñ ³E³: 
ñ ee±: ñ  ¯E¯³ ñ  .�.F¸Wñ } f½F½N? 	Df½F½O: 	[f¸F¸: 	jf¸F¸: í  *zF¹? 
í ´F´: ¤11e6Õ¤ÂT+:DOT0fÄFÄ| FSTRO€fÅFÅ~fÅFÅ: ð ACUTE
    '\xfb '  ð!#  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
4 X'\xfc? C? •DIAERESIS> d> D> Y} SACUTE: Pu0177< · E: ·  f= "  ? F? · ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_15 generated from 'MAPPINGS/ISO$ / Ð-15.TXT' with3 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . 1):
xAdef í ñe(self,input,errors='strict'):,   creturno B = , 4ingC  o 8o *B 	o  o ú ±Incrementalã$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  œ�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ŠU-15', i !e=5 2().     ik: 'r=Ô~/ J 	/ é/ sur<=I# w˜# ¥# ")
[  ”Të
~ é2 = ,W'\x00S 00SANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" ¤ACKNOWLEDG !x0ža‡07 -> BE8E 8 tACKSPACC t" C 9$ ð HORIZONTAL TABU©» n0 A0 •LINE FEED½ b& À#  0x0B -> VðERTICAL TABULATION
    '\x0c'
 ó #  0x0C -> FORM FEED$ r"  $ D$ æCARRIAGE RETURN e, N E* “SHIFT OUTN 8x0f$ F$ IG '10#  10# ôDATA LINK ESCAPEN (11+ 1+ öEVICE CONTROL ON- 2- 2-  5TWOZ 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% Ô”1”ÆILE SEPARATOFdJ ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦CSPACè !  ›aEXCLAM�C MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSAN"1"'"Cu“APOSTROPH(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3F4COL(;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÀQUESTION MAR�K
    '@'   ò	#  0x40 -> COMMERCIAL AT( A( 1( òLATIN CAPITAL LETTER A1 B1 21 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 CL1 C1 Lb M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 5ßP1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ P5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ/ À J
    'k'    ð#  0x6B -> LATIN SMALL LETTER K
% 0'l'   / C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ ðóEFT CURLY BRACKEG|- îÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f# d7×UDELET! '80! 8É’<control>“ H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@À 0x9E -> <coðntrol>
    '\x9f'
 ú  #  0x9F -> <co$ 'a0$  A0$ äNO-BREAK SPACEM (a1) 1) õ
INVERTED EXCLAMATION MARK4 24 24 •CENT SIGN$ 3$ 3$ XPOUND% Pu20ac' Ê  A4% HEURO$ 0xa5"  î  A5$ 8YEN# Au016ï G 6# öLATIN CAPITAL LETTER S WITH CARO¨ 7_ 7< 1SECó Ï  c )c 8' c OSMALa 9a 9: ‹COPYRIGH2a) A) õFEMININE ORDINAL INDICATORgb5 B5 ÿLEFT-POINTING DOUBLE ANGLE QUOTÏ „bCD +NOœ dg D# ¦SOFT HYPHELe& E& ™REGISTEREù(xaÃAÃ7MAC—bÑ” BÀhDEGREEù!xb”& ½ªPLUS-MINUS* ³B³ô SUPERSCRIPT TWORb¹B¹	* 4HRE=Au017BÀyZy bØBØ;MICý'b6RBÚzPILCROWÞ ÅBÅ£MIDDLE DOTÙ  ­ eN ­ Ã« ÃBÃ$ON(xbÄBÄoMASCULÅ
bÅBÅÆAu015äß ÆŒ”IGATURE O¯  4 î4 ×4 Ö2 &78Eã2 òYò“DIAERESIS…(xbùBùoAQUESylc	C	q Aq DGRAVß (xcC< 	FACUT< M[C1< 	¤CIRCUMFLEXê cZA HA 	FTILD} 4d< Xõ fc\C\| 	R)7ABO:xCxA ³ ƒCƒ2 C¨uCEDILLA-Uñ œÀLATIN CAPITAðL LETTER E WITH GRAVE
    '\xc9'
 ü	 #  0xC9 -> LATIN CAPITA< FACUT< a< A< ¥CIRCUMFLEX} bA BA •DIAERESIS@ c@ C@ Iù d< D< 
ù e< E< ù  fA FA ù 'd0@ /D0@ 4ETH,(d13 13 N,ETILDé(d2< 2< O< 	a(d3< 3< 	h(d4< 4< h(d5A 5A 
õ 6< 6< ¤7@ 7@ õMULTIPLICATION SIGNŸ8. 8. ˆcVSTROK ÅDÅU ÅDÅ< 
 ÀDÀ<   ÁDÁA dÅDÅYù 
½ ÅDÅFTHOR§¹D¹ESMAL-eSHARP §e®E®	5 A¤ 	=eµEµ: 	Þ e³E³: ™e¶E¶? 	7e´E´: Ñe±E±> †RING ABOÎe´E´
? 9e¤E¤v	0 CštCEDILLA²e²E²	< te¯E¯: 
Ö­E­: ÀITH CIRCUMFLÐEX
    '\xeb'
 õ  #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS> c> C> I> UGRAVE: d: D: FACUT: e: E: ‡CIRCUMFLñ f? F? ñ 'f0> /F0> 4ETHè (f11 11 N"ETILDè (f2: 2: O: 	\(f3: 3: 	\(f4: 4: \(f5? 5? 
í 6: 6: –7> 7> ÕDIVISION SIGN�8( 8( í SVSTROKŽ9; 9; UŽa: A: 
ŽœFœt Ž �F�? T¡F¡Yñ 
· ¡F¡FTHOR™•F•m « ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_16 generated from 'MAPPINGS/ISO$ / Ð-16.TXT' with3 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . 1):
ÒAdef í ñe(self,input,errors='strict'):,  åcreturno B = , 4ingC  o 8o *B 	o  o ú ±Incrementalã$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DZª  €  ª ø ª (@ ä ª  Qª Àclass StreamàWriter(Codec,c ‚s.Stream ò):
    pass

class  ORead9  	9 ó### encodings module API

def getregentry(7 sreturn ‘ ž QInfo(�  ‘ õname='iso8859-16', i !e=5 2().   deV    ²incremental: 6r=I EÅ /er/ J 	/ Dl / s[r<=IR # w˜# ‹# @)


O[ �ing TableI_ _t 2 = ,`'\x00'2ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |ðAMPERSAND
    "'"    ð    #  0x27 -> APOSTROPHE
 0'('   % 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# ’PLUS SIGN$ ,$ C$ RCOMMA  -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOUR“ 5% 5% #IVJ 6% 6% 2SIXI 7$ QCSEVE´8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 UÄ V1 ÀETTER V
    C'W'  ð#  0x57 -> LATIN CAPITAL LETTER W
) +'X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ ò C. ò REVERSE SOLIDUS* ])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' ÁESMAL¿AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ Û	G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó—	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðV/ w/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTIC¯B}( çRÀV  ~. æCTILD~3\x7�7×UDELET! "80D ! 8É’<control>¤H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �ð <control>
    '`\x85'  ð#  0x85 -> <control>
 X'\x86$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ '90$ /90$ 1$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ @9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ãNO-BREAK SPACEÑAu010ÛõAE÷LATIN CAPITAL LETTER A WITH OGONEK= ô= ^= OSMAL; 4¿; u; x Lx USTROKµ 120ap= Ž”EURO SIGNœ 1201L$ Ž÷DOUBLE LOW-9 QUOTATION MARÒ 6:6  — S— DCAROr (xa¸A¸1SECc ™ 7016ú »c S5a ÑAÑ™COPYRIGHTü 1021 Æ Öc ]e £OMMA BELOW>(xaôAôãLEFT-POINTING L_ANGLEL7± † † ZLDACUTâ(xa,A,¤SOFT HYPHErAu017Àb .b 	K`   : â : D: "< …DOT ABOV  b&!  @ B`hDEGREEˆ!xbé& ]¨PLUS-MINUS*  ‡ÒBJ� C,xAu014æŒ K	IÀu017d'   #  óP0xB4 -> LATIN CAPITAL LETTER Z WITH CARON
    '\u201d'   #  0xB5 -> RIGHT DOUBLE QUOTATION MARK6 0xb64 6 6r ´PILCROW SIG] 8xb7' 7' £MIDDLE DOTL Pu017e' ‚ 8% ¾ OSMAL¼ 
7010¼ 9: Cö  F0219t A: S: £OMMA BELOW´ 0xbb>  B@ R6”-POINTING?OANGLEPu0152G ù CE ù ·£IGATURE OEy  4 34 D4 -2 &782 E2 f Yí –DIAERESISr &7c@ F@ r > [„DOT ABOV° 0xc0< )&C0> ~ A~ 7GRA< 1< 1< FACUTx Zx 2< ¦CIRCUMFLEX÷ 0C �/C3A 7BRE¹ 4¹ �õ s 0`| ”uÚ
ù : ù š< A+¥C¥2 n sCEDILLA(!xc]p ¾áEá„< À< 
è adÂ< á(xcÃCÃ÷ ¹ ¥!xc½ ¾¥Iù ·< Æ½ < 
ù -< Ð< ù  f:Ñ} ù Au011ÕžDÓDù TSTROKmFu014ÀDÔN= 	ú d‘ú DÔO< 	Ldv < Ï< 
x ÏDÏ< r µ2ÐA Dz
„ ×D×ÀITAL LETTER ò2O WITH DIAERESIS
    '\u015a'   #  0xD7 -> LATIN CAPITAL LETTER S@ VACUTE< &70< 8< U< xDOUBLE C 0xd9A  9C DGRAV !xd¹ < A< 
x bx B< £CIRCUMFLEXü 8xdcA CA x  18B xD@ E<cOGONEK} Au021ü = E= T= ³COMMA BELOWB 0xdf} <FB FSMALõTHARP ,!xeî5 /E05 Au 	«'e1o /E1: 	©(e2: 2: §Pu0103A */E3? 6BRE^ e48 í 4: ß  07@ x 5> C+
ñ 68 x 6: Aeh 0 Á	Êj tCEDILLAeƒ< Á	< ƒ
Ñ¸E¸: 
à ºt ¶: Ñ(xe¹E¹? —(xe¶E¶	> I—
ñ d—°: 
ñ e: ­: ñ  ªEª³ ñ Au011{ˆF³Dñ TSTROKYAu014; ´N; 	ò f´F´’	ff­F¯: 
t ¬ : ¯: f (°? Éf·F·A † ØlÅSlGu017¹ 
ÃÀLL LETTER U ðWITH DOUBLE ACUTE
    '\xf9'
 ñ #  0xF9 -> LATIN SMALL LETTER U A FGRAV: a: A: 
t b: B: ¥CIRCUMFLEX³ c? C? “DIAERESIS> Au011ó ñ D> Eñ eOGONEK; !21º ; E; T; ³COMMA BELOW@ 8xff¹ F@ Y@ ¹ ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_2 generated from 'MAPPINGS/ISO# / À-2.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
7Adef ë ñe(self,input,errors='strict'):,  Écreturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  š�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ˆE-2', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  ‘Tè
~ è2 = +W'\x00P 00PANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" ¥ACKNOWLEDG�(07& ð 7 -> BELL
    '`\x08'  ð#  0x08 -> BACKSPACE
 2'\t" "  $ 9$ óHORIZONTAL TABULATION0 n0 A0 “LINE FEED$ 2x0b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ äCARRIAGE RETUR  2x0e, | E* •SHIFT OUT  f$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ 1+ öEVICE CONTROL ON- 2- 2-  4TWO¨ (13- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ «1«eCANCEL! 9U ¨U eMEDIUM( a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt0"'"Ï  ø2u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þ[3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3F4COLz;  CGSEMI$ à<'        #  0ðx3C -> LESS-THAN SIGN
    '='   p#  0x3D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARKz @(  40( ÒCOMMERCIAL AT( A( 1( òLATIN CAPITAL LETTER A1 B1 21 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 CL1 æLb M1 îLM1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Ê5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û/ ÀR G
    'h'   ð#  0x68 -> LATIN SMALL LETTER H
& 0'i'   / 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f# ñ7×UDELET! '80! 8É’<control>“ H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@Àx9A -> <contð rol>
    '\x9b'
 ù #  0x9B -> <cont$ c$ C$ d$ D$ e$ E$ f$ F$ 'a0$  A0$ ãNO-BREAK SPACEÝ Pu0104+ Ý  A1) õLATIN CAPITAL LETTER A WITH OGONEK= 62d8= 2= GBREV] &41  3  ] L] TSTROK= !xa˜  w A4= ÕCURRENCY SIGN… !13YÂ 5( e 	GCARO< &5a¡ 6< S¡ FACUT  7:   7< xSECTIONŸ !xa"' 8' –DIAERESISÃ 6°Ã 9$ Ã ‡ Ã 4< A< gEDILLAz g> Üz Tz  79< ô< Z< 
=³§SOFT HYPHEŸ7( b b 	ž ¸< &< 	uDOT ABO¼!xb’¢ BBhDEGREEÞ ?5B?OSMAL=¡ B=^6142\ >	\ <bÕ½ <v ACCENTþ3<B;b ^5½ 9	: °{ t !2c9˜B7Z (xb0B0C´VB.| \ Au015<| ,: v ê*	< (eB(	: & Fu02d B&qDOUBLE SÎ7Î.h 7À,: * Vo> C*jR cÊ©C@÷ J!xc< Ax »£CIRCUMFLEXA  ½C ¹ Ð3 -> LATIN CAðPITAL LETTER A WITH BREVE
    '\xc4'
 ÿ #  0xC4 -> LATIN CA< “DIAERESIS@ Pu0139B @ 5@ L| DACUT| Vu0106< 6< C< 0xc7:  ¸ 7< vCEDILLA¶  0c@ ¶ 8> CARON< !xcð z 9< E¶ Vu0118x A< eOGONEKy b; y B= «  1aB õ C@ Cõ d: | D< Iõ 8xce< E< £CIRCUMFLEXù  (C ¹ FA D} ¹  r0 < /D0< WSTROK¡&43= 1= Ny Ý4£y 2< µ !xdv n/D3< Ox (xdÑDÑ< n52ÒA xDOUBLE ü !xd×À ÙC U!xd:@ ÝôMULTIPLICATION SIG‘Fu015UDÍR.jFu016[DÍU< †RING ABO@dS« ÒA 'Gu017jÑ< jÇ ÔC jØDØY ¿ &62ØT< 
ƒ0xdf< º ÕESMAL³gSHARP n 557 UEÎ	5 é­ 0xe18 o EË	: "
: å : É: O0Î³ Ì? 	›eÊEÊ: îÀ   '\u013a' ô+  #  0xE5 -> LATIN SMALL LETTER L WITH ACUTE
    '\u0107' : 6: C: !xe8 : 7: wCEDILLAv dv 8< CARON: 0xe98 v 9: E° Au011< $A: eOGONEKu bu B; “DIAERESIS>  y @ y C> Cí %í D: Ií 8xee² E: ¦CIRCUMFLEX³  0fA ³ F? Dy ³  í 1: /F0: WSTROK‹&44; 1; Nu Å&48: 2: ¯ 0xf38 b/F3: Ot !xf¬ : 4: b5(²y iDOUBLE¹8xf6º ¹A ”(xf½F½ÄDIVISION SIGoFu0155F©R ZFu016CF©U: ”RING ABOV8xfaß ®? 7Z­: Zc{ °A Z´F´Yø ¹ 6ŽuF´T: Q'2d¨±3DOTSó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_3 generated from 'MAPPINGS/ISO# / À-3.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
ÎAdef ë ñe(self,input,errors='strict'):,  creturno B = , 4ingC  o 6o *B 	o  o ú À Incremental€Encoder( ãcs.Incremental Á):
    def e, ó
(self, input, final=False*  . sreturn U ƒcharmap_@ :  F �.errors, ÷ing_table)[0]

class �  DeO ª  €  ª d, ª '@ ª  ª ðStreamWriter(Codec,° 8cs. ¤ Dpassã  0Rea‡9   	9 2###�ðings module API

ý Ãgetregentry(7 
�e QInfo(Û ±õname='iso8859-3', œ!e=4 2().     iP: 'r=Óc/ J 	/ è/ str;=H# w—# ¤# @)


N[ Ping T‚ H5codè2 = +`'\x00'1ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™À  0x1E -> REð
CORD SEPARATOR
    '\x1f'
 ü #  0x1F -> UNIT)  & "  )  20) RSPACEI !  1  òEXCLAMATION MARK+ "+ 2+ LQUOT) #) 3) ²NUMBER SIGNO $& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'"17$ ƒPOSTROPH(I 8% ñLEFT PARENTHESISP +')+ 9+ ORIGH,  *, A, sASTERIS_+# B# GPLUSç ,$ C$ RCOMMA“ -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU<5% SK 3FIVJ 6% Q% 2SIXÜ 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 ML1 æLb M1 îb M1 N1 ù1 �O1 þ1 ð O
    'P'      ð  #  0x50 -> LATIN CAPITAL LETTER P
    'Q'   1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ C. ãREVERSE SOLIDU¯]) sD* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINEÖ `# 6ñYGRAVEJ a' çESMALAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Óî	/ K/ l/ Ô	/ L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃðCURLY BRACKET
  c  '|'  ð
#  0x7C -> VERTICAL LINE
  +'}( D( òRIGHT CURLY BRACKET. ~. E. CTILDN B\x7f# v F  UDELET! '80!  80! ’<control>e H\x81$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ G°d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÔNO-BREAK SPAC©Au012“ÊAE°LATIN CAPITEöETTER H WITH STROK= !2dˆ= ^DBREV  (xaZAZ¤POUND SIGNa[A[ˆCURRENCY( cufffe'5  · 7 z H· 	£CIRCUMFLEXA (xaeAexSECTIONu !xaà "  h h“DIAERESISK Au013n$ hŒ ICuDOT ABO&Au015ö@ „@ S@ vCEDILLA~ 1> ž> G>   º F¶< J< F ÓAÓ¤SOFT HYPHEâº7Pî ¾t Zt .À\xb0'     # ð 0xB0 -> DEGREE SIGN
    '\u0127'   # & 1& óLATIN SMALL LETTER H WITH STROKE; 0xb29 ; 2; õ SUPERSCRIPT TWO* 3* 3* 6HREV 4, 4, ÅACUTE ACCENTS 5' 5' \MICROÝ ' Ý 6% Ý ¥CIRCUMFLEXd á 7? –MIDDLE DO‰ 8‰ 8% sCEDILLAG Pu0131$ † 9" †  –DOTLESS I7 &5f7 A7 Sšs 1< B< G< DBREV ­ 3C: J: 3 d³ 3D? ô	VULGAR FRACTION ONE HALFè Tfffe' @017cB ,F@ , Z uDOT ABO½ 0xc0< ~ Có> eCAPITAÏA@ 7GRA< ¤< 	< ”¶ (xc
C
x 	7u(xcCN 	“DIAERESISŽ Pu010aDC@ CF @ Ô@ 6
@ Î (xc8C8� 	
¼!xc} ‰Q> E¿ 
Å9ù < k» < 
Å5< p< ÷  b} uA ¸!xcú� {@ Iù xCx5< 
ù e¸ Etx ù  l¹ µA ù 
þdˆDˆNDTILD½(xdˆDˆO< 	;d¤D¤B< 	Bd²D²< B †»sD³²³7xd6ÃðD6 -> LATIN CAPITðAL LETTER O WITH DIAERESIS
    '\xd7'
 ó #  0xD7 -> MULTIPLICATION SIGN. Pu011c0 . 8. ¶LATIN CAPITn Gn £CIRCUMFLEXA 0xd9?  o 9A UA UGRAVE< a< A< FACUT< b< B< ¹  ø ¹ CA hAu016B :D@ 5BREù Gu015< E< S5½  fþ FA ESMAL#eSHARP 'e05 /E05 At 	©(e1: 1: 	§(e2: 2: è dufffe'/(e4L 4L ° 03°/E5> Cþ xDOT ABO²0é> 6> È (xe•E•g	°} uCEDILLA÷ 8÷ £	< E¹ 
·³ ãEœ: 
·šEš: ï  jy �? ª!xe> š	> Iñ d+”: 
ñ e: ’: ñ  �E�³ ñ 
æflFlNþ ETILDflFl8	)'f3þ /F3Þ: 	8f”F”: 8Au012ï WF•}•8xf6· •} v(xf”F”_DIVIS# W¤ €¤ ã (xf…F…f…À#  0xFA -> LðATIN SMALL LETTER U WITH ACUTE
    '\xfb'
 ß #  0xFB -> L: ¥CIRCUMFLEX? c? C? “DIAERESIS> Pu016d@ } D> DBREV· Gu015: E: Sñ · Vu02d9y F? óDOT ABOVE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_4 generated from 'MAPPINGS/ISO# / À-4.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
–Adef ë ñe(self,input,errors='strict'):,  9creturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  š�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ˆE-4', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  ‘Tè
~ è2 = +P'\x004 , 006ANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" ¤ACKNOWLEDGƒ8x07& w7 -> BE8 8 tACKSPACC t" Q9$ ð HORIZONTAL TABUŒ» n0 A0 ‘LINE FEED½ À'\x0b'     #ð  0x0B -> VERTICAL TABULATION
    '\x0c'
 ! #. C. “FORM FEED$ r"  $ D$ æCARRIAGE RETURN e, N E* “SHIFT OUTN 8x0f$ F$ IG '10#  10# ôDATA LINK ESCAPEN (11+ 1+ öEVICE CONTROL ON- 2- 2-  5TWOZ 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% ¡Ô”1”ÆILE SEPARATOFdJ ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦CSPACè !  ›aEXCLAM�C MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSAN"1"'"Cu“APOSTROPH(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3F4COL(;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, À#  0x3F -> QðUESTION MARK
    '@'   ò	#  0x40 -> COMMERCIAL AT( A( 1( òLATIN CAPITAL LETTER A1 B1 21 B1 C1 31 C1 D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 CL1 C1 Lb M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 5ßP1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ P5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ ÕÐSMALL LETTER �J
    'k'   ò#  0x6B -> LATIN SMALL LETTER K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ ðóEFT CURLY BRACKEG|- îÒVERTICAL LINEU }( çORIGHV ~. æCTILDN B\x7f# “7×UDELET! '80! 8É’<control>“ H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@Àx9e'     #  ð0x9E -> <control>
    '\x9f'
 � #  0x9F$ 'a0$  A0$ ãNO-BREAK SPACEM Pu0104+ M  A1) öLATIN CAPITAL LETTER A WITH OGONEK= &38= 2= ESMAL; 6KRA1 &561 31 n Rn dCEDILL> !xaª  ù  A4> ÖCURRENCY SIGNf 2— 5( Ô If GTILD&3b¢ 6< L< ¢ 7< ¢ 7> xSECTION¡ !xaŸ ' 8' –DIAERESISÅ 6Ä™9$ Å S‰ 7ARO 12‰ < A< E< 9MAC= 2= B= G= 
Gu016âC> T> TSTROK}0xad¶ D= §SOFT HYPHEÞ 7( Þ $Zc C(xa<A<	þ !xbuƒ B9hDEGREEÁ 65« ƒ B6	ù4&2daB4U5F\ $	\ "b"B"ÆACUTE ACCENT\&29¿ !	c c: 	: Gu02cÙ 	œbB]1~ 	~ 3: 	: ; 	; ó 	< Vu014a² æ6ENG×&7e3 	n   m •m 	: 	k 0)¥C'1 É
dcÅdC>= Âä !xcœ< ?y 	¥CIRCUMFLEXA ÍA _} (xc_C_} 	Ô!xc5| x| ÀLETTER A WITðH RING ABOVE
    '\xc6'
 ô #  0xC6 -> LATIN CAPITAL LETTER A2 Pu012e4 2 72 ÓI WITH OGONEKo Vu010c= 8= C= SCARON< 0xc9:  « 9< E< GACUTµ  18> µ A< 	µ 0xcb; y B= “DIAERESIS¹ Au011f} C@ +OT¤d€ D@ rù !xc¬¼ E< ¦CIRCUMFLEX½  2a ½ FA 6MAC³ ú 0= /D0= D³WSTROK´&45= 1= N= vCEDILLA¸ 4j/D2> O> ¸ 3²/D3= K= 
{ 0xd4· t/D4> { t!xdø A 5A DTILD6!xd¹ < Ñ} ­8xd7½ ßõMULTIPLICATION SIG”dVn Ðn á 72m [DÑUf
•d–z Ò= 	dÑDÑ< ¡ [} ÒA eAu0169ú Ò@ á < û < Ò< 	Ù0xdfq¹ ÎESMALígSHARP À 017 r EÆ	5 A¦
p e9 p EÄ; 	¤e: À: ¢ e3² ? Â? `(xe¾E¾: Ú(xe»E»> �e¾E¾
? î �Ò›®¿0 ÀTTER I WITH ò2OGONEK
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
: 0xe98 : 9: E: VACUTEt 1< t A: 	¯ 8xebu B; —DIAERESISy 7@ y C> tOT ABOV· !xe)ñ D> Iñ 0xeev : E: ¦CIRCUMFLEX· 2÷ · F? 6MAC¥Pu0111| ; /F0; D´ TSTROKï Vu0146; 1; N; vCEDILLA² 4-w 2< O< ² 3¤/F3; K; 
w 0xf4± h/F4< w h8xf5? 5? DTILD,!xf*y 6: —!xfñ > 7> ÅDIVISION SIGr(f8  ¬ß Í 73= ‘­UV
s fa9 ž ®; è!xf¶: ­: � cy ®? UFu016eF®> Í : ¹ ,®: ½'2du ªDGó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_5 generated from 'MAPPINGS/ISO# / À-5.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
Adef ë ñe(self,input,errors='strict'):,  acreturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.SÀ)[0]

class ðIncrementalDecoder( >cs. Á):
    def d, ó
(self, input, final=False*  . sreturn U ƒcharmap_@ :  F �.errors, óing_table)[0]

class StreamWriter(Codec,U  z Jpass9 0ReaÝ 9   	9 ð### encodings module API

ý Ãgetregentry(7 
æ e QInfo(1 õname='iso8859-5', h !e=4 2().     iÀ: 'r=¹EÄ /er/ J 	/ / str;=g.# w—# ¤# @)


N[ Ping TØ H^è2 = +`'\x00'1ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ À  0x22 -> QUðOTATION MARK
    '#'   ò#  0x23 -> NUMBER SIGN& $& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 0"'"“   — 7$ ‘POSTROPHE% +'(I 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, sASTERIS6+# B# GPLUSç ,$ C$ RCOMMA“ -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ Tm CTHREJ 4& T“ BFOUR“ 5% SK 3FIVJ 6% Q% 2SIXI 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUES@@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 ML1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 À  #  0x53 ->ð LATIN CAPITAL LETTER S
    'T'   ¯#  0x54 ->1 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ …C. ãREVERSE SOLIDU¯])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINEÖ `#  60# YGRAVEJ a' 1' …ESMALƒAV b/ 2/ B/ c/ 3/ C/ d/ á	� D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó[	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICsB}( çRÀV  ~. æCTILD~3\x7�7×ðDELETE
    '\x80'  ð#  0x80 -> <control>
 `'\x81'
  $ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ '90$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ãNO-BREAK SPACE…Au040G…AE÷CYRILLIC CAPITAL LETTER IO5 X5 V5 (DJk j6 h6 G6 |6 z6 ¸UKRAINIAN Iu —? •? (DZ6 ©6 §6 ×BYELORUSSIAN-‚ ,ÐK ÎK 'YI5 á5 ß5 	*ò5 ð5 L6 6 6 N6 6 6 8TSHX)7 '7 Km (xa9A9·SOFT HYPHEN4=\ ;\ wSHORT U: S: Q: (DZÍ 1f7 BdÀCYRILLIC CAPø%ITAL LETTER A
    '\u0411'   #  0xB1 -> CYRILLIC CAP4 'BE5 25 25 	V5 35 35 	(GH6 46 46 	D5 55 55 	I5 65 65 	Z  76 76 
k 85 85 	It94 94 	hSHORT : a: A: 	Kb5 B5 	'EL¤ c5 C5 
M5 d5 D5 
N5 e5 E5 	O4 f4 F4 	P«%205 /C05 	&ERj 2UCU
'ES5 UCU
TŸ UCU
Ui SCS
'EF5 SCS
HE2SCS
(TSÔ SCS
C‰2TCT
S¢ VCVC8 TCT
‡HARD SIG¼2[C[
8YER·]C]
LSOFTs dCdòcCc
Y¥ dCd
Y'3dDdOSMAL¶3aDa	2 ´3_D_	3 ²3]D]	3 	°3]D]	4 ®3[D[	3 ¬3YDY	3 ÀZHE
    '\u0ö'437'   #  0xD7 -> CYRILLIC SMALL LETTER ZE
    '\u04383 83 I2 92 92 hSHORT 8 a8 A8 'KAk b3 B3 'EL3 c3 C3 M3 d3 D3 N3 e3 E3 O2 f2 F2 P›%403 /E03 &ERf &413 13 S3 23 23 T™ 33 33 Ue 42 42 'EF3 53 53 H/&463 63 (TSÌ 3E3(CH4 4E4Sœ 6E6
C6 4E4‡HARD SIG¢4;E;8YER§=E=LSOFTo DED	àCECYŸ DEDY6211FDkNUMERO¾ 57F7IÐ57F7'DJ858F8G4 :F:¸UKRAINIAN Iq DFDD52E×BYELORUSSIAN-~ á5ZFZY#5YFY	 XFXL4 VFVN4 PFP(TS)5PFPKi !xa5ÄFJ|SECTION³?À 0xFE -> CYRÿ)ILLIC SMALL LETTER SHORT U
    '\u045f'   #  0xFF -> CYR8  óDZHE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_6 generated from 'MAPPINGS/ISO# / À-6.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
.Adef ë ñe(self,input,errors='strict'):,  ^creturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  š�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ˆE-6', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  ‘Tè
~ è2 = +P'\x00EG 00GANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t" Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ì 0B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓŠN Œ$ IG 1h1hðDATA LINK ESCAPE
    '\x11' ð    #  0x11 -> DEVICE CONTROL ONE
" `'\x12'
 - 2-  5TWO- 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & { 20) CSPACÇ !  ›€EXCLAMAT‚3MAR�"+ ™LQUOT) #) •²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'"Vu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[“DIGIT ZER¡1% `% òï™3Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:MFCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 À4 -> LATIN CðAPITAL LETTER D
    'E'   ú#  0x45 -> LATIN C1 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ d5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çESMALbA,b/ å	/ B/ c/ ã	/ C/ d/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó		/ ál/ Ô8	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ ÜðATIN SMALL LETTE°R O
    'p'   ò#  0x70 -> LATIN SMALL LETTER P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# ¨F  UDELET! '80! 8É’<control>“ H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÔNO-BREAK SPAC©cufffe'’ (xa A ßCURRENCY SIGNB \ Àffe'
    '\ußfffe'
    '\u ó060c'   #  0xAC -> ARABIC COMMAA 0xad% ' D' ³SOFT HYPHEN& g �  b@061bÑ ö  BBÏ ö �SEMICOLOÔ F061fR FR ßQUESTION MARK*E0621< 'C1< ´LETTER HAMZ‹Vu0622. 2. ôALEF WITH MADDA ABOVEy F0623> 3> 	v > 4> 4> 2WAW{ = 5= 5= ¹ > WBELOW¹ 6> 6> ?YEH{ 	7= 7=  { j 8- 8- 7BEH, 9, 9,  TE‡HRBUTÁa4 A4 ` ©C©)TH� ÌCÌ- GJEEMZ ÔCÒ- (HAæ e² E² K- 
C
Y 6DAL… %30Y .D0Y )TH- 'D' R3%D% 5ZAIã6063D &SEä6063D *SH. ôDô 7SADâDâ D, ÑDÑ T¾3ÐDÐ Z, ÐDÐ 
7ÈDÈ 'GH. è.6064,E,gTATWEEU4(E( F(4(E( 6QAF 4'E' K, &E& 'LAŠ4$E$ M·4%E%ÀTER NOON
   ó '\u0647'   #  0xE7 -> ARABIC LETTER HEH
   , 8, 8, 7WAW, 9, 9, ÇALEF MAKSURA5 a5 A5 Y� b, B, ‡FATHATANV c* C* KDAMM* d* D* KKASR* e* E* ~ { f' F' { ' %50' 'F0' x ' 1' 1' WSHADDG&52( 2( 5UKUTfffe'\  ‚ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_7 generated from 'MAPPINGS/ISO# / À-7.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
•Adef ë ñe(self,input,errors='strict'):,  ¡creturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  š�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±cname='ˆE-7', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  ‘Tè
~ è2 = +A'\x0/¶01ANULL0  ' )ðSTART OF HEADING
   € '\x02'  ð
#  0x02 -> START OF TEXT
  ( 3( 3( =END& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& •7 -> BELL 8 8 tACKSPACC t" "  9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEEDx b& T B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ 1+ öEVICE CONTROL ON- v1vD- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÌ(19f¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt0"'"®  ø2u“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þ[3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK ÀFIVE
    '6'  ð#  0x36 -> DIGIT SIX
 0'7'   $ 7$ BEVEN& 8& 8& REIGHT& 9& 9& BNINE% :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARKç @(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 31 C1 D1 41 D1 E1 51 F1 ™õ Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ ¨5ãREVERSE SOLIDU¯])  * R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# 6ñYGRAVEJ a' çLSMALõb/ å	/ ðB
    'c'       ð #  0x63 -> LATIN SMALL LETTER C
    'd'   / 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ ðS/ t/ ðT/ u/ ðU/ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�Ü7×UDELET! "80D ! 8É’<control>è H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ ÔÔC$ É$ 9$ =8=$ 9@9@9@9@9@9@9@9@Àx94'     #  ð0x94 -> <control>
    '\x95'
 � #  0x95$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ 'a0$  A0$ ãNO-BREAK SPACEµAu201Kµ A1) ÷LEFT SINGLE QUOTATION MARK5 \5 25 ORIGH6 8xa3” 36 ¦POUND SIGN[ aK[ iLEURO$ $ ixDRACHMA' (xalAl£BROKEN BARp (xamAm1SECò — !xa% ÜAp•DIAERESISK $ pDCOPYä 1037wÀ uõGREEK YPOGEGRAMMENIW A ¢ÿ-POINTING DOUBLE A±xT› Ÿ NO¯• (xažAž¥SOFT HYPHEŸSfffe'š  <óÈ ‰¨HORIZONTALebŽBŽ DEó 	°'b1 B‹ªPLUS-MINUS* 2* €ó SUPERSCRIPT TWO£ (xbtBt	* 5HRE@0384X Ï B{ ¤ dK TONOæFu038õ B}& �DIALYTIKA0 ˆV †0 @CAPI(ùLETTER ALPHA WITH@ (xb¡B¡£MIDDLE DOTç  • ¡e Ÿe ~EPSILONg  B ¿B ½B T¥   > ÒBÒå /IO? (xbãBã6ä „ :BäÂ _OMICR(xbB¢VULGAR FRA‡ONE HALFye4°u Uy	ÍBEB OOMEG{9^¹C\@ cSMALL ^y§9ANDkAu039ƒK �K ÐCAPITAL LETTEø+R ALPHA
    '\u0392'   #  0xC2 -> GREEK CAPITAL LETTER BET4 34 34 HGAMM5 45 45 9DELj 55 55 wEPSILONÕ 67 67 ZÕ 74 74 
3 83 83 *TH5 95 95 )IOa4 A4 HKAPPqb5 B5 HLAMD5 c5 C5 'MUld2 D2 N2 e2 E2 'XId f2 F2 XOMICR%a07 /D07 Pi &a12 12 4RHOœ Tfffe' 603aD8SIGaD'TACaDUaD(PHDC3 D(PSf DGOMEG¬aD Jè WITH DIALYTIKC $D$HF 5D5ESMALBwB WTONOS4ADA	> â@ ODO
@ /TA< YDY	< A¹ b_E_	= ;\ AND N {E{	N E:b¼E¼	3 
ºb E 	2 ¸bžEž	3 ¶bžEž	3 ÒÍ œEœ	5 
²b›E›	2 ðETA
    '\u03b8'õ$   #  0xE8 -> GREEK SMALL LETTER THETA
    '\u03b9'3 93 )IO2 a2 A2 HKAPPe b3 B3 HLAMD3 c3 C3 'MUÈ d0 D0 N0 e0 E0 'XI` f0 F0 vOMICRON5 %c05 /F05 Pe &c10 10 7RHOa 21 21 §FINAL SIGM_&c39 39 3 43 43 'TAc&c51 51 YUPSIL365 65 (PH471 71 C1 81 %(PSb #F#HOMEG_$F$ Vè WITH DIALYTIKA 2F2<D CFC³D WTONOS]SFS	„ @ cFc8~  ófffe'
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð iso8859_8 generated from 'MAPPINGS/ISO# / À-8.TXT' with2 ‡ P.py.
m ±#"

import  sÊ j ÁAPIs

class  ($ . 1):
„Adef ë ñe(self,input,errors='strict'):,  Ïcreturno B = , 4ingC  o 6o *B 	o  o ú ±Incrementalá$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DXª  €  ª ø ª (@ ä ª  QÐ[0]

class StðreamWriter(Codec,c Fs.St ò):
    pass

class  ORead9  	9 ó### encodings module API

def getregentry(7 sreturn ‘ ž QInfo(�  ‘ õname='iso8859-8', h !e=4 2().   deU    ²incremental: 6r=I EÄ /er/ J 	/ Dl / sZr;=HR # w—# ¤# @)


N[ �ing TableH^ _t 2 = +`'\x00'1ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |ðAMPERSAND
    "'"   ð#  0x27 -> APOSTROPHE
 0'('   % 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# ’PLUS SIGN$ ,$ C$ RCOMMA  -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOUR“ 5% 5% #IVJ 6% 6% 2SIXI 7$ QCSEVE´8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 D1 E1 �1 ™F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 UÄ V1 ÀL LETTER V
 s   'W'  ð#  0x57 -> LATIN CAPITAL LETTER W
) +'X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ ò C. ò REVERSE SOLIDUS* ])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' ÁESMAL¿AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ 6/ F^ g/ Û	G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó—	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðV/ w/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTIC¯B}( çRÀV  ~. æCTILD~3\x7�7×UDELET! "80D ! 8É’<control>¤H\x81$ ¾$ 2$ ³$ 3$ ¨$ 4$ �À<control>
  �  '\x85'  ð#  0x85 -> <control>
  $ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ '90$ /90$ 1$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ @9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ãNO-BREAK SPACEÑcufffe' (xa.A.•CENT SIGN$ .A.ZPOUND% /A/ŠCURRENCY( 3A3:YEN# 2A2¥BROKEN BAR• 3A3kSECTIOL 6A6•DIAERESISK 6A6ŠCOPYRIGH	dt ;®MULTIPLICA{ EAEòLEFT-POINTING DOUBLE ANGLE QUOTD EMARK› eAe*NO• adAd¦SOFT HYPHEÄfAf›REGISTEREÉlAlUMACROK biBiiDEGREEÅb«B«ªPLUS-MINUS* ƒBƒô SUPERSCRIPT TWOb‰B‰	* 4HREæ(xb�B�€ACUTE ACáS �B�ZMICRO¢ ‘B‘zPILCROW' B“¥MIDDLE DOTq ‘B‘uCEDILLA" �B�æ %ONä fq �\DIVISbŠÀ#  0xBB -> Rð%IGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'
 ñ #  0xBC -> VULGAR FRAC/  ON= UARTER6 d6 D6 EHALF3 e3 E3 ETHREk S9 oufffe' ÿ‰@2017ÛB DFÙx„LOW LINE½E05d0*  E0* ôHEBREW LETTER ALE0Vu05d1- 1- 7BETY 2, 2, WGIMEL. 3. 3. 9DAL\ 4. 4. Hà 5+ 5+ 7VAV… 6, 6, WZAYIN. d.E7. H± 8Z 8, T, 9, 9, 7YOD„ a, A, ˆFINAL KAÃb2 B2 
, ŠFEˆ
HLAMEŒ ‚. €
. Œ 7MEM¾ �2 
2 
, f¸ Ò
, ^ 'NU eÚFÚ 
, ÙFÙ fSAMEKH¹ eÜFÜ 
(eÛFÛ º P³eÞFÞ 	+ ÞFÞ \ WTSADI½ æFæ . æFæ 'QO\eæFæ 8RESDçFç (SHleèFè TÆœ6200pF¢�LEFT-TO-R¥…Fu200qF�%  .  6 	- t ð)

### Encoding table
eøncoding_table=codecs.charmap_build(de$ ð)
""" Python Character Mapping CB ð iso8859_9 generated from 'MAPPINGS/ISO# / À-9.TXT' with2 ‡ P.py.
m ±#"

import  cs

###j ²APIs

class ($ .‰ Ð):

    def eë ñe(self,input,errors='strict'):,  0 creturno B = , A)o 6o *B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� DXeª  €  ª ø Nª !@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ÐJàs module API

ý Ãgetregentry(7 
¡ž UInfo(Âcname='ˆE-9', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  ‘TÙ HÅ2 = +`'\x00'âñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOHð13'     #  0x13 -ð> DEVICE CONTROL THREE
    '\x14'
 ­ #  0x14 -/ EFOUR. 5. 5. öNEGATIVE ACKNOWLEDG] 6/ ö6 -> SYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  ò 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN‡$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDq 1"'"úu“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ àÝã3T“ ×Ô% SK 3FIV” Ê% Q% 2SIXÜ Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI):FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™ÀLATIN CAPITAðL LETTER F
    'G'   õ#  0x47 -> LATIN CAPITA1 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ 5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMALÏAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó§	/ ál/ ÔÖ	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ð ÀTTER Q
    '3r'  ð#  0x72 -> LATIN SMALL LETTER R
' +'s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# JF  UDELET! '80!  80! ’<control>“ H\x81$ 1$ 2$ ³H 3$ ¨$ 4$ �$ 5$ ’$ 6$ ‡$ 7$ |$ 8$ q$ 9$ f$ a$ [$ b$ P$ c$ G$ d$ C$ e$ 9$ =8=$ 9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@a@A@ÕNO-BREAK SPAC©aEAE INBôED EXCLAMATION MARK¹aUAU•CENT SIGN$ UAUZPOUND% VAVŠCURRENCY( ZAZ:YEN# YAYð BROKEN BAR
    p'\xa7'  ð	#  0xA7 -> SECTION SIGN
  ' 8' 8' •DIAERESIS$ 9$ 9$ šCOPYRIGHTM a) A) õFEMININE ORDINAL INDICATOR^ b5 B5 ñLEFT-POINTING DOUBLE ANGLE QUOTAÆ EMARKD cD CD +NOœ d# D# ¦SOFT HYPHEe& E& ªREGISTEREDì f* F* UMACROK 'b0!  B0! iDEGREEG (b1& 1& ªPLUS-MINUS* 2* 2* ô SUPERSCRIPT TWO(b3* 3* EHREE, 4, 4, ÅACUTE ACCENT' 5' 5' ZMICRO¢ 6% 6% zPILCROW' šBš–MIDDLE DOq ˜B˜uCEDILLA“ –B–&ONä —B—oMASCUL˜
b˜B˜ò™b™B™¢VULGAR FRAŽ ONÖEARTEb¬B¬6 EHALFe|¹3 Tø1 QUk ÝbÈBÈÝINVERTED QUESlcØCØõLATIN CAPITAL LETTER A WITH GRAVŠcîCî< 	Šâ c C < 	¥CIRCUMFLEXA CA 	FTILD¹ 'C'< 	Cc@C@@ 	Rø7ABO:\C\A ³ gCg2 C¨^c€C€> E> 
æšCš< 	
æ¬C¬< 	æ ·C·A 	ª²C²@ Iù ¸C¸< 	
ù ÁCÁ< 	ù Àcf'     #  0ÿ4xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u011e'   #  0xD0@ G@ SBREVE< 0xd1: < 1< N< FTILD< 2< 2< O< 7GRAx 3< 3< FACUTx 4< 4< ¥CIRCUMFLEXõ 5A 5A 
õ 6< 6< ­8xd7@ 7@ õMULTIPLICATION SIGNª 8. 8. cVSTROK(9= 9= U a< A< 
 b< B<   cA CA dPu0130B D@ QeOT ABO�Gu015QE@ S9uCEDILLA´f| SÏESMALÍdSHARP Ä!xe± 5 &E0s 	5 Aq 	JeÂEÂ: 	¨eÀEÀ: ¦eÃEÃ? 	DeÁEÁ: Þ(xe¾E¾> IRINGÝ(xeÁEÁ
? Fe±E±ƒ	0 Cše¿E¿	< E< 
Ö¼E¼: 
ÖºEº: Ö ½E½? œºEº	> x
ñ d6E´: 
ñ ¬;®: ñ  ¯E¯³ ñ  |@ kF¸zf¸À 0xF1 -> LATðIN SMALL LETTER N WITH TILDE
    '\xf2'
 ü  #  0xF2 -> LAT: O: FGRAV: 3: 3: FACUT: 4: 4: ¥CIRCUMFLEX³ 5? 5? 
í 6: 6: •DIAERESISx 7> 7> ÕDIVISION SIGN( 8( 8( SVSTROK9; 9; UŽa: A: 
Žb: B: Ž c? C? TPu0131@ D> “DOTLESS IcVu015f7 E7 S(sCEDILLA< !xf:  òF< Y< ± ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
#
# johab.py: Python Uni=   CB ¡ for JOHAB- ð*Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _R rcs_kr,   €multibyt› ±ec as mbc

& ' =: A.get !('´ ’')

classª ( !s.· !):d2e =t .  
  P ±Incrementale„er(mbc.Mª   ,U ¿ — 4 ¤   £ ‚  D‚   ‚ 4 ‚ 	ÑStreamReader(T,™! Õ. ^  N^ 
! ^  ^ ódef getregentry(& breturn"UInfo(¶Sname=WJ0=þ #()? 5   iFI .r=/ J 	/ ²/ s r =w# cwriter# <# T)
"""õàCharacter MappVö ð9 koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.ðpy.

"""#"

import codecs

### C Â APIs

class ($ . à):

    def en ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âåname='koi8-r', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[ Ping T• E5codå2 = (`'\x00'ßñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ðSYNCHRONOUS IDLE°
    '\x17'
 õ #  0x17 -> END OF TRANSMISSION BLOCK4 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( ¥SUBSTITUTE% b% B% VESCAP! c! C! åFILE SEPARATORJ d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  j 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'"ru“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ ÃQ3Q$ 3EVEèµ& R& E-L º& M& $NI):• FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 ÀAL LETTER I
p    'J'   ð#  0x4A -> LATIN CAPITAL LETTER J
& +'K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ o5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMAL<AV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ ãk/ Ó	/ ál/ ÔC	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöðu'        #  0x75ð -> LATIN SMALL LETTER U
    'v'   #  0x76/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# ŽF  TDELET! Pu2500# !  80! áBOX DRAWINGS L| ¢HORIZONTAL§ \8 28 18 â 6 c6 26 ‘DOWN AND ù < 1ª 3< 3LEF| ­ &14w 4; /UPu 8: 5: s ê X  y 2³ @ 
 2 (?  ià3€ :A  3? € J?  	ÿ E 8ò`öUPPER HALF BLOCK8¯ ^?LOW+ ÓaMFULLP À X _z 9¥ b·+ 1M9l_5SHA³Fu259Z9Z|MEDIUM ' 3M KKDARK% &32� 942TOP› hINTEGRÒa, %¦LACK SQUAR16219x åULLET OPERATOR”621a* K F ROOœ&24�9éö ALMOST EQUAL TOP 6ä9ÔÏLESS-THAN OR0 5€ ÃGREATER3 x!  9·ÖNO-BREAK SPAC'32Ë›oBOTTOM\!xbZX Ÿ³DEGREE SIGNá !xbø& šäSUPERSCRIPT TW0xb7Ù * Ÿ…MIDDLE DZ)xf% šˆDIVISIONw Au255Ÿ õ A—	¬àDOUBLE HORIZONù)TAL
    '\u2551'   #  0xA1 -> BOX DRAWINGS DOUBLE VERTIC7 27 27  óWN SINGLE AND RIGHTM { (04{ 3D ô	CYRILLIC SMALL LETTER IO3 F2553w 43 ® #WNf w ˆ D 4D 5D  ò FDOWND = 5= 6=  
ø <LEF÷ F2556C 7C w ;C Ã 7C 8C  
Ã  C Â 8< 9< /UP¸F2559B AB ¿ úÀ aB BB ? /UP�b; C; 
¿  ù  cA DA  }dA EA > ½  ‚ { e: F: e�fH /B0H ‹  É ‡&60H ü�6=BÑ  “7040G 
	oCAPITA6‚B| | ‹6RBN  L G Ô6NBpHORIZONÓ ™ I ZBI Ò `BI ‹ _B#@ ×6256jB(G Ð oB-G Î mB2Ûw æF Ô B>M ÝM c š ‹BJT  |š F !xaÂBVDCOPYñ"GN) À\u044e'   # ð$ 0xC0 -> CYRILLIC SMALL LETTER YU
    '\u0430'   # 3 13 A2 12 22 &BE3 &463 33 'TS4 &344 44 D3 53 53 I3 4f 63 &EFÍ &33f 73 (GHg š 84 Hg8g 93 I™ 92 A2 hSHORT 8 a8 B8 K� b3 C3 'ELž c3 D3 M3 d3 E3 N3 e3 F3 O2 f2 D4PÎ3 4Y14gD5&ER™ 4hD5'ES3 2Ì 4TÌ ÎD42ÍD3Z 3™ 4V™ 0D3‡SOFT SIG4�D:8YERÖ 7;=Z¢ ¢D8SÖ4ÓD9	ÔÖD89SHCh Ï ;C¥4D<KHARDr2vEDoCAPITAz1EF5 G1EG4 ~2±EI5 	€1EL6 ‚1èEN5 „2j 
Q5 †1¸ERÀCYRILLIC CAPø'ITAL LETTER GHE
    '\u0425'   #  0xE8 -> CYRILLIC CAP6 &HA5 &185 95 	I4 94 A4 	hSHORT : a: B: 	K£ b5 C5 	'EL¤ c5 D5 
M5 d5 E5 
N5 e5 F5 	O4 f4 /F04 	Pà5 15 	Y=&20j 25 	&ERŸ &215 35 
S5 25 45 	TÔ 35 55 	Ui &164 64 	Z1Ÿ 76 	VŸ FFS
‡SOFT SIG2·FZ
8YERÞ 7Þ ]
Z¨ ÆFX
Sü2ïFY}2üFX
9SHCl × [
Cµ20F\
BHARD€ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB p koi8_t* ð
# http://ru.wikipedia.org/ –/ÐšÐžÐ˜-8( ò
www.opensource.apple.com/ •/libiconv	 %-4 ò/tests/KOI8-T.TXT

import Ú ¤ ÁAPIs

class  ($ . 1):
ÝAdef %ñe(self,input,errors='strict'):,  rcreturno IB = , 4ingWC  o po *B 	o  o ú ±Incremental$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� D’ðer(codecs.Incremñ	entalDecoder):
    def d ó
(self, input, final=False*  . preturn A ³cs.charmap_@ :  F �.errors, óing_table)[0]

class StreamWriter(Codec,U  z Jpass9 ORead9  	9 ð### encodings module API

ý Ãgetregentry(7 
æ ž QInfo(1 åname='koi8-t', e !e=1 2().     aincrem£: 6r=I EÁ /er/ J 	/ å/ sqr8=d+# w”# ¡# @)


K[ Ping TÕ E[å2 = (`'\x00'.ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) ð#'        #  0x23ð -> NUMBER SIGN
    '$'   p#  0x24& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 0"'"m   q 7$ ‘POSTROPHE% +'(I 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# GPLUSç ,$ C$ RCOMMAD -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& T“ BFOUR“ 5% S¸ 3FIVJ 6% Q% 2SIXI 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 ÐS
    'T'    ð    #  0x54 -> LATIN CAPITAL LETTER T
& 0'U'   1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ TC. ò REVERSE SOLIDUSX ]) ¯D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' TESMALRAV b/ 2/ B/ c/ 3/ C/ d/ á	� D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó*	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICBB}( çRÀV  ~. æCTILD~3\x7�87×TDELET! Au049`! 8ÉðCYRILLIC SMALL LETTñ:ER KA WITH DESCENDER
    '\u0493'   #  0x81 -> CYRILLIC SMALL LETTER GHE C dSTROKE@ F201a@ 2@ ôSINGLE LOW-9 QUOTATION MARK6 F04926 36 v oCAPITAx eB 4B ODOUBx F20266 56 pHORIZONr „ELLIPSIS¦ F2020. 6. FDAGG=F2021! 7! … 
( 7fff­ 8( –UNDEFINEDm 3m 9$ äPER MILLE SIGN) 704b²A) <	²HôF2039· BB ´áEFT-POINTING AÈÂbÂCD † Âˆ F04b7ˆ DD 	Ê #CH|¿ bÑEC ‡ E 
ŸFE Ÿ6049è 90$ ð lE2018ð 9lSLEFT }i6201­9aORIGH6 ck ak $k d5 Tk 6 2
9TdBULLET±6201±9GwEN DASH" 4y H)EM" 	£9B1‰ BQTRADEz	C
N Cñ7203ñ%&
i &i 
$ $ ç$ Æ	l AÆH E04ef�A¦ê	–USWMACROžeëA¯> ‘@ 5SA¹@ 	~ #IO>!xa<ÃA·‰CURRENCYö604eˆA©[ Ù  !xahf ÆB	DN BAN!xaÐ% É1SECÿÃ
‡Î
$ Î«
$ 	ÈÀD
    '\xab'  ð&#  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
9 `'\xac'
  D CD …NOT SIGN# d# D# ¦SOFT HYPHE& e& E& ¨REGISTEREDP Aufff, s F* ”UNDEFINEDt 'b0N  B0$ hDEGREEJ 8xb1& 1& ªPLUS-MINUS* 2* 2* ó SUPERSCRIPT TWOz Au040V ž  B3* õ
CYRILLIC CAPITAL LETTER I5 	Ó  B45 Ó Au04e… Y 5$ Y µ WITH MACROa(b6Ã 6@ zPILCROWê 7' 7' ¤MIDDLE DOTå 
° 8% ° 1211r ° 9$ hNUMEROo 
Í BA& J 8xbb“ ¨ORIGH©i ©i $ ª$ ¨$ 8xa9± ¢ACOPYµ 	þ @044e+ $C§ÔESMAL+$YU{1043Ü3 ´3 A2 ’C¼2 &BE3 4¼CÅ	˜ 'TS4 &34Ì Äg D3 53 
Ó	g I3 4f Æf &EFÍ &33f Ò3 (GHg š á4 Hg8g ð3 I™ )Ëü2 hSHORT 8 aj 8 K� Ek þ3 'ELž Ü3 3 M3 ì3 3 –Gu043+/	,E043fþ D4PÎ3 4Y14gD5&ERþ 4hD5'ES3 ÔD4TÌ ÎD42Íð D6 -> CYRILLIC ù%SMALL LETTER ZHE
    '\u0432'   #  0xD7 -> CYRILLIC 4 V3 &4c3 83 –SOFT SIGNm &4b: 9: FYERU5 &375 A5 Z¢ 83 B3 6SHAg &4d4 C4 f 92 D2 9SHCh Ï E6 C¥&4aj F4 KHARDr%2e: )E0: eCAPITAYr&105 15 	?&114 24 	BB&265 35 	'TS6 &146 46 	D5 55 55 	I5 2j 65 	&EFI&13j 
RsGã2  
U6 L1èEP5 IŸ ¶EO4 hSHORT : †EV: KóEW5 'EL¤ bEZ5 M5 ÁEY5 ’1 
Z5 Oi fáFT
PK5 T
Y=2‰FU
&ERŸ 2ŠFU
'ES5 FT
TÔ êFT
\óFS
	¦1Ÿ T
¨2FFS
ª 2·FZ

¬1ÝF]
®2ÆFX
	°2ïFYÀ LETTER E
  ô)  '\u0429'   #  0xFD -> CYRILLIC CAPITAL LETTER SHCHA
  8 78 E8 	7CHE6 a6 F6 	óHARD SIGN
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ñ
 koi8_u generated from 'p6 "-m, ðs/KOI8-U.TXT' with1 ƒ P.py.
i ±#"

import  sÆ f ÁAPIs

class  ($ . 1):
1Adef ç ñe(self,input,errors='strict'):,  —creturno B = , 4ingC  o 2o *B 	o  o ú ±IncrementalÝ$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DTª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  –�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±`name='„E-u', e !e=1 2().     ig: 'r=Ðz/ J 	/ å/ sqr8=E# w”# ¡# ")
[  ŠTá
~ å2 = (P'\x00Eµ 00GANULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" ¤ACKNOWLEDGU!x0‰w7 -> BE8E 8 tACKSPACC t" C 9$ pHORIZON vTABULAT» n0 A0 •LINE FEED½ b& Z 0B$ �VERTICAL R 8x0c. C. HFORMR r" ¦ ¬ÖARRIAGE RETUR[e, | žðSHIFT OUT
    '\x00f'  ð#  0x0F -> SHIFT IN
 W'\x10#  10# õDATA LINK ESCAPE+ 1+ 1+ öEVICE CONTROL ON- 2- 2-  5TWOZ 3- 3- 6HRE\ 4/ 4/  EFOUR] 5. 5. öNEGATIVE ACKNOWLEDG] 6/  6 4æYNCHRONOUS IDL+ 7+ 7+ õ
END OF TRANSMISSION BLOCKŽ 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% Ôc! C! ÖFILE SEPARATOFd) D) _GROUP*  e* E* oRECORD+   1 LUNIT)  Q 1   É2¦CSPACè !  ›€EXCLAMAT‚3MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‘AMPERSANDø0"'"¸  u“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þ[3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×Ô% SK 3FIVÊ% Q% 2SIX#Ã$ Q$ 3EVEèµ& R& E-L º& M& $NI:”3FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 ÀL LETTER B
 s   'C'  ð#  0x43 -> LATIN CAPITAL LETTER C
) +'D1 41 D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 S1 T1 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Æ5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çESMAL“A,b/ å	/ B/ c/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ók	/ ál/ Ôš	/ ßm/ Ù/ À M
    'n'    ð#  0x6E -> LATIN SMALL LETTER N
% 0'o'   / F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. æCTILDN B\x7f# ×7×TDELET! Pu2500# ! 8ÉáBOX DRAWINGS L| ¢HORIZONTAL§ \8 28 Ò8  â 6 c6 Ù6  ‘DOWN AND ù < 1ª æ< 	3LEF| ­ &14w ò;  /UPu 8: ý: s ê 9   y 2³ @ 
 2 (?  ià3€ :A  3? € J?  	ÿ E 8ò`öUPPER HALF BLOCK8¯ ^?LOW+ ÓaMFULLP À X _z 9¥ b·+ 1M9l_5SHA³Fu259Z9Z|MEDIUM ' 3M KKDARK% &32� 942TOP› hINTEGRÒa, %¦LACK SQUAR16219x ÓULLET OPERATO—f\u221a* K F ROOœ&24�9éãALMOST EQUAL Tt P 6ä9ÔÁLESS-THAN OR0 ÀL TO
    '\uð&2265'   #  0x99 -> GREATER-THAN OR EQUAL TO
    '\xa01 3 A3 ãNO-BREAK SPACE) Pu2321+ \ B) óBOTTOM HALF INTEGRAL/ )xbX C/ µDEGREE SIGN& 2S ~ D& åSUPERSCRIPT TW¨ (b7* E* ¤MIDDLE DOTO f% F% ˆDIVISIONw Au255Ÿ Ì  A0( õBOX DRAWINGS DOUBLE HORIZONTÖ  9 /A19 iVERTIC7 é p 27  W¡ ãNGLE AND RIGHT† Ü Gu045{ 3D ôCYRILLIC SMALL LETTER I4 3 46w 43 ¶UKRAINIAN Ið'55= 5= $FDOWN´ ­ 6z 6= ­ ×BYELORUSSIAN-‡ I ÔÃ 7I EYI (@ )? 7255? 8? Å 
4LEFM ì8Ä M	< _UP SI³
F2559B \B jõS À aB u©.UPƒF255b; �} l ;  ù q9qœÄwô  GHE WITH UPTURæ Jd‹ ¼	‹ Æ  ‹  e: Ñ	: iŠfH BñH ‹ �69B [ÍÑ 6UB
‰ œ0G 
oCAPITA0ÒB5 Ó&63DÂ  DÌ6040B 0×BK 6Œ 
6ƒ @ e6256eB#G  ð 
    '\u2569'  ò2 #  0xBB -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u256a'   @ C@ û VERTICAL SINGLEF _ M F0490M DM ô"CYRILLIC CAPITAL LETTER UKRAINIAN GHE WITH UPTURNL F256cL EL Ù   ß 0xa9D ß FF ÕCOPYRIGHT SIGo @044e+ !C0) » ESMAL¹ $YU¢ 6043î /C13 A2 1e 22 &BE3 &463 33 'TS4 &344 44 D3 53 53 I3 4f 63 &EFÍ &33f 73 (GHg š 84 Hg8g 93 I™ )þA2 hSHORT 8 >C~ñ	6K� b� q3 E¤6043CW	f 'EMÑ df >f 3+Oe fe D4PÎ3 4Y14gD5&ER™ 4hD5'ES3 2Ì 4TÌ ÎD42ÍD3Z 3™ 4V™ 0D3=SOF�D:8YERÖ 7;=Z¢ ¢D8SÖ4ÓD9	ÔÖD89SHCh Ï ;C¥4D<KHARDx2vED3zð10'   #  0xE1 ->ÿ% CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xE2 ->4 &BE5 &265 35 	'TS6 &146 46 	D5 55 55 	I5 2j 65 	&EFÕ &13j 75 	(GHk   86 	Hu8k 95 	IŸ 94 A4 	hSHORT : a: B: 	K£ b5 C5 	'EL¤ c5 D5 
M5 d5 E5 
N5 e5 F5 	O4 f4 /F04 	Pà5 15 	Y=&20j U
&ERŸ 2ŠFU
'ES5 2j T
TÔ êFT
Ui 1óFS
Z1Ÿ T
VŸ FFS
‡SOFT SIG2·FZ
8YERÞ 7G]
Z¨ ÆFX
Sü2ïFY}2üFX
9SHCl × [
Cµ20F\
BHARD€ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð! kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ-  .TXT' with7 ‰ P.py.
o ±#"

import  sÌ l ÁAPIs

class  ($ . 1):
¥Adef í ñe(self, input, errors='strict'):.  |creturnq D 	> ,Z 4ing#E  s <s Àerrors='strisct'):
  ð	return codecs.charmap_de ñ(input, errors,  ðing_table)

class IncrementalEn8  r( >cs. z Qdef e, s(self, j ³final=False*  § ¤ @ :  G .©  © ?[0]¬  Dä ¬  ‚  ¬ ú e¬ '@ ¬  ¬ àStreamWriter(C¡,¨ § Dpassæ  ORead:  	: 2###“ðings module API

Ãgetregentry(7 
–  UInfo([åname='kz1048', �!e=1 2().     im: .r=f/ J 	/ é/ ssr9=F# w–# £# @)


K[ Ping T, E5codç2 = (`'\x00'åñ  #  0x00 -> NULL1   1  1  õSTART OF HEADING, 2, 2, ETEXT) 3) 3) 0ENDS 	' 4' 4' µRANSMISSIONV 5/ 5/ UQUIRY# 6# 6# µACKNOWLEDGE' 7' w7 -> BE8  8  tACKSPACE t# Z9% öHORIZONTAL TABULATÀ n1 A1 •LINE FEED› b' °B% oVERTICT 9x0c/ C/ HFORMT r# ª D% æCARRIAGE RETURde-  E+ †SHIFT OUßf% F% II 1x1xô DATA LINK ESCAPJ)x1„1„öDEVICE CONTROL ON. 	†1†. 4TWOP1‹1‹. 6HRE^ 	”1”0 EFOUR_ 	”1”ŸNEGATIVE z 1¡1¡ö SYNCHRONOUS IDL‹ 	¦1¦Fe BLOCK‘ 	»1»UCANCEò(19¾1¸W eMEDIUMK a) °–SUBSTITUT¦ àb'      #  0x1ðB -> ESCAPE
    '\x1c'
 �  #  0x1C" åFILE SEPARATOR* d* D* _GROUP+  e+ E+ oRECORD,  f, F, LUNIT*  '  «  20* CSPACÌ !! 1! òEXCLAMATION MARKÎ ", 2, LQUOT* #* 3* ²NUMBER SIGNQ $' 4' XDOLLA' %' 5' wPERCENTO &( 6( ‘AMPERSANDt 2"'"º7% ƒPOSTROPH(K 8& ñLEFT PARENTHESISR ,'), 9, ORIGH-  *- A- sASTERISh+$ ‚GPLUSí ,% …RCOMMA— -! |³HYPHEN-MINU¿ .( y’FULL STOPM /% rTSOLIDH 0# 3k¢DIGIT ZEROI 1& p& #ON~2% i% #TWJ 3% d% 3HREL 4' d— 3FOU©5& cM 3FIVL 6& a& 2SIXâ 7% a% 3EVEü8' b' E<N 9' ]' $NI1:& VCCOLOn ;! SGSEMI% <% S—LESS-THAN}=* \XEQUAL¤>' [|GREATERT ?- cKQUES‡@) 4i ú’ERCIAL AT<A) lóLATIN CAPITAL LETTER 4B2 y2 Bd C2 †2 C2 D2 ‘2 ³,'E2 �2 ©F2 ©2 F– G2 ¶2 G2 H2 Á2 H2 I2 Ì2 I2 J2 Ø2 J2 K2 é2 nL2 ðC -> LATIN CAPITðAL LETTER L
    'M'  ö#  0x4D -> LATIN CAPIT2 M2 N2 E2 N2 O2 F2 O2 P2 /502 P2 Q2 12 Q2 R2 22 R2 S2 32 S2 T2 42 T2 U2 52 U2 V2 62 V2 W2 72 W2 X2 82 X2 Y2 92 Y2 Z2 A2 Z2 [2 B2 óEFT SQUARE BRACKE[%\\0 ë 5C/ ãREVERSE SOLIDU¸]*  + ORIGH[ ^0 óCIRCUMFLEX ACCENˆ _- rOW LINEÛ `$ 6YGRAVEL a( ÷ESMALïAX b0 õ	0 B0 c0 ó	0 C0 d0 ñ	0 D0 e0 ï	0 f0 í	0 F` g0 ë	0 G0 h0 é	0 H0 i0 ç	0 I0 j0 å	0 J0 k0 ãŸ	0 K0 l0 äÏ	0 ÿm0 é0  ýn0 é0  ûo0 ìÀ ùp0 7ø`  ÷q0  õr0  ós0  9t0  u0  ív0  ëðw'         #  0xð77 -> LATIN SMALL LETTER W
    'x'  #  0x780 X0 y0 90 Y0 z0 A0 Z0 {0 B0 òEFT CURLY BRACKET. |. C. ÒVERTICAL LINE) }) D) ORIGHX ~/ E/ CTILDP C\x7f$ 7F! TDELET" Qu0402$ "  80" àCYRILLIC CAPIT£ Ž(DJ7 37 17 	G7 G201a7 27 òSINGLE LOW-9 QUOTATION MARKX\u045n 37 ¥ 	1
l el 45 ODOUBl G20267 57 pHORIZON„ELLIPSIS› G2020/ 6/ gDAGGER" 1" ëˆ ) 'ac) ä–EURO SIGNN 3p Ù™PER MILLE* G0409O Ó5ÚL£37 Ú£áEFT-POINTING A·±0èñ| N| 80497 ÿ7 ö KA WITH DESCENDp804bE E DSHHAZ2040.
,8 7DZH5B9B	�@F2018�9@L@kW7201œ9?7 Y9?m ‡m d£ @m 7 2@DBULLW\u201Î93tEN DASHŒG2014| 4)EM# 7fffß9.•UNDEFINEDH 1� .QTRADE_/5\
/	Ç
-l9-+.5F 
.	{ 
,b#
,	5 *	C 
*	C 
(5(9(	6 &"xa¶!  ^ð A0 -> NO-BREAK ðSPACE
    '\u04b0' ð##  0xA1 -> CYRILLIC CAPITAL LETTER STRAIGHT U WITH (OKJ 1J 2J OSMALH 'd8H 3H ’ CCHWAË 1xa47 "  Ë 49 ÃURRENCY SIGN) Hu04eb 5) ô ƒBARRED O< 9xa6e 6< ¥BROKEN BAR& 7& 7& {SECTIONŠ 048( ~I„ 9^ 96 AOPYR�
ê !92, A* ê ?GHE× 1xabA VBC ñLEFT-POINTING DOUBLE ANGLE QUOTAè EMARKcE CE 8NOT9xad$ D$ ¤SOFT HYPHE½9xae' E' pREGISTE©
þ - þ F+ ^Ü´ ù  B0> iDEGREE· bÁ' A¨PLUS-MINUS+ Bu040>� B"Úó	BYELORUSSIAN-UKRAINIAN Iž Hu045L 
&	nJ eP– 7$
J (b5‹BHXMICROö "xb¨ !2zPILCROW( 	4B4§MIDDLE DOTø q® 
2	® 0Bu211„ 4 0JNUME© Qu0493Ñ ' 
-	[ +b+B+”,Hu04d�,¶	‡ SþGu04aëB?7 ]"ENê„DESCENDE¸ E ]E 	| C 	fF
u	C sGu041�Cs Ä ÷ 5 C�5 B®1/CŒ
V6  Cv¡ (GH7 œZCc7 D6 a6 _Ù I6 íCoàCYRILLIC CAPITðAL LETTER ZHE
    '\u0417' ÷
#  0xC7 -> CYRILLIC CAPIT7 6 86 86 	Ik 95 95 	hSHORT ; a; A; 	'KAq b6 B6 	'EL6 c6 C6 
M6 d6 D6 
N6 e6 E6 	O5 f5 F5 	P³&206 /D06 	&ERl '216 16 
S6 26 26 	T¢ 36 36 	Uk 45 45 	'EF6 56 56 	HP'266 66 	(TSØ cDc
Cš2dDd
S¥ fDfC9 dDd
‡HARD SIGÉ2kDk
8YER¿mDm
LSOFTu tDtûsDs
Y¨ tDt
Y13tEtESMAL’3 qEq	3 Ba3oEo	4 V4 mEm	4 G“3mEm	5 Di kEk	4 I4 iEi	4 	Ê3gEg
5 i dEd	4 ‹3`E`	3 Ä3`E`	9 Â3WEW	4 À3SÀxEC -> CYRILðLIC SMALL LETTER EM
    '\u043d' þ#  0xED -> CYRIL4 N4 e4 E4 O3 f3 F3 &PE4 &404 /F04 'ER4 14 14 S4 24 24 Tœ 34 34 Ug 43 43 'EF4 54 54 'HA4 64 64 (TSÐ 75 75 (CH5 85 85 SŸ 95 95 	C7 a7 A7 ‡HARD SIG¯'4b; B; 8YER¯c6 C6 LSOFTq TFT	µSFSY¢ TFTóYA
)

### Encoding table
e _ ò = codecs.charmap_build(de5 & ð	)
""" Python 'latin-1' C: ò


Written by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
† s
import¶ â ˆ Â APIs

classš (Ú  1):
y²# Note: Binòhese as C functions will result in the X 3notF qconvertXðhem to methods. This  �ntended.4 yeqG2_1_ # v#   Ý ±IncrementalÜ$erê  #):Y "f h ó
(self, input, final=False*  creturnc.¨ (:  F ¿.errors)[0]›  DB›  q Bdef à › '@ › 
`Stream«1er(,  • 5pasL ORead9  9 C)2er(I ‚ , < ¦¢"ß #  # ; Àe

### encodð(ings module API

def getregentry():
    return codecs.C QInfo(  ! õname='iso8859-1',  en6 =4 .  'de   ²incremental8 6r=I EX r/ J 	/ Dj / ástreamreader=S R R # Ewrit# W # ñ)
""" Python Character Mapping ò ð  generated from 'VENDORS/APPLE/ARABIC.TXT' with/  `c.py.
` £#"

import~S

###] ²APIs

class (= ¢1):
† ÔAó(self,input,errors='strict'é Ì
íƒcharmap_B = , †ing_map)m m )B 	m   m dtable)ø  å  h Ã final=False*  W.Q
?[0]¨  Œ¨   ~  ¨ ö eL¨ !@ â ¨  Oª ê(Æ,W ¤ 5pasƒ F9  	9  ÌFŠ9¯mac-arabic‹/()�
1().!eë ��C €0MapÐ0codæSmap =Cñ.make_identity_dict(range(256))
ú 5 ‘.update({K€0x0080:  0c4,ö #  LATIN CAPITAL LETTER A WITH DIAERESISA 1A %a0A öNO-BREAK SPACE, right-left6 26 %c76 w Cw vCEDILLA? 3? 9? E? VACUTE= 4= /d1= N= GTILD= 5= 6= O= 0 6A cA UA 7A e¿ À  #  LATIN SñMALL LETTER A WITH ACUTE
    0x0088: 0e0, ¿ #  LATIN S;  GGRAV; 9; 2; ¦CIRCUMFLEX{ a@ 4@ –DIAERESIS? b? 56ba? dARABICð ¶NOON GHUNNA5 c5 50ab5 ö&LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-leftQ dQ &e7Q @C{gCEDILLŽ e= 9= 	E= ¸f; 8; 
¸#90; 9ó v ¸ #91@ Dó @ ¸#92? dº 	Iõ  93; E2026; ÿHORIZONTAL ELLIPSIS¨ 94; E00ee; õ  v õ 5@ f@ õ  6? /f1? 	Nõ FTILDg#97; 3; 	O; 
%9ÝbªORIGHï(9ôf´
� GôfÂ‡ @ G ô&0fnPDIVIS£OSIGNûôfð
UAÞf¡
; fÜf|ê  ; *á/fc÷	@ *aå2Ø_SPACE"aÒ2žoEXCLAMýaË23aÆ6002ÑNUMBER Ãa¾2w_DOLLA3 	±&66öqPERCENTn Èa¡[ŸAMPERSAND4—2‹ŸAPOSTROPHfŽ2³°EFT PARENTHÝj t2…Æ9 À
    0x00aa:� 0x002a,  ð	#  ASTERISK, right-left
  ( 2ab:0 b0 ŸPLUS SIGN1 c1 560c1 ÆARABIC COMMAY d( 502d( ÏHYPHEN-MINUS\ e4 e4 ŸFULL STOP1 f1 f1 _SOLID` !b0/ 5660/ ¼ ø-INDIC DIGIT ZEROn õ (need override)ã #b1O 1O 	?ONEN 2N 2N 	/TWœ 3N 3N 
?HREž 4P 4P 	OFOURí 5O 5O 
/IVž 6O 6O 	?SIX� 7N 7N 
9EVE#(8P 8P 	_EIGHT  9P 9P 	/NIyaO &033ICOLOÜ ô0&610CQ SEMI8 , +&03+ŸLESS-THANab939_EQUAL”b838GREATERl @&61@Î ÕQUESTION MARKÒ cA6274+·ÿ TEARDROP-SPOKED PROPELLER~cB2BÆ LETTER HAMZTc#2#/ öALEF WITH MADDA ABOVE¾ 2? x ? 2? 2WAW} > ò2ò> ¼ ? VBELOW¼ â2â? ?YEH} Ò2Ò>  } l °2°. 6BEH- �2�-  TEŽGRBUTÉs6¦EøTb s2s- àHEH
    0x00cc : 0x062c,  ð#  ARABIC LETTER JEEM
 c0x00cd. d. 6HAH- e- e- K. f. f. 5DAL[ "d0- /30- (TH. 1. 1. &RE¶ #d2- 2- FZAIN‰ 3. 3. 7SEE. 4. 4. H/ 5/ 5/ &ADŠ 6- 6- D- 7- 7- TÈ#d8- 8- Z- 9- 9- 	>a- a- )GH/ b/ 505b/ öLEFT SQUARE BRACKET, right-leftc; çÿ REVERSE SOLIDUS7 ð&05ðORIGHs ÿ&05ÿÿCIRCUMFLEX ACCEN¬ 
&05
�LOW LINE¥ e4fTATWEE7e	4	F	e	4	5QAF`e4K- 4&LAse4M¡e46NOO�e4H46WAW4¶LEF MAKSURA6 4Y� &64ºwFATHATAè þ&64þ+ JDAMM+ ò&64ò+ JKASR+ á&64á+ � Ö Ð&64Ð( ~ ( fÈ5È{ ( Æ5ÆVSHADDOfÂ5ÂFSUKUf½7É Pwf½7Ú(TT. ¾8�(TCdf¿dí&AE½aFVˆ ½a„À #  ARABIC LðETTER GAF
    0x00f9: @688, Â #  ARABIC L- FDDAL. a. /91. FRREH. b. 507b. öLEFT CURLY BRACKET, right-left: c: c: ßVERTICAL LINE5 d5 d5 ORIGHp e; /69J× f- %d2h 
3óYEH BARREE
})

### Decoding Table

d  _t A = (ü d'\x00'‰  õ00 -> CONTROL CHARACTER. 1. 1. 2. 2. 3. 3. 4. 4. 5. 5. 6. 6. 7. 7. 8. 8. 	t,  'ž9. 	n. a. 	2x0b0 #š/0b. c. c. 	r, ¸ d. 	2x0e0 Š e. f. f. 
1à1à1à1à1à1à1à1à1à1à1à1à1à1à1à1à1à1à
9x19Ì1à
:x1a. à1à1à1à1à
:x1dŠ à1à1à1à1à	 ‡  j2àpSPACE, ä-ïÀ!. àþEXCLAMATION MARK9 "9 ëMQUOT7 Àright
    '##'  ð#  0x0023 -> NUMBER SIGN, left-right
, -'$4 44 _DOLLA4 %4 54 PERCENTi &5 65 �AMPERSAND› 0"'"¢   Ï 72 �POSTROPHE3 -'(e 83 þLEFT PARENTHESIS9 )9 99 ORIGH: *: a: ŽASTERISKk +1 b1 OPLUS;,2 c2 XCOMMA` ð; in Arabic-script context, displayed asð 66C ARABIC THOU‚²S SEPARATOR-x dx ¿HYPHEN-MINUJ .5 e5 ŸFULL STOP± 'B± |DECIMAL¯ /z fz _SOLIDª 00  300 ÏDIGIT ZERO; Q0  v-INDIC H N1o 1o _ONE; o 1o 2ONEn 2n 2n  TWÜ Ý 2n 2TWOn 3n z_THREEœ3n  H p 4p ¶»OFOUR»4p  H o 5o ñß 0FIV¼{5o #IV¼6o +o ?SIX*6o 2SIXÝ 7n gn OEVEN¼7n  H p 8p ¤p Eqp 8p H p 9p Ûp !NIy½9p  H o :o OCOLO ;. OSEMI2 <2 À03c -> LESS-ðTHAN SIGN, left-right
    '='   ÿ#  0x003d -> EQUALS4 >4 e4 �GREATER-n ?: f: ÞQUESTION MARK¤ @6  406 ÒCOMMERCIAL ATÎ A* 1* òLATIN CAPITAL LETTER A3 B3 23 B3 C3 33 C3 D3 43 D3 E3 53 E3 F3 63 F3 G3 73 G3 H3 83 H3 I3 93 I3 J3 a3 J3 K3 b3 K3 L3 c3 L3 M3 2dM3 N3 13 N3 O3 *3 O3 P3 5'3 P3 Q3 0Q3 R3 0R3 S3 0S3 T3 0üU3 0Uf V3 0V3 W3 0W3 X3 0X3 Y3 0Y3 Z3 0Z3 [3 0þEFT SQUARE BRACKET”$\\= 859þ REVERSE SOLIDUS8 ]7  8 >ORIGHu ^= HÿCIRCUMFLEX ACCEN¯  _: O~OW LINE¨ `1 6MSGRAVEf Ea) CLSMALqb1 A	1 oc1 ?	1 mðd'        #  0x00ð64 -> LATIN SMALL LETTER D
    'e'   Ÿ#  0x00651 E1 f1 61 F1 g1 71 G1 h1 81 H1 i1 91 I1 j1 a1 J1 k1 b1 K1 l1 c1 L1 m1 d1 M1 n1 e1 N1 o1 f1 O1 p1 /701 P1 q1 11 Q1 r1 21 R1 s1 31 S1 t1 T1 u1 U1 v1 V1 w1 W1 x1 X1 y1 Y1 z1 Z1 {1 òEFT CURLY BRACKET, left-right; |; ÞVERTICAL LINE6 }6 ORIGHr ~< *CTILDÔ3\x7×7óCONTROL CHARACTE…B\xc4S . 8PCAPITÇ fó A WITH DIAERESI–J\xa0B )ñNO-BREAK SPACE, 6-A;J\xc77 /y Cy uCEDILLA@ 9@ >@ E@ EACUT%*d1> K> N> 	c*d6> X> O> 5*dcB iB UB eÂ z·	þ e³…< EGRAV:*e2º �< “CIRCUMFLEÑ;\xer A ÀH DIAERESIS
ò'    '\u06ba'   #  0x008b -> ARABIC LETTER NOON GHUNNA
6 0xab4 6 c6 ô&LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-leftR *e7R dR ¤ATIN SMALL� ÕC WITH CEDILL� *e9> e> E> UACUTEz 8< f< FGRAV< </90< ¥CIRCUMFLEX} 
I/91A •DIAERESIS@ d½ /92@ Iù Pu2026> û 93< ÿHORIZONTAL ELLIPSIS¯e: ù 4< L¯x ù  fA 5A ù *f1@ 6@ Nù ETILD¶*f3< 7< O< 	.b±8< ORIGHû'*f4� 9S L � LfÇ�aA L
|9PDIVIS²OSIGNfüUF f°9î< 	tf‚ì< / cpñA / = 3aõ^SPACE'!. âoEXCLAM	"9 ÛI#7 ÖNUMBER Ë$4 Î_DOLLA4  96>aÁ9qPERCENTp ª&d ±�AMPERSAND:0"'"l  b §ŸAPOSTROPHm (e ž ˜€ PARENTH<l -')9 „×: *: }ASTERISê +1 nAPLUS/�  k0³	jkRCOMMAd-[ WðHYPHEN-MINUS, right-lef�t
    '.'   ó#  0x00ae -> FULL STOP, right-lef2 /2 f2 ~SOLIDUS0 `\u06605 b  b00 øARABIC-INDIC DIGIT ZERO@ ò (need override)² P 1P 1P ?ONEO 2O 2O /TWž 3O 3O ?HRE  4Q 4Q OFOURð 5P 5P /IV  6P 6P ?SIXŸ 7O 7O OEVENQ 8Q 8Q _EIGHTQ 9Q 9Q /NI�:K  �  aP ICOLOß þ 1b3 . b. NQ SEMI9 - <( 	[ c- ßLESS-THAN SIGd  =7 d7 oEQUALS4 >4 HGREATERn 	 Ð 1f? Ò PÒ ÒQUESTION MARKÖ g\u274a1 cQ¿ø TEARDROP-SPOKED PROPELLER ASTERISKâQ 8062RcR× LETTER HAMZA0 3c30 ÷ALEF WITH MADDA ABOVE@ $c$@ z @ c@ 2WAW ? c? ¿ @ WBELOW¿ òcò@ ?YEH 	âcâ?   n ÀcÀ/ 7BEH. �c�.  TE•HRBUTÑ	RƒƒTd ƒcƒ. H/ c¯…
] GJEEMÂ d/ }
/ (HAð e. w
. K/ À'\u062f'   #ò  0x00cf -> ARABIC LETTER DAL
    '\u0630'   #. .d0. )TH/ 1/ 1/ 7REH] 2. 2. GZAIN/ 3/ 3/ 8SEE/ 4/ 4/  H0 50 50  'AD� 6. 6. D. 7. 7. (TA8. 8. Z. 9. 9. 
Ea. a. %GH0 [+  b0 óLEFT SQUARE BRACKET, right-left$\= =c< þ REVERSE SOLIDUS8 ]7 t d8 ?IGHu ^= e= ÿCIRCUMFLEX ACCEN¯  _: ŽLOW LINE¨  4egTATWEEH4e F4e 3QAFgHu064e K. e 7LAM\ e 8MEE/ e 7NOO£4e He 7WAWº e·LEF MAKSURA7  e  Y“ b8âeMxFATHATAí c, , KDAMM, d, , KKASR, e, ñ, „ Û f) à) � ) 5ØfØ~ ) ÖfÖWSHADDW5ÒfÒGSUKU&7Î fÍ P€7åfÍ (TT/ 8ŸfÎ )TCrdþfÏ &AEaYfÍ V‹ a�fÍ Gµ8ûfÍ D¶9˜ÅÀIC LETTER RR EH
    '{'   ò#  0x00fb -> LEFT CURLY BRACKET, right-left; |; c; ÞVERTICAL LINE6 }6 d6 ORIGHr `\u0698A ­ e< ô ARABIC LETTER JÛ  . (d2. f. óYEH BARREE
)

### Encoding Map

e �_map = {û  (100:0000,>ö #  CONTROL CHARACTER- 1- 1- 2- 2- 3- 3- 4- 4- 5- 5- 6- 6- 7- 7- 8- 8- 9- 9- a- a- b- b- c- c- d- d- e- e- f- f- 1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð2Ð2ÐpSPACE, Â-Í - a- ( õ ú2ý2ýÿEXCLAMATION MARKe 8 a8 	p @2@OQUOTn 6 a6 ÀQUOTATION MAóRK, right-left
    0x0023: , ð #  NUMBER SIGN, - -8 3 /a33 . f 4f 43 _DOLLAf 	3 a3 f 5f 5f PERCENTÍ 64 64 ŸAMPERSANDþ 1 a1 – 7b 7b ŸPOSTROPHEc 2 a2 d 8d 8d ÿLEFT PARENTHESISj 8 a8 	p 9p 9p ORIGHq 9 a9 
r ar ar �ASTERISKÚ 0 a0 ` b` b` OPLUS91 a1 b cb cb XCOMMA¿ ð; in Arabic-script context, displayed as³ð 66C ARABIC THOU±¶S SEPARATOR®dw dw ¿HYPHEN-MINU4 a4 ß eh eh ŸFULL STOPã 'Bã DECIMALá y ay ª fª fª _SOLID/ a/  ^  "30^ %30^ ÏDIGIT ZERO; á0þ v-INDIC H Þ#31n 1n _ONE; n 1n 6ONEm 2m 2m  TWÚ Û 2m 6TWOm ™3f _THREE)3m  H o o3o·OFOUR·4o  H n ª3ªÝ 0FIV¸5n ðIVE
    0x0036: 0px0036,  õ<#  DIGIT SIX;   in Arabic-script context, displayed as 0x0666 ARABIC-INDIC H 
Y 0e  7:* <037m _EVEN;m 7m  H o 8o 8o _EIGHTo 8o H o 9o 9o _NINE;K9o  H n an an ýCOLON, left-right- b- ( -3 - bZ bZ OSEMI^ c1 c1 ßLESS-THAN SIG” 6 b6 � dl dl oEQUALSi 3 b3 f ef ef GREATERÕ 9 b9 
r fr fr ßQUESTION MARK×"405 %405 ÕCOMMERCIAL ATÓ#41) 1) öLATIN CAPITAL LETTER A2 22 22 B2 32 32 C2 42 42 D2 52 52 E2 62 àú F2 ¥4¥2 G2 h4h2 H2 +4+2 I2 ï4Â2 J2 Ç4Ç2 K2 ’4’&L2 [4[d M2 !4!2 N2 42 O2 552 P2  5 Q2  5 R2  5 S2  5 è5 5 ð U
    0x0056: 0px0056,  ð#  LATIN CAPITAL LETTER V
 0* 27:  2 W2 82 82 X2 92 92 Y2 a2 a2 Z2 b2 b2 ýEFT SQUARE BRACKET, left-right; d; 6 -A ; cv cv ÿ REVERSE SOLIDUSr 7 d7 n dn dn ?IGHå < d< x ex ex ÿCIRCUMFLEX ACCENZ9 d9 
r fr fr �LOW LINEQ0 d0 `  "60` %60` SGRAVEÍ à#61( 1( PESMALNA0 20 20 	B0 30 30 	C0 40 40 	D0 50 50 	E0 60 @	ð F0 >/67` 	G0 <6<	` H0 :6:	0 I0 868	0 J0 66û0	0 K0 ¹6¹ L0 v6v0  M0 1610  N0 ø6øÀ O0 7ø7ø`  P0  7 
Q0  7 
R0  7 
S0  7 
T0  7 
U0  7 
>7 7 
<7 7 
:7 7 
ð Y
    0x007a: 0px007a,  ð	#  LATIN SMALL LETTER Z
 0( 2b:  0 ýEFT CURLY BRACKET, left-right: /fb: 
5 -@ : ct c: ßVERTICAL LINEo 5 f5 j dj dj ORIGHß ; f; v ev ev VTILDEf! f! õCONTROL CHARACTER- "a0- %81- ÿNO-BREAK SPACE, „  aØ8/ÿLEFT-POINTING DOUBLE ANGLE QUOTATION MARKQ bQ %98‡ KR '#c4Ù 0R «PCAPIT­õA WITH DIAERESIS#c7A 2A CA vCEDILLA? 9? 3? E? FACUTÃ#d1= 4= N= 
 #d6= 5= O= ú d/86A UA eUÎ|	'zFGRAVú eú 7| ; 
5#e2ø 9; ¥CIRCUMFLEX²e2Ý
¶ 6e0Óõ  .#e8¼ ´=  ,2i; 2av 9$	mv 2¶={ 2 9b	 Ifº 9!; º $9$@ º f¦9"	? ž#f3tá
œ
õ f¡9á
; õ  f9á
@ 
õ À0x00f7: 0x00@9b,  ð#  DIVISION SIGN, right-left
! €0x00f9:  %9d5 öLATIN SMALL LETTER U WITH GRAVE; a; c; GACUT; b; e; ¦CIRCUMFLEX{ c@ f@ ”DIAERESIS? #60? aº ÅARABIC COMMA( 1§ bR( –SEMICOLON, f“ b“ , PQUEST…EMARK0 "210 %c1Ã 0 tFHAMZ‹ #22/ 2/ BALEF¦–MADDA ABO¬3623? 3? x ? 4? 4? 2WAW} > 5> 5> ¼ ? VBELOW*6? 6? ?YEH} 7> 7>  } l 8. 8. 6BEH- </c9- §TEH MARBUTÉ6/ca5 b �c�%(TH� ×c×. FJEEM\ dë ú�ë e- ±
- 7KHA. c‰ 5DALˆ "30[ /d0H. 7d7R35d56ZAIÂ3$d$7SEE. d)SH/ d6SADòdòD- ádáTš3àdàZ- àdà	>ØdØ(GH/ 4öeöfTATWEE 4òeòFò4òeò5QAFg4ñeñK- ðeð&LA\4îeîMŠ4ïeï'NOi4ðeðÀABIC LETTER ð HEH
    0x0648: @0e8, ö #  ARABIC LETTER WAW- 9- 9- ÆALEF MAKSURA6 a6 a6 Y� b- b- †FATHATANX c+ c+ JDAMM+ d+ d+ JKASR+ e+ e+ � ~ f( f( ~ ( "50( ,f0( { ( 1( 1( VSHADDO#52) 2) 6UKU6y by õ-INDIC DIGIT ZERO, right-left (need override)  6  b  	O ?ONEN Å bÅ 	N /TWœ 3+b3
N ?HREž 4P 4P 	OFOURí 5O 5O 
/IVž 6O 6O 	?SIX� 7N 7N 
OEVENP QbQ	Œ_EIGHTP tbt	P /NIy�aŒÆ PERCENT SIGE7~ f
'TT½7<fˆ. P- 8ÇfŠ z(TC©8Xf\ EDDAL®9®ft'RR‹ 9\ ô‹ J- af1‰ V- &f- 5GAFµ bœ8ü‡ ¦NOON GHUNNdJfˆ5 ¥YEH BARREEi d‘fB– A, 3202§9ÔøHORIZONTAL ELLIPSISËg 3274Ð c‚øù TEARDROP-SPOKED PROPELLER ASTERISKP ðA}
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDOñ)RS/APPLE/CROATIAN.TXT' with gencodec.py.

"""#"

import  €s

### C% Â APIs

class ($ . Â):

    def W ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o  de‰ o )B 	o  o ú ÁIncrementalE>r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø eNª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âõname='mac-croatian', k !e=7 2().     im: 'r=Ö€/ J 	/ ë/ swr>=K# wš# §# ")
![ Ping T› K5codë2 = .`'\x00'åñ #  0x00 -> CONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  Œ9, 	n, A, 	2x0b. äB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
1À1À1À1À1À1À1À1À ÀTER
    '\x104'  ð#  0x14 -> CONTROL CHARACTER
! X'\x15, 5, 6, 6, 7, 7, 8, 8, 9, 9, a, A, b, B, c, C, d, D, e, E, f, F,  ) 1    20, RSPACE!  1  òEXCLAMATION MARK+ "+ 2+ LQUOT) #) 3) ²NUMBER SIGNO $& ªXDOLLA& %& ¤wPERCENTM &' Ÿ‘AMPERSANDq 0"'"ö  —“APOSTROPH(I �ñLEFT PARENTHESISP +')+ �ORIGH,  *, �sASTERIS_+# †GPLUSç ,$ ~2MMA“ -  r³HYPHEN-MINUº .' m’FULL STOPK /$ eTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ ûî3T“ 3FOU÷ô% SK 3FIVJ í% Q% 2SIXÜ å$ Q$ 3EVEèß& R& E-L Ù& M& $NI):FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4YÒCOMMERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™ÐLATIN CAPITALð LETTER F
    'G'   ô	#  0x47 -> LATIN CAPITAL1 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ 5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMALÏAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó§	/ ál/ ÔÖ	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÀTER Q
    'r#'  ð#  0x72 -> LATIN SMALL LETTER R
' +'s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# JF  óCONTROL CHARACTEGG\xc4,  80, vPCAPIT§ xó A WITH DIAERESIXH\xc5@ 1@ •RING ABOV­ (c7A ÷� C� rCEDILLA9H\xc9> > E> EACUTz (d1< < N< 	c(d6<  < O< 7(dc@ 1@ U@ e¼ Bµ	ö (e0z M: 6GRAª(e2: X: “CIRCUMFLE—9\xejh? 1(e3} w> 	«e¢„â	X:  e ›?  žež©<  œ(e8ï Ã: 
¦a: 9Ñ	ï t ¦ b? Ð? ¦d> Í	> IÕ
—9É: 
ñ et Ç: ñ  -9Ê? ñ fˆ9È	> Bðf3'     #  0x97 ð-> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'
 Ÿ #  0x98 : 
FGRAV: 4: 9: ¥CIRCUMFLEXy 6? A? •DIAERESIS> 5> B> FTILD· a: C: U+9: D: 
+b: E: + c? F? +Pu2020@ â A0> dDAGGERLb  !A1! ¤EGREE SIGN& a) A2& JCENT$ 3i J 3$ ZPOUND% 7% 4% xSECTION'  · r · 5' dBULLET‘ bA A6! xPILCROWH 8xdfo 7'  eSHARP _(ae5 ™REGISTEREÎ Au016?§ eCAPITA|SQDCAROSGu212ã ©TRADE MARKÅ blAïÆ0 AC…(a8· Ü2± ÆÃNOT EQUAL TOK Pu017dM Ø ³Ø ZØ )xd‡ °< �TSTROK Au221}y B¯ƒINFINITYœ 0xb1š gB±¨PLUS-MINUS8Au226:M µÍLESS-THAN ORö 1226Y0 ÁGREATER3 0‰3 Ï†INCREMEN«U ± Ì[MICRO¬ 0BÐð ARTIAL DIFFEREN  (x Ø°N-ARY SUMMAO* 0* Í* dPRODUC¦  ËR Ë	EÉ!22âb ÉƒINTEGRAL… (xawBÂö
FEMININE ORDINAL INDICATOš	5 ÐoMASCUL6 	Au03aªŽ â Î,K CMEGA   ðwð	ý îfîBî	: ì!xb˜Cì°VERTED QUESÆ¦ !xa¡1 ú#IN1 ÀEXCLAMATION ð MARK
    '\xac'
 ó #  0xC2 -> NOT SIGN# Pu221a% # 3# ´SQUARE ROOT& F0192& 4& ôLATIN SMALL LETTER F WITH HOO‚ Vu22489 59 ö ALMOST EQUAL TOc &06* 6* c eCAPITAe Ce SACUTE< 0xab:  è 7< ÷EFT-POINTING DOUBLE ANGLE QUOTATION ,Au010.	8D ã € FCAROE'02¼ 9< pHORIZON¹ …ELLIPSIS® 0® A. ÕNO-BREAK SPAC× c) B) AFGRAV< 3e C< ETILD< (d5< D< Ox < Gu015*E<  ”IGATURE Op  4 ® {F4 ^2 12 &D02 ­D¢ USTROKo @2014á = 1= sEM DASH¢Fu201D8DLEFTGAF201dW JORIGH6 !DZ k /SI¬F2019k Vk 6 	0xf74 &DbPDIVIS
	&5cDNUOZENGB@f8ffL B,£Apple logoE!xa£ o DCOPY© ƒ'04�AFRAC¢)SL—Ñw JEUROÐ!03x $ ø Â	7203 D ½ E !xcÿ 	5AV(xbÆDp Ç6201LE(ENÝ(xbEÿ†MIDDLE Dñ'20E_LOW-9DE201eE³ 6 3ÍE˜PER MILLEÜ!xcZSE÷	£CIRCUMFLEX“ äý EA SÇb c1Ø { ‹ž v E.v X!xcv C: çÀE WITH GRAVE°
    '\xcd'
 õ #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE< e< B< ¥CIRCUMFLEXA fA CA •DIAERESIS@ c@ D@ EGRAV½ (d3< E< Où  (d4< F< ù Pu0111C v&F0A ESMALtD{ VSTROK¸ 29  ±&F1; ±¸ 
ô a< 2< Uy 	í(db< 3< ô 8xd9A 4A ¹ Gu01305< 
0ƒOTLESS I Pu02c6u g67 „MODIFIERØ¨ v ACCENT< d^< 7< m ETILDŽaÂ F8& eMACRONG 63c0ƒ 9! bGREEK M ^P³ )xcg�E£Au02då· ”†RING ABOü b8“ DxsCEDILLA· !xcE " Z‡ FA eyA _	ø AI «7• ¸ S CAHó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð8 mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with: ’ P.py.
x ±#"

import  sÕ u ÁAPIs

class  ($ . 1):
TAdef ö ñe(self,input,errors='strict'):,  Òcreturno B = , 4ing(C  o Ao *B 	o  o ú ±Incrementalì$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Dcª  €  ª ø ª (@ ä ª  Qª ðStreamWriter(Codec,codecs.SñtreamWriter):
    pass

class S àReader(Codec,c (s. 	9 ó### encodings module API

def getregentry(7 sreturn X e QInfo(�  ‘ õname='mac-cyrillic', k !e=7 2().   deX    ²incremental: 6r=I EÇ /er/ J 	/ Dl / s>r>=1R # w€# �# @)


Q[ �ing TableKa _t 2 = .`'\x00'4ñ #  0x00 -> CONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  Œ9, 	n, A, 	2x0b. äB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À
7x19¸1À
8x1a, À1À1À1À1À
8x1d„ À1À1À1À1À	 �  D2ÀRSPACEt!  ´òEXCLAMATION MARK+ "+ ³LQUOT) #) °²NUMBER SIGNO $& À 0x24 -> DOLðLAR SIGN
    '%'   ÷#  0x25 -> PERCENT' &' 6' ‘AMPERSANDK 0"'"G   K 7$ ‘POSTROPHE% +'(I 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# GPLUSç ,$ C$ RCOMMAD -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOUR“ 5% S¸ 3FIVJ 6% Q% 2SIXI 7$ Q$ 3EVEÂ8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÀER T
    'U'  ð#  0x55 -> LATIN CAPITAL LETTER U
) 0'V'   1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ #C. ò REVERSE SOLIDUS* ])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' #ESMAL!AV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ ß	¼ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Óù	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICB}( çRÀV  ~. æCTILD~3\x7�7×óCONTROL CHARACTEG`\u0410Q , 8ÔŒCYRILLIC»š4 ð1'   #  0x81 -> Cÿ&YRILLIC CAPITAL LETTER BE
    '\u0412'   #  0x82 -> C5 V5 35 35 	(GH6 46 46 	D5 55 55 	I5 65 65 	Z  76 76 
k 85 85 	It94 94 	hSHORT : a: A: 	'KAo b5 B5 	'EL5 c5 C5 
M5 d5 D5 
N5 e5 E5 	O4 f4 F4 	P«%205 /905 	&ERj &215 15 
S5 U9U
TŸ U9U
Ui S9S
'EF5 S9S
HE2S9S
(TSÔ S9S
C‰2T9T
S¢ V9VC8 T9T
‡HARD SIG¼2[9[
8YER·]9]
LSOFTs d9dòc9c
Y¥ d9d
Y''20dAdEDAGGP!xbƒpAPkDEGREEå 9( –AA
äGHE WITH UPTURš!xaLh NIPOUN¿!xa�% ?ySECTIONŽ 6202ÏA1cBULLET`!xbH yPILCROWH 1040) Ö 
õBYELORUSSIAN-UKRAINIAN	!xaÐr #ðREGISTERED SIGN
    '`\xa9'  ð#  0xA9 -> COPYRIGHT SIGN
 p'\u2122+ ) A) ©TRADE MARK* 7040* B* ôCYRILLIC CAPITAL LETTER DJE` 70456 C6 OSMAL4 F2260” D4 ÆNOT EQUAL TO[ &03' E' ‘ G‘ 6 F6 	‘ 4 E221ej  B04 ƒINFINITY� 0xb1! !  H B1# ©PLUS-MINUSH@2264, * 2* ÍLESS-THAN ORç F22650 30 GREATER3 F04563 43 	ä õ	BYELORUSSIAN-UKRAINIAN IÖ z Ö 5I YMICROÑ 1049ý Ñ 6% n åGHE WITH UPTURƒF0408® 7@ YÇ0F85 	Ø —?  Í	"= &07± 4ñ ± YKGu0455 
?	r 3 0ÇY
<h L56 >ž 	i 	4 &0aÒ K
Nj 6 K
4 íCKž g 0‡C[3 $DZâ0xacÑ »Cg E	ü&21À CZ³SQUARE ROOTFu019ÂCMiLATIN MFÚDHOOK9 7224ë =^ALMOSÊ6220°CB„INCREMEN‡ 8xabÐ &ñLEFT-POINTING DOUBLE ANGLE QUOTATIONÈ’ )xbD 5E Gu202­ ;pHORIZON„ELLIPSISs aÊ‡,ÔNO-BREAK SPAC°Au040ž æ
 æ7TSH7 57 
$	¡
5 0l 
#l Kˆ56 
%	k 
4 ¼#ºFu201¢D#sEN DASHU " ¾DÐEM DASH
    'ñ&\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '5 d5 35 ORIGH6 86 46 k OSINGk 	95 55 k 6 	0xf74 Ö 66 PDIVISÉ GSIGNÉ e* þ 7( ù _LOW-9ÿ 70406 86 ôCYRILLIC CAPITAL LETTER SHORT Up 7045: 9: OSMAL8 &0f¨ A8 r GDZHEo 7 B7 	o 5 F2116l C5 xNUMERO :F0401& D& 'IO� 5 E5 	� 3 4Ã F3 &YAf %30› /E03 2 ˜ /E12 B[&32e 8 	Ë V3 33 63 GÂ&344 44 Dg 53 23 I3 óE/3 	\3e;E;4 g E8	4IËþE08 a
0	j Kb3 ,'ELž <E*'EM3 :E7	™ E¤60434E5g34E4P›44F4&ERË 45F5'ES3 5F5T™ 5F5d43F3'EF˜ 3F3H/43F3(TSÌ 3F3C44F4Sœ 6F6ÀALL LETTER Sö0HCHA
    '\u044a'   #  0xFA -> CYRILLIC SMALL LETTER HARD SIGN
: b: B: GYERUo c5 C5 LSOFTo d: D: El e2 E2 YŸ 720aŸ F3 BEURO‰ ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð2 mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with7 Œ P.py.
r ±#"

import  sÏ o ÁAPIs

class  ($ . 1):
UAdef ð ñe(self,input,errors='strict'):,  &creturno B = , 4ing"C  o ;o *B 	o  o ú ±Incrementalæ$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� D]ª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  Ÿ�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±¡name='mac-�%', h !e=4 2().     ij: 'r=Ó}/ J 	/ è/ str;=H# w—# ¤# ")
[  –Tí
~ è2 = +P'\x00lI 00;ñCONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t* Œð9 -> CONTROL CHARàACTER
    '\n' ø   #  0x0A -> CONTROL CHAR, 2x0b. , B, c, C, 	r* „ D, 	2x0e. „ E, f, F, 
'10, /10, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, a, À1À1À1À1À
8x1d„ À1À1À1À1À	 � È2ÀòSPACE, left-rightô!, ÀþEXCLAMATION MARK7 "7 ËOQUOT5 	#5 Ô¾NUMBER SIGNg $2 Ú_DOLLA2 %2 àPERCENTe &3 ç�AMPERSAND• 3"'"&'2ëŸAPOSTROPHd (a ðýLEFT PARENTHESISh +')7 ûORIGH8 *8 ASTERISË +/ 
OPLUS/,0 8MMAÃ ð; in Arabic-script context, displayed ashð 66C ARABIC THOUv£S SEPARATOœ-v X¿HYPHEN-MINU@ .3 _ŸFULL STOP­ 'B­ |DECIMAL« /x «_SOLID¦ j­3­ÏDIGIT ZERO; I³F0 EXTENDED¥ v-INDIC Q ð
    '1'        öL#  0x31 -> DIGIT ONE;   in Arabic-script context, displayed as 0x06F1 EXTENDED ARABIC-INDICQ €
    '2'   u 2u ?TWOu 2u 
2TWOu 3u 3u _HREE;ê 3u  Q w 4w 4w _FOUR;a4w 
 Q v 5v 5v  IVØ×5v 2IVEv 6v 6v ?SIXØ6v 
2SIXu 7u 7u OEVENØ7u  Q w 8w 8w _EIGHTw 8w 
Q w 9w 9w !NI±Ù9w 
 Q v :v Av òCOLON, left-right, ;, B, OSEMI0 <0 C0 ßLESS-THAN SIGe  =5 D5 oEQUALS2 >2 E2 GREATERj 	?8 F8 ÞQUESTION MARK@4  404 ÒCOMMERCIAL AT+A( }òLATIN CAPITAL LETTER A1 B1 91 B1 C1 õ1 C1 D1 ¯1 D1 E1 j1 %F1 %1 Fb G1 á1 G1 H1 ›1 H1 I1 U1 I1 J1 1 J1 K1 1 K1 L1 L1 M1 b M1 ðN'        #  0x4ðE -> LATIN CAPITAL LETTER N
    'O'   #  0x4F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET, left-right: $\\; † 5C: þ REVERSE SOLIDUS6 ]5  6 D6 ?IGHq ^; (ÿCIRCUMFLEX ACCEN©  _8 /~OW LINE¢ `/ 6-SGRAVEb ÿ a' #ESMAL´A/ b/ !	/ B/ c/ 	/ C/ d/ 	/ D/ e/ 	/ E/ f/ 	/ F/ g/ 	/ G/ h/ 	/ H/ i/ 	/ I/ j/ 	/ J/ k/ Œ	/ K/ l/ »	/ L/ m/ ý/  M/ n/ ñ/  o/ è¼ p/ 7è^  q/ ðr/ ðs/ ðt/ ðu/ ð	v/ ðw/ ðx/ ðÀLATIN SMALL ðLETTER X
    'y'   ó#  0x79 -> LATIN SMALL / Y/ z/ A/ Z/ {/ B/ òEFT CURLY BRACKET, left-right9 |9 C9 ÞVERTICAL LINE4 }4 D4 ORIGHn ~: E: RTILDEŽ B\x7f# %F  ôCONTROL CHARACTER, 'c4,  80, QPCAPIT¿ ‚ôA WITH DIAERESIS@ (a0@ 1@ ñNO-BREAK SPACE, *-55 (c75 25 u Cu uCEDILLA> 9> 3> E> EACUT(d1< 4< N< 	W(d6< 5< O< +(dc@ 6@ U@ e¼ 7@ 	ü©	ö e¥8: EGRAV0(e2´ pt “CIRCUMFLE¯9\xe^€? 1Pu06ba È8�dARABICè¥NOON GHUNN ab2 "  4 ŠÿLEFT-POINTING DOUBLE ANGLE QUOTATION MARK«e«¦«	u©e©¨<  §(e8Æ Â: 
±2 9Ð	° t ± ?9Ïy ±7xed· 9Ø	} Ià¢Au202^·9ÔpHORIZON„�ELLIPSIS¡et Òt ñ  ,9Õ? ñ f“9Ó	> M(f3· ÍK+)xb£Í8ã&f¥9ä‹ Bf¹rä? B`9äÀDIVISION SIGð	N, right-left
    '\xfa'
 õ #  0x9C -> LATIN SMALL LETTER U WITH ACUTE: 9: D: FGRAV: b: E: ¥CIRCUMFLEXy c? F? ’DIAERESIS>  ; "  ñ  A0> ^SPACE!, 1, þEXCLAMATION MARK7 "7 27 OQUOT5 	#5 35 ¯NUMBER SIG» $2 42 _DOLLA2 Q\u066ïí A52 áARABIC PERCENTl *&` 6. �MPERSAND÷ 1"'"HZ70 �POSTROPH_ (a 81 ÀLEFT PARENTH¶h +')7 97 ORIGH8 *8 A8 ASTERISÆ +/ B/ APLUS#—  ]0™]J]RCOMMAV-W 7ÎHYPHEN-MINUSZ .3 0žFULL STOP0 /0 !_SOLID^  ¸  f03 ¸ B’EXTENDED Á ø-INDIC DIGIT ZEROu ò (need override)è W 1W <W )ON#V 2V [­ 	/TW¬ 3V |V 
?HRE® 4X ¢X 	OFOUR[5W ÇW 
/IV® 6W ðW 	?SIX­ 7V V 
9EVEî
8X =X 	E"° Ù^X 	/NI¹:ª  W }ICOLOë ;1", z‰Q SEMI7 + <W uð
LESS-THAN SIGN, right-lef�t
    '='   ó#  0xBD -> EQUALS SIGN, right-lef2 >2 E2 ÏGREATER-THAN8 `\u061f= j F8 òARABIC QUESTION MARK™ e\u274a/  C0/ þEIGHT TEARDROP-SPOKED PROPELLER ASTERISK¶  ~ &21O 1O ~ ÄLETTER HAMZA} F0622. 2. ÷ALEF WITH MADDA ABOVE> 3> 3> 	v > 4> 4> 2WAW{ = 5= 5= ¹ > WBELOW¹ 6> 6> ?YEH{ 	7= 7=  { j 8- 8- 7BEH, 9, 9,  TE‡HRBUTÁ>A4 ` b` B,  H� c- C- GJEEMZ d- ]uæ e, W
, 8KHA- LCLÎ6DAL… %30Y DI
Y )TH- 'D' R3%D% GZAIN† D 8SEE- D *SH. ôDô 7SAD‡ âDâ D, ÑDÑ T‘3ÐDÐ Z, ÐDÐ 
7ÈDÈ %GH. [æ Ì cDÊÿLEFT SQUARE BRACKET \; : ×þ REVERSE SOLIDUS6 ]5 p àR¤q ^; ïÿCIRCUMFLEX ACCEN©  _8 úŽLOW LINE¢  ÷4ýEýgTATWEE&4ùEù Fù4ùEù 6QAFq4øEø K, ÷E÷ 'LA[4õEõ Mˆð46'   #  0xE6 ->û ARABIC LETTER NOON
    '\u0647'   #  0xE7 ->- 7HEH, 8, 8, 7WAW, 9, 9, ÇALEF MAKSURA5 a5 A5 Y� b, B, xFATHATAã c* C* KDAMM* d* D* KKASR* e* E* ~ Ñ f' F' { ' %50' 'F0' x ' 1' 1' WSHADDG&52( 2( 7UKU7Ä 'F3' (Pn7Ï.F4, (TT- &86€ 5-  CV&d5. 6. &AE&a4+ ­ V… a{F­ 6GAFX 8ÙF­ FDDAL- 9†¥ $RR† {­  i_F¦òLEFT CURLY BRACKET, right-leftf |9 µÞVERTICAL LINE4 }4 ¿ORIGHn  9ÏJÓ  , d^Ô, óYEH BARREE
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð2 mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with7 Œ P.py.
r ±#"

import  sÏ o ÁAPIs

class  ($ . 1):
ËAdef ð ñe(self,input,errors='strict'):,  *creturno B = , 4ing"C  o ;o *B 	o  o ú ±Incrementalæ$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� D]ª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ðReader(Codec,codecó6s.StreamReader):
    pass

### encodings module API

def getregentry(7 ð return codecs.C QInfo(T  X õname='mac-greek', h !e=4 2().   deU    ²incremental: 6r=I EÄ /er/ J 	/ Dl / s!r!=.R # cwriter# W # ")
N[ �ing TableH^ _t 2 = +`'\x00'1ñ #  0x00 -> CONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  Œ9, 	n, A, 	2x0b. äB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À
7x19¸1À
8x1a, À1À1À1À1À
8x1d„ À1À1À1À1À	 �  D2ÀRSPACEt!  ´òEXCLAMATION MARK+ "+ ³LQUOT) #) °²NUMBER SIGNO $& ªXDOLLA& %& ¤ðPERCENT SIGN
    '&'    ð#  0x26 -> AMPERSAND
 0"'"   $ 7$ ‘POSTROPHE% 0'('!   % 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# ’PLUS SIGN$ ,$ C$ RCOMMA  -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOUR“ 5% 5% #IVJ 6% QÝ 2SIXI 7$ Q$ 3EVE´8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 ðU
    'V'        ð#  0x56 -> LATIN CAPITAL LETTER V
    'W'   1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ ò C. ò REVERSE SOLIDUS* ])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' òESMALðAV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ Ý	ë F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ ÓÈ	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICàB}( çRÀV  ~. æCTILD~3\x7�7×óCONTROL CHARACTEGB\xc4O , 8Ô‡ó A WITH DIAERESIXH\xb9@ åÔSUPERSCRIPT O&E\xb2* À0x82 -> SUPEðRSCRIPT TWO
    '\xc9'
 ô #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE< (b3< 4< ESUPEf 5HRE, (d6, 5, h Oh ”DIAERESISl (dc@ 6@ U@ Pu0385B è 7@ õGREEK DIALYTIKA TONOp  e0.  80 ° ESMALAn EGRAVê (e2: 9: ¤CIRCUMFLEXé (e4? A? ' ç @ ç B> ç 	Ý (a8d C& J 8xe7$ D$  CuCEDILLAÄ 	UE< Seš F: 
wa° /90: w b? 1? -a
 92> £POUND SIGNAu212œ9k¨TRADE MARK* 8xee� Y| I|Cf? l	¼? Ì 8u20§ jcBULLETÈ 8xbd_ Kó	VULGAR FRACTION ONE HALF3 Au203Pû N™PER MILLEú f¾w9=%Æff9=? ú )xa> =¦BROKEN BARË a‹Ë <AEUROÆ ô # before Mac OS 9.2.2, was SOFT HYPHE(xf'9cÒ	íf®a: ' Â ff? ' !ÍAjUDAGGE#1039#AL…TDGAMM4Au039ü5 C5 HDELT5 15 S5 9THE5 ?5 ^5 HLAMDj •5 T5 $XI)703a'H2 P2 (xd¸AY÷ eSHARP ©a— ÌA[ð
REGISTERED SIGN
    '\xa9 '  ð#  0xA9 -> COPYRIGHT SIGN
 p'\u03a3+ ) A) ðGREEK CAPITAL LETTER4 'MA5 a5 B5 ôIOTA WITH DIALYTIKC 0xa7A "  x CC pSECTIONk Ÿ @2260) ' D' ÃNOT EQUAL TO‘ !xb% N E'  DEÈ M )xbt F& £MIDDLE DOTK Uu0391r  B0%  I EALPHÎ b3 €  B15 ¨PLUS-MINUS„ Vu2264_ 2* ÌLESS-THAN ORÚ  0 50 30 GREATER3 !xa1 � 43 *YEWF0392V 5# å 4BETä  Y ‹/B64 eEPSILOÂF0396k 77 Zk «k 84 
3 9g ñÒ  “ëÇBüHKAPPci ü&MUg aë› 7PHI3 be ÷3 Uld Ü8F F (PSy G#3 GOMEGaC3ESMALB1ª VTONOSì %9d¦ C<s NQxn áCD 
×&9fU 7×XOMICR­aÊyC;Œ $RH{Fu224eCK]ALMOS¥ �ûCA&TAê ê =ñLEFT-POINTING DOUBLE ANGLE QUOTACCMARK`)xbD ME Fu202ÄC_pHORIZON$tELLIPSIÓ(xa�CYãNO-BREAK SPACEœ  TCMè7  CRCR8Á R¦8çLþè&15jC[cLATIN &•IGATURE O62012 DXtEN DASH	6201@àD1 -> HORIZONT÷,AL BAR
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK5 d5 35 ORIGH6 86 46 k OSINGk 	95 55 k 6 	0xf74 Ö 66 PDIVISÉ DSIGNÉ 7038^ 7( ÷GREEK CAPITAL LETTER ETA WITH TONOS> ah <8> /IO? {9? OMICRON� e� AB _UPSILB aÊBB FSMALÿ @ 	‚ C@  &af¾ D< =c=E= ;
} F@ úOOMEGüc9&E0@ 	9y	%b1ý /E1@ VALPHAo&b23 «­	s 7BET2 crE¨2  7PSIc 4c £1  8DELd &b53 ¡3  EBh &c65  5  (PH™ 31 ©	ü GGAMMý bžEž	3 	.bE�	1  �Ç bþE€	2 XÆ 1EnHKAPPÆ bù aHLAMD3 EX'MUÆ ËKN0 ;E;	ö {e %c0È F0P+c[F ž^F+7RHOŸ `F*8SIG`c,F,(TA8ŽF*)TH“c“F(Ê &F*ÀEEK SMALL LEñ*TTER FINAL SIGMA
    '\u03c7'   #  0xF8 -> GREEK SMALL LE9 7CHI1 51 91 vUPSILON5 &b65 A5 8ZET˜ a2 B2 øIOTA WITH DIALYTIKA bA CA ¨ D &90D DD …  § AND TONOSK EK � N 0xad— ¶FN ò:SOFT HYPHEN # before Mac OS 9.2.2, was undefined
)

### Encoding table
en _ ø	=codecs.charmap_build(de$ ð)
""" Python Character MappW CB ð6 mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with9 � P.py.
v ±#"

import  sÓ s ÁAPIs

class  ($ . 1):
›Adef ô ñe(self,input,errors='strict'):,  3creturno B = , 2ingJ)o ?o *B 	o  o ú ±Incrementalê$er ç  h Ã final=False*  Y.S4[0]¤� Daª  €  ª ø Nª !@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  £Jàs module API

ý Ãgetregentry(7 
¡ž UInfo(Â£name='mac-‘%', j !e=6 2().     il: 'r=Õ/ J 	/ ê/ svr==J# w™# ¦# ")
 [  œ Taó
~ ê2 = -A'\x0´h 00hñCONTROL CHARACTER= , 1”/01, 2, 2, 3, 3, 4, À4 -> CONTROLð CHARACTER
    '\x05'
 ÿ #  0x05 -> CONTROL,  6, 6, 7, 7, 8, 8, 	t*  ° 9, 	n, A, 	2x0b. B, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
'10, /10, 1, 1, 2, 2, 3, 3, 4, 4, À1À1À1À1À1À1À1À
8x19Ü À
8x1a, À1À1À1À1À
8x1d„ À1À1À1À1À	 �  D2ÀRSPACEÄ!  ´òEXCLAMATION MARK+ "+ ³LQUOT) #) °²NUMBER SIGNO $& ªXDOLLA& %& ¤wPERCENTM &' Ÿ‘AMPERSANDq 1"'"¬—“APOSTROPH(I �ñLEFT PARENTHESISP +')+ �ORIGH,  *, �sASTERIS_+# †GPLUSç ,$ ~2MMA“ -  r³HYPHEN-MINUº .' m’FULL STOPK /$ eTSOLIDF P3[¢DIGIT ZEROG % `% #ONt	$ Y$ #TWH $ T$ 3HREJ û& T“ 3FOU·ô% SK 3FIVJ íÐ   #  0x36 ->ð DIGIT SIX
    '7'   ¤#  0x37 ->$ BEVEN& 8& 8& REIGHT& 9& 9& BNINE% :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARKç @(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 31 C1 D1 41 D1 E1 51 F1 61 Fb G1 ¦&G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ ¨5ãREVERSE SOLIDU¯])  * R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# 6ñYGRAVEJ a' çLSMALõb/ å	/ óc/ À63 -> LATIN ðSMALL LETTER C
    'd'   ù#  0x64 -> LATIN / D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ ðT/ u/ ðU/ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�Ü7×óCONTROL CHARACTEGB\xc4O , 8ÔPCAPIT§ 9ó A WITH DIAERESIXH\xc5@ å@ •RING ABOV­ (c7A ÷A C� rCEDILLAŽH\xc9> > E> EACUTz (d1< < N< 	c(d6<  < O< 7(dc@ 1@ U@ e¼ Bµ	ö (e0z M: 6GRAª(e2: X: “CIRCUMFLE—9\xejh? 1(e3} w°> ÐTILDE
    '\x@e5'  ð!#  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
4 X'\xe7? D? C? uCEDILLA< 9< E< E< FACUTv 8: F: 7GRA° a: /90: ¥CIRCUMFLEX³ b? 1? •DIAERESIS> d> 2> Iñ c: 3: 
ñ e: 4: ñ  f? 5? ñ (f1> 6> Nñ ETILDâ(f3: 7: O: 	(f2: 8: 	+(f4: 9: +(f6? A? +ˆ/9B> 
+	ÓÂU+�9½: 
+	»: + 	ÏÀ? +dGAÄeCAPITAµYó  'b0¥AÁ´DEGREE SIGN©aDA©JCENT$ ¢A“ZPOUND% A~xSECTION' Au202r …AfdBULLET‘ b\AIxPILCROWH (xd®A6eSHARP –a"A1›REGISTEREÎ 0A!‰COPYRIGH8u21Ð ©TRADE MARK² btA÷Î0 ACr añAäAu226ÝEÎÄNOT EQUAL TOK cK»>AŒd} ®2 ŽTSTROK= Au221`– B­„INFINITY’ b&B”¨PLUS-MINUS. ã 0M ˜ÌLESS-THAN ORì  0 W0 ¤ðGREATER-THAN OR ðEQUAL TO
    '\xa5'
 ô #  0xB4 -> YEN SIGN# b# 5# XMICRO% Pu2202J H 6% ðPARTIAL DIFFEREN T Vu2211/ 7/ äN-ARY SUMMATIO~  Y f* 8* tPRODUCTR F03c0( 9( ôGREEK SMALL LETTER PI0 F222b0 A0 ƒINTEGRAL# 0xaa!  B# ôFEMININE ORDINAL INDICATOR5 b5 C5 oMASCUL6 	Pu03a9m ?D6 ¾ eCAPITAÀ TOMEGAk  e63   E5 ZLATINó $AE0 (f80 F0 ÅO WITH STROK; b„k  C0; ÐINVERTED QUES²T MARKl aß1 11 REXCLAæ
4 c   C24 ;NOTg1`( C3# ¦SQUARE ROO&19�CÕ Fé 4HOO¶ Au224$_ ë{ALMOST 8 —~* ð„INCREMEN‡ !xaaåñLEFT-POINTING DOUBLE ANGLE QUOTú	bD ÿORIGHE Gu202­ pHORIZON[…ELLIPSIS»H· ÕNO-BREAK SPACq)  gµAiFGRAV< 3ì'< 	ETILD< d‘C-< Ê< Gu0154´ ”IGATURE Op  4 ® ì82 62012 D/sEN DASHePu2014T D ,EM" "  >5/ W dW  /6 ÷D0 EFzš k ³D,k /SI6 0xf7Ÿ 4D8yDIVISIOuFu25céD<TOZENG–(xf“D	ñY|fDIAEREåGu017ó > 1@ 7204À%AFRAC)SLéaÇ%*EU=(xdrD$ET@)xf3 	þ 1 À  '\xde'    ð" #  0xDE -> LATIN CAPITAL LETTER THORN
    '\xfe'
 5 F5 OSMAL3 d3 /E03 ÄY WITH ACUTEm (b7: 1: £MIDDLE DOT% Pu201a' Ç  E2% ÷SINGLE LOW-9 QUOTATION MARK6 Ê 6 36 ODOUB6 &30l 46 ÕPER MILLE SIG' c2'  ' E5) \Aö £CIRCUMFLEX  !xcÔ A 6A EA 1‚ 7A ‚ 	x(cb< 8< } •DIAERESIS½ 8@ 9@ EGRAVôc.A< Iù 
¸ Ó5B< v f¹ CA ù c@ D@ 	ù (d3< �Où  (d4< –Ë< ù Auf8fû F¤¤Apple logo×dÕF�Õf 
Þ ÐF¦< UÞ �F¬< 	Þ 7xd9F·A 	¹ Au013JÊ	ñ“DOTLESS I,Pu02c6u 7 À„MODIFIERX¨ e ACCENÒ102dH< »m ETILD)a±íF¥TMACRO„Au02dˆG †5BREj     jyDOT ABO$ ¹$ RIRING% !xbg Š 6vCEDILLAd×G nÀ ò. 
UOGONE½102c! ï CAú ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ñ) mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/z°2.TXT' with= “ ò.py.

Written by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ðs Reserved. NO WARRANTY.
(c) Copyrð)ight 2000 Guido van Rossum.

"""#"

import codecs

### C Â APIs

class ($ . à):

    def en ñ(self,input,errors='strict'):,  0 creturno “.charmap_B = , ¦ing_table)o /deo -B 	o  o ú ÁIncrementalEç r ç  h Ã final=False*  Y.S4[0]¤� D"ª  €  ª ø e½ª !@ ä ª  Qª ÑStreamWriter(N,Ò8cs. ¤ 5pas‡ ORead9  	9  ÐJ€s moduleÛ 

ý Ãgetregentry(7 
¡ž UInfo(Âõname='mac-latin2', i !e=5 2().     ik: 'r=Ô~/ J 	/ é/ sur<=I# w˜# ¥# ")
[ Ping T™ I5codé2 = ,`'\x00'ãñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„šNEGATIVE kÀ  '\x16'    ð #  0x16 -> SYNCHRONOUS IDLE
    '\x17'
 + 7+ õ
END OF TRANSMISSION BLOCK4 84 84 eCANCEL! 9! 9! U eMEDIUM( a( A( –SUBSTITUT¢ b% B% VESCAP! c! C! åFILE SEPARATORo d) D) _GROUP*  e* E* oRECORD+  f+ F+ LUNIT)  & "  j 20) CSPACÇ !  1  €EXCLAMAT‚3MAR�"+ 2+ LQUOT) #) 3) ²NUMBER SIGN$& 4& XDOLLA& %& 5& wPERCENTM &' |‘AMPERSANDq 1"'"ru“APOSTROPH(I fñLEFT PARENTHESISP +')+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU‘5% SK 3FIVJ 6% Q% 2SIXÜ ÃQ3Q$ 3EVEèµ& R& E-L º& M& $NI):• FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 ðI'        #  0x4ð9 -> LATIN CAPITAL LETTER I
    'J'   #  0x4A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ o5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMALmAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ åj/ Õ	/ ãk/ ÓE	/ ál/ Ôt	/ ßm/ Ù/  Ýn/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðÀIN SMALL LETÐTER T
    'u'   ð#  0x75 -> LATIN SMALL LET/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# ½F  UDELET! 'c4!  80! ÞPCAPITœ àòA WITH DIAERESIS¯ `\u0100B a /81@ gMACRON= 1= 2= 	[{ 	; 0xc99 "  x 3; ¸ E¸ 5ACUô  ´ ö < 4< y cOGONEK´ 8xd6y y Oy 18xdc@  @ U@ e2ù 1» ÷ 5| ÷ <: 	õ  2· ; Hµ Cµ &CAå!xel± Uw / z dµ d~x   : «´ qÚ< +7v …< 	™:  )xe˜‘:  –7< ° «: dZd° %7a° 9Æ	° : &0e: ÀDv 
ÚšÚ9¿I: ° 0™ì 9¾	° t  Vu0112° ¼b	5 = 3= ¼	w ; N9·= …DOT ABOVhfy ,·5,1Œ9·x ~9º	ó ð O WITH CIRCUMFLÐEX
    '\xf6'
 õ  #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS> 5> B> UTILDE: a: C: Ux DACUT: Au011< ² D: eCAPITA´ E< SCARONv  < bx < E< 	î :  0xfc8  (F: ° (Pu2020@ x  A0> cDAGGER™ !xb _ !A1! ˜EGREE SIG¿ 8G 2& ­û dOGONEKc  a3; c 3= XPOUNDb 8xa7% 4% xSECTION'  Ð 2) Ð 5' dBULLETm bW A6! xPILCROWH 0xdfF ” 7' Ñ 	�eSHARP u(ae5 85 ›REGISTEREÎ 9* 9* ˜COPYRIGHTˆ Gu212Ð ©TRADE MARK* 1011U ú òB�¼í ó)!26
_ ÝÃNOT EQUAL TO_Au012Î' ÈGgEDILLA< A< ÊEI> 	Ä  y ³= BÉ± ; ¸Bã; x 7MAC¹@2264Ìx ú½ESS-THAN OR!1226›0 íGREATER3 6012Bû  	ŒÛ 
ž 1013ðn ; Û KSC‘6220}B,ð ARTIAL DIFFEREN ÀF22114°N-ARY SUMMA«* 7014Y )— 	Ò L• WSTROKe3:; Ò = Ò 1013/O> y < dß az 
ß3ÛBbx : ×Bx: v ‘3Ù�*: 4¦‹N£*4vCŒ< ÀDILLA
    '\ð0u0143'   #  0xC1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\xac: < 2< ƒNOT SIGN# Pu221a% _ 3# ´SQUARE ROOT& F0144& 4& … OSMALƒ 	 ¿ 7: 5: ¿ GCAROœ &06< 6< „INCREMENš 0xab" ã 7$ óLEFT-POINTING DOUBLE ANGLE QUOTATION MARKÞ )xbD 8D ORIGHE Gu202­ 9E pHORIZON¥„ELLIPSISs (a0· A. ÔNO-BREAK SPACÃ @8+  B) z	>1015e : C: zO9(@ d5{ ]DC GTILD¹  51>  E< 	3}  ú cA FA À 8MAC;&016 D0= sEN DASH‚Fu201ÓDX,EM" � D> [RL W d¶ DPL6 æD` EFª· k 9k [k /SI6 !xf�ÔDUPDIVIS	&5cDYWOZENGâ4ë 7› â
Ÿ7015}-; ÜRœÕAu015—YD;< 	Y: fLv 	N7203mNg ohGu203SOD ¸E 7015‰ Xÿ 	Ã 6015¢DQ< dEDILLA01015:wERwC< 6‹El< ySï	¶ '20¡E†5_LOW-9Ó eE‡á6 	6016´E‡l	[¦ 6015ÛEŒâ 	Ñ�Zð 6 -> LATIN SMALðL LETTER S WITH ACUTE
    '\xc1'
 õ	 #  0xE7 -> LATIN CAPITA< A< Pu0164> < 8< T< SCARONx  < 5< 9< ESMALv :  0xcd8  ² A: ² Iv î Au017> ² B< Z< ²  7ez < C< 	² : &6a: D: ² Uv 6MAC)0xd3; ï E= O= ï !xdŸ< F< §CIRCUMFLEX¦b ô &F0A 	ô ¸  á/&F1; õ •RING ABOVšd4½ /F2A ù  } f¸ 3< ¸ {  '0? 4? ¼ iDOUBLEX C Z:5C ‚ A 2„ 6A „ fOGONEK¸77~ Ö~ 	; !xd!wÕYp f< Õ:  Vu0137î Õ	± Kt wCEDILLAí ¥Õ9DOTiGu014«ÙjL~ TSTROK¦ èc¹ Ü	¹ {  2åÝG{ ù '2c5ß²ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð2 mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with7 Œ P.py.
r ±#"

import  sÏ o ÁAPIs

class  ($ . 1):
Adef ð ñe(self,input,errors='strict'):,   creturno .B = , 4ing"C  o ;o *B 	o  o ú ±Incrementalæ$er ÀentalEncoderó):
    def encode(self, input, final=False*  . preturn / ³cs.charmap_@ :  F �.errors, ðing_table)[0]

class IncrementalDeO  r( >cs. €  ª d, ª '@ ª  ª óStreamWriter(Codec,ª  ¤ Dpassã  ORead9  	9 2###�ðings module API

ý Ãgetregentry(7 
�ž QInfo(Û ±õname='mac-roman', œ!e=4 2().     iÀ: 'r=¹EQr/ J 	/ / str;=H# w—# ¤# @)


N[ Ping T‚ H5codè2 = +`'\x00'1ñ #  0x00 -> CONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  Œ9, 	n, A, 	2x0b. äB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À1À
7x19¸1À
8x1a, À1À1À1À1ÀÀONTROL CHARAð CTER
    '\x1d'
 ù
 #  0x1D -> CONTROL CHARA, e, E, f, F,  ) "  „  20, RSPACE¤ !  1  òEXCLAMATION MARK+ "+ 2+ LQUOT) #) 3) ²NUMBER SIGNO $& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 1"'"Œ7$ ƒPOSTROPH(I 8% ñLEFT PARENTHESISP +')+ 9+ ORIGH,  *, A, sASTERIS_+# B# GPLUSç ,$ C$ RCOMMA“ -  r³HYPHEN-MINUº .' m’FULL STOPK /$ eTSOLIDF 0" 3[¢DIGIT ZEROG 1% `% #ONt2$ Y$ #TWH 3$ T$ 3HREJ 4& T“ 3FOU—5% SK 3FIVJ 6% Q% 2SIXÜ 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 ML1 æLb M1 îb M1 N1 À0x4E -> LATIðN CAPITAL LETTER N
    'O'   ý #  0x4F -> LATI1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 41 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ z 5C. ãREVERSE SOLIDU¯])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, ÿrOW LINEÖ `# 6ñYGRAVEJ a' çESMALxAV b/ å	/ B/ c/ ã	/ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó	/ K/ l/ ÔN	/ L/ m/ Ù/  M/ n/ Ù/  Ûo/ Ü¼ Ùp/ 7è^  ×q/ ðÕr/ ðÓs/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðð Y
    'z'      ð  #  0x7A -> LATIN SMALL LETTER Z
    '{'   / B/ òEFT CURLY BRACKET- |- C- ÒVERTICAL LINE( }( D( ORIGHV ~. E. CTILDN B\x7f# £ F  òCONTROL CHARACTERz G\xc4,  80, þ PCAPIT§  õA WITH DIAERESIS@ 5@ 1@ •RING ABOV­ (c7A 2A C� uCEDILLA 9> 3> E> EACUTz (d1< 4< N< 	c(d6< 5< O< 7(dc@ 6@ U@ e¼ 7@ 	µµ	ö (e0z 8: 6GRAª(e2: 9: ¤CIRCUMFLEX«ejh³ 1(e3} w¦> 	«e¢„â+ e ›?  žež©<  œ(e8ï Ã: 
¦a: 9Ñ	ï t ¦ b? Ð? ¦d> Í	> IÕ
—9É: 
ñ et Ç: ñ  -9Ê? ñ fˆ9È	> BfÑ9Â@	+fˆ9Â: 	+fƒ9Â: +fõ9Â? +ˆ9Â> 	ÂfÓÂ+
+�9½À LETTER U WIðTH GRAVE
    '\xfb'
 õ! #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX? c? F? “DIAERESIS> Pu2020@ }  A0> cDAGGER! !xb  ž !A1! ¤EGREE SIGN&  a2E & 2& JCENT$ 3$ 3$ ZPOUND% 7% 4% xSECTION'  · r · 5' dBULLET‘ (b6H 6! xPILCROWH 8xdf' 7' | dSHARP 48xae5 85 ›REGISTEREÎ 9* 9* ‰COPYRIGHGu212Ð A) ©TRADE MARK² (b4S B* €ACUTE ACr (a8' C' ü!26ÝED$ ÄNOT EQUAL TOK cK eCAPITA¢AÒd} “2 OÔTSTROK= Au221`– B’„INFINITY’ 'b1Ý B”¨PLUS-MINUS.Au2260M ˜ÌLESS-THAN ORì  0 5\ 0 ¤GREATER3 !xa1 ûB²)YE®)xb# ®[MICRO« 0B²ð ARTIAL DIFFEREN  'ª º°N-ARY SUMMA1* 0æ* ¯* dPRODUC3Fu03cB­ èKˆ&PIX 2ºX ´ƒINTEGRAL# 0xaaM­ö
FEMININE ORDINAL INDICATOr	5 »oMASCUL6 	Au03amŽ Í¾ tDMEGA  eÛBÛ	{ÙfÙBÙ	0 ×!xb„C×°VERTED QUES²îœ aß1 å#IN1 REXCLAæ
4 Cï Òª 8`(Câ¦SQUARE ROO&19�CÕ FÀCHOOK¶ Au224$_ ë]ALMOSWAu220~* ð„INCREMEN‡ !xaaåñLEFT-POINTING DOUBLE ANGLE QUOTú	bD ÿ€E  p­ pHORIZONVELLIPU!xaH· ðA -> NO-BREAK SPàACE
    '\xc0'
 ö #  0xCB -> LATIN CAPITAL LETTER A WITH GRAV< 3< C< ETILD< (d5< D< Ox < Pu0152> ´ E<  ”IGATURE Op  4 ® 4 F4 ~SMALL L2 62012  D02 sEN DASH<Uu2014ˆ !D1" M" c" 2" ÷LEFT DOUBLE QUOTATION MARKW d5 35 ORIGH6 86 46 k OSINGk 	95 55 k 6 	0xf74  4 D66 PDIVISÉ ESIGNÉ 05ca* t D7( dLOZENG–0xff  J 8" ~–|Y”DIAERESIS` 7017ó 9> ¼@ 7204ÀA@ AFRAC‘)SLéaÇ%YEURO í '03KE ‡¿-POINTING A�
31D –E @fb01VvTê$FIH6fb0PD$FL2 6202d EÓcDAGGER( (xb*E"£MIDDLE DOT%  Gö E%ö _LOW-9&eç E&ƒ 6 3ñE&˜PER MILLEÏ!xcšE	£CIRCUMFLEXÖ xûA %A EÝA  bA >ÞšEACUTX cb< X< } Z!xcX@ Z@ 
½< Vù Iù 
¸ Ó< i< 	5 QE†A 	ù è� ‚@ 		ù d/< yuÓ	ù d‰< ƒ< ù 2uf8LÙF’ðApple logo
    '\xd2'     ð(#  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'
  < 2< U< FACUT< b< 3< ¥CIRCUMFLEX} 9A 4A ¹ Pu0131> ¹ 5< ESMALó “DOTLESS Is Vu02c67 67 „MODIFIER'¨ v ACCENT< &dc< 7< m ETILD af$  R8& gMACRONG 8# º 9! 5BRE“Au02d  A  yDOT ABO$ ¹$ B$ IRING% !xbg Š C% wCEDILLA‹ d‹ D" qDOUBLE é òu E. fOGONEKO &c7O F!  CAú ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð8 mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with: ’ P.py.
x ±#"

import  sÕ u ÁAPIs

class  ($ . 1):
$Adef ö ñe(self,input,errors='strict'):,  —creturno .B = , 4ing(C  o Ao *B 	o  o ú ±Incrementalì$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� Dcª  €  ª ø ª (@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ¥�ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±¤name='mac-“%', k !e=7 2().     im: 'r=Ö€/ J 	/ ë/ swr>=K# wš# §# ")
![  ŸTö
~ ë2 = .P'\x00>±!00@ñONTROL CHARACTER= , þÐ  #  0x01 -> ðCONTROL CHARACTER
    '\x02'
 Ï #  0x02 -> , 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  49, 	n, A, 	2x0b. ŒB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
'10, /10, 1, 1, À1À1À1À1À1À1À1À1À1À1À1À1À1À
8x19`À
8x1a, À1À1À1À1À
8x1d„ À1À1À1À1À	 �  D2ÀRSPACEH!  ´òEXCLAMATION MARK+ "+ ³LQUOT) #) °²NUMBER SIGNO $& ªXDOLLA& %& ¤wPERCENTM &' Ÿ‘AMPERSANDq 1"'"0—“APOSTROPH(I �ñLEFT PARENTHESISP +')+ �ORIGH,  *, �sASTERIS_+# †GPLUSç ,$ ~2MMA“ -  r³HYPHEN-MINUº .' m’FULL STOPK /$ eTSOLIDF P3[¢DIGIT ZEROG % `% #ONt	$ Ð2 -> DIGIT TW�O
    '3'   ò#  0x33 -> DIGIT THREE& 4& 4& BFOUR% 5% 5% #IVJ 6% 6% 2SIXI 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& 3NIN• :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 vb C1 D1 �1 D1 E1 �1 F1 ™1 Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 óP1 51 P“ Q1 Q1 R1 ;S1 Sb T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ <5ãREVERSE SOLIDU¯])  * R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# À #  0x60 -> ðGRAVE ACCENT
    'a'   ò#  0x61 -> LATIN SMALL LETTER A/ b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ ðQ/ r/ ðR/ s/ ðS/ t/ ð¬u/ ðU^ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�i7×óCONTROL CHARACTEGB\xc4O , 8ÔPCAPIT§ —ã WITH DIAERESIXH\xc5@ å@ •RING ABOV­ (c7A ÷A C� cCEDILL%H\xc9> > E> EACUTz (d1< < N< 	c(d6<  < O< 7d±w1@ U@ e¼ BA> 	ö (e0º M: ÇúH\xe2: XÀETTER A WITHð CIRCUMFLEX
    '\xe4'
 õ  #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS> 3> B> UTILDE: 5: C: –RING ABOV? 7? D? C· uCEDILLA{ 9< E< E< FACUTv 8: F: 7GRA° a: /90: ¦ b? 1? ¦d> 2> Iñ c: 3: 
ñ e: 4: ñ  f? 5? ñ (f1> 6> Nñ 	—fÑ/97: O: 	(f2t 8: 	+fƒ/99: +(f6y Â³ +ˆ9Â> 
+	ÓÂU+�9½: 
+	»: + 	ÏÀ? +Pu2020k+AÄdDAGGERYb  LA¦´DEGREE SIGN& a)AŽJCENT$ ‡AxZPOUND% AcxSECTION'  · r · KdBULLET‘ bAA.xPILCROWH (xd“AeSHARP !aA›REGISTEREÎ A‰COPYRIGHGu212Ð ð©TRADE MARK² bYAÜ³0 ACr aÖAÉü!26ÝE³ÃNOT EQUAL TOK Gu010œ  lCAPITAP5BRE#Au021‰ c �< SRð%COMMA BELOW # for Unicode 3.0 and later
    '\u221e'ð   #  0xB0 -> INFINITY
    '\xb1'
 # 1# ó PLUS-MINUS SIGN* Pu2264, M 2* ÷LESS-THAN OR EQUAL TO0 50 30 GREATER3 !xa1 ° 43 8YEN† )xb# 5# XMICRO% Vu2202{ 6% ðPARTIAL DIFFEREN ª 1Ú 7/ çN-ARY SUMMATIO&0fY 8* tPRODUCTR F03c0( 9( ôGREEK SMALL LETTER PI0 F222b0 A0 ƒINTEGRAL# 0xaa! B# ôFEMININE ORDINAL INDICATOR5 b5 C5 oMASCUL6 	Pu03a9m D6 ¾ eCAPITAÀ SOMEGAk Vu01035 E5 ZLATINó ÅA WITH BREVE: '21o F: S: óCOMMA BELOW # for Unicode 3.0 and later\ !xb¯6C°VERTED QUESÝT MARK1 a
1 #IN1 REXCLA
4 cù 4 ;NOT’1‹SC¦SQUARE ROO7&19¸C D F
4HOO¶ Pu2248„ _ oALMOST– &06* „INCREMEN‡ !xaŒÐ ñLEFT-POINTING DOUBLE ANGLE QUOT%	bD *ORIGHE Gu202­ GpHORIZON†…ELLIPSIS»s· EÔNO-BREAK SPACqxœ) Kgà­5GRA­!xcå< R< 	ETILDx d¼CX< Oá< Gu015_´ ”IGATURE Op  4 ® Y2 62012 D/sEN DASHeFu201D ,EM" v D >5/ W d—D /6 ÷D0 EFzš k oD,k /SI6 0xf7Ÿ øD8yDIVISIO Fu25céD<TOZENG–(xf“D	YfDIAEREåGu017ó > ðETTER Y WITH DIAö ERESIS
    '\u2044'   #  0xDA -> FRACTION SLASH) &ac) B) –EURO SIGN$ &39$ C$ ñSINGLE LEFT-POINTING A QQUOTAi GMARKD aD DD ORIGHE 7021E EE ô4LATIN CAPITAL LETTER T WITH COMMA BELOW # for Unicode 3.0 and later£ F021b£ F^ OSMAL\ ,E2021\  E0\ ÓDOUBLE DAGGER„ 0xb7& ¸ E1( @MIDD( #OT% 7u20 E2% �_OW-9 ‚ 1e]  E36 ƒ L6 
&306 46 ˜PER MILLE%0xc2' º 5) œAœ“IRCUMFLEXÖ !xcÛA 6A EA bA 7A ‚ UACUTE} ú< 8< } 9DIAp8xc8þ 9@ FGRAV| d< ¬:Iù 
¸ Ó¸ ¿< 	Cvf} ÜA 	ù >� Ø@ 		ù (d3| ÏOù  dßx ­< ù Auf8fû F’¤Apple logodÕF�Þ f 
Þ ÐF¦< UÞ �F¬< 	Þ !xd±F·A 	¹ Au013JÊ	“DOTLESS I,Pu02c6Ð7 À„MODIFIER˜¨ e ACCENÒ102dH< »m ETILD)a±Õ ¥UMACRO©102dˆG †5BREj2u02  jyDOT ABO$ ¹$ RRÝ% !xbg Š 6vCEDILLAd×G nÀ ò. 
UOGONE?102c! ïð CARON
)

### Enò coding table
en _ ø	=codecs.charmap_build(de$ ð)
""" Python Character MappW CB ð6 mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with9 � P.py.
v ±#"

import  rs

### s ²APIs

class ($ . Á):

    def ô ñe(self,input,errors='strict'):,  0 creturno B = , 2ingJ)o ?o *B 	o  o ú ÀIncrementalEÛ$er ç  h Ã final=False*  Y.S4[0]¤� Daª  €  ª ø Nª !@ ä ª  Qª ÑStreamWriter(N,[ ¤ 5pas‡ ORead9  	9  ÐJàs module API

ý Ãgetregentry(7 
¡ž UInfo(Â£name='mac-‘%', j !e=6 2().     il: 'r=Õ/ J 	/ ê/ svr==J# w™# ¦# ")
 [  œTó
~ ê2 = -`'\x00'äñ #  0x00 -> CONTROL CHARACTER= , 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 	t*  Œ9, 	n, A, 	2x0b. äB, c, C, 	r* ° D, 	2x0e. „ E, f, F, 
1À1ÀÀL CHARACTER
     '\x11'
 ð #  0x11 -> CONTROL CHARACTER
"  , 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, a, A, b, B, c, C, d, D, e, E, f, F,  ) "  ” 20, RSPACEˆ!  ´òEXCLAMATION MARK+ "+ ³LQUOT) #) °²NUMBER SIGNO $& ªXDOLLA& %& ¤wPERCENTM &' Ÿ‘AMPERSANDq 0"'"z  Ÿ2—“APOSTROPH(I �ñLEFT PARENTHESISP +')+ �ORIGH,  *, �sASTERIS_+# †GPLUSç ,$ ~2MMA“ -  r³HYPHEN-MINUº .' m’FULL STOPK /$ eTSOLIDF 0" 3[¢DIGIT ZEROG €3`% #ONt	$ Y$ #TWH $ T$ 3HREJ û& T“ 3FOU{ô% SK 3FIVJ í% Q% 2SIXÜ å$ Q$ 3EVEèß& R& E-L Ù& M& $NI):rFCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUESi@( 4YÒCOMMERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 ÀPITAL LETTER  C
    'D'   ò#  0x44 -> LATIN CAPITAL LETTER D1 E1 51 E1 F1 61 F1 G1 71 G1 H1 81 H1 I1 91 I1 J1 A1 J1 K1 B1 K1 L1 C1 L1 M1 D1 M1 N1 E1 N1 O1 F1 O1 P1 /501 P1 Q1 11 Q1 R1 21 R1 S1 31 S1 T1 T1 U1 U1 V1 V1 W1 W1 X1 X1 Y1 Y1 Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ •5ãREVERSE SOLIDU¯])  * ORIGHY ^/ óCIRCUMFLEX ACCEN… _, ÿcOW LINÛ`# 6ñYGRAVEJ a' çESMALbA,b/ å	/ B/ c/ ã	/ ñd/ á	/ ïe/ ß	/ f/ Ý	/ ëg/ Û	/ éh/ Ù	/ çi/ ×	/ åj/ Õ	/ ãk/ Ó:	/ ál/ Ôi	/ ßm/ Ù/  Ýn/ Ù/ ÀER N
    'o'  ð#  0x6F -> LATIN SMALL LETTER O
' 0'p'   / /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ 3/ S/ t/ 4/ T/ u/ 5/ U/ v/ 6/ V/ w/ 7/ W/ x/ 8/ X/ y/ 9/ Y/ z/ A/ Z/ {/ B/ óEFT CURLY BRACKEG|- C- ÒVERTICAL LINEU }( D( ORIGHV ~. E. CTILDN B\x7f# ¨×óCONTROL CHARACTEGG\xc4, 8ÔPCAPIT§ ó A WITH DIAERESIXH\xc5@ å@ •RING ABOV­ (c7A ÷A C� rCEDILLA9H\xc9> > E> EACUTz (d1< < N< 	c(d6<  < O< 7(dc@ 1@ U@ e¼ Bµ	ö (e0z M: 6GRAª(e2: X: “CIRCUMFLE—9\xejh? 1(e3} w«> 	«e¢„å :  e ›?  žež©<  œ(e8ï Ã: 
¦a: 9Ñ	Ôt ¦ b? Ð? ¦d> Í	> IÕ
—9É: 
ñ et Ç: àCIRCUMFLEX
   € '\xef'  ð #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
3 X'\xf1> 6> N> UTILDE: 3: 7: O: FACUT: 2: 8: FGRAV: 4: 9: ¥CIRCUMFLEX³ 6? A? +5> B> 
+a: C: U+9: D: 
+b: E: + c? F? +Pu2020@ ” A0> dDAGGERŠb "  ! 1! ¤EGREE SIGN& a) A2& JCENT$ ‡ A3$ ZPOUND% 7Ž o 4% xSECTION'  · r – KdBULLET‘ bAA.xPILCROWH (xd“AeSHARP Š(ae¤ ›REGISTEREÎ A‰COPYRIGHGu212Ð ð©TRADE MARK² bYAÜ³0 ACr (a8¤ Éü!26ÝE³ÄNOT EQUAL TOK cK eCAPITA¹Aýd} “2 sTSTROK= Au221`– B’„INFINITY’ bB”¨PLUS-MINUS.Au2260M ˜ÌLESS-THAN ORì  0 <0 ¤GREATER3 !xa1 ²B²)YE®)xb# ®[MICRO« 0B²ð ARTIAL DIFFEREN  'ª º°N-ARY SUMMA1* 0æ* ¯* dPRODUC3Fu03cB­ èKŸ&PIX 2ºX ´ƒINTEGRAL# (xaOB­ö
FEMININE ORDINAL INDICATOr	5 »oMASCUL6 	Au03amŽ Í¾ tDMEGA  eÛBÛ	’ÙfÙBÙ	0 ×ÀTROKE
    '\Pxbf'  ð#  0xC0 -> INVERTED QUESTION MARK
& X'\xa11 11 ~EXCLAMA4 c4 24 ƒNOT SIGNW Pu221a% ˆ 3# ´SQUARE ROOT& F0192& 4& ôLATIN SMALL LETTER F WITH HOO¶ Vu22489 59 ô ALMOST EQUAL TOc F2206* 6* „INCREMEN‡ 0xab" "  ­ 7$ þLEFT-POINTING DOUBLE ANGLE QUOTbD 8D ORIGHE Gu202­ 9E óHORIZONTAL ELLIPSISÛ 8xa0· A. äNO-BREAK SPACE) c) B) g@CAPIZ iAiFGRAV< 3e C< ETILD< (d5< D< Ox < Gu015E<  ”IGATURE Op  4 ® ÈF4 O2 62012 D/sEN DASH<Pu2014Æ T D ,EM" "  >5/ W dW  /6 ÷D0 EFzš k 9k ,k /SI6 0xf74 D8PDIVIS@	é&5céD<TOZENG–(xf“D~–åYfDIAEREåGu017ó > ¼@  1eÊ ž%@ G€ 5BREüAu011¼ < 8	º : 3t: 6Iv xDOT ABOz 3˜@ :	z ”DOTLESS I­7015í 5mSw wCEDILLA> ï ?< 	6202± EI5cDAGGERd (xbWEO†MIDDLE D'20=ER¬_LOW-9‚ èý ESƒ 6 ªES˜PER MILLEÒ!xc�EGIE¤CIRCUMFLEXû (A RA E�A bA kð ATIN CAPITAL LEðTTER A WITH ACUTE
    '\xcb'
 ñ #  0xE8 -> LATIN CAPITAL LE< E< •DIAERESIS@ 8@ 9@ FGRAV| d< A< I| 
¸ e< B< ¥CIRCUMFLEX¹ fA CA ù c@ D@ 	ù (d3< E< Où  (d4< F< ù Auf8fû ò F0A ¤Apple logo'd2f  F1% ¢ 
Þ a< 2< UÞ �/F3< Þ 8xd9} 4A ¹ Puf8a0> 5< £undefined1Vu02c6% 6% „MODIFIER,– v ACCENT< d6a 7< ¥SMALL TILDaŸ “F“gMACRONG vG t5BREX2u02  XyDOT ABO$ §$ @IRING% !xbg Š $wCEDILLA‹ ÅG bDOUBLEf à. øfOGONEKO &c7]Ý CAú ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python 'mbcs' C7 ò for Windows


Cloned by Mark Hammond (mh
 ó$@skippinet.com.au) from ascii.py,
which was writtenM òc-Andre Lemburg (mal@l  L ð).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
Û ó
# Import them explicitly to cause an# ó Error
# on non-ý ‘ systems
Ð S" iT  0_u1e,  ^1e
#?ÀIncrementalDvGer,  ½  C...
R ` ÝˆRAPIs
Ú2e =f s b

def r �(input, eÄ Ás='strict'):Jbreturn< 0 ï, True)

class¤  (˜ .¾ b  Š – s(self, � ³final=False*  ^� 6 0  = .Å O)[0]’  J’ ‡Bufferedš " p !_b" ð _decode = mbcs_ðdecode

class StreamWriter( 8cs. �):
    en ‚ = mbcs_ 
C LReadC  C x C  R

###] óings module API

def getregentry(G preturn � Ñcs.CodecInfo(§  « `name='¨ %', ² =  † =  ²incremental2 6r=I Er/ J 	/ Dp/ ssr0=l)R # w–# £# ñ)
""" Python 'oem' 	Ð for Windows
$ ó
# Import them explicitly to cause an# ó Error
# on non-G Ó systems
fromv" iT 3oem ,  ý !
#‡ 1  ES ...
P ÔÐ bAPIs

„! =e  q �(input, eÁ ªs='strict'0  
/ t, True)Ì¢  a  ¨• s(self, � ³final=False*  ž¿ � 5 /  < .Ã O)[0]‘  G‘ ‡Buffered™ " o !_b" _&? ^ ~[X  J ª B  
B À
B  B w B  èN ü< ) rb eûÂ÷Character MappingÐPalmOS 3.5.

âñten by Sjoerd Mullender (s ð@acm.org); basedáiso8859_15.py.R?#"
¯YÁ fòe0 ú½ À2ƒ.charmapxÌ= ,ê€ing_tablÔ ?  Ÿqo )B ¬ , o ù �å C	MÀding_table)[ð0]

class IncrementalDecoder( >cs. Á):
    def d, ó
(self, input, final=False*  . sreturn U ƒcharmap_@ :  F �.errors, ¶ing_table)[ª óStreamWriter(Codec,U  z Dpassã  0ReaÝ 9   	9 ð### encodings module API

ý Ãgetregentry(7 
æ e QInfo(1 åname='palmos', e !e=1 2().     i½: 'r=¶EÁ /er/ J 	/ ÿ/ sqr8=E# w”# ¡# @)


K[ Ping TÕ E[å2 = (`'\x00'.ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�ð"'        #  0x2ð2 -> QUOTATION MARK
    '#'   p#  0x23) ²NUMBER SIGN& $& 4& XDOLLA& %& 5& wPERCENTM &' 6' ‘AMPERSANDq 0"'"“   — 7$ ‘POSTROPHE% +'(I 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, sASTERIS6+# B# GPLUSç ,$ C$ RCOMMA“ -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ YI #TWH 3$ T$ 3HREJ 4& T“ BFOUR“ 5% SK 3FIVJ 6% Q% 2SIXI 7$ Q$ 3EVEè8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SKQUES@@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 ML1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;ÐS'        #  ð0x53 -> LATIN CAPITAL LETTER S
    'T'   #  0x541 T1 U1 51 U1 V1 61 V1 W1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 óEFT SQUARE BRACKET$\\/ …C. ãREVERSE SOLIDU¯])  * D* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINEÖ `#  60# YGRAVEJ a' 1' …ESMALƒAV b/ 2/ B/ c/ ã	^ C/ d/ á	/ D/ e/ ß	/ f/ Ý	/ F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ Ó[	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðÍv/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICsB}( çRÀV  ~. æCTILD~3\x7�ð7F -> DELETE
   ð '\u20ac'   #  0x80 -> EURO SIGN
    '\x81" $ 1$ “<control>$ Pu201a& H 2$ ôSINGLE LOW-9 QUOTATION MARK6 F01926 36 õLATIN SMALL LETTER F WITH HOO9 F201e9 49 ODOUBo F20266 56 ôHORIZONTAL ELLIPSIS� F2020. 6. gDAGGER! ô 7! … 
( 702cw 8( „MODIFIERã öCIRCUMFLEX ACCENTd 3… 9< ˜PER MILLE¥Gu016) A) K@CAPIß MSMDCAROáVu2039ê B< ½áEFT-POINTING AÑË5ËCD € ¥IGATURE OEÝ '66D4 öBLACK DIAMOND SUI
6663¥ E- LCLUB* 5* F* \HEART+ 69ÿ‚ ZSPADE+ 5018V 9SLEFT *6201Z9ORIGH6 •9 k ãk d  k 6 2·9VBULLEw&01w9uEN DASHÆ6014y )EM" 702dÐ SáFTILD1‹ ë TR† 2ìy9ìV ê0x9bª Ë9êË7015ò Ê^ È!x9yV ÈV !x9°$ ¿$ Gu017c¹DYÄfDIAERE²!xaÌd AÎÔNO-BREAK SPACk!xa?) Ìý INVERTED EXCLAM¬!xa(4 Ë ©™!xa9$ ¹0POUÉOa.% ©ŠCURRENCYM Å( ›:YEN# ?# �”BROKEN BA§7xa7ôA 1SECŒæa{L ¥aÍ$ £BCOPYh	M ) ¢ö
FEMININE ORDINAL INDICATO© �A� b€Ê‡xÎy ½ NOoÏÀ'\xad'     #ð  0xAD -> SOFT HYPHEN
    '\xae'
 ! #& E& æREGISTERED SIG* f* F* UMACRO! 'b0!  B0! iDEGREEG (b1& 1& ªPLUS-MINUS* 2* 2* ô SUPERSCRIPT TWOÅ (b3* 3* EHREE, 4, 4, ÅACUTE ACCENT' 5' 5' ZMICRO¢ 6% 6% zPILCROW' 7' 7' –MIDDLE DOq 8% 8% uCEDILLA“ 9" 9" &ONä a* A* õMASCULINE ORDINAL INDICATOR` b6 B6 õRIGHT-POINTING DOUBLE ANGLE QUOTATION MARKE cE CE ±VULGAR FRAC/  ON= FARTE{ d6 ¬6 EHALFi e3 ¹3 Tø1 QUk S9 ÈBÈÑINVERTED QUES¤ Ó cØCØõLATIN CAPITAL LETTER A WITH GRAVŠcîCî< 	Š© c C < 	¥CIRCUMFLEXA CA 	FTILD¹ 'C'< 	…DIAERESIfc@C@@ 	R_7ABO:\C\A ³ gCg2 C¨^c€C€> E> 
æšCš< 	
æ¬C¬< 	æ ·C·A 	ª²C²@ Iù ¸C¸< 	
ù ÁCÁ< 	ù  ÉCÉA 	ù dØDØô ETH (Icelandic)^dÛDÛN8	^dÛDÛO< 	mdÖDÖÀER O WITH ACàUTE
    '\xd4'
 õ# #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEXA 5A 5A FTILD} 6< 6< •DIAERESIS| 7@ 7@ õMULTIPLICATION SIGN. 8. 8. ë 	VSTROK« 9= 9= U(FGRAV< a< A< (AC b< B<   cA CA dd@ D@ Yù 
½ e< E< õTHORN (Icelandic)³fA FA ESMALœõ SHARP S (German> 'e0> /E0> A¹ 	²(e1: 1: 	ó (e2: 2: ®(e3? 3? 	LeÉEÉ	+í æeÆEÆ> †RING ABOâeÉEÉ
? e¹E¹‹	0 CštCEDILLAeÇEÇ	< E< 
ÖÄEÄ: 
ÖÂEÂ: Ö ÅEÅ? œÂEÂ	> Iñ ¼E¼: 
ñ ºEº: ñ  ¸E¸³ ñ f¸F¸?ETH3f»F»N.	Bf»F»		Yf¶F¶: 	hf¶F¶: hf·F·? ÀH TILDE
    p'\xf6'  ð #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
3  > 7> 7> ÕDIVISION SIGN( 8( 8( f eSTROKE; 9; 9; U¡ FGRAV: a: A: FACUT: b: B: ¥CIRCUMFLEX³ c? C? Td> D> Yñ 
· e: E: õTHORN (Icelandic)· f? F? y · ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python Character MappW CB ð generated from 'PTCP154.txt' with" m ò.py.

Written by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R û	s Reserved. NO WARRANTY.6 ð2000 Guido van Rossum.
á ±#"

import § s>Þ ÁAPIs

class  ($ . 1):
«Adef _ñe(self,input,errors='strict'):,  ¨creturno ƒB = , 4ing‘C  o ªo *B 	o  o ú ±IncrementalU$er ç  ¤ ½ ¤  h Ã final=False*  Y.S4[0]¤� DÌª  €  ª ø ª (@ ä ª  Qª `Stream1er(N,[ ¤ 5pas‡ ORead9  	9  �ðings module API

ý Ãgetregentry(7 
¡ž QInfo( ±õ name='ptcp154', f !e=2 2().     ih: 'r=Ñ{/ J 	/ æ/ srr9=F# cwriter# ¢# ")
[  TZ
~ æ2 = )W'\x00Â 00ÂANULL0  ð1'     #  0x01 -ð> START OF HEADING
    '\x02'
 § #  0x02 -+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& •7 -> BELL 8 8 tACKSPACC t"  9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEEDx b& [B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG '10#  10# ô DATA LINK ESCAPB8x11+ 1+ öEVICE CONTROL ON- v1vD- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÌ(19f¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „wPERCENTM &' |‚AMPERSANt1"'"Ìu“APOSTROPHø(I fòLEFT PARENTHESISH)+ pORIGH,  *, tsASTERIS_+# rGPLUSç ,$ uRCOMMA“ -  l³HYPHEN-MINUº .' i’FULL STOPK /$ bTSOLIDF þP3[“DIGIT ZER¡ø% `% òï$ Y$ éæ$ T$ àÝ& T“ ×ÔÀ     #  0x35ð -> DIGIT FIVE
    '6'   v#  0x36% 2SIX$ 7$ 7$ BEVEN& 8& 8& REIGHT& 9& 9& 3NIN• :% A% CCOLOk ;  B  GSEMI$ <$ C$ ÓLESS-THAN SIGM =) D) gEQUALS& >& E& |GREATERR ?, F, ÒQUESTION MARK@(  40( ÃCOMMERCIAL A4A( 1( òLATIN CAPITAL LETTER AY B1 21 B1 C1 31 C1 D1 41 D1 E1 51 F1 ™õ Fb G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 PO1 þ1 Ob P1 51 P1 Q1 Q1 R1 R1 S1 S1 T1 ÔU1 Ub V1 V1 W1 W1 X1 Y1 Yb Z1 Z1 [1 óEFT SQUARE BRACKET$\\/ Ì5ãREVERSE SOLIDU¯])  * R¦Y ^/ óCIRCUMFLEX ACCEN… _, ÿEOW Lß`# 6ñYGRAVEJ a' çLSMALõb/ åÀATIN SMALL Lð ETTER B
    'c'   ò	#  0x63 -> LATIN SMALL L/ C/ d/ 4/ D/ e/ 5/ E/ f/ 6/ F/ g/ 7/ G/ h/ 8/ H/ i/ 9/ I/ j/ A/ J/ k/ B/ K/ l/ C/ L/ m/ D/ M/ n/ E/ N/ o/ F/ O/ p/ /70/ P/ q/ 1/ Q/ r/ 2/ R/ s/ ðS/ t/ ðT/ u/ ðU/ v/ ðV/ w/ ðW/ x/ ðX/ y/ ðY/ z/ ðZ/ {/ ðóEFT CURLY BRACKEG|- îÃVERTICAL LIN0}( çORIGHV ~. æCTILDN 3\x7�7×ÂDELETE (DEL)Ê `\u0496L ' 8ÏàCYRILLIC CAPIT¥ 7óZHE WITH DESCENDE‡E 2E åE GE TSTROK® Au04e`‡ øB U… SMACROÅ‚ 3‚ 	@ 	ü€ 7201€ óDOUBLE LOW-9 QUOTATION MARÈW\u202=!pHORIZON7sELLIPSI~ ¤ b.  ¤ kC&k a© 6E ASTRA@¢‚ ¨D= "HAg� ZªYD Sf &a0¥e; ¦BASHKIR KA©e¼ À 0x8B -> CYRÿ2ILLIC CAPITAL LETTER I WITH MACRON
    '\u04a2'   #  0x8C -> CYRI@ "ENA –DESCENDERD &9aD DD 	/KAD bD ED 	FSHHA{ &b8{ F7 	2CHE| ö VERTICAL STROKEK %97K )90K ESMALHZI 	6201Ž  91C ôLEFT SINGLE QUOTATION MARKx F2019x 25 ORIGH6 c6 36 k ODOUBk 	d5 45 k 6 2# 956 gBULLETÂ 3W 6! wEN DASH" 4" 7" M" 704bD 8" ˆ	~"HAÆ}704bÀ9B CÀF04a1§ AC —BASHKIR K‰eÀ B; †> 
†	þ „	b» 
„	B ‚	B 
‚	B €½
€	5 u~0xa0¾ ˆA~×NO-BREAK SPAC§ 0e+ ±Ad)ñôSHORT U (Byelorussian)”7045I xI 	» G 0ôA‰G � JÅ e5 ‰5 †BARRED O· 9; Ž; Zñ+oD±D ASTRAŽUw	4!xar¶Ø1SECã7SIGe0XAÝ$Ié !xaY\ Ð2OPY±
^ d
¶^ DSCHW³!xaïa ³ C£-POINTING A½!xa…D ¹ NO»ý &ef±šb	 !xa¤a –pREGISTEÀ049c'   #  0ð2xAF -> CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
    '\xb0'
 € #  0xB0J ³DEGREE SIGN& ƒu04b1'  & 1& p ESMALn ¢STRAIGHT Uv 	m Vu0406G 2G · ö	BYELORUSSIAN-UKRAINIAN I’ 5K 3K 	’ I &99” 4I "ZEÓ –DESCENDER‹ eB 5B ƒBARRED O9 !xbÂ V69 xPILCROW}0xb7  ' 7' £MIDDLE DOTL Gu045¢8% ¢I Au211� û93 hNUMERO~ Gu04dÞ A& Y SSCHWA� 8xbb´ B6 Ró-POINTING DOUBLE ANGLE QUOTATION MARKE  Ô 8G ¡ CE { JÏVu04aa3 D3 b/ESÐa¾ w ED 	[B &9d† 
Ÿ	B �Au041ŸŠ C�Î z 4 	C«4 B7%12± C™
V5 35 
ƒj (GH6 46 
p6 D5 55 
c5 I5 àC_>Z  ptn6 k ªC~  Þ1YCi XSHORTü1åC“n KÖC’o 'EL¤ cx
‚j 'EM5 þC„b&1ej 
uj ÁF041f4 
g4 P«2TDT
ã2UDU
&ES2UDU
TŸ UDUÀTTER U
    'ñ&\u0424'   #  0xD4 -> CYRILLIC CAPITAL LETTER EF
    '5 55 55 	'HA5 65 65 	7TSE6 76 76 	(CH6 86 86 	S¢ 96 96 C8 a8 A8 	—HARD SIGNà b< B< 	GYERU7 c7 C7 	LSOFTs d< D< 	Qe4 E4 	Y¥ f5 F5 
'%305 )E05 ESMAL�2 12 12 BÏ &323 23 V3 33 33 G‡3]E]	Ì Dg [E[	3 I3 YEY	3 Zš WEW
4 g TET	3 I¥3PEP	2 hSHORT 8 PEP	8 KGEG	3 'ELž CEC
3 M3 :E:
3 à39E9	3 Oe 6E6	2 P›44F4&ERf 45F5'ES3 5F5T™ 5F5443F3Ž43F3²43F3	Š43F3	ˆ44F4	†46F6
	„44F4ÐHARD SIGN
   ó& '\u044b'   #  0xFB -> CYRILLIC SMALL LETTER YERU
   5 c5 C5 —SOFT SIGN: d: D: E2 e2 E2 YŸ f3 F3 ó
A
)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ p)
""" C) Ð for the Puni;  O ð), as specified in RFC 3492

Written by Martin v. LÃ¶wis.\ �

import R !cs· # É   ñ

def segregate(str):zÁ"""3.1 Basics e point, aion"""+ ñbase = bytearray() ãextended = set  cù 2stri  Sö if ord(c) < 128    _ ‚.append(& `   Jelse. v 0.adQ Š dorted(& J Preturz@tes(o 4), " "°lective_len&V, max+RB  õðlength of str, consider\Ponly EÀacters belowI .Kqres = 0¶ +:maxý  ? A+= 1@ Ö <resÄ BfindÅ  � Í, index, posÒ ‡a pair (# 0 @icatÓ  ò ñnext occurrence of€  \ ê.c 1 is€position% A  * .D 2ðordinals up to an:1clu° < , =posa !inG  e @full“3ing� /2 !sttgœ !in¬  7 D  stÄª Cl = Fvwhile 1’ _ Ž ® if_ V == l&   «r(-1, -1O   c<qtr[pos]u   @if cD  ú G ¬!+1Ñ6 !el8 <€
7 0  ª Pinser r_unsort+#T3.2 I,  ,  +4ingÐ0old§  Ô"x8×¢result = [Ó 2old� 2= -¹ùs ¯ *  [0  f  õ `curlenEeÀ 2 j’delta = (3 p+1) * ($ 3 - Æ . ë ƒ œ ,š sp l%c,! I 8 f=Ò ì     UbreakÓ   ­ #+=8 ¡ ] 	& i:4 ð -1)
           Á oldindex =  '
  •delta = 0  oldchar =  
 ñreturn result

def T(j, bias):# ð# Punycode parameters: tmin = 1, tmaƒ Ñ26, base = 36: 1res Á * (j + 1) -Z   ifw c < 1: ‡ 1 E> 26 2R ¯ p

digita ñb"abcdefghijklmnopqrstuvwxyz0123456789"Ý ’generate_	 ù lized_integer(Nø �"""3.3 G2 ) ó variable-length 9 As"""º Gá = bytearray() j‰rwhile 1[ ¯7t =s.   †if N < t)   a ‚.append(2[N]e  !   M „ "s(2 !  B ñt + ((N - t) % (36 )Y DN = " %//# ° bj += 1Baadapt(�À, first, numvU"if ß / r //= 70´Oelse  2u 0 2+= 	 %//c  A# ((Ž-ª1) *¨Ñ) // 2 == 455) €divisionJx £W >( … t B35 #öh S  …W + U7 =  H*Ã 5b + 38)´ÍBias
^º$te·sè Blen,H cÀq4 Bias ’Tation«Öqinitial¦° = 72, damp €00, skewÓ8è Lï é 7ª£for points¢ � in enumŠó µ  ; Šå 	 ñ 2 ¬‰  6 � @.exts>  � ; � 2==0³Blen+ "+19 w6yteDBp0_enS(text* p", ‚ âed = segregate& ¬ X ã Pinser“q_unsort$ ? ˆ M 
ø1lenü)Xõ !if’¶Í  �…+ b"-" +§ • " n ?

# ¯ Decoding   ¯d4 
ptnumber(n ô 2posÒt, errorÆ†$Ï ¦æ †	&ry0 6 ­e = ord¨ w[extpos€except I…E¶ 
D #ifÌ  pŠ"strict"#  k �raise UniPG ò ("incomplete pu ð string")
         ð	return extpos + 1, None
    5= 1 ð if 0x41 <= char µ0x5A: # A-Z'  ? cdigit ( -7   !elI  30A I 539:# C  Å22 # 0x30-26( K úerrors == "strict"I àraise UnicodeE- �("Invalid `ended  Å point '%s'"c  ‹   %; [+E-1])5 Kelse… pl )–T(j, biasE ¢result += N5* wa #if ?< ti 
E 8 ö w = w * (36 - tm jh õ1


def insertion_sort(base,ð ", q)x „"""3.2 I3 0 un5  QRing""Jça= 0x80Œ  u2= -\ ÷ Q = 72 O2 = * Pwhile}  3 ‘< len(extµ‚  žðnewpos, delta = deÑõ_generalized_number= Ñ  4 u  D   ± @  ” !isL V â# There was anD2 inª öing. We can't continue becaus• L Ð# synchroniza¤• is lost.‰  ' à »  B N ¥ +{ + œ0+=  @// (c 8 )""iföª> 0x10FFFFá "ifÕ Š n Ž	 Š Ñacter U+%x" %r ƒ  @  $ ¦ = ord('?'  ¾ Ä %Ã  Ö 0 =  Ð[:pos] + chr(T  î  Upos:]4 ë‘ = adapt(^ , Do Q= 0),“ : )� Ä˜N ’fApuny¦­U(textV\Óif isinstance! 7strù 5 0 =  0.enO ‚("ascii"Ž B ®memoryviewI Qbytesj @ è _ –rfind(b"-[   È¯    
3 = ø  ¯a = str\ $, ¥ r.upper(m 
7J 4 ²: *]h …[pos+1:]6 )p “ïò

### Codec APIs

class (z1cs. 1):
•  K”¥self, inpuã"='®'…eres = = 7 " è ¶ 2res| s O	s Àerrors='strisct'):
  ðif errors not in ('strict', 'replace hignore:  A àraise UnicodeEH Ò("Unsupported[ Â handling "+l )  res = punyB 0_de r(input,> s- Òturn res, len' ð)

class IncrementalEnG  r( >cs. Qdef e, s(self, y ³final=False* í e ­ : 4 † DÍ †  \  † ù † 0if & .J¶Sq ŽÃ ,¤ óStreamWriter(Codec,¢ DpassÛ ORead9  	9 2###Ûðings module API

oÃgetregentry(7 rÞ‘ ž UInfo(«dname='ï %', =3 2().     i·: .r=°/ J 	/ Y/ ssws=G€# r]# P# Q)
"""Ü õ for quoted-printablee�.

This AB de/Î ò s from bytes to	 .T @

im'2 s qquopri
6 3io $ B@ "IO¾# _a -=¾ÖcassertJD ==   ¾Cf = Z G Þg  r Ûb(f, g,
’tabs=True( EØ(g.getvalue()¬)Á Áz Á Sr  Á ± ^Q b OŠ 'D �HTÆœ  Z ± Z "< ‘� ŒdÝ  ê .
æ  Ï ÁD)[0]çz É”   ” è  U ~” À       returð4n quopri_decode(input, self.errors)[0]

class StreamWriter(Codec, c (s. ú):
    charbuffertype = bytesL OReadL  L ó# encodings module API

def getregentry(G dreturn´ Â QInfo(°  ´ bname='%', e "e= _  <   ²incremental9 6r=I E¿ /er/ J 	/ D§/ s“w“=…R # rj# \# ‚_is_textÛ ’ing=False! ð)
""" Python 'raw-uni.‘-escape' I0


òten by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
‘ s
importÌR

###ˆ  fš (­ 1cs. 1):
×°# Note: Bin?ð these as C functions will result in$  
3notF  converting ðm to methods. This  �ntended.4 # =» S.raw_R_R‡e. . 
# Y]   .– (ú#, Rfinal*  $
E¾ L� Õ§ B4.ed" …  ¯ _Z¸	· ¹!, ¿ 4 ¹ I¹ 
G _d_ v 5pas‹ z9  9  ã Ž Û  “='strict'. Ý (è)?K</ V ´ q !e=˜.  ÿ    U�ñ)
#!/usr/bin/env p? ¹JàCharacter Mapp@Ñ for ROT13.

A_B de/" s from strlOstr.yÀm).
"""

impðort codecs

### C Â APIs

class ($ . Ð):
    def en ó(self, input, errors='strict'.  2 óreturn (str.translate(7 ò rot13_map), len 5))
l /del Oó ÁIncrementalEá r  ß ³final=False* 	‚u D�  e  � 0� 1ÑStreamWriter(,™8cs. ‰ 5pasJ ORead9  	9  “d°ings modulež 

â Ãgetregentry(7 c‘ ž QInfo(F {åname='rot-13', e !e=1 2().  L   i1: 'r=µD/ J 	/ Ê/ sqwq=E~# r[# N# ‘_is_text_¢ 2ing–! )þUMap

‰# =ö.make_identity_dict(range(256))2 @.updÓ{X�0x0041:  eh  2 f 3 &50 4 1 5 2 6 3 7 4 8 5 9 6 a 7 b 8 c 9 d a e 4¾ f ¾ #50 ¾ 50¾ 50¾ 504¾ 504¾ 504¾ 504¾ 504¾ 50%4bÑ 50&4c 0%4d 6¾ 6î6¾ 6î6¾ 7î6¾ 706¾ 706¾ 706¾ 706¾ 706¾ 706¾ 706î706î706î706î6¾ î6¾ 7î6¾ 70¾ 70¾ 706¾ 706¾ 706¾ 706¾ ð77: 0x006a,
   0xñ0078: 0x006b,
   #79 c a ðd,
})

### Filter API

def rot13(infile, out	  ):V  ð.write(codecs.en	 2 ò.read(), 'rot-13'))

if __name__ == '__main__'V ¡import syse �  sys.stdin,   ðout)
#
# shift_jis.py: Python Uni‡   C• á for SHIFT_JIS5 ó"Written by Hye-Shik Chang <perky@FreeBSD.org>
#

– _V rcs_jp,   ‘multibyte ’ as mbc

 &= : A.get %('¼ ’')

class² M¿ nY" =x h#ds   P ÁIncrementalE›tr(mbc.M®      · .s.4 ¤   ‰ ‚  Dª ‚   ‚ 4 ‚ 	ÑStreamReader(T,�! Ù. ^  R^ 
! ^  ^  Ãgetregentry(& breturn!s.Î QInfo( ¶ [=[NC=4 #()C 9   iJI .r=	/ J 	/ ¶/ s¤ 08er={# n# @# __2004, ‚š ÿÿÀ():
    retu°rn codecs.C sInfo(
  õname='shift_jis_2004',  en; =9 2().  )de   ²incremental: 6r=I E\ r/ J 	/ Dl / ástreamreader=S R R # Ewrit# W # e)
#
# ý ðx0213.py: Python Unià  ÿ ð  for SHIFT_JISX, ?  Q ð&ten by Hye-Shik Chang <perky@FreeBSD.org>
#

import _[ ccs_jp,  �multibytò ¡c as mbc

1 ' =: A.get (ÃÆ ’')

class¼ (% !):ß’" =} Û }  P Ád(mbc.M³   lp
 — 4 ¤   ‰ ‚  ‚   ‚ 4 ‚ 	m(,¢! Þ. ^  W/er^ ! ^  ^ ódef getregentry(& Oretu#`SH#Ç4"""òCharacter Mapping^ñ tis_620 generated from 'pG"-m- ðs/TIS-620.TXT' with2 äµ.py.

"""#"! cs

###h DAPIswØ¿"f •ó(self,input,errors='strict'ý �
ƒcharmap_B = , µing_table)
o #o )B 	o  o Ò. ç  û½ e¤  h Ã final=False*  Y.S4[0]¤� Vª   €  ª ø ª (ð decode(input,seð)lf.errors,decoding_table)[0]

class StreamWriter(Codec,c (s. º):
    pass9 ORead9  	9 b### enŠ ós module API

def getregentry(7 sreturn ‘ ž QInfo(�  ‘ õ name='tis-620', f !e=2 2().     ²incremental: 6r=I EÂ /er/ J 	/ D{/ srr9=e,R # w•# ¢# @)


L[ Ping TÖ F\æ2 = )`'\x00'/ñ #  0x00 -> NULL0  1 1 õSTART OF HEADING+ 2+ 2+ ETEXT( 3( 3( 0ENDQ 	& 4& 4& µRANSMISSIONT 5. 5. UQUIRY" 6" 6" µACKNOWLEDGE& 7& w7 -> BE8 8 tACKSPACC t"  Q9$ öHORIZONTAL TABULAT» n0 A0 •LINE FEED— b& ¥B$ oVERTICR 8x0c. C. HFORMR r" ¦ D$ æCARRIAGE RETUR[e, | E* †SHIFT OUÓf$ F$ IG 1h1hô DATA LINK ESCAPB(x1t1töDEVICE CONTROL ON- v1v- 4TWOH1{1{- 6HRE\ „1„/ EFOUR] „1„ŸNEGATIVE k 1‘1‘ö SYNCHRONOUS IDLˆ –1–2e BLOCKŽ «1«UCANCEÚ'19´1¨U eMEDIUMI a(  –SUBSTITUT¢ ¡1¡Ô”1”ÆILE SEPARATOFdo ™_GROUP*  ™1™oRECORD+   1 LUNIT)  {  2¦Ý!  ›aEXCLAMÓC MAR�"+ ™LQUOT) #) •£NUMBER SIG@$& ŒHOLLA& %& „ðPERCENT SIGN
    '&'   ð#  0x26 -> AMPERSAND
 0"'"   $ 7$ ‘POSTROPHE% 0'('!   % 8% òLEFT PARENTHESIS+ )+ 9+ ORIGH,  *, A, ‚ASTERISKO +# B# ’PLUS SIGN$ ,$ C$ RCOMMA  -  D  ³HYPHEN-MINUº .' E' ’FULL STOPK /$ F$ TSOLIDF 0"  30" ¢DIGIT ZEROG 1% 1% #ONt2$ 2$ #TWH 3$ 3$ 3HREJ 4& 4& BFOUR“ 5% 5% #IVJ 6% QÝ 2SIXI 7$ Q$ 3EVE´8& R& E-L 9& M& $NI):% FCCOLOk ;  CGSEMI$ <$ C—LESS-THANl=) LXEQUAL’>& K|GREATERR ?, SÃQUESTION MAR
@( 4Y æ’ERCIAL AT4A( \óLATIN CAPITAL LETTER B1 i1 Bb C1 v1 C1 D1 �1 •+'E1 �1 ™F1 ™1 F“ G1 ¦1 G1 H1 ±1 H1 I1 ¼1 I1 J1 È1 J1 K1 Ù1 CL1 æLb M1 îb M1 N1 ù1 �O1 þ1 óP1 51 ³Q1 QÄ R1 ;S1 jT1 ÔU1 ðU
    'V'       ð #  0x56 -> LATIN CAPITAL LETTER V
    'W'   1 71 W1 X1 81 X1 Y1 91 Y1 Z1 A1 Z1 [1 B1 òEFT SQUARE BRACKET. $\\/ ò C. ò REVERSE SOLIDUS* ]) MD* ?IGHY ^/ E/ óCIRCUMFLEX ACCEN… _, F, ‚LOW LINE~ `#  60# YGRAVEJ a' 1' òESMALðAV b/ 2/ B/ c/ 3/ C/ d/ 4/ D/ e/ 5/ f/ Ý	ë F^ g/ Û	/ G/ h/ Ù	/ H/ i/ ×	/ I/ j/ Õ	/ J/ k/ ÓÈ	/ K/ l/ Ô L/ m/ Ù/  M/ n/ Ù/  N/ o/ Ü¼ O/ p/ 7è^  P/ q/ ðQ/ r/ ðR/ s/ ð"t/ ðöu/ ðU� v/ ðËw/ ðÉx/ ðÇy/ ðÅz/ ðÃ{/ ð ÃZCURLYÂ|- î`VERTICàB}( çRÀV  ~. æCTILD~3\x7�87×UDELET! "80D ! 8É’<control>ÓH\x81$ ¾$ 2$ ³$ 3$ ¨À<control>
  �  '\x84'  ð#  0x84 -> <control>
  $ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ a$ A$ b$ B$ c$ C$ d$ D$ e$ E$ f$ F$ '90$ /90$ 1$ 1$ 2$ 2$ 3$ 3$ @9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@9@cufffe'ÙAu0e0+ýA)÷THAI CHARACTER KO KAI0 70 50 YHO KH2 E2 C2 7UATe T3 R3 Wf c3 a3 'ONe q2 o2  wRAKHANG5 ‚5 €5 wNGO NGU1 �1 �1 0CHOn˜ �2 ›2 I– ¬3 ª3 
É »3 ¹3 WSO SOÇ Æ/ Ä/ Ç 'OE2 Ô2 Ò2 JYO YÅ á1 ß1 D)'DAc ï2 í2 †TO PATAK2 1=2 B;2 gHO THAŽ1 B ×THO NANGMONTH11(B( 8 hPHUTHA5 +B+XNO NE� (B(XDO DEÿ à5'   #  0xB5 -þ!> THAI CHARACTER TO TAO
    '\u0e16'   #  0xB6 -0 ‡HO THUNG3 73 73 GAHAN4 84 84 Og 93 93  WNO NUb a/ A/  —BO BAIMAI3 b3 B3  gPO PLA0 c0 C0 KHO P,d3 D3  HFO Fb e/ E/  Pb 	Yf2 F2  a ‰%200 /C00   b XSAMPH%&215 15  GMO MÆ &22/ 2/  fYO YAKX&230 30  XRO RU` 40 40 &25, 5,  XLO LIw2CL] 
C
hWO WAE~CXSO SAs2CSSÔ2C b 	LCgHO HIP¬CiLO CHUÃ C9O A€CˆHO NOKHU@C‡PAIYANNO'3DWSARA s3D¶AI HAN-AKAT-3	D	f g 
D
1 Mb D1 ø D0 1 D1 'UE’ D1 2 D Œv3D0 1 DePHINTH1 Tfffe'Ñ  60e3…D…÷URRENCY SYMBOL BAH 4†E†*4†E†\ÐAE
    '\u0e4ö"2'   #  0xE2 -> THAI CHARACTER SARA O
    '\u0e430 30 §AI MAIMUAN9 49 49 GALAI: 5: 5:  ¨LAKKHANGYA¨ 65 65  ‡MAIYAMOKg 72 72 gTAIKHU3 83 83 ( Ec 90 90 (THÆ a1 A1 R,b1 B1 ‡CHATTAWAÈ c6 C6  ·THANTHAKHAT5 d5 D5  xNIKHAHI2 e2 E2  iYAMAKK5f2 F2  XFONGM1 %501 %F01 —DIGIT ZER[&51* 1* 6ONEè 5"F"S (TWR F) 8HRET F+ GFOUR~ ýFý* (IVT òFò* 7SIXS éFé) 7EVEµ5áFá+ GEIGHÝ5ÜFÜ+ )NIQÕFÕ0ANGÐ	j5ØFØUKHOMUŽ Tfffe'ñ  ó)

### Encoding table
e _ ò	=codecs.charmap_build(de3 $ ð)
""" Python 'undefined' C< 
� QThis L ñ% will always raise a ValueError exception when beingC ð0used. It is intended for use by the site.py file to switch off
ÉÑautomatic stró Po Uni˜ ð coercion.

Writt| òy Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R €s Reserv¿ ÐNO WARRANTY.
8r
imports’8Â APIs

classJ(¨ 1cs. "):YAdef ³àe(self,input,eK0s='ç Qct'):B rõ r%("³J Ving")^ í^ >Ø ±Incremental‡$erå  Å ñ  ò Ã final=False* ï  Àror("undefinðed encoding")

class IncrementalDecoder( >cs. Á):
    def d, ó
(self, input, final=False*  . �raise UniW ïError("undefin‘ ðStreamWriter(Codec,: 8cs. a DpassÊ  0ReaÄ 9   	9 5###às module API

ä Ãgetregentry(7 sreturn ‘ e QInfo( î ename='à %', {!e=4 2().  Q   i§: 'r= E×/er/ J 	/ é/ stwt=H�# r^# Q# ò )
""" Python 'uî‘-escape' õ 0


U òten by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
� s
import¬ 

ìˆ  á5 ò 1):
´°# Note: Bin2ð these as C functions will result in$  W3notF  converting ðm to methods. This  �ntended.4 á# =» .N_N_ * Ü*   0ø  ï o ê	¶ (+ 8 .e_s)[0]£  ¤£ ‡Buffered« " « !_b& _ø 
³ m ¥4  ±
Òµ I µ 
C ´ /°G ŠŽ  <t” Ÿ='strict'Ù +»+÷?ing;: …m 
.: œ_tf-16YÀANTY.

"""
ið	mport codecs, sys

### C � APIs

en # =& ‚.utf_16_ €

def de# û(input, errors='strict'):
    returnE 9 ñ, True)

class IncrementalEŠ  r(m >cs. k  “ ß__init__(self”  ˜ M .C )Í  9  Y .‘r = None
    } ³final=False©  G 9if J !isK 5 !   oresult„xG }A)[0]Œ  =    f ú	ys.byteorder == 'little'k  . J nu $leü +  OelseI bI (ò Ä  ™ ÷ 4  „Qresetƒoï/ C  Ú p äŒgetstatec !#  „ info weúÖto the caller+ò# 0: stream is in natural ©õfor this platform� ÷# 2: endianness hasn't been determined yet3 ð(we're never writingu )unw çr¸0(2 D5elfôª û6 0)ýs,ƒ H  8k     b 
.  D Ð‡»D"»‡BufferedÃ" ( À€W ÔU ËŒË!_b­ _  í#, Óë!, Û»  ’  Ÿ +4 rÙ  
ÄA(out1¥consumed,  U) = \· S   é ‚x” Ž 0‘ 	A &if_  ÿ*-1�  a ðµ ò#lep 	W ,elY X bX ^ >= 2¯ �raise UniEú„("UTF-16R€does not…ðrt with BOM")
        ñreturn (output, consumed)
 3   " ñ self.decoder(in-  ñ errors, final)
8  def reset(# !):  Q  ? òcs.BufferedIncrementalD[ .7 6  E | v = Noneh Œgetstatek Ñ# additional " ñ info from the base class must beZ e here,| ñ# as it isn't passed along toH ecaller1 k /= ë 
º 5[0]D ¼ !we‚ 
z ^÷"# 0: stream is in natural order for this platformq 1: )un< * ð2: endianness hasõbeen determined yet3 9if Â!isi¸  g(?6, 2�1add ò = int((sys.byteÔ Å== "big") !=r  Q  A$isœ¢utf_16_be_Ù)u � „ àsx,bê# €[1] will^¿ignored by X � K5  i� ? &[1h š <Z == 0� I 33= („ 3d o  _ ­6 
 el˜codecs.o l¢:  el^ ½ 1½ N M ² 	  _ ½ 2_p  ã ² 
ã�SÑdWriter‡ u t�__init__ñ  ", £“='strict'1  ì ÖO .E 
•! enB r•Æè  + 9cs.m ) Z 
r á ˆà  Å ¹6 r [”  uresult ³u4 ìd ÿ  9  ^ #Š'little'c  . × m 2le_p  3 (  I 
bI ÏÀresult
     §   else:
  ð$return self.encoder(input, errors)

class StreamRea#  ) 8cs. 1):
Z  def reset(U )o 4  .) =  š 6try5   2del¡  deD ) ðexcept AttributeE± 
; Fpass— @ ˜ ), æ —='strict'° õ(object, consumed, byteorder) = \‰  ¥  š Ócs.utf_16_ex_m 	g µ, 0, False)= &ifW j == -1Ã  F.M : = g #leg N ,elP O bO  :>=2› �raise Uni– ~¡("UTF-16 s.ö
 does not start with BOM"ÿ �mq)

### ”ðings module API

dÃgetregentry(¶L  Ž Õcs.CodecInfo(åname='utf-16', e "e=  u=  ²incremental2 6r=I EE/ J 	/ DÓr/ 9rg=`# cwriter# W # Ó)
""" Python í Q-be' 0


- òten by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
ˆ s
import¸Ôˆ  É2s

BÙ2be_ ì9
™³
ýˆÒ
< e, TrueÛ¿(D k ‚¢ 
Obfinal=ã-œ B $êv4[0]y„ .ž ŽBuffered" ¦ !_b" %fZk p  $ere  W · O  
O 3
 ;„ O  6[ 
B ; Ž h µÀ )
""" Pythoò+n 'utf-16-le' Codec


Written by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ðs Reserved. NO WARRANTY.

"""
import c| bs

###ˆ � APIs

en # =! ².utf_16_le_ €

def de& þ(input, errors='strict'):
    returnH < ñ, True)

class IncrementalE�  r(p >cs. n  – ¢ s(self, œ ³final=False* œ 	B <  I .Ý O)[0]ž  Dž ‡Buffered¦ " | !_b" _f k `Stream ee  W · O  
O LReadO  O „ O  6[ °ings moduleAÃgetregentry(S 
ùQInfo(* ’Wname=, h "e=  ‹ =  i;2 'r=ŽN/ J 	/ ½/ s�rA=‰:# cwriter# À# )…SPytho$32
ŸO, sy¤/32¡0#32š
Úž3ƒ__init__ X5 ë.C )*°1� = None
 9if J !isK Ö ¡   jresult$„?G A 9   f ú	ys.byteorder == 'little'k  2 J Û # �'32� +  OelseI bæE   ¼ò P ™ ÷ 4  „Qreset  I Ì ¦./ C  . p äŒgetstatec !#  „ info we›Öto the caller+R# 0: êò  is in natural ©õfor this platform� ð# 2: endianness hasn't been deter³mined yet
  õ# (we're never writing in unnatural order)3 ñreturn (2 if self.encoder is None else 0)
3  de& ptstate(/ !,  !):  ˆ  H       , [ =Z 2  b 
.  D qys.byte° Ê == 'little'* \   ¿ Òcs.utf_32_le_Ò o  3 s   ¥ 
I bI ð
class IncrementalDe,  r( ¾cs.Buffered" ( Gƒ__init__Gó errors='strict')  – U .K ä× d£  |‡ b­ _  � rinput, ” w, final’  Ÿ +4 +
šA(outF ¥consumed, ÐQ) = \ƒ  á  é ¹$ex” Ž 0‘ 	A &if_  /*-1�  e 	
p #lep 	W ,elY X bX ^ >= 4¯ �raise Uni© E ð	("UTF-32 stream does not…Ært with BOM"ü ÷ ä‘& "  (v 
	Qreset4 ® 
.7 mh Q¥'gesk À# additionalòte info from the base ¯qmust be{e here,| ñ# as it isn't passed along toH ecaller1 ô? = ë 
º 5[0]D ¼ !we‚ 
z D# 0:ÿ isÜ	Ú÷ for this platformq 1: * ð2: endianness has®been deter{g(?6, 2�1add œ = int((sþ•"big") !=¥  Ú †.A$isœN†)u � „ ë#t€[1] will^¿ignored by $.sÐ� Kðsetstate(self, sstate)
  s 1 =  5[1] "if e == 0:  7 ðself.decoder = (	 Òcs.utf_32_be_ 	4  8   _ ‘ys.byteorH = "big"6 
Zelse o lo Ô  el^ Ù ?= 1½ N ‡ 
 _ ½ 2,½ /se² 
ô	None

class StreamWriter‡ )J Ðdef __init__(¾1, s: ó, errors='strict'1  ª ( 0.enn æw       8cs.k .a 
!)
Q ‰ Qreset† m Q ) =  y •   Z ­ [ , inputà 	 Å É6 Pr is ä 2 l   ‹result =u4 (d Ã 9  ^ #Š'little'c  . × Q2le_p é  /    I bI rreturn ê c _ ( « 	–LRead– /):4 .:tryAdel ¡ ‚ðexcept AttributeEö
; Fpass— @ Kõ(object, consumed, ÙU) = \W º
Þ#ex/
M—, 0, Fals¬&ifW  —-Û²Ù&§  P O ¹Ú O  :>=4^�raise Uniý ~ƒ("UTF-32Š� does notvÆrt with BOM"W�mq)

### $ðings module API

Ãgetregentry(tL  Ž Õcs.CodecInfo(Ï åname='utf-32', e "e=  /=  ²incremental2 6r=I E\/ J 	/ Dq/ Ãrg=‹,# àwriter=StreamWñriter,
    )
"""
Python 'utf-32-be' Codec €import c bs

### � APIs

en # =! ².utf_32_be_ €

def de& ñ
(input, errors='strict'):Œ nreturnH < ñ, True)

class IncrementalE�  r(p >cs. n  – ¢ s(self, œ ³final=False*  (œ B <  I .Ý O)[0]ž  Dž ‡Buffered¦ " | !_b" _f k qStreamWâ W · O  
O UReade´ O  O „ O  6[ °ings moduleAÃgetregentry(S 
qŽQInfo(* ’Wname=²Ð  h "e=  ‹ =  i;2 'r=ŽN/ J 	/ ½/ s�rA=:# w³# À# ¢l¢0l¢4#lež
Þ¢rä œ ¢^
Sâ¢Ñ 
O Ž
O  O¬¢ž  Ø¢C2le'Ð¢Ä D7@
èðten by Brian Quinlan (b ÿ @sweetapp.com).p%7lÀ'strict'):
 ð
   return codecs.utf_7_de ð(input, errors, True)

class IncrementalEn.  r( >cs. Á):
    def e, s(self, ` ³final=False*  . ˜ > 8  E .� O)[0]š  DÈ š ‡Buffered¢ " x !_b"  / =g µStreamWritea  S ³ K  
K LReadK  K –K  R

###^ðings module API

xÃgetregentry(O 
aC QInfo(¬ ‚Õname='utf-7', » =  ‡ =  i'2 'r=~:/ J 	/ ­/ s„r9=}2# w§# ´# Ñ)
""" Python ì 18' 0


) òten by Marc-Andre Lemburg (mal@l ð.com).

(c) Copyright CNRI, All R ð
s Reserved. NO WARRANTY.
„ s
importrÏˆ  Ä2s

>
ý"8_ ã1
µŸ='strict'ô í8í
8 íoÜ ˜ í[
¢ ¢ _�¥9§3 K ÎK  m í@8íÙD-sigñõ-This work similar to UTF-8 with the following changes:

* On{/k   a; §ñ	ed BOM will be prepended.  c as_ ó
  first three bytes.a û@ing/ï a  if3 1 _ are ~  ,/ ð se
  bytes willð be skipped.
"""
import codecs

### C Ð APIs

def en ð(input, errors='strict'):
    return (* Ócs.BOM_UTF8 +Z .utf_8_K Q)[0],E  I   2lenn "))‚  deX  ‚ ¡prefix = 0L 1if ± t[:3] ==‡ ™ ¶  m & # =. 13:]?   R 3 A(out¥consumed) W Þ § q, True)B %I +j ñ)

class IncrementalE|rX € ¨ß__init__(self' Ù  M>cs.M .C ½  9  Y ±.first = 1
Õ  z ×  ,IÓ, final=False¤  B 0if & E …   Å    9¸ ÄA + \ƒ  #  ' ”› æ,| Â w> JelseŽ 
s L M  Qreset…ù • t / C  Ê 	iŒgetstate^ ® 7 œs3 !, ? ˜ 3 " = † D€†‡BufferedÍ " Y  K7 ì U –%!_b¨ _— ê ž¦¶  �  6if ™J < 31> Î ².startswith¿l  2  õ$# not enough data to decide if this really is a BOM-D   ÿ# => try again on the next call4 =f("", 0í O        RÊ²5 1  P ´ -  — 2 ŸÐD[3:]4.
Å3;Rm i j  6_H "7 K  ë mÀt = 1

    dóef getstate(self):
   ð = codecs.BufferedIncrementalDe *r.B A !# C õ+[1] must be 0 here, as it isn't passed along to the callerJ ‚return (P @0], ¬ �.first)
' Xdef sÊ ,~ Ñ � @will� ¿ignored by à X )k    ù 5  « � @   À " =© ó	[1]

class StreamWriter(j  Ô  ó \resetº3  .) … 6tryï Ö 2delZ enD ) úexcept AttributeError;  ÆŠ@ ˜  , input, e5 £s='strict'Å  w 3 pbutf_8_ ‰ 	 (Y )>LRead> y >3 >dµ >@ >bif lenZ) < 3™%ifÂóOM_UTF8.startswith6 
2  “ð# not enough datašõdecide if this is a BOMé  9   ñ# => try again onÔAnextÙ0 Öf("", 0dBelif=f[:3] =‹É 
· F;F 	x A(out—Ÿconsumed)5 "R[3:],Á   ë » N &+3( °# (else) no/  pŒ%nt� ¹ n  œ2cs."Ü § eq)

### 'ðings module API

ùÃgetregentry(
\ CõUInfo(§ õname='utf-8-sig', h "e=  š =  iA2 'r=TEzr/ J 	/ ƒ/ s<rþ=5Ä# w_# l# ñ)
"""Python 'uu_n!' õ - UU content transferi@.

T3 B de/á Às from bytesH	 0.

v 0ten~ò
Marc-Andre Lemburg (mal@l ò.com). Some details were
adapteda ðuu.py which was ã ` ð	Lance Ellinghouse and
moô,dified by Jack Jansen and Fredrik Lundh.
"""

import codecs óbinascii
from io & àBytesIO

### C3 ð APIs

def uu_enH ó4(input, errors='strict', filename='<data>', mode=0o666):
    assert< D == ?   inD 3 = Š k ) ;out  rread = ; . / ƒwrite = 7 . 
 ñ# Remove newline chars  c  Ä )  % =Ü ò.replace('\n','\\n'‡ , r, 4r')‚ EKf š ð(('begin %o %s\n' % (>† & 0o777_3)).‰'Æ"')‚ €chunk = 2(45 @whilá 2unk� …r �.b2a_uu(@ L  &  P  W‘(b' \nendþ Å „return (oó getvalue(), lenÉ)K/deK,Jò	0  Å 4âFind start of ‚ d é< i1es; ^ (� V†if not s)   praise V2EW±('Missing " " G A in }w y ? €if s[:5]QbI'a Tbreak}D}· FTrue0 º R or sj :  Œ j  
   :try  15 = }0a2b}s"fexcept" Z as vJ ò# Workaround for broken uu� rs%/ô  ˜    nbðù = (((s[0]-32) & 63) * 4 + 5) // 35 À "[:O ]É  d ²#sys.stderrƒ¡("Warning:è—" % str(vy‡(i L 3/šTruncated!» œRclassù(Ÿ1cs.� [b(self,k 	.  þ z ; W W 8 ‰ 2)

É ²IncrementalorÖ  µ  Œ ã ³final=False* ß 	 Ç .O)[0]�  ‚�  f  � ð decode(self, inóput, final=False):
  ñreturn uu_decode(in. ðself.errors)[0]

class StreamWriter(Codec, 7 8cs. a úcharbuffertype = bytesL OReadL  L ó### encodings module API

def getregentry(I ò ¶ Ä UInfo(¥name='uu', a Re=uu_
  6  
  ²incremental5 6r=I E³ /er/ J 	/ D�/ s‰r=={/R # w¬# ¹# ‚_is_text× 2ing ! ñ)
"""Python 'zlib_4!' 40 -  Å compressionˆr.

ThisB de/bs from2 to	 0.

– òten by Marc-Andre Lemburg (mal@l `.com).˜ ‚

importd s “ 6# t~ òneeds the optional¸ m*0!

BÓ BAPIs8 H “='strict'Nrassert  D ==   <l(O  ¼ *cc), len )v þ ,Y v ( O ¢S x Ø (à!s. à  E¾(#,  ñ ˜  Uô  ó B) X  › /deX !: 	Œ )XfÙ  æ ƒ__init__� á ó  *=# =Ãö  6Qobj =‘aobj()
/  %}Ë"ifäÝ o Ac = � s l m  -   À>c +8 bflush(Â , Jelseo > r s  à QresettŒ X ? $¼Ö'ð  d  y ðZ ±†ò	 ô  ôÀself.decompr÷essobj.decompress(input)
  ÷ return c + self.  < fflush(2 _else:@ <  x 9  def reset(4 )N   
 z = zlib ð()

class StreamWriter(Codec, c (s. c úcharbuffertype = bytesL OReadL  L ð### encodings module API

ö Ãgetregentry(I ~¶ Ä QInfo(* ¦`name='%', c  e= _   vd   ²incremental7 6r=I E¹ /er/ J 	/  Del/ s�rC=�5R # w²# ¿# ‚_is_textÙ ’ing=False! ð)
import sys
from Ì#s  ðMappingProxyType, DynamicC0õAttribute


__all__ = [V—'EnumMetaj p', 'Int   @Flag 2Int B @auto guniqueH "]
 Þ ãdescriptor(obj	1"""G R�ös True if obj is a 6 !, ± otherwise.: B SC Gahasattq ñ , '__get__') or<  #   ' s' `deleteQ 	N )ô  unY Îñ Qa __d. 0__ 0 ï !@len(< ™) > 4 and˜   q[:2] ==b A[-2: O'__'. 2] != ' $-3  	i sÓ • ó°ò2a _- ÿ 32Ñ 0ñ 
!-1 Ý 1+þ 
 2:D # Àprivate(cls_w ,{ò# do not use `re` as Ú�s `enum`] €pattern � %s³'% W ­`pat_le%  3  :if  "  “  .8 i    1and­ É.startswith(R  %   ) [F : !+1]['_']Z [A1 orn %[-u¸  b 0  è )T ›À        retuñ$rn False

def _make_class_unpicklable(cls):
    """ ñ Make the given 3 E un-4 .' / ] óbreak_on_call_reduce(self, protoc  g ñraise TypeError('%r cannot be e `ed' % ? )k Scls._V Ÿ_ex__ = _s . amodule+ ò'<unknown>'

_auto_null = object()
å   
ó)Instances are replaced with an appropriate value in Enum6jsuites0( &= ‰ #

€ _; “Dict(dict4hpTrack e] ó	member order and ensure  3nam±  U�reused.
 a ÂMeta will usé1 PfoundÁ  y"._M _  asC  ‚ yerationq 
æ q_init__	Î  ”super()._  æ ;elf{ A= []y   Qlast_H/s   oignore  á£Ded = X ¯ ssetitem² b, key,Ø¾ � 7 PChangl€nything q±dundered or Ãa descriptor‡ <  IfB NG0 is—�d twice,#  '  :Åd; duplicate ¤ ‚ ™checked fq qSingle ž  sc"!(s #) åã@serv0 ¤   ð Òif _is_privatáQ._cls&0) = õ import warnings±    .	 (     "j P vari¯âs, such as %r,Æðbe normal attributesÇB3.11Ò K  1% (ß/),z aDeprecæW½ ( Ïstacklevel=2" Ý>u ~ -fr4?in !'_öô_', '_create_pseudo±'‡ P'_gen¸Se_nex?G rmissing =_F ²  U–  VþÑ#s_3P Œ@ fut§ … å' I iÿ ?== ¬ › +  !# ë3 ifDðs already defined* ö(l  A !ifc.‰ ¹.edc  * ã ³"LA musÄ{ 0beffI.s"‚ 0set³  Ð¢ '�	¦(el-³ð :
             ÿ   if isinstance(value, str):
   ! 1 =  ý
.replace(',',' ').split(); OelseQ Blist > Äself._ignore| c Äalready = seJ ! & @ Îmember_namesd 3if B ¨ praise V mError(� .'® ô_ cannot specifyd  —  Š _: %r'L 
3% (š ., ¸ v  ûelif _is_dunder(keyÑþif key == '__order__'û $ # '" © a   >in _
H ù# descriptor overwriting an enum?ÿ iBTypehð'Attempted to reuseº 8  % ÷ 	– 5
� Epasss É  ¢.¨ ‹
9 4ó 
  ˆ#Ï 
ã ü 
è  1 ì %%r"¤defined asë  Æ,nf[key])ø  L ÉKautoù, Á  _* ^_null×  2 ) . b ‘ágenerate_next_ Ekey,y V  1 Nlen(m)5 1 3las£ Os[:]2 
X¤ H 'Ýcalled = TrueÑ 	§3	$ I Žp.appendà
| + ¼ * d , ðsuper().__setitem__M ,§²)


# Dummy Á for Enum as ñMeta explicitly checks' ö
it, but of course
# until9 Ðfinishes runnØð the first time  n ðclass doesn't exist.
# This is also why1 dre are‰ &inn �like `if  7  ½aNone`
e  =  "

m    Þ S(type
1"""‘  &   @ amethod ñ
def __prepare__(metacls,  Óbases, **kwdsj  <#Å â that previous)  Å j  8 ^ !._�Q_for_! Cing_9 (y r# creatwc‘pace dict\ À    enum_dicót = _EnumDict()
  õ
enum_dict._cls_name = cls" õ,# inherit previous flags and _generate_next_value_ functionD ðmember_type, first_y ö = metacls._get_mixins_(cls, bases© (if9 Åis not None:f  Ó  W Ð /['œ Ù'] = getattr(:  >   Ÿ /, D ,y ,? ² ureturn ’ 
0 Ãdef __new__(ý ,pñ   0ass’–, **kwds)â P# an Æñ class is final oncej  �ñion items have been defined; it‡  ê P# canGðbe mixed with other ¬ðs (int, float, etc.) if it haK %$edÞ Õ unless a new $is‹ ÷ (or the resultingN ß ¶will fail). 
 õ remove any keys listed in _ignore_- Q  VÔ.setdefault('' ×', []).append ÍP Ÿ[> ]g 0for‹  ƒ 2 ¼ r† rpop(keyJg )0]P, sav—¸w, use_argspAfind‡¦ /, � û)Þ å #z Ž‡�into sepa*° mapping soÿpy don't”A bak¿%toQ#$ B–  Vž  × 2{k: ãA[k] ‰ ‡7   "._/ ä%s}J  * ÷&inC 
- 
Å6del) [; ]ý aadjust· fsunderKx_order_F.	' '� q# checkÏ rillegalY w 0s (û°&s?Erinvalidé x = set(0æ) & {'mro', ''
 Ú; 
÷ praise Vâ‚Error('I- ‘ ] ˜ Þ: {0}'.format_™','.join(¨ )))C€create a. ¬p docstr8aif one‚½µen provided9Áif '__doc__'+Þ
Ù "[2  %"'A¼R&.'åM7  ^super().xÕª M 
u ' []Q #asÙÒig WQ Às._member_maŒp_ = {}  ô# name->value map
" ðenum_class._member_typeH  
0 ð # save DynamicC9 ´Attribute a
 Ñs from super ^ ×es so we knowN  if òcan take the shortcut of storing Œ As in# S U dictK d’ _„ 5= { ð pk for cI û ]mro(),  * @k, v- @c.__p �__.items/  ÿif isinstance(v,%g }^�Reverse ª ->· °¶ shashabl %s.± Ê _9 203_mac ÀIf a custom ìá is mixed into`ñEnum, and it does not») h¿óto pickle itself, ô.dumps will succeed but Bload Ä ð# fail.  Rather than hl Perror¡w up laterŸ Èpossibly farK  ~ 8 ò source, sabotaga² �protocol\Bthisª7 soJ 5tha¶ Ô Aalso¬ �#2 0HowÄA, ifL3newY  implements.ð own __reduce_ex__, doiM ¸ ‘-- it's o`m to m10sur|÷
 works correctly.  We useL 	l  ©0eade0any  0o|0s a¢  ppreferr¾yK BFoverÃ _2³handles allò m5Iif '” 'ý m W n:t  À#if£ Ÿ  –jobject*  . ñ	methods = ('__getnewargsk ',|  9_',l  B  ¦ ; ·._'Ð!ifÈ Pany(mÎ Œ kEt § )Á   $`new__'L ù +  Q# too#÷Û _E_V 1_un× b(Rà  i Oelse²   p# final@empt­`verifyÖO ÖQwould»L 	ñtravel mro until __ Àfound, checkR &fo Š  #«=`friend§1ong¬@way j&f m=a# are ƒ ° before/wheÕ  Y    shó R  È S= NonÜÀ              òfor chain in bases:
   0  '  / 8 �.__mro__7  M !ifa ¯ is object3  7 �continue— 
 )  elif any(m�  ¥  .__dict__ ·  �methods)| ÿ# found one, we're good‹  � ÿ sabotage = FalsÀ  5 _break_ ê �'__new__'î Ü ?notÏ "/TrŽÎ 5if (0is ’ ONoneÂ )W K ò_make_class_unpicklable(enum )Žñ# instantiate them, checkingað duplicates as w,= )we@ Qfirst oead ofK ) 7 caE³# a custom  X doŒ  soæ 
  funky with° ÷ values -- such asŸ °auto-number: ;ø <e @_namÆ  1 [6._m ;n 1 = L' "s[ I ]~ a    ifþ"ise1ce(@ , tuple° targs = ' °  N ?elsE 3 Y } ™ @typeJv Ñ:   # special€è × A u   c ( 0, )   # wrap itHš more timÿ @use_; ¶F$ =ô¨t Rrhasattr+ æ A, '_/_'Y  @ n .+ " =@	9h> ¬ 0, *å 
³ w ³ "2if Þ _Äf§ å 
 š   í     N “ (õ  †
$‹ 
h �L .=4_ =ï  •- A_obj¯ð __ = enum_class'
  ùenum_member.__init__(*args)( Ò# If another 0 ð with the same value was already defined,$ M 4newF ðbecomes an alias to1 é existing one.? ófor name, canonicalÃ A in Ò cclass. é_map_.items():K  
-ifH !._Î B_ ==P ò  D  H y ) - =S w  3 Ybreak Nelse_ 0# Að es don't appearî p  ps (only _ú Js__)< v © 
"@  _.X 2nd(U _ ðperformance boost Ž4anyÏùthat would not shadowã À# a DynamicC§™Attribute& #ifR ‡ L Bin d8 $_a4 s-0set (ç ,K ,Òß pnow add„C=	š X 	a[6)] 8	? >try´ ó# This may fail ifP!isû Àhashable. We[  § hx	b  ä#Ã  œÁmap, and by-Õ� lookups¹tv  jwill b…J olinearHD 2 p[ 		þexcept TypeErrorUpass
Û ñ # double check iAreprÞ ±friends are1û ÷ixin's or variousL qthings ‚ö (such as pickle # however,“U „ethod isß p  ÃEnum itself,§freplacSE# itƒ  8 b @ @('__Ë ´__', '__str nt Ëreduce_ex__'Ë!if O ÜNdictSvcontinu”  ã0 "_mÚ ?= gA  ª  5 >obj3 Qtype,� W, NonQ : An `first_ : 7if w  a 
 Õ % ä  æ)}Í ìr__new__ðour own (as longNÂ ¦ ,ý#G Ðway) -- again& isX£to support�6 <if S 
Ú #¦Euser¡ð their own __newñ__, save it befor
 ggets
  ù# clobbered in case they subclass later4 !ifZ Y_new:  X Qenum_:  ._" Â_member__ =  _4 0  ) CEnum? %_
/ ð$# py3 support for definition order (helps keep py2/1 @codeÜ Usync)M Aif _4 Ú_ is not NoneÐ ãif isinstance(/ j, str))  ù   ç X ö
.replace(',', ' ').split(…  8 ‰ 8!= :nnames_q òraise TypeError('0 
2doe× Tmatchì &')Ogreturnr  ÷def __bool__(selfì 5"""Aäões/types should always be True.- 9 x  ! r 0calr Ácls, value, ú =˜³, *, module @qual    †  start=1· rEither … âs an existing @ñ, or creates a new# ð .²  ¸°This methodBáused both whenX 2num6    0giv Û A to ˜!$to3 1eraÑŽ ñ (i.e. Color(3)) andû€the func, eal APIL 3 0 = L!('A 'S÷'RED GREEN BLUE'))Ù WÀ Ï  ch :`©`` willõ -  •0 ofF=8`! $s`2Bbe e“aY ˆòof white-space/comma delimitedí ƒ sƒ ûQ at `
 !`)ÍPan itWsor/mappd  ˆ kg pairs!`ml¦ 0set· ã    tß  á beX 9 L;£  Gt#  f@set,ëaattempS “find thatâÌ ö be made, but ifN qt failsa~  ] Èbe picklableÎ -Ð ¢actual loc{Ù 0canÙUfoundƒ  atP3its± @; byŒ@aultp7is .ðglobal scope.  IFis i‰ » ±correct, unÃ  MØ  í  o ²some circum‘	°  0`, › a:  B"ixÙa0pfirst bæ;¢"ife ´ ~³:  # simpleÀelookup RD clsº(Ìó0# o�[wise,Ár: we're}  ~ Á à o k qð_(
               › value,
  ^names rmodule=  @qual: =	 # Ptype=  astart=  !)
¤ ñdef __contains__(cls, obj):   Ç ÷if not isinstance(obj, Enum& * åmport warningsB    .	 (     ‰"in 3.12’ ò will no longer raise TypeError, but$ ÿreturn True if\n"e õobj is a member or "'sÀ"0   ÂDeprecationWã ( Ïstacklevel=2" )› Ó `"unsup\°ed operand õð(s) for 'in': '%s'   	 N" % J  Ç 9  ã4.__Yù__, cls.__class__ )° eAcls){ Pobj._´B_ inS hX_map_utdelattrt  O�# nicer eåð message when someone tries to delete an E Uibute`õ# (see issue19025). !if1 © þ 2¡AAttr] y�("%s: can‚  W.€R_C¦super().__ ¹ 	“ diGself}×%['¹²', '__doc__ s sE__'] ã    + p "._2 Æ-s_& 	§ 0get» Å ë ° &""„Ržƒthe enum'° matching `< `! � •We use __c  €ðead of descriptorsÁ`insertG Tinto e ¼ Õ‘' __dict_›Porder>Z� Å`Æ@` beS EbothJ  pr€tz yË Ðs (which liveT † y $L 	= ¦themselves¡@àif _is_dunder(-i 1¥( q ;tryÙ•¨ö §[7  ¡except KeyúC � @ ²) from NoneÖlgetitem2â‘ É G 0ite! x� 0pshs‘`defini¿ þiƒ  
o ß  Q § Àember_names_ñ	)

    def __len__(cls):    return len ó ._member_names_> ‘@property6 L ( sP 1"""&  \ R\ ò s a mapping of 9  a ‚->value.¤  2 EThis- ãlists all enum9 �s, includO õaliases. Note that this� i| àread-only viewƒ Äthe internaln .5 Â M¿ ™ProxyType+4map)MreprJ !"<Ì Á%r>" % cls._l"__B mversedF œ ^Qqs in re8  ïßinition orderÝ 
Í [œQ] for¦Y d,  ' 3s_)%º csetattÿ ,@ !, ætÆ ÷Block attempts to reassign Eö$’A simple ' @ment7  ÕQclassu aspace ö³changes oneýës0ñ al possible way„ Yget a‚ ` from e — j ,I `result“ in9 �inconsist�  1 0era�‰Âc_map =Ädict__.get('” ie', {})x !ifî  £E Ý Söraise AttributeError('Cannotl> 6s.'\ ¦super().__Õ óÐ±acreate[!, Õ ðs, *, module=None, qualK  4typ start=1-ðConvenience methodú~ b a new5ƒ 3`m ¢s` can be:º  p* A str¹pcontain Zðs, separated either with saEs orŒÀ  commas.  V×@s arh0cre¤red by 1H`è ` * An itera‡
'R 4(× Äi pairs‡  ,2 2 ->È3 ÍumetaclsÆˆ%__#b®0 = Gp, ) if ü@ is p else (  GsŒ‘_, first_>%£get_mixinsz_ 5 ~  I  =. š P.__prÐe[3ass©; ª p# speci`rocesseneeded%s?/ áif isinstance(n,YÈ o " =Zö
.replace(',', ' ').split(Â W €(tuple, b)) andP 
 ðisinstance(namesÇ[0], str):
  ñoriginal_names,  " = I, []. Ülast_values = ’for countF ê in enumerate(h …  � V � = first_9 Q._gen> C_nexx  _(¢  Ê Dart,p ˜ I[:])´  ]   �.append(p *  ^ s$ l + %)
W b# Hereç ùs is either an iterable of ? å or a mapping.K  5@item.| 
Ÿàif isinstance()  û Å ã amemberÇ#,  ¹   =• m® [D 
ÕJelsev P Â  - £classdict[z  Ë 9] =‰ 2  Ý_3 " ñtacls.__new__(me !, ! Ð 0bas�  g 	Œñ&TODO: replace the frame hack if a blessed way to know( ucalling™ �# moduleÓÕver developed# 'if$ ;Non:?tryK U P= sysÕt  ñ(2).f_globals['_ë ;__'�ð	xcept (AttributeError, V… 1Key
 V Opass¼ R_make˜€_unpicklÊ(¯/4& A.__mò  __à „ @qual  fNnot F	L / N  ŒRreturj¼  ódef _convert_(clÛ,¾ð, filter, source=… @5"""³ ñCreate a new Enum sub‹T thatzàs a collection Ü1 coÀt‰^ #   ¦ @ all  ìsts from� C (or¸ )s  ×Â U() to¬ #§  ß!edËÁ, and exportû c 3its¦0s b2	N É;` Dlso,ô K ó	__reduce_ex__ method so DÇing works inH öprevious Python version%{ !€ = vars(C "s[ ï#if2
„ãB ñË	0 a ƒ ½ 2í@map_Í�populatedÍ ˆs‡÷order every timeG  ý 5pnsistenK e' E nuØ ·4@whenvrH Áare multipleï s [ Ðthe same numbSer.
  µmembers = [  í (name, value) Gfor ! þ in source.items(2 ‘if filterY %)]S Etry:  ~ ’# sort by} 	 ² ." ö(key=lambda t: (t[1], t[0]) üexcept TypeErrork ²unless someo ðs aren't comparable,ß ¥which caseŸ  ž — -  clu1cls#, × ’, module= Æ ÷cls.__reduce_ex__ =  9by_Œ ? ò_globals.update(E k &__^ 
/ [K u] = cls± areturn  Ñ@staticmethod ó	def _check_for_existing_p a(class§ †, bases)‹ NPchaini          ( Š.__mro__'  + �if issubo (5 ±, Enum) andy .“ Œ sC   G Vraise6(ã    ÿ"%s: cannot extend enumeration %r"? 
-% !._ž ¥y !)
Y �½get_mixins_a ~&""  Rè°s the type {@creaÌÖ ¬ Q ( âfirst inherite ®   ˆ.¨    ’"s:` quple of– s ñat was given to __new__ä  < © 0if oO "  & «bobjectý ¦ find_data_ã % E   ¨;setÑ± C Pcandiyy = None¥  !  E  À Ö / i)B is Ü ý '   ~continus   /el$R } < 9_‹  …�  v QA.addt
M � /  ]breakB & Ï '+'L T.__dict" 5     7 \
 ! ê !orêé å 	/se�c =‡vo ð
            if ûlen(data_types) > 1:
  ðraise TypeError('%r: too many ?  ? ñ: %r' % (class_name, ^ )Z Gelif w  Weturn# \.pop(E /se: UNone
t ñ# ensure final parent « ð is an Enum derivative,*  d ä ‡concreteM ÷ ò, and check thatG åhas no members8 pfirst_ei µ= bases[-1] Áif not issubš (1 ,Y )î ›P"new _ õerations should be created as "r ë "`±Name([mixin¸€, ...] [ñ  ]b  6)`"‘í  • = _find_6 (î µ) or objectƒ 6if æ #._F  >/s_î 0Can0aextend– ø — rHX  ª Úˆ!Ñ@staticmethodš 3defÃ Bnew_ÓSdict,Ôç I š&""aR~ €s the __L @_ to�‚used for™1ing$  ½c "s.�  ¤ € :&    Àionary givenY d Ä  9 ÷ ;  ’°V whos• Ewill— –by defaul§¤:j t ý Ë  an overridÐ Œ R# nowb tcorrect#,Q E ðto see of one wasš 2ine§ ã A# by¢user; also? � earlier° ëÄes in case am  U 0R# sav&¿ A_"  2_ =R  …c.get(' 0', z)½#†"  gf u later?m  '  6 Q   __­ õ d c %ifÎ !is€ 
;#Ñall possibles~” æ P befo%0all~ ba×o� p4    ÿ@ bX 5',  * 9    = — ? 8 ®;   ? ôtarget = getattr(L  ® Ó“ -  3if @  WIin {î /  x," .#* 
,  œ* }ûÁ ð__new__ = target/
  ]break ýif __new__ is not None:(  U B ?els,  Q “= object. 
V º# if a non-#  … ÷used then whatever value/tuple wasH `assign1 o4 ñ enum member name will be pasX oð Qand t6 P 8newD µ's __init__% 
3
À 
9õuse_args = FalseC 8+ 6Tru* dreturn´ `, save°$, 2 ñ


class Enum(meta = RMeta)” 1""" qGenericå ‚eration.™ñDerive from this H  #tdefine 7 !s.Q Y %deKR(cls,µ~  ?Q# allx ó instances are actually created during€ €construcª q L Àwithout call- ² rmethod;¿   R $ Qed by##'O  __% ð__ (i.e. Color(3) ), (†by pickl™�if type(›)f "lsk ¡   ó# For lookups likeX ^ U.RED)‚  0 ìR  Q# by- ð search for a matchù ò5 0seedqit's inø rKpse mapp9 (I ‚hashable®s‘ :tryÎ ž Qcls._� 2ga_map_[ ]� ú except KeyErrorJ ò# Not found, no neÀÃdo long O(n)í Q    Ã b OTypec  ËPtherec $w \ D"--f …behaviorW  h  Ü  ;ñ  ë .ë 's(Ú 5   #if{"B_ ==Y
 ,   S] ƒ @# stµ Â %ö -- try _missing_ hooËªQexc =ÈT n rsult = Ò L Á* XEÁ{ion as ä` 	]  ?M › Tif isþ0(re’ ,‘ N % S  m ?  2ve_š V.@("%r› KaŠ’id %s" % ÷ { p.__qual.6__) T   2if „  J  ß  k !isfÝRaise • 	¾  T _elif C  ! %= ã(G  K ð         'error ÿ4in %s._missing_: returned %r instead of None or a valid member'
    ÿ	% (cls.__name__, result)5 
 �if not is� ÿance(exc, ValueError):R ý	exc.__context__ = ve_exc- hraise  zfinallyX ð# ensure all variables that could hold anK ùeption are destroyedy Qexc =W	 £   ð def _generate_nÍ vü  _(X€, start,ƒ ‘nt, last_  s1"""L  ¬GK P the O  Óque whenjugiven.
1  g :. 0ame : % † & rinitial™ ] *orì Rcount/  nuK W ƒexisting^s] Õ 3   Y Passig°b ó 7forÐ in reversed(K 0 (+tr  M 5+ 1¨  " ¢except Typž
E " 6pasÛ Jelse# c Q…²@classmethoE´ e,òF  ¸E 4 Î_repr__(self- ù"<%s.%s: %r>" % (Ù  »  8  U � '__Û  *2_,  …(_)~ /st} | w @ _ö f 	X /diX  RÖs»¹Qs and rpublic _™? ýadded_behavior = [m  u0clsnÑ Nmro(è 0 m. 5mdict__V áif m[0] != '_'Å m¶#inxà N_map> u] + [m k ™ l  \ ]| LD(['_•²', '__doc__ �module__'c 
0	«cformatƒ,Š   Gspec�|»9   u¨` actua†ñlue type unless __dð has been overriddÒ Â  _ ñ# mixed-in Enums shÌ1useó  f 'a ‰  Ð•otherwise*ó# we can get strange÷as withT  i  , m wñ'upmN  iHF ½ 0# p…D pbranch,™ d §explicitlyà
        str_oôverridden = type(self).__str__ not in (Enum d, Flag 3)
  0if = �._member_O ð _ is object or U os :;  B Pcls =" 	 2val ™  õ # mix-in branch OelseX :elfš 3  } g % evalue_ óreturn cls.__format__(val,  aspec)
1 Âdef __hash__² � I    y._name_: “reduce_ex? �, proto)F j£_class__, R ¼ #, U  # DynamicC( �Attribute•pused to` °vide access Pthe `› Q` and× 1# `Z `/ òperties of enum ïós while keeping some measure ofG  Î ðection from modifica ,B °still allowI afor ank !er) L `to have  o s ³ dº ´ ÿ.  This works becauseP  È 1areøðset directly on ñ u± -- __getat*#is— Y@look4 Rm up.@Ž8  9 Á Èïa"""TheÜ  q „  ŒuA."""?  Ä` L _v Ùw  x 2 B_


%0Int¯ `(int, 
 Û 0""" V wherÂ zðalso (and must be) intsé  

&_$!byC½ 
* �  ºÍˆ @pSupportÒR flagÍu  [x 0gen�re_next_é (] À, start, couè 3las  sg  D  M     GK    O  O  n|Sgiven6 1  g :.  amP ²Á  % † & rinitial™ ] uor None/ ® /  nuC éPexistw\  ] Õ 3   Y €assignedâ	b ó !ifÙ u „  Z ¬ D E	 s0  P  Õ% 15    „  –reversed( { f 6tryE    Ähigh_bit = _ D Ü -   Ubreak‰   �except E >ione ñ	raise TypeError('InvalidGC†: %r' % ¿ )  ÿ o )d2 ** (¯ #+1ì@rRmethoµµÒmissing_(cls,m Ð):
        ""3"
  ó6Returns member (possibly creating it) if one can be found for value.
L 6 ""Y  original_v$ " =, x "if U < 0:  I 0 ~	  ™ #e_ª q= cls._§ ƒe_pseudo !_(; )<  ¿ 
� v _ ~ N r3    Á@classmethod Odef ¥ Bcls,)CCƒÔe a composite§$if?Ócontains only s’	$ @*2T’_map_.get@i, NoneF
C !is" ½  ¿ñ# verify all bits are accounte7 ,   ò_, extra_flags = _deð 'e("	4 (if4 
€  T praise VyðError("%r is not as”id %s" % ê LÆ_qualname__)÷  Q  # construcA ò singleton enum -D	¨  –ð = object.__new__ß 
g 	0 !._‹ ! =eX .b_c¹ ðuse setdefault in case another thread al ö(edt	z °# with thisH)ue 	À b� 	9 jÝ
r W_ý‘__(self, Ô Nê@TrueÑ 2 ò has at least the same ‹bset asT R!ifS±isinstance(�  , \ 1.__'__‘  ”žBType�Ñ    �"unsuppor0ñ operand type(s)w°'in': '%s'   	 ÍJ  R 9 ˜ 7)._ã¦ 	  …B l&ã ?C_ =='Œ¥Crepr¡	 clì
(¿ #if_ º Ž
ì› Ð'<%s.%s: %r>'ÕÎ= _ç   · i¼Ïs, uncovered‰ ­ ; „ Í  „  	•  ô '|'.join([str(mýDor muümÃ° =]),I ¦ 	 À     )

    ódef __str__(self):
  `cls =  ¥.__class__ #if öname_ is not NoneA  H ñ	return '%s.%s' % (cls.__7 (_,E )] ðmembers, uncovered = _decomposeC : fvalue_; sif len(B ³) == 1 and  B[0].}  ´ ° r°  G | ?elsþ ä   	" ô '|'.join([str(mÃ cor m._ˆ   f 4 inì ?]),M !)
 ûNboolü·  e ; o5w, other<!if±isinstance(" ¶O2  v áNotImplemented¬  
‘	ž " |‰ ® 3andè ¯ v&¯ x^^¯ cinverta×0Ë
Î Òû^ 
1 &(0ûÿ
# 
�Bif m›' ¾ Xz # &™ Ð  ‰  ’  5| m² Ë
‹ (+ A)


Rà IntFlag(int, 
 l 1"""L qSupportÜÑinteger-based- s$  , 	 @T Rmetho7ã‚missing_7Ò e  É  =     R­s@ñ (possibly creating it) if one can be foundŸ Z .‰  M Y - W, intŒ  7 praise V×�Error("%r« ¡°a valid %s"JD >BqualU)Bnew_‚1 = ( Ê ƒe_pseudo !_(J 7 ½> ö_R @cls,® 'ueà CSBe a Õ4itew2iff: ã contains only sb	Ñ í × 2ð_map_.get(value, None)
  óif pseudo_member is None:
!  ù	need_to_create = [value]% ù# get unaccounted for bits' ñ_, extra_flags = _decompose(cls, [ )4 É# timer = 10 XwhileP 
¸  ½ < I-= 1<   0bit‚ —high_bit(š 
‚  -  ± _ž p = 2 **Ý S Gif (* ²not in cls.< 2i�_map_ andA  k   E 
‡9 ) P 
> w.append« ñ (if[V == -• e A: = ­ … ;els\    : 6^= i 	è  SƒÊin reversed(Û   ó# construct singletonú-‘
¦ ’ 
ß= int.__new__ª8 ‘._name_ =W	Ì ,  Û  - 	 . ò # use setdefaulZðase another thread al "y °Bd a b?iteT  ’with this{" Ì.— (¾ ,`Z_Tretur~ 
v ñdef __or__(self, Ö Ð1if Q¡sinstance(" !, 0 °.__class__,­)9  lx  NotImpleme¥x  sR = z J Y Ò <_ |  )Û_ä  reU Ý ?andÞ ctÜ 	&Ü +£x¤eÆ ^Æ 0__rÂ  üoÛ 1__rž 
  ï  
 ÐcinvertÓqú O~ƒP0
g—. ] 1"""— Î°s index of . 0est•¢, or -1 ifÓ Öàzero or negati¡ve
    """ ñ(return value.bit_length() - 1

def unique(enumeration):< D ÷Class decorator for . £s ensuringK r memberu )s.L ñ duplicates = []  P Tname,9 (in` 2.__Q £s__.items(¡  é 0if < 3 !=> . Á      u �.append((% p 2 !))Œ 6if . F Àalias_detailº ¡', '.join(6  e  ñ ["%s -> %s" % (: ,¤ ):
 'inp ]„  J praise V·uError('— Xý found in %r: %s' %Œ Õ!, ‹ Å ð  Ï_ï²mpose(flag,u x³Extract all}¢s from the1 
ý&# W ö is only called if6   1not5dÕ Ònot_covered =[  tegative A < 0 2
e  3 Ô Þ _% H M  ‘#ifã ' :and &— $ =A ) f  F j s‡ ö # ë B&= ~$ M Ž  ò û a gtmp = @ /  T –while tmp-    Y ú = 2 ** _high_bit(tmp˜ 7if 0 !in .? 2¥ Jmap_c  g  õ  F 8  [ O  @   Ö  - å  '    3‰  ¼Þ�  Ç 6 ´ z 0  [Q º 3 ósort(key=lambda m: m< ò _, reverse=Truelsif len(? Q) > 1­  A[0].g  e	 ¦ ‘# we haveGñbreakdown, don't need 7 ºu itselfBg b.pop(0’   ,^Ð"""Utilities ÅQcompa	Qfiles» ð directories.

CK"es· Àdircmp

Funcw òcmp(f1, f2, shallow# V1int¯ 1cmpd à(a, b, common)" R([],  Ã ð clear_cache()

½¤
import os
 Qstat
¼£itertools % ²filterfalse" Etype €GenericA!�

__all__w'x  /0cmp õ  
 Ã   òDEFAULT_IGNORES']

² ù	 = {}
BUFSIZE = 8*1024

1 ÀES = [
    '‘RCS', 'CV @tags A.git !hg 0bzr Q_darc! ñ
__pycache__']

def clear_ À():
    """C Ñ the filecmp " A."""# 1 .= #()J ÷mp(f1, f2, shallow=TrueV ¡ompare twoX 1s.
N ¢Arguments: ±f1 -- First( S name 2 lSecond u  ! Btrea< ðs as identical ifÖ ñir stat signatures (type, size,•  
 pmtime) » J Á. Otherwise,‰ s  üconsidered differentO „ Àizes or cont 4 Ð.  [default: C]ý ÃReturn value+  Õ †  ¹Ôsame, False o« qòThis function uses aâ± for past c­�isons and7‚ results!Cwith5 óentries invalidated• jpinformap Óchanges.  TheF bmay be’Òed by calling t#()Ä  ‹K Ðs1 = _sig(os.×R(f1)) 2 2 ±if s1[0] !=€.S_IFREG�/s2   r‡[g  L ñ* ‘ M= s22  ­1 21[1} M2[1]+ ] - poutcomeÊ …Fget(jG1, sÕ . vis NoneY  u= _do_c­* Ø rif len(h€) > 100: ‘  # limitqmaximum+! oPÁ® 0  ³ \ ['½ C] = ž ) ` §à#stL" (î¹âMT(st.st_mode) Š  Ù ÜÂ<0buf< ¡ = BUFSIZE¤ ýAopen‰P'rb')iRfp1,  72,  Qwhile×a ¨ bÈ“fp1.read(w ž ' bÐ?fp2# Pif b1Õbs  <   8]   šif not b1“   4 ¼Ç
# Directory!¡ class.
#
	 r dircmpK B"""A  Ñ that managesJc H28 \ $ieJ à(a, b, ignore=×R, hid "A|B†d¥ I  Å    IGNORE iê@listr  WCs toZ 7} ‚DEFAULT_A !S.ÿ_  HIDN  › L ð[os.curdir, os.pa ]Ñõ High level usag»0x =Ðcmp(dir1, dirA2)
  òx.report() -> prints a  ð on the differences between dir1 and	 2M 3 or
 W ù_partial_closureg e a N ª m ,
 = s£ ócommon immediate subdirectories.F ” ;ful‘ Clikeô ² ,> „ @but ? Ñy recursive.
" ±Attributes: ò left_list, righ Û: The files iEj ñfiltered by hideñ cignoreÍ ó @: a b r of namT @both•ž4 ‘ Donly‘   :9   ’ ,? 26 j k_dirs:Y 0 n 8 ë :ò 0 Dunny• >in 0 a where˜4typ�™}   Ä A, or3  'ô is not stat-ablUSsame_± W’identicalÃ  °*  9  ^ `s whicƒ 51 f× 2 . Qcould– ³be compared= Ïsî dictionaryôÁdircmp insta�©(or MyDirC tif this`object1of D4 0, aäVclassa b), key�â I  in« 1mon® 2"""ò
def __init__(self, a, b, Êa=None,à €): # Ini/4ized  : .¼J = a XE = b !ifQ  Ü  _ ‹¼J Pð= [os.curdir, os.pa Q] # NHõnever to be shownb OelseW  ^ + #ifë � õ = DEFAULT_IGNORESE p 8 	 raphase0pRCL Ñ Óything except» ð-x wÄ0 = ¾pter(os.1dire ›)¼l Q   +
 ¸ ‡ �Ñq % r T s  Zr !.s
l 	    Ûi1i!ut½ Ž	)P a = ¼€(zip(mapFâpath.normcase,­ Ž ) +bM ½ N Àlf.right_lisSt))
  ð*self.common = list(map(a.__getitem__, filter(b.__contains ,a)J Ÿleft_onlyM _falseR NrighS  Š   S  » ¥ b¥ ð °def phase2(÷ ð): # Distinguishæ Ðes, directori qfunnies@  3 9 0¯_dirs = [] Ofile 	0unn&5[]
? —for x in f :   Àa_path = os.
 Q.joinÎ .{6, xÛ 0 b0 Y1 	b iok = 1 :try†  Z ba_statŠ  
 (› 
 îexcept OSErrorE ð# print('Can\'t I 2', K ú, ':', why.args[1]]  † ® 0® b® 
Q ® $K ® 	¯ ^if ok�a_type =‚.S_IFMT(tŠ.st_mode½  b5 û 5 3if m 2!= B �  ^ •_›y.append(t , Eelif» RSDIR(d )[  VZ ?REGZ ’[ 
/se  û 	/elB 9	™3Ë™óFind out differences between ±Ñ B  t�xx = cmp I € ï ? _) F Bsame ,†  	   R = xx¿Ã 4z Ã 7subpÌ p# A newŒôcmp (or MyDirCmp if ÷was subclassed) object is createdP  \Deach<y 'y,( ðthese are stored�ña dictionary indexed by1Wname.@ ñThe hide and ignore propertiesY õ
inherited from the parentG ‹ C%{}  Ç #‰
¹ a_%Àn(self.left,W x)
  üb_x = os.path.join(self.right,.  ásubdirs[x]  =  ð__class__(a_x, b  rignore,& ahide)
 ñdef phase4_closurew ó): # Recursively call) b() on } �ectoriesL  Î m Q (á ’for sd in€ < µs.values():? C "d.A ’ ¬ freport¤ ‚Print a   ™ õthe differences between a and bk ð
# Output format is purposï Ulousy+ pe  ('V 'CCleft ¢ì "ifå  " [_onlyÞ  Õ  .sÎ =   n zOnly inq (': _ = z ‘  {   | 4 &, }  b ~ ¯same_files~   ~ ¡Identical G  ô > w  �w  w D5<ingw > w _funnyx  y üTrouble with commonƒ I „ 3 _s  „ Cw šÖzE € ¤ �  ‚ ' m cases  …_partial/ „Ás  Áº, º%º! Î5sd.U Q r O_ful¶  Rã	¯ —6s r’L a  QQ ¸ B
¦ ~ómethodmap = dict(¢ =º,ž  ¢  À( !3,ª? æ
 O •" =�#2,A@   ®i 2¤ U $ 51, ª ü ž : Blist' ð0, right_list=phðase0)

    def __getattr__(self,  !):!  % !if € not in $ ¦.methodmap'  + ñraise AttributeError(O N 
? [ ]x )# sreturn —  • ¶ p__class¸ ‘item__ =  – ð(GenericAlias)


æ ócmpfiles(a, b, common, shallow=Trueó £"""Compare&  9  û òtwo directories.�  R 5 -- qy namesÏ h   qlist ofM ! ` foundX Eboth? i; ›  < °if true, do” òparison based solely on stat() information¡ RP�s a tuple† `three ” sÂæ Cthatd qe equalÈ  ¸ !s   —different ÷ # ²n't regular= /1"""4 ²res = ([],  Pfor x;ž ð  ax = os.path.joinËx5  |b  7b,   õ res[_cmp(ax, bxü£)].append(- „res


#  ý$B.
# S0:
#z P   0 ¸ 0 1 ) 2 ð funny cases (ca. À‘, etc.)
#¶° ²ósh, abs=abs, cmp=cmp²6try'¾  ­Aabs(ñ A )-‘except OSŸ: 2ö á Ð a copy with lPoccur¥Ôskip removed.µ €filter(f_ , # © œ   (% `false(# ñ .__contains__, = )¾¡# DemonstrÓÄ and testingr Sdemo(d ’import sy� Rgetop¬ op`s, arg‚ . ò(sys.argv[1:], 'r'4pif len(3 g) != 27ô? !.Gh Yð ('need exactly ? ? r', NoneW @dd =ù¦brgs[0]˜ 2[1]" Àif ('-r', ''Û ¿ € Pdd.reô â_full_closure(? Oelse+  P()

iû ³ @Â= '__main__'0 T¢
"""Helperbð to quickly write a loop over all…@ndarØ5putúò Typical use is:™� VBinpu  I@line_ .  ó(encoding="utf-8"ô …€process(; p)

This²Rratesž  thòn f«  ^ se¯  4ü €0aulg õ  `stdin �J ñst is empty.  If aî  S  ñ'-' it
is also replaced byi M Í#heÖ al•°uments modeí 
openhook xð
ignored.  To specify an asPnativå k Ž ð s,
pass it as tñ8he argument to input().  A single file name is also allowed.

Functions&  % ò(), lineno() return thF    ñ  and cumulative, ¡
number of+  ? ñ
 that has just been read;i  " a `s its
  J iu @currÙ  Ã �; isfirst( œ ‘s true if{ D r  m  ñ ¼ 1rstª  £ 1its…  Q [stdinM 
M 1 1was¹ ¡ from sys.4 C.  F<P next¢ �() closes
¼ 2 so Ž  / ò  iteration willb   â z  q 
 1  a ¡ (if any);" Rs not;  ,  v Ù S   Ácount
toward– º " ;; âiY óchanged until
after( N
¡  ñì$1()
 ‹ ðsequence.

BeforeÛ Ù Fhave5,×  œ «0Non2 ad both7 ‡¸s are zero;› › �no effect Ñ 1all< %s s 
;	s  ó è  z¢fþ %ðvalues
pertaining“: a� ] ˜ Q

Allï Ç popened ñ#ext mode by default, you can override this by
sett� "he6 aparameÅ'� or FileI6à.__init__().
Iið I/O error occurs durU  –  r  aµ ,"0OSE5 a
excepåqis raist&IfG ¢`used m  thÊ 2nceG asecondq±further useÞ
š"no¾", l ð  perhaps for inec§@use,î Bif i˜ §ð

explicitly reset (e.g. u;¦ ñ.seek(0)).

Emptyì 	¡ #Áimmediately èdY€only tim�Peir
pk 1nceÖhC st™ ã åsÐnoticeable at²  @whenb 
lP 0  ‹ !0s eš P.

It+ Ppossi> ‰
„2of ¯± doesn't endPa newæÐ
character; oz0wis© "neö  x Pnclud c “trailing
G †.

Classe ›  * Pimpleµ;r method� 1(),Ñ *� ›  ¡	
A, is”   , !()8‡ w`orrespOt‹&e À \%Òule.  In addi¸,a~ § c which"Ñ | �•,‚ °a
__getitemZ
> A õ behavior.  The
 mLÀ accessed inó strictly sequential order; ðTce
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inp+ ð =1 is
passed to put() or  : ðFileInput constructor,  ð
file is moved
to a backup� e¹ Àstandard outD ’is directo  F i]  L @.
ThO ðakes it possible‹ pwrite aZ ±ter that re  , sº   Qe
in O.  Iÿ ¨ ð=".<some extension>"Ñ °also
given,ˆ ‘specifiesö ,   f&(heõ ,ö  × b 
Ø ò remains around; by defaultIS ‘is ".bak"H  itž@dele0Awhen‚ L[ �is closedí  ? �isabled @ ‘w!is\ð.  XXX The curre!@mple+a^`
does yAworkú ¡MS-DOS 8+3vôsystems.
"""

import io
 ðsys, os
from typâ$ ñGenericAlias

__all__ = ["£ A", "â  	 @next÷     @name   no
    &
  " # pisfirst&  2 pisstdin ì  °hook_compre)",O  òencoded"]

_state = None

def’(x  s= , ucFalse,8ð="", *, mode="r", open` 6 w p 2ing b error\ !):' ð """Return an iníBce oÞ Ð class, whichQ NaiteratQ 6 �parameterº&e & àa .“  I r” %ed“  P addi\ ßQbeingµ ‡ "ornÒkeeps global bu@func> s~  8bodule,w  † È < Ÿ‘ 2if  c  ._§D 6 àraise RuntimeEg(ŽP() alŽ¡y active")U G 5 = eù é Œîè íéòö  ‚  ú	 ,þ† hß …;(C-Fz?ce.+r=Q  ” é  Òû "ifš>7 .z ‡ ¹Š = � x ‰2 soâ i ;  ž�ion will´Å ÊJ  Ï ^1he 5 K  (if any); " Ä Á, '  W H  äÂcount towardõ`cumulañG  " .1 ?  ˆ 91notE €changed Aðl after the first liñne of the next file has been read.
    Before( ›first lin) ñ , this functionF ¡no effect;F ÷
it cannot be used to skipY  ‚ q. After $lan ¨ I   * f ¬ ƒ 
É 1"""B 0if ˆ q_state:  è ñraise RuntimeError("no active input()")0 rreturn C .? ’ q()

defJbname()^ y R6 r%am~ ; ÿ currently being€‘ os Noneî L ¯ Þ î  /noì acumulaF , t number| AthatÐ0jus"�0AµE AC   – © aø\L w  LZ j J ! S!in8Lˆ.À	í$,  C° • š  °G „C C	S withª  H SL c  $
W  S 3 S5
SqWhen noa6 is½fopenedP/-1ã P Ñ 6!is§ ô •Rs truÑ %  t ð Ë  º@ çaof itsé ,Ý Ptherw*ìOfalstM	Ô ç _stdinã 
ißòë 1wasZ¡ from sys.E Û kƒ  <°class FileIn   ([›0s[,�ðlace[, backup]]], *, mode= , ‡Ahook !)
¾ÐClass FileInpñut is the implementation of ðmodule; its methods
    filename(), lineno
       visfirst Pstdin  & 0 J @next ñ() and close() correspond to‹ @func› sœ Psame … H !in& ± . pIn addi5 â it has a read• Ñ Ò which return ” B Qinputá ,ž ú a __getitem__()B BE @ õsequence behavior. The  ÷must be accessed in strictlyA ótial order; random2 • Ò QcannoR RmixedA"""
M ñdef __init__(self,Èñs=None, inplace=False, backup="", *,@  ù ómode="r", openhookG „encoding Brrorc %):G àif isinstance(  s,ú #  j  3 = " )@ /elB ¿os.PathLikeJ ’os.fspathT 8), V &se¤  � "if# & &
  " £ Åsys.argv[1:]§  ! 0if ”( ? V('-',Š  9 ,elŽ   H s = tupl:7  Õ$._#  Œ  å$ =ï  ö# =ÿ Ðsavestdout =   0out1  Ž  ®: Astar-kno = 0X  <  µ U !isu1 = ÔU ë  [ — Í4 =  F eà   	 j ©�# We canþÄuse io.text_I `() her ca  5oldL… doesn'tm e# take… ¢ parameterä q @if (†öflags.warn_defauls  0S  4   1"b"¤ 0in Õ $ h !isè écpimport y 2ing( `    — 4("'`' arguwƒ ¿specified."s  I  Ec¸Warning, 2)x"reDÏ a !toý1ing ¡ !if ‚ Àin ('r', 'rU  ;rb'ì Àraise ValueEøq("FileI/ 'e  â0one¸"~Ñ  "{ vV'rb'"ã`if 'U') ­
Q‚Àarn("'U' modÿe is deprecated",
  D' åionWarning, 2)1 Ðself._mode =   Xwrite  ñ.replace('r', 'w') if 'U' not inE P else N Åif openhook:  µ Qif inR 
   ðraise ValueError("FileInput canq ause an\ @ing `  … S � "î  U !ifª ”callable(— )€ 7 ” must be Q o ]* =§  £ 
Àdef __del__(+ ‚   †.close()-    + :tryº    €.nextfil?  õ   ofinall- _* Hs = m ~__enterœ preturn g › c__exit- �, type, vº·, traceback¶  > á ?__is  å s [ ªwhile True0linåz P_read (  
9  =6  (   qno += 1Æ    # 	 tE a ìÙStopIterationC <  ñ  „ ¶ à# repeat with %  & žsgetitem.7, i1‚import wsw  .	 (  í A"Sup5 �for index~žzobjects¨:. "E @Use ñûator protocol instead.×É 	N Åstacklevel=2 Þ h1 !=·.¡7no( Õ ƒdRuntimq`accessÝ  4 çs out of orderê…
¶ __“'__¶yexcept ï
� I[ü0end{ iÿ‡reached" e  ÷L`avestdº ÿ %_s *ª  u = None  6if  
« Fsys.a [ < 0out³~   z  v X HN 
ƒ  ¿B U    ÷ ( �   Ž  3 ’   �   ”   2del[Z   —estore . 	q ‚Attribut}
â À    pass
     Ttry:
  þif file and not self._isstdin/  7  0 ‰.close()P ofinalle  `backup8 cname =f 
 	K  h ‹ 
% } = None, ;if ) 
Ñ  Ð  ² os.unlink(+ ­ 
â  —   ýexcept OSError: pass
• Á L‚ = False' Ðdef readline(( )œ  wh‘FTrue  u  , <= 
¡ 0if ' 
9  =  d  ._Ö    }no += 1² areturnC 	 'if E a ; y @next7 1à# repeat with % �#_ç  G $‘ s’ “if 'b' ink;modN ´ 9b''î ?els- ,  ” T	× é Es[0]T ( sÀ% ,1:& Sstart£( ;P  O = 0m  ,7 �    
ýY Z ð# EncodingWarning is emittedjÐ__init__() al¹y; aif "b"D“e_ % µor "locale"T ¦/ %+ #if v¬Z= '-'4# 1 '<>[M ñ  = getattr(sys.S Å, 'buffer',  
Êß ¦ ¤  %O é # ç I! V oinplacù Ë (U  v  ‘os.fspathÖC) +  J  Ôj.bak")ù  J  “_ §– I ©T ½ v  S# The“!ew´s may raiseúP Pos.rebì  ª  ,�ü  ° Ö    s = openH 
8 N  Ö$, ÷=	 à)
            �    try:
	  ðperm = os.fstat(self._file. Ýno()).st_modeA ïexcept OSErrora Q `outputi 7pene bname, $ Qwritei ´, encoding=	 )} ?lses  ¬  k °s.O_CREAT |á „O_WRONLY ]TRUNCW  !ÿif hasattr(os, 'O_BINARY')q  4 u |J/ 
] "fdœ o
 F  , •ñ  f *NAs.fdI /fdG$ V   �os.chmod¶¦  [ Mpass$ã �savestdo5Bsys. .  # =H	* e,ô# This may raiseÉ	;  ¨ $if[ penhook�# Custom #  X þde previous to Python 3.10 didn't havW s #� argument—  ( › ) is Non 3 a Þ3Ø ä,  –�Y f   > j Î  5   9 ! ‡ % ø 0, e…#s=  µ ± 8 ­ T † € L …readliney o . ô # hide FileInput._ /creturn� "()l@def S  ° Ì±	9 % 7  — /no5 
Rstart( # +‚  I  K  O 
' 
; † å 3 
|»ë ÌG f§_ValueÂJ %-19 A$ %  „aisfirs,V == 1bisstdi*Ä$ 5 ð__class_getitem__ = classmeõPthod(GenericAlias)


def hook_compressed(filename, mode, *, encoding=None, errors=None):
    if$ @ is ' c:  # E9 pWarning ðemitted in FileInput() already.
O   t ± = "locale" õext = os.path.splitext¶ A)[1](  “  + r= '.gz'¨  Y ±import gzip)   �stream = U.openQ )+ (elV >bz2W 1bz2+ 	V pbz2.BZ2ð X &se¡ return †  ŠŽ•!)
~ #É ñ and bz2 are binaryÔ² by defaultp if "b" not— ÷Ž òio.TextIOWrapper( ”  Ö 5 {Ê 1ed( 5ingÒ  F)‰  ¨  ¬B" c  ) % ¥  B  k § c_test(‹ ?Qetoptmñ inplace = False ibackup  opts, argsh? !.g ò(sys.argv[1:], "ib:"q€for o, a— @ ì æif o == '-i': ƒ 2Tru‚  % Eb': ” a£  \ @line\ i† œ ,L =T ,8 =? ^  @ Q[-1:]‹ P\n':  ! = 3[:-�/ r/ 	ðprint("%d: %s[%d]%s %s" % (c dno(), ¬  â  v  pisfirst4  �Ñnd "*" or "",À )…Š … �))

if __N!__#ƒ__main__9Z@
""" ) ` match-ñ	with shell patterns.

fn! ò(FILENAME, PATTERN): �es accordC qto the @Ä convention.F OcaseJ Ðalways takes %  % W àunt.

The funcL s©@rateV�translat| $he¸ ñ into a regular
exm Š Á  They cache¬  ŠDiled-  -  s ´[speed…  y %e(qsw J ¤
correspon'7 ±.  (It doesŽ P it.)¦
ÿ$os
 PposixŒ $re
 #°ools

__allÓ ["filter", "Ì  l  Ð ð"]

# Build a th&@-saf·@cremÑðng counter to help create unique regeð2xp group
# names across calls.
from itertools import count
_nextg= Rnum = A()._ b__
del à

def fnmatch(h ñ, pat):
    """Test whether FILENAME / Áes PATTERN.
/ òPatterns are Unix shell style:$ *X %  B ¡everythingC ? ñany single character) W[seq]H  ) " r in seq) !* ³ ) D not( ) ðAn initial period ò !is1 �special.2 FBoth4andñfirst case-normalized8 òif the operating system requires ita ôIf you don't want this, use´ ` (¦ ,� )@ 1"""q  Ø° = os.path.� 8   )" ?pat!    ireturnu  = -q

@func‰ñ.lru_cache(maxsize=256, typed=True)s¢_compile_p5(k vÐif isinstance s, bytes• "Òpat_str = str# Â'ISO-8859-1'Ô  ) 3res) �translatR   	% " =d (1 ., P Belse¢ Z 9 = V R +3re.ã  T !).€oQilternsBW ñ"""Construct a list çòthose elements o@ ýPable “bS thatW .üPresulÝ![]Êê¨ ? = ¡B $ifJ� is posixWÄ  $# b2 on!  * ôNOP. Optimize it awayá be loop· D 1for÷ … js_   "ifë E    ö r.append% ¼ 
Äe 9w  Œtˆ	x€, includD I ˆ@Thisq�a version2äÀ) which doesW 8 ¡% itÃ!gun“Në ) y ‹  mRNone
ý 
7Û m¤# a;að to a regular expresÙ ñ 2ereg  Tåto quote meta-sÌ è @STARödbject(¾Cs = ,“add = resI6 Ði, n = 0, len|9 ²while i < nÐ  ‡0c =O"[i|  qi = i+1K  ð	f c == '*':
            ÷# compress consecutive `*` into one
  ð if (not res) or €[-1] is  YSTAR:1  < @add( ) Úelif c == '?'1  - ?'.', [, Uj = iU  k ñif j < n and pat[j]f !:  ,  > ?j+1@ ]@ ^whileƒ O!= 'C Ã J>= n ² 7\\[  Nelse- qstuff =Ii:j]è  7 qif '--'¹1in 0 G  *  " =# ð.replace('\\', r ® /   ”   ®chunks = [“    kÕR+2 if» Á S + i± 2   y?Tru
       Z þpat.find('-', k, j¼  ,   �if k < 0 "   ]break]    î €.append(’Oi:k]t O = kä  P  Ä ?k+3p l jl ñ# Escape backslashes5ÿhyphens for set difference (--).z 3# H7 ñthat create ranges shouldn't be ev dG h¯'-'.join(sm  ÄKr'\- ) Õ B in +‡ û ñoperations (&&, ~~"/|| » óre.sub(r'([&~|])"B\1',?t Li = ˆ ¾ "if2 $[0‰{ S'^' +3 .1:]u-  R ßin ('^', '[')Y %\\Z ÿ ”Af'[{Y '}]Š °
Y  , 2re.2(c)€assert i©!n
a À# Deal with :s0Pinp =t% 'reF2add k" òi, n = 0, len(inpq À# Fixed piecöÁt the start?8 MiI_inp[iå Ô   ] ºB += Yy# Now dÎ ! f  Ù  "..á €# For an}verior `& ñ` pairing, we want to do a minimal½ ñ
# .*? match followed by `v ð `, with no possòXibility of backtracking.
    # We can't spell that directly, but can trick it into working by matching
N ³   .*?fixed` òin a lookahead assertion, save theD �ed part 0 `group, nG `consum0 1at  a via aÔ Ðreference. If6 ‚ overall[ s fails,J  r �  0 woñtry alternatives. SoR ptransla» C is:M  ö Ä(?=(?P<name>ý `))(?P= )* GÓ   Às are createô needed: g0, g1, g2, ..¡¢The number9 ñobtained from _nextànum() to ensur*Ãey're unique† óacross calls and  ðthreads. This is because people rely on
J ‘undocumenÅ dÐto join multi8 6ðe() results togetherÁM 0"|"º  build largr RgexpsÂ m@"oneÅ€many" sh®0pat«s,²while i < n  žqp inp[i]Ú ASTARw   fi += 1 hf i ==@  & ‚add(".*"Ì    Ubreak; h Inot l U = []5 ² Ž¦ > É  s C ‚.append(- 
” Ð 0 ` = "".˜( 2 iï  @ Jelse¡ Š, =šô  È L "9$g{6 }@{e }B )i¨V 7resä 2resâ ðreturn fr'(?s:{res})\Z'
# Originally contribuÆò6by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jya
  ¥ðmail.com>.

"""Frac>ñ, infinite-precisDrealça."""

ßòdecimal import D 
 Dmath # „operator $re
 Àsys

__all__Ž'™ ð']


# Constantsõ£t@hash‰  leö
0;   0(x)Zsbased
#(Q reduò  ¶x9"ulJ ûprime _PyHASH_MODULUS.
 p = sys.a ñ_info.modulus
# Value2@e usAor r“ 2alsÅ % p¼_ulo
#{ =INFw ðinf

_RATIONAL_FORMAT = reÞ‘pile(r"""‹P\A\s*â @# op ðal whitespace atTg startñ Q¸sign>[-+]?)N F# anK  % 	8 ð=\d|\.\d)          ñ# lookahead for digit or .
 
' À(?P<num>\d*)  ó# numerator (possibly empty)< :/ 	 Ñ# followed by- p   (?:/p @denor @+))?6 á# an optional   inw 9 |#  A# or$ ] "\.^ QcimalÒ :)? ] Cfrach Gpart= E< ±exp>[-+]?\d�  = d› rexponen7 _\s*\Zž 'an= ðwhitespace to finish
""", re.VERBOSE | óIGNORECASE)


class F¹ ²(numbers.RaÈ !):Å ‚"""This . Ãimplements r(  Í9 
0 ð In the two-argu,  $Am of Æconstructor,} ¡8, 6) willE œproduce af ° equivalentí ¤4/3. Both l Rs musH4be Ì P. The© v€defaultsD  0 N ´ !& –1 so that´ q3) == 3? F "0. ås can also be ‚ed from:- 2  -¢ ðic strings similar§ Áthose acceptý N- %VfloatZ  Y ™0exa±€, '-2.3'£v'1e10')t l  æform '123/456'' b  +!De¦ instances% Uotherv" ó (including integersƒ 2"""@ õ __slots__ = ('_#W', '_›¼ ð# We're immutable,£ñ	use __new__ not __init__*4def R(cls,p 8=0, ó
=None, *, _normalize=True sD"""CÌ5s aö ü # @Take c£ like '3/2‰.5', an51, aµ  I /	` pair,Ô!a žz EùsB - l T 6>>>Ìb10, -8z  ºf(-5, 4 	5 % †1, 7), 5(  3 @ 
5 _2, 3)M  O3, 1� _'314'4 V14, 1 	‚ _'-35/7 /-3ù °'3.1415') #tqversionÍSÃ€Ü ¯6283, 2000” Q47e-2] 9Bmay A d€	5
µ_47, 1b ç1.47)  # direc7Å Oð (exact conversion3)
  öFraction(6620291452234629, 45035996273704965 E>>> 9 F2.25   A  	2 ö Decimal('1.47')& = ¥147, 100)
© 5""" Ôself = super(5 ð , cls).__new__( > õif denominator is None:R  Ðif type(numer' )( :int'  +  � %._) 5 =  	S , ~ == 1& preturn Y ¶  ? çelif isinstancž ,t pbers.RaÂ?al)© .³ . .Ë Ç 2ƒ(float, )Ç  ý# Exact conversionz  :“,K'._­ ¦Ð.as_integer_r?(† v  “!?str¿ `HandleÀ Astrurí from strings.Ð ÷m = _RATIONAL_FORMAT.match¡6 @if m¶Þ Ò   õraise ValueError('Invalid literal forÞ}: %r' %h  J  #L þ = int(m.group('num') or '0'7 ¾5 = /  )  à ¦ 6 û€  p ;els ?   1 C À$ Ø
°  ²   1 ¶ ! ¸  $ òscale = 10**len(d=¼  -   k "* I +E ï "*=< 8expð ?expì ?expè I  ?expÞ 0if * O>= 0L 
*=?expÂ  - ø     Ž-R  �Üßsign') == '-'® ¡5= - •È3TypÇó"argument should be a_ð "
                ô"or a Rational instance")

, ðelif type(numerator) is int  qdenomin ::  B û
pass # *very* normal casea 4(is} h ¤, numbers.¢ Y) anda 8 † :  )™ Í ', 8 I = (_  Ä + .
 ( *6 .B ,?  	A M ? > ) JelseÄ õraise TypeError("both arguments should be "F  Ñ  "_s(ifí _ == 0ˆ ÂZeroDivision� P'Frac[ (%s, 0)' %ÒE“ Bif _+izâ Èg = math.gcdT! × ¬ <«  $  U %-g   ŒZ //=  l  fself._< =Þ ^ $ D =N( preturn / ²@classmethoò÷def from_float(cls, fÖñ"""Converts a finite , t to a ræU¢, exactly.p  ÄBeware that ¼.t u0.3) != w(3, 10)B &""k7if žf”‡Integral½  ~ Vcls(fÖ€ nom""f,Ù A (%s¾ Â) only takes@ 0s, Z ¥%r (%s)" %� �   sÒ.__name__, f,%f) )· Í p*f.as_iõ 1er_‡#()bæpdecimalu  £cì êD0 Ãõ© â p ƒ import O 
Í?decÏTdec =H ‡(int(dec"ÙX { ñ  Šíš     "îÊ (ðU ò qÑzè ¾  È ê?decì Á	 ñê B"""R
0thedBeger»  aØWtupleq. !a  t of two9 ð s, whose ratio óis equal to the
  õFraction and with a positive denominator.2 5""" ðreturn (self._numer- ",  @ !)
5 §def limit_ ? X, max 1=10 !)::  ° µ"""Closest ¸ !tom ¼ U Œ at mostW .‰  O 5>>>H þ('3.141592653589793').« 510)� „ f(22, 7 X #Y 311, 99[ ¯4321, 8765ª /00T 6 Õð&# Algorithm notes: For any real number x, define a *b”Uupper°# approximaa*zx b2 r N Öp/q such thatò#O `  (1) )  >=~ :and R2) if! P r/s '  í¤n s > q, fÇ } 6r/sÙl DÚ Ø \lowerÎ ö
similarly.  Then it can b\�# provedÔ < a ô Vis a :A or k Ö 	C =Qx if,­Aonly 1it J Èconvergent o‡Hsemi fó (unique shortest) continued f‰ pssociatÎ ?o x6tTo findÖ ð 
Æ fªW<= M,l "weG 8the ¢ 
‹sû? [ .ñtake whichever o se:cSr]× 1 In(!evQ�f a tie, 4bou.xsmaller+7 isŽ øchosen.  If both* Ss are˜(� CghappenD ëwe$Q == 1à  q Í Émidway betweD Ñtwo integers)Æ LÌ r---i.e.Þ Afloo" T ,Î  GnC,if`F < 1À güraise ValueError("Æ pshould ¦t least 1"õ!ifã.< <=z v ›¤ Í … • ñp0, q0, p1, q1 = 0, 1 0ycn, d =| Ý	2 ªwhile True� va = n//° ƒ Åq2 = q0+a*q1B   if q2 >à  ) Ybreak; 	× À1 = p1, q1, ×p0+a*p1, q2
  õn, d = d, n-a*d
 õk = (max_denominator-q0)//q1% òbound1 = Fraction(p0+kh  	 :q1), 2,  � " qif abs(U Æ2 - self) <= !1- :U  Ê rreturn 7  Oelse( 1é ‘@property7 �def numerì 6(a)? c 5a._  A /C " E  x ›__repr__(á 0"""  1"""© ö ñ '%s(%s, %s)' % ( õ.__class__.__name__,8  <    w Þ ,}.ý)­ /st¬ 1strƒ )« .ifN V == 1a ’ eC Ž EÖg'%s/%s©Ë    ðô_fallbacks(monomorphic_ $,     `"""Gen9ôes forward and reverse G ðs given a purely-ra7%al * ? Qa funY† from thK ‚ module.— AÇUse this likü°__op__, __r	 5 = Ã õ Tjust_Ž E_op,´ 3.opü e AIn gë ðl, we want to impleme Óhe arithmeticF uions soæ äthat mixed-modÕ & æeither call anY )e whoseG ñauthor knew about"ðtypes of both argu™ Ñs, or convert G !to8 ðnearest built in I ˆd! œ0ion/ ere. InD ", Ü Beans ñwe define __add__S 3__r &s:Ã b L0, oo &   0# Bâ  § fs have¿'s/g¾ attributes	]# so á rdirectl l  áif isinstance(š u, (int,)«   ? á*Ý .¨" *è .¹ +` A  † 	J ÏI ÷ L 6 “ ŒB q# floatÖ corx don't“t²v, but wÅH 6knoÈoÎ Ê,¡ special ca Mhem.+elœÀther, float)?:
   ýreturn float(self) + other/ ñelif isinstance(& ¯, complex)` 
% b ’# Let the‚ ý type take over.’ ½ @NotI„ ymented
' Ádef __radd__~ ,\ ¯   # ' Ñ handles more‚ ðs than add because£ Ire'sj  ]þ# nothing left to fall back toÁ Qÿnumbers.Rational«   l ý @Frac( Ý Â.numerator *è �.denomin +±  I  Ø	J  I ,H 6 “ )J f/Re	Ã½  Ä  „ d CÊi 	ÛÏ ¦£( ñThere are 5 different cases for a mixed-@addiì5 onA  À. I'll refery x ofª  above cod¹¥at doesn'tC 4 L ,D, orßõ as "boilerplate". 'r'C  wiçTe an  F of Q áwhich is a subÎ %of? ëU (r :6 D <:  æ), and b : B <l´ . The firs@úree involve 'r + b':Q1. IfJ n _, intú  C, we° 3âthat specially¢  xzis wellð2s s§^­P i¨v w23to [ñ a value from __ê ´ `'d mis½e¸ °possibilityÜ t B defineŸø€intellig�?ö-so¸ dshould› 
ö¢ ‹ ± ð . In particularÀ c don'tz@  ?Ð, even though®c… 0get�@exac	 @swerä]G tPwantsFrdo someÔê
×3× ”Jô Python tries B.Bm befor�.@This-5ok,t]it wasiùð with knowledge of Fraction, soš it can
  ü$handle those instances before delegating to Real orC •Complex.
 ð#The next two situations describe 'b + r'. We assum‚ Eat bC ðdidn't know about FracG � in its iv Ament] Õ, and that itF öuses similar boilerplate code:±  Á4. If B <: RS ðal, then __radd_ converts both5thek  C Ã   builtin rC ð  type (hey lookR €at's us)² ? ™proceeds. Ô5. Otherwise,� p_ triesˆ !fiü  u½arest commoì‚base ABC,�fall backB  Q»  ² `. Sinc–)is‹ Ð   class does¢2sub a Qcreteô  ê Œere's noB 
» € � `, so wÍ  ed ]try a† àhard as possibÃðo return an actual value, orÉM use½÷will get a TypeErrorÊ5"""½ õdef forward(a, b):  ýTif isB•(b, (int,·)/  3 ° òmonomorphic_operatorb 	a -elc _floatY  V âV 1 0(a)¿ ] cØ_ 3 a *se1DNotIÏ%ed™ ný.__name__ = '__' + Ú $ +$ D  1docC o1.__  îpreverseÍa
‹´a, numbers.<0  í ë# Includes intä ! +… ?eal�  ` =(
 5b))A ™ {k þn & r /¯/r0E ? = 0\!#, H Q#Sñ arithmetic algo ðs: Knuth, TAOCP, Vol‚2, 4.5.1#“2# A1sinput f0s aPð b are normalized.
    #
 ð   # 1) Consider addition/subtrac 0.
 (  ò Let g = gcd(da, db). Then    1  pna   nb çna*db Â± nb*da- a pb == -- "-- - 7 ==1  N  d^ d^   db (      na*(db//g)f anb*(da M   t1 � ‚ 
 ž 0 h ! (‰ E)//g d0  ú$ Now, if g > 1, we're working with smaller integers‰ÐNote, that t,o Ç Dand á úare pairwise coprimeD oIndeed>  sh@ óno common factors (they wereÉ �removed) | Tda ism Ç óna (since input fX5s aD ð normalized), he- ™ V  na, W ó .  By symmetry,‡ ö  ndm ½ ô a too. ¥- 3  š È3t, =Ù& 17  K7 O �3== 7 = ñAbove allows us optimize redup` of th Ôsult to lowesžƒterms.  ¼W   Ð 3 g2ž Ö )¨ã Q (*g "g)C  I  ^t//g2   : Í4  –  
 @ c ³  (g‚ )  
 2¿ Vis a Ts is£áuseful becauseq&un3 Ž ðdenominator d could be much larger‚:n gXQWe sh- Àspecial-case8P= 1 (Ó §b= 1), ƒ60.8% ofy õ randomly-chosen:, ð
https://en.wikipedia.org/ "/Cù_Fò#Probability_of_%a P Z¦ µ always forLös, obtained from floats: hgjpa power×2$ Ýla numerdt1 Tn oddó 
Z2­ multiplica§½  ¦1	n§|  Ñ ¼pnb, da)B¼5na*¸	  (n/P1)*(nûx ’3 a*Á-¾ë-¦ 6  .  d 	 Ð j œj ; ¤ó after divisionsJyN	IÀers.
    #
 ð4   # Also, the resulting fraction is normalized, because each of
  B átwo factors inK �numeratorB ¤coprime to9 $ 7 
I = pdenomin? .  P Inde‡ ôpick (na//g1).  It's f pwith (d &2)³ SinputH ß Ws areá K LalsoP bm P J ecommonþ  O úremoved by g1 == gcd(na, db)Ï °As for addimS/subtyó	, we should special-caseS 1 `and g2e 1K 0samÇñason.  That happens Ô  o mäcplyingF  ra ñals, obtained from floats.
( ñ def _add(a, b):  ·µ"""a + b""" ï ea = a.
G, a.Ú, bH = b, b, �g = math.TdTI Aif gœ    ƒreturn FZÀ(na * db + d
 n  	 Udb, _íu=False)] 0s =0 2// 6 Z At = N @(db  ¥) + nb * s8  ž³ Ft, gT  ± ½² At, s´ ¡ 	ç t’ 2; ¡  ä ­ _Üò__, __radd__ = _opÆ°_fallbacks(' $,  W.add) ?sub - Ÿ-ð/*  ;- ¨3sub 
  7sub 8sub ?mul * T1A¦b�Z1 > 1�‚na //= gu ù  ó	 
ë8
] 2]   :A= g2… Y   ds  ßxd  p Ø3mul¸ðmul__ = _operatoñ%r_fallbacks(_mul, operator.mul)

    def _div(a, b):   µ"""a / b"""  # Same as O õ(), with inversed b.+ âna, da = a.numv °, a.denomin… , ˜b, db = b, b, àg1 = math.gcd(f 5nb)J –if g1 > 1È  Ì •na //= g1)  b (g2] d— a] 2] d] 2] d]  Àn, d = na * [  nb	 a6 ‹if d < 0» 6 e-n, -d, ðreturn Fraction(\ ó, _normalize=Falseâõ__truediv__, __r D = _+7div+/ M /_floor45¬ (	9 * Þi) // (# :} $__z Ë  Ì " Ñ  U Ò odivmod (Þ¨ b, a % b)dã ·	¹ ,Û ³U@n_moo ð pù  ª  GG ø P i TÑ _Ï3mod$l /__"  ",  D 	'È Ã wdb) % (
 .a)å â 
 ß 7modü8modâ o_pow__÷ ba ** b" ~õ.If b is not an integer, the result will be a float or complexðsince roots are generally irraÊDal. l h F p 9 ® žóif isinstance(b, numbers.Rq ô ê *ifÁ< ==O ' Zpower³¡      2if ' ,>=×    rÉ5a._õ ƒ@ ,Z  ;  7a._]= ;_ Yelif Ÿ Ö › -Ù 	< 
À            û   _normalize=False)
  ]else:  % ÿreturn Fraction((-a._denominator) ** -power,A  E  A _numer? "Ì È S# A fÁ 1al ­ ý will generally produce anÆ `# irraþ ­al number.% (qfloat(a bnž 6  !b
\ ödef __rpow__(b, a) @"""awAb"""-  `Iif bš� == 1 and qV >= 0K  : ú# If a is an int, keep it that way if possibleû Á � %._g Å  ^ óif isinstance(a,B3s.RSÙ  0 R q%a.U L, a.{/ : 
ì ^ ° " Âf“kpos__(�ô+a: Coerces a subclass ÷ 5 toB´l ì B í i,Ç — >neg— /-an 	 Ê	\o /ab oabs(a)s 	" ')æ ^truncè  { Gif aj , <÷}-‘0 //8 gf aÀ	i A >^floorÁ Qmath. Æ ¥ ¡   _ Oceil^   ] ‘# The negŠñs cleverly convince “ 0divÁ‹ @the L 6ing LSª )« ÷round__(self, ndigits=None1"""( 
& H  “RF ös half toward evenš Ž$ifh  í k 
î ñ, remainder = divmod ˆ µ 	‹$ • 'ifD l* 2 < 1 
y  5 C„ 	N -elP >P À    return f§loor + 1
  ù# Deal with the half case:' aelif fB Š% 2 == 0!  S breturn' > P / 	˜ õ	shift = 10**abs(ndigits)T ñ # See _operator_fallbacks.forward to check thatÙ §results ofG bthese H ðions will always be Fraction andF Prefor%'veF …round(). 3if ´ , >)%Z (= qself * ú #), P ,el@F /> O 
H Ðdef __hash__(o )Á0"""  2"""2  ¤æ# To make sureN / W of a#@greeBJ!shz H - ðnumerically equal integer,6±at or Decim ˜stance, wm`follow�³ rules for X  — àes outlined in) † �documentaÖ@.  (Iölibrary docs, 'Built-in Types').6try6 Ø ¡dinv = pow=�._denomin—ö, -1, _PyHASH_MODULUSÅúexcept ValueErrorZ # ` meansË ö	re is no modular inverse| –  5_ =| 5INFLÀ# The generaýðgorithm now specifie} I absolute vº P { #¦ ˆ5 isu      (|N| * 7[) % P" pwhere Nä  £!._Ù M‚P QŒ.  That'm ¡optimized T  
0wo Ù‘:  first,;àa non-negative�; i,—  P0(i)÷i¶ B, buV3intí EmpleZÛ doesn't needM ¡to divide,Ô �is faster]pn doingd û explicitly.  So we doL !  ~ V" pinsteadC becond,^0unbµòed, so its product
  K mayM Àbe arbitrariÂPxpens6 oaompute�Pe finLPnswerµ&thÄpsame if×  usZ#e “  $C% P ¼ þ, which can again– Bdoneº !anÃ² ) jò.  If 0 <= i < P,3ÏëPso thc0est<Bash(H   w§ps a bitü@time ±a” ñredundant copy when× €  = Í Psave Õ TLlarg+Qamouns ce½½.  Y  àhash(hash(abs(óself._numerator)) * dinv)
  ûresult = hash_ if 4 Á >= 0 else -$ ; pturn -26 H B= -1.  
/ ñdef __eq__(a, b):  ƒ Å"""a == b""" öif type(b) is int0  4 !rey aÚ C ð  and a._denominò   1X ÷isinstance(b, numbers.Rational™ i (j .S t `  4  ˆ 'b.™ ‚?if • €Complex)c p b.imagÏ 0¥b = b.real‡ R [floatÜ Ðif math.isnanj$or Hinf(¤Ó õ'# comparisons with an infinity or nan should behave in— G ñthe same way for any F ý	e a, so treat a as zero.E 00.0b   ­
% { 2 nqa.from_&(bŒ: ó# Since a doesn't know how toeêb, let's give “ `# a chw7  itm> aä ® @NotIgmentedM€richcmp(A ·, other, opå‘"""Helperbº2 op!s, òinternal use only.g  4| ê  ú´ between a 7 T  `�  `,³“ eiž 1 an¦ 5    Œ! `$ e`.  IfA    nox C ", ;> 
Cf. `op`¥� one of “0ix Edard? 9"·  Rnvert� ê$öwhere reasonableù
¹¤o*‡ v,×  Þ  ¶
8= é%¦ ¿~ \ 
cÏ )&x g ­cop(0.0à‚  ] «  r,Íìp J F B 
6Æ/ltÆ<ÅI 4a._¬b¢|H.lt)U gU >U ðgt)

    def __le³__(a, b):
  Å"""a <= b""" ñreturn a._richcmp(b, operator.le)
+ �def __geV >V gV @boolX « H!= 0« ð# bpo-39274: Use 9 ò() because (a._num»  > d) can ã nÊ  ñ# object which is not aQ .& 8 f [ ð# support for pickling, copy, and deep CPreducGGselfò m ( ñ.__class__, (str 3),)y Œ Y "__ ärif type Æ == Fraction#  n  m   ü # I'm immutable; therefore I am my own clone  E ² z ˆ",   pdenominV	Ç $Ë g, memoÑ &öMy components are alsoä Ç 0ñ"""An FTP client ¶ûñ some helper funƒð2s.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel TñJ. Reynolds

Example:

>>> from ftplib imš2FTP @tp =ª ð
('ftp.python.org') # connðto host, default D @ p.login(0  ö, i.e.: user anonymous, passwd Ñ@
'230 Guest F ò ok, access restri!… apply.'t ñ retrlines('LIST® Ðlist directorå ntãð 
total 9
drwxr- ‘   8 rootäQwheel
 ÿ   1024 Jan  3  1994 .9 &: 2s :binu ; ‚etc
d-wxì @   2úÞ é ðSep  5 13:43 incŠg{ aNov 17)Z3 lib; a6 1094| { »13 19:07 pu; 3, usr
-rw-r-  Â; ã„ ¡312 Aug  1± ö4 welcome.msg
'226n !Gleter`quit()( ƒ1 Goodby  

A nice tÇÑthat reveals í of5ò network dialogue would be:
v ¨ð lib.py -d localu  -l -p -l
óÁ
#
# ChangesP€improvemê  suggestedð	Steve Majewski.
# Modifiòed by Jack to work on the mac.
# Modifi' pSiebren* üsupport docstrings and PASV6 ÐPhil Schwartz< áadd storbinary8   ü lines callbacksG ôGiampaolo Rodola'K CTLS � q.
#

imš 5sys Áocket
from s  % ö(_GLOBAL_DEFAULT_TIMEOUT

__all__ = ["FTP", "error_reply Ftemp Gperm †roto",
  "V I @s"]
_Áagic number ¡ <¢ ö.h>
MSG_OOB = 0x1E 
 ð# Process data out of band
d ðThe standard FTP server control /ñ
FTP_PORT = 21
# 5 ð	izehint parameter passed{@read³!()´ñs
MAXLINE = 8192z ÐException rai8 �when an ð or invalid response is received
class Ex(K !):…  I •()  $ñ# unexpected [123]xx Æ	C  ÉB b # 4xx´ s5  ð5 55  6 #	ñ
does not begin with [1-5]ZTAll e^ô
s (hopefully) that may bewAhereh óaren't
# (always) programmingç  –our side
µ2 = º A, OSpQ, EOF
 )™ òLine terminators (we h  ™ðput CRLF, but ac @ any± €CR, LF)
 Ã = '\r\n'
B_ b £#citself›AFTP:tQ'''Anñqclient - !.
 °To create a	0nec¨,Ì - 0 usò these arguments_ c±host, user,š0wd,Ù ót, timeout, source_address, encoding‹  he first fsg   a¶3ll b,Ãòhave default value ''.Ô 'he«#Â´€ pÂ´ mustqnumericI D sÍpNone ifpJ çb, meanTat noÒ P willP 0set* Á3ftp]2(s)� EIf a3 !is0ed,_`n thisî0now Ó µ Á for all ftp“ ` opera«s" F nß"cev  º8las¶!isc w môfilenames, which€ Tutf-8) ³@use c@.con+"()‘oÞ0al V M*C Ðo download a z 0 Û P.retrG±s('RETR ' +"  œ )<%or* 3~ ð slightly differã=Lo upx À ftp.storlinðJes() or ftp.storbinary(),
    which have an open file as argument (see their definitions
? €below fo qtails).W ð The download/up Q func: ñ first issue appropriate TYPE? €and PORT¸ ÒPASV commands^ A'''
( Ñdebugging = 0 ‘host = '' 0por @FTP_O  òmaxline = MAXLINr ±sock = None&  `welcom6 # òpassiveserver = Tru< ñ# Disables https://bugs.python.org/ü ñ	43285 security if set toJ ê btrust_c ô_pasv_ipv4_address = Falseðf __init__(self, ‘='', user	  µ !wd @acct	 ð  Í ôtimeout=_GLOBAL_DEFAULT_TIMEOUT, source‡ =2, *RF  	 õencoding='utf-8'):n @"""IKPalizañ method (called by class instanti& a ] ? eé  :Plocalö !, ü0to < @dard Z A  Opx %alë õM (Õ“connect(). 5  œ O", L , I 0 wlogin()¤ 5"""ò  ”.4 =  
! 
\+ =m
- ª3 = 
  !ifp ¼ ‚ Õ  ')0   !if)
4   8 Ý û )Senter€ípreturn H . ñ# Context manageiÐprotocol: tryÏ`quit()Ractiv_ deè'exèW*argso K1lf.Öais notÛ
Ú :try ë x 	ñexcept (OSError, EOF
 w  @    	= ofinalln  ©  T    ?w.close(uÐ  ó  4=0,_=-999ºÁ B'''Có ~ !C.  A1-a @name3 Œ   ñ
(string, default previous1 y-–:  9 D integerE   ß 	E T: theõ  O  T0agaE @ftp Iet(sA 
yÐ: a 2-tuple (
R)í c D  b Hbindï to?3its» ¯sbefore á 6ing‹ Ó ã  »  !Èq!  A.Ž ! =Gw "if@ð> 0:
            s°elf.port =  #
  õif timeout != -999:  # s9 " =, # 9if " ñ is not None and ! 
] óraise ValueError('Non-blocking socket ( C=0) ` 0supÆ Ied')‹ Ôource_address-  � 
x ’ s- *=  X ñsys.audit("ftplib.connect",ü  S.host  › ˜ m 0ck c  Ò ƒ.create_H Qion((& D P  ,“  ™ 
Ï =a 
 ¤  af¢  ð yu.familyt @ Ifile% @make â('r', encodingm  g ewelcomG †getresp(& areturn\.- 
‡ sdef get 3)Ù³'''Get the " Ñ message from qserver.N  AA(thi(Aread±ósquirreled away by §e())'''; ú–debuggingŠ  Z ƒprint('*‹ #*'Ì�sanitize¾ ß )ý Aset_p QlevelC !,  
S,  œ % ø `The reë  è rrgument% f meansÍ f0: no J ö output (defaultº 11: õ ‘ commandsP Ü‘onses butÖbody text etc“ s2: alsoD ¦raw lines š £ Ðbefore stripp$XCR/LF˜¨¯ =Ö · ¿G\ _CpasvY:valWðUse passive or act
 ömode for data transfersÚ ãWith a false amQ, use”Ànormal PORT L ç9 ?tru8 DPASVl.¨ ñb = valé Ô# Internal: "Ž1" aT!ngÊ È3ing6$f ( s  [:5] in {'w Æ ', 'PASS '}H  i �Qn(s.rÂw('\r\n'ÿ & s£S ñ+ '*'*(i-5) + s[i:]“  & r&~repr(s)Ü Psend ‡ G1 tolp, appenªQ CRLFT  ]0put. æ   
é @'\r'è    5'\n 
ê Úáan illegal newB ò character shoul. beqItainÞ† á 5cmd† S Žðline = line + CRCLF
  õif self.debugging > 1:  & âprint('*put*',/ õ sanitize(line))0 L Ásock.sendall! �.encode(  aing))
7 À# Internal: 5 ð one command to the server (through puty (z 0def 1cmdc  ,  )Æ å $: Õ ?cmdÕ s [ º areturn¼  " W from» €, strippaSCRLF.û ñRaise EOFError if4 ñconnection is closed1  é "geü  Mä v =ž�file.read @.max F + 1®aif len£2) >< ) = r§  ¤ ù("got more than %d bytes" %A 	f  ¬ c/gecaif notã¥ L0 ¼  å Àine[-2:] == 
9 =R U[:-2]; %el= o1:] in= 1=  ] /îget a response.ñwhich may possibly• ñ# consist of multiple¹ Rs.  R„�a singles£ng with noA Utrail‡2  Is‹ a sb ,B phese ar—`parateð '\n' characters.»Qtring; ¾¸  šÃæ	G 5 A[3:4È:'-'Ç c Ç3‰ \whileÙ  1nexO ;x  &    } _ A + (ï $+ @ ¨  ,    ¨] 1[:3³ ¢  ×\ &  P ç =!= ç 2 UbreakH n(
Œ�various eís’Âindicates an$ ƒ Û ' Ö  ^þ3 U ê ¬ J ­   1 k@last ! =d €R c ­@if c²€{'1', '2 :3'}ad Y N 9 [== '4Ž3F`_temp(7 	ó cŽ/'58 Kperm8 W Sproto  ‘  †@voidk ‡À"""Expect a óresponse beginning with '2'."""
   ( ° = self.get %() 0if  p[:1] !== :  A ðraise error_reply(/ @ areturnD 
9  def abort(r )N @'''A ñ a file transfer.  Uses out-of-band data.O  „ ñThis does not follow the procedure from õRFC to send TelnetG 0IP \ ±Synch; thatU €n't seem7 BworkF _ Åservers I'veF ðtried.  Instead, jusA !nd€ �ABOR commk bas OOBÎ 5'''D �line = b'. ¥' + B_CRLF  "if¯`debuggÚ6> 1J òprint('*put urgent*',6 �sanitize(g )« �`.sock.1all! –, MSG_OOB)  â2PmultiL 7!3]•ò in {'426', '225 :6'}µ M_protoM ­ 1cmdOZ, cmdTSêas3nd ” Ã Ë  %.	0putV  P x9   +  ×@void4    Š ?"""Š  �expect a  ˆ ­ [ .›  ˆ  Ù &()s &pv€, host,  .EPORT36 -qcurrent= +  Qgivenw¦ort number \�hbytes =E ¦.split('.']p! `[repr(£ …//256),  % ]u 2 \ "+ D   qcmd = 'Õ  N‘','.join(9 { ß D Ì J  â F#ep¼FOn EPG‘?6aaf = 0‡  f    = ³ªet.AF_INETR " / 19 6:  2:  L := 0' ³`'unsup¸÷ed address familyçPfield3[''Ú4af)SêV), ''êÊXÊ|ÊO Ë@make¥ 8
ÃCreate a new^ï þ1 a HÃjfor it?0ockqocket.cM _,“(("", 0),=ÐÖaf, backlog=1Ä  ž H  ™ çð name()[1] # Getá1per7ªÀ    host = sÀelf.sock.get óname()[0] # Get proper host
  @if s8 `af == 6 µet.AF_INET:&  - bresp =. �sendport(L  ,  )- Oelse; /ep; Ž ûtimeout is not _GLOBAL_DEFAULT_TIMEOU   ¼ C.set< (×  � areturné 
² Ádef makepasv4 )¼ ó)"""Internal: Does the PASV or EPSV handshake -> (address1"""c  >Ú h¦untrusted_]± = parse227¤ .�Pcmd('� &')à l H €_server_à c_ipv4_¥ ç  4    p : = � Â  " Û  8 q†Pgetpe7€D @  < /ä 9ä  i3'),{áa ý ÝT ã�ntransfer6 ª ü, cmd, rest=None÷”itiate a 9 Q overòdata connection.f  
!If! 3 �is active½ And a+` comma  nd0 8 ! !, & Pccept) u #  m à5 isG Ipasst 4asvt ,D b to itb Astara C Š Ð.  Either way6F  ñQet foA Ä  * ú expected size o+e.  The? 
, pmay be §Á if it could×be determined‹ Opœ@al `ãà' argument canM Áa string thais aã‡ 5 ”to a RESTH°  is¢ es; ‚ially a �B °marker usedrAtellÊ'   Bskip\Aany \ up tbgiven M .] aU=$  ut 
ø,ÜX Û Ñ # Ðocket.create_ ( î3lf.},�  H  dsource¥=«. 
˜ :tryÒ  a !ifÙ ž @ 9%  ) _ 0end"áQ%s" %? 
i  /  6 >cmd) c# SomeÐs apparently ºý  a 200 reply to €# a LISTfDSTORu�, beforeBð150 reply
          ó!# (and way before the 226 reply). This seems to
7  ñ# be in violation ofC ÿprotocol (which only allowsE  ÿ$1xx or error messages for LIST), so we just discardF  t« �response.! 0if  ½[0] == '2':#  Ø  $ ° = self.get -()* M _!= '1M BaiseØ _R(P 
O nexcept� ¯conn.close€  rY – JelseA BwithÄ úmakeport() as sock*  ô Î Ët is not NonO  %   ðsendcmd("REST %s" %Zt×  /  í L6 >cmd) ¯# See abov¹˜ â  ¥ Ÿ`ckaddrì `ock.acÓ· "if•etimeouqþ_GLOBAL_DEFAULT_TIMEOUT©s C.setD (” ZÓBp[:3ï;150¤!# 1€is condi¾ alÍ@caseoåreceived a 125m „ û size = parse150Ö`returnW 0n, + 
= Àdef transfer@ ¹ a, cmd,?=w)ô ˜"""Like n4 b) but a sV ² ×aet."""j  £ $ o	C q F)[0]š QloginMP, useÌÐ'', passwd =  Aacct § @'''L; õ, default anonymous.'''� !if\ [ ä  ©    U 7 4 „ 
6   8 /  ¦ 
-   + x 6= 'y  Z @in {ô J'-'}N 1# Iå"re1ñ B ftp2Êord specifie¬ w‚en we'llÒ6useC @1 °# We don't @  any other¼Œng becauü0# -7 æwant to remainb a 	, Ÿstop SPAM% ˆ W 1letï @site™±riminate by d,L `  hostðzcountry« ]z+¡@ì[‘'USER ' +ÁÀp[0] == '3':'
  õresp = self.sendcmd('PASS ' + passwd)2 0if 1 µ[0] == '3':  T   M AACCTM OacctK \!= '2K ðaise error_reply(] ? areturnŽ 
„  deœ �trbinary(Ñ ð, cmd, callback, blocksize=8192,> vt=None)È ò"""Retrieve data in T ò mode.  A new port is created for you.Ž  FArgsX  � ñ: A RETR command.»  -  §  $ ñsingle parameter ¡able to be §ed on eachE K   ì 2 ofÅ 9ream   
ð: The maximum number6 Pbytesn  : Ÿ from thej ð socket at one tim& [default: l]: Àrest: Passedb €transfer{F).  :  ›]QRô	T ½  `onse c i 5"""  B.voißvTYPE I'MBwithŒ = ­ ˜) as connÎš  while 1  {7=2 e.recv(ns  (   aif not¥I  ! UbreakÉ     Ô(l 
V ù# shutdown ssl layer@ ‚if _SSLS¶!is�  kð and isinstance(ó ,, & „    # †.unwrap(‡ �v ¢"()É¨_lines§0 = � m “ ? ‘8ÿ , LIST, or NLST ¿n optional ª"ha!Yalled‚ :   4 Á Î †ù
the trailing CRLF strippe¿ =  -`print_J /()52!ifh ; é •
£…6 = } é  õ{A{u5, \T ô "  \ñmakefile('r', encoding=w G *fp¹ º >` = fp.÷  ¢@.max F + 1æ� pif len(! 2) >H1 
w 1 rÜEÜñ("got more than %d z9" %I v é `debugg.?> 2p ð print('*retr*',ë repr(line))
  pif not  :  , ]break !if3 ß[-2:] == CRLF@  Z " =. M:-2]K %elM 1M O'\n'M 1M ‚callbackï 	l ù# shutdown ssl layer! ñif _SSLSocket is÷
None and isinstance(conn,, )­  # †.unwrap(uðreturn self.voidres † ð def storbinary($ ô, cmd, fp, blocksize=8192, è =  a, rest ‹ ò"""Store a file in \ ñ mode.  A new porí ñcreated for you.
–  HArgsâ õcmd: A STOR command.- @  fp  s ù-like object with a read(num_bytes) metho@ ë ð: The maximum data 1 toF � from fpž{send ovÒ ¾  @the “Ðection at onc [default: XPbp: An op8 ñal single parameter‰‚able thaH‡alled on„  BeachÍ2 ofÔ  afH i= vsent.  –  ß–  é€: Passed	ßtransfercmd():  … R{	È ^ ‚0ons&deÆ5""":  Š® d †'TYPE I'ÔØ$ Œ ¹ ­ A) as{B@  wh“1  "‘buf = fp.)p  %   ¹>bufE    ¸ .-all(bufX û Q   ? b” ’saÖ F @ Dn … (?É ¸@ t  ¯7u:AuoÀn:
         Û   while 1:
  ðbuf = fp.readline(self.max ] + 1)4 èif len(buf) > 0 `  o ùraise Error("got more than %d bytes" %I u not bufe _break« ÿbuf[-2:] != B_CRLFA  if] t[-1] in*     = ][:-1]`  ß C  +7 ' Áconn.sendall8" ¿if callbackŸ  ? ù# shutdown ssl layer` ðif _SSLSocket is IðNone and isinstance(§ ,, )‹  # †.unwrap(¥breturnÂpvoidres † �def acctY§, password\ °'''Send new* Ñount name.'''C  fõ cmd = 'ACCT ' +H ! „ ‘cmd(cmd)
"  † 4nls† Z*argsƒ RÄ ð a list of filesÿa given directory (default the current)¯ FNLSTÄ qfor argT :rgs^á   A+ ('ä 6argd� 6= [†{@retr¬sî ,¶ v.append= D 3dir– Laõ Ñin long form.U ˜4By 98 –to stdout5 pOptiona­ stAumen›çP func% U; alln •non-empty5 Ps befPiI ðe concatenated to¢> ðLIST command.  (This *should* only be usedå q a pathŠ)‹  N Ü`unc = Wp  if§ as[-1:]lPtype({ g)’ '''‹ U # ," =C  ~, ˆR
 
f ^  d =  +jW7uncKCmlsd; $×="", facts=[]Ì ?'''G a qbdardizlõmat by using MLSDD¯ñ  (RFC-3659). Ifš ËAomitê‰{E Ñis assumed. "¨ "= ìðstrings representˆ  Ý  G Pof inÿašð desired (e.g. [", €", "size ‚perm"]).q zdðgenerator object yieldu pa tuple�ptwo eles„  òQeveryê@ fouÄnaÐFirst elementñ is the file name,  second one! ãa dictionary
  ðincluding a variabB ñumber of "facts" depen' #on[ ErverG µand whether4 õargument has been provided.8 5''' 1if n :  ¤ ñself.sendcmd("OPTS MLST " + ";".join(8 ) )? zif pathP ñcmd = "MLSD %s" %$ 4 Oelse1 "' ¥lines = [] © Aretr a(cmd,  0.ap=˜ 1for 1 in sq Í ¡_found, _,Ð! =* ð.rstrip(CRLF).partiÑF(' '_  6¥entry = {}     z  _  z   sg ú[:-1].split(";")�  9 1keyŒ qvalue =©€ :"="€  4 „ ñ[key.lower()] = A 	” ryield (¶4 !)
! `def re (\`, from @, to ¨ A'''R+ ! a.Ypresp = E J•'RNFR ' +V Á ix Êsp[0] != '3'ðraise error_reply(a ? breturno 1voi¹Q'RNTOo » ã ddeleteã !ilÇ 
Û D# Û ADELEl  )P ”Û 0:3]ë{'250', '200'}ç Ç  Ü ? 3  Â3cwdÜ 1dir� g Ð'''Change to Ÿyrectory¾3if : { == '..�6tryR  ä   „LCDUP(SxceptÍ¾perm as msgR  if �.args[0][A ;500�       +elÈ 6 ã ó '.'  # does nothing, but could Ú ^ ÕA'CWDøM  4 ’7cmdh?sizƒ‚Retrieveý0izel ð # The SIZE comm is defineds‡RFC-3659� ž A ž0 Ã ,21¡ ™ ·R[3:].1ž �Wint(s/mk«
HMake¦,Œ�its fullJ ã	À Š ~}9'MKªŸ €# fix arþð non-compliant impleQaôÐs such as IIS£ shipped
  õ# with Windows server 2003# ðif not resp.starts3 …('257'):'  Q •return ''  �parse257(F !)
 ÷def rmd(self, dirnameQ °'''Remove a Žectory.']  A ð.voidcmd('RMD ' +3 Q m "pwm d ´ ð current working? r Zsp = r QPWD')Ó  ÿ'# fix around non-compliant implementations such as IIS™}Aquitš
-ðQuit, and close the connecÒ �+ GQUIT,HJ (A3 *¼%  0 
‘ C‡  Ó�out assumÍQanyth	 b )itª :tryÇDfileæ  Ü à „ . y = None 1if  !is4   
[  B  " .Ñ ö kfinall‰ Dsock‰   	l ‰   ‰  ‰ 
 " ‰ 
ñimport ssl
except I RErrorÏ ¤_SSLSocket} Oelse  Essl., Ïúclass FTP_TLS(FTPÒA B sub( 0whi%±dds TLS sup� !to' §as describÔÂin RFC-4217.s  vC§ p‘usual to K !21™Àicitly secur+ Û0FTPßEtrol{ï÷ before authenticatings SL @dataM ,à requires user� Cexpl… 5askp àfor it by callš ÷ prot_p() methodq �Usage exaiŽ û ð >>> from ftplibï  áƒj ' Ptps =\ž÷ 'ftp.python.org»- Á.login()  #  ò anonymously previ Y0conQv channeY£'230 GuestI  ok, access}1trie†s apply.d‹ 0 # ¥ chXy +e €ö ’'200 ProtÄ  level set< Pf  òretrlines('LIST'û 6ist4 ètN| %lyn utotal 9 `drwxr- �   8 root²a wheel
 ÿ   1024 Jan  3  1994 .A À   1024 Jan Ó 3  1994 ..
  `drwxr- ‘   2 root Qwheel
 Å   1024 Jan B ?binC -6etcC 2-wx‰ † 2ftp{ † öSep  5 13:43 incomingH E 1r-xH Î aNov 17_3 libC a6 1094Œ ‹ ¿13 19:07 puC 3T5usr† `-rw-r-  C Ò ” ¡312 Aug  1É Æ4 welcome.msõ	'226 Transfer complete.'l õ >>> ftps.quit() »'221 Goodby/ # 'G õssl_version = ssl.PROTOCOL_TLS_CLIENT
; ñdef __init__(self, host='', user	 apasswd 1acc A  økeyfile=None, cert bontext @ ò timeout=_GLOBAL_DEFAULT_TIMEOUT, source_addressK ? *,N ùencoding='utf-8'):( Bif c“ € is not · S and È  
<  ñ ôraise ValueError("O C ù	arguments are mutually "‹  O  ¶"exclusive" & ¹ sº )D » C\ 5 or-º ý import warningsE .	 $("l  ‘× Áe deprecatedç/ a‘v"custom3£nstead", DL BionW˜ :, 2² Y.� =_	¾ # ¤ =	% 
ú ¯—…ýó _create_stdlib_ ê.+B n 	° =	 H $= = ¹ $ =�	=ú _prot_p = False! uuper().ë åû2r, ß , ÜÁ ¡‰%, l	 )dÀ login(self,ñ user='', passwd Aacct	 ÷ secure=True):
  2if  û and not isinstance(self.sock, ssl.SSLSocketD  O + iauth()` ðreturn super().login(¬ ©  , ¦ %)
6 Adef I  S j ”'''Set upµ õcontrol connection by using TLS/SSL.''']  « /ifä $÷	raise ValueError("Alreadq "þ ^ Dpsl_vers  !>=MÊPROTOCOL_TLS“ ¤ presp = à.voidcmd('AUTHÖ 'e OelseB ;SSLB g  ès  W�ext.wrap_ )etñ erver_hostname=@   
™  DfileW  J P.make ò(mode='r', encodingI  
M I 
,1cccœ + ðwitch back to a clear-text19(', L ™( Ö %ï?CCC¨Q un§x Y 
/oprot_p2	]@data)Z! # Åñ defines whether orHBthe B �hannel is†0be ƒ iected.˜õ# Though RFC-2228Z Åfour possibl?  L{levels,G  @ ð4217 only recommends two, Cî|Private† ! (Ü òC) means that nox6ityÎ »used on theˆ  þ "-cþ #, n  Y PY ,. I xshould ; ç<TLS¼ PPBSZ ð  Î MUST still; ðissued, but must have a paramet¹fx 0'0'³…indicate`bufferd Ô ak
 QplaceWÍ M £Ð   beþmapsulaAÜ 0 á:»P* M _|_[ 	¢ a3 d2Z Z ö6	² ï² IFalscÀ return resp3

  ö# --- Overridden FTP methods& õdef ntransfercmd(self, cmd, rest=None):V  ] ùconn, size = super().E ? )9 0if _ Š._prot_pV Z  T ñ	elf.context.wrap_socket(z 	S  6  ñserver_hostname=„   
ž qreturn d Þ 
&Qabort6# oeúas we can't pass MSG_OOB flag to sendall(| 0linMùb'ABOR' + B_CRLFë ·  	.D  6 
H DrespA€getmulti& o  ifÝò
p[:3] not in {'426', '225 >6'}¢±raise errorÆ o(s … I  Cò	__all__.append('FTP_TLS'7   Q `s = (E[ C, OS	 3EOF
 qssl.SSL  )


_150_r7`None

Ë‚parse150– ¿ @'''P ¡ the '150'ý ñ	onse for a RETR request.tRs3 ”expected '@ or x ; !isI€guarante. oJ ‘be presenf ƒ ²150 messagem 1'''+ –"!=« Ã  âzRreplyä : sglobal  $if 1 isª K ‘import re*  ] : å = re.compile(  "  r"¸ ð.* \((\d+) bytes\)"(Ð.IGNORECASE |C RASCIIß4m =Š g.match¸ !if6m› … Z  áint(m.group(1)þ?227þ2227b U 
þ=227þKPASVþ åsæ¢ if it doeè �ò	ain '(h1,h2,h3,h4,p1,p2)ÍB0 ('ið.addr.as.numbers', ‚Ÿ#) tuple. ¯ Ç ƒ — – ;  + 	!r'ì, 
'òO _.searó×  S03 = þsÊ VÃ = '.'.join() B[:4]w ` P : È4]) << 8) +  54 m \ ¡
V1229Xc, peer^9^On EP_)0|||Ê |V	À.numbers', pñort#) tuple.'''
    if resp[:3] != '229':   ðraise error_reply(- )  aleft => ’.find('(' 1if  X< 0: C WprotoC KrighD 2)',= 5+ 1N (  O z š W ú # should contain '(|||port|)ò £ 1+ 1ø  × [g O- 1]h ˆ Sparts[O :F q].splitì  5+1]Ï Alen(< )s5m 0hos+rpeer[0]€  or 2intO #[3d preturn 3  , ü ñ 


def parse257— )x @'''P ¡ the '257'Óñonse for a MKD or PWD request. –This is a1 /to0 ò: a directory nameB R¨ s{     1 in A257 x°/57°ê13:5ó8' ": ‹ ð" '' # Not compliant to RFC 959, but UNIX ftpd doe¼ !is1dir» $= [A = 5 @n = õ f²while i < n‡ ÔcLià  qi = i+1G  ˆf c == '½  `i >= n¬ i "[iç )  - UbreakT   h Î 
 1+ c2 ] Z rint_line( \ÀDefault retr  s callbackYp7 0 a  ã G ^ âftpcp(source,   l„, target    €`, type &I'Œ `Copy fyðfrom one FTP-instance‘ uanotherŒ cif notg  _ ®{   ' =” $~ �TYPE ' +�  ½ �.voidcmd() O   2 Ì  Ò# =Î#27A.senT y'PASV')W    7 , N , #é:}ðuser must "listen" [...] BEFORE T 0ing, Û ª# transfer(ð# So: STOR before RETR, because hereE fS"~ "'t# =! é T _ ŒÊ 2if 5 Ø Âöin {'125', '150'}É¢%  
Ù s€ €  È ß 	€ 5 € 3ù Ù(ä 1 åUtest(õÀ'Test prograð m.
    Usage: ftp [-d] [-r[file]] host [-l[dir] d
 2p] & Q ...
I b-d dir bl list ¡p password 2'''0 ñif len(sys.argv) < 2:#  — õprint(test.__doc__)  3 sexit(0)K ²mport netrc Ñdebugging = 09  rcÖ q = None `while M  € ¶[1] == '-d'† G  !+1?  ¦ 8delA  (if 3[:2X rX ñ# get name of alternate ~/.Å  ¬ ‡ ¼ ­ A[2:]p ˆ ¾=Œ /  é`= FTP(! U�ftp.set_ã alevel(  A" ‚userid =Ì 	 ‘acct = ''V 6try¯ Ã Robj =“Ô (Æ P æexcept OSError; 2if ' q is not®  ì  ñstderr.write("Could. Áopen accountD"ž  7  p" -- us(óanonymous login."© 6lse€ 	ç  R ,t &t,÷ .authenticatorss = ;Key  @# noW Ë !orŽ	Î 		  D   &"NG í  þ (Ø »dà 1forZ6 in\62:]%!if! úlú “  g @dir(å ÇY   -el= � #  cm~B'CWDz    9  ‹  %   r+ ' ' +’ 3 4 `resp =üÏ.sendcmd(cmd�  pÈ   7Ppasv(­ Ù  2˜iveserverK H }  - õretrbinary('RETR« ?, \Î 9 !  ybstdoutb, 1024n  X àquit()


if __h!__Ä ƒ__main__Ê  `ð()
"""functools.py - T  ì@work Qwith & ð
ions and callable objectsH ñ	
# Python module wrapperL _@ [ C  ð
# to allow utilities Ù0tendN ²to be added3 2the� O mm €.
# Writ; óby Nick Coghlan <nc
 òat gmail.com>,
# Raymond Hettinger <pÄ eat rcn)  õ òÅ�ukasz Langa <l @at l @.pl>† ô
  Copyright (C) 2006-2013ðSoftware Foundation8 üSee C source code8”credits/c_ p

__allà£ ['update_u@', ' s	 ðWRAPPER_ASSIGNMEöNTS', 'WRAPPER_UPDATES',
  ð 'total_ordering0 Qcache	 �mp_to_key Elru_ kreduceK ppartial-  `method îsingledispatch * 	œ o òd_property']

from abc import get– b_token  ´collections( Änamedtuple
# òtypes, weakref  # Deferred to ² _³ "()\ treprlibD  recursive_ # t_thread# RRLock r  ÿGenericAlias


# < Q ð update_wrapper() and  Ðs() decorator+ ~ :?

#{ �are toolsj�help writœ � sper funÂòthat can handle naive introspç$

åðASSIGNMENTS = ('__module__t __ Hqual 0doc ƒ)±  '__annotaYE__')v [r @dictI \)
defà 	…f  d ¿assigned = ì  3 ý2 ¨ !):ä A"""U ! aw ˜Ólook like the" d™
D #   Ar is( ¹ B #beÿ d- d- †originalV ï Qis a ¹q naminge µattributes * „directlyk +º  š  k� (default–F  ˆ ª.w )& k® !ofÀ ê r ÜD  H Awith)  correspondû ÷  Ý E ~Ì ^	Å 
8 1""" @for c 5 inW+ –6try   °value = get6 (Õ !d,D ” except A³ZErrorJ Apass‚  W Jelse sa ra !, € h º DC 
  ? ").( ( ¾ R, {})[ ó# Issue #17482: set _Rñd__ last so we don't inadvertently copy itÞ #·š‚ion when- é"__E7 X(r.v =wYð# Return the wrapper sñ8o this can be used as a decorator via partial()
    return wrapper

def "s( !d,'  + ø  assigned = WRAPPER_ASSIGNMENTS* Yupdat) ‘UPDATES):P E"""D– òfactory to apply > _‚ 1r() — Ñper function
J A   RÄ 
ê Îthat invokesP „with the$edL ]  : ! „ Ñ argument and:  s�  & 3s()5 L •remaining> ¦s. Default @ are9 =for© .K TÙiã µconvenience
 ƒ ‚simplifyC u é4 toH Za 1"""! 9 
- ,� d=î )pe  #=,,Õ "d=O od)


# < Q À total_orderÿ Tclassá or# v :r

# Thew  w ASs all‚1ðroot magic method directly
# rather than us¿  } correspond 1opeÆ1.  ðavoids possible
# infinite recursionR ðt could occur whe $e O ð	 dispatch logic
# detectm€NotImpleúaed res»`n call' `reflecðÚ !.
Hð_gt_from_lt(self, oæ *, W = "'Öà a > b.  Compuc Kby @ë e Á (not a < b)¥¡(a != b).'Ü3op_¿ a= type’ �).__lt__ Ÿ 6if 2 +is³ Å õr|, l   ‘ E  9  – %/le%1/<=&"or (a =!k1or "==$g2> ± 5t¶©HÀImplemented=ðLNotImplemented):
    'Return a >= b.  Computed by @total_ordering from (not a <= b) or (a = !.'Q ñop_result = type(self).__le__ �, other)/ 6if 2 :is ¥ ¤  ¨ r§ , =  7notE 0or s  • h ò

def _lt_from_l’ … ,q =€ %<$a �and (a !!k6 � "!=†g2> ±"6t%(gtª%EA> b)˜(/gtIS,eJ%+o!a "oj!GIf2<‹  HG ÆHm+ e’g’ktg%*tÀing from (a à>= b) and (a ! ñ.'
    op_result = type(self).__ge__ �, other)/ 'if2 ñis NotImplemented:$  W freturn,   �  p  ’ e ò

def _lt_from_g� ‚ ,n =} )~ "'R{ ða < b.  Computed by @total_ordering e � (not a "g … Œ�

_conver–{< '_ð_': [('__gt__',   Å Q_lt),(  }  ( "le( "leR(  îP ( ]Q  y  E y    y ) ey ¡ Ël( É &e)y  y lQ gò Ê ( (gty  æ y   4, _CgÊ ( É Re)]
}ú
 C(clsÖð"""Class decorator that fills in missÓÜ¡methods"""ò# Find user-defined comparisonsÀthose inheri3 [‘ object).G ðroots = {op for op} ® if getattr¼ @, opµpne) is ã U ! }_ !if& f Ï Ìòraise ValueError('must Ç å at least one ÿ òoperation: < > <= >='Ä ^ p = max(  s)d Â   # prefer k0 to
 2e__
  �
 1e__¯ @nameÊ Hfunc[^ ]Ç < - ä 0in   s   ‡  opF 0.__( p__ = op o  !   sc   € â cls


# < Q à cmp_to_key() ³  k µ er$ w :v Wmycmp/aš =’ ¦into a key cQ"K(ŒL  `q__slotsu['obj']€ V_init'bj=  A  Ô@.obj¿+bj<   	Y
%à '  I   [) < 0S  ›, ( � À         retð
urn mycmp(self.obj, other s) > 0
  ¡def __eq__, ( %):!  ( ?retS -==T /leT ,<T gT ->T ñ __hash__ = Noneó ë bK

tryñfrom _functools import cmp_to_key
except I RError: �pass


# < Q ð reduce() sequence to a single item' z :à

_initial_misj Ð = object()

K– -Eion,ž #, ; =D l3"""�Ø B •iterable[C Á]) -> value
4 „Apply a 5 ð of two arguments cumulatively)"th$s+ a¦ N  or?t !, ý@left6 Áright, so as „ M 2   †N § ô .  For example,½ðlambda x, y: x+y, [1, 2, 3, 4, 5]) calcº !esN ô((((1+2)+3)+4)+5).  If\ñ  is present, it Älaced beforeª mM  &» !in! s À and servesô Ña default whe. – £ q aempty.  Ó	 Ait =T(­)¹i» E �Œ    V± = next(it)g   ‹PStopI9FtionH  " ¡raise Typeª(;     "Å)Ï ¼  „… with noqˆ "")'EFelseu $  <ú f ležn in it0 Î(A 2, e/ ;© ­Ó ©b0par3%()�€ applicaœ¥@P# PurèA0al,´ódescriptor behaviour
class ¤ „f"""NewMô" »   ûUgivenÝ [ 7‹keywordsq__slotsw"£ €", "args 4   ‚__dict__ ¢weakref__"A nð	__new__(cls, func, /, *aórgs, **keywords):
  ÷if not callable(func  & õraise TypeError("the first argument must beH 8")
c qhasattr^ 0, "e "f pargs =  . +^ sF  Š À a = {**+  ß }5  ' Y   ™ ðself = super(partial, cls).__new__( 
1 .D P h  J ¶ =¶  ¤ 4 =  : preturn ( h `def __�0__( `, /, *ä >T  3 . 2 t Î !(*5 c  -˜ ñ@recursive_repr()Ã ®   ® ˜ ñ qualname = typeÍ  Z !__C  Ù t @ = [I ( ˜ ))]! �.extend(% ¢x) for x i=~” Q 0 Áf"{k}={v!r}"5 e(k, v): -†.items()F *ifº ²module__ ==Åftools"N { ^fæ! $.{ó Ð}({', '.join(õ E)})"å : 0 1 zNduce|K x&, X),) }@,Z  Å   ’ or None,1 „__dict__ ò˜ tsetstatš !,  x±isinstance(" w, tuple)  Š ‚xVto __m ˆaH "Ì2lenf k) != 4·æÑf"expected 4 1 Õ v, got {O }h  ,€, kwds, @spac	å fNif (~ Q   +5 orA @   (e 1 isÇ ŸA and @  $  , °,))@ Ÿ E ) J ¦ƒinvalid [ ×   ó@ # jKöin case it's a subclas!if] ø  ô 
Ë î  ò$elË  )7  b ð: # XXX does it need toÍ‘*exactly*:?v~ = ‚	i* i    B= {}_ çnW=9z "  b�À      self.kð2eywords = kwds

try:
    from _functools import partial
except Im RError7 ôpass

# Descriptor version
classA âmethod(object)< A"""M & d> Dwith5 ñ application of the given arguments¼ Sand kÚ !.
 0Supª ðs wrapping exist	 m  s : Æhandles non- F `callab Âas instance Ì !s.# 2"""r ðdef __init__(self, Nä, /, *args, **¦  ytif not k (5 )™   qhasattr ·, "__get__"@  D ¡raise Type›€("{!r} iÔ Z W or ak"À  ?  q.format~ "))è  - #Û ™ could beW a like ý)¶ which isn'� ,}  # so we ca  rinherit�}@ (itVRifiesz %is1)J Tif is¦´ ,JŠ 6�# flattenðis mandatory in order to placÐ  s/Õµ before allx [other™    Ð# it's also m? Àefficient siS�only oneÞ ï@will[ )edl  ˆ .'! =0  "  t"  +ž 2 •   K •` = {**Y . ´}c BelseÃ D   H  : q +  ‚ =‚ z mUCreprUÃR à", ".join(map(+ !, �    )Y 6 = 3 @"{}=,"êFk, v4  ¾  @for +  *m ^ w.items(x C@_strgð= "{module}.{cls}({7@}, {°   K &})¢yreturn L ³ O =‡ !__yR__.__ &__kË  >clsC �qualnameE  Ë F  
 y  ÷ = / =	 —*Òmake_unbound_ô‹6( w€(cls_or_:§ 's ) 7 ) 5 ».  
v * ÿ & GÍ Ò.__isabstractà B__ =ð A À    _method.ó_partialmethod = self
  ‚return _ 
 Àdef __get__(- ñ, obj, cls=None):&  A Ñget = getattr, ƒ.func, "@ 1", 3 2 Presul5     ifE q is not2 d  h @new_Y m (� )A  % 5if ( J  ¾ ’ 
O  . „# Assumeê  
`ing so 
 ùnew indicates theq G þcreation of an appropriate callabl6 œ(¹ 1, *´ rargs, * Škeywordsï  ~ >tryÚ   a 0.__N E__ = Ë ÿexcept AttributeError_ Epass@ 2if o  À ×
4 @# If;€ underlyXðdescriptor didn't do anything, tSF thie  Õ `# likee�instance ©%od‹  & Œ èã._make_unboundæ3().ŸJ Ò @ÒAertyh ¢isabstractƒ +I ? ’", False)t p__class†AitemÃ o ð(GenericAlias)


# Helper ' �1s

ª dunwrap( ¥ „while isM #, “%  R 4 ! =Z Mß   ?

# < Q ¡ LRU Cachez  Ô   decorator! t :1

_l @Info.µamedtuple(" ò", ["hits", "misse
 `axsize Acurr A])

¯ó _HashedSeq(listW’""" This % �guaranteeòat hash() will bHöed no more than oncX ù’element. Y ðis important becaus: pe lru_cWa  m Ó ìñthe key multiple times on a 6  ù .¥2"""	 q__slots¦'P bvalue' ‡F_iniPAtup,å =-    ¯•[:] = tup•   .* W ! =; C(tup-b  ! ‡
C Bkey(oÅkwds, typed,|  – À kwd_mark = 3{ect(),)% @fast= ës = {int, str}% T= k =3 “, len=lenP"""Maët ’pfrom opBally¨ R posi @ and»ðword arguments

ð    The key is constructed in a way that ðflat as possible rather   n
I €as a nes> G 0ure ñt would take more memory.
8 0If I ee ñonly a single argument and its data typ, áknown to cacheK  $ °hash value,X n‚ K ðis returned withouté prapper.!isL ²saves space€ @mpro Ãlookup speedÃ 1"""4 ð# All of code below relies on kwds preservingž à order input bmse user.O ñFormerly, we sorted()9 M 0befOqlooping¾ Qe new¹“is *much*L ò
faster; however, it means"ðf(x=1, y=2) will now be treaÓ ßJ òdistinct call from f(y=2, x=1) whichD "bežÂd separatelyÜ  s=ân!if:b  N    += U_mark €for item¡ . 6s(): >   : !if7d& ` `tuple(S@(v) ] vZ Qargs):  N �   A › †2s()J ñelif len(key) == 1X| pkey[0]){  §  s¬ ± ¦1[0]–  ¡_HashedSeqU ¡

def lru_Ò(maxsize=128, c=False-ò"""Least-recently-used±£ decoratorãCIf *P *ª0set|2Nonhò LRU features are disabledæ h
¿ …can grow‚DbounM j  dh  TrÉ¿s]`differ ' sjñFor example, f(3.0)“ 3f(3ê
æ	Þ ^ !thµ  sresultsA¥stç ð d function mustI ™ 8 AViewÊ¬P statW‘cs named šÐ (hits, misse Ò`, currÜ[ É1 f.J à_info().  Clea zõ g 	5 c, "()œPAccesPe und€ ¯Ñ 9 1__w63d__Ó ðSee:  https://en.wikipedia.org/  /C­€_replaceÝ¡_policies#�_�_�b_(LRU)( e‰¡# Users shW4³  � through;¢public APIX#Ä"  î4, ,.'f.å |  0�internal� ôt  ú�encapsul8 TÐthread safetyZ L Pto al% D i¢ a7 ÙÐhange (includ„a£C version)~Ôif isinstanceüS, intð ò à# Negative maxósize is treated as 0
  aif max# E< 0:    =0 ãelif callable( ö) and isinstance(typed, bool)P õ## The user_function was passed in directly via the˜ …argumentœ 	F ,( =
 U, 128. ówrapper = _lru_cache_ (K #, Å  _C. \Info)P .I ó	parameters = lambda : {'&':• 'U "':] }Q Æreturn updatš ¢ ,4‡ ‰b  Ú†not Noneoõraise TypeError(m  Ø`'Expecdfirst aõ to be an integer, aðA, ore 1')
N ådef decoratingÖ
SÑ ˆµ»  

 r*ÎA# Co[ñts shared by all lru … |s3 ðsentinel = object()÷ ƒ# unique  _dùcsignalQ amissesã €make_key¸ K À  # build a " AfromºâZK ðPREV, NEXT, KEY, RESULT = 0, 1, 2, 3 U ‘names forN ²link fieldszõ 2= {D0hit}´  M ¸ 0fulQFalse 6 b_get =æ . p ±bound methoclookupÖ 3or ç cK 5lenK p__len__½  V l  VqwithoutH‚ing len(ÆÈlock = RLock¢ Vpecause û cedlistòs aren't threadsafÝ 0rooØ $[]š !#  !ofKó circular doubly`  a Ù  , p[:] = [ ,= ,÷ ` �# initialZ`by poirgH2elf§[ ==\c  ™  ç(*args, **kwds/ ( A# No¬ 9P-- ju®³ statisticsY  5 ’nonlocal 	  Y += 1 PresulA	œ 2 µ9 ð – /:  ˜ õ eSimpleù BPorder
"or[Flimi d ü Àhits, misses'
  ùkey = make_key(args, kwds, typed). úresult = cache_get(key, sentinel. 3if 1 eis not' :U  Ž �hits += 1 creturnI 	 _misse6  t ò= user_function(*Ü  **Þ 
© Î [key] =j 
„ … aelse:
  À »def wrapperi 
ì á# Size limitedGñing that tracks acceÙ ¥by recencyg  k ð nonlocal root, :", i, full. àšwith lock¶  w Llinkù
F & 1if ) ñNNoneK  ) �# Move thQnk to �front of écircular queue×  C    m a_prev,x p_next, Ë,É! = > P[NEXTýP  E 0   U[PREV0  € 0  as- ©2 & � , ¹ R  & ?astY 9inkY &  A{ a
û   w> ƒz0if Æ!in/P@GettL£here meansW�his sameF “was addedr#j S whil¤@ock < ó released.  Sinc ?inkI ðupdate is already done, we need onlçä/thåp# compu1YCand Z  B2cou6�.Œ Mpass Aelif5¦"Usã 1oldq 7Bstor 1newV � › | 0oldÙ ^/oo­# @[KEYY*keöv' QRESUL³x Ú  1 q# EmptyMaoldest ¯  ó1 it  Ç    ½ ñ # Keep a refereõ®  › P   ‹ ? toŽ  )!ent  irO  º�s from go¿±to zero dur  0. T<Twill _ 0pot�ð	ally arbitrary object
    ý)# clean-up code (i.e. __del__) from running while we're
I ð   # still adjust2 ¯the links.1  root = old
 o[NEXT]) ‘oldkey = ( ?KEY' PresulU * _RESULT !  K W - o = Nonâ °Now update Ý ÿcache dictionaryè Adel * [É ¾ R# SavW ópotentially reentrantC ÿ key] assignment0ñ# for last, after­  ò B and“  hn ¿been put inJ €a consis’ o stateå á ž ÓS ]else:  Mc# Put ¿�in a newª 1 at¿ �front of Oqueu‰  ÷ ÔOPREVn —@ = [. ,Xc, key,ƒ 5 2ast§	a ( =œ=¶ å "Usâ.ô
_len bound method insteadæ ‘len() fun`S Èwhich could 9�be wrappeW � an lru_x  itselfÈ�full = (*  ¢ é() >= maxsize)… creturn3
 2defv_info()îƒ"""ReporÉL‘istics"""<  –with lock9   j  _CqIZ °hits, misse Ÿ ,| 9)’  ër“ BCleañ  
  ì  šnonlocal €  6Ä W .… - Þ `oot[:]� ¥� ˆ,Ž
� { # =ü I = 0M  ‹ ‚ = False!r.� ˜² > 
$ ¥ %  & ‡- R

try¨)_ªqools imê_t_4 �except I! RErrorB �pass


# < Q ñ	 -- simplified access toP‚infinity+  5 ˆ :%

R(user*cion, /# 'Sœ  0Ághtweight un"ed— ø.  Sometimes called "memoize".'¢xÐ(maxsize=Noneÿ)(user_function)


# < Q ó singledispatch() - - ” generic Œ   decoratorB • :ð

def _c3_merge(sequences):
    """M µs MROs in *# c* to a¾      uÝ ñ the C3 algorithm.
K ò0Adapted from https://www.python.org/download/releases/2.3/mro/.E 1"""M ±result = [] ¢while True¸  ¼ ©  ' as for Â  õif s]   # purge empty   Z  J fif not d   rreturn “ 4 o 12P :k Qfind nð candidates amongb e headsG  a ' r = s1[0ó     i 2i 	?  % &ifm + Z2[1:]È  (   o MNoneM  % Pbreak	  >arejectùqcurrentÆ ù, it appears laterK 7els®L !  Y ( 
¸  s � 
¶ ñraise RuntimeError("InconsistŠ ¥ierarchy")W ¬.œ 5nd(ñ ! ‚# removeÔ VhosenAG {!eqQ9
ž  b†eq[0] ==A 
$  ú 0delý Ü’Ðro(cls, abcs=ú •PCompu8 m`method�0olu½c order�€extended”�lineariza& ˜IÝ  *e Á* are given,ú Äò works exactly lik±built-in C3	a 0 usð=or ¢ | n € ñ+is a list of abstract base classes that should be inserted Ainto¹ á0ing˜`. Unre�ad ABCsæ ð	ignored and don't end upÍ"thõF V. TheÏr sK Awher%ir°pality im’troduced,Ÿ ‘.e. issubÍ Þ") DsÂª Ø% ´ itself but& L QFalse+ 0all% @ dir†-¢. Implicit®  ±aáPK °(either reg4 €or infer ± � @presœ„ specialÜ N ‚__len__)fž� �ly after¤1las— 2 ex¤ Ys$ in" O 0MROp Bsaid³ ©. If two iÛ ¾@next˜aeach o× M Ñà, their orderiñ%ng depends on the order of types in *abcs*.

    """ °for i, base$ ð
enumerate(reversed(cls.__! as__)):7  C °if hasattr( ÷, '__abstractmethods__'1  5 ëboundary = len] E - i_ . ñreak   # Bases up toß ñlast explicit ABC are considered first.N Felse· ‚ 0   � @ist( P) if 	  9 1 []& l 
0 	$[:\ !])4 4 L Uother ly 
I H :I  ¦ d £ š Î Ðif issubclassOÌá) and not any(�  P 3 b1 d  a 	‹ 	; ÌÑ# If *cls* is–† ù that introduces behaviour described byZ A# anÆ*ç á*, insert said ¢to its MROÔÊ 
c0.ap�ƒÖ Ý
, D Rw.remove: ñÂc3_mros = [_ & ,$== () g 9  Ë s>{ A M 9 M ?J 6 G qreturn Ô Ferge'•[[cls]] +¤Ô v %+ š  c  > [?  E + [?  ?  < ð )

def _compose‡ãÔŽÂ"""Calculate†}³ resolution ¥‚a given ª½õIncludes relevantâ 2 €es (withî irc qpective$ qs) from¼  „*¨ Ð* iterable. UÆña modified C3 linearizaª “algorithm– ¨` = set ._"__å1# R¾á entries whichàalready presen— »  ? € or unre<dY q3is_ C(typh r3  ]"inø n1typ0mro  =  « isinstancea â, GenericAliasé C    G Ù@cls,ý); ‹ Än­nê Cñ "n)²Tcstrictú 1of ¸|ñ(they will end up#p  heÂ ”9waypT  ý t ¶b  inÐ #esºÀ       if tyòp != other and typ in ».__mro__:
  µreturn True  BFals ðtypes = [n for nX  ñ
if not is_strict_base(n)]M ð	# Subclasses of the ABCs@ *A ó* which are also implemented byF ñ*cls* can be used to stabilizS ¡ ordering.3  \ °_set = set( !s) 0mroÉ    Í '# Vfound)  5 - 0sub¼ utyp.__sÜ F__()<  - 0if ,  n s•$is6 P(cls,% :  > ~ ¡.append([su54subË c � eì ]á  @ –G 
˜ 4mroX 6typ2  6 gcontinp# Favor¥ ÅAwithÇàbiggest numberÝbusefulì k T ƒ ð.sort(key=len, reverse=t‚ _5 
¸  $cl
  k   ’s’^n mro&  * Ž÷0_c3- ðabcs=mro)

def _find_¤ ƒregistryÄA"""RPs$ !†matchingÚÄation from *A *ä … í!.
CPWhereL @re iÙ  1 MeredQ Ðor a specificÿÑe, its methodP aresolu€ 1 U P Û û  a more genericc • PNote:¾ 0doeŸ  t Ekain an= á !he!� ƒ*object*« ‘this funcŸ Cmay ‘CNone{ 1"""; Æ†_compose¯’ry.keys()^‚0 = H >  Mt;	"2if * it/ 
@a# If *% *:ä @icit×F but¬"an‹¡unrelated,|  €  ’# equallyu !L  &1fusüb tempt6‚to guessç I   Aif (Ñ  lt	4cls6	„  ; 
  8à ; #ïâJ C, t)l ðraise RuntimeError("Ambiguous disp8ÿ: {} or {}".format(Â j 	 Ubreak 9if %
ÝC A = t0 {PQ.get(" 	dsingle§ (·å A"""S - N & Ý“decorator×PTransà 6s aminto a> ,3 Ðhave differenñ>t
    behaviours depending upon the type of its first argument. The decoratedL ñfunction acts asC Ðdefault imple: a#  , and addi !al@ 
# ðs can be registered usŸ  š  ±() attributª 1theL „generic ” . 1""" #¾ ðre are many program³ bat use9 Ðools without | òledispatch, so wm ð # trade-off mak¤ 
- ñ marginally slower for £benefit ofš A ptart-up±such applic>Ðs slightly faÞ aimportµ±s, weakref
W /qry = {} È „_cache =0 ¡.WeakKeyDiÌQary()1 ( Ò_token = None[ Ddef M a(cls):/  ]3"""ˆ_ˆ.' P -> <  >[  D 0Run–ed ò algorithm to retur­ be ‹vailableR ” x¸given *cls*bHon *´ &*.‹ > — —nonlocal d (if q is not3 E ucurrentU2get� y *   V 9!= @ 
[  1 oT k.clearT  ' Â  T Ò :try`  ¬% =•c U[cls]4 ú except KeyError@ Q  Š U ­
O  ! S 
 ! B `_find_  ’,á"ryÊ )   
 n ! =8Ä _ J  î¥_is_valid_B  ) k ý; �sinstance  ,ž)þ i G·fAlias)r "erC  5=�n k2 )q ; W  RZqs a newû ¤£+ Þ"3F § !ifŽ H ö 
I ! k“lambda f:ð0÷Jelse@ ]  ‘a ‘aise TypeË(  ~  Af"In+ §`�B)`. …8  �f"{cls!r}é  Œ Ža class./ Ñ  =  an’0get
#‚'__annot/ð__', {})
            Ûif not ann:
  ýraise TypeError(!  0 ÿ%f"Invalid first argument to `register()`: {cls!r}. "I ÕUse either `@; ÷some_class)` or plain! `P @on a þnotated function.� )“  ) y = cls
 ð# only import typing if> c �ion pars ¹s necessaryD Efrom; I éget_type_hints. €argname,Œ � = next(iQ
4 (² ª).items())Î ãA_is_©‘_dispatchu _(cls)ü.!ane Sfor {¸ ï
2 isƒ å�‘ry[cls] =Ó àif cache_tokenX ðNone and hasattrí û, '__abstractmethods__'I  = n (aL g.clear breturn§ ¨ ÷def wrapper(*args, **kw~ ¯  
—�0f'{÷  ñ} requires at least 'p  £ p'1 posi%alµ&')ñ» á (‘ R[0]._�9__)Á 9 ‘  4s  t © `__', '"$leZ  ‰ 'Wäiobjectç;.$ Ter =  ï   \ $=  	  5 @ry =Œ`es.MapÎPProxyò(" ” X _á_í \  þh supdate_7 ( ,ë R _ ñ	


# Descriptor version
 0m´¤"""Single-ç ’ generic ' % dU .£0Sup¿s‡ ¬Pexist	 , s6@ndleŸ&n- á `callab ³as instancet !s.# 2"""r  ôÓ__init__(selfÃ  žôU Ïƒ  �½J0"__�'_"4 D "0!r}
 H _  Fa"ö Ÿ .L`
}› à  u /  ˜ Œ  ñ @#erñ Ccls,=–½ 3"""´_´Þ¯ _ A) ->=R { R\ps a new– lezaL ‡ðthe given *cls* ð  *generic_methoSd*.
  5""" ñ#return self.dispatcher.register(cls, func=method)
; Àdef __get__(< ñ, obj, cls=None):&  p * < À(*args, **kw
 &  * % - =� ˜ (5 å[0].__class__)g  A Ì H .Ÿ ™ ) Ë  : _4 ¢isabstract $__‘ .__  A 85  ) ó update_wrapper(8 ,ô  hÓ Ï # ­ ‘@propertyQ \—  “^J qgetattr .l ?, 'Ö ß', False)


# < Q „ cached_Ì ó() - computed once per instance,0 @ as À PibuteH › :à

_NOT_FOUND =Ï@ect(l„ ´ á�&ni X{ l! =G¸ s  Ï pname = 7
 Q__doc€ T . 
$ Àlock = RLock­  Z • @set_[ ¡`wner,    "if{Š !is‹ à  O   ­  E ‰ AelifW # !¼M 
E õraise TypeError(A  b   ð"Cannot assign the s/ñ to two different} &s Õ M   If"({» �!r} and {Á Z!r}).5 ÞŒoGå%if® A‚ � ÷ {6<use¥• öwithout calling __ † on it."z:try»‚% =P  �Uict__Í ±except Attr ãQ:  # Ò#llR¡s have __d@ r (e.g. cÖdefines slotsŽ  Ênmsg = 3@f"NoÅN '  Õ d{type(»3)._ 
ø c $f"*  aò >´9 C  ´‘msg) from[4Rval =´B.get˜<&, �0if 6 'is 
« êÓÐlock:
         ô.# check if another thread filled cache while we awaited lock
E  Rval =2 ý.get(self.attrname, _NOT_FOUND); 0if > 'is& :&  i  ' != [ Þfunc(instanceT  . ?tryG   Ü [K ¦ 0] =‰ z ÿexcept TypeErrorY msg = (F  y   ðf"The '__dict__' ƒ æibute on {typeÜ 0.__Dd__!r} ò / "a ñdoes not support item assignment for¯Ying { h Ÿproperty.h u ß Vraise,õ (msg) from None¹ areturns °__class_get­  __Q  ðmethod(GenericAlias)
"""
Path © ñations common to more than one OS
Doð use directly.  ‡ñOS specific modules im4`the ap`riate
uj Î Cthis3 Á themselves.› B 3os

 ±stat

__allÚ "['® ðprefix', 'exists
 ƒgetatime c m 1 l¡   'getsiz. Pisdir7 Qisfil Hsame Bopen 	E  '  ¤ €']


# D@0a pb™ P?
# Tñ �is falseBPdanglCàsymbolic linksÇpsystems†† 'a.
def U  s(a )N±"""Test whe�~ Qs.  R05s F~ zbroken |   	ÿ0os.Ý o ø Ò1(OSÑb, ValuÝ�  E ¤s 7  ATrue({follows‰ À, so both isq() and £°() can be tJ #M o ‡voÙ C 0symN sFç× F
Àis a regularàe'_st = ,= yñ.S_ISREG(st.st_mode)@I˜  # a™5orylY!(
#[Y'Sdir(s2"""~¯ 2 ¬ ·  ›p refersx"anÙ hOory.lsN•+i:DIRiÀ
def getsizeð(filename):
    """Return the size of a ' ñ, reported by os.stat()."""< r9   3 Z @.st_J ÿ 


def getmtime{ ðlast modification 4 � 3 Ž aZ Ž oaccessˆ 8y ˆ cˆ ÿ metadata changeŒ 8} W


#  álongest prefix}ñll list elements.Ôbcommon' $(mLrGiven a1 pof pathsJ esff E ò leading component^£if not m: h!''vÿ# Some people pass iu ñ parts to operate' Ón OS-agnosticP ðfashion; don't try6 ctransl8 °that case aÄ Áat's an abus13theM pAPI andé ðy are already doå wI �they needh (be“ < #soM ) Ñmost likely w¢ Pbe usN  an—ð PathLike objectè Í ubº!s.M Oðisinstance(m[0], ($ ƒ, tuple)É 2m =  (map(os.fsÏQ, m))Q £s1 = min(m 2 $ax €for i, c� Aenum„7(s1d Òif c != s2[i]� {   ôas1[:i]p   ´€Are two ’ñ buffers (obtained from 1, f# @or l	 °)
# describ@'1ameï?Ú@same* s(s1, s2® @"""T~whether| �referenceù E T +0(s1Pino =÷  1andä  ú   ' 6dev' Adev)¯û oás really pointÖ o… Ù  4 o(f1, fÙ 	 è· Ö  aactualÝ á or directory
Á áThis is determŒ!byŽ Ñdevice numberæXi-nod B Qraise]Qexcep
 ifmhÁ) call on ei�° S failïy¦: 'f1« 2 ` 	tAopenû u"x BN�# (Not neFBaril	‰eptor!)| c §p¨p©	 , � ú – ‡ Àle"""
    s1ú = os.fstat(fp1)
    s2 2 ±return same0 ö&s1, s2)


# Split a path in root and extension.
# The ð is everything start	 ð at the last dotN  !
#a ñ name component;/ q 
R °before that}  Itr ¢always tru ª +— ð == p.

# Generic implementation of sè ñext, to be parametrized with
#�  se ¤tors
def _8 Á(p, sep, alt  ex !):y2"""I ñ :S from\ û !.
- EZ × I.  A B!to” Ñend, ignoringC @leads�dots.  Rá@s "(N,0)"; @ mayï ‘empty."""? ò# NOTE: This code must work for tex€bytes sty s¿ �sepIndex u’rfind(sepj#if  ”02  5  & U 0maxQ 2 o )?1dot € ŒÜ  if}" >³ � ¸# skip all F<  Š @file­7 % =B E + 1% jwhile + <x m  Q Yif p[+ : `+1] !=­:sep;  ? ½4p[:ù T], p[ %:]•  . 	Z R += 15F  ; B:0]
Ýðcheck_arg_types(funcü s, *argsÝÂhasstr = hasq= Falsez  0sì 2 ¿ ðif isinstance(s,EP  ¨   X 2TruL   -el; u =  ; = ? &se†  Q ôraise TypeError(f'{è €}() argu* be© !, \ a, or 'æ  I  ðf'os.PathLike object, not {s.__class__.__Wr__!r}')2Nonõ  ifY b wdÄ À  "Can't mix« Aings°²  ˆÊe(s"p ‘"""Parserç@commt pline op+ åðmodule helps scripts;p? –	> F 
ð
sys.argv.  It suppor> !he„q conveno 1 asM àUnix getopt()
   q (incluë Áspecial meanù %ofÀsæ % �form `-'
Û Ä`--').  Longã € similarÏ Tthose£ óed by GNU software
?@used« ³well via anN …al thirdˆ ". WmAä
provides two Ø ²qan excex4:

þ A -- ¥ *	 Àions
gnu_getñopt() -- Like get ô, but allow option and non- ñrguments
to be intermixed.
GF PErrorZ BexceD ó#(class) raised with 'opt' attribute, which is the
n dinvolv3 Ethe U Ô.
"""

# Long­ ð2support added by Lars Wirzenius <liw@iki.fi>.
#
# Gerrit Holl <ge ð@nl.linux.org> mo�  | �string-baÅ ‰ qs
# to ã  e °Peter Ã…strO"<a	 ó@lysator.liu.se>· Dgnu_‘@ ˜TODO for  :À S- GNUÀó	_long_only mechanism
# -Ñ Ã `caller° Àspecify orde× ) ó RETURN_IN_ORDERW  g `extensÃð-' as first characè #of8  1? ÑDal aA", ƒ iªÀdouble colonSJ- anH 8`a W fo¢8 Asemi5 ð should
#   treat "-+  o"¥ ÷"--foo"

__all__ = ["±@","e¹2","| 	 ‰a"]

im[ðos
try:
    from|Stext   1get Ras _
%! I; 9 `# BootÔpping Python:L ñ's dependencies not built yetz ñdef _(s): return s

‚ Ô $(E‚)w �opt = ''C 6msg P ð_init__(self, msg,�3=''?  ó   .; 1msgI  _ "op£   � /._] !)
C  3str~ q à 0elfx !

§( =é ð # backward compatibility

Z Ñ`(args,&rí0s, /@opts]s #"" / ¸"s[. _ P]) -> s,ÑsÆ `Parses‚ mç@line$ AionsGQparamplist.  ’ ò /    ¥@be pU !d,ý0outP lead7�reference,  7 E @runn àprogram.  Typiùöy, this means "sys.argv[1:]". “‰Ã Ôlàr¦a� ñ script wants to= €recogniz× í7Ð that requireàñ ÒaC ÔP(i.e.· `e samemx pat Unix2º± uses).  If? \¹çBis a[#ofÙ sXUPnamesé I Àžc øj ed`%he“2'--_sY ulFt: PincluŸ!inx   A.  O2sÄ t /ˆ 	9Án equal signB b('=').žàThe return valð@ue consists of two elements: the first is a list of
    (option, value) pairs; 2 `second3   5 Ñ program argu_ G ¡left afterm U i ðwas stripped (thisS ña trailing sliceF  ¹ « a ’).  Each U Q-and-­ ¬ Ñ returned hasE  ­ + s as itsû ñ, prefixed with a hyphen (e.g.,C ¨'-x'), andÎ ‘ W  X ±or an emptyF  õ Xng ifE ehas no>c.  TheÛ  s occur in2 D v ¡ same orde" Pwhich( ñy were found, thus allowingC ‚multiple] Ñrences.  Longâ Ushort‚ €may be m!!.
A 2"""	 ‘opts = []  Ø €ype(long `) == t A""):#  a  9  A Oelse(  õ W J Pwhile6s´ àargs[0].startsÈX('-') v != '-'a !if@ 0[0]© ('-  ©  T " =$ "1:£     Qbreak‰   J 
� '-'ø  )  ,R ` = do_ srs �[0][2:],  - U[1:])n 
'W ÂX 1X  Y Z 7 ÷Œ ð

def gnu_getopt(', B ¥  Ê]ê 9"""/ y"s[Ó _ Y]) ->l  Ç T@func�Ã works like R õ), except that GNU style scannß0odeQñused by default. _ Rmeans@ Œ #Bnon- Ù#s þRinterŸ‘  ® BstopopprocessÉS s @soon &a l  	3" i; Pencouk #edkI,¬`characS` M X“s `+', orcÌ penvironšð
 variable POSIXLY_CORRECT/0set- en—1ion= Ì á  Â Ê  Æ 1 :_VAq Æif isinstancJ,ã a )y  
 ! =zCm 0# Añ s¯  !s?0 &ifþ	é+è!& =/  ÂD  ¿ 4all	_ÚR= Truóƒelif os.¸k.get("°OM Àfirst = True¡
    else:
   ñall_options_first = False
# ¦while args3 !if ¶[0] == '--'  S Pprog_3 2 +=* 11:]N     Rbreaka   Q ?[:2U Qopts,N Æ = do_longs( �[0][2:],   E1:])| (elk 1k Q' and[  Ó !Ó Ò P } \short~ 1~  / [ zú �
M & QÑ     Q 
  
æ J €.append(§'[0#*    ¿s rreturn à L \

def”<optŒ)Ú 2try	  k 0i =O ¢.index('='­öexcept ValueError2 Ñoptarg = None– 
ë y % €opt[:i],e 0[i+‰4 0has£ ! =5_ Ø¼ ‘ 3if  Š  ifV  � !isŽ  Û Qf notX
   Áraise Getoptá B(_('ˆà --%s requires@ �ument') %p ³ •  I   î  »2[0]  ‚ò ü* 1 is›  B› “ Amust8 have an› 	 #d(#% +½  2bor '')Ç 	V ½ Q

# RkT:
#  z? @fullK �ion name} õÀâ ñpossibilities = [o for o inþ ±  Ò°.startswith_)ºiÍ	F Y  �; 	¯recognizedË ‘# Is therYÁexact match?½ ™  pt¬ ‚ /º"7 ôo + '='? FTrue> W# No ‹ ñ, so better be unique.i yif len(� V) > 1$É# XXX since ( ñ contains all valid Ainua˜’, might bï qà# nice to work9`m into
   e1A msg›  /  aÒ  prefix¥ oassertê A== 1n _»* =é "[0LI# =q . B.endvua  B[:-1b Ri Àrg, unique_mðatch

def do_shorts(opts,  qtring,    ö, args):
    while' b != ''   7optE & =* 7[0] A[1:]P  5 "ifm €_has_argŒ € z  *   &ifU * =      aif not¸ œ    ðraise GetoptError(_('option -%s requiresC �ument') %x ,¶ K  Mopt)+  N^ S  =_ s  	 W goptarg7QE, ''b Jelseê <   &  € á.append(('-' +Ó   Barg)± `return sú*¢ñfor i in range(len(6  w )ÆÂ ¼ 1[i]K:L � ( ó.startswith(':', i+1· Ò ¥recognizedÏ è à)

if __name__˜ “'__main__� ¡import sysLqprint(g>�(sys.argv¾ðF, "a:b", ["alpha=", "beta"]))
"""Utilities to get a password and/or the current user — `.

get+ ñ(prompt[, stream]) - P  �Q  , '` echo Óped off.I Puser(9 1Getq    i Q from penvironý6 or§ ôdatabase.

GetPassWarning - This User àis issued whenò Ä P) can’qpreventV ð  ¶  T !of�  6 %ƒcontents‰ñreading.

On Windows,2 ðmsvcrt module will beQ0d.
Šõ

# Authors: Piers Lauder (original)
#� ó Guido van Rossum (o A supºand cleanup: õregory P. Smith (tty6 &†F �në cxtlib
€$io
 $os
  ” wˆ€s

__allË3 ["8 ",
  è:","¹«"]


classŒ (Ë!):
Sunix_Z ’ ='Æ  ¥4: 'žS=Noneû?"""¨DArgsÙúÃ: Written on M1ask øthe input.  Default: › W  : á: A writable fÛPbjectR qdisplayN{ S  ÀI # y ptty.  I~ å�is avail_ dŽ  ;  J�.stderr.G Ruê £The seKr3tÌ %  ã$ 1EOFº:p 2our* w ðor stdin was closed.
      GetPaðbssWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returl  .
8 1""" Ñpasswd = None ðwith contextlib.ExitStack() as s :*  H 6try   ## “ ðtry reading and wri‘ ” directlyÎ ’tty first™  D   f• ños.open('/dev/tty', os.O_RDWR|
 uNOCTTY)‘  <  S ú= io.FileIO(fd, 'w+'& Ê s.enter_ð J(tty% l M ÞTextIOWrapper* O > Q Êf not stream; »   q  åÖ êexcept OSError7 ñ# If that fails, see if stdin can beÑjrolledg¶ jclose(© Ú Ÿ f–Asys.] {.fileno9 ¬ ¡(Attribute´ b, Valu )Á Y „   ¢Àfallback_get ƒ(prompt,L
¾ z5 = ¬ K X i…> 2errn< Qfd isÇ ² 
Í 7 ol8œðos.tcgetattr(fd)S � # a copyó2sav‰  Énew = old[:]Ê    ´new[3] &= ~c ýECHO  # 3 == 'lflags'9 2tcs‰ _! 4 = @ �TCSAFLUSH4 aif has¾ - 0, '/ _SOFT'Ú  ¢ i |j  ; i IM AermiG¾ àc Z, new <    <óQ_raw_)K,c= E falø Z   .� ž >oldY  @ €.flush()Ä™issue7208#fo e N 3if ï ± '   &# ñ succeeded.  The ó  Ô j nRerais±R ð instead of leav Áµ ðnal in an unknown[*teŸ G   e @# Weá$'tà  ÿ"or ¡.  Give up…Þuse normal IOk -# e!) | s© Òappropriate wºD z Ý$F%À            ÿ" # clean up unused file objects before blocking
   Ýstack.close()" ðpasswd = fallback_get õ(prompt, stream)
;  ¶.write('\n'V preturn @ Ëwd


def winT 0='Pv dord: 'a q=None):f A"""P~ B forN ñord with echo off, using Windows getwch()."""E ñif sys.stdin is not !__ "__l  2·  “ Rc in !F ‘msvcrt.pu‰ cSpw = ’  wh¼12 Cc = 6 ¿ »  ” ô if c == '\r' or &n'?  ' _break5  ;003* ÿraise KeyboardInterrupt<  b: Ä upw[:-1]/ Jelse‹ ' A + c& Ú  È  A†#pw9�>�warnings.	 Q("CanüscontrolAðn the terminal.", Get—W> ,Ã  b Jrlevel=2Ë !if[  ! =pastderrO sprint("c  : p wÚÁinput may be¡  ed“  ì=M p #Q_raw_4 ¦t! 9=""i!, ? uñ# This doesn't save$0strhi2ñGNU readline history.Ý / ‡ : 9!in[ j  #trò -if†6tryO  ¼@¯J =   ñexcept UnicodeEn JrrorD ð # Use replace e! ° handler to|€ as much ‘possible ð"ed  o   ƒ # =º !.eu (§  cing, 'o _?  de´ ? â  4 \ ²€ !  Sflush!ð# NOTE: The Python C API calls fo œ () (and un A) du+ ø *=p. i  # q©@EOFEh0if $ B[-1]  " =! £rŠ  O†getuser(d1Getâ  ‘name from °environment|Ð ¨’database.øFirst try various 9   `ables,T ?J Ö N  {ðworks on Windows aòs long as USERNAME is set.

    """	 ðfor name in ('LOG, @', '8   L  !):C  G ðuser = os.environ.get(P )$ 0if ' 5  9 areturn ˆ ñ"# If this fails, the exception will "explain" why` ¡import pwd V 0pwdˆ €pwuid(os  
 Ñ))[0]

# Bind`  © ± getpass to ðappropriate func B
tryÀ q qtermiosu ð # it's possibleE  ren²an incompat 5 P from& > þMcMillan Installer, make sure we have a UNIX-O F � Æ.tcgetattr,  s 
N1 (I5ñError, Attribute Ûï  «ó amsvcrtn I H  . N³= fallback_ ; ?lse- 5win( e$ : u = unix!  """Interna�Aaliz	 † and loc 0sup @.

TZÿmodule provides iE n(I18N)L s(L10N)
S  8°your PythonU €grams by @vidi€ tterfacea0GNUtðtext
message catalog library.

† e referšBoperé  by which al  x  pðmade aware of multiple
languages.  Ä V RadaptW 1of Ó 0proT {, once
&4ed,Ê l ` 3ñcultural habits.

j(# � represents‡gÚ Âof work, con™ ions, feedM,f �
# suggesÿsPp followxñpeople:
#
# Martin von Loewis, who wrot­ö initial implemen „ðunderlying
# C-based¨RintlmQ�(later reP d ¨ ÞA), a†0wit«¤skeletal
# ;.pyv .³  PeP HFunk¬ fs `.py, a%@rly ðlete wrapper aroundS� 4,
#,0lso‘Pluded:Cure-¾û ð to read .mo fil+7f
#V ò wasn't available¸ òJames Henstridge¾ ay oaú > $  Ë‚has someh  erÞóng, but currently un�‘ed experi±±l features:S no  o¶ 3a C^ clè &ikAncesP3 pabilityÜ1add — „ via
# añ2APIõ ÀBarry Warsaw#eÌea2se å  tp.~ €ll() APIÑP codeª œ pconform¤All C  § '  š   's8  ïðstandards.
#
# FrañŒncois Pinard and Marc-Andre Lemburg also contributed valuably to this
# module.
#
# J. David Ibanez implemented plural forms. Bruno Haible fixed some bugs.L ðTODO:
# - Lazy loading of .mo files.  Current’ ñhe entire catalog is7 ñed into
#   memory, but that's probÔ ðbad for large translaö pprogramp �Instead,M ðthe lexical sort� `origin Ötrings in GNUµ ò should be exploitedN `o do b‘¡y searchesšlàinitializationŒ ðOr you might want–2useN “he undocu€ñdouble-hash algorithmð Pa with " atables(O °you'll needf `study   Ü Àgettext code d.È`- SuppuSolaris } 0matË ðUnfortunately, we've been unŠ  ¿Pfind y<  á áanywhere.


imr $os
 $re
 ósys


__all__ = ['NullTî [|', 'GNU CVF',
  '’  1 /0ion pinstall  Qdomai Hbind 	M   _ _Q;sets dp ] 'dn  l 1 	n l= lJ  	2 pV d n d ? ð-]

_default_localedir = os.path.join(sys.base_prefix, 'shareì 4 ð')

# Expression pars »pe` selec,ˆCThe ¿ ¢ library sšñ s a small subseÈ°C syntax.  : ðonly
# incompati· differencej N hðeger literals startž [pzero ar¢rdecimalœ óhttps://www.gnu.org/software/µ t/manual q.html#Pð -U0
# H õ ://git.savannahP Ecgit=   5tre] â-runtime/intl/Fð	.y

_token_pattern = re.…ile(r"""ßö(?P<WHITESPACES>[ \t]+))
 ƒ| # spacÝù horizontal tabsR ÿ NUMBER>[0-9]+\bO 0   R P‚
G _AME>n@ œ  G  è  nÐyallowedI ÿPARENTHESIS>[()]‘ |5 ñOPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|)Å ù!, *, /, %, +, -, <, >q¬  ð# <=, >=, ==, !=, &&, ||,
       o# ? :
5 / ÿ# unary and bitwise opsM %µnot allowedC ò(?P<INVALID>\w+|.){  ñ # invalid tokenE ñ""", re.VERBOSE|re.DOTALL)

def _+ ²ize(plural)�for mo in< ’finditer(- ©_pattern, 3  “ ñkind = mo.lastgroup†   2if  ò = 'WHITESPACES'q  "   …continue7 RvalueT P (E ) V )R  ra˜VG yError('& ä È Ñ form: %s' % w g Ryield {  #''EeY 4 Ð "if.   Ú xreturn ‰ “unexpecte²Œ OelseS cend of¥Ý p')

_biµ�_ops = (Î ƒ('||',), '&& •==', '!=' < > < > + -, * / % ) `{op: iœ 0 i,< §enumerate(¬ A, 1)(  op$ £ops}
_c2pyÉ {Ã P: 'orm �&&': 'and / C//'}­aparse(øãs, priority=-1ü±result = '' nexttok = 
 9 Qwhile ! G= '!~I @+= 'ÜN   H 1 ; R n !if  G= '(P Fsub, ( _É �  ] v �= '%s(%s)Î( V, sub* k W!= ')k I 9ðunbalanced parenthesis�B'a 'el_ =_ �  c"%sp¢ E ï6tryü ¢ qs = int(8 B, 10<  ! gexceptt
@ _¾A ¦) from Non„	¯ dQƒ q A (Öqj = 100 
57in ç  8i = [^ ]C  Ü eif i <À:   Ubreak+ 0# B ö chained comparison­O ‘in (3, 4)ÔjÚ e:  # '?, ' p  ‚ 4… % ð# Replace some C opööors by their Python equivalent°  op!Àps.get(nexttãok, nexttok)
  Uright ÷ = _parse(tokens, i + 1/ Áesult = '%s  a' % (r a, op, R 2 Qj = io ðif j == priority Ð4:  # '<', '>  <= 1>='3  ¥ \  s @(%s)o  
" $ifÔ  O v'?' andc Q<= 0:)  K if_trueï 0¹ Z f!= ':'H  L Ýraise _error(Wif_falsk h Î  à P%s ifVpelse %sì (´ ( $, [ B &ifñ =ñ © œ ` @treturn ] É ò

def _as_int(n)û 2try	  W ²i = round(nŠ Àexcept TypeE+ + ò('Plural value must be an integer, got » s  ñ(n.__class__.__name__,)) from None; ñ import warnings  .	 � ,‡ ,i ° â  DeprecationW� 2, 4;…nwac2py(p#yò """Gets a C expression as used in PO files for <   !ms` 1s a— °Python func� à that implemenf Çn equivalentp .> 5"""z4len© g > 100lõVã'('— V Ò is too long'	hš¢_£4izeƒ =  u»…  ” ´×   •depth = 0  Nc`† 
N Aif cu(L E+= 1M     2if j 7> 21   ## ¥àcompiler limit,‚about 90Ž1  °# The most ; plex exaÜo has 26 ¬[ ¯| %el)-sns = {'i$':s}" ú exec('''if True‚ ¥ Ç¢‹    o3°instance(n,bT #  nZñ€ # C @  F	  ''©"F, nsˆ5 @ns['§ !']8 )PRecurÈÙ %#   ^@ can!¦î¤Q) or !)Ø&  ÌÀor('plural fð<orm expression is too complex')


def _expand_lang(loc):
    import locale
 Sloc = ¡.normalize3 2 ûCOMPONENT_CODESET   = 1 << 0! ”TERRITORY! 1! …MODIFIERB 2! ã# split up theŒ á into its baseà aonents3 cmask =‚ 2posÃ ¡.find('@')% 0if  B>= 0þ  ð ‚modifier2 a[pos:].   V[:pos o 6|= Ë ; Oelseb !''   † d¡ .¡ 	codeset  ,­ 
Ÿ ` ž _ž 	Ÿterritory  ,,¢  d ¤  ÇBuagev 4 r$[¥ð for i in range(°#+1ô ÙÐif not (i & ~ Ç):  # if all] I @this Ábo exist ...s  J   0val‰ 0ang” 	 0if d )é  : 7 5+= ß 9 Â4:  9 º7 ™:7 ò	8 âret.append(val0  …reverse( òurn ret



class NullTranslationsùt÷_init__(self, fp=None†  µ._info = {}‘  Bcharù 7  output_$ 
pfallbac	B Pif fp)   ³  Ê  ~ p} Q(fp)
z Ð      Î É Fpass( Dadd_| ü ‹ 4 0if J .+ † G .T  • ´ 
Ó  
\ 4 = 5 ¨ sgettext£ hmessagŸ¢ 0ret
i .U O > ‘ /  † l2  I #,   )m¤rwarningð Q  .	 %('H )Ûôdeprecated, use e µ) instead',š  M  D: BionWs 6, 2j2 ; +Pwith §  Á t.catch_ (ë  K    t.filter ð('ignore', r'.*\blgetÏtext\b.*',
  ýDeprecationWarning)< ðreturn self._fallback.lgetq †(message8 #if, ù output_charset:Y U = ‚.encode(d 
8 Y 4 ñlocale.getpreferredN qing())
v Tdef n±  e ƒ, msgid1 V2, n)¡ Â î   Xˆ  H ` Z „  : Ÿif n == 1Q 9 - Oelse( 2Ú l{  “ Ó Û rmport wísm  .	 &('S c) is d'ved, useLŸ) insteadtb6, 2Ôi� ÅŽ �EwithÃ p.catch_¸ Wings(È s   t.filter õ('ignore', r'.*\bö FW»ý½�6ctmsg =É- 6( 2( c
nq B £1 Û p 0con_#, #×» Ÿ_ Y Øq `n< `B D>j d ° NCAinfo‰r ÿ  ._! Þ2 
$ 5 
t< §ð  ¤E ©‘%	ë 
c À Jset_ Ä #, ê ;Í R  Ñ À   Deprecatió onWarning, 2)
  óself._output_charset = 
 
( Àdef install(0 á, names=None):#  N õ import builtins  ð.__dict__['_'] = L ….gettext. "if^ € is not e d  h Ãallowed = {'> X', 'l n Y  ;  '# E 'np0 % ' }< 1forš D in ƒ a& set(	f ù  *  ú wgetattrNø)


class GNUTranslations(Null i ò# Magic number of .mo filezñLE_MAGIC = 0x950412deÑ B ‚de120495êà# The encodingU áa msgctxt and  !idp " ir #+  + "\x04" + Cid (_ò version >= 0.15ˆÐCONTEXT = "%s9 4%s"� ¡Acceptablep @ q òVERSIONS = (0, 1)5  ¯T_get_- g @ ¥ð"""Returns a tupleó Tmajorª V, min 1"""D > r; # (X t >> 16,9 ˜ & 0xffff– p`� *fpŠ ñOverride this method to supX¢alternativˆformats.“ ó # Delay struct ’ ºAspeeÔ4up � Awhen]= ß Q# areƒUused.÷ Kfroma funpack" 0ileê  =k éPfp, '  ª'÷e P3 thÕ ðile header, which consists›p5 littl£udian 32u ¶# bit words¬ b€_catalog×
 {Ý% óplural = lambda n: int(n != 1) # germanic * –by defaul»æbuf = fp.read(å `buflen\ fen(buf ñ # Are we big enÔ *orå ?ã mñ"= oõ('<I', buf[:4])[0]) 3if , e
I¹,¥ðcount, masteridx, t…Gidx q 4r V4:20]È  Ë¥ii = '<II'ˆ -elŠ }Š ,>Š >Š *ses Ðraise OSError?C'Bad7T!',O ¶Ä ç [ Ô
~gD 5jor8  é"inÖ¯ [ 0' +š(¤ Àsion), filensame)

  ñ%# Now put all messages from the .mo file buffer into wcatalogI µdictionary. õfor i in range(0, msgcount):%  ‹ ðmlen, moff = unpack(ii,w µ[masteridx:
 J+8])@ Rend =A  + N 	 t_ t_ Ptrans^ 	 ] t] ?  + L 	] @if m" <® �len and 4  
ì ð @sg =0 [ô :@ ]U  % %tm&  | :T 
& Nelse] Ðraise OSErroru 'FÃÁis corrupt',Õn j  ñ# See if we're looking at GNU`convené s Þ‰metadata½   	N== 0Ÿ 2# C=€ descripN 	@  � Ílastk = None  z `b_item] (Ë.split(b'\n'\ N   / "= 8 ú.decode().strip(O /   pif not : È  !   ~continu¦   ÿ
# Skip over comment linesP !ifm ó .startswith('#- !')[ Ž N.end T  ‡ ¤ 
 gvk > `if ':'k | f 0k, H  % �o':', 1] Z  { kƒo.lower‹ .  ] v.  "   ÿself._info[k] = v* dk" Qelif # ò l * P] += „! +ÉY �if k == '–Ÿent-type'e pcharsetÑ ] Z=')[1   Ä m Ïplural-formsm dN?';'»P  � 4[1]’  ‘  • 5* ‚ = c2py( 
m  œàte: we uncondi)Qally †prt bothS1ids©msgstrs toyP# Uniï0 usÐ Ú <°acter encod �specifiedê$ ;setL `parame: !of@ContÇðType header.  The gettext docuûaÂ O �stronglyˆ !ur€0msgÓ Âto be us-ascÑt some applicN sO ðrequire alternative encodings (e÷.g. Zope's ZCML and ZPT).  For
  ð# traditional gettext applica ûs, the msgid conversion willJ û.cause no problems since us-ascii should always be a subset ofL  t @char ðencoding.  We may want to fall back R8-bit© sN !ifÅ xUnicodeÇ ifails./ w „= self._ Aor 'È '/ Ðif b'\x00' in :  lÚ# Plural formœ   \ 1,< Pid2 =	 s.split(Z )S ptmsg =  + _ r = str( #, Õ Y €for i, xÍ  enumerate(h )Ù  ¾ …catalog[[ 3i)]m xh NelseM I § < O  …  	`# advam@to nÃPentryÅ  Jªseek table~émasteridx += 8R Utrans  Sdef l#(—, messageæimport warningo  .	 %('H ð) is deprecated, De ±) instead',‚  p
 D: BionWs 6, 2ÖŽ elocaleC `missin@vobject(1  d ¾úÛS.get(ê #, = 3  ] Ž$is 
Ü#ifI ® ­
  Ð kreturn' .$| s  4 ª  Ü n doutput¾
t p  C .^eÐ*._5 q 1  T ‘preferredK qing())
‘ 2nÎ3 Jî?, n= S > ?A:tryO H5 ÷ !.pQ(n))] Âú except KeyErrorT È6ÿ ì 2j{   šif n == 1y   Ñ 9 15 »0 20 Ã 
V
o Z 1‹Àle.getpreferñ redencoding())

    def gettext(self, message):   $ õmissing = object() 0tms  : ã._catalog.get(F #, = 3 1if 6 $is j  n 2if O Šfallback  # kreturn'  w Ç { r 3  À J  ‘ n€sgid1, m G2, n:tryŸ  J # =› ![(; "1, µplural(n))]ˆ ú except KeyErrorT &É €  Ã z  šif n == 1x   Ð 9 15 Oelse0 20 gpg0con¿�´ctxt_msg_id\½CONTEXT % (9 w |¹l ½YÎ  �IÇT  P&, Z  ÉÑÿ k
C c] N9 k[ñ
# Locate a .mo file uw4the£  strategy
¸ófind(domain, localedir=None, languages „all=FalsÙð# Get some reasonableñaults for arguments that were not supplied/&if{ @ is ~ – p = _def] _ A ¬ A   6= [% Ÿ óenvar in ('LANGUAGE', 'LC_ALL
 �MESSAGES GANG'¼ å0val�s.environE(Y Ü ( fif valØ     f  =! ª.split(':'?  + Qbreakò   aif 'C'O&in­
b ^ £.append('CY ð# now normalize and exp  /9 Ð
    nelangs ñ= []
    for lang in auages:  $ne! €_expand_ ( )*  . 3if - 0notR  P  &    ‚.append( )w ¥# select a‘  fif allq uresult Ê Oelse  ANone@ ê p ˜ !ifm v == 'C'G  ¬ QbreakC   ñmofile = os.path.join(localedir,H ò, 'LC_MESSAGES', '%s.mo' % domainë  P %ifJ rexists(b [	þ  ;   H; ­  " 
    rreturn 1 0  Q ñ



# a mapping between absolute .mo 	 ö and Translation object
_t ðs = {}
_unspecified¼' ‡']

def 6 (/%, a=Ñf¬ Â  Ø  bclass_ ø
 fallback=False, codeset=� p2if ; @ is k  W= GNUí s| I å Nfind· ² ,ÈR=True 6#ot‹
”¹ …  à ªHNullˆ (O  " ñ	from errno import ENOENT«  ! ò	raise FileNotFoundError(' ,(  ,  8'No§fH R¶)',îñ# Avoid opening, read	  ?@parsj'th]Àafter it's bdÍq# once.¨ ²! =¯  ë‘ …
 Yrkey = (Ð,0absÍ€N e	Ë†.get(key# Nif t2 :Awithó X Ú, 'rb') as fpØ / l ‘setdefauls ,ŸF(fp) p# Copy <=‡0 torpow settdWs¹2 { ð
# output charset. All othƒÀnstance dataé qshared Þ "thbE ccached| ¢ pDelay c© • ¨@spee´ up gettext´EwhenigJ @are bFusedb U  a Ô  O  . &(t2 è Î  M 
˜Y 0war¸‰  �  .	 €('parameµd ^ ¿deprecated'Z	D' BionWk 6, 2²  n ¶ 
¢   ‹ † ´ings.catch_ ð():
               ô warnings.filter ò('ignore', r'.*\bset_output_charset\b.*',
G  ÂDeprecationWx )@ .t.o †(codeset2 ùif result is None:M  5= t ?els% ã.add_fallback(c creturnc ð


def install(domain, localedir=€ #, ¤ ñ=_unspecified, names" )£ ¡t = translO $, Ž V=TrueY a $t.� b ò)



# a mapping b/w ª Ss and® å directories
_Â os = {}@ 
} 6  : ãcurrent global{ ó%, `messages' used for compatibility w/ GNU gettext
_I _½ E = 'C ‰ (  =_€ G #if—  4;not83 # =. < $ ‘ Mbind• !ÿ  |` #if¢?dirŸ 2 [þ 6] =5 F ¦ + C.get&¦, _defaultù 7 Ü Â _Ã _Þ:  itimport 5€  .	 /('V )â d/edI/2, 2û
C› s� $if‡ c ä 4 I F 
G sK7d¶(«ì2tryô "ø�b ,�)ñ æexcept OSErrorS ¨ u » t­  Ð( )Äl² ÕC Ç,â a )1/eaß„ ªÕ ‚3 = - 1*	rEwith p.catch_™ ó(£ š   €parameteÆ“
Óµ  €   ""3À      returnð message.encode( ñset or locale.getpreferred% ôing())
    with warnings.catch_ 1():$ ( # efilter# õ'ignore', r'.*\blgettext\b.*',?  C  ÂDeprecationWb —  , ”return t.T (ê “)

def dnl ó (domain, msgid1 C2, nÁ 6tryÊ ¡t = translw = _.@dirs2 CNone-æexcept OSErrorS –if n == 1 Á – Oelse( 2( û ã E Û leimportíi È.	 '('N c) is dŸwed, usesŸ) insteadå×2, 2Ú† m„ ±#= ƒ ‡< 	Èº Š Þ á¾£parameter „ Ç d ô µ     x",‰ =‘ T ‰ctmsg =t ‘ ‰( ‰ ( �?msgdtžš	Ý $.lU (kqpq0coní,„pTµ Ñ %t.¤ œ 
2%dn# 8+ A¿í å ÞXÍZd ”_current_>/ _­ì÷‰´ }b { ànstead',
       ðDeprecationWarning, 2)
# bwith w „s.catch_ 1():$ ( # efilter# õ'ignore', r'.*\bldgettext\b.*',@  D  › ˜  , ureturn S ó(_current_domain, message)

def n{ ‘(msgid1,  C2, nÉ Q d) Q : [ l3 T \  eimportKù &.	 &('E c) is d–ved, use¿ Ÿ) instead@2ÍH÷ Î9T Ï ~ ÚpÚ0con]ú¢Ù( Ù9 
Ùn3 " † 
e 3 f D t


# dcÉ ð) has been deemed unnecÐ`ry and"ðnot implemented.C ðJames Henstridge's Catalog co óuctor from GNOME s r.  DocuK   u8°
# was:
#
#pÃ0  Ucat =C j ò(PACKAGE, localedir=LOCALEDIR)9 ‰_ = cat.N ðprint _('Hello World')× ÐThe resulting9 Ò sobject ÷Ály don't supm ac1  through ab icçÐary API, whicás5 Àed (but appaL�ly unusedv2%
#ñ #

ó ‘ = translFð
"""Filename globb¶ Óutility."""

MV4lib $os
 $re
 0fnmz …itertool* Dstat °sys

__all_d ["€ T", "i	 ‚escape"]â  P(path­  , *, root_´ÒNone, dir_fd= ó recursive=False9B"""R� a list of S !s ¸  ý a  d  	 atern.
 Ú0pat @ may¦atain sÚñ shell-style wildcards a la> ó. However, unlike  3, fˆas star?Õ@ ò
dot are special cases tha  bÃ ‘ed by '*'|1'?'~ ¸ sË 5If    ”true, theó P '**'Ç lA any¡ sW S Àzero or more{e¯!ie! t subdir .1  N žr� (ëÕÒÀir=root_dir,‚ dir_fd= Å, recursive=
 ô))

def iglob(pathname, *, root_dir=None,L  @ ð%=False):
    """Return an iterator which yields the f Ás matching a  w  	 atern.
O T,   ñ may contain simple shell-style wildcards a la> !fnb ó. However, unlike  `, filew ps startŒ Rwith @ ðdot are special caseÀ a 2notÃ ñed by '*' and '?'~ 0pat¸ sË &If}” is true, ) P '**'Ç lV A any¡ sW S Àzero or moreŽqectorie! t subdir .1 1""" °sys.audit("æ.  ",míÎ)0 //22 '"D %if@ ð  . :( ,^€ = os.fs( D Oelse1  ,  ¹A[:0]² lit = _ÄN š ", ¸>  f   V  d ~E _is $C[:2]ø Ð 6try¬   ñs = next(it)  # skip empty string|  *   Jif s@   Ø  Iòtools.chain((s,), it% ' Áexcept StopIv:ionM Apassp r "it÷4sdironlyö 0dir…Q, basHË Ge.split+ª ig–has_magic ¬ aassert�m ¶  å %ifi 0  å_lexists(_joinGä)¼  8  šp 
~ - 3# PÖF end/Ó slash should¿ (¥W  I  ifS=dir° T¯  Ùg iL - ”ØÆ"`from _92^3 ]  ú ñ ë FQ 1Q è g# `os.p2)`   ¨ðe argument itself a` if it›îp# driveü1UNCp.  PrevA  ÏtnfiniteÈ onC a7 ƒ#­ èògic characters (i.e. r'\\?\C:')­ if/ Q1 !=€   T2½ £0diriÈð dirname, root_dñir, dir_fd, recursive, True)
    else:
   ñdirs = [dirname] ðif has_magic(base )5 &if[ … and _isl 1  j ð glob_in_dir = _ 2n   
•      / 1/ 
+ '  0' 0for º 0 in sÁ    B °(_join(root§ I ' 4),  ]wdironly · áyield os.path.O [!, K õ

# These 2 helper functions non-I0ly œ ð inside a literalÌ rectory.L �y return# Ust of¯ 2s. kò
1 accepts a pattern while €0
# take g ó € (so it î    to check Gòits existence).

defT %1(ú r =  ††_listdir9 ÊmÛ`if notushidden(_ ‹R !(x¥ x = "x)Dñ fnmatch.filter(5 ,3)ß 0¦ *à i‘„Qif _l:sx/P )Q Ú  e« [( ¶
4# `†ƒsplit()`'¥s an empty'% ²ñ s ending with ao r #uñ separator.  'q*x/' should :(1dir¤Eies.F  ó /isá à ö ]C`Followª >1areópublic but can be used by third-party code¯ gÏ
Ow ±% Ó, None, False O ýä O % O  ,,is)~1ly r s relative«h¶9
Æú Ö 2Êû x  ø½ Qasserz¦}æ�  ƒ  a2[:0š from _räP
# Ifq z P is f],ê Pall fºæ s
A Etrue@ V - –"s.· aŸ 6tryÈAfd = -@fsen^ iÕ 0_fdÔ  Â ;I  ; #  Ù 
   i Parg =`Dopen¸À, _dir_open_âflags, dir_fd= 7)
  Yelse:   Sarg =7 	 þif isinstance(dirname, bytes)H äfsencode = os. R @eliff  E 
= �   
0 € C š ö(os.curdir, 'ASCII': 4  :try¦ @withÙ úscandir(arg) as it(  SÏfor entry in!  % b    `if not0Tonly P @.is_}  :   4if €1 isJ ?Nonü  -  Uyield< (Ä .—C/  W  ] T l% îexcept OSError[, EpassA kfinall± dÿ  ÷rlose(fdá ~ ðreturn

def _list…l{ ®�1ðcontextlib.closing(_iteŸR@ X  y ñ(it)

# Recursively Yð s relative pathµÀs inside a lu  alQrectory.Ì rT Í O =ý • xý8 Æ×³_ishidden(x-×Ë ! xE   Ï † = _join56x) Q ‚7  „ �_å  J §1_fd ¯n   † q dx, y)
ûpexists(I  Û E 3_fdÆ `# Same0os.$ #.l1 q), but ïã Â !_f¨
£ôI  V  z °	D�os.lstatž 	ã(bq, ValuenÆ  ~ QFalseª  aÈ CTrue isFž / .G v  "st�[ n ó.S_ISDIR(st.st_mode),
ÉAbaseÒ_@# It¶hcommonä4or ,  ! ðempty
    if notð dirname or not base 3:
  hreturn( $ #  Óos.path.join(T ,N ø)

magic_check = re.compile('([*?[])')$ j_bytes* b+ ‘
def has_X 2(s)± ñif isinstance(s, G   Ñ �match = 7 � k ¡.search(s)× BelseS 6 0 _ !isLQNone
©  _ishidden(%� 3   õ[0] in ('.', b'.'[0]); �recursive> CternA 
í 0pat ó h    Ÿ == b'**'ç  * ) Ã Qescap‚ h ƒ A"""E ñ	 all special characters.f 1""" !# - ðing is done by wrapp óany of "*?[" between square bracketQ f# Metag 1 dor@workIòthe drive part and shouldn't be Í dž )  , ˆ Ú 4 = ÍQsplit  zø É z {T q ¶ub(br'[\1]' G _.sub(@ Ê¼ % +Ü ð


_dir_open_flagbò|os.O_RDONLY | getattr(os, 'O_DIRECTORY', 0)
__all__ = ["TopologicalSorter", "CycleError"]

_NODE_OUT = -1
_NODE_DONE = -2


class _NodeInforq__slotsg P"nodeY Ðnpredecessors 4suc 
• ð __init__(self, = ª ÇQ# The q this c~ Òis augmenting -  B .A ! =3 e   €# Number­– ò, generally >= 0. Whenk ñvalue falls to 0,³ N  Ÿ2is ´ edÂget_ready(),A `is set< U 9 wc eP µ •is markedh0a c¥!to  Y 	Q LDONEþ Þ H = 0@Listˆ&!s.dl ðcan contain duplicated elemGs asµ ñ long as they'reP`reflec4 iG%e l 9's  ´[ibuteÃ 2  ê%[]s¨ (V›E³+b"""Sub6of   R rais¡ýP.prepª‚if cycleÝ  ex
¿  Ÿ ébgraph.M³If multiple8  4 p, only $ðundefined choice am-�them willÒ�reportedR „includedðexception. The detectedñ% cycle can be accessed via the second
    element in ñ*args* attribute of ðexception instance and consists? aa listU ñ	of nodes, such that each @ is,0  ‰ ð
graph, an immediate prede± #or~ T Cnext@ «  n 2. I �reported„ ,³ Qfirst¦  j 3las? qwill beU   òsame, to make it clearµ Qit isM1ic.2 A"""
	 ð
pass


class TopologicalSˆ !r:$ ð"""Provides funcAPalityo t4 ¡ly sort a  ÷ �hashableó sv òdef __init__(self,3 b=None)v  ×   ._…¡2info = {}“  Qready# @s = @ ! nã œedout = 0 �finished  "if�  71notW –  } 1forÔ ,éAü w.items(Ë  5   Ó @add(Ö 7, *("s)”1getÖ  ø # 2 R áif (result := X 2 +A.getc  ))Å  
Á 0 [] C] = R ²= _NodeInfoG creturn( ±  Ó  T ,
Ù | Á"""Add a new+ Ü:itsI!toþMf  >0Bot‰0e *° *< Call  �	z `* must?‹.N óIf called multiple times wig  V¦ 0rguc–0setßÅdependencies!šÀ  unm0of ¥ .  –8 in� ¨Ppossi4Bto a+2ode” 9no F (í 0is °p¯%d)• �as well ahÌ& aK °y twice. Ifš o î"haP Tbeen U b beforz ”ivÊcluded amongÕ*�pautomatb lyÞ !edE#heq zµ *no0of )(ow5õRaises ValueError i×ò after "prepare"ü ´  Š    #if=KI8ro n  ("(s¥ z ¨d
{ aa ã „ 3()"æ { P# Cre. Â Ò8 ->ó G edgZ "   ï	%  ñ   , (.nbˆ += len( � $  —  Q �   &    ðsî å   _‹ ·   · Ð    pred_infoñ!.successors.append(node)

    def prepare(self):   ö&"""Mark the graph as finished and check for cycles in. .a  J bIf any% ð is detected, "C9 ðError" will be rais õbut "get_ready" can� #st- àused to obtain£ ml  ã s âpossible until„ Ås block moreR ðprogress. After a call[ æthis function,â  ‘ 0not³ bmodifiR Átherefore nol  – 0can4 õadded using "add".: 5""" 0if ™._C 0is z FNone± k<a ValueVP("can+ å)Š £than once"	 = h 5= [‰  "  i.€ óiî2   p2info.vy ó s() if i.nprede}U == 0M ]
 !# ßÙ  seS8iwe looc—on purposù #o  § user wants¸Qcatch¯f ¿1at'É'e,… @theyÑ“ continueš W €instanceU @grabX f?  
pbûq i> # # =çQfind_ %()# "ifºíÝ 3(f"ˆ  reža5 "", ê óVõ ñReturn a tuple of hÇÂdes that are¸çÑnitially it rF s< • @with
;„a thoseT emarkedø  as/ B@ed b¡!ll0 done", furf«sAy x #ews ´ U Ahave  Ptheirÿ¥!alŽv 0. OúÂ½+gbe madGRempty8sÏ � 'ed&RÞs£ ½ k0ed #1outÏ ç ¶"¥ viously&"e `() mus|€ ˆed first!Q# GetRÓ Wè 1ady Á " mo‚result =q	Íæ5n2i a TH  h   ÚT 
@n2i[  ]x¦ _NODE_OUT“p# Cleanª P listç = ßÔ Vupdat*#6 @coun('ofdA we _ù 7  +^ìg.clearå" pnpassedr+= len(í ¾ K ]   Ô  Õðis_active(self):
     ð.   """Return ``True`` if more progress can be made and ``Fals+ Óotherwise.

  P7 ñif cycles do not block the resolution]  eiT   %reT ñare still nodes ready that haven't yet been rÏ ±ed by "get_- @" orU S “number ofS ðmarked "done" is lû @than7  / s 
l V 
t ðRaises ValueErrorgð called without  õ
ing "prepare" previously.c 5""" ‚if self.ä _…is None:&  ™r€  (e `() mus<€ ¥ed first")? Qi ´nfinished < `passedÁ �or bool(” )`def __# !__% )¥ f §is_active(9  ™5 1, *é = æ"""Marks a setÕU  asÞ ce¹ ¥áThis method un£�s any suc- o0Aeach53 in‹ 0* fü e¾t @iB`future–aj8 to ‡ ,v:exec:`3› �  ÿ } ahas alè˜Í%as… 0proÂ aYŠ tû ,›aâ 1was¯Padded² &th–PgraphÑ  usù A"addg íÚ ™%if© Ü  Ñ  &Õ
D Jf Tn2i =‚ode2infoé r Í !inL&s:    p# Checkm we know abF‹: @(it ‚~ qFadd(§ T @if (:  Š ± := n2i.get  ))Ö 8  f"G   { 1!r}†  ‘Š  "¢ F   B# If1Dode Èb% ( Ê)�@ly, ½ !rmE Fuserä ` astat =Q ( p.npredeÛ&orî *   - Æ!= _NODE_OUTo "   & N>= 0  "    5! Ü(Ætú ÌJ 
Ö  $elª =Ð ODONE³ š Àe!r} was alrûeady marked done")
  ]else:  % ðassert False, f"node { ð!r}: unknown status { 9}"
K °# Mark the 8 Ù as processed)   °info.nprede" üors = _NODE_DONEZ ‘Go to all_ 4suc5 ¡and reduce ¨number of [ Å, collectingE Iones— Á# that are rL@to b ’turned inc �ext get_% ‰() call.J Efor ¤  8 ò  s‡ _u = n2i[ ]b  ³ 0 MM-= 12 &if— 5 N== 0˜ l Belf.ò _Í •s.append(… 
ms0 °nfinished +� � ðdef _find_cycle(* )u `n2i =  .i 29 ‡ †tack = [>its AseenG &t(˜  ¸ 2-  c &{}d °  «&2iŽ  t "ifÏ0in W 
  ! †continueP   Ÿwhile Truq S  A Á# If we havez 1 als†   ý is¶ 5the% =  �# currentº%ckP �found a „
½; ¥  :ÿ 0  re(h [2  r] :] +  ª  �` go onìPget nkb7  1 �  ©P.add(ˆ «   8ÈPiter(q 2 %].u Ps).__ˆ /__H  0 Þ q = len(i3  y  @ ); Ÿ €# Backtrð!toódtopmosÊ­entry with÷# at least anotheŽì©” M?try  ¨  ¿ 3 = NG[-1]r !  ]break¯  " ÿexcept StopIterationu 1del”x½ f.pop() W  £ ' … L
µ æ3Nonð Ð Œic_orderÑA"""RPs an g@able¢ ;½áa topological F .âThe particular ªð is returned mayó
 depend on the specific
  áorder in which$ ðitems were inserted!  ? ugraph.
> ó8Using this method does not require to call "prepare" or "done". If any
Œ ð cycle is detected, :exc:`C õError` will be raised.Œ 5""" Sself.q %() awhile  Åis_active():   ˆ Ânode_group =+ —get_readyJ  * ¶yield from 5 	L j  ë &(*" ð)
"""Functions tha-ñad and write gzipped files.

The user of¢  jqn't havf±worry about% ðcompression,
but random accessf §€allowed.>q
# base-ðAndrew Kuchling's mini™ À.py distribu2wit8ôzlib module

import struct, sys, time, os  1  ubuiltin $io _É ø

__all__ = ["BadGzipFile", " @open <   %de ò8]

FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16

READ, WRITE  ñ

_COMPRESS_LEVEL_FAS;  ÍTRADEOFF = 6 !BE6 €9


def Ã (ê na7´mode="rb", Ç llevel=}  G ,‡ðencoding=None, eEs qnewline ‘"""Open a…-k � `binaryÆ@textñe §± Ð argument can¯‘an actualÖ Ô 0 (a  J ñbytes object), orÀ €an existd X !  S �{#or5'to‡  .ƒ  "rC "w wN "x x ažSab" f… ï  Q  ™ @ "rt0 w #xt1 t1   bdefaul$1 isÕ Ã ì Q" hÓ œ9Í IFor ƒ mf? *  h0valk!toú	B con�"orå XSR). InÖQcase,U HCÍ  Ç Enas must�be provid¨1  Ï %D, a ’ Üqis creaü ^ 1wraQin anC ¡io.TextIOW  ½ustance Šæ;ed ¶ P handÐJ ‘behavior,{ 
0 en,3(s)  ì`if "t"ÿ 	M b    ¡a Value»‘("Invalid4�: %r" % (Q ",)¥Ielse] À  é ¯ Å! f ÐArgument 'encóoding' not supported in binary mode")
  Áif errors is4 UNone:  & Àraise ValueE+ Â("Argument '< n newlineo #= p À 0gz_í ! =ô ó .replace("t", "ö#if isinstance(filename, (str, bytes, os.PathLike))Q_5 ¨ = GzipFilE � ò , compresslevel|Çelif hasattrx ¯"read") or owrite"ƒ  Ä/,   , ±  æ ‰ sðì4Typë- à must be a str  € object, aZ 1")
~`if "t"y …61enc¢´ = io.text_ (	 š |Peturn* çTextIOWrapper(|$, 7 ,Ë#, (H )elâ R A a

def \Ð32u(output, vñlâ# The L format, ñs the bit pattern correctly whether signed##"un . j .z  qÔuct.pack("<L"� ð)

class _PaddeddN°"""Minimal 6Q-onlyƒ•â that prepends¹aing toº ‚contents‹ ±f an actualD ¡. Shouldn'öòused outside of gzip.py, as it lackI pessentiF òunctionality.""" lô__init__(self, f,¦ C=b''s þ  ¤._buffer =% ±  Ólength = len(î ù$  ÅK = f:  6F = 0™   • Gsize‹ 2if Ž  #  ½ dˆ g   rZ'  r .+ (H y 
G  +  3 <=\ Ë V 4ad !  R L  t m _ 1 +=N 	 “ H[- :8 ]1 
( ^  + |  = J < ºi Ã{ Y] + \+  / "  
9-? +� ^ Fì° B
p!is¨ 
ac ¢ e ñ  # Assume data wasta sinceO5lasmy() callå g  Ã / -¬ ²: 6  ã ° èÀ  self._readñ = 0

    def seek(self, off):     Û._read = None lbuffer qreturn = Qfile.`  Z 
s Aablew r < ðTrue  # Allows fast-forwarding even in un[  H ó streams


class BadGzipFile(OSErrorg ð"""Exception raisedL ðsome cases for invalid gzip Æ Us."""_ \ ñ_compression.BaseS‰ l DThe .  œ ðsimulates most of the methods ar Á object withy & e» 7 £truncate()B .fCThisp ðonly supports openEÕ  ú ñbinary mode. If you need to- ! a~ é "edž qin text8 Q, useÆ  0.c p() funcf’ @ WÁ# OverriddenÞ ’ internalZ ø ñto be closed, if È 2nam�‚# is pasÆ©  myÛ 4obj™  é�__init__v,m  I =Û,É  1  ª  ý òlevel=_COMPRESS_LEVEL_BESTO 2objC a mtime  L á"""Constructori Õ
 / 0 `At lea$ neÙ "an… ¾ P must* gi­ = ÷non-trivial valueY  –3new!€instanceL baK!onàobj, which cane •a regular$ ” ó , an io.BytesIOºã, or any other O Ñ.P  It•Paults‚œ#in8  ¢› û iÏ¬bprovid  Y w ü 5WheÞ  ò 1notÝ,Á Ï \ €argument# zu•¬ bincludA É þž t header=Cmay , e …originalI v Ö$unro;.   p 7 	K ¸ò if discernible;†zwise, id K PemptyGEing,M  i éMaä¾ ê ,0is Fã P T { w h ]W & f 'r', 'rb a  w w  x'V  ¡'xb' depeno'en €  P willºÇÐor written.  Ž 0defkQ !is¡¥ !ofâ  JL i F  + ¾ ÍAV »0'r' pequivalX _× 4  C±d similarlyu'w' and� 'a 0 'a ¢#'x ;xb'nGàlevel argumentó is an integer from 0 to 9 controlling the
  ðlevel of compression; 1J ðfastest and produces< h least1 ,O  , 9= Oslow= *mo< 0. 00 (noQ P ðt all. The default. 59.
#   Ñmtime argumen" ðan optional numeric % Pstamp¥be writtenJ "toß  Þ €modificaC 9 ‘ field in$ ¶stream when¸ 5ng.L PIf om_ ¡d or None,9 @curr£  Œ  Ê GusedÍ 6"""Ú qif mode�@('t'}  Uor 'U %):v  Õñ
raise ValueError("InvalidM ð : {!r}".format(O %))@ r t'b' notu 
e  8 x += 'b'= pfileobjÙ  ó 
4  –= self.my àbuiltins.open( Qname,²  @I'rb'¦ # j  A ¡ = getattrT `obj, ' G', 'Q  7"ifî ‘sinstance3  - ë, (str, bytes)n ; � 6= 'Nelse Q Å = os.fspathf ß Aorig`= ` !isP
\  ï    ï BL û .startswith('r'Ü § ‚e= READ>  õ õraw = _GzipReadecÉ  ' D á_buffer = io.B #ed6 ?raw2  'Z#el¤» 0('wã a ,x'£5if S< ¨ ù import warningsë     .	 (  # "�File was Êaed forhÿing, but this will "F `changewðfuture Python rexOes. : qSpecifyh ÷ †  ‘  þ(it• &."½ Å  F| W?, 2¤ c y= WRITEË ôPinit_cJE  w„ = zlib. Dobj( ¤§ ¯  M �DEFLATED< -= ŸMAX_WBITS> = ßDEF_MEM_LEVELA 0' I_è!=  tÀ   else:
     ðraise ValueError("Invalid mode: {!r}".format( D))

= ó self.fileobj = 
   1if #  8 ¥ == WRITE:?  G   ó_write_gzip_header(compresslevels ‘@propertyB 1defr Pname(G )Z ñ import warnings0  n  .	  ("use the C ò
 attribute", DeprecationWD E, 2)G Ø B andï  O æ[-3:] != ".gz"š  † freturn, " +& ` ! Rÿ >mtiü p"""LastÀ2ifiÅ  ) ÿ read from stream, or None"""| ñ_buffer.raw._last_r �  €Œ__repr__€@s =   "@à  '<òñ ' + s[1:-1] + ' ahex(id?  )) '>'v Binit4" , .Š™  å  öcrc = zlib.crc32(b""¤ # Šsize = 09 ®Šbuf = [] ?buf4 `offsetL ±  # Current¸   ðfor seek(), tell 7etc÷ x 	& ¥ *, ,l  }.= Ð(b'\037\213')‹ ‚# magic 
Õ ØC +10?  H #‰ ¥ion methodI 6try™ . ñRFC 1952 requiresŒõFNAME field to be Latin-1. Do notS F qincludeK ä F �at cannot?  ˆ°esented tha)y.E f8 ð  = os.path.base ]D u  ifˆ Á isinstance(B w, bytes„ -     ˆ V ¢.encode('lØ '] / ÿ.endswith(b'.gz'W F[:-3� except Unil Er à
…j e = b''@flagÀõ1if ) < ( ±> t Achr(U )û ü Z" =Ýn B  2if % !is¶
�  =ê.ï(\ ü232uÑÏa, int(7 )+ %ifÆ{ ·ú_COMPRESS_LEVEL_BEST} 1xflFF\002J/elN /FAN 4N /sev 0( ‚ ðxfl)
        self.ó	fileobj.write(b'\377')
  •if fname:   Zself.: & Á + b'\000')
1 Bdef Z  3 f,data)K   ù._check_not_closed(~ $ Ömode != WRITE@  ‹ Áimport errnos     áraise OSError(  ’.EBADF, "“ ó) on read-only GzipFile object"Ã  L 1if ˆ ó { is Nonq RValuet g Û d °isinstance(* , (bytes,  garray)> ™ Álength = len4 <;els¡ Ð# accept any a � that supCùs the buffer protocolR3 Ë= memoryviewr 	‘  -  .n¹ s   if©  ² :> 0È`� ”compress.	 u è  X * asize +9gthº   ñcrc = zlib.crc32I ,Ù?crcR  goffsetT U creturnÍ à  ë M(m  , Ž 7=-1°  îJREAD%í"• ì÷í H  Û ® .C  Ò ì 1í ñ """Implements BV�edIOBaseO #1(L  t ÓReads up to a„²'s worth of­ … ãõ is negative."""”² N`8/1(a© É < ß õ	= io.DEFAULT_BUFFER_SIZE? ¡+1(¢Cpeek¡nˆp� '   ç C n9‘@property “eó ð I Áº; : . =% o  ¢ 3if  %/  1 =A ;tryêrú=ú ƒ O 1zflush()Ø 5 Ðwrite32u(fileûobj, self.crc)
  # ðsize may exceed 2 GiB, or even 4 < Öwrite32u(fileh L S& 0xf 
v Belifu Ýmode == READ:^ ´ æ_buffer.close(I zfinally6 #my‰ # =a  	] 5if * 
A  w   y = None@  & ! š #  def flush(G `,zlib_æ =
 æ.Z_SYNC_FLUSH)z  + Á._check_not_ì dí 0VWRITE@  � ò# Ensure the compressor's A2 is™ !ed©  4   | 6.Ðº .C .Î  ¿ É )ƒ? + !)
a 
QilenoQ ï ‚"""Invok¬ °underlying ‡ ‘ object's Âno() method.W  u ñThis will raise AttributeError ifY œ  E õ doesn't supporto ." 5""" breturnU § @obj.  ¡ ™  ð lrewindð B'''R?  œ$un[‘ed stream| ð position indicator toÊ … `beginn*oã  ‚ 5'''! 	(!X1!OS*@("Ca· A in  ±"è#ˆgseek(0äŒreadableö 2 Q è. m : ò;  † ; JTrue- ž ÷, offset, whence=io.SEEK_SET 	F1== | 
n#ifC G != F 
&  g* =* >CUR*  .   ¾ +· ç *   OelseH çBValuõ('Seek from end noù6ed'ë V #ifp " <ð‡ i e L 'Negative �
Mb tcount =g -g 	å ùchunk = b'\0' * 1024! fï l brange(Y !//) Ò ×   Ê w!e([ 
ù  q R %Q / ÃO Ö	 ’ &	cuªp2 % ê Œðline(self, size=-S1):
  õ	self._check_not_closed()! rreturn ( ô*buffer.readline(size)


class _GzipReader(_compression.De  € Ðdef __init__(a C, fp  Ÿ …super().$ õ_PaddedFile(fp), zlib.d^ Eobj,¹  B 	 qwbits=-4 –MAX_WBITSé õ# Set flag indicating start of a new memberd  µ b._new_ { = True  ñlast_mtime = None
! ÿ þ  Pý ™Brc =ç –crc32(b""³   stream_siz` V0  # q1ed  ð of unconcatenat 7 ‹  † a_exactŒ 7, n� 0'''¼   òly *n* bytes from `‹ 2fp`Q  yóThis method is required becauseSÂfp may be un_&edÅTi.e. ƒPhort ¦ !s.A e 6'''r edata =Y ¨&(n0 while len(* V) < n
 N b> & -1 J  - Šif not bC   óraise EOFError("C@ed f‚ 1end¥fore the "Ð  ?   ‚"end-of-ì  marker waWWached ?  à U += bY E  1 Nr_gzip_h¸ È÷@magi‚  B._fpS2	3if $ Z= b''t CFalsô œ 3 !3 Œ\037\213; C0BadTñp'Not a ­ pIr(%r)' %ƒ )Ø  c (w,ÏN�)ðótruct.unpack("<BBIxx",, !õ:(8)÷ ÚK!= 8ö » „Unknown 3ion'¶ !if° š & FEXTRAW !# �‘& discard9ðextra field, if s5entö $ __len,î  Hê 2ê  B þS 	<& FNAME¼ 5and¾ Åa null-termi‘ rpcontain   16namT ‘ ÉJTrueh   sæ =¯1¦  !   ¼ës or s==b'\000ƒ (   UbreakR¥zCOMMENTƒ §ë am»è 7Àor s==b'\000O':
   Ubreak ú if flag & FHCRC3 ñself._read_exact(2)Q õ# Read & discard the 16-bit header CRCd Áreturn True
 @def V (a ¦, size=-1)} !if F < 0  { K  8 .B Qall()T   #6 ð=0 is special because decompress(max_length=0), Õnot supportedN 1if  ?ize… 2b""Ï { õFor certain input data, a singleX ˜# call to” Q) mayp ã . 1anyK ñ. In this case, retry until we get some, 0 orbuch EOF.M Qwhile‰
Ò  pì&jor.eof' é aEnding… �: we've cx !toðend of a member iµ ue file,‰  J   â# so finish upÞ 8 P, andÄ Ãd a new gzip^Ñ  D   q# Check� 1CRC<  r K 1set ï so3 B“  p ‡  {'of} ‡   ! Bnew_B ! =qI q2 = =  �_factory(;  g )**, Vargs)� " ÕŒ Ï!If_&  D0et,(}have toˆ `# jumpÊ Cnextõ1, iV  re_>one²¾ AinitMI €™ «__a(. í  W  RN=posº  / i Ç   F c= Fals¿* pa chunkõ òQ fromS �	z 5buf– !fpÁû(io.DEFAULT_BUFFER_SIZEË$un½@ $ Ð6or. B(bufR ° + 0or.X ànsumed_tail !=&¡fp.prepend¹/._L 	
 /el� Qused_8} 2# Pv U alyTbytes€ o0objR‰they can~ Ñ# be seen by y _eÆ1 	eA 
Õ È0if sˆn
¢ · 1if <ŸPraiseêÐError("Compreÿssed file ended before the "
  õ"end-of-stream marker was reached")
D ûself._add_read_data( uncompress )* ¶pos += len(& % greturnA j Kdef e  y  , p +):d ðcrc = zlib.crc32(&  , 2 V._crco  é s_size ='  +¯  E ù � ð @eof(E „ p# We've-Ad totaend of  •°  , ± check that!  ;Ñuted CRC and ˜ > 9 >!ed� matchesE ðstored values.  Notþc  R K - i; Btrue; ' µ mod 2**32.2 U1, i  ô= struct.unpack("<II"m$vxact(8)w1if D $ !o6crcÆ Ÿðraise BadGzipFile(",�failed %sA ±%s" % (hex(U %),©  I   I  Ó+¶ Celifõ 1!= ÷(._(S& 0xf  ‚ Ï  �Incorrect^0gth! dz producg # —Às can be padÛ²with zeroes/ötill have archives»Ñ# Consume all6 D byt: e‚ £” positionÃUfirstZ`# non-v @ õ. See http://www.gzip.org/#faq87  ˜fb"\x00† wh§Sc ==  

 4 �0fp.Q*(1J
/ + šprepend(cµAwind¼¢±super()._re ` N ðnew_member = True

 ª å` ólevel=_COMPRESS_LEVEL_BEST, *, mtime=None‚ D"""C/±in one shotÒr ½d  edw2ingÛ Op«Ãal argument Í0  É˜  , in rangep20-9A """‘ buf = io.B2IO(d ‚Š  €obj=buf, „e='wb', m i = ÷ ý f) as f·qf.writeGp ò qbuf.getÆ"()u$deY 0 G E"""D 0 a €� - ü Zø R[Y 0 $ , ½)Ý Ë f»")
Æ Smain( @from¹ãparse import AÉP rA   ‚
 ð(description=
       ñ0 "A simple command line interface for the gzip module: act like S, "
  ñ"but do not delete= Ñinput file.")- ñgroup = parser.add_mutually_exclusive_& (2 ) ðargument('--fast',‘ ðion='store_true', help='compress + ?er'N 	/beN ObettN 	´"-d", "--de‚ "¨ "¨ !",@	 À "l un„¡instead of~1")
A I �"args", n ð="*", default=["-"], metavar='œ - šX _ (j Ï ñlevel = _COMPRESS_LEVEL_TRADEOFF— 0if < .}:  ã C AFAST- $elA  ›A BBEST Àbarg in‰  Ž H ^ ¥  ©   z == "-"   Ðf = GzipFile(C€name="",*qe="rb",÷òobj=sys.stdin.buffer‰ G  Cg = & 3out' " Nelse‡ ¦ ß[-3:] != ".gz­   D  ^ texit(f"¯ À doesn't end&Ã.gz: {arg!r}­ :   ó  open(arg, â È ”builtins.- §[:-3], "wbV Ð Ì r
 Å I	" ¨  H—	w— q‘ \  (Pÿ=Ê

Ü  @  @I	@" +ÙC›while Truúchunk = f.read(io.DEFAULT_BUFFER_SIZE² !if¹: fYbreakl�g.write(1 K qif g isL ¬^
X sg.closeã  Kif f= 2
< f< `
if __| __:¢'__main__'2   ð~()
#.  Copyright (C) 2005-2010   Gregory P. Smith (greg@krypto.org)
#  Licensed to PSF under a Contributor Agreement.
#

__doc__ = """hashlibpule - AP7monrðto many hash functions.

new(å ð, data=b'', **kwÓò) - returns a new? qobject â 3ðing the
          ñgiven hash function; initializing the  
B  $us/ U õbinary data.

Named constructorp ðs are also available,w !se Âfaster
than d ónew(name):

md5(), sha1 4224
 #56
 $38 0512 vblake2b Ñs(),
sha3_224P S3_256
 $38 1512 °ke_128, and}  ke. Q.

MoÍ ö gorithms may beÚ ð on your platform butî R abovò ò
guaranteed
to exist.  See( l] _) ˆ a J° attributesM åfind out what 1  OPs can­  passed to j)¾pOTE: If» C wan² ñ dler32 or crc32(ØAtheyÃŽ 0in
Qðzlib module.

Choose\ rC p wiselyý  om‡ñve known collision weaknesses.À!84°sha512 willÓ @slow{e32 bit}Ps.

Hý±objects havfðse methods:
 - update(ÌA): U �:= Q with ‚bytes inüp RepeatþNallsH ÿ€equivaleZ@o a Lvle callX �concatena§~ of allO  ` arguments.¾ ‘digest():¬aReturn©   J  5 · ý  ù )n Âso far as a A y 2hexc | TLike  b excepH Q is rœ "edP nstringt ðof double length,X@tain�ðonly hexadecimalr i	Acopy‹ 	 a  „ (clone)ÙU. Thiu– ñefficiently computJ € @estsY  @0s t{ sh÷ | NmmonN „B subÁ.

For examp!@o obõ Ê 7 Ñ 'Nobody inspãðthe
spammish repetiP1':
† ¡>>> importŒ5lib 4m = .x .)+b"o /")% ´ …  	. (A ðb'\\xbbd\\x9c\\x83\\xd À1e\\xa5\\xc9      a1-  ( Óf0\\xff\\xe9'©—condensedý  úplib.shaKÒ ¼ .ðö ñ4'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

"""

# {Qtuple×ç__get_builtin_Op() mustìðmodified if a new
# òalways available algorithm is added.
__' ó_supported = ('md5', 'sha1 4224
 #56
 $38 512',
  €'blake2b5  s, Vsha3_l 63_2n _p /3_r 
�shake_128t   H E)


¡s_guaranteô Nset()0 J/= / Qnl__ = N € + ('new– ˆ Y'9 ‘  Q Àpbkdf2_hmac'é ò __builtin_constructor_cache = {}

# Prefer our šð" implementation
# OpenSSL 1.1.0 comes with a limi1
4 3 ofM „b/s. TheD +
#_ £s neither ~c keyed? # (” ñ#MAC) nor advanced
# features like salt, personaliz½ ô, or tree hashing.‰  ø-only
# variants are-$s ¹ kD and sL€, thoughCØblock_opensslo iK  ©Ö  Ï}

def __get®q(name):B ¹×( í1 = 6 B.getK " 7if  ‚not Nonej  lhreturn( ; 6try$ 0if   ” in {'SHA*61'}%  M  imZ  _NG     ž [< ]® [v  2 .7 )elw !MD¨ ¯u ?md5t  9  c ƒ  A   X_md5.3 p 2SHAý ¥ 
   /24ÿ ?256� B  � � 0sha   0256?224? 056'- ?  ? ~ Ø  æó
 7SHAq8Ø 	?512™  B 
™   ™ 0512Ø /38Ø  ‹ 
?  ? ~ Ø l	{(* Æ  b`_ . b/ s/  s/ ¦ õÀ  D à
            cðache['sha3_224'] = _ .   '
  c/ -56/ /56/ -38^ ?384/ <512^ 5512/ àelif name in {À “ke_128',  e256'}:1  Å bimportà 	 × F 	 1  j 1 2
�except Iz VError“ ð pass  # no extension module, this hash is unsup¼ Aed.
‰ áconstructor = À P.get()" 8if % ¶is not None‚ hreturn( ^ ±raise Value´ '('‚ – �type ' +…÷)


def __get_openssl_ ˜ y ¹__block2 ,  ¶ñ# Prefer our builtin blake2 implementation.ù  4 Ù � 4 � / 8tryl àMD5, SHA1, and
 A2 argEall ˆÀ OpenSSL ver¹sM  | #5 q3/shake; �availablE 7 e1.1.1+5 Ðf = getattr(_÷dlib, 'Ki b   Ó# Allow the C6L to »°.  The func#… will bey Ñ# defined butN  ~ ,•actually Á  .  Don't fwback toK j1 ifJ ñ	current security policy õös a digest, bpo#40695Â”f(usedfor= b=FalseÜ1Useg CÞ ödirectly (very fast2 f± ™’(Attributé,õ): Oapy_newôó, data=b'', **kwargsY ?"""& 
B - R Qa newwÐing object us "thË øð d algorithm; opï¿ñinitialized with“ Ä (which mustÃa bytes-likeg )’1"""6	(ô ð  [&)“»  Éwq !	Ù¹ ‚Ðlib.new(name,ñ data, **kwargs)
    except ValueError:   ñ## If the _hashlib module (OpenSSL) doesn't support. WnamedE  = ÷, try using our builtin implementations.7 ðThis allows for SHA224/256 and u384/512} ·even thoughH  Á ° õ library prior to 0.9.8Æ pprovideÆ m‹ Óreturn __get_¹ Ð_constructor(ñ  )(]r)


tryC!im=“ qnew = _ A_new Z  '  g xopensslg + ÿalgorithms_available =  q.union(7  Î  x Dlib.` €md_meth_Ã 3s)
Iº 8 q = NoneT Ë /pyÉ 	0 ### šô's PKCS5_PBKDF2_HMAC requires% ± 1.0+ with   Ž Ffrom¨{¿pbkdf2_hmacÛ 9 €warnings� Ç  P as _	 ` ñ_trans_5C = bytes((x ^ 0x5C)Ÿò x in range(256)]6 ,366 /366 m Gdef ¼ (£ò, password, salt, iter<€, dklen=¡)‚ óC"""P4 ñ based key deriv8 P func}@ 2 („¡ #5 v2.0)
Œ  D ‹]Pytho²T oy e j%PaboutEEfastK aÎó é shƒé sîPmuch I %erK  , Elong?5"""( Å
"Í * owõ) is deprecated.",T    cgory=D# BionWI
) Åstacklevel=2B ! H øif not isinstanceð7strÍ / ’raise Typ¯- ±S O1, (¿,Ækarray)a + ´´memoryview( à � l šh  ' d   )Í Ò# Fast inlineú
7T¸inner = new ¦   ?out 	€blocksizQ�getattr(R 1, ' _ Y', 64½6len1 > ,  + … ~ ;  Ô–).digest(_ 5  Õ+ b'\x00' * (m 9 - ‰ D À   inner.updðate(password.transl _ s_36))
  �outer.upd! 4 U5C))
5 ñdef prf(msg, inner= !, O = %):0  l ô# PBKDF2_HMAC uses the s ñ as key. We can re-use# KsameK ò	digest objects and just È P copi` ùo skip initialization.L bicpy =Å f.copy( · o  Ò    @ ?>msg=  ) ¸ (€ d preturn k ." mqif iter¼ Zs < 1Xöraise ValueError(- � úif dklen is NoneC  =½‚ F_sizv@  M , kea5b''x…loop = 1 ¡from_bytes‹&t. $ òwhile len(dkey) <Ò 
Ê aprev =œpsalt + l 2.to^ ›(4, 'big'�ð# endianness doesn't matter here� long to / �  Á�rð (inÆ (™ | Ó  üçfor i in range½K - 1C 0  I â   ã    ## ‚   ^ & 	r  %  =Ë  ( ¢  B( +¯ B  …   J `BR ƒ í @ ![:-b]

tryÉô# OpenSSL's scrypt requires Q 1.1+O ‰ó _hashlib import6 ‘
except I a  p0


w°__func_name�À__always_supJ "ed2 P# tryìðm all, some may not work due Ï¾ Ÿ ‘# version* V iFÒhat algorithm� ]§globals()[¤ ‘] = __getò ( ò 
¿  P qlogging�    .:  ion('code  Vq %s was¿ ™found.', x ñ 

# Cleanup loc´ ^
del M	:   Ê 0 `py_new  {   % öopenssl_constructor
"""Heap queueLÀ (a.k.a. pri^y! @).

/ 0s aÍQrraysæ ñwhich a[k] <= a[2*k+1]P
  2]0 Ð
all k, countÊ�elementsI€ 0.  For,ú sake of comparison,
non-exis;  “  Û `ideredIb�f¶`e.  Th Atere9 �
property^ 0a hðis that a[0] is ÷!always its smallest element.

Usage:

heap = []  ð# creates an empty ( - Ppush(  , item) #   , A new r on the5  & ! = 1pop; 5 1ops% � ) Afrom  c 
 < $[0£ #Ð   m ñ without popping itµ iify(x)â ñtransforms list into a§  , in-place
 È linear time‘ !re# Ñ  × §and return| ¬  ,  Wadds
�  #M;ò size is unchanged

Our API differs @qextbookÎ ñ0 algorithms as follows:

- We use 0-based indexing.  This makes~ ñrelationship betweeâ"
 5 ± for a nodeâ  ýN eq r…ðchildren slightly lesÀobvious, butÞ ðmore suitable since Python® s¯  Ë   3 cv) metho„ � 	gQ, notÚ `larges‘These twoø   iE0ssi„ qto view1  e  H”a regularœ  F
€¡surprises:„ ½iï  S ò.sort()
maintain-   ð invariant!
"""

# Original cqðby Kevin O'Connor, augèÐed by Tim Pet ~ðRaymond Hettinger

__about__ = """Hñ queues

[explanÿ N ðFranÃ§ois Pinard]

0 �s are arrt ñwhich a[k] <= a[2*k+1]
  2]>À
all k, coun— «Òq0.  For‚úsake of comparison,
non-exis;  “ ñ
considered to be infiniteæ  Atere9 �
property^  �cthat aÃVPThe sZgY ·Q abov¸Smeant‡  Zò
fficient memory
representn G€a tournaÏ² @numbÍQbeloww2`k'Ò Z/:
\ p0& 1  
27 3+ 4 + 5 6> 7 8 9 "10	 1Š #12 k "14B À15 16   17 1D @19 2; @21 23 @23 2Ž @25 2( @27 2( ‘29 30


I¾R treežñ , each cell `k'÷C`º'º ð2'.  In
a usual by¨` we sex sports^ ¢winner
oveÕ x ~  ±R topsÁwe can traceý8 F dowÃ 1
top àall opponents õŠs/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when, Á is promotedi °try to
replc ðit by something else at a lower level, and Ž ñ rule becomes
th) Ecell! @two  ñs it tops contain three different items,
butZ 1top9 Â "wins" over  woI 1ped  ð	s.

If this heap invariaR ë atectedÄ pll time”Pdex 0€clearly
Î  d 4allWð  The simplest algorithmic wa6p removeÛ cand
fic"next"G  e 1to )  Xñ loser (let's sayÇ 0 30*ñthe
diagram above) intoù `0 posi7€ n percolatÑis new 0 downÑ Ðtree, exchangÏÑvalues, untilV 	/ðre-established.
TV3is %T logaoÃòe total number ofÇË  € @.
By 0rat‚  d eðð you get an O(n ln n) sort.

A nice feature^ ç  V p @ 6canñ€ly inser=!w
f P whil"eZ  < !go�  n,0vidg O  ?  ed¶ pms are
ŒÂ"better" thaü àlast 0'th elemÅ Ž  ex® teAð
especially useful"Qsimul!exü2her«  =` holds0`
incomµ "ev&„ !"B da meansÜAsmal» scheduled
 P.  Wh!n L   b other ²s for execusAthey. d› fu¡1, sª!y ‘†asily go'   �.  So, a
  ŠÀa good strucF x t R ñ q Ars (@is w­aI
used1 ömy MIDI sequencer :-).

Various_ Ø ` 0havÐðen extensively
studi0 s ¸ ¸  & • 1, au$ñ reasonably speedy,� õ Plmostµ0sta¥ Z  |0wor 0ase'  wm' e}Èaverage casep Ãe©Î‘representj :rich
are0e)brall, yeƒŒ òs might be terrible.

Heap
ˆalso verÞ�big disks�s.  You ö Aprob€all
knowR c 3 ÝQmplie¿0duc0"rua(whichÞ @pre-- 4ed
õsí   1siz@1usut re#dJ�he amountPBCPU 2`),
folådQa mer3Rpasse6`these Š i ð merging is ofteñn
very cleverly organised[1].  It is # Ðimportant tha ñBe initial
sort produces the longest runs possible.  Tournaments are a good way
toY  u Áf, using allO õmemory available to hold a tR ð, you
replace and percolate itemš �at happenB "fiÇ acurren­ D C'll
Î Á Qwhich° Qtwice“ qsize of Ÿ ðfor random input,
… Àmuch better "  a fuzzipðdered.

Moreover, ifÊ b outpu¢ A0'thÄ � on diskß bget anl  ¤ �
may not Û !in� Þ )‚ (becausÉ Ðvalue "wins" � 
Á4ast‚ " ›), it can_ �heap, sol 
   decreasesü“he freed 0†could be~ðreused immediately
3ñprogressively build€ second k ,ð grows at exactly˜ p
same r	 Ü Qfirst5  ÝÀmelting.  Wh ¦ ! acompleŠ v1hes$q switchF sŽñstart a new run.  CU ôquite
effective!

In a word,D ”re useful €structurT`o know %  Õ  eñ
a few applications,p pI think³"isd°to keep a `0ÿ' module
around. :-)

-  ‚
[1] Theyabalanc“lgorithms{Care n�, nowaday� Pre
moí@nnoy: Cthanõ¯ @thisŒÅa consequenc^ôseeking
capabilitiesz  \pOn devi	© < ð, like big
tape drivÆ  stXAwas ¢` diffe˜ pone had-!be
*  ñensure (far in advance)Æa each o @moveñP willî th5st "! (\4is,. °st particip¿Eat
"0ng"	á merge).  Someu Äs were even 0Ðread
backward— nd% s þ @alsoYë @avoi qe rewinlótime.
Believe me, realZ V w K°spectacular.²watch!
From× im… 7  Ðhas always be¶ ± Great Art!›ð"""

__all__ = ['Årpush',  $op 4ify   'F',
  P'nlar©   �nsmallest ^ ¡pop']

def§ q (  Aem):N e"""Pus¢ �€maintainá  n 9 ° invariant.Ó  Œ   .– d(©)U “_siftdownp R0, le G)-1)” !op# � !opÑ ;f®Ðheap, maintaiñning the heap invariant."""
    lastelt =! `.pop() ñ# raises appropriate IndexError if1 ‘ is emptyM  :  F £returnitema 5[0]  ’ T[0] =…  €_siftup(" E, 0) P    W   F 2
de� sreplaceG  / )› £"""Pop andK "ñcurrent smallest value,' 1add$ @new I !.
z @This°more efficiB AthanO²followed by Rush()Y acan beM E aopwhen usÂ²a fixed-sizËÁ.  Note thatš ­ H ðed may be larger* n¼ @!  T6 ðconstrains reasonable uõ!ofJ tß ó!routine unless written as part of a conditional vRment:& 
!if| ! >2[0]Š     T#@ ¶� ²ß 1  D?   ²" b @ =ž h }u . | 
f@pushè K ,G f FaGbersion* &  2  a5pop—J| 3  ¤ <] 8 ‡ ,:   Á2[0]„ Ë  ZÏ 	 B É Vify(x¼ òTransform list into © Q, in-[ 
 õ  O(len(x)) timeÃ nÙ Œ &# Q  bottom-up.‹¢d 0dexÎñre's any point to look	tN  is) Ýpst with‰`hild i¨ ¥ órange, so must have 2*i + 1 < n,L  Ðð < (n-1)/2.  If nØ0eveÇ Q2*j, qis (2*j( ³ = j-1/2 soH 0j-16  ou�st, which ‡n//2 - 1_ µodd = 2*j+1` K  f %+1h  Ã ^  Ã  /Pgain f 1-1.F fØ Áin reversed(($ )é#Rx, i)_uqpop_maxŠ/ `"""Max  S 
×ÀW‰Ô [$¦L  M&ü5ush:m P  àâÀis empty
   ð heap[0] = item
    _siftup_max( A, 0) rreturn  / `
def _% 1ify1 1x):, ð"""Transform list into a max0  , in-place
 ñ O(len(x)) time."""F Bn =   pfor i iƒ óversed(range(n//2)y Â  x, i)

# 'w a' is aö ð at all indices >= startpos, except possibly z Ppos.   
#F 0the< ðex of a leaf with a$ 7 òout-of-order value.  Restore the
#‹ ¢invariant.R ‚Cdown€˜ 3posè 0newƒ! =B Q[pos]$€# Follow_ � path to ðroot, moving parents e € until f	 ng¿  —M g Qfits. Pwhileã % >1ô {Y ppos = ( ‘- 1) >> 1= # ¹ Š ¿  ! 4if w <ª a  !  Êò # =  ]    w  9pos …continue Qbreak V €  8�The childî*!oft  !ex
±are already às, and we want‚0makî{3ind=  too.  We d©°is by bubbl© fssmaller† Aof
#u @up (f Rso on{Bthat' "'s “ren, etc)æ@hittX ±0,
#@n us ú to*¤P oddb) originally;À ÙËP.
#
#Ê �*could* ]@ out$ Ë Àloop as soon !wex u†os whereü¸=
# both itÎ @but ‰sY  ó ò's not a good idea€`despitÆ òat
# many books wr  ·€gorithm J   way.  Dur®@pop,'ð last array
# element ¯e w I Ptendsú°be large, sà ¡Aompaa i— ragainst sT ~ 0fro•  e ºA usu{ìdoesn't pay (= ‚
# get u"of·  uóearly).  See Knuth, Volume 3,zpthis isÝ �xplainedÈ�quantifiä Â an exerciseñ"CuT á#êcá 0sonO ð important, sinc� es× ðutines have no
#~ 3�extract "R 0pri¡1y" "an‚€W°intelligenck�is likelyR `be hidV¦in custom ¦   methods, aa   ± = (� ð , record) tupleCõ  Àthus potentiºVSensiv8’On randomÒ s;ðlength 1000, makv — chë  cý¡he number É `s madeA ÍPify()›TittleœÐose made by eñ–xhaustive
# heappop() a lot, in accord with theory.  Here are typical results from 3
# runs (3 just to demonstrate how small the variance is):
#
# Compares needed byš @ify    A1000$ �pops
# -  A  8 °
# 1837 cut¼ A16638  T14996  A86803 $55 F1659. 
 G14963 !783 4f 0)  T15024S P8703
€Building�õ ` by us Áaush() ò!times instead required
# 2198, 2148, and 2219 cox!: W ñ ify() is more efficient, when
# you can use it.œ •The totalM Åálist.sort() on¿ Psame  0s wT�8627,
#  š ô8632 (this should be] dž Dgsum of¶  anæ ÐÛ 1): o ‡ Àis (unsurpriBKly!)ð p
# for ¸ ðing.

def _siftup(b @, po» ¸Áendpos = len  )
 Rstart 1pos ‘newitem =¶ Q[pos] ²# Bubble up"ðmaller child until hittïqa leaf.8   c  2* 0+ 1{ £# leftmostC �position6 Rwhile  4 "< Á : ? #Se:  ! €to indexnÃš …  2 Crighì ” 5+ 1R 5if # p ê2not7 2] < 0 ]˜  j ( % =R f o# MoveBp«  ¾z†R ‹ d  õ =!_ ) 5 = n  #  —0 at Aôempty now.  Put üRthere�bõSit upI  l S"inaó place (by ‚ òits parents down)à Ü p X º ( Ÿ$, ›ÆÞ $ O_max( ‰@'Maxh  Ät` 'o { açaFollow¢ pa]o  roy0movÜ Ø ü1finý!a e #RBfits Ú ¿>ä ¶ ×1  0= ( w- 1) >>¨| ¹ 1 #ifx$ <€ a  e  _N ®      w =C     …continue1 Qbreak V ^¶'up´˜
ªÀnt of _siftuñ
p'
    endpos = len(heap) Rstart 1pos  newitem = ' Q[pos] ñ## Bubble up the larger child until hitting a leaf.7   b  2* 0+ 1‘ £# leftmostC �position6 Rwhile  4 <À : ? #Se:  ! ¹to index of™ „  1 Crighê “ 5+ 1Q 5if # o ‚ and not
 2] < H ]—  j  % =R f o# Move@ pª wƒQ ˆ c  ó =^ ) 5 = l 0# T²peaf at > ôis empty now.  Put ùathere,ü bòSit upI  jÁts final resñÑplace (by sif òits parents down)à Ü p X _8  ( A_max $, œ,± ò")

def merge(*iterables, key=None, reverse=False)”@'''M3 ö multiple sorted inputs into a sing �output.
š £Similar to; (} ·tools.chainŽ ñ)) but returns a generator,L AdoesPApullBdata…  memory all£3oncƒñassumes that each ofM  „Æ ó streams is already«   (smallest¿ ±3st)Ù ’>>> list(Tð[1,3,5,7], [0,2,4,8  5,10,15,20   B25])=ñ[0, 1, 2, 3, 4, 5 p7, 8, 1 ¢5, 20, 25]L€If *key*ª  W¸`applie/€key func ² ï aelemenÂ ‘determine c Îo orderÖ à'dog', 'horse'À @'cat @fish €kangaroo  M4lenà = 2 L 6, '; à 2'''	 Rh = [¯€h_appendÍ. $  q²« Ø_ dify =   ï   4pop  >pop  "re�D  	( Bdiref2= -Oelse‰ “ „   "poŸ p  ð 3eap > z 1	 ù0is „ 2forÛÀ, it in enumOQe(map‡  
)ò ˆ   6tryK     Ànext = it.__ %__™     ° ([! 2(),„ 5 * »  ,  ] 4   Àexcept StopIž Ä� 2pasf 3 ã&(hK ù¥Z) > 1C Õ 3 5TruÀÀ            ÿ  value, order, next = s = h[0]
   Ryield8   as[0] =K '()@ ÿ# raises StopIteration when exhaustedR ó_heapreplace(h, sW  # restore ! ` condiT 	E jexceptu :"  ¤ c Spop(h\     g Ámove empty i» %orD Jif hR ²# fast caseà Õonly a singleB … remainsJ  q ‘�… Afrom�•.__self__c qreturn
 4forù it in enum˜`e(map(é ,­ fbles))å 6try  ¶ 9Pit.__ r   Õ }     áh_append([key() )�€ * direcÔ,r£%])C ß2pasbäRify(h? �while lenõ6> 1Ò ß + FTrue%  ½   Akey_· ¶ 	ª M	¬; Ï  Q    1  d2A 0s[2†H  
	Q# P= +6 
ÿ	Ê Â ð

# Algorithm notes Âñnlargest() and nsmall O
# = –
#
# Make¬ >ò  over the data qkeeping âk most extremeª0s
#Saœ�.  Memory¥@sumpÓô  is limited to Q k@ > Rlist.˜ ñeasured performanceárandom inputs:,  $ ðnumber of comparison³ C   nK A *k-Ö    (average< q5 trial‘0% m‹èthan min()
# - *   >--- 1 *  1-
#� b 1,000  1  s  3,317  c231.7%G /10G d14,046@  C40.5G /10G t105,749?  5Ž Ñ Ž  % U7,751? 	 00.8Ž Ñ G % À9,401         ð*0.1%
#
# Theoretical number of comparisons for k smallest ñn random inputs:I ‡Step   C: n 	 ñ Action
# ----       
a-
#  1U �1.66 * k  òheapify the first k-³  A 2/ ?n -> #  ðe remaining elements to top f  P 3P ñk * (1 + lg2(k)) * ln(n/k)   replace‘ ñtopmost value on L 4L G p - (k/2D  Á   final sor“ ã !k Q rextremeY sœBCombÀ Àand simplifyÐ  Ýóa rough estimate giveÖn a= n + è �log(k, 2æ "ogç &+    þ )‰ 0puty  ± psM#3:* �
# * ForN‚i-th newR from �terable, °probabilityÏ beŸ i� × W‘ is k/i. m _exampP  é Q101stM îXseen i O 100¾ g �100/101.Û !If´ G Ais aà 	óÖ c\�of inserrPit in·!he‹  l`  ­Éf HThe Qtimesy W   @(k/iüO )µ @SummURacrosH R6n-kVZ Osum(^ œ1i i‘Âge(k+1, n+1)x  This reduc¾ oO¬  “(H(n) - H§Òº
¾ aWhere - i½ nX„harmonic6>Kd byj ñgamma = 0.5772156649ƒ‰ "  ^ =9‚n, e) + 5 À+ 1 / (2 * nÕ ð  http://en.wikipedia.org/ #/H• ð_series_(mathematics)#Rate_of_divergenc	–* Substit˜ì {formulaË 
	3  ÿ  3n/kÉ 0(1/e12/ 2	¡Worst-caseÄðA
# I’  w9  9 èÐP dataÌ�reversed ` that  y+Á£
# must be" edG ­ ÓŸ4= 1wá(é kâ ÿAlternative AlgorithmsÒ¥
# Other a,   wyPnot uÓ abecaus=að$1) Took much more auxiliary memory,
# 2) Made multið(ple passes over the data.
# 3) Made more comparisons in `mon ca: ð(small k, large n, semi-random input)R 1Seeb R €detailedL [ ñ0 of approach at:
# http://code.activestate.com/recipes/577573-c£ ñe-algorithms-for-heapq¢ ¤est

def n ñ(n, iterable, key=None):
    """Find² $n 3 � elementa-Qset.
3 úEquivalent to:  sorted(c �key)[:n]2 2"""; ñ# Short-cut for n==1 is to use min()2 ’if n == 1¦  ª Ait =È j +   ósentinel = objectG   Presul<  ^ Äit, default=5  ± { 4 ³turn [] if A 4is 2 r else [ ]Û ÀWhen n>=sizerp's fastqß )· 6tryÜ  3 k = lenÝ òexcept (TypeError, Attribut Ç µ  ãÂ  ž \ K0>= d   1 !reæ — ÀR !# Ý 0key®Qnone,±ñsimpler decoration/  ifg +  ju Ã	Q# put‡ñrange(n) first so that zip() doesn'tg  Ä ö# consume one too manyÀAfromV ß 5tor: ¾P = [(îA, i)”!i,>   s Ž  Ò)Ï x  V#otâ   W` o _£‚ify_max( 	 3 Stop =M V[0][0i ‚order = Z - J ¨replace =   ] r  a Ú  Ê *it¤ "ifå Z< top c ­ #, '‘ )¼  0   atop, _ Ì �  $   " E+= 1 .‰	¹Ÿ[Ä  Í 	�  Ö 8 �qGeneral±ñ, slowest methodl €H 1keyg 3), 	±
1> þ -68in ú0k =™á  ‘ ® 	 j 1k, ‘ &1, _ƒ ×r  v E  ƒ9ÿ{ 	òšðst(n, iterable, keñ+y=None):
    """Find the n largest elements in a dataset.
2 ñ,Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]@ 2"""I ñ# Short-cut for n==1 is to use max()2 ’if n == 1³  · Pit = s x +   ósentinel = objectG   Presul<  ^ Äit, default=5 ¿ P Óreturn [] if A 4is 2 r else [ ]Û ô
When n>=size, it's fasterß 7g 6tryÜ  3 k = lenÝ òexcept (TypeError, Attribut Ô é Apass= ž \ K0>= d   1 æ —  [Î` !# ë 0key¼Qnone,¿ñsimpler decoration/  if  +  …ƒ Ñ	[P = [(™A, i)1!i,© ¥ðzip(range(0, -n, -1)w)t á  û #otÁy   ü h §   ‚heapify( ©  Stop =H V[0][0d ’order = -í  . _G §replace =  i  ý Ù  É *it› 0if p <ê 
 ^ © #, &� )¸  0   atop, _ È �  $   " E-= 1 .%(Þ" -Ð  Ù 	�  â D )ðGeneral case, slow�amethodV H 1keyg  ó! À ¡ @	 ,58in 0k =2à  œke 1k, � 
1, _ƒ Í r  v E  ‚<[R  Þ (‡ 	¢# If availw !C D ŠA'Qfrom ì q$ cort *
aImport ; 	I £O_maxJ ,?ifyF 0?popF Ð

if __name__#²"__main__":ŠiÐ doctest # prðagma: no cover
    print(doctest. »mod()) # pr0 ñ<"""HMAC (Keyed-Hashing for Message Authentication) module.

Implements the H ð)algorithm as described by RFC 2104.
"""

import warnings/ _ Q
try:Ë & �_hashlib&   ñopenssl
except IM RError8 1 % q = NoneP ˜_functype ô from _operator t àcompare_digest{ 
 R
elseo 
 8 = € . ˆ  � (1 ¹ ð_sha256)  # builtin - = 
ñlib

trans_5C = bytes((x ^ 0x5C)×°x in range(] )1 ,361 /361 ð 
# The size of ü$‚s returnñ¡depends on( Ðunderlying
# ¿  mQÂ used.  Use O _b ž d qinstanct \   Xead.
/ í€

class ) ¤4"""ƒ  ! `.  Als>±mplies with¬a4231.
®€This sup²ì1APIMàCryptographic >  Fbñ ions (PEP 247).F  ÷ ŸQblockÛ @= 64Ýq512-bit— °; can be ch¤d®1sub­ #es‘ Ñ__slots__ = (]  Y ñ"_hmac", "_inner
 2out
 w S  3"A )ë ðdef __init__(self, key, msg=F,œrmod='')[} á""Create a newÌ s objectµ  & Bkey:—¡ or bufferb N ækˆ>  9   ?msg=  ÕInitial inputG  \ c  ´  B ö bmod: Ad Ñname suitable>  : ñ lib.new(). *OR*! @  @  ~€construc<  Õ M È K c ? ;;| €Required”pof 3.8,lÐpite its posi¬a aftery op /alË €msg arguËp.  Passƒ iôa Eword# ? isF ô
recommended, though not r­  Tplegacy ?vreasons�  Y !if=  iså ö(‡(Ó,Cgarray)ƒ "¡raise Type!("raexpect—0tes H A ñ , but got %r" %a l @).__#__ ^ – G°   | "MiJ`parame”'D :'."b W and 6 Àmod, (str, _×functype)):
  :try   ùself._init_hmac(key, msg, digestmod)F ôexcept _hashopenssl.UnsupportedD6 _Errorp 
?oldo JelseB ® > ® Gdef Ö  8 /, Ü `  $ .* =ß  O_new® =' J  �_size =  ] . « †_block1   
1 Ü   Z Û Âif callable(  ×û  ƒ  v_cons =ýr    çelif isinstancH [, strk
M Òlambda d=b'':[@lib.R) Wmod, hù( ž 
Q  2modR )& ´  ÓENoneÎ  Uouterî ^ (î$ ?inn$ � 
º7 	ì| ·if hasattr(c 6, 'é'P 	K`  y ^  ø 1if  2 J< 16ë #  _warnings.	 (| ù of %d seems too small; using our 'm  N  ‚'defaultK e.' % (‘ , /),O ‚RuntimeW² 6, 2¤y N l ] U"No7Q ¡ãibute on given� object;`'Assum3"%dí˜ ÷ ó F ï ð `if len´2) >Ù  
;key Ckey)¸(K#¶„ is the ê’ .) I%is” ²# effective’  “ € as well  T ¦public API….D G_ =J  I úØ ˜key.ljust~Vb'\0'BO _
p.update3p.transl 
 L_5C)4 ƒ4 '364  ifW 7@not �
Šˆ M 3msg{‘@propertyÿ  úAname8#àif self._hmac:'
  õreturn self._hmac.name# Uelse:  8 1  f"- "-{9 Qinner: 1}"
/ °def update(# f, msg)J ð"""Feed data from  ñ into this hashing object."""V  � ginst =² 3 or ‡ 	) .„  ~ ™ Acopy— 
’ R°a separate ) ? of” O  ’ #Anë  ¿ 8 ô
won't affect the originalÖ ª ß ð# Call __new__ directly[ QavoidJ õexpensive __init__.M Uother!“_class__.Q ÷ $._ )7 Ä.digest_sizeC  - #ifr Ö  KB X (p , ·3 = ; 1outÁ ?Non‰	.  ‚ 9 = - \   …!._j .Š { .  .  ~  ë�_current_V ÔûA forÉ7 r state.P  ¾ ð To be used onlyÒernally with •¤() and hex T¯Ï ñ  LäûhÑ ¸ hqQ p� 
ýz hõ  E(  ; C DE_value˜TJg sn à  = Àas bytes.  T›h5 isÿ ò
not altered in any way byö
function; you can continu³{ Å ¸ É0 afÜBcall 4is J »t+CÛ # h¶&()KNELikeAb, but J ps a strš  ofV€adecimal. @its {?eadª (˜ 0)

ôqnew(key =Å,m “estmod=''`"""Cre’[a newÃ 3 itFBkey:ã  qbuffer,ìPstartå 5key‰ XØ ?msg9  ÙInitial input6 ,`  º ? Åamod: A¨  Q‘ suitable;  m @lib.ý u). *OR*x F#  < 0libXƒstructor¨ ¼ SG ðmodule supporting ºPEP 247.

  ð&Required as of 3.8, despite its position after the op ,alK ð
msg argument.  Passing it\ •a keyword# < isB ô
recommended, though not r¥ ófor legacy API reasonsÖ àYou can now feÓ òrbitrary bytes intoÂ sbject u  ¡s update()‘ ±method, andP @ask y  ü òhash value at any time by callï ƒs digestO dor hex  ^ !s.k 1""" óreturn HMAC(key, msg,G £mod)


def " !):E ð"""Fast inline impleŒa¯ Ý _ ,Ckey:àor buffer, The§î akeyed ô o3¶ ?msg=  ÒInput message) õ 2: AD Ñname suitablee  [ ‘lib.new() ñbest performance. *OR*à ¹N òlib constructor C ‚Ra newr ¶ D Pmodul� Ppport8 $ i š@if _¦ ¡openssl is’ANone!`isinstª (î ó, (str, _functype)Ÿ V 2try¬    ¶ 	c b.hmac_M ë
jexcept: AUnsuÏ 1edDƒŠmodErroru Bpass	!if¸ �¿ ­ ƒ _e# =| _elif ù  ?str? Òlambda d=b'':¶ ùh 2, dFelse°  … 
F  = # PUinner® 7 ‡uÀÈ  ñblocksize = getattr(H 1, ' _ R', 64¢ `if lenœA) > #  " µ ;key„ Rkey).° � $   Õ+ b'\x00' * (N % -e v  Û .ª key.transl¸
 B_36)* oë * 	#5C* ç * ?msg@  # » ! ¶h  
3�General ýAionsÕÁHTML manipulŽ.- 0
im|0 re"ð_re
from html.entitiµ$   5' 
 ó


__all__ = ['escape', 'un ]4 ã(s, quote=True¦ ±  5ñReplace special characters "&", "<"ìp">" to Î ã-safe sequenceÎ"If^ R flagv  7`true (E€default)äe! Q marka�  , both dou3Â A (")�  ¾l@ Xe (')¸ ðare also
    trañnslated.
    """ ÿ"s = s.replace("&", "&amp;") # Must be done first!6 <6 _lt;") > g ‘if quote:-  Ž 
† 0'"'†  $ R %  !\'& D#x27& ð$return s


# see http://www.w3.org/TR/html5/syntax. ð#tokenizing-character-references

_invalid_ 0ref° {¾ ô0x00: '\ufffd',  # REPLACEMENT CHARACTER- d- r)  Ó ó# CARRIAGE RETURN' 8T @20ac+ ¥# EURO SIG! 1H 0x81  u ”<control>B 2! Pu201a# ô# SINGLE LOW-9 QUOTATION MARK3 33 B01923 õLATIN SMALL LETTER F WITH HOO6 46 B201e6 ODOUBi 53 "263 ôHORIZONTAL ELLIPSIS” 6+ 0+ EDAGGN$87 ## | 
% 8% 302cn „MODIFIERÔ ôCIRCUMFLEX ACCENT| 99 3203| ™PER MILLEŠa& 3016& 6@CAPIÐ 8S8ECAROÃb9 B2039Û ¢áEFT-POINTING A¶°cA 9015°z ¤IGATURE OEÑ }!x8¨5eR 7# /# Ì ZÌ  f9 0x8fÊ Z 9Ñ!x9$! Ñ °8D d# LEFTµÿ 9â@ORIGH3 â3201We 5e Þe 3 
Þ—TBULLEU9Ñ"13è sEN DASH£9Ò#14 M ÌdÁ S�DTILDå9¶#12 QTRADEè·9·;ëP µ9µ
W¶9¶	y ´9´99´€	P ¶² 9²Du017pí=9 Yë`DIAERE–}†odepoint # R01 to
 8Ø`1, 0x2 3 4 5 6 7 !8,, C EC !1F 00xe% f !10 T 1U 1V 1W 1X 1Y Ð17, 0x18, 0x1À9,
    0x1a, b c d e f( ±# 0x007F to
 #9F?  7f' !80 1 2 3 4 5 6 7 8 9 ac 10x8… 8… 8… 8… 8d 9d 9d 9d 9d 9d 9d $96L 9h 9h 9h 9é 9d 9d 9d 9d 9é BFDD0é 4FDEé 1fdd� 1fddƒ 1fdd… 1fdd‡ 1fdd‰ 1fdd‹ 1fddñ 1fdd‹ Dfdd8� 1fdd“ 1fdd• 1fdd— 1fdd™ 1fdd› 1fdd� 1fdd3fde„ &e1L eˆ eˆ eˆ eˆ eˆ eˆ e3fde„ e�3fdeˆ eˆ eˆ eˆ e'cothers6 "ff& !ff® #1f  	  2  	  3  	 \ 40x4  	 ( 5  	  6  	  7  	 L 8  	 ( 9  	  a  	  b  	 L c  	 ( d  	  e  	  f  	 L $10 
 ñf
}


def _replace_charref(s):gás = s.group(1) âif s[0] == '#''  ×£# numeric E .   2 —1] in 'xX3   ònum = int(s[2:].rstrip(';'), 16t  ) Felsen   ; 1; 7  if˜  | „_invalidå sN }return & X[num]Ì ‘0xD800 <=Y Á<= 0xDFFF or >Û_0FFFF` ˆ'\uFFFD'R  É i{ �odepoint£ '= µ rchr(numö 
)# named•_html5« _ &[sþ ñ# find the longest matchingg ñ  (as defined by) ‚standard�  ¸Pfor x| órange(len(s)-1, 1, -1z )   =!:x>‘ 
¬  $  æ[s[:x]] + s[x:¼ 
7 0'&'- 4


  =ö.compile(r'&(#[0-9]+;?| C  €r'|#[xX]) oa-fA-F/ ò
[^\t\n\f <&#;]{1,32};?)')•…unescape�1"""6±Convert allvPd and|~òacter references (e.g. &gt;, &#62;Ë`&x3e;)‹ Ó z@ng sˆ   correspondàqunicodeI` !s.Ž ñThis function uses÷ðrules defined by thòe HTML 5 standard
    for both valid and in ñcharacter references," ±the list ofE Y onamed 7 p define\ ð  html.entities. !5.F 1""" ñif '&' not in s:  ¬ �return s  _o ôref.sub(_replace �, s)
"""   ) Ï } yÖ .{ Ñ
__all__ = ['— @', 'Ô  2codepoint  2   P ðdefs']


# maps %y   . 1 to 0UniG   Z 
 i A = {ç €'AElig': ð0x00c6, # latin capital let¦LAE = óigature AE, U+00C6 ISOlat1^ Qacute_ ^ 1^ a with 0 L 1L AcircK  L 2L  0 cumflexQ 2Q Ggrav� 0Q 0   k 0k Elpha¼ !39\greekfa* E $39E8rin£5¨  0 o above­  $ g ;0C5¬ Gtild3o 0 L 3L 2uml÷ ´4L “diaeresisP 4P 3BetG P !39HAbetaD 2392ŒRCcediŽ @7Œ CŒ0 lF :0C7Š 3ChiÙ Š aN Š 2chi‰ "A7‰ aDagger> Q0x202�double d  0    s 3pub7 $elý Q0x039Lr d*  D  &  D Bgrk3E 1ETHy    · /0dô1ETHC +0DÌE¤F H9HEH0 L  C9�  E¤K � /caL  0 	ÔAQ …R � 8Q 0 � 8L `psilonM qxqe* G 3395k®k/39"«"E7bÆ 7BÊ CGamm8Ê ÓÊ g* È Ì;IÈ ¬ð d, # latin capið%tal letter I with acute, U+00CD ISOlat1
    'Icirc': þ0x00ce, # latin capiL  0 cumflexQ EQ QgraveR Q cQ 0 L CL 1otaJ €  0x0399L \greek� AiotaD 3399Ù 6uml< 00cf< Ù 	‘diaeresisH :0CFŒ CKapp� Œ aP Œ k* E 239A� RLambd> = b= l* > Bƒ Bgrk3F #MuÑ [ƒ #muB C: VNtild• d1€ N20 D 00D1† 2N† dL † n† D† ROEligÃ `0x0152: † ¡igature OE~ 3152~ 2D ÌE  _/d3D  üOÊ 0 L 30D3L üOÌK  _?0d4L  0 ü+D4Q ÌR � á 	� 0 � é � 2meg2 � /3aüo* E 03A9‘ 2pOmicron’ x¬o* G #9FmPslash>  „ ?0d8!�stroke =B!O P d 00D8« WOsl 5l 0 L 5L 
ü/d6L ü*D6P 1Phi™  yaP G1phi“ !3AC ŠPB  K03a0“ C B 0… B 2rimÃa 0x203ú€double p ñ = seconds = incheË +  J Btech×%Ps�  a×Œ s� ®� 9RhoQC 3rhoÙ3Sca“ 
!16
%SÂ0 D !163latHSigm%‡ s* E !3AÌ RTHORNÎ ¶* E +0D÷%TaTLŠ #ta"A4�4Theç ; 9�t* € *39‘À'Uacute':   ð>0x00da, # latin capital letter U with acute, U+00DA ISOlat1
    'Ucirc':    0L bL £circumflexQ BQ `grave'R � 9Q 0 L 9L `psilonM `0x03a5L \greeké u* G 03A5G Cgrk3ä 0umlD ä cG 0	‘diaeresisP 00DCP 4#XiN  4039eP — !xiB 039EB ’ Y’F %dB ’ YÂDL Ž YÞ ?178L 
Þ 3178P 2.AZetaš Þ 6P Þ Czetaà 6< aØ  e1< Ø Esmal˜aÖ #E1† ˜ah‡  "/e2J  . –,E2O "ut• ³00b4O ­ ø accent = spacing. B4G 3diaß Gelig• ß 3e =‘÷ “igature a‡ E6Y Åa[ ï 0  Z 9. d ó!a  ˜;0E0g `lefsymh Q0x213Qðalef symbol = first transfinite cardinalS  4 C NEW3lph,  bï+ø ”  (  ? 103Bè
0ampŽ  Œ ù 2S‘ampersand4 !02-3numv &nd3 A2227,ñogical and = wedgj   Dtech> Â ß1222jDangl0 3Camso0 3rin2  ¡ e3š . ] abov " Ø E¨$syQ0x224Êðalmost equal to = a' €totic toJ  +  å Camsrµ Btildðµ 3#"
™O.  J @00E3J ” 	^!0e9ÿ 
\!0E@N Rbdquo½Q0x201:ðdouble low-9 quotation mark” F201Esbžbs  (  > 103Brabrvbar…  arÓbroken bar =  AvertT1barK *0A‰6bulX1202Œ   eObblack o Ÿa!02� 2pub«'ca12220�intersec	=í �   ð  ISOtech
    'cñcedil':   0x00e7, # latin small letter c with . ñ	la, U+00E7 ISOlat1
    ' K L  b8L  Êla = spacingD  B8D 4diaC "ntB C "a2C rnt signw  A23 3num3 #hi2  3 !3cÂ [greekÂ !hi@ !3C· Cgrk3A 3ircB `0x02c6t …modifier ñircumflex accentL 02C6Œ 3pubK BlubsL `0x2663K ð black club suit
phamrockD  & 
D 2ongC p 0x2245D ñapproximately equal to@ 0245@ Ctech… 5opyA @00a9A ‰copyrighI99 IBrarr9 Q0x21by ó downwards arrow1orn"ft ñ= carriage returªƒ21B5 NEW– "up\  i@222a– ²union = cupÌ  2A“ Ì Qurren9  Ÿ a46 c (cy48 Ë $dAÊ  D!1dˆË bdoubleÒ x 01D3@ 3amsˆRdagge`0x2020x  1 00201 ùd;q 9q <9 !19j ª eí ¾"0bi eÀß Bn 5 1lta 5 !3b 3 óBdelt¬!3B!õTdiamsC 1266õª  1ond­´ *66æadivide=  •fr  sÎ©Fi¶ Veacut7 e˜k ee.  € 100E©i%ec³ � eLJ  . ¼O eO Ggrav™ ¸O . J ¾J 3mpt| ¼0Ce 0 seúCnull  g@eterJ 1220ÅBamso/4ems0 �0Q!emEe3 !00Jƒ*en2 ;)en2 :2 Qpsilo^B0x03ñG e(  v 103B© IQequiv ú0261*widentic¥ 610ÙeÁ 103bD| ÁMx "thv A !0f9µ!th¹ !0FD¬"umøA  eb¹ A �’diaeresisN  EBÐ N #ro�  ° acN EeuroÆF20ACCexisê*àathere  g "22ä7Efnofg 1019åµ f® Àhook = funct•q= flori˜à0192 ISOtech
 ð   'forall':   0x2200, # for all, U+ ¡ ISOtech
 2 Srac122 @00bd2 þvulgar fraction one half =  W @00BDW 7numV 4V cV |quarterY  \ C\ 3\ e\ cthree G s_ 
 b Eb sE F0044b Pslash8 ‚2044 NEWó Qgammaò p 0x03b35 ð greek small letê (  ? @03B3w Cgrk3C e@ ¾#65C ðater-than or equal toC @2265C Ï'gtC 10036greC @sign< :003ö ChArr= Q0x21dö ðleft right double arrowA @21D4} BamsaÀ )haB 9B ; 9; Qearts B0x26û pblack h ñ suit = valentine‚ 6ÿ 3pub� TellipF 0026A±horizontal   si¡dot leaderP 0026Ò P Riacut•Q0x00eZlatinÔqi with .  I 100EBlat1š Qicirc™  !0e˜J  . cumflexO «O 5exc¢@00a1é �inverted  1ama»BmarkD  A1Ü £WigravÜ £’ . I E�� 2magI  /!11� ¼ó@capiðI = imaginary partQ 1211š Camso-Dnfin-1221-i 1ity3 !21ø%inù ù"2bStegraú 2B 3 #ot° “03b93 ± @iotau @03B9B °Riquesx   bfB †  > ƒ© = turned  X 00BFX šsþ  P0208W  element of4 @22084 Î #um Î !0eŒ Ï�diaeresisN 100E‚ ÓCkappÍaƒ  ( C 03BA‘ lO‹ O_wardsN0A Ò Rlambd… „ Ó„  ( … ä… 2angI K!32ä … @-poiHàg angle brackeb!brî1232î� 2quoM  îa� 
L #S Fquot„0 = ,  x @guilÔ100Aº lK>JÀ+2190 ISOnumÐ
    'lceil': ð 0x2308, # left  ðing = apl upstile, U+& ƒ ISOamscE EdquoE 501cE ñdouble quotation markE 001CE 3numD eA ’   0x2264D ñss-than or equal to? 0264? Ctech@ QfloorD É a@ 1ft  Ç HdownÉ AE É TowastE 0217E òasterisk operator�  17< � !oz9 Á "5c� Rozeng7!5Cn 3pub² 'rm1 000em  {—-to-right.ó 0E NEW RFC 2070B $say`0x2039B asingleÄ`-pointÅa ‡ 39Ç ” proposedY X  �&01^ J  18J ÑHZ3003Ñ@signI:003	2macÇ 	@00afÕ   �on = spacÑ  ð overline = APL  !ba£@00AF’ 2diaÖ Rmdashs /1c0em   ‹ 1201U¢EmicrØA00b5‹    ¿  B5e ÷ Rmiddoû Q0x00bC  ðle dot = Georgian comma Vreek $  Œ 100B`X 5nus½ 2212Œ 5nusŒ @2212Œ ”"mu2 ”103b„go ñ small letter mut !3B‹Bgrk32RnablaC  •0Í  ò = backward differencè!20º † BnbspE   a0» �no-breakÒ ¾2non  ß çN @00A0Ô n®N Å3M (enÅ31 ÅnY~ tPg µ ie ;@220bh ñcontains as membei@220Bs = = 100ax5not«100Ak× Botinr jË 2 Ðan element of¦1220³n 2sub;  ®!28Ø< f subse: 8àCamsnàBtild  š f1å ilatin  qn with .  „ @00F1ò Clat1J jdJ j njD@ jWoacutŠ ×Š  oŠ . Š ïŠ RocircÔ J  . cumflexO #O EeligO .15™ ’igature o±$15‘ 2WogravÛ º‘ . Œ ÏŒ  éŒ 12032 ò    Ascor‘ 1203<ð
    'omega':   ñ4 0x03c9, # greek small letter omega, U+03C9 ISOgrk3
    'omicron': C /bfC ( E cBF NEWA `plus':M `0x2295A €circled  Ð = direct sum@  %  … CamsbD rA 0   D  28D òlogical or = vee;  28; Dtech; #df= `0x00aa; ðfeminine ordinal indicatorE @00AAE 5numD mD bD omasculE BE QslashG  ‰ fÄ KatinŒÿ with stroke, = l$ M ­ Fò Clat1® Vtildei qE i . J 5÷ 	J "me¼ w 97<»QtimeszÀctor productI @2297I À1uml‘  À@00f6I “ �diaeresisN @00F6N — GparaN bN ð pilcrow sign = $ Qgraph H BH ÖEpartG @2202•   ðial differential>     † YRpermiÖ a0x2030? …er millew   9 px a ðup tack = orthogo– toÊ @erpeŸ1ulaŸ122A¨‹ #hiQ ¤cç 0phiÌ 103C
åp@ A Ì A @ 0Ó @ v� d� �pi symboF<03Dz Alusm^ z 10b1F‘lus-minusG   'or É 00B1‰ ÓBoundŠ  d!a3N   I 4 *A34 2rim. \"03  0 = … tç2feeÝ0032@ ~#rot  A !20"Tn-ary Á ‡ @220FG $8pro!1d¼ sroporti Á @221D: � s¿æZ¾s¿2¿6quo
1002  az @ mar™@APL  i &  † {4rAr¥Q0x21dD ñrightwards double arrowÇ +1DHTradic½1221fásquare root = # 'alF1eBrangD  �!32E ‡ ð-pointing angle brackeV kÚ-32M 2quoN  O bb“M Ø T  	4-  z  gump J00BBCaC9C<9<}#ce‹ö 0èÐright ceilingð, U+2309 ISOamsc
    'rdquo': ñ0x201d, # right double quotation markF 001DF 3numE 2ealD p 0x211cE ñblackletter capital R = real part symbolR 011CR DamsoS gR p 0x00aeS ñ registered signM  Qtrade¤   W @00AEW © QfloorY a0x230bV î   5 @230B5 $h" Œ 03c16 Ãgreek small æ 0rhoA @03C1A Cgrk3Í !lmt  A @200fA e�-to-left¸  = ó200F NEW RFC 2070B $sa¨ § 3aB bsingle®±-pointing a ¶ 3A— ” proposedZ Y  ¼0019Z œ  ` K 1GX*sbE Ÿ _low-9FAê ‡ ascaron&Q0x016dZlatindqs with .  0 +  Ö Clat2J 1dotH m02c5Ñ Àdot operator7 @22C57 Camsb7 &ec7 @00a77 1secú n 7 @00A77 ù #hyl  !0a? soft hyphe£`discreG 3ary L 
FRsigmaN `0x03c3‚ g ( B 03C3Ž i fD C 2C Pfinal'#maI 2I ²!23ÒUtildeGƒ = varie’±= similar t1223ÓCtechbSpades� @2660� &  s P suit�    � $puœ!ub7 @!28× ‘subset of3 !28Â n 3ube5 `0x2286n 4 • or equal®  86s @ 	1‘ n-ÄAsummz 1îJ#upy  R!28ÈYsuper° »p #p17  ñbˆ6 Ècript one =  Adigi  ˆ ;00B”8up2Q 5 ‡ Q ?twoQ  cquared[ ]ö8up3[ â [ ?hre® t 5cub] 
] 	¹‰?» ”K3zli> KdoLäharp s = ess-z�  DF
Blat1¸3tauí  ä03c4J˜ 1tau.03C4A –athere4D  ‹3A  @fore4 12234 Ä Gthet/b8u  (  C M03B8w Àtasym': 0x03ôVd1, # greek small letter theta symbol, U+03D1 NEW
    'thinsp':   0x2009, # thin space, U+2009 ISOpub4 1orn3 p 0x00fez \latinz �orn withx ³0FE ISOlat1H EildeH 02dcH ¼ t 6 02DC6 4dia5 5mes5 00d75 ñmultiplication sign= 00D7= 3num= &rar @2122= t U mark9   	9 BuArru  '1mðupwards double arroww @21D1> 3amsµ Ruacutë 2ax 2 u. .  J @00FAJ 4)ua‰ 9ö‰ ‚ 9‚ ù RucircÁ � b�  . cumflex† B† GgravÐ 6Ð . J KÐ "ml—  L a8™ Àdiaeresis = ‡Eing  H  A8’ RupsihI Q0x03dÙ  "loˆZ hook2*  G  E  c5Œ E –R( ‰ 03C5‰ Bgrk3c%uuÒ jÕ× FíUweierŸ!11ðscript capital P = power set = W4 €strass p¥ 1211.Bamso¥  xiå   v!3bÂê   xi@ 103Bºå y¢D å d*å  yÐD/á #yeJ t"yeÄb = yua ‰ !0An×ymfˆ mFŒ AzetaÔ Œ 03b6N   ( � 03B6B 3zwjA  '!00ðzero width joiner< @200Dz’ RFC 2070™4zwnB 0�>A Inon-E CE  }


# mapsøð HTML5 named characÑreferences to( öequivalent Unicode/ Ò(s)
html5 = {¦ Aÿr'\xc1', a e , O;': -   . Rbreve Uu0102]  3 c. F223e d f E ee\u033G Aó¥ u  e * H %xc a+  , &b4‡ #utã x 2Acy? Vu0410,  3 ðAElig': '\xc6',
    ò'aelig': '\xe6',
    'AElig; c +  , "af Uu2061A "fr ”U0001d504 a $1e cAgraveu 0 a e , c %xc -  . ralefsym Uu2135^ Oleph  SAlpha 5039Ø a b CAmacò Fu010‘ 
 0 CamalaTu2a3f� 0AMP& 9amp 1AMP– ! 
 1And e\u2a53H  7227 a &a5'ndF c0 Vslopea 8 v a æ &22%ngD &9a5ngl 
/ %ms� &22Fdngmsda©729a�  b” 79a9”  6 c ¯   l ;9ab6   '9al ;9ad6 %9aïa½ ~%9aTangrtŸ *21 vÔ (2bM Frtvb¹ 9ƒ sä7222œ sf 'xcûDgzarÌ5237ç SAogon– '01Ò
 J 3Aop3ž 5– pc 62240 Epaci” &a6$pE/ &a7`£&24Ý%pi &24Ù0posD 4"'"þ¥pplyFunctiñ Ý`approx4 :'\u§   &eq } CAringl e7  B — , svc%49®a bÈTAssigÊ6225�*#?sym�  è n`Atilde´6\xc e , ë  a-  . 3umlX ±  e CAuml= c a * sawconinFu223„ w %a1rubackconÐ%24q  Uepsil4503ft  Eprim@0…  %siŸ%23N jc …BackslasA%21n 6BarŽeððbarvee;': '\u22bd',ò

    'Barwed;': '\u2306', b 5 &ge4  5brk b t f Dcong3 424ce 3Bcy D0411 b 3 Cdquo. E201e. Tecaus %23� B Á  b TmptyvN 69b0g 3psi 603fÛ Sernou 6212Ü  5lliœ 	 #ta4 F0392e  b h. 7213{ Ttween &26| "fr …U0001d50b %1f| Rigcap7 Fu22c~ digcirc )5e3 u3 3L Dodot3 &a0GVigopl°&a0áuigotime0(a0„ 6sqcl aÂSigstað 7u26ì Õigtriangledow(75bd¨ " \ (5bÈ u® 4; &ve]cÇ 6wed9&2cý Tkarow&90ˆ –lacklozen8 59ebl   Usquarq 95aa Ç ] &5bª  >   
	E$ 5lef»5$ Frigh% 'b8� n&42JElk12� òFlk14 F7lk3 H %oc` &58x nf=\u20eïUnequiÐ;261  N¦e�n %31ÀBBopf¬ X%39ø  5³ L &2aš RottomN )u2 2wtiÍ \ˆã Toxbox2 '9c| 4xDL 6557” 6xDl 87oxd0 “ &xd0 ÷ VboxDRH Y5oxDx5ñ 'xd0 Å6oxd0 0®FboxH_ n5boxö5BEoxHD/ 6Ö Hâ(56¦ h0 î h0 ¸ Ž U` fHè(56fh0 ¯h0 3� 6min&29P(oxn&29 )ox(2a'UÎðd',
    'boxUl;'ô	: '\u255c',
    'boxuL;' b l '18 %UR (5a r 9 u0 H u0 '140 VG 1 v '02 %VH 6Ö &Vh Ö v0 ¾ v0 3H (63x 6� v0 	¿ 0 2î (60` '5f v0 (5e 0 1À Tprime	40351 DBrev 602d— Avbar'4xa6F  br _  5Bsc� &12�  •U0001d4b7I BsemiH Fu204ð 4sim 623d/ Ö '2c of\+ 4olbC %9cubsolhsu &7c#ulF Fu202ÜTulletK 	 $mp &24”DumpE )aa {&22ì dBumpeq1 I  TCacutK 5010˜c h&Caª dÚ c 2ºdcapand� %a4µucapbrcuJ (a44 M %a4y9cap2 ’ UcapdoV%a4ôCapitalDifferentialD� %14ÈDcaps …229\ufe0D 7car²4�Scaron6 502c� eCayleyP %12Zch %a4 CK %10íc 2 BedilJz &cc e�  © x-  . 2irc Eu010Ð)cc ­eCconin|&238&cuV'a4Õ Eupss’%a52 CÅ5010Xc í b§   ¿ x C -la ecempty&9bÎ2ent_a C  tCenterD~x�c ¼  'CfÚÔc Ù&522Hcyy Eu042Ù'ch 4 3eck/ 5271o�checkmar $Ch9703aJ  Àc7',
    'ció	r;': '\u25cb',
    'circ H02c6 #eq H2257 ´learrowleft" ?1ba"  Grigh# 	u Uledas ,29 ™ ;229^ Tddash| 429d| ‡CircleDoX 9  Q BledR7 ;xae S Tu24c8 P TMinus %29% (Pl 5; GTime; GER 49c35 Dcire 
uEfninÖ 7a102 4mid4 7aef 5sció49c2 ô	ClockwiseContourIntegralE 7232+ õseCurlyDoubleQuot¡ &01x#lo( " ~5lub	&66ò   %uiÛ  VColon• < :¨   ™ 4a74 c +25 â 1mmaw ,F 2mma£ @ p& h\u2201 f¶ 1K†complemeÆ6 6lex+%10„Econgi 4`  dé&a6�Xongrui 6Ÿ (CoH&22/ %2" $pf¡ 	¸  xU0001d5}5proµ2Î Co "ucl Z 1OPYÀ&xaV<opy BCOPY� )  s"%11bCounter)Ç6rarJ b¦ECros÷ao 7z #scG 5%49gc b\2subÞ Fu2acÔ6subd5csu»&adK7sup/ �th2bUudarr7&93�  É Eu293Ecuep &2dÝ 4uesˆ622dÃ )ulY|c Ç &93ÿÝ &2d¡ 2NeupbrcaG %a4Ä FCupC %24` 9cup2 “ &pcf (a4f B8K oaÜ%up5†22a\ufe0§ul¶c m	ð93c',
    'curlyeq÷prec;': '\u22de',
    'curlyeqsuc f 5vee9 c9 Gwedg 8 1renn 7xa4N 2renL 
 ²vearrowleft Wu21b68 ! Grigh" 7" ¥ 4wedR &2c  ewconinK 5232K w 1 TylctyL 432d dDagger %022 d 02 ddaleth2 4138 5DarI &1aI A $d3. d. 9 s\ %01u TDashvt %ae•d &2aG dbkarow2 %90=Ddbla-602d	CcaroßEu010+d J $DcQ6041’  3 $DD‹ 5145Ý%14/dyI	3$caG uDDotrahM '913 Totseq| %a7t2degábd2deg) x 2Del Eu220= SDelta 5039æ d b EmptyÀ&9b¡ 6fis&97]fLvU0001d5} d ³#Ha5 Fu296g5harÆ &1c$hƒcDó DiacriticalAcut"xÏ ! $Do†E02d9’B gDoubleH uu) BGravk `G  BTild \A c# Cdiam‰522cqeDiamon  1  
4suiÓ 6266—Diamsj 	 — &xa	·ifferentialøL FgammA…Ddisi„522f“#di=%xf…bdivideÅ © - eontimeÇ (2cM 2onx7 'u2 'DJÐ0‘ j 5 ElcorÁ &31ETlcrop` %30wCdoll¶$ÕBDopf+ ý$3b d 5ç‹ŠdŸ%ot- Fu20dN&ot-&25  L 5225ÁuDotEqua`
6 Fminuo+Wdotpl ?ðotsquare;': '\u22a1',
ñ    'doublebarwedge;': '\u2306',
! D! ô ContourIntegral( :22f( 2Dot <xa8 rwnArrow  Zu21d3" KLeft" 0" LRigh' 4' %TeÍ ,ae  =ongm +7f± L& q ;7faq ?ong' 9' # ?1d2#  ¼ 2G+Up#1A MUpDoi5$ ´VerticalBar�'22$ @ 9©?wnaÅ,do 
8 ¸ s )91W  Þ f– DBrevÖ5031ú  z   š sÓ %1c¦  £harpoonlef¢Eu21c‚ " raE ¡ wn6ÆUVecto>'95©& <Tee$ e†$ 
! ?1bd! 45˜!wn‹ j  •% k c< .G " 	l 7� 	•QQwnTee½4a9 Wdrbkaô%91)ddrcorn4 %31´ edrcrop %0c† #scr†U0001d494  b{3ScyM 5040P'ds 5 oÝ&9fmTstrokG 1Æ  X4dtdGu22f #riH 625bÁ Ftrif +Cduarõ 6u216duh½&96H Twangl%629aÃ Zñ 01 z 5 7igr{ %7f aEacute)%xcge e , Ø -  . Ueasteî %a6TEcaro,5011Ùe b,5eciI 25SEcirc» E  e * ¢ I W c , EecolŸ &22NE\2Þe 4 D<Eu2a7CEH5011Ïe. %25_e. E À2147',
    'òefDot;': '\u2252',
    'Efr ”U0001d508 e 24 "eg3 Tu2a9a/ aEgravea &xcE  e , E -  . 2egs  p 6p FegsdÒ %a9] &el. 9. fElemenç elinterc 43e75 %elK 6113 , 7a95 	� E CEmaccFu011E
 _ DmptyÂ &20a   'seÃ  E ´SmallSquare> 55fbŸ  # v W < OVery@ a@ Dsp13@ 6004Y Fsp14 • Femsp ß 3ENG 5014=$enS6014u nC :UEogonE 1ù
 ü2opf/ ä%3c¾  5`$pa·622d× Epars%9eÙ Feplu%71c 2psi~ Eu03bH VEpsilÇ 3J 4 DepsiÄ503fL ceqcirce '22Ä 6qcoe 72253 5sim2 4\•eqslantgtü &a9 6lesé ¸ EEqua'a7k 2ual1 =, ETild¬2„ 6uesè'5f6 uilibriu» &1cÌ%qu6226�  $DDí &a71+qvÎµ 5rar9ÎrGþ%EsåD2130² e 2É e»%25/ E•%a7] e (3EtaÕ 5039pe b 2ETH›dm 2eth f 2ETHR x'  ( 2uml< c­ e 3Eumx) R * Beuro Fu20aÔ"xcA !R'xi0$E f á •expectatim¡ÄExponentialE€ %147e ª Ôfallingdotseq? ]$FcÊ50423f 4 Eemale %64•Tffili&fbÚ )ff 1 l À '\ufb04',
 ð   'Ffr;': '\U0001d509',
  f %23 Bilig6 Tufb01 óFilledSmallSquare$ J25fc$ OVery( $aa( $fjd %fj 4latS 666d + \� 2 4tns0 %5b§ Cfnof 5019/ 3Fop 3b  $57e cForAllO D2200 Ofora k0 'd40 $kv %ad‡“Fouriertr� Fu213Ë epartin&a0´ Qrac12Û+xb g  3 Fu215ë F 4F Åf / *xb 5  F 5Ü  0 6 Ý I 8 b2 2‘ 'Grac2d 62 3ª e a *xb F Ï ‘ 3‘ 	Ü 42 8b 5Ü ÂGrac5K 	„7 – sK'04ô 2ownÄ Fu232²#sc½
 É%4bWTgacut—501f¢SGammac 5039 g b 0 d1 d(1  ö 3gap/ 52a8¶VGbrev‘ 1g fpTGcedi&&01SGcircc 6011’ 
 ‘ 4Gcy. %41Ù g 3 4Gdod5012äg –#gEY 5226Zgæ 5226w$gEÊ 62a8² e &2d¼&eqW B 'eq n Gqsla7Zea c>52aa¢6geså 62a8ü  o“ %a8—3 oÄ %a8Ê&geáv2db\ufe2  œ 96 GŠ0dg 24 ¡&22Lg 6X + &im†%13Y'GJ!0!'gj ?g%27C $glj62aaÉl6a•5gljbaÝ (gnMunapprox2 8 ^ Àu2269',
    ð'gne;': '\u2a88',
     q  6269/ 4sim0 42e7 BGopf ”U0001d53e g 5} 2rav• `. ÂGreaterEqualQ _u2265 ELess# +db# KFullF ® e l D ;aa2D 	b 7? YSlantc %a7ö \ BTildâ e\u2273a 2scrx 04| g Tu210a2 gyI   a %a8€   A4a90G  GT> )gt !GT•  !Gt  ¼ 6ag % Dgtcc' %aa&Cgtciä Fu2a7É 2tdoB  W d0 5lPa1 %99ôegtques3 6a7c¾ urapprox (86 rO 7u/tr� OreqlUYgtreq (a8‡ 	7 *?gtr·xvertneqdU\ufe0©DgvnE× :269 SHacek 502cDchairsp &20>3hal 4xbd#UhamilX%10âcHARDcyG 5042¼Ghard 4 Al61d4b  9 %94�Sharrwy 521a« "Ha¨ ^Z b,410f DHcir�6012r 
 \UheartF6i "uiw 9\u2 6llif2tdhercon¿ %2b7%HfŠ%108h %52— µHilbertSpacÝ uhksearo)9: Jhksw ž 'oaŽf4Uhomthè %23§hookleftarl %1aÖ    Lrigh! Hû ËÍh ù 5S rÙ&01¶orizontalLiÉ50H7Ä  l 4ÿTslash®EEstro_1à x€HumpDown Q %24�  	)&24~Eybulª%04#UhypheM%01`Iacute¸5\xcUi e À 'Iacute;': ö'\xcd',
    'iacute;': '\xe c Tu2063, RIcirc* $ce i e * B x+  , y Vu0418W  3 DIdot- 4130- 6IEc. $15 'ie 3 2xclÇ &a1, 2xcl[ x "ff Tu21d4, 5Ifr 1B  •U0001d5260 Rgraver $cc i e I _ x-  . "ii Eu214%Tiiiin'52a0\ 	 &22íTinfinJ '9d1 4ota 4129» SIJlig D0132 )ij 9m- &210DImacHE012aE 
 b g©uH uginaryIe gmaglin8 5uimagpar)› SimathN 6013ã%mo62b7š 5ped/ bisImplies 621d)n&20¸Fncarª 0H 	Ÿ%21f %ti3 &9dÓ)no+Ã I&22é rCntcaFu22b£fntegerÚ 2  r6 2O /erQ ¶Intersectioc/dtlarhkJ&a1|Tntpro~52a3Ô ÕInvisibleCommÆÏ! 6Tim¦%06w 'IO@0C'io 5 5Iog½ 6012¦
 f63IopM14› 5{I’5039’i b biquest’b’  ex %Is¨6211¥  À &4bó sOá6sin–622fâBsinEy Fu22fÀ 5sinf%2ffi v1 j   \çàDtild>6012Š � 7Iukü0âi 5 3Iumjcf e  ( Î x)  * Jo Eu013j ZJ° À'\u0419',
  ò  'jcy;': '\u0439',
    'Jfr ”U0001d50d j %27 Bmath6 Eu023 BJopf M %413  $5b 9Jscƒ 44a5 j $bf GJserÑ $08 j 5 8Juk1 41 	 5 RKappaÏ Tu039a0 k b v1 $f01 dKcedil 4136 k IK© 1a  3 K§%0e_  2fkgreen’  'KHd 2ˆ'kh 4 'KJ %0cx j5 K%422  6 a? csClAarUEu21d-fLacuteù l 2 tlaemptyØ529b!TlagraF5211Ï WLambd;ël b CLang– 727e}  ¦Tlangd/ %99e  lÞ 727e1 p/ %a8¿“LaplacetrµuÄ Qlaquo/%xa§  J  Ll9(lAƒ›	. 	 b[ Gu21eeTrrbfs %91Hlarr ¹  $hk2 '1aå5rrl
1Ø 4rrp¢&29 K 4simL 4973³  t3 %1aý4lat/ ab 5Ata7291S
 ­ ©72aaÝ %te†aad\ufe0FB^9)lb ”Elbbr*&77Å BbracJ{ò   - [ k' V\u298Ö Vbrksl¤8¶ u#%98Ú TLcaroO5013 l bL@  ð &ce†352lcu}î LÛ® 3o $dcî&29ßTldquoé &01…   ž%01Ð eldrdha %96Xldrus 4} sŒ621bÂàE;': '\u2266',ò
    'le;': '\u2264', ôLeftAngleBracket# 97e8# Drrow 8190 a d Jleft 
8 A8 5BarW e–   QRight) & $c6} a Etail  $a2   Ü tCeiling )30× ODoubû  b  B ÅDownTeeVecto¬ 8961f  $ 
! ?1c3! ñ 8959$ 6Floa 430a  ç ´harpoondownË ?1bd"  &up  c   F Žs! $c7!  è k 9‘rŒC B d!  _ !  B 
! … m" í $ b© $ Zsquig� aÏ 
”494eH  " &Tea®:Teetaè 9 Y 5­•threetimeÂ %2cÂ A 0riatH)2b´T +)cf» " EEquaú)2b¦ .Up–)95·/UpÙ À ª *Upê )1bˆ  ª 5b? ” ^  	= 	%lEµ%a8>%le '2duqKÛ7leq gUqslanê%a78l²
 $cc` %aaß WlesdoG  o3 8u G%a8x8lesÛ U\ufe0‹  œ 96 vsapproxn 5*8les¢ '2desseqgt‰ 	M   €ALessuoGreate@  # AFull' – %26|    > 7  ´ ˜   8   S (aaWDssim %27F 1 Sî	Ž Ý ! FTild= Ulfishá%97¼/lf«#Lf†U0001d50 2ûl÷í 4lgEÎ &a9è H.%96å Tlhard/ À  'lharu;': ð
'\u21bc',
    'lharul;':  696a 4blk 4584 CLJcy D0409 'lj 5 L[ 52d8,  p ClarrY F21c7- Ucorne 431e ¥Lleftarrow8 dÀ  Ú d 496b6 Tlltri %5f1 cLmidot E013f1 
 &40 4ous2 ;23b CacheO 	 4nap %a8*�lnapprox E &26Fn^ &a8/4neq-   	E 4sim0 52e6Û Doang &7e/o¦&fd0 %br.7H ˜LongLeftA¦47f58    Æ&7få ?ong   	@  ` LRighe e r% 	07ÿlj % J  % emapstof g ˆ U ! _ ?ong! B AloopÁ  ƒ &1aÜ  F ! ¤ l@  '98H"pf ”U0001d543£+lo 5öBplus8 Gu2a2 Ftime 3?Flowa4'21[2wbaæ_{ PLowerß	?%191! t'19Az  %5cìelozeng@
 	Fu29eYpœ (œ Ulparlý&990r#c¼rÉb#rh_  �cv   Ä`rµ%00'lrÚ&2b_ Esaqu²&03?"scr w %12Û  44c1 4LshO1ð [7^ %imz&a8Ô 5sims'a8¾ !qbt [… (lsÏ 1ì  Ñ %01ïTLstroŸ5014Ï l ¥  LT<r t !LT‘  L2Ñ % Altcc7 V\u2aa5tci´ %a7œ&ltŽ722d0 5hre@2-	s'2cJ Àlarr;': '\u2ö976',
    'ltquest;': '\u2a7b $ri 85c3 e 82b4 f 75c2 4Par &99z Wurdsh %4a4 8uru 65 „vertneqqQ •268\ufe00< ?vnE Amacrê 4xaf1   1 	 lå %64Í 5mal+%72t   %es1  2Map\ Vu2905s  %1aÜ dmapsto/  Fdown 7L estolef™ %1a•S un „ 5rke˜55aeQ Tcommaj 4a29 3Mcy D041c m 3 Cdash. 6201‘ 5DDo© %23ò¶measuredangy4221f ¥MediumSpacf%05Ã…Mellintr€%13°#Mfå †U0001d51¶ 2Ž h‡2jBicro>bG  é x d Eu222‹ Cmidak*Ù Smidci¢ Fu2afž Siddoto „   \ 'xb 2nus Fu221°Uinusb 92m ¤ &38� Tnusdu3 aM3 (Plh Ú %lcd%adC5mldÛ &02é/npG FodelÈ aà 3MopÜÆ4R 5Ê” %21« 5Msc” 'm b 4ÂVmstpo– 3` M'6039ú b Fltim&2bqu Enabl†%20TNacut5014Ù n "DnangÐ…220\u20d"n• 4ë5napEva70\u03#Fnapi;-4b -)01S Eprox‰  %tu“%66_tnatural2  ”%11�Bnbsp5aK  F x &um +4eÆ DbumpfK224f c7aƒTNcaro¥5014µn þTNcediã 6014È  =7ncoÏc Fongd]9a6d´ À'ncup;': '\uô2a42',
    'Ncy;': '\u041d n 3 Cdash. E2013. e 6260 Darhk 6924 4Arr 61d7 a 9 %ow2  4dot ”250\u0338P õNegativeMediumSpac§ <00b& _Thick% n$ VeryThi( enequiv¶ 6ŠUnesea%92É Unesim1 ,42ç ³stedGreater - 6è  ' @Less ! a	CwLin#n Vnexisd0Æ  sI  #NfÅ •U0001d511M  2ž 5ngEJ *67á #ng• Fu227L 5geq3 
  K  UqslanÑ =a7em Ô  %Ggs ,d99 ¥%75ô Gm †26b\u20dòg f2 #gtAFu226 'Gt6b~ hT%ceL hTa pk&af’ iá #%ni52fc[ 5isd- fGnÜC 'NJQ0- j 5 lÎ €lÎ 90 d2&02{lU61lU´wLeftarrnc~  ƒ  : Lrigh? sOleft"  •lÓ• 7leqÓÉ Ódë À/a7   &26® %LlÝ,d8Q 	ëLÏaël f 6ltrreÑ6tri¡euLa˜ &mi’peNoBreaŠ0£1Non 7ingÖ%xa{DNopf&11Y ã5¦!otN%xa´ N¤aÊ  
* vCongrue¢2!”NotCupCap“ %26�öNotDoubleVerticalBàð226',
    'NotEleõment;': '\u2209',
    'NotEqual ,60 UTilde  ˆ42\u0338& Uxists" '04 uGreater .6f 
� .71" JFull& -67‡ k  r b* 6Les¶ 7D JSlan?a7eN 
''75Æ €HumpDown ˜ 4J    
ç *4fo UnotinC Ç &doâ/f59  E: /f9  %va  Z %vb $f7Ù t &vc 6 æNotLeftTriangl</ea" %Ba"+9có M 
 )ecR Ð+6e 
9 7ç 	óÎ 7â !    *6a@¥ /ss1d* .3cNested�  y .aa0  Ÿ   * 1y Tnotni %209 û ûS4 ûdmvPrecede[8l 	�.aaõ) T(2eQ ªReverseEleãÇ NotRigh� b¶ 	# �*d0HO 	É (2e
¶SquareSubseš8ë ( O 2£ ' pð Q 9¡ 
* S 3S œ i2\u20du " 
C 8wSucceedïÁ 	A /ab³  G ïQ AU u(/83Ý  $ 	ž (28
h 4‹  
; 4É  »4B1Not$  ›4 ‡Vertical’%22e &np9%22€  ðallel;': '\u2226ø',
    'nparsl;': '\u2afd\u20e5 t –202\u0338 Eolin  6a14 r6 '80 5cue e  <aaff 5rec5 	N Deceq 8 5rAr† 51cf† 'ra )9b i ;933‡  7 wn ;19d –Rightarro$ t  z 4triZ '2e’ 5tri52ed« s¨ 7281 	_ F :ab0¹ 3Nsc&—U0001d4a9Q 
 &c3 uhortmid· 2ýs uparalle\6226= %im8 4§ %im¨ '24P &imè	 � #pa¹ )u2x Fqsubc &e2’ Gqsup é %ub¬ 8” 4ubE :ac5Tng 81Usubse10282od‡   í < &eqòw  c(uc*DnsupÌ &28ý7supä 6ä 185)upä 3ä    ä < 	ä w &tgS7: aNtildeÇ&xdR f , ñ -  . Bntlg Fu227Ë¶trianglelefÑ%eaR  í -ec" rc ÿC ! D 	#Nu8 5039 n b s# Sumero? 6211ž5ums50071 %va !24)ºTVDashN &2an)Vd eO 
2 ª v2 1&vg¢+65W"vg‡> Hï&90Âdvinfin³ '9dš l:&90Ÿ'vl� 4i l� < Æb8 ¨&90z)vrÿbò sG+3cw UwarhkÞ ð23',
    'nwArr;ô	': '\u21d6',
    'nwarr; 9 /ow 5nea3 4927K aOacuteK 4xd3 o f , ^ -  . Boast Uu229b[ %ciˆ 429a SOcirc‡ 4 o f * Y %xd +  , y Vu041eW  3 Cdash. D229d. cOdblac D0150 o 1 #iv0 F2a38 o9 Dsold0 49bc SOElig D0152 )oe Ÿ'of[49bf0 #Ofq†U0001d51J  2| Dogon{ %2d½TOgrav.G  f , E %xd o-  . %og&9cJ'hb¶$b5Ó 2ohmB Fu03aJ%inE &22Ùl.bs)ol00 Scrossa 529bÿ Toline 0;lx %9c COmaczFu014\
 iCmega^ 	× 	 cï VOmicr§%39òo 7omik9Uominuò 2RBOopf“ =44  6ú (op¶löpenCurlyDoubleQuotN1 O' ! IBperp– Eu29b8oplÅ .O†62a51 &22Z r+ùr6%a5±EordeF '13[ Cdero8*u2 fåa‡#rd+ x m) °#rdöx &igk &2bŸ%roœ 'a5 Eslopw%a5ž&orµ5ú Si%4c'$OsÙ4¹  	ù bOslashÒ dH o f , w x-  . Bosol  gE Dtildª
o f O E %xd -  	. %me,&a3A'ti +29 a4 �COuml ðouml': '\xf6',
 ð   'Ouml;': '\xd6',
  o f Bvbar+ Tu233d- VOverB 903e Erace6 d 5ket (b4: µParenthesis" $dc" pr 7225 aÍ b¸ BparaA x 3lleû *u2D 2sim2 Wu2af3] s1 %af5parÄ 4202/ „PartialDJ  #cy D041f1 p 3 Bercn` %* QeriodC . %miŸ 7030 p+ V\u22a+dertenk 40311 #Pfç†U0001d51 23PhiJ 603a{ c v- d‘ Bhmmaé V\u213v 5honC%60CPs î  c etchforî %2dk'pi� ¤ Elanc/ &10� hÀ &21� TplankL 23 uÂ+bsplusacigFu2a2í Dlusb^ %29í  3 	2 h  %do3 1Ú Tlusdu a&5lusQ%a7J sPlusMin® 5\xb d #mnZ a - B2VEustw¬ 5a27qG €PoincareX® &10SointiU\u2a1KBPopf— Uu2119e  Ú6Ë Boundà aŒ  H x P·%bb[  627a az&abì 5rcuÑ &27Ñ "rEm Fu2ab… r, &aa‡4rec- 	r „ecapprox 	x ”eccurlyeq ~ rPrecedeª +È  EEquab�   YSlant% `  ETildÒ &27á € ™ ^ \precnÕ Ô  &eq9 b9 ‰62e8š(ec ‡ EPrimŸ 0…
 4p 5m(rnþ± nç­ n‘ « ê ”ˆeProduc/2 fprofal'32dÐofline;': '\u÷2312',
    'profsurf;': '\u2313 p 421d ¥Proportion .37 %al < opropto 5sim $7eP VprureJ $b0 BPscr0 ”U0001d4ab p $c5 2Psi5 Tu03a8 p c Euncs%00 )Qfz 4514I q 2È Cqintz D2a0c1 5Qopz411a q Ý %56°dqprimeK %05zQö af q %c6j ¤uaternionsT %10ëHquat¹ 18 "esÑ ?K TesteqG 425f @QUOT_" Iquot  " 9 	# 
 CrAaryEu21dï5rac”23d\u0331j TRacut 5015«r #Qradicz F\u22”„raemptyv %9b)DRang '7e™  9“ Trangd/ %99Ú  ª 729a‘ 5ngl '7eI 0quoG7\xbu #qua R;aE(rARŠ  ¡ 5rra'97¢ 4rrbÒ *1e fY&92y 5arre%93JGrarr1 1@  %hkd a+  l• 1õ  p:)94– m%97 &t3 î L  )1a° w– 99WrAtaiJ ‹*ra È #ti¸Eu223i raj%alF''RB×&91^	 0ˆ(rb0 çErbbr\&77Þ b\}¾  - ] k¡&98í Vbrkslì8Ï u:%99¼ ERcarZ5015vr ERcedl6015; +5rce1 5230J 2rcuÇî 3Rcy¤ '04¾ 4º Crdca- &29erdldha¹&96o d«6u20%r 1 	 $shb 1|&11|e�ð11c',
    'realiöne;': '\u211b',
    'realpart c s d c/ %5a 1REG_ 6xae* g 2REGS 
'  ÕReverseElemeno %20¹ ! ¢quilibriumD Lu21c% >UpE' 596f¨ Efishe %97Ô drfloorY 3~ f &112 †U0001d52b %Ha1 5964y Dhard_ 81c1 u 0 l %96z 3Rho 703aG  ] %ov- f- õRightAngleBracke47e9€ $ CrrowA I2192 a d r^ 
 : A: B'91e5Z   ALeft	 € cMc 5tai%91a3G tCeiling@ *30Ý ODoub 7D ¶DownTeeVect%957' % 
" %1c" ÷ *95÷ F‚Q´harpoondownÑ F # &up! O ! Aleft™ìT " G $ |Š  G [ Qsquig# ‹ 93%Te£*2a,:Teeø)a6“� ~ •threetimeÃ %2cÃ �@Triaÿž *2b:  ­dL	C EEqua‚*2bÒ.Up%94+I /UpÑ  
¯ +Up^bxC   ¯ 5-# ! ð *1cÍ  	? rCD02da‹ÄrisingdotseqW &256 5lar1f'lhø—%rlÕ%00!Urmousž%3bÂ 5achF 5nmik%ae,6roa%7e‘(ro¬ f0 4brkÜ %7e6ropÄ &98ž4opf/ '11_  ,6&Eoplu¦'a2{ 	À&a3X–oundImplißð970',
    'rpar;'ö: ')',
    'rpargt;': '\u2994 Upolin 5a12 Drarr3 41c9 µRrightarrow $db drsaquo 403a 6RscN 10  –U0001d4c72 hH 41b1 /rs !qb- ]( ˆ 1¿ UrsquoŠ 0 QthreeE e\u22ccJ Vtimes Ó Drtri &5bb 6triH &b5H 6rif0 8 lK 49ce ´RuleDelayed9 &9f½UuluhaÌ &96S x/ %11M TSacut™ 5015È s �)sbD1 $Sc_ %ab's &27B 6cap,   cScaron D0160ñ s ÷Dsccu¼ F227d1 EG 52ab%sc, %ab] cScedil/ 5015s f^ DScir× 7015ì 	 Ž nð 17scn§ 6_ cscnsim‘ 522eC,sc—34 3 7« yI 70427 4 %doò%2c¡BsdotF a/ P6¿ Searhkv 6292I 'eA;d÷(seS9 O !ct¶%xa3sec¾ 	 mŒ;)7esw2]fetminuÒ1Ò $tm—(22 xs Eu273/ #Sf}¼51  3…Usfrowd %32pEshar,&66ÙFHCHcÆÈ 7hch 4á S0 f	.  ©ShortDownAÓ9r! KLeft! Ó  B %mi£%22< s tparallez&22*\ RQ] " +Up œ#hy …h.%xa SSigmaª603a  	 c ­503c� s1 vJ  É3)'iml&a6%imS'24x 3meq^ 2 g &a9¹6imgYàa0',
    'simlö	;': '\u2a9d',
    'simlE f $ne 7246 Dplus 7a24 Drarr 5972 l 4190 ¦SmallCirclj $18 s fsetminp &21Š Tmashpo 6a339 deparsl &9e¤ 4mid '222 iƒ 3 t. 6aaa` t° 8aac vac\ufe0ì SOFTcyN 60427 7oft 4 Â /a 3olbA 629cÔ Eolbaw%33ÃBSopf0 †U0001d54Ã  6O EpadeÈ %66Â s %ui
 ‚ 5225² 5qca¢&29p  d :293,Gsqcu7 ›   7 47 5Sqrœ &21ì 5qsu8%28s É6291¶ VsubseL 4 RseteqY+u28 · 9Gqsupi   i  � pi 8 u %5a· USquarg  s 2 ÄIntersectionW ¬% S BEqua´\$ ph Wî 
! G ÷ & )Un¨ 3uarð7u25¯/qu ­&19f #scË654ae c­ ©?¦/sm\'st° %2cØ&StÎ  / Ÿ%60.   ß &60{ÅtraightepsilÙ=03f" 3phiX 803d nk%xa4SJdá 8IUsubdoî&abs&ubrcr %ub¾&28á 8ubeH cFVubmulb cGsubnc bÁ'ubÕ8#)ubÕbñ 8sub(4979L 	Ô	
Ò	å  Wai 
: n‘	× àsetneqq;': '\uø2acb',
    'subsim;': '\u2ac7 %ub )d5 p 3 $cc '27b „ccapprox 8ab84 tcurlyeq 427d †Succeeds V  TEqual  <ab0; YSlant% `  TTildeE 427fE s€ ™ ^   nÕ a7 7neq9 6 q82e9  ‡ …SuchThat¢ 0¼6211K  $ngC '66® !p1ÿ'xbŒ "p1+ 
 2) 2j $p2)  3) $p3)  %SuH'2d¾  8, Usupdo7abeƒ (dsª]"pEt  Ú„pí8ñ(peb $c4b uSuperse} 2–  
b	U 5hso¡(7cch· ‰ Dlarrº 9KEpmulˆ (acsnì c» Gsupní 8esuppluY'ac9pë 	—  su2 Á	ÿ 8setc‡Hsetn8 Ÿ  DcÔ ((acð	RÁ ¢ k&ad„ Uwarhkj2 A‚&1d¶wš*19 $owJ 	 6nwaÍ2xBzlig'dr  F x #Ta‰tØFtarg‘%31¹ 2Tau? Eu03at Ø5tbrü %3b- dTcaronF %16 t TTcediå5016—t Î4Tcya '42/  4 –%0d$Utelreq&31Ž fo…U0001d51Zt 3tcthere4“ 5223ô T 6forE 5  SThetaP 5039¤t 	 $sy¸&03y vL  :ick†'24j 5ick)Àu223c',
    ð'ThickSpace;': '\u205f õ0a',
    'thinsp $09 JThin;  Ethka4 42484 dthksimM 423c QTHORNƒ 4xde Rthorn f * B +  , 5ildÚ n t 602d†   REqualK Tu2243Ž T KFull! 5! & > ú BimesÌ $d72 t - x b Yu22a0/ 4bar 9a31 d 4 $nt 522d0 4oea &92¦ o¶&a4- 5pboF 7336 &ci� f� BTopf_ —U0001d54b4 
 6Artopfork9 Fu2ad…'os¯ ƒUtprimá%03² TTRADEH 5122} &ra	 UianglK &5b• r DdownR 65bfR  5lef"%5c5t>   $eq@ %2bª !  5� Frigh] bÿ ]   ^ ½ dº(5e[ í 2r Tminus© %a3ƒvTripleDN &0dÔ  6 £ sË&9c€ riýh L Upeziu%%3e¾3TscmV&4a‡ cƒ CTScyh 6042¼s 4 7TSH 0— 'sh 5 TTstro³5016I t õ5wixÎ&26“`wohead*Sarrow´ 5219üt# ð
$ %cUacutej¾u f , i xn-  . rEu219{'uA d'ua 9 U¸ 5%94©7Ubrc0ö u 5 TUbrevÆ&01Ju vSUcircÂu f * è+  , `úuÌ E(udc©bUdblac[ Eu017Àu I6udh
%96Fufis.%97 !Uf¾À'\U0001d518'ó,
    'ufr;': '\U0001d532' aUgrave 4xd9 u f , I -  . 3uHau Uu2963[ Bharl- Xu21bf 0 61be 4blk0 5580 Tlcorn :31c eL 
 5rop4 0} Dltri 45f8L DUmacI D016a u b lKaC #umî x cUnderB_=  DraceŠ %3d¢  5ket )b5< µParenthesis# &dd# %io0%2c‘…UnionPlu4 %28}5Uog4 50176u L 2opf{ i4— %66š bpArrow9 Vu2191 a d *up 4 N _U\u291¹ Uk ADown& t cKp 9 Jdown| d .up < ´Equilibriumz %96nÅupharpoonlefå#  Grigh! A ÇŠpperLeftô 9‚@perRV " 7Šs!503dP'up D  hâ / VUpsilR'3a:
 L EUpTe22  
¯  #up!Ö&1c“r;#u ; 	;tTUringë 1Í
 É)urk]sj;&4bë c‰5tdo
%2f3 TUtild66016ü  € u— Y  ÓTu25b4Duuar2\3Uumdû f  ( 6x)  * duwanglÌ 529a”Uvangrþ %99] Kvarejfj‚varkappai 6u036vvarnothÑ82208 'ph	  U“varproptoj 5221O'vA>@vU9  hG 503fvvarsigmÌ ðc2',
    'varsubòsetneq;': '\u228a\ufe00',
    'varsub% & ?acb&  p& K % K cK SthetaG G03d1Œ Ãtriangleleft" O22b2"  Grigh# 3# DVbar: 4aeb (vB 8 v/ 9 3Vcy 6041  3 SVDash. 522as )Vd \ v0 Œ 
0 `   la 5ae6¥ $ee &2cF 2] 'ee%2b¦ 7vee$5a] evellip` $ee 7VerJ %01� v |- ¥
+  	) Gical§&22Õ0ert 2Linó 8 …Separatoü%75ü V> BTild?  
4ÅVeryThinSpac  %00#VfV †U0001d51Ë 3² Uvltri>ÂEnsub u82\u20dëFvnsut*83 BVopf; ‰ $4dhv %67 6proT 13 r¢ º 9Vscï &4b[ cGRsubnEž .u2A  \†8sup> 4  > y Vv"| %2a¹tvzigzag %99 SWcirc D0174-w 5 'edõ4a5f FWedgš cTw 2Ž %25KUweier¨%11¾Wd1Å w 3Ç W4¿w 6j w w6u222Vwreatô W"úw $ccE5xca{ %2cx�525et'xc%c¹'xdÑ%5béX'1µx 3ðExhArù %7fs8xha ×Xì5039kx b lZ })xlZ Š m&7f33nisÀ622fÒ ðodot;': '\u2a00',ò
    'Xopf;': '\U0001d54f', x '69 2lus8 Vu2a01 Ftime 2 DrArr &7fJ (ra 60 3Xsc/ ˜ 44b3 x &cd Dqcupg %a0O 9xup± 42 Dutri1 5e %veÇ &2cà Gwedg 0H aYacuteI%xd� y f , u -  . 2Acy Eu042ž'ya µTYcirc/ %17y 7¸ F $2b y 4 "ená %a5) "enm x )Yfº551c.  3Ÿ 'YIr 0ž 'yi 5 Yš5ˆy $6a~ Y8by %ce6 Uƒ 2 'yu 4 "ml$fªBYuml%Tu0178Y y x, Z1. (z Ö SZcaro… ` fz ¤ Zº 1Tz 3 FZdotŽ 
z àSzeetrOEu212ì ÕZeroWidthSpac?%00Q DZetah %39z b ZH	e z 25Æ HÝ 1G 'zh Œ8zig•1ÏZ] y >z z 6Ø Yb;z c23zwj6200Ñ'wn  uñ}

# maps the Unicode  �point to ðHTML entity name
# " 2 J = {K 1 I õcharacter
# (or a  Ñ reference ifv  ¡is outside ò Latin-1 range)
™ Cdefs‰ Pfor (™ ,Ì © A) in¼ 2¼ ‘.items():¯ Ó [ 1] =8 % k [`   Echr(- a)

del0 | Ð
"""A parser � Pand X
 @."""‰ñThis file is based on sgmllib.py, but0API$ Áslightly dif< t.H ð
XXX There should be a way†ñdistinguish between PCDATA (¢ 7d
#•qdata --v ð normal case), RñCDATA (replaceable character
# data -- only ó and entity references ñd tags are special)
# g [ 
Y /en:  Ô.


import re
 ó_markupbase

from html ( ðhunescape


__all__ = ['HTMLParser']

# Regular expressions used for parsing

interesting_normal = re.compile('[&<]')
in Klete  �&[a-zA-Z#& 
4<ref& (' B][-.1 †0-9]*)[^ 0')
;>  P#(?:[1 `+|[xX] ãa-fA-F]+)[^0-9 û')

starttagopen† <… œ')
piclosÎ >„ oomment  pr'--\s*% ð# Note:
#  1) if you;0nge�find/attr	 ô remember to update locate¬ 0oo;O 2O oand/orC !heÚper willN    ð"lode, so don't do it.
# see http://www.w3.org/TR/pð 5/tokenization. P#tag-Yc-state÷B CnameB 0tag#š_tolerant²&r'8ô^\t\n\r\f />\x00]*)(?:\s|/(?!>))*')
rO ñ
    r'((?<=[\'"\s/])[^\s/>]  =>V ”\s*=+\s*'0 ð\'[^\']*\'|"[^"]*"|(?!B  ? �>\s]*))?Ž ä— ur"""
  ž[ë  ¹ @   #\ ?0
   Â *   @# op½ðal whitespace before -TibuteQ S  � 6  8 5†  ñ # value indicatorY *  (?:'[^']*'  ‘# LITA-en‹dE ; $  �7   ; :  ¿%'"¾ 3  0# bÚ± l ) /\sp
ñpossibly followed by a yD +  )* _)?
  d 
¨ §# trailingÚP
""",¾úVERBOSE)
endendtagX'Ã@the 7! 5ÊP, sec/à 8.1.2.2, does2aÍ Æ ás between
# </ø H  d  ™gðmaybe this should be fixed’ ô
“ vr'</\s*ð(S:_]*)y�


class¹ ð(0. ð Base):
    """Fñ
ind tags and other markup ñcall handler functions.

    Usage:   öp = HTMLParser() ¦.feed(data 7...! rclose()X SStart• #re Pd by � ’ing self.—  _s. �tag() orS  1end! 4; eî )byE " a.  TheF  ¯ ‚ between� ñis passed from the pì 1 to Ñderived classE ´  \ r() with9 ðata as argument (]  & F ò-may be split up in arbitrary chunks).  If convert_charrefs iˆ ATruej   ð acter referencew e: °ed automatimyÛ ‡  correspond„†Unicode R (C} Á �() is noB clongerÉ $in¼ ,y1wis¥ @y ar[kBB _ ‘entityrefû	Ð •  dastringE pcontainÆ  Ñ �ectively!önamed or numeric( ¡t©Ä2"""ºóCDATA_CONTENT_ELEMENTS = ("script", "style"ìÐdef __init__(Ý D, *,�Ç=À)kÑ"""Initialize©óreset this instance¦ › V k�efault), ñ >%9 L  œ
#u#ed- )s6 M  :     þ .L ú - =Š 1 ù : N   
1R" P  Los¡ll unproceu ¹.œ 0raw Z = ''… plasttag ;??? €interesto'=  z_normalK cc ²_elem = Non�  _˜Rbase.dB ð … q  , P 
�r"""Feed ±Ç1CN€as oftenþ’you want,º�as little/Åas much textÒ 4as 4   (Æßinclude '\n')k Å . +¶ _  —goahead(0RO  ú A"""HÊ€ any buf ìV 1V _h_â œ‹  q:get" Í
~ ñReturn full source of À a™: '<...>'Ž r5  Ì .… ïBset_9Amode{  , D� B % Àelem = elem.“lower()
  ñ self.interesting = re.compile(r'</\s*%s\s*>' % / °cdata_elem,- 1I)
O ¢def clear_! Pmode(1 !):   r   o } z_normal. M  n r = Nonen 0# I¶ ànal -- handle ™ p as far ñreasonable.  May leave statee R# and6 ó#to be processed by a subsequent call.  If 'end' isB ²true, force‡  F2allW �as if folyV ±EOF marker.B  7qgoahead.W, end31raw× =} ;  RUi = 0 ƒn = len(& è¶while i < nŽ@ fX ñconvert_charrefs3not  ƒ ó
>  B j4¥ Æ.find('<', i|  %   Žif j < 0C   #)�we can't I ñ the next <, either we are at 5endû  D  @# or! °re's more tG ‚incomingÈ ^ °latter is TÇM – @passX O "toñ e_€ in case£ 2hava‘  C# a b@ cut4 @halfÐ ÿ
end.  Try to determine if• @this¹  Ç x 0befê Ã ed†pby look ofor anK Q& nea1 |ú se{ Y it's¾pa space`;ÀÛ  gampposrÌþ('&', max(i, n-34)  B Cif (B @>= 0Œ µ  ,  ž	­ä[\s;]').search", Q )U ?  ðbreak  # wait tillÇ@get Ê c AŠ  ÿ
YNelseäcmatch Æõ®  i)‰ <c&r 1if I `  Ï  Œ  g.startè    œ   i	 Íë (   /œ    ‚ 
!ifwj² r {& r S ˆ”(unescape _[i:j]o S OJ 	ø  / �updateposájÝn== n: :ª@switi ¿ 
n f½!rt hY  ðtagopen.match(rawdaÿta, i): # < + letter
   ýk = self.parse_starttag(i)/ Qelif ! ¡swith("</"f *  h Y ?endW ?!--Y comment± ?X /piS !S ÿhtml_declarationa Ï(i + 1) < n:]²þ handle_data("<"±‡N H Oelse^ ]break0 �if k < 04 ¯if not end   Œ X    -0rawË ±.find('>', ¸ × � S <S  5 W  &  ® œ $  X  ok += 19  ^ Šñconvert_charrefs and]öc%__elemi) “unescape(eo[i:k])[À [ 	R Ø i_êupdatepos(i, kz Y/&#Uƒmatch = . Õ  Œ� !f % -bname =" í.group()[2:-1]I  ½ý ƒ (C 
Ï  *    '| _.end($ 7VŸ';', k-1)² Y ?k -Gs G   �continueï ¦if ";" in ûý]:  # bail by consuming &#Y  v   L ÓÆ[i:i+2]/ 9 S?i+23 uo '&p ½Ï = entityrefpA1· € mÀ match.end()/
   ÿif not startswith(';', k-1):1  D Ÿk = k - 1" ÿ	i = self.updatepos(i, k)- �continue ñmatch = incomplete. ¾(rawdata, iR 1if % » # à.group() will � ýain at least 2 chars‘  ù «if end andK 3== ˜ O[i:]  A  :¢ ^.end(Á  $   Ÿif k <= iK  '  O nª   ‰_i + 1z #nV ]break belif (X O < n´ #i1theC0of  qbuffer,R€can't be“]fusedi  Õ  # ¦° some other/ ostruct0 Šphandle_8O("&"þ /Oelseè $, õassert 0, "interesting.search() lied"Ó #6Fwhil+ŽixFÎ ~cî Z_elem¨ "ifž€convert_îOrefs>  ƒS„unescapeœj[i:n])fK F*n]A Ÿn% L @  �
G0# Ihó%nal -- parse html declarations, return length or -1 &ƒterminat›ð# See w3.org/TR/M ‘5/tokenizO . ‡#markup-g ¢-open-statÎJ Balso˜ _, R in _C 2bas0 3def)  a . ( õ  .  Îˆ õ[i:i+2] == '<!', ('unexpected call to '>  B  	'h_§ &)'¹'if=4i+4~ 6--'Æ  e ò# this case is actually already çd2lgoaheacÜ™ ‡comment(MÏ3‘ [� O  ¨`ed_secNV 
£9].lower()m{doctyped a# find-™closing >~Vgtposð./ ð('>', i+9)
          û  if gtpos == -1:
  ™return -1 ñself.handle_decl(rawdata[i+2:P )])1 G  +L Jelset ) a ñparse_bogus_comment(i)
Y á# Internal -- *  *  * #, K Àlength or -1ï ãnot terminatedM ðsee http://www.w3.org/TR/html5/tokenization. #l -l a-stateK 2defŽ ¸  Ñ 0, i– vport=1)ø =0 = & . O  Žsassert  õ [i:i+2] in ('<!', '</'), ('unexpected call to 'F  J  'Lp&)'É'ˆ æ.find('>', i+2% 1if ( O�KPif re £ ^b	a7pos_W  u ?+ 1ðprocessing instr‹Ü?end
Ó0pi(œ ?, i¾-`== '<?½µ ‚Fpi()¿ômatch = piclose.search„E # >ð0if ê8 
_1-‡Aj = ) v.start(Î ï é$pio ç' j…B 7end@ l j—â s ?tag� ; – ¹ $__" ²_text = Non¨ h0end6wò check_for_whole; @_tagt /   3if 6 ?< 0W ‡¶Ü§ 6 2[i:O ]@ ‚ R# NowcP the wñ between i+1 and j into a tag Uattrs•  U = [] ÿ  =1  Ù¡_tolerant. ù h1š# /, €Ë†Ñkt
2@last» � ) çgroup(1).lowerf“while k <�
™@m = ò Ø 
kÖ  f>
J   Ubreak7   \ @nameÁ1st,l Pvalue¹ .µ o, 2, 3e Nresth  V F 	¶ s Felifh @[:1]À@'\'' ; P[-1:]Ü\± À       attrvð alue[:1] == '"' Qattrv {-1:]:
    5 =  i[1:-1], &if F •unescape(O )J   ‘s.append(% Öname.lower(),g )8 `k = m.5 %)
Q öend = rawdata[k:endpos].strip(A 0if + únot in (">", "/>")Ì ÷lineno, offset = self.getposN  Dpif "\n"O % ú __starttag_textX  1 \ 3 = 	 +] 8 p.count([ ¾  ?   — Olen(v 5) \ 1 	 -q _rfindq  NelseÆ ƒ 	 /+ Œ 	Š ® phandle_¬(´i´
ï `returnµ5posJ Ç «swith('/>'Ãñ# XHTML-style empty tag: <span^!="E" />Z  *¤ Í¢endtag(tag—s¤ > ;  k  if• =þCDATA_CONTENT_ELEMENTS~d Pset_cDP_modež — 
7Þ ñ"# Internal -- check to see if we have a complete û Vtag; N J Por -17 $in/ . 2def[ ¢_for_whole_ · 7, iªþb K  m'Tocate� ôend_tolerant.matchB Y 9 Jif m7j7 [  0nexáz ^[j:j+ó% Z= ">"V  F Uj + 1�   5if 9 /9  $if².ß Ì �7, j% L  m 2m  ! Q "P ý# buffer boundaryU  Y v -à    # Í bogus inputA Žif j > i: A [ j7  X 3 
iq
p #G? of¨ Š å Å/ýabcdefghijklmnopqrstuvwxyz=/"Â  ß   ü"ABCDEFGHIJKLMNOPQRSTUVWXYZy / 
§  ‘or before·aibute »C, or»Àe the
        õ
# '/' from a '/>' ending
" 	 ™return -1 ™if j > i:  3 0 j Oelse+ Fi + ^ ñ!raise AssertionError("we should not get here!")
h ð# Internal -- parseÐ Stag, ‘ ñend or -1 if incomplete? 2def5 ö_endtag(self, i)´  rawdata =  . >  ö a°   ù[i:i+2] == "</", "unexpected call toq "I pmatch =¾ Œ ƒ.search([ ¥, i+1) # >3 !if: ±  – û ¼�gtpos = - e.end()H  { �tagfind. {  y ¯</ + tag +„ "if2c?�_elem is± ?Non _phandle_3 ~ 1[i:½ ]±  ã   ç  Î    # Æ ð the name: w3.org/TR/html5/tokenizaj. P#tag-, C-sta J       =  [ �_tolerant**+2¨ ¥D 
© _ #ž @end-¢ Oopen¢   G )if†3†^'</>'s  0 =9i+3;  ¶  5 ¬nú_bogus_comment(iý 0tagù ! =‡D÷ .group(1).lower‡ ` õ# consume and ignore other stuff betweenÛ(  èH ¤Note: thiswð100% correct, since we might have. rngs lik J   @# </ùöattr=">">, but looking for > after˜ ¶Ycovera‘# most of, QcasesÅ  is much si¡
4 â$ =á.ƒW('>',XÔ
§SU(’
( Öf "+1Z ø µ4¸� # script^Fstyl4û1if g !a/·Ð #!ˆI  … ! bclear_‘ Gmode¬20Ð# Overridable�àfinish process(�of start+“Òtag: <tag.../½ Ž®( š  Œ ,y , �s�  .3  Äýð attrs)
        òself.handle_endtag(tag)

    # Overridable -- ) ¡ start tag& 3def _  D  W ," ‘, attrs):+  U Opass_ 0end; 2 ] Ÿ [ T ücharacter reference`  # Bref(a Onameb oentity_   a (Ldata´   ±   ± |commentS  V %¼declarationZ   W ?ecl­ ÿprocessing instrucb $pi` ?ata`  Pˆunknown_� 0  ö,from enum import IntEnum

__all__ = ['HTTPStatus']


class  (5 � 0"""  Bótus codes and reason phrase W % Ž  the follow	òRFCs are all observed:\ jð* RFC 7231: Hypertext Transfer Protocol (“ `/1.1),G ±oletes 2616ÂK  6585: Addi}!alè  § CÌ 1 ð3229: Delta encod· !in8 + Q4918: ù Extensions for WebDAV› ;518? ‘5842: Binc B #toA 1 ò7238: Permanent Redirecó R2295:40par) @Cont aNegotié Ó r2774: Aï Ö ¬ Framework“  72_0 Wa to Re„ü Legal ObstaclesB ?540ì0VerZ# 2ö+2)C C2324C   T0°Coffee Pot û 9rol:ŒCPCP/1.0H F8297ý Í  ÔpIndicatLHintÈ q8470: Uï©Early Datag1"""º  Ñó__new__(cls, value,J�, descrip±3=''‡ à®obj = int.? Í Qobj._S  ï	 a  ²# =q ” _ .| ( =Š & ¢return objV �# informW!al( ðCONTINUE = 100, '‡ñinue', 'Request received, please cont% D ð
SWITCHING_PROTOCOLS = (10÷1, 'Switching Protocols',
  # ƒto new p* ñ; obey Upgrade header')> ñPROCESSING = 102, 'Processing'# ±EARLY_HINTS$ ñ3, 'Early Hints'
& P# suc8  ò%OK = 200, 'OK', 'Request fulfilled, document followsn qCREATED?  ù pCreatedD D1 c Z, URL> RACCEP? !(2Î QAccepA ™  1� a ,+ ¼  `ócontinues off-line+öNON_AUTHORITATIVE_INFORMATION = (203“ð'Non-Authoritative InformationÏ ¦ from cachs �_CONTENTï4, 'No ContentD Q, not(	VYRESETL 5•8setO  Clear inpu–Órm for furthe ¥yPARTIALQ 6;hartialS P  Wí°MULTI_STATU\ó207, 'Multi-StatuÒALREADY_REPORÞð208, 'Already ReporåäRIM_USC2– uIM Used©predirecˆ0 †  PLE_CHOICEŠ !(3¼‹ ¨ple Choicesó'Object has several resources -- see URI listBðMOVED_PERMANENTLY6 30ç÷Moved PermanentlyÞ'k m$ p$ g @FOUNA3AFoun?	F ½temporarilyF àSEE_OTHER = 30ôPSee O
 y	M î ¡Method and™ù L ¡NOT_MODIFI–2(30Ê€t Modifiß) žç [ônot changed since given tim%ƒUSE_PROXN Ù0Use(xFÀYou must useñqxy spec€ q in Locœ@ to uss thisÖÅ€TEMPORAR�PDIRECœ!(3»TV ’dÇ�	›(8_REi  ù)# RÍi 0wP# cli�Qerror ¡BAD_REQUESß 4CBad ¶o   ràò syntax or unsup—! mA#UNFZ42Una-z0No Â dission«+ °sschemes_ qPAYMENT¾ $IRc Ù!ayp Ã .irg  ÎPcharg
_ �FORBIDDEò4˜Forbidden e ñ  ¼ 
¸ @will¯S help¾  +ðFOUND = (404, 'NÃot Found',
  ñ'Nothing matches the given URI')) ùMETHOD_NOT_ALLOWED = (405, 'Method Not Allowe^ ²Specified m( óis invalid for this resourcen g ’CCEPTABLEj 06, ª ¸ AcceptableÄ ÐURI not avail Á in preferrei 3mat^ ôPROXY_AUTHENTICATION_REQUIR× 7úProxy Authentication Requirê ¦You must a, be withå pI óbefore proceeding–  � ²EST_TIMEOUTõ @8, 'k ¸est Timeoutö  ótimed out; try again later] pCONFLICV ÷ 409, 'Conflict'a c ò2GONz�10, 'Gonp ó  longer exists and has been permanently removed� jLENGTHr¿11, 'Length\bClient_sR¢y Content-7 ] �PRECONDIÕCFAILÓÑ12, 'PrecondiÃJFailÁ	 ôin headers is falsžª >³TY_TOO_LARG.3Rù Entity Too LargB �is too l l` 2URI] 1ONG&14\ -òY 8ong  U   T óUNSUPPORTED_MEDIA_TYP²  ÄÿUnsupported Media Typ° @body\u1 6for^¾ �ED_RANGE3uSATISFIÍ'16`Å�ed RangeHpSatisfiÉÜ 0Canås  W qur8  bEXPECTÔÿ¢7, 'ExpectÁþ  !QcouldV2be t iÅ IM_A_TEAPOU0(41«ÉI\'m a Teapo©ÀServer refusbð	o brew coffee because itk1a t@ .Ò €MISDIREC»]23€Misdirec¸I1x !isÇ  O0 to|`duce ax5ponÚ�UNPROCESSª_àP = 42=!Un´!ssG ¿'+ALOCKg 42þbLocked ƒ±_DEPENDENCYO  È�² Dependency1  NBEARL)  › åCEarl! xUPGRADE? 42vUpgrade?œ 	 ?å2²	ó AÕÄThe origin sÅû("reƒVto be<#al½ Ï AMANY¯ BESTS» ƒ Ø AMany± Hests¹ w AuserPsû &m/ s  F 4 É#'a´ amount of ð ("rate limitingñ!")')
    REQUEST_HEADER_FIELDS_TOO_LARGE = (431,,  0 ÷'Request Header Fields Too Large'+ óThe server is unwilling to process the rR Òbecause its h^ 'x fi ‘are too lm Ä ñUNAVAILABLE_FOR_LEGAL_REASONSÂ 5Â ÿUnavailable For Legal ReasonsÀ @deny¾ "acº o½ ¢ ðresource as a consÙ ¡nce of a lg ‘demand')
Ú # aerrors ðINTERNAL_SERVER_ERRORÆ ò500, 'Internal SZE: ¶  0gotJãelf in troubleõò NOT_IMPLEMENTED] ÿ1, 'Not ImplementedW  ódoes not support this operationa ²BAD_GATEWAY] ø 2, 'Bad GatewayY ÀInvalid resp4ãs from another!c/proxy^  GICE_øf @3, 'ÿ Gice æn ”0canÉ ‹ duf° a high loa² ÿÕ ‚_TIMEOUTw C4, 'Ù Œ Timeouts gø Î A didEõreceive a timelyê ÐHTTP_VERSION_¶eSUPPOR´@5, '$ � Version ÁSš
¿Cí tfulfilltg ðVARIANT_ALSO_NEGOTIATE;ò506, 'Variant Also NegotiatesüñINSUFFICIENT_STORA71507®òsufficient Storage7 ¢LOOP_DETECÎ ð508, 'Loop Detec ÷ aEXTENDª 51 è ‚ExtendedP ðNETWORK_AUTHENTICAT5 à!IR: 8(51ñNetwork AuthenticÁ à*ir= 5!clÄ PneedsÂa7 ,cgain nT $p')
r"""¡S/1.1 C ðlibrary

<intro stuff gYshere>
<ú  ,î0>

E `Connecg. ðthrough a numberh0"st›ð", which define when•Å B
may�uly makem‹�or fetchã™ó for a particular
/ 0. Tádiagram detailÜ1se � p transi» "s:ûR(nullÀ1  |êJ  | è (! v! AIdle	 2 3putˆ .  Ê½est-started9 0( pÄ Ç¢() )*  endysK 4entH /\_ 	&  5 T| get`‚() raise  + =(  R &| s v  À      v
    ûUnread-response  PIdle
 #[R" �-headers-8 ] _  |\_    @  | | .R !()* ã| putrequest()+ v  v  ©  ú   Req-started-uê 6 2 Æ /� 	  /  ¶ |   (½ '¢() )*  end sÍ /  Ú Í  º  ü ¾  & Í ?entÊ  2 1   ¬   +| Ç 9 �   R¬ð-sent

This diagram pre ós the following rules:
  -- a second óÃ may not be À„ until {± 	ˆ}G  Ó [object] canI –retrievedK `´ B òthere is no differentiation between an L=² body and aA partially Ô
( �

Note: t$°enforcementv ¡applied by-¡HTTPConnec� ’class. Th“     ˜  @ doe½ #t Z g òstate machine, whichª 0 ims ñs sophisticated clientsˆpaccelerB  Â£/kH Ñpipeline. Cau¯ `shouldÃõ taken, though: Q   S Ÿ sI 0bey
  Ñabove patternŒ  ® áy knowledge of)tserver'C c4ô-close behavior for certainlós. For example, it‰  isðossible to tell whe%w b will i  ¶ ~ I QUNTIL1 4 @ havž eŽ 2ad;®@mean.`at furn I {sÕ�placed in  4he ‡äiW 0Tn thaÛ  § 4½ 0NOT¨ Ä ”Æ Á.

Logical SHø !__Â  $__ì (
-       O---
Ø- …_CS_IDLE u  None
�ý   7 °REQ_STARTED 
7  �  
 7 3ENT 7 E 7 ¥ <_·>± ìà j  C ± C    @ 5   C ÐENT       <reúsponse_class>
"""

import email.parser umessage Drrno Dhttp i r- dsocket" 4sys òcollections.abc
from urllib…  ˜ òurlsplit

# HTTPMŽ !, « ñ_headers(), and the& ð status code constants are
# inten{ ðally omitted for simplicity
__all__ = ["x "Re<1",  BConnÁ F",
   PExcepb  . 3Not-  ed û UnknownProtocol?  òTransferEncoding9  Ÿ û ementedFileMode? ÑIncompleteReao  InvalidURLD ƒImproper’ |ionStatF ðCannotSendRequest;  Hu  0Notp yŽ 0Bad_ `usLine0   RTooLoÒ ¢RemoteDiscN![errorJ rPs"]

�¡_PORT = 80 S ó443

_UNKNOWN = ' 'Ag 1ion!°es
_CS_IDLE* QIdle' °REQ_STARTED ‡-started$  EN„ '! Pent'
j ð
hack to maintain backward”€mpatibilhðglobals().update(S.â :Ð.__members__)Z �another b ‘# Mappingô s� õofficial W3C names
hñ  = {v: v.phrase_v in    .values()}© ðmaximal line length when call� @read °().
_MAXLINˆQ65536 ÐHEADERS = 100S y« /l a ABNF 4ò://tools.ietf.org/html/rfc7230#s­ö -3.2)
#
# VCHAR¸ó= %x21-7E
# obs-text   ‚80-FF
# p±-field   = 
 -=ƒ ":" OWS   SOWS
# %  T u= token + O #*(- !co¦! /Ž efold )1  € óvchar [ 1*( SP / HTAB )L  ]?  p e  ó   r  ­  å LCRLF\ "
#  ;« o|ô C ?ing) Rsee S’` 3.2.4ÞO P= 1*tØ ” 
  �"!" / "# $ % & ' .*"~ A/ "+ - . ^ _ ` | ~A ÞDIGIT / ALPHAb R; anya1, e± delimitersÏ xtdefinedWÃñ5234#appendix-B.10±he patterns AbothVàare more lenieð\nt than RFC
# definitions to allow for backwards compatibility
_is_legal_header_name = re.compile(rb'[^:\s] ðr\n]*').fullmatch
B )ilD NvaluE ã\n(?![ \t])|\r ò\n])').search

# These characters are notÌ ÿLed within HTTP URL paths.
#  See https://tools.ietf.org/html/rfc3986#section-3.3 and the
# ; Àappendix-A p¤ q ƒ ðPrevents CVE-2019-9740.  Include~Xntrolá Àsuch as \r\nE ñWe don't restrict- Às above \x7f. ñputrequest() limits uõñASCII.
_contains_dis	qed_url_¹ +_r¡°'[\x00-\x20c ñ]')
# Arguably only t›„_should_‘:{ d se ðr"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$"x !We÷Ámore lenientÆúassumed real worldÏ¯ purposes.Kàmethod names
#=pÍ Q inje=`F c 1f_0
# è €lways seÈôe Content-Lengthw  Â~a Ðs because som½@serv-àwill otherwiseB2pon4ñ! a 411
_METHODS_EXPECTING_BODY = {'PATCH', 'POST ñ	UT'}


def _encode(data,( =' ð'):
    """Call  ., ñ"latin-1") but show a better error message."""G 2tryP  T oreturnS /  except Uni� E£ EY  asb L a) (H  n   2err½ Ming,  obÿ ^start :end á"%s (%.20r) is×rvalid L(‚. Use %sƒ ²e('utf-8')  ¡    "if you waþ¢o send it véd in UTF-8." %Ä (ß‘.title(),X[ò À :
 Bend]Þñ)) from None


classvM²t(email.À P# XXXÌ:uã’ of this Ä !inŸ #d.Å@.CGIÝRÞðHandler.  Maybe m@the ð “rG @that	@doesB@needËrbe part‚ áe public API. ¥ sAPI hasF ¢never beenßRed so» cû {S ¢a# issuˆ   @Cgeta42ingPcs(selfp«p"""Findbalines ràing a given heÓader name.

  ðLook through the list of he/ õs and find all lines matching a givenM 4 c   (9 òtheir continuationC U).  Ak w  Z %isL ñreturned, without interpretI Q.  If² v ödoes not occur, a˜ Remptyo 4is Z B 9 ðs multiple times,ù – # ¨rences areL bCase iƒ €importanµ ¤ }5"""Z   ! =<æ.lower() + ':'" p = len(* ) …lst = []  hi 0 1foruõ in self.keys():!  
!if$ E[:n]~ =Ž 
)  - b 1A Aelif~ #Ì[:1].isspacej A £   nif hitm °lst.append([ ù r!ò lst

def _read_Cs(fpâ ó"""Reads potentialÛñ sV2o aáfrom a file pop+`Length …  çðlimited by _MAXLINEt±d number of � 2  �HEADERS.' 
/ Ò wh� FTrueƒ P= fp.ó   (ƒ F + 1# Ö"en8% >¨ J  yòraise LineTooLong("† !"N  sŽk $ )n ä q �HTTPExcepó("got more than %d¥As" %¸ J Ž  q 0ineÖÃ(b'\r\n', b' 'þ á   Qbreakj7© ;Wparse;�, _class=¥ sMessageQ @"""P. äs only RFC2822®  Baemail < òr wants to see strings ratherRbytesàBut a TextIOWr‚r aroundÏr¯ would buffC �oo many G ÷ ™  irstream, Ð which we lat0eed—  X2 as% ‡  So'   G rcorrect" e here,1  , tñ ƒ 1to iSóÂ7 h Ã = b''.join(½ò).decode('iso-8859-1'"æ„ .v "r.|(Û ) Cstr(h A)


ý ýÑResponse(io.B]pedIOBasŸ P# Seeá 2616 sec 19.68�RFC 1945 6sdetailsS# TheD¢�ocket obja fß -”|  32.2Õðnotes an exceptionòF for MIME-encoded
    # text following RFC 2047.  The basic status line parsing only
C ñaccepts iso-8859-1.
^ ñ(def __init__(self, sock, debuglevel=0, method=None, url
 !):C b ÷-If the response includes a content-length header, we need toG ámake sure thatS òclient doesn't read mo" n" ? òspecified number of bytes.  If iG ,	 ÷will block untilF  É ðserver times out and closest  Õ qnectionˆ0is Q E Àhappen if a Y@.fp.¼ ñ() is done (with\ ç size) whetherF :  3 ü	buffered or not.  So, no^ bõ—=qs unlesº ƒy know w_Åy are doing.x v =.•ªfile("rb")& (' =5
% _@# =I|¢  ÄTHTTPR:`objectò Àreturned viav1libm#e × f #éAhttp§ urllib expI !di8Ñnt attributesk7theA — )
  ‚ ‘used hereX †supportsŒ gmsg isF  provided aúñbackwards compatibility layer„  ´ ? Ø � !‹’ =ì v  = �IAfrom›SP-Line Î—k W ðversion = _UNKNOWN # Œ"-V 
/ d. 3 # m 6CodM] Jreas\ A # R v-Phrase½ 1 xchunkedŽ    #Œ"! @" be œ?¢ " ]_leftF #  "toGpin curr_; 
N °ð  �   #`X %in
K  _>™  Aconn>`p at end»·N ¬ C_Š°…ýQ= str q  ö(_MAXLINE + 1), "	Ñpif len(1 D) > 4 ç û `raise ]’TooLong("�  8 
N Ø":> 0M òprint("reply:", repr€ g ifï^ 
= Ñ# Presumably,úµid  \§f befor¥ Ì `# sendMua valid¿ ( ô “RemoteDisU Bed(" °v   Xß"¾ H  À           "Ó response")
  Etry:   översion, status, reason = line.split(None, 2G úexcept ValueErrorU f j  b 1b  2   � )""¸ ‚  ; ƒ# empty ã ù will cause next test to fail.]  > 6 '= z dif notR ú.startswith("HTTP/")	úself._close_conn(á ¡raise BadS}PLine(w%)
� S# The�õ code is a three-digit number2 }Úr = int( 
‡ $ifa „< 100 or Z> 999Ó  ¸     ŸA dreturnjŸ  def begin(h{ Ñ  zpheaders3 · Ç
Í ð # we've already÷ @rted…ding theFa à rŸ ‡   #3 ð until we get a non-Q‰C ªwhile True� uï 0 = â  ._¦ _ÃK ó EÊ != CONTINUE]  ¨ Ubreak‡   a# skipê /Q from »  4  2 Bped_1 Bs = š  �>.fpf •îdebuglevel > 0£  pr¨"L 1:",¡ o 
W <del! —66B< P-
) l	 g.striph$if�C in ób1.0", ÿ<0.9 # Some serÜ� might st‹D  "6 õ	, treat it as 1.0 anyway¡ w ? G i¡%10 &elœ –,1.– ï J `1   # Ç21.1lCfor  Çx where x>=1x sÂÚóUnknownProtocol(k Ø‚ ä � Û ´msg = parse[Kt  ê . H	 ¸ €hdr, val¬n w.items(/ \  	z yphdr + " 7val¾ P# areè$us'ðchunked-style of transfer encoN?Ã dtr_enc÷ d.get("6 -6 ½iU : Band E ð.lower() == "chunked":
      óself.chunked = True
    ¶_left = Non# _else:1 Q eFalse
" ñ# will the connection close at aend of •response?@ �  C _4 !=  b_check (()o ödo we have a Content-LengthV ð# NOTE: RFC 2616, S4.4, #3 saysB óignore this if tr_enc is "="¤ lc / ¶ ãheaders.get("cœ # %")O 2if  ‚ and notó w 
}:try  Äl C b= int( c  & ÿexcept ValueErrorI 	B   "if° t “ < 0:  # Pnßó nsical negativeï s G  
Í 	„ Œy ¹U a# doesgDbody#Sfixed‚ ¦? (of zero+øif (status == NO_CONTENT or  ÕT_MODIFIED oru  Æ d100 <=- P< 200=   º # 1xx codeþ ö p_methodx z"HEAD")£% î 0 ²
sÑremains open,Zówe aren't using a Á 0# a¹Fk 1was–�provided,Tpn assum1×ïM BWILLþ.  bæë5and$  -$ ©  Å 	! !is¸2c = F Idef W O @  Ð  ÉØ
Å @ P.versòZ== 11¿ð# An HTTP/1.1 proxy`H@d to3y±j unles#Â# explicitlySdT 0 ifºn'! ">A" in w.lower(Þ  1   breturn    ÞDSomeÅ À0 implementaçsdÐsupport for psNt ^ #’ #s,Œàrules differen(a,.ê‘For older† �, Keep-AlW—indicatesw m .³	×kI aI xòAt least Akamai ( es a "Cü:¢ "" r ,`which d8!se
@be s bymy clientÁ Ÿ 1"¹ À" in conn.lo‡wer():
  Õreturn False
 õ# Proxy-Connection is a netscape hack./ ñpconn = self.headers.get("pG   G %")5 2if 8 òand "keep-alive" in ?.lo² õotherwise, assume it will closex ò 3Truñ Qdef _$ _© (Æ &$fpÚ %fpE  $ . 6Non\ 1fp.I "()L [   1 U :tryˆ0sup�? � # set "= ud" flag} kfinallA "if*fpY  ì } .ã Ÿ ð# These implementaëñs are for the benefit of io.BufferedRå.æ ò,# XXX This class should probably be revised to act more lik;#j ú"raw stream" that n ƒ expectsv  \\flush±K 	q	" .0 h ^ Œreadablea ±"""Always r> s M1""":  q  #0EndD	å rmethods#  r "isñr   c 1 if* §P —3 .€ p# NOTE:²is possibleU"weÒnot ever call<J 1().ÌÍ #Ò ñ   case occurs whenG V ‡ ÀTRUE, length   , Ýwæ G L  [0 up eàlast byte, but½   p &ite#‘ €IMPLIES: ã† `FALSE,&nÔ ­ ž ALWAYS b‘ à Òlled, meaning? ’)Ô  6ful˜ ìF &  ú Ô ë Ð`, amt= 	·: 
¿^ 2b""R  E4 _@ª == "HEAD"; ’ Ù F Z 	zchunkedP 1 W  Ö _' C(amtR Y  ifé  Ï  c ð 
H ¿ +( .Ramt >}" 
>  b `# clipå ˆ F""ed†response� 5    \ §\ T  sé.X Ø    0if ¬ s© › 0Idež , i raise Incoh te= º ú�content-�   u ð# wasn't satisfi  "ð it might break Z –atibility›ð        self._clÇose_conn()
  ùelif self.length is not None:*  5 ) Š-= len(sP  & !ifC - J  ( ! ?_cl› …return s† ;els” „# Amount¶ øgiven (unbounded read) so we must checkñ ^  ’ " =D 0fp.c U©  ] ?tryN a_safe_Q “aÿexcept IncompleteRead\  Ûd ˜   Yraise  … I = 0   	Y  2   #m Å ¹ everything; Ù 1def§Pinto(V F, b)Í 0"""Þ a up tor�b) bytes 2   array b anò6¡the numbere  ˜ !of- sn . E"""
  fpSý» 02 ö_method == "HEAD"Ã  }  Ù ./t   X kchunkeÞ/ U  k _+ >(b)Ÿ K Õ Þ$if\>Ú1 
Å  ª p# clip ` y  •  `"end oÊysponse"ß  9 ñb = memoryview(b)[0:Á j ]´ A!doEGuse °) here beca `this mü’e a .willd~  # õqection,! ® @user Â `ing moU UPthan I Ç be providedO €(for exay,K A ain 1k �nÙ' ¦ ž   )n˜ bl # Ideally,Oawould ¦÷1 if�‚content-N±  g ð# wasn't satisfied, but it might break M–atibility  B ¨ZEAE Ÿ Y -= n¤ $ 
† nE SGR_nextQ_size`]!# \  * Á * Q fromY6filKlineÕ  Ö(_MAXLINE + 1°U " D) > % 
Ú ÕÑLineTooLong("H‡ "M 0 = J ˜.find(b"; Šf i >= 0[ Àline = line[ó:i] # strip chunk-extensions
  Etry:   õreturn int(line, 16)! úexcept ValueError< ñ# close the connection as protocol synchronisa i‹  ~ #* ¥bably losty   aself._b _^ (˜   araise
2 ðdef _read_and_discard_trailer(H )¹  # * S and *  * a up toÎ ñ CRLF terminatorf  u ô### note: we shouldn't have anyJ %s!2 ¦while Trueƒ  J  m0 = � @.fp.”   Ú(_MAXLINE + 1ñ aif len¦D) > ) 
W  [ ä LineTooLong("â  c "W @not  K ú!# a vanishingly small number of sites EOF withouÂ � ‘# sendingXˆ  "   Ybreak  î óine in (b'\r\n', b' 'Ñ @   D E Aget___leftú‚( , ° Ra newJá if necessary.c  r # ` ‘ == 0: atè 0endburrent+ `, needfØ& i1M ªNone: No cA v¦ X next� ‚This funˆÛàs non-zero or V  Î  š 3las— 6 ha˜a# beena \ !µ  &oS Ä: # Can be 0~ .  B"if.   i¬ t¤ ‹kWe arec‡ ,Ë I endg  k èQ_safe+±(2)  # toss²ò¾  I	L B ] w Å Ôe _¡…KsizeÃ_ Y ÌýIncompleteRead(b''Ä‚  Š	´  J &# ð²: 1*("0") [€+0 ] ? ? §e
� p !weEp everytB;1o"file"h ö Z ë -	E © 	#  ) rö  8ä  !ed6`, amt=:vbassertÀ- Á != _UNKNOWNO  ­ v<U = [] B$ @ \ 
ZÙÀeft()
        õif chunk_left is None:
  	 mbreak
 Qif am; 1not? A and '<=] U ývalue.append(self._safe_read(amt))q  “ * ¹ i   -} 7 Ã … 
f Œ  ý ç  "-¥ Ÿ Ò 0$ ñreturn b''.join(´ úexcept IncompleteReadŒ [raise" (P )àAdef ƒQinto_eŸF, b)W vassert ¼ åed != _UNKNOWNÁ ætotal_bytes = Ù ömvb = memoryview(bÒ 6tryi  ôŸwhile Tru  £ Ä=� B_getº  (Y  L   û}Ç ( G  Ïif len(mvb) ù$n © ð m@ 8\   eÑ  NO - n5 ¹ N + n½ Stemp_ŽFvb[:P]X º D jY .n:P V? +=É  ú 0Â ù& �W(b[0:€ (])™™,Vü0"""dò  the number of ä¦requested.© óThis function should be used when <amt>B "! "" µpresent for�  qing. If‚ x  are truly Œðavailable (due to EOF),0 n M 
6 S ¦ 0can� £ �to detect; • problem.D 5""" Ddataß0fp.¬ Ì! , ( 0) <Y
ë« . …-h  ‘é  sÃÂ[ H
À¶"""Same as wA, bum ¹ @ing > ¨ a buffer.ê  Ø=øº!ü  ? ÚOif nö Ùr(b[:n])þ naö Ñ ó  ³ 1°Fn=-1±À """Read witðh at most one underlying system call.  If( 2lea) #
  õbyte is buffered, return that instead./ 5"""  if self.fpA N "or õ_method == "HEAD":6  x c bM  chunked0 n s_read1_( 5(n)Z � `length” Anot ˜ òand (n < 0 or n >§ * )m 8n = _ dresult 1fp.‰ �  r )  t n[ Á ¶close_conn(½ /el¿ E  º ‚ -= len(r M ` 
Â �def peek(„ g, n=-1ø P# Hav5ñthis enables IOBaseè  line() to ö P more"nu`  ×!# N•at a time Û *\ ð ) 
@.fp.'  Ç¯  ( ã ñ  " z, limit0Ñ W # Fallback}’„ ¡ ² which usesÝ ) v À [ ›ó fuper()ÓÜ 9Ø _0is ÑC/ G K	" O Õ (6 	”  … Íà !  _Zf•8naòStrictly speaking, _get ú_left() may causebñ,  ÍP# buttå�ok, sinc‘ ó to satisfy the +– protocolÎ | ×“ u "ifI / "isYNJ== 0�o8b''@  Çp(0 <= n ~ ) à  ‚ p # if në €negativeÅ`largern™ o  Õ ¬ £.e J/ad{ a‘öaise IncompleteRead(b"";  ‡ �_kò$edŠý /# &Àay cause moróe than one read,
  P# but Ñt is ok, sinc/  õto satisfy the chunked protocol.I Etry:  ] + ö_left = self._get_ %()0 úexcept IncompleteReadO õreturn b'' # peek doesn't worry about˜ Z "if´ ‰ is NoneZ 5eof< h ãis allowed to ˆ 1mor%ôn requested.  Just  0K SentirAö, and truncate what we getPh 90fp.ò (<6)[: !]
h °def fileno(6 )æ L % )7 ‘getheader: ð, name, default=3N A'''R�sã ‘ value of F ° matching *J "*.j  I( ö re are multiple0 @ !s,M Z s* à  ? ð combined into a­pgle strn ñseparated by commasjjspaces† ,nov  cfound,å3s *A* or:& i ! úis not specifiedn  , Ü  Ð ð unknown, raises http.client.ResponseNotyJ 5'''"ifVW Ü _  R z> £ .ª@all(¿)ý 	~ ³isinstance(7 ,‰/  vhasattr §'__iter__'N Ö F d ?els«”', '.join\ ËsÌj 2"""¸P list²? ,ÄÅ) tuples."""„ f3á  x – .ë ƒ.items()À ô# We override IOBase.53 so¨tûòcheck for closed-nessm ; t 
�  &- 0# FD óompatibility with old-style urllib r�N g =infs%4an ) u õclass mimetools.Message containing�Pmeta-b ármation associæ£  P 7URL&AWhenA`methodØAHTTPU3se |ˆSthoseï7x  W ‘server atN  8 Á ðretrieved HTML p½ x(includ½ áContent-LengthŒ _Type)µ F´ $a 2 E  ‡ ¥er will be° ðpresent if (as is now usual) tóhe server passed back a file
  õ#length in response to the FTP retrieval request. A; ñContent-Type header will be present ifL `MIME t( Vcan b 0gue› %.
V AWhen4 ðmethod is local-· ,’ Surnedq sr fincludW “a Date reˆ 1ingT  D õ	's last-modified time, a‚ Ø L0giv?  ; @ siz+ Tnd a '  ÿ < pcontain1 !a Ý 8 at{  ‘. See alsi< Òdescription o8÷mimetools module(5''': Âreturn self.‰sQPdef g  l( %):3 @'''R l„real URLx 8pagl áIn some cases,Ï DHTTP_ð redirects a cliø¥to anotherr ñURL. The urlopen() funcï õhandles this transparently, but inG ‰ ˆ Àcaller needsº¡know whichÐ  É“ 5wasE ²  þo– '#) x©  u9 toFÊiF  Ý s Xœ2url% ˜Ocode™g`tatus . ¡ that was _Awith½,ã tor None‚ Ý¡is not an W ´ s} q

class9 QConne¸:Î á_http_vsn = 11‚  €_str = 'r R/1.1'3 ° _W =Y R‚B Òdefault_port   Q_PORT Pauto_E r  âdebuglevel = 0e @¼ "icÑ& ÷f _is_textIO(stream°"""Test whe¼-À-like object� a @ Ò or a binary J .e  5""" ž£isinstancex a, io.TŠ _Base)µ 
@get_]Bent_´c(body,¯
Ä "Get1 -1 0 baÍoó > O!IfH   ã  ;0, wBtês: 0 fory  ´•at expectó !a I Â(RFC 7230, S2£ 3.3.2). Ws« Nd  a M #nym Í] io ^‰or bytes§2andíï™"if§ !is+ Â0# dÄ Ú °licit check™ X  !A her/µdistinguish¶ D  between uné  •    ÓYempty. #ifç €.upper()–ú_METHODS_EXPECTING_BODY¬  l fÀ 0
         «   else:
  Åreturn None
 ú	if hasattr(body, 'read')? õ# file-like object.B  f [ <tryF ðdoes it implement the buffer protocol (bytes,  qarray,  ))?u ñ mv = memoryviewÀ )" — @mv.nL s úexcept TypeError¨ Ipass"¡isinstancee [, str"k 1len# )@  wðdef __init__(self, host, port=( õ, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,Ñ  … ãsource_addressN çblocksize=8192º  ~ .l $ =v V  
R : =  
- j 5 =  
#  Ó " =‡³ 1   i _J= []3 ¯__response9 P_stat ‹_CS_IDLE? omethod< ptunnel_‚! 
 �! 
Æheaders = {}þá.^ ,æ  H )F�elf._get{   (&   ?�validate- T ( ô# This is stored as an ¹õ variable to allow unit)p# tests preplace¨±with a suit< emockup5 œ 0creš  connectionÞ ¸  Bset_|Ï  QÄ´‘"""Set up6A and9ò for HTTP CONNECT ^ Rling.w  nWIn a « Ÿthat uses< Aing,¢ š  ed"5the°constructor}#us{ Ï¡xy server g `relays~¡ communica0%toO  ‡endpointr `/"`.ê`done bb Pndingí ÿ J srequest¸ 
— Awhená Pis esïWished;`Kñmust be called beforeJ  „ a…has been˜ ] #e ñQ arguPshoul^ p a mappç ‚of extra°3 uto sende ¹ L·6""""if� œ
�raise Run&,’("Can't s…f~Ú "¥13 Ë
_ü > È   ¼uÀ:
          ó
  self._tunnel_headers = 
 #
  Uelse:   9 ‘.clear()
* ðdef _get_hostport(4  ,   ,  )S !if { is Nonl i’ áost.rfind(':')b  ˆ   j  0]')  ù# ipv6 addresses have [...]D †if i > j“ ? n   try    Ã p = int(Ô j[i+1:]š  ' ÿexcept ValueErrorN !ifF ð == "": # http://foo.com:/ 
 /È  r  ¡  w�.default_ 1 ãG   ñraise InvalidURL("nonnumericº—: '%s'" %Æ  (­:[:i‚�  ° " =¨Ä <B and  0](6'[' "-1 .]'€— R1:-1]Âù aeturn â¶  ßãset_debuglevelà Û& 1 = " F ? 8 ðconnect = b"CONNECT %s:%d HTTP/1.0\r\nr(Ñp T |ò.encode("ascii"),N#  bªúC = [� ¦3for0, vÏ: inL > w.items(Í  K ¢append(f"{ A}: {O }Ñ ¯ �latin-1")ž .C !b"2   ð# Making a single sk ð) call instead of one per line  euragesIQ# theL÷ OS to use a more optimal packet size[ C ópotentially emittš Peries†  sm— H %s.: Â¹ ’b"".join(*s3del�sK c„response2 a_classbá.sock, method=k _ G (version, 9 - ”ssage) = R Ô._read_statusó ƒ !if5 1 !=¼.­S& :.OK{} fclose(|  D n!OS/A(f"T  ‘Ðion failed: {¡ Q} {me¢ ¦.strip()}"Q ›while TruVûÑ 0fp.Ó   Ö(_MAXLINE + 1J  › pif len(& D) > ) 
Ù  ) Ä ÒLineTooLong("Åt   - aif not J  # yñsites which EOF withoutáX trrG Y   Ubreak À    if line ó in (b'\r\n', b' ['):
  ibreak
 þif self.debuglevel > 0; òprint('header:', line.decode())U Àdef connect(V ƒ B"""C õ  to the host and port specified in __init__."""® ósys.audit("http.client.p !",È  .\   ^ )E  ì asock =0 “._create_G Eion(-  >È P  Ò .O [ stimeout æsource_addresss À# Might failÝ õOSs that don't implement TCP_NODELAYƒ ;tryŒ†  Â @.set @opt( óet.IPPROTO_TCP,  V 6, 1— úexcept OSError as ej áif e.errno != 	 A.ENOb :OPT-  +Rraise	  Z€_tunnel_”
5 Ë  (CAloseyA  <®NºHTTP server6 ñÿ__state = _CS_IDLEa 7  * Ô :ockÇ   Ë  / y = None6 ! Pock.cÁ q()   #  ð  it manually...Ü õre may be other refsN 0fin+ 
€ presponsß ‡ $__ 8  ‚ 4if  
@   9 Æ A Ê î ÷Asend³j, data¹`Send ` '°«¢ ` ``` caný ö	a string object, a bytes vn array L “file-like o0sup½ðs a .read() method,  ”n iterabl6 .P  † ×í!isî
P" šauto_open oÅ(”  ;els‰  \C NotE$ed1  r Å	Á"¨�:", repr(’) ’if hasatt 0, "(:") Á n  – r `Ing a N  ()c"u  *  enGv¢_is_textIO¡ { +  –.  ;·ö 	 3 ˆ e  R 0 us «iso-8859-1’ zwhile 1ù  M  3"blA  Kˆ  JsizeÝ  6 aif not& X  & Ÿ 
  ò 5 À          daÃtablock = da û.encode("iso-8859-1")
  ösys.audit("http.client.send", self,S ?  �elf.sock2 Eall(€ 
- ereturn w E Etry:?  Å  œ { 1 úexcept TypeError> Ñif isinstanceµ ú, collections.abc.Iterable);  } �for d in  #    �  ! Nelse; Vraise¶  ("Qù should be a bytes-like object " \  ƒ"or an iÒ ò , got %r" % typ1))
H Àdef _output(Å 7, sò"""Add a line of * ò to the current request buffer.Z  – ÁAssumes that2 H ñdoes *not* end with \\r\\n.”  : &""è  ˜ #._] ˆappend(sÀ Pread_  ÁÇ  Î !ifäú .debuglevel > 0–pprint("`Ing a H  ()Y Qn" =P °_is_textIO(.  , ý3if . 2and0 € 3 °ing file us Û wh! ;Tru^ I&• .	 . Fsize©  vaif notè" 
 " Ubreak¦  á - …  «Vyield… O© —
®ómessage_body=None,oØ_chunked=FalsÖ@"""SwÁ#ly»%edÌ ®Qclear¸}‹  ö A‡shSextraÁ0  +   (A © @ mayß specified,8  ðV  ed    Y0ext¦(b"", b"")Ùòmsg = b"\r\n".joinR) 2del¡ 5[:]ê„ C(msg| Ù *ifÚ !isB Š:. * p# creatÕpconsist;�interfaceó $z  < ¸if hasattr($ 0, 'Ó'ä .   Q# Let>=ñtake precedence over] y.  Thist F  Ð 2eed“Qallowú@posiD mmap'edE   Åsá 0be ‰ æn into accountÞ s   »s_ðread_readable(me×ssage_body)
  Yelse:   >try   ð
# this is solely to check	 –see if mem Z E ÿ!implements the buffer API.  it /would/ be easierG  } Qapturx  PyObject_C‘ BT ¿was exposedE Python.! ¸memoryview(Ù 
F Ö ÿexcept TypeErrorAZ C ßchunks = itero  0 s  * Vraiseœ (("Ì 0 shp oïa bytes-like " O  !"oza or an¾ Ïable, got %rH j% typeú j ´ ”  Ÿ#e � eÏinterface an0canÿpassed directly into socket methods"Ç	É 9,)
. Afor * 2 in	 s3bif not   ó ÿif self.debuglevel > 0,  0 òprint('Zero length^ ž ignored'p 7 ŠcontinueÄ   ¡if encode_Î  edY” ÿ _http_vsn == 11• #€ "edG 9ing' c   ] ¡ = f'{len( ¢):X}\r\n'.‚ ²('ascii') +U / \L  P A+ b'< " OCsende 
ó ï )R# endš Ÿed transfÝ � 0b'0¤   '?ð def putrequest(, ,Žý, url, skip_host=False,á "  $  ac²_<2ing/ )¦@"""S± #a n  å °vserver.`°' specifiesEHTTP; " Æ, e.g. 'GET'pH`url<  d ÅTbeingE $ed@ ¸/index.htmlH û '‰‘True doesD÷add automatically a 'Host:' head‰`H S nn!'Ab -E >ingj 6"""F#µ ða prior response has been co6töthen forget about itOÀ__response a÷nd self.__response.isclosed():
  ( • = None

%  # in certa ÷*ases, we cannot issue another request on this connection.P  ¶occurs when‘ `#   1)_ 0arex ô	the process of sending aj ÷.   (_CS_REQ_STARTED)k A  2). ä to a previousE ð has signalled that iÛ i goingO    D K � â Ì upon compleò A  3)/ ±headers for ‹ ¢ Phave Zü been read, thus† ƒ�determineM‡úpoint (2) is true'7ENT$Y  if•  z�s no prioÔš  ‡  enœ ca™ êwat willß
P ‹ G  8  ï Apassy€e socketd7theK ÈP (effSð vely meaning, "ø eï ¸ w"), andL y Âopen a new o; Åis madeÛ �Note: ifO'v existsç ³*can* startp a Y �0We ø þPallowÐo begin fetchü v"toi7newá O g ò, however, untilà
Ü 9ºð i{P�state == uFIDLE½ v N& % š£ Jelse9 qraise CURSendRJ(Q )• òvalidate_method( ' 0# SO 3  y”use laterbOFphasve 9 "= 	 „ `url =  eor '/'Þ 8 � ‡path(url˜ ›q = '%s  C' % Á ,U ,ÂÇhttp_vsn_strB d coutput%sencode_\ ( )5 ÇU  É*11Š1# IÔ@some·hndard ¹0bet=‚HTTP/1.1ôViance !ifÉšskip_hosth  " #¾]  …O�d *only*­f ^ 8   #^ðs. more specifically‚ ÃBeansÏC   h Äd> ·Ðe client uses $;   ™ Càð() class. backwards-R#atO Á ½   #:` be usÙ Q @/1.0®T thosŠ  ˆ6y b™ >   #»  < ð this header theûmselves. we should NOT issue
  ÿ## it twice; some web servers (such as Apache) barfC  ÿwhen they see two Host: headers
3   IfŸ ðneed a non-standard port,include� i[ C  ^ P.  If} ÿ request is going through a proxy,D  1but< bhost oH íactual URL, no  F  _ .ç ½netloc = ''6 ýif url.startswith('http'):+  ³Rnil, P ",   @il =I ®split(url)‡ #if: [ ?try x Ã 0_enÇ € ÿ.encode("ascii")°  except Uni, E2 _Errork #Oidnaj ‚self.put ('{', ¹ ¡ Oelseˆ 1if P €_tunnel_*    . =2  1  Ü1   1 ¦  K |   C  )  ` t     & 
 `  J0 =  E \ g ýâ ô# As per RFC 273, IPv6 address °be wrapped k? []M Ê us–sÅÄ5"ifïfind(':') >= 00á ab'[' +?  o+ b']'g  ¹# =k€default_ m Èe t®   0.deá Z � ´"%s:%s" % (š ,)É#Œ e:6’are assumåð at clients will( á attempt to seÃsü#” #  ßòs since *this* library must deal6/thD @cons| ncv C ñ also means that Xpthe sup·9ing‚� z @ies å pupdatedÆ ðrecognize other forms,¼ Ðis
          B  #  òcode should be changed (removed or updated).

4  ð&# we only want a Content-Encoding of "identity" since4 [don'tK “support e< ðs such as x-gzipˆ ©x-deflate.= ôif not skip_accept_F :)  · ñself.putheader('A1 ³ D', '² /')ð  Bcan e õ "chunked" TransferG ùs, but no others‡ p# NOTE: 2TE ‰   implies *Q*\ 
: ¾  TE± ˆ ° pif TE iLp_ ƒd in theu , ðn it must appear# av  Ùsnection: 
�#— 3Con0  Ÿ (TEš Jelse—á# For HTTP/1.0• ð server will assume "åë "¡ Bpass«Bdef ý e_request(� #,  ){ ö# ASCII also helps prevent CVE-2019-9740ì dreturnK .e„e('asciiã ‚ @vali3s_methodƒ  ‚ C"""V* 2 a  Ó name for putµ 6.""ñ #¦ Chttp�B inj¡ómatch = _contains_disallowed˜ ò_pchar_re.search(ƒ )D 1if G 5 Cõraise ValueError(0    "f"N s can't †  0rolh¢racters. {* F!r} è H   ñf"(found at least {˜ Ó.group()!r})"®
�Cpath?url|?urltPŽ m=urlj � 7g	!InMŸURL(f"URLO?urlL P U'%hoW  V  0 soaOdoes
åqV18348Œr � Ús! ^ t@©Æ-@, *v~sz Se"Ÿðline to the server.

   ò!For example: h.putheader('Accept', 'text/html')
6 U  """ õif self.__state != _CS_REQ_STARTED:,  @ òraise CannotSendHr %)
& ²if hasattr(� º, 'encode')L  2 = 	 .& Š('ascii'S ânot _is_legal_1 S_namee [ § óValueError('Invalidl  ; s %r' % B ',)r v: ’s = list( A±for i, one_ Ô in enumerate. 
ì 7  iY fs[i] =i #wlatin-1Õ 4 ÷elif isinstance(j ;int# 1 e 6str1 )j � 8 !if�)il�N ÿ ?[i]p  —C ˜  ›ó = b'\r\n\t'.joinw ¤#]± + b': ' + W ¯þcoutput
rdef endI  s() ò	, message_body=None, *, ºç_chunked=Falseÿ €"""IndicaÔthat the lastŽ@line6Ñ been sent to& vserver._°This method) !ds' lreques6 é  The optional¼  Pargumq °can be used} dpass a4  ð ð associated withz H ‚ . f	=f l“, 5ENT` Jelsed^œ  ³  W Ssend_ñÏÇ
Öì  �a, url,(90={}$¸  ‰   
^ 4 `P a coâ3te w  ž Ahá - (+ž ,usð á _$C  V  úç I —Q# Hon§„plicitlyÆ Òed Host: and ° -E'Ding:£ NMò —ðfrozenset(k.lower() –k‹, s@skip6 %{}†–if 'host'1 ] ¼  ¥:  [' _/  �1F al-Ï?ingQ : _: \ ]  w Õ‡Àt(method, urãl, **skips)

  ÷.# chunked encoding will happen if HTTP/1.1 is used and eitherF òthe caller passesP #e__ �=True or ) —followingA ÷conditions hold: ÷1. content-length has not been explicitly set8 !2.n @body½ Qa fil„ Ñiterable, butI Pa strŸ §bytes-likeI Ô3. Transfer-E' „ ?NOT„ 1 byz mJif 'Ê '~ ö in header_namesü  ¥b# only§ Ì f6 
ø å for backwards½ B ðcompatibility, assumë �±client code&Ãlready handl$ N  2¾ e  Ü t%Lß  < #h
B canâ� automatiNùy determined, fallœ M  2 to3Ú+ § £v = Falsù N   š _}Ê= self._get_ (Ÿ�, method)o $ifÈK zis Noneñ s   #ifïì) - – ïdebuglevel > 0Y  0   �print('Un 1\á size of %r' %‡ Ï  C   F ëý  *   ¦ 2putñ-('YC', '5'u ?els/Y C3L3 ',â(°)` X × Ù  pµhdr, value Äšs.items()}Ÿ : „ Óif isinstanceL;strI à# RFC 2616 Sec2ñ 3.7.1 says that text default,a¶  ƒ# pcharsetê¹iso-8859-1.-  ÓB = _– ' žÝ 2endÕs& 3 
 „ðdef getresponse(J ñ a"""GetM# Q from vserver.`!If  ²CConn is�ëõ	orrect state, returns anò i~  G R˜  ð of whatever objI #isE Ued byF  l ¯ °_class varig
® ‚a reques¦ð@en s‘ or�a previouj $ Òk 4 ® ± ðNotReady is raised.ó   If the HTTP
  ñresponse indicates that) ðconnection should be closed,! nF vit will  p before&  c ðs returned.  When  E o (ish õ underlying socket ! .? E"""
 Æ# if a prior� ôhas been completÈ ö forget about itU ¥if self.__Æ <and 2.is5():ƒ  a< o= None§ bexistsc� it must[¶ õ  (otherwise, wes ð# cannot read thiqàò's header to determin x-Æ O –behavior) 
 o note:iÂ  ^Œbut was d Ý (th½ Ü an�were mad¡ ependent oÊ!isËC¦› ð
object since a new requesDquirèð we open a whole* G ·  
 b@mean5enQd one­ Pwo st^ a#   1)8_x:P t :0resšnÐc )�  p	 DioperatB)ly: Ð2) persistentˆ e5 ¿�retained œpwe awai)sF 	~ &  ü  us{¶become truef#G p/ü != _CS_REQ_SENT or|Q  sraise RÕ“NotReady(ˆT )n ëdebuglevel > 0R L " =z Vb_classZ  �, K ,Õ  ™  rmethod=¨  tOelse• %L Y š :tryY   ¸ ó v.begin(™   vexcept †ZErrorV  ( Û èA   ·–   Passer­¿._'yUNKNOWN3 b !__å 8FIDLEï X %ifÚT ¯ #�0eff`vely p” ê¤ toÅU 	’  q – ø Ö / €# rememb© his, so weØp tell w6 | TÅs ²Àponse = respwonse

  ±return resp  {except:, % Š.close()  ai\ 2try5 ²import ssl
L ! I RError# ’pass
else ðclass HTTPSConnection(  )+  ¦ b"This 5 ðallows communica: ¦ via SSL."ò �default_› =l V_PORT# ò# XXX Should key_file and cert öbe deprecated in favour of context?Q ð
def __init__(self, host, … e=None,h  j  	h û  ÿtimeout=socket._GLOBAL_DEFAULT_TIMEOUT,= âsource_addressg 4 *,¿  ; `check_Ã Bname* ÷  blocksize=8192¦ « QsuperÉÙ , %). R #, Ü ½  T  
Ú B !Ì 
 
ëEif (pis not È7 or%
 L:   O 6 F ò U�warningsU  .	 $("¥ ,— Ê	Ãm are "L  p  "ñä, use a custom3¯ instead."tD;BionWÉ :, 2b .¾ % = 	¥ % +& =å 	' i• ] ¨Dà ¶  =°”._create_.chttps_$ ÷ B ð# send ALPN extension to ind�eiÙ/1.1 protocol¢  D !if ._m ®_vsn == 11«  - ‹ ¤.set_alpn_W @s(['A  l *']T 9 ð	# enable PHA for TLS 1.3Åq s if avail) ¨ ~ ðpost_handshake_authb» = i= Trues °will_verifyá]. r_mode !´™CERT_NONE?  ü
ì!is«� ˆ= Ê. _  ^ ¸ k r+a Value*("d q needs ¾‡ _ with¦±   "either ðOPTIONAL or CERT×_REQUIRED")
  ñif key_file or cert :&  1 Ñcontext.load_( achain(  @ ,J 
c  = #Z @ and%  / ý means the user wants to authenticate.‡ ð# enable TLS 1.3 PHA implicitly even fË custom · sJ $if ð.post_handshake_‚ Î is not None Ô Z = i= True½ cself._5 $ =| 	$  “ ßheck_hostname† 	S *.c: *=  
j !deú Pnect(C )à @"Con Œ Š € on a gi[Æ(SSL) port."S  ’super().c? *() 0if m �._tunnelã 
y E Qerver  =5 È  0 ?elsŸ sF  Ì 
• ’ Tsock i ¡`.wrap_ e%. ,|  €  Œ = &ó__all__.append("HTTPS‰Ðion")

class  ¥Exception(
 ÄQ# Sub) e[õat define an __init__ must call ? . á #9 "òargs.  Otherwise, str() will fail^Dpass¨ 3Not¿ 9ed(µ « - ¯InvalidURL+ ÿ UnknownProtocol0  áÑ â“, version|  ¶Ù $ = ß 4   Ü „ ÿTransferEncodingŒ ç  Un©ÿ ementedFileMode6 ßIncompleteReaLñ  ðpartial, expected=Ê - þ 3 = 
 
 Y % =d ! � arepr__~u < fåe = ', %i moreb 2' %B s  ³ 
C '! ðreturn '%s(%i bytes read%s)V « 1.__>P__.__�&__ f  	2lenE /B), eó__str__ = object. QƒImproper2ionStatøCannotSendRequest(J ÀectionState)þ,:
    pass

class CannotSendHeader(ImproperConnectionState); ÿResponseNotReady; 0BadV ðusLine(HTTPExcepn i ôdef __init__(self, lin‡  Æ aif not œ      ( € = repr( )õ    H q.args =8 ,  -     TooLong§ H_typ¬ 	â .Ø õ"got more than %d bytes when reading %s"­  Ë  ²% (_MAXLINE3Œ )Ò ¢RemoteDiscá6ed(ëÉResetError, ¤–£*pos, **kw$  š 	< ð "’{ 0 b ð

# for backwards compatibility
e» 9 = pP
r""" Ð cookie handlU K ð	web clients.

This modul' ó"s (now fairly distant) origins in Gisle Aas' Perl; 
n 1::Co ðs, from the libwww-p+ ðlibrary.

Docstrings,Ð mŒ ³ and debug   o tŸ Ðcode refer toW €
attribu5 of ï €system a-  -/ ,B  Ø ðinguish
them cleañ · vPython 4 A.

C;pdiagram$t¼rt BSDDB÷ 1JarÄ  ÷ aMSIE* q`es areº
x · ad with¹ o  j@dard2 &Q, but: ‘availableVÿ
http://wwwsearch.sf.net/):
0¡ O____& /É! \ ) \' EFileE !  	(  D 4|  G 
 ¦\
 MozillaI V| LWP { g  S 
   
¦  0---ƒSBase + Ò , ²  & , -  ,  X ó

e ,|/  C ö ò

"""

__all__ = [' 3', 
 6Jar `Policy rDefault.  l '· 3 o 1oadþ  ŸÔ']

import os
 Dcopy „datetime r
  ãurllib.parse,  trequest: $th÷Eas _   ô.´�  # only kd ­ Ð
from calendaðr import timegm

debug = False   # set to True qenable ( ñging via the log pmodule
 �er = NoneX 1f _5 ò(*args):
    if notN    areturn! aglobal] !er 3 ` 4 È   1ing*  K   ‡  	 ñing.getLogger("http.cookiejar")5 | q .² ñ

HTTPONLY_ATTR = " Fnly" `PREFIX ð#HttpOnly_"
DEFAULT_1 Â_PORT = str(ƒ elient. ð)
NETSCAPE_MAGIC_RGQ ðre.compile("#( Netscape)? : ! CÉ ð File")
MISSING_FILENAME_TEXu ñ("a filename wasÑsupplied (nor  ÑQ QJar " O ÷"instance initialised with one)"Ì dHEADER‰ u """\
#Ç Å 0
# ò://curl.haxx.se/rfc/´ñ_spec.html
# This is a generatedè Q!  Doå £edit.

"""Žó
warn_unhandled_exception(œ U Pere a ò  few catch-all - ð: statements in t…  B, fo°#7  +ðinput that's bad4 punexpec° °ways.  Warn1anyx#n Aions� PcaughH Aere.# ý@io, Ö ñ ings, traceback# òf = io.StringIO(î$ `.print(±2, f!  msf7Svalue8 f .	 Jð bug!\n%s" % msg,'ðcklevel=2)


# Date/uÿ  conversion
# - 9°

EPOCH_YEA® 1970
def _x Sgm(ttêðyear, month, mday, hou ñin, sec = tt[:6]KPif ((4 F >= c ²) and (1 <=L  	 )12 0day !31 N  S (0  t   !24   0min (59  ” c<= 61)Ã  F »Þ ` Felse'$  äð

DAYS = ["Mon", "Tue 0Wed 0Thu 0Fri 1Sat ¢un"]
MONTH; !Ja; 0Feb 0Mar !Ap 0May QJun",Œ  ¦ `  "Jul 0Aug 0Sep !Oca 0Nov 5Dech P_LOWEÂc[]
for]2in ‡ : ' �.append(Î’.lower())ó €2isoz(t=<A"""Rr  a• ª�represent  7  « seconds siðpepoch, T × !If@funcE ŒCcall°out an argu.Ñ, it will use8 qcurrent& p !.
 0TheIRmat oa Á$edª óis like "YYYY-MM-DD hh:mm:ssZw	Î ÐUniversal Timñ<e (UTC, aka GMT).  An example of this format is:

    1994-11-24 08:49:37Z
 1""" 0if 0 a None:  8 ådt = datetime.	 �utcnow()( ?els2 @fromG rstamp(t= òreturn "%04d-%02  
 : aZ" % (m • ñ .year, dt.month
 1day 3hou Qinute Ðsecond)

def „ À2netscape(t=ò )ó B"""R‘ ða string represent  ; B in P òs since epoch, t.lI„ñ2e function is called without an argument, it will use the currentî  p V 4TheÖå1e rª $edª `is likE ÷ð
Wed, DD-Mon-YYYY HH:MM:SS;®  u!s,õ@-%s-  ° 
ñDAYS[dt.weekday()]êQMONTH A-1],O=+
ñ
UTC_ZONES = {"GMT":h, "UTC  Z p}

TIME? ò_RE = re.compile(r"^([-+])?(\d\d?):	 P)?$",) aASCII)¬poffset_;B_tz_”3(tz° ! =˜ ã  Çz£¾ Ú û . 0+ 
¸Gm = ³ p.searchk -  @ Fif mN   R ò3600 * int(m.group(2)â (    >  3¿    K 	 <+ 6R 3R š1) == '-'   ] P 2= -
 Ï <  k ]2q(Dðmon, yr, hr, min,õ%, {Ayr =ð "yrè vif yr >.vMAXYEAR’ u  p|Á# translate ªñ  name to number« #  `s star3Òth 1 (Januaryƒ 6tryn bmon = ñ_LOWER.index(mon.lower())+1d öexcept ValueErrorG ø# maybe it's already a¡  e	z   i "onŸ   j   #    �if 1 <= S V<= 12ž    j 1monÌ   
Û  Y '  Ø ðke sure clock ele’Ñs are defined+ Pif hrÇ º: "= C Ôiâ  mit 6sec7    8 S 3day?#da½hQhQM ðint(min)
    secñ = int(sec)

    if yr < 1000:   õ# find "obvious" year ðcur_yr = time.local
 ( . e())[0]0 Cm = 4 %i  vtmp = yZ V Dyr +0 5- m.  G um - tmp ×if abs(m) > 5Á  Å �if m > 0:â  g ) +~  $ Felse  -  ] Ñ# convert UTCé ñ tuple to seconds since epoch (not' ázone-adjusted)L Pt = _ðgm((yr, mon, day, h 0in,T V, tz)—Pt is V HNone›] m a using  x € string,¥ 0getQolute! ¯ —   Pif tzi 
e   ¥tz = "UTC".  ’tz.upper(Ý  + Poffseæ 	 ’_from_tz_� 6(tz+ 2if % u preturn Ž v  j# -8 ·( ñt

STRICT_DATE_RE = re.compile(C âr"^[SMTWF][a-z ò, (\d\d) ([JFMASOND # ") ó !r"& *  : ) p GMT$",s ïASCII)
WEEKDAYŠ ñ(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat) b*,?\s*W 7I |^ ¯LOOSE_HTTPð 
1""^ú ¬  ?)¢ #w ò    (?:\s+|[-\/]¢I(\w+0 0  #®$th4 5 d5 1&(?¼s :e ô	# separator before clockl À mµ # hour:min" #?:  )?ã  # optionalQ ¥*   !  * 	t 1\s*3 · ð([-+]?\d{2,4}|(?![APap][Mm]\b)[A-ZXA+) #h ‰C 4   N !)? U \k\” !# B° representaÈ 5 ofT ± in parens.M 	_ 2$""1X1�def http2~b(text)ŽA"""Rks`  \ Ö – sed by ai.�J ` value× aneCeger!  Ï  ¶ edv the formatå 0str! àunrecognized, #  ¹   qoutsideú   (Õble range, or4  †¦  ?  H[ P.  If+ O ¦ ð@taint B ,þ£is assumedÐ "ThS #  ; ‘ F ðmay be numerical (like "-0800"¢ €"+0100") a�  ë R 3  {Ò, "GMT", "BST? õEST").  Currently, onlyÏ G ’ às equivalent t÷&o UTC (zero offset) are known to the function.

    T ò  loosely parses/ òollowing formats:8 ðWed, 09 Feb 1994 22:23:32 GMTY £   -- HTTP: o õuesday, 08-Feb-94 14:15:299 ß-- old rfc850B } D Ÿ-- brokenE ¹ À 
¾ Ñ (no weekday)Ë Â @   $--‚ >F Æ  A  Ï M ”  Î½àr ignores lead¿�and trail ²whitespace.±time may beI cabsent$!Ifñyear is given with only 2 digits,& `À will select W ócentury that makeZ tclosest¨Ãcurrent dateˆ 1"""F °# fast exit\Ð strictly con â   !ng/ òm = STRICT_DATE_RE.search(textÍQif m:.  rÒg = m.groups(!   õmon = MONTHS_LOWER.index(g[1].lower()) + 1J òtt = (int(g[2]), mon,  E0]),)  `   3) $ 4 @floaA 65])� €return _ºbgm(tt)™ð# No, we need soØ2essÕSing..N¡# clean up…  0 =   .l>pú   ¡ = WEEKDAY>aub("",, �, 1)  # Uê$ss#Œ  tz2 ¤ ñ  zone specifierµ¡ôyr, hr, min, sec, tz = [None]*7V ¨r regexp­Ã  é`LOOSE_wí — @not Z ùŠ Felse> “ S  0badŸ2mat¸  P_str2(n d)

ISOÆ á = re.compile(ï Qr"""^
 r(\d{4})D  # W  ‘   [-\/]? m(\d\d?. �numerical¤!th+ 9 0day- &(?
á (?:\s+|[-:Tt]!ðseparator before clock9 3   “ !:?	 › ¤# hour:min$ #?:   ] �.\d*)?))?j opÒaopconds (î1fraê!al6 +  %# = ‘ 0\s*w Ô a([-+]?:A:?(:
 )Pq   |Z|z¶ Y  # ãô0 (Zn"˜ d°dian", i.e.õž 3   t @)?$"^`re.X |öò  ASCII)
def iso= —ð ):
    """
    ðAs for http2time, but parses the ISO 8601' ðmats:

    1994-02-03 14:15:29 -0100 ,--7 4  /  ü-- zone is optional5 ( 	 Ë-- only date. T— 2 õ-- Use T as separator7 Å0203T141529Z3  	 Î scompact	<  +  	¡ / 1""" ¡# clean up ptext =  ’.lstrip()j@# tz ž# specifier ) !ngA ðday, mon, yr, hr, min, sec,A ¤= [None]*7V Âloose regexpñH 0m =½ð_DATE_RE.search(™ )! @if m� @not S :  ú P# XXX5ðre's an extra bit of  Ä æ÷I'm ignoring here: isI R  thi�Pright •ng to do?(  ê ó ý ô ò , _ = m.groups(¾ Felse² areturnÇ t  # badÚd  A_str(h r  { q Á)


# HeaderRing
# - 9ñ

def unmatched( )Ò B"""RÑ    ‡ ~@re.M3 „ object.‡ start, end, " r.span(0/f .n![:4 )]+ ð	end:]

HEADER_TOKEN_RE =  0re.<ôile(r"^\s*([^=\s;,]+)")8 °QUOTED_VALU}= = 8 ô=\s*\"([^\"\\]*(?:\\. V)*)\"O H  „ /  O  M  Š *Š _ESCAP„ @\\(.(  ‡qsplit_hñs_words( cvalues˜Pr"""PR    ± into a lis£  �s containAkey,+ r pairs.º€The func$¡ knows howð
eal with ",", ";" and "="ò@well aquotedà] ps after' E.  A� Tspace(Ðed tokens areU0sedM iØyN 8wer0  by‚ µ I(  _x 3pasG „argumentþ £s multiple,,?n l  † Ytreat‡  ƒ da sing; Â €by comma˜ Tf@meanlags^�is usefulö  —ÅRfield7 ÿ @follˆ R °syntax (BNF&@from¼ £ HTTP/1.1 Ã caÆt�we relaxM  zqrequire ¤�)º  MsÚ  2= #� D "    ð= (token | parameðter) *( [";"] (token | parame A)

     ð= 1*<any CHAR except CTLs or seD Stors>A  @ ± = "(" | ") < > #@"6 ,  A| ",$ ; : \ $<"l . 
 @| "/$ !"[ ] ? =l 
{$ } tSP | HTÑquoted-stringh ó= ( <"> *(qdtext | % apair ) )Ú # 9  != ODTEXTO4<">Ô J 0 1"\"~“  t¸! ó	   = attribute "=" value‚  / != ç  ,     Ø ý  òEach header is represented by a list of key/[  rs.  The™ a for a bsimple� P (not•@ a
 Ÿ i ñNone.  Syntactically incorrectM – ps will L ànecessarily beQ òsed as you would want.Ú @Thisj ðeasier to describe with some exa² "s:4 ¢>>> split_} ò%_words(['foo="bar"; port="80,81"; discard, bar=baz']+0[[(5 Ð', 'bar'), (':   <  ? 0', a)], [(1 8 Qz')]]™  ²ø/html; charset="iso-8859-1"� + n  ” 5  — 7 w ùr'Basic realm="\"foo\bar\"r % n 0  l  1  Oj â """Òaassertð³isinstance(�‚bs, strg¢result = [( ‹ è 3 inÖ_4 :e  Qorig_$  =   ÙK  , 0whiÏ6ext@   ðm = HEADER_TOKEN_RE.search(S œ  )   Jif m?    ( ê = unmatched(m6  $ þname = m.group(1" ‰ ÏQUOTED_VALUE� 
 Z ” 3  #ëÉ
 "  ¨  , g­ ' >RESCAP¯ ’ub(r"\1",� ì NelseH U ÿ  5 "un¦x  0 	 , + 3  .rœ.p(ý À    else:
    ÿ
# no value, a lone token
. "  , } = None% òpairs.append((name,1 ))), ùelif text.lstrip().startswith(","):0  � ý$# concatenated headers, as per RFC 2616 section 4.2D  s * =z M[1:]) 1if Ì „: resultÔ  
Ì  œ  J = [J OelseÉ �skip junkx @non_ A, nr	 ñ_chars = re.subn(r"^[=\s;]*", "",Í ’ kassertF m> 0, (u  Â r"split_Vó_words bug: '%s', _%s" %? `(orig__‘ ,?÷ i  $ 4 = é N rcreturn’ò

HEADER_JOIN_ESCAPE_RE*ùcompile(r"([\"\\])")
def joinå c(listsoñ"""Do the inverse (almost) of !co  `d,>by 9!.
Ö PTakesU0ist@ j  	 D(key(± and produc3 csingleäM £Â.  AttributeX�s are quo“if needed� ?>>>ñ  @[[("…�/plain",ÊQ), ("k etXâiso-8859-1")]]_'6 #; , '="* 'ª v O], [x ,x y 1""" Ä 4�3forg1in †•Jattr¹ . rk, v in6 -  À if Qs not:
 "    ±Pearch³ƒ\w+$", vi '  Ov = Ï ôq(r"\\\1? Á  # escape "5\ó L    P ­'"%s"' % v# �k = "%s=Ð  (î ã <    ók 0if  :™êP"; ".[( õ® N ˜!)
Šø_º s(Z3'"'  œ  , Ä»5 2endC3 2:-1¥   O ’ ƒparse_ns &s(  ¡"""Ad-hoc ,  r ,2Net‘ðprotocol cookie-«s�…The old 2 )  F 0mat a Set-C? A can €instanceÿ2taišQan un=Pd ","¬ ·ðexpires field, so we have toñ, use this ad-hoc
    parser instead of split_header_words.
+ PXXX T? °may not makQ ò
e best possible effort to] Ñ all the crapI òthat Netscape Cookie q ñs contain.  Ronald Tschalar's HTTPClientH ¼ ñs probably better, so could do worù Ñan following „ !ifH óever gives any troubleû ¢Currently,A D0lsoRQd forê  W ¡RFC 2109 cÖ ;1"""j ðknown_attrs = ("expires", "domain
 @path �secure",:  ¬ %# j N (•¦turn up in_‰ o, too)K r"versio{ 0ort{ ’max-age")ú±result = []B  ò #ns$ n  !s:!  ª 1paiæ 4   j 0_seM RFalsea   §# XXX: The§Adoeslð strictly adhere^@RFCs} ËUempty| Q# namÊ`d valu  re legal (�àformer will onX áppear once and P ñbe overwritten if multiple occcf ’present)..'isG 0mosÅ ðto deal with backwardüÅmpatibility.7  o0ii,e amò ¥enumerate(y.·f(';'))„ Xrparam => .H#p(Ø    �key, sep,-+ Úpartition('=';Ÿkey = keyP !if´:key‹  l ®if ii == 0    Ubreakû     Oelse0  07inuI 0 #v!owœ�a distincÌ  "Sween ¦ì=
 ymissing€  L ‰together Pval =3 @sep ® K Non• û !û #lcQjlower(o Ò Pif lcýD�&lc[ @    if´ }õC #»6 anjK˜ S   if	" i® ü Z  0 8Š¾_quotes(való , �3ITrueƒ # 'elØ eR~ #_Svert ( A datM seconds si]epochi  m è ­http2time(ò A)  #( 9yinvalidv D‘.append((§ *¿1if % 
ð i�àversion_set:
   øpairs.append(("version", "0"))
- dresult, 9 !)
" rreturn ! ð


IPV4_RE = re.compile(r"\.\d+$", ñ	ASCII)
def is_HDN(text):P B"""RS €True if  ñ is a host domain name."""5 S# XXX
 ðThis may well be wrong.  Which RFCM ð HDN defined in,h ƒany (forH ñ the purposes of: c2965)?" 1For% ó+current implementation, what about IPv6?  Remember to lookI ³ at other ul FAalso� Áchange this.6 3if % x.searchE »™TFalse2 KR== ""m( 	@[0] + 0." è dext[-1 ? x  ¾
ä±¿_match(A, Bê* # Aä-3 #es Ð B, accordingB Ë ‘.ŠqA and Bü-be-sÇ ÃIP addresses7 F P, sec¹2 1:Q Ho hPs canKÁspecified ei°fas an V  d  a ]bstring¬ÐSometimes we care on¤  b � with anƒ.  (Such+ ±isons SHALLÈñbe case-insensitive.)  ® 1A's3B:bB's ifÜ  ú0 * À"ir,ˆ · "s  -­ ™equal; or> AJï ‚0hasW € form NBRere N- ‘non-emptyÌ ‡ "  ´ t I, B C A.B',Y "B'C _ *)o,K 0x.yx!.Y �but not  .Ä0Not[a]7 m  + aˆ muÖqve operàp: a.b.cV € ½; 2es  $, q  N redey½€ ëAE B $Y1es,Uðonly relevant part›"thã#ÔiÇ!of2 ˜   algorithmÝ  “ kdirectï¶ÂA = A.lower(YB = B @if A&B  ß!ifqêAý  *¢r rrfind(Bs @if ia  -1 0l #,!esb Fhaveu"orr å pä ¬~ © €B.starts’O("."± 
3 Ü _B[1:]/ 	ñ ƒliberal_A  Ÿ@ 	Ïsort-of-like¤ žð accepting/blockñing domains.

    """ ñ	if IPV4_RE.search(text):  ) Áreturn False  ò True

def user_^ ³_match(A, BC þ"""For blocking/accept� óA and B may be host² ü names or IP addresseÇ ÑA = A.lower()§ YB = B ñ
if not (liberal_is_HDN(A){  #B)Á  –if A == B  y# equal˜ |     +     P±initial_dot³ âstartswith("."Í 8if '  +RA.end' l_ ž  õ > Ï – 7  ¦ ð
cut_port_re = re.compile(r":\d+$", aASCII)€request_Ç( PB"""RS -% ó	, as defined by RFC 2965®àVariation from ": £ Áed value is ÿñcased, for convenient– µ carisonV 1url× ´ Ó.get_full_urlL ¢ ñ = urllib.parse.url	 �(url)[1]c "ifºV== ""-@ ñ b òheader("Host", "")˜�# remove p”, if presÃ I ��.sub("",x 2, 10 ™Ceff_‡ �„a tuple ¾¦£effective F  £)VAÉ@, exú— both are®9 �Berhn�£  Oq1req( Q.find3 Ü!-1Ö ñà0 � %r ’+ ".local$r°i  , 0 üT_path+Y €"""Path w…onent of6?URIó—p)˜ Qsplit˜$ œ ’ = escapeª : . 0&  .€#/"Í  &�# fix bad€ñ 2396 absoluteURIk  '  E � = "/" +   D Š:;ort:æ" . D 2i =Óê5':'½ fi >= 0q =- R[i+1:ž ž 6try'   @int(/ L   ©VWZError1 ñ_debug("nonnumeric¬�: '%s'", M  Q ü 2NonBFelseT  } ñ = DEFAULT_HTTP_PORTó ;  $ ð

# Characters iniðto A-Z, a-z, 0-9, '_', '.', and 'ò-' that don't
# need to be escap ðform a valid HTTP URL (RFCs 2396 and 1738).
 ð_PATH_SAFE = "%/;:@&=+$,!~*'()"
ESCAPED_CHAR_R% ÷re.compile(r"%([0-9a-fA-F] ó)")
def uppercase_¤ ñ_char(match):
    return "%%%s" %  ¡.group(1).B (N D `_path( B A"""Er any iný  i •acters in,U  — C all?Qs."""’ ð# There's no knowing w|T a encod Ras us}`creatersI pcontain) "%-¿ ðs, but since we haveÈqpick on * Ë L  ò  ‚  s,= 5 ðUTF-8, as recommendedõ Ãthe HTML 4.0E Òspecification�ð"# http://www.w3.org/TR/REC-html40/appendix/notes. ƒ#h-B.2.1W @And 4ð, kind of: draft-fiel(€-uri-rfc„cbis-03: (; "in/ Z IRI £  ø -duerst-iri-05)< w �for new UA òchemes: RFC 27180 @ñ= urllib.parse.quoteL,#	4 U.sub(D	Û , g = Ú  
dreach(ùB"""Rü ¡ of host hË¢defined byÇ €965, sec¸A 1.
BThe = R? aA ¤name H is E ²as follows:9 …   *  If R   - 5  6‰ qdomain O 2of ^ ;A,8 @has 9 €1A.B' &  A & €no embed¤(Òÿis, interior) dots> B> �at least*H �dot, or Bõ  ‡ 0strt�"local".- m Athen­ ;"ofø #.BV¯Otherwise,,  H+ 2>>>� (">1acm"$'. '‚ .  *  ) Ç U  ']´Ói = h.find(".U ’if i >= 0è ü  #a( ð[:i]  # this line7AonlyÄ �Bshowó2a iÍ ? b> Qi+1:]Ñ    z bz  °f is_HDN(h)4" (�  ¨Sb == �Å 3   rQ"."+bd  hCóis_third_party(requestD  4 ù	2V3.3.6ýò An unverifiable transa^ isa1rd-i Y Qtfu -k  ´ .PU doe3 £ 9-Ê=¤ ž¶ -8 OªN aorigin’ Àsaction.

  ð  """
    req_host = Auest @(req )% ðif not domain_match! * R, rea  1 „.origin_X 1)):C l ‘turn True Melse óFalse


class Cooki% s"""HTTP !.
D RThis , ñrepresents both Netscape and RFC 2965 cR s? òis deliberately a very simple] ñ.  It just holds attributes !'sŽ ópossible to construct± à instances thaNón't comply with theŸ M  . @dardb “Jar.make_Å   iL óe factory function forv J òobjects -- it dealsr H ð parsing, supplying defaults,>E pnormali)  ß  ­ rav •used in t”#. ‡ ‚Policy i'brespon* « Pcheckv @them] °see whetherñ
y should be accepted from™  ß re[ ed=  š cserveråBNotet  €port mayM 1µ óe headers, but unspecified ("Port2a— !an Q=80",r0exa2R); if acase, y sis Noneš  †Ä ðdef __init__(self,„ñsion, name, value,-  L  V \ _° '  ¼,Ä+   | ial_dot?  `path,  f 
_secur¦ expiresZ  discard  ocommenŽ  O_url8  ?res5 �rfc2109=a7  "):R Z$if c ü µ: �= int(ver¢$7 é 
7  7 cfloat( )>  Í ;  n  y4r   >5 v praise V ‘Error("if9  /  J   mÈb8Vlse")ø  z.× $ =ï u  �! =–
 ¢ 6  Š 
 Ø =•  à #  - $# "e Nfas perØ"seûU3.3.38 ² ü# =ëv.lower(y% { /  V â# Sigh.  We nevHknow´m c givenaA z-G` had a) `itial ‡ 6 0ord…o followð K !(ar«ðin draft errata).  Needed for the retó urned $Domain
  …# value. aself.d% þ _initial_dot =  
5 ppath =   £_specified#  
- ’secure = 	 
 £expires = 
 
 `discarb 
 
 `commenË 
  s_url = #   
' £rfc2109 = 
 
  B_resd €py.copy( )& ð
def has_nonstandard_attr(w…, name):P areturn @ in $ ._ "  L ?getL 	ß, default=NonZ  R P.get( 3 )e se C¸ W [S 2] =f2is_Âdú ,ow¤  if now is ½ : p= time. (¡  È1if G #.e ais not8 [) and  <=M ±  E mATrueú  VFalse½ q__str__s E "if¢Fport¶ ep = ""R aelse:  1:"+) 0   @limi> rc + p +\ 5ath, q  r ô B Å  ƒ# ³= "%s=%s" %  ,[ # T© k H Ÿ  = " ?ñ"<Cookie %s for %s>n  , b !, ã ___repP 0argê%[]d  Q  I  Ð("version", "   b %",1  ·  "i &   / ~ 1 
 3 # " #I   G   E § ù 1 Ï  Ñ  š  ¥~ ¡ 
 m` = get
 Ãw	Ž  |‡.append(4 h , ¯(? &))0	2  òh- /º2 V5 d7 ia%s(%s)]_ °_class__.__¨ @__, $`.join(Ÿ Q))


%  ¥bPolicy.ñ"""Defines which cÈs+á accepted fromQ† Òed to server.!ô May also modifyG Ð, though this¬óprobably a bad ideaB rThe sub© DÀ°  Ô¨ t) FR rulesðNetscape
    and RFC 29ñ665 cookies -- override that if you want a customized policy.

    """ ódef set_ok(self,X ±, request):'  3 °Return trueh Ó(and only if): ó should be accepted from server  P óCurrently, pre-expiredG ðs never get this farì Qthe Cû 5Jar› õclass deletes suchG  itØ w "ú  ƒ òraise NotImplementedError()' rõ "B[ Ted to Ÿ rdomain_K ¦  ÈAfalsÉM¼0notÀS “ed, givenS Z .}	² ,V TrueAMpath    ž A X œ 
3rDefaultRP!( ÿ5"""" s „óstandard rules forï@ing =  ].(5D²ÿStrictNoDots = 1  n* G = 2 òRFC2965Match = 4i+ ·Liberal = 02 k 2 = %  z | r S  ý‚__init__T  9 ‚blocked_Üs=None, allow = �netscape=0P, rfcÙ  =F—,/    u109_as_: p + Rhide_y2P s‚» &  } ó 965_unverifiabl¸ ~ Y *ns. Ø / F=”Ì	 1  » ¡¯ial_dollarÈ 0ns_5  '+ þecure_protocols=("https", "wss")ó ) À"""Construct0rguZsõpassed as keyword a&  P, L   Àñ4 =  … !  $ =G <+  
7 H8 =  
) “Á9 =  + ± 	#9  Àle
        sÿelf.strict_ns_unverifiable =  #
  s= idomain7  1 ùset_initial_dollar=  I 	Mpath?   5 ð ecure_protocols3  
2 ²if blocked_Ê ås is not None:(  _/ ‹= tuple( ); ?elsI )()™ _allow™ ) “  “ Ê  ; =  Ž -de$(A )õ	"""Return the sequence o9  ]R(as a2U)."""&r@  Y .d%  ‡  0h‹ ,Å
œ ?Set™ 	Œ …  V� ´ Ÿ $isº – ö � ;for« O in p ^ |sif user¥r_match(_ ý o  :   ]ATrueL VFalseéÈ Q é M, orYB ò6 à s¦  S ò ” ,¬
¥ òG ™ ½  Æ 	û,ifY Q ´ ! w(sis_not_Q ù öð #ifB( ‘ /isÆ ø 	   ˜
> ˜
 s˜
: ²  s   Œ  ­	#ok�cookie, ri'stY RðIf you override .Lòok(), be sure to call this method.  If it ‡ Š ¬ f)°, so should] ûr subclass (assuming Pwantsi fbe mor€zÒ about which Ø . ‚accept).š € Û ð_debug(" - checkw = ð %s=%s", cookie.namóe, cookie.value)

  dassert öname is not None( ñfor n in "version",  ifiability  @   @path Qdomai+ eport":w  ~ 0fn_0 ë = "set_ok_"+n" ó = getattr(self, 5 )( !if² 2fn(æ ª, request)r  v ·return Falsß  3Tru Cdef – ñ � b $ifG2  J F
… 2# VB  `alwaysj ù to 0 by parse_ns_headers if it's a Netscapeý #v ð, so this must be a±ãvalid RFC 2965, .B ñ_debug("   Set-C*¤2 without Î  †ù ibute (%s=%s)",G  ^$  b  Ûv"  rˆ    ë `.u q> 0 andà @.rfcÉ 
TÂ ê ús are switched off"<ˆ .elÍ,==‹ n�Œ °Œ #¡ ›�¡a.unver; l(ód is_third_party(( @Ÿ›sstrict_¢_d 
# ï³y -y ©Ÿ during "j G  "l � transact¦
í . P
y  õ
á /nsÜ #Ü Uñ A ¦8Q# Try†€stop serž µtœ%V0à€designedÍ¥hack other¼#< òthat know both VåÆV1 protocols£3if ØŒ— ²àinitial_dollar· €  æ` ù `.startkh("$")î¢€illegal 6 " (7  Å '$'): '%s'"î & 
xƒ
t ˜ A˜� / ¢_specifiedmÀ        req_ð path = request_ ( 7)
  ùif ((cookie.version > 0 or' 2 ( ò== 0 and self.strict_ns_ser  )) H 2not2  – ¤_return_ok^   ,º =)):@ °_debug("   , ð attribute %s is ` ´a prefix ofK - "J Ö 1  "G S%s", 
  „ :
2 5 µ e FalseV  QTrue
 @def  ok_domain()e `  žã i1 Ôlf.is_blockedA +  ‡ 
  �in user D V-listÛ ) 
Ó º 
Ï Œ Ÿnot_allow� $ ’” H ” (¢Ç ª_specified'óreq_host, erhn = eff_  U $ = Ì o  î"  ç" ( û.count(".") >= 2³ D ÿ(# XXX This should probably be compared with the Konquer“ B# (kqjar.cpprù Mozilla implementations, but it's aÕ • ílosing battle.! Ci = ã Qrfindã & j&  j, 0, is s Pif j EC:  #\ ß like .foo.ba„ e   tlde m[i+1:]†  ^ s' _j+1:i(  Ò0ld.Þðr() in ("co", "ac 0com 0edu 0org _net",w p   "gov% 0mil  inA"aerV 0biz !ca OcoopJ 1inf5 0jobŸP"mobi> Qmuseu˜ @name p^ ’ QtraveŽ 2eu"%€len(tld)‚2? ? ™_co.ukg  ‘ôry-code second levelépQ~ š  #ifH p.starts-’Ê ƒundotted…<:Oelse? 	aembeddd kts = (u .2 0ñ !if´
D  XÎ != ".local"Ÿ sÀ non-local dÿomain %s contains no embedded dot",
  d< ) Éreturn False ùif cookie.version == 0:$  k óif (not erhn.endswith(o M and2  6 3 Rstart5 O".")2  e P("."+j )k .))œ  j ð_debug("   effective request-hostP`(even º ! aL"¶  P °   "initialrP) doeˆRt endC /%sˆ C  Á #, #i r–(—m> 0 orG ò(self.strict_ns_o 1 &  DÏRFC2965Match@!ifv;  _m' (½ s(7^ -^  x Yi>rS\oNoDots> ]�_prefix =s_ d[:-len!]¸ P ( : P.find÷o) >= 0 ñIPV4_RE.search(reqr œ  ‡ q  « c%s forŸ mañÛ I º ¤ ÷QTrue
ñ def set_ok_portÔ,˜,S Æùµ / ª_specified¨    – C ^ 
% ifh ! Š is NoneN  KR :"80Å?els2 1str¬ “ 
|  ˆCp inò ." §.split(","ø  „   >try�   Zint(p]   ÿexcept ValueError> *@bad ‡  Å¿numeric)", a   e Öc  @if pZB� Qbreak 4   V© Í­ A(%s)ËPfoundR K	Q  U  Œ jx=Ø  
Ã ?_okÁ&""=ðIf you override .ró"eturn_ok(), be sure to call this method.  If it
  r9 ûs false, so should your subclass (assuming …wants toP ðbe more strict about which cookie.  v 5).
8 5""" ò# Path has already been checked by .path_G ö §and domainI Pblock· Adone9 # ; .0 ¢_debug(" -l  9 ¶ ƒ %s=%s",Å U.name fvalue)Ì ñfor n in "version",  ifiability `secure
 `expire^ P"port ¦ %":›  ¯0fn_x E = "ú 6_"+ð % ó = getattr(self, 8 )M ¢if not fn(â ª, request)u  T n   F$E  BTrueû 3defÙC_ok_û ƒ d $ifT2 P > 0 Í Ÿ  Á Š.rfc2965˜ ¬`  RFC ! I 0s a�Êwitched off"û º 
Ï .elŠ ,==‹ �netscapeŒ N! Œ *¡ [KaÚa.unver; !lecó is_third_party(( ¢žê_¥_d 
& J¶y -y Â@ dur|L    I  �"transactj
ê & M
î  ò
Û /nsÖ #Ö Oë 8r1¯.1 *Q.type92in $Çª_protocolsôðM [ £ with non- ` ªæ eNç 2is_5 d5 [._nowÈ Á 2 ± 0 ôy Q‹… / eÀ        req_ð port = request_ ( 7)
   if% ! ™ is None:!  , 2req" i= "80"  ðfor p in cookie.k ¾.split(",")M aif p =œ U "  s Ybreaki ?els›   _debug("  È  í  ‚ ó %s does not match   )",]  s  í ,2 Ò 
5 * Åreturn FalseK  QTrue
  de` * ô _ok_domain(self^ ,· * ‚ óhost, erhn = eff_¾_ ËZ $ =´  „  ® 2if  A and ì.startswith(".¯2dot' ƒ = "." +E Û  W ”3 < … ò# strict check of non-& ¹ ¢s: Mozilla¿±this, MSIE5 5n't} Cif (upversionW0â $  ¥ p.{ 3_ns†0 & ˆ!.D”S™ 2Non )E  Hm ±  _specified, 1 !=´Í ‚ ¥D  q6 unD U ä Ÿ ¯ ºng-compare t T Ä   "equal toD† "®•ª#ifs.=!> < � _:(†,\ Ú ”effectiveŽ -«Y nameŽ[ -[ Ø ƒRFC 2965¢ { B %s"� Î  r’ç '==è  õ+à R).endÃì �â k‹NetscapeÀ ÅÖ óÂ ë   ï 
l> _ 1_okü/l•# Liberal•p.  Thisðhere as an optimizatg…to avoid€# havingŒ�load lotsá ºõfiles unless necessary.E  ‘÷iCtqÎ` Í+ € M  } I  " E   A € 2 N oS e$ð         if not ÿ(req_host.endswith(dotdomain) or erhn G):
  ò#_debug("   request F ö
 %s does not match cookie  *",L X › ,* )& Õreturn False
 òif self.is_blocked(‡ ° ¯    § ±is in user = o-list" ±  ~ Ÿnot_allow‚  '† A † 3Tru’def path_ @_ok(&, ,±#¤- checkingµ G B=%s"< “ ­  $ =O _  ` )    len = len(   if= 9 1 ==ž 
gÀ  Ú uPelif h 8 b.startÊ] E and4 v Õ1"/"ëÃ [8 Clen: 0+1]Ž  ' # K � d < Sú L -ÿ>m H× ¹ó	vals_sorted_by_key(adictŒ rkeys = !  . "()X¤ 3map Pget, " 0)

` ódeepvalues(mappingZ ó	"""Iterates over nested & à, depth-first,:„ @ ordBye A."""b ? = Ï  Q ° pfor objP 4 ( # =ö ƒ  6try%   ‘obj.items{   úexcept AttributeError5 7pas0 :lse } 	~ ] ·yield from M2objÒ  # #if a
Z ? ðobj


# Used as second parameter to ÷â.get() method, ñstinguish absent
#+  �— @one Ý@ a N Z‘.
class A4 !:  C£#Ja$ó"""Collection of HTTP"s.qYou mayè @need› ñknow about this q Q: tryšsurllib.1à.build_opener(b † °Processor). a(url).@  ]	 ±non_word_re�â.compile(r"\W"‡_quote!  ƒ([\"\\])' rstrict_/  ƒ\.?[^.]*/ ( 
% /tsK  b^\.+")>_magic$ R#LWP-
Ðs-(\d+\.\d+)"¸c.ASCIIC  Í„__init__à`olicy=ôÕð     if policy i—s None:
  ñpolicy = DefaultCookieP %()+ eself._- 	 
 c< ý
s_lock = _threading.RLockO 0 R = {}L sdef seti (v ", m )¸   �  A _X ³_for_domainJ  —, requestS 3 U = []Ö xif not o .C ²_return_ok( T  f( U ô	_debug("Checking %s for ‚ 2to 5 2", \ †$ £_by_path =œ  [0 Á  X ) $in` < g.keys( ® ñ  @ ï   í  C …continueE  Us| lname =Ž [W ¸  4  ¼ Ø  ¾  B m.valueÀ  8 Ä Q ®R Á 	 D ¤!  ?  ¬? "’ .  û   O Ïit's a matchG  ` ’s.append( n ‰ =3	òÝó éA"""R¾¤ a list ofR c to be€ ed ¥server."""Ò– s, ¯ ¯3) k 0extê 	1 ¹T ±c_attrsn -9 `ibutes| Ýölike ['foo="bar"; $Path="/"', ...], ÕThe $Version g õ  is also added when appropriate (currently onlyˆ…once perÏ.j °#Y ã€in order÷ðmost specific (ie. long ’e firstq Fð.sort(key=lambda a: len(a.4 )¬¶verse=True)”   ö ion_set = False  S s  S
 s }#. Y  Ò ¿u header¹ + ;XXX àWhat should itû²if multiple¥ öISet-Y Zs havã€#  diffe©‘ Ûs themselves?{ pAnswer:"  reAno a Â; was suppos„ beç ftled bÿÕ ð RFC 2965 errata, but tÙ ðmay never appear.G..
  óversion = cookie. 	% sif not  Y_set:   P  } = True# $ifC N > 0C  G òattrs.append("$VŸ d=%s" %> ))
[ s# quoteÁ p value ³ ‹ecessary. (Ì òfor Netscape protocol, which already has any` sG ö intact, due to the poorly-specifiedc C^™: syntax)L Tif ((¾ sq™None) and/  'ùself.non_word_re.searchF : 4 r)s-!= P GM ³ub(r"\\\1",W.* 
¸ OelseS Ñ ±3addX -ñ`ibutesEò be returned in 6y header#ifA ™ @ is .�  ` Q” OnameË 	< 3"%s‡f G ,p)O ê¾ Upath_0¿  í	‡ ä'$Path="%s"' % G 
ƒ  9 g ÿdomain.startswith("."  6 ,  	~ '    º NX* Ï_initial_dot½ :   / • – 1 2 = : O[1:]— 1Dý 3= .	@portR Û V Ž ¿p = "$Port"† ~ P åR ep + ('­ Z B ²  4 	ì pH   €‚def add_T _V(û—, request}A"""A§Srrect‹:Œ ¬3 “ (urllib. ".RK ’ object).}  ¬ 3TheH 2H pis also˜ óed unless policy.hide­ 2�GtrueN &""x�_debug("ß "6 é .P ö s_lock.acquire(% Ftry:±  µ 7 “ S_now / �int(time. '()‚ > ls4  S_for_1( : ¹8 _ €s¶  j "ifìDÐif not requesÿ
t.has_header("Cookie"):
   ô	request.add_unredirected? 5  H X ù, "; ".join(attrs))
5 ù # if necessary, advertise that we know RFC 2965< ðif (self._policy.rfc% ™ and not  ahide_cï 2" 	K  ´  2 ñ #?2")% Bfor T 3 in
 sL#if  ß.version != 1,  � ‹ |cr2", '$VS m="1"')Ú  O   Vbreak€zfinallyƒ 4Ô ÷ s_lock.release(»& Óclear_expired[s& Õdef _normaliz q_tuples·!, G_setZò"""Return list of 3 Ã containing W 3sedS@ infk Vtion.á ` u is theS  [ s\ ðkey,value pairs extraâU fromI < BSet-.F or  "2 Lsy Tæ ± are name, d ó, standard, rest, whe#  ’& 6 5the} ŒI & L  Ü Pa dicý 8ary) ¸ t P -Áibutes (disc— Psecur° P", Þsó …max-age,I Ádomain, pathš Qport)
  ß ™ $ %ofO  ­ ì œ U5""", ( NV = []ö€boolean_á Ss = "Þ B", "à H ˜* #("›"å  8 " M - " ,  $ ?ort1 pcomment*  Gurl"yq¶ &inG
Êz# =)5 '[0/ Ý x# BuildF%of®< –$ (Vï—L Œtof othe%	C   )à= RNote:w`y timeGñûto seconds since epoch.  V0‡ $Às should havU1e E±sÖ ,º#V1 sO G ÃMax-Age, but‡ ²V1 includes®4109J \ (andO ½ %V0$ ðmay be a mish-mash¡�Netscapeœ v109), w 8‘accept eio(™ ðprefer Max-Age).
       òmax_age_set = False

  ¯bad_cookie  Ùstandard = {}: 0resT  Âfor k, v in X ¹_attrs[1:]:@  € ílc = k.lower() ð# don't lose case distinction k íunknown fieldsA Pif lc‹ RvalueŠ 3 or rboolean �  ¡ ok = lcX kW 	B @ andù os NoneP ## 3 -ñibute is present, but has no º �  œ þ# (like "discard", rather than "port=80"X > �v = True[ 1if Ü úÉ ¢only first¤  Á ½significantX  u ocontinu ¿== "domain"u /if` e ó_debug("   missing¡  1`  w H 	+ &   _breakñ Ò# RFC 2965 se·_3.3.3-  “v˜ #expires$õH ´ ó# Prefer max-age to Z XMozilla? C Î  ¬&§or invalid·š "9 p  "Ùp: treatþpas sess4“õÔ 0|a ª ?try› _int(v{€except VÓ_ErrorJ  _×(non-numeric)meFXvconvertNRMax-A¶ÿseconds since epoch&ð# XXX Strictly you're supposed bfollowe ?616F Ñ  age-calculaŠârules.  Rememb�st zero ¨ K �is a requN toá ÌQ (oldQCnew)-Ÿ, though.N àk = "expires"
   üv = self._now + v
% ó	if (k in value_attrs) or sboolean :?  O  C ßv is None and&  * Pk notm ø("port", "commen ourl"))k  E ò_debug("   missing¼ € for %s Ã ¿ibute" % k)� ÿbad_cookie = True* Oreak ßstandard[k] =^ OelseÊ Drest6 	[ 6if š < ™continue
5 È ò_tuples.append((name,$, «  , { &))A yreturn D  Cdef $T_from h (YP, tupS Wquest¶#q  vdict of m -¬sD (st, &th’#µ  B Ethemû á   =š Ç  6`domain³b.get(" –", Absent.Mpath.   , >ort, áX }expires/  ^ æ õ# set the easy defaults  nversioÜ  !",™Û 3if   o ’ ¹
k:try  D6 c= int( X  # €except VM^ErrorF o t ´  # invalid“ ƒ, ignore�å PsecurªÈÀ †", FalseŒ  # (discardä AalsoE3if i  œ2 =¨e  f ½Í z O_url4  þ±ý ù † !if  Ï  ÊÓ  … Z!= ""„ ? ¯_specifiedü "   = escape_ ( ^×   	U �¦   # Q = re+W  Z  ) 1i =½ «.rfind("/"  šf i != -1Ù < ÜN== 0!  % Q# NetÝ  ð  parts company éÆ reality her† <  Î   I[:i]ê  $ #     3 â Z[:i+1< bif lenp Ã f = "/"ÏÀefault domai3n
  òdomain_specified =  å is not Absent0 ö,# but first we have to remember whether it starts with a doE b õ_initial_dot = Falseh #ifˆ › :  ¼ D Rbool( .  ~ e("."))> [  ã ß 
[ ñreq_host, erhn = eff_request ( T ’  / &rhaAelifI— 
z $ r = "."+ 
¸ ö# set default porQ  )M "  ð Ó
z !ifR  # JNone  Þ ð # Port attr pre, ha)u value:Ÿ 2X .Æ  L   ð# Cookie should then only be ^ Â back on thaï E Ö #= �_ œ?elsÔ   0 	76Truƒ ¦    &  e ñ.sub(r"\s+", "",Ú d A# No% 	7$. û =canî 1any3 
í „  ›õexpires and discardu4if  #isÓ
ã != d  ø  M 9 = Ù7 Ê<= self._nowY 0# E™ ày date in pastgµ >�delete cú .  This can't b�#B D@ó Policy, because7 	R s]*reR:try©  ï Ä SclearFÆ, path, nameê + þ except KeyErrorL Epass� 2 �_debug("3ingð ,éR='%s'p   u  )",I  M #  7 2 ¢ breturnÐ@  <�(version_ !  ö ,Ú#  ™	I, Ñð 0 Ë D �  @ Þ  osecureJ » ö comment O_url# Rrest)ÍRdef _þps_from_g`s_set(“,@ ,í)r: †_tuples Š‚rmalized[ Àe_tuples(att£rs_set)

  Åcookies = [] ²for tup in   …_tuples:"  >  ’ = self._ T_from 6 é(tup, request)B #if` : ’s.append(M . TreturŽ s¿ ódef _process_rfc2109z  s(” ,V )¹ ( @as_nö qgetattr0 ¸._policy, '' æetscape', None” 8if ' As is" m  &
# S= not1m .! 5965 }ÿ €z8Ú.version == 1x  | G b ¥109 = Truei  "   È H  & €# treat fXS as N ½rather thank I ¤as RFC29655 ) ¾ ã & 0øKmakeì†responselÉ B"""RBsˆ�nce of Cüð objects extracted Ä P   E."""§ S# get½ -@pibutes ¼ARFC Ü 6and•protocolsD `header„j f.info(a1_hd' 1 â.get_all("Set-Ä f2", []: /ns5 4  2U._nowÚ �int(time. '()D¨ 0 Ùn*2(  Þ #Pif (()Z Í  P  Ý E) orM 6 2   - B -  _ § 3 ­ a d � ±ô[]  # no relevan5 ÍÆ: quick exit 6try¼ N  ,¦ m €×( 8 bsplit_l x_words(ô ),; �except E :ion‰ ò_warn_unhandled_. 7ion· y ¡ W\ 9if  j
c ý  P #2| Úub  ,   $ns–“ 4 ? `parse_¬ ¥( ?drs1 0 5 " 9 , 	½ —   ö: ŸÀ    # Look fñor Netscape cookies (from Set-C ÷ headers) that match
  ÿ	# corresponding RFC 2965R 2S .I ‚For eachf ¬, keep theT ± and ignore Å O Ó % (’ ò	section 9.1).  Actually,` 5109´ ;areM ù bundled in withx 7 ûfor this purpose, which isN úreasonable behaviour`if rfcI:<  z½lookup = {}  ƒ ù $in™ C G "[(/ ƒ.domain,4 U.path íname)] = None
u qdef no_Cing_º B(ns_] ", ´ = )‘ ekey = 5 ’  •   ˜ Ž  Ü preturn R 0not¶z - L ¿s = filter(Ë  ,— *s)'if Ù †s.extendG ® + _  T3setA´_if_ok(self•—, requestNƒ"""Set aÅõ if policy says it's OK to do so.""" \ .o õs_lock.acquire()% :tryã 6 e ‚._now =   �int(time. .()<- A  ñ #ok’á  Ü  6  . 42 ")
< " 0finÝ® 4 ä `releasä å 
w	qh,�out check±whether or �ù t should be setzc4š Š  Å ç ”#if B‚ rn c: c[c   ÓEMc2 =' ‘  • _  �] T2: c2_   ] 3] 
& 	\ $c3B  Û B ° % ×(dextracRsÜ» ¬OE5 Q!s 4 ±where allowÎQgivenN 	é‹_debug("Š P: %s"î Epse.info+ m  #

D ð make_cookies(reûsponse, request):
  ÿif self._policy.set_ok(cooki9 
 H ò_debug(" setting 7 c: %s", )s  : t  l 2 p , zfinally° 5 _2 ñs_lock.release()
g  def clear(, ó, domain=None, path Aname @"""C; S some½ "s.X  ³ PInvokå òthis method without arguments will„   a
 Ias.  If£  K ågiven a single= d, only{ q belongr co thatÏ c %beO qremovedd  \ 5twoW s‹sS µe specifiedM  &× )inu Oare i 6hreÂ us, thenM $thJS   s  †—D andÞ %ish }ðRaises KeyError if no match!h exist´5"""Œ  3 °ame is not 
_Bif (1 $    a) or (!is2 0 É  r› a Valueœ (r    "Z  é Q tmust be°oõ # a 1 by!" L 3del±ô "s[Y  ][V  ][T]‚ Aelifø Ò ö B  #  õ 
 t â Ù °  Ø  « Ø 
Ò ± Ô %G *seé  1.]R = {}~S„_session$ c¡"""Discardù. Î•BNote[ u.save()QPon't   B õ  anyway, unlessË òyou ask otherwisebs]ô a true ignore_d  ®Þ*	h`acquirh   +trž3forí 1 in¤
a 5 #if# .‹ #  ' � È6.òÉ.A  ó%:-�_expiredç. × çáYou probably d×�need to cG+: G  nUneverç�sent backA  9PserveŸðrovided you're using DefaulótCookiePolicy),
  ò
this method is called by 0 õJar itself every so often, and theJ t.save()M `won't  ¡ expired cƒ õ	s anyway (unless you askI �otherwise‡ òpassing a true ignore_R Õs argument).
? 5"""  ¹ #._x õ _lock.acquire()% Etry:  °now = time. +   3forÊ @ in b 
>  $ #if# 3.is­ nd(now)+  /  E r.clear(¬ „.domain,F Epath Fname¾ kfinallÂ Q 
ø `releasø ì Ðdef __iter__(/ › ñreturn deepvalues! H)lB >lenA B"""RD €number oVntain.©Qi = 0™  c  " Ui + 1& § i� ?repÑ U = []9 _ �r.append(B †)fl Ó"<%s[%s]>" % °_class__.__šù__, ", ".join(r)./stž ,$st#� 5ð	
# derives from OSError %ñbackwards-compatibility with Python 2.4.0
Q Load> (F 0): Á
  EFileX(
 {5""" ò that can be loadedŸ  v U±d to a fileIÝ“Cinit”,!  —À=None, delayP ‘=False, p ‡  �›”  lYe NOTŽ @the ^ dh � until eiÁ   .k Q() or   [  .rIt)vÄ€ iJar.__Û » ¤!if†  �  Ë@not õ 
s 1" p= os.fsZ( L  . % =Y Ç ! N… = bool( ö ®+�Ítdiscard’ ã 
›CSaves b   ra@€NotImple#ešš � É š 6 š O£ ˜   ¨¤!ifW€5is Î‹* =& › d ðelse: raise ValueóError(MISSING_FILENAME_TEXT)

  õ
with open(filename) as f:"  ) ôself._really_load(f, 1 õ, ignore_discard sexpiresn °def revert(O @ i=None,p +  T l=FalseZ  )¬ ð"""Clear all cookies and re¶  Áfrom a savedÈ .±Raises LoadCq (or OS 3) iÅ õsion is not successful; theÊ ñobject's state will0  be alteredO Çthis happens‡ 5"""I !if¥  ž t  0ô   0if T.“ &  š * < =& `  C pelse: rý a Valueñ @w _kõ _lock.acquire()` Ftry:a n Bold_°= copy.deep	 .Q C  5 	l U = {}b   f  	  4  üàE¯@ dexcept 
v ( ` ¯ 5 = Ù 	›  * [0finN
R 	N N`releasN 

C3lwpo R_str(zð"""Return string representat°Aof C0 inªC LWP%s format†@Actu£ ,+   Yòextended a bit -- see module doc| E ÇSh = [® .É,y  .vm) u("path"!   
  fdomain"  !)]t$ifZ @port± 
!h.h@d((" B   )n@ ø ath_specified: >  0", e< ?ort<  < Ï É_initial_dot|  ?dotA isecure5  1 ª	2  "š Ç ô time2isoz(floatå@ -))y	n  ¡ jcommen Å p  I_urlt  =urlD  , )¹Ôkeys = sortedÞ `_rest. (p Pfor kY  ×5 k,—	A 0[k]¸) @"ver`"1  0 rêð
join_header_words([h])

cõlass LWPCookieJar(File ¡):
    """ 9The- ò saves a sequence of "Set-B ‘3" lines.> 
 ñis the format used by ñlibwww-perl library, not knownK ð2to be compatible with any browser, but which is easy to read and
Ö ò doesn't lose inŠ ñion about RFC 2965 c1s.
{ òAdditional methods óas_lwp_str(ignore_discard=True,  bexpire ):  ^[ Gdef G Eself8 M sb « Ù ”"""Return» ! a¥Qtring£ë\\n"-separated³dheaderð  Q ¼ „  A
Ï ²s: see docsd Ifor I.*ï  Q  ó     °now = time. !()  er = []  U Œ@ in ž +   !if&­  6 .À 
6  : …continuek   
O e¸sü O 2is_ Wd(now€ >   W ˜r.append(€: %s" % B^ I )×ó"\n".join(r+[""]I @ h(æ, filename=Non�V=Fals É s Ë %ifG  H J 
?!ifŠ.m  &  ¬* < =& 	ióelse: raise ValueError(MISSING_FILENAME_TEXTê  ^óTopen(| `, "w")íf¥ p# ThereÿQlly i÷ anÌ ªSs 2.0�<éthis indicates± `# that¬ reð YextraB1in q °(domain_dot:F  port_spec)ª°le still be§Ý‚, I hopeW   Óf.write("#LWP�†s-2.0\n"B*  '.qi¸{)| fÄ_really_loadnq: l J ž magic = f.› - iÑ§ ) ±_re.search( © Ø °msg = ("%r ÜÇlook like a ™c (LWP)ñ Þ C  "W •   H
E°BLoad¯3msg! D Õü_) =v:ƒ Ñboolean_attrsÐ (�", "path5  _%",a  € 	 q"secure1 ð iscard")
      ÿ  value_attrs = ("version",
  Ð"port", "path _domai1 	expiresS acommenV  eurl")
„ Etry:  ˜ zwhile 1   Ðline = f.read )()9  $ 0if  ß == "": break% 1not) þ.startswith(header)y  Y �continueM o M E[lenF ‡].strip(ë  H   òfor data in split_{ €_words([S ]ˆ Rname,Û! =F =[0]•  f ßstandard = {}" Orest  ¦ k£ rbooleanJp ®[k] = Fals- ( X 0, v[  O[1:]V €if k is ±ONone*  \ Ïlc = k.lower  #   ?elsI  p 9 D ð# don't lose case distinction å ïunknown fieldsI `if (lc±D) or 	€ ’   ok = lcl 	Ó R  if« s �: v = Tr  +  z
vŽ "elÞnÐa _ [ â ý¡ ¢ Dh = o O.get% c = h(" "— » Bdisc�3h(" + 3if L û- ³= iso2time( ‹ 
` ÚÞ 
· ø' Ø  �_specifie› ‡/".>  Ü†Cookie(hÎ7), Ü Ë   "h(æ ),² ñ� /"): ª ",  6 Å I  ?dotJ  „  b„ 1athN : osecure, À            ¿ expires,
  discard( Ïh("comment")- ?url0 _rest)ª ãif not ignore_­ s and c. :9  ö �continue! 
Z e/Z 2is_ od(now)b $öself.set_cookie(cã êexcept OSError` Frais³ * E1 :ion, ò_warn_unhandled_. Fion(l  
T Q Loadq ñ ("invalid Set-CŸ ÿ3 format file %r: %r" %< S   (, òname, line))


class Mozilla[ …Jar(File RA"""
` ðWARNING: you may want to backup Âr browser's Psª  if # u4Rthis „ tto save/ ð.  I *think* it works, but there h- Abeen” pbugs in b past!« T` Õdiffers from Ü T only9 S it  sÒ ’ 1andd DloadŸ    ØN aÜ 7.  o AusesŽ \‚/Netscap,`S.txt'Ës.  lynx|  ¹  ° b, too.Õ PDon't35ect�  ª @d wh4the€° is running³  be¡qiced byÕ , ”(in fact,ð on unix will overwriteÃr®!ifO  `changeý mA Cdisk™ 5it'� ; €Windows,R ñ  probably can'tO  Ö s at allC ° Ü )0Noty a%Æ { áÎ õdowngrade RFC2965K!to| ±  onô 3ingm àIn particular,ð + � version âport number in‚   ris lostž@toge×Y with' ‚about wh  orÀ€ Path, PZ  …DB wer_qspecifiæ˜ 9W2 (orI‘) header,­ h "thP Ôdomain as set.CHTTP= ‚ started¿ ø
a dot (yes, I'm aware somM ®c êsF D  Ý  8 ! dó�-- trust Ã1you§creally" Šâknow any more D l(Dough+–  usMce same<çy¤} `slight ^3entseÜ Ç	ðusing the Netscapeñ&
    header by default (Mozilla can cope with that).
5 2"""	 ðdef _really_load(self,  õilename, ignore_discard ‘expires):R  ‹ °now = time. "()d   ÷if not NETSCAPE_MAGIC_RGX.match(f.readline()R  ; õraise LoadError(o     �"%r doesb ýlook like a Netscape format cookies file" %I    ó ¸ 6tryà  m zwhile 1    ¼ 8 = É a –rest = {} ;   2if B ¾= "": break& ó # httponly is aÒ € flag asý ined in rfc6265ƒ Â# when encod* 4a n(! ,:  2the¥ �is prepenC ]Í"#HttpOnly_": Ü p.starts0 û(HTTPONLY_PREFIXó    0[+ `ATTR]  b  - ?¡ N[lenc ]Pý#last field may be absent, so keep any trailing tab} ß 2endÝ a"\n"):Š ! = O[:-1 ðskip comments and blanÂÀnes XXX whatí$Æ?} (ú ˆ.strip()eí("#", "$")) or; 5;   =\‹ŽcontinueD‚domain,  ò_specified, path, secure, e0 , c¿, value = \˜ œ ­plit("\t")) Z D = (
 = "TRUE,  ž  6  @ !if¸ $þ ° #�ñs.txt regards 'Set-Cz`: foo'©ºÓ H  #1 nor ,±Areasû!.cJ 5jara !itR K 0 "nov.,  —" =" ! ²?Non  initial_doã[�/".– massert; fP t Œ� = False¯ $ifo K /""±e’1 = Ó  | õ_ = Trý�# assumeìü ±fš Bc = )(0qŒ    ,ì Àe,
           ‚domain,  ý
_specified, initial_dot,
8  ¿path, False( 
_secur# expiresG 
discard$ 
?Noni ! ]rest)ö ãif not ignore_Š s and c. :5  *�continue 
R e R 2is_ od(now)Z õself.set_cookie(c)
~ êexcept OSErrorY Frais¨ * E1 :ion, ò_warn_unhandled_. Jion(<T Q Loadq ò("invalid Netscape format ¬ õs file %r: %r" %¸  K (, ³name, line)ç �def save(,Q  % =úÂ=½ us w%ifG @ is J 
0if n .’  &  0* < =& 	Þ belse: 0RValue1óMISSING_FILENAME_TEXTê  —with openš"w") as f¥ óf.write(NETSCAPE_HEADERR  M  °now = time. Ô3for¯1 inÒ 
h  F U# =) . 	ñ  ' iW¼\?W a+$if× Ú":  � = "TRUE"è Ý& OFALS'  #ifŽp.startsÝh("."):”g ¿ + l t#.e|!isä´Â  ®) j= str(> 
÷.  ÑH "+]v J’ #‰ñs.txt regards 'Set-Cê`: foo'a+ ’  # k@ no +ò , whereas http.é 5jara !itR K 0 R Ç .,  m  £ A9 C - F Y  > ð name = cookie.n_ame
   ñ value = cookie. ) $if  ýhas_nonstandard_attr(HTTPONLY_ATTR):?  w •domain = - ’PREFIX +  6 �f.write(  O ²"\t".join([? ä, initial_dot,¯ _path,A  E  ñsecure, expires, name, ?])+? ó8"\n")
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
#‚  PAll RJ ¡s Reserved' ðPermission to useâ ñpy, modify, and distribute this software
# àits documentatK ñ for any purpose& õ+without fee is hereby
# granted, provided that the above cðnotice appear in all
#! 1iese ; BbothE ; n_ Eis pø =
# X ªsupportingÙ e     Ï^ of
#— T 0 beRdª pdvertisS °or publicitppertain &tol H!ofp D specific, Ê�ten
# priY Ø .à0ð4DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE, INCLUDING 9 xIMPLIEDA ðOF MERCHANTABILITY
# AND FITNESSC À NO EVENT SHG Ÿ ÑBE LIABLE FOR@ �Y SPECIAL@ ðDIRECT OR CONSEQUENTIAL DAMAGES 4ANY ð
# WHATSOEVER RESULTÁ ðFROM LOSS OF USE, DATA= �PROFITS,: ðETHER IN AN ACTION0 ðCONTRACT, NEGLIGENCE; O. pTORTIOU;3 `, ARISv 0OUT@ OS RCONNET y0THEŠ  õ �PERFORMAZ F‹‰×‚
# Id: C`‘py,v 2.29+ð/08/23 05:28:49 %A ExpG_  µ€a Python@ule è 	PhandlÁ0of ‡ g øUs as 7 0dic ñary.  See RFC 2109J !moSr informJ#onrsù ð  The original idea¸Streat
r k   came from— ðDave Mitchell (davem@magnet.com)­ñ1995, when he releas˜ ò¡ first ver6Rof nsì 1.py¥  ž°
r"""
Here' •sample sekPshow  wY’module.
A  moS, !isJonly•0.

…Basics
- D

ImÆ°is easy...
v1>>>q http i' hs

Most {àtime you start‚ðcreating a cookiñe.

   >>> C = cookies.SimpleC ð()

Once you've created "r # , ÿ  can add values just as if it were
a dictionaryy › õ["fig"] = "newton"¶ r["sugar Vwafer �.output(). R'Set-° b: fig=J H\r\n N =I ð'

Notice that the printable representaÑ S of a0 is, ð
appropriate format 8 a o Ôheader.  This: ð default behavio 1YouaPchang‘ "e ; B and— ðed
attributes by using‹  	A fun‚÷~RrockycFroadb#[" b["path# /G& 5$(C… ¸ #="Œ!")Ÿ  P =f s; Path=N  Ã §M  ò Ss=[],W ù

The load() method¾„extractsò from a string.  In a
CGI scriptý€would us›$isX 3to O ‡sR ðthe
HTTP_COOKIE environment varif%.Ô ñ"chips=ahoy; vienna=finger"h D‹ 	> 	L 'Fðis darn-tootin smart about identify‘x
withinZ³Escaped quoW marks, ness±semicolons,÷ðother
such trickeries do not conf�/itF ñ&'keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";'N `¤ íU T S R ¡

Each ele!ofE)ð also supports allÅ £”RFC 2109
) ð.  Here's an exaä¡ which setµsG:b["oreoµdoublestuffC! 	, 5 U =P R)qhas a 'ˆ ' ",ì Pgives²Q
backT+ ` assoc¯ d œ /keªBtwix1nonú l ç AC["t" .u  ×') Z‚P expe’‡ ë; As shv³be standard¦@s.
J0to  Uure, R Àkie invokes ðthe str() builtin to convert
 Pvalue a( ¥ing, when  ñ(s are set dictionary-style.

   >>> C = cookies.SimpleC %()" ç["number"] = 7 astring w"seven" 4 .§   0'7' v $["=   D $ r.outputŠ R'Set-› ": \ h=7\r\n T =H ò!
Finis.
"""

#
# Import our required modules
#
i $re
 N  òtypes

__all__ = ["� ÃError", "Bas=  Mð"]

_nulljoin = ''.
 °
_semispace   %;    Ç ð Define an excepÙq visibl‡ExternalÛ gclass ¯ $(E:  ):”ð pass


# These quoting routinesx@formn _ðRFC2109 specifica…  ñ	ich in
# turn references•°character dÃ i5 ps from Q P068. � õy provide
# a two-way” ö
algorithm.  Any non-text _ ÷	is translated
# into a 4# @sequš ð: a forward-slash followed by¶  Ì ðhree-digit octal >�valent of& Z – ñ '\' or '"' is
#¾ ðed with a precedb ( x ´.
# BecauseT  ö ôbrowsers really handle³À (as opposedœAwhat± eRñ says) we also encode "," and ";".Pó +Ytaken‘*  �0109¢   ±_LegalChars    rahe lis ‹@s whTdon'tq0 "'6 #_T¥"or € hash-taÊ�for fast:hing
#
w =ô°.ascii_lett&+ ®òs + "!#$%&'*+-.^_`|~:"
_UnescapedÃ (= Z ø+ ' ()/<=>?@[]{}'

© ñ= {n: '\\%03o' % nAÁ    º @n inzá(range(256)) - ›map(ord, ‡ 8))}i ‘.update({_ �ord('"')z 6"', #\\ à\\',
})

_is_l¡ð	_key = re.compile('[%s]+¶ 2re.(ü ð)).fullmatch

def _
Se(str)¤r"""Quote v ? ¶Cin a™r headerg" I#PÂ does not neµ¡be double-m  d,QPn jus7I1theò C ð.  Otherwise, surround6 þ }S R sÆ F (†"\)Á&al¿!s.#  4 Ì ifS  ß@NoneÒ	^ . !re® 1strE Belse_  ¦.£(`Àor) + '"'


ò_OctalPatt = re.compile(r"\\[0-3][0-7 Ÿ")
_Quote. ð[\\].")

def _unq) ñ(str):
    # If there aren't any double, #s,( Cthen*  ca) !be, ñspecial characters.  See RFC 2109.A ñif str is None or len‰ B < 2�  ‘ `return, 7  [0] != '"'9 dstr[-1 ; < ð# We have to assume that we must decod  isq 2ing¬ `# Down6 cwork.
N @RemoM Qhe "s  Ò =; d[1:-1]) ¤Check for €sequence‚Examples¹ #õ ±\012 --> \nX  1"   "  Qi = 0
 5n =C �res = [] òwhile 0 <= i < nm  l ¦o_match = dp.search�A, i)B  , q, b, tif not _ 1and C :O  P# Neiw � %eds  $  res.append’ F[i:]“    Ubreak2 f# elseá ¥j = k = -1# $if˜ '  I  + ± †.start(0j 4if ½ I  5  \  5 	 (’or k < j)%# Tk';k+1!  -Uk + 2À * Å  &# ƒ¥j~ Ÿ qchr(intÎÖj+1:j+4], 8))n ‘  ° Qj + 4° 
ð_nulljoin(res)

# The _getdate() routine[@used·0set«ñ expiration time iÂù cookie's HTTP
# header.  By default,b ”sS ycurrentP ñ appropriate
# "v 0es"0mat � a Set-Cy p  Ê p¤ €al argum_ °is an
# offÍ �from now,Ã `secondKRFor eOD, an. ðof -3600 means "c Ñhour
# ago". C[ @may Ëð floating point number.
#

_weekdaynamec°'Mon', 'Tue 0Wed 0Thu 0Fri 1Sat Äun']

_month@  W ö 1'JaT 0Feb8 0Mar !Ap 0May NJun'8  ul 0Aug 0Sep !Oc~ 0Nov 0Dec… 8§future=0, Ý =ê %, µ =À 8‘T€mport gm ,¿Qnow = (æCyearT ð, day, hh, mm, ss, wd, y, z = gmtiñme(now + future)
    return "%s, %02d %3s %4d :  ‘ GMT" % \5  9 ñ   (weekdayname[wd], day, month 
 ñ], year, hh, mm, ss)


class Morsel(dict):\ R"""A  ñto hold ONE (key, value) pair.
/ ñIn a cookie, each such" ó may have several attributes, so thisk !isN ÷used to keep the2 ò associated with `ppropr  ¡   } .P Tb Ñalso includes´ Bded_1 ˜ ´, which is ‹  L  � ñ
network representation ofŽ M y 1"""5 ð# RFC 2109 lists( s×  K Brved�ƒ#   pathåscomment ƒ  domain] �  max-age Qsecur
 ƒ  versio' - ÿFor historical reasons,“  1re /™ bexpire­#X e°is an exteny ö  from MicrosoftÚ ‚httponly<   B  „Âionary provi§rmappingP  ƒ“lowercase<  variant onÉ P leftB + aPtradi­#al9 pformatt] < RrightÀ_û A = {1  b"ÿ U"  :  ,   ¸"*    WPath" Ê= C×  Ú ? A: "Dç ê? xMax-Age  ÿ? S y"› ˆHttpOnly! 3` V@  �samesiteA PSameS à }`_flags3'Ž D', 'y '% ódef __init__(selfy 7Ò# Set defaultf   & ‚._key =  k &coÌb= None�  < 	S Pµ0for<3 in\ ûµ D    Ÿ£.__setitem» ,: R, "")q @�2ertß ê <keyå óÉ ?key; ä = 
" ? E 
( K  · _é GK, VªaK = K.�(Ê %�if not KMqraise C7æError("Invalid¢0 %ròF(K,)a †� ¾ 3setDú ¦@val=Æ S?keyÊ    Î Ì 
Àtribute %r" ³% (key,))
  ðreturn dict.setdefault(self, , a val)
0 £def __eq__  �morsel):  Q òif not isinstance(# <, M+  / } åNotImplementedM  (œ x 6 an.  P    º ²._value == €  1 8key/   - ^codedd  2ò__ne__ = object. NAcopyLD² # =3(¬	VupdatX ï " < 0.__+ 3__.-  %  . a5 • 5 ,þ7uesŸ •data = {}¨5for*" iL(�—s).items(@  ¤ ^=4 g.lowerã    if I"n ¼ †reservedk *   þraise CookieError("Invalid attribute %r" ü ?  Ï p[key] =ì Õ  A? , * × 	3isR” "KeÄ7, Kè ]Kã  
Ì r,ser%, MT R 
ô'Attempt to set a Xr?%r'& ÔÐ_is_legal_keyF˜  In  !Il1 \  gÐ# It's a good) Õ, so save it.' 97 lÀ2 E Sz£__getstateÕÖ Â{n  ç c'key':–  
 ‹    ," “ (  . }¦ s¦ !, ´ ­ ð " [ª ]} ! ’ " =? ![' '% � +  &']› Toutpu¾ qòs=None, header="Set-ž':"° ]a"%s %s�1 ,[OW qString(W )|R__strT$ ‹ o__reprÈ‘'<%s: %s>å€_class__™_ame__ z  ö?js_ò Ü õ# Print javascript†÷ %"" <# Æ type="text/9 &">( õ!-- begin hiding @docu<!.c¡ = \"%s\";" À    // end h³iding -->
  †</script ñ&""" % (self.OutputString(attrs).replace('"', r'\"'))
P Idef 2  D !, 8 q=None):(  { ö# Build up our result 
  U = [] ƒappend =6 . „ \ û
First, the key=value pairD v("%s=%sñ Pkey, · q.coded_: à \ ñNow add any definedã eibutesa !if Ps is ü û  G " =k –_reserved= @tems RortedŒi 5())% 0forÞ !, ¥ A in # 
i #if Z== ""  ‰ …continueV    ifY @ notV ¬ :  m ñ	expires" and isinstance(® W, int v   Ë—"ã[key], _getdatM ) E #elÁ  ‡ max-age‡ 'd‡ Ë } 	comment} ?str(?quo#inc^flagsÅ  IŽ2strƒ
 ù .seG C h
J Ã
haReturnÄ£r ñ_semispacejoin(rC‹p__class( Q__ =  ðmethod(types.GenericAlias)


#
# Pattern ^1fin1acookie ðThis used to be strict pars[ ba o· qRFC2109  ð068
# specifications.  I have since discovera ñhat MSIE 3.0x doesn't
# followñcharacter rules outl’iƒ 1oseo  f cAs a
#3µ ; Óhere are lessØ ð.
#

_LegalKeyChars xó"\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\="B V†D += U +Jq[\]'
_Cm‡ åÑ.compile(r"""0\s*  @# Op^�al whites%Ó at start of Ò A €(?P<key>   4# S5 ±group 'key'† [++Ë  ð"""]+?   # Any wordu °at least onf hH )w   A# En@ € (%   Ànal group: tðhere may not be a value.
    \s*=\s*  Á# Equal Sign2 �(?P<val>/ ñ
   # Start of group 'val'< þ"(?:[^\\"]|\\.)*"E ñ
# Any doublequoted stringA |1  A# or, ð\w{3},\s[\w\d\s-]{9,11} ±d:]{8}\sGMT° òpecial case for "expires" attN z à[""" + _LegalVmÓChars + r"""]nê Øword or emptyë )Ù  _# Endf,)?+ 	 8 ‚optional­:	 1 £`number€ bspacesP�(\s+|;|$¾ | áing either at > À, semicolon,2EOSP ð """, re.ASCII | qVERBOSEb #   âñbe removed if safe.


# At long last, ð	is the cookie class.  Us� Bthis ñ	 is almost just like
# u' Qa dicC‘ry.  See : Âmodule's doc¼Uñexample usage.
#
u a BaseC† (O !):ƒã"""A container�  ›Aa se\ÁMorsels."""
3 2defÊÐ_decode(self, T  �"""real_ , ( d   =+ $ue> qSTRING)[  : ð Called prior to‡ t-aD"'s@ Q from\unetworkB  representa5À.  The VALUEg Ž– R readF EHTTP? bheader ‘ sOverridu1funŒ › amodify„ Pbehav² #of¨ © B  ;    `returnÃ 3S en+S%> ì R) ! ³%ryU!be­ssignedFE€strval =ÉF(valí `! ,  6valfƒ__init__b§input=None¼1if  " µ   æa.load( )T 3setQ 0keyHúc ñ"""Private methodº?setë@Mõ �elf.get(n ¡&() M.‘  …,  ë¥.__setitem= Må # À value):
     ð"""Dictionary style assignment."""
'   õif isinstance(value, Morsel):&  * w# allowI ó  of constructed7 ùs (e.g. for pickling)J ñdict.__setitem__(self, key, ‚ / Jelse‡ Ðrval, cval = 9 .3 c_encodÂ @  ¹ % o (c B !)
˜ £def outputŠ ÷!attrs=None, header="Set-Cookie:", sep="\015\012"*ñ"""Return a string suitableIHTTP�±result = []�  ²  sß Qorted• . &()Û  `Ð  A in # .^ r.appendß.ë å à X r¿ ’sep.join(¡ +“__str__ =1Ac__reprÍ §Û BlÖ £'%s=%s' % à3eprë )Ý ‘'<%s: %s>6 !ñ	class__.__name__, _space#l) -3js_E ; !, K0ù 
šJavaScrip‘r²YÎ È .Q_null� 
2loa š, rawdataaLoad c7fs from (pN `mably µ_COOKIE) or	2  1Í0.  S  WV $ E 'd'B ú	is equivalent to calling'Bmap(Ý˜ , d.keys()
 Ls‚H, Ü 2€.__parseMCing(/ Ü÷#ìñupdate() wouldn'tÐ Á our custom é 
%__ x /v Z
 3  « r[key] =˜Q $ý	Ð  9 ü ‚, patt=_\wPatternPi = 0k 	 °# Our startéUpoint{ Æn = len(str)6 €# Length“w1 š  d_ T![]6 0# P‚yd (type}… triplesB m@_see} °False   # A³=ð pair was previously “runtered+ z õTYPE_ATTRIBUTE = 1h  pKEYVALU 26 ±# We first Ð ð
 the whole cookie string óand reject it if it's
  ð-# syntactically invalid (this helps avoid some classes of inT 7ionL •attacks). õwhile 0 <= i < n:  � ð# Start looking for a c e) Ñmatch = patt. ‰(str, i)' qif not ! 
j n sNo moreb     ibreak
S Âkey, value =Y ê.group("key"), Kval"“ 7 jend(0)^ þif key[0] == "$"µ Ó ›orsel_seeC ·   €# We ignß ôattributes which pertain to thÿ 	ç  C   ð# mechanism as a whole, such ¦"$Version"ä 8  ú# See RFC 2965. (Does anyone care?8 zcontinuö  ðparsed_items.appFñ(TYPE_ATTRIBUTE,D31:]©)c "elfÑ.lower() in MO¯._reservedx)I3· string]Vretur0 ß   #ifa~is None� & ?keyÅ _flags5  9 Bk, True= A   ?els˜   /#  0 	e Ä ‘_unquote(´)Ï  1 is,qp rKEYVALUuq, self.Q o_decodx  õ mtÃ! =l	%ý ZRR 5# Té“ ò ÝP, appìtÄ1M =| ©  �# current25selZ  ¤!tptp Q1
‹Pif tpß
µ
%  s  Z@rt M¨  Æ šv  !   ‚M[key] =2	 AV ƒ Â	=  \ ¯rval, cval`  # ïa__set(3 
t ,  S 0 ² 1


<� SimpleCãC(Bas )1"""— & “ supportsÈsˆmzÑs.  When sett|À   the valueð using the dictionary assignment nota ñ	, SimpleCookie
    calls; ñ	builtin str() to convert Pvalue a  ping.  V sF óreceived from HTTP are kept as3 !s., 1""" Adef W Ð_decode(self, !):!  Ÿ ñreturn _unquote(val)$ 
# D /enD €strval =‡ A ; ^ ! 2, _d  Q)
"""Ê ðserver classes.

Note: Base  ñRequestHandler doesn't i~2anyr* b; see
ŠA  Qfor s> D ¾ð
s of GET, HEAD and POST,

 ?CGIL  CGI script¼ !It¢ Ð, however, opFallyp ° À/1.1 persistFQconne_As,
aŽ v con 0.3_s on � /
- 
b

Thisf‰ sñ ë  BsŠPcgi-b°Ü f¬Ños.fork() fun° 0 isP presÊ P(e.g.© ðWindows),
subprocess.Popen()5 @usedÁña fallback, with slightly altered semanticdÁn all cases,“ Ï É Z  inT « y€naive --8 
å  C`executa òRynchronously.

SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may ej p arbitrBpPython Yð or external programë  Â that status- 0200ä lPprior°Ê 0ionÇa$—S, so
¢ø cannot send otherY `s such‘ö302 (redirect).

XXX To do:

- log,óeven later (to capture byte count)2 puser-ag"aheadery†  °@resti’goodies
-§ Qerrors ðto separate fileCñ


# See also:
#
#]P WorkM PGroup� ÿT. Berners-Lee
# INTERNET-DRAFTC $ ô#R. T. Fielding
# <draft-ietf-http-v10-spec-00.txt>: 	 ùH. Frystyk Nielsen
# Expires September 8, 1995;  TMarch/ .PURL: ‘ p://www.dÀuci.edu/pub/± /  /Á N 1and Network‡!R7ÿ ·0Comås: 2616à  ðet al
# Obsolete> >068) 	 À            óZ   June 1999
# Category: Standards Track
#
# URL: http://www.faqs.org/rfcs/rfc2616.html

# Log files
# -- H ñHere's a quote from the NCSA` ò d docs about loH � format.C P| The  b  ð is as follows. Each line consists of:
# | ð0 host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbbC      N �: EitherÍ ¢DNS name o ÁIP number of! 0remþ hclientK ” ‚: Any inö ðion returned by identdù Ø this person,G ™ @ - o• Xwise.  ô Q: If ý asent a i\  $ ±entication,¸ +  Ú n  p xDD: Dayƒ ðMon: Month (caler5)& ŒX Year Ñhh: hour (24-	 *¥ `machinf‰timezoneS  mm: minutež|+©ss: second ý:tRfirstWÉSHTTP $  �G!by-Þ	xAddd: ¹status codeÜ ú
server, - if not availablÄ ŠM Wtotalb`bytes ‹ § *R ‘including�  Å Ï/1.0 header*{    ð  You can determb ´  Ý—ôaccessed through%Ã’(Actually²`latterÄ�only trueü �you know¥  ÏQfigur•Q
# at  ê	 Œðwas made!)

__version__ = "0.6" 1all  [
"S{�", "Threa"
 @Base R’Handler",C _Simpl  _ "CGI9 ä]

import copy @dateÔ  ´email.utils l;  ™.p $io
 …mimetype: o
 ”posixpath, eselect hr  ð ocket # For get÷Šbyaddr()$ ¬ yp Ó Äurllib.parse+ ±contextlib
£functools é ‚partial
  ÷   ]SV
‚ð%Default error message template
DEFAULT_ERROR_MESSAGEò""\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD ‘4.01//EN"þE ’ "!w3 0TR/ªð4/strict.dtd">
< >8 <v  C Q<meta
�-equiv="C€nt-Type"`tent=")[ 0;chD‡t=utf-8"K qtitle>Eðresponse</title>
 À   </head>
  Bbody  ÷h1>Error response</h1  p €code: %( Y)d</p$ aMessag! m <)s.% h  A Å explanationU as - %( (in? "</´ ñ </html>
"""

DEFAULT_ERROR_CONTENT_TYPE = "text. ñ;charset=utf-8"

class HTTPServer(sockets 3.TC 1):
/ðallow_reuse_address = 1;ò# Seems to make sense in testing environmentM Bdef i Á_bind(self):h  Q  """OverridM  � '  a „store th ` name.	 9   Ç .o n Ðhost, port = Š , ç E[:2]-    {  3 8�.getfqdn(O )0 c   
€ŸThreading‰! gMixIn,±1�daemon_t(  ”ETrue` @Base[ ÌRequestHandlìjStream" ÷0"""? " r@ " hA a base C.Ó`The fo%ò×1 ofµ ñ& guÚ°you throughÑ3‘as well a- ðexpose any misunderstan4ñs I may have aboutE ± @(so b  don't need? m m  i ñto figure out I'm wrongE 3:-)Ú O ó HyperText Transfer Protocol) is an extensible p 1 onN 0toppa relia" su  tM  ð (e.g. TCP/IP).  QG D  recognizes7qee part# W ß¬ð1. One line identify– 7É0typUad path` €2. An opŒ`al set³ àRFC-822-style ?1ers0 30 Adata“ . Q and   ar¸ñparated by a blank« o ø Qfirst  ƒ · hk"rmi °<command> <Ë ²> <version>  fwhere &  ¬p (case-©ðitive) keyword suchyÁGET or POST,î ] > 0strOpcontain  z q informÌA forhoD  ž “ should bÏT nP/1.0"  ;1".…  enÂ@d us  "AURL    ‚scheme ( á%xx to signifyJ  2 `ASCII âacter with hex$xx ’‚specificÞ  Ša©-s ÝcCRLF b• Òcompatibilityo  ˆ Àwidest rangeð€clients ñRmmendpÂcs alsoˆò LF.  Similarly, whitespac€Ðhe request liñ8ne
    is treated sensibly (allowing multiple spaces between componentsE Eand 4 Ptrail= Qwhite9 1).
( ñSimilarly, for output, lines ought to be separ• Ñby CRLF pairsE Àbut most cli‚ ó grok LF characters just finey ÁIf the firsto " o ²request has" 2orm¬ ò<command> <path> ð (i.e. <version>?@leftË )A `n this sassumedÑ qan HTTPÁ C0.9 x ;/ Aformƒ ðno optional headÌ  ]Ñdata part andE  Ï àreply consistsÓ ø    1 ü BThe * g ù  Ž ñ 1.x protocol again† Qthreeo "s:÷ b1. One:0givÞ f Âresponse codOV2. AnÄ 0set— ÔRFC-822-styleÙ Ç 03.    ¯ j A† ,K(  ó  ! ; arqa blank˜ 	î —  × ewàÄ<Ç  Æ %>  cstringùZwhereù >N 0 ("Z”/1.0" or  A1"),ñ ^ m Ôis a 3-digit ˆ O€ indicatl¡success orD pfailureZ „ L,)` ¾ ‹’@ Àhuman-readabÜè € explainp Awhatƒ
’ Umeansh�is server*"se@Œ ‹  œ Åœ  th;aalls a‰ @funcî� specific. 7 G etype (‹S).  S+ BallySaN  SPAM willDðhandled by a method do_$ (I QIf no‡ Dsuch" !exL … Þ æsends an error¥ to#A Š’.  If it D , `is cal‡ Ðwith no argum¸[“  fNote t€Ÿ@nameÊ0cas‚nsitive Ž Ò qAspam�  )€differenWE s† quvarious:Pdetai˜ cðtored in instance /  ,-}P_addrš G#he E IP   xb (host´bport);ó -O k , jË O Ê  Œµbroken-down´  7C i %a¹ òof email.message.M Ò (or a deriveR`class)Ot y X 0 in=a­s Arfil–!a 
 °object openh a N po¯Roned W¤ stÏŽõRinputî ïl wb .
 l 0wri*�ðIT IS IMPORTANT TO ADHERE TO THE PROð+TOCOL FOR WRITING!

    The first thing to be written must ñthe response line.: nC ñfollow 0 or more header( ñ s, then a blank R, and 1theC òactual data (if any)c P mean™  of3 	\ ¢ depends o‰  ¦ @comm_ ±executed by8 ð	server; in most cases, w� w !isŠ �returned¸ �re should¹at least onã  š BformTð Content-type: < a>/<sub
 $ Swhere   s ðregistered MIME @ !s,¨ ðe.g. "text/html"} rplain".g 2"""	 #êðPython system version, trunca.cto its¡component.s Csys_3 B = "L @/" +P . ¸.split()[0]y ” software{ ð .  You may want~€override�sy ¼  `ñat is multiple whitespace-separÃ cstring'"# iReach   B ³s name[/¿ ]r ¯ î �BaseHTTPð _ "__å ãerror_message_ª ñ= DEFAULT_ERROR_MESSAGEL1 c)_Ø / ÂCONTENT_TYPEf ÷ default requestK0Thi¥ly affects´¡s up until~ #Spoint  ;Q  à %@pars	s÷ mainly decides whatL ðclient gets backW `n send¼Pa mal%ed·  f m0# M’Bweb x$s ä 0to uñ 0.9, i.e. don'tY ‘ a statusUK 8 _Ë § ¯ H C/0.9Adef á , q(self):Ô  @"""P% a³ £(internal)^ (  Ao º0sto¶idlf.rawh  ø ;€bresultw J  1 Ç , – S.path k Ú 5and³ , }s¢ RÓò True for success, Fals Ãfailure; on   ¦’y relevanë ¥ ¹Xð has already beeï !nt�  … <   ¤ Þ @ = NM` # set› – Pf !on(Ÿ 8
ê =" =7
F ñclose_connection =*% f    X !tr)Òÿ , 'iso-8859-1')> L  .rŽwp('\r\n1  ( $ = ‚ X Zwords z$ Ðif len(words)‡ == 0:
  Õreturn False
 õ,if len(words) >= 3:  # Enough to determine protocol versionD  e  1 = K I[-1]  :try�  5 dif notP þ.startswith('HTTP/')4  8 ùraise ValueErrorj  ! Sbase_“ –_number =h Ûplit('/', 1)[©  ? : P  !.sF M".") ÿ*# RFC 2145 section 3.1 says there can be only one "." andJ  �  - major  r minor Ò `s MUSTG ¯treated asA ÿ   separate integers;* !- xä2.4 is a lower8T than! º13, which i	 @# !  p#isF > O12.3€ ÆLeading zeroá ýignored by recipients.Ã Í
¿o) != 2I$
K   =@( _[0]), *1]†except (¸q, IndexÄë °self.send_eæ(ð  g ±ÿStatus.BAD_REQUEST,, µ"Bad requesv„ (%r)" %æ
´  b 	9   $if5 dP>= (1V­À 6� d"µ ^/1.1"—5 £close_conn?=¸{    O2, 0L0 ¢ ÿ_VERSION_NOT_SUPPORTED[qInvalid A (%s\@ h·GÏ	Ì OH2 <=Õ<Õ	Q Y	 þ U	QesyntaxP± Jlineì PÕcommand, pathF&:2FÝ_)àÔÕ 9 ITrueþ 3if n  _'GET'‡#	 ‚' , + 1 E/0.9…Etype2– 
. < 2ð 7ð self.path = comÓmand, path

  ð$# Examine the headers and look for a Connection dir
 5ve.C Etry:  W Tself.K ó= http.client.parse_ () irfile,A  E  q_class=H €MessageC )O iexcept„ ÿLineTooLong as err¿  µsend_error(L “ þHTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE× "~ ® too long"! †str(err)Ã  w Åreturn False� Ü   › Eó  ­Þ _„Too manyJá Ç  à î ( ±conntype = ñFf.get('£V', ""P 4if 9 ÿ.lower() == 'close'ú  _4  é‡on = TruvPlif (   � 	T °keep-alive'Cº  â  µ Ðprotocol_vers¤@>= "¶o/1.1")� 
Ã†n ExpectÀ� e U4 Q(4 ü ï"100-continue"þ   8 request7bif notprhandle_± [_100(d œ^ ü-Ndef O  ‹S ò"""Decide what to do with an "Q*: -É.•!IfŽ4B is ¿ i± <  ‘iñ response, we mustª Ô   d| PeitheÊ6100= ÜUfinalH u beforeF @waitw   !‡ð body. The default¦ “to alwaysO dG 	» ð. You can behave differently (p Xexamp0rejÃÓunauthorized ‘ Ðs) by overrid± ·this methodYT ƒ should îð (possibly after 5ingÎ aÉ í Rse) o,  ë;  Ø c F Åœ 5"""  U.w _á`_only()z†CONTINUEê5  ·Pðs()
        returnñ True

    def handle_one_request(self):"  & A"""H% ó  a single HTTP / .L  * ð$You normally don't need to override this method; se ue classq ð__doc__ string for infX °tion on howU ¼ ‘ specific— F ÷commands such as GET and POSTµ 5"""4 6tryø  Ò  D.rawrline =  �file.read u(65537)K  > aif lenPE @) > 2 6p  6 ] Œ Z Y = ''X & P_vers* L °send_error(ßúStatus.REQUEST_URI_TOO_LONGå  � ireturn¤ cif not*
Aó Áclose_connecé=« a  m FparsÌÈD Q# An é ù code has been sent, just exitÏ  = y  @mnamr'do_' +ï l	@ qhasattr!, > ¢  �	J  Š   ¥ÿNOT_IMPLEMENTED,0 Ã"Unsupported�‰ (%r)" %· ÞÁm = getÑ 	 * (V á w@Ñflush() #actu9 ù ã the response = almZ%e.e ð except TimeoutEÁ îef0#a = ò or a write timed out.  Discardžƒe  qµ 3log%""R£H �: %r", eì  ÜrEt š+$Ž„multiple‰s(˜ecessary.Ø» „ q á T	Ð VwhileØR 
su O r  ã  ëO . ,‘0, mÃ ñge=None, explain 
	ASendÓTlog aÕWreplyáÑArguments are{  í *l : !an:&    v3 digit§*¨ :m‹ opºQal 1 »Çreason phras´S   ö*( HTAB / SP / VCHAR / %x80-FF | -  €defaultsðshort entry match3	>ð code
        * þ)explain: a detailed message defaults to the long entry
  �matching+ õ response code.
0 õThis sends an error , ð(so it must be calŽ –before anv ñoutput has been generated), logsƒ ] Ò, and finallyy Œ óa piece of HTML Ã @ û GuserÇ 6"""Ô Etry:U  €shortmsg� Ôngmsg = self.ê  s[]5 °except KeyEN q'???',  F %ifºzis NoneI ×$= ¡ ; þ  ;  =5msg: Ø Alog_/ ("Ù E %d,‹ A%s", )=  _(@ * 
ðheader('Connection	vclose')•3# MÆ@bodyÖ öomitted for cases described in+ñ#  - RFC7230: 3.3. 1xx, 204(No Content), 3 ¦t ModifiedØ C õ1: 6.3.6. 205(ResetC £ =³ 1if p >= 200È  e )ù not in (HTTPStatus.NO_CONTENT,0  4  0 _RESET3 æNOT_MODIFIED)): _ #Ln  ðto prevent Cross Site Scripthyattacks© ö# (see bug #1100201Z c c‚  =) 1lf.z_Þ¹_format % {V  9 '” "':Ž B ó ': html.escape( î, quote=False)['#>  
> 	{ }Ý ä !.eHp('UTF-8é`replacë Ò  †I"§r-Type",)[ Z_type| F  e íð-Length', str(len(§ &))? ; Bend_€ 's(‹"if @commŽ�!= 'HEAD'Ô J 
CL ²wfile.writem Û deM &nd1 . a=ü˜a"""Addh ¨ ß �s buffer˜ !loÊ¬:  EAAlsoYÓ two standard` as withz õ server softwareX qversiont  e@curr08dat9 r	î±log_request(Œ´ Q_only& [Àsage)
      ò  self.send_header('Server', óversion_string())
  : DDate8 —date_time: ; Adef p àresponse_only(N ñ, code, message=None):6  t Ä"""Send the =  ¶  D E."""- if ³lf.request_È æ != 'HTTP/0.9'\  ` $ifz @ is } 
  $  ¤ 2 inˆ s+  / Ê + =. [E E][0]°  .   OelseL )''7 ãif not hasattrJ'Ð—s_buffer'I h    t.( J = [– & ù
.append(("%s %d %s\r\n" %™  d   “ ”.protocol‹îP)).en(D  H À'latin-1', '�act'))
/ Vr ÿ , keyword, valuKda MIMEE!to\C "s 9V0že 9  ¯:­+ (!ƒj L $if[þ.lower() == 'connectionZ‚
. Klose)  ] pc _Q y = TrueÒ BelifÚ	X Ÿkeep-aliv] VFalseKsK=†ñblank line ending@Ss>-£}!b"u’>Tflush6 (#
  ] Ú /ifD @ ñ.wfile.write(b"".join4Z;© ¤ ¥}å ÑClog_ÀR 20='-e0ize
 À ó"""Log an accepted > .Ú w @Thisßšcalled by�'(), P°isinstance(¨ , HgStatus†  e   ! =Î.ùÓ   3 Ø p('"%s" F5s','  + 	 8 Î  pQ, str‡ ) Hsize d Derroðformat, *args):
      ó  """Log an error.

  ðThis is called when a request cannot be fulfi# U.  By? ódefault it passes the message on to log_ '(){ ÑArguments are8 ¿same as for6 AXXX µ �should god  v ‚separateä  A m 6"""õ Xself.— âformat, *args)) 0defD »  5 ,› * :	b”arbitrary† ¹ ñis used by all otheï õ
ging functions.  Overridee ðit if you have specific§ = iwishesp “e first am�, FORMAT,õaÏ A str}  orˆp ¶ a!bef ped.  If& < …contains= Ñany % escapesRie  ¥pmeters,G #y Ébè Ù  ed@subs�nÅ ös (it's just lik: xprintf!gðThe client ip and curr pdate/titåre prefixed toÄ ?eveÈ
Nõys.stderr.write("%s - - [%s] %s\n" %S x (Y’.address_Š?(),1  1  ¿ Á _Á 7 å%ãätversionC  ] )Ø`Return¬Ð server softwµ< @.Ù r6  O .7 _. r+ ' ' +È 4sys xÙ  G  , ë ¯stamp=None¦ àñ 8 ¯0ted
 $ ažy header¼ &ifk  ( n  â  R Š ! =+ . %()µþ Âemail.utils. Ú (- > ,
‡gmt=True”Ý ô  [  á 4matë 0log	â ?nowº ôyear, month, day, hh, mm, ss, x, y, z< Plocals F(nowþ ðs = "%02d/%3s/%04d  : U" % (- Q  n  æ . Qname[
 2], — ‹ m ks>pweekday< ð  = ['Mon', 'Tue 0Wed 0Thu 0Fri 1Sat Bun']E u C  ýŽ 1'JaZ 0Feb> 0Mar !Ap 0May OJun';  ul 0Aug 0Sep !Oc‡ 0Nov 4DecŽ  ‰ %ðlient address.""C"

  òreturn self.client_address[0]' ô# Essentially static class variables* ñThe version of the HTTP protocol we support.„ Ñ# Set this to, @/1.1  enZ a automs ‘keepalive9 R _o 0= "k C/1.0à ¡# MessageC­ @usedY Ñparse headersL 	' c= http.S  ä @hackH ñmaintain backwards compatibility[ Ñresponses = {  yõv: (v.phrase, v.description)% �for v inòStatus.__members__.values(1 B}


”`Simple¸ ÿRequestHandler(Bas  "):Ø 2""": o " r< " h= ð with GET and HEADì bmands.@ TÃ serves fil 1romñcurrent directoryE 0any#"it„4sub  `ies.  K MIME type W ò is determined bgqcallingo p.guess_7 •() method¥ eÅ ç €s are idæ�cal excep—a eñ ˜0 a omitsn ð actual contentsÓ  ö ¬ u #""�r±r ¬d/" + _ !__n PextenLñs_map = _encoding ‰_default[ð '.gz': 'applicaSq/gzip',S  ~<'.Z" Éoctet-stream* <bz2, yx-bzip2' xt Cx-xz# }"Ðdef __init__(q†, *args,�=None, **PEgs):´ &if& @ is )   Ö >Óy = os.getcwd    r .% ufspath( L. uuper().± « › Ô ado_GETÒ ±  P ! ar9. `   2f =yPsend_‘¯ Jif fá :try  D Ö @copyq2(f,Q w Í  ) 0finÀB  øYose()Ò  ãÓ   $Ô )}   Ü 
R¢Common cod‘	 õ •"nd¬�A  Êa z$erÉ 8 Rb n�either aÚñ object (which ha»•be copied³!to!`output‘1 by  ­‚er unles™ @comm� 1wasl¬  Pmust `  loÃF dš õll circumstances), or‹ ð None, in which ócase the caller has nothing further to do.

  5""" ðpath = self.translate_ (  
 ). …f = None `if os.% p.isdir( %):   r ÿparts = urllib.parse.urlsplitf  5  ifÇ  < ` Ëendswith('/'b  1 ð# redirect browser - do@basiùy what apache does¨  F ô ösend_response(HTTPStatus.MOVED_PERMANENTLY =   Anew_µ A = (	 B[0],È %[1
 �2] + '/',‚  E  A 37 /4]r ?urla "unc” = ð ðheader("Location", 8 ?url6 ÿContent-Length", "0"8  ]m .s(# jreturne áfor index in "
 P.htmlk  "y 8  % =¦Ajoin¥,O ‚ Óqexists(D s  `  ð" =L ÌYbreak Nelse© ù ‘Rlist_Í1ory¯ ¨ Tctype³`guess_ & €# check 8Ptrail	ó"/" which should u õ404. See Issue17324² ¢# The testL Ðhis was added�  ç_httpserver.py< ôHowever, some OS platforms accept a Ÿ `Slash [ † filenamh#Ÿ òdiscussion on python-dev and¼ ÷ 34711 regardingŠ w  , Prejecæ5 ofm  s _‘   s’ D 0if î.‰;"/"¾?Xerror<ñNOT_FOUND, "Fileß[found)”	g:try2 ‰4opeËF'rb'"!exZ0OSE… 
9 ¢ =£  ô±os.fstat(f.Ô6o()¨  @U# Use²cš ifossibl , ðif ("If-Modified-Since"…× V“  4   ö <  Wq-Match"‚"inü< Ð > ­# compare { x@timeG la# Úm  G� ( d    im1 email.utilW@rsed�0to_  k ð (
               öself.headers["If-Modified-Since"])
- 
 ó	except (TypeError, Index ƒOverflow BValu' -):K  Q ð# ignore ill-formed v5 s/ >pas Oelse^ ÿif ims.tzinfo is Non+ � �obsolete ‹ ÿ	at with no timezone, cf.š @ ð https://tools.ietf.org/html/rfc7231#section-7.1 N Qims =À ‚replace(È P=date‘ .  – N.utcª ’ < = @ ô# compare to UTC @ ¡ of last m2 caÓ Ë  * _* % =C .L P.fromÌ ostamp(F  ‘ afs.st_. ,J  = 	 < ý# remove microseconds, like in ÿ‰ 	Ï  .¨` O=0)
H iD<íŒ Ã ±ÿsend_response(HTTPStatus.NOT_MODIFIED D   H  G ý(/ f.close& areturnd
ô n ¶ *OK} . � ð("Content-type", c 4 ÿLength", str(fs[6]); ELast
-",¿¡  ½_x‡_string(šb m7fh c
	‚Rraiselðdef list_directory(¨ g, path}�"""HelperÒ¥produce a 6 E Ðing (absent iÞ.Â").k  ARì« Yñ	either a file object, or` (indi$Vng ané  @s).  In A ¢case, the ý s } ‰ P, mak™ 5theB ‘interface3 psame as½ o D (· 5"""< :tryd ?` = os.
 Adir(<1 ˜1 OSÝ
<  l.t eÕ Å§^FOUND[à"No permission£ ‹ ž"¼; Ö¦  1 ð.sort(key=lambda a: a.lower()3)
  er = [] Etry:  # ðdisplaypath = urllib.parse.unquote(self.! ,:  >  öerrors='surrogatepass'� ðexcept UnicodeDe E4 ¤  Ÿ X 
Õ Çhtml.escape( !, ß f=False< öenc = sys.getfilesystemencoding(* ÷title = 'Directory listing for %s' % q >òr.append('<!DOCTYPE HTML PUBLIC "-//W3C//DTD µ4.01//EN" 'F |ð'"http://www.w3.org/TR/÷ ç4/strict.dtd">zƒ  ( �>\n<head# Pmeta e ÿ-equiv="Content-Type” c" a="textŒ @; chX`t=%s">6encN’ YR>%s</
 B\n</ž 1 %  7 AbodyÉ 1< !h1e 0  hr. (ulõ  ¹qname inÍ
‰Afull A= os`.join(~ ,  ™  Ÿý  s = link   	É1# A! /<dR�ies or @ �symbolicI s? %if‘ disdir(ª )Á •  Š i + "/"Q  ) ° &  	w  / x @x ‘# Note: aé d to a yQÁs with @ and(  /Ç UÀli><a href="� _a></li>T i   % (.(æ  4C  ’±s 	±)kæ 0/ulÕÛ/€7>\nÐ ed¿2\n'Ç2r). f(enc, ·=> çf = io.BytesIOpf.writeA Foded¤ †f.seek(0 Wÿsend_response(HTTPStatus.OK*  5er(€t€/, e9 % cr H õLength", str(lenÀ f>  ¯ = sö ‘return f
}àdef translate_C ,  ‘D"""T' ð a /-separated PATHù the local Š ‚ syntax.k  §ðComponents that meanó special things to the local file system
  ó0(e.g. drive or directory names) are ignored.  (XXX They should
F õ
 probably be diagnosed.)
h 5""" õ# abandon query parameters# ppath =  ÿ.split('?',1)[0]$ 	#$ õ4# Don't forget explicit trailing slash when normalizing. Issue17324p 4 _4 ž ÷rstrip().endswith('/')5 %y:  . Ó ð	 = urllib.parse.unquote( ÷, errors='surrogatepassS ðexcept UnicodeDe E4 i ¤  w  m@osix .
 	 ‘ ( Pwords) 4ath–ì   Ñfilter(None,  D  W … = self.m!1for1 1 in sÓ `if os.C  <  ¢(_ )º 	  7 ²(os.curdir,-   )H  ˆ1# I×ñ components thatòÁnot a simple7/¬ ±  J   ‰continue  © " =† qth.joinR%if�\
® G e+= '/'_ areturn d€def copyä(^ð, source, output ñ"""Copy all data between twoò ’ objects.`  å ø	The SOURCE argument is a0 P openo… reading³ q(or any™ )! a$ á() method) and¯µDESTINATION? r @writÔ6(or7 r  $ es Þ @only• "soÄ `overriÇ  Q0s wõ ä†to changñ g‘block sizLaperhap„õ	replace newlines by CRLF§ ò -- note howeverŠ0thi”Ðe default ser 0use i/ �  ÎbbinaryÑwas wellâ „tshutil.3Oobj(0 ü \£guess_type^ –
PG# À ' 3 of‚ A7bPATH (? Í)* RáRvaluee h ngW  kPform h @/sub ,L@usab· pà MIME Content-( w headerk  ×bò Ù ation lookkÆ's extensionn pv “ tw  |.' �s_map, us˜ ap~Z Æ/octet-strea�aM‹ ;&itx€permissiá 1(if† À    slow) toó! look inside the data to make a better guess.

  5""" ðbase, ext = posixpath.splitext( )- !if* õin self.extensions_map:'  g _retur( U[ext], z ¯ext.lower(m J	ñ, _ = mimetypes. _ î  Ù  Æ î ñL'application/octet-stream'


# Utilities for CGIHTTPRequestHandler

def _url_collapse_path(‰Š ¿ÀGiven a URL  €, remove¤ñ ra '/'s and '.'  ‚ element _ Ä òany '..' reference% Ø Ds a / dK M4ImpS àsomething akin„ðRFC-2396 5.2 step 6 áparse relativeN !s.… QThe u#ày of this funcN° is limitedE pis_cgi s !odå QhelpsG pprevent‹  • ô security attack	R¡0s: w  reconstitua ñURL, which will always start with ^ð	Raises: IndexError if to†WQoccur;  h÷ @ Ïò# Query component should not be involved-ñA_, q5 =I`.parti0B('?'K ) � = urllib! £se.unquoteð6�# Similar_0os.7 ( @norm 7 à) but specific6 3URLK  & ò semantics rather than local opera£Vystem- Þ _Í s—’3('/Ö Ehead! [O U 4 1 in  R[:-1]9 ˜1if $ !==ñ   V ‹.pop() #ÖAmore8 Í QpriorP { D $elc  |l !l 'k qappend(H  µC "thÂ 9 Atail  s¬ { �  }( ;    & Y     † )'' ý   ù  B Felse® C 2 ''º"ifì& •?'.join((< "))@ Ôš = I  +#5 ô 5), A Œú‰b = "/"6 R b rS+1 ñ



nobody = None
ã b_uid()Ò ð"""Internal routineVBget - ð's uid"""
    globóal nobody
    if :   creturn  6try ¡import pwd �except I VError+ J !-1* 	F ƒ   =H ².getpwnam(' Q')[2]4 ^ ;Key[ ) ö	 = 1 + max(x[2] for x inV aall())L Ž : ò


def executable(path)¼ q"""TestO " ˜ file."""N ‘os.access@ þ , os.X_OK)


class CGIHTTPRequestHandler(Simple 1):
^ P"""Co# 0te & ò server with GET, HEAD and POST commands.? 1GET % qlso sup·prunning— t script4 9TheL ± is *only* ­ amented;CGI=  ¹ ñ# Determine platform specifics# ð
have_fork = hasattr(os, ' "')Â €# Make rtð unbuffered -- we need to read one lp  ‚then pask p# the rÌ°to a subpro¯@, soJ ¥can't use c ainput.« Ârbufsize = 0˜  50do_uS(self2 8@"""S¦" aHró“ " @ThisW VU 3 Y  0if t ‡.is_cgi(|    2run À   Belse×    ) `send_e°(+      rýStatus.NOT_IMPLEMENTED,, Q"Can Ñ   •"Î 6q Ohead8 �Version oá 0nd_' U that¸U ‚ ª rÊð 0 �.Ã ‘ i •Grwhether¼ gÀ corresponds2a�/R¿ as TrueÏqupdatesÕ�cgi_info @PibuteJ  ïUtuple¨Q(dir,)í £ .„  ŸTires 
†  ^  … pFalse oÉ Gwise§ rIf any « Æ¢is raised,ª 0allþ Áhould assumeÝ¤ • �was rejeck¡as invalidþ ÷ act accordingly‚  »vdefaultW atŒ dtests ‚ ånormalized url„ bbeginsf W!ofÂ `stringŽ Ä |¢directoriek ,(‚ð  next characteró�a '/' orP 0endë Ž [ )Í  ò M   ¡collapsed_Ÿ t= _url_  NÒæ 7 £dir_sep = + Àed_path.find£('/', 1)
  ówhile dir_sep > 0 and not collapsed_path[:$ õ] in self.cgi_directories:T  [ . + =H R.find† # +Ž (if‹ 
R ­head, tailU � ,o [e ):]  Â vinfo = ^ 	' µreturn True  qFalse

 ð = ['/cgi-bin', '/ht
 ]. ðdef is_executable(Ž  , h)õ ñ	"""Test whether argument( v is an D ‘ file."""‘  ƒ¨ # (a 	„ opython€ %! P? y script} P` = os.{ “.splitext‰  ¥   ©  Û€.lower()e€(".py",  6w")¸ qrun_cgi¶ 
0ESe a CGI— `dir, rV=Å 6 ©   =‡� + '/' +0   1i =�Éˆlen(dir)ÊXfi >= 0Ó î snextdirG :[:i™  ¡  ‹ S[i+1:8 >   oD  :¡.translate«(C  � ´  5 %if‡eisdir(F C )   'N  , 	  š 	W  .  + Jelse  Rbreakà   # %ßõplicit query string, if present.�  š C, _,+ =¶ã.partition('?'Cc Àdissect the & a after ÕÓy name into aN &w ñ# a possible addm !al#à, to be storedÓ–PATH_INFO¸  = ¼ Pœ?if A¹Ç =  F '[ién<  F, ''|! ø 
 ø   t J…!  I 	Ñ  Zcexists‰ K ŠÜµsend_error(}  Â  ýHTTPStatus.NOT_FOUND,& ‡"No suchƒ (%r)" %Õ
¦  Z “K !if¹  is® ¹ 3ŸFORBIDDEN¹  Å ï ;qa plainíÅ À        ispyó = self.is_python(scriptname)
  "if& õhave_fork or not ispy:'  . !if U £executableY Zfile)3  7 0 ¹send_error(T  !   ÿHTTPStatus.FORBIDDEN,* R"CGI Ê 1 is’ Š ƒ (%r)" %! 
ë  h   ureturn
^ ÷&# Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html> ñ"XXX Much of the following could be prepared ahead) Eime!E ð env = copy.deep	 ¶(os.environ®ôenv['SERVER_SOFTWARE']êÿ version_string(7 7NAM3 rserver. _0” ò['GATEWAY_INTERFAC; š'CGI/1.1'- ™ †PROTOCOL™ “protocol_¢ 7 2ORT3 3tr(5� KportÓ âREQUEST_METHOD=  óucommandg ðuqrest = urllib.parse.unquote( Y ‘PATH_INFOT ? N …" —TRANSLATE| ò translate_path(< _ vSCRIPT_‹™
e ÁQUERY_STRINGŠ Zquery$ ±REMOTE_ADDR# :õclient_address[0]4 Ôauthorization9 •™ers.get("" "º 9if  
ê	 * =+ g.split‘ ‡yif len(9 j) == 2Z , mþõ base64, binasciiÖ  $   ›‚AUTH_TYP¬	` 
 0   Ø ¡[0].lower(Ž ~"basic"”  < +tr$   	z Á[1].encode('Ì 'jA  I 0.de? [bytesF-.\L  E „ „except (w .EÉP, Uni‚  ù k Opass� OelseX ; ö 	 R/':7a q  EW2USEW	~ G #  / UIDENTì \4ead_ð 'content-type')Ã;Non‚ vCONTENTÊÚ«_K _K ]À     else:
   ô$env['CONTENT_TYPE'] = self.headers['content-type']
= klength. U.get(2 # %')4 2if  :  O 	† aLENGTHˆ , + referers  
l  m  ÁHTTP_REFERERk + l oacceptk  b_all(' V', ()Þ Ç Z aACCEPTY ’','.join(3 . /ua^  Ê('user-agentÌ /uaÇ ’USER_AGENq %uaÅ ùco = filter(None,Ú ¬Î ·cookie', []Ï  0_str3', È &coÄ 6if &   RCOOKIY- ¤ Á# XXX Other <#* z# ñSince we're setting the env in ÷parent, provide emptyC ð values to overr#  previouslyU  " 3 Pfor k^ à('QUERY_STRING	°REMOTE_HOST @º,C  Ü 'Û ª",   “)Mõ.setdefault(k, "")
h °àsend_response(p öStatus.OK, "Script output follows"ÊC cflush_(a ñdecoded_query =  °.replace('+' '1 #ifkŠave_forkÐ  # Unix --  Õ as we shouldÕ  9‘args = [s¾ |   if '=' not¥	¢ 
m  -  I ‰.append(+  ' Pnobodá 	 Z_uid(" (awfile..Á() # Always  q beforeÙ 9ingÏ �pid = os.ö Y 0if  N!= 0¿ 1# Pß	N  ± ppid, st%±os.waitpid( 0¹  . ú# throw away additional data [see bug #427345n ? @whil€plect.se !([r]@ ^0)[0]Ç  E !if³7 {.read(1ò +  ]breakû @exit–R û sðD_to_ N(sts4if ! ¤ � òlog_error(f"CGI „:  x {E }H´ ireturnµ [# Chiá>tryƒ   Y  os • Û !ex·0OSEº [ À           p[ass
  ðos.dup2(self.rfile. �no(), 0)0 w+ 0 10 Ðexecve(script2 º, args, env1 }except:u � óserver.handle_error¶ �equest, ' êclient_address`  ü åos._exit(127)
k Jelsey û# Non-Unix -- use subproceGoimport ¶cmdline = []x  “ "if» —is_python,)• / Ànterp = sys.]iutableS ( 1f i+ ð.lower().endswith("w9 "]   9 Ñ# On Windows,ú —  4 b, not  E w  B x # =� t[:-5] + :-4: 3 (> `, '-u'7  	j aif '='� Žin query*9 �.append(& 
3÷log_message("command: %s",Õc.list2R ( )N t… bnbytesz(length6 öp (TypeE×b, Valu £ Q 0¢d.Popen¨ ,*  o fstdin=ã_.PIPE8 ?out9 #?err9  Penv ==Õ 
ihãó  == "post" and _>> 0Q@datay-Rread(3 
m Q sA :Non°ñ	# throw away additional 0 ú[see bug #427345=PwhileAÁect.select([ØÏ“_sock], [ ^0)[0]Û !ifM9 .recv(1‡  Ï Ybreak‡PstdouŒ tderr = p.o€unicate(Ð 
(q Ibwrite(B 
%  ºQ ¸ @  Âq'%s', s- 
D "p. .close(  ?out PstatuÂºp.returncod¿   %   R"CGI 	 ‡ ] 0%#xoj 
› I÷ ¹Y ðed OK")


def _get_ðbest_family(*address):
    infos = socket.get    (   $ 3 , Stype=3 ¶SOCK_STREAM! Tflags" ¢AI_PASSIVE! )H �  , L ñ, proto, canonname,’  Œ Ð = next(iter(™ "s)A treturn H  �  0 ó


def test(HandlerClass=BaseHTTPRequest “  ç T Serv- �Threading2  * ® Pcol=" ó/1.0", port=8000, bind=NonefÀ"""Test the 2 " r„ " h¡   c¢ !.
ÂThis runs an. s™ 1 ond  d A (orO  v £ argument)C 1"""K ¹ ÿ .3ess ,  ˆ = _get_! ¼ Í )� )F ú ¢_version =»1colr HwithI(g (, D ¢) as httpdƒ |Bhostu " = .Ð’ 
  a()[:2]g  4 @url_8 p = f'[{ à}]' if ':' in  Q else
 8 VprintÞ K  f"*2ingp2on O p{d"} S /   0f"(Ä D://{‰ "}:* f/) .../ ¯ 5 6tryô    C !d.à–_forever(/ ú	except KeyboardInterruptD Ð 4"\n( $ i) ö received, exiting."_  � @sys.  (0)

if __jò__ == '__main__'q  im	 mRparse 5r = #.A�P% Ï '  …_­÷('--cgi', action='store_true'm §  �help='RunF3CGIm'× g  Ôÿ
', '-b', metavar='ADDRESSl  m ñSpecify alternateàAUess 'Z¦ 
 â'[default: allœofaces]´ ‘directory¹ Cd', H 0=os¨_cwd()'» Eive Y º µ vcurrent6 · 
 !Ñ`Ò  Ò
O=intÕ �nargs='?S ³ š  ‹ r Ê  U  È°.C ¥sŠ ifÜRs.cgi Ý¹_¹` = CGIÙ
\ �8 ßpartial(SimplŸ w   Ï=È . Ày)

    # enð,sure dual-stack is not disabled; ref #38907
    class DualS0 òServer(ThreadingHTTP !):0  4 Qdef s) §_bind(self  # ð# suppress exception when protocolš EIPv4V  7 ôwith contextlib.E $(EE h  5   °.socket.set
 Iopt(Y  (     õet.IPPROTO_IPV6,  ÙV6_V6ONLY, 0)@ `returnÕ Xer().þ !)
* 7test €HandlerC^"=h _l,.  Œ X# �%  port=args.
   y  
  ò)
"""IMAP4 client.

Based on RFC 2060.

Publicû:Š  ;  @vari3! TDebug @funcÔs õInternaldate2tupleè ^  oInt2AP ¯ParseFlags# XTime2r  ù ð

# Author: Piers Lauder <p ó@cs.su.oz.au> December 1997.
#< `enticaÙ Q code‹ð"ributed by Donn Cave <donn@u.washington.edu> JuneT ð8.
# String methodL @vers	ðby ESR, February 20012  GET/SETACL/ t{ ÀAnthony BaxtÔ a  @ix�link.comÛ UAprilR Ô=_SSQ ÀTino Lange < . à@isg.de> MarchF 2˜ ^QUOTAš �dreas Zeióñ <az@kreativkombinatR 1200Q œPROXYAUTHN ò Rick Holbert <h	 r.13@osuc2Nov»L 5œNNOTATIONT óTomas Lindroos <skitta@abo.fi´“2005.

__¤ð __ = "2.58"

im} Ì ôscii, errno, random, reEð, subprocess, sys, time, calendar
from &   Z  . Bzone
 Rdelta3 $io- ò	DEFAULT_BUFFER_SIZE

try¡R 1ssl?AHAVEÿr= True
Ž! IÒ RError7 ( PFalse1all[U2", 	 q_stream  	÷"Œî"í + Ø  Ã "]Á7 ñ	Globals

CRLF = b'\r\n'
ƒR = 0
×£PORT = 143 CSSL_ Â993
AllowedVwas = (': rREV1',  "')v ð  # Most recent first• òMaximal line lengthÌ@callâ -  €(). ThisÜÐto prevent
# !  ) `arbitròG  6 !s.��3501 and¦  (¨ ø
 4rev1)
# don't specify a‹ à. RFC 2683 sugð&gests limiting client
# command lines to 1000 octets  ðthat servers should be prepared
#5 kacceptM  up 8P À, so we used ñ use 10K here.
# In the modern world (eg: gmail) õresponse to, for example, a
# searchˆ 0can¬ ´quite largeƒ 0now‡ ñ  1M.
_MAXLINE =ý ‚000


#  C 4s


 R = {
 „  # name   Åvalid states' �'APPEND':" ÷	   ('AUTH', 'SELECTED'),. òUTHENTICATE': ('NON1 & ¡CAPABILITYX &  _ ™, 'LOGOUTi QCHECK> ™ (� ,j 0LOS‰ %  ¾ ¶ 
' "OP‹ ( N "REØ ' Û ADELE. 2ACLÕ hVENABLÙ . ü eEXAMIN% $ +
. GPUNG. *RFETCH£  × *5GETË 6 . ¿NNOTATION':ª ƒGETQUOTA† . AROOT’´
�MYRIGHTS\ 0LIST  	  Š SLOGINY ìp& FLSUBh ³5MOVö— ùƒNAMESPAC, ì INOOPƒ Æ cPARTIA» o æ# NB: obsolete¢QPROXYcÈ  REí ¿ # çGSEARVU @OSETA@S@:SORäÉ 9ED'BvSTARTTL9ñZTSTATU$  Ô‰MÀ     'STORE'#:  ó ('SELECTED',),
 Á 'SUBSCRIBE'+ –('AUTH', / . bTHREAD+ ?   U &UI$ ' 	N~ | "UNÂ ~ | C}

#Ý ýLPatterns to match server responses

Continuation = re.compile(br'\+( (?P<data>.*))?')
Flags+  .*FLAGS \(1 f$ ð >[^\)]*)\)')
In‹ oalDate=  õ INTERNALDATE "'Ÿ0br'P ðday>[ 0123][0-9])- Òmon>[A-Z][a-z  Qyear>)  )Z  E 8hou,  ): 7min@  8sec J °zonen>[-+])D   h2  m 	G ð$"')
# Literal is no longer used; kept for backward ®´atibility.
< Ê0.*{ Ðsize>\d+)}$',ííASCII)
MapCRLF™¡\r\n|\r|\nš 'We’ ñexclude the ']' character from  8A por]!of |ñ
# code, even though it violates- óRFC.  Popular IMAPÃñ	s such as Gmail
# allow yP with” P, andI ðre are programs (in½ ð	ing imaplib!) that can
#) 1ducÜ am.  Th< Bblem\ @this iÔ o'text'ê o @es a— ± we'll parsc �Ð wrong (which`  \cpoint >PRFC
#0 @tricWÂ).  However,Â ðseems less likelyÿ@be aÖ Ã @in p«Pice
#5 @n be`unable0 “correctly¦ X"Ì É  ô1s, ° �
# was reñ edœÈa real-world~ ó issue #21815.
RŽ_ƒ[¹AtypeìL-]+)•ä\]')
Untagged_aJ *ñK 
çK Qstatué‰Ž C 	�ÞBbr'\‘  &•Ÿ 	2€¶A# Weiµöhese in _mode_xxx.
_?br' ,
_ì /= ™ $‘



class§14:
æ @r"""·‘4 client # . €Instanti ³:; �([host[,Pò[, timeout=None]]])= ä , ! - ð's name (default: lo·calhost);
  qport -  ñnumber (default: standard IMAP4% )).? `timeouB tsocket  E YNone)5  %If1 ðis not given or is : ,: ³the global ¯  ‚ �is used
A 2AllÅ ðrev1 commands are supþ ðed by methods of b Asame@ öname (in lower-case).[ Êarguments to^ �converted ñstrings, except for^ ñAUTHENTICATE, and} Tlast Z  ? ÀAPPEND which ‘passed asE "anâ ñ
 literal.  If necessary (Ñ ‚ Ñ contains any= ðnon-printing characters‰±white-space› °isn't enclo~ AwithC ñeither parenthese> òdouble quotes) each  Â  dS�However,ü 'Ü Yword' Ã TLOGINe E RalwayP ú €you want:�avoid havß &anT ‹ 8 Ç B(eg:ƒ Zflags€ `STORE) n  Ò nC O Ä"(\Deleted)"7E
‰` retur�ð tuple: (type, [data, ...]) where ' 'h â ually 'OK'­B'NO'B'; ' ™ <�text from¶ D ðtagged response,E &un Bults2 ¬ !. º _ C 3is c a	F aÌ .† Ün| ` first-tD    dheader~• asecond7 Ä@  =  ñ s (ie: 'e' valuªÁErrors raise… ‡Ðion class <inóPce>.e, ³("<reason>"ø	qserver $ P < Xabort< Å¸ba sub-s Aof 'H  '. Mailboxw0tus‡2ngeÙ´ READ-WRITEÔ OONLYÑ ™ ‰readonlyœ P˜ È 'ç"¦ "»òions imply a programÍ"< .   ©pconnectx�should be‚!et»¶ $0 ¯ƒ re-trie0"Î f 6 c @ c PNote:Ju°is module, ;Pmust c *€RFCs per6 D to G Àprotocol, as • semanticLÊ$: D \�1lef´ ú Pinvok 0to d 7  0res�b. AlsobAmost ¢Ðs implement añ" sub-set of the commands available here.
    """
	 ð
class error(Exception): p Â   # Logical$ ÷s - debug requiredF aabort(L B  o –# ServiceF ÷ close and retryG ‘readonly(P J ò# Mailbox status changed to READ-ONLYØ ñ,def __init__(self, host='', port=IMAP4_PORT, timeout=None):‹  ¶  7 .î 0= Dö 
  … Êe = 'LOGOUT'  literal = W  P  D# A  €argumentÄ aµ
J utagged_ÑC= {}L 1# T 9 �s awaitin¡jsponseL #unN "re $s O ñ# {typ: [data, ...] }B €continua)_F  '-Hast "  " 
E 4is_çƒ = FalseÒ & #Ë@ desdïÉ ªtagnum = 0Z ô_tls_established_ & Âmode_ascii()2 € Á# Open socke’vserver." Popen(OLAJ 6tryI [ 9 ¥_connect()� eu |
6 G K ‡shutdownK   O 0OSEÓ
M     Ø|   Rraiseà 4 ³ putf8_enO[Pencod‚1= 'bLÃre.compile(_ ¦, re.ASCII# ˆ $.U¹ vu¶>  F Ü  Â Û ;Trus_Ú _utf-8Ú Ð )')
Æ D Ä õ# Create unique tag for this session,û#{~ ,  G¬n matchøPtagpròàInt2AP(random. ûint(4096, 65535)î 1tag9 ´¶br'(?P<tag>G ’  + æ .y ½ "   ¡+ br'\d+) R “ype>[A-Z]  ÐY>.*)' 9   b# Get éø welcome message0 ñ1est8õstore CAPABILITYæ*i�>*__ˆÓ ö_cmd_log_len = 1Ç • 
# 9idxé" À_cmd_log = {&}  ö# Last `_cmd_log_len' interactions
- ù  if self.debug >= 1:   , ! ó_mesg('imaplib version %s' % __ ?__)? 
ñ new IMAP4 conne‘ b, tag=I k …tagpre)
J  ’welcome =± æ_get_response(v °if 'PREAUTH÷ - …untagged1 sæ a @stat_ '< }  elS /OKN %<NONQ *se Rraiseª aerror(� ñ ù Êcapabilitiesý !__Ë*__c è3  èðCAPABILITIES: %ræ— { ',)ž 5for²in AllowedV)qhif not/ ó \   …continue›µ ôPROTOCOL_VERSION =[ 	, freturnXxq'serverœ §¢mpliant')
9 Pdef _…aattr__ ,  )³ #› "  à UPPERCASE varM Es ofåmmand methods.± !ifU a in Co$ DÎ @ get} ˆ .y6r()é ¡AttributeEeŠ"Unknown‰ ‘: '%s'" %~ ßô eEò ì ˆ  Á"Cexit- w, *args4 �t¦= "LOGOUT"C B[ V   :try!  u w.logout‘except OSé 
2 CpassÊ¥´Overridable‡" ø Ócreate_socketgwtimeoutÒ õ # Default valueáò.host is '', but H .·wddrinfoº €# (which1 tused by1 ‡ 8ö ()) expects Non‰# as a d�  ž ‹ 	aÇ  n  � F  �   
>IVâ \ã('Non-blocking« # (< 4=0)[ ¦supported'– � ! =¼  ˆ u Ð $el  ³sys.audit("‹q.open",? s  u r °address = (V $ 3if ¿ ¼  Iï .šh ,J ‚ Ò: x ß v ´ =Hð port=IMAP4_PORTó, timeout=None):
  õ$"""Setup connection to remote server on "host:port"<  C ñ (default: local& ð standard IMAP4 5 %).6 HThisn öwill be used by the routines¨  l `read,  öline, send, shutdownb &""¤ Pself.– 0 =  ‡   › ! =¢ 
 qsock = % €_create_ 3et(I)1 Dfile1  ) P.make �('rb')

/ 1defÀ (Y [, sizŒ`Read ' Ã' bytes from�.Ù breturn¢  h .(: m  -q 
÷k   c  c   Ö(_MAXLINE + 1	pif len(" D) > % Å0aisYð
lf.error("got more than %etes" %B c ö  c S 	â j, dataè ASend Ø	Iðsys.audit("imaplib.P "`#lfR ¾ „ ¹.á % Aall(r � �‘ 
‹ úClose I/O established in "open"—  ¹vc6 (:tryS” | ö ocket.SHUT_RDWR>  except OSE~z as excP @# Th£ü€might al_qy have ‘ d©6 'ð # On Windows, tó may resultò ±WSAEINVAL (g 10022/F ñAn invalid opera Úwas attemptedx pif (exc[õno != errno.ENOTCONNÇ ^ à   and getattr7 a, 'win� P', 0)A ˜  > rÈP ofinall˜2(™ C/et$ RØÁ0 inMc$to9 Ì^£.` ™ Z D = <= >±'etDJ = 
Í#N ó   Utility methods Ë?cenÅ pmost re% � 'RECENT'õponses if any exist,K´else prompt€Àfor an updat1ing~ç'NOOP' commandp(typ, [›*])�  Œß   '' �' is None– û no new messagesœ ‚list of Ñ Ð (, ð Flastœp0nam+ù ´ 4datGÑ_untagged_res3€('OK', [¨ 0], I Ù ifæC[-1]ÎÀ       returÃn typ, dat
   õ = self.noop()  # Prod server for response; breturn7 ¤_untagged_' (Z ‘, name)

9 5defJ (r �, code):  • B"""RZ Idata{   ', 0' iD òceived, or None.`  B ŸOld value= —s cleared3 (Y 0, [s õ]) = <instance>.Ò  $ )¨   9 0, [§ ]ð €.upper()F #¹ ÷   IMAP4 commands5cappend3ámailbox, flagsÒëe_time, messagQA=  1 to”#d H 	·‚ 4 | 	‹Ö ó All args except `§ ƒ' can beÃ/ 1"""   >µ = 'APPEND' dif notÃ @ 4 ¤  7 YINBOX6 4
0 Aif ( B[0],	 ÷-1]) != ('(',')'¢ b   )  d r(%s)' %Ž¡ Jelseg 1  	'  if‘¿
/ 2dat ð = Time2Internal ( ô“r % ! =cv ðliteral = MapCRLF.sub(	 C- "ifæÊutf8_enabled« O Äb'UTF8 (' +  V+ b')„ ÷. =& n 	Mssimple_(,ôƒ O š fÄauthenticate7 echanism,  gobjectÙG"""A6 ‡µ - requires¼· processing>$'mb ñ' specifies whichr � Eion * e is toþ ðbe used - it must xXar in•�capabilita Vin th™µform AUTH=<f >¦ ý 'c �be a callÛ :Æ ! =Ê $ ()- pIt willÕ R  edo.P�continuat
D )s;Æ   8Pument`is pas d óa bytes.  It should B Y½ 6thaŸ �base64 en @d anð nt° 3the¬ Y L a  È � . 0cli¤ Vabort&4'*'• bR  Æ unstead.M í °& =(- c# XXX:T �n't thisC qAremo  4àented out?
     ð	#cap = 'AUTH=%s' % mech
   €#if not ' ðin self.capabilities:% ö   # Let the server decide!I  ) @rais" ³lf.error("S. óoesn't allow %s authentication."˜ )P Š Æliteral = _A1 0or(? õ object).process: ¢typ, dat =Ï ñ_simple_command(¡ENTICATE',x õ if typ != 'OK':V ß ödat[-1].decode('utf-8', 'replace')Y Ñ Tstate�'] `returny º !

 0def˜Œ y(A )‘ A"""(ë ö[data]) = <instance>Ä&y(ƒ VFetchS Óies list fromØB."""~  ñ 1nam® ¦CAPABILITY´ | g < { â  Ä ò._untagged_responseÉ Rdat, 7 ƒ Oheckü  C ð point mailbox oÀ �.?  Â Z # B  ú  3   	¯ @xCHECK')¦Olose¥     currently�Tected³ © ADele òessages are removed¡†writable=  ª   qThis isŸ reè`ended 
 ÷and before 'LOGOUT'v 	 ¼ 6try‰ ‚ v'CLOSE'kfinallF #"op Ë=0_seJ3ew_
7rCopy 'mi , #'  ös onto end of 'nB 5 Œ M  Z ', D þ k1OPY£Ø „Breat…,#ø "  ’   
8 (Lœ õÆ #REkª;dø<· ? ol7ÁZ · 'BDELE"·  ÷  –\ :acl¹ Z, whou¾  :bACLs (Ôð any rights) set for=  Å² �Š ðmailbox, who)
    A"""
	 ñ+   return self._simple_command('DELETEACL', mailbox, who)
@ °def enable(@ á, capability):"  f ó"""Send an RFC51615 ò string to the server.[  9 ó(typ, [data]) = <instance>.v p o  óif 'ENABLE' not ié 8 6ies©  t ñraise IMAP4.error("S˜ Q doesE ‚support Y %")n ¯  ® / =P3 ')? ðif typ == 'OK' and 'UTF8=ACCEPT'¾ ¹ ‡y.upper(h ¿  ‡Æ._mode_utf8(� è¤ gÂRxpungÃO ð"""Permanently remove deleted items fromë  ec "ÂõGenerates 'EXPUNGE' response for eachT wmessage@ 	¶ ‹ ý '|°' is list oýv #d ] € numbersMõ order received.‰fname =¿ % Iì 9 ~Ÿ”untagged_ç Rdat, 7 �Sfetch^Ã T_set,Ð j_parts·F4 ! ( D of), sZ\, ...ax r £ w& q Ô' should be aâ&of&& G`enclosQ÷n parentheses, eg: "(UID BODY[TEXT])"Â î are tuplesñ‹  K ¡t envelopeK ãeFETCH'š á‡” J {ýdgetaclþ€
ë1Get<AACLsQa¨*_Hb º°	I'GET#G ú 'A ")
U • ™ šnnotationú, entry, attributeï V ö P  »ðRetrieve ANNOTATIONs." = HÆ T 7Z >Qquota9À, root):
     ð%"""Get the quota root's resource usage and limits.

8   qPart of= ÷IMAP4 QUOTA extension defined in rfc2087? ñ(typ, [data]) = <instance>.getŽ (Ž )q 5""" = ñdat = self._simple_command('GET� !',Ô F creturn6 òuntagged_response– bdat, '@ ")
ó Ddef ™  ˜ (x µ, mailbox):› T1lis#Î ˆ Qs for3Tnamed? [~ @ROOT�œ rs...],   ]?¦   Ÿ  F ˆ 'í 
A Þ ‰S @  � @  ­ ÍD ‘ ÕO [P ,Õ]Â ’ºúdirectory='""', pattern='*'ÎLÆH ·sÒ? ” matchingB ÍåŠ E „  w &'@ P' is 5  t8LIS�# ª @ = ', '" #9 6 %, ˜ l ÿ/._ª	 K >Slogin}@user\ jsswordpñIdentify client us]²laintext pa6 hv p \TNB: 'R ‚' will b5ed.7YC’'LOGIN', u ) •$e(i )Oæif typ != 'OK'G ùRraise«Öerror(dat[-1]> ] PstateëFAUTHëê¯  Ÿ_cram_md5“2 Foe~ÐCRAM-MD5 auth¬ocation�| $qå )  . # =c > û . ¥ 4e('¼ "',X_ P_MD5_=¯
 %šchallenge³à Authobject to– ` with ] * Pµimport hmacÁ apwd = u .Þ ô.encode('utf-8') if is7
, V, str' Mð                  ôelse self.password)
% breturn ñ,user + " " + hmac.HMAC(pwd, challenge, 'md5').hexdigest()

P °def logout(n !):  j ò"""Shutdown connection to server.A  + ó(typ, [data]) = <instance>.\ )- R¾ sF ø 'BYE' response.   š õ.state = 'LOGOUT' } Rdat =ô_simple_command(1 AP Ý ( YQ #1sub!ú, directory='""', pattern='*'>öList 'subscribed' mailbox names inL ” matchingO ^], ...c œ – 	|'£ð' are tuples of message part envelope and . ’ Â Œ?SUBŠ 6 A<‚¡¤_untagged_hAdat,CU Ãƒmyrights¤i
�õShow my ACLs for a‘¢(i.e. the G ô  that I have on( )–‘� ‡ «5"""  f¶	¥MYRIGHTS', < ©''F - ‡Qspace.
% ŸAIMAPf* Ös ala rfc2342P‘ù›j ã    GŸNAMESPACELU  r üOnoop £Send NOOP FúN – ë Æif __debug__e >"if¸ Z >= 3   $ êqdump_ur° .sy 	 × ' ù1ialW ,F_num  # �, start, T*th8ò Fetch truncatedM ofd_A6 m  � ™Š ‘á"isàß-PARTIAL–6C
Àgth)
       ð8 return self._untagged_response(typ, dat, 'FETCH')


    def proxyauth(? �, user):  # ð"""Assume authentication as ", "".L  - ‘Allows an- òorised administrator tor ‘ into anyq %'sq wmailboxV À ö[data]) = <instance>.½  ‹ )E 6"""– õname = 'PROXYAUTH'( 	9÷ simple_command(0 6 reV (33old¶ S, new 
ER1 S old    B  ?newî u o Õ  ý  Ž  á 
€RENAME',– • 	Á ð Tsearc#úcharset, *criteriaì S- è ÿfor matching messagesò w q p †on, ...)ä'ý' is space separated list of‚ • numbers.8pIf UTF8E “enabled, z Ö MUST be None2 jÎ‡= 'SEARCc$ifE U š"if°Sutf8_p 
"  & ðraise IMAP4.error("Non-‡ W Ò not valid inÂ Vmode" I " =w _î ¿ µ, 'CHARSET'ú å*Jelse¬ _ 0K 	¡»	 ¡ ¸cselect‚¾ü	='INBOX', readonly=FalseŸ : $ a¡‹¤Flush all ‹  F² ] (‘ ºBcoun«$ ÐI ¥ ('EXISTS'‘ )¸ AMandî® ô  are ('FLAGS', > €, 'RECENâõ'UIDVALIDITY'), so–Uotherj €s shouldÈobtained viaŠy s _) etc* 5.`¦`s = {}«"# ‡ ,W §? 4is_ã% =îÀ %if 
¨ F vEXAMINE
Ó+ fSELECT* ë¸…êif typ != 'OK'– Ó Astat¨£ 	ð # Might have been_ Ž àED'
          ó  return typ, dat
  õself.state = 'SELECTED'  ñif 'READ-ONLY' in 2 õuntagged_responses \4 [ ù and not readonly:" Êif __debug__  @ "ifi ! ^ >= 1$  ( Ž ‘_dump_ur( œ )y Rraise^ š q('%s is® öwritable' % mailbox@ Gm ñ	.get('EXISTS', [None])

„  deØ Atacl¬ ,b P, who 6at)é „"""Set a& R acl.I  ü (Îñ[data]) = <instance>.sed À  Y ^ ‡  > 5""" × Ò ÿ	_simple_command('SETACL'¬ × “nnotationÞ Z*argsÑ µ B ¼ ö[, entry, attribute]+‘  ÀANNOTATIONs.Ö ×  Rdat =ïÛ = 2', ° @ 	WÊ fdat, 'ƒ 'ëSquota»root, limit Ç Athe .  ( ³'s resource2 úE (E m Ó    þ  qQUOTA',“ N !H 	3ortõsort_criteria, charset, *search 
Jó
IMAP4rev1 extension SORT º0‡ � € V, ...|L2namB6ORT>1#ifT <Ðcapabilities:ˆ€  # Let åserver decide!·#(  ¼‘error('un¯gmented
@: %sÊ ‚ º Iif (uJ[0], ÷-1]) != ('(',')'| Œ 	-  ;@(%s)i 	 À k Ÿ ), < 	X � a 	~ttarttls‚°sl_context=±î  :  á †STARTTLSÞÝ†HAVE_SSL¸ !ªùSSL support missing'“`tls_esƒ_ishedV  abº�'TLS sesþ alÑ!y ? Àlished')
     ðif name not in self.capabilities:
&  Rraise% ¡abort('TLS< õsupported by server')< ð# Generate a default SSL context ‡ õ one was passed.= uif ssl_+ js None™ ! =/ ô ._create_stdlib> (” ¢typ, dat =Ñ ð_simple_command(. ëif typ == 'OK'}  5@sockK ª `.wrap_ 1et(Y  ,Ø U NP_host” =K   ž  C  @file† ’ P.make G('rb‘1 ù_tls_established = True¥ Z X_get_K;els�)õerror("Couldn't m  <†session"Ì SreturŠô_untagged_response(·,¸1)

« ¡def statusj’, mailbox& &s)±¡"""RequestA d7  Š´ditions for@ ._  /z ó[data]) = <instance>.z t ™  : 5"""  Âµ = 'STATUS' #æ ¶ñPROTOCOL_VERSIONsðIMAP4':   # Let th† e† decide!I  r a'%s uná0men§1in V d (obta Crev1¿ñ, or re-code)' %/§ˆn?‡¦ å(4oreäÃessage_set, ·k, flagñaAlters x disposêF sÿÂö ‹ m? … ï Aif (¤ B[0],	 ÷-1]) != ('(',')'¯ Î%  51(%sŠ ñ # Avoid quoting x ¥Ÿ'STORE', Æ µy'FETCH'�uubscrib¼ ê D"""S%  to new†> (Ç­€	Æ ô‘'SUBSCRIB£ ccthread ñing_algorithm, char�ú*search_criteriaê  {lPextent THREADÈƒ?e, z„ ( ‹ Š Àeria, ...)
   B"""

 õ  name = 'THREAD' ðtyp, dat = self._simple_command(8 õ", threading_algorithm, charset, *search_criteria)^ creturnZ ôuntagged_response(} ,Ÿ 1)

9 €def uid(� #, ‰ ‘, *args):#  Ö Ã"""Execute "% õ arg ..." with messages identified by UID,F  J   ´rather than8 ‚ number.–  % ± ð[data]) = <instance>.± † ,‡ 1  2,� )B R$s ó appropriate to 'D %'.¢ Æ $ =v.upper(rdif not R in CÊs: Ë Rraise™ðerror("Unknown IMAP4%E t: %s" % 	l  ¤0.st¾  w o [¬ ]x ( ° %s illegal¶ T F%s, Ä ¸  Õ"only allowed: s´ E7   ({ ,s  *  ¤', '.join(Xé &)) 7 o/UIl• ñÃ $if‚ æ €('SEARCH� @SORT Ü$ ¸ ‹ W O Jelse›) f'FETCH"Ä'£nsubscribeÌwmailbox¡ F"""U' £ from old * |B (9 Š?	Ë éä'UNSUBSCRIBE',� 	”qnselectÍ 
Ä 0FreMQrver'ÝÀources assocÜd’ th'  E eä ’Band ¢ "s )  P    @authÆacated ¬$EThissperformE  ø`action� å CLOSE, except{ tthat noúò
s are permanently removed¡ � Acurr D Ø ¼U²:try¥3a± ÈfELECT'R kfinallJ »n= 'AUTôm šQxatom¶™A� b¤ extension¢s4    &noŸ!se÷ K•APABILITY0UeAssume÷À is legal inó current state.

  ö!(typ, [data]) = <instance>.xatom(name, arg, ...): ð$Returns response appropriate to extension command `L %'.| 5"""   0 =  ….upper() q#if not ò in self.capabilities:Í ö	# Let the server decide!I  ( @rais" þlf.error('unknown² q: %s' %y � Ž CÞ %s:g  f  [Ò Q] = (¶ ,L rEÒ ƒ_simple_/z‚*args)

y#\ p   Privhsmethods ñdef _append_untaggedx !, çFdat)§ æif dat is None  c   U= b''Õ Bur =¨ Z _ús% Êif __debug__Q "if=  Z >= 5   u "P_mesg”¿ e õ[%s] %s += ["%r"]' %y  ?  ×¡len(ur.get P'')),ô )� if V*ur’ ‚ur[typ].P(<o ;els1. ! =L]‘‘check_bye‹�?byeT¶ Y'BYE'­ +byy Ïòabort(bye[-1].decodt ð._encoding, 'replace')U 46u „,ñ", {:z * ÅÆ“:in ê
D N ¡.literal =hD Q ½ Œ"ˆ  épillegalœq F%s, 2 @  Õ"only allowed: _s %s".G p³ p ,« $ 	 ª', '.join()Z* 4fora@('OK4  NO GBAD' 0 Œ… h
] 3 2delX- ¾	¼±'READ-ONLY' G8 % \ø  µ y� pis_reada
ˆ Å! ‘('mailboxp us changed… M4tag‡_new_tag Dˆ = bytes§×# É0 = P �+ b' ' +ÎÔ  ‘0arg Z
Ë  ifê• continue>  tTif is'(;strÌ )  g ¶ '  rµ   - ¹  º 6argÂH� › 3if   À ð not None:
       òself.literal = None
  ƒif type(# B) is 9 ©_command):5  ; 1 btor =  l$ Oelse6 Œ  W qdata =  õ+ bytes(' {%s}' % lenª ", £ ¥encoding)
€ Êif __debug__„ "if6  Z >= 4   ƒ W  mesg('> %ry  � )`  & à < -lo; < :trys 3 Psend(e v + CRLFl úexcept OSError as valB RraiseØ ð abort('socket e3 @: %sÃ :val#¶ ò ‹T –eturn tagWzwhile 1) ö# Wait for continuation response?  6C ó T_get_& (b ¬dtagged‹õs[tag]:   # BAD/NO?\ b  rÁ    e# Send³	< #if :toræ  : 0ðAtor(Ê ø Ò l = “ J —	 ( % _›Swrite° cl sizeé%† }U �â }    x # 
�  ¡ ' ¥! 8 cif notè ˜VbreakgùÞDdef >  Qpleteºp, name,æ€ logout = ( Æ == 'LOGOUT'P# BYE:ò expected after ) w ½ R 
RS¶_check_bye(\ ¥Btyp,=æ;BRtag, �  Q =Ç W ¨x 'L G3 =>d,‹)b {b % /('b PãÈJBAD'‡—Ž 3%s ‘ @
ö �ü v«
‘| éÁcapabilities|qP  ß, y if Æ [®]Ç Àself.error('óno CAPABILITY response from server')
  üdat = str(dat[-1], self._encoding+ ¦dat.upper( 2 ðcapabilities = tupleU ±.split())

v ”def _get_š (? "):  — f# Readº ¡and store.A # 
 õ Returns None for continuationF 's,3 potherwiEirst% ö  line received.“  ¬  ( ½  ) &()! `# Commª icomple| ?( #if`Qmatchû q.tagre,… %):¦  ç 4tagv ×mo.group('tagÁ ' pif not . "in` ‚tagged_c• sW  4  raÿ  {ð.abort('unexpectedJ &ge‚r: %r' %¢ Ì  G ?typ¢  ;ype£ ( otr(typd S “ kõ KdataS ¼ è ‚[tag] = f V[dat]§Jelse	adat2 =:
× ’# '*' (un` )û  GsÌ ­ {Œ _ÔU5 áÛ= 9  > ostatus<  @ ¿ 8 
+'2'œ + xBmo i+

 $ q# Only a possiÐy2 X'+' (Y'..) H   p C“Ó 
Ì h Fg  {   rÙ  ù # NB: indicates#
ú / "  
 "~0if @ä P= b''Ø   t# Null ÚÙ	xF #2:?  R €+ b' ' + 23P# Is Rûe a literal to come/Rwhile¢ñL5 ,] 
 ±   \ bdirectÒ`conneco† ¢size = intj%  &') f   Îif __debug__"" ´ % _ >= 4(  , ) €_mesg('rÔÂ   0 %sU  ˆ  Üò : (' 	¦ b ð# Store response wiûth literal as tuple

  þself._append_untagged(typ, (dat, data))9 ô# Read trailer - possibly containing anotherˆ F bdat = … ›get_line(n  £ 7dat- ö# Bracketed response information?€ ðif typ in ('OK', 'NO “BAD') and” smatch(RM Q_code)):J L Ç ÿmo.group('type')( "trbÚ Šencoding+  ö  h  ¢'£Êif __debug__¨ "ifØ  Q >= 1ì  ¿ {, 'BYE'è  =~ •_mesg('%si‚: %r' % Ú  ™šareturn, 
…Pdef _òr_°(_ ò
, tag, expect_bye=False):<  † zwhile 1ß UresulQZ Ùcommands[tag]Ž if’  2 ºis not NoneR  k 2del6Q  . ë 6ult°   'ifÓ h  †=w	§  ; 4bye(¥3Rs.popw Á 
G = 0if @ å 
 ( ó# Server replies to the "LOGOUT" K½ with "BYE"©  H “ 7bye	  ñ# If we've seen a BYE at this point,x  soÍ‰ will bek À# closed, so¯ 1ort3  J Inow.-  Sp._checkM`³# Some haveK bed "unLp" excepKsb ð# Note that ignorýýthem here causes loop9 `InsteaÉ ñend me details ofÒ ˆ   ´	á ±# I'll upda†  e © Þ`d]:)'.“>try‰0 �9 	p  ab|nas valK ‹ 
  “F  (   ™ ®print_log(ê\raisebT ; @  R@read Q !if  
� b ú #('¦·error: EOF'ð°# Protocol …�ates all Y �s termina°uby CRLFg� P.endss|(b'\r\n•“ Àbort('socketñ error: unterminated line: %r' % C)

    ! = U[:-2] Õif __debug__:  6 �if self. Z >= 4   $ ! ‰_mesg('<z    Oelse< /lo; areturn´ 
Ê °def _match(z ¢, cre, s):  p ñ# Run compiled regular expression @ õ  method on 's'.ù ò# Save result, rƒ †success.g   P.mo =ƒ .S 5(s)G Vûmo is not None andn52n1"\tu òed %r => %r" % (cre.pattern,Q Æmo.groups())¡ Ù  á
‹ kqnew_tagmeRtag =_ ñtagpre + bytes(str. ƒ.tagnum)… –_encoding‚ B& L unum + 1I& ñged_commands[tag] =9) Ñ 8tagÁ Qquote‘ X, argÄ  arÄ ö	arg.replace('\\', '\\\\'¨ (  "' '"'a€ P'"' +k h + '"'Œ dsimpleÆ • ©name, *argÆN þ 2   bplete(5 	  I )w Puntag?trespons typ, dat, O )næif typ == 'NO'  ^˜ < ~!ifË J 2 iny sL [•DdataG A.popð ¥pÆX'o A[%s]bsXy 9aOa�
— .Ç 5 Ä0, s&0cs=‰ q… cs,  
B ! Àsecs = time. (  $tm Astrf! ‚'%M:%S',4 Qlocal  J Ó  > ñsys.stderr.write('  %s.%02d %s\nPtm, (= �*100)%100“
‡ I gflush(:bdump_u<,Ö´^_dict ;	­( !³| × @item5ù(f'{key}: {value!r}')  -   ‘for key, '  âz .V (B a!4  ^Š s ÷ :2á'\n\t\t'.join(K )$Àlog(self, ligne):
  ù.# Keep log of last `_cmd_log_len' interactions for debugging.J Tself.; [ ð_idx] = (line, time. ?())C  5 Y += 1# =if [ ; >= :lenç  ò 8 E= 0
^ �def printû (- +  �._mesg(')‰%d IMAP4#�:' % lenB é \i, n µ Nidx,È    Ã owhile Ü  >tryñ  2 µ * Ý:[i]} . oexceptJ Ipass�  1 i¢ ?f i–/  Š 
  0n -þâ

if HAVE_SSL:°Rclass}  (‡)  D 1""" ‚ client 1 áover SSL conneÓP  3 ÷Instantiate with:` °[host[, por ãkeyfile[, cert  ssl_contex#  ß‘out=None] )k  o    V 0 -  ð's name (default: local -);w ˆ ! -� w number9  Ç 4dar� ð  0 G  È ` - PEMÜpmatted Ò P that) tains yourv7keyp  ã ]  ^   @ificJ Rchainp ú Q a@ - aÉCp object³ m L ‰ ?andç 	> `Note: –ÿô is provided, then parameters u-orM  ­ |ðshould not be set otherwise ValueErrorh jraisedŠ Î €‘ - socketu<out¸5 If !isr bgiven _  ‹,¨  a  ³the global ¹p vis usedý Càmore documenta[@ see+  Qstrin� _ 6parÂÕî F"""
Z  Â�__init__,[2=''º=>  1d_PORT,‹¥æ “$  „ i 1 Ñ S g	w  zàô'("ƒ 	G 1argOðs are mutually "
              Ø"exclusive")
! øif ssl_context is not None and certfile :A  M øraise ValueError("T 	H ý	arguments are mutually "T  X 	 Ã 	<key¦ ? or¾ ý import warningsŠ  .	 $("l × ÿe deprecated, use aÖ z"custom‚£nstead", DP BionWœ :, 2¾Tself.‘ #= 
 	Â # Ç=	%  é×=· ô ._create_stdlibH(q =	 ,p 	Ù Ö =  — ˆ 	u ð IMAP4.__init__(€, host, µ, timeout)
7 Edef â Socket7 + 
#ssock = i 8 b  ý preturn ‘ .Ë `.wrap_T  w ?ockDpserver_å Qname=c   ä CopenÚ   2=''=Ë •_SSL_PORT#=)ý ò"""Setup connection to remote Š P on "b :r)". ñ (default: local+ ‚standardXA SSL°)> HThis{ pwill beŠúd by the routines¹  x `read,  úline, send, shutdownj *""®$.C@1pñ__all__.append(";  _²")


class  qstream( "):’"""1 ‚ client 0 rover a 1 )  In4ºtiate with:U scommand”  ÿ   " 2" -O Àing that canJ`passedÔÁsubprocess.Pø K Áfor more docæa1see`docstrW !of 6parÈ ë j bÊ �
²§ ~Ö 3 = 
 \Y 	ø n ô  _ Á  C Û¾ ì v ð|~Ç  b —' �“ð"""
        selfÓ.host = None  ó# For compatibility with parent class
- ” self.porF 
 Csock_ 
 Ofile Óprocess = sub q.Popen(k …command,O  ‰ úbufsize=DEFAULT_BUFFER_SIZE) hstdin=Z ½IPE, stdout 	d ñshell=True, close_fds )( ¢ Swriteà  Æ } 
, Oread+ Aout
- @def (   , é !):  û �"""Read ' õ' bytes from remote."""- breturn´ S  { .	 (> *)
q Alineu o    g  6 (g Asendc j, datai ASend ? toÎ ]n.
 (G ñ # Zflush� bhutdow]
 Cåð I/O established in "Ž"Yh  IR(. %Await¢ 
hò _Authenticator:¢¢"""PrivateŽ !õprovide en/decoding )°for base64- 6d aY ñion conversation.:  :	  ‚ƒ__init__®‡mechinst3  0 =     y ÷# Callable object® /÷ çÜ  m  l Óò reln % .ó eþyi:At isáC  — @b'*' P # AbÇþ   - u ¶encode(ret)²   ! W, inp#F ð#  Invoke binascii.b2a_�Ò64 iterativelp7  sh› ðeven length buffers¼Ørip the trail÷0#  rR feed­ ' ö
result and append.  "Even(ð#  means a number that factorsÀaboth 6E 8cñ#  so when it get,  u  Ë!of§ P8-bit$(utã  there's noiatial 6* boutput“ ŒP•oup = b''H Pif isy�ance(inp � A  in7 Cinp.¶v'utf-8'8 whŸ:inp3 if~ W j) > 48  [  š…inp[:48]•     x J[48: OelseN I ø  _  PX &(tØ  ' Ðif e:
         `oup =  ”+ e[:-1]
 `return 
 ñdef decode(self, inp):  3 `if not    G 5b''+  ðinascii.a2b_base64(T ðJ

Months = ' Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ')
Mon2num = {s.enc» ò):n+1 for n, s in enumerate(w €[1:])}

ð ôInternaldate2tuple(res÷ ò"""Parse an IMAP4 INTERNALDATE string.>RN0corA ò
onding local time.  The r& ¡value is a4! pstruct_  Š ó  or None if theo   has wrongå Amat.C 2"""ˆ Tmo = × ¢Date.match× + É&moÈ—  n F Cn = `ò[mo.group('mon')C@zone%   "')B ¦day = int(! aday'))… Myear    ! >hou!   !  mi~ 
a 4min =sec` 4sec  ¬ h!  #  \
c  # m# Ç # ½ ! ò must be subtracted to get UT ' 0= ( ph*60 +  Qm)*60[ !if –n == b'-'® ( @ = - M `tt = (?À, mon, day, .@, mi	dec, -1 „ ut#�calendar.½ �gm(tt) -{ \   .Ð 
 u(utc)

E’2AP(num):4 �"""Conver0Ptegerÿ 4A-PÅõ representation.¾@val ï Q'; AP
 òABCDEFGHIJKLMNOPfö š1absz Ó –while num.0num d = divmod/ B, 162  Ãv ñAP[mod:mod+1] + val‰  ñ RFlagsWö .f#   sebpythonàö ´P ­(iŸ 3l| A').s/)­ ñTTime2 ö( v½   ¼ Ô 	Çý
 �òform: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' pu Àargument canNaÚ€ber (intufloat) ‡ 1ingC óseconds since epoch (asRed by–Ì�)), a 9-C@ Q Å,	PinstaW "ofD ¹3(asA  \i :n €n aware ì  „  V r double-quo>NQ.  In0lasase, itJÐssumed to alrñeady
    be in the correct format. 1""" ñif isinstance(date_time, (int, float)):,  V Pdt = '  & P.from	 Wstamp> /  3   9 Äzone.utc).as !()? /elœ Wtuple• 6try¢  o cgmtoffª Ñ B.tm_ ]  % úexcept AttributeErrorH 0if – š.daylight  E $dsg 5[8]`     1if & N= -1A  "  j Plocalt ( 0.mk Z/))b Ù B = -6  4  Z,T 0alt Z)[dstŸ Nelse“ O  I .  @ Ù qdelta =]  ’(seconds=: ÀÙ  D  (*8'À:6], tzinfo=  ` (L )> þ F  4  c».W { is Nonß ¢raise Valuï ("N ” P must6baware"‡ 	Å ' ž –str) and µE[0],g ÷[-1]) == ('"','"'Ç areturn_l  ~   q# AssumÑ
ÍŽ Æã 	ônot of a known typé  fm«ò
'"%d-{}-%Y %H:%M:%S %z"'.;À(Months[dt.m
 ]%· `t.strf›ð(fmt)



if __name__ô Á'__main__':
» ð2# To test: invoke either as 'python imaplib.py [IMAP4_server_host\ #]'L /or5 �-s "rsh < À exec /etc/ri $d"M t™ B; ²tream class¿ àimport getopt, p 	•ð optlist, args =* Bopt.9 ò(sys.argv[1:], 'd:s:'[¤(  .e¢ 6val·\ b(), ()¡ s³ P_comm”=.@for µ 0val(E V  if µ6-d'  �ò Debug = int(val«   2opt7 s7 � 1valŒ  ;   0if ¢ $:*(6 ,Ù + $''  ! =D 2[0]BUSER{ ¥ |CusernjPASSWD  '  ("ü  @wordDð %s on %s: " % (X !, r Aor "Â  #")¬  à@_mes3�'From: %(| 5)s@. â%(lf)sSubject:­  rdata... ð' % {'user':USER, 'lf'ñ	:'\n'}
    test_seq1 = ( ó('login', (USER, PASSWD)), `create  Ö'/tmp/xxx 1',! ^renam!  / Fyyy', fCREATEM Xyyz 2M mappend! c None, Å FmesgX Elist5 w', 'yy*w Vselec! /w `searchB i €'SUBJECTK  o L 2fet*  '1 ÷(FLAGS INTERNALDATE RFC822)5 Bstor#5 4 è', r'(\Deleted.  PAspac2 å kexpung QrecenÛ ) Iclos' !)
Í Ê  þ2þ@ `responC Ø('UIDVALIDITY¨"ui¥`SEARCH	7ALLñ C ˜ ('EXISTS? çp ¦ 
ßå Ylogouù æ ñdef run(cmd, args):þ   0M._Z ·('%s %s' % ' )' ñtyp, dat = getattr(M, cmd)(*R * Q ;=> W H )[ ðif typ == 'NO': raisel 5[0]V `return ¹&ryÄ öif stream_command ã ’ = IMAP4_& ( - Š Oelse; V(host* ¡if M.state¸ ZAUTH': ´X  [1:]   # Lbµ not neededè >óPROTOCOL_VERSION =Ÿ,M. — > ÀCAPABILITIES: rÙóM.capabilities,) $0forÎ,Ì6 in
Ö 
F‹?  ml9  " '}/Wyy%')w 5 ömo = re.match(r'.*"([^"]+)"$', mlÙ  / ú	if mo: path = mo.group(1& Ä% Æl.split()[-1M N ¨  dej å V 2 M ] i "ifR Z) != ('+
[  = ŠcontinueS Puid = Ö â C 8 !if]Uuid: D     ² ˆ 2FET²0uidY ï1  'ßD.SIZës.HEADERùP.TEXTÐÈ Áprint('\nAllncs OK.'“fexcept. ÅTests failed.  œ ò VDebug8   < À''
If you woñ6uld like to see debugging output,
try: %s -d5
''' % sys.argv[0])

    ÿlraise
"""Recognize image file formats based on their first few bytes."""

from os import PathLike

__all__ = ["what"]

#--- L#
# Œ ¯headers #
8 	P
def a (¼ ¡, h=None):ì @f =    	  qif h is ,     Óif isinstanceU d(str, Ý )^  .   j Copen1 U'rb')m % Úh = f.read(32 Jelseˆ  5 €location8 šile.tell(9  ' X    [  "  d.seek(S F ú for tf in tests† Öres = tf(h, f4  T [if re/   `return vfinallyW Óif f: f.closeÎ 4 ¬(	> 0ø Subroutines perÂOtype8
H 
õ a = []
L  R_jpegó ¸ À"""JPEG data* JFIF or ExÎ 01"""ð  Z`[6:10]) 0(b', P', b'- '<õ 'm "'
‰ ….append(† )– )pn•  j ÿ.startswith(b'\211PNG\r\n\032\no ?pngn 8pngm #giõùGIF ('87 and '89 variants)ü $:6ú aGIF87aü   /9a� ?gif� 8gif� <tif� ÀTIFF (can bel€Motorola™`Intel ©k order£ 2£ !MMŸ /II›  t œ   � ;rgb.3SGI‘xlibrary#µ001\332‚ ?rgb� 8rgb€ ;pbm€ øPBM (portable bitmap±len(h) >= 3Ï\¼ ¿ph[0] ==7a(b'P')  1h[13Sb'14' E¢b' \t\n\r') D Ú?pbm¿ 9pbm¿ g¿ G¿ OgrayÀ 6/25À gÀ gÀ pÀ PÀ ?pix¿ %À') and h[1] ñin b'36' and h[2]  ³ \t\n\r':
  ðreturn 'ppm'

tests.append( ±_ppm)

def  ¢rast(h, f)C p"""Sun  ¡er file"""] óif h.startswith(b'\x59\xA6\x6A\x95'D  Š ‡  I ˆ   ‰ ;xbmˆ ÿX bitmap (X10 or X11)Ž �#define † /xb)xb8bmp„ ò /BM^ ?bmpã 8bmpâ ?web_ cRIFF')ãÿ 8:12] == b'WEBPã  Q y   z ?exrØ ÿ\x76\x2f\x31\x01æ ?exrm �exr)

#-  ‘#
# Smalll¯ program #. —(J¡import sysƒÑrecursive = 0  if ‘.argv[1:];3sys ?('-8del2 !2]G ²] 1 2try  j     KFall({ E:], ¯ A, 1)R  , Oelse> O['.'7 ö	except KeyboardInterruptG  y õstderr.write('\n[( fed]\n'ƒ  . gexit(1& À Ilist¸ �toplevel�Ÿož"fo1@namež M ¢ ðif os.path.isdir(\ + [    Uprint ÷  + '/:', end=' Ä  , &ifd !® v  &   V '’‹ng down:O  ) Ó Eglob²     ® @s =  . (Ò Pjoin( u.escapeÀ v), '*'){ H   2T 	s0- / ? Ð ÷*** directory (use -r) ***Û B > � dc +Ústdout.flush(ž 	# ™   _ 6whaÈÑOSError¯ ß “not foundÖ `
if __7 __“'__main__! Yð()
"""This module{ò!vides the components needed to build your own __
ô__
function.  Undocumented  ñs are obsolete.

In most cases it is preferrec ñ  consider using• o 3lib³ ð 's
functionalitñ0y over this module.

"""
# (Probably) need to stay in _imp
from
 ð import (lock_held, acquire_ ƒ, releas -
  ôget_frozen_object, is �package,8  4ini9 2 qbuiltin P 6 ñ_fix_co_filename)
try:_ Ô ñcreate_dynamic
except Iñ RError8 ñ# Platform doesn't sup; ‘ loading.h 
W ‚ = None
SNälib._bootstrapcð_ERR_MSG, _exec, _W 3, _ú  4 m_Õ L ”_externalU üSourcelessFileLoaderŒ , ›machinery`   Rutil
Â  4lib $os
 %sy „tokenize Etype ¤warnings


 .	 P("the` ´à is deprecated¢�favour of& Ñortlib and sl" "†ˆ "for remový n Python 3.12; - @see � 1ð's documentation L !ald¬tive uses"‰D¯ BionWå ,_ðcklevel=2)

# DEPRECATED
SEARCH ðOR = 0
PY_SOURCE = 1 ðCOMPILED = 2
C_EXTENSION = 3  %RE0 ð4
PKG_DIRECTORY = 5
C_BUILTI0 60 PFROZE 7 GCODEB ò
8
IMP_HOOK = 9


def new_(ƒ)V"""**Ê 1**
}CZ  a6 Ç. 3The  Ø‘not enterÙ …2ys.f s1  ° Ìqreturn B!.MÎBType� ¤  komagic(Ÿ RL  Œ  / q numberÝP.pyc >sÎ€  ×.MAGIC_NUMBER{ 7tagy e <tagb ] •sys.implep£.cache_tagh   Ë!_sÛÐ(path, debug_ðPride=sQGivenê A  Qa .pyû  Õn4he  0its! � Î5  ÒRbexist;€sØ "y Æsx 1the5zb calcuÍQas if/ h 1wer Sorted‰ +If^ 	,@ ñn it must be a boolean8 isÇ [ˆ Pplace^ �Ðflags.optimiz@ Œ0If   Ó « |  x w DNotIÔ!edX ! Erais¿ Pwith  t.catch_ [ �  .W0efi’ð('ignore')
      ò-  return util.cache_from_source(path, debug_override)


def # / : . ñ
):
    """**DEPRECATED**
  Given the Z ô to a .pyc. file,Ž ! 0its# ! .F 0The c à does not needS óexist; this simplyX sz �  i 2.pyI ‚calculatF ‘corresponT ) s R.  IfÂ  } J  � pconform„ �PEP 3147  ñat, ValueError will be raised. IfB @sys.® £ementation‘°tag is NoneÁ ‘n NotImpl) "edU $isP $1"""V à²Ðßget_suffixes(ÇW ðextensions = [(s, 'rb', C_EXTENSION)ü õ s in machinery. ¡_SUFFIXES]§ › L Ï', PY_SOURCEI  F †bytecodeH  ” ¿PY_COMPILEDK ‡BYTECODEM ” ;ë +õ4 + k õ


class NullImporter:„ * ! i+ s objectØ ]z  _á__init__(self,n• `i€R== ''s    W ‹ q('emptyC Rname'N A='')n  5 €elif os.—h.isdirÎ "   [  mÔing directory_  K )	 Ð ³find_moduleÓ @full� × •"""Always² ö. €   –  |æ_HackedGetData~ðCompatibility supŸ—'p`' arguoòs of various load_*(@funcŒs… 0 Î žË Z,P=£ Ü …super().; 
5 o  â  ñ.  ! =I D £CdataAbýÐ"""Gross hack…qcontortÑ  er qdeal w/  ã ¡'s bad APIß  ~   6if … 1and;2 ==  w v  0  # “ o @ractLª Ð) requires usƒ À @rs. Reop[ M   #ù  ;€binary mÖ!ifä9ed.-   "otœ  7z.closed£  V    Å   	F  ! aif 'b'M!inƒ .y J  -  B k +    >! Œ  `å0 = 
Ú†RA W   Awith˜ “ X– Gread• Felse1 À    return sòBuper().get_data(path)


class _LoadSourceCompatibility(_HackedGetData, machinery.. @File< Ùer):

    """C ñ support for implementing load_su É()."""


def `name, ­ 
 ±file=None):n  D Oer =Â 8 
B )< Àspec = util. `_from_b ¬_location(> p = G 0if & ò  in sys.modulesŸ    £ Pexec(j ,* [> ]L Oelse:  p : ' Ð# To allow re  O`to pot\ñally work, use a non-hÉ]�er whichp# won'tI Ay on. �w-closed � object.. Í 0.__v er__ = ?½ C  
2__.J  H :\ r rreturn 6 
± h@iled ³©Oless­.@compq ¯  Í±	ð"""**DEPRECATED**ø 'Œ Ó  j   Û ] U LÌÿ2-ÆAèwpackaged Ú)`if os.Ñb.isdirË6çextensions = (�ñOURCE_SUFFIXES[:] +b ~
 5 yBYTECOD7 r 2  Óo     ) Pinit_³ % =½ Ajoin¼ Q, '__" U_' + D h C ÷ qexists(3  U 2 &    5 = # é Ubreak 
x E óraise ValueError('{!r} is not a ¸�'.formatÉ )² Œ,…  w  	Asubm#u_search¦3s=[@
ŒÀ.modules:
    ðreturn _exec(spec, sys.modules[name])
+ Qelse:
   8 Aload8 €)


def  _? (> b, file  ‚details)M ñ"""**DEPRECATED**
d rLoad a I ò, given information � ¤ed by findt ").A 3The>  w ñ must include the full package# ƒ, if anyA 1"""Š psuffix,M ³e, type_ = Å " !if ‘ and (not ñ.startswith(('r', 'U')) or '+' in& Rñ	aise ValueError('invalidAB ope3 r {!r}'.
d(mode)¡"if, qis None‘ ± òin {PY_SOURCE, PY_COMPILED}‡ ‚ pmsg = '°ð object required for import (S • code {})Š   _Š  M rÏ 2msg DelifH=‹ – ˆ ÛJgsourceJ ÍNN Ù P �compiledR ±C_EXTENSIONPà°dynamic is ð mo †   Ì(gÍ �'rb') as 0ed_ 
6  : € Å  %A  9 
¹  K  … D °ÆKG_DIRECTORY¦ S Už M �C_BUILTINI Áinit_builtinI ? �PY_FROZE? Zfroze> Ãïô "Don't know how toé+{}ì"v¸òI%ÂAmsg,[=1 "®  p, path=EaSearch‹¬!IfD  �pomittedh R 8, s6 RR-in,  '  ö1ialËpé„continueA !in ¬ ,. ^acannotC  8 €ain '.';M	€ 3subc Dof a  ss–B %  �  ±WP's __† #__þ ª!ifŽ…isinstan73strYý™3Typg "'f '!‘be a str,J %{}ò ìˆn ýo  – ,4(}‡), list)~ À# Backwards-Œ‘atibilityú   eRuntim£  Z £  \  ºa_ ", © =   "¥ Ê Àmat(type(patñh)))

    if path is None:  öis_builtin(name)  ! areturn6 , P('',  ¥C_BUILTIN)P ßelif is_frozeQ ‰PY_FROZEQ s¯  ’ É `= sys. á Áfor entry inë Æ òpackage_directory = o< a.join(8 !, ý É  Q `suffixR ö['.py', machinery.BYTECODE_SUFFIXES[0]]u © y Pfile_^ ò = '__init__' + ` s  4 ,  × ¥ Æ $,  4  ` ‡ K %ifç  is$ ( _] ä . 	èZ 3%, õÖPKG_DIRECTORYr 0Ð, mode, type_=Bget_ë ;es({ “  ¼ ! =�»F �  Ô Ubreak�,elx…continue# 1 P  # B: p out of Ñer loop when & 0ing    3inn  .J 
i òraise ImportError(_ERR_MSG.format¤®=9âPencodg =¦[  if 'b' not‡ –¡–with open°, 'rb') as Q,  L` ôtokenize.detect_ J Ñ.readline)[0]†  L  Îl  � $, < =	 ÂŽ ; ,� ·2, (H	cô)


def reload(modulÆò"""**DEPRECATED**.R+ @ the¬ƒule and u 2it.& T ñmust have been successfully i­“ed before= 1"""þ U % Jlib.§ ¼ † À HLoad³ !a < 4-inÐ !byOA, or úDsuch  qdoesn't£ Bexis
 µ 6tryþÂ % ÛmÏ‹C Hcept¸@  xò


if create_dynamic)  Á ¿ \  ã"th=@ = «” extensiop " è   ¿Æ ¡äÚ  #  ™ Oer =% $.Ef @File{ 'er½ ž F ñ# Issue #24748: Skipƒ Êm¶ps check®_u _ e_shim;� �# always # F newê à
        spec ÷= importlib.machinery.ModuleSpec(
  Pname= ’, loader= å, origin=path)3 €return _% Ñ(spec)

else:"   ð_dynamic = None
"""A pure Pythonž àlementation of òort."""
__all__ = ['__É c__', ' mÈ  ðnvalidate_caches  re„ ÿ']

# Bootstrap help # ! H tUntil bN ó	ping is complete, DO NOTÇ R any ¦ ôs that attempt
# to% Î  £_Y ô (directly or in ð). Since this
# partially ini
 óised package would be present in sys.“ •, those
#¤ 1 ˜get an unT @copy¡ðthe source version, instead
#! La fu‘ * � (either E  frozen oneã    ##É Œbelow if1 òis not available).
F (�  # Just6 qbuiltin£aonent,¡ p  ¨ ŠF ‚sys

tryË[ ²  b SF as ³‘
except IrRError? dfrom .î1  { Á._setup(sys,Ç )N#? &iW!e ä !-iP€ort, ensfñ we don't create˜¸# a second Ó .# ” _…v
‚ '1 }4 ) Sû Q_file3 _ À.replace('__ˆP__.py×ž 2py'�{GNamey e $# Q  ¨ 5 guaranteed„òbe defined, e.g.mÓqde getsâ K ò
 by a tool like cx_Freeze> + 2pas8 n[A8] =Evš_external ˆ:  » _ š ,( … . E 	ç  ã4  /._H _C ‘ X .>=Iš@ £_Àozen by a toóol like cx_Freeze.
  Apass ÿ sys.modules['importlib._bootstrap_external'] =   ò

# To simplify E ÿs in test code
_pack_uint32G .# O
_un2 	%  ˆ eFully ¼ óped at this point,ž Ñ whatever you%ò<, circular
# dependencies and startup overhead minimisation permitting :)

  warnings
™ ÏPublic API # %w

from œÎ "__t ñ__


def invalidate_caches():ï¿"""Call the% ° method on & ñmeta path finders stored inN =Aeta_$ `(where” Ñlemented)."""* 3forD  	8 ™  ˜²if hasattr(p =, 'Ê 'Ê  1   * .( #() ! Ñ_loader(name,Ò S=NoneK ‘"""Return+  ²  &¢specified '!.
Ñ TTñis a backward-compatible wrapper aroundú _I (()? AfuncA issQrecat]� favor ofM’Qutil.Ì 	I an.	 T('DepO òsince Python 3.4Ñlk  å premoval˜'Û  V ': a12; usá” ¯ instead',I  “ BionW,X¡cklevel=2)4 6try‹!= 1¦ Ä3]._Ó!__7  ° 3if 1 0is ßI   ÷raise ValueError('{}G  5 �'.format,)•  ? KelseQ 4t † ¡except Keyb / o" ‚AttributŠ ( ¤ {not set§   õ Ÿ $	h&._< Bß ð# We won't worry about mal0ed N ps (misså ¢¾ "s)R!if# CÐ #˜  E) .40   2subn±_search_locls4  X 8I¿{ ('´ Å4{} ¹ w 
;« S   -= ,  n   ! `space ·€ages do ¬Chave˜s R    C i r; Ç /Ðë ¦ Ìðckage=None):
    """ñFImport a module.

    The 'package' argument is required when performing a relative iT A. ItM ãspecifies the V ’ to use a ðanchor point from which& presolve= O g  # ´an absolute} È 1"""4 ‘level = 0 ñ	if name.startswith('.'):  ÿ  ! $ot«    €msg = ("Ì #$to! ’  K  !"i4µ for {!r}")�  & ðraise TypeError(msg.y0at(Ê ).  A Ácharacter inê 
Â 6if " j!= '.'!  r Ybreak„ DA+= 1 òreturn _bootstrap._gcd_È – [2 4:],I!,  ò)


_RELOADING = {}


def reload(‹�A"""R  ¦S and � 'it´: ó must have been successfully “ed before= )6try [# =t 0.__É0__. ò except Attributœ? 	L  T 9 P   !__K   O  # "2)¤ü %beÒ"")rif sys."Cs.ge; Õ3notæ ¾ è"0 @ {} % (inE Ê˜ L¢,‰=ó ­ d0ame£ Þ [; ]- T 	wpparent_< ! =ƒ ±.rpartitionö"[0U  _7if 1 �   	W     . ( =[ t [  . á1Key$
`  ! tA v
 3   ~
M Ž !),! 3   +=5 �INone> NelseÂ “pkgpath =I0.__ æ8 4 	e jtargetÜ ·  † –) =‹Afind°Š#, d ", V ƒ N  0pec ~ 
Ò YM�NotFound»1(f"‡  f ¹ 0 G Èø u 5Pexec(M ,ƒœ #ˆR 2mayÓð replaced itselfAÙ!¥B CÀ   finally:
  Stry:
  õdel _RELOADING[name]! ú except KeyError: ÷pass
"""Subset of importlib.abc used to reduce Cutil Ãs."""
from . Â _bootstrap
Q D abc ñwarnings


class Loader(meta ñ =abc.ABCMeta):
Ë P"""AbR �ct base * D fort lF Ž 3 ödef create_module(self, spec)Â"""Return a (  ò ð
initialize and into which  k .˜  �ñThis method should raise IMxñ	 if anything prevents itª  E A¯  " Sa new� ².  It may r¨ @None‡ …indicateD �that theã ‹ T e T 4  ½ €   Ð# By default,	  erh  ¡ semanticsw h Q ¥ # # We don'tS „ine exec”°) here sinc¥ Aat wBQbreak¦ ð# hasattr checks wO  ™ 0sup®ó backward compatibility¢  ±q @full)	 Û  3 $edƒÊ  $3The Â must be add'Bsys.Cs64hav5�-relatedÒ  H  Ñ pibutes {°properly.  b Ÿ “ is a strÍ  : 	VskÇd on failure+ š€is depre2 Ñ` favorôë )r.–E. If¬ 	 p existsQ@n it¢ '•provide a’$s-“l§�functiona¦LB¾ ›dif not
Ê'™ 'Ê &‚Î 2# W‚ :qlemente_	'…_shim().6 ×Ú./ [5 €m€S_repr»  ´ ‡0's 1 U� by{„’type when …Adoes/Ã dNotImpò —] ,$ ’Ç.	 "("è9.Óø )*‚ W"œ  ³ !"s-óremoval in Python 3.12", DÎ3ionÑ)O #Füñion will cause MŒaType._š  __LPignor‚Š‘ G ? ÷`contex5 R@ort ™Rress
!  öBSpec'cAdapte›c Ð a package spñec to adapt the underlying loader.
    """
	 ò	def __init__(self, spec,C ‘er=lambda : .H !):@  M  7 .6 ! =" 
 / $ =R (* )~ ugetattr� Gname_ sreturn & ¥ n !, ) ñ


class TraversableResourcesLô «  ô  ¯ Aa /provideB 0¯  hSget_rš 0_reŽÎ É ¦  ¢ ò ñ DegenerateFiles, ú µ)._native()þ - M 	ó ð er for an existqor non- Dant ž  ž º 4to  5a d“ 1 .f• )!Œ—Path(abc.•$ qiterdirÖ    " 3((),  8 /s_7 RFalse` 4 0is_ª " =÷ Qs = iC ÷   # type: ignor3  g PjoinpÆ  Ð, other§ z.ü µ ‘@propertyO “  `  ¼ü &''Â  / Aopen/ ð	, mode='rb', *args, **kw
   ð aise ValueError. ô >  ô jÒ» 
É  – Æ? òwith suppress(Attribut… '  Œ ëq ^.,– .=b‡  F ` þ h RE - ãa if it­ Ports +#s(Õ 9 E  Celf.ý  * Ë % `if hasØ( 1, '] €') else ­ äÃ _à ; Í ^ & ‚ !, , M h # A ®
† Pwrap_ t(packag‡ÃConstruct a " ò òt�Ã compatibiliù!on‘ ^ //AFBSpec½¯$er’ !._¡ ?__,¯4 ð)
"""Core implementation of  ort.

ThisMÐule is NOT meãto be directly1 `ed! ItÔð	 been designed such
thatH0can< ñbootstrapped into Python as– @ As
Q  L srequire2 DnjecÃ  DCific¾ Às and attribðnutes in order to
work. One should use importlib as the public-facing version of this module.

"""
#
# IMPORTANT: Whenever mak< ¨changes to< �, be sure õrun a top-level
# `make regen-œ Ò` followed by# `Û A get½ sfrozen ¶ 1
# ¸ "e · ð updated. Not do¥ àso will resultU  qMakefil¤ ð'fail for
# all others who don't have a ./python aroundÞ afreeze™ � $
#a �early sta!÷of compilation.
#

# Se��._setup()‰ p what iÝ‘jected indðe global namespace.J  ˜P editð tÆ@code‡0awaˆ O  PexecuQ  ` ó time CANNOT
# reference any in€  ob	 @s! T^ ôincludes not only— d €but alsoO@nyth• ²specified aÈaclass ‚.

def _d _Û â(obj):
    try	   ðreturn obj.__qual- !__) ýexcept AttributeError; Atype^ 
A ð
# Bootstrap-relE Î # " – MoJÅ€manuallyãïö

_thread = None
_warnings deakref  ’¹AdoneK òinstall_external_W„ers()
_bØ   K xÓwrap(new, oldv€"""SimplÉ�bstituteš¢functools.k_> qper."""‡°for replaceB['__q__', '_à Ã vdoc__']¶ô if hasattr(old,Z ¦    1set# Å } ,3 	9 )¥ Ãnew.__dict__É  `  #)
”3new¿ (kx ‡LBsys) 
õíP lockþC"!##& A § P mappK L  ‚ws_rQLock  nces
# Dicw‚ary protR!by·P2± 
ñ _¾  ‡[{}
# ‡ µ!idýy  _bB âing_on = {}


÷P_Dead ¤@(Run… bFpass/ Ø á"""A recursive¶  çalementc` whichC"abå deù # dz sc(e.g. Í 1l d k ¤ ¢ 0s A(`n B, aõ®2, I t0 B0 1A).  	 äÑ_init__(self,Æñ Ç0lf.u 3 = ‘.allocateŽð ()
        selfó.wakeup = _thread.allocate_lock()
  Àself.name =  
 Êowner = None šcount = 0 qwaiters  Ádef has_dead{  q !):  ƒ 3# D õ avoidance for concurrent circular imports.> · ã —get_identß `tid = t .Ì : Aseen . ¦while True¡  ¥  ¹  Lb	 æing_on.get(tidJ ) 0if # 1 is3
F  ! ¶return FalsQ  ©  = ©   1if   ;= mš   T  · ß   6 0in í Œ ñ	# bpo 38091: the chain om �'s we enèjer her±  b ù!# eventually leads to a fixpoint or a cycle, butŸ A ñdoes not reach 'me'.  This mean† Pwould% @  #ac a> ÿcan happen if other?  �s are at�beginning
ö acquire() belowz ¾   }Ñ tB.add%{  Q  “1"""#  S At � amoduleUô.  If a potential ó  o•detected,G 4a _[PError& fraisedÆ OQwise,n   ' salways ¬ Qd and  ñ E ¼ §u’_EQ[tid]†%lf¸ :try¬– ,Bwithß ¼ 
8      "if" ËP == 0˜ �k  ?tid=  A +  ‰«    ) g O+= 1( DS$ ² 	9.t   ×ï%('‘ by %r' %
º G   { A.(à‚ ú ýü a# WaitÛ€a releasWMcallN  Ã‚ ¯ & Q L 0fin—
ÖMdel �
4  �F  Z í Õ‡	R€0 !=B
–  xÃqRuntime°R('can-C un-�d'Àassert self.·count > 0
  Rself. I-= 1 7if  Y== 0:   G ! Íowner = None" F ~waitersC G "  ‰  "   m ñwakeup.release()
r Ðdef __repr__(( )i ñreturn '_ModuleLock({!r}) at {}'.format7 ‘.name, id ö))


class _DummyB _ Ç"""A simple _ ñ equivalent for Python builds without¸ ømulti-threading support."""Ù CinitÙ  , £ ß  î · ! = X /Ü6= 0O racquireâ È / +?FTrueD  } Œ ív 3óraise RuntimeError('cannot R C un-¡ �d lock')Ñ $ ú½ÿ ú†Manager:/__ _µ¡_å =Ò OenteÍ  q.4 a_get_mÖ Ó.l 6 .Y
5'ex\°*args, **kw
 Ûy |Ð
# The followÁðtwo functions ar �r consump 3 by1/imìAc.

ÆÎ  4‚ ò"""Get or create the ú &gta given  ? .¦Aó/ei]QnallyI rglobal � P ’to protec¨fsžD_impVc(x6tryY	  jò	T [® ]?  % ¡except Key(O   B q4  "if» !isŠ
2 Bif _g    A V ë(› Ø  &   Jelse`   @ ,; £  &  ëbcb(refË=_ N \ D  [ ó# bpo-31070: Check if another 	Kqd a new<	© L 1aft6 ¡e previous. ï was destroyed< ’but befor´ñweakref callbackD   ?ed.B  ¹éaRs.getW É>ref:¹ Ðdel _module_lËocks[name]
  �finally:  ( ù_imp.release_lock()
) b_modul b ð = _weakref.ref(7 Q, cb)9 o c preturn ? q


def ‚ 0_un y (Õ )½ ó"""Acquires then ¹   © O Ä for a given  H .Ü ô	This is used to ensure a+ ðis completely initialized, inz é €event itJ ñbeing imported by another thread.2 1"""  ß  E3getæ ù ë " 'tr° / ".aù (eÀexcept _Dead RError% Ö�# Concurr¢ ƒcircularŸ ¡, we'll acC Pa parà 
ê † K XbobjectÉ   Apass& Felse{  Ž Q Là# Frame stripp&magic # °call_with_fU ös_removed(f, *args, **kwds1"  „cortlib:  É¯P.c wiblways 0 ’ sequenceã #of=Blib {   that end � 0 a œ  Mt]‚functionp1Use(ònstead of a normal6 ðin places where includ,6thez n~ pintrodu4 Punwanv0noii 0nto¤ð traceback (e.g.\ ±n executingM ÛBcodeX¢›*f(V§óverbose_message( …  Vity=1ŠQPrintš /  .ðstderr if -v/PYTHONVERBOSEW  ded on.™ Òif sys.flags.g Re >=  'it7sif not m p.starts­‚(('#', ' 3 ')¤  Ö  2 ” = '# ' +C 3 ! pÊ õ  .fÊt*€), file=¤ Û )4"reºÃ_builtin(fxny À"""Decoratoraverify+ ¶d˜= &-i7\ ð_wrapper(self, fullI o  Ã %if &!inX_ $in– 5 sÜ 9  raeIêv`('{!r}® n!a C $-ix' … ,H P   u =. - “,xnÖ # ó /(_
 , o* I + ±_froze°$< ¿
® º ­ \ ÅB.is_7 à(fullname):
    õ4raise ImportError('{!r} is not a frozen module'.format(fullname),
 L 	  % =. - úreturn fxn(self, # ò_wrap(_requires_…  @per,8 )L H * ò:


# Typically used by loader classes as a method replacement.
def _load_ÿ \_shim± :‰ ó"""Load the specified6¢ into sys.G @s anj Ait.
B DThis† óis deprecated.  Useµ b.exec_H £() insteadC 1"""K €msg = ("�  ì 0 æ 	` Ž  slk ò for removal in O ØÐ"Python 3.12;K ‹ "™ _warnings.	 s(msg, DÓ BionW ,  0! =7 êms%ere , $, %if+ ¡ Uˆ ¬  R s[a]" ' _À (} ,©c   X_ A Felser / ¹ R )yM4Ø Ïifications # #!

ŽÜ b_repr( )‡ ±"""The impl¾n B of † aType._8 T__().+ ´er = getattU A, '_Î ²er__', None!ifÑ . :3 0"__N3__"1 š P‰‡ Afrom1 2 ( �elif has‹ œ 2, 'é 6 'ï  - 6tryb   ‡8 m6 +ü�except E :ionH Apass+ ð# Fall through to a catch- ñwhich always succeeds.9 	›  # =d0.__ !__( ˆ ‘Attributeƒ�  * a = '?'. 	V Cfile   0.__ Z #ifQ ê Þu J"'<[  >þ w  , 
  ˆ	>   (D )E ,… M 
I E  4�   , ú — !

ØøBSpecÛ ! ¢Žðaš,Õd  B3ingWA! "'sû"isçQource0 "in‘ion about! <a.  ForÀ±data associnGwith* Ñ, including s] “ "  · '• � #erœ `õ `Å í�absolute   ý  ‡ À  `loader` iñs the loader
    to use when 1ing# òmodule.  `parent` i< pname of% A ppackage  5  * ’in.  The >   Áderived from.  J !.
E C`is_I á` determines ih X Óconsidered a 2 " oË ƒnot.  On/  ¯  isz Áreflected byz ô`__path__` attributeŠ eoriginï ðspecific location/I IÓ �which toÑ   k ,Ê ’at informJ ¡is availabjW„@file1 isI Rset, ” ´ will match­ Dhas_™  ` indicateú Pat a ½ B's "@ #" 	5s aÏ .f { "th/�True, `__Œ 	$øa [4setŒ ecached9— 4    bytecode ] �any.  It‰ °corresponds› ­2`__< 	‹ v 2subcu_searchsŠ qsequenc¶ ÷` entri&¬9 `importY sž !f ‰§¡ should be¸  4ô--and False otherwisWP&Ãs are simplyF­¼(may) have z Èg  ha¼õnon-None value in `4 ,ˆÙ E bsystemNP�  ¹¥ C4 aslsxòOnly finders (see a ñlib.abc.MetaPathF# A and{ 
%  ! REntry& )T�modify MƒÔSpec instance 2"""9ðdef __init__(self, >,ÌTer, *>=2 b_state ™   æ" %):#  b .a ! =h 
 <3r =} 
 „# =Í
 : – @  
) èP = []g¾   e‹ ø - á #y-ž o # å A_set ! " =×
Œ —6 = c �Crepr�=@args¦ 'Ar={!r}'.ºX%),d  ‹   '1   %)]3 i§3lf.lais notž Ã S  Š ’.append('- _   -))_ …s A E={}'p  «  	.D ² ðreturn '{}({})'.fñ0ormat(self.__class__.__name__, ', '.join(args))

    def __eq__: ‘, other):  ! qsmsl = W õsubmodule_search_locations/ 6try<  @ qreturn ^ .Œ 2 ==e  5and=  0  q floader2  4 
forigin4  4 à “ â  A  qfcachedu  4 
5hasA:  )ÿexcept AttributeErroriâNotImplementedå‘@propertyP  ó  •ì"ifè_ Š is Noneh % Xais not(  #A »set_fileatt§  àÿif _bootstrap_externalo  0   jraise Þ Ô  "  :Ã =j S._get" .Í p¶K Kq.setter| P", # XG # =  P ›RparenÈC q"""The Arof the ‹2's 2 A."""�  ¥ÐÝø  l p.rpartiä…('.')[0]d ;els> ã ä€é D _GM < † X w, value_ ‹X ‚ = bool(* 0


Ð¢spec_from_s(",  R, *, 2= Á, is_package p B"""Rþa­ X ó based on variousW … methodsÉ`if hasC(y '¹ Y � 'h ñSK § ÿ  l ¦N. ±� "ç÷x	y 	=­s�‡ = [] if� £›µh ,<  Ë  l=¢ s
£ ‡ö>ôð     try:
        öis_package = loader. u(name)
. ù   except ImportError:   , A õ
 = None  # aka, undefined4 JelseB Õ# the default( X aFalse
  ñreturn ModuleSpec¸ ,Ð ’, origin= &, Ÿ = ñ)


def _spec_from_mP ( N =Ð S   )¿ ñ# This function is meant for use in _setup().· 2try;  Ü  w 2 = m "._‡ _( s›AttributevBpass( 	K1if T ais not‡n  r 6 % G íƒ   _ƒ #ifM ×  õ K 	Æ  X FI  K  # Ò  # #q ‘will stayÃ : !   û 	… AlocaƒOCfile� } >  é Z#ifDÿ p !is¤  ¤ 	›     ‹sq_ORIGINm      ¨  #   K ®   W( á m 	ž hcachedº 9, ò] 2subÝ„_search_ˆ s3isti’.__path__xV 
Š  å/ ="y  3 .±_<qattr = u ô  qU Truep .	  µ 
 A 	¶²Cinit­_¨  s(¼ ,Lá, *, override=Á ² e DSed-in0 q may be50supç V {Á assignment,� #×ñwhich case we simply don't setÏB sÂJ# __`(¤ p or get2 4, '. !',c)‰Ë  ó	Ë  o.; ! =.w ¼  $ _ #  !0  ´ 	Ë Yµ / · #" œ  n  { i ”ï 8   ò# A backward compatibility hackj ) ð    if spec.submûodule_search_locations is not None:
  ðif _bootstrap_external4 0  ? ý
raise NotImplementedError^ ÿ_NamespaceLoader =n .' 
I l? R œ.__new__(D )D ÿ._path = spec.subm7? 0 ˆ 	 % ò# While the docs say that g �.__file__b –_set f: £# built-in: as, andY ÿcode below will avoid setting it if™  À 5has ƒ ¡false, thi(�incorrec” $ n½N  µpackages.  ’  ” have no …P, but¼ i$@# __œ �__.origin˜  }ñ "us: 	C–  Ðshould also b£ ne^ã consistency. £ÿa bit of a hack,O   Îðbest place to ensurç)is] E  ð  See # https://'ö.python.org/3/library/importlib.html# Babc.Q.ˆ_\j   2�bpo-32305  7 P! =$' :try00  u rer__ =  4 ñexcept Attribute
F Apass0  ù2!__ òif override or getattr(x U, '__0 !',­ )-d · = þaparent{  Ø½ ¶? 	u ° .×n ( c /th - /ifñ J ’ {N 	Ý     å  O Q a   	9–/__cachedy Ú¿ RV 9 ‡ B æÄí ;   í 9 º Àd__', None) §is None:
  ÿif spec.cached is not(   3 :try=     ’module.__F H__ =V 	q  0 ÿexcept AttributeError[ Apass@ rreturn k c


def `_from_Æ ( )I ³"""Create a( ò based on the provided© 1"""f ñ	# Typically loaders will±implement cZ _� 1().<  ! => ¡if hasattrš .R 9, '@ '²  L# If^  û 0s `¿`¾ ñn it means defaultp B ˆ d òion should be used¬  * ( «œ .6 eÚ P[ /elÍ Cexec1 Ë Áraise Importá"('d `s that¹ Gine > A() 'm  ž  ¤'must also< 
­ 1)')> i Î 3 Q ó C_new´ ›Bname? S_init _¼s" ,F% “ Ž4 Orepr”RÇ ‚ ( 0 to–@ forØQ .�ðWe mostly replicÑi �() using>  ¯ ³ Vsë Ú t = '?' í R else  B K ~.originGH Ð   k"#'<tà{!r}>'.format(k J ,  ƒ ¥  >   (D )E ,» Š R 
N ¬ Ïhas_locationl  T p o o  ¯ 
s   Á }¿ c 	Ä U P

# UªAby i?`lib.reä €() and _ @shim„ _O
°í ¥"""Execute*!'s<SifiedyÀ in an existUmÙ0's § Uspace›  ç  9qwith _M6 ²LockManagerï‰   ”2ys.^ Cs.ge J  0  4 0msgÆ š”6n sK ` @ �Amsg,Ù =À Íç ¯  $ u er¥ 
V _   ( 2sub§ u_searchxs<  @ £ A'misÞ{ '° :µ  @   a# Name«ð package.
        ò
_init_module_attrs(spec,  õ, override=True)
9 ‰   else:   R ) @  if not has� Ž ã.loader, 'exec® .')|  @ ømsg = (f"{_object_nameH 7)}.H !()p �found; "Ð  T  ð"falling back to ˜ � :()"4 ° _warnings.	 Ò(msg, ImportW 7  †ø  g  Í 2 ‹ ƒ H ö àJ zfinallyTò# Update the order of insertion into sys.N Ss for:	Hù# clean-up at shutdown.$ C ( =P B.popº÷ w [å  # 8] =€ dreturn q

def _µ Ââward_compatibl#Uð# It is assumed that all callers have been Ö°ed about usb Ð (bñ# appropriately beforeN  1 �this funcV'trŒà  V )er  ø f fexceptÃ5if " 8 inZ%  %¬ |; X QraiseæS# The‰‹ must be“  	cpoint!7 pMove itn …0endƒý/Â 9 6aif get~W A, '_7Àer__', None) 	 J	³ ÿ > .<  b1pecÄ!erâ  ( ¸ö  AttributeErrorX  # Apass0 � packagež d# Sinc•Ñ.__path__ mayÁline up with{  ˆ   #V2subá q_search@ @s, wØûn't necessarily relyE "onH ²parent hereÌ d   ^ ™ Þ Þ!._Ö)__T ;@ ½Û 3% e 6p.rparti—…('.')[0]r ¶/ g ³­ : O’ À      pass
 ñP   return module

def _load_unlocked(spec):
    # A helper for direct use by the import system.4 0if B .U âer is not NoneT X ñ	Not a namespace package.C  # !if8 qhasattr• S ‚, 'exec_Ã '«  4   ðmsg = (f"{_object_e @ 7)}.@ !()h …found; "€  L  ð"falling back to Ü € I()")5  _warnings.	 €(msg, Im'W 
/ �„ ` ñ ward_compatibleº !)
c ò # =¾`_from_m% ð# This must be done before puttÇ  ºL  in½. sf ò# (otherwise an optimization shortcut in ý”.c become> bwrong)Ê � °._initializ} a= Truej 6try4sys‡ [7  ¸]í 1  ‘	5   q
m $   ( 2subï ±_search_locÝ s­<  @  raË°Error('missÔ  Aer',Ñ=¾ 
ê D  Q Ø 	õ` so do‡Bhing9 -   7els8    b u 	ÌØ w fexceptd < @  8del�x ' P A Key
Y  ! 2pas    5D w# Move €!to hend ofƒ 1# WÇ€'t ensur@ !at7 ‚ƒ-related 1§ibutes get} !se¸  nó	 replacement case.  SuchO ‡s are onH –their own¥ z) =Ã 1popš.ó–| iêò_verbose_message('ð q {!r} # "',n b  o vfinally©:‘RFalsec�Ï  

°`methodöPd durð1tesIo=£) and by
#WJ †_shim().p¼B"""R—Sa newy À,neU ô Â "'s "r.¶ 4The5 pPadded«£its parent, GIf a- palreadyÐ˜¢, that exié m/ Oß“clobberedU """:qwith _M. £LockManage¿ ¤ò ó ú
~
zŸLoaders # +À######

clasñs BuiltinImporter:

    """Meta path i ` for b. Â-in modules./ õAll methods are either class or static# ñto avoid the need tow ±instantiate A d 2"""m ´_ORIGIN = "�  @h Š Q 3def« b_repr(· !): é pReturn   ä  • ( z  ( 3The¿ ð is deprecated.   #ámachinery doesÃ §job itselfN  Ì  V    _warnings.	 +("‘.‹ ¿ )} e and "Ì  N  0"sl¢ Ô óremoval in Python 3.12", DÊ BionWˆ )P r2f'<„ " { ü .__name__!r} ({±  B})>'±@Ç–ðfind_spec(cls, fullU ,sÑ=None, target ³!if$  @not + Ð  ¸   Ì ±if _imp.is_54in(s [ >  › Å_from_loader/ !, ± ³origin=cls.ñ 9Oelse“ ” d® b"""FinFÕ ™l@If 'Ç'1Pever Û 0ifiw1hen¦`search" ÷considered a failureN OThis	FUse × ) Î7ead> øJ ø<?; u« !",�  (	 P  =.µ   / }� $ .Z1 if“ ~Ñ CÛCÚscreate_% S 
C  , a·‡} .}  qin sys.Q#in] ñsÔRaise 9€Error('{!isH v �'.format(© p )o~ • =/ �Eñ_call_with_frames_è1ed(ìÊ ,e)P	Cexecñ *OExecN’ a � ¸’ %•@_require²ÿ  ÒŠget_code%
üÖ 8 asÀdules do notó	 have code objects."""
  Áreturn None
 Â@classmethod ñ_requires_builtin ñdef get_source(cls, fullname):#  c F"""Rc A as E ò-in modules do not¨ N ¯ § 7Ÿis_packag§ _False¨ £are never N J@ KRload_æ 7 = X'(_ ‘_shim)


! ò FrozenImporter:J á"""Meta path i a for f- J.- BAll À s ´ beither€ ¥ or static# °to avoid thà Qed to¿±instantiate   d  C% ²_ORIGIN = "� "… @f ˆ *  1_repr(m&  Û  Ž / s  N3The¸ ð is deprecated.   ámachinery does¼ §job itselfN  Å  V    _warnings.	 *("‡.Š ¹ )| V and Q M  0"sl¡ Ó óremoval in Python 3.12", DÉ BionW‡ )3 H ¡"'<ƒ ð	 {!r} ({})>'.format(m.__w;__,?.Ÿ)•Ã”šfind_specÄ,m=�, target ¶²if _imp.is_ü( Ä  e  * mÿ%er/ !, ?¦origin=cls¸  ?   FelseV   ¡ Þ ;à Ó š"""Find a[5OThis„FUse O ) B7ead> sI º s<?; uª %",x c £Ocls  Ãi"ccreate6(2
ž c°default sem !cs^+ A 1ion?Î ‹Dexecg ; i  N# =X!._0__. S  !if· # I  ) braise ÒqError('Å!isA kÖJ � Y 0   % = 1ð code = _call_wió"th_frames_removed(_imp.get_frozen_object, name)
  ñexec(code, module.__dict__)
% Á@classmethod ’def load_0 ¡(cls, fullY :$  ] ¢"""Load a � ` W  " RThis Z ð is deprecated.  Use œ f ¦) instead.@ 5"""n õ # Warning aboutM ÷ion implemented in _¾ …_shim().H _retur$ 
ç … £@_requiresvX  2 ‰ g/	R| @the +  ²P for  
Gý µ ò(œµ "osource· zNone asîâs do not have L Ý .À   B ¤ Ÿis_packag¤ ~True ifO €#a I œ Ni×s \ÿ
# Import itself # +!

z" _V ÂLockContext:%3""" … manager+i‰ AlockÍ ‡ __@r__(£ )®!Ac»A  ¯  a) __ (' äc__exit\ ¢, exc_type
 Cvalu štraceback€ |Release€ ð
 regardless of any raiseda qeptionså      ¤ rM ¤ 
¡ €resolve_«( ,ôs, level’ B"""R+ ³ a relativeÁAõ to an absolute one„ dbits =Y ³.rsplit('.'d B - 1�pif len(1 2) <‚ “æ TÐError('attempÈ• ª±beyond top-É  'j bY = j 1[0]5ð '{}.{}'.format() $ ) $` else  "

Gðfind_spec_legacy( "er8  S#thI£msg = (f"{€{0 0)}.	 J !()'vfound; Ø Ñ P"fallê C ‰E Ž")"ñ "_w s.	 S(msg,K('  Per = D "er� K  ü Í 1 ®Poader- ¬«º  + \#Afroms#ersu )N Ðpath, target=S L`"""FinQ¡ Ð's spec."""
 õ   meta_path = sys. w
    if! �is None:   õ$# PyImport_Cleanup() is running or has been called.< braise > yError("  H  n €, Python …likely "E  … 
 `"shutt} qdown")
, fif notË Ã @_war¬  s.	 -('„ sempty',ª W. W ¢# We check;ñ$odules here for the reload case.  While a passed-inŸ ð# target will usually indicat/ E tZ ðis no guarantee, w #asK Â Š Âprovides one{3is_M ˜= name in¼ D  » `finder 5bwith _¼ÖLockContext()#  –:try    Y €_spec =  0er.  ~  %   ñexcept Attribute%P K _E €_legacy( 1er,æ  , â)`  d 1if @ Ú   ‰continue> 7els	+ M Ø Ñ (c} ,ä… }  � í
ß á# The parent ihó may have already ‘ed this mùë• ýú1and Þ.
}  > N [  s[Ó ] + ì  _	D__ =�  D ò V z1usecRfoundÉ@sinc  at0 €"on n G ‚we wouldU@usedô 9 xohadn'tE Ábeaten us to’ Zpunch† o   areturn® N U 6 4if 7 Ù , %  c 	 $ g   > o 	¥ : 2  ý. 
&   ³ ñ 


def _sanity_:#Ãckage, levelIò"""Verify arguments are "sane".""
áƒinstanceT 3strI Ø q2TypJ#('Ú Ð° must be st2òot {}'.format(typR "))½"if¦ F < 05ÑDValua Ë [ [>= 0'A >A Ç #pa
Ê Î #__. !__ì0setŽaÓ 3ingz ð     elif not pa‡ckage:
  ñraise ImportError('attempted relative i  ù with no known parent 'P [  1'pax !')) öif not name and level == 0™ • SValue” ÁEmpty module< ø')


_ERR_MSG_PREFIX = 'No& 5d '% < = 0 ñ+ '{!r}'

def _get_mc Á_not_found_e ¯ )¡ �return M) @NotF' § ` �.format(6 ,° = i ñfind_and_load_unlocked/ ,l_n ±path = None?u=U ñ.rpartition('.')[0]% #if�²  ‰ ~rin sys.í s&  * `_call_ëò_frames_removed(#_,] Ð 3 ñ# Crazy side-effects!Š    ò îu 	U• [1Ï  E ø Ÿ( =¿ [ , :tryÓ E( D 0.__ %__¨ ò except Attribut{
I tmsg = (è` + '; C1 isY%a î3 Ô çI8msg7V from@specÎG  : Ð •0if   –  :Å s ê7els-, w 
µ h u bo ”# Set the•tas an acs on itsQ.w  H ªîochild 20set‰ (m !, P ,± Ú  “ Pf"Canã=setí {m r!r} forl k ! {z E!r}" y  _warnings.	 (°W ¤ B§ ðNEEDS_LOADING = object(8î>…Bâ|r"""Find§7oadÉ2.""¦  (" _Ä±LockManagerP G  Å — 
Ê2.ge#9, _­ Ñ  7 $if+is% e ) þ _Õ Z
`	\ 
&pmessageë'ï of {} halted;ô'E  æ')Ù ˆ7
D| ÿ° _&Ó fÎ h
hðgcd_import(name,ñ@ package=None, level=0):
    """Import and return the module based on its name, S  qcall isO ñbeing made from,V  O v Ñ adjustment.
0 ñ	This function representsY õgreatest common denominator of7 QalityN ‘between iÒ "_mÃ  Ù #__ 1_. t Ðincludes sett´ #__Ô Q__ ifO ¸ Äoader did no¶ 1"""! ñ _sanity_check(nF h)( "ifvB > 0w { 0 À = _resolve_ E œã_find_and_load0 C_gcdâ ð)


def _handle_‡Rlist(,˜  ,'ö, *, recursive=FalseöFigure out what Jd shoul5ÑeX ð parameter is a (ò able which takeè ù  Ñ¢ 2 to5Å@. It? ñrequired to decouple%= é ` assumÏïBlib'™  ›  le€aq`is desX ¿ ÚÀ# The hell tö  ¦0rom8A ...¡ d# If a^@ was_  orted, try« w Qstuffz  G D …for x in  ifró isinstance(x, str› B  &if¼=     swhere =Î!._eñ __ + '.__all__'Í  -   OelseG 1"``g Á "'' 6   ðraise TypeError(f"ItemÜ {† �} must beÅ *, =  A  åf"not {type(x)¸ "}"Q + Úelif x == '*'³ ;Ô†uhasattr' Q \ =£;C	D B  � [=TrueÇ  í   x˜  y¿ô = '{}.{}'.formaÛ&6, x`  ‰ :try!  _�p_with_f¨¢s_removed(µ_+s 
O �except M_�NotFoundõ~ as excm ð# Backwards-compatibi¸P dictæý we ignore failedS#_€s trigge%by: L  W�at don'tG  Rexist€ 	 �if (exc.�!==Y þ  ?G  6 Qsys.mes.get(£ð, _NEEDS_LOADING)Ã å ƒØ I   �continuej Y s èWcalc_¾ð(globals):
    ""ù"Calculate what __package__ should be.

    óis not guaranteed to be defined or c> @ set ANoneH àto represent tv óits proper value is unknown| 1"""< ž ÷ = globals.get('· !')) Nspec&   #__# 4if O Ï  £ :?  ð 0if 0  �  ì   E and5 !!=  v.parent8  <  _warnings.	 '("¡ ` != __Z #__<  Ý  9   Cf"({© 0!r}? {> < e!r})",µ @  rImportW‘ â, stacklevel=3, 4 dreturnÜ O /el ç 2 ‹ 6 &se% Ôcan't resolven U from </,ð"falling back on __nam» § D Oth__zL$['g !']ò  ?1if … q '$in£ * P 
 ò.rpartition('.')[0W `& ¡


def __iÎ0__(ë ,d =žƒ, locals  V’list=(), ñ"0)� 2"""ý „ a moduläSThe '[p' argum¦ �såòinfer where the �  %`occurr� z ôto handle relativ0 1s. k ± 
j qignored" F 'P  Ê (  wRifies¸¬ðexist as attributes ¨ mç P  be¥ ¹ °ed (e.g. ``f Ö <  z r>``).  ´  <'J !Ñsµ� Ù  p ìEin aJ  	Œ T..pkg‹ qmod`` wU�have a 'Õ{' of 2))"ifóR == 0õ ~s = _gcdLJ
(el½_ü4 ifr ò 8 1 {}Ê  g  €= _calc_ŒW(V r  . • ,"À3 !ifa›Ý 2# RÆ upq öàfirst dot in '3'X is¿ ácomplicated by¹EfactÆ #ž7 @ mayâÉ.' k Ú r� m »
òÚ  3 v Y ­ Ü   N /  |
( Ä# Figure outªao slic³À module's na÷	me up to the first dot
  É# in 'name'. àcut_off = len(! 5) - ù.partition('.')[0])> ð# Slice end needs† °be positive ‘alleviate"   Ëspecial-caseO àwhen ``'.' notµ  “ *``µ òreturn sys.modules[ 0.__0 @__[:Ï  #)-î !]]w Òelif hasattr(, á, '__path__'):&  Fq õ_handle_fromlist5  Ò, _gcd_import+MelseI m ñ 


def _builtinW À ˆ6  -B = B$ IZ €er.find_ , ª 0if  x is Nonv Raise < ¡Error('no w B-in Ž  :Qd ' +
 ¾ ù àload_unlocked(f )¾ ¢setup(sys_H  ,   D@"""S'  clib by 1ing,ed’ Às and inject& Bthemé níaglobal° qspace.
   As  •`ed for .b acces_  ­ * 0to ì ‹ P Ù Ãs, those two4ðs must be explicitly passe¸ Ž 1"""F ­  q ,Ž    ( =3 Psys =% HØ Q# Setì"heë Ù Aexis Ñ„in/froze×s;m(€_type =   ³å E  ý,Ö  w\s.items(Ë Õif isinstancec , 0  ` X ¨ Û òsí -   ‡.erû % Ã D0.is@zÅP F+erO ­e zcontinu¬  ¹   z mÏ À bJ S_init) _wsLy)çPDirecL E ŒŸs/0dur’bootstrapêCselfc Cö[þ öŠž ('_thread'	‚warnings heakref"if› !inÄ²;
†n ) =  @D (  ’ <
E N( L v [  E í  3 0sets(!,Á  V ãë ll2ZåI#llÚ1ersz� Î
œ_Eâ 1eta À.append(Buil÷tinImporter)
    sys.meta_path.append(Froze) ó


def _install_external_iK As():N B"""I%   ä that require < ñ filesystem access"""D õglobal _bootstrapp  X 1 _f¤ ƒ :lib& >  / =5 T .ü (0ð
odules[__name__])
"""Coreö ð lementation of X`-based Áort.

This mF ó is NOT meant to be directly1 ñed! It has been designed such
^`it can< 6pq ÿnto Python as th¡ QP. As
Q % i­2 DnjecÎ ƒspecific¾ ñ!s and attributes in order to
work. One should us€ dortlib‘ ópublic-facing vers9t% .
að
# IMPORTANT: Whenever mak: pchangesC: ,@sure òrun a top-level
# `make regen-òlib` followed by# `Ù A getL/´  
#ï dÚð updated. Not do¥ àso will resultU  0 @Make ¤ ðfail for
# all others who don'ƒve a ./p×Qround: Qreeze™ � !in °early
# sta!‘of compil£—.
#

# Se›�._setup()‰   w¿iÛ V ¸ ª `space.J  ˜P editð Š@code‡0awaˆ O  pexecute@êñ time CANNOT
# reference any iˆPed ob‰ 1s! Góincludes not only — d €but alsoO@nyth• Äy  È aclass Ã Mšq €manually ]j6()
 p = Nonek„ builtin4
j ¼ o 4sys …_warning ñ	marshal


_MS_WINDOWS = —÷	platform == 'win32')
if + ¦€  nt„8_osX¹winreg
else- Tposix0 
W  ê÷
_separators = ['\\', '/']R (  " �# Assumpl@made ˜Ð_join()
asserÑ l(len(sep)í 1¨0sep1 ^ $)
 ! =Œ¢ 5[0] ‘_tuple =  (5 Ì F  a = ''.— + ³ òseps_with_colon = {f':{s}'­ «   }
4B÷@-rel@ É# "ð
_CASE_INSENSITIVøE_PLATFORMS_STR_KEY = 'win',
_CASE_INSENSITIV- TBYTES/ 1cyg2 P 'dar
 ; 	_ =  ([ /
  /+ H 	Ð ñ)


def _make_relax_case():a ÿif sys.platform.startswith¦ 	=  ¡ A #oI  M 0key�`PYTHON€1OK'§   Belseµ     / *b'0 1 ø ó  :   ð"""True if filenames must be checked ,õ,-insensitively and ignore environment flags are not set."""Œ  q breturn 1ys.1 .J _J  a  Û sin _os. K 
á C¸ QFalse† É O'

 / =o ˆÓpack_uint32(xÿõ"""Convert a 32-bit integer to little-endianž … Ó(int(x) & 0xF ò ).to_bytes(4, '@ '(un… Ndataˆ !4 @ : in  � $anž � 0ass¾ Alen(P X == 4,ƒint.from—  % 	š Ë™ "16I ñ!2™ /2™ ò 
if _MS_WINDOWS� ® ±path_join(* p:J ï¢"""Replace `or os.+ .6 )> . !if  _J j     îR0if o1 )u17 % 1[0]þ T goot = T  ( F = [$ ðfor new_root, tail@map(›_1 b_split!  ¿ 	 l  ß G d0 ·sep_tuple) n B.end‰% 
â  ]  | % =¨ „.rstrip(8 qarators^  +  <    )  ÷   a_sep +ê  % (elÄ � ;':'ë  - 0if j .?‡fold() !¡  Í  ? €# Drive ½ v š `s have�b ñsolved by the OS, so w  et ç Z À tail but doÿ not add a path_sep prefix.
   °root = new_ $  I � = [tail]" ]else:  k  8 €.append(< )& 8  … � @ or  	: \  v  ® �p.rstrip(  ñarators) for p in"V if pÖ aif len4 ¡) == 1 andU G :[0]ë ñ# Avoid losing the¯ €'s trail 2sepz   when join @withX IhingÞ areturnG ! +£  ½ #  .W ¶ &

ZPdef _¹ _  * fparts)È á"""Replacement0os.+ V \)."""€    ˜ # [T p;  ¸ Ž4art‘_L s—†art])


Ç Rsplitè Á ½ , ¾ qi = max> ‹.rfind(p Ò ­s­‚if i < 0m  ½ €1'',œÝ   B[:i] Š[i + 1:]À ,ta¿ AStat9 ? !.
Q sMade a ;ðe function to make it easier €overrideB`experiÉsJ Ð(e.g. cache sj ƒresults)j ÛÃ @_os.' %
{Áis_mode_type  ,  Ip"""Testä th— !he 1 isÝ ‘specified5  E W6try` ~ s_info =»  q “æexcept OSError9 Â QFalseû  (@ R 1.stÃ ± & 0o170000ä Ç 	¦Risfilå ß $- Í v v4 00o1y 0]2dirå Ò ØUisdirp  ifFl:  ¥ K @¢os.getcwd(<�  04ž  � âif _MS_WINDOWS\ ‰Xisabs±  w µ 
5absµ  - ¹   ¥ É ¨  [Þ … R[0].rÆ¢('/', '\\'õ ? U Û 4 3) >Ú(  ó0rts“@('\\: yE.end ?'))^/õ  ¹Ž   	•ð
write_atomic(path, data, ð'mode=0o666):
    """Best-effort function to write data ña path atomically.@ °Be prepared& ñhandle a FileExistsError if concurrent[ ¡ing of theI ðtemporary file is at qted."""$ `# id() "usp pgeneratr Ñpseudo-randomE Bname¦  » ð_tmp = '{}.{}'.format( ,W  	 !))g Ñfd = _os.open"  < ,  4  % �O_EXCL |2 uO_CREAT €WRONLY, x2 & zI 2try‚ N ’# We firsv P, and4ñn use os.replace() toY P 0perâ 3 an³6 re $ �with _io.«ñ IO(fd, 'wb') as?Ÿ  /  –.(*   …  E,-$ ‘except OS	U 	I eunlinktB   F   Epassû ðraise


_code_type =  !(_¾ _Â"._! ð_)


# Finder/loader utility C / #  N ‘Magic wor±reject .pycX$s ¶ó6d by other Python versions.
# It should change for each incompatible   toP byte· ð .
#
# The valuej!CR= LFA C rq`ted so ñyou ever read or¦Ve
# a¼ ‚ in textÑQthe mì ðnumber will be wrong; also,— Ð
# Apple MPW ¼  iler swaps "ir¦ €s, botch0str €constantÑ `re weròpvarietyÜ ±old schemes'@sett? ¢  X ‰0ork( <   to_0rem¨ ? ‚previous£ ‚ by
# 10`AStarh M . AadopA°of PEP 31475àA3.2,e`y bump A3
# C 4 ‚ Ñludes a new "$ ñ tag", i.e. a human«a/  
#ŠdrepresÅ A c ðin __pycache__ directories.  When X M æ, AmustáC set¨ Tuniquqtag.  G¡àlly this
# can" Œpd after Tmajor Ù T	½  7¡, but
# itO  re� V @anyt>,Ä@long ¡it's diffe| th) @ elsã0tha& Ñcome before. >„tags are“d³ • `follow<t�3, s1
# òa.RKnownGTs:
# õ Ê1.5:   20121 6.1:  1 /.2 6K P50428K ð   Python 2.0:  � 50823
#  ßPython 2.0.1: ¬1:   602024 14  /2:4 2N <717N ¯3a0: 62011 2 l11 (!)8 4R 48 14a3l 5 !b1 6 5N 7 í81 (ast-branch� A 91 (wit! þ2 (changed WITH_CLEANUP opcodeY bÎ ð 101 (fix wrong + ÿ : for x, in ...:  @: ®x += yield7 c%)12q plnotab Û w “loops and˜ p Qstori® ÿnstants that should have been remove‹  j9213‹ ü   ý listcomp/genexpØ 6ãñ151 (peephole optimizationÏ Ÿ STORE_MA‘"6a K61 (ÁL ~ 7~ C71 (u  e ³  ´ `rehens„ /Ï LIST_APPENDL  “L PcondiÇ 2al ¤?es:�	ðintroduce POP_JUMP_IF_FALSEØ	 OTRUE‡ P  621óM `SETUP_1 2Ë1 ŸBUILD_SET0  Á0 qMAP_ADD¤ 0SET : @3000Š  c3010 (wÕ UNARY_CONVER† ÍÍ3020 (added ² , 3, ôkeyword-only parameters² : 4: Àsignature an} Ü8 ð	50 (print becomes a func6 m ÿ60 (PEP 3115 metaclass syntax6 Q1 (stÙƒliteralsu @ uniž;  þq ’09 raise ðÙ  å3 ñ37 make __file__P__nam {  ¦ÿkill str8 interning« pðmerge from 2.6a0, seeó/518 53 (¢ 1poiö�o source º ; Ÿ`3.0a4:„Q
.Ê6  b16 à31 (lexical exÿception stacking, including POP_EXCEPT
  �#3021)
#! ó0Python 3.1a1: 3141 (optimize list, set and dict comprehensions:F K  ñchange LIST_APPENDF ðSET_ADD, add MAP o #2183“ 5“ Pcondi ¯al branche† 
‘introduceÑJUMP_IF_FALSE�  2 OTRUE8	M4715¥ 28@60 (Ò õ SETUP_WITH #610h
qtag: cp|3-32FŒ02a2Œ7T óDUP_TOP_TWO, remove  XÅ ÕROT_FOUR #922£ s d3  318s ýELETE_DEREF #4617ù 03a12 ò90 (__class__ super closure d; ð200 (PEP 3155 __qualname__Ÿed #13448> 1« @ed s¬ðmodulo 2**32 to the pyc headerL %64j³3a2  3220 (­  ’ Ð80 implementao #14230�  4A £30 (revertõ s„  C Vicit !^#1485U4Uô250 (evaluate posòÀdefault argu› ƒs beforeA
ò Ókeyword-only ? s #1696~ Ì¡LOAD_CLASSñ; allow locals of ö é overridˆ €free var| >785íú  ôÑvarious tweakI ÍD>237“J  Ë-ˆ± >Í!4aÍ Ó} 	š  u&93âTF 3Þ%moK #arc2 33ëJlter&	Œ 6206ûŒ 5P3à Øò465: Matrix multiplicà€operatorŒ=176 5bï3éJ e48: AdŒ2Unp�¡ GeneralizX s #2292O   y�340 (fix\ó ionary display   ë"orÃ>120Ã 5bº33 �þGET_YIELD_FROM_ITER opcode #24400!5.‹  g ‹ `BUILD_šaUNPACKÍV_CALLH >728"t6a0  33>ÆFORMAT_VALUE: >548ü6¦ñ61 (lineno deltacðode.co_lnotab becðomes signed #26107)
#  ðPython 3.6a2  3370 (16 bit wordcode2 /642 ó1 (add BUILD_CONST_KEY_MAP opA O7140s ñ2 (MAKE_FUNCTION simplification, remove % sCLOSURE¿  Ã  n#27095n !b1á 3¯ gSTRING¨ ?078: 5: ÀSETUP_ANNOTA¯ ·S and STORE T s© /98© 36 (	ey CALL 3s &nðMAP_UNPACK_WITH_' 
 o#27213à ÿ7 (set __class__ cell from type.__new__ #23722G  B8']TUPLE¤ o #2825S 0rc1…÷9 (more thorough” Qvalidˆ !7aé"90ˆ ±LOAD_METHOD© $  sâ.11¡7ý91 (update GET_AITER #3170907a4fð92 (PEP 552: Deterministic pycs> /65q  ¤C93 (ôW_ #325A 5 4A ñstored docstring as the first stmt in _body;ªñthis might affected8 J °line number˜ =9118”0400Ùðve frame block handlŸ �to compilH ?176H tÀEND_ASYNC_FO“?304| !10“C570 õ@Posia al-Only Pa– 0ter /65²  8bãò411 (Reverse evalu�àorder of key:  eaOdict\ ó �rehensionz N5224Az q2 (Swap~pÀ  s  qal argsê  oú 3 ð in ast.argument‹ >759/ 8bãñ413 (Fix "break"r  "continue"ù þ "finally" #3783ïˆ9a0  342ªPASSERWA_ERRÕ?488; 1%�ied byter‚for withc Ë >294®� 2/dð BEGIN_FINALLY, a : 4POP( x  i >338Ù9J#42}àIS_OP, CONTAIN ?ùJUMP_IF_NOT_EXC_MATCH] M9156] 4ðy bytecodes for ð*value unpacking)
#  ÿPython 3.9a2  3425 (simplify bytecodes for *D ý 10a1 3430 (Make 'annotations' future by default„ @ ð	1 (New line number table‡ ïmat -- PEP 626C 2ƒ p2 (Func{  †  A ÿ' MAKE_FUNCTION is changed from dict to tuple bpo-42202i ð3 (RERAISE restor.ÿ_lasti if oparg != 0B 6« 14 (Î ÿ34: Structural Pattern Match²@10a7@ ‘5 Use ins< ðion offsets (as opposedÓ  Ï ,).110b½õ6 (Add GEN_START #43683È  9  7 (Undo maaý  - We like› ÿdance among core devs!k 8 Safer" �handlingß 9ß óROT_N)

#
# MAGIC mustp whenevwh±€ emittedÂðthe compiler may no
# longer bhqderstoo. `older VCemen@ of G ñeval loop (usually
# du   AaddiÇ‘of new op“ ÁD
# Wª Å w_NUMBERÕ,d ráAs in amagic_`s arrar òin PC/launcher.cAalsoÐ ™pdated.

h À= (3439).to_^ûs(2, 'little') + b'\r\n'
_RAW_; @int.s:  E Q # Fo>ðort.c

_PYCACHE = '__pycache__'
_OPT ð"opt-'

SOURCE_SUFFIXES = ['.py']
if _MS_WINDOWS:
	. €.append(2 èw')

EXTENSIONQ þ_imp.extension_suffixes()

BYTECOD€ Âc']
# DeprecToDEBUG_1 ŸOPTIMIZED 2 b

def Zñsource(path, debug_override=None, *, optimiz§ )r"""Give4 C  ©úa .py file, retur 0its! c" !.
Z0The  Â does not ne•Áexist; this yyX s¬x 1theM 2.py] p calculB0 ask -� P werer"or· ã ‰ 'î ó' parameter controlv yresumed‘ level of‰  n  ó �Û [. If _ iì k 2 €string rþsP @argu$ Ãòtaken and verifi1ðbe alphanumeric (else VßQErrorN ðis raised).

    üThe debug_override parameter is deprecated. If+ ðis not None,
    a True value? ðthe same as setting 'optimization' to & Áempty stringK Çwhile a FalsR  equivalent: T Q'1'.
I ñIf sys.implementx  .cache_tag§  Á  † dn NotI) aedErrocraisedQ 1"""Y i	:#   _warnings.	  ('î su; use 'J  N  "J³instead", D¶BionW} )E 8if � ÿ Ä´  f »message = '¯ *orC pmust beâ • N
µ ?Q TypeR([ • 	’ ^= '' ]e1È Ðpath = _os.fs ( O  head, tail"   g_split# ñbase, sep, rest =/ p.rparti–B('.'N  !=@
‘ 0if * !isHù U /('”… Àalmost_filenM !€.join([(Ì  - # Ó )ß Btag]É ÷  ¨« i'cflags.�fe == 0$   F ê ~ , 
 ó 
` =R Hstr( À !n !ifŠ8 ¦.isalnum()'  Á ”V£ŽT'{!r}úalphanumeric'.format� �  J ˜ u{}.{}{}: # y, _OPT,?P Ý4 ñ + BYTECODE_SUFFIXES[0];µ"pyÏdprefixË 
àð# We need an absolutí th´ •0py †   Pavoidñ  possibility ofu  û ñ# collisions within&
Š ,š÷
someone has two differentM ð `foo/bar.py` onz  irQ atem an‹ ðy import both of% @m usT7theN r m
Ž °. Let's say[ . 7 isC à`C:\Bytecode`;k “ idea herÙ atÝ ø
we get `Foo\Bar`, we firsÞ vmake itv(_ PSomewP \=  ),i $n 0 Èroot-relativà /(`<  so} ³end up plac# bÉ ßÐin an
       ó# # unambiguous `C:\Bytecode\Somewhere\Foo\Bar\`.
  õ
if not _path_isabs(head):"  )   # =& ðjoin(_os.getcwd(),   %)
3 ð# Strip initial drive from a Windows r ÷. We know we have an absoluteO  ,  Ã ñ, so the second part of ñcheck rules out a POSIXi W thatQ ñhappens to contain a colon atN a ™character3 ð á[1] == ':' and1[0]N!inu ¿_separatorsOF ?2:]9ø F B`7 `º amplete° §conversionç @back* Àa root-relat‹X pbefore Ï6ingà hreturníR  ùsys.pycache_prefix,   Ÿ 0.ls(h )* †filename )J �  T Ä, _PYCACHE, : ð )


def source_b_š z Å�"""Given' ’  Å .J #, r  Y! qits .py! .¢0The c Q doesî@needS óexist; this simplyX sz â  i ] ’ calculatF pcorrespÝtë © s Q.  IfZ} J  ½pconform„ ÐPEP 3147/488  ñat, ValueError will be raised. IfF  Ô ² ±ementation.G±_tag is Nonf`n NotIv ) "edU $isP (1"""V ?if Y – c /('I '?Â = ¢ fs “ I¿GÛWsplit/ ”found_in_2 ñr = Fals¢æ " i 9à 1pedn! =
8 !.r$ ƒ 9½  ~!ifjÁ.startswith(2 V +! < ÿ 6    û ! => J[len7 5):]c  - ù 5Truø  }* õ  x #, ç j  µ u %if' %!=îJ  $ #ÒD(f'{}�ùbottom-level directory in 'ã  N 	 0f'{.3!r}I´dot_count =™ _3. 3('., 6if /  –in {2, 3}À ¼  Pexpecú°only 2 or 3I s° {5u › ðelif dot_count =c= 3:
  õ#optimization = pycache_filename.rsplit('.', 2)[-2]; xif not B ö.startswith(_OPT)i  p øraise ValueError("= A por‡ 4of € Q doesg Z % "~  P   f"{   {| U!r}")/ ¹opt_level =² C[len« Ú 4 Ÿ.isalnum(Ð fÑ q {å R!r} iÒ /anÏ ð "alphanumeric v8Ó 6bas¥¸PpartiN »2)[0Ý ú	return _path_join(head, O ð+ SOURCE_SUFFIXES[0])


def _get_source¤‘(bytecodeS Ô"""Convert a ! Ó y b to a D  ñ (if possible).
µ�This funcÅ ñ exists purely for backwards-compatibilit @ @PyImQó_ExecCodeModuleWithFÝós() in the C APIz """f0if Á â V == 0ÖQANonev ò rest, _, extensU	B *.r›7 K > 6 or= ý.lower()[-3:-1] != 'py'€ 	b R 6try& lÁ # =za_from_îÅ@ ñexcept (NotImplemented¶,Âò ‰
e 	’ [½ W 0, #if�!isR e) elseCÁ ˆ¾  d(7  ­� i?B.endŽktuple(Ø)2  ¿ 	1  « d -š o Ò  + -, „ ( Apass5 /el¥ vBYTECOD§ – ó N &sei " “´ calc_mode(€õ  ¦�alculate ! p permis¹sgÁ.	/: =ÇBstath 1.stv ¥ Q!OSD¯ < Q0o666) ð# We always ensure write access so we can upd¼ ¢d`^ # Ô ¢r even wheã¾' ò are read-only on Windows (#60748› �|= 0o200œ r@  ˆ`check_v(method_�Decoratorò´verify thatnñule being requested matches# !on™z aloader÷ chandle­àThe first argu¦ð (self) must define _name which tó#he second argument is
    compared against. If the  ison fails ñ
n ImportError is raised.
K 1""" ðdef _check_name_wrapper(self,  ð=None, *args, **kw
 !):?  – !if(  c  +     B 0 = O . 6 Felif 1 !=E 
= ² Ç õ('loader for %s cannot handle %s' %a  ~  Û Œ à ) =ž )> Ñreturn method3 ' 	P§# FIXME: @N óused to define classW €s before®y ð# _bootstrap moduleC ¶set by _set  !_m  1().; (if< 0is 
�Ü' =( . @ Felse} —(new, oldð U €ãreplace in ['_� r__', '_M @qual^ vdoc__']o  R   óif hasattr(old, b |  *   1set+ £ + 3, g 	A Ø 9 ðnew.__dict__.updatep  )Ó(Ï Cper,ÀV *(  1


IDfindCshimO1fulß `"""Try+ 0 7 a ë ä”specifiedñby delegating toÈi A _?    4Thix T deprecatedÀ�favor of : 0er. _q ? 0 _warnings.	 !("* ‹Y Band f v 1"slz FPmoval† ñPython 3.12; useŽ ‡  ðQead",Î M   DÎ BionW  œb# CallH  52it ¸ps a strBc(indicNhs#Ô aœ spî€package [@ion)r�nerate a  K 1and§ #f  Š©‡ ,@ sI (E $if!isI  YClen(„ sB 
Ámsg = 'Not iÿ � ðdirectory {}: miss ‘__init__'f  = Ý¥msg.formatj S[0]),’	jN© ùíÄify_pyc(dataDpexc_det«¼ `"""Pern ñ basic validity � ° ±of a pyc he w   ²flags field$ðwhich determines howkD òshould be furtherq —^, csource5*Ä * q €contents8   › ±file. (Only? ñfirst 16 bytes aremðrequired, though.)

    *nameñ* is the name of ð
module being imported. It- ñused for logging.

    *exc_detailsU ða dictionary pas7 Ato IO ð Error if it rai 1forI Øimproved debub 	: s7 Bwhenµ °agic number¨ Õincorrect or & Qflagsh Rfield) £valid. EOF˜ ^ @data- ðfound to be trunca1"""Z mŠ  = 4 A[:4] 2if  ñ!= MAGIC_NUMBER:  Bó message = f'bad/ Ñ 0n {£a!r}: {J E!r}'= ó_bootstrap._verbose_Q s('{}',  )3 x�(# 8, *Î2 pif len(Ô o) < 16¹ preachedL° while readH pyc headergÍ Â 0·¿ ° éñ = _unpack_uint32À R[4:8]& a# Only@¢first two ; Áare defined.4#if & ~0b11!inN+ {L V!r} iÁô ƒbreturnZ �


def _m ñate_timestamp_pycç  , source_m  Qsize,ï,×  { Ð)ë @"""V*`ate a ÐPagain6#hem ð  last-modified z ! ; o€contents   N {file. (’Á16 bytes are± ¢required.)w*ç a  ˆ  ˆ p 4  s 
G   F @None< Ÿ   ;   Ö� ä  £=  5   5 mS‚(An  à’dš Â  Ü @code Sstaleè ê/if`²8:12]) != (hƒc & 0xF T zwù9yter k.8F1ð½ ýqis not 1andŠ ½ `Z12:16D 	 uŠ=(f'{
	´ Nhash  Ð, name, exc_dñ6etails):
    """Validate a hash-based pyc by checking the real source+ � against aone inU  ,  @ �header.
 ‘*data* is. ±contents of  / ±file. (Only ñfirst 16 bytes areI £required.)Y ’ _½ ` ÷ importlib.util.# $()t   w K EnameD   , �module be] `ed. ItÑ u1´for loggingò Rexc_doU ða dictionary pas7 Ato I¬ ð Error if it rai 1forò Øimproved debub *An= s: iV 9@code¥ Sstaleš 2"""Y  f –¢[8:16] != K  $Ž i (=      f'z1 in¨o âdoesn\'t match,#of^   {YY!r}',H '**0 ô)


def _compile_Õ (»  , M e=None,€ S_path Ò  øCP 6 � as foundË a.(Õ ñ = marshal.loads )Â  µs	Pance(- ,¯ sde_typer  +ð_bootstrap._verbose_message('8 á object from {$  Ö q  L iP  â@not 	º ( Ð_imp._fix_co_ì 1¥ Y preturn � Þ FelseS P'Non-. ½ "in» „.format(±© )Ú ž 
  › = !, ±
: 	 Zó o_timestamp_pycÒ m 3=0,ls_size=0ƒ�"Produce^ > µ a 4 I ü.!% =ƒòarray(MAGIC_NUMBER3 # ÿ.extend(_pack_uint32(0)! ¬ % £ È +  ’Qdumps% Å � 7 ®2a   ,ïded=Tru¸5 1 0!Ôflags = 0b1 |q Q << 1n ² O8 Þ  ;wrt len(¿ m) == 8F "  A deå_O x  ¢LD$ 0°s represent47 VS and ¡ +6str5ðUniversal newline supÌ âi"inÀ k 8  Dª›ð tokenize  # To avoid bootstrðap issues.
    source_bytes_readline = _io.B 8IO($ $).% ? ôencoding = tokenize.detect_ 	? c )? 0newp ƒ_decoderx ÂIncrementalN! D  ²(None, True@ {return G .O 	y  – ÿ[0]))


# Module specifications # #ð

_POPULATE = object(h 1defc Ò_from_file_lom t(name,  =å * Bader / ± AsubmÆ u_search[ %s=� !):C B"""R5"a 4 — À based on a � Ž !.
7 `To ind¤e that the@ ñis a package, set2 ” ñ to a list of directory paths.  AnA Rempty' ðis sufficient, though its not otherwise useful` 1theE Ôimport systemÌ Phe lo[Â must take a!asW óonly __init__() arg= 2"""Y f#@ is ´a  ñ# The caller may simply want,õrtially populatedM -^ E  orð !ed› €.  So wea~0 ï ÷a bogus value andF ð fill in as much w� n k K Õ= '<unknown>'D ²if hasattr(8a, 'getÆ ¼'\ K   p# ExecuILhJ   6try*    ‚ c .a "ò -   �except Ià^ErrorU Apass{ Felse l `_os.fsy( g !if__ f_isabs% N  � Ó C Pjoin(r €getcwd()âu  O Ü /OSØ 	Ù J# If isÅ ž Çøñ, but doesn't actu}cexist,H  Sould S Ñd here,ù æû. ü"noò#Ðid.  However,¯ dou 0havd€good wayù@testT @sinc´‰  g Â (e.g. a zipœ�or URL) wÚplook liÃB Anon-Ü 2ent1 €relative+
Ö ý }¢bootstrap.ASpec} « 2”, origin=º @ 3._s *! =§>`# Pickõ¡ if one wa‘‚provided�iY k  [ †k3for¹r_class,0xesà_20supñ!ed�_LÐs():
        ð    if location.endswith(tuple(suffixes)):
+  ’loader = 	 Å_class(name,P )6 Rspec.2 ; % Ubreak Jelse Áreturn None
' ñ# Set submodule_search_paths appropriately.0 .if- æs is _POPULATEy ³# Check theó L  ²if hasattr(Ü ë, 'is_package'>6tryW  ?   / . X
Nþexcept ImportErrorU Apassñ  b   L  6if k F  # ¸a4A= []j 
b 7 T O  ª 3'   =| ¶ Ï  Ã 0dirž1 = t_split(Ã 2)[0Á  +   » ƒ.append(V )‰š < a


# L%?s # 1!

dò WindowsRegistryFinder:� €"""Meta û! f R for Ñs declared inÊL # rM B."""J ñREGISTRY_KEY = (� ô'Software\\Python  Co æ{sys_version}'6 1\\M�€s\\{fullŒ"}'Ôl o_DEBUGr Fs\\Debugy l `_BUILDr ð	_MS_WINDOWS and '_d.pyd'.óEXTENSION_SUFFIXESôÑ@staticmethodð ¤def _open_WG(key8ó winreg.OpenKey( ðHKEY_CURRENT_USER, O k  ‘
/OS Y ÓLOCAL_MACHINEZ [ @n× [Ù Tcls, Ðã wif cls.a
ŽA a_key =, ˆ ã  þ@ : _ n „.format(µ =	 ,5  s  Ýó ='%d.%d' % sys.ó’_info[:2]Ú F î bò %  as hke" Afile×#= °QueryValue(3 3, '× v À   return NoCne
  ñreturn filepath
 Á@classmethod ðdef find_spec(cls, fullname, 8 Ñ=None, target !)::  g ] ô	 = cls._search_registry(K )2 io ’ @ is ] O  S ·   5 :try% _š d_stat(ƒ c êexcept OSError9 ^ ðfor loader, suffixes in _get_supported_i _( 's( µ Ö ô.endswith(tuple(R )3  7  tà = _bootstrap. S_fromj B, 9  ® D )O "porigin=	 €r� ^ Å oomoduleq-‚"""Find 2  šdŸDthe i.o  ˆ RThis á a÷deprecated.  Useí—) instead> 5"""i _warnings.	 £("WindowsRÝ • 1er.=œ *()r V and P  ž  0"sl—  premoval× ïPython 3.12; u± "¿Dï BionW¾ ¦ —©µ   
Ó0if    Ñ ?not¨ % .h9Oelsew!

„1 _LtrBasics:Á‚"""Base " òof common code needed by both SourceE  j  slessFil .Õ  íö is_package(selfï
sðConcrete implementation of Inõ tz .P  š ±checking ifr  ð © ]! r’Ã  \ I Ïa has a� ñof '__init__.py'Á  J   5 #= AplitÌ .U ÚU))[1]� ?  _bh=u 1.rsH –'.', 1)[03 Qtail_™ =p.rpartiv('.')[20 ç Z j =Ô '¯ W ! 	 ªscreate_\­ z
© Ôñdefault semanticsU9  G 1ionF ] Jexec[ / 
] €Execute Ã  F  ˆ  — = › |  (( _3&__€iÏ deS Þ"paise Imm¸P('can{ ]ý {!r} when ëo à) '
             ô'returns None'.format(module.__name__))
; õ"_bootstrap._call_with_frames_removed(exec, code, K �dict__)
K ’def load_ °(self, fullr !):%  t õ"""This method is deprecated.""") ÷# Warning implemented in _h …_shim().6 þ  Ö / œ ò


class SourceLoader(_ †Basics):æ £path_mtimeå   
á „Optionalå Rthat š Ps theDPifica'  K Ð (an int) for# Ñ  specified h ’ (a str).�  QðRaises OSError whenA / öcannot be handled*lrD C [  Ñ r o_statsë æ  ¶aþ `adata *Ù  Ñ ã  g Ù  ÖPossible keysA1- '~Ð' (mandatory)H YqnumericTñ stamp of last sÝt  Î	‰; ³- 'size' (oÊa    …Pbytes]  v \ R ™I· tôRallow	 œ°er to read V  ff files¬ä2# {> : .|Î  &)}þt_cache_” ì _- ", "   ê�which wri; /   (]  s) aô ¶åL6]  o-ofLÞ3Then ris need]2ord�õcorrectly transfer permissionsM Fð# For backwards compatibility, we delegateñ @set_(Œ=™ d¢$  Ë,Î  , T ˆ‰ ´   :Ë Bget_[h;†ConcreteDPof InZt·.P 	U «" =b #  h ¡(o Ú6tryu ± Ÿ sD  q(Y ÉdexceptQz as excN saImportº"('a  ±`availaý€through ® ðdata()',
         �name=full	 ´) from exc
. òreturn decode_source( �_bytes)
, Cdef  0to_- ñ(self, data, path, *, _optimize=-1):;  k B"""Rj @the ? ò object compiled› c .t  9 PThe 'd ô' argument can be anyE …type thaO È() supports.…  ø ó_bootstrap._call_with_frames_removed(£ 
ì u'exec',Q  ­  	õdont_inherit=True, +5m8getgÃ	TàConcrete impleôation of InspectLoader.N ZpReading,  é”�requiresÐ�_stats toma Åed. To writeý A `, set_¯� must als> Ü5"""B ù_H0 = [´ @fileº( 2 ¶mtime = Non� N  — s Lhash   Ö_based = FalsR Scheck 0 = ÁŠ 6try–  x  PÏ `cache_|B b ï )H ´except NotIÏedError_ 	û Jelse/ Ÿ  £ $stg „ ë–  . š /OSŽ     EpassÇ   †   —³�int(st[' &']	 ,   º   b'  (vM Ä  X È   Ì  �xc_detailf{    'Ã4': Å6'Ž9': Ì / }o 3 Œ @flagª à_classify_pyc(=,œ  Ö F G    ¡ sêÁ= memoryviewM o)[16:]Ÿ  ; 	f“ ¯& 0b1 != 06 6if 9 
á U  ¬c 0d  E ’if (_imp.F t  ,s@ ¿'never' and®  J   (F ù? or1  | Á== 'always')\À              ósource_bytes = self.get_data( mpath)
;  - Çhash = _imp. (@  O ÿ_RAW_MAGIC_NUMBER,7 h Å 2 Ë  _validate_Î P_pyc(#, i   ¯, fullnamer  Û  ¿exc_details� _else:
ª ‘timestamp¯ 5 
 ‹ Ð & ð m] ç ¯st['size'], =*W Hñ	except (ImportError, EOF
 )^Opass •ð_bootstrap._verbose_message('{} matches {}', ±Pcode_bÝ  ´ ¢ A   5 âreturn _compilî x (� sì , Ë=— X 	  L  U Í = Û  Ø = ä $ifŽ k ‹s is Non/: " ÞÂ dobjectE 0to_ T 
€
 E  b Bfrome 
H öif (not sys.dont_writ¿J andD  1  
  Ág Ñ- 	0if än_based$| &  H  q (   r )   NÝ 9    ¦ M 46_to� E„ c ‚, check_W 
Q ¹c  ëHh =Ó9len:)œ >try?�V_cachôE  )A Ì 
X ð except NotImpleëmentedError:
  Epass ñreturn code_object


class FileLoader:
0 á"""Base file l  + °which imple{ Es th" ð protocol method !atP crequirP òsystem usage."""s ödef __init__(self, fullname, path)à �"""Cache} pmodule ) A and  0 1 to Ä €found by ’  *afinderƒ      y .K = 0  [ =’ ¹ %eq· Wother® yÕ 1.__Ha__ == *  5andm  Ž   u j__dict5  )… Chash‡ €   „  à F) ^   Õ J €@_check_% �  ™ !_miC œh 0"""E2 a * q from aE.§  Ñ CThis"ô
 is deprecated.  Use execl —) instead@  2 H   ú# The only reason for tb  "Ý .Ù A òIssue #14857: AvoiC�zero-arguç W Âm of super sZWationT rof that6  can be updå ð without breaking’ *3zen8ž :u (¥ , ().–,Æ	@get_ ÛÇ
R+ Û JSsourcÅ8as T L ¾ @elf.G  O ‰ Cdata…   
H�  (   msÙ as raw bytesºPif is.CanceY !(S²  –Öer, ExtensionK)x   ž  _io.open_,Q(str(¢ )}  @‰ 3   ë   u.read()Jelse1 d  ‡ !IO] _, 'r'a b ® _"re®_� #er™ô £‘importlib¼ 0ersà1ort Rem ê  »  Z )Kr  v	·  )k€Concretew WQ p2 5 us0 ˜HŸ  Z ©a_stats˜ :\Bmeta`6ecQ  ë   est = _V ¬Ü÷ñ{'mtime': st.st_ f, 'siz   } _cÁ_Èfò´ p ,ä    , © ºÀ     # Adaptó between the two APIs
  Ðmode = _calc_ Õ(source_path)' òreturn self.set_data(bytecod,  ,  !, E =J !)
? Edef 3  A  , \ 0 *3 q0o666):4  � �"""Write g s^ å to a file."""* qparent, 1namÐ  c p_split( Ê   µ_parts = []E õ# Figure out what directories are missing.3 bwhile ~ ‘ and not 9r_isdir( Ô  Ø    rtz‘ ª  É ¬ / "th° p.appendV t$ ø # Create needed¶ ª 0for¨ Àt in reverseH Z ¢ œ @joinu d :}  ¡ 6tryµ    g_os.mk5  þexcept FileExistsErrorF ñ# Probably another Python process already cdä6dirú  o   �continueˆ !OS€  as exc‡ áCould be a per	@on e¶  , ‚ Q-only�ùsystem: just forgett  � A# abgbriting¶ >ata· ñ_bootstrap._verbose_message('c–  uÿ a {!r}: -',u  y  ”:excÝ 1 üP ð _w§q_atomicnÜ
Q Ñ Æ È '"ƒ5­	0# Sÿ as`#ve…adon't ¥ j P ·
n™ j	Ï  3 	d‘

class Sm@lessvLoader( 2, _ ‚Basics):S2""" ò  which handles » N ‹� imports-   Œ@get_ÿ (Œ@full5 ’" =í .  q # (, M  å  ô+   ö�# Call _ñ pify_pycÉ@do bÖ á validation of¢ "  but ignore q ó# result. There's noø  U Öcheck againstá exc_detailö{N  Ã 'Û 4': Ý 
:'+':ä}B 	× (ÿ ,J  Ox P¤ _compile_�(U  — ¡memoryviewV j)[16:]œ  ¹ =· À bytecode_pa£th=path,
  !)
 ñdef get_source(self, fullname):$  2 ò"""Return None as there is no > • code."""6 r3 ö


class ExtensionFileLoader( 2, _ ‚Basics):§ 2""" d for eC ’ modules.& ð The constructor� ðdesigned to work with p cFinder:  µ ¶  ƒ__init__ 
 , > ). 0 =  =  )  - ! =4 š W %eqU o?P *s 1.__+a__ == *  5andm  q   u j__dict5  ìc__hash‡ €   „  Õ F) ^   Õ J rcreate_‚4 g, specU A"""C& ý  an unitializedÁ  È   Q ð = _bootstrap._call_»ù_frames_removed(S_imp.˜ sdynamic” ' U üverbose_message('Xp {!r} l¤ad from 'E ° 	  !, ”4# åâ JexecH" 
JI@ N« Bä 9,z *v ,) Q ?ute.>elf.€  1pis_pack› M˜pTrue if˜` 
#a M 	¢Pfile_ì q ®a_splitÐ. A)[1]’  ÅÁGany(9 4= '3¥' + suffix4  8   ¼ ÷ in EXTENSION_SUFFIXES^ ” O‰ ú ’.anù rcannot ! a£y objectÚ  K ™ … Û‡ ›os have' ,q@_check™I  Ž  v ®� 1the‚ û  Ê  C  À�found by1fF z	Á _N‚‚pacePath#¡presents as# u!'sŒ ‘.  It use@¿. ç 0to Š 0 it/ Crent# C, anU 9Ñe it looks upÁ  pa. !'sG  __ºÐ__.  When thiñ*s changes, the module's own path is recomputed,
    using ó_finder.  For top-levelG T cparent !'s9 H pis sys.g Q."""
 ñ	def __init__(self, name,7  v !):1  ’  (  ._( ! =/   c ! =C  Rlast_¢ _& Qtuple{ I._ge ;())@  4 � a  Î  %d © sb Ä Ñ"""Returns a „ R of (œ -™-ã   R-| Q-attr )C   6 Æ, dot, me = #ö .rpartition('.'Ò  if0 f == ''\ O `# Thisaæ.Å‘ containsKƒ t.5 M ræ � 'sys', 'Æ '! P# NotL". P 	!._®)__t F /  { K 4, 'F '®ó 9§< _�Ê �0th_‰ møq� 0get= (X .s[g ]h )µ ¢recalculatº± G# If‘�4 haû d,â?  YJˆ  ¥" =—¹å # Make a copyC #if�Z $ !Œ{
sEspecJ  X~ 	X V dG”e that noäð are made if a loaderÖ‰¥ed, but we¼ L Á do rememberK3newÔ a	/ 1if ¼ ñ is not None and .s   
ò  l = B.sub
À_search_loca²s4  8  ¥. 4?pecB 	® 9 ‹Ë dS  b P# SavReÞ;_ ¨–S_iterÇ’3   Î¿)Ø �CitemE  , pxL Ç 	G [+ ]� >setM WS L  Ë C (thJ 3len“ 9 Ø ?len× ?repó'_NamespacePath({!r})'.format[  Ÿ 	)|—  , ê � ðitem in self._reñcalculate()

    def append(self, item):      s._path.' ! òV


# We use this exclusively in module_from_spec() for backward-compatibility.
class _NamespaceLoader†  ¢ ƒ__init__¤ `name, •  _finder· 6 = X _Path(> Ñ@staticmethod � Ð Rrepr( m  """Return   é 3the.W  LT X ð is deprecated.   ðimport machinery does J ajob it‹N 1"""Ÿ  Z  _warnings.	 &("ò J.´ _  *()~ V and K  O   "s.dÕ premovalàó Python 3.12", DË BionW‰ )› r"'<ƒ a {!r} „sê£)>'.formatX0.__¡'__¡£is_package@full& …h BTrue$ ·Ÿget_sourc9 *''7 ?cod5 ðcompile('', '<string> ðexec', dont_inherit=› Õ rcreate_Ø  +Ô `"""Use¤áault semanticsŽ9  G @ion.v ù  € 
[ / ] Fpassó Jload1 d 0"""P0 a }Àæ2is ?
i0.  Î › —) instead& È �#ðsystem never calll .ü  9 ð	_bootstrap._verbose_mess?'¹  ù qed withR¡%',N  R  ’ð## À implemented3_j cv_shim()´ ¾» /  n %, —¼ æ"reè0_re;Põ ‘ ™ rortlib.- s $ N€RE ž  d  )
F†?s # 1"

 ³Y :ò r"""Meta­ù@sys.Ð/! _žÖ__ attributes)ëpinvalidœwcaches(5q"""Call–)  ø0on & � bentry © sSBstor¸ _ 2er_w p (whereœG)¼ Ž Q Ï,]  e[list(R Àer_cache.ite‡ms()):
  úif finder is None  * ùdel sys.path_importer_cache[name]Q Òelif hasattr([ Ò, 'invalidate9 +s'ˆ  i . ., 1()
c Ñ@staticmethod Qdef _˜ `hooks( Y –"""SearchÀ ( d for aù   ': Q'."""X  Ž ,if6 ais not&A and Y 
= _warnings.	 *(',  q‘empty', IVW/ )ƒ  š  X ; inŒ 
i :try  À preturn @ W   cexcepty ^ErrorB …continue9 ;els e  9¤_class£
;`(cls, w
±xGet the�   ) ¶ entry from
V .†  â !IfH 9 À!in Á,h  ¤appropriat} ø  í/ ¡ it. If no8 6ñavailable, store!‰ U‘ Z== ''rÅ- Æ _os.getcwd( å ÇÏFileNotFoundÍ‚# Don't È  S¡failure as õ	cwd can easily change to p   A# a Îý directory later on.. " >   ë ú/ =×[hö ?Keyí  L Mcls.	  ‘
En # =ä3 Ë a i@ïò legacy_get_specë@full/s'er÷ó# This would be a good place¬³Deprecation'5 ifš ö# we ended up going that route•› Ï |_loader•ðmsg = (f"{_bootstrap._object_Ì á1)}.F í )f‹&; O ø P"fall¤ bback tM„ :()"ãF?msg0 ` Ê  , §EionsÇ£  (�k Üþ [omoduleþ 3ô Ànd_module(fu—llname)
  Õportions = [] õif loader is not None:  @ òreturn _bootstrap.spec_from_< 2(fur ,M z  + ( == §ModuleSpec7  v 
5 Q.subm+ Ä_search_locaÂ Í © ¥  o 
 Á@classmethod �def _get_$ f(cls, · Ñpath, target=� ³"""Find theß @ or a`space_< ¢ for this ´ �/package' A."""ƒ  NB# If* ñ ends up being a+ R  = , e 'isG � pist of „ ñ	s that will become its _< %__; º 	 Ç �entry inU  ½ !if$±isinstance(- ú , (str, bytes))4  8 …continue„   0finxb= cls.¥  imÙser_cach]  5 3if 8 °' ‚hasattr(/ 0, '	 ý'¢   5  # =` ./ §!
’  : ;els5    T ã flegacy„ l .erX 1if A /is˜  _   ]  > .¥á ,   D    ˜> ’ ž	ä C 5if > É 
qraise IpError('l P miss#È ''0# T{ñ is possibly parW .¢  #  RemembeÅ1eseû ÜÁies (if any)åjwhen wÊ æ Ÿ#  createÊDand ©¯ iteratingŠ oy¦ 
¸„.extend([�F… Õ  9 ë+ =¢	Ð O “ û–“‹˜aTry to²" a+ Â'Z�' on sys.  ¶'	 "'.# â BThe `  Xbased4 p_hooks ¾G _¥¨æ ô0athT  N
 „ % =˜  Œ  n ©Ë ,”îåà is None:
      Ãreturn None
 ñ elif spec.loader is! :"  * ònamespace_path =2 ùsubmodule_search_locations= :if @ 
\  ` ö# We found at least one8  x B.  RÃ a� i whichl M Úcan create thF mckage.4 �origin =# ó T = _N'�Path(fullù ,Ç ?°, cls._get_w )j ¨  	 Nelse<. Ö* & T U Á@classmethod ’def find_Ôf(cls, Ä  �=e )ƒ 0"""2 e6 € on sys.. P or '	 x' based ’_hooks an|  ·7 ñ_importer_cache.
ž  " RThis ²  §òdeprecated.  Use¾  â §() instead> 5"""J  _warnings.	  ("°pFinder.Ñ )g  ¯  E  “  0"slŒ ÿ for removal in Python 3.12; u¦ %",š Q   Dä BionW³ / ê ! =Mµ   u z- æ Ñ  ÅÄ f   ‰   U ‰r@static‡. 9�distribuÀ(*args, **kw
 
79  {  v 9 ³î÷n iterable of all Dk ì“ances cap& a  ×2ing¤qetadata¤!paps match#  ``context.·%``D 1(orv   ps if ``,q`` indiƒS) alog  zsü }ElistI ö of directories q  3 &``˜­Rfrom Tlib.mÅ  # M Äo Ä" æ	w°1


#P File§2er:0""" -Ö |#er¶ In©cQ withx@file�tem are Ùd†`erform¿q, being¾ árefreshed whenE 9y v  ÏPhandl¿ôhas been modifieý LU  ©á__init__(self,W0, *%ªer_details«¦InitializeÑ  ¯B to ø Ùa»Q vari�‘number ofy  é`2-tupl¤Pontai~É { [ /+wuffixes! H °recognizes.Ù  [   G ðs = []
        for loa÷der, suffixes in loader_details:
   ¢s.extend((8 ,4 S) forL  J  5es)D cself._F # =8 s  õ# Base (directory) path  @   ! = u or '.'  €if not _# u_isabs(3 )Ë  # =0 õjoin(_os.getcwd(), % Ã a ¥mtime = -1� 1  @cach Lset(? relaxed) K ñ def invalidate_K Ë Æ E"""I$ U the 7 › A."""O  Âš  ¸   find_modul° _ a_shim
%  “  ¾Xª, fullname— pTry to / # aå ¥ ±specified ms ,Å   H Qspacep  ´ òpackage portions. Returns († ¤, list-of-# ").¯  ? ñThis method is deprecated.  Use  _� §() instead> = _warnings.	 Ð("FileFinder.å Ò G g V and ‚ “  0"slŒ premoval5ïPython 3.12; u¦ %",#Q   Dä BionW³ {Rpec =Ô¶ û ÂS 0if   3JNone7r�  E, []5   9 .œ 2subèÁ_search_locaÎ ø"[]¯ ^B_get� ¬Uf_classj,ùç, smsl, target~| [> (å = ¶ ¥_from_file¢ 7 ’ =d „ ˆ =Å )–· è =wí :"""k rQ P  iÜG ' �matchingõ� f  Kefound.ç5is_³v = Fals» =TÉ p.rpartiÿv('.')[2B:tryk§&Astatu.| <«Q).st_1 « ïexcept OSError[ º"if5# !#w T 
=  œ.*l™Þ ÷  ¥ ‘ " =Y ™ (# Qkeeps¾ñoriginal casing,É_i 1e__Lffriend/Aif _Kg_case( ‰ 6ñ( sÀ_cache
       ócache_module = tail ’.lower()
) u  else:   = á = self._path_ % T 
b ' ò# Check if the mŽ !is õname of a directory (and thus a package).O 1if ‡ u "in 
½ Abase´ 1 =  a_join(Ì  Ë , ø ófor suffix, loader_class in sr  ; ‘init_file× Q= '__ C_' +T È  0   Afull¢ 
ª Á !, C V 
¬  A #ifâ  is% (Q )¡  0 TreturË ’get_spec(Ô ê  , D  Ä 
 Ÿ 5, [” ]?JrgetŽ D p 0# Ià O TspaceÔ#, Š   ” "�we don't'•#  find aAnA¶ext section% x   6is_x 
eisdir(Í Ä ª  a M0 w/…Dropev existsl  . 0 >try  xn
·TÂ  ô þexcept ValueErrorg yINoneiù_bootstrap._verbose_message('trying {}'( Zity=2ˆ © HÂ˜ ËU	õ  4  $î8if [
Ê F
–possible ˜ AV“  ™    �MDS¸ 2 K  , ª 
‚ 9 Q.subm/ À_search_loca.8s =Ó	! A    g 
 @def îl]tq"""Fill¦ð è“potentialÇ s íæ s FthisA."""n  
&’   M0coni  ä €_os.listõ 5 @ or  †getcwd()4:Ñ(FileNotFoundBÃ, Permission TNotAD³ û  ¬ %#  ð has either been removed, Š‚ed into r,Ÿ :mad™Æ# unreadablez g é À []
        ò4# We store two cached versions, to handle runtime changes of the
   ò# PYTHONCASEOK environment variable.
+ õ  if not sys.platform.startswith('win'):/  7 ±self._path_¥ õ = set(contents)- Jelse; ð# Windows users can import modules w ö case-insensitive filá  … ð# suffixes (for legacy reasons). Make( ` lowerX M herL ð	o it's done once instead\ _ Severy« õ. This is safe asñ ™ Óthe specified  esÀ�check aga^ · are always/ Kin aP  µ -fmannerÂ u Ý __‰˜� *  Í „item in ) 
¤ & £name, dot,À 0 = 6 ê.partition('.'Z  8  if5 P   @new_X ° = '{}.{}'.n0at( i .Ë .()\ N V   Z  K 	?   S T.add(: 
n á C i /ifA_†ÿ_INSENSITIVE_PLATFORMSWzrelaxed_4{fn Á(fn¿!}
‰ Á@classmethod Adef ¦÷
hook(cls, *loader_details‚ Q"""A B  C ð which returns a closu�o½2 onô   a s  n8 Cwill=  å@nstaXRusing˜#• Qs and  µ O `calledo  X… .ó  o Iýé  ,  © ãáa directory, IuvError iÁgraised^ 5"""Š 	Pð_for_FileFinder(´ O š €"""Path ·êælib.machinery.C .l  @ ›Oisdif  * · Ô e('onlyñ 1iesn0suplAed',1=¶ á K ðA clsÓ 3zI _ä )  5�__repr__(Y%A 'e({!r}) 0 .¤ 3

#á  mOup # +!

š rfix_up_}(g B
 c€   S=None¾ #@func c¢used by Py\¡_ExecCodeMÙ‚Object()¸òà = ns.get('__lðoader__')
    spec = ns.get('__  �if not l4 :1  5 !if8    % ! = . 2 ôelif pathname == c E ñ SourcelessFileL� (= ,G Á  { OelseH 
D ç  û G   Î û_from_file_locationŒ ,$=ø › 6tryO 6ns[^]Y   = 0__'   " „   A" ccachedD f% �except E 6ion� ð# Not important enough to re .@  kðpass


def _get_sup! $ed ^2s()\ ð"""Returns a list of Ä Ó-based module<1s.
g °Each item i7 rtuple (², suffixes)” 1"""5 äextensions = E øu, _imp.' _H (¬sp2 = y9 ñ SOURCE_SUFFIXESo …bytecode1 
ª›, BYTECOD7 r% [‡ 2s, z $, S ]_ñ set_bootstrap_m+( jvglobal  §  ' = M i install\ B"""I# A the€À2Ä components.�_¾ § Eæ Ä^
6 0ys.b_hooksÛ0d([»fFinder -(*c #)]ù€ys.meta_K Â.append(PathD #)
ä $os
  ) 4lib @tempÓ …functool0 xcontext3 5ype `   
gs typing�ð  Union, Any, Opz"al( D.abc& "ReF Reã, Traversable
. ”_adapters4 wV å€

PackagÍo  [t  !.Mr”Type, str˜ ì 2s(p3 ~#¶ Ce: (J I) ->…  ;XGet a # r¿  #a ] æ6 ; " _  (�  #))Ö‘normalizeÙ(µ­ 1Any© 4strk N6  † ±th by ensur“t’ st ®!If`result&   öAains/ò separators, an Š0ionQ jraisedÏ1str¸  ("tr¾ ¤ qparent,E_B = ot.split(; ßwÐrent:
       ð4 raise ValueError(f'{path!r} must be only a file name')
    return  _ ñ


def get_resource_reader(package):9 �# type: ( ós.ModuleType) -> Optional[RE RD ]; 1""" R| Cthe \ P's lom º if it's a B .: B á# We can't use ð# a issubclass() check here because apparent„bc.'s __2 / 2__(ð# hook wants to create a weak reference  Ç ³object, but� ¥zipimport.
 ð er does not sup O ós, resulting in aM  _áò.  That seems terribledspec =R0.__ !__C Ê  =àPattr( .s?, 'ö ¤', None)  ñRignorl3if R !is' X < z th/ w  oX € |Œlve(candqPˆ h}l  < H‚sinstancO ,¹
²Relse ¨Blib.
 !_mÔ„ ¬Ÿ `"""TakEJ �B or q  FD andŸ \ !.
ã Ròqan excel ê  ' :dM iia@ A. =ros•  qif wrapD(- R).sub� À_search_locaò.s 
« »œJ ŸŸ 
—r ~Sfrom_  Ñ TÔa TraversableQ@for #Vgiven	 ' =õ o ¿0 = ' 8.6 á^ f? .màs()


@contextu qmanager†P_temp. (: µ, suffix='' Noü )- €.NamedTew@aryFò¡as it leadÇÁdeeper 'try'¡ µ# blocks duÍ@needÙQclose9 b RoraryGóto work on WindowsL ‚properly‘€fd, raw_’0 = E  Ô @.mks (Ô  h6tryK‘os.write(I H"()(  j1os.¢ 6(fd 3del›“  ( `yield …  nTPath(– 8 gfinally 	†  C ›os.remove:   ‰ n�NotFound«È  & @passøñ	functools.singledispatch÷0as_!(¬ èßG»ð a Traversable oñbject, return that o ð as a
    path o ñe local file system in a context manager.8 1""" \ P_temp: (Q ñ.read_bytes, suffix= Àname)


@as_. ‘.register7 ³lib.Path)
@t    ~ a
def _/ !):‚ Š ñDegenerate behavior forâ  H  Z ÿ sÄ Qyield( ð
"""Abstract base classes related to import.x cfrom . ` _boot= ºp_external
" Òmachinery
try¿ N ’ _frozen_ Álib
except In PError¶3exc8 `f exc.R] != 'A '(  åQraise-&  = None� Ó ™ j \ 3 / =D_abcBrLoader
D abc ‚warningsPdtyping5 ÿ	BinaryIO, Iterable, Text, ðProtocol, runtime_check5 "

\“a	s_cls, *
v Z0cls"  o9 âAcls)„ # .ifòq is not�M  . -   1 … ­= getattr(„€, cls.__(&__�  F É‘Attributee
z  ' i ír 	a  OÁ Finder(meta ñ =abc.ABCMeta):
I¤"""Legacy X ´üIfM "s.7 IË�y be sub] !ed. òcompatibility with l` @thir"1rtyz ô	reimplementations of the“?â.  Otherwise, … ? = áshould derive 3 M àmore specific ú  ÄH 0or  REntry D ABCè pDepreca¶ñsince Python 3.3>  Á	 SÃ_init__(selfä ýy.	  ("— j  ²df Band  :  ""sA 9premoval=” {12; useç P ý  ‘instead",× �   BionWR)@_FamethodD   ¹q_module`, fullQ,5=A3 Dn“N ~é R 2 a T Œ ž 5The[  [`a str V w opj!alt  !or1F À Returns a Lóoader object or None.
  5""" �warnings.	 ð("importlib.abc.FinH öalong with its find_module() K ^  ÿ"method are deprecated and3 A "sl% ÿfor removal in Python 3.12; useA ‚MetaPathº .« `spec()¬   "4 _Entry9  •instead",5ã  Dß BionWOª)


class ‘ Q(meta =`0ABC  1):
[ ñ"""Abstract base *  ˜{°ers on sys.N `_path.ÓD ñ# We don't define4 _óhere since that would break> ðhasattr checks wM p to supò	 backward compatibility.Á 2defo ðself, fullname, « !):j  <Ò"""Return a l³ ì Bthe A W  , SIf no Â is found, r@ àU  Then  % Pa strss  \  †  plist of&   #J Î  w SThis Ê(isÉF›4©…favor ofo  €(er‡3. I$“µexists then]$s-^&leL €unctionaq À �provided!t© 6  Ç    á æ ê y öñmÕë D9"3.ú ’ Á K Œ‹¶Õstacklevel=2)eig#t (Á'ÇC'¾ TC š0 = < ö / C 6 ."ifà %1not¿Q else
 ž lñinvalidate_caches± ¤  RBn op8É e€clearingy´Qer's F †, if any1‚used by • -‰ )>  …º
_register(yñ, machinery.BuiltinI„(er VFroze > ? Î: �WindowsR à  5 ù¡&UeBNsª' c f 9§@Ào to supportð0 backward compatibility.

    def find_loader(self, fullname):
%   ²"""Return (+  , " ôspace portion) for the path entrh  C 5TheZ À is a str.   L ! ¡equence of¯  G \ øies contributing to part of až package.i F sZ òmay be empty.  If à  � ’not None,Õ æ U willH £be ignoredR £  Ò .  a ÷discarded if another(†%erX qlocatesy €module a3‚normal m oC Þ Ð~ �is methodÅ PdepreM @d siLøPython 3.4 in favor` 0er. €_spec().  V PproviÎ Ethand$s-e%leË @funcax< .# 5""" �warnings.	 p("PathEJDFind˜ £ ()N à R   "ù  b ú  E £(availableVe3.4)",Æ p  
 D„BionWß * Õstacklevel=2)N 0if Œdhasatt¦'“'© o rª»%[]G €found = æáï) 2if , !isy  J  c ’ & B.sub‘�_search_¾Jions5  9 Gs = š   Oelse0 
m ¿  N 4 0,©s* t 8  ò ,¢ + jã ÷	 = _bootstrap_external._# R_shim� `ñinvalidate_cachesf³‚"""An op%» LQclearÛ <1's F ,HyE)Thøqused byß<Š )?  „»
_register(ò, machinery.FileR ò)


class ResourceLH "): á b1‚ct base 4  â šÃs which can ��data fromi Ë�-end storÓ_ ù PABC rg€sents on5 < Y protocols Þ3ifi!cEP 302À Ac@abc.a· O Ó@get_¡ Ê,ÇÐ8 Íß ôwhen implemented shouldó  : byö"foñ  ˆ   °  þ4  P must_M ½ ð         raise OòSError


class InspectLoader( ò
):

    """Abstract base 3 Qfor l0 òs which support iM Ñion about theJ pmodules Qy can@ .f ðThis ABC represents one of/ ð optional protocols ² óified by PEP 302M 2"""V ñdef is_package(self, fullname):– ä Ob cmethodÔ ðwhen implemented should return whether£ L æ c is a y e.  They  qstr.  RI  , CboolÀ  “ �Raises ImT®" ia õcannot be found.�  þ  B   rF E get_codMõ À : € object Bthe ™ Ä õ àtypes.CodeTypeâ Òpossible, els8É (NIif a‚ Pdoes ‡make sen: ã(e.g. built-in¥ ?). aZi�source = d.\ (nF 2if    Ð ˆê   3 z\ < 3_to¾y )Øc@abc.a®ÉD  ”  ¤ ì? 
÷ í‡ †k  Ã 	ö ¼  9 ”õ r@staticØ ¬  È Oúdata, path='<string>'*�Compile ', j' into�( @arguEúòbe anything that cU !() phandle.6'Œ '¯  "F ’ be… reƒ ‘ @ wasŸ�rieved (ÂÉapplicable).V}  @ ý ó, 'exec', dont_inherit=Truek  _é€ = _boot%Âp_external._HwBasics.0 Í  <@ 0 É

_register(ºÐ, machinery.Bñ"in@(er UFroze )PExecuh¹ 
\ Ñuwish to 4 a 1 of@Ãs as scripts<)/inÀ  @abc.abstrðactmethod
    def get_filename(self, full !):&  * Â"""Abstract A ñ which should return the value that _Z µ__ is to beP …set to.
 ñRaises ImportError ifP õmodule cannot be found.: 5""" rF E a è ?codä M ¬ Ñ  6 µ object for¾ S@None¾  ° ñapplicable (e.g. built-in mØ )É ½  D  R* �source = Ë.Ý (Õ-2if   Ÿ ´ ï ó  3 :try% Hpathm Jo hexceptà 
K p ¸ ˜ @_to_}( )‡ Oelse=  , « ò&)

_register(ExecutionLoader, machinery.ExtensionFile ¦)


class  `(_boot¶p_external. B, Re» C +, s "): ^Rbase i ñpartially implementing
Y 2 anÑ` ` ABCs.!÷   ò S8 m ( Fless, F î ! - Œ@loadg .€ (and opÚ=1anyÍ ‘correspon2 @byte/ )Ç`To sup~ U Dfrom# + ,{aÀs inherited 0 j žúP needh&beÝ¥ed. To alsŒ O 	� ¸ � ç •ðs specified directly by thisO ³is requiredü IÃ Ý  Ã}@ed iäL ¼ *éxAdatap " ›# .	  ¯ ®E_mti•  
‘RtP(int)RPificaú ; ¯ B = a (str) ’    @elf. Ò_stats.__func³­$ zs!OS´ð Í1intT> (m 1)['Ü ;'])ó † 4 ²n 3"""ó aïaa3 di– ç @poin� sð y the path (strC).
  åPossible keys: ð- 'mtime' (mandatory) is the numeric ! õstamp of last sourceF õ  code modification; `- 'sizb  op %ala   � in bytes]  v \ R ¿ 5"""Q Ñif self.path_¾ �.__func__º Sœ gLoader$ ô  Õraise OSErrorZ ƒreturn {:h (s 1)}
1  deˆ pt_data(‘  ,   ,  )o �"""WriteSê !to  / c (if p�").[  ¢ ÑAccepts a strZ A and] 2 as3/ ñ2ny needed intermediary directories are to be created. If for someÕ  z areason¢ °file cannot7 ð written because²õpermissions, failG ŠsilentlyÅ¸
_register(©Â, machinery. BFileÅÂ)


class Re ReÝQ(meta Ã=abc.ABCMetazñ"""Abstract base ) í ls“provide rY ð reading support.xÒ @c aR amethod  Topen_C  ù: Text) -> BinaryIORs0an F @ed, tÁ-like object´ b< Ÿ øTThe 'm  ' argument	€expectedé `repres aonly af V nameŸ!IfôM øpfound, “@NotF 9 f JdF  2 F  ñ# This deliberately 0 sL ‘nstead ofY@ €NotImpleÔ "edu s>@at i° 2is Ž Œ ÷accidentally called,M Ðit'll still dE Öe right thingÃ £ ¢ œ		;_Ú	  þ þr systemõ,•specified¬SPdoes ÿhexist ¦ ,Òg%Xé,is" $OboolBTrueëe°0d ': 'ð À Files are róesources, directories are not.
  5""" ñ	raise FileNotFoundError
! ñ@abc.abstractmethod ñdef contents(self) -> Iterable[str]:)  q ã"""Return an i$ q of ent  ßin `package`.œ ð 
@runtime_checku à
class Travers ¢(Protocol)Œ Z ðAn object with a subset’ Òpathlib.Path ð `s suitP A forÕ td :inggpnd open Rfilesq w 7 M	 2dirL¯ ;;   XYieldà Æ Ps in „* r  §“read_byte©] EReadÒ 
 Q A as : 	Z  Œ   = ' .õ `('rb')2 Fstrme  * rþ  .� "()^Ÿ Atextû ó , encoding=None¹ D  Ô     ­  H ¬ e 	 ¹ Ê
%s_É Fbool
Ç qTrue ifÃP is aU	Æ  t  qCŠu   A i  b §  v 	@join1w , child²ë �/ »¿__truediv__d = å   ›Eelf.Ð Ê ¤	ø ð, mode='r', *args, **kw
  0 ð  may be 'r' or A1 toC H Í  „binary. Dq handleŸ Ã Ÿ _ €P(sameF  ¡Ò©").Ù  ; AWhenp  3 0as s •, accepts‹  parameter chW Fthosƒ 2 òed by io.TextIOWrapper n U�propertyÐ  AnameïÊ?str>�The base 0  ²CthisÙpout any¾ Äent referenc—’ 9RG(
  r#erÌ È  >  ‚ ðrequired interface&` proviÇ , @â r\  L  h	 ›¾À a Traversabó4le object for the loaded package."""

    def open_resource(self, r !):'  + preturn   ô.files().joinpath(?  ).N f('rb')b  _,  B ,b öaise FileNotFoundError] R ,is²  [ ® , @.is_È (© �contentsN ¡(item.nameY  + iò#iterdir())
"""The machinery of importlib: finders,� 	 ¢hooks, etc¢ófrom ._bootstrap> Ï ModuleSpec
# �BuiltinIo /er( _Froze' ”_external{ ÷(SOURCE_SUFFIXES, DEBUG_BYTECOD 9 = ŸOPTIMIZED2   E •EXTENSION‡ )á º ñWindowsRegistryF~7 OPath,  », So 2 Lœ¢Á 2 Oless6 —Extension5  

ø all_suffixÌéA"""Rè€s a list´ñall recognized m~ ; Àthis process] ð11. +ç> + Ó
+4 os
 $re
 4abc 4csv %sy+ Temail  ï4lib 0zipø „operator „textwrap uwarning[ …functool  ò	 Pposixu C Ãcollections
rPa_adaptS_meta  $ P¶fMetada# V * õ
FreezableDefaultDict, Pai_¾ 3 Ämethod_cache} Ò % ô unique_everseen(  ± # ¥ €, Simple?ô ]xü4 ‚suppressP ð4lib  _p$ D.abc(   h {Ã rstarmapG dtyping@ �List, Map @, Opªàal, Union


__,Q_ = [Ö 'DC0ibu) .', Š   	ì da   s) ðentry_points',
    'fôiles',
    'metadata õpackages_distribution. frequir> òversion',
]


class PB ùNotFoundError(Module !):‚ s"""The x   was not f< Q."""
& ódef __str__(self=  Ã µreturn f"NoF Ö O K ` for {; c.name}X •@propertyf   c ( Q,) = A Aargs0   " 0Sec7%edã / ñA simple entry point config parser¦ ²performanceý 1>>> …item in _ f.read( 0_sa` 0...¡ p print(= )‡ APairÒ ÿ='sec1', value='# comments ignored'2 _a = 1% _b = 2% 2|  J  % ¢  ñ Wres =ë sTo_pairsô  9  é ² = next(resÂ  R   ý+ ü    $a¥ ë 1 g J bJ  ë  �J Y +  ± !2'ž 6 .g ± g 7lis![]J a;ñ = textwrap.dedent((  �  ,     [:C   :6  Ù1 Ö 8  G 2G  , 2, p 0).l‹2p()9 @hamethod-  
Acls,É  l (Ð   7 ¡._replace(R=ÿ.“("  )N :    T   ˜2cls’ C , filter_= Zvalid= 3if < •" iùANoneÖ  a ò kstaticó ý
k  = ó 1linFŠ ( ±_, map(str.W)a.split1 '()ç  0 = Y –  ÷  õ 3 è ²   × ‚_match =_ó.startswith('[') and 3end ]' F   $M 
h  "   � Ð <('[G  ) vcontinu\  `yield î
v
Ê(ö i\  Ø  Â  	õ 5#')"EP�Bcollås†dtuple(', �Base', 'õ ó ƒ group')Œ Y"""An_ðas defined by Python÷ packaging conventions.

    See `the% ñdocs on entry points, •<https://Q ñ.python.org/specifica_ /> -> A/>`_B ñ for more inform+ . 2"""‘ ñpattern = re.compile(#  ¯ ø	r'(?P<module>[\w.]+)\s*'! @:\s*& Dattr$ ,)?& ñ?P<extras>\[.*\]" $I )O  “  t ðA regular expression describU >psyntax à a:,K òwhich might look like:ñ  c "- Ó -  d/e. :æ _ibute< �:object.*  # ! [11,  "2]§ ÁOther combin¸ós are possible as wellW8The.ðis lenient about whitespace around F2':'0dfollow] – f, and  2any  s@€dist: Op†�al['Distr!Âion'] = NoneÓ õ def load(self):Ab"""Loa“ Çð from its definib ¼. If only aÃ`is indQed byá óvalue, return that6 !. `Bwise ' ƒe named É©  €match = Ì .E. ß .{ Ù \ W¢ = import_ (1 ‚.group(' &')6  Š°s = filter(K*, 5  # ø') or '').split('.E × ðfunctools.reduce(get=  ,  #s,)¬‘@propertyñ  ºž Ý ¼Á Œ 6 ÷ y  Ÿ w @ W 'î Œsw 3�list(re.f  È‰r'\w+', r Ëš  zA_forŠ  , n~}  ! = ­ oh   WH q_iter__L F y 9 pSupply ) ° so one mayÉðstruct dicts of E¯P® o 2 G S fmsg = T  2ConQ  Ý!ofW V iúÕprecated in "à D [favor5 .$ G�warnings.	 ‚(msg, DeY BionW / = (,.Ý ,ë)˜_Jð __(self):
     ×   return (
  ù self.__class__, ( aname,  Dvalu fgroup)1 !)
< ±def matches? Á, **params):!  | Àattrs = (get * ( a) for  2 in	 %s); Å óall(map(operator.eq,, .¦ Ps(), \ as))


à ó DeprecatedList(list– 1"""c ñ"Allow an otherwise immutable object to implement  Qility@  ¼ �compatib .ó>>> recwarn = getfixture(' 'ã  ( Ldl =« ˆrange(3)& q[0] = 1x 8 —.append(3' ˆel dl[3]' ‡reverse(' jl.sort 0extN 9[4]) bpop(-1 4W Smove( “ h += [5~ R + [6 £[1, 2, 5,  4 B (6,a # Â.insert(0, 0) ; � C[0, Z h  M ==  ATrue5 $  U ? [ 	$ Clen(´ � AH _äöfunctools.partialx " Pings.	 BÐ"EntryPoints œõ  interface is d½Q. Casˆ& ¦f needed."M ë¦ionWarning Âstacklevel=2 ½³__setitem__—P*argsÈ kw
 2 Èñ 9  ¢ˆsuper().P J  3___delv :P v / Ç ,, ' ¯   .ç K E â t M m -L n »m 1K l  i 1 H f !re]i 1K l o__iadd6M p 	o {fñif not isinstance(" w, tuple)  ~  ¬À
           ñ  other = tuple( 3)
  òreturn self.__class__(+   2) +A !)
4 °def insert( Ð, *args, **kw
 !):'  ^    ~._warn(p super().K E l /soj 4I h c__eq__Ô $Ê óif not isinstancF,Só ÷   V ˆ.‰z.” 8 A)


žó EntryPoints(DeprecatedList‰ 1"""V ðAn immutable collection ofï"ec O ‘ objects.>  F 	 ×__slots__ = (•__getitem7Çname):  # ->§ H T  
  wGet the( " iˆ  matching Q Ž  2 > (ifŽ ( D, in .    |Pings.	 (Î    p"Accessj eU! pVå by index is db". W>   ‚"Cast to	 (�eeded.",n ¬®ionWarning$ Êstacklevel=2 B x -sF‹ - 6try: ‘next(iterò0.se(< = &))C ðexcept StopIteraDT Ñaise KeyErrorF (\   'cparams« ’ ×Sˆ  Ž@from±bf that :aagiven X ñeters (typically group and/orO)PQµs(ep for ep˜aif ep.žQes(**s #s)ì ‘@property™  ( Jsaï R}pthe set™1all§ s » 
pset(ep.t ¸   ¡  8 ¢ ý  ×òFor coverage while Þ �G—s`vpresentÛ (>><Bs().o Y  é ž>Å ! "ep7 JamethodX  ®_ið _text_for(cls,  6, d\ Ú g  cl$.- " l Fcls.P (G '| x 4r  °ætools.starmap(°!, t ðparse_groups(text oñ
r ''))

    @staticmethod ñ	def _parse_groups(text):  3 …return (   ÷(item.value.name,      ); 1for- ò  in Sectioned.s
 S_pairƒ 6 ò)


class Deprecated  1"""& ðCompatibility add-in i ð mapping to indi; Q that6  `behavi— 5s db .2ó>>> recwarn = getfixture(' 'ß  ( ¥ VDict(´ Ñ, dict): pass‚  5 Gdd =Ù 4 ‡foo='bar\ ödd.get('baz', Nonex ‘dd['foo']U 9 
  _ rlist(dd- '  .keys()$ Z  ­d1LTrue^ 
C  ¼ Ž g 3en(.d 1A  ¾	 _^öfunctools.partialu " Pings.	 ,6  ˆÁ"SelectableG¾cÉ interface iÓa Use s3 &."F £¦ionWarning Âstacklevel=2 K9@_getú‘__(self, ð�     .ß (ú   R—super()._E ? y `  ò C X ¡, default=ÿf  K  ^ E 	Ç CiterÄ û { ¾ < 	P ƒcontainsT , *args[ G A ³ ¡ U 8 ¬ ­s¾J : žŒû ¹ ø ð A backward- and± cÎále result from; Áentry_pointsÉâ fully impleme e.;  v 	 @§Èload(cls, ep¨"byñ	 = operator.attrgetter('4§ Ô `ordereÓôsorted(eps, key=J < ,  Cù 3by(H ., 7 r‘Qcls((/ 0, EP q  ))L  0eps¿ #edû0@prÐ !ty lL_all 4 Ö   àReconstruct a W� of all •” ªB the} s{ ? K ‹ Bs = 0ed,�%f)O�  > ô è 4`chain.z _ ðable(groups))

 ñ   @property
    def groups(self):   preturn  b._all.' 
! E MnameD 1"""/  P Æfor coveragef ò >>> SelectableGŠ !).N ; Uset() U ¥ 9 ,  Û s[ Û §, **paramså rif not  –  ° [ O  ` Z ð


class PackagePath(pathlib.PurePosix … ð"""A reference to a 0 1 in
 F  ò „  Ó “read_textÖ óencoding='utf-8'Y  ¯ BwithÁålocate().open(3 	 ¿) as stream .{ "()‹ abinary� { O'rb'n $Ä  ‘i B"""Rª9Ð-like object tAthisS F   Ýb.dist.] R_fileË Ê‚FileHash ÷ �__init__) g, spec‘    ’.mode, _,~qvalue =* ç.partition('='Mc__reprV P « 4f'<Š  ^ 5: {j !} b   5}>'Ã €Distribuv Ç wpPython   " p¸.-sñ@abc.abstractmethod  	 ‹ > �¾  i `ttemptÜàload metadata / à given by the = .` ¦:˜(   3: T$ 1 of0 B !in 	Ç Qinfo.¨ H D@  ;ö
 if found, otherwise None4 6,i
ÿ † Gê ¦ ¿ )is‡", ² %thC _to it¤ užPfrom_8Q(cls,\
š 8 y"6e›@ œ ` X 
 ˜	ŒA �to searcha Å :ë E 	ˆ Pinstaq(or subå  ìPreof)F   ™ ” ì  r ,çn Eaise @NotF¢Error: WheM Í d'�Ž k Í0canJ"beYr  I *    �€resolverâ�cls._dis_ 's(¨ 7  ODs = ! (' Finder.ConÚ(º = )2À      dist =÷ next(iter(dists), None)
  0if  q is not! :!  , areturn)  Jelse* ñraise PackageNotFoundError(name)
< Á@classmethod !deƒ öcover(cls, **kwargs)` B"""R… 0an Ó òable of Distribution objects for all pŒ "s.{  Ë ðPass a ``context`` or p ó keyword argumenH Áconstructing°  F #a ? Z : h: A ``˜ †Finder.Cr ¨ .O :ao: IterÚ  �   5"""P Š 2 = Ic.pop(' '$ifÎ C and3 { ] ÛRValueÑ@"can0oaccept@  "gx % =' )or¸
 (ÿÐ øôtools.chain.from_(. ± AesolQu)r Á in cls._disx_ &s(¸ ±kstatic²at(path£	Þ z ðthe indicated metadata C œa:param @: a Ù"ngŸsth-likeâë 9‘Zcrete| …instance… r  "  4dHPath¼æ @lib.  )
SM """Search  _’ Ÿ „.˜ ºdeclared = ã‘getattr(f^0, '	   së_    erûEsys.{ Lù0fil< 4$, ‡ ý Æb_localÄ‡root='.'! ¯ñ pep517 import build,‚system = ‚.compat_ (X ª @ ’er = funczpartial- ï .. ,ñ  °source_dir=Z  ‰ =z   ) 	4rzipfile4{ �_as_zip(ˆ 5er)J�property›   4  !°(self) -> _ .]M@	X  XHparsg Ithis»QThe r_#edcð will have keys that Ç¹ñ various bits of¸  O ¥  ¸ á.  See PEP 566vdetailsõå Šá ü `.read_ ¶('METADATA'� t 6or * Àtext('PKG-INgFO')
  ÷0# This last clause is here to support old egg-info files.  Its
J � # effectA û'to just end up using the PathDistribution's self._pathš Ð(which points�  A 	‡ B) atK Ée unchanged.G "ora ·read_text('òreturn _adapters.Message(email.m `_from_¿ 0ng(N 1))
o ‘@property �def name(Ü !):  +B"""Rh  Ë ñ'Name' metadata for$d Å package."""G ¬  ] .> [N ]� Ï_normalized_› &a + ± version of›  : ‹ •Prepared.; û .0 "\ * %V‚ (7Q +bentry_w� {E# P™. A_for1 .nN q.txt'),’`G 
FxP in t²%.õ b:¡ `: List¶P@ xa8is = † or NoneD QResulÇ` 2` iýk@ thaà�umerates Á(i.e. RECORDx  s @ or SOURCES Õ6) iC 0mis7Ï˜ Ímay be empty› ‘exists buÀ $ A D f�_lines =�!._µ   s_®  í ()i 2egg 5 óPmake_A (øp, hash=C`, size8 Ø ´rp'= ¬B ž' .U 0 = PHash( ) 	 R elseÏ 3  b .… p = int(  � :  >  ,Š a r d   hõand list(starmap(0Q, csv56er(2 )^ ]€ ‹ � šNáARead´å#ofŽ¼ -  ¾Ü ‡ *À0Õ /  Ï  	 a.splitf (Õ° 0¯ ðmight contain literal commas, so wrap each w Ò ™in quotesóÀ
        texót = self.read_text('SOURCES.txt')
  preturn # ñ and map('"{}"'.format, ñ .splitlines())
? ‘@property Ðdef requires(| !):  h Ä"""Generated% õments specified for this Distribution"""E Dreqs× _Ø  dist_info_ R() orö  8egg I ó  4 ó Plist( Ø  Ê B a Ö ;  ó.metadata.get_all('R-Ð '[ 
�  D 0dsourceí ì  ¡$('aÅ7  Ç Q °._deps_from!š) ” Á@classmethod$ ; Scls, @ áÙcls._convert_â  _to_simple‹ Ps(Secà!ed¢(Q ’ lstatic“ Y sY sNEñHistorically, setuptools would solicit ) ‘e 'extra' Ë‚¾ð, including those with environ# • markers,@ pin sepa ¬ °. More mode‹� µexpect each< õ	dependency to be definedR  Ô ƒ Åany relevant? Ê sÜ £  ñ attached directle 6thaA ü 0. T¬£ šPs theÉ0mer¢ 5the} ÿlatter. See _test� @ p an exa/.B  Ç  ¤@maken diKW(nameö­ê  ÷ fÎ` == "{ 2}"'Ì .  T rquoted_·(¡V  ŸÆ x'# L l a$p,0 R.partµ '':Œ 9 1if < ° ‡ sh "    s = f'({ *})„ 2con 7åãfilter(None, [7  ¡ 	I€ 6)])% s ã�'; ' + '  v'.join(i @) ifx kelse 'd0url`_spacey` é r  tPEP 5089As a ; � betweenv U  M˜  ‡	ÊF U ôRef python/importlib_ÂJ#357/ � ð# '@' is uniquely indicative of a � :reqG Aa ' * (C nÔ õ ™  ^)_ ü =e Gàsection.value)'
  ðyield section.value + spac äquoted_marker(& ðname)


class DistribuA ò Finder(MetaPath !):r 1""" *A  ð capable of discovering installed b !s.E  M 	 „ rContexti  Þ        ðKeyword arguments presented by the ci Ar toT  5 7``dØ ¸s()`` or ``ï .°   ; ‘to narrow[ AscopÜ Êa search forÓ : oin allR 5s.
% OEach#  õ may expect any parameters: ñand should attempt to honor« •canonical2 E ` defin2òelow when appropriate– 9 z@  *u = None  !  )   ‘Specific )  ywhich a!! fW¼ Vmatchq A= Pof ``i 1`` " !esM	Ç6  † “ ódef __init__(self, **kwargs½ ­   Avars" “).update('  @Ierty_ Bpath9 ¥ Q  ˆ    ±The sequenc6€directorÑth thatn  J æq<  0Typä�ly refersgPythons€package · @s su”I G c"site-( 4s" © ix nd0Aault_ ```sys.L &``ƒF     wreturn gPget('; 4', F )nñ@abc.abstractmethod Ï 3_ü~2, c+=3'()â� ¼	†„R§ tan iter¾¼PGncesä¢  ë @loadè €�metadataTÇ# #``º 5``,D a	 .Ú ~ r à ·@Fast¤�   • òMicro-optimized _ ™L Ž a « ˆ ‚childreng  I  ò@functools.lru_cache()  # type: ignor °÷__new__(cls, root—‡super().+ 	A 	ÀC  Õ. ! =^ £  ñ  ‚base = o¤.  ‘26 P).low} y p @join—% !, ´  " @lib.j* O / N ? 1ren$ G €with sup²ps(Exceph"  Å !�os.listdi«!lfk  µð '.')
        wi÷
th suppress(Exception):
  õreturn self.zip_children()' # 1[]
 Idef *  < V   `path ='  file.Path(' V.rootZ Rnames( _3  . Glistƒ < @join& 1  ›  Ø ® ádict.fromkeys(Ö À.split(posixH ñ.sep, 1)[0] for % @ in � "s)S  î RsearcÁ , î o ¡ blookupé smtime).;  R Q •@propertyM+ 6 X (wi¾wOSError  ë qos.statB BQ).st_V d  +   Ô.cache_clear(• qmethod_ 5  ø Ð !, P � ù Lô ¢)


class  i I �__init__£  , }`: FastT  base = os.# .  :( ;P.lowe·  Õ    $  _is_egg =  P.ends?v(".egg"o@infotðFreezableDefaultDict(w0 ?egg/ 0 Œ 	E´ SN &   Rlow =qÒ    fif lowÊ €(".dist-½ 1", Ù  )? :   €# rpartiïñ is faster than Àext and suitÿÕthis purpose.Ô  P    ˆ! =– ] @("."?.o 1("- @ ôormalized = Prepared.n (` z r   ²[+ ’d].appendä)D Aelif# ö }b= "eggD
œ x  Ž Oï "vlegacy_µ ö  ý 	 [1 ~@ .fðeT _  8  ±· ? 3, p®j ˆ (2  2   / . [4 â)d], %ifX 	 ñelse itertools.chainÈ_  ­Eg ‡.values(ö  Û ? = £    ¢ ]	‘ © - m ¨ 
I ß ô (H , ? Y9²1"""« AKà search for meñtadata on a possibly-named package.
    """
	 ñnormalized = None ~legacy_  ðdef __init__(self, c !):  _   . ! =  !if 1 ism 2  6 ereturn, E   
 (a )/ ¹ 6  = > Ñ@staticmethod  â ý + «  < ¯   „PEP 503 - òation plus dashes as underscores~ : F ù ó re.sub(r"[-_.]+", "-"\ò.lower().replace('-', '_')ÈÄ ö Ë NjD the.®±as found in aconvenë i°Solder9 ÿing tools versions and spec Ôì  žc__bool€zK  ›†Â)


class Me"`PathFi˜�(DistribuÏ  O @3 gfind_d3 þ s(cls, context=N ".C #()X þ u  S .Ô ) Rø an iterable of all j ã instances cap& Ê D Aload‘Che m4 fo¬€es match# #``É 8%``D 1(orv   ps if ``.ð`` indicated) aloø?4ths/ElistI ö of directories q opath``!~à= cls._search_0 (s(¯ †. @map(ø9,ÙEòp  í  , e sÔËcè "in0 ø  heuristically.aprepar‰P {<É  
]À.chain.from_  ù(.  û ¤ .1(` )ü th¡ @FastÔ C  qñinvalidate_cacheøþ D ‘.__new__.& v_clear(� g �	O  o ` È €: SimpleC *  ã é"""Construct aIHa:param„H ¾ ü ÷¼y‘Tƒ! =U ² º Pread_€`, file1³ Úwith suppress±€FileNotFoeError,� í CIsAD>y À           K§eyError,
  ÏNotADirector  «Permission= )):H ðreturn self._path.join	 ñ(filename).read_text(encoding='utf-8')
N ! ö.__doc__ = DistributionB ! 8 °def locate_n (‡  , ~ § £ �parent /* J ‘@property�  X À_normalized_Ç ] W 1""",  U@Perf. Ànce optimiza¸ õ: where possible, resolve the> i  i P from!  Ô q system« .3 }  P= os.ù A.baswA(str´ ˜%))= 	 r _r _H ( Ü) or super()./!8ame; Qelf, A $ _ f, ext ¢ Aspli, — !if( ònot in ('.dist-info', '.egg „ |Î F q 1sepl w  f `.parti“M('-' 5 0


Ö  u w( | a"""Get¤(``©€`` insta	1for"  ] ¢d package.@}:param ` R: The!of> # E ` as a "ng:O: A ‘ (×`bclass\ Rreof)@ PG 
| Å  5 ªs(**kwargs-?allœ sóqthe curœ´environment3œ ÿ: An iterable ofT Û †discover³ Ñ �metadataó  P -> _  ".PÓM, õ %  E  
H‚to queryì � ° containingû„ parsed £ ? %.G >0ver:= $+ Í*` p… ³ ntdefined¦ %'sw""Vô "S3 ke–WÒ# .Ž L°entry_pointZ8 s)…pUnion[E  P ð, SelectableGroups]:
  ñh  """Return EntryPoint objects for all installed packages.

    Pass selection parameters (group or name) to filter the< `result ez   p{ ñs matching those properties (see: ª "s.} 3())’ ñFor compatibility, rà `s ``Seª ÃableGroups``ë q unless^ R Ï ðare supplied. InÆ ñ future, this funD Cwillx 7 ``° !``Moead of’ @ ßeven when no ‘ � û smaximum› 
p¯u Ãor invoke ``X‡`` with Ùoü ¾u:c:D\s or pQ
 P1"""‹ Ànorm_name =  ðator.attrgetter('_" aalized( !')8 Puniqu5 ŽÒools.partial( ð _everseen, key=F @ ? ±eps = itert< °chain.from_  9(h  ¬ Qdist.»_» /  B in o ( ²ributions()g  4$£.load(eps)„1(**és)


def filesZ Ã :› Ñ`a listh2 }1the‘ÊÂc  ¯ U 3: T2  H  > #  Åaquery.ƒ L€  —"osÛek 7 ýi î  .Õ orequir› ì: 3menð ä  z"— A: An" “ A `, suit' mq  *5Ging.- ".R´  z  "L se 8es_8ðs() -> Mapping[str, • 
 %]]1ª m.  Ý ”top-levelêsëQtheir4 	l Kà>>> import colq üA.abc3   0pkgi³ ( aall(is~1nce,U  .Sequence)tW € c e.valuew2Tru@iapkg_to1) =X Àdefaultdict(E²à	ú "()K í % 0pkg„ ± ñ.read_text('top_O`.txt')#˜'').splitD  H � Â[pkg].appendT òmetadata['Name']  ¢ ¶ ? #)
�ðre
import textwrapó
import email.message

from ._text " òFoldedCase


class M/ (= . ñ):
    multiple_use_keys = set( ! &ap   i ,%   [    'C‡ jifier',  ïObsoletes-Dist" �Platform ¯roject-URL ?vid\ 	"ro! _ExtraC oRequirC ! �ExternalF 0SupÂ?ed-Î 	{DynamicA ]6)^ 1""" K¯õthat may be indicated×ñ times per PEP 566.;  C 	 údef __new__(cls, orig:p3 ½!re)wuper().A ¢  # ñvars(res).update(  _ )% ·return res
� ð	init__(self, *args, **kw
 ¸ b    �._header� ´elf._repair "()Y ñ# suppress spurious error LHmypy� 3ter� p ­ sö i' c K~  £ B  # Çredent(value  Ñ ð"Correct for RFC822Ô‚entationö )   qif not H � or '\n' "in á +  Á 3 î   Pbwrap.d¤ ’' ' * 8 +Q è  5 uy[(key, Ö )Á  l  “ !rsÒ4)['�5']]‡ 0if -š._payload¾ p ð.append(('Descrip"',: 4get= .()dC †@propertõBjson  z  & î   ðConvert PackageMetadata to a JSON-compatibleÿ 5matÜ 0€ R  ^ #  Ptransð SH œ0lf.ê 1all' p if keyc@ÑAelse"F[keyq ƒ < Ö== 'Keywords'ÿ  "   | ôre.split(r'\s+', $  @tk =� A.lowöreplace('-', '_'ü 3 ’#tkM ž •dict(map( ,  †Ü  ñ
`collecRs


#áwjaraco. C 3.3)ðFreezableDefaultDu + ".d  � ˜ ½ § ðOften it is desirG  âprevent the muÁ1 ofñ#a Q  R ° after its ùÐial constructñ!ion, such
    as to prevent mutation during iter !.
. ÷>>> dd = FreezableDefaultDict(list)( è[0].append('1'  .f@ (e( 1[1]< [  k blen(dd% 1 2"""Š ñdef __missing__(self, key):)  Ü ãreturn getattr# �'_frozen'gper().H  )(C c ¨  ^ Y   .H � = lambda} !:  dð_factory()


class Pair(collechàs.namedtuple(' @', ' ƒ value')v @? amethodà   ó parse(cls, text+ ú òcls(*map(str.strip* ô.split("=", 1)))
import types õfunctools


# from jaraco. P 3.3
Š m™ r_cache( !,  0_wrcr=None¢  Å ¦ ‚Wrap lru8  ˆ1sup‰ 1sto€2theG � data in  óobject instances�‘Abstracts% ñcommon paradigm where   ñ explicitly saves anZòunderscore-prefixed protect
 ò	perty on first call and o ~ !atJ Ãsubsequently¤  ÖË@ MyC®0...L Qs = 0@ 4...  @º /	 „æ>o]  D Ÿ ² Rs += T  Ä } ² 4a =° ³"a.� "(3¢3“  0 Pfor x®‹range(75Š  reå @ x@  : !a.� J "75‚ 0Not¹!at¾Pappar¬ðbehavior will be exacÎ3lik0 &of_S PexcepH M £@ is q edÕEeach[B, sosÏ 1oneG z{ ”not flush* ,�another,uwhen anX 1 isI qdeletedg aŸ” dL for thaîIb—}3}b½}b}!35¡ ”è0¨� ®	2if 9 ð had been decoraHuwith ``K.Q()``,} ² would haveF p76 (due1 1P of 0+  ¾ s I žQed byC5'b'Š)P@Cleajp  .]  _c  ™ ’ü Ý 
"   PSame ˆaÃ¢hasn't yetÈ  =#ed�  T cÑc«j Af%l@ may Nðlied:

    >>> cacñ0he = functools.lru_cache(maxsize=2)
    >>> MyClass.method2 = m
 2 ñlambda self: 3, H ‘_wrapper= L 4a =P ( \  !3
} ðCaution - do not subsequently b C theŽ ñ with another decorator, suchO ñas ``@property``, which changesL Ásemantics of $Bion.“ �See alsoQ õ&http://code.activestate.com/recipes/577452-a-memoize-š â-for-instance-]!s/Y 5forÊ ¡implementa€and addi ±al justific .= 1""" zˆ* =˜? orÿ)ç 1def`@per(ÙÐ, *args, **kw
 !):d  #R# it'>ñfirst call, replaceEÝ ¢‰ ƒd, bound¾N  _1 ‘= types.MpRType( ,oA „ ì d7  ü (T 4 dsetattà X “.__name__ÇS 6 creturnÄ q (E€# Supporòche clear even beforeF ò has been createdÇ ßBper.Ë < "= mb: Nonef ‘ / ¡
from iterÙ1 im� àfilterfalse


Þðunique_everseen(3  able, key=_ ãb"List / " e‹õs, preserving order. Remember all)  ï  r b .–#K z ±'AAAABBBCCD á') --> A B C D5 þBBCcAD', str.lower8  x c = setY  A_add aen.adda  if÷ 1 isYÜ ‰ô G in G(K °.__contains3D: ™   *  u (J M  Tyield0� Oelseƒ d !  E 0k =Á b  Ý ?!inŠ
;  ? ¢ kœ   
  _0typø\ò Any, Dict, Iteru 5À, Protocol, ¼ôVar, Union


_T =  ("_T")


chô PackageMetadata(F W ¾q__len__œ†) -> int× ò...  # pragma: no cover0? ·D ,3 m:LO OboolP sgetitem“ EN ?strM  äJ Ž W_[str]J sget_allâ Ðname: str, faóilobj: _T = ...) -> Union[List[Any], _T]:
  5""" ñ$Return all values associated with a possibly multi-( ed key.G  S  ‘@property Ñdef json(selfš “Dict[str,¤  © _str]]¦ ûA JSON-compatible form of the metadata� ò
class SimplePath(Protocol) µ  ðA minimal subsetX €pathlib.8 Ð required by  ÂDistributionu  K ò 0oin@ ö '… '|  x õ	...  # pragma: no cover
I __div__H .oparentG .‡read_texJ ?strÐ óimport re

from ._functools  ñmethod_cache


# ) pjaraco.s C 3.5ÑíFoldedCase(strÌðcase insensitive ¬1ng ñ; behaves just lik  rqexcept eáres equal whenf only varia÷@ is j .®‡>>> s = œ é'hello world')' A= 'H W ~ FTrue% 	  _ == s%  ?s !J GFalsK Ás.index('O')E 4g vs.split [¶ `', ' w  ¼ ]0 ¦orted(map(ê �, ['GAMMA1 Palpha	 rBeta'])s *[' #, 2 \ pSequencË€mbershipa÷ straightforwardl"@�" in [s]Ý G ]’  	, & 0 ÀYou may testU  òinclusion, but candidate and element‘mF`both b” ™¦ $(… )² 1{s}‚ ² {8 2 < uString °  nkÃ� long asºO q object< Bis oÚrd· "ºW; Â C » 
 ’But not i’7 r  În Vleft:S+ (|!o'	c ×I¸ a™Qse, uð_T Y.in_(U šÃ  1� >ÕxI’  m	ÿC__ltµd, othe¤ * rp ¢.lower() <&   ;?__gJ À    return sôelf.lower() > other ò

    def __eq__(self,$ !):  ! preturn  : 2 =='  K /neK !K ChashM ‘   ³ … )† ƒcontains? × ñuper(FoldedCase,é )T 7.__J 	?o /in=Q"DoesS ¢ appear in;/?"b  � (q i �# cache Îñ since it's likely to be called frequently.g �@method_C   øK D_slQindexE _, subJ  „.. $ubbÞ  � TsplitJ   Áter=' ', max '=0_ ñpattern = re.compile(re.escape(1 Pter),  !I)ö Ñ? .( v h ô)
import collections tzipfile ó pathlib
from . 8 `abc


Õ óremove_duplicates(itemsÈ ]Witer(l Ð.OrderedDict.Z 4key9 ð)


class FileReader(abc.Traversab dsourceg  ‰ e__init lo9 ‡  á Î 0 =  ’lib.Path(* . †).parentþ"rej _ F ] &""ïRQ@the Iq systemt  Å@prevc  ”   `O sƒ @()` à creating a te®5aryä3copú C ~ r1str® T Q.joinÁ l )— ¥ s- Ñ G  Ü : •?Zip”,‡, modulen Ã_, _, name = p.rparti›F('.'ßÈ„refix = ½ ò.replace('\\', '/') +W + ?D `archivr E  ýTopen_3" l¾ 6tryO �=c*).G P Ò ûexcept KeyError as excS Aaise�NotFound, Ç(exc.args[0]Ó,is·  Ä³ €# workarI c for `÷@.is_"` Ê  †Etrue@#4 Ánon-existentßs� �target =.M 6s()ˆ� O f  4 } d() and h !s(ä À  def files(ƒself):
  ðreturn zipfile.Path(# ¡.archive,  ñprefix)


class Multiplexed3 ó abc.Traversablea 1"""i ÷Given a series of , ñ objects, implement a merged>  U 0ion7 ô	the interface across allD Á. Useful for< `namesp- ðpackages which may be mÈ phomed aw esingle; .
  Ç 	 Ádef __init__&ƒ, *pathsð  T/_ À = list(map( 1libañ, remove_duplicates  As)))h  H bif not~O µ   »message = '�Ð must contain×  least one † 'c  G ó	raise FileNotFoundError(_ � 1all¬ �.is_dir()kX 8 in® h ÒNotADirectoryi ¾ ó only supports d. aies')
»  †@iter  nj Ávisited = [],  { ?for¡ 
O %   Æ  &.b ^  M   0if + .] 0 v 
Q  )    ˆ2inuT   6 ….append(R s* Qyields pread_by;Ò0f'{* A} isZaR UT DtextÜ args, **kw
 
d '7 Š P †FTrueã 0is_� , GFals- @join¸. w, child5 ò# first try to find$  À@currv @ s7 €  "  ¯ 	"==W i R c ²# if it doe”`exist,¼`struct Pwith ùÂ  ¥ A U Ÿ %R[0] /„ Jä__truediv__ = '  JCopen5*æð8‘@property°  m  2m ›Ä \¥ c__repru<  s@, '.Ü P(f"'{ ?}'"š�  ]{ f„(C Es})'ñNI{Reader(ñ„Resource
 í * ü ‹©Å Eif '_  N'  O?tr(7 Á ¾SValueNqInvalidñ'KÀ  self.path ó)= MultiplexedPath(*list(namespace_path))

    def resour e(self, !):'  + 5""" ðReturn the file system Z µ to prevent/ `c  s.# õ()` from creating a temporary5 Ucopy. ~ r~ 1str® T Q.join] l ã  ¥ s- Ñ G 1elfC  
iƒ Dt os
 Aio

© #.  s_common   0as_i ,s$ 4abc  RibReader  ¤contextlib& ssuppres@ x Olib.I  &LoI ) ”machineryR ¢ModuleSpect $io ôBytesIO, TextIOWrappš  M—  K? TtypesB \ EType  ÑŽ " CÞ ôManager, Iterable, UniG7typ3 HcastK .® Vinary¯ ' ¸collections$sSequenc— …functool¸ ñsingledispatch


__all__ = [u¢'Package', R½ Í  Þ4nts   4is_¬  aopen_bç 	  #  ˜ Kread0  0 C]


Ç " =sf[str, ¶$]
Ù 
" 0os.ò@LikeF  (� "(p#: _ 2$: Q a) -> BÍ "IOH3""";a%Ð-like object ` red for  Ì  !ofk.. 3 = ‹’.normalizç(" )Å¶ / Cget_ Ô +  { +er* N _ 
2 iJ �Â is not None÷  ?n: .ì þ¦ pspec = 	(© »#, ¨ 0.__" "__© 0# UÌ| ¯ðdoesn't work well here dueš ²ñlack of 'strict'¡# argument� e u .÷ °lve() priorH ¢Python 3.6£0if • Q.submnÁ_search_locaœ h ?s == £ $elf ooriginR "[om@.dirü(  abô!h(° J 2))] |g'1 inYsÈBfull $= S  | ¥ 6tryF    (V ¶, mode='rb'; êexcept OSErrorF ð# Just assume thôe loader is a resourc ÷; all the relevant
  ó# importlib.machineryP ûs are and an AttributeError forH ðget_data() will make it clear what  ±needed from• º .L  “ = cast(RÐ Lä r, spec.# )7  } y = None ·if hasattr(< 4, '² 9'):1  ñwith suppress(OSö (   , y ” .V ª(full_path§ 1if 1 ais not¯  ð return BytesIO(1 !)
¥ ñraise FileNotFound› D(f'{ú6!r} d f' Q in {ñname!r}')


def open_text(b ¢package: P	 , ] $: ‘ óencoding: str = 'utf-8'  ,s òstrict',
) -> TextIOü B"""Ró ña file-like object   40or ¦ @ rear 1 ofCš C."""« =` rWrapperÛ  ®î sbinary(ë ,/4), Ñ =	 1, eÇ = c ; ‹ _M 8V 4ù bÖø  ¢I Ÿ contentsá �È b as fpe  ö Q0fp.³ (À  U Ã í aÇ Þû&2str› ø  @deco (-ngÿ AThe ) ñing-related argum4Ahaveàsame semantics�those ofÕ ….I 2e()�A`&%)` p k4 'CõxtManager[Path]'EA5Bxt m! a provi'R { R!to#Ù.ZIPB doe¤ al5Ày exist on i� wn  ¸ ²r system@a teW1aryÏ`be cre°#. l : 4was ,˜   ¥Ibð leç@upon† Ating* +ö °(no excepti§ sF 32d iß  ]  s "deU 0priZQ @ 0exiq % eòq_commonùR_ ( Gu)™ ª3_!E L $, M ðnormalize_path(r³esource))
  •if reader õelse _common.as_file(  7    ôs(package).joinpath(  ¡normalize_ r~ ˆ �)


def ' b_from_” ( %, ; :‰ jreturn0 Ú C 7 8 or. Topen_T Ü n l � m 
¤ òwith suppress(FileNotFoundError)&  OÎ P;ƒ .œ Ï p )Œ  
Ë ? 0ósaved = io.BytesIO#.? i .I ('  ÖP_tempû(W + ”, suffix=¹ ª &ish)2: P2ò, name: str) -> boolÀ"""True if '$ e' is a“ inside 'R 1'.
«õDirectories are *not*6 !s.% 1""" < % =ìCget_ Õ+ ú Ð š Á .+erK Ì[ 2 w Ú ‚not Noneý X .Eu P ô_contents = set( Ã q  ;  l <in = { QFalseþ ÿÖ @ e ! /Í)¬ � þóÒIterable[str]„ B"""RßCan i  q of entÚ-inù‘Note thatß 5all-  ‰ús.  Specifically, d1ï  !!coa7red>x  Use `�¡)` on eachq "y ,bed her>€to checkÌ itîÈ or± ˜&w?ô_ensure_sequence-Ì�transversÃ‡ "]9if 5  /Ndir(¡list(item.·0forLm inB 1terC è‚ò []


@singledispatchdÜ cƒ @  ž Ì@³.register(S')a  ¶ 7 ÑR h ð
"""Utility code Û  qð	tructing importers, etc.± Rc ._abc 1 Loµ ”bootstrap amoduleLÀ_spec
from .þ_bootstrap import _resolve_name
from .& Pspec_ _loader) `_find_/ # ”_external{ ÏMAGIC_NUMBER. __RAW_3 Rcache· ^sourcà ” decode_/ ( c n È  1 âfile_location
: ¤contextlib& „manager
·4imp ”functools %sy Etype ó warnings


def ½ Shash( ð	bytes):
    "Return the $ X of *( Á* as used in" 0-ba @pyc Ü 1s."I rH S_imp.@  P (Ò,“ ‡ § ¡(¦”, package© 2""RÅð a relative module 1 ò to an absolute one.""� aif not' ó .startswith('.'^  Â  L Ò #el7 ‰ 1* aaise I\¤Error(f'no±  ýñ ified for {reprÓ A)} 'Z  D  ƒ'(requir8 ä As)')B ‘level = 0  g �character¨ Ä ¯ 6if  f!= '.'  ˆ QbreakJ   \ A+= 1 	CÏ [) %:]ª!,  )Ó&
Apath9  1 ith=NonÝˆ @; •  Mmì!.
– ²First, sys. Às is checkedasee ifØ! Ã was alreadywaed. IfP 0so,, nR [G1]._ê __a 8 Ð that happenss "beK  et  ß T QValue)D  >z  r Ã!is£"inD Ø D ê @eta_G G csearch-¡a suitable~ ß ^ M v  Ù'< p' given£  ` ËPers. °  X ã  >"noO QcouldL ƒbe found‡aDottedYAs doÃ @have| ”ir parentswhlicitl‚�You will` âmost likely neË:exp6 N all\ ÅaproperL QorderI b@to g¢¡he correctä Ñ 21ameÑ i;* èÞ§Felse0 � =d¯  |'if ’>   r   3 ðtry:
            sópec = module.__spec__
  õexcept AttributeError:  & ¢raise Valu E('{}I õ is not set'.format(name)) from NoneN Jelse\ 0if ‘  F  * 
 }  7 z p A Qeturnf ±


def find©  , package=J )‚ B"""R8 1the< T for  TifiedS
o ²First, sys.ksÔ ñchecked to see ifC ! ñ
 was already imported. IfP 0so,, nR [Y]{r¦ 8 Ð that happenss bz0set  ß T Ì ¥ àz  r ×    Ø"in� Ø D ê €eta_path. �searched*“a suitabl>@with^ M vKP of '< p' given£  ` žAers.: X ã  >"no�QcouldL ’be found.‡Ib ) <  µ3subqñ(contains a dot)Ê v parent÷ W Çautomaticallže AThe b 4and>ð  arguments workì ƒ same asÝBlib.ç_� 1().l €In other9 Äds, relative“  k 1s (Cpleading¿  s)1 kù 1"""M @full1 ° = resolve_ 
ë)L ame.starts[ `('.') ¢Ü M 5if P �+ dCi % =3 ±.rpartition] 1[0]V  2 #ifx5 J   N S = __0"_( - ,Y�list=['_U__'])\  D :tryU   E  u# =€ .B 	?  Ë¿ V ?! M`@NotFŽF(S  +   $f"r $ auBÇS on {¨  ¸B!r} Ù <  °f"while try!toØ$ {±Q!r}",Ë= “ L  î
'{ # 3Å ˆ  _¡?X  C DŒˆ
Z ð( =>[> 	* !isÿ
œ � 	• èNïîÀ spec


@conð!textmanager
def _module_to_load(name):
    is_re 0 =  ‚ in sys.2 !s
%  ( = B.getI # fif notO ^  b ò)# This must be done before open() is called as the 'io' u ] G ø+implicitly imports 'locale' and would otherwise trigger anE Õnfinite loop. m Ç = type(sys)Ü  Æ qputtingº H E A   6# (Ÿ ð	an optimization shortcut‚à û.c becomes wrong)¯ 0.__Ì õializing__ = True' É[Ý8] =W6try§Xyield �except E 6ion+ ì å 	V     8del=Ž ¨  " o †KeyErrorn     Apass2 gfinall» uqFalse

ó set_package(fxn „"""Set _ Q__ onËtreturne.Afunc´Óis deprecated" 1"""§ @& ¡ools.wrapsu   “Ž _ ð per(*args, **kw
 ¢  ü �warnings.	 S('The UÀtem now takeJ Y0f tu€automati_Ay; '  Q 
 '- �decorator‘ slÓ À for removal˜ßPython 3.12',M DBionW· ì, stacklevel=2Æm = fxný ^ ²if getattr(é7, '¯q', NoneF 	 
92 .0 0.__%__j  Ü>hasr Wth__'– 0   e t�__.rparti9…('.')[0]{ m ( Ð ¹!erZø Ï ÎYr Íoself, ÓêôÙG_Ø/ Ð = self
     ö   return module
  ó	set_loader_wrapper


def+ C_for  a(fxn):< ó"""Decorator to handle selecting the properH R for h 1s.
E RThe dF ñed function is passedE ±  d çuse instead of M `name. S 2 D  in<  � a òeither from sys.4 As ifM ðit already exists or˜ Sa newÑ 8. I…   @new,˜ @n __� "__N Ps set ô  first argumentš “method, _i __N 4 oTaf, andL –__package$ ñ accordingly (if1 4.is)  ()M ð defined) will b«tQ �before it& 4!to­ œ ` AdoesM �not workí tmo ^ x ` post-)
´If an excep0rai"anŒ Šor creat½ � ðsubsequently removZæu  ,W ²assumes tha«  @ š1tak" e å" aü  ï esecondài 1"""� �warnings.	  ('€ `importƒ‚tem now d Bcareåñis automatically; 'M  Â T'thisM¬!sl' w	ÿal in Python 3.12',I  pDepreca†W¯ ñ , stacklevel=2)4 @LPools.4s 9Y°(self, full:Ð, *args, **kw
 ] × bwith _?1_to(9 C) asƒ� 2   0 .H=›  !   :try6   0 3 Bx 	H ¯1 (IÄñError, Attribute Ñ  e    c
G ?lse�  &f “   J í =\	c  . eg   H 
p.rparti‰('.')[0][ #•@was  ¾Pabove×ç3__(€ do ¡)r.O ¦3fxn,� *B/ % ªqñ 


class _LazyM�r(types. bType):M ‚"""A sub2 	b 4 ñ  which triggersÍ ëdupon aø€ access.õÛ  U__get# #__Ý   #B"""T]  !p ô  o @ mn  Ì  ð# All module metadaó&ta must be garnered from __spec__ in order to avoid
  ÷# using mutated values.  ÀStop trigger* ¶this method' ÷self.__class__ = types.ModuleTypeQ ðGet the original nameš ømake sure no object substitution occurre¾ �in sys.mi ¸ ] _] #= ¡ . ’ 0Figv õout exactly what attributes were%qbetweenÆ @crea� O !of ” † and now, V |s_then ˜ €loader_sŒÅ['__dict__']] < 6now; $ " 1updÏE= {} ‚for key,å O •.items():-   €# Code ts¶ 3 ñ
 may have kept a referencÌ&thóK ƒassignedÚP, makPðidentity more importan#¶an equality> M  ifÈ F notÅ  P
¾  *  ® 2s_ur[key] =ÿ 	é ‚elif id(/ 1now+ F) !=  a  g "
�éb.exec_((! )– X# If  ñ ) was used dire¥ th– is0€guarante¯"e T N O D  pu7/to9%if™<
b
ü 6º ,�[„]\ žpraise Vs‚Error(f"¹ $ ²{G U!r} "Ø  E  "9 ed%˜ 1 duÉoa lazyN  °"žUSp after   Ë!siþRhat'sBÀwould happen‡  ÓEagerÂ #= !tuJì Y..Æ¤ d“  return getÅN,Á!)
m �def __del (__! ÔB"""TêÂ Ø À ü� perform @deleö6.""ŽD# To*& @ é ý @xcep9 " i% Ž O¥  Ì€# doesn'Œ=istâ 5 !__à Þ 1


—a LazyLa( "):A"""A‡ ! ìÔCes aH€ which dás*  îQuntilcŒ q accessÍ @Ç"ic+ „pcheck_e_"2er( "!ifÞ0has!  5, 'Àle'):
        ð&raise TypeError('loader must define exec_module()')

: Á@classmethod òdef factory(cls, J !):  3 ó """Construct a callable which returns the eagerA å made lazy."""M Ácls.__check_/ _p ( )) X ð lambda *args, **kw
 S: cls3 ( )ê  Ù ß__init__(selfÛ    � * ¤ # =ã R h dcreatem , g, specFÐ   .H .6  0 S ¾ 5 ", ËS q"""Make{ ™  u*ilw 0.__– #__‚ 0 = [  {- ¨ /__( ð# Don't need to worry abou„ñep-copying as tr
 õto set an attributew @# on ð
object would have triggerf !heä ,6 ue.g. ``¶ ã cNone``P K ! aG W fromK ¦ caccesst8, ¯state = {} æ['__dict__'] =N  . (óT  : «;  o ÷ _™ T 4 M ‘ = _LazyM-ñ
"""Get useful information/Ò live Python ¬ts.

Thi/Â encapsulateñinterface provided by¸ 1nal/Eial
°s (co_*, im  tb ôetc.) in a friendlier fashion.
It alsof ðs some help for examin’ñsource code and 	ò layout.

Here are@ !of« @funcsf Ì ÿ :Å"is›a(), isa  } M  —generator µ%is . ’traceback Rframe  × 
 –builtin()1áisroutine() - ŠÇa typesq ¡getmembers& Cget  7 of¥ðthat satisfy a given condi#	Pgetfi„R, getz g Ffind] '¿§— 0docÛ ¦getcomment¢ @docu ¬M= ’� - determ( º  Ï a×Q cameô@ Æ2tre<rarrange=e® ê°o represent8Åir hierarchy”argvaluesÌ  U&rgÌ  vKàfunction argumò4ents
    getfullargspec() - same, with support for Python 3 feature@ ñ formatargvaluesA  Ð an argument ] p �outerfram/ ,‚ 6inn   - Â info about , ? qcurrent l ƒget the  b stack2 1  •(), trace3 ^ 1 onH 0 ‚ or in a5 Rback
M @ignaü H 4a S b objec,’ rallable; âget_annotation(àsafely compute0C 7's + ð
"""

# This module is   f ñ<public domain.  No warranties.

__author__ = ('Ka-Ping Yee <ping@lfw.org>',ã   ô'Yury Selivanov <ys ñ@sprymix.com>')

im'5abc $st 4dis acollec.- Denum# K Õlib.machinery utertoolO ”linecache" o r %sy utokeniz  < Etype* uwarning Ifunc{ ðbuiltins
from operat6	’ttrgetter  ø  á ð	 namedtuple, OrderedDictêñCreate constants í *‘iler flagñInclude/code.h
# We try toEQthem ¢ 0dis Áavoid duplicŠð
mod_dict = globals()
ð@k, vfñdis.COMPILER_FLAG_NAMES.items():7F ð ["CO_" + v] = kÎ DSee § àP.h
TPJ ðS_IS_ABSTRACT = 1 << 20


defÁ 	3tobj, *,§ Ó=None, locals ãeval_str=Falseœ C"""Cc E[ ù  í #an¿.¯ãobj may be a cÊ€, class,m‰.ý @PassU 3H à of any other \ó raises TypeErrork ‘Returns aŽ .“	ø 5) r# 1new' @ eveç1imeƒ Ait's¨ 1ed; � ut twiceÜ3ameç S willX A twoE Pdiffe_À but equival¾ ' M ‡Ðion handles s� ’al detail²Byou:Nt  * If ž ¿btrue, 5 ,"1str™ Ž  m ñbe un-stringized ui I B(). etended9  Ô3useÆ@ ý, !(""@__fuÜ$__£- "")ëÊ  ±doesn't hav¼. £,_ Íl Qempty P.  (FV ô and methods alwaysX ; ` ;Ž3es,!s,G rEs of? àcallables may qnot.)
  ò"* Ignores inherited annotations on classes.  If a > ù  doesn't have its ownA ðdict, returns an empty  .F  * All acceh ð to object member6 d1 ó values are done@ ò  using getattr() an1 ø.get() for safetys ˆways, al © Ð freshly-crea² s ôeval_str controls whether or not¨ €of type +  ´ �replacedE ðwith the result of callÉ  `  ()|SthoseO !:
8 0  *‰ $ „ �is true,  Q() isH  ed@ 1‰ !If3 E pfalse (’ “default),z  œ 	É ¢unchanged.” bglobal©1loc @re p9@d inÔŸ Q; see÷ rdocumeniÚ  §& ²±more inform��!eiir 3or q !isE ð None, this funcÆS may |C tha  ‚aÅÁext-specificG , `ingentP Z(obj)�0objx¤a module, Ÿ G s`obj.__G)__†> j= ”  ±Bsys.e "s[Q  5__]] ÿ8 ‰  ã t o ¯ namespace” _allabÔ î 5__,p °although ifÎvwrapped™(¹5 ±Âools.update_1 pr()) itD ‚first un d³ 1"""C Ðif isinstance¦,!):  >#¾1obj‘% ==dobj, '¨0', Q. Ï 5  f1hastJ w, 'get't  x Pann =9 –7'__h-__j  8 
Ò 2annÒ ûs.GetSetDescriptorTypet  @ x  Â Felse% &  Ï Ö! = p 77  Ï #if_: 
‚ 5 7 = Þ% 2 ‰ º T 
O   
Á P à	 8 ;! =tP(varsM)€Ò*elªE ,1s.M #=  ¯ ©§ ? ! « ¤< h'µ À  obj_locals“ = None
  hunwrap õelif callable(obj):. ó# this includes types.Function, tBuiltin XType,C 5 % aMethod#   fH ×ools.partial, èsingledispatchP a"class+ ñlike" from Lib/test ð_inspect... on and …it goes.œ Ðann = getattrû °, '__annotaá Qs__',@)4 ¿obj_globals<   8 2loc7 “1objg Felse„`raise 2ñError(f"{obj!r} is not a module, E, orÐA.")
T 0if î !isÏ ^ …eturn {}'  S ÷isinstance(ann, dict“ [Value” .?¤ �either aG A nor„ š  s ?ann– �eval_str(  Ÿ  © ì ç" o5 —while True aif has?  /gped__' /   ( 2 = 	 5.__/ v $  vcontinu‹  7if lF {  Mt Ubreak+ ö  $"_â;__"{ 
ÿ± .0 G
 
 '= L � 3if "§ 4  j rÀ _vŒv = {keyê !if'h p, str) m Z(   ,Œ ú‘for key, )   iX±n.items() }Ã �   – o


# - 'eÀ-checking
de3ò ³ešA"""RÀ true if thee0ect‡(.:M5  �s provide4 0se fibutesN`__cach ºö  pathname to byte compiled filçr__doc__4 ¢   documenb „ Ö   __< .   d @(mis †bq3-inùXs)"""ëdobjectªô  L#)
J4I5 HCŽh Gê#ofù  „Rwhich§– ð  was defined"""ó#
    return isinstance(object, type)

def ismethod !):; B"""R> Âtrue if the ? t is an U  @ !.
9 Ik  3 �s provideG Òse attributeso  ® p__doc__  ñdocumentation stringc   f__name.   ô with which thisƒ ·was defined@ 7funn   h ã öcontaining imple‰ #ofX L FselfŒ /toŽ  ±is bound"""B ¥1s.MžT±¯descriptor»À  A ¼pBut notîÓ) or isclass( -p() are "B Twðis new in Python 2.2, and, for exaR,G ; ñ of int.__add__.#An:P pass‡Òötest has a __get__K# b¿   s J k,! °beyond thatŒ@ set� & µs varies.  d!isJ ñusually sensibleÔ  ·@oftel
·s>ged viaus… Aalsoå @ one‹ iAtheru  ò sÊ¡false from¼ ¥É0() 1 0, s¶’y becauseJ  Á X # ’òmise more -- you can, e.g., count on hav€G  __ÿ	y (etc) whenB ¸&es_$).òiuQ, WHÍx l  ˜ /ñ# mutual exclusionæ  SF. Atp =ôG  ' 0hasþc(tp, "V ")° Y"<GdataÐ ¦ D > ;:Dat(Ahaveò}   ãPdelet ¾ MB.  E]s™å Ãproperties (šæ `getsetÔŠd member, "C)”PTypic,¹ qs will Ë­ ;5and"¨ O(› #, „ S… K Cboth	9)Ð é  vßot guaranteedp”Ô"ká n if÷ B(¼Qs, 'M«DÐType'):
    #ñ, CPython and equivalent
    def ismemberdescriptor(object):$  ( ò"""Return true if the ' b is a D  E %.
> M`  ùs are specialized õdefined in extensionL µmodules.""" r› £isinstanceÁ ‚, types.€ Dà ¢Type)
elseâ ñ# Other implementations` "ºñFalse

if hasattr(!š, 'GetSet#'#Bfgetsetý�A BD 
B B\BÂ "®B@func*
î,Tuser-æE îFT ]�s provideq0se µbibutes» [p__doc__  EdocuÆq stringÌ  f__name.   ô with which this ” @ was$ �B 7codB   ® ö containing compiledM @byte- J ‚defaults� Àtuple of anyw   ñ  values for argÙ šÎ cglobalA    Õ PspaceDØ Cannoüp__ dict� §parameter   Ä (kwÆ 6 Õkeyword only C sk1 ÅÁ¹
~P_has_N�_flag(f,  qƒR``f``ªÝ(S¢ method or©Áools.partialå �wrapper   Ùa) °ion) whose ‡ 0has«� given ``– !``J 0set�1its¬ ÄQwhileˆ ‹ #(fÆ  á€f = f.__µ !__G   &« 0_unš _³ ð(f)
    if not isfuÃnction(f):
  Áreturn False  ðbool(f.__code__.co_flags &  ó)

def isgeneratorfu^ 3obj` B"""R_ õtrue if the object is a user-defined K  L !.
“ Gd  E ‘s provideY õsame attributes as0 !s.I ´See help(isc ÷ ) for a list of@ A."""6 B_has õ(obj, CO_GENERATOR”coroutined  , > ½ CW  ds are ?°with "async ‚" syntaxú Ì •COROUTINEÌ O ?genË !!n > hronousßA³ & æ ¢ê ð and have "yield" expressions in%ir body_ASYNCç Ý 0genÞ?ectáo£isinstancea �, types./EType®B3 ” œl_ isfJƒ__iter__Y „×°to support ! aƒñ  over containerÅ 8 Pclose	  @raisÊU new • ¡Exit excepL 3insH ?  Â to terminat6” = !giç=  $  frp&  Ûòor possibly None oncm ˆ 5hasM D  åbeen exhausted' ¢gi_running* 0setÏ f1 whenÃ Z@execƒÃg, 0 otherwià < @next  â ž �item from3§ Dsend<   qresumes. ã  �"+ �s" a valuŸat become  ˆ  S l’  �current Ø-×Pthrow‹  @usedA  aO/4|ƒ	w³w9 ý	� „awaitabl+øÀturn true ifñ> object can be passed to an ``await`` expression."""
    return (isinstance(oK ñ
, types.CoroutineType) or7  ;   7 ’Generator7 9and8  < Cboolm ÿ.gi_code.co_flags & CO_ITERABLE_COROUTINE� ðcollections.abc.Aþ óable))

def istraceback€ !):ž B"""R´true if the[Uis a 9 !.
2 TI & �s provide: Òse attributesb  ø €tb_frame    ÁÑat this levelc  # €tb_lasti   �index of   e pempted Ä!ruü € in byteW	H PinenoE ð   current line number8 ìPython source B Cnext@ !   Vinner· (called byÔ )zB[Bº-¶5 – ¹F‚uµ f_/÷ ø houter ^ ! (¾ 1's %r)€¢f_builtinsJ  ð-in namespace see¹2H >  ‹:    Ã Â being execu	A cglobal~   }  l‚ ƒ% f_m‚ƒ Vf_locÅ   Å Á =    82fun57for9Ÿ, or None´V	° ¤¯ 4 
®4Codˆ­§co_argcoun©uÞð	of arguments (not includP*, ** ss& ð or keyword only1 P è!coÏ	9 0stre Âof raw compi¤ < dellvar§p  tupleð( 	 �cell variÙ°  = Fonst; = c aù u in¥% „0ilek Á  pof file"Rwhich*®¶ was createïO 8rst÷kQ #rs€?in y G ” À  bitmap: 1=ðoptimized | 2=newlocals | 4=*arg | 8=*
 /
  ‘| 16=nestI ÿ32=generator | 64=nofree | 128=coroutineS Õ256=iterable_5 Õ | 512=async_g K 0co_k Evars° àtuple of names	  # P vari\ s= ðposonlyargcount  number5 °positional # ™ argument@  kw ? @ {keyword= ð (not including **Y )” elnotabÏ à  encoded mapp4 sof linel �s to byte% y indice¤  N  ñ with which this > øobject was defined™  I g<   j�ther thanÔ -� and funcK o	T    � ·”stacksize8 Àvirtual mach! Ú space requirË :varÎ Ë fÃ � 1"""Æ òreturn isinstance(Có, types.CodeType)

def isbuiltin' !):F B"""RI Âtrue if the J a is a 7 6-inK±or method.
D BY " s{$ �s provideY Òse attributes�  Gp__doc__  1docÃaºastringj    __?. Porigi+   >Tø­ A FselfA @ Í–aà  ïbound, or None}3inF~	ˆ”ˆpny kindá Ü .˜ (îþ  CTor isF ˆ " Á  ¤descriptor* r„abstract òs$n 9 õ base class (ABC)é 1if ÎþÝ ì 'BFals#ifßò.__flags__ & TPFLAGS_IS_ABSTRACT® D 5TruC } 1sub� (sæ ß, abc.ABCMetaŠ 0has; T, '__ü ~Gs__'D ó# It looks like f õ.__new__ has finished running;Ú#ç õ should have been accurate.9 Eˆ ànot finished rñPunning yet; we're
    # probably in __init_subclass__. We'll look for abstractmethods manually.N ð for name, valueS ñ	object.__dict__.items():0  ‚ ±if getattr(5 ‰, "__isai §__", False:  > ¢return TruÐ  ‚ :bas{   6s__t  &  ¨  ¡ }  % | 
z s{ +()x « % =» ç ,þ UNone)â  ¨ æ + B ê  A

deG„members(� ¡predicate=“ B"""R7Call 3 r of an 9 P as (!Éñ) pairs sorted byè .â óOptionally, only ™ X õthat satisfy a given ˜ A."""G Qif isv½ qcmro =  @,) +w3mro jBelseà  .3  Áresults = []m òprocessed = set('  ñ  % 9dirZ ð# :dd any DynamicCðAttributes to the listGH $ifMQis a Û ;~ �# this ma, š  ‡AduplªÁ entries if,sóexample, a virtualF  4‚ Q withƒ Asameœ Âa° q existsE 6try4   � 0.__ 	< ^ * @k, v*  ! ß /   àÿinstance(v, types.Rû ;  X’.append(k´uexcept �VErrorÓ 2pasé ² eåG # °# First tryÉ1getJá0vial jñ
.  Some descriptors don'tI ¤ °# like calljðtheir __get__ (see bug #1785), so f€xback toF 0ookA !inŠ ;# 	¶ z ­ Ž2key' %   �# handleY s5key]  ' Bif k-*1 !   [raisezF ˜ @  “ = E>mroa †  ' d)  N 	+ B[keyò #  Ubreak®   
@    ð# could be a (currently) miss¥CslotD , ! ågOI  È°r__; discarR™d move onŠ  / ccontinÕ  fif not9 l F:7ð results.append(ó (key, value))
  Ðprocessed.add#  Àresults.sort Ñ=lambda pair: 4[0]+ Sturn 2 õ

Attribute = namedtuple(' @', ' ñ kind defining_class object')

def  2ify Á_attrs(cls):Á Q"""Re~ €list of " } Á-descriptor � 1s.
4 �For eachœ q in dirS w, the rP Ñcontains a 4-E B @with, Âse elements:\  Tb0. The^ £(a string)}  ! 1! ý ² Ð this is, oneÌ StheseA sñ  @  '€ method' ²created via9 (§ "  w'static< ;  < �propertys  Q <  t  Q 6 ð  any other flavoró % F or ¿t i  W'dataH s  not aÎ ‰2h'Rwhichl"edj+# (0¦3> �  a™ ðed by calling getF B; ifT @failÁr e¼ ! 7 U Adoes¼ @livePwhere“ ‰¸ ø' mro (includingP Ameta% 0es)�n @Ô is looked upR j('sM ¡dict (founá @walkª  ‰ 4mro'Ifœ` items] B v `stored < ¤ Á it will nowx  be discove/ 1and
`have N 0be Ô ed| K ë  X Ë P aÃ Ø ƒed.  Any– ¢whose homeî @ can'w ±re skipped.– 2"""A w=à1mro  s	 Atype v) # for€/s 
I W C ? !clQh i$@in (n ,âÃ�_bases = H @,) +6h 5all + +.Aamro&  � ? È P# :dd–� DynamicC ÅAs toq ¦ »E ;; Ë3may ·ñduplicate entries if,õ óexample, a virtualF  \Í sC sam\a—› r existsÒ •  ƒ 6mroG  @k, v  ! 0.__1__.Ø(cu Ðàisinstance(v, �/s.�  ) Ð`v.fget y Õ} V 5’.append(k©(Q = []¢‚ = set()¢ À  ?  À   "Q# Get�Àobject assocó!iated with the name, and where it was defined.
  ò# Normal objects will be looked upT Áboth getattrW ·directly inM õ	its class' dict (in case; òfails [bug #1785]¥ qalso tov O øfor a docstring)¸ ÀFor DynamicCr ÑAttributes onñsecond pass we onlya ! i  h ³ s´ d "  Getting an*Q fromd  __è ø__ sometimes reveals more tha  usE H‘.  StaticQ„ ñ methods are dram †examples› åhomecls = None¨ |get_obj £   !if(@ not¥processed:Q  &:try   ; D== '''  + ôraise Exception("0 ð is special, don'¤!ntXyproxy")‰  M â EQ(cls,Ç 
- ep w ~ as exc£  	g Nelse' ry ‹ @, "_uÀS__", + 
�  ½ $if s5 ^basess  3 A# ifQresulƒªQ doesG Aliveê
Ý E  °# mro, drop Rsearc3Émro manually? Ø ^   _last_™    x# first‹4/esw  AsrchX  P î_4 i 1 ó° .,:¤ =   1if 1  D  isÀ å¥ 0   þ < /clÒ #Òpn check  öametamroŽ ´ £     Ü =ç ccls.__+/__V?   bx_Error“  3 vcontinu±   vI5if ¡i; =² ð8   ” ‚ 7?allŽ"0in * .öp Ÿ	* [Å]t (FÀ not in metaomro:
   íhomecls = base# Ubreak 4if 0 zis NoneU ð*# unable to locate the attribute anywhere, most likely du2 f  ¦ ù# buggy custom __dir__; discard and move on8 vcontinuÉ  obj = get_
 &if Qs notÅ ‘ else dic% P ¡# ClassifyÆ õ
object or its descriptor.1 äif isinstance(P ñ, (staticmethod, types.BuiltinM jType))M‚kind = "=  > "m  & Ó =¹ /elŠ cÒ K ‰ å ‡ DÕ ‘ 	D � 3�propertyû  ö ¿routine(objV ÿ T  þ{Fdata( ô result.append(AÕp(name, ¯, ,  )­Ñprocessed.add1  rreturn Z _

# - ' ˜±helpers

deísmro(cls""Rr �tuple ofö: àes (including 3 3 inç ¢ âolution order.À ¿cls.__mro__Å )Q funcd 	Å punwrap(  , *, stop=}Ô X""Get¤ 0 €ped by *7 0*.
‹qFollows* Pchain:žC:`__5 6__`±"s â   Ê@lastJ &inL c *�  * is an opÍ ðal callback acceptN   QE  !r ™  d !asiÀsole argumenå Fat aÇ pR ð
to be terminated early ifM  ½ † Ô òs a true value. IfÍ ¬ Snever ,  K / ,,   ê Ç ¿   e ð
ed as usual. For example,J :œð:`signature` useŸ isB K á  if@
p  G s  ha¥ E``__P 7__`Ì‚ defined©p:exc:`Vû aError`´ `aised i ` cycle ”encounter; 2 ""þ!ifŒ %  �D {3_isS3r(fª ´  @ has}W(f, '€'
—S  À__wrapped__'ò() and not stop(f)
    f = func  # remember the original ñfor error reporting? ñ%# Memoise by id to tolerate non-hashable objects, bu� r 3 toK `ensure~ ðy aren't destroyed, which would allow) `ir IDsw ¡be reused.N ñmemo = {id(f): f} õ
recursion_limit = sys.get  (ðwhile _is_wrapper(*!):K = 9@#._% 5d__  0id_2 0 = ‡ 2uncX  ; Dif ( 0in ¯ ¢) or (len( 5>= — ° {  D  ray`ValueEœ#('¨ Ñ loop when un öing {!r}'.format(f)Œ  o [� ]Ä areturn_

# - ó source code extraction
def indentsize(lineÜ B"""Rv  …$  % ð , in spaces, atýÀ start of a C  
 �text."""À 1exp = ³.expandtabsáà  s+ G) -  ±.lstrip())
´ ¨_findclass3clsJamoduleR! 2.__ "__o0if . vis NoneJŠ   º  p@nameõ  Cp.__qual ö__.split('.')[:-1]G  \ ð = getattr(cls, 3 |  þ"isÁ 3clstLu� ‘ 7clsú sdoc(obj7 4if L   L  ½ 1bas½ 0objFro__§  % 2if $ s” 
#  ' >try   Qdoc =C g.__docw    ò except Attribut%N �continue} <  0if j i¦  A 05docC   4 
 1gmethodG j  ¥  =%!._3P__.__ × 0sel®R   OÙ  íu  _     & ,ŒD), '| Y') isŽ ó I   !# DÌ 	g ‚ ]  7elsê ? % 1.__J Ë !el$ ò (&	S   “ƒ 
w h$ ó   :objãÈ ¾ ¥ builtin¤  æ  ö  U Á 1 	� + '.' +ã$ =?(à):
           ÷ # classmethod
  ¥cls = self Uelse:  , % 1.__J !__! ð# Should be teste
 ñ	fore isdatadescriptor().2 öelif isinstance(obj, property)w ñ func = obj.fget<  ‹ pname =  0.__ ‹   ¨ Q_find¦ (' )< 0if " ð	is None or getattr(cls, M €) is noty �  \ areturn: Q É Sè @obj)[   S  m à Ç  û Q__objË æ /if¸ ) Ì ƒkmemberº ¡  ( @slot	'1'__ A__',a 4 \ ß* ±, dict) andeA in  
n  > f [$]m“%  Å €for baseX ¶cls.__mro__^ 6try  g  do]×  < ÿg.__docmúexcept AttributeErrorM �continueŒ  ^ 0if a J § 
1 À 1doc3   ( A

deÞ0doc3ect """Get the\ ðumentation string  an·Qect.
Y ðAll tabs are expanded to spaces.  To clean upW L `s that5 F PindenÚpto line, ñwith blocks of code, any white_  E rn can bñuniformly removed fromÒ bsecond^ ponwardsˆ( A."""Š 	Ç b  ð ¶²n
­ �©	m  ) q ]ž™   w (*R, Typ5É ,   ˆ   x@doc,ß9 5  Ä • Bdoc)D	 Ö D"""CíÕB‡3docþ=ÎtÎ ÊÎ Y jBdoc.ª ¹Ò().split('\n'gg0UniuŽ É~ 
Êø # Find minimum !of¾‘non-blank‹Ñs after first Ã ¾`margin:’ys.maxsizæ   Œ Ñ  �  Rs[1:]„     4 ent = len(%  .l€2p()è  %    ´jontentA  šD C) - Z Ð
            ò    margin = min(  , indent)
!   ƒ# Remove eation. •if lines:  4  R[0] = ¶[0].lstrip(Y $if� Ú< sys.maxsizeJ ñfor i in range(1, len(` 3)):^ ii 2i][É %:]’ Â ðany trailing or lead RblankL Ú Rwhile ‚ and not J[-1]¥ � 8.poÞ ? 0> 0ô return '\n'.joió ò

def getfile(object)� ð	"""Work out which sourceé �compiled 7 B an : ñ was defined in."""5œif ismodud  Üi€ Cattr€ P, '__Y “__', None’  .   Ì t ., j  òaise TypeError('{!r} is a built-in � ƒ'.formaty )/® Tclass  \ lif has­ N ;__'©  " =� Ds.gep 2.__" "__z  b   !  6 2  # #ifª{ 0 ==qvmain__'ë  0   rO#OSMAcodeÃ¦available'Ä 3 ‚a�nmethod‚ö& =É afunc__ÿ»   U<  Ç < Ÿtraceback= ‡tb_framey   9  f_v 7   6 Îï 1.conp bö!, W", >$, ,¨Ú !, · ,È'†  æ '’ `Óõexpected, got {}·? 5typK0.__´ E__))k«   S(path4B"""R¤3the  %  ³qa givenpº  `f( P= os.R P.base ` ¥ q# CheckM  $  s that loo© keÅdactual|  ‚; àsuffixes = [(-/ 3), 	 ' B   ·    oò	importlib.machinery.all_" Bes()` ó.sort() # try longestp €es first\ñ case they overlap�  } dneglen¥  … ] å1if =¢.endswith($ • È   �+ 1[:nY ð ]
    return Noð"ne

def getsourcefile(object):
    """Return the   òname that can be used to locate an B 2's V .J G äNone if no wayD ‚identifiJ 1geto ? 1"""G ƒ =·   ±  ð8all_bytecode_suffixes = importlib.machinery.DEBUG_BYTECODE_SUFFIXES[:]
û K +L ŸOPTIMIZEDP pif any(³  Dÿ.endswith(s) for s in u Œ • > õ = (os.path.splitext[ a)[0] + 4  WSOURC 10])< /el³ + c l•EXTENSIONgÕ rb N 4if Ü fexistsÚ – o 5 9 s# only  aa non-B 6ent½!if^ñmodule has a PEP 302 loaderM m  h j,K (iBRattr(( R, '__J P__', Ù �) is not Æ x1getR  Z £"__spec__"X 2, "k  i p# or it1 iá‘linecache‰ a ž .% Ç W0abs@ 9_  þ=A dÀan absolute Û W x	 ® �compiledƒ7p!.
µ €The ideaÖ  WCeach’ O òhave a unique origin, so this routinþ ¡normalizes/àresult as much ”possible.œ5if á    ä ã  ± SÔ  )à 8get Ò Ï ˜ Ecase 0abs-(a B))

00sbyO a = {}
  `sbymodƒ ª0 ‹ ,È © •2 ðÐ was defined U!oríîxt found,"isC u H if© d@ >__'< Bsys. Ss.getd 2.__ "__¼Q# Tryà (2to $  éƒ B ÍF and0 '? |Èš 	. [c …¡ Š p again 8¶ / ¿  › ¬ 6tryx  tð absfile(object,ñ  _filename)
    except (TypeError, FileNotFound !):+  / ±return None 0if P Ð in modulesby 2 Csys." S.get( . [3 ]‘ Á# Update the\  ¬ 3 to`   ñ
cache and check yet again• w# Copy s    PorderI ñcope with changes while iteratingE 0fors  o ,	 u" nU ç.copy().items(%aif ismè )¬ shasattr A, '_�7__'=  f3f =s .# ”      v2 ==Ì`sbymod¨ Y  ,¤X  < ó# Have already mapped thiss É, so skip itv  > rcontinuý    Æ ‡ [� Y] = fB  Ø `getabsñ÷ H   €# Always™  ­  Ð Tù knows itself byc # † [f„ 
 	.  r Àos.path.real	 6(f)6 0.__~ !__7  x*î8CÁ ç %maFn  =r@['__ A__']# tif not YaobjectY¶ Y» 8  T ", > ò <    0 = ÁÆ>ain5 —  W7if 7 #is_  % ”  ) 9 "# �builtins    sÏ  � } # Õ  ; Š  ³ 3if % = Û ,  


class C [zTion(E
 sEpass1 _2 ñ	inder(ast.NodeVisitor):
˜ Ðdef __init__(`, qualS  º   ¢.stack = [A 0 % =; \ vo Ã_FunctionDefe Onodea .V0nd(! .‡ ¨ n † % ¦'<locals>'¬ �generic_ L ! G Opop( z C g_AsyncÇ 2 =   ö ó +1if Ð d¡= '.'.joinJ–J )2# Rm  decorator ˜  Ošif presen«2de.7 Àtor_list:
    ðline_number = node.decorator_list[0].% 8no
9 Yelse:    ) N   9no
+ ð
# decrement by one since - ðs starts with indexing( :zer…  / o I-= 1e ÷raise ClassFoundException(7 )3 ðself.generic_visit(! òstack.pop()


def findsource(object)ò"""Return the entire ) ’ file andê  Þ  “  ‡rfor an N .:�The argu3ðmay be a module, cå à, method, funcé ñ, traceback, frame,ï tor codeb    ^ ›  Ais r¼ €ed as a 	q of allÏ  ¯ sL ià Ò  í   Í ÀeD 1ne / !atQ Ò.  An OSErrorM !s ¶Ad ifh • `cannotù Òretrieved.""" € R= get3   �[  ªl³ð# Invalidate cacheu qneeded.3 Ñ a.check (] 
   …  
 	  L q# AllowþPnames@formZ@"<soÀöing>" to pass through� ð# `doctest` monkeypatches `v      F eenableÏ s# inspegso let: @.getG  s`< b(ll0if „.§ ¦Q('<')Ñ ù R.ends 3>')   àõ"('®� Z Pavail³ "')ÙãV X,H‡#if{ h Ç ! =RÜ ½ ,1 ’.__dict__I 
ÐD 3 ,  ç Qcould;4get kç Yif isà 8ŒË Bs, 02 ù1 @qualb$ =ä$__ %__}‚= ''.jois×  Dòtree = ast.parse(1 !  _> _CˆFó$r(p . 6try! ` ? .s s 2 e³Ä —Í N  ‚µ= e.args[0]î  $ 
J2 & 
4 H§&('Ë ø {p definit
Ñ‘ Ûž ³šÙ   O <  H< õ= À        objeñct = object.tb_frame
    if is ( !):    9 Wf_cod7   6 ãif not hasattr  ÷, 'co_firstlineno'h  l ñraise OSError('couldH ðfind function defini %')¨ Flnum¦ 
h E - 1)  pað
re.compile(r'^(\s*def\s)| „async\s+ ñ.*(?<!\w)lambda(:|\s))|7 '@)… awhile ‹ 6> 0E Ý :try    0 =   s[8 ]¨   Áexcept IndexB 4 J ÷no is out of bounds¤  X Ðif pat.match(3 ‰ $ YbreakŽ     ­  jRbreturnÅ ,þ 7 š Î 8�ó')

def getcomments2— b"""Geta  Ô & ô
 immediately preceding anY �s source n !.
— R® µs None when$ �an't be f3.- 1""" 	½ 1sé 0 = œf µ 2 »(Îa, TypeÄÕ  d: ‹ � ŠdmoduleN óÓ# Look for a ð block at the top   BfileÄ  i @star÷0œ   #ifP2and
 ô[0][:2] == '#!': 5 <à Q< len=6s) E  ü].strip() in ('', '#í) # =f +¢#if c 
3[:1¬ '# Ú [s = [O$ndq  2 × Oend r Oend]p  B t r.append[7 Ö.expandtabs()¯ 5    u  =    „''.join(b ))	û$ofsÀsame indenta: el Ð	¯( # =1 CsizeÒ  ]Æ  ¸ =ò	c!ifÒ G>= 0lN# \‘� x  < )š ñœy.x 
© ¬ €Ü   ì    � Oinesr 	Ù  ; nA à ú  O   M Ps[:0]÷ ð ]
               `end =  B- 1
 
 !if ¯< 0: break& ùcomment = lines[end].expandtabs().lstrip()? cwhile = Us and C[0].3 ‰ == '#':;  ¦ 9 ™[:1] = []" ] 	/-1^ ?-1:_  ô return ''.join(Œ ô)

class EndOfBlock(Exception): pass#  bFinderÝ ñ"""Provide a tokeneater() method to detect the™°of a code bl A."""òdef __init__(self)c  8  .w ²00  ú slambda = False `starte5   Ü   ;  q corator! #de hasargs& 0lash®Î ñbody_col0 = None
·  G * r, type,^Ä, srowcol, e	  Á ,pif not ; .ý  ¨ × b Nµ# skip any Ú s—     "if‡  á:"@"?  ! v a f = Tru“ $ ¡# look foráfirst "def", "‹b" or "Ö 8   %elƒ Jin (6 ,4  6   8 %==' À  * Ä UÁ % _å  E _ E  8 d!toü  È!of  Ælç  ¯ (j"ifßiË ‚ È¢ Š i )i &‹  ø   ’ 
™ü 0ypeeºize.NEWLINEç Q eI ‘   # stopÎÃping when a D … is seenœ ªc*[0Ÿv:8 n ª�s alwaysæañÝy 	q  = Wraisex	! `# hitt¿ º É iÌ Ù� without �A Aends]. 	! Ñ n  Ò* >
~ Â ‚ü	Î& ¨
E   • -  îûÀenize.INDENT7:
  òif self.body_col0 is None and zstarted8  C 9 É= erowcol[1]d ( ‚indent =T  >+ 1* õ passline = True! úelif type == tokenize.DEDENT� q -q ò# the end of matching ž 1/de³ Qpairs$ ua block’  ò# (note that this only works for "def"/"class"A +s,C ’ not e.g.2 °if: else:" A Ôtry: finally:C )C Çº Z <= 0 « Éraise EndOfBÈ ZMCOMM[i 	0 ¾ 4# >î- ” ó# Include comments if�ðed at least as much  ²ˆ á øl/ 3= s‡ 0Œç $ 'A== 0èV Æ Ein ([,m:NL)Ã ²# any other& 1 onSCsameÇ ±ation levelF À ‰previousÅ# ä °well, excepV‘e pseudo-œ #s š ¼ 9NL.F æ�
def get4(ZsÆ ’"""Extracd !  	@code{ ª 0top    given list I A."""~ < fXAr = _F (© Ä)  ¨Æ Æ’generate_ S(iter« ’.__next__I  @  W* 2 inxs˜� .S  eaR *6 J ^(1, I¦²SError) u  —Â PreturXnes[:j  {$]
pasource's(objectN B"""RD aN-  . ×v �  q number2an N !.
� €The argu=ñ may be a module, wà, method, func� , ÷Âeback, frame“1or ýb    ^ œ  2is   �&s Á  ! « Ó correspondÃ !toU Þ . Ù àindicates wher: 2 à @origü ‡ 0filnqe first2 �ž  wat±und.  An OSÅ" i• d`  O 8 0canþ beÝ erievedÚ¶ „= unwrapËœ ñ €, lnum =£dV % &  Ñsp ±b 	 A.tb_“à#öÐ  ofEs toôr]$ll4Àlines
    ifó (ismodule(object) or
  v(isfram Band ( ò.f_code.co_name == "<J U>")):D ñ return lines, 0 Melse" ‘getblock(+  [lnum:]), 	 õ + 1

def getsourc” H B"""Ri Àthe text of  .  ­ t for anÂ 
Œ òThe argument may be a Ê ñ, class, method, function, traceback, #,M "ori $   ^ ‚ 2is ñed as a single string.  AnI €OSError 0 ~aised iÏ `cannot± Ñretrieved."""A E==6 ë) � ‚ ''.join}o)

# - /€ tree ex# -¸@walk (R óchildren, parent4Êåcursive helperwÁ1getD N )ñ Áresults = []Ù % òes.sort(key=attrgetter('__âq__', '_ÄQ__'));  (Bc inÐ "esd f ó.append((c, c.__bases__?  ) 2if B æ C   G . V[c], !cY ¬> ê 
  ]Æunique=FalseYqArrange@give—s*9 ð into a hierarchyFÒnested lists.5@Wher'  ôars, it containsAÑ derived from q mñwhose entry immediately precedes/  } t.  Each+  >q2-tupleH t Ring ax  ¯!a #  É @its ª bes.  IV'0'I ôis true, exactly on© í  $ e™ edÈRuctur“  He³ î - zÃ.  Otherwisel@es ud multiÜ ±inheritanceÕ ótheir descendants willƒ; e times"PQ = {}ê Groot2 ¯ µ ö÷ Îç
Ì 6 Â á 
'  ÷#ifì ¸ `ð+  / ± [_ ]Ü    œ P 2 X ÎcþY   2if wˆ ç "a breakM / (elŽ _
ƒ  p A6} w  { 	Z © Ï œ dÐroots, childrïen, None)

# - ó argument list extraction
A õs = namedtuple(' Õ', 'args, var	 Ðkw')

def get ð	(co):
    """Get informae ¥ about theˆ ñs accepted by a code object.
G ðThree things are returned: (q � �), where= ² A' isu ô %of} é õ s. Keyword-only m E ³appended. 'û Q' and 1kw'•  Ô  7As ofl *# "**B ]!or½A.""" �if not isù < @ðraise TypeError('{!r}Ë  1 	*"'.c @ )6Œ ±= co.co_var s n6  ‚argcount )kw  kw	#    K(T ![:Q !])B 2  H% $ * "+nf 2 „step = 0¸ srgs += % U v! =< #ifÛ òflags & CO_VARARGS~ B8 
[Ž ]I  (  ø} ! 1 _varkwt zKEYWORDx : v Ä ]Ê6 + ?×
£ASpec© 	¡  Ÿž" kÕ«s defaults©Špec(func®È â; a valueÛ a 4  ÍÓ's parameters¬!A 6 Dfour¶/isµ¨ ,© !).€¼a®ZÃ´, includingó 
ÈåS À{ Ãè  ÀO  sbUan n-  I ?  glast nU =EThis^ èñdeprecated, as it does0Ñsupport annot\As or• Õ ¢�Rwill XVÓY  if eitheru Sprese!onË m Ólied callable± ñFor a more structured introspeWÁ API, use in `.signa*  () CteadO ÒAlternatively5 pgetfullt ¯0) fs nV ñ  with a similaræ´2basŒ Àerface, but L  Î  ;K ? ð<G @¥ D”ò since Python 3.5³ `é ¼ `Öù@warnÓ.	 '("6 î i½ðprecated since Píython 3.0, "
  õ"use inspect.signature() or  getfullarg' O()",I  ñDeprecationWarning, stacklevel=2)4  D U, var	 òkw, defaults, kwonly   qann = \H  È — Bfunce 'ifH  É Eann:7 ðraise ValueError("Func¸ Ð has keyword-ˆ ³ parametersG !otâ sK ” o   ", TòAPI which can support them"º ò return ArgSpec(.s)

Full- ÷  = namedtuple(' '¯'N |û �')

def fQ"""GeØ “ Ts andä  vy÷	s of a callable object'sq!.
²!A Ñ  0 òseven things is -"edu -ß !).x .'g `a list� 6the¡ Û - £'ê °'varkw' areÜ) @ *# &**I [CNoneL ñ} En n- �  H  glast nU M D úO Ì ç¬ 	< p s@ !di+²ary mapping4 X fromw$toósP 5annDYM  rW 7to 8 1Not7²differences€ É 1  -Œf"self"(ˆ @lwayO ŽAed, hñfor bound methods H àwrapper chainsæ ¢ined by __ Ãd__ *not* un � automatiôyL """F4try¥ á  # Re: `skip_ ±_arg=False`6  f#
 a ThereÇ  _ Nû in behaviour betweenºL  ¨S:1„former a$  0s 'G'G.N 80, w£ !asP _ S Bshow aactual7ingI —Ecpassed6^�o simulat…&isÚ, we "unbind"ã§, to trick~ T % 	 Ù ‡ir first(m~  ’ usually)Ü ðcfollow?"r_[÷	~‚) histor_À ignored __wórapped__ attributes,
  õ# so we ensure that remains the case in 3.3+
6 ösig = _signature_from_callable(funcc j  �follow_w§ @r_ch| o=FalseD ïskip_bound_arg= tigcls=SÍ v ‚eval_strp )�except E ¡ion as ex:  ‘# Most of^utimes 'H÷	' will raise ValueError.? óBut, it can also- AÜ1 ÷, and, maybe somethingF ðelse. So to be fully backwards compatible,—catch allB @poss!  ò ‘ions here{ 2 reÄ \a TypÅ   ä('unsupported E0') U2 exw‘args = []„ 3var DNone Ukw =  sposonly( 9 .kw qannotatÃ A= {}O pdefaultt (Û'kw "{}— æif sig.return_J q is not Vempty% 2s['9 A'] =+  H f �for param‹ p  peters.v'6s()a bkind =1 . Ñ  ~Ename   _   0if +  ¸ ö_POSITIONAL_ONLYZ  ) W.Z0nd(J $ !   #if 3 W  ¸ . 1   , bs += (*  ,^ /elª šR_KEYWORD°   © o7VARW
¢ Í I­
ê Ü ‘ Óç <ñ[™  ¤	–ª  ë ® è ¢ M 	yV .+ s›  b !if‡Ë “ #çÀility with '¼6.__1 5__'é  i e ­sc / a  	_ × FullArgSpec(…0 + ã#, G	 Àkw, defaults?,
  ó.kwonlyargs, kwdefaults, annotations)


ArgInfo = namedtuple(' @', 'B A var ñkeywords locals')

def getargvalues(frame):˜ Ñ"""Get informu ñ about arguments passed into a particular H !.
H !A ™ ð of four things is returned: (¢ ,« 	 3kw,ª !).H Î '8 `a listQ 5the� s, õ ð' and 'varkw' are 2  .s? *# %**H “s or NoneK / y  =  @ dicˆ4aryI Sgivenú 1"""´ × # =to�.f_code)1  Ä^"f_‹ È¦"( à, base_module=Û ãiÿ9ttr. #'_, A__',Ò) == 'typing' º® 8repA £).replace(2 .Œ'á Ùif isinstancev ótypes.GenericAlias¦ j sª R D 'ifA.ä ù  in ('builtins'.? ‡ [p.__qualR!__Â' ~__+'.'+A 	U®æórelativeto(object± n k à /, Ü ·  _^  X Þ - ", € ¡Ñ ^ 	Ò jrgspecñ«  º  “  ;0=()> J6 ){}E?={}„Ú org=str! dq=lambdaq: '*' + 9 
,kw7 8 4lue8 ²@: '=p ‚ )w ˆsA °text: ' -> C   < ±=‹A"""F)5 anL ÕQ fromy¢ ø0 by@full)3pec3ÀThe first seUr Ã
% $, åÅ 	@).  n –other fivPs^ q  ÷ñcorresponding opý"l t 1funPs tha&±e called toK  íÐ names and vað.lues into strings.  The last argument is an optional
    func õ to format the sequence of? 1s.
3 ÐDeprecated si$ ñ Python 3.5: useA ¶`signature`d eand `S N �objects. 2"""d �from warnÌ q import    2("`± €argspec`ß dœ h. Use ˜  � "x  
  "ù Ÿ  › ¶ directly",, BionW¦  Òstacklevel=2)± 3def_Àargandannotaye(arg):Z †result =. !   i�F in C s?  É C ”+= ': ' +K s  us[arg])_ rreturn C   [as = [] §if defaultv Sfirst ` = lenµ As) -  sg `for i,V Æ ’enumerate2 Ê  x 5�  ñ ”  ÔXi >= ” V  / Z  dvalue(© I[i -A " 7 �s.append( Ö `if var‹ ‡†not Noney  * 7 ¸0 (  "))a 7elsO �if kwonlyr f ß j 2'*'? 1  �I  � ßV �6 m  1   u YŸ- p   
Ê  C  8$ +§A 4 [ 
È; 	 H � ª/kw¨/kw¦$kw¤7P = '(x‘', '.join(�s) + ')'·Bif 'l'ÌN ý 0 sŠ Ä(> [V ]75 Ñ
ˆNsy,¾	 §kw, localsÖ S ²O=str# 	Äð=lambda name: '*  ; ,kw9 : 4lue: ä @: '=t Qrepr( )sB"""Fö an“( - ƒ !4 3 "s LÂed by getarg  pvU fourN os are f
)®OnextA  Š ðcorresponding optional forñHmatting functions
    that are called to turn names and values into strings.  The ninthF  argument i4 0 opa %all  W ôformat the sequence of ; Qs."""M Àdef convert(‡ ’, locals= ,%  ¼  Z Earg=
 ",  ½   %):? !reê ) 1argm 8) +; (t [ˆ !]); ¡specs = [] ÷	for i in range(len(args)i 2 „.append(Ú  % B[i])U `if var   	7 ¦ $ ( ­  
\ /kwZ  kwX /kwV $kwT <ñ'(' + ', '.join(³  @ P')'

É•_missing_è0(f_N,ú 	 ss, pos,h7  eCrepr™ j   m0arg As if«@ not äsšz 0 = •/ m 7= 1! =N 2s[0C Welif , 2, 1"{}#B{}".¡'(*h Felse1 ¯tail = ", 6 C[-2:e Û3delŽ   m   |B", "ro 0 + _ $ õraise TypeError("%s()Å à%i required %s„¹‘%s: %s" %C  g  ³ƒ. R"posiû"š@pos ÿ  "keyword-only"? 5 d S == 1> ss", s))R…too_many–  7@, kw]  HHð, defcount, given  Êbsatleast C 5) -4 R _> ( @[arg  9 p#  ì   #inÆÆÖPplura	� A!= 1o  D0sig$2at ž s%d" % (, ,À–Þ aZ LTrueR afrom %àT  ^ ¶U  D&  ±  7strú| _Ñ Ú#if¦T» !ms÷  	@ aš  (‡8%d E  )]  ?	u (V Q% ("sXÇ ½ V"4Ž – X 3   F b M É~Ptakesp!Á � but %d%" Z ‰ëDsig,‹ ›a"æ¢  * Ð
            ò "was" if given == 1 and not kwonly_ ð`else "were"))

def getcallargs(func, /, *positional, **named):
    """Get the mapping of arguments to values.

0 ñA dict is returned, with keysG  v  l  E  p Às (including' 
M   of ! *ä %**8  s,Qany), vˆ , ñrespective boundN   ffrom 'ò '= 'l ad'."""-  @   =/"fu/1pec2)   AU, var	 Ókw, defaults,ˆ ” `ann = b K  f_| 0 = !._ !__ Aarg2· b = {}
c²if ismethod‘ Á = `self__€ BNoneÈ OÀ# implicit '( ó' (or 'cls' for clasY %s)g‰  ? 31 = z 0.__H v__,) +   3 ænum_pos = len( @       +  )ð  Ý0 P@min(V Ppos, 	 T  Ý Ãi in range(nÜ Õ b[/ g[i]] =Ê 1[i]Í $ifìO;  ; Wtupleî B[n:]Ù °possible_kwk  1et( +/- p /kwn  kwl !{}œ  Þ  })!inP‡d.items(ë Qif kw% inã Ž h  !if' 8var‚     ðraise TypeError("%s() got an unex{ edòEwordIa %r" %³  G  ( C)* 	qQkw][kø 	W …continue û  inŒ Q
ñ Ó ƒmultipleæ(¹Ñ Í É Â  z8>Åà Ïh¼ •_too_manyh  P ;  5 >,]!  p >  €• <%  Y … Preq =Z4s[:x! -) o E k  ­1arg�&eqE   iY{« ) ”_missing_Šs  req, True,’ ìÆ  9  ~ i  � ‘enumerate†[¼ ':]D E § G \ ±VÇ A = 0� Ÿ  ž 6kÀ       if kw÷arg not in arg2value:
  ð	if kwonlydefaults and kw: +in 
;  F V [3 ;] =3  	t ;els†  K Ámissing += 1/ 3if  x _ ó_arguments(f_name,x Æargs, False,ô )Q Wretur
ð

ClosureVars = H ‡dtuple(' ð', 'nonlocals glob òbuiltins unbound')

def getcV ¢vars(func)À 1"""‡ ÀGet the mappñ ðof free variables to! ±ir current ¹1s.
@ RÇ 2s a±  ² • of dictsW  c @ ¿ ,¿ H  éÆ ð references as seen by… P body]  O  Í Ñtion. A finalH 0set! • Ás that could�ñbe resolved is also provided.F  	 ¸if ismethod> # € 0 =  0.__ "__!ifg  is  £ ; ðraise TypeError("{!r}‹  �a PythonZ  > ‚".formatF )d Fcode~   !__² 3# N	H!red~0co_ä a@ pby lookpthem up5 #__J __Ž@posi� �al index< !ifµ .,  is‘ cÿ_€ A= {}< 
ˆ% $  w  °var : cell. P_cont	% 0forÆ,(  Â @zip(). ,± žB   }i1# Ge*¢Z ¸¸WÄƒ__ or __c sÏ  _n O2.__ ! 0 "  ˜_ns.get("N 3", + @s.__ž"__ì äcodule(# 3_ns( o $ =E  d G w{ 
Õ: 
 �+ Ø Bset(‹  ´ A ¯«  sµ �  ]0ame" Ñ("None", "Tru k"»  2 �# BecauseCpse usedÖ$beÍ �s instead;�keywords,/ yÜ  F   ð# may still show!asYm¡. We ignorr mS @    ¬EinueY 6tryÞ  " J[ý  È "ns = ¡except KeyJ
I Z  ^ “M 	Õ `  2 d 
 ! 	ÐP.add(· ©À  return CloôsureVars(nonlocal_vars, glob /
  sbuiltin2 ÿunbound_names)

# - ð stack frame extraction

Traceb  = a …dtuple(' €', 'file ± lineno fun? ñ code_context index')

def getm Qinfo(
 #, ) A=1):ú P"""Ge8 Pforma� ƒ about a© 0or ª   �object.
; !A ¨ ô of five things is returned: the º ,  ¿ ¡ number ofI  % qcurrentÞ ) á  ö €, a listm  B s	 Ì U fromI asourceQ, andu  3 k 0 wi· @ tha| 1st.I `The opð al second argum£ ‘specifies[ Ë » ˜ J #toð, which are centereT  VH A."""> Uif isÄ¹ ¶ 
Bno =«B.tb_ <  ! õ    Belse ) 8 * fI ‘if not is= … ðraise TypeError('{!r} 5 F"'.sQ )U-  =¿Í  & 0 or  Í $ifÙF > 0× qstart =›„no - 1 -* 1//2<  ÿ 6try5    ps, lnum2ind‹ ‡ 9 ‘except OSü D  " =”v = None9 	 s ¬ ±max(0, min( a, len(‘ )¾ %))K  =  é !s[8 : +%]/ 0 ' sÈ ( è ¨(˜¯ ‘ 3no,š f_¦1.coA,�"s,­4 cLŸ ·  9 ò¢•á, allowing for¾1mizÒO0# F} ¬.ãªÀw a descriptò øgrovels co_lnotabô E !

Y 0InfŽ Ä Q', ('6 V',) +5p._fieldVµQouter+ s·qrecordsü u þòall higher (calling)•sÇREach ? Mains\
Ù‡,… ÷ ¨	�{w ª»¥ù ì2= [·Rwhile¶  ó(  Û3 = 'ð) + getframeinfoó(frame, context)
   Ðlist.append(F) aInfo(* [info)0 1 =  q.f_backM breturn  P á

def getinner/ Es(tbƒ A=1):9 �"""Get a 6 ð of records for a tracef "'s] â and all lower 1s.
L CEach@ ë bains a$ á object, filenñline number, functionI   ”  * s� A,† ñindex within thet qext."""G ÷ Ø A= [] ‚while tbý  †%  g¡ = (tb.tb_ @,) +A    ?’ d ÂRtb = g Anext• ½qcurrent€ (®Rê ð     õcaller or None if this is not possiblet ssys._gef  1)8 åhasattr(sys, " q") else_ _cstack(”R¤ ÁU ­ : b aboveº½ d¥ egetoutÇ´ Õ)— ´— (Rbelow— ƒ` excepžš  a š Aexc_/H)[2]› O
# - ð  static versionë0get�Ó

_sentinel =\( _6  ¹“mro(klass@öðtype.__dict__['__mro__']._5 #__4 Oð_check_instance(obj, „ T  O Q = {}Õ6trye$ o  K ribute__\ "š "g~Q Attr( VError\ Apassr Ý  Ö Y.get(u ³ %, 7))
ß c&ø + Þ  Ÿentry in Z KÁif _shadowed(i(?  ))‹~ ¿  9 	,    Ï > ­ .Ë $   ;Key    !… 1is_¨ 3objõ 	� õ  & ox KTypey º QFalse+  CTruet 
'£ ¿_æ  (	¨›	Ò  ð¥5 = t ’#__´[s  : ø plÐ    else:
     ðif not (type(class_dict) is  ôs.GetSetDescriptorType and
C  B ñ .__name__ == "_V ?__": 2objJ _ˆ }entry):q rreturn *  ¶ "  ð_sentinel

def getattr_static(obj,  ¥, default=1 j ±"""Retrieve* ñ!ibutes without triggering dynamic lookup via the� E   d:ä protocol,  __’ F_ or f D__.
? ñNote: this function may¶Åbe able to r« 'll¯ F Dthatô can fetch (likeÀ Çally createdC )D 1andz 8fin   \ $'tX ú sD , ¡raise Attrî ¡Error). Itš 1alsÏ  Û<eobjectI °instead of  ùance members in some cases. See�`ocumenñ on for details.¥ 1""" V ¥_result = !  9@_is_( R9 kJ! =C 4    ¨_zR qhadowed(5 oV if (. &is� 5 orP  T � + ¼M
¼¦  < è  dcheck_  ¿ ,› FelseŒ´ b = obj³ 5M ¤á L Â i¿4 !isÜn 2 V " Ž  3_r = A), '|1__') þ	l ˜    M ?setM i˜� 2â F �5´ /if'E ‹ 0objt w #) NQs we c UQ metaÝA too‡  7 V¶ Œt ñ2mroj_ )"Yif _s q (I )­©š  o   >try   í F .ˆ[‚]°  (   ¡except Key•Q 2pas‡$if= 2	I:  fr  (‘ )


# - ñ generator introspe'ð

GEN_CREATED = 'GEN_CREATED÷'
GEN_RUNNING = '  ”SUSPENDED    FCLOS  õ
'

def getgeneratorstate( ñ):
    """Get current % e of a * 2-itB !.
3 ‚Possible- Rs areL    ¼ ðCREATED: Waiting to* Ñrt execution.H / ú 2: Cƒ Ply be7 . øed by the interpreter@ B ûsuspended at a yield express€ 04: E� â has completedk 1"""³ iSP´.gi_runningÿ �  returnÙ 8 Åframe is Non=	> — = ï.f_lasti == -1� ‰D ˜ 1
$olocals%F  * ‹@mapp£o <   variables÷Utheir\cvaluesE`A dict› �ed, withëAkeys	 
T ² names and L  $ ™ 5bou .­ Pif nod ËÚ  ðraise TypeError("{!r}š  = †a Python‡".formatL )Ö=vFattr! a, "gi_ !",ô)¡  m ½  q/  ü©E >elsC�{}


# - ‘ coroutino`rospec±s

CORO_R ˆ ' ñ   w   " ó  É› ¤( É* s object‚ÇÝ È0 ï ‡ÉA C 
Ê`n awaiJËB 3Ì?.crÌZ Ý q&if' 9 ” Ã¿? ™ >  ÒÎD XE 4  7ÐØ @s,G Ð ; ÐIÀariable nameõ	s and values the
    bou A.""" ñframe = getattr(coroutine, "cr_ �", None)1 1if  q is not :  d breturn" ‘.f_locals Melse( o{}


# ; P ð Function Signature Object (PEP 362)( z 9ð


_WrapperDescriptor = type( ó.__call__)
_Method/ % 8all$ _Class) ðint.__dict__['from_bytes'])

_NonUs… þfinedCallables = (¡ ,� » 
¨ , ° 1  ”s.Builtin±äType)


def _s½Á_get_user_deÖ !_mAb(cls,  b_name)cð"""Private helper. Checks if ``cls`` ha' ÷Bibut% E Gd ``T !``NÛ�s it onlyJ  itaCpdƒpython f~. k2tryž  j ` wÈ : ±except Attr¢ VErrorD ’ * 	^!if›°isinstance(o /, 6 ˜   —# Once '_�ñ_' will be added to 'C'-levelƒ  :    # æs€, this c{` won't@ ™necessary7 Í Ìÿ‘partial(wddœ #,  ó , extra_args=()Ð  µ acalculGow 'N %' pì Ÿ ñlook like after applying a 'çSools.‡ 3' oe@or a6 4Von itY �old_param™†  L bameter86new( ÆOrderedDict(A ¡.items())
Z � $ =#.R or (” & pkeyword†  . 0or ¢ Ö'ifcƒ3 l †$ +y  š 	Xba = ù 1binæ*Z 5, * � Æ " 6f as ex  smsg = 'M ŸA{!r}ÿ`incorróarguments'.format(4 h  praise VUl `(msg) ~D ex
â 0ansA a_to_kw)b= Fals_0for!am®Ànam in ÎÅ 	7 Š Aarg_ÝP = baÚð uments[param_naSme]
  õexcept KeyError:    Epass Jelse úif param.kind is _POSITIONAL_ONLY/  R ò# If positional-onlyE @eterD qbound b Utial,�  @   ý# it effectively disappears from the signature? Anew_· as.pop( m_name)+ ™continue
 ÷ žR_KEYWORDý 9 n 0 inù  ã ž_keywords3 ð ðThis means that t ¹  6�, and allP  am ¶ A  A# affÃt should be | Š(J Fvar-£	û J A ñremoved). Here's why. Consider�ŸfollowingM @func  w ÿfoo(a, b, *args, c)/ 	 3 	¿   #ˆ @"par‘ÿ(foo, a='spam')" will haveÏ |V: "(*I ¾ ÿc)". Because attempt@to cÚ÷ž ñ with "(10, 20)" arguments¨ Ü 0raiq Q Typeë‚, sayingS&"aH Ÿ receivedK ÿmultiple values.' ñ transform_to_kwé^= Tru’ —@# SeÙÒe new defaulta _ Æ[	T2] =“.replace(I Q=arg_® åØ �   `# was Fwed as aºuž d.d i hZ\C?'ð ?if ä 
”cassert”&=not*b4×   =Hè" Ž =¬RO sC \  Ç  3 . ý?endf$elE9n (• U, _VATó q À        elifû param.kind is _VAR_POSITIONAL:
  Anew_3 as.pop( q.name)
, òreturn wrapped_sig.replace, geters=F ðvalues())


def 3 ò	nature_bound_method(sig)� ò"""Private helper to transform sig@ �s for unG � �functions2   ^ !s.  2"""Æ × �s = tuple| . ¾ .³  bif notICs or
 3[0]W1n (X£KEYWORD, _
 S_ONLYÖ  J praise VãError('invalid§ Ü 'o¸=r Ì 1if  i~ Ò4_OR~ ', ê‹ ³# Drop firsÛ  ü � « ð# '(p1, p2[, ...])' ->  ˆ  - < O	 A[1:] FelseS ² sP3¹ (  R ò# Unless we add a new ¨ P type Qneverl  6   ©# get here {�argumentT %')6 ð# It's a var-posiZ&al… Tt  DoÔ Ûhing. '(*args8
 ‡MEM8 ãis_builtin(obj`6Àest if `obj` ña callable that mightó ”support A÷ Clinic's __text¸¢_ protocol W Ï 8(isŸ * o¡"is”¡descriptorÆ ' €instance ó, _NonUserDefinedCÇ ,s)9 �# Can't tü D'isiG  4!)'Ñ, as it wouldÿ  À   á# also be Truebùregular python classes6 @obj ‰ c �, objectò4is_¤1likÚ ¿AduckªS of FðBType‹àA good example$ Csuch’ ds are � ñ s compiled withÐ Cã ò, which have all attributes6�a pure P. Q B R: Q, but
 ð their code stati„y º  EB o $  ¨ þ ä1 isz -U# Allƒ -V	î •obviouslyù!s,g í nd¹Õ‹   ÌRFalse­   =^  ‡ P, '__ ’__', None>é *   * pdefault;9getX  2 °_void) # Im¥a®ao use  2 ..º ðkwdefaults = getatöBtr(obj, '__kwdefaults__', _void) # ... and not None here
    annotations = getattP  Q  < !)
9 ðreturn (isinstance(code, types.CodeType)x 1  n   1 žname, str& (É 2 is³ 7or ;  �, tuple)B  D ! o, dictE s 3, (1 )orC­ ñ) )


def _signature_get_bound_param(spec): """ Privat›ñlper to get first 1 Peter 3q from a: g__textf ñ_ of a builtin method, which should9 ñbe in the following format: '($r  1,:1)'.2 bAssump+‚are thatA ¤ óargument won't havb ¬q value 25] 2"""Xpassert ó.startswith('($'z po«! ‘find(',')¡ 1if  B= -1X p P / )I c :J … !  O  ¶  >c ª  =Z =? A È ~[2:pos]3õ	strip_non_python_syntax(U@D@func°¥. Takes a 9  ýA²�Clinic'sD ‡extended, .÷ Rù M z o@threDingsy* q @re-rY 0red}  4adard PÚ  Ú ,ƒ    >  ¡2dexa ‡e "self"à(generally 0),¢ Ÿ3 ifD  �Q does š- aP ,ª   last "posiRwal only� º  ‰ �  ha�  AD -D Ò s!if° A [$  <\,# ¦ -h7=!  É _È _„   ! 0inebP[l.enÔ�('ascii')!! l¾z Ñ.split('\n')]? –Àtor = iter(lP P).__nª_% ñ token_stream =  Dize.	 Ü3torõòdelayed_comma = Fals` sk# [   B = [š 0addl ¢ext.append+ycurrent.0¦  OP0  « 1.OP ¥ERRORTOKEN  O #Î  × Ý ralways Ë Ì’ ENCODING)  , Â 1 ita @t = ((
"ß•ðt.type == tokenizñe.ENCODING

    for t in token_stream:   òtype, string = t. "t. D  ) 0if  f == OP@  .   :',' " îkip_next_comma$  ( s% … = False®  $   OelseB òassert not delayedp C  G 	" n = Trul  ) ýcurrent_parameter += 1T †continue6 = %if`O= '/ µ c + þlast_positional_only is NonÂ T é T .= ü -û Dif (2÷ERRORTOKEN) and (0:$')Ëã GselfqÝ # ¬  	@Ÿ*if&
‰ Œ!ifj(é .OPá ;)')â  •add(', ')£     E \J  4 'E òclean_signature = ''.join(textU {return + *, K/, v


def b ñ_fromstr(cls, obj, s, o bound_arg=U¶ ð"""Private helper to parse œ ent of '__° g !_'% :À 5a Sç Ábased on it.( 1""" ð # Lazy import ast because it's relatively heavyš8    Du[  C0oth¯ Ðhan this func|r c ûP(f= cls.ÈB_cls$ ƒ"A = \¤  C" $òp_non_python_syntax(s)m °program = "Ãlfoo" +² + ": pass"6 6tryPmodulUAast.µ(V Z�except Sy _Error<   Á ;Áisinstance(ma ,©!.M 7 ì ±raise Value\ õ("{!r} builtin has invalid Ó".format(obj)	Bf = i ‚.body[0]ë Úas = []£ …empty = Î.  m =÷Cect(` \ & =Š ¡_dict = {}?  0namRpgetattr¨ ,ÿ 1_',G `#if¹ _6 	\Àule = sys.moÀdules.get(mo ã_name, None)
  2if  :    s_dict =" !._ !__* Jsys_& Bsys. ‘s.copy()
* ‘def parse� f(node)n ñassert isinstance! ™, ast.argª  ; ñ.annotation is notÒ Q  ¿ õraise ValueError("A6 Qs are8 öcurrently supported"p rreturn t &rgÌ `wrap_v\ '(sÉ :try… # £ = eval(s,FDf ¢except Namª 
C T  Ý X Š\  - `  " ,SRunti„ ¹  (if›{ ñ, (str, int, float, bytes, bool, type(g)  N T Ü!Coð!t(T µ � ðclass RewriteSymbolics(M ÷ NodeTransformerv  }ñvisit_Attribute(self,Ù)  Ÿ aa = []µ    1n =* 	 Xwhilen°c X  I ö a.append(n.attrñ     j .	m !if­!n  4i  A a  Š *idˆ ~ ú = ".".join(reversed(a)* Ê< ó k z © uà  rode.ctxç OLoadç ã  É ñ ^ ž  p(_ š, default g=empty~  1 ) =Ï1ame5 €  Ò  am!Š invalidÖ< "Œ  .)if‚ J and ì_’ 
P &Ð . =7!).(( Ã  “   1o =Š�literal_Ì3 n–
© R ý   @if oÑ 9 6 9 Ž   =@ E  I T elseKr ¤parameters—P e, kind=e &, ~òð# non-keyword-only%d w uargs = Rfßs xd %  )  Œ0 =  ðtools.zip_longest(args, defað*ults, fillvalue=None)
    if last_positional_only is not ) :)  - ñkind = Parameter.POSITIONAL_ONLY) Oelse3 ‘R_KEYWORD9 ö*for i, (name, default) in enumerate(reversed(list(iter)))n p= X  º if i ==ì ?  * ä 
± Z q# *args Pif f. v.varargV R FVAR_:>  z )p(A ‘, empty)
! ¡# keyword-Ÿ‚argument| b W• \	X W%zis  kwW  ¿ ,Ç 3kw_„sb	ž @**kw?   ­ : 	= 
”if self_pƒ©ô# Possibly strip the bound :• #u Ó- We *always*5 [first7 5 if© 9 @  it… ša module. X _don'tU Qskip_² @_arga GFals^ uassert 	
 Ë _"ñ = getattr(obj, '_ A__',Õþ /  . 1_isl 1 = '  p ÿÐ ) ç R = is (3 Q ¤T Zand (= :or á b ” Ö f.pop(0] 
^ ,  # Ý‘builtins,  Ê Ö ãD!Ù  F 6p =5 Ðs[0].replace(]=óš F — B  R ½¶return cls(Ú ",  p_annota}T=cls.öó
def _signature_from_ç 0(clÐKunc,IS=TrueNð"""Private helper funci 0 to ^  Da ¢ callablesÐ2"""Ë !if˜ %is–  _ |  ðraise TypeError("{!r}‘ [”a Python r "€  8  "X  · �".format( )së  —, "__text¤ (_"öÄ sª V« )no :g Ê Ž Ô¸9str³¶?)

ï Ð  ù 	= 	ð,;À          glö obals=None, loc ñPeval_str=False):
    """Private helper: constructs Signature for the given python function."""
O “is_duck_f 1 = n  „f not is (	 ‰  � Tif _ss 5_isG Llike- 1 o ATruen    Belseè     ‘# If it's‹ 0a pÝ )PyÏ S, and   Î F typT F "of;  Â Jtionf ôraise TypeError('{!r} iu p ‚'.formatâ !)
¿ ±s = getattr —, "__text"@_", é)2 Fif s‡ hreturnPÁfromstr(cls,»ó, s, skip_bound_arg} ôParameter = cls._p B_cls¡ &# & "inÂ  Œ  q_code =k !._ !__ “pos_count  0.co‚  & €arg_name
P  & 1var & posonlyP  6argW @posi²Ual = d %[:• ]X �keyword_]  kw 	\ 5 	^ ] g 8 + / Á | `annota¥  ü Gget_ "glé ìó%, î	 %pdefaultX  T4.__ œ$kw �6.__ "__ý4if ' s å  Î s = len( s‚ 
”4 0d t ­ "[] 4non² d  D à0 -  p   Í@_left 5 X #I-‘-Ù € 5w/oð .R   …0 int R-[:  ] ðkind = _POSITIONAL_ONLY ifC  t ¡  "
& ‘R_KEYWORD|  ‚ h0P.get(™ ‚, _emptyu 3 Ð ….append(Á2 U = ,t  E   Ü = )q Ø 	 E „“D-= 1ˆo... w/o €offset, Þ  w¦enumerate(Ó[€':]a ¡ ‚ÁÀ    kind=kinOd,
  ƒdefault= µs[offset]))? õif posonly_left:  _  a -= 1
 q# *args öif func_code.co_flags & CO_VARARGSS °name = arg_ ñs[pos_count + keyword_‹  ]a  ˆ  annotation?  `s.get(K †, _emptyØ ôparameters.append(P 2 U = XPkind=à Ô_POSITIONAL))KÊ -Ê  ˆ Ï @for ² 9 inó &­# =Ô 7  Sif kw Ös is not None<  ' " ' =. ) W ý ]yÏKEYWORD_ONLY•ø íäo# **kw¯u ³pindex =$ªL ¬_ +Z  &% ‘?
@Is ''®Ña pure Python5Ññ- don't validate theP#<p list (=ócorrect order and ùñs), it should be OK.I ¶return cls(ŽT& _i'# 'mD $__Æ _j °__=is_duck_ õ ý)


def _signature_from_callable(obj, *`   �follow_wráßr_chains=True9 ïskip_bound_arg2 €globals=n] ?loc* ßeval_str=Fals´ rigcls):ep"""Priv/fhelperPuto get Z 5‘arbitraryg‚ objects'2"""] G_getšBof =_ ×ools.partial(" 	¼?   ¸ M À              ú skip_bound_arg= %,
( 	 ƒglobals= 1 0loc0  / rsigcls= / ”eval_str=	 !)
Ã ñif not callable(obj):  Ø ñ	raise TypeError('{!r} is4 a6 ñ  object'.formatE ` ‘isinstanc^ à, types.Method[ p ð# In this case we wñ the first parameter of ¥underlyingµ õ# function (usually `self` or `cls`).. ðsig = _get_signature_ofÄ 0.__J #__Ì  !if“ -  wreturn K Bmî U(sig)z Oelse> 2sig�R# Was ‰ Ó ñwrapped by a decorator?V ¢if follow_& †r_chainsf €obj = un   ã ÷, stop=(lambda f: hasattr(f, "_È F_"))¼ ?if × 4# I² }  Ã 6 O2a *" *,õÑmight want toÚ  B   #~M its(ãÙ/ xSee tesÝ Ãx Æ for details C Ò!6trybPIobj.>Æ ò except AttributU; Bpass( 	 s ig' ª;Non6Ã�dsig, SÎ` Ñ   Øv    ³'unexpectedá ÿ)n Û / '?  Gç  ÿD l ^ò	Kspartial¢=… )._ y V&2	V ,AYools. JA# Unß —ª O(seeC ³  û   0# Tí°means, thatÿpneed to_aculateêžB 0as ŽÔt's a regular‘  3ýect, but taking inTPaccoum � m0osit»al argument| `,aQ will'0be Ù+ed< €automati{Qy (as„Pòs_ )  ¸b²	«.1A 9 IC ð partial(wrapped÷_sig, partialmethod, (None,))
  ôfirst_wrapped_param = tuple( Asig. ùeters.values())[0]L ?if O   .kind is P]  C ù.VAR_POSITIONAL:E  œ 0# F— ó argument of the ‘ � callableV ï`*args`, as inK  `�(lambda 6 =)`.1 ©return sig Nelse© 2sig4s5-	N  å °assert (notn H -or*  .   ]  
A :[0]â : 4new` ?= (H  G,) +† ƒ –.replace(=_ !)
; ðif isfunction(obj) or –¤nature_is_ Alike# _ô	# If it's a pure Python 3 ,N àan object that	‘duck type„  ø #:a? : (CP ðs, for instance),nn� þ À EfromÂ €(sigcls,� ,|  €  	ú skip_bound_arg= G ƒglobals= P, loc  ´, eval_str=	 £Ð ’is_builti®û - ú !
ê ù ž $is� ,ý@oolsŒ Ø)¦  Ñ p = _get l ofA .=Ó 5 +úÖ– `sig = Gææ
¥  ~˜ # ›qa class¸Q meta - %ò@, le÷@see ^ `t has êÀverloaded __ÿ¡__ defined‹ D gin its`      2  3sig î Suser_F _&(Á  /D), 'j '7!if} Ó  w † j #‚ ‚ G Nsfactory‡ f V   ?newÃ 1obj½  –_¼  E OinitF  2 _G à# Now we check« ŸS'obj'é¸ wnH‹  ™&ho±‘ f  iÓš.__dict__Z . &4new À     # or an÷	 own '__init__' method
  Helif# ùin obj.__dict__:-  8 ‚factory_L 0 = ] 	& ð# If not, we take inheritedj 0newŒ  or  = ù __', if presentL Ÿ `new isS _ None” >newG  l H  3 
J ;if š 
ú	sig = _get_signature_of(D )d 0if 4 /isë  ð # At this point_ðknow, that `obj`à ùa class, with no user-Æ r# defin‘ å „2'__�B, orE `-levelªvcall__'ª `or basâ7®mro__[:-1]§p# SinceN 8tex _'¹ €implemen)Ias a³  o  · ‚scriptorõ �extracts Q  :cŸ from theC  ¡ docstring{A'objƒ rderived@ Ÿa builtinF T, itse ‚ å opay be 'µ/'.E  ‘Therefore+ go throughº ° MRO (excepõZe lasÏ  in4 I @hichN Ô Ðect') to find" O firG 2{n-emptyUÂ >tryæ — ! =4.__  -__ê ïAttributeError^ Npass@ /ls  � !ifÉ  œP  % µ 3'ù  h‚ ¹ $ a¢ M 	‡return a“ (nd on iÇ ‚   7  « ) É°str(sigcls,f,Ï 8 > O# No]±was found f:'e ë 
Ø°# Last opti¬ s>Pcheck£ ï'Pi‡#ž Dect."  GEtype 
k  ™1ypeÙxA[£# We have ßP (notÒae), butîß&(# œ ð– Bif (# V9objâ *anP ˆ  8 O	7  )à  4 ># R7!of¬ Ê�
F :   <Àsigcls.from_ûcallable(object)
  ]else:  % ÿraise ValueError(&  * ð"'no signature found for builtin type {!r}'.formatŽ 1))
Q ñelif not isinstanc­ ó, _NonUserDefinedCÊ &s)¯ R# An Ú € with __ñ !__Z  › ñ# We also check that the 'obj' is{ 4an | 7 of= `_Wrapp„ óscriptor or _Method — to avoid8 ÷infinite recursion (and even potential segfaul— ¿ E = _O²_get_user_d!_m} (UH4, '÷ 'à1if L â ;Nonç6tryI +  0sig~  t ‚ 0of(K \  * gexceptn as exS  msS #E e   ‡Âmsg) from exC ifÍ
ë à# For classes „0‘s we skipðfirst parameter of %irŽ #[¡, __new__,_è2__ –s1  ” Pkip_bJ_arghreturnè) G F(sigo£> 5sig> 2s.B‚ÉFunctionType?Rä�a nicer eçp messagÈÂ× Îñfp õ ×Î  ' ÆP èÀsupported by c
û  _¡ƒõ"""A private marker - used in P4& SÔd."""

K Cempt<B"""MB V÷7 * uW . 
Q  óKind(enum.IntEnum­ñPOSITIONAL_ONLY = 0I ÑR_KEYWORD = 1 FVAR_" A = 2 ' J 3  ,  B = 4‰ódef __str__(selfŽ –À  r._name_3 ‘@propertyV  A "de;?ionE ð_PARAM_NAME_MAPPING[Y 7]

À °  |   9= _6.é ) 
:  ß: )  
_U  t  z 
) 
‡‡ 3  9 p) p  0  7  p )  !<Ð = {
    _POSõITIONAL_ONLY: 'positional-only',
    _POS) ™R_KEYWORD/ ´ or keyword5 7VAR9 Æ: 'variadic f , S ‡ J 	„  O ' L + ñ'
}


class Parameter:¾ ô"""Represents a p   in a funcó Á signature.
8 òHas the following public attributes:* Á* name : str;  52The !ofG w a† qstring./ ñ* default : object F  @valu� rP ñif specified.  Ip B x ehas nol O f, thisÓ ¥ is set toA `Pt.empty`µ `annota<,  õ  ? fo¬ ,L © )KkindžñDescribes how argument ês are bound tomü  šƒPossible4 ': (0BNLY`G 6 % U(`,H  ôL G ;>  ´2"""²ð __slots__ = ('_¿P', '_*	 t …"')? ” w  Ù  =+1NLY/ ê ;   /  5 
ü _  := _ . è 
� c  ,  ?  R  Z  ê ò © 	  ñdef __init__(self,é , >D, *,c!=_6 &, B )› z 6try    R .Š x }PKind(b )Å  * €except VCErroñ    Wraise 1(f'à  {G 0!r}íPnot aÄ&id9.! 'i $ifÓ 3 Ú 
¹  ˆ3elf¼ Kin (ª,»a ®   –msg = '{}¥1s c>U have† È %s'
 =   A ¡msg.formatŸ‘ !.dóp°Ú  5   ,6msg& “$ =‡    ¨ ' =ó5 e !if) D@„ '˜ . §a requiredª ]šg àot isinstance(H ,žtÀ          msð g = 'name must be a str, not a {}'.format(type(* @).__ W__)
  õraise TypeError(msg)
" 0if 5 â[0] == '.' and å1:].isdigit():2  [ ð0# These are implicit arguments generated by comprehensions. In
C  ð# order to providë ðfriendlier interface" ûusers, we recast• Qtheir½ T as "š !N"Õ  treat them ûpositional-only.K ú See issue 19611 úif self._kind != _POSITIONAL_OR_KEYWORD4 ñ  msÙ(l     '¯ Iý`passed· '< Î ¶ or keywordI 8.{}> 
, ˆ ¤ 4msgbë €.descrip89 iHValuj S  J  49NLYÙ  ” ñ  K[1:]Å!otùÜ.isidentifier·¢ ƒ'{!r} isWâvalid parameteJi x )u Í   ! ={ Uð def __reduce__(& =rreturn ¶ ,ø  *4 .Ì,h)* Ã{'_default':*  , � '_annota½/  }Û À tsetstatÂ !,  É  ¼ .~ " =  [� ]× * i -  "']>‘@property?  Œ  a} FZ  ! = @ 
$ C ¤ F 
' I  ,C 
 ! =  ø qreplace2 A, *,c€=_void, +  ) 7 Š "  â  G@"""Cðes a customized copy of+$ PB."""ž  i 7 ;“ 
ë “ ç$  	9  ½ 9  =Ë  	9 Ú ? ! E  	K H  E  B �| †)‚˜,p7 &, … = 
pð tr__(self):
     Àkind = self. 
   …formatte e_name
  õ# Add annotation and default value+ "if` _. åis not _empty:+ z ’'{}: {}'.� ( Ited,3  7  2 z (ë ‹ &))Õ ª É § , \  /  Ÿ Œ T_'{} =Û S repr¨ ‰ )))ð Jelse5_  =8] ^ 0if ú == _VAR_POSITIONALp 	Ë U*' +  L ,elN KEYWORDK 	L M greturnf  `def __0!__2)\ 2 ¥'<{} "{}">F¡_class__._Û1__,§Z OhashZ   (v .? F  Î¾ #eqb w, otherÃ d X Ý  ðá *Trl X±isinstance(9 ™, Paramet_ E áNotImplementedž  å ' S . &an.  2   `H.  . _  4 `7  A)


ä  BoundArguß sF`"""Res®ô"of `Signature.bind` call.  Holds the mapping of aI '!to  @funcD's pk"s.["HaD `followF òpublic attributes:* *] q : dictd  UùAn ordered mutabl” t  ' �Fs toL '’%s.N 2Doe‚xcontain, yÆ4 4* s"5 : .P 6The ð object that creaóTthis –‰ î †s : tupl0T  i@posiT&alŸ 	Ê p* kwargC 	,@DictA keyword> 2"""vå__slots__ = ('ßU', '_÷  ¹_weakref__'(EinitÆ3 ,y Õe & =% N# {  ¡~² ‘@property3  ¬u ¬o &S Àsignature

 ñ   @property
    def args(self):     U = [] ò for param_name, @ in : Á._signature.% Çeters.items(W  [ "if< P.kindA ô (_VAR_KEYWORD, 
 [_ONLY<  @ ebreak
˜   6try»     Rarg =ž ¡arguments[� Â Ú  - þ except KeyErrorN ð	# We're done here. Other>\ 	’  T ñ # will be mappeì t'BoundA� 0.kwj'< å  F  Nelse— 
M1== L®POSITIONAL2  P 0# *w v     Í.extend(arg)% ‰  ; u# plain;  % `  ` & Àreturn tuple{ "s)æ²6´ U = {}T  õ_started = False Õ9Jnot o }
¯?in ü A
d f = TruÒ  "   ¦„  ¶ Å'¹  S   }  *   ‚continueÈ    !ifv 
K s = ëPEpass" ± LHÈ{ÇÏ  I B# **÷ 	`      a.updat}!keyword…j   =2 ©�)  ,Ípply_default6`"""SetU  € values epmissingd ..T  ÷ öFor variable-positional, ! (¯U) the] Uis anGRempty;Z 4s (ŽZ Udict.n 5""" 5m# Hnew_' VP,s Àts.append((n÷	ame, arguments[name]))
  ùexcept KeyError:  ( þif param.default is not _empty0  4 Zval =7 X %elZ @kindW ÿ _VAR_POSITIONAL\ 	(Æ  u Q KEYWORDN 	/{}Ÿ  /se3 Ô# This BoundA\ý was likely produced byW  © ÿ# Signature.bind_partial().0 �continue Enew_Þ�.append((æW, valêUself.+ ‰ = dict(@ !)
` °def __eq__(5 †, other)0if   °   Ü —return Tr¯ !if1±isinstance(9 ,Cd J €NotImpleÂ!ed£  ¤ $.sO2 ==°  &an6  :    Á 6 "	…setstate ¯ O _†  " &[' %']» . j $ =-  (']‹g~ w l{g :�.y 6, 'Y   }i Creprã e †args = [À 0forTcRue ins U w.items(D  s H £ó'{}={!r}'.format(argO ´ß ¥'<{} ({})>/ BÀ__class__.__óÐ__, ', '.joinR as))


% q®F"""A € object  es*Ö the overall ØÒof a function¬ÐIt stores a P'DeterQ  *Beach
  aco e R �, as well "inð ion specific to5 ƒ 1 itÆÒ  2has1 ð	ollowing public attribut¸ ²nd methods:I *° ñ s : OrderedDict¯  ÎBAn o P mappZ o( ç 0s' “s± ÕcorrespondingE 0ð s (keyword-onlye¹1 arh –Bsame| H z@stedŒÁ`code.co_var„ `V"* Qp_annotaÃ# :ªK GThe    Á u : ‚ type ofS  "ed !I&  Š,no\ 3its– \ e, this� ¥ l0setN`;€`s  * Ið(*args, **kwargs)ó -> BoundArguments
  ô Creates a mapping from positional and keyword a@ 5 toC ±parameters. ð* bind_partial(*args, **kw
 )� = • ~  Ø 6to • � (simulatÝ ³'functools.c Á' behavior.)A A"""
	 ð__slots__ = ('_return_annota@', 'æ ý #')7 { „_cls = P V b‰_J% Ÿ+ ‘empty = _	 ^ ÷def __init__(self,ë ­=None, *, ­ =E ,Y  $ §__validateÍ •__=True):0 ò"""Constructs Signature/ûthe given list ofõ  m @obje;  P'  w'.  Allb`are opi"alY F ž  'ifý @ is  ³  # � †ÂOrderedDict(é  Jelse1 i`
(  > ]  #   €top_kindËõ POSITIONAL_ONLY_ (    ( €_default· RFalseû   2forû 2 in	 �£  1  T " =' . v  & Ename&   v  ' 0if C 4 < × u  , 0msg<o      b'wrong�  Ä   o©G: {} `before 'M ’ G ( ý   ¯ ´msg.format(â q.descri�B D   (; z ÿraise ValueError(msg. $el�>� ‚ N¤  ï ! =ã [in (_Î),  —R_KEYWORDGp   Ã.ô Æ«W8 	Ý .  2 T# No f  @FthisdŸ, but thea
I wpreviou>  ó sE ™ O hadJ a’ , �T'non-Å D„ followsL ð ' \
              ¿'argument'
$  ÿraise ValueError(msg)6 _else:  S ÿ# There is a default for this parameter.E 
Skind_= Ÿs = True
2 ¢if name in\ sž òmsg = 'duplicate1  � C ð : {!r}'.format(V 6¢ ó  s[P 2] =u 	) T7 ñ = OrderedDict(( .L ,J )\  Ó &s)0aself._$  ò
 = types.MappingProxyType_ s÷ : ýreturn_annotation =  o Á@classmethodå Ðdef from_func< `(cls,  )«ñ"""Constructs SignatureÜ ñthe given python<  J .s  uPDepreÔ’d since P+ ¥3.5, use `T .Ž ¶callable()`Š6"""S �warnings.	 «("inspect.H  È  Œ  ()ñd‡ " ¢ 
 "  W Ÿ /",C ó BionW« æ, stacklevel=2Å«4 _sW_» ‘þ ÄbuiltinÃ(B Äz” Ã º ÂY3 oobj, *bð follow_wrapped=„ö, globals=None, loc ïeval_str=FalseÞ› @ objj Ž6Ã3 (É psigcls=Ú 4O  	ä ™r_chains= d F 
   '%, "	 ¥‘@property¸  3­(„MÀ return selfñ._parameters

    @property ñdef return_annotation(self):!  3 !   "._ . W I Qplace? V, *, | ~=_void,l  m õ"""Creates a customized copy of the Signature.¤ fPass 'q ­' and/or '± µ' arguments? °to overrideb @m in A newz i 2"""ò  'ifä A is ç : $ ” " =D ™.values()S ² Z ( a ¥ � 5 B typ©&)(� , * 
 8 ø= Æ  ±_hash_basisáo ’s = tuple~ B forJ yi' ¸%
’  Œó.kind != _KEYWORD_ONLYœ  4 2kwo … {h c.name:‚ Œ 0 g  
— =— }ùO„ 6s, ¦ ,6  �; no_k
L G –D ³)	‡ Ö = frozenset( ž4 c  (àÐ ! Ë )ŸÍ 2eq_Ë w, other=!if  
kX U TrueÁ ñif not isinstance(9 ,E_  ´E €NotImple(%edO  £	22 ==® . ¥Abind¢,�Dargs*§tial=False‘ ù"""Private method. Don't use directly.”ÝG = {`éQq = iterŒ . Ê  v_ex = (åparg_valDM  Ë Æ FQwhileŠ
£q# Let's�  Ö qthroughm@posi€ al!¢ Çå corresponding‹ g #0× 	 :tryy  . ´ ƒ = next( sÕ  % ñ except StopIterK ¯# No more ¶ 	‹  U �   b‘  Ì 
“  ) — ð    # No more paÿrameters. That's it. Just need to check that
   ÿ# we have no `kwargs` after this while loop@ ]break ]else:   ÿif param.kind == _VAR_POSITIONAL6  : #ã POK, jã pempty *³ P.  Le Pstartc Osing‚ L ê ! ×  ; %elÃ ‚name in L º 1 ô ð __ONLY;  r àmsg = '{arg!r}Ü õÿ	 is positional only, ' \Õ  M  ÿ'but was passed as a keyword'@ 
� ò msg.format(arg=Ò )= 
ÿraise TypeError(msg) from None; _ çq_ex = ( ,l ¾@ 
‚¯KEYWORD or‡ ; Ž €.default•Qnot _�)ÚÏ¥fine too -‹$a N ‚value fo�› #É.  So, lets Þ,  ñ with the currenSw… §5@ D# No" , n DÂ e,´ #? %in* ÅOtialÔ �  5 ±  N    –@'mis÷� a requirÚ“rgument: @ßsÓ 3# W�aÚaÄ  Ï}process§?try˜�r = nextù£=ðexcept StopIteraWS Ç'¾Omanyµ /s'ã	 Óp)Ain (*ð KEYWORD, _KEYWO¿RD_ONLY):
  ÿ&# Looks like we have no parameter for this positionalN �argument# ÿraise TypeError()  ± —'too many}  c ïs') from None
H "ifÉ ÿ	.kind == _VAR_POSITIONAL	W±an '*args'-% ÿ, let's fill it with…  É _# allÅ uÿleft and move on toO ïthe next phase) ÿvalues = [arg_val]+ ƒ.extend(/ /s)0 !s[,ò .name] = tuple(y > _breakµ R ` in kwk Î7!= ÊèÏv’multiple Æ ï ÿ {arg!r}'.formatÁ üBarg=¸  Ñ )µj Y“5`# Now,Aðiterate through ’remaining ÌÅs to processØ–# keywordY z_¾ " =i Ó     0in � Átools.chain( s G_ex,‚ ‹¡~KEYWORDÏ�# Memorizë  atû ±Ra '**­ ¦� Ì  ´   ' Ô ) % {continuW® O	g# Name[À don't referŽ	[Œ 6.’ 0# Wñly arrive here ifì›Åo endedH  Àbefore reach -Flast¦ # ÷‹ ½ _ã" =K 	� >tryÕØ# =éB.popAN 
D¡except Key?N ("noÀ¿ÂÕB.  I¼nJ 4,©  )#^òit has a defaultS @, orô;is F   Ö 2 ärlone byºŽ ˆ'of!H  ’aif (noÂÐtial and paraÿm.kind != _VAR_POSITIONAL and
   ÿ
param.default is _empty):N ÿ*raise TypeError('missing a required argument: {arg!r}'. \N ¯ ±format(arg=— ù_name)) from None
G Nelse§ 1if = *7== &^_ONLY3  ˆ ù'# This should never happen in case of a properly built�  G   ð# Signature object (but let's have tl ¯check hereG `to ensG @corrH äbehaviour justš )@ ¬�@eterïÿpositional only, 'M  Ø  'Ñ €was passõ¿s a keywordð&.ð
æ v S!s[Û0] =kF_val1 šif kwargså _@  ø 1notS
)  m  # Process h2'**R f'-like='¥ 1 l Ô  ¬  	6 Á¸	3  ¡   ô'got an unexpected~ €XI  M  q¢next(iter(© F))))Xõreturn self._bound_ï P_cls( ,{ s; ƒdef bind @/, *�$, Ug """Get a B_ AEsBà, that maps th‡w`O `Ù Rand `À A` to* @funcáD's s—@.  RÊ5s `ÌF !if9 ÚŠ @can 71be .x 5""" 
+ ý  ¤ ,˜ $Otial!60parP %ly+™ Ð 3 0+@ 2 *I,k Ì W=True8¡__reduce__6C{R(type ,¾  è  R(tupl .~ am
Þs.values()),)5 2{'_\ q_annotaP: }­ tsetstat¯ !,  ¶  ;.` " =* Ð['_return_annñotation']

    def __repr__(self):   ñreturn '<{} {}>'.format' ñ.__class__.__name__, @ X /stW —sult = []k ünder_pos_only_separator = False* .kw) 6Tru( @for D Am in™ . ×eters.values(ì  ð ß ¡ted = str(1 )Ð      0kin  . 
 0if  ö == _POSITIONAL_ONLYX H   /reõ 	Ì  - _elif 2 ] ð# It's not a posiö0al-_ å, and the flage q   Ð# is set to '“  ' (there w 7posP ­s before.)H  reó¿.append('/'# 	V i7VARmøOK, we have an '*args'-like so& ©won't needr Pa '*'¢’e keyword	�arguments; »¸ß  `  íIqKEYWORDF°L û W÷ 
© Á  Ì P [ &=n'tÂ #/edD‘, so add /J  > or  � ÿs list ("foo(arg1, *, arg2)" case;	^*^ ±# This cond	± should be àtriggered once¿ µ  !re-F_â	S 
{oð Þ  �•Ð pñ€s, henceô	� #2 wa4ì 1o 'ž', 
¼ Ï  DU'({})6¢', '.join(? )ë  <.rC_ann§ € Ãj_emptyà & 2 = ;  ÚŸJ 
7¦ ¥+= ' -> {}©  K œ J ü0


4Ñsignature(obj£�follow_wræ d=.ö, globals=None, loc ‘eval_str=a‹P"""Ge²` p objectç  ´ñ passed callable."""|§ S˜ b.from_' Àle(obj, follö ow_wrapped=foll ?,
  ƒglobals= P, loc  ´, eval_str=	 ñ)


def _main():e ñ-""" Logic for inspecting an object given at command line """A ø import argparse  Alib
   5r =,  .ArgumentP: 7r()' c.add_a  (  '” '"”help="The° òto be analysed. ¨  >  p"It sup· ÿs the 'module:qualname' syntax"‘ ÷-d', '--details', action='store_true¯ ® ñ'Display info about‰ ˆ ò rather than its source code')Lrargs = S.  .#s(  btargetl"s.5E@mod_ä Ñ, has_attrs,  2 = 6  O  tiÄ 3(":2try0 Ccobj = ­ %= ç.
 _ (k F�except E ¦ion as excV ómsg = "Failed toX õ {} ({}: {})".format[  ™  ±type(exc)._/__H # C U x òprint(msg, file=sys.stderr  $   cexit(2§&if‡
@partÞ—“.split(".Š H ��  À : 0 in&tsQ 4 0getV Q(obj,& ‰ ¶ G  ° sbuiltinÕ0Z ö p"Can't rÒ ‹ 8 '?s."1�  â.UÊ p !'Tß '¼)m+ iOrigin+ 2getS © LNule): iCached: $c '__6  if�3 isó µ  Ž iLoaderT Crepr… A.__l!  Y Ê  @ *¼… Ã, '__path__'Ì (  p 2Sub/ € search 2 	  .L Ñ JelseÅ 	j 1__,’no = find\ c
Ã 
\  O EpassÐ  ƒ   Ü ILineË  ˜3no)D* 2\n'‹ 
P H ²  %4if a == "_22__"²  Q()
""v#ioñ‚ provideUð Python interfac ðo stream handlinð8g. The
builtin open function is defined in this module.

At the top of  ÐI/O hierarchy<   òabstract base class IOBase. It
_ sK ñ basic interface to a stream. Note, however, tha€  rei ‘no
separa¶ ð	between reading and writ #toR Ás; implement7 Ðs are
allowed| ñraise an OSError iç ñy do not support a give;� �.

Exten} ì  ¥ 3Raw Ðwhich deals s† ay withµ 
µ Àof raw bytesš ¡FileIO subZ6es f Úto provide
anWóOS files.

Buffered› • Ž b  5Eon a‚ @% (j )Ê&s
… $, V @Writ¯ @Read  “ bWPair o 
ð  at’ÆQable,Ä
  ? õboth respectively.Ì dRandomþ 3s a] Ç^r( daccessz 0. Bh IO´a eõ Âof in-memory� 
cnother×�b, TextX,îY Aenco  Ë "de 3
ofi s°so text.G PWrapp<>ebRs it,© @ »Kext
F  Hc4 (`‚¤ ð	`). Finally, StringIO
isõ = 2forž `

ArguFQ nameFDpart ¥Aifici,‘Aonlyña? sþ  !()ø Â  ndÐ õo be used as keyword 7 ñ.

data:

DEFAULT_BUFFER_SIZE

   Aþ€ containÑ ‚sdefaultC size b˜ é#'s!  edK  ãj., ()š  ¯eS 0 !lkM `(as obs ðed by os.stat) ifK `possibK """
# New _ plibrary¯ Aform¯ ð o PEP 3116.

__author__ = ("Guido van Rossum <g ð @python.org>, "r   ò"Mike Verdone <mike.v ¯@gmail.com8 òark Russell <mark.r ¯@zen.co.uk8 ñAntoine Pitrou <solipsis@p O.net7 ñmaury Forgeot d'Arc <a /fa« óBenjamin Peterson <b !")S!llPq["Blocküö@", "– P_code 5 
 	(",g"� " R  Y  
€>  3/ U RCA æ / �Àse", "TextIO¶Wrapper",
  õ"UnsupportedOperation", "SEEK_SET 5CUR  END"]


im: D _io �abc

from    ÿ(DEFAULT_BUFFER_SIZE, BlockingIOError, ‹ 	­ · `open,  ð_code, FileIO, Bytes	 1StrX ÿ, BufferedReaderM  ! gWriter1 HWPai _andomA  ðIncrementalNewlineDe— ó	r, text_encoding, TextIO†ñ)


def __getattr__(name):ž0if  “ == "Open6 "  ð# bpo-43680: Until Python 3.9, _pyio.%ñ was not a static method andl N vuiltins4 wset to     J ãbecome a boundP L Swhen ? ða class variable.e  isC  x €-in func}‡ whereasP Í 4 é 2 F. Iný (10þ @() iÿ wO 	,
  bˆ  6  E5().A Õvwarning¨  .	 (('8ñis deprecated, useÀŸ instead'X  –# D5 BionWo ,Å¥cklevel=2)• hglobal­ ‰ =x  mreturn6 ñ raise AttributeŸžò


# Pretend this excep¸`as creã  Ã/.
Ñð.__module__ = "io"S ´for seek()
yB = 0 rCUR = 1 pEND = 25 PDeclaê  ABCs in Cíótricky so we do it� 2# Múadescri¶ sýpdefault°lÍ Ò  s are inhe!d ×ò
the C
# version however.
çÂIOBase(_io._ , a Ã=abc.ABCMetaéQ__doc3 . 
U 2RawL X  ",  L ' O ô= T 
 Y 
, ^ ç V ( R Ã ’register(í0)

3k[Ein (ü� òáÑ> ÿX 0.‹ ~ Š }Ò »L   H Adel S R

tryês0_iošðort _WindowsConsoö
€! IŠª: ðpass
else:
    RawðpIOBase.register(_WindowsConsoleIO)
# Copyright 2007 Google Inc.
#  Licensed to PSF under a Contributor Agreement.

"""A fast, lU  we ö! IPv4/IPv6 manipulation library in Python.

This Bs us~ Åcreate/poke/E eZ @ and	 À6 addresses
 ‘networks.˜ ð*

__version__ = '1.0'


import functools

IPV4LENGTH = 32 6 Ò128


class Ao ¶ValueError( q):
      " b relatÓ 4the² E."""W qNetmask6 5 W nC W sdef ip_( ¢ ñTake an IP string/intV`return  object of · @corr atype.
ê BArgsô  ø d 3: AS Á or integer,C %IPý €  EitherÅA4 orP  F   ×ô may be supplied;S ÷s less than 2**32 willH ²be consider}b<�by defaul¿ t Ró Ë A#v4í È  Ê WRaise; Ã2: i:*P* pasÜrisn't e0a vW a v6¾ 4 i + © 6tryp© iš çH ƒexcept ( ™ -, o d  ¤ v n 6Q n <rI ¦ ð('%r does not appear”b¸6 ˜U1' %ù  Æ 	 LC)


(Ã ,²sct=True?"""%ež .%( s$iNr$ $…! D. Oriô has host bits seèG½ )VOFv -ÀalueError):
  `pass

 ð&raise ValueError('%r does not appear to be an IPv4 or Á6 network' %J  N 	 ôaddress)


def ip_interface( :; c"""Takb ð string/int and return~ ðobject of the corr Rtype.Í BArgsR  ‰ d 3: AS  º  ƒ Ager,C 3IP % �.  EitheÛ  ã ˜  F  í ( `es may£supplied; S ÷s less than 2**32 willH b´ ƒnsideredTQ£by defaultÈ Ró Ë A{I@ Ê GIPv6 @  Õ? ß2: i>e 	¢ed isn't e"a åGa v6¿ c GNoteb 0The(?‘ âclasses descri?Aõ on a particulare NR@, so ðy're basically a combination@both(  X H  7L  ˆ · 1"""& 6try)b ŒÀ ¢/ ƒexcept (i P–, Netmask )Y  ^šp Áp <×( Ï¥Ù v4Ù¥_to_packedË 	¡"""RepreseÑrb as 4 2 ” bytes inTó (big-endian) orderÁãn‡$ rm (¹ï–h Ç  5ger¨ £ ¯ ¨ RƒIƒi °is negativeØ“too large#!anƒŒ-4 È Ö	·1to_¾ ¡(4, 'big')W Ú�Overflow¸ q G"² f$4"õ/v6%/16Y6U/16Æ±/16²*ÀAddress negaðBtive or too large for IPv6")


def _split_optional_netmask(address):
    """HelpeK  2 S the - Â and raise A7 ð	ValueError if needed"""
L  Z e = stre .S Q('/')# aif len R) > 2…  = f ð("Only one '/' permitted in %r" % v  Ð ` areturn Sfind_% a_range GesseðFind a sequence of sori �deduplica CIPv#
!.
r FArgsÆ h  es: a listI 5 ƒ objects= WYield? ñA tuple containingŽQfirstŒqlast IPá Â   ±¹ Y “…it = ite’"es‰S != Q “= next(it  ÝpZ &itÛ ²if ip._ip !7  6+ 1#  ÈyÓ  _ ,^ &      “ p ‚ i ? Îðcount_righthand_zero_bits(number,  )� @"""C0 >   ‰ 4 ' 1 on O  P S side=
Ó? Õ: an integer.¼  s ¢: maximum *  i   A to µ V R›íTh¼  3 œ  $  ée T çf} B== 0 o � ´  @min( B, (~P 3 & Hô-1)).bit_length()P›summarizeMÓë~S-   aLQwork |R give}9 Öß vExampleÐ 1>>>V(� CIPv4 á('192.0.2.0'),ÿ  0...  C b130')) ; F õ  #doctest: +NORMALIZE_WHITESPACE‘ [q 0Net$´ `/25'),Ó4 h128/31Ö ( �30/32')]«: C < [ M i²Âþ ºA  
 @ û !An©Datorìæd] U(4|6)N
IR¤(2Typ¥  ¶'Ifï  Û¸ J z are no_í @  ¦Æsame versionD =˜ Ž 1 isŒ ð	greater than the first.
  òIf the version o ðfirst address is not 4 or 6.

? 1""" @if ( Á(isinstance(> ‚, _BaseAD Q) and1  =  1 Klast0 5)):/ ñraise TypeError('a  R  : ´ must be IP³ 1es,³ ¡networks')M 1if ; .ï !!=B  s 1"%sp   !re\ +5sam?Q" % (j â  | ,r )‘ ! > € DValuô ê â õ Âgreater thanÞ "')£î F== 4c ¢ip = IPv4N%¸ /el6 66 66 &se# ¯¼ punknown¡z¤ ‚p_bits =» ñ ._max_prefixlen“ 6F_int% !ip     #._ RwhileQ  <æ  ¦ nx ð min(_count_righGad_zero™ Ì : 2, i¬ !),} Ý(ƒ  ) ' -{ ò+ 1).bit_length() - 1ü A  neÖ ?ip(h  1 - ¤ + / •yield net‚ r+= 1 <<4   Î™ ö1 == ip._ALL_ONES ` óbreak


def _collapse_ esE eernal( ¦ñ"""Loops throughT% #, L àing concurrentÉ cblocksT‚Example:¿ ‘ :ip1¥ã('192.0.2.0/26×* 2* ,64+ 3+ <128, 4, "92, m3
@[ip1D2 3 e4]) ->> 7  [Ž	é F4')]ÑThis shouldn'ùðcalled directly; itµ 7viae ‹×C([])‚FArgsÁ€: A list¤  's4IPv"'s¦ gReturnJ ? p depend(õ on what we wereÂ cpassed° †1# F²Bmerg+ 1to_ ! =º ²J Qsubnex!{} 46 ¢ V.pop(¿Rsuper" Dnet. " PexistÏ #= s T.get(* K 5if , gis NonR á? [; 0] =A½    ºC ! Ç Ð    # Merge c÷onsecutive subnets
  4del ©[supernet]" ôto_merge.append(& )& ð# Then iterate over resulting networks, skipp „subsumedv F ±last = None 0for< � in sortev ¼ ±.values()):)  Ê 1if @ ais notE   ! ó# Since they areT ,7 .¤ °_address <={  n Q ¹is a given. Œ ¥.broadcastW >W  
«  ^ rcontinu
  Pyield• k ð Q ô 


def collapseo 3es(Ð #es+C"""C& ñ a list of IP objects.
_ vExample— [  b[IPv4NÜñ('192.0.2.0/25'),F  ·  9 1128; _]) ->? 	x B4')]¿ FArgs¼ 4: A¥"orø Â ƒ or IPv6Ñ gReturnT I 5the~dH _(4|6)L GaiseK ÷TypeError: If passedœÛmixed version— 1"""* â Rs = [µ'ip  í + p# splitó 6 �esses anZ¦&  { ipz% Pò	if isinstance(ip, _BaseA;iø - pb ”ips[-1]._Í U!= ip a < r*$ T 2("%I   !reè ofÑT same$Q" % (Æ H   ¸ ’ )Æ' 4ipsç&ip !elÌ Ò._prefixlen =Á 6max 
Ç 3 ¶ m ð  ÿ „:tryÄ  	.  ó except AttributÏ„
E sisz `  ifùG ÐG|“ H  I#xrQdedup ±å‚et(ips))Ì‡# find cÃ”p ranges¦ €? ð sequence and summarizñe them
    if ips:   öfor first, last in _find_address_range(ips)5  9    ûs.extend(summarize7 Z 1))
u õ return _collaps2 Áes_internal(\ ó + nets)


def get_mixed_type_key(obj• B"""RX ð a key suitable ß ð sorting betweenV  works and k besses.Ÿ A÷  0Net) ð objects are not Q ^ °by default;bAy'reä ðfundamentally differen9  ' @ exp[2iont  OCIPv4| ð('192.0.2.0') <=  Œ  C/24'Tñdoesn't make any sense.  There¸ ñsome times however, w Áyou may wish¾ £to have ipñ  º sQ 2 °anyway. If  ðneed to do this, M `can us�àis function asO  «`= argu, ?  ZDed()�%rg«ãobj: either a C or 6¦.v < °appropriatet ^ 1"""-  �sinstanceUs, _Based c ¥¼Pobj._�n!sŽ)M /elO ¨ O oN q €NotImple'ãed


class _IPU  ¯ :M‘"""The mo*) .ê ž Ó__slots__ = (=@Aerty"  k×exploded(self° f�the longhC@versÕ!ofÕ$IPU ç�a string„  D  ×  _ #._n `_shortQ B_ip_5 £ 1comD¥ U  ¦ '"tr	`/rNQse_poÁ- -‘Sname #2 S DNS 6 ª W?f, e.g.I  :6>>>˜4.ippã("127.0.0.1").` ’ Ù >   "'1' `27.in-si.arpa'% g ¯2001:db8::i  ”  P8.b.dÂ ¡ S2.ip6› œ  É Å   	Eò 9¥õmsg = '%200s has no2àspecified' % (~> ,òŒ Zaise §“Error(msgh Z`_checké¹ ,2m$if J < 0® °"%d (< 0) i° ðt permitted as an IPv%d addwress"
  �raise Add òValueError(msg % (a õ, self._version))D 3if $ # >% •ALL_ONES:%  p  Q ô= "%d (>= 2**%d) is not permitted as an IPv%dX ° )émax_prefixlen,�  ”  ð < ódef _check_packed_ü (/ ,² ö , expected_len).   d = len`P& )!=L K  » Sßr (len %d != WKÂ OM]Á@classmethod n³ip_int_fromÊe(cls, Ö_³"""Turn the   dð gth into a bitwï�netmask
g  JJArgs\` @: An@ ^eger,[ .E kReturnH = * &""Õr6 d cls._:0 ^ æ  #>>Ò  Qs 0¸ 0< J ",  
-± Y + jç -¿ .^ +i0 inÇUanded…bformatÌ  „Ž ?| Ç< ÎA: IfÔ QinputÎõrmingles zeroes & ones¢“trailing_+ ñ= _count_righthand b_bits(
 ý  	´Ù è=-	( ; - § Ë @lead¾  à # =	? >>1 Call_- S(1 <<! zE - 1Y 9if \ 4!= ; 
L_bytesº E// 8T  udetails¬ A.to_C (  Êf 'big' 7 "'NÜü  pattern %r mixé'r 0þ‰ g ¬‹½‰ó report_invalid_
� G_str’Á $%r!a <  / 4' %  : Â ¾ ø 
Å ð) from None

   ô @classmethod
    def _prefix_from Âstring(cls,  ‘len_str):8  < “"""Return" € length H ² a numeric K 
7 FArgsE  I 	a S: The5 ö to be convertedE y H ú An integer, the— .= Kaise< ñNetmaskValueError: IfF òinput is not a valid n/ Õ 5""" #† ð allows a leading +/- as well qsurroun ·whitespace,F ðso we ensure tha… 1n't• Ecase+ !ifœ (Hã.isascii() andÅ§.isdigit()Ï Šácls._report_inë _ë 
^ )} ?tryÎ  =	8 wexcept qS Š $F0 <=ð   × 3maxÞ?lenø /rû2len_a ipG] � @"""TTadA/hosœcinto aâ u~  9_c XÍT b�ª 
k@Parse/õlike an IP address.E ¶‘ip_int = , À(FøÀAZ Ç!R • °# Try match1À (this would`/1*0*/Eöa bitwise regexp)â P# Nota2àtwo ambiguous @±s (all-ones#  ¦zeroes) ar_�# treatedr AK	rI“IU I=intIBFpassÞ1# IQbits,» t8u/0+1+/ 9vinstead‹ # ^ï…ALL_ONESŠÔ ;g	O`split_ÔÑ¨  :essLÐHelper functióon to parse address of Network/Interface.

  EArg:   8 ¯: ArgumentB zReturnsF (G õ, prefix) tuple.h 5""" ¦# a packed³ •r integer& Ñif isinstance] Àess, (bytes,/ *))‚ r— T ², cls._max_” 6lenoif notb º [ ô# Assume input a)õto be string or any object representation×  qð# which convertsÍ óo a formatted IPI\ I @  j é°= _split_opd ¤al_netmask/)ñ °# Construct¬ bfrom a¦ / 0, [; %])« aif len �ess) > 1q	8 
ˆ?[0]‹÷def __reduce__(selfzI   ò.__class__, (str+ c,)


_ð_fmt_re = None

@functools.total_orde©
J r _BaseA4C(_IP   "):9À"""A generic”ÛL@This N ðcontains the version independTsmethodsû1are0àused by singleO Î "esô 9* Ó__slots__ = (Ù??int<"ipÐ 0 #eq/ w, otherr?tryãor._ip ==5   ˜  ‘ Band ²3  cÿexcept AttributeError‚ €NotImple (edÏ lþ Ï æñ ,üÿ  È up     +ifÝ !Ý ¾ ‚aise TypÛ P('%s "  !re„!of45sam9_' % (^ „   cñ PŸ 6ip š +ip• ) C  Ç/ <Ó RFalsen€# Shorth¿ @for \0gerpiØ psubtrac !. " isæ Í p# meant²Åever supportB />  „¾?add¿ð?intçþ "zA(int	2) +2	‡?sub™ SÀrn self.__clòass__(int(self) - other)

    def __repr__! :   ñreturn '%s(%r)' % " Q.__clV á.__name__, str )X /stW 2 ô._string_from_ip_« J._ipO Ohash§   E(hexë @ � ò get_address_key± ð  ±._version, 7
.Oduce‰  0 $,58ip,Œ s_formatF f, fmt)‹ A"""R~ƒs an IP · b as a ; 0tedwBing.ž  ´`Suppor öpresentation types arec R's': ã]s thef —¥ (default)õ'b': converts to binary andQ µa zero-padd§ A ‹X' or 'xH `upper- ïlower-case hexZ 1n':Í @same-0'b'/Q IPv4G %'x 678ForÆ  t @,Z �alternateX ¶m specifierÞ !#'j  T±grouping opˆ0'_'†$ s§.7 6"""� ## Éâl eatting1 `if not9 2°fmt[-1] == Ú&  æD (y)uu ðFrom here on dowþª  = u 'bnXx'[ uglobal Sefmt_re ,if w is Non… ž  im² :   V ó = re.compile('(#?)(_?)([xbnX])'[ : <m =y °.fullmatch(h£  Cm A /–super()._«= > 
$, èS _b¸A= m. 's(�  # Set some{ XsP  ifÍ> Z= 'n'˜ !ifŒ› ì4#  ¿  ‡‚  þB # B $ist ÎEipv4|  9 ;els›  O �x'  # HexÊL NÉ bÉ ƒpadlen =Ï Õmax_prefixlen’ Ž 7 	V // 4Ë%if“
!D 3+= 
  8 I - 1< Ú= 2 0by&0x; : ‰ i%'{T 2}0{| !}{ Ting}{f}Êð
@functools.total_orde%
zò _BaseNetwork(_IPAÕ  EÀ  """A generðic IP network object.

    This ñ)class contains the version independent methods which areE tused byb !s. 2"""d ñdef __repr__(self):!  € ñreturn '%s(%r)' % " 1.__’ ñ__.__name__, str ())X /stW 
6/%dV  _address, Ž §.prefixlenX Rhostsn ­ à"""Generate It ñ or over usable 6 T in ag ë kóis like __iter__ except it doesn't  ƒ° .Óor broadcast Å 'esd  t l   = a = intË .  )Y V .  0 Pfor xé crange(X V + 1,¢ ç � RyieldrQ å'(xy± B c    M Î =Ê  Ù Œ Î sgetitemú7, nH Á ¢B–if n >= 0¿ ·   +! ®
(  , óraise IndexError('s� out of ý'x5 ÑYšçï 6+ n4 Jelse{ en += 1› U &if¨  ¸ <`
;  , ¶ = y 	©%ltÖWotherÚ gáot isinstance(" ‚, _BaseN‚0 ¹ :åNotImplemented#if;—1!= T #._ 
CType¼p%s and  Qre noÂ e5samí+t  –   Ú,{ )ÇŸ äú ¦  ­ û  [ ¤" <l  ¥ z Imaskr   j 
 ! b   Z ‰XFalser/eqø?tryp Îª, =¼ ›x s? UF À            ñ int(self.netmask) == Uother 3)
  õexcept AttributeError:  & ñreturn NotImplemented
# Ádef __hash__x ); 7   (— ñ work_address) ^ž 	³ )\ ƒcontains` !, É g ò# always false if one is v4 and the4  !6.¸  × 1if w ²_version !=) . Ì  0 Ð Fg E ñ# dealing with anŸ @ netç 	m ±isinstance(% ‚, _BaseN+ Ò m L” Jelse» ,# $ d � b._ip &; %==  Ñ ¸  ¦�overlaps¢p"""Tell› q ˆspartly ÝSed in|5"""É r 5  º� 1 U or (2  × / ”broadcast² 1  5 ·4  N d  3   7 m  9 #))Ìñ@functools.cached_property»  GE N¢ o_class_|`  «  ž2hos6· 3 ® $¤^e”_ALL_ONES % e¯_prefixlent ¡'%s/%d' % ! ;,m G n K Žl sl D i Jj E k 4num=e±Õ Ð"""Number of K s7 Bÿ current subnet.¦ EÉ9) -åÈR) + 1J@î© æRÙ1# R™ }DbareäÀ objects (raõP than� õerfaces) allows for`# more‘@sistê ñbehaviour acrossI!k %, í J l~¡individualP9 &esômsg = '%200s has no associated2  êiBtype�ð,)
        raise ñNotImplementedError(msg)

    @property ñdef prefixlen(self):  + preturn  %._& G  9 ñ address_exclude? w, otherF Ó"""Remove an 3 ò from a larger block.Y  y pFor exaÅ :    @ õ1 = ip_network('192.0.2.0/28')¾ / 2/ K1/32/ Qlist(c . Ü   Y2)) =`  d n[IPv4N�  ^ /,  }2/31'),K . o4/30')K v8/29')]& orF 68¯2001:db8:: ð :1 1l=#É` " 0 _2/127R0 _4/1260 _8/1250 >...Çu ™8000::/33¯FArgsr P@@: AnÈY ×h÷	 object of the same typeDR½\ ´An iterator< ŠIPv(4|6)Z ¡s which isÿ	ã Rminusçp Kaiseo AType€A: IfI B and; @ are„ ”differing	l °  versions,#if= “is not a 
ŒGValu€ Y Ò  :  co^ñtely contained by¥ Ö 5"""� !ift — 2 ==’ #._ 
Ír$ TA("%s  !reP ÄD U" % (x    † lÚ $ ¤ ±isinstance(ö s, _Baseä� 4 ¤ ` ™ Q s  ¡.subnet_ofi –2('%Ç‚`in %s'ÿ P ,�)Õ!== nôð# Make sure we're ÷an 8=W?~  Ü€_class__² /¡ .C _0?ess²  c e .Y)UPs1, sº èV&s(¢while s1 !¤ Àr and s2 != ‡other:
  1if  ê.subnet_of(s1)$  / ‰yield s2=   ³s1, s2 = s1D 9s()& /ele 2e 1? 
e 2e .se¶ ð# If we got here, ð e's a bug somew .s ñraise AssertionError(' ý	 performing exclusion: 'D  »  ¡'s1: %s s2 ~ 
 ?' %A (s,¹)m‚if s1 == 
À– ¹/ 	Š,el`\$XBT*P‡ô
def compare_networks(selfx`B"""C* ñ two IP objects.
K  ðThis is only concerned about•l qison of uintegerC  representa‘& œ Ñ addresses.  m ‘means tha` F ðhost bits aren't� PsiderŽ  t all in t¯ €method. E…you wantH #to³ %e S  , ' õcan easily enough do a9 Ð'HostA._ip <  B '+FArgs] =$&An\[kReturn3 ID`IP ver s1 ÀB and" jtsame, rH «  | 0-1 XRelf <7 
œ ²  eg: IPv4N&ÿ('192.0.2.0/25') < 1128  	n  , 6J ð2001:db8::1000/124P 2  ¦ ?IPv6 26 	4 0Ó -	 Ó  ƒ  ==¨ ò &4'‘ š Ò +==€  9 Ó 		4 ¦>¦	 Ò ‡/ >Ó 5Ó   s+ >„  6   Ú 9 RˆÝb  TypeŒiéð
are different.

        "C""
  õ# does this need to raise a ValueError?0 õ
if self._version != other :,  c L 2TypI �('%s and  ùre not of the same type' % (E  I 	  ƒ ,x %))+ #› =› ¶ below here¦ Ò ònetwork_address <` . 9  ’ •return -1… O >O N Ó „  Ú  á HmaskÙ   Ñ  /  É   ? Á !!0
!“def _get_¸ `s_key(Î)H B"""NŒò-only key function.H  {R{ Nô object that identifiÕÏ#' s  ~Œ  D 0netÄ 0. T e ö is a suitable "key" argument for sorted({ ÓPlist. '()§ "mñ 0,¶Ÿ   ¡ )÷  ?qsubnetsD ò	, prefixlen_diff=1, new_ Z=NoneXThA ° which joinôAmake‡@currç h É "In   as) !at· ¡ contains «eone IP_¥ .� 0len¸!32BPIPv4 JM± " 5128B  mðIPv6), yield an iterator with just ourE® FArgsS ìd +Ñ: An integer,Ù PamounEeVu lengthŒ  E ó	  should be increased byB  Ö›be set if@  g0lso( .& $  : ³pdesiredÜ
œ w mIbe aF ó	  larger number (smallerC )0Ôƒexisting 
�  Û 0 
Ñ Œ ©
Ž ~È³of IPv(4|6)ËsÊRŽÌš!
Ü ˆ Atoo ð  e  Ú E  OR¨  àI  ×�� are both² X  	E  � a 2thanbl —C µ@meanŽ¿ rÅ ² `|
rÐ_max_prefixleGn:
  ©yield self ureturn
 ú
if new_prefix is not NoneN 
' <X .6 +le{  † óraise ValueError('new g õmust be longer')Ž  : #if' Úlen_diff != 1�  ( b 0can¾ <setB 7andç q • n =* , -ê 	:: :< 0§ £ 2 � length Þ 7> 0™ •\len =‡ + +ã 	˜ 
= >= ?max²© 	’ n'º   %d1ýinvalid for netblock %s' % (G  K 	ž ,� &))À Àstart = int(¿ö.network_address.8end( •broadcast* E + 1ƒ …step = (X �hostmask)' L) >>S ­   Ú wW ¡ in range(¨ p, end, \ )ü`currenÉ Å °__class__((  Ì ,iFlen)Ù  u ÀF ²def superne,² (=1T =Ç– e"""TheB ó containing the k  Ä o.t  ‹ JArgsÝ 3@: An¯Qeger,L aamount + òoŽ # áp shouldõdecreased by.  For example, given aØ ¢ T  /24º  îa† of 3, aÿ OwithG  1G   Ü.'edRAfAn IPv‚ hobject6  5 A: If.. ó-Á û< 0. I.e., you have£a negative< v.( I  OR Is C ¨�   are both \è3Œñlarger number thançaT (' ]means�PsmallL '5"""Ä i>ß= ==�¹gÛ
ØÿQÉ ÿ'_short *Àe ValueErrorò('cannot set prefixlen_diff and new_ G')
   , s= self., Wlen -< 
; P  $ 6 L + -„ 8 'ifO  ; E< 0:  ˜ ùraise ValueError(  " w'currenè ƒ is %d, khave aƒ � of %d' %P (ó ½ ,9 )1creturn#š_class__(¢ 2intQ ønetwork_address) & ( Œmask) <<o ,¡ 	i	 "))�‘@property ò def is_multicasŒ )có """Test if the �  AÕreserved for @ R use.i  |RsP   ÿ A boolean, True\  aQ s .¯  ?   ñSee RFC 2373 2.7… wdetails 5"""7 �m. 6  m   ôPbroad&¥	8 `ÁstaticmethodH  d÷_is_subnet_of(a, be:try"Ñ# Always fals!0oneu v4ž ‹Qother 6õif a._version != b 
f  Ø ?3Typ>Qf"{a}d €{b} are &oþSsame Y "çH éK (b.È] <= a "an ;  -b.d  >A   ò except AttributÉ 
ê æ °Unable to tß›� containm.:¡  §f"between 0" ñR  í ;!, ¯ô2"""3is > Ø"a D  Š> .Ï  ] .]  p Š� 3per" )’ F ” À ,
$‡T¥
-†Y wTIETF A fƒpwithin xþËÿh r IPv6 N»o range€%S  ² 7 W	ðlink_local(self):
  ó%"""Test if the address is reserved for link-local.

; • Returns:   ÿ A boolean, TrueY 	Çper RFC 4291W 5"""R rc ó  (self.network_¥ @.is_˜ _˜ E and7  ‰   7 Ÿbroadcast9 )Ñ ‘@propertyE ádef is_private )è 	5(is6 alŽ t7@  º sæ =0ª  ç   ôiana-ipv4-special-registry or  6 “ yÚ v6 s	oglobalr'_ublicq86not?peruP s º‚¤!unñOfied6
	Ý5 ”i# 2J Ùas defined in1 ï§2373 2.5.2{ |	s ö: „	�loopbackP$a 4 Ü W	¤T  Y3} YÄ V7 ò)

class _BaseV4:¶0""" Ã IPv4 object  øThe following methods are used by4 ñs in both single IP[ esù þ & â__slots__ = () ±version = 4 ÷# Equivalent to 255.  Hñ 32 bits of 1's.7 �_ALL_ONES[ ò2**IPV4LENGTH) - 1Ð_max_prefixles & E q# Thereý àonly a handfull €valid v4ß ðmasks, so we cacheºSm allJ Ðwhen construc‹ð(see _make_netmask(ñ)).
    _netmask_cache = {}
 ñdef _explode_shorthand_ip_string(self):,  I ¢return str F Á@classmethod+ W Dmakey —(cls, argL ³"""Make a (Ÿ ð, prefix_len) tuple from the givenC bument.z  ” 1Arg v can be­ à- an integer (D _ � length)«  B 0- aÓ Ðing represent 3 ¿ (e.g. "24"> à ? C55.2 0J 5"""”  ifì Ä not in cls.LÅç  Â ðif isinstance(arg,ù m %   Plen =` o     !ifs S(0 <=Ž - "<=ƒ Emax_C _   C ¬ äreport_invalid» (< 	z 7els¸ E   :tryæ     ä# Check for a ]#in± à  mg  <   †  ×  _lß   ³D ‚except NU¯ValueError® aor hos– á±dotted-quad¸ ¸ ­  þ# This may raiseƒ 8 à  Éñ  íí [Ð= IPv4AddressÌ.#8int3Ý ¾ K ½t[arg] =»ø5lenlj< þx5ip_š Æ~è µ@"""TÎ ç^$IPHinto? kªcomparison~søh 3: AL ,¿2IP  < RN? EThe - 7 as† ;  ÿ:  � Ì‘ isn't a �Ï 0 V �}? 
â |? o #('  Š < ¢be empty')° „octets =–split('.'4 ifÂ(* o) != 4€ Â"Expected 4 >  [S%r" %o ‰ ^rAint.	’bytes(mapñaparse_W ,^ w), 'big»  Á?excÀ &%s± T(exc,· )BNoneKûðparse_octet(cls,ã octet_str):
  ò"""Convert a decimal) € into an eeger.
5 FArgsC  J [ ÷: A string, the number to parseE kReturnH 3The~ /as| [Raise6 áValueError: ifx ‘ a isn't� Gctlyâ ×from [0..255]• 5"""æ bif not�  6
ò rˆ  z r("Empty/ 9 µpermitted")T õ# Reject non-ASCII digits.# w (Â  x â.isascii() anda  < '()Ð �µmsg = "OnlyÓ* %s ” f in %rí  8 Ó  I %q Ç QWe dojñlength check second, since ðinvalid character e©ï °# is likely&ñbe more informative forK Euser8 fif len&Z) > 3£ ¿ Æ= "At most 3„ 	8óHandle leading zeros asu 
 øglibc's inet_pton(I0See6øurity bug bpo-36384ë z != '0'
Q[0] = Lœ *reŸ-@$to+“ (we knowÝ0 ar"6galú Ò Pint =7 ÉF, 10' #if€ * Z> 255ã ´ "OæQ %d (/ )í $" Ñ6intg r�k ìÁ@classmethodŽ@def {@ing_CÒ_ip_int(cls,  Œ@"""Tã� a 32-bité  K  @o do¢‡notationŽhd 5: A—g§IP address? b.   a¬ ng” "6ô'.'.join(map(strò.to_bytes(4, 'big')))ZIúreverse_pointer(self?Â  I- S DNS 1 F namOIPv4 ñ This implementsL Ò  describedú ·RFC1035 3.5C
î ¯ º0s =7´ ñ.split('.')[::-1]-SX"Æ _D �) + '.in-¼b.arpa'‘@propertyI  - max_prefixö*ˆ  )._* À

    @propeñrty
    def version(self):   preturn  #._$ ñ


class IPv4Address(_BaseV4, 	  1):
J ñ"""Represent and manipulate singleL  7 bes."""; ò__slots__ = ('_ip', '__weakref__')(  Ä �__init__Å 2, a› …  Ï  W     FArgsé   1 ô: A string or integer rÁ    th² z  :  õAdditionally, an< ñcan be passed, so5   Iñ '192.0.2.1') ==Û(3221225985).C àor, more gener‚ ! d Hint( t )v <  † . [RaiseQ¸ óValueError: If ipiá isn't a validd µ.Y ´€# EfficiHôconstructor fromnãif isinstance(u ,( â €ß£check_int_+ 3 )- Dip =­ 	 2¿ 4# C©  :ª �a packedA ² _bytes´ N · ?, 4º @int.‹ _[ é z, 'big'6 Ñ ðAssume input argum� toä9¦any object<a/ð# which convertsšÀo a formatteŠÕ œ`_str = º ³ ‘if '/' in] * 
år¨jš�("Unexpecw A Q%r" %G 6essb  6P —  | žh@propep³ªÙÛ"""The binary7„ of this‘ $ ¾  ¥1 v4Š 7to_` O._ipˆ 0is_˜Orved� Pest ix ew ô is otherwise IETF A µ! R9ÿ A boolean, True[  ¥within the' à d &×Network rangew , £   !._5Uants.÷ "_nM ³
ªò@functools.lru_cache(
 q¯is_private<
´ =`allocagCfor @  … sÍ CBŽI perDðiana-ipv4-specialÓ-registry.

  5""" ñreturn any(self in net for 0in  ò._constants._private_networks)Z ‘@property\ ñ@functools.lru_cache() Ñdef is_globalv !):  Ÿ �  u @ not�   
� Tublic€ A and+ ( $is  – { œmulticast~ ñ"""Test if the address is reserved@ G useYRMsÎ  Ò ÿ A boolean, True\  O . 9 ÁSee RFC 3171w wdetailsq Ê  6f 9!¿unspecified#5 £ ii xJ „Ùas defined in( $g5735 3w .==Ño _ó�loopback$a 4 Î ©  	�T 2per(7330Y Ó  Žlink_loc»= A -A ­ $L  7927Y 1ink™ ð
class IPv4Interface( A"):* Y�__init__,ëÜ \t, mask †Qsplitu€_prefix(% $esU o .d  U )  û.–! =µ N¤(W | þ ), strict=False? ¡ N  V   xk ³ 4lenÐ /  
)d_- >@hostc >5 †  r., ]  > S__str{= ¡'%s/%d' % ^ .- âing_from_ip_in
e._ip),å  T
 ÷ ú� #eq€ w, other‡ Ôc_equalšA=.__9 � $ifF; ðis NotImplemented ¨*ot' À:
          ó	  return address_equal
  Etry:   . ôself.network == other 1 úexcept AttributeErrorP ô# An interface with an associated f ¥is NOT the`  ‘ �# same as7 'un9 Ò À. That's why> [ hashC Qtakes  extra info– ©o account.1 aFalse
 °def __lt__(,)ì � Ò_less = IPv4Ar.8  T  Þ %if™:  ÖotImplementedb  / ™ N# M Í³ ½" <¼  %orA  c   ç $ I and¹ )D ÔWe *do* allowI eãd—-às to be sortedçñ  is considered V ths'll\ ñ Kóì†  (\Q_ip, 2°_prefixlen,n  ãO_-2)))^ó__reduce__ = _IP:VBase. , ‘@propertyr ˜!ipf ¡ …" C._ipr F  š½ 0 R ¡'%s/%s' % ! ó._string_from_ip_int Aip),¢ P
 ,– qnetmaskZ ” Ml ‘ ?hos’ Wm ‘)


class]Nœ (_%AV4, 	  "):,P"""Th7 ’representhñmanipulates 32-bitY �+˜"..P éps: [exa§Qs for: } õ('192.0.2.0/27')] :7 í7 'N.þ ,  0. (31+ ”broadcast`4 — (326 ñ, E255. (241 áB: 271"""å 1# Cjôto use when creatingN� objects1 ª _Ù	8[  áV__ini{> , }wct=Trueà"""Instantiateó a new IPv4 network object.

  UArgs:   ðaddress: A string or integer represent ”the IP [&_ )].J ÿ  '192.0.2.0/24' C55.2 0(  0. <255$ ðare all functionally   qsame inÏ. Similarly,Œ 1Z Ã $1/¢  * ,32 ¡ *so¢ ñequivalent. That is to say, failfo¬ óprovide a subnetmask will create anè� with a " gof /32û íA  If(# @(por>a after /= I�argument)¤ ‹given inš òdotted quad form, iÓ ˜ Ad as”²  if cstarts© O ñnon-zero field (e.g. † ³0 == /8) anZ 7hos[ M 	i  W 0€3255Z ,— <theL ±ingle excep0 ofu2all° MPwhich-tþ I ¾ Ê  0.Œ"no®1is eÂ, a default Â S MusedÊ@AddiŽ  ü,� µücan be passed, sQ "N!(ï ') »3221225985)È àor, more gener� !  G êInterface(int( w )y @  ÁB 0 Í[RaiseÏAÏ°ValueError:g#ipçá isn't a validf   
ÍNiH  ÅJ H ;forÂ a„] V  xc:0TruÐd8Ãž  ;notf `suppliÞU  """$  ; ,`à= self._split_ €_prefix( Fess)W* B+ Qess =,^5 1  ,i ^ Dlen { Smake_=(+ A €packed =x(N  þ  + 3if . &. Q 3 != 
ä!ifÜ*ct  4rD ‘�('%s has ^Á bits set' %Ø ˆ  < NelseR À ?Â ª N   Mc Ðmask))

     ò   if self._prefixlen == ( 7max w- 1):
  & shosts =G u_iter__' /elb ^ 	ñlambda: [IPv4Address(addr)]
m ’@property ñfunctools.lru_cache() Ñdef is_globalé x p"""TestPthis b @ess  òllocated for public networks.…  zReturns*ò A boolean, True` e_ ñnot reserved per¬  P   ÷iana-ipv4-special-registryy 5"""5 r…   (V ä .ª _Ò  n KNÁ õ('100.64.0.0/10') andN  ƒ  ôŸbroadcastO P  ž P ðis_private)


class _Ÿ ƒConstantOP_link‡#l_Ð + =Ç S69.25È 26')˜Ÿ_loopback7  27û E.0/84 Qmultiå l !22h E.0/45 g 
e� û 5  M[| ¥0¥ ," 1# ì G G' P72.16• _/12')&  92# _.0/29% o170/31' 2L 4% 
0168u ?/16' 38.1& 5& 
051. ?0/2u Ÿ203.0.113œ $24¢K F55.2 )/3\ñ_.8	j k!unAEfied»BT'Ÿ  Ò
} 4._cŒ+ =�´rBaseV6:n 0"""  ¡ƒ6 object¯øThe following methods are used by4 ñs in both single IPüÊ es¬Š & Ã__slots__ = Â_version = 6$ €ALL_ONES$ ò2**IPV6LENGTH) - 1$ õHEXTET_COUNT = 8 `_DIGIT< òfrozenset('0123456789ABCDEFabcdef'ƒ_Y �q :q# Thereð	only a bunch of valid v6ò Ñmasks, so we å‘ them allŸ q# when ºðructed (see _make_nòetmask()).
    _n Á_cache = {}
 Á@classmethod ”def _make3 ±(cls, arg):!  O ³"""Make a (Y ð, prefix_len) tuple from the givenC bument.z  H 1Arg v can bea à- an integer (D _ … length)Š ð- a string represent 3 ¿ (e.g. "24"> à ? C55.2 0J 5"""”  ifì Ä not in cls.Lç  ðif isinstance(arg,ù m %   Plen =` o     !ifs S(0 <=Ž - "<=ƒ Emax_C _   C ¬ äreport_invalid» (< 	z 7els¸ E   -  ~  _† _· ò ‘ < rÐ= IPv6Address†ˆ._ip_intF — 
F Ë K wƒ[arg] =  ²5lenÑ _retur³< ¸2š Ù 8 ipè o@"""Td !anß  !  óoô
$s2T 3: Aú,e -N > RÒ A A\7 aeá  „\Raise6 % ÀValueError: ¼� ‘ isn't a 4Ú º� %!? 
à r}  ? o #('  . < ¦be empty')¹ tparts =	ˆsplit(':# 3# A|÷ ñ needs at least 2 colons (3 P E Q_min_ E = 39 ifš( F) < ' 
Û „msg = "Ak "%db � expected2v%r" % (D ,Ï 
â'7msgA# If í 0hasiòIPv4-style suffix, convert it to hexadecimalD ÿ `if '.'¥ ë J[-1]á :try 6 0pv4¹ Ó4Ç.@.pop§5_ipN 4 nexcept~ as exce 0"%s° U5excN)¢INone{ Û À.append('%x'Ž$(iÅ ú>> 16) & 0xFFFF)–= < 5 s � caMõhave more than 8–94–ð# The extra colon ðcomes from using the "::" notation for a  Cle
  `# lead1 €or trail ¥zero part.) P_max_ õ
s = cls._HEXTET_COUNT + 1+ qif len(- F) > ; :$   ömsg = "At most %d colons permitted in %r" % (E ¹-1, ip_str)O õraise AddressValueError(msg)
* ¡# Disregarö  'ð
endpoints, find '::' with<h¦in betweenð# This indicates that a run of Cöes has been skipped@   Æ_index = Non” ©iû ˆrange(1,OJ- 1)G if¨ ¯Js[i]  h!if~ m !is/  r +  / ð# Can't have moreÚ Qn oneJ ,  Ë, Ê»F Â
k  	@iáyP_hi i•€e number• ‚ to copy.’above/befé ä #W?_loM ±below/after� Jê ‡ñ # If we found at,N ðn check if it alsÇ 2verå Åb *ò  =“ " Jlo =g`-Ý 3 	r0r v +-=; ? ! ‚NLš‡':' onlyN!as™ Ô d -9%r"Ø  j   U$ %Iú  # ^: requires ^:š 	ò /-1ó ?lo ó *loY  ¢   ó T‚ô T&:$ô 9::$A¤ ?pedõ"- å `+‘Js_lo–#if I >< 1ÿ PExpecøaRotherD •ñ	í(¸L· Jelse£ 0# O†  wise, alloò ”’ entire av [7vhi.  ThÕ å%# ¦ð could still be empty, but fÐse_hextet() w# û	Ÿà# for that.
    õif len(parts) != cls._HEXTET_COUNT:
- 	 ñmsg = "Exactly %d ? ý expected without '::' in %r"E ð	raise AddressValueError(] =% (‡ ©, ip_str))K bif not� ?[0]­ ðLeading ':' only permit® !as? ? of± (� ú  # ^: requires ^:’ 	¯ /-1° _Trail± T&:$± 9::$`ÚW_hi =("  olo = 0  qskipped  :try`# Now,ˆðse the hextets into a 128-bit Ueger.J  “aip_intb    Pfor iRrangeãJ_hi)z  . A i<<= 16[  |bparse_  U ;[i]•‘ P   *× 3ts_
	` ¤ -o_lo, 0¨ P`returnY5int˜ vexcept ”z as exc8À "%µ óv % (exc¹± from None
m Á@classmethod Ydef _`Ccls,ý„ ó"""Convert an IPv6( @ str9:n3c  ÑFArgsI   Î b 3: AA ,ˆ�number toÅ2se.º  4 R=I T» 5a~ Rù7 lA: ify ±input isn't‘ kaä  ”  NÔ  ’ ·  [0..FFFF]¨ &""}ö
# Reject non-ASCII digitsQ¢€ö_DIGITS.issuperset(-£Ì 0("Oj3hexf u  %Ñ 0tet{Dq# We doò
length check second, sinc(ðinvalid character eG°# is likelyÅðbe more informative „ sEuser8 ì J > 46 «Æ= "At most 4… sê Y  ©) J LÐmeans we can Q ð Ã 0int  vPs çÀ int(hextet_ñstr, 16)

    @classmethod ódef _compress_hextets(cls,  !):)  > C"""C+ Äes a list of* .d  * ' õstrings, replacing the longest continuousq €sequencee b"0" in2  x ð with "" and addN cempty g 5 atH  g `beginn' Qor atI 0end[   6 â such that sub 5tlyI @callC ”":".join(%Ñ will produce\ UÕed version ofI  s @IPv6»  {<FArgst Ne 5: As¯ !s,k   D to v P kReturnS J 1 5"""¨ ÿbest_doublecolon_start = -1$ ulen = 0! @  ; ”for index� •enumerate
0i“z == '0'  Rs 6+= Ð  !   8if ( ú  û Q  0 1# SRof a <»ezeros. ,  a  ð . Ž  )-> Ÿ?len� qThis is2t¦  so far­ n ) =%=lenº  ì ; N	=  	? NelseÐ 5 l m   $ X ´^ /if=J > 1q º  5== ( f +b  †  = Ilen): a# For :® 2add6a Ó ­ F= le«
ß  A @y+= ['']ˆ  [² ï : _end] H  Ð  ’f–Ö |  Ý0Í „ $ +ž�r
 fÂ_from_ip_int Z=NoneTjð a 128-bit integeÃ toq ÷adecimal notationwøg D: AnI ð/IP7 çÀ          A ñstring, the hexadecimal representation of" ³address.

  uRaises:   óValueError: The 6 ð	 is bigger than 128 bits] ‡all onesZ 5"""V �if ip_intD JNoneq  æ= int(cls._ip)¤ > !>  ŠALL_ONESF rË  ½ h('IPv6¾ §too large'^ óhex_str = '%032x' %­ ¿ Òhextets = ['%! 3nt(9 ö[x:x+4], 16) for x in range(0, 32, 4)]Î M Ì 0comª#s_  W  m )~ ö return ':'.join! " ðdef _explode_shorœ@d_ipÕ –ing(self)*Á"""Expand a / Xened *Ä;ArgX H: A z? Rº B 
: eŒ ‚ F‘sinstanceØ ,¹ wNetworkå  Æª   =© - ".n( _Ðb elc[ ŸInterface]  ² w   >elsâd1str� �þ ª û )T_fromÃË ° z³	2par±, ¦¡ ¹   c(_Basehu¯P%s/%dM(º• 2), é –prefixlenÙ < ë1 <é°reverse_poišK	Ýtî- S DNS 1 Q name 1·ñ This implementsL ðmethod describedä·RFC3596 2.54²‚ P_char?ù ­ð d[::-1].replace&N, ''.ø	M ò ) + '.ip6.arpa'# @sïc¬ ó split_scope_id(N	6±Helper func0�to parse` B5ingJQwith O 7 idú ÁSee RFC 4007dhdetailQA(Ð,‘ §_id) tuple˜ ’, &ep1   =ð@str.oi 7('%‰¦if not sep4 *`_id = Ôq  O2 sp or '%'44 
J »Až	ÂZnvali Ð: "%r"' % ip_cstr)
  ñreturn addr, scope_id
 ‘@property ñ	def max_prefixlen(self):  M J   )._* O oversioI $ ñ


class IPv6Address(_BaseV6, 	  "):o ñ"""Represent and manipulate singleL  7 bes."""; ô__slots__ = ('_ip', '_ Â_weakref__')5   �__init__,U7ess$°"""Instantiˆ Ra new‡  �²ess object.T  WFArgse  + ô: A string or integer rô    thå L  >  ò Õitionally, an< õcan be passed, soÜ9 |û'2001:db8::') ==+  Ö \ö(42540766411282592856903984951653826560•o àor, more gener® e � Hint( 	  )¢ 	/ 1[RaiseÕ äValueError: Ifìá isn't a valid Ô jä    # Effici§ôconstructor fromš.ù aif isiC3ce(
,( f [ ‡£check_int_+ 3 
l- Dip =­ q L  y = None" ü84# CË  ˆÌ �a packedc Ô Hbyte<Š Ö N Ù O, 16Ý @int.Œ _\ , 'big'6 ô ðAssume input argumÕ toUª3anyæ­a�Rð# which convertsßÀo a formatteXû á`_str = Ü Õ ‚if '/' iì * 
Vrë  [Ý�("Unexpecw A T%r" %Çb ‚ ", P= EplitH£  ˆ Aà‰3 !ip¾µC7 x3strw ip_  €uper()._ 6__(´ ¹ * |+ '%' +À ,if Celse5 õ† Nhash‡ d   (L._ip%)I #eqG w, otherÕ  f™ess_equalÜ 5 / KišÀss_equal is ÷NotImplemented:
  zreturn # " ÿif not address_equal@ UFalse7 U õself._scope_id == getattr(other, ' ‘', None)
D ‘@property Ddef E (T )ƒ ð"""Identifier of a particular zone 4theÄ "'sL .j  
÷	See RFC 4007 for details# R&sx  8 ¢A string i‚ y  k w  € if spec¨ qd, elseñ d 1"""ï  [ A² opacked ò
The binary representation$is.|  §v6_int_to_` O._ip¤Ïis_multicastŽ 0est "Q@ is — Arvedz@ G use€ßboolean, True\  &a Q s .d hû2373 2.ÿ  ˆ@ in  Æ._constants.�_network·4is_ü .9•wise IETF=+/vwithin 1	(© r IPv6 NÙ h range'( 1anyÞ  ,xäx 7b 6sg	¡link_local\ 
Th A -A :/º B perH7291W   þ  ˜ — =Osite* A  Note that ¨# +ð space has been dY�cated byÿ F3879fÀUse is_privaZ 5o t � 	"ins ` ¡of unique �Æ¶es as definy G4193x4$Ï035175.6] Õ EÆ Õ	ñ@functools.lru_cache()ø   Cò
RÀ is allocateód for private networks.

  …Returns:   ùA boolean, True if the address is reserved per; ðiana-ipv6-special-registry, or; ùipv4_mapped and isA Z !inu Q 4Q Æ 5"""E ` w= self. ' 'f   ™ Šnot Noner!, C.is_RN & @any(r 0 inm}0net   Ä._constants.C _•)•‘@property\ Ñdef is_global[ )Ÿ r"""TestŸ(is ƒallocate Public’ ÿtÿ +©²= U &`!unaOfied
	·5 Œ iý J xÑas defined inº  M  çRFC 2373 2.5.2{ ¹�_ip == 0�loopbackþ $a 4 ³ Š 	RT  3} 1L Ó FTIPv4 uÇ ) IõDIPv6/ &-a J #, »9the÷v  m j§ otherwise� 1if Ø .ö>> 32) != 0xFFFF	 cƒ  Á„   ‡ Aõ N &F  J {ateredo5 xòuple of embedded + ? IP^T<  H(H r, client)A  ) È Ùo×  ï €doesn't H¤ar to be a† ª(' ©start withF “2001::/32 Z €	#96€ 9 O0000„(…QÔI64) �,£  “ < ~ 	5 Á ð@property
    deóf sixtofour(self):
  õ"""Return the IPv4 6to4 embedded address.
3 0 sD  K T> -> ð if present or None 5theV  E l ÿ doesn't appear to contain až 5"""T 1if ð ú._ip >> 112) != 0x2002Á r › @   A(P “80) & 0xF �)


classIó 6Interface(IPv6A "):IÁdef __init__T ,j� �, mask = ¹€._split_ €_prefix( Bess)X  Go .d  )à S `networb  8 N (W | þ ), strict=False? ¡ N @.net 
k ³ 4lenÐ /  Ç ñ@functools.cached_propertyR  >1hosc >5µÜ ., ]  > S__str{= ô'%s/%d' % (super().1 !),‚  h u Ì ”p #eqo w, otherv Ã�_equal =>0=.__9 � $if5; ðis NotImplementedn:not' ù	„ b ?try. é ½2 ==Ò  õ K> úexcept AttributeErrorP d# An i*ð with an associaÂ f  Ü  OT§`  ��# same as7 'un9 Ò À. That's why> [ hashC Qtakes  extra info– ©o account.1 cSlÍãMlessâ8 n â:  	á
N™ ú _3 K Ë@»* <Ë5 orA  n  
5 an8„ 3ÔWe *do* allow»eád•Us�be sortedå
L/# 0 isL€sidered !0 thq'll\ ï IÔÍ„  .,¿´@len,n 	{ƒÝ Ñ)?ó__reduce__ = _IPVBase. ˆ@'À    def ip(sself):
  ñreturn IPv6Address(self._ip)
& ‘@property ñdef with_prefixlen0 R ¡'%s/%s' % ! ó._string_from_ip_int Aip),\ “  � o – qnetmaskZ ” Ml ‘ ?hos’ Wm “ ïis_unspecified&qÁip == 0 and  Šnetwork.D $¯is_loopbac�U _g 1g A �


class¦N‡ ¡(_BaseV6, 	  "):� ‚"""This 7 ¡representsg ñmanipulates 128-bitZ  â "s.E ñ
Attributes: [examples for. õ('2001:db8::1000/124')]É.N "_aW:6 d= &')8 Å1 8::f& Ÿbroadcast` 	: ·_ _ffff: 0ƒ “R: 12442"""	 1# C³óto use when creating � objectsü È _´=/S  {�__init__»,I  , ]wct=True÷ñ"""Instantiate a newX  0‚ ñ yFArgs  ­ 1: Af ång or integer [ × 2the^ û ) 1theß  J  !IP†>/Ž.%  _/128' _0000: ; :V ðare all functionally Õ bsame i&ü.  That is to say¼Afail€o providy3subê R willCe an‚Tå  a Ë@ of È ¤HDAddi¦ ,J ”ûcan be passed, soX  ì Å[') ==+  Ð- ö42540766411282592856903984951653826560Ë¨ àor, more generTe �   ?'))¢ 	/ 6… À   strict: Aù% boolean. If true, ensure that we have been passed
  A6 û$ network address, eg, 2001:db8::1000/124 and not anH $IP< T on aQ I  F %.
= uRaises:  œ A„ °ValueError:Ý š ô isn't a valid IPv6y .F {NetmaskF 0the›   J H 9for> O  an] V ñ strict was True&Ÿ  ;noth †supplied¾ 5"""$  ö !, ¯ à= self._split_ €_prefix( Fess)W* Ô+ Qess =Ñ ^5 )h 1  j ,i ^ Dlen { bmake_nY(+ A Ôpacked = int(N  S + 3if . &. Q 3 != 
2if f
  0rD “ñ
('%s has host bits set' %Ø ˆ  < NelseR À ?Â B N  #õ º è ç~"= RC_maxô –J- 1)¼ ¸  ö  í …__iter__§ /elb . 	a \ �lambda: [€	R]…1defsº § à"""Generate It âor over usable6 ' iD/ô   This is like Þ á except it doe!¥return theû ô  Subnet-Router anycast g ‚FÚQbroadT  
Pfor xì drange(k U+ 1, 7 - +èQyieldÎ.U ƒ_class(xK‘@propertyþ  Žßis_site_local– pTest if2 h�reserved ¬  A -A -3Notn ]# F @spacˆs‡ödeprecated by RFC 3879ÿ°Use is_priv%Eto t› %isV  à ` ¡of unique ¡ ø  �¶es as definy G4193Ê R4Žc,Ü#2perÐ —513 2.5.6] T�†.öÉ.© KË  Ï ð     self.broadcñ.ast_address.is_site_local)


class _IPv6Constants:

    _link) °_network = ) N Ó('fe80::/10')3 `multicr 3  f03 82 tprivatec Qs = [  ƒ 	n ¯::1/128'),   ¿ffff:0:0/96E 1Ÿ /64! Ÿ2001::/23" _2::/4¬ F �db8::/32J 10÷ !fc³ 7F ¦:]±�reserved€/Ñ 
0  •2� 
8 4 ˆ8  J5'),8 !10  4!  Ÿ
: 6 « 8! 
: A : C! 
: E ® F! è F!!FE	9÷Ñ ßµcRµ
bA$_c+ =ö:
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
J= ò	syntax (ECMA-262 3rd ediJ `used a= plightwe ð data
interchange format.

:mod:`x ð` exposes an API familiar to users of the îÃdard libraryE Òmarshal` and X ðpickle` modules.  ItÛ ôderived from a
version` ðexternally maintained simpleª x ð.

Encoding basic PythH `Ãhierarchies:œ°>>> import J —    ñ .dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])< ô'["foo", {"bar": ["baz", null. A]}]'.  j gprint(p  "\C \? )U  7 …'\u1234'4  "1 	\- \) ³{"c": 0, "b a ó}, sort_keys=Truez !{" / ? }Š å$iox…StringIO  Tio =  ( *$�(['streamé–API'], io) ³io.getvalue? 9'["2 ã"]'

Compact e4Àson
    >>> ò%mydict = {'4': 5, '6': 7}
    >>> json.dumps([1,2,3,4 ñ
], separators=(',', ':')): ', ñ{"4":5,"6":7}]'

Pretty printing::
0  j aimportq  ( („ ¨ ó, sort_keys=True, indent=4Š {L  Î  ‹ 6 5, Q6": 7 ÿ}

Decoding JSON— ñobj = ['foo', {'bar': ['baz', None, 1.0, 2]}]b  á Ç ÷loads('["foo", {"bar":["baz", null; ‘') == objD  à 	 M 0"\\O  \\L 4 ' ax08ar'4 	= ƒfrom io s�StringIO)  ] Tio =   ­ `streambAPI"]'æ + Õ p(io)[0]± '/ €  
SpecializK  j Ý Sect dzñdef as_complex(dct):· 0...åd if '_  ª__' in dct%  * wreturn J �['real'],1 ‚['imag']ê ^ 5 4dctu  		Ws('{"ƒ A": tš"_ p": 1, "] b": 2}'‘a Æobject_hook=è … R(1+2j  q ÅtdecimalÊD • ó1.1', parse_float=. e  ('' e 3³"en2³, e—N(obj· isinstance  ,š) »P[obj.T,F.SmMñraise TypeError(f'O_  of type {B ò__class__.__name__} ´H  t  �f'is not,A serÓCable:...ƒAú2 + 1j, default=u0'[29B1.0]…  ëe /Et?er(B .R (i Q r''.joinZY Jiter] ^  @

UsÙ¯ Qtool ¤ñthe shell to validate and p-æG $ echo '{"G ñ":"obj"}' | python -m$.a fã3  4  ÉT � 1.2:3.4P 
PExpecž  property ‘ enclosedSð8ouble quotes: line 1 column 3 (char 2)
"""
__version__ = '2.0.9'
__all_ [ª '$ E  s	  + s('­¬ er  ã (â',
]

__author ÐBob Ippolito ò<bob@redivi.com>'

from .decoder import JSOND , SError2 -en2 E 
E    Ôcs

_default_3 =S . ñ(
    skipkeys=False, óensure_ascii=Tru çcheck_circular —allow_nan £indent=Non> §separators ¡  ü)

def dump(obj, fp, *,¤     œ  ä   3 cl„  ¦  ¢  @ 	¦ g sort_3q **kw)::ñ
"""Serialize ``obj`` as ayñ formatted stream to ``fp`` (aA ð``.write()``-supñing file-like object).
0 TIf ``Äð
`` is true then ``dict`` ® ñ
 that are not basic typesH ò (``str``, ``int	 Cfloa Bbool  Ò±``) will be�1pedF ð instead of rais¹ �a ``TypeÂ(``· Ç» f„½ 0the&Pings 7ten/1canr ðcontain non-ASCII characters ifK µy appear inQ 7 Bed iH ¬÷. Otherwise, all such S  @Qescap; Ö0str¦ Û 
�Ý I¢ referenceÆØ Dfor ¥ r¨r and a G   ›F `resultù a“Recursion�© (or worseO/¸ %it†  ÙDValuÚ1 tot s 2out
 ngN  v5 ‚s (``nanT2inf	 -
 )I ¯ ct complia"oÓxçpecification, }u{1theI ñJavaScript equivalent� 2NaNx ‚Infinity - 	.asðnegative integer,qnŸ ¡array elemo "an$ÀP memb¤ ¬ G�pretty-prJ bd with²u £ level. An´Ú   d0—@onlyòert newlines. ``´bhe mosT1actG ‘representJÈsa ed�`` should¸ Ye(item_" ,q 1)``g Ãtuple.  The S “ ```(',  @: ')^2f *ö *  ¿ B1 0 o³ \ Po get†	ç ’
è ì4youÎ ï &y ` � óto eliminate whitespace'#``Ë  ²¾  îðfunction that shoòDuld return a serializable version
    of obj or raise TypeError. The default simply$ s% 
E ó	If *sort_keys* is true (> ð: ``False``), then ¡ output ofD ðdictionaries will be U ¢ed by key.m ð2To use a custom ``JSONEncoder`` subclass (e.g. one that overrides} s 3``.¢ å()`` method to.ae addi— ñ
l types), specify it withJ ð
the ``cls`` kwarg; otherwS¡  isÁ dÏ 1"""C ¢# cached eÊ  Àif (not skip\0 an!  sure_ascii *  Ìàcheck_circular   allow_nan )  ls¥N R iindent ™separator* B 8	3 ©  p   Ekw):7 Aiterƒ3= _C _ð .  Q(obj)4 Gelse> 6f cº  ü Wls = 
@    X t Dcls(K=	 F, enQ= ,E  I 
_= ,k=u", Z= 
O b= 
# #= ,e=
 , **kw)?@# co¡accelerate³õ writelines in soms¡Python, at ò# a debuggability cos �for chunkH i™1fp.k ($ Ð)


def dumpsäE, *,Û="�jTrue, j= š  –m  "=Ù| c @ \ a� ]Ò C"""SG îPobj``.awó formatted ``str``á If Á ``3 ``ø 62eys¨1are9Rbasicv­ (W �, ``int``	 Cfloa Bbool  ò 6``)FakippedF pinsteadç ñ…ing a ``÷
· » fÈÅbñvalue can contain non-ASCIIw €characteOf�€y appear9tstrings;  ed !``a4. OIcN Wsuch S  3Rescap;   U …
HÐ >’referencex ïà "er›eø/a G   ÔF 0resSi”q ``Recu�wØ`` (or worse)½ è¸ Š1À a ``ValueErñ6ror`` to
    serialize out of range ``float`` values (``nan``, ``inf`	 -
 B) inL ðtrict complianceP ðthe JSON specification, instead# ‘using theF ñJavaScript equivalent� 2NaN� ‚Infinity - 1).
D 0If § 0denÃ ðis a non-negative integer,u nŸ ¡array elemo 1andJ ðobject members will be pretty-prJ àd with that inu £ level. An L   ñ 0H @onlyð
ert newlines. ``None`` isŸ B mosT1actG ‘representJò a ed¤ðseparators`` should¸ µan ``(item_" V, key 1)``g ðtuple.  The default“ ```(',  @: ')§ 2f *ö *  ¿ B1 0 �otherwis\ ]o getç ’
è ,• 4youÎ ï yÐ !',` � óto eliminate whitespace'#``Ë A(obj¾  @func–Ã.…return a#²able versioðùof obj or raise TypeError.5bsimply$ s% «¡*sort_keysBctrue (¨ Ã: ``False``)¯ RAoutp°!di¿ Farie£ U Ped byßÿ ðTo use a custom ``›`Encodeòsubclass (e.g. one�override’s 3``.¢ (G•method to.`e addiV£al types),Ay it3J  Ï @``cl©ukwarg; #¡  isÁ dÏ 1"""C ¢# cached eÊ  Àif (not skip\0 an!  sure_ascii *  àcheck_circular   allow_nan )  lsç å  à	 Z	* B 8	3 © X   Ekw):7 �_? _ì . Ð, Fif c¤ @   =Zð. V Acls(  2=	 F, en8= — 6 
B= ,N=X  .=?K A= ,†= , ã8=
 E Y**kw)%

=!deó D  D�ect_hook=á,à  Vpairs °)


def det ‚Sing(b¯qbstartsF= b. d7if "  ((‹ ýcs.BOM_UTF32_BE,  3LE)_  n¸�'utf-32'X ÀUTF16_BE, coódecs.BOM_UTF16_LE)):
  ñ return 'utf-16' øif bstartswith(coB 8= t8-sig'
A ¶len(b) >= 4m ¶if not b[0]  ‰ @# 00 0--   Ž Q32-beO  "   & !XX# 1- -& ,16& 
Ò P-be' Ñ ‚[1] elseë ] î  Z ™ 1™  XX™ Ÿ s L32-l™ &  Ÿ & /16&  # ¿ L ¿ l¿ ›2] or b[3Ç "leÇ Selif vF== 2aÝ v Ž ± p‹ bj 1žß ã‘# default y ó8'


def load(fp, *, cls=None, object_hook ²parse_float S  µ  #in   econsta Q XpairsW C**kwûó*"""Deserialize ``fp`` (a ``.read()``-supporting file-like® ± containingœ óa JSON document) to a Python3 .Y#``Ÿ  ð ð`` is an optional func ð that will be called Ì2 thºÓresult of anyd ° literal deóÑ âdict``). The r-�value of½ “ v Àused insteadh  th*O  N ’is featur‘ 0can¬ 6 €to imples custom” �rs (e.g.1à-RPC class hinj)'Æ-L_ �¡rdered lis`ƒ  . @0D @) r%``¼FP &ThJ FV.  If{ NO  R0lso�Pined,2) 	¤ ãtakes priority{„To use a¸ ``ÜDRqr`` sub³°, specify iª#thi Qcls``Š ð kwarg; otherwis>
K  isk !d.. 1""" _ -Cs(fp�,   ::cls9U* H ,7 G <int6 T"  v H=|  !, kö?s(söÀe,
        pñarse_int=None, p econsta óobject_pairs_hook- ð**kw):
    """Deserialize ``s`` (a	 Àtr``, ``byte #or ‘array`` im !ceI òcontaining a JSON document) to a Python ” !.
5 "`` �  R ðs an optional func ò that will be called with th~ Óresult of anyd ò  literal decodeÖ ÿdict``). The return value of“ v Ausedò 0eadh  th.O  N ’is featur‘ 0can¬ 6 €to imples custom” �rs (e.g.1ü-RPC class hinting)'Ê-L_ �¡rdered lis`ƒ  . @0D Ó) ÙFP &ThJ FV.  If{  ë!``O ðis also defined,2) 	¤ åtakes priority{ZPfloat if specifiN Ø ”q string‚ �of everyä H  #bePd. By  aÂtÿ ñis equivalent toH : �(num_strÁ,is!òuse another datatype orrG 'orŠ €’decimal.D yþ /inü 1iÍ  ’ú ?intø 8eintegezWð Hñ on> Zb@llow	æs: -Infinity, 
 ANaN.1 óë1raiÌQ exce² if invalidÁqnumbersC °are encount®½1To u ``™Dqr`` subp,Ó0y igXc ``clsGqkwarg; Zwš K  isk dÑ 1"""–  ² s&0(s,x | Kp.startsÍ—('\ufeff'#  ' º òError("Unexpected UTF-8 BOM (Z0 us€Áutf-8-sig)",‘  O  Qs, 0)( Belse  . ‰if not iË ( ,  )· BType±  f'3 Ç  @must2strH s¬Q 1, '�  ƒ  À            ó  f'not {s.__class__.__name__}')
  ñ#s = s.decode(detect_encoding(s), 'surrogatepass')
; ðif (cls is None and obj> Hhook 0 n ¨ parse_int"  Ifloa :  kconsta? y lpairs_  Ekw):N òreturn _default_ý rs7if á >   q= JSOND5rX ,ifÿ  w  : Ckw['«  ¥ H'] =5 H 
Î N 
+ T  Z }gT % N  
H ÅF 	7intD :intB ÍG 	( L  Q Ñ—cls(**kw)Êù"""Implementation of½ó
"""
import re

from json  ²scanner
tryÊ" _# Àstring as c_3  ‘
except Ia RErrorE % ! =Cç

__all__ = ['`7',  E ð	']

FLAGS = re.VERBOSE | ƒMULTILIN áDOTALL

NaN = üæ('nan')
PosInf ™inf')
Neg - !

F<Š a(Value bb"""Sub- 6of   ñ with the follow00ddi–âal properties:cðmsg: The unformatted eD� messageý2doc'  3P docuì0 be` ½d( 2pos( °start index‘doc where† 5 Rfaile5 blineno8     correspon q to pos_ 4col) ocolumn+ ,  t ò# Note that this / ¦†is used n: ðdef __init__(self, msg,÷ ,‹ „ ]  ¯ @no = â.count('\n', 0* A + 1T  - ¾   =C ! -2 Zrfind2 . àerrmsg = '%s: i C %d ÷ ñ%d (char %d)' % (¡  % 0no,%   #pof } #.Ü i � *  ò .{ 5msg�   Èí 
  poâ¦E � ! =¾ *no4  �ycreduce{l�ˆ o!, ¢ ° !,  3doc
  °

_CONSTANTÉ{… P'-InfáBy': Œ,  º 0NaN+ àaN,
}


STRINGñFCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS)
BACKSLASH = {
    '"': '"', '\\': @, '/ 2/',$ b  \b% f f n n r r t ñt',
}

def _decode_uXXXX(s, pos):Y òesc = s[pos + 1: !5] òif len(esc) == 4 and esc[1] not in 'xX'J v    try    return intF Q, 16)Z   úexcept ValueError; Apass, ñmsg = "Invalid \\Ç  ˆ Aape"# ±raise JSONDê O c(msg, î 	Ðpy_scanstring	Pend,  rct=Truen ž 5_b=«±, _m=STRINGóc.matchB±"""Scan theJ ¡ng s for a‘  �. End is' €index of À �characterS@s af  Q ðquote that started4 	Y A âUnescapes all ) ~ -€ sequenc' 1nd 6s�K âon attempt to :  aÄW  .ang. If]  ctÖ @Fals¨ ¡en literalL …control à Ps are¤ @owedí  å R 
3 R2“s a tuple&ˆ ds !ng‰ ; Jf  Y <JAend N2.""5¢chunks = [î@_app& "=  . – €begin =   1- 1 vwhile 1¶7 S = _m[ì"ifU  ,FNone5  l‰Õ¿ "Untermina÷%i!t"Ýš i  ¡ Á V.end(  ŒTent, U 4or * ggroups- �# ContenÝ : óains zero or more us”å Ù  ÷ H 
ñ k(Z 6ent¥ 3# Tó  or, ä Ó omTng, ab > 	^¾#§ ða backslash denot8L,anr follow6» )=§Ù  " Ubreak Helif[!!=É
ø iÇ *ct  N #çÝ ¶ %r at" % (™ ,; E   H P{0!r}K w.formatO N ›Z:end3 ;elsÜ “ ï¸ 
6  $  ð EinueQL«2end± 7 EIRö
Z¿ Z†  d 	 À         s, óbegin) from None
  õ0# If not a unicode escape sequence, must be in the lookup tableH  if8 … != 'u':  f :try   échar = _b[esc]0 þ except KeyError< òmsg = "Invalid \\² ù: {0!r}".format(esc)Y  x Àraise JSONDeî c Ê(msg, s, end3 …end += 1H Jelse’ 0uniÉ dO _uXXXX(K 5K  � Àif 0xd800 <=�  ñ0xdbff and s[end:… ¬ 2] == '\\` H Ouni2† J + 1Õ  1 y cy 2z :fffß  -   ç Ð0x10000 + ((( -À °) << 10) |  !2  Nc00)|  O Ô 9= 60chrD 9 €_append(   ñreturn ''.join(chunks)Áñ



# Use speedup if avail°�scanstrinC'c_ Wor py ÷ 

WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS). ƒ_STR = '% q'


defuðObject(s_and_end, � @ct, Š !_opo% s_hook,  Rpairs 	3€   memo=ÕV, _w=µ `.match s  � )ã¦5 = � [ k B = [— ‚1 =  .‘/ À# Backwards "‘atibility !if  1 isxy   ¶ Q = {}'   a_get =/ ±.setdefault Ññ	a slice to prevent IndexÄÜ beÚå!d,®“followingI ±check will ' a a mor.²cific ValueS !ifC  £ ngÃ 3empØ @next� >¥140# N„ælly we expect 3 Q= '"'� &if  <"< fin _ws> B CD= _wn.#    s 	K¦  " ¡# Trivial Ü oœ   „  ~}    ¡ ) R “
²  2 Presulè8 ([
Á 2 ì9 ã Ó£  # : N    #ifÐ 9˜ C —  }‘ y. Œ (el1Ñ “ t€	Í  ' !"E4 Íðproperty name enclosed�êdouble quotes"Áð end += 1
    wh³ile True:
  ñkey, end = scanstring(s  ,  8ct). Á = memo_get(= 6key! ó8# To skip some function call overhead we optimize the fast paths where
� ! # õJSON key separator is ": " or just ":".¦ �if s[end:Ø ¶+ 1] != ':'ö  `   C= _wí f).end(Ê  # I  * `raise © ðDecodeError("Expecting Ò delimiter", bo  Ž U+= 1
Æ :try± Ž Š] in _ws  † E    ;  .  ? L + 1Áexcept Indexä 
… OpassÂ Qvalue[oT_once�ú e ‘StopIteraBjas erro vq n1rr. ¦) from Nonh�pairs_app×, ¡�€nextcharË  n]À  L5if ! ¯	p K   L =Ûm -’9 %''¢  ê
n° [== '}.Vbreak@ l0  ^,0 ›?',' F - 1t § !�Ü 
ð¨ 1nd è  D  · "· P  C   Ùðproperty name enclosed£Ódouble quotes…&ndâ ¢if object_@hookÙ1notžìŽresult =0 (; 2rreturn 1 j¼ & x = dict3 ƒ } < ¬  ) C r & q A
defñArray(s_and_end,bóð, _w=WHITESPACE.match s R_STR). jM × ¤Rs = [ü“jû] �# Look-aàðfor trivial empty a´ †  i]‚L× M ‰ 7 �2 =  .­ .whØ¯À       valueñ, end = scan_once(s 3)
  õexcept StopIteration as err:%  , ðraise JSONDecodeError("Expecting value", b 1rr. µ) from NoneM ‚_append(!  €nextchar® P[end:º E+ 1]" 5if % jin _ws¢  1 C= _wä ` + 1).j î  É D ?= si  I O+= 1z j== ']'z Ubreak. (elª [!= ',0 LÓ',' delimiterTfnd - 1Ì :try† "ifÑ /]  û Ù     ;  &  ? aOQIndex"
£ Qpass
)breturn5 2§nd


classd’r(object)F ‚"""Simpl‡ñ <http://json.org> dšrb ðPerforms the follow§atranslès)4   ²by default:A *+-    +Í |´  # ‚| Python  |* *+=    T ü > „  | dict  T  ‰  ¨ 	Rarray=  T ?lisT .0str@V S| str  ¨ Ànumber (int)¨ +in§  T 'Êreal) | floaV T Dtrueæ  ¨ T   T FfalsU 9| F T #@null:  |’  ¨ ËðIt also understands ``NaN``, ``Infinity vand ``- 1 asD ðtheir correspondH!``™%``ñwhich is outsideÒ Šb spec.®2"""	 `def __| Â__(self, *, M`_hook=��, parse_l  ’  2int . 0conê   ú0ct=õ,> n Vpairst Ç c S"""``&  ”  & …ñpecified, will be called withø eresultn ‚of every‚ðobject decoded aónd its return value will be used in
  õplace of the given ``dict``.  This can: õto provide customI õ,deserializations (e.g. to support JSON-RPC class hinting).
D õ``object_pairs_hook``, if specifiedÉ Acall !th¼ •result ofN Qeveryv  W d decod5 àan ordered lis:  w ÷ e>M F?of ¤ – _TsteadVPM W|feature_“implementaµ 5rs.? I† $ñ is also defined,« UtakesL ‰priority†¼parse_float€,ë �estringY 7of �L  #beÑ Pd. By° a·ti is equivalÿ %toL > ¯(num_str).—ñ	use another datatype or Ì rK "orT ¦’decimal.D 
”B ?_in5?int
&?int<tinteger
 oconsta$onUz‚llowing *æs: -Infinity, 
 6NaNë*�1raiì` excepm "rinvalidÝfnumberæ°are encountñíL ‘  ò G°false (true  0def¥)V•n controlÙ pcharactDfaë is+ ` rngs.  C<  4 � _ @ext ´ @thos¼&th2  ÄAs inäµ0-31 range,‘ `includjñ``'\\t'`` (tab),   n'Ö r 2and F0'``|5"""S Rself.F—# =T 
' 0I" =€L � 0  .   oor int* Š]  ú
or _CONSTANTS.__getitem__G  �Act =‰cd å Ý ë  
P ñ 9 ! =‚OÈ' Sarray& A %  ¢  ng¢ 2can 
' ”memo = {} À self.scan_oónce = scanner.make_ ñ(self)


    def decode ñ, s, _w=WHITESPACE.match):.  2 ð """Return the Python representation of ``s`` (a	 Õtr`` instanceI òcontaining a JSON document).� o 2 €obj, endÙ „elf.raw_½ õ, idx=_w(s, 0).end()): 5  3end   !ifW ‡!= len(sî  ƒ Qraise¢ D*ñError("Extra data"7 X R r#2objË  h¯ 1elf5  µ 0p 2"""e P fromM
VQbeginDEwith QS and ” �a 2-tuple§Ä< Ì :  & ƒindex in„ Qwhere¶ C'ed»óThis can be used tolÝ Pa str…that may“ `have epQneousu1 at (ent 5"""6 6try· É@ P_once57idx0âxcept StopIterÖjas errS @pectÌ Svalue!1rr. )Í6Non�£ �
"""Imple !of„ En®r! Å
import re

í (c_json  e2 R_baseaÏ_ascii as c_ "
eIb òù 2 1 = Ñ ‰ ƒ } w ýè rr  m ' h ó"
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')1 l_ASCII7 ú([\\"]|[^\ -~])')
HAS_UTF8* ba 8a 'ffT qDCT = {òÒ'\\': '\\\\', " " "\b b f f n n r r t °t',
}
for i”range(0x2Í'ð_DCT.setdefault(chr(i),§ óu{0:04x}'.format(i°#; ð%04x' % (i,))

INFINITY = float('inf')

v.pyäãÍ2ýDof aä<Ïg a Œreplace()ÒÎ [" ¡.group(0)]¥& b'"' + , S.sub(V Ò, s) + '"'


ÄÉG = (‘Àsestring or ÿpy_encode_basestring)


def  ò8_ascii(s):
    """Return an ASCII-only JSON representation of a Python i 
D   s Óreplace(matchd  h As =  ‘.group(0)3   2tryŒ     r‘ ÕESCAPE_DCT[s]. ú except KeyError: –n = ord(s^  Q êif n < 0x100003    q ú'\\u{0:04x}'.format(nJ  . #/ º%04x' % (n,) Nelsei õ# surrogate pairÖ  X   Dn -=¨  0s1  ú
d800 | ((n >> 10) & 0x3ff‚  O "s22 c2 n* Ô  1bs1, s2g 1 S"' + «@S.sub(Ý, s) + '"'


§‹A = (ë cÉ" /orË�)

class³Eƒr(object€Ñ"""Extensible' ò <http://json.org> ž Tr foräòdata structures.îòSupports the following r òs and types by default:: .+-  +|ƒ  Å |º  1  |* .+=  T Edict? 	 |·   T § -¨ ³list, tupleE s| array T !5str> 	 |‡ f ü ¨ •int, floau| numbek PT 4Truõ ˜ ) t T JFalsU 9| f T :NonS  ü #llµ øw@To eSó
d this to recognize otherYbs, sub  ±implement aH 3``.$ò()`` method with anI  Rthat uñs a serializableJ €¿Á``o`` if posô,” ñwise it should callÅQsuper¤ J ¤ ö(Ý a; a``Typew3``)2"""6 ñtem_separator = ', ' :key :  0ñ__init__(self, *, skipkeys=‚, ensure
=sà,
            ócheck_circular=True, allow_nan ÷sort_keys=False,
  óindent=None, separators bdefaul %):9 ó"""Constructor for JSONEncoder, with sensible E 5s.
A pIf skip• Q is f˜ € then it õa TypeError to attempt@ ej qing of E ðthat are not str, int, float or à U.  IfC € 8¡such itemsJ asimply¨ :ped½ Àensure_ascii¯ ty‘the outpuÃ  guaranteedÂ  be— ~ robjects*�all incomÒ ð
non-ASCII characters esca… 	Â … F† Ïcan contain X 
Õ 
M	× Àn lists, dic ±and custom ‹/edÚ  all be V !ed%©ð  references dur÷ G  	 %toK ð!prevent an infinite recursion (which would cause) R  <%).M áOtherwise, no ì› Ê takes placeHbNaN, I‘ 0y, - 1 wi÷ w Ø Qed ast ð.  This behavior[  ³ð JSON specificatà –compliant±bZpconsistjómost JavaScript based™!rs¡ !de›s$it· v a Valuy¿ » MÆ\ É nË…!of6pionarieó
" ŸPed byÊ0; t‘is useful7aregresõPtestsPýg EqerializE s  †ðompared on a day-to-day,iÔ  Ñ a6€negativeS egà©n Uarray† relementsãP membÃò  pretty-printed ¾ E  �level.  Aý ¤   ò0¯÷only insert newlineà ò Ä  •! PÑact represent"
ó‚(ed1 shdba("_*,¶ )Ç Qtupleï � @(',  ’: ') if *ï *  ``µ  ``²H 5(',0 oÄ X Qo geti	ß —
ä A4youÎ ë $y ` !')Wýliminate whitesp8 i#Ù » aa func¸ Í ›  |#llúsÖ % ecan't Õ  .s¾ ed®t­ Preturºð JSON encodable
  ó"version of the object or raise a ``TypeError``.

8 F """ ôself.skipkeys =  . ! ø ensure_ascii =  
) úcheck_circular =  
- Åallow_nan =  
# Tsort_›  
# ’indent = 	  õif separators is not None:#  à Uitem_. !,  6key  N A Celifx b e = ','G ¯if defaultF & =0 É%deA (» F, o)æ �"""Implem'õthis method in a subclass such that it returns¢ Õa serializablm for ``o``,xQcallsŒdbase it UationJ ?(to¢)£pFor exaB ò, to support arbitrary iteÚµ, you couldd { '` like ü "::3 û  ; "   6tryP   ‡  =’ 5(o)… # uexcept ŒI 6pasn; +ls®  d list(„ { V# Let’èD. B¢ Ã n ÃJSONEncoder.F oV _§ ‹Y C(f'O§Áf type {o.__˜ Ö__.__name__} J  #f'Ê � 	•"')„  Òe¦ � sA"""RÛ2 a B ñ tring represent­ T÷a Python data structure¥â>>> from json.s r÷ ª ] ,O 1  #()5 ö	({"foo": ["bar", "baz"]}Ñ'" 'ó  w0# Tç0is ¢±extremely sõ cases and benchmarks.¦  ÒÀsinstance(o,ü N l [8lf.d "   6_smG+eìD > î €doesn't JôÀtor directlyJð''.join() becauseü "# ®€ions areP ñas detailed.  Thev î0 shx¸ be roughlyJ aquivaluo‘ àPySequence_Fas™6at ‘ wL &do‹ðchunks = self.iterencó	ode(o, _one_shot=True)
  õif not isinstance(chunks, (list, tuple)):2  9 $ 0 = $ 2 T åreturn ''.join B °def iterencš iself,   WFalsep A"""E- ñ the given object and yield each stringg  ¥ õrepresentation as available.
& ÖFor example::  A Afor ê ‚ in JSONˆ Gr().Ã 2big� ´  >   Ómysocket.writ[)e 5"""ˆ 0if ú .check_circularwÅmarkers = {}9 Oelse' ENone) b Êensure_ascii9 _–Br = 
 R_baseW0 M v = 	ó   €floatstr˜¡allow_nan=þ  ,j  H  _Ð=< !._ ð__, _inf=INFINITY, _neg - •0# C` Ûðspecials.  Note that this type of tes© processor• #€Ñ/or platform-R ¡fic, so do@ ðs which don't depend onÍN `intern‘ / ù šif o != o­  Étext = 'NaN'N !el6 !==!9 �Infinity> PA -B • ¯ ½'(o	  Št ùraise ValueError(ó  D   @"Out½arange 0  v4 Qs areî Ìÿ  compliant: " +K  r;(o)© Æ  |
ªEif (e u c_make!is| 	“ °    É Qindent ( ½_v+ =_ -,W”default, �  q nŽ Ôkey_separator1 =tem Ÿsort_keysI Askip � ä4P 	î L ð ,?str± ú @õ JØ @0)

'ó Ò_Î _Êð _floatstr,
    ù
    _key_separator, _item @sort& °s, _skipkey  one_shot,
G   õ+## HACK: hand-optimized bytecode; turn globals into localsC ¶ValueError= b Pdict=  afloat=  Wid=id Wnt=inª ¶isinstance= 0 Plist=  vstr=str atuple=  @_int* Âint.__repr__ 1):
å ñif _indent is not None and Ž (' q, str):=  e „ = ' ' *N ^  de_ Pterenq_Ä ã(lst, _current? g_levelW !if€ 6lstk  o ¥yield '[]'‚    reË ¨if markersÖ 
J ! pid = id• )?  R C Tid inO 
C  ( fraise á("Circular refú ºe detected"d ƒ "s[ •id] = lstˆ 0bufX[ì ¯
– [U += 1Y  ¹ snewline� h T\n' +Á Ë¤	D ¨, =©: + b 	9  Ú /+=" JelseÔ 
K ! =¦	R ‹ ( Æfirst = True €or valueçp1if 6 
�  @ v = FalsN   ¿    ó %= § €   7if jŽ h '    M 2+ _W!r(2 
\DelifØ s/Ã L V'nulli k 
C  5C OtrueC 	+D fOE   7int1 ±   ð # Subclasses ofÖ/Žå may override Ù but we still•N ‚want to kq them a-Regers\   ú JSON. One examplN PithinF  ðý	dard library is IntEnum.ˆ ªÕõ* ,€see comm �above for4‚ Q /sty½ û Á Y À if isinstanÿce(value, (list, tuple)):
   ðchunks = _iterencode_8 E À_current_ind mlevel)L Öelif isinstanƒ Odictz  0 z /seÜ ] ²yield from *ù £if newline» is not Non� CU -= 1N  šl t'\n' + U /* > 9 5 %]' ¯if markers’ 4del% [- Aid]
C 9def’Odct,‰ Ý jot dct�£ &{}¤  ï areturnt   · « š = id(dctˆC Tid iná 
�  k praise V%ñError("Circular refºe detected"d ƒ s6  =ò Ç í ì iP<�ä, +"q/= - ý ãitem_separatorù +ØÛ  > ß 
ˆ ! ,elŠ
) ! =0  Q � - Åfirst = True  \šsort_keysé Y  Ø  e-. &()Ñ± # Ó/ m ‘for key, _ b. w 	/ 7str& õ   Epass[   À# JavaScript*Ðweakly typed | ûthese, so it makes sense toI òalso allow them.  Many Þr7 ùem to do something like this.N ÙÓ OfloaØÑ# see commentµ Aint/.  0_¶ i	i  0key’1 vstr(key® ! Ž  & !is

} "   v= 'true„  ; -Fa« # < f = á< Onull;  A/in?:À       key =÷  _intstr(key)
  ù elif _skipkeys:  ' ‰continue Nelse+ ðraise TypeError(f'S ù must be str, int, float, bool or None, 'b  {  úf'not {key.__class__.__name__}'Ø Žif first§   = Fals× ùyield item_separator¬ ! _encodec   ?keyA ðif isinstance(value,/)½ L l , 
ù Ñ 1 is\F Z'nullw
= ?Truç ƒ _'true= 	_{ f}?  ?int ð# see comment forZ/Yâ in _make_iter*	° XÅ /G Ž b � G_  ¨’ u<ß(list, tuple)®   —chunks = '_8 �À_current_ind Zlevel% H 3)?dic¸ 2 z  0 z b ] !Rfrom ° C£if newline h š È
ñCU -= 1N  ¯ l `'\n' +ª o? * > 9 5 }E¯if markers’ 4del% [- Aid]
U 8def?(o,‚ P
}oµ§ oA9o« 96 ¡1 ™1 
•1 � 2 ‰3 Îo³ó  °})w y
z | &Àncode
        ñyield _floatstr(o)
 õ   elif isinstance(o, (list, tuple)):+  3 J ðfrom _iterencode_2  ; À_current_ind _levelm 
Odictd  * d *se´ ûif markers is not Non$  Ü % xid = id$    I Tid inU 
m  (   ñraise ValueError("Circular ref9¶e detected"# <   � "s[ yid] = o‹Ìo = _default® §> { ç 04del§ £ hreturn"ð
"""JSON token scanner â
import re
tryM`Sjson  Smake_6 h as c_ ‘
except IK pI 
' ! =úè

__all__ = ['H ò']

NUMBER_RE = re.compile(Ø ñ'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]? !',2 Ð(re.VERBOSE |P ƒMULTILIN ùDOTALL))

def py× t(contex ó parse_object =  . t  ]array'  & mstring'  ( Àmatch_numberA. #  . 	“   � zf  & .inØ 7int" !co¨'  , #W_hookt  & _pairs,  2 0memuy  
  ¼ž _oD ÿ wng, idxÛÞ d  pnextchaV2 Q[idx]Q   ÔGndexÓ    aàStopIteration(q  = âœ  , 6if m R= '"'    °¬Œ ( Å ` + 1,  &ctª:	W {W 	(X )Y 0 Ž  R", > § ž , Œ› 	[› 	š ‚ \ 	an' and  ngÄÿ:idx + 4] == 'null~  ¥a4ø ’	Xta Htruea À   return TrÓue, idx + 4
  òelif nextchar == 'f' and string[idx:4 "5] ealse':A  H €return F c %5
# òm = match_number(\ * )& úif m is not Nonec ðinteger, frac, expU †.groups(F  � !if& 0 or( 
H    óres = parse_float(^ @ + (`  : 0'')  i jor '')d ;els¢ Z %inX 
; .§res, m.end¿ �N�3�?NaN�ß  constant(') )sE + 3vq Iq 8q �Infinityv . { 8{ -{ 9{ -N 
ÔQò / } 9} Àò	raise StopIteration(idx)ÈÙdef scan_onceÁŒ 6try _9 Œ kfinall< ³memo.clear(ƒ ç M a

make] ‰ner = c_ Yor py ñ
r"""Command-line tool to validateûòpretty-print JSON

Usage::ð$ echo '{"json":"obj"}' | python -m  .^ æ {  3  4  } T � 1.2:3.4P 
ñ$Expecting property name enclosed in double quotes: ï Á1 column 3 (ññ2)

"""
import argF  Æ  ósys
from pathlib 4 pPath


!bmain()�prog = ' 'ò pdescriphò  = ('A simple c¡²  š‘rface forV‚ module F  T 'Ì¢ objects.'–ð  >ü  .ArgumentP! r(É = ', ³ = I c.add_aB ñ('infile', nargs='?',ý ³  Utype=† ÿFileType(encoding="utf-8")B qhelp='a´ y  Û%beÞdÙÞ/ed� ÿdefault=sys.stdinè 0outp é  7Ê òwrite the output of R Ù t Rð default=None)
 ÿ>   parser.add_argument('--sort-keys', action='store_true', default=False,
    `help='N ñ the output of diV ñaries alphabetically by key')V ¡ ñ no-ensure-ascii’ Bst=' _ 
¼ qfalse',X ¯ ® ðdisable escaping¯ ÿnon-ASCII characters¡ Ÿjson-lineC30 in? us–  P`JSON Le ¯ format. 'Þ ÷%'Use with --no-indent or --compact to produce valid a ¼.ö xgroup =@@mutuÀ±_exclusive_& (É i† ¿Q¿4, type=int©¨âseparate itemsÚ 1newtÿ and use this number 'of spacesG ” aöî ¼ =tabQconstÏ  ŽJ r. 0='\2 Õ äO'tabÄ 	Ê 2?Noná |Ärather than É�
·» ¤	ˆ `uppres}ql white†  V£ion (most e )Š  opsûš =As()
t Adump A = {  m_T#: F . ì'5%  " 	å(  . }~ %ifp Í :  – ¬ [x @] = È# @ors'' ‚',', ':'÷ [Ù ¢infile as 
 r 6try  ƒ Ÿ  5_Á
#  ' 0objv($ p.loads(* )³ 
 3 inm q 5   OelseO (© #),Æ ;   Ÿ 1outÖ !is"U  õ ut = sys.stdoutD I ˆ 3 7b ó.open('w', encoding='utf-8† P   t uti< – pfor obj àobjs:
          ðjson.dump(obj, outfile, ** w_args)
0  * ¶.write('\n'( ùexcept ValueError as e:H ò raise SystemExit(e)


if __name__ == '__main__'= 2try	  ‡   (u q —BrokenPipv &xc2 Qsys.el ð*xc.errno)
"""Keywords (from "Grammar/python.gram")

This ôB is automatically generated; please don't muck it up!

To update the symbols in tY  , 'cd' to " ðtop directory of
 ” ñ source tree and run:
`óPYTHONPATH=Tools/peg_  2or @ Â3 -m pegen.ký Qgen \A  [   Tns CLib/P ð.py

Alternatively, you can­ € 'make rƒ -3  '.�p

__all S ["is §", "issoft `kwlist   2]

 A = [Ò ‚'False', 5Non 5Tru 4and# &as
 Fsert 5ync 5wai Tbreak EclasB fconting 4def( 4del 5eli e­ Ù& 0fino %or 4rom UglobaZ X FimpoÌ $in0 i¬ dlambda fnonlocJ %noï y pë Ó> Ureturd 4try EwhiluDwith ¦yield'
]

ÎÄ_' &caÌQmatch3 )Ò = frozenset(	@).__‡yains__
G	/ x 3 à"""Cache linesa 1m PŠ #s.%i×`tendedÍHread: ‚modules ‘ñed -- hence if ac à
is not found,Gáwill look down%L à search path fpF � by
that O ^u ` funct 
 4sys o
 tâ:ize•0get x cly   Theckc Blazy ¡]


# The  R. MapK ™ s$ñeither a thunk which ð tprovidei�code,
# å òtuple (size, mtime,i`, full^ 0) oZ�loaded.
� Æ = {}


def Â "()* í × `0 Áentirely."""F .< (¸ J ( z ‹ Bno, ¥_™ s=‚l QGet a¶ ºYq ÿx ƒ UL  =pit does{ñð an entry for this fñile already."""

    lines = get ñ(filename, module_globals)/ qif 1 <=7 !no
 1en(: !):"  U areturn%  s[ qno - 1]!  �''


defz S=None^ ¢"""Get the^ ð for a Python source Ã Q from( acache.{ fUpdate ñ if it doesn't contain an entry] BthisR <!if  .A in i C = [”  )  %qif len(' f) != 1<    (V ? 2[2]¹6try0 , uà 2 Èöexcept MemoryErrorM RclearE õŽ #[]¶Rcheck% Û ¨rDiscard Qðies that are out of ‘� (Tjqis not _ õed upon each call!)¸	| s #Â ’  ÙQlist(© r.keys()Ô )elB ¾C ~FFelsel {” �9   s/ ï =g# lazyU€y, leaveÉ  M ³   ÓAinue¹   0sizÛ tiâ ›ps, fullœ! =§y- @if m* , ib K \ ¡   # no-op1 õ ñs loaded via a __ 5r__[ 	¿ N  stat = os.
 (” ® ! ³+OS¯  à7pop÷ > & 9ont0if  } u A.st_ #orø 4!=  	ÈP Zv Ú�5¢aáR and gP its Ò ;¾ïóIf something's wrong, print a message, d“ ?3ð,–f  Amptyk ,2ÐX 2Ú# .8 V!if G•5or Ö Ártswith('<')* C.end 3>')1 R < ¼  [% =¿	“ ÷�‹1bas<Z [  w ²# Realise aÄ 5 €d lookup‘Ptherer&on·0# o w?  š$to2 ’right now
 j  Šðazycache(filename, ÷module_globals):
  :try   ùdata = cache[filename][0]()= ñexcept (ImportError, OS	 h  W Jpass@ >lse~ 1if � ois Non!   L ñ# No luck, the PEP302 loader cannot find isource{  D   ²# for this (.' �return [] %M = ($  i @len(× /),  ê  Á[line + '\n'­  !in%`.split Os()]A @fullÁx 
Í ¥ ç Ô E[2]
= ñ# Try looking throughf@÷ search path, which is only usefulK  when handlM ´a relative uŽ`if os.V t.isabs(# iÃ [³  â0dirb in syH 
z	;% =} Sjoin(N Q, bas
KAType¢, Attribut ´  { Ñðt sufficiently string-like to do anyth+JV with# G   zcontinuñà BstatÜ  
 (ï 
Î  S Ubreak¹  ä î
L   	íeé§ - 	�  Õ æ tokenize.open™ j as fpn þ� = fp.reaK#es©¥ 
~ 2if D @and 9 �[-1].ends� (~¶" 1 +=šàsize, mtime = SB.st_   . f 2 @ ,“ $, ”3 ¸ ~ ±


def lazyJ ,Êòb"""See1 MFK9 .ö3The `Ñwill be askedG  „fêÙ"geš" i÷qcalled,c³immediatelyg  IfF re.€an entry¯ [ °  alàPy, it%  ªsalteredC : ±: True if a·  2 Qregis1 	Y 7ôotherwise False. To 5 P suchR ]oad aAth a¤ ÐCget_°method must3Rfound´{ ar6abl»%  , �  S   ŠA ð d.
    """
    óif filename in cache:
  qif len( [( v]) == 1&  - µreturn True> 7elsL & BFals' fif notƒ Dor (h õ.startswith('<') and* C.end F>'))� ‰ c õ# Try for a __loader__, if availablŒ ámodule_globalsq 0'__0__' 
! v  # : =  [< ]Bif (… , :1 f.get('¥ «')) is NonHif specB   7__'   6try·    • =Z . ¶ % ÿexcept AttributeErrorP Epass@ óget_source = getattr6, ' !',î %)
:  " � ý( 
s   ðlines = functools.partial( |  , ¨)\  Ö Ü1 = 1 O ,+ [ä kó"""Locale supportc.

The ð provides low-level access to the C lib'  L 2API‡¢adds high
6 `number×‚matting + Òs well as a l� Palias" `enginej ócomplement
these¥ * Pinclu® Ó  Fômany commonly usedi  ]® P
mapsÏ mm °values suitl ´   “ ö 2setµ "()ÉÕion. It
also � ñdefault encodingsT 4all|” ¡.

"""

im™4sys B  .e* $re# ô_collections_abc
from builtins e  tr†_ D_strA £"

�3 Bhe _3ð.
#
# If this fails, fì ôback on a basic 'C'ŠPemula¡ .c ðYuck:  LC_MESSAGESVðnon-standard:  can't t=ôwhether it exists before
# try§ µ Ð.  So __all__W ª fiddled at` end oÂ eÀ$.
0 T= ["gô0",  Ý ”preferred°  |(",Î"A ! )re R @conv 0strÈ LxfrmK  tr Catof i fformat
  Ù0ing ‹currencyI n2 @lize$ „LC_CTYPE TOLLAT 4TIM ‹MONETARYL £LC_NUMERICA 0ALL
 ðCHAR_MAX"]

def –  ß C(a,bB""" õ Àl(string,strãing) -> int.
  òCompares two strings according to the locale6 1"""> ðreturn (a > b) -
 ñ< b)

def _strxfrm(s):/ 0"""`  h � s Z  “ RV 0s a- ‚ óhat behaves for cmp� _-awar– �s

try:
{ bfrom _Ä ñ import *

except I SError0 1# Lð ¢ emulationH áCHAR_MAX = 127[ ¤LC_ALL = 6 µCOLLATE = 3 0TYP 0 ÅMESSAGES = 5 ´ONETARY = 4 pNUMERICp  0TIMK 2 µ � = Value ©  �ï Sconv(‚ _ †  7dic & …ônumeric and monetary|öspecific parametersÆ$ M S# 'C'6   default v² sÅ  $ Lõ{'grouping': [127],#  '   ÿ'currency_symbol': '''  Ðn_sign_posn':°$  ßp_cs_precedes& n& Hmon_¾ » ïn_sep_by_spaceq Ðdecimal_pointà .á qegativeè  & % Oposi% — @int_}yp‘ y�thousandsz ¼  R) ¯frac_digitÅ M X2 æ Q }X2setA¢(category,Î[=Nonek- ‚integer,ð,  } : ãôActivates/queries>¦processing1 k"if‹ � not in (“ ,  „œ  f araise 6$('ò� only sup.Ss "C"… %')“¶ñ'C'

# These may or  … Aexis‹ a À, so be sure]0setasm.
if '4'À tglobalsÁ % =^6 Ocoll6   6   3


�  # =Ú    É  With this ÷, you can override some items of= 3's ß.Áis is usefulÀ@testÙ´purposes.
_Z 
– ÷{}

@functools.wraps(# )i� ¼ 'dë  Àonv()
    ifó	 _override_localeconv:
  Ÿd.update(' )' ðNreturn d


### Number formatting APIs

# Author: Martin von Loewis
# improved by Georg Brandl8 €Iterate © ` groupV ô intervals
def _ _ ( )Ï Elast q = NoneÁ Dfor 6 5 inc 7  	E# if ô is -1, we are dG  ) &ifJ ¶== CHAR_MAXJ  % 1{   À# 0: re-use ¤ i Õ ad infinitum, ` 0Y !ifA å !isæ 
&  t ò
raise ValueError("invalid} Bing"Ý -   ®while TrueM Zyieldz ±  ^  è § =5`

#per<E the� ÷ from right to leftöó(s, monetary=Falseò Ë6 = Ø(Õ ðthousands_sep = ( [B © and 'mon_' j' or ' ]Ð gI " D  ? eif notë _' Þ 0¸ ö if s[-1] == ' '+ ástripped = s.r ë  ¼8p_spaces" Q[len(% Rped):‡  )  K Û 7elsðH !''$  �]  ä  O [^ c¯ ‘ s|ú  +ö in "0123456789" 3 ò# only non-digit characters remain (sign, Z :   
Í sá      Ï ß     Ubreak% õ ´.append(s[-÷&:]f  F 5s[:   ÚÈ I =  sreverseß$„ Á )+ ¯R.joinBs) +Oº,A )n(7 P) * (2� R) - 1’ )�S0ð a given amount of excess padd®ÁÓ(  ~"ngÄ  #p_)  îE Ä0lpo30¡ †  ¨ s[    Q += 17  «5 - rX  Ù sÔ * a   ) a    M a ¢ :0 ò'+1]

_percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?f b   r'- ð/modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')

def _format(pôercent, value, grouping=False, monetary ö*additional):
    if     Òformatted = pe R % ((h 7) +6 )I Oelse@ > . $ifW ÿ[-1] in 'eEfFgGdiu'G ¥_localize(� ñ ë Ž ureturn * �

# Trans  A as W ô
e number according to the ßsettings
def ‹ 
l
|oð# floats and decimal ints need special ac¥!+0'.'# ¼ •!�seps = 0*  ¹@part , ¢.split('.' % %if*K   > S[0], Y _R( Ö 	 V Ï ƒ_point =:tconv()[/ ù Y'mon_/ 'Á  ‡  Jor 'A ]B û $ =c” R.joinÌ ¶ !ifì 
C €_strip_p'(ng} $I 
ý  	•ph q :=	 s  $¼ 2+ ã� ü  õ boä
A"""F?@s a = ng¾ MÑsame way that_%� s¡would use,Í‘but takes* scurrentW 5o®Qunt.
0 Gþ° is appliedà y ð third parameter" Qtrue.8  Conversion| s6  thousands#aaratorÀ ± Þ As ifI Wforthf ²o 1""") S ©clist(_ ò _re.finditer(f)êˆnew_f = % Âsub('%s', f)ý Ðif isinstance¨�, _colleK�s_abc.MapŒ B \ yval = [Až ¶™ s ¿.	 ()ÄG=='%º ]   a §.append('%‡   
:    6 _Ž(� t ’6
Y mif not"Wtuple | BJ   ‘ 
(iå?for6SÀ   else:
     ñstarcount = perc.group('modifiers').  h('*')
;   ÷new_val.append(_format(J -),5  9  oval[i]. § ?ing0 �monetary0 *� u+1:i+1+%.])¥i += (1 + ' % Ãval = tuple((!)
preturn  ×f % val

def >@ent, Due, ì „=False, Ì  Ñ*additional):a ó"""Deprecated, use\ ñ_string instead."""1 ñ import warnings  .	 (  ¶ò-"This method will be removed in a future version of Python. m F ÂUse 'locale.ø œ 6()'Ÿ ¯Ð BionW¦ ,q‘cklevel=2  `�match = _ˆqent_re. ™2ent¡qif not  � or len( A))!= G ] ¿ òraise ValueError(("Å p() must÷	given exactly one %%char K 	 F Q spec€A, %s¦ åvalid") % reprÉ Ê rQA;(, 5~ÿcurrency(val, symbol=Tr‚rinternat‡A"""Fs¾p accordrtto the e U settk'in #t �cconv =   (èp# checkÜ€ illegalv "ueÁ�digits = 4 [´ ò  and 'int_frac_* '' ]V2if ! r == 127d ¸#"CE ” !maã " iÂ°possible us J 	 "*3'C'ó #."ð  Ì _ ize(f'{abs®B):.{¢ F}f}'1ðÈ,R# '<' ñ>' are markers if†EsignÅóinserted between@ vÿ" ™  V ’+ s + '>'è#if/ 2?smb‘ "_~‘   ˜ • 1 â0ede~ ãQval<0› d'n_cs_  H p F Psepar)™ 	G Äsep_by_spaceH 	 ]ì  � 4if s ò    ¢  ú 6+ (n ƒ T  ')@L 0 JelseB >if Ápsmb[-1]—:' '1  G  s ð= smb[:-1]
         ñs = s + (separated and ' ' or '') + smb

- `ign_po4 ¢conv[val<00 3n_s n: p ]> = = : qegative0 < 6osi ]} 4if c a == 0:U — ` = '('ª a + ')' +el2 12  M  3 - 2-  * ?ign- 3- Ñ.replace('<',¶ )9 49 >9 &se+ ñ# the default if nothing specified;o   , Áis should be; ‘most fitt5 Qign proà  8  ä"N Šreturn sÝ 6'')  µ ò'')

def str(val)¸ ð"""Convert float to" €ing, tak‰  Õ ølocale into account."""� ð_format("%.12g", e s !de@ ¤ize(string} ƒParses as   a nH Álized numberr !rdŒ o)O Ae se+2s."‹ Ã2 =    "() ñ#First, get rid ofG �groupingÇ t[ 5 ò['thousands_sep'&Rif ts4ˆÈ  ¥	 l0ts,žw cnext, vs ñ	decimal point with a dotƒ $ddˆ'( _( ƒ /ddƒ rdd, '.'Û¦ ŽŒ$, ò=False, monetary ¬/""® L e¨3? ‹ … ¶Catof=q, func=¯� ›  aÑ ¯= Ñ) [ (°† i† z > ¹Ü B an+/eg¼ ?int~ c_test(y 1set>Âe(LC_ALL, ""ó5#doÓWRs1 = ž_¤ ò("%d", 123456789,1;  pr� òs1, "is", atoi(s1) “#standardM  §a  XB3.14, J  fJ b
### LP name aliasÝòengine

# Author: Marc-Andre Lemburg, mal@l ò.com
# Various tweaks by Fredrik Lundh <f °@pythonware: >j ¡store awayŸðlow-level version+kö (it's
# overridden below)
_% =˜œq_P_encoÇt(code,  ð ):
    if '.' i“n code:
  ¡langname =  [: Á.index('.')]* ?els4 " ÷# Convert the encoding to a C lib compatibl astringA Unorm_8 =C  s. Ualize (( ); €#print(') 8 €: %r' %  9 0 	  k „aliases. Iget(. ‘.lower(),y D 	I Š º p d½ û * =Û ‘ 	c " ¼ * *if? – in localf_– +z * [~ 9	! Ÿ ò replace('_', ''" \7 -7 ã   n ç !ÈFfounÆ‚Q Ñ ureturn xu+ '.' +ûð

def _append_modifier(—$,  )–%if ¢ == 'euro'  Ê !if\ 0notÞ B     ‹    ‡ ±ISO8859-15'$ $ U_, _,� &¡.partition$- &if* Win ('R “, 'UTF-8'¼  ]   … H  Ø G Ý < _:ç. 	}ò @yTy lm(ä 1):
› Q""" R¿1s a?* d9AA forDgiveS>  ±  N .M   QThe rQ eE  isH `matted
 • use withJ 2set¡ '()Q IÖ — aŸq fails,‘ �original … 5 isz T šunchangedR  ÑÎ Ê >  VRknown^ Afuncr µdefaults toY  B  !)Ç =§just like à G Cdoes› 1""" `# Normð eå M ã a‹[xtrac•  ö ˆ=Ç < +>':'C!#  °s sometimes§Fd aså ¡delimiter.¯ m  t .¹0(':¼.ô ¸@q   3 ŒÂsplit('@', 1æ
®àmodifier = ''
ð    if '.' in code:
   ñlangname, encoding =# ñ .split('.')[:2]1 ?els;  1 "  S I 1''
 ð# First lookup: fullv ö  (possibly with„ Ñand modifier)C  © p_enc =   >  %if6 Ö @norm- Ñ “ ò.replace('-', ''[  µ 2 	 7 _7  ‹  i 1 +=`)+ 9 ¢ õ _² ½  2  %ifæ ½ 0  W E@' +' 7  Ã K ÷ocale_alias.get(: b, Noneà !ifÒq is not n Rretur\ —#print('f±’ failed')Î¶ Ç# Second tryá ×5outÀ òª  ŠÝ 0ang9Ú  0 Þ 
 ! Ò i	’ qsucceedà  0   3!@'37$ >„_append_³(Å ,õ Ý  8 ± aõ@', 1)[1].lower() ==: ¨ :   r  a °  â s‚é µU c# Thir´ Ì¥(µ1 *, §ç Ø s ä J ¡ 2 º 8 ì &  í ð 3 eô ! 4‚ ó  1n ¶Šd ? ‘  å 3U
%P 0 	_e J + 'CG —‚# FourthÍ ¨ ›    Ï ´q¡ 0   µ % ¹”“ bÆ I à ( Ê iW 5  ¦! <  u �, defmod 2 #if/ HÀr() == modifoier:
   ôreturn _replace_encoding(code,  ñ) + '@' + defmod
M = ölocalename

def _parse_ ( "):; P""" P' bs the !  u C for  S R and i + y  É ñ
result as tuple (languageF » .r  4 Tk [ Ñis normalizedi çpassed through› w ðalias engine. A ValueError is rai@ win case@  q E ¡cannot be +d£ Ê ñ corresponds to RFC 1766. é · §a  ^ XNone � v® &s € õdetermined or areC punknowns óthis implementation² 1"""1 ¹=Nò! !if@ Œ 6odeŒ³# Deal withõ¡ modifiers9  · ^ , ! =ù å.split('@', 1), 'if) �= 'euro'%@'.' v„  c ñ# Assume Latin-9†@= — As. T…s bogus,r ? õsince some systems may use otherKs[ FtheslC ôs. Also, we ignorA .{ ò , 'iso-8859-15'ø z!.'	z8 =îQr.')[:2]SAelif\ v == 'C'º@  c ,  – 
0 WUTF-84 ñ# On macOS "LC_CTYPE=% ">sa validr� settingX " g  7 ’ handlingU6ext	¡ '/ 'L ¥¹$('ì‚s: %s' %‡  ¹)Ù^buildÙDÚB( 3s aC AAfrom_given¶   ì Ò)i  1No ~ ï %orm  atakes Ã1 š6try´## =¤ Ä 2 l 4if -  š àG  !  ¸ %ifé8 –? 9 7els b *  ‚.‚; ²except (Typ†,Ù)³ ô& 1('LµA musˆ á ±, a string,ân iterable of < ™  C'two9 Fs --9¸° A.')  l Q¢getdefaultzð(envvars=('LC_ALL', 
 ) 4ANG hUAGE')wATrie$ÖÀmine the defóault locale settings and returns
  õthem as tuple (language code, encoding).
2 PAccor õ to POSIX, a program which has not called; 2set” ó(LC_ALL, "") runs using the portable 'C'Ã .B @Call) J ±lets it useK 8def	a÷ ¡defined by) �LANG variy ð. Since we don't wantí •interfere� AwithA lcurrens C ²thus emulat• …behaviorE !inC ÷way described abovevñTo maintain compatibility „ ñother platforms,~1onlß j 	ç õ
 is tested, but a list of	‡s given 8ðenvvars parameter. The first found)4be afwill b2dused. G ¡s5  ü°search pathÅõd in GNU gettext;Ê òit must always co D Çp name 'ô 'IPExcep¬ rv è j, 	ÿ± correspond¡ 5RFC€ a1766. &W)À can be None½ #ca‹`values 5notG )@term�¥ 2"""mEtry:* ð# check if it's sup)Ã_Zf modulp im'   O  ÷ ß$ =! S._get–Q !()5 e7!(IP ñError, Attribute )® 2paslFelse ¢# make sur † /;#†are vali7tif sys.Þ± == "win32"| F 	 A[:2]! 60x"y  í } ¥p windows ê identifier…  =ù  ;   f =@ P�.get(int( B, 0)- 0 š# ...add ›�-specific21ces÷…here, ifq @# ne Vary..þ½v½-@# fajback on˜ kulošðlookup = os.environÎ ƒ 5for Æ¯P $2 = J (x,ü#ifÅ . B  #ik ³«ZUAGE''  + q  Ø P á.split(':')[0]¼  .   Qbreak 
„	J 1'C'# Yc_parseÜ ` (. p)


def‹ ò(category=LC_CTYPE):ŒR""" RhV‰ _ ª^N  N n•ðcategory may be ðone of the LC_* value except “ALL. It
  °defaults to uCTYPE.
 E9 1forS ‘code 'C', ‘language  ¡correspondM 5RFCF b1766. ' ðand encoding can be N¶ qin caseZ ¶ s &no¬ Óbe determined¥ 1"""g òlocalename = _set ¡(category)& 4if  0 ==ñ @ALL “ r';' in 6  G :1  &õraise TypeError('C 0LC_@ òis not supported'm æreturn _parse_Z ( ~)

def ¯ ,Š ="):‘q""" Set"D  ™@give@í c.  TheC  F5 beÏ òa string, an iterabl4#wo :s (Ü "µ%),K !or»‹ ,IP @s ar0nve ^v @s usú ¡Ä @alia W ¡engine.  LÕ•  S ð passed directlyY  K WC libˆ £0mayb 0as j s: M$if< ù  Ü£isinstance¾ö , _builtin_str).A# coö  › ô Ù ñ Á= normalize(F d)D"C.re# = ?s@,!to  –Cting Þ U 7 is•µ by callingõ 3get4 ÿ 6().… 2® o ‹Ë {	5e ‚))


tryšSfrom f0 im¨S _get _Ý
*I# ðA  §1 (û÷if hasattr(sys, 'getandroidapilevel'/  Rb# On A$  tainfo.h“qCODESETJ0mis# ´¥d UTF-8 iscJ Palway` edË¡mbstowcs()N ¹wcstombs().8 ¦'U ' òif sys.flags.utf8_mode o   ; L> = —8[1]d , !isK
a b# LANG]Cet, . b’servativeUASCIIY  � Z †= 'asciiÜ ¸ " 's2Namô—  ÄgetpreferredA 6(do§W=TrueæB"""R	 ¨ ch Ãa `e userD0likË .ý È ­ |ð
else:
    # On UnñHix, if CODESET is available, use that.
    def getpreferredencoding(do_setlocale=True):1  5 ñ"""Return the charsetU  @useru Õlikely using,= Paccorc 1 to/ õ	system configuration."""2 õif sys.flags.utf8_mode:   “ r� …'UTF-8'
 ‡if not dÎ 9 a_get_lî _)H 0old 5 = ¥(LC_CTYPE)n :try^   ¬ B F, ""F  $ Êexcept ErrorS   Epassu   ÿ Æ  "   kfinall£ Ž î ñ+)


### Database
#
# The following data was extracted fromÙOð.alias file which
# comes with X11 and1 0n h
 0ediG Premovc  d”explicit œ 
#»0ini.sB !adV¡some more y 2es.³  € `is usu&
#ò as /usr/lib/X11/¹  À E.
#
ÿ   '_h   t_õ  maps lowercase¯ Œ € names
#ú!C F #    (8 ò-sensitive). Not²ð normalize()
# first looks upAo i›.sÅ `es dic20ary4 ‹ ðhen applies thisÃ pxBo fišá correct C libÇ @ fort %
#v  $Õ 2= {KP# Map^ s@ Ånon-standardG _  ©Ted in'ô`'437':Ð 2'C'n/'c' 	&  ) /en* 
¤'ISO8859-1Z ?jis2 	W'JIS7, ° 		, ?ajeµ 	d'eucJPY Okoi8. e'KOI8-ü microsoftcp1251¿ 1'CP ;
. 5. 5Š 
. 6. 6.  K€ Ìn 1 2U 1  2b ´ 1  Á  b 12 “  2 †Ê ñÃPython codecÂ#to0‡ ? o'asciiÔ solatin_8À'ISO8859-1',ð
    'iso8859_1':  @'ISO  K-1',1 02 1 02 d 2 d 3d 3d 42 42 52 52 62 62 21  ú 21 ø 1 ø ÷ 1 ÷ ö 1 ö õ 1 õ 7õ 7õ 81 81 91 91 2022_jp2 E'JISŽ Ÿshift_jis+ d 'SJISX Otact)  ]FTACT. ?euc‚  wd'eucJP[  - /kr„  [ TeucKR- Outf_>Z EUTF->_koi8_Z UKOI8-[ . tˆ . T‰ . u. U. Oz104¸ 1'RK  y_cp125Cå !CP  . å @. å\ â.  âó&# XXX This list is still incomplete. If you know more: ñRmappings, please file a bug report. Thanks.
}

for k, v in sorted(locale_encoding_alias.items()):h ñk = k.replace('_', '') l? °setdefault(o ³)

#
# The 0 af ð table maps lowercÂ  £names to C3   @
# (& ò -sensitive). En¼ õs are always separated from t| !
#K ð using a dot ('.');% ðy should only be given0 w  " ²
# languageI �is needed¯ �interpret+ = \ Û ð
# correctly (CJK codes often have t T !).90Not aU ðnormalize() function which us5 > [ös
# removes '_' and '-' characters¥ ppart ofÀ  ë àé �before do9ðthe lookup. ThisñZ saves a lot of
# space in the table.
#
# MAL 2004-12-10:
# Updated alias mapping to most recent locale.a$ òfile
# from X.org distribution using make6 a5 2.py� ‘These areš ðdifferences compared|  ¶ 5old� ñ
(Python 2.4
# and older):Õ C   uÆ ð
'bg' -> 'bg_BG.ISO8859-5'V  ªCP1251'
# 9 _< '�ulgarian| $"cz9 Ucz_CZµ 2µ *cs ¸ ?cz_? +3ech~ Os_CS~ 4dut? Unl_BE? 1½ Wnl_NL ½ "et{ Fet_E< 4< 
 ,15²_et_ee@ ("fi= Wfi_FI¤ + } ?fi_@ *"iw} Fiw_I!8ú *he 6_iw_il? 'sjapanes;¢ja_JP.SJIS|  \eucJPql®Ult_LT1®
 -13= v² ]lv_LV= 	 = sï /sl£ Fsl_SÀ2y cslovenî A !Cth_t#¤th_TH.TACT/ h1WCzh_c²zh_CN.eucCNk ]gb231¶ 8 R.big57Pzh_TW= %TW= "TW! Czh_t^6 o8-05-3¡5�cs_cs.iso2LRñ  þU¥serbocroatçUsh_YUÊ®*sr¢G I< #5_hrË À' -> 'sh_HR.öISO8859-2' to 'hr_HR. ñ	
#    updated 'sh_sp' -> 'YU* ? Wsr_CS ? /yu? ({ 'p_{ 5º 
{ ,5'{ %p_{ ? !r· r{  ¯r@cyrillicE )zGr_SPezrÿ Ã "¯_yu.cp1251Í  CP Š ‡ ˆ @.isou2‰
Ï2ÏH 5H 	H Û Q Ÿmicrosoft36Outf8Ÿ XUTF-8y x@ ß ó
# AP 2010-04-12:
# UÐalias mappingˆòmost recent locale.$ ðfile
# from X.org distribution usA Bmake6 5 ð.py.
#
# These are the differences compared|   5old� ñ(Python 2.6.5
# and older):V Ùr—Fru_RÖó X?ru_; %ÕserbocroatianÂ	? Ö q'sr_RS.~ m@latinh> + !> ;½ ·  A ?lat;+Qr_cs.\K qX‚ G  �� -£	HL l 	 ÍÎ qCCð' to 'sr_RS.UTF-ñ8'
#    updated 'sr_yu@cyrillic' -> ñCS.ISO8859-5' to pRS.UTF-D ó
# SS 2013-12-20:
# UT Ðalias mapping< òmost recent locale.$ ðfile
# from X.org distribution usA Bmake6 5 ð.py.
#
# These are the differences compared|   5old� ñ(Python 3.3.3
# and older):V "a3Âa3_AZ.KOI8-C'az R_a3_az9 &S.koi8ˆx �cs_cs.iso¶2� 7cs_Ê2½   Zß2bhebrew@ Uiw_IL+ 8@ *he  @ ‰ 8I '"sd< ósd_IN@devanagari… Þ'  ˆ ssr@latnD $r_¾  "inË  sr Õ E =_csC = D srŒ@utf8W „ 1H #§4-10-01§ðwith glibc 2.19 suppor#|suõ8-05-05N /27N Ã-?6.5Ãâca_es@valenciaÉFca_Eß'15  é 9 
6Ckk_kä³kk_KZ.RK104  |ptcp154crussiaUru_RU_i nBR'

_üP = {
¿P'a3':	  '©,<  ¡? <  ¤c€ 
< Oa_dj7 
Î e'aa_DJ$1'· Oa_er? #ER; t; T; f8 Ÿ   'af_ZAµ  Of_zaB ? _gr_pe@ {'agr_PEº ðk_gh':                ð 'ak_GH.UTF-8',
  P'am':	  l'am_ET; ?_et> ; oerican> õ'en_US.ISO8859-1µ On_es< ‡   'an_E? 5@ ?p_i} @ Kp_INö ry | Er_AA» 6{ Or_aaB /'a? e? E~ /bh? /BH? /dz? /DZ? /eg? /EG? µ ;µ?_iqz /IQz /jo? /JO? /kw? /KW? /lb? /LB? y? Y? m±Mðoc µ/OM~ q~ Q~ s? S? d;/SD½ s§Lr_SSf/_sµSµtà+/TN¹ yfYfOabic8 ô#4bs�sØ? 'a; tUO'astUOyc_p6{'ayc_PEïVó 6z_AY%9EVðz_az':               ð'az_AZ.ISO8859-9E',
&   `az.iso @9e':   ( @ /ir6 H  @ „IR.UTF-8{ bn 8 ö   'be_BY.CP1251< o@latinz < w 1 ø ¯be_bg.utf8C 
l'bg_BG¸ ?_by6 
À | ¸ 3_byŠ k = < ¸ Om_zm~ |'bem_ZM¹ Or_dz< Nr_DZ< /ma< +MA< g8 õ l1?g_b? ¨< _hb_inå{'bhb_IN´ ?ho__ �/ho< /npô {'bho_NPx Oi_vu; { 'bi_VU; On_bd; Mn_BD; í N 'bní ?o_c‡Æ<o_Cdc? 'bc _okmalí e'nb_NO÷?okm\xe5B ? òô Or_FR~  ?r_fB /'b? x›.rx®s4‹Es_BAº 2w?s_b? 'b? ulgaria0ÍOyn_e6k'byn_Ejcõ 4 'Cè �c-french8 V'fr_C'_c.ascii> p /.e –	1 ³1e À              ð'en_US.ISO8859-1',
 �'c.utf8':  ? UUTF-8; /_c8 W   'C1 .3 1 aa o 'ca_EÜ Oa_adB  ? /AD Oa_es? ~ ¯es@valenciÉ  ~ 1ES.Z. žOa_frƒ /FRÂ /it? /IT? _talanA Â [Oe_ru= ‚  'ce_RU*_exten¼–z hinese-¾Å'zh_CN.eucCNz ; 7 ;  TW; &TW; ?r_us  0chr‹ò< _kb_iq-{'ckb_IQ-_mn_tw< [mn_TW< Orh_u�|'crh_UA< Ooati V'hr_H�2ó +  e'cs_CZ�? /_cB ? 	z4 ? Ob_pl@ {'csb_PL8vvys 4Ey_GB4íOy_gbB /'c? 1á²?z_cB sOzech½ ~ dæ;^da_DK;_da_dk~ ? ?nis¾ '? s~ ÀK.ISO8859-1'°,
    'de':	  õ'de_DE.ISO8859-1'? ?_atB  ? /AT? b�  ? B~ /ch~ /CH~ ÿ  ~ ü iü Iü li.utf8Â 
 ~ ‡LI.UTF-8v/lu6 
Ï; Uø ?uts9 ? ø _oi_in {'doi_INº /uty �  'nl_NLº   ? @.iso†1ƒ  ? 0Ov_mv6 4  k'dv_MV¹ ?z_bíJz_BT; eâ ‹Fee_Eå4í?ee_B '? ?stiô (et~ á/el< ½ El_GR±7½ Ol_cyB o'el_CY? /gr? ~ gr@euroD 
 ~ ? %15¾ æ0Uen_US¾ <On_agz 
 > { 'en_AG4?n_aâ ; â ?en_X?en_( ? w¹ /BWø /ca? /CA? /dk? /DK? lX]en_DLv/gbz /GBz h¹ H¹ i+ /I(ni­À    'en_IL.UðTF-8',
    'en_in':  	 ( ÇIN.ISO8859-1? /ng? KNG.Uz /nz; Zz /ph? /PH? sc.utf8D 
 ø -SC¹ sô /SGz /uku 
‰ z /GB? s? /US? Q@euro I  ~ ? 5ñ/za6 ¹   @ /ZA /zm? Mw/zw; Wz wñ,ZSz Og_gb{  ô ²Oglis¬ ? Ec? @.iso|1ˆ  ? ²±? _t ? ½ ß_united-state  ? ~ 
? J.437Æ -'C¯ e  Z p oY .  e'eo_XX%3~ o"6o"?o_ez  w /EOw ?_usz  ? UœOo_xxô  ; ñ g9_'es_ENOs_ar~ Es_ARø >?s_b76s_B7? /cl~ /CL~ c~ C~ ü Cü /cu½ Un?s_d¹ D¹ À9-1',
    'es_ec':  ð'es_EC.ISO8859-1',
2   /es? S? /gt? /GT? /hn? /HN? /mx? /MX? /ni? /NI? /pa? /PA? e? E? r? R? y? Y? /sv? /SV? uvUvu½ U½ vzVz_tonia¸_'et_E? 0<   ? 5²?t_e¾ 
 @ u¸€ ?u_E|/u_1? f·?u_F· fq ½ ´fa_IR.UTF-88Ofa_iz ; ¯.isiri3342@'; aISIRI-) eOff_s/¶ Kf_SN¶ ¡; 7i_F¤îOfi_fC /'f@ Ol_phò  C |'fil_PH¼ Onnis= | ±ow  | n'fo_FOdOfo_fB ? ,yr©?r_b¦Ofr_B% Ofr_cëÀ        'fr_ðCA.ISO8859-1',
    'fr_ch':  	 ( /CH? /fr? /FR? /lu? /LU? Ÿan\xe7aisE 	 ½ ~ /e_¾ ? n<? @.iso’1Á  ? z¿ench_france= áü _ur_it8 Õ'fur_IT.UTF-84?y_ds ; } 'fy_DE; /nlv ; *NL; /ga8  Ò^ga_IE,Oga_iµ ? Olego‚ o'gl_ES~ olicianA ? d9 to'gd_GB~  Od_gbB ? /erñ0'deðcOgermú /  ? (?de_(~ _ y~ ?z_eâ{'gez_ER²Oez_ed< dg&îp?l_e
1? Oreek,<  ~ Fel_G×7!Ogu_ië ? [gu_IN4vw ; vêvê? _ha_ng� j'ha_NG¹ ohak_tw< '( +TW< ™ õ Uhe_ILß�Ohe_i/À           'ðhe_IL.ISO8859-8',
    'hebrew':  '? i;  V õ'hi_IN.ISCII-DEV~ Oi_inB ? 
Ÿ.isciidevH ? Of_fj7  ¹   ·'hif_FJ.UTF8/ne9 ` neú < ÷ /'h< rw u 'hr_HRï2q?r_hB ? _vatskõ? Osb_d8'hsb_DE¾  Ot_ht k'ht_HT°u8 °Ou_HUz  ?u_hB /'h? ongariaì? Oy_amÀ k'hy_AMø  ; @.arm%8D ; 0ARM£_/ia3   :'iaw Oia_fh[ia_FR; �celandicz e'is_ISª1â/id8 ³ o'id_ID? _B ? Og_ng� k'ig_NGø ?k_cnk'ik_CA; Xô nô +sñ  [±?s_iB ð1so-Ó1† 
_'en_U/? 5@ 	? 5o/so~  @ ? ~ 
?  _€ _þ À         'enð
_US.ISO8859-1',
    'iso_ P_15':  9'en? 5@ t7 	M o'it_IT  Ot_chB  ? /CH? i�  ? ~ _alian€ ? u:  õ'iu_CA.NUNACOM-8;Ou_caB ? 
Ÿ.nunacom8H ? w3 ¶  e'he_ILz½ Ow_ilB ? 
O.utf¹  � 0'iw~ 6UTF7j4 Ú´ja_JP.eucJPr_ja_jpµ ;  N ? '; omscode> ; ISJIS° O.pck7 ë 
: pØ#  t %_panes« 	›ê ; O-euc³ v 	c; pÖ&kLôka_GE.GEORGIAN-ACADEMY§Oka_g/ §F þ.georgianacademyF'F .psA  ½ F PtÍ ‡ rA Ob_dz} ‚  ‰'kab_DZ.áOkk_k; õ  'kk_KZ.ptcp154Œ•Œ6l_G×Okl_gB /'k? ?m_kÏ[km_KHö ‡2Ln_IN; /_i> À            ð	'kn_IN.UTF-8',
    'ko':	  Æ'ko_KR.eucKR; ?_kr> ;  N ? ; Ok_in8 Ù kí  ?rea< í   ; ³ ² s®  ~>'ks± sì  ; þ@devanagari.utf8‰ ; . ä?u_täåu_TR.ISO8859-9? wr  ì  e'kw_GB? 1? ?_gbB ? y< +Ky_KGOy_kg> .'k; _lb_lu; Zlb_LUv Olg_uv Vlg_UG/00_li_be{ Ki_BE{ Oi_nl; ,NL; Oj_it< |'lij_IT< othuani–f'lt_LTò 3ò On_cd{ { 'ln_CD{ úålo_LA.MULELAO-œ_lo_laz ? .cp1133F '~ aIBM-CP, ¸ O.ibmC @ �mulelao1‚ @ þ ð ä¸?t_lC @ v³  x  o'lv_LV8?v_lC @ Ozh_tÝz'lzh_TWy?magÖ'( ¯?maiù B'maiMÀF-8',
    'm�ai_in':  ð'mai_IN.UTF-8',
.  /np< +NP< _fe_mu< [fe_MU< Og_mg; õ 'mg_MG.ISO8859-15¸ Ohr_r| Lhr_R| iy –   'mi_NZ| { Oi_nzB ? ?q_n‚ {'miq_NI6/jwê.jwêk´ ö Ek_MKö q?k_mB /'m? l~ l¹ lô ? 'm;  ?n_ml 'mn_MnUnU rí rí rí ;  sv Es_MYá1×Os_myB /'m? t< _Et_MT~ 3~ ?t_mB /'m? Oy_mm� j'my_MMTonan_tw< '( +TW< b8 fUnb_NOõ s_nb_noB '? _ds_de@ {'nds_DEº Ods_n”< +NL< /e_3\ 'ne_3onhn_mx³ [hn_MXw Oiu_nó[niu_Nó  µ'( +NZx 'åOl_NLå ?l_a_l 'nl_A_?l_bàÀ           'ðnl_BE.ISO8859-1',
    'nl_nl':  	 ( /NL?  n< g On_NO? ?_noB /'n? < ~ o~ Ÿo@nynorskƒ 
?'ny? ½ ~ p_no.iso‘1@bokmaŠ /'n? É ? orwegiaÀ? r3
Ko'nr_ZAø Or_zaB ? sùI'nso 5ö/so� A y¾ z;y;? ¶~ 7/oc½ ^oc_FR½Ooc_fÿ'? Om_et� Ä'om_ET.UTF-8·_om_ke; Kì o¶  7[or_INz ?r_i+ ô'; Os_ruµ Js_RUv p$ ± -pa± /pa± ; p ë | 'pa_PK± /p_S± ;p_Acopap_aw)'( .AWx c< C< dt  ð n'pd_USOpd_d”Opd_D” _pd_us� ~ h< 	À         'phð_PH.ISO8859-1',
    'ph_ph':  	 ( ? l< g El_PL~ 2~ ?l_pB /'p? Oolis¾ ? �rtugueseÅ 
e'pt_PT½ ;o? o_braziÉ  ? /BR? ?sixy 
‘%'C-Ÿosix-utf26 
1 p) 
_ �Op_AN¡  Op_anB /'p? Os_af? ¥s_AF.UTF-8ê t8 ¹ ™Ot_brB ™?t_p�  ? _quz_pR z'( *PEù _raj_it'( +IN< oó  5Uro_ROî‹Oro_rB '? Omani0? u½ Ku_RUø ?u_r> /'r; /uay  ; ”UA.KOI8-U¤/ruñ ,/ss/ { "RU{ R{ w´ êEw_RWê¸Orw_rB /'r? /sa£\ 'sa_£?sat< '( < ?c_i–Zsc_IT"/sd0.sd² d± / '; þ@devanagari.utf8‰ ; . ì^sd_pk6  B  F +PK÷ ð e_no':           ð 'se_NO.UTF-8',
% ð'serbocroatian':  b'sr_RS; e@latinA _gs_lt: N r'sgs_LTB < h8  ? } þh_ba.iso88592@bosniaT  A `CS.ISO( &-2€ >_hr/  t  o'sh_HR? ~ H ?'hr? /sp6 � ½ /yu? º_hn_mmB |'shn_MMº?s_cj ¶ 	 {'shs_CA< it  > l'si_LK; ?_lk> ; ?d_e¨Lid_E¨_inhalï w ¯ Ÿ   'sk_SKc ?k_sB ? l-~ Ol_SI~  Ol_csB O'sl__?l_sì ? ~ ?ovaý ü _ovene¿ ~ 	/en
¦;?m_w;3m_WX–Oo_dj·  3Eo_DJµ1? èN 'soè?o_k1z /KEz /so¹ /SO?  ­rn5ø /p_­? Oanis‘V'es_EKvp? __spaiH	? q8ü Eq_AL;Éàq_al':          ð'sq_AL.ISO8859-2',
*   @mk':  	 ( …MK.UTF-8; r8 œ   'sr_RS; Ÿ@cyrillicD 	; Olatn7 	 É  ; Cv f@latin· ?_cs? · A 	; @.isoD2W ˆ | lOr_cs6  ¶  ? l . 	» /me» ,MEr/_rö ­/_r· ; · /sp· /CS£ Or_yu? € Ÿyu.cp1251xx CP( ó%yuó† < ó? 5? 5~ 5¼ ~ ? Ÿmicrosoft? ù Outf8¶  ® < v
¶  ; ² ; 
6 
 : Tß�Es_ZAf1µ Os_zaë 
z ? t< ~ t~ t~ ? v~ Ov_SEü  Ov_fiB o'sv_FI? s—~ ?w_k? <w_KÖOw_tz¹ Kw_TZowedish=  ô 3_zl_pl> Š 'szl_PL{ th ,Ôta_IN.TSCII-0¨Kta_ivÀ              ð'ta_IN.TSCII-0',
    in.tscii':   ( = 
0> = /lk6 ‰  = …LK.UTF-8µ ¯cy_in.utf8A 	@'tcyó 
< e3 	u _  'te;  ?_in> ; g8  v µg_TJ.KOI8-Cî Og_tj? /'t< h9 x õ h_TH.ISO8859-11| ?h_tC /'t@ 	.tactisŠ @ VTIS62› | @.tis œ< aÐ
è< ø Oe_np² A {'the_NPžOi_er; ~ 'ti_ER; t; T; gw N'tigw Ok_tmw Kk_TMw l8 a7l_Pa`?l_p`? �~ Fn_ZAß5 On_zaÁ /'t@ Oo_to@ Ko_TO9Opi_p{'tpi_PG< _÷ Er_TR÷ 9ö Or_cy¶ Or_CY? t� /'t~ 		W  9'ts´½ s³? _;åt_RU.TATAR-CYR~ Ot_ru;? �.tatarcyD/'t? �@iqtelif† à'tt_RU.UTF-8@iðqtelif',
    'turkish':  ô'tr_TR.ISO8859-9? _ug_cn= å  'ug_CN.UTF-8; k8  ¢ Æuk_UA.KOI8-U< ?_ua? '< ?niv; ¥ 'en_US.ut+Ÿuniversal> 9  N o8@ucs4C 9 
%_nm_us. 	¬@'unm® 
< r8  E Õ'ur_PK.CP1256a?r_iØ<r_IØ?r_pÛw z³ Kz_UZO?z_u> /'u; Ÿ@cyrillic‚ ; /ve/  \ j've_ZA± Ove_zÄ; iv ”i_VN.TCVNØOvi_vØv: ?.tc? ': 	O5712º : _visciò 	: iVISCIIê .< ?111w < w˜ ›Uwa_BE1{ Owa_b'? ?e_c’Š 'wae_CHUowal_etí � < Kl_ET< ?o_sKwo_Sôx¯  | 0'xhF1/xh? y	 x  0'yi$é5¬/yi` < Oo_nglz 'yo_NGl_yue_h&'( ,HK< ?w_px b'yuw_Px À8',
    'zh'/:  ð 'zh_CN.eucCN',
1   ?cn'>  ( ™CN.gb2312< _.big5A 
 < "TW( v  ‰ 9 
 : ±  /hk7 Ù !HKu Whkscs´ #hk F  z ? /sg8  { !  ¹ [SG.GB/_sg.gb¾  { < K´ /twu h/twh TW( )TWu   {  ® ; u­ %åu_ZA.ISO8859-1z Ou_zaB -'z? õ2}

#
# This maps Windows language identifiers to locale strings.
> õ@list has been updated from
# http://msdn.microsoft.com/library/default.asp?url= ð
en-us/intl/nls_238z.asp
#Ž Ôinclude everyœ  up É RVista¨ sNOTE: tì ÷ping is incomplete.  If yourÿ ðs missing, please
# submit a bug reports ¡the Python ¤tracker at abugs.p" ð.org/
# Make surex  Œ Ð  J w ‹ dŠP and $ ´suggested
#þ @codeï "
wÊ_²1= {Àõ0x0436: "af_ZA", # Afrikaans! ¢1c: "sq_AL! ulbanian  õ84: "gsw_FR",# Alsatian - France)  5ej Bm_ETI õmharic - Ethiopia*  01* 3r_S” 1rab) pSaudi A - 8- "IQW    V DIraqR c% *EG% SEgypt& $10& *LY& DLibyq $14& *DZ& UAlgerÆ 1™ MÆ tMoroccov œ *TNP UTunisP 2ž *OM( %OmŽ2� *YE% DYeme´2› Sé &SyÁ 2™ *JOL EJords 3˜ *LB' dLebanou 3› *KW( TKuwai…3œ AÂ 0UniF þ„ Emirate¥3« *BH\ dBahrai„ 4¬ ð QA", # Arabic -õ Qatar
    0x042b: "hy_AM", # Armenian  ¢4d: "as_IN  õ ssamese - India(  2c( Bz_AZ( µzeri - LatiM 8% …CyrillicM 6u Qba_RUM gBashki´   Teu_ES  qu’ HRuss“ ’3: "be_BY' ielarusÝ 5" nÝ cBegali† @201a Bs_BA@  os; - ° /14* 	ÿ 047eQ Br_FRQ ãreton - Francex @0402' Bg_BG' Pulgar· #µ5¸ Bmy_Mµ3Bur”ÖNot supportedQ  	$ca0VCatalãò004: "zh_CHS",# ChinâˆSimplifiK , !TWœ , FTaiwT 8T 7( 4PRC˜ c% +HKM `Hong K cS.A.R.2 1« SW „SingaporF$14] +MO] iMacao Y 7‹ :CHT³Traditional† 1048PoÈCorsicaÊ Bhr_HñPCroatÉÈ1b$hrb  A - Bmr 0ñBcs_C^VCzech ‚6: "da_DGVDanis 8™`gbz_AFÚ !Da˜@Afgh( t´ 46e adiv_MV* @ivehÄ…Maldivesq 1 Qnl_NL[õDutch - The Netherland/ 8/ )BE/ uBelgiumV ’09: "en_UÖ`EnglisX ¶United Stat… 8/ !GBV / eKingdo_ c0 AT0 uAustral9$10+ Cù+ TCanadô$14( N–( `New Zee…1° I- 0Ire0$1cV Z~ ´South Afric„ 2¬ J. GJama) ­ C0uCaribbe	2« BØ TBelizc2ª +TTƒtTrinidaý 3¦ Z7ý tZimbabwT 3§ +PHT pPhilippœ+4W �W œ4T M	' VMalay34ú Q `0042.Cet_EÐ0stoœ ²0438: "fo_F€dFaroesè 0046I@fil_é 0# FÝ 5ino? 0˜Qfi_FI9FinÖ0ÖfKAFren„
K8' À_BE", # Frenñch - Belgium
    0x0c0c: "fr_CA", # Fren( cCanada' %10' H' ´Switzerland, 4, *LU, ¤Luxembourg+ 8+ *MC+ cMonaco' @0462¥ Cy_NL' Âisian - Neth~ s- ¡56: "gl_ES- …Galician  ¢37: "ka_GE  Heorg  0  Dde_D  !rml  Ge	 yH 8( C > - $0c, #ATt  K — - Austrig| ;T ;4S *LIS ÆLiechtensteiõ ¢08: "el_GR. DreekÊ 046f2l_G_PGreenÒUic -  / 4¥ Rgu_INL uujarati  6l Qha_NG  ¸Hausa - Lat‘ ‚d: "he_It eHebrewC  39 ic FHind`  0e 2u_H`iHungarÂ Ð Bis_I2IceÎ _ ¡21: "id_ID¢ `IndoneS" 5Ÿ $iu�Inuktitutàuyllabicr8- 	õ  83mBga_I[@Iris”!Ir¡ }  10Ÿ 2t_I.BItalï 
 �' �  ' ‚  41ó Qja_JPó …Japaneset  4bnr0Kan e - Ind¡0043[Qkk_KZG eKazakhE  53E 2h_KØKhmer - CamboF 8£ðqut_GT",# K'icheltuatemal0048lRrw_RWp �inyarwandRR	 ~  , 1kokÄ †# Konkan7 12� 2o_KGKore4tBky_KµfKyrgyz[ ‚4: "lo_L&1LaoÑUo PDR% 2Ö Qlv_LV¬ HLatv–2Ÿ Blt_LÖwLithuan"  82Ù1dsb{Â# Lower Sorb×  46/ 3lb_-$&is“2±Qmk_MK• ÈFYROM Macedo|  43M Qms_MY( �Malay -  s8( Bý   Wõ runei Darussalaa 44ô!ml•" #Q  ! [‚a: "mt_M HMalt¡8ÁBmi_NzFMaorÜ7< `arn_CLQ–Mapudungu4à r‡ GrathA ¦ !ohñ�# Mohawk» ã5&Cmn_Mþ Congoœ„Cyrillic, 8, C, 4PRC'  46Ø Bne_N™VNepal˜ 1yQnb_NO—PNorwe® sTokmalH 8* n* Àan - Nynorskõ
    0x0482: "oc_FR", # Occitan - France(  48( Br_IN( Åriya - India% ¡63: "ps_AF% õPashto - Afghanistan, ’29: "fa_Iy WPersi  15K Bl_PLK Uolish=  16 3t_B= ôortuguese - Brazil+ 8+ #PTI + P8 a- !44X aæ tPunjabiL ô46b: "quz_BO",# Quechua (Bolivia)) 8) )EC) uEcuador) c) )PE) EPeru&  41}Qro_ROÄ aRomani¦ y ¶417: "rm_CH* 8 uRru_RU 'usu0243à `smn_FIŽ ÃSami Finlandb #10$ 1j_N$ dNorway# G 1j_SÕ # VSwedeþF eE 1 # # ™Northern O $08,  N , 
X c,  Á , 
Ë 2Ë sï TSkoltÊ { !ma¨ § ?Sou§  1{ )maö , 
§ u44f: "shtSanskrix @0c1a  Ar_SP¨BSerbð„Cyrillic¢ * +BA* {Bosnia 1 /08[ DLati¡1' X . 10459Bi_LK† Pinhal ‡Sri Lank$‚c: "ns_Z± õSSotho× 0043—$tn& qSetswanR SVAfricX 1ƒ 3k_Sƒ UlovakP  24QBl_SI¡ @loveC! 0rRes_ES! p°uh - Spa$08' +MX' UMexicÀ c( O „ (Modernâ$100 G¦S „Guatemalé $14+ Cü+ vCosta R1¯ Pm, UPanamT ¯ Da( ö Dominican Repubz2³ +VEuVenezue³ 2³ _ eColombB2± U  ­2¯ A„ArgentinÚ 3¦  ‰ Y‹T 3¤ qDChil3¡ U{ UUrugu3¤ +PYGPara* 4£  U	£ W£ 4£ +SVS pEl Salv[- © H±ð Spanish - Honduóras
    0x4c0a: "es_NI", # Spanish - Nicaragua+ $50+ +PR+ ´Puerto Rico- 4- +US- ò United States
#ˆ r0430: "+ 0utu€ Ãot supportedW Â0441: "sw_KE, ewahili  1d 4v_S "edÎ dSweden( 8( Fö w( fFinlanp 5ôsyr_SY",# SyriacG ±428: "tg_TJŽ õ Tajik - Cyrilli( 085f( Pmz_DZF õTamazight - Lati˜ 0449) Ca_INQ 5miln  44 Ct_RU 6tar  © %te: Uelugu  1e; Bh_TH; %ha4 85SRbo_BT æibetan - Bhutaœ ( Cœ ( 6PRCi ê 2r_T$uTurkish  42ˆ Bk_TMl Purkmel 3 483ug_n ÖUighur - ArabZ 42Q Quk_UAQ wUkraini¶ 2ú `wen_DE{±Upper Sorbiä uGermany¡ 2w Br_PKP %rdE8 �0Urd¨DIndi$Â0443: "uz_UZ@ 0zbe	æ8% 2ÔBvi_Vr¥Vietnamese¯ 5ÿ Qcy_GBo 7Welm8žBwo_S? æWolof - SenegaW3WBxh_ZCPXhosa' ¦outh Africß  85`!ah„`# YakuÅº 7{ $ii¾XYi - '6Ú Qyo_NG¸ PYorubu WNigerO3p $zuœ ñZulu
}

def _print_locale():
ô""" Test function.  ñ categories = {} M Vinit_ ( = !):1  ³ðfor k,v in globals().items‹  "  öif k[:3] == 'LC_'E # b q[k] = vg _” ) Gdel 1  S RALL'] 1('Ló defaults as determined by get A'` B R-'*72 ¿lang, enc =8  • 5 ÐLanguage: ', 7 ° or '(undefz )d �Encoding/  ` . 	)á úsettings on startup:d È  ´ @,?y¾ >ies¿Ö 3 S '...Z  · Ý EM y8 ( C O'   
6 #5 	'ˆ „ À('Locale setò&tings after calling resetlocale():')
    print('-'*72 	' $ ófor name,category in  Áies.items():- U 3 S '...l   Õlang, enc = g� M y‚  ( ˜ ð   Language: ', ? ÷ or '(undefined)^ 6 �Encoding6  o 5 !)
¿ 6tryÈ 0¢LC_ALL, ""£ fexcept* y DNOTEZÆ H ò does not support the default ¨Û Pgiven€ - ô	OS environment variablesqLelse¤ À � LO set5» ã  A \ 3 5 E7   ü; , K '?
: C9 …)

###

HÂLC_MESSAGES
6¢ NameErrorœVpass
«÷__all__.append("A �")

if __$ã__=='__main__'K ÎÓPaliasG_ _g(  	 Ñ'Number forma û, ð$_test()
# Copyright 2001-2019 by Vinay Sajip. All R$ ñ>s Reserved.
#
# Permission to use, copy, modify, and distribute this software  its
# docu atK  Š±any purpose( òwithout fee is hereby granted,
# provided tha˜Qabove� à pnotice ¥ ar�0all 1iesc  9 r
# bothE  Ë 
; n_ Fis pø V $
# Á	Ù  g 8 8 ofk!
#^ beLd¤ `dverti E�publicityƒ @taine &todPion
#V  mj>ðspecific, writtenM orM ÈðD.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# 9 xIMPLIEDA û"OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALLš ð
BE LIABLE FOR ANY SPECIAL~ ðDIRECT OR CONSEQUENTIAL DAM×Q OR
#4  ðWHATSOEVER RESULTING FROM LOSS OF USE, DATAV ð PROFITS, WHETHEN ÀIN AN ACTION0 ðCONTRACT, NEGLIGENCE; O0 ð TORTIOUS ACTION, AðRISING OUT
# OF OR IN CONNECTION WITH THE USE °PERFORMANCE0 ñVTHIS SOFTWARE.

"""
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.py; ð

Copyright (C) 2001-2019 Vinay Sajip. All R% òs Reserved.

To use, simply 'import lª  ' † ‘log away!Å 
# òDsys, os, time, io, re, traceback, warnings, weakref, collections.abc

from string i| �Template õFormatter as Str ñ


__all__ = ['BASIC_� T', 'Buffee 1   €CRITICAL PDEBUG	 –ERROR',
  B'FAT& °FileHandler, CFilt
 ™   " KINFOM �LogRecord+  B 
 CAdapS QNOTSE¾ ENullT 	™ eStream ` 'WARNX   !INÑ ÀaddLevelName »basicConfigš ƒcaptureW¸ - €critical Qdebug	 QisablM [errorG Pexcepä , 2fat> 9get‡   2oggý  [ClassP @infoK !lo~ ImakeD2set== « 'shutdownI  ‘ I   !inM y �pFactory" S  	z lastResort0 draiseEø Ds']
'‘threading¡Çuthor__  = "ž0 <v« _s«ó	@red-dove.com>"
__status7 QproduC`"
# ThG@llowYðmodule attributes are no longer updatø‘__version0€"0.5.1.2l  !  j £ ÿ07 February 2010"

#- 7ò
#   Miscellaneous mÂ Odatak ;@
#
#I�rtTime isødGðthe base when calculatO   re !veç` of ev’7
#
N = .
0()
k p ¥to see if &@s du›  hY x ðshould be
#propagµ<
#
U a= Truep õ If you don't want z A 8`ion inM á@, se& ñis to zero
#
logT²/s ^ Àmultiprocess´ d M> l g È P� eÊ »À------------- ÿ
#   Level related stuff
#9  à
#
# Default lm Rs and ðB names, these can be replaced with any positive set
# of values having correspond T ñ. There is a pseudo-~ ð, NOTSET, which
## °only reallyŒ @re a8 ólower limit for user-defineÁ ¡s. HandlerÖ q
# logg  } „nitializÍ { € so thatk `y will6 ° all messagŸeven
# atv ñ
#

CRITICAL = 50
FAT  ò
ERROR = 40
WARNING = 3 3 =  ð 
INFO = 20
DEBU$ 310
¨ a= 0

_7ô ToName = {
    f 4: ' !', w 1: '  l 3: '
   | 0: '  „ 1: '  � 2: '	 `',
}
_å"To½• ‹ :¡ • '1':   ¢ !:      $': =ING ¸  :  * · !:   ¶ :x±
}

def get¿  X(d!):B1""" `Return%ð textual or numeric&°resentation z  L ! ' 1'.
L !IfH  ñe3 zthe preÓ$ (Ó,
ð ã )V Pn youÏ    Œ¡string. If% Ahave� aassocis” sí Ö@s usÇ 5add  Z 
 " K 1ù  æ rB&eda@B® Uto on‘is passedÁ !in¶A ï œ?is Š - oªt  p Š Ñ l €no matchW/ 3or � 9 k  d 'Šc %s' %º	i  ·�# See Iss¡á#22386, #27937ùa#29220Pñwhy it's this waym 0res,(= zC.get&% 3if ( ²is not None@ � p# 1 . (= ;V 0¤" " äÄ¾ ,? õïA» # 'ÓÇT-i' Wðhen converting levels to teñxt during message formatting.
    """ á_acquireLock() @try:# ò&#unlikely to cause an exception, but you never know..^  ? Ñ_levelToName[ A] = 	   k ( pnameToL. (   , ( �finally: 5 dreleas· ò
if hasattr(sys, '_getframe')6 bcurren  ˆ µambda: sys., ñ(3)
else: #pragma: no coverz Hdef H (\  ’ á"""Return the { p object| âcaller's stack$ .‰ D  zi     traise Es … ã  2   rˆ  Û ñexc_info()[2].tb_™ ð.f_back

#
# _srcfile is used when walk@ Í ¯  Check  �e've gotÚ ‚first
# â à  , by skippN ~ €s whose u  ü y ðthat of this
# module*�ource. Ih órefore should contaip1ileL D B A
# sD o .ò ñ Ordinarily we wM  Þ __“ #__±"isãcfrozenR Ðs don't alway« Uhave : Aset,? ðsome reason (see Issue #21736). Thus, !geÛ !
#¡ Ä õfrom a handy codeI @func‚‘ defined #is£ �.
# (TherAÔno particular‘ qfor picá1add{ ue.)
#

ù= os.path.normcase(.  __� Q__.co: ½ +)
SBonlyX in³j½ Kwith)» ñ
To provide compatibility 1 àolder versions3@PythŽ5setÌ 
#´†None if à)lánot available;sð value will prevenÎQfindC´1() • beÆæòd. You can also doJ !if@want„ Pavoid� 0he H@head¶ UfetchM  r ¥ ¢Y � g
» &
#¹ `.
#if Ì ù#Ð 0


È _cÍû(•ÌÒif isinstance S, int  Q 3rv É‘‚elif str- 3) = •"ifø¯ @in _*ó& [ ñVŽ�Error("UnYnA r: %r" % ®6  ‘ U H]Ÿ &see RCType` ™  anè �eger or a idÙ 1ingy O  p  "% ü ",)” r�orv

#- 7
ÏÐThread-relateŸ 1ufff À------------- (ñ

#
#_lock is used to serialize access ðhared data structures in this module.
#T Aneed6 €be an RLa ñbecause fileConfig() creates and c  W ±
#Handlers, ðso might arbitrary¬ ór threads. Since 5 ‘ code updZ cthe
#s¾ `iction@ %_hb 5it ± Àacquire the …. But if� ding,
# � would alˆ Ãy have been H ‘d - so web (ñe same argument applie7bLogger‘Manager.l ‚Dict.
#
´=Aing.e“()

def _€  y±():
    """ Aã ·a-levelð E for ?ing!.
J ì!sh€be releaCcwith _ ƒ .1 ƒ 1if Á ™  �  .¶ Æ 	C - C Rm ©Æ I �d by callÊ 
‘ �  ‘ q
# Prevª` held ’ Y  (p from b   ra child ( ò%.

if not hasattr(os, 'register_at_fork'):  # Windowrfriends³ ß5 q_reinitF“(instanceø _@passV ìno-op when os.F Q does¢ ²exist.
elsew‘# A colleAD of f !s ï$a Á Œ ” method (ÿ ž)
#T!be�"edGe5Pafter‰kØð  The weakref avoidªƒ keepingN •discarded  Ralive=¤ 0_\ Tset =f €.WeakSet÷ >s"
o§  L 2tryR    “ 	F.addÏD lfinallH ¬p¡¹ Of ˜£ÿ s  �  þ ”6 _/
Æ 5 .2 B \ #–K was 0par`ebeforeø # d ®” ©· un sed statñ y ç š  (€ =Â,…  R  _1in_Z"=_ Í 	oJ =BV)


#éÀ------------- !ÿ

#   The logging record
#M !4 Á

class LogR^ ñ(object):
    """ A! ð instance represents an event be©  ± Aed.
< [ : Ðs are created9 àry time somethB !isö 0ed.yI ðcontain all the information pertin‚ !to �   J I mF 	> °assed in is òmsg and args, which³ qombinedF  us© ¡str(msg) %. 3 toÙ † ñmessage field of ÇÙ I  Ð also include† Ý  su€ gs whenB C wasm !d,J  °source line1 !re2  ’ ¯ c= 8 Rmade,å €ny excepIG Bto b‚ Ñódef __init__(self, name, level, path  šo£  B  Amsg,7,‚ _x à, func=None, s  @**kw�š D ž  ÁInitialize a; î ZÐwith interest  W :.ò  B N Act =“.˜%()%  è .Ö ! =î 
  8U= msg #
  p follow„ `statem²a Qs pasR€of a dic�×ary as a soleK @argu< 0, sï×at you can doF8lik6 ö.debug("a %(a)d b %(b)s", {'a':1, 'b':2}÷ €# Sugges°öby Stefan BehnelBP# Notp0at t1out}�test forëø[0], we get a problem becaus­ 0dur' ¶6 K ‚to see iO0arg·Œ —+A'if ¶ =R:'. I7 ! F °e.g. 'Value 7%d'K  u  ­e!{ fails g  ø @n no÷ 0matÀ I ðis done. For exampl8éogger.warning(†  , 0) wouldÅK 	& b!eaj (0'£ s  (€use case– Î  mx‘, this shu  noÜ' az »\ ðIssue #21172: a requüq Prelax5 isKWcheck\ °to hasattr(·4ð'__getitem__'). However¨ Àe docs on st6J @` still:mˆ sÑp a mappþ ú ÷ ¸ $irñ R# Thu0le Premov7  MË ð, it does now loCok
  õ,# for collections.abc.Mapping rather than, as before, dict.D ñif (args and len a) == 1 ¡isinstance O[0],r )U     P  Y Z[0]):  o #=   Pself.   
 ðlevelname = getL QName( { F  Qno = 
 
J CpathI  ! :try¬ O Cfile2 0os.5 A.bas (   ‚  ý 7 Pmodul° 5 ‘splitext( V E)[0]� ôexcept (TypeError, Valu ‚Attribut X	V 4 = › ] š ¡"Unknown m¬ "+ L pexc_infH !  Ñ p = None` ð  # used to cache t �raceback / 
E Tstackh sp 
  BlineÌ	 
 @func0 =  
 Êcreated = ct úmsecs = (ct - int(ct)) * 1000+ •relativeCM ¿] Í- _startTimeB ßif logThreadsZ t 2 = 	 ïing.get_ident(S ' ñ   4 ‚current_ 0().’Ç õ	else: # pragma: no cover!  ¸ñ@ Î ~  ñ# `if notì ÿ Multiprocessingx 0 Z ½ h ª 
2 b'MainPu '- ’mp = sys.ás_:('m¥ 'j�if mp isÓ  ç 
¹ „ !# �Às may occur 6 
W 2 haD ùfinished loading¢ O  ye‰@e.g.I ÿa custom import hook causes third-party codeM  Ëto run when ë c callsX ç. See issue 82ù ”   ažan exampll 0 6   O
¥4mp.¨ © 9   Eoion: #¼
 4   Epass{Peàÿhasattr(os, 'getpid'E  A = o27pidŽ“>‰ Ádef __repr__7n ùreturn '<LogRecord: %s, ð"%s">'%(self.name, ÷ self.levelno,
   ¡pathname,  clineno Qmsg)
3 ð def getMessage(+ !):  P 5""" ÂReturn the m. ò for this LogRecord.V  < 0 õ after merging any user-supplied~ èarguments with† .$ ® ‘msg = strÓ .ñ  –   "ifFargsì   6   %# ` rðmsg

#
#   Determine which class toÅ ð when instantiatà Qlog r)ts.
#
_l8–Factory =K 

œ5set]% "(f- ¨ö 1Set  †  be‰ dŠ &a Œ µs:param @ ´: A callablÞ qwill be  eda Þ e&
V  Rž }global ò 7  $ =‡ g ÿ oÂ  ¡ ¬ � é— � Emake”[(dict‹ fMake aÊñ whose attributes are defined by· specified R bionaryÖTb°function isÔ1ful~aconver\|FPeventh¡eived over× âa socket conneO (¹@is s5 Gas a� h) intoÌ I ÷"ce{ãNrv =ár(None,  p"", 0,  $()   )X Prv.__ÿ ’__.update_ ~rv


#- 7É`Format‹Ã £4nd usq ;e_str_fr U= Str� i()
del 1


– ñ PercentStyle(obje{sdefaultW c = '%(§1)s'# yasctime#  # bsearchF # E `validaŠ!_p1ôn = re.compile(r'%\(\w+\)[#0+ -]*(\*|\d+)?(\. ð)?[diouxefgcrsa%]',E I•�__init__À�, fmt, *,6 è !s=6¾ ¹P._fmt;Rmt orÁ
 ë/  5s =X À z}usesTimB �fmt.find¦ .+_?f) >= 0Q ;Q B"""VVe
PinputÞðmat, ensure it matches the corrãect style"""
  ñif not self.validation_pattern.search( e_fmt)::  A ñraise ValueError("InF À format '%s' 	 ~ 6 % Q ,{ ‚default_7 a[0]))
j Cdef  5 ‡, record‰ 3if ? Bs :=P _ 
° vª 6s =1 |P ‘.__dict__v  Ü Oelse> ƒ 3 creturn‚ bfmt % r Ì á Ë :trys 
R T(~ )© ‘xcept Key„K as ¹ §!'FK ¡ting fieldƒfound in : ½ò% e)


class Str: SH�(Percent ‘x³á = '{message}'² xasctime!  ! {B ! 'Gö4fmt_spec = re.compile(r'^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.( ð)?[bcdefgnosx%]?$'b".I_m  D ÿ	\w+)(\.\w+|\[[^]]+\])*$'½±.«"**ÄÔ ã1ateÇù 3B"""VD°e the inputÿñmat, ensure it is Bcorr•r‰”)§‰ ¹Bset(œ q 0bfor _,Ô`name, *À, conversionàC_str�‚ter.parsÌ .ä  h &ifS 
¡    H­ 6q.match(  � , 5  ¤iK¡ ame/expresÇ v: %r' %— V z Ws.add… ˆ& (if!8and  �in 'rsa'ü » w°  ± !if® �  v vîK ÏF‡ 1badR Tifier‚ B e=Ã?›³)V
6§ N "no×sHz±ingTemplaterÀ '${message}ó'
    asctime_format = '${ }" lsearch" E ðdef __init__(self, *args, **kw
 !):)  r …super().1 + * ñelf._tpl = Template_ q._fmt)
)  | rusesTim k  fmÒ  ‘ 2 0  ƒ óreturn fmt.find('$ó ¦') >= 0 or ?   '& € Tvalid� € wpattern¿ . ‹ æfields = set() ƒor m in 0 ¨ Giter S Ô èd = m.groupdicL   Úif d['named']9   † V.add(' Ž  # "elD ObracE ( F  § P(0) =q'‘ ñraise ValueError('inf ©ö
: bare \'$\' not allowed'o !if Û 
b ^ 2no 9 'gþƒ‡, recordî  �efaults :Ñ ¾d 
� vÙ  ö # |P 0.__¿%__Oelse> ƒ 3 àº @â.substitute(**} ð)


BASIC_FORMAT = "%(level'U)s:%(	 ñmessage)s"

_STYLES = {¤ ø'%': (PercentStyle, Y "),' {' AStrFj) %'{r 0}:{p 3}:{n $}'; $; 4ing@ $A $B $C ’}

class z  Ecobject¼1"""¢  ° instances eñused to convert a LogRþ  Rtext.B Bs ne5 ‰know how6  isM àstructed. Theyk ‡ °responsibleí *  w 9ingD ðto (usually) a str" ‘which canK ðbe interpreted by either a humanèPan ex¦‘al system� V base2O d0s a— @mattq x Ðto be specifiÓ I~ñne is supplied, theI s&³-dependent  š,ˆe)s", "ÎQ", orB "ã ",e  ¥†'Th¹   ›  �Åialized withÆ 
:Ámakes use ofi  À@ledg  À üñattributes - e.g.  	Ì ¡ mentionedM habove d 3 €fact tha e} Cr's � and arguJ �Apre-O  ÚHinto@ ¦ ð. Currently, theñ) useful
    attributes in a LogRecord are described by:
1 €%(name)s=  ðName of the logger ( Ãing channel)= wlevelno@ qNumeric9  1 " A forO ñmessage (DEBUG, INFO,L }  ú	WARNING, ERROR, CRITICAL~ À OText{ "| @", "~ " "€  + ‚  	 „ "… JpathDTFull  Iñsource file whereWôcall was issued (if available‚  T ‚ 0ile € portion… ‘ l y%(modulùM  9 _ : †lineno)dªSÜ   ~ numberã  Ë M C 
 ã 0unc—iAFuncÛ  è M µ%(created)fN 1Timonn S. p (time. (R> 	 µreturn valux0asc6 ”  @ual   w ³ XmsecsLÈ Millisecond† �²  Ï ` A “relativeCü !d ô Fin mI s� _ 1 toC z 	 º H¤aloaded˜ : P(typiÁy at applicaÃqstartup7ƒˆ%(threadT ? ID1 %1  !3 hprocesP e Àó�he resultermR.getMêÿ(), computed just as" äB “ is emittP2"""°±converter =/`.local–  ödef __init__(self, fmt=None, date  style='%',×i �=True, * �defaultsK %):Ä  š ã’InitializÝ`format¬ àwith specifiedÂmat strings.º  E A @eithV H  &L e, or aœ ´ 7 asûÀabove. AllowŠ ˜ ¶ d"   ¸  ¾ ¹ O  y  op²!al* õfmt argument. If Bis o¾Å, you get anI ñ
ISO8601-like (or RFC 3339 )� aUse a ±ð parameter of '%',ó '{' or '$' to specify that you want to
  òuse one of %-formatting, :meth:`str. ²` (``{}``)   ( 5 orK a:class3 Øing.Template`/  in† r @ str+ 
D õ.. versionchanged:: 3.2  õ   Added the ``style`` parameter.* 5""" 1if * õ not in _STYLES:!  ðraise ValueError('S^ t must b&ù: %s' % ','.join(D  H 	 j •.keys())). bself._– =‘ [ ô][0](fmt, defaults=	 @ ºif validateÇ Y ." &()b  bfmt =  u Z._fmtž  \ ( 
 E Œ b_time_
ñ = '%Y-%m-%d %H:%M:%S'N . Hmsec. us,%03d'S PTime(— £, record, } f=None)ì àaReturn�creation Ÿ  Ö )�ied LogRX 3 ass tNBext.Œ  ¿PThis  �od should³called from; s() by a ‘ter whichù  H  ms‡Qmake kf/ d¥ (. o 0canl ¥overriddenM 2in n1terU pprovide C anyìðic requirement, butG òbasic behaviour is”llows: ifq3 (a )% D,K  it ’used withÎ @strf| ()ù ²  �  šK íñ. Otherwise, an ISO8601-like (or RFC 3339 ˆ… ü‘The resul£e & r(#edsAfunc,`uses a¡år-configurableŸ * ‘to converUÔ äto a tuple. By¾0 `.local
 (W >;*ð  t{Pfor aÕdticula/&temÂinstance, seŒ '™ Ðer' attributeZ %a ¿ §fhe samÞ �signature
 › 	¥ "orÙ gm s(). To ® "it~&ll+DAers, pexampleY€±all logging\ Ï bel wn¡6GMT7á iøFw  †(cõ,(zž)edazt Ô1s =´ .é' F, ct? <els™9  è.! ]!
J  u  Á 1- Nð :
             ð   s = self.default_msec_format % (s, record. Cs)
  ‘return s
 Bdef 5  Exception(W a, ei):#  8 5""" Fd Cand L ô the specified eI 2 in[ òion as a string.{  X SThis Â ° implementa‡ ¥ just usesz õtraceback.print_j (ß ª ¡sio = io.Sx 'IO( ¥tb = ei[2]_ ð# See issues #9427, #1553375. Comœ `ed out4V now.= £if getattrA÷'fullstack', FalseQ#þ Ð - ð (tb.tb_frame.f_ï ¦, file=sioè < Pei[0]Àù [1], tb, None, ? ?·io.getvalueˆsio.clos öif s[-1:] == "\n" É N F[:-1Mg ËATime²�Check if S= 2crebtime o% åˆN „  'u_style.… )… bMessagž <¦ L    (‚ P Súì !, Ù_R ª ñmethod is provided6€n extensFBpoin}pealizedü ‘ @tingu „	xÀe input datas � s ì õed from a call toh |:func:`ƒq ±`, but withµ last trail— unewlineJ {removedš Obase™ sY ·¦ passed inŠX1 €ö¡ÄÖE ñ “væ2  .KtextÁ  0's �ibute dicÖ0arynuµ aÉ @operMEto a* g2matÒ '  C Â which yieldB æ %ed` ”  hBeforeF  Å ‹ ,ÝAouplOöpreparatory stepy€are carrß¢out. The m1ä 	“ ç gcomput¢ usBLogRœ4getxB). IÓÇ ¶ õ (a<°termined byÎ «5m#),ÿ  & iÖ  ×Sed to"  b p event ` � rÖ,‘  itð º 2ed é  E0() éPappenÞ!tos IÂÅÐessage = recoórd.getMessage()
  õif self.usesTime():  # òrecord.asctime =. aformat0 ! , vdatefmt_ s2 € 5 ' 2if  š.exc_info† �# Cache t ðraceback text to avoid converting it multiple · sÓ p# (it's1 Æstant anywayŽ  ø hif not–  n 
–  ( ·  ! 
ï §Exception('  Þ l 
ú  C 
d   Ú[-1:] != "\n"  ƒ d! + 	é  }  a $ | _stackx ~ 1_1Sg t òreturn s

#
#   The default C 0teróóuse when no other is specified
#
_7 Fª 6 %=  ö()

class Buffering cobject1"""/A €suitable   1matv¤a number oÎ!s.= E Ðdef __init__(P, lin1S=Nones  Ó2   OBCallyá 4y aw ðer which will be used -Q eachƒ  I ¤individual× p $if– 
k ± .° $ =$ C Oelse1 
’
<  ® cHeader´sR( h6 0 stÆ %ë Š ì p,""Œ OFootŒ f6 Œ =Àü S and ë  30resQCas a¬ ¨Cv =    eÌjs) > 0òr1 Brv +	×Ñõ N   3for¡3 in
 sT  ' X ….` PE2  * ÕŠ orv

#- 7Â0Fil}n!esŠ@funcsn ;Òq ð(object):
    """ñ&
    Filter instances are used to perform arbitrary f/ ñing of LogRecords.
M ðLoggers and Handl àcan optionally\ u #toZ G rU ó as desired. The base( ð class only allows events whichÆ K ñbelow a certain point in the l¯ ó hierarchy. For example, al I òinitialized with "A.B" will� € U Cd by_ s* ,F  5 A.C", D.C.D ñ D" etc. but not  B !B.h  !IfE ‹  Ì Ðempty string,’ �  Ðqpassed.> 1""" `def __L ñ__(self, name=''):!  -   I÷  ”  P  (  rž¢, togetherK5itsr ’children,[uhave itÞì �ahroughÇ”u. If noI } Áis specified ow ry "nt ¿ é  .? =S   len = len($ )ú Nˆ LÄKÁDetermine ifÃ ¥  8 0 is€b¤diµReturns Tru? 5 ushould 6 À, or False onFwiseó ñIf deemed appropriate,� P 0mayM 1modA‡ in-placD 77if !6= 0G br¸ · Q%el5 came ==ÿ ~? ¬ 2 Q.find€ F, 0,“ ?) !” #• © (Y [Ù ]¥ b".")

‚@“er(objectñA´+ 5for "h"³Ç@themüQshare• £common codz^  u	Ã~  o$   º‹0ist—°i2an D?lis	6 F= []ü2add
,:� 1AddgöU  ÷ Sthis ¬Î iç3t (4 "inä ss  û ¹ s.append9 ¹oremoveÀ R0 Ã _from Å –  Œ¥ 
ö .§ ¿ I y¶;àDetermine if aó& record is loggable by consulting all the filters.

  °The default@  to, !ow. W Qto beZ sed; anyG • can vetoM ˆthis and>  is ón dropped. Returns a zero value if aÇ N  : { ; °, else non-: Å ö.. versionchanged:: 3.2æ ƒ   Allowº "s Ô �just call3%s.z 5""" •rv = True ãfor f in self.S:  Yò if hasattr(f, '$ *')%  )  re£4 = I (u)O  ø < 	5 • # assumeÕ Á - will raisf9not[ rif not ˆ d   þ FFalsÿ  ·   UbreakL rÖ rv

#- 7ò
#   Handler classebŸfunctionso ;2
_hm ðs = weakref.WeakV§!Dit Ðary()  #map oêŸ AnameZC M �List = []¡@dded€a‘,    be removed^ reÔeb ò	order initialized

def _. cRef(wrdÂRP 3 a h ð  reference from›ò internal cleanup listG 0# TÛuúbf`ed dureòmodule teardown, when globals arCP# setî pNone. I�Qn alsë �"edœ ñ	another thread. So we ne?yñ# pre-emptively grabÓ –necessary €nd checkk€they're ƒ ,J  toM �vent race>!dibÒ„failuresí 5°preter shutò 4ôacquire, release,| S_ PLock,Á#  ¤ .•  M ƒ P  + s²Y (:6try  ²@if wG‘ 
  # X .[ Q‹   kfinallT • #()“7add�O •7Add’!to³Q†0 usZa‹¼i�Tÿ 	û Ó X„.append(ÛCref(¥ � ~À )Mù _ö  ¸ ú ™§!(Fee‹W € instancKqispatch\ è eCñspecific destina‰ò ³Ðbase handler ô6class. Acts as a placeholder which defines the Handler
    interface. ðs can optionally use Formatter instancK 1o f I arecord€ °desired. Byx tault, n. E ðs specified; in thix 1se,M  ¦ Ð'raw' message× âdetermined by p .  ¡is logged.A 1""" ñdef __init__(self, level=NOTSET):&  	2   �Initializæ %heô � - basicqsettingR Ú uto NoneW 2and"  il Òlist to empty«  q } F* 9er.¸ )R  Æ Š._name =l  ß   = _checkLí ( B ³ F æ_closed = FalsÏ B# AdÑ hE Í  ®ƒglobal _ Lè ö	(for cleanup on shutdownŠ C_addŽ1Ref¡ Ï ÑcreateLock()
 Ó1get2 Åqreturn : ! 3 s3  , @þt_acquiri  ”  6try]   'if]  ¹ñ s(  , &de&s[” ]Ç  "    ! =– 	 !if ] x [Ê 1] =˜ < !fi¼
8 t_releaså -  > Ä = property(Z$, 1w� · @ÁAKà a thread lock+A serW 7daccess?punderly ?I/O s .L =Z Sing.R L  ñ_register_at_fork_re  : 0$  5r .) :<  )3I/O¾ ë g ´ �  ß “ x ‹ à‹ 	R”‹ 6x ‹ 2set| ± u01Set�  À ®2 ofQ". ¹° must be an¼Ÿ or a strH } .P  Q9,[® 
± Ã2 .Y §@If aó5sO,KÒit. Otherwise  0def)5 œ  L  F " dmoduleé À  """
      ÷  if self.formatter:
  [fmt =" ! Oelse/ ”_defaultFT 2 £return fmtq ‘(record)
# �def emit(“ #,  c 1"""(  ¡ ð#Do whatever it takes to actually log the specified CgingX .t  L ð	This version is intendedP õbe implemented by subclasses and so” 1rai V NotI5 eError.& Æ 2 /  ('	k must ƒ 'J  ¼  ·'by Handler° 'hh j‘ConditionW— XAEmisTódepends on filters which may have been adu ` ¡ 8AWrapÒã *^ !of /Á with acquis¶ µ/release of9 ` �I/O threaQck. R� š QetherT ®   pïd f 5forN eç ãvBû óºVif rvå    .Ä Ere()i   :try,   0  š]   !fi»7 g ¦"rv" –&seÎ4Ffmt)S Õ1Set+T0 foO=is Õ8 Æ 5 =(ƒ Qflush| w ¥Ensure allê¢output hasaD /edû�does noth& Üš AË _closeË 	ò	Tidy up any resources us� ¾Iƒ 	ÅPremov$het� from anÞ´rnal map of  %s,K _^ #s,§i}  È p lookupuname. SH ‚should e™0thaâis gets called– ²overridden ômethodsW##gkñmodule data lock, as we're updatÑö shared structureU _mGLock
 m B�#unlikely´€an excep±, but you n�fknow..^  C Ý_Þ …d = True(   ‰_NY ˜ 5in ”t 7   6del [i  F ]a À         _reñ leaseLock()

    def handleError(self, record):#  ' 5""" H/   e0 òs which occur during an emit() call.i  F ñThis method should be% sed from‹ rW !enI µxception is‚ ¿encounteredt ¤ If raiseE@ ¶s is false,H  ñget silently ignored. ± iŽ  at@ 0mos  ewantedG  for a loggþ �system - - @ useÎ ôill not care about@%inH ;theF p, they 5 amore iõ ñ sted in applicaŽ.L PYou cb�, howeverÖpplace t‡¶with a custxÆ if you wishL 3Theî`was beí pprocess� Bs pa
 Bn toe ìJ Gi¢õand sys.stderr:  # see issue 13807à  O¡t, v, tb =6 ªexc_info()& &ryÈ 7   f Ó.write('--- LÃMz ---\n'M  < ôtraceback.print_eF(‘ q, None,– Ì F ‚ ¿Call stack:x `# Walk& ð frame up until we're [$ofHì º   p# so as£¿ P  ¨ Ïvcontext± 2   k �= tb.tb_ 	e $ qwhile (  Ëò os.path.dirname À.f_code.co_fp}ame) ==N  R P   __C W__[0]�  p =0.f_šN "if  
 D Ò…¯  , ¦ =®ÊOelseX #ƒ�n't findkXrightÁ , @0some6aso ›  � ± ­7 ¤ ý %s, line %s\n' % (N 	 í.D  § ( þ.L >no)ñ 2# I’P8671:r4putr� message†argument»z t–  é MQ : %r\n'Ô $'Az :é >msg {  F Oargs ¡ RecursionVÊSÊ_36272È ³ T Ëm9ðUnable to print theÿ
 message and arguments'
  ÿ' - possible formatting error.\nUse theN ðtraceback above to help findI Y R )Æ  except OSEž ù: #pragma: no cover.  ÿ @pass ù# see issue 5971) ‰finally:  6 Ñdel t, v, tb
 ödef __repr__(self)6 Àlevel = getL AName$ . Ë òreturn '<%s (%s)>' % * ó__class__.__name__, > 
 ó  StreamHandler( † 1"""¦ 2A h   4 ðwhich writes loggâôrecords, appropriately1ed,K ato a st P. Notsat this] Âdoes not clo-0 A, asD ãsys.stdout or  ñerr may be used.*  Á 	 øterminator = '\n'Cinit,l S=None º I     �Initializ¼ e.R ! fF " iÊ ¨specified,® 'isª  8 e ‰7.__ž óic  ¬ 7 J a' =o  Felf.! ‹¼  �Qflush<þ F! !es|F k [ Á  Í–.acquire(¹ +tr Ê ’  tqhasattr† ª 1, "š "–  r   j ‹ % o ‹1 `releas›  ü Aemitu ", Ím Û cEmit a$ 
øaðrýù it  › ÄEk E3The[  1 Athenj0ten9 4the]Àwith a trail�Ánewline.  IfÔ  ãbion inu  ²s present, ™  •ted using@ €v.print_P  ªŠappendedš ‚ Ü –M ðhas an 'encoding' èTibuteˆ !"de³Pe how_  doR K `output D®r0msg uö (ƒ¥ 9» )  ~  ! #ÿ°35046: merg	#wo . †into onež  > Q $ (’ !+ —ö  ©� ¯  |Þ�£ RecursionÇE # SžY36272¹ Uraise D À Exception:
  ðself.handleError(record)

% àdef setStream(, 1, s !):!  % 5""" ’Sets the 3 HY 3r's6 1 to õspecified value,@ òif it is different.Š  i bReturn` 3oldT B, ifU ™ û was changed, or None` uwasn't. Â #ifX  †  ò .ñ ð  ‹ Šresult =^ Oelse( J w  I  ™acquire() :tryM 0 [flush.  ¯ # =Ç 	S ofinallW hreleas‡ rr î ‰ �__repr__
Àlevel = getL AName$ . ß Bname( Battr# ¸ 0, ' V', ''0 à#  bpo-36015: ! å can be an intå  û ( B !if7 
Q # u += ' 'B ó ò'<%s %s(%s)>' % ¤ À__class__.__= 1__,W #, á !

! S Fileý(.r"A |"r 8 òwhich writes formatted logging �sG¢disk filesÈR  Cinit ,&  ® ð, mode='a', encoding=ð, delay=False, e	s ¯  ]a   BOpentÉ ‹ € and useÄa¨Ö Ë Å ¯  F R ñ# Issue #27493: add support=  Path objecaoû•passed in¼ „  é Ô = os.fspath( Q#keep¿ �absolute * ò, otherwise derived–2es ˜ Û Ethisq ó#may come a cropper wh0curÁ² directory —? ý@base/¹  � ?.ab¿ 6  Ê! =ÑŽ  Ù% =ä! Ñif "b" not in< 
A „io.text_T (	 L3 1 r 	 p  [" =c #Ñh26789:. œas a re  ceí RÇbuiltin openü # function)  !bl4  (   !re
  C  @ durKVPytho;!# 0izaK ¤Ã _| _J =ƒ Ê "ifÛ 
K‘#We don't- mð, but we still need¹ @call& W  !#C€ construF - 2setq,$¶r, lock etc½  D C À.__init__(seWlf)
  õself.stream = None Uelse:  4 S( ðHandler.__init__(D  ,  ¡._open())
8 ‘def close# )M 1"""!  U C! bs the ˆ . ' _ †acquire(Ä 6tryW  O    "ifŸ a 
1      9     ~ Wflush|    kfinallŒ    { ( =‰ é  !  o 2 	–'   ²if hasattr(1 1, "t"p )  . ., Õ Í ñ# Issue #19523: call unconditio= toØ Ò# prevent a h?ÿ leak when delay is set;  „Also see| °42378: we a rely on9  F_á pd beingb € to Truerrî
ä= ¾a l `releasŸ-  ÿ  �Ø@Open‹ P curr"ábase file with P(origaö) mode and encoding.RReturL aresultñ ³% {  ¬T_func–@_bui7 µ Ã  rX . .§ ƒFilenameý œ ,7  ; 	 ² =. ƒ, errors  ?Aemitq �, recordG0Emi]$ . ~ !IfBí� was not Ì eqcause '‚' ±specified iLÐ Áconstructor,A ¡ it before nÅÀuperclass's ¿ 
Ž Š i‰ ,û A 1'w'ä`½=°`’ AwillÏ !bei \ted ())ü
 u  f
$ — 0!= — !orr Ãž 
5  u é ñSg\ & 
C 
ƒ C
Þ^S_reprƒÀlevel = getL 2Nam„. ?Üð'<%s %s (%s)>' %GQlf.__ÈP__.__è#__ê
ýT !

. ƒ _Stderr'(Î ¤ †RThis 6 ©is like a 1 0 usYQsys.sW ñ, but always uses–whatever )  ÔTÀtly set to rð6ather than the value of
    sys.stderr at handler construction time.
- 1"""5 ñdef __init__(self, level=NOTSET):& 2   ¡Initialize‡ l Z    ^   H‰ .f !)
_ ‘@property  “ astream‘ ƒ greturné ñ


_defaultLastResort = _S{ ¹(WARNING)
l% : O

#- 7 
#   Manag‡álasses and fun�so ; 
cd ó PlaceHolder(objectB•! € instanc™ ’re used i[¹ 0logÀ ñhierarchy to take« „pp ò of nodes for which no = òs have been defined. This ² !isM �intendedC   @rnal” Q only:°not as partr  ’ublic APIæ  Fsa�  œ-   ÔAwithÙ“specifiedÊ â being a childƒ 1is hs…  P \  Y.~ ƒMap = { � ’ : None }
 ¶ aappendü,' ´ ?Add¨ /as¥ $ifn  h:in ·  ß 
 [Ï 1] =Ð 1

#ÿ“Determineñ!to×Cwhen‚@tiatZ$`s.
#

AsetL�CÜ (k `1Set[ bÉ_  aÈ e~ashould‚�P) suc
#at„ñ name argument is required,¡"thz") ` b call Ì )w Ê 1if á 3 !=* si` q 1subê ,)  ™  òraise TypeError("XØPderivf1romBing.™ ":  C  +  0.__"__¿ ‚global _d ©×  " =; ÖgÖ½ Ræ Ýê  rÔu E +„ 
!ÚPThereØó[under normal circum,P] juseßH,è‹  s›=!ofs2ers)¯  ì4 [`, rootSÐ):
        ""3"
  ñInitialize the manager with Ároot node of 0log! ¥hierarchy.K &""W Qself.<  =   B )  ºdisable = 0 úemittedNoHandlerWarning = False- Ž ŸDict = {} ¾Class = Non= ÔRecordFactory% F ‘@property Cdef ² (¿ !):  Epreturn  #._$ 
 @ q.setter I w, valueP 	I ò  = _checkLevel(, ^  J AgetL�• X, namK ’bGet a 0ß‘specified; ‘ (channel €), creat}!it¾  ð ñif it doesn't yet exist. This9 ô is a dot-separated 0EicalK  ¯ ó, such as "a", "a.b ò .c" or similar.ö  ‚ òIf a PlaceHolder� aed for¤Ö Q[i.e. ÿ € 0didÄ À 0 bu!Pchildì ä €id], repk  õ %edI X ± and fix upn rparent/S ðreferences which poin to- K m hØ bto now*  ( Âv$rvÃ '  óif not isinstance(t'trs * óraise TypeError('Ak Óõmust be a string')² Ö_acquireLock( 6try% b  Œ Same i-5 ¼
(  , Ê 
& [» ]w  '    �ß 8rv,å  0   }ph = rvL   { P.| AGor _ )Iî  :  4rv.H=h Þ — / p_fixupC¤¯ren(ph, rv… 0 Pˆ,s(+ Oelse{ &ü ™ J üÖø + ô Ä kfinallf|_releasŽ¦"rvG =s=áò 0, k.6C0Set«  c$  �Òbe used when b"ti1kBis M\»"if{ B != Ó
š =É1sub€ (ª ,- ² †ÑÀ"logger not ÿderived from logging.Logger: "
  õ+ klass.__name__)2 Pself.Q 0erC# " =+ 
" ð	def setLogRecordFactory(6 2, f !):,  ƒ &""Œ tSet the& ð to be used when instantiating aÖ ! rf ¥ with thisY …Manager. j  Ž  Ä 	¤ $ =z Ë Ó_fixupParentsÅ aý Å ¡Ensure thaÍ Ðre are either² ðgers or placehold 1allú 5way° ¹ “specified?    qroot of9 “ ¯ hierarchy÷  Ë3 = Á . o @i =  ¦.rfind("."ó•rv = None. ö	while (i > 0) and not rvÙ ÝcsubstrY E[:i]@   3if !  < 4in –zgerDictL  2 ! [? P] = PNHN(ß ¿  ; NelseQ \obj =x W 	­  D Rif is…‚ce(obj, Q (  7=objI �  7 massertg ß 
×  4   ¯obj.appendÿ Þ¦, 0, i - 1R /ifÇÈ | sÎ h!.p\ = rv9ƒChildren:4ph,}3™>c= ä21 phW“connectedœ 4  len = len( (°for c in phFÇgerMap.keys(Ø  ˜ð#The if means ...  ïc7…p.startsÅ6(nmh  B 9if ,  [:Œ blen] !²×šB   Z    Ã±clear_cacheÁÜ ´C' †+   Ñ”s(  Õ‚ DCallÙÑlevel changesÙ6madm m 8 Ö_acquireLock(+ u f  p ­  u m.value�
Ð/ Ó! ..� s   ! t_releas¹ ?
#- 7ð
#   Logger classesÿ and functions
#- 7ñ

class Logger(Filterer):
    """ óInstances of the/  < ñrepresent a single logging channel. AH " ð" indicates an areab   0ppl òion. Exactly how anJ  , À" is defined Qup to  a? ô developer. SinceC $ pcan hav �y number‰ \reas,Î s© ± identified‘ ÷by a unique string. A†  °  s h ô be nested (e.g.ù F ðof "input procesOò" might include sub-N ñ"read CSV files",  J 3XLS > “ Gnumeric `). To ñr for this natural¤ Aing,N È@ nam« re organizyRnto a ðpace hierarchy where l�5L ñseparated by periods, much likeÀöJava or Python packaged A. SoM !in0 i¡Ô given above,~7 F#beb"ó qe upperN ª ,1‡@.csvW Hxls" 6gnuF  —@ !s.L Tü  Qôo arbitrary limit¦Pdepthh  29 uñdef __init__(self,É ,Ps=NOTSET©­  ’InitializO wser withªÇ Pan opT"alU º  A …   .Ž )­     œ .! =¢ 
   = _checkL( A 0parCj= NoneC û propagate = Tru Úhandlers = []9 û disabled = Fals9 P_cachT 1{}
8  r2set¤  Ö le1Set} ^ íÖ  ÏH   tZp must ba@ intÜa(r | .O 9âmanager._clearÕ &()Ò SdebugAðmsg, *args, **kw
 Þ °Log 'msg % & '>òseverity 'DEBUG'.h  @To pKAexceV€ informabB, usŒpkeywordU  umò@exc_* a ˆ N àa true value, )j [Ù Ã"Houston, weÄ! %`thornyJtblem", j &=1|é1if zAisEn8AFor(è $ � & B_log !, X 'W°  T Þ �À  Log 'msg %ó args' with severity 'INFO'.

  ð
To pass exception informa ð, use the keywordT Pument0 _* ` N ÷a true value, e.gj plogger.5 õ!("Houston, we have a %s", "interesting problem",n 5=1)l 5""" ðif self.isEnabledFor(ë %):$  ñ % A_log `, msg,Ô ps, **kw2)Àdef warning(6 , *# - _ � ¡Log 'msg %] …WARNINGˆjÝ ‹�bit of aˆ-î ‹  ba
Ž‹Û  s.	 p("The ' ö	' method is deprecated, H $"ô0 óing' instead", D3 BionW6, 2� &r  3Y-Ì _errorÍ X_ERRORVjÙ T_majorQ-ç O Mï… 1excÛ0=TrÆì´Convenience_@for î Ä1an ‘ ( Èf.£ìOOM� 	 �`�criticalÞ  Ï »�CRITICALfjß i�disasterC%î m! p?fatŽ!SDon't…#is`–)£ð .
        """
   ðself.critical(msg, *args, **kw
 0)

+ €def log(1 Ÿ, level, 0 :0  4 5""" °Log 'msg % V ñ' with the integer severity '^ "'.y  I ð
To pass exception informa Q, useJ pkeyworda Pument0 _* m ‹ ÷a true value, e.gj plogger.ê † õ, "We have a %s", "mysterious problem",j 5=1)h ÿ óif not isinstance(_ Fint)2 í ”if raiseEí s   $ ! Á TypeError("N   must be a!V"�  8 OelseN  Ueturn¸ 0if æÒ.isEnabledFor¯ ª & _, ß?£findCallerFQstack¡�=False,  Ì '=1m JAFindî, ‘ frame of c^ ð  so that we cany esourceè ðfile name, line number and func\ .2 ˆ ±f = current„ (jð#On some versions  »IronPython,8 ! r€•s None ifo #4 ¡ isn't runÌP -X:Fú s� pif f isï J 
è ¯ …f.f_backa Qorig_   whfbŽO > 1P  c5 E-= 1Y fG † ) ð rv = "(unknown ¦h)", 0,     6= ¿ ÷hasattr(f, "f_code"N ¦ Pco =   >    p  ô = os.path.normcase(co.co_" ñ 8  2ile; `= _src) 
ï  ) pŠ    vcontinu¥  sÄ=Ö	¬  ªDj  siæ ·io.StringIO¤ X   Àsio.write('SK   (most recA Qª last):\n'ñ  > PtraceSq.print_ý w û N=sio3 Í  y 1get†˜   Û  ÷ Î[-1] == '\n'â  „ Q ‰nfo[:-1]$# {o.closei kÖ, Bno, ò Õ!, i 
Ñ FbreaOÈ2 rvº 3£makeRecordôK Up, fn, lg 91exc,Æ !  ˜=ñ r3tra š  ç­ðA factory method wó!hich can be overridden in subclasses to create
  õspecialized LogRecords.  5""" trv = _l& õ)Factory(name, level, fn, lno, msg, args, exc_info, func,P ƒ 
 s* )$ õif extra is not None:  ; pfor keyê * 
  " Cif (" õ["message", "asctime"]) or# Îrv.__dict__)L  P ðraise KeyError("Attempt^ z€write %r’ S0" %¦ Ù  I   o r[key] =ñ  é ¡return rv
 1def‰U(self|s =0 ‚3tra Qstack�k=False� Í'=1 ALow-" ò logging routine w†c6s aRñ  and then callsÅ  þ 0all ñ handlers of thisZ  erS & rž�8! =!_ «if _srcfil5ó#IronPython doesn't track  ñframes, so findCaller úEs anb  Å ñ#exception on some versionÐ k @. Weg �p it here_ JthatO 1 Ñ1use6ingû  x >try¡�l  ).Ê (ç!,  Ñ
Ÿ× a Valueëð: # pragma: no cî	»  – 	� Ð = "(unknown ‡h)", 0, 0unc;)hOelsek g /[š
Gæif isinstance(¾TBaseEë ö   * v = (typ; )‚j 
 0.__r eb�_z1lifïˆ _tuple€ Dsys.� (\ A1 = BmakeñH.Éë õ 	 s êÊ,…† } ×(’ )×  $ #,  Ÿ‡ ”3 0rs Athe ÕCfiedA ._  « T]`methodSAused7 uunpickl3 s; 0eiv ö rom a socket, a¾Ówell as thoseZ@d loä y.þ3ger+`filter-¦is appliedÏØ  ¯ ë ¡.disabled)B J ð(record):
        ðself.callHandlers(record)

  sdef add (. �, hdlr):   $ 5""" òAdd the specified hX õ to this logger.2 > å_acquireLock()# 6tryn  r €if not (‰ @ in — .i sš  ,   	  q.append= d kfinallh t_releas� ‘  oremoveR/ Ofrom:
@Ò )3hass'‡ãhSee ifñ „ has any*Òs configured.† ° öLoop through all/ 9forP ð and its parents!1the½ I �ñ hierarchy. Return Truœ a[ ö was found, else False»pStop seF Ping u  eY ³ whenever aöQ with¦"propagate<Ðattribute set0czero iƒ ñ  - that will beF Elast[ Ehichå ²is checked äe existence ofâ sÍ ¥1c =TO Brv =þ  zwhile cYEif c‰
  {G  gF     Ybreak ä%c.*P 6  §(  Ð "c.e rö"rvd Ø	 5#, T (cPass a$  ² ˜ 4Gvantdt ÅHIt ºõoutput a one-off error“ pmessage¾ Ïsys.stderr. ÜJ Yä ÜJ ä4oseä `s are ³ ( E  Ÿ ÷ ÆX ÌE = 0 Æ 2FÏ	O  5+ 1W  Š   #if±.levelno >=? V -   { E�    û @None0 #'ð out
            {else:
  Åc = c.parent ú if (found == 0)6 Úif lastResort  \ ÷if record.levelno >=1  7  ; W ‚.handle(J )™  &  elc ñaiseExceptions and not self.manager.emittedNoHN ŽrWarning} òsys.stderr.write("No ƒ Ârs could be ¹for logger"˜  œ  Ò" \"%s\"\n" %ž JnameÒ  6 ¹ � = True
w ðdef getEffectiveLn(G °&""¤ ”Get the e2  ¡ Ð CthisÕ ._  ” ×Loop through # nBits 7As inZ ± hierarchy,©  J qlookingl ¡a non-zeror   ‰ r. ReturK ƒfirst onu.J Ò p =X" Qwhile[ *erë º¹…r� X % W Ç  ÷# =^ 7? bNOTSETG ¦ÁisEnabledFor¡,z¨)Isle< ;(! ' %'?› !ifA.dist 
¢ CFalsG × ?try'  M�._cache[t ]s e{‹ KeyErrohÚ_acquireLock(ëk  € ´ ¸¼ 9 Ö
�  2   4is_
« 2 = ç  ,   " R ( 0    ² 5™
: 
 kfinallŒ + _releasQÒ» xƒgetChildtosuffixu a×ò
 which is a descendant to˜7one$T:+ ðconvenience method, suc:"at–  Ì  ]�ing.getL�p('abc') ¯ ¦'def.ghi')6 i–e same as N .B  ÁIt's useful,MÂexample, wheuÏ0is «ud usingù __ ð__ rather than a literal strÞ / œ@root_±
à¨Á = '.'.join(Á.w  RÆ9wA\À(suffix)

  ó  def __repr__(self):
  Àlevel = getL AName$ Ñ.getEffective 5())7 ò	return '<%s %s (%s)>' % ; ð__class__.__name__, x . !, t !)
M œ Nducež ñ8# In general, only the root logger will not be accessible via its name.j  ñ ¬# However,H 1's ´ A has9 1own5™ … method.J !if3„ õ  Ü A) is�  î e { Õimport pickleG   Sraise  .P  £ingError('å 3canã @ -d'‹ ÁŽ ,… � R,)


Ø QRootL! ( 1"""Ž AVÇ óthat different to any other€�, except + I áit must have a' 2ingõ@ andz re)Ðñone instance of it inI  ê’hierarchyz­ 6Cinit4Ut+  b Initialize} “ :!th  *  "U"g  4 @ 19.__r 2 z Ï6«B)

_åC32 = m · ìAdapter(objectº2n a  4 fo˜Às which makeÑp easierÃñspecify contextualoáinformation in% ¸boutput , €\ ƒtra=None§ M�» Cwith/!er(Âa dict-like ù Ô ‚  V ‡providesÊ  Æ Q. Thi õ
structor signature allowsK ¡easy stackô f†xòs, if so desired.í „ ”You can e+ðly pass keyword arguments as shW inw|  foŒ  x †example:_ ‘ R(some,&÷ (p1=v1, p2="v2"ª ´ ©    –.n! =â%er‡  �extra =  ‡ pdef proZéß, msg, kwargsäP0  ç g  Ý qmessageÛ 4 edy%to“ >@call¼oinsertñŽi£H ’manipulat Š  itô ’ Ás or both. RçH  ’=  ÊÐ modified (orþ)ª ÷ suit your needs3Ng@lly, 2'llØ &  8 poverridª 0is { aŠ üB subå  ðyour specific neceds.
  5""" ñkwargs["extra"] = self. % Âreturn msg, 1 
 # ò Boilerplate convenience methods&   def debug(g ,S *ƒ B, **\ !):+  ­ ª PDelegb aB ÿ call to the underlying loggerî  u ¯.log(DEBUG Ü  ª Oinfo© ) n B © *OINFO¨ owarninT+D ­ *oWARNINX l X * Pings.	 p("The ' '\ö is deprecated, Ù?#us0 óing' instead", D3 BionW<E, 2)w' g  Uö£$_errorÍ Î!n C y*_ERROR'Ÿexception¯  @exc_­_=TrueŒ%n V Â =“ 	 — €�criticalÔ  QE Ã *�CRITICALˆ � c, level0 ?log° å, after addingÞ¡contextualŸ0rmað  from this adap8  0OanceL"if+ÑisEnabledFor(Ñ Á †AÛ_‡process( ~ 4   © Ê /X )	‹  C b‘ „"Isð 2" eÇ B for™! 'w %'?;>  g ª 	€ < )� @setLï© å1SetÖ“specified� !on íÀself.logger. setLevel(l ò)

    def getEffective" aself):!  % 5""" ”Get the e2  O A for õunderlying logger.; G preturn i .( ‡ ¤ ÀhasHandlers(5 ž oSee if‰ £ has any hI š } ” A_log� ,ð, msg, args, exc_info=None 3tra Rstack _FalseÌ BLow-\ólog implementation, proxied to allow nesteduŸ adaptersä Í « ö| ,  à 	 ì 	 ø 	 
B  ex 
  # w‘@propertyt  ½qmanagerˆI` * ø@ .setterO h, valuŸ z¯A " =& W   Oname�  ' C  Õ Œ__repr__9 *( =8» °  =ÏÆNz 2 .\ )9 ,ñ'<%s %s (%s)>' % ~ Ð.__class__.__¦ 3__,e. üñ )

root = RootLú¢(WARNING)
 ."    FMÉ, _)

#- 7±
# ConfigurE Ù e`d funcZss ;
ÏRbasic{ P(**kw6¬1Do & ) c¢ V Ç Srsystem.*EThis¸   does noth(  j­p alreadþsr ¡ed, unless@pkeywordÏuxÐ *force* is s¢o ``True``e It aÂ ñ	venience method intended&�use by sÒ� scriptsŠ àto do one-shotI ­o×
upackageeËàault behaviour� óto create a StreamGñ which writes to� ±sys.stderr,ä a±  ma"0 usY ûÃBASIC_FORMAT! ` striný!ndJ 1addFl § ; ‘º àA number of op‚<al |ðs may be specifi«À dcan alÂ c 6defÀiour.

    fó.ilename  Specifies that a FileHandler be created, using the s3 9d
  fU €, ratherR £n a StreamT .5  + ;mod€ !e  qto openl  ) P, if 	 ² /is� (( F Uis un« ó, it defaults to 'a')Œ PormatÊ 1Useu 6 " f 0strý  foÔ 2e h? `datefm@ ?   S/timeI 2 Pstylep S If a  d ß  u ’ i² – y¢ DB  {type ofJ ð	(possible values '%', '{ 0$',. H "%-ð òting, :meth:`str. Á` and :class Ûing.Template`L -n%nQlevel¶ 0SetÌ Ò root logger  !to ñ 2ied = M A osi Þ�initializ?e‚[ Note¯ ýñ
this argument is incompatFdwith 'ˆ0' -—KbothK âare present, '” 'N bgnoredÈ D s ê !, „ `should€an iteraÇ¤of already–z T Á, which willE @dded ¾o* T. AnyÏM i�ClistO Õdoes not have¹Äter assignedr K   € L 6 [ j ²is function!Eforc&€keyword L2ð as true, any exis¾Ô sŠ [ttach| ¸qremovedé@closù\befor0Pcarry1out­�configuraÂ  • ¢ b´  o� msô PencodV 	P toge=  ƒa.6 qis passß i  zpâB, caÙ it!@be u@ 'wh€, iG ŸÉ`errors‘&Ifš´ “ É±  Fµ ± =j1extg.d Î© Oe·5û ñ`backslashreplace`.
·  U òqt you cÁ[ 0y aÞ4eam¸M G(Q,– )L @ !  Â,  æ¡n. Howeverã:H pememberàhat StreamHandðler does not close its stream (sinc ô may be
    using sys.stdout or ðerr), whereas FileHandd [ s\ K £when the h' "is… 1d.
! ñ.. versionchanged:: 3.2 �   AddedA ÿ``style`` parameterC 
3C † sF ð A ``ValueError`` i.Äw thrown forL ÷incompatible arguments (e.g. ``_ pspecifi½ Äogether withI Ò``filename``/ pmode``,m    W I t^  % ØH ’ /``W
8y šOforcš9C ðencoding`` and ``eŒ	©!s.9 1""" # ¤óead safety in case someone mistakenly calls9 óbasicConfig() from multipleQ * á_acquireLock()= Atry:	  )ø ñ  = kwargs.pop(' ‚', False4  + à .  h', Non0 ÿ .  ö', 'backslashreplace'j  if²&ce§  € Pfor h Troot.:[:]'  + " TremovÝ&(h_  "   !h.ò  qif len(? a j) == 0d  
Ý " "\    ž ,
U % "Å"ê –O"n @  D fraise 2("'S 'I 'I �' shouldW2be ” B  
"Á º"\;els» Q ?if Û  ?or Ú 2?or Ù @ñ$ '¸'é $ifsÓo, , 0 M4    W", 'a0 /    8”`if 'b'Z G $  I º! =Ò,   ä ´ = io.text_'(	 
4: 1h =”ÀHandler(fileßname, mode,
  ”encoding=	 ’, errors= )F ]else:  k òstream = kwargs.pop(" ~", NoneN  8 Qh = S< ‚Handler(5 . h  ys = [h]…  df z datefmt{ ]styleª šyle", '%'z 2if 0 înot in _STYLESÀraise ValueEE1('Sh ùmust be one of: %s' % ','.join(È   r Š.keys())Ÿ ù Pformaø 7 [¾ K][1]9 amt = F. �ter(fs, d 0 , @or hý ƒþ Rif h.| ater isó(  Þ Wh.setz *mto  $ „root.addh# [levelÃ ñ1if   —  Ç Ž› s @setL\ (1 
u #ifÝ<  œc = ', ×Œ  (³ß -ô	Unrecognised argument(s)1 J � vfinally… ÿ_releaseLock()

#- 7ð
# Utility functions ate2uleW�.
# Basic— ð delegate everything to the b� logger.¦ ;‘
def getL] (	 =Nt&1"""hƒReturn a… Q withš  specified ; p, creatº ñit if necessary.
H QIf no+  S= 2, ra í  ô…  P "ot> o+�instance· ’, str) an‹ 1 ==7.˜ Í  L h  Q‘  ÿ P.manad
!)
&@crit«p(msg, *­B, **±)c « pLog a mü "ge.s× Ñ'CRITICAL' onE Ž ZA. If î¤ 0has6D , 0  b9€Config())ãadd a console . | aH Âpre-defined r. µ î n(Ž .?  s)H0Ý  @	v > / @_fatal=åDon't use this?, j  ) ÿ:eadÅ   ¦Š ¥À(msg, *args,ñ **kwargs):
    """ ñ+Log a message with severity 'ERROR' on the root logger. If  A hasN ô!no handlers, call basicConfig() to add a console. y Ña pre-definedP qformat. ² pif len(Ž .m b) == 0Ú  Þ 	v > / Àerror(msg, *,ù 

def exception% ×exc_info=True4 p ˜ J#,û y ­  m  ù ?ionj  f	ë 1 isw#edkO o k0	 CywarningA|!WARNING~¸
=:	C  s.	 p("The ' `' func¹ Âdeprecated, æ 3"us. óing' instead", D/ BionW½A, 2): \ Í³  ¬³ 	OINFOê¸4Odebu"/ODEBU ¹7¿log(level, Ä�p'msg % ì'i ÉwintegeréV �
 8 í
ƒéL f	í~é(*Àvel, msg, *añ%rgs, **kwargs)

def disable(level=CRITICAL):
    """ D% ñ all logging calls of severity 'D Á' and below.= E Óroot.manager.w 1 = 5 ) 	! Ó_clear_cache(¬ ÷shutdown(handlerList=_ · ÀPerform any O õnup actions in theÎ ñsystem (e.g. flushing– ¡buffers).
 PShoulà Ðed at applicaY Z exitø `for wrq r*8sedÀ 3[:]¶  qð#errors might occur, A ðexample, if files ar¾ Acked˜ > àwe just ignoreá m1  raiseExcep£ Ås is not set; 2tryó H   …h = wr()"   Jif h'   <     €h.acquirÁ   !h.je & oh.clos< eË P (OSE/q, Value LH   2# I`Swhichfwbe causH 2  A# be  hÁs have been ¡ Fd buI8   ò # references to� ¸°still arounA	d 9   #W   MpassA kfinallÓ6 yh.relea[S4: #< « yt°, as we're �tý †	u ;if f(! 	6 ñ#else, swallow

#Let's tryE o  j � automatitNy onÀ..
import atƒ
 ¤.register(L ”)

# NullÐq

class HX( MÁ0Thiý{A doeF "0. I· €intendedë0be S  Pavoidüû 4"Noz 4s cLf
 é _ñ
er XXX" one-off warning. ‚ iïï 1ant ãlibrary code, ßa Qntain  � ðlog events. If a¦ r™  of¤  I à � configunú,( œ LL �produced;s  "is: b  rñoper simply need(±instantiateO a�`add it^  ÅAtop-GÏ er–  j ‚module oé zpackage¥ áÓ(self, record :€"""Stub.–  3 Oemit1 ¡createLock7 `  w Â.lock = Noneo e Ó_at_fork_reinp 9 B
# W& ÛAtegr�à

_warnings_shõ
owwarning = None

def _sh ò(message, category, filename, lineno =A   ¡):
    """ ÷Implementation of f ós which redirects to logging, ¡will firstP Pcheck' ¡see if the™ Ñ parameter isÕ b. If a ðis specified, it V P €delegateS  L “original "?s iÂ 	Á. Otherwise,P \ F calD s.formatS A and�  ë Á `result�0str Ato aO 3 s+ @ger €dd "py. Á" with level& Áing.WARNING.D ‹%if1not$¬ °Dif _S 	 N.  2 / 83)¢ Felse‹ 5s =~
:^  žX  §  Où er = getLogger(?* 0if ê 1 –.handlers˜ N R.addH  T(Null )M F S’("%s", s)j‚captureW…#s( ;#f   …Utrue,* _¼ t  >rpackageþIF õFalse, ensure thatkA areŽ edY U ¨0but etheir *adestinàst roglobalYQ i� gŠ	 l*  ‘†Aos  5   š's.! ) =0 
œ� 	 =¡ h  mq  �   Ú  c ð
# Copyright 2001-2019 by Vinay Sajip. All R$ ðs Reserved.
#
# Permiss’@to uÑcopy, modify,£ diŽ buhB ofÃe ¦its
# docuÝâfor any purpos(  �Pout f¯ðs hereby granted,
# providl � ƒ`above � à ñnotice appear inüacopies‹  Ær
# bothÒ; @nd tÃ pø V ‘
# supporˆ	Ù  g ® „ Ék!
#: beLd¤ pdvertis�ñor publicity pertai}5to dPion
#V  sj>½àc, written priW Ð ð.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITHð¨ REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAG} R™ %NY ñWHATSOEVER RESULTING FROM LOS­ ðUSE, DATA OR PROFITS, WHETHEN ÀIN AN ACTIONÝ ðCONTRACT, NEGLIGENCE; O0 “ TORTIOUS1 `, ARISt POUT
#@ POR IN¿ "NET ±WITH THE USI �PERFORMAX F‚ð
.

"""
Configuration func	 ñ
s for the logging package ôPython. The core ð
is based on PEP 282 and commentsR preto in �p.lang.pO ,* ðinfluenced
by Apache's† ð'4j system.

Copyright (C) 2001-2019 Vinay Sajip. All R% ðs Reserved.

To use, simply 'importa  ç '… ‘log away!"
# Terrno i
 !  ”.handlers $re
 estruct y# ”threading ñtraceback

from socketË #r – T5 @TCPSå òr, StreamRequestH‰ ñ&


DEFAULT_LOGGING_CONFIG_PORT = 9030

RESET_ERROR = ó a.ECONN q

#
#  ù`follow@code� "leåa© ‘ listener5¡on-the-flyC 9recz$of„.e _? Ahold< ü �object do ¦j  ;6 ò= None

def fileêð(fname, defaults=% ð, disable_existing_Èàers=True, encoš. p):
    >  @ReadÙÀ  Ù º"a ~ ÑParser-format– !.
M òThis can be called several times G �n applic®4, aƒ`an endÚrO  àability to sel0D ðvarious pre-canneŸPs (ifÐ I ðdeveloper provides a mechanism\ ppresent2 ` choic# Snd loachosenN 	!). GÐ# p(Ôif isinstance¿' H.Raw_  œQcp = òl Belse½ 	I F (");  1 ¤if hasattr‡ '²Wline'u  + 0cp. _y- G 
†  . _´ = io.text_ (	 @  2 ` [  . ¶ iö ters = _create_ B(cp)eÑ# critical se@  òing._acquireLock(Š 6tryKr_clearE=ÀgHandlers()
#
  ó# Handlers add themselves to logging._h$ 7  µ = _install% õ(cp, formatters)5 *  X 1ers) J ó, disable_existing_' A …finally:N   � òreleaseLock()


def _resolve(name)5 B"""R   a dotted   ê ña global object."""i   =' ¢.split('.'‘ Sused  Rpop(0 @foun °__import__(*  ar n inQ –  ˆ ! 1 =  ‘+ '.' + n€   'trö   c �getattr( 2, nd  " öexcept AttributeErrorp  #       R ? = b qreturn % oóstrip_spaces(alistu, �map(str.( ", " < vcreate_23(cp> A"""C S and L ) ¦fq w = cp[" ‘]["keys"]K±if not len(0 c  ï Y !{})  1 =  ö2","^  öÊ ò  ! ù4 = R !or ú+ ‹Csecte» a_%s" %3 ’  ¤ !fsá T.get(5 #, 4 ò", raw=True, fallback=None•  A dB datefmtC ?stl… _styleA #'%/ ƒ 5c =TF(â cclass_4cp[æ ]ô " † M 1if  2 Q   h % fÇ `(fs, d 7stl ™  s[L]
¤ &  Úl� B"""I*ÍÿËhË É. É 1 =  É É ~ Ç@ixup‡ã[] #for inter-) ± references/ !    õW    Ú0ion…0p["% 3lerõ  ± * k3 = 2 [! 6fmt )¡G", "1H] Qeval( s, vars([)	 ˆ Q(RR, Nam]… 0 N  ^ˆ P 0argI× ¸   g", '()3  1 = £   ¢  kw   V à{}')
        káwargs = eval(k ó, vars(logging))
  °h = klass(*6 B, **2 # Å.name = hand9 õif "level" in section:  _  $ = [0 ]% `h.setLI (0 x ºif len(fmt)X 3 ´Formatter(f
 is[fmt]A aissubcà æ #, .Í ûlers.MemoryHandlerj ftargetÃ b.get(" V", ""m  ñ ²   ‚): #the  =ù ler may not be loaded yet, so keep for later...( ` ófixups.append((h,] ÐÈ  s[à ]µF „#now all‡ Ds ar� !, X p inter-8  ¨ ¤referencesŠ  ›  s  ð2 s—“T.(B $s[Œereturn{ r

def _'  _existing_™Ders( t, child •, disable2 ¬1"""ã ôWhen (re)configuringî,}  àers which wereÎ  §�previousL C aÕA but/ ·0in . Inew % ñ. There's no pointI @deleÞ  5 ñm as other threadsöcontinue to hold z  Qthem;L cand by Ý   ¢, you stopc  do 1anyë Qing.
= ãHowever, don'tE ecpren of æd7 @ers,­ áthat's probabl¸M �what was3nÄ by À user. Also,n4ow ÎX  Ó aNOT beJ ÔDd if” à’ is false	è0roo’ / ß   K  Ÿ0logÐu   . Per = / ’.manager. †Dict[log˜ ÈJ 	ƒO  �!ifÈ¡isinstance^ c W  › �PlaceHoldX @  & 'erþœz.NOTSETY0 7rà[²  !   U €propagat¶2Trul   JelseÇ 2 ‰=ˆ°ç $ll�4(cpV .@ ½�0Cre‰  ¾C  Ò»#LeG ¥R firsE@llisóBcp["¯ ¢s"]["keys""  “.split(",ž 0 = F ñ (_strip_spaces( > �.remove("ƒ @ Ü6 = � _  }    _ À  Ö  �q 1ýj-7log- 1$ øàh in root.hand£lers[:]:
  ñroot.removeHandler(h) òhlist = section["h  1s"]  qif len(' )Q  1 =  ¢.split(","T  u  ó = _strip_spacesG Y  % @for p 2 inJ a   ulog.add² š [3 1])
G ò#and now the others... ñwe don't want to lose) òexisting loggers,1 CsincF ð threads may have pointersI Ctheme K Qis seg Åcontain all  
j  ¶ €as we gok Aoughš Ðnew configura’2 we� ¿å any which are+ aed. AtB 3endÏ °what's leftb‹ !is)  ® $ofe Z @were2  T…previousk – 8but2  Œ !nog  5 Æ -‚  = w(—‚manager.!²Dict.keys()MA#The. Q need~°be sorted s= atH2can‘ Àavoid disablãTchildæ â of explicitly1 Ename! „. With ab  ¨ Ò it is easier4 qto findH	a 
é .¨ (É ¡We'll keep7 Z � 
Œa ‰ W_ 0ren» 	« T hereí& _DRs = [¿# éuu  ™5one$ ‚0logíl‘ �r = cp["Y `_%s" %L^  ¥(qn>@qual¥ > ! –propagate( •.getint(" Ò", fallback=10 < w   =s @ging9 L³6(qn' Pif qnÄ aÇ  F 5i =ˆ`.index> à + 1 # start wõ ºÒentry after qR C    prefixed =n Q+ "."¬    @pfle 0, ¤  " Dnum_£  Õ 4en( 
) ¨while i < 3 
Ö  Q iÎ?Q[i][:ƒ T] == � 4  8 	.u.append‹ :[i]Ž  2 ii += 1ð » Y T   if "level"—L
Œ  [0 Z w P.setLN (5 ž  ¿hb (  ýH DQI @ � B¸Õ % [0 ðë H … L  ?  P% TÀ            ûfor hand in hlist:
  ðlogger.addHandler(1 Plers[	 1])
3 ò#Disable any old 8 òs. There's no point deleting8 ðthem as other threads may continue to hS ¢references;  ¹ Aby dz @ing L ¡, you stop 0 do  –  ’ Bing.= ãHowever, don'tE õe children of nameÉ ,¥ Sthat'~ ðprobably not what was intended by€ S userr  m0logl@exiso#s ž àer = root.manaw ’Dict[log]»  /  ifb L ² _) sQ  &  €.level =2 gfNOTSETM +  Ô ÝG = [o " Öpropagate = 1D DelifF_à — ¹%edI _~ ? (P , W ,q ó )


def _clearEgº2s() @"""C   Bdclose b  1"""Ý  C 4œ 1rs.[ )() œshutdown(/ rList[:]. 5del„P ! Ð


IDENTIFIERðe.compile('^[a-z_] ä0-9_]*$', re.Iî Óvalid_ident(sä Fm = R ‚.match(sˆ !ifµm Üñ	raise ValueError('Not a Z � Python a Óifier: %r' % P ðreturn True


class ConveråÃMixin(object� g"""For$ ÐXXX's, this m0  F ð
provides common functionsŸ‚ îcl ð_with_key(self, key,Â  ue/`place=¤ … ø €esult = 2 Ð.configurator  Á  (v8 2 1#IfÙt "edb q is dif¡€t, save ñ‘next time­  A &if2  ;rƒ ‹$ !re± 
    ª Q[key]& ¿ [   ‚if type(W )"(Œ J,x ~,@  D  ? WTuple?) m d.parenNV % Pkey =œ! ?  OÖÍ‡. ºy>| 
#QÂ2XXX,àes are wrapper Ôound standardÅÐcontainers,
#ð" and they serve to convert any suitable values in-  # Ðtainer. The
# sversion òts base dicts, listsl Puplesh ð
their wrapped
# equivalen1 ówhereas strings which match ad o £format are tM óappropriately.
#
# Eacho Òr should haveP ñfigurator attribute holdingó qactual
ë , £to use for~  ” ¢.

class CJ€ingDict(, óMixin):
    """AC ts  , dionary³ Q."""
, ó
def __getitem__(self, keyL  P °! =€.- L  , preturn G .ýâ_with_key(key,þ)~ 6getv ï, default=None„ 3 )… (?pop… 3 … þ, replace=False)ðPList(õð , 	ê ™é A é?1oidx=-1Þ y 	( P
(š3 T (t 5- 6*B 7t# Can'tõ1 a 7  entry.Â=uBaseCon\s(objectr ý !Thè& fo$Àdefines some�4ful¡s­  L ¶ ð&CONVERT_PATTERN = re.compile(r'^(?P<prefix>[a-z]+):// 0suf S.*)$'OWORDI Â\s*(\w+)\s*'/DOw .\.0 _INDEX` [2 '\]g ?IGIi %d+À —_ÿqers = {% v€'ext' :  $ &', 1cfg ;cfg }5ð # We might wantÿ 8ña different one, e.g. importliba  òer = staticmethod(__ #__‚.EinitcPC É äÀconfig = ConóvertingDict(config)
  Rself.  �urator =  
) Àdef resolve( Q, s):  F 5""" R& õ( strings to objects using standard import and attributeG usyntax. c @namež ¦.split('.'Î pused = # f.pop(0 6try³  · @foun-  Ñ .Ž 0er(B 5 ( ‘r frag inY 
F  "  4 ‘ += '.' +, ¹     ~     † 0get( ,E 
‡  - „except A0^Error�  + Ö  $   p ? = € qreturn 0 ß ‘ IÌŽ  Pe, tb­õys.exc_info()[1:]C  … ‘v = ValueC „('Cannotsú %r: %s' % (s, e)Ðv.__cause__,  átraceback__ = ƒ 	n vraise vÛpext_con'ßv� 
ãƒDefault ) øer for the ext:// protocol.­6ŽB]  ?cfg )?cfg Qst = r m‘ ÷öWORD_PATTERN.match(rest_Êif m is NonegD´p"Unableñ"b %r" %| S <elsK e¤  z ‹[m.end()¦¨ê[m.groups()[0]J�#print d,=tó  eQwhile 
Ë   ?DOT
 -    G    ­ d£ 	 %     Š _INDEXŒ  7 �  Ydx = 7	 $  0if |²LDIGI7idx6  :idx›#  & 1!   €n = int(” à # try as numbŸöirst (most likely† =  » n¹  5 õ2Typ° *  W ¹ ! =± _ JÀ  raise ValuÿeError('Unable to convert '
  õ'%r at %r' % (value, rest))A # õ should be empty ‘return d
 4defƒ q(self, T !):  ’ 5""" C­ $ s¿ õ!an appropriate type. dicts, lists and tuples areK ôreplaced by their‡ ñ	ing alternatives. String? µ checked toJ `see ifE ƒy have aK ±sion format† 3are 5ted3 5do.K ì ôif not isinstancen�ingDict)[ &  F J6: = A W ¾* ð.configurator = Ÿª /el  ?Lis   �   A   HTA\Ù  ÿ  SF/ šrhasattr  ¿, '_fields'Ö w 7 w"š °str): # strqY py3kÒ mÀÿ.CONVERT_PATTERN.matchŒ Fif m…à   d = m.groupa(À  & Âprefix = d[' )']‹  % ueW.›_ bs.get(? n, Nonei i9.er©  f 5suf‹  ‹   ) x a = getÖ î,¯r€  9 · & =' (h . î) 	òZƒe_customûq@C"""C…øe an object with a user-supplied factory.Dcœ Æfig.pop('()'› Á@call'(cy  Ý  =  ¦.resolve(c<  rs] ,.'«0# C/“õvalid identifiersPkwargM 0{k:Jafig[k]5 Ck in  0D _D E(k)}B `result� 2(**O « 1if ® 
$ƒfor namep h & {.items( sm ,> m ï$ ð1as_=èc ð"""Utility funct8Pwhichü  žsÌ#toË	æ/if& `À         valóue = tuple(value)
  qreturn  ø

class DictConfigurator(Base !):@ 1"""  Àe logging us ña dictionary-like object to describe theE cq Aion.  ` 	 Ddef   ce(self‚  Å P"""DoG # at .>  % > 0 = = . [   óif 'version' not inL è  $   praise VAvError("à ó doesn't specify a S "miÇ [p o] != 1h ´UnsupportedW s: %s" %© Q o Ãncremental =) v.pop('i w', Falsõ EMPTY_DICT = {}'Ýæ._acquireLock(n :tryÇ 7if h 
  O†handlersœ Tget(' 6', Š g  :   €for name­3 d  * "if) ÚÇ 6  : ñC'No 7 Õ found with '$ 6  
'´ a%r'  %— Ú  @ OelseÎ   k   ¤ =’#._  s[� ]± 
+ _'$ =ó < @leven
D .Ú g', Nono¸  1if - * h P.setL{ (ßScheck   )j I �except E ion as  3 `UnableÜ84ure9! ] ' b from $    è = <2 ji
KBure_I (_,w#er1H, TrtÃ   {w‹ vrKroot¬  Ñ0if   Z/ F ( IÀas e:
        ýraise ValueError('Unable to configure root '
>  ù'logger') from e: Yelse:  G 0disx ³_existing =€ l.pop(' _b ­s', True)
Q s_clearEO ŸHandlers(*  ð# Do formatters first - they don't referPanythŸ  Æ t E ¿ Vget(' ï', EMPTY_DICT)B – name in 5 / 3?try   = [P •] = self.Õ_" (†  A  G si Ô  J �except E ion as   +   —’§ a %r' %eŸ  á# Next, do fil�, eitherOD Z 2 õ: ¢  (¨ & È…« ÅwÆhÿÖÐTs andîK  5As E 6canoó `, sort;_ keysI  ðto allow a determinò£c order ofø}urationB † 
N OdÉ�red = []\ 1for ~ È 4ed(X )v < p ] r	 �0 .Ê! =£ ¼  (   , Ž$ =›1 —åif 'target not©qed yet'6ïtr(e.__cause__6 ¨   Ž€.append(à x .  s†    7Àable to confÿigure handler '
  ý'%r' % name) from e
B ý# Now do any that were deferred0 1forR 5 in% :&  § ?try   Ó ±= self.confì _ (  s[¿ /])b I .' ! =› , T $ =Y1 �except E �ion as eÑ õraise ValueError('Unable to Þ q ÊÆ@ext,Èðloggers - they rÉ … QÏ and filters Ðwe don't want8 @loseK £ existing b ,7ð#since other threads may have poinu  U ^them.@ c Qis se ¿contain all‚  Ý €as we goƒ Aough¾ 5newˆ atÐ.we� aremove•which are7 aed. AtN ?endÿ  °what's leftÎ 1theÒ $of?} r !ing …previousƒ º ?but>  ° !no  s ö uaroot =– @ing. ] Ê p= list(% ’.manager.¾Dict.keys()­A#The: ` needs°be sorted s©xM can| Ð#avoid disablQchild°  çÞof explicitly=  - „. With az  Ì Þ it is easier@ qto findŽ	y I%.Ø ( ¡We'll keepO ~ ¿ 
X…  Ûƒ aren ofëÛ ~ here..– 2 _¤ns = []` 1now�u™  5OonesO I Õc.get(' Þ', EMPTY_DICT;2 PiÝ D)  5i =p.index(õò) + 1 # look afte·ý  C   ƒprefixedDo + ".". @flen64en(: ñ  X   Dnum_5  5  À       whileÿ i < num_existing:
  4if ) ÿ[i][:pflen] == prefixed@  [ ÷child_loggers.append(V )‚ _ += 1# H Ï.remove(nameQ ?try¬ ãself.configure­ M #, º [[ ]\ �except E �ion as en õraise ValueError('Unable to … x / 'ü  ]	 p'%r' % © �) from e
> A#Dism sany oldh ð	s. There's no point dele$D @themå ðother threads mayÀ AtinuÌ h_ ®referencesG �and by d’ @ing X ¡, you stop 0 do  ®  ŠNing.I ãHowever, don'tQ !e {aren ofí ,½ _that'–  ñprobably not what was intende± �the userŠ  0forR5 in:	#· Î òer = root.manager. žDict[log]ë  ; $ifd â °si  2 W €.level => gJoNOTSETe 7 Ïhandlers = [“ . ÿpropagate = True_ Delif©Ž+] ,/ed\ _¬ R r, ,ž  m  { [ )] À And finallyŽ Ãás-ern  ý  =7�fig.get(' o', NonË !ifO ë ³ ä f ( ÓX o Ñ·'Î å   b
 -  ÕÓ_releaseLock(¥3defd à formatter(ù, )O D"""C5 a 0 Võa dictionary."""Õpif '()'ýÈR ¶ eactoryï[- 0] #`  P 8 K DÉ
2á�result = Í Æðcustom(config)
       ò	except TypeError as te:
  þif "'format'" not in str(te).  8 ]raiseH ò#Name of parameter changed from fmt to j .? ÿRetry with old name&  õThis is so that code can be usedA þer Python versionss ý(e.g. by Django)" òconfig['fmt'] =  T.pop(35 !()4 }factory\ âresult = self.Z ²ure_custom( ^ ;els½ Q“ 5get“ f, None;  ´d. @dateÙ / Vstyleñ ^  j', '%'\ c¬- dclass'[ 	ý !iff6 aÑc = logging.F–9ter@ 
 á  8 ‘_resolve(\ ))
7 7# APwould5Í d @valiP" keye0pasS"inVa½Ûjallabl#”Adoesã !acƒ"Y Fas a!	  Dif ') '„@:  #ž ðuser hasn't mentioned it, the defaN@willÖ :fin›  #rpc(fmt, !, ×,Û[ƒ ]åvS rreturn - –3defs  ôpfilter(
Š |A"""C‰bure a - UPa dicuary."""R N(()H 	 s }!ó    ö Öí  / c#Badd_ð s 3er,s)4Add  n.$er0@list¦  s3Pfor fyc sœ:try  G* rer.addF× Q"['  \s'][fOžE 0ionžà a žR ValuÅ@('UnwÜ ë ’ %r' % f)å ec_handld. P e¢q_copy =Š· µ P�restoringX1cas!e�� TÍ`5terF   &if‰”À       try:
  õ
formatter = self.config[' Es'][ (]
@ �except E ™ion as e:#  / õraise ValueError('Unable to set ^ - '<  @ 	 f'%r' %4 …) from e: ‚level = É a.pop(' …', None)* {filters,  . £if '()' in[ 
é cG 6()'j  Â °if not callý :(c)A  $  E †šresolve(cD pfactoryk Æ ;elstPcname$ Ë[class’ k ør  = 
v Ð#Special casezð handler which refG¤to another  ¤  Ü �if issubŠ (| £, logging.Q ’s.MemoryH` i) and\F  J 'target‹ $ >try_ hò !$['| 4'][ a ]ï ?   ÊÖisinstance(thË ¼   @ f ‚.update( ò_copy)  # restorhdZ}red cfg K   _4Typ^¾ nuC ;yet  =   ‚ [Wm] = tho í Q ’ ñ¡ yö V ú®  , /eloDSMTP±mmailhoso• -  EÊtas_tuplè&['# 
f³ _ysLogµ address#
´ , ³ " 
² ŽÎ2LpropV.PPkwarg' 3{k:R1[k]_keõ if valid_ident(k)}h ä“result = š 2(**f ¸ Æ. ³t@Ñif "'stream'"GŸin str(te´ í”  }à#The argument P‚ changed¬Astrmüc 
; áRetry with old= ." õThis is so that code can be used= ðer Python versions
    õ#(e.g. by Django)
 ó   kwargs['strm'] = P.pop( Jeam'2 òresult = factory(**E ' Ùif formatter:o = T.setF! (+ 	A ÿlevel is not NoneI L) ó (logging._check   )V zfiltersL “self.add_ (¦ #,  	B Kprop@ ñfor name, value in & Š.items()n  ~usetattri > m rreturn � 
G@def © �handlers(»  , ý Der,  r e"""Add S to a0 P from aist ofÃ Qs."""k  §  Ù hÏ Y 
Ê :try  4 Œ  OH¥ ¤ ”.config['J V'][h]ì  : �except E {ion as ö ' praise VjÑError('UnableÛ ë ’ %r' % h)ç eArcommon_© _™ ¥ I ú, incremental=FalseZ)0PerÆ 8 @uratÀ PwhichÃr  ¡ Ñroot and non- ‡ %s.L �=X a.get(' !',A1if   o 2i  {2 M 
ñõ#Remove any existinglÒ  ¶K‡ :[:]S  - $ r] Ghí  $ A   ! 4 %if� u  K ·_C T	W
Ò K€ 3  ~ " }  )À K3ureÃ¼D‚ºC�\ure a‹0Pa dicÆ9aryœ! =E r getLogger(‚ ¥Pú© lC ,Ö	¬ ?  B[agatea c!ifw5 9} .G & =6 d ¥b\  > */erX* VR = à, config, incrõemental)

dictConfigClass = D Æurator

def ( !(c/ ¢):
    """? àure logging us a5 ¡ionary."""0 H p M .U bure()
r ö%listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None• m ðStart up a socket server on the specified f b, and w � for newG œ �ations.
 ñThese will be sent as a file suitableG aproces!by  21().J `Return< ÐThread object¥ ðwhich you can call sÔ R() to É × ,O  Å 
8 ðjoin() when appropriate. TD (opC e H QstopL„0ing¬  1Use/ "``wp`` arguP “  ñ any bytes received across< AwireM öfrom a client. If’°, it should`a˜ SÜ X 1s aJ  ^&le‹ -i ƒ 9of Â_ data™ J ‘network -… r¦  either ``o0``,õ pindicat aty I “passed in
cÌ 0notÐ ( y ®ç Ódiscarded, orÛ  Å @ strSü iG#n b  tot ä Ámachinery as� ¤normal. No© WÚ ²transformed² ñ, e.g. by decryptingK  ; – s‚ "inÊ å" cLçâStreamHandler( sRequest ¶OA    Da\
ËrI ” 6 �It expectQ completelyÍD  ƒGuses›„ pto insty"itå  e  é      hÞ W(selfÍ   *   Õ  €º   SEach Õ 3 isË  edgpbe a 4-zò  length, packedqµ  I pstruct.  ñ(">L", n), followá4ù Ý  ? Updi`grunt %
4 ë 2try$ Q  pconn = * ô0necU	»  + pchunk =Õ�n.recv(4)%  if(, n) == 4p  M 1slet 'un< =[0]]  9  ® ‘  V ”  7  wh4len›  < - �  1 h  +ö  8 ' -ç r "ifRß.^y@ o ªð :
               ñchunk = self.server.verify( &)
, 
 1if  ñ is not None:   # < ÿied, can processD  N E =M ÿ .decode("utf-8"z  6 Otry:S  ! ¿import json( 
0d =$ o.loadsð 	 U   ÿ
assert isinstance(d, dict­  7  " �Config(d* �except E ?ionä Á#Apply new c[ Ÿuration.
ó 
ÿfile = io.StringIOø r æ  [ æ   é  - í  2 ÿtraceback.print_exc(d )ifÏOread1ú+ K.setZ ® ÎOSError as ežþ
if e.errno != RESET_ERROR+  Ð Rraise­bclass <ðSocketReceiver(Th” qingTCPSŸ)O 5"""íáA simple TCP sE ã-based logging'# r[ .;  G  òallow_reuse_address = 1©  ¸ Ðdef __init__(=Ð, host='local 0', €õ=DEFAULT_LOGGING_CONFIG_PORT,p  S  €handler=P , ú y X  9 ".Ÿ (• ” 3), d 
;$Û._acquireLock ë 0.abY9= 0À > oreleas> qtimeoutP »  [ î " =ö 	_  " =by�¹á_until_stopped›+iselectc Ø  wh. á  y¹ ¢rd, wr, exCBect.^ !([¶ ‰._no()]øP 
 _[], [3 u g
â [ ^if rdÆ   9 |_reques & é' ' .f3	m # J 3Ú’r_close()ö/$(t!.	"):%  e «À(self, rcvr,÷ hdlr, port, verify):
  úsuper(Server, self).__init__()+ °elf.rcvr =    n ! =u   … ! =Œ  œ # =¥ !  ready = th
 Åing.Event()
, �def run(Å æ à ! =á Ä (� =+ .
 ’, handler  É ,Y /  ‰ y0  1 å 2  
a"if   ‘ Z == 0Å  | ± Ì  µ!.sÜ ¹_address[1]¸ 1 Ÿ 0.se/ F  ùglobal _listener: @logghË_acquireLock9 Ž B oreleasB ½ Ä ä_until_stoppedÚrreturn ¢ñ(ConfigSocketRecei· btreamHÈõ 

 [ Lì Cing(
1"""¶ ’Stop the Bing ž ó which was created with a call to2 1().I Q ^V6tryñ&if—  ¹u¡.abort = 1w       q = None gfinall` ˆ 
œð# Copyright 2001-2021 by Vinay Sajip. All R$ As Re%ðd.
#
# Permissionñ use, copy, modify, and distribute this software ðits
# documentatK âfor any purpos(  ‚ñout fee is hereby granted,
# provided thatØQabove� à ðnotice appear in Îacopies‹  9 r
# bothE  Ë 
; n_ Fis pø V `
# supÓ R	Ù  g   xname ofká
# not be used¤ pdvertisM Àor publicityƒ @tain &todPion
#V  Új>ðspecific, written priW Ð ðD.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# 9 xIMPLIEDA û"OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALLš ð
BE LIABLE FOR ANY SPECIAL~ ñDIRECT OR CONSEQUENTIAL DAMAGES OR
#4  ðWHATSOEVER RESULTING FROM LOSS OF USE, DATAV ð PROFITS, WHETHEN ÀIN AN ACTION0 ðCONTRACT, NEGLIGENCE; O0 “ TORTIOUS1 `, ARISt POUT
#@  ORRCONNET r0THEŠ  I ðPERFORMANCE OF THISñ, SOFTWARE.

"""
Additional handlers for the logging package õPython. The core ðis
based on PEP 282 and commentsR preto in ‚p.lang.pO ð

Copyright (C) 2001-2021 Vinay Sajip. All R% ôs Reserved.

To use, simply 'import¾ .× '� ‘log away!þ 
, 4io,0 ð, socket, os, pickl\ ótruct, time, re
from stat C áST_DEV, ST_INO TMTIMEc Tqueue ”threading Ðcopy

#
# SomZõ!nstants...
#

DEFAULT_TCP_LOGGING_PORT    = 9020# /UD# 1# =HTT$ F 2# ?SOA# �3
SYSLOG_h ƒ  ‡  T= 514"  ­ " ò
_MIDNIGHT = 24 * 60 ð # number of seconds3òa day

class BaseRotatingH¶(­S.File 0):
–  ç   6  A  âp that rO óñ files at a certain point.N òNot meant to be iªð
iated directly.  Instead,œ ­ � M �or Timed   n ¼ Ánamer = None: ° o  ñdef __init__(self,Ì  < À, mode, encox=I °, delay=Fal@aerrors : 6‚   0UseÇ¥ specified` „streamedK•  8 D ¨ .µ 
=º L  P  ß 	 ã é ,E )4  Q.Œ ! =M
 q % =d! V   	 
  ²Cemit®orecord}0Emi“$ .@  	aOutput˜  ™ ¿ Èp, caterÆ ôñrollover as describedŠ  J cin doR# "()‚  À2tryW    i¨•lf.should? Œ Ì  ,   Hh €   "3 �except E :ion› k èEv(• = }G@ion_- )Š€default_ Ä 	aModifyx=  ´aþR whenY7ing²òThis is provided so…�a custom?  { @ cane* 	E #e ¦  ƒ lefaËQ callp  'E Ðr' attribute ƒof the
  ðhandler, if it's callable, passing/ õ default name to? Qit. IR õ attribute isn'tI U (theA ‘is None),W  O L õs returned unchanged.
  d:paramJ _< 7: T\   A for[ •log file.@ 5""" Vif no¤ `(self.@ 5r):%  #0resø =w " Oelse0 R (=² )< ì  a æ ¡def rotate‘ ç, source, dest™ Ê BWhen5 Bing,
 e·current logF1áimplementation²s; '† 7or'Ö9#Â A andÅ P argur sF8d Y@is sÚ @y reÓAd toÖ  F!inì WE Q ? A ñ. This is normallyO 6basH ,  z ; õ, e.g. 'test.log'¦ w  ” 3:  È#st  | B o   Awhat˜ ¾ #is  ˆ ?.1'‚ q ñ# Issue 18940: A´ A may[ðhave been createdbPdelayI7Truš N òif os.path.exists(È u  + 2os.Ú#  –�Æ 5 €
class Rw‚ingFileHT(Base  Ž � uAlogg/¡o a set ofñs, which switches from one ¶ ¡`next wÑ 3À LA rea< Óa certain sizCŽ  ?ƒ__init__A < ˆñmode='a', maxBytes=0, backupCount=0,Œ  b �encoding=µ hñlay=False, errors  7 �   BOpen“�pecifiedó ‚use it aqhstreamH¢$By~6 Õ À grows indefò áely. You can so Åy particularÚ `valuesœŽ  .Qallowº l åto rollover atL Àa predetermiµ’ R3 aoccursÙeC Ý§ enearly 5 inL alengthl« ris >= 1ðsystem will successively create
      ð  new files with the same pathn	 !as Abase) R, but- Ãextensions
  ò".1", ".2" etc. appended to it. For example,E õa backupCount of 5M @and  z  � ÷of "app.log", you would get D , ˜ 9 ð.2", ... throughž ) b5". Thí e beingM pwritten/ –is alwaysu   - when it� s.pled up, •is closedN  ß  reÕ �  B   ifC eb Ä cO `exist,­n oy are `  ý m 3©F årespectively.
 ðIf maxBytes is zero, rollover ne uoccurs.4 5""" å# If rotation/9 ‘is wanted#ðdoesn't make sensej·use anotherO Pmode.U fR  'w' were Ä 0ifiX t“f"re ‡multipleO @runs}  pcalling¼1lic² Wñ logs from previous 8 �bP alost iv – 3is Z ” @beca×  n 1logçÇ§be truncat*�# on eachp ai•E> 0:Ð  � !e = 'a' àif "b" not in ! 
3 Pencodú ¤= io.text_ (	 )N QBaseRÒñ	ngHandler.__init__(self,Ø  à,m $, E =	 ,N  ³  adelay= ’, errors= �  r .¤=¯b ! l=zësdef doRØÆ )$ÑEDo aà, as described]	)¯? 1if � fstreamc   .3(æ   f = NonyW ç  2i¥ Qrangeå .1 §- 1, 0, -1ü  y   Rsfn =¼ Ï_@ ç´("%s.%d" % V QseFiläJ, i)È  O dO &Ø G  _i + 1‹  `if os.ø.K_s(sfn  l , d,  0  os.remove(( » # F]sfn, ( *
3 £n0 + ‹
q¶ Àpath.exists({dfn):
   os.remove(  	 Áself.rotate( ébaseFilename, 0 qif not ' Zdelayj  ‚stream =& �_open()
s ñdef shouldRolloverr ‡, record¸ 1"""2  Ç ãDetermine if r9 H r occur._  - ÑBasically, se2 Ãthe suppliedi   w„ p cause   åfile to exceedz   õsize limit we have.  ¦ ö# See bpo-45401: Never° ðanything other than regular  sV ñif os.path.exists%.—Q) and‹*  isE *  
¢Èreturn Falseq º€is None:O	 !# ô¦ was set..
 ( D þ    "ifÎmaxBytes > 0h p  # arep ï5Ever?±  K âmsg = "%s\n" %W sformat(N	/ � ñ.seek(0, 2)  #duúönon-posix-compliant Windows featur0  Ê îó.tell() + len(msg) >ë 
ˆ C Œ6Tru[   Ð
class TimedR¡0ing™ÄHandler(Base  C™ � for loggKAto ar!, ö  he   Ð at certain t{ H“intervalslñIf backupCount iËf, whenôð is done, no morl(an8 [  ¹sñakept -’¢oldest one rdeletedrß  P�__init__û,Â ¹ ‹ d='h', ¼ 8=1,} 1=0,€  Œ �encoding=,ñ=�T, utc  at–% E  Qrrors ‘ ` [ ´ = io.text_ (	 )M Ý .ì T'a', D =	 ß   ˆ  Õ= 2, e»  Ž ? R! =ä{.upper(! =kÖ H Putc =N
 T2 = 	   # CalculatAge reald™ |0ichŠAjustE—number ofL ×seconds betwe­€s.  AlsoÚ=  — JÁ suffix usedü M aˆ ‰ E �Current '/�' events‚Vortedr# S - S� U ¦M - Minute¨# H - Hour ðD - Days
        # mò
idnight - roll over at mi #
  ‰# W{0-6}) öon a certain day; 0 - Monday: 
 ÷4 Case of the 'when' specifier is not important; lower or upper caseM ¥will work. €if self.[ … == 'S':  Ê  þ
interval = 1 # one second+ þsuffix = "%Y-%m-%d_%H-%M-%S". ó	extMatch = r"^\d{4}-\d{2 _  –(\.\w+)?$M -elÅ MÅ #60Æ nminute˜ Æ v Ã ½ /H'‚U60 * Â OhourÀ ½ %·  D'x/M�MIDNIGHTÒ C* 24™k–Ó Í ÿ.startswith('W')�» 3* 7¿ Iweek–uif len(j) != 2\  è óraise ValueError("You mustø0y a9P for f !lyˆ‡àfrom 0 to 6 (0Z†): %s" %ë)� ™ Š[1] < '0Î  K> '6É² qInvalid§ ­d± — ” ö dayOfWeek = intB:[1]Æ / #F*se­©÷  �6ñ  ‰¿ M’e.compileô  ¦, re.ASCIIÿ < o =è *9Àö# multiply by units requesteÍñ# The following line added because�ðfilename passed in coul% % aØ ò# path object (see Issue #27493), but² TbaseFU ­µbe a stringQ w è 6 % `if os.z „.exists(7 Ñ0t =* Fstat# ¢[ST_MTIME]Q À   else:
     Ðt = int(time. D())
 àself.rolloverA+  ƒcomputeR A(t)
3 Ldef   1 ñ , currentTime):,  c 5""" ÔWork out the s  ‘ ‘ based on ‘specified .@ L Presul® w 0 + ‹ •.interval9 ¢# If we arx @ing ï ð at midnight or weekly,… Š J ö is already known• `# What^  ne² �o figureé pis WHENQ P next‡› ÷ is.  In other words,° oif you± 
§ Ayour?\ h 1 dayQ 1butR Àwant to star‰`at one. h clock÷, not now.  So, we¢ @haveI Qfudgeá ÒðAt value in order' Ptrigg …he firstT a’ 1e r� a.  Aft7 !atñ † regularî °will take cà'ofQ i�est.  Not§ c ò is code doesn't9  ab›ö leap seconds. :("if]ðwhen == 'MIDNIGHT':x  .Y—swith('W'
 A# Th} Puld b� 0ne , B les•  , « I ©Aed i®…be clearÛ  M ’ 6utcp     B gm ('Ô  ) Oelse? _localB [ H‰i= t[3]§  pMinute ! 4! Su! 5! 1Day 6 0# rŸ ë€number o«ÂÐ left betweenÊA and­Ž‰rotation° WaË [ ?Non# = „e_ts = _	J [8 !((9k  .hBD* 60É m; )* 	a  À  E ¼®    Fr = x 4- (µs 	©")  p & ®
KŽif r < 0O0# RkeÑ SPbefor�e8 Ð(for example P€ #‡Î  AtM Q13:45Ú!itår14:15),ó oion isH  †tomorrowÌ +  ?r +Ô  �J  ‰+ 1) % 7m ª
Ì¢Àon a certain¦P, addZ
ððdays until
         ð2   # the next rollover, but offset by 1 since we just calculated < gtime
  v# untilY ûday starts.  There are three cases:A pCase 1)-  > %tož ñ is today; in thisC Ï, do nothingM 2M rfurtherN òe interval (i.e.,l ; isU ð  ž ù2 (Wednesday) and­ !onÃ `6 (Sun" `.  DayÆ T 	Ž ð ûsimply 6 - 2 - 1, or 3.? 53è Ÿbehind usê 
T ç !isÅ €5 (SaturÇ é q3 (Thur£ O  	( Þ Q5 + 3Þ Y4.  Ià@it'sT¢ �number of© ds lefté ñcurrent week (1) pluK  5 R K g$C ß3 t L (3)ð  Thá/àions describedœ 2-p3) abovb Áed to have aT ^addedV  is`becausIeB  Œ �ion takesôÀto midnight  hÒPday, ô e° N ã‘:day‰ Òif self.when.àšwith('W')Ñ ÷ )#= ‹pDay # 0Å  Mo	ƒ / iÈ2 !=d ždayOfWeekY . <-  1 ¼daysToWait b   -z‘  6 Oelse�   	T  Î ó +“ O + 1\ CnewR�A• §result + (X �* (60 *  O24))K  if
y ?utc² ßstNow = t[-1]L Ù DstAt�  . �ime.localp(º )J 
 Öt H!= dW ¥  ‚ Ò d< :¶�DST kickÎPbefor@	Æ so³"neUïdeduct an hourì  n    y¯nd = -3600/ 
 4   # � Ÿbows out � ?addš ™ 	™ð += addend
           ôresult = newRolloverAt
! rreturn & 
 ¤def should0 ñ (self, record):&  A 5""" ãDetermine if ri H r occur._  9 J ñ% is not used, as we are just comparing times, but it4 …eeded so} ñthe method signaturesL   Esame+ ´ ö# See bpo-45401: Never¾ Panythƒ �other tha*µgular filesV ñif os.path.exists3ñ.baseFilename) andð *  isE *  b-£FFalsÇ  Ò@int(. 8())Ž Pt >= ·.Œ/AtW 6TruV k O  0getÅ ‘sToDelete²  z à as to d9 Q when_U(veÒMore specificl C searlierßr, which# 8` glob. 1().²  3å�dirName, � 
 % =¬QsplitÏ 
«I  Á  4 s5 ƒlistdir(T r@U = []< ^¡4753: Don'î Ù ‚xtension ð ut  fprefixÑ Bn, eƒ d¸ Dext(Ô Š :  ðe + '.'� ²plen = len($ 4 "foÐ ê 1 inÜ  s2"ifR Îr‰JNone#  }B# OuP õ	s will always start with‹�  8   !if"w.4 s4 ë r  : gcontinÌ  ?els¡ cè# bueabout ÷ñafter custom namingˆ· ó# likely candidat~!ofëOform4  ð	foo.log.DATETIME_SUFFIX Ž,oo  + E @if (C1
y" 2endQ’S  8 %1 Q) > (=6+ 1Å [ ×+1].isdigit() L  ¡	r %ifn [:K R] == ¡é†suffix =4  3 :tm | 5628: The ˜/, H ý€anywhereý&thO  ï  ø	½   @partS .šF('.'^ &    f .  e   ^ #   f extMatch.m (2 Z 6 àresult.append(ðos.path.join(dirName, file
 O))
  Ubreak õif len(result) < self.backupCount:+  P ( U = [] Oelse& j.sort(‰ @ 	 ([:} -} e rreturn 7 
| ð def doRollover(¹ )ˆ 1"""&  ¶ cdo a r) ñ%; in this case, a date/time stamp is appended to theXEnameS 0wheF eW ! h4 õs.  However, you wantC  O 0be J Pd for S €start of Ò interval, no@ PcurreL qime.  I( !re®  ±  c²,R t¥ pwe have{ ‘get a lisg …matchingÝ 0s, ³ € ¶m and removô  	€one with% õ  oldest suffix.w {"ifÕfstreamŸ — ². k.close-  f = Non‹  # Ì  ‘ ¸0tha%¡is sequencËqrted atË `make iÿ †TimeTuplM Z    =z(U . (I�dstNow =  `.local
 (? F)[-1´2t =ý {3At äß4(:utc% c ¯ y  gm &(tY� " 	5 ® 8  „@dstT&Ö 4 	Ä  $ 3if ü  !=
  1 
¥ 	&    Õaddend = 3600÷     Ã     8 -9 ê 	2 + > +6dfn•ptation_4 ’B�.baseFile � + "." +¯  ™   ‹  Ïf	 M ,2\O4if Ä§exists(dfnÁ ` 2os.„ ‡ brotateh µ  , H , Y"ÓJ > 0¥ ‹sZ 0get«sToDelete(– 
š s^!if®E Zdelayf  ð…W_open÷4newÑA?tcompute 	qè jwhile @ 7<= �
� 
* =: +¹§ò #If DST changes[õidnight or weeklyƒ, adjustì&is%2if ¼JÐ== 'MIDNIGHT'I ,  .stÐ('W')) and no×t self.utc:
  ðdstAtRollover = time.local
 D(new yAt)[-1]> Àif dstNow !=
 K 
f  q `if not& óNow:  # DST kicks in before next r� `, so w ùed to deduct an hourŠ  b   íaddend = -3600# Pelse:(  … �bows out… ?add‚ � 	QB += ± © ¦ YAt = 2 ÷

class WatchedFileHandler(logging. )†1"""` 2A h, S for 0  Xñ a file, which w\ Qs the < ð	to see if it has changed4  leÁ°use. This c¡@appeÖ�cause ofF @usag ð programs such asæ  syslog andœ `rotate_ ¡ch performD  $  ¯  " 3ionv Ü ¡, intendedæ  } ±under Unix,B á  Ý Qsince	¡last emit.C !(A	
ôs device or inode have.!.)> IF,d 2oldV pstream Kalosed,	�BopenPget a@ 7 !.
d Š J  |€appropriY ±Windows, be±C 8  r Ÿ á O €be movedì �renamed -¼ ˆB  4 Iðs with exclusive loý-Þ  so"re¬ Q needC  ¨ %¾ò. Furthermore, ST_INO7 Át supported ¾ C Â ñ; stat always returns zero*t»_valueB0basì án a suggestion¼ p2¢ by Chad J#’Schroeder …Ðdef __init__(î,U >ò, mode='a', encoding=None, delay=FalseÄÀ aerrors+ ó  aif "b"u!in[     c ´ = io.text_ (	 ° . /_.È  Í ­   M  o =	 ò ø E ¹  dR.dev,0inoQ1, -1 Œ $ _D"()E­  ( 
b  .5 
^°sres = os.fA ë) .¿Fno()¥ … ©  G ¤[ST_DEV],  FINO]¢  reh�IfNeededj ¥ À      """
    ñReopen log file if needed.

! �   Checks Óthe underlyin2 ðhas changed, and( %it= °has, close > ¡old stream, r    `to get* A scurrent6 . 5""" r# Reducc  � ðce of race conditions by stat'¼ Çby path onlyH Aonceš ethen f/ ‘our new fà 0we 7Aed a  ?Ö   ð # See issue #14632: Thanks to John Mulligan forô æ problem reporD#’ Vpatch` Etry:¹  «#Ý H Lâ 0, cÀ ô  g ™existence<  sres = os.ò õ(self.baseFilename). pexcept  ÚNotFoundErrorŒ P 6Nonh ’# comparejbsystem´ �with that¶ kM) VhandlG  ¢1ot b !or Á[ST_DEV] != » Gdev  6INO :ino¬ "if5 t pis not » 
( d`we hav$£  è•ean it up1 7   ™ d v.flush(U     $ 4$ ! =§ "  lIl€21742: _¢æ () might fail= m   #Å Æ6nq Š ô ¢ info from¨/fdá 	 ˆ„ Ä _X "()n�def emit�–, record)‡ôcEmit a$ ®/If£sabeforew t%&thl�  °&it=† ²S 1IfN:ð €logging..HÇ.r.à ó 


class Socket) (=  } "A ª"r < Àwhich writesÏ x Às, in picklekqmat, toÁaX ú s b. The  P is kïLVacros] Rcalls!Ifwàpeer resets it€ attemptI @madeK U�nnect on7 Pnext N M   ­ Õ @is s"is|on ALogR! 'sg  ribute dicí"arÖ0(__ r__), so@  nÂreceiver doeñ ÷ Ÿ Þ # €S modu€�installedQPorder2 `proces� ezSevent–STo unÒ  Y  Ard aè ¤0eiv€e=ento a Ü 2, u:®Emake A funì 7 %  Eƒ__init__Iðhost, port):
       c """
  õ0Initializes the handler with a specific host address and port.
H AWhenA ðattribute *closeOnError* is set to True - ifa pocket e$ M qoccurs,P s!  > �ilently X d† tw ¢reopened oƒ EnextL Õlogging call. " ".Hû õ .__init__(self)3   .=
  ! = !if  ú UNone:  |O QR ?els. (ˆ ,^ ¡  /0 = p o k 5�Š = False" œretryTime@ #( �# Exponen4ö backoff parametersa4 ~ \ µStart = 1.0R  �Max = 30 ÑFactor = 2.0
= ‘def makeS ¬Æ, timeout=1)më1A fI ðy method which allows subclass�o define„Wpreci/€type of m Ó†hey wantÿ u 1if æ #ais not £  PresulU ñ.create_connectionã .2ë ó =[ b ( “.AF_UNIX,Î Æ.SOCK_STREAMU ¢ C.sett ( 
' :tryÚ < Î 	Ë 
> ‘except OS6I  [ñ()  # Issue 19182 o  (ra·rreturn FjH=0Try¾/ »@, us`Oan e  H— aa max «€. ThanksW ñRobert Olson foryåoriginal patchH Ã(SF #815911)Ãàhas been sligh&"reì/ed—Rnow =‡  È(ˆ‚# Eitherª !is³C, inq 0cas%is– #é DQfirstZ #Ã after a disG, or8 ö	we've waited long enough¹ D<’ 
"`attempF db ) (">=£_  ¦V 
k çè X Q ¢S ž. s v0 # À?0, nˆõlay before tryingÙ  J 2ð#Creation failed,ð so set the retry time and kurn.
  �if self./ T. �is None:+  : , ‡Period =? ]Start7 ?elsM !` *` mFactora  ˜ 	Ç ; >; ?MaxÑ  = Õ 
=Maxr 1 2w= now +o ‚ 
9  dec0nd(6 F, s)‰ 1"""#  … ñ	Send a pickled string toÍrsocket.Q  . ð-This function allows for partial sends which can happen whenR w ö network is busy!œ ^ ‡  *   Ü �.createS¬ %()c # <  Š !be`ð either because we haven't reached¨  ¸&ryK Ðmyet, o; 8 	ÿVried,J ðbut are still unableovconnect	ý » …:try   í .ƒVall(s ! þexcept OSError: #pragma: no coveáS Wclose[ P   " " =]  #!weüXcall �Q nextR £QmakeP}©orecord®* s£ )   in binaryˆð
mat with a length prefix,�…‘returns iôd: ¡ transmissÚBcrosg  A  ð   ¡Rei = ± •.exc_infof Zif ei©`# justïg/ raceback tHintoM  &.. ~ Tdummyþrformat(� îð# See issue #14436: If msg¾Aargs‚€objects,MÅy may not beÁ q# avail¢o¿ Ÿ 0eiv"pend. So@bconverÿ e  % d G Cto aZ`, savez!as’  %0zap… 7 ï  å4dicà 0.__ &__é †d['msg']…˜getMessag®0d['‘ (  Cš 4d['¶ 2# IBò25685: delete 'm` @' if]ãsent: redundan~— g U.pop(9 ,+Æ 3s =·.dumps(d, 1 0lenñðtruct.pack(">L",á6(s)) Ö  s0 6+ scahandle÷dH/ P an e*1 dutloggingÀ   An error ó#has occurred during logging. Most likely cause -
  ð*connection lost. Close the socket so that we can retry on# F µnext event. 5""" �if self.c] ²OnError and  i :,  ™ -   2 /() p = None2   #š Sto reÖ  ˜ Etime@ Jelsel '‘Handler.h £ (ˆ ,P Ard)
E Šdef emit S ÷ cEmit a@ .@  © pPicklesC °writes it tt‚÷ in binary formad IfD ¡re is an eX@with Áñ , silently drop  paÛ¬H íwas a problem J Âre-establishÀ  Ô  ®e› 6try!- " =ûBmake(¶ f     €v.send(s�except E ;ion[  hÄX ª  ¾…¿); ¯ žÖ 	� wacquire¢í 4ockð  P ‰ â  6ock‰  ^  / å	6  %   Ñð E lfinall– ;`releasÑ ó 
class Datagram !(S B>"A z"r < cwhich Ø˜ òqs, in p
ØA, to¢ 3a du Äd.  The. V pis sentû oÂ LogRecord'sL ±ttribute diè H0(__ E__),à óôreceiver does not need— 2havÊ ðmodule installedÒ PorderÁbprocesG1 #™ STo un | aord at¢Š  Ç enX Fto aÜ  , Æ"thØ E÷ A funè p› ú�__init__ýÃ, host, portÇ W0   ’InitializìÝ¡a specificI P addrð  × T ^S 	>.‘ # „ Ã8r= FalseO ×   X Ù Í  Aòfactory method of 8 Î Lð here overriddenÊRcreatk ’ Sa UDP™ß (SOCK_DGRAM)ò  â Y  a  ²
ï`family#[….AF_UNIX´2 Ày = socket.AƒF_INET
  ²s = socket. „(family, µSOCK_DGRAM)5 ‘return s
 ñdef send(self, s):  a 5""" ôSend a pickled string to ak O  8 ñThis function no longer allows for partialz õs which can happenv ð0when the network is busy - UDP does not guarantee delivery and
�    Z  0 pa/ps out oû uquence.t ö i! !lf] | FNone  [  6�.createS‰(i  ˜.aato(s,  óaddress)

class SysLogHandler(logging. ‘— 2A h(  < < a Zsmatted D ƒ records©Qyslogé ñserver. Based on Sam Rushing's s* c modulñ ò!http://www.nightmare.com/squirl/python-ext/misc/C 1.pyp €Contribuœ óby Nicolas Untz (afterÑminor refactodqchangesG ò have been made)µ  Ð# from <linux�   blog.h>µ?# = 2n ñpriorities/facil ò  are encoded in"óingle 32-bit quantity, whereM  æÑbottom 3 bitsI   g py (0-7)Ùitop 28+ K � 1 ñbig number). Both< S 5iesO 5   3mapJ ðroughly one-to-oneJý2s iœêÀd(8) source ý 0.  I @mapp1i6 2clu! t*#il#. Ÿ a(these‚ordered)i�LOG_EMERG†A = 0 @  # ¾0tem°runusabld 2 QALERT* 1= 1 2 a«ò	must be taken immediatelÄ @ 2CRI? F = 2@ c�cal condi÷° 3 3ERR) 3= 3
 �#  error0 `WARNIN× 6= 40 @warnBb  `NOTICE+ 0= 5  Õ önormal but significants m ¢ BINFO7 2= 6	  G0infB  Î %al- @DEBU� V  = 7- ðdebug-level messa³5 3#  \yBKERNB 	¿HkernF  #  § 3USEJ	¼¼random user€ : @MAIL  ´ ¶Cmail-ª  e QDAEMO– 	®0sysSfdaemonÂ DAUTHY ¬ðsecurity/authorizaE 3  m QSYSLOM	¹@ð generated internalð
ly by syslogd
    LOG_LPR c   = 6
 õ
#  line printer subsystem6 BNEWS- 2= 7	 ÿ #  network news6  BUUCP- 2= 8	  6  d BCRON% 2= 9	  . Åclock daemon� €AUTHPRIVÆ "10- õ#  security/authorization messages (private)I #FT¢ U = 11I   s N* 2*   Ì �SECURITY  3- •Log audit€ qCONSOLE�*14) 6ler) 3SOL!E= 15) £Scheduling#± (Solaris)
e ð#  other codes throughC Àreserved for'qtem use6 *AOCAL\3= 1+9#  7 ^local6 I3= 1+6 U3= 1+6 ^3= 136 k1= 2à  hØ x1= 2à 6 <1= 2à 6 <1= 2à 6 	±@prioú¡_names = {  ( "aI ":  ØfALERT, Bcrit !<CRI oical": Rdebug=  [ WDEBUG[ Gemer IEMER "rr< ›8ERR< 3rro  [    Â   Ö#  DEPRECATEDÉ CinfoP  2 GINFOP anotice    gNOTICE  Qpanic é ¬  n |p Bwarn1 2 €WARNING,4 ¢  2 !in „ 2 Ã }´�facilityÍ3uthu  i  G  É  ü è& "  /& bconsolŒ% $roâ m  …" %k ÇgDAEMON$ 5ftp! k 7FTP! %keIg 8KERC #lp   g (LP.0mai£ ! GMAILe  ¤‡   Ö" ¨ N¨ _G  C éG s€"-c=& ½% —I ° XSYSLO8useö  I 8USEö 8uuc[àLOG_UUCP,
    Ð    "local0": ó    LOG_LOCAL0,
 $ 1$ 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ !}
ò4#The map below appears to be trivially lowercasing the key. HoweverT Ð#there's more@ Ñit than meets5 áeye - in some  8es,\ “ ðgives unexpected results. See SF #1524081:M  � sTurkishT ‘ q"INFO".» Á() != "info"e �priority_ü 1= {  ò"DEBUG" : "debug"N  Q   H  bWARNIN6 iwarnin8 QERRORS XerrorS �CRITICAL ‚critical£ ¢ñdef __init__(self, address=('E host', SYSå–UDP_PORT)   ½  ‘facility=) öSER, socktype=None):"†  8 òInitialize a handler.@ f’ ñ is specified as a string, a UNIXo  et( Àused. To log0a{ Õ ò syslogd, "SysLogHx (ý ð"/dev/log")" can±T H 4If ñ  q 6not� ,@USER 8 1 IfŸ  5 isG 	Ñ  /ñet.SOCK_DGRAM or6  pSTREAM,üo cL aocket c Ewillµ “ For UnixM as, youØ Calso¹ &y & Š H 0of ¼,£which caseH ª q •, falling› @backˆ X 
Í .$ "ƒlogging.˜.¤) ³.µ$ =*S  §=²
!  • í =Ø   b Ôif isinstance ,zÐ ©l @unixO •et = Truej  # 1# Sx± server may¤Ðnavailable duÒ š fsation,N ðC's openlog() func&  ÔÒignores conne  sE ÒMoreover, we 6  Q2se 0 P whilR’ Ô@ it ðLworsá $toD "it‰  º
t 6try Ê   ?_® _Hs)J except OSEôN 6pasdJelse# m d k = FalÌ i±Àis None:
     °socktype =  èet.SOCK_DGRAM
) ùhost, port = address!   F 0get% Vinfo(; A, 0,h  s )? pif not F :  … ÷ raise OSError("] ú returns an empty list"\ 0forY 0 in s` &af— ð, proto, _, sa =3 ‘ 3errì } = None" >tryh  Ì  g< 0et. ?et(�  
Ã  :   %if@* =´oSTREAMu  ;  k ¿.connect(sa` ]breakÍ dexcept� as excj =excE  „ ¿ 1 isî :G  - ± Zlose(­ 0if g E 
39errˆ Cselft„   !   
& Sdef _AP_unix¡ 0et(U ,)Ð @use_#  B  M |   Q  å 9if ( !isPF  % 	" 
ö
ª ‹ 
à d ‹ ¹et.AF_UNIX,w `¸S > Û6ess6  ¥ °# it workedNU set =  ô p to they  d   ? 
+ =& >) 
‰
%A Oet.c6#  ~ …#� ñr didn't specify falling backå Efailž  Ç   |	 Á·	. § em¸ ( Æ † Ê  [ Î - Ò, C p rÖ ) Ú	   I Þ $ xK ¬ãencodePriority§€facilityç ²1""">  M E> ±4 c and pP à. You can pass\–strings ot°integers - û! 1are5  ) ` P_nameËd† n  @mapp€ dictionari0 rT�o convert· Dm toH À integers.
   B"""

 õ  if isinstance(facility, str):&  .  „ = self. t_names[ ]5 
[ _prior[  [  [  [ ureturn ° ” << 3) | + 
†  def close(² Ð C! Ñs the socket.<  ó '  B ¥.acquire()# :try'( I | -  T òlogging.Handler.$  6 ( ofinallY `releas� ‚  á CmapP\ç ¿, levelNameò cMap a ‰ .  ÅÁ to a key inNˆF mapáThis is useful2 ò
wo scenarios: when customd ±s are being½  ‘used, andA phe case; àre you can't d˜ õ straightforwardC ðmapping by lowercas  Ðã  õbecause of locale-I öspecific issues (see SF #1524081)ý Œ Â.1 +Eget(‹Â, "warning")� ident = ''	 ±# prepended�±ll messages§  ap ò0_nul = True   # some old syslog daemons expect a NUL terminator  ;Cemit4orecord10EmiG $ .@  ± BThe   
tformattÑt sä !toNž ¡server. IfÓ  H Âexception inF  s B @, itb @NOT    àK H —™4msg`d (» w ‹ "ifÞž
Ú  E " V + msÏ # B ¬G –+= '\000'P ? r# We netconverteN ý é e, maybe tŽEwillL dchange]ffutureÇ $  ³ †r<%d>' %þ iencodeWð,c  C  §y.Ï  y)„“   .Š Š('utf-8'( 2# M a³ Y# C5áto bytes as re¹d&‰RFC 5424È Ù?msgr 
&  ™ ùBunixù–<$6 š.send(msgî  * )Ž OSError_  $ J ð close()
         ñ
self._connect_unixsocket( ˜address)
3  " . š.send(msg* Uelif ' ƒtype == 3 ½SOCK_DGRAM:_ 4 !et[  to] ,L • OelseH 0allI ¦ �except E :ionC ‡ ñhandleError(record)

class SMTPH £r(logging. )J 1"""Ý "A G "r : `which 6As anI ó email for each Q q event.F N Ádef __init__© , <  host, from#@, to ±s, subject,E ¿ ðcredentials=NonecCcure ³timeout=5.0Ñ  6 ‡   0Ini> tize theæ %.
k ! Ñinstance with3  ° € and to ° @essed· K qline of6 -ð. To specify a non-^ BdardS�port, us� H ()  p) tuplev0mat ^ N` argum€j H @auth=wcation L s0ppl• ð(username, passw@u H  ó =A y ›  Í pof a se©E âprotocol (TLS)m R in am Û 7 ` …his willK ponly be8d when ê ò are supplied. Thep M  Z  M `eitheríRempty& @, orË £ingle-valu?  ;M ù skeyfile< 27 s-2  fK Àcertificate O @. (T
!is®e– œò`starttls` method)“ #A ( p°seconds can÷ ž5ied� 5 q 7E(the– àdefault is oneä(onk {!r.ãTif isw(ÚP, (li/ð )Þ Ò ù+   3% =m· ~3 l B  , vH 
¬ ¯ hm m( =™j ² E * =™ S  ª ¢% =eP 
º z+tr[ C = [ ]E f  $ =À
 Ì- => ß=;%urYÀ self.timeouñt = timeout

    def getSubject(self, record):"  & 5""" ò Determine the s9 A for bemail.\  : õ	If you want to specify a9 lJ ƒwhich isz µ-dependent,w poverridv ¥is method. ¡ preturn Ë .Ÿ �  ì ?emiæ cEmit a� Ð aFormatë &± and send iâ æ ïied addressees¬ 6tryf 0åimport smtplibà   Rfrom `ƒmessage . EuM 	3   5 Rutils
 O   l =+ D   
A `f not  
¨ > ¬ ©.SMTP_PORTB  Ê $ =Ñ % f.p Qhost,^ ,—=¸¤)K hmsg = í (! €['From']s @elf.5 …I A['To& ‚','.join•  to- sW  "4 £ 6
5  ADate2 ‚`.localá ¾ ².set_conten¦!.fp(b 
c "ifºŽusername¢" `securea Î?Non,   Ò ­[.ehlo›       ¡starttls(*\ 
š  ,   0 P  4log{Æ ,Õ Ppassw†	º5  n_J(msg| # GquitÄ �except E :ion*Ç ´handleErrornñ

class NTEventLogH% £r(logging. *…"A M "r @ Þ ¶ 0s eJ s )1NT [ Á Log. Adds að °registry en ^?Y°pplication ü0. I«@ dll 1 isH òprovided, win32service.pyd (—  nóains some basic \B Àlaceholders)B�used. Not‹�at use ofGse p. ¡ will makeI Byourÿ Ð logs big, as9  æ 4irex a sourc¯qheld in% 2logETqslimmerS ,k@have` A; o‹‘r own DLL•  ”ý  0iniasX Ã ð ’ Í { ˜   h __= !__WP, app„ , =„,; vtype="AÏ"N @h.V ÷FôÐevtlogutil, wÇin32evtlog
  ó self.appname = 
 # –_welu = wH Iutil)  if not dllN :  s  ñ = os.path.split(„ a ¯.__file__)= U ?[0]4 Vjoin(3 A, r'Ò Êservice.pyd'H � 2 $ =Ý 	Ÿ # `logtypD
 # ã óAddSourceToRegistry(w,_ #, E Œ #efi º Ôþ.EVENTLOG_ERROR_TYPE�  8 ymap = {  �ølogging.DEBUG   :ë_ ±INFORMATIONe ,I  *  Y I .WARNING’  Ž ×  C �CRITICALÑ C }úexcept ImportError!ðprint("The Python Wkó extensions for NT (­¥, event "\e  p "Ö)Ù1ear ÿto be available."e «� = None
_ ñdef getMessageID¶–, record)Ì 1"""0  ‡ ÂReturn the m8 1 IDÇ   ¾ A ð. If you are using rJ 4ownC  s, ð could do this by hav7  Z Àmsg passed t! eH  Per be+  an� Ðrather than a� @matt 0stræ Then, in hereð ® … ðuse a dictionary lookup| ;getÿ e. This‘ 0verÝ! r+Ñs 1, which is9 9bas="in˜ ±.M |Q ) 1¾E1�CategoryÂ¯c=  )¡ Àg  õ‚Override™i×@wantpspecifyÂ r ÕP 2ies Ô È ?s 0ç 
0€ ¥ç OTypeã " &ß 5 L Ú F doe `a mappoö ¿ handler's ?  ±—attribute•set up in+ __init__()kð a dictionary whóich contains mappings for DEBUG, INFO,
  ðWARNING, ERROR and CRITICAL. If you are using Àr own levels U willO õ6either need to override this method or place a suitable dictionary inN õthe handler's typemap attribute.) 5""" Ãreturn self.3 Á.get(record.º 2no,! 0def$ !)
? �def emit(= ", 2 !):  0g cEmit a$ .@  $ €Determinô ñe message ID, event categoryk  ‚ e. Thenj @log þ @ !in #NTF ?logþ "ifÙ V_weluº  š :try   Bid =2 BgetM® #ID-)�  +   7cat0 EÒ CÑ 4  ß 5 OType1 4msg0 Tforma¼�  ¨.ë q.Report’ ¿Ð.appname, id,v,Az, [msg]K �except E >ion'i ‹UError¼ " 8Qclosez 1‚Clean upL r9ÒYou can remov>papplica Ì Q from	`registF1s a„  ž–source of&ò entries. However, iÖ!doŠ ,Åqnot be ™Rto seŽ ­2s a÷“intended ›zE LogŽ ±Viewer - itsX jaccessÏ `to get G 1DLLý ð#š :SSFromR%–2 0log˜’logging.Hp.ÐÃ

class HTTP (/ ô!"A 2  wh�Ssends*‘a web ser�[:aGET orý âPOST semanticsÿ a  r�__init__ß Ã, host, url,i`="GET"éöcure=False, credentials=None B  ?1ext Ù   |   0IniC "izÐinstance with¾Ž  ÃÁrequest URL,õ  ç  O («  "ö "—u t.3 \ # =v.upper(  #if  éAin [~ ", | ]þ²raise Valueú"` 1mus'² ¸ !if^  se|÷ V1 is  |j 3 PparamXñ only makes sense øÀ              ô"with secure=True")
! Àself.host =  
 šurl = url ’method = 	 
 h # =q 
 çcredentials =  ' Pontex” c
 
  ðdef mapLogRecord(¾ 1, r !):$  Ù 5""" ñ	Default implementation oJ Ãping the logG Å into a dictE ñ that is sent as3 õCGI data. Overwrite in your class.? öContributed by Franz Glasner& ¶ creturn“ 0.__Ž &__�getConnecÍ  ¿,vÖget a HTTP[S]A .Y  ; Ì õride when a custom cm  ðrequired, for exa\5 ifñ Pthere* a proxyå öimport http.clienq#ifÉ Õ ž ‡ =8 .Ó SÑ (=='. ûOelse_ ^ H ¬œ N ­Cemitž¥
0Emi™$ ŽASendm 1 to  web server�ña percent-encoded¼eionary’]:tryø ‰Åurllib.parse9  w NÑ,
  
” 4  Ž2lf.1 S Z™_   UvŽ B.urlÝ N.)` A2lf.¢š == "GET"ø  n ÷if (url.find('?') >= 0@ %  ™sep = '&'  M    4 ?4   ñ+ "%c%s" % (sep,Y
Ñ Ph.puty"esSÛ ,Ÿ
+ Q# sup[�multipleÛ s øö ne IP address..š ¬ `# needg€strip op`Aal :O AfromK €, if pre	iGO'":j ` Aif i`ˆ 0= I[:i]V @# SeOÆsue #30904: ð call above alreadyà  ¦›is headerO Üon Python 3.xj7 �("Host",õ 
ea ?POSb	P   «itype",—  ! q"applic°Å/x-www-form-d^À      h.puth÷eader("Content-length", str(len(data)))
  ùif self.credentials:!  , Ýimport base64 ís = ('%s:%s' %O ú).encode('utf-8'€  _  A £'Basic ' +g C.b649 Òs).strip().deK _asciiK  bh.puth	ú'Authorization', s{ Rh.end, *s( þmethod == "POST"ah.send[è 
S ð h.getresponse()ø õ#can't do anything with the resultl�except E :ion‰ ÂñhandleError(record)

class BufferingH$ £r(logging. )O ‚"""
  A J "r = qwhich bC #s :  b ós in memory. Whenever each
 # Á is added toÚ J �, a check  @made gsee if& ó should
  be flushed. If it ,. n  ()M bexpectp ñdo what's needed.Qè ð   def __init__(D£, capacity ¦.   0Ini#0izew )¶Ü R sizek  5 A ?y. 1 � .Œ % =— ¿  T ! n Q= []
  Ñ 2F,Ô «Ò Sa	Î hC itsõ?]  w ¼Returns truªPis upÅ· s. This Cacan be¦  I  overridden3 òimplement customÏ ¯strategiesPr‘  ßC) >=‰ÑÅ  "OemitcEmit aÇ.@  ¼ aAppend3[’xÐ) tells us toU"llÓ  ()ï uprocess ðÌå Ù !.a} á �   ±† � ø ) L â"()Ó     / ¸O°¦®—behaviour.ñversion just zaps>ô  _emptyý wacquire¦2tryµ Õ    ½ .R g.clear- ofinall1 Prelea�Qclose C! Á )î 
[°es and chai>	1paró £"' w )î ðflush()
        §finally:
  ólogging.Handler.close(self)

class Memory! £(Buffering )P 1"""X 2A hJ  = qwhich b5 #s n Ñ records in m^  , periodic£ J ô
flushing them to a targetb 4. F# ð occurs whenever3 t K ±is full, or$ ð	 an event of a certain s< 0ity' ñgreater is seen.H å Ádef __init__,Á, capacity, ¸ cLevel=ï s.ERROR,¿ a=None,P ˆ 8 0OnC�S=TrueZ % y   ¡Initializeç oAwith la size, lŒ A at Œy ¨  `qshould D@ andƒoptional´ %.
7 0Noty  O fithout˜!beO àet either hereM�via setT¿&()ý a] nano useðfnyone!{ aThe ``¸ (€`` argumËPis ``8õ`` for backward compatibilityÈ ‘reasons -$Áold behaviouõ thâ 1hen e1is !dZL s g ’1ed,_1 if> ²  ‡ñhasn't been exceeded no³P M" r. To pr´Pthis,PÂto ``False``³ 2>¿.È)�  .Ã Õ" =ª 
% Ÿ=5 ñ# See Issue #26559¡@why Ì B hasUadded7 y î{   ŒÂ�aBQCheckƒ ¹  ¨a™ -7theé   ohigherW±return (len‚ .Z Q) >= È Ó)J \ä  Ÿ  (± .%%no7 x)ï K [ Xí 1Set…�Ê "}ù“ . ` –.acquire(+trF( b ÿx2 `releasZ ~  Ëñ CÐ KFor 7t }ð means just send  ÉŽ\osg   » ,± re‰Ðone. Override �you want¬  µ di |;) ®g ‹ U ãalso cleared b Poperap\+…"ifkÍ —À            ÿfor record in self.buffer:
   ! âtarget.handle(> )/ + L v.clear($ zfinallyd 1 ¡release()
Q  def close( )1 1"""!  ¤ òFlush, if appropriately configured, set the ¼ Ð to None and _   P µ  l +tr¶ "if6f… 0OnCN §  Ÿ    ¾ .# `acquir =  |   Z Ö =Õ ¸     BÑAingH²'r.R	- — B e ›Ã
class QueueU “(logging. ¬<RThis 2àr sends events‹0a qJ p. Typicñ, it would be used together² òwith a multiprocessing‘  R ³centralise ˜   @fileç ú6 N 4(inM -  Kò lication), so a« Qvoid I Pwritee0ten' K ƒbetween G 2es.É °code is new‡ àPython 3.2, bu 2is Z0canù  copy pasteŸ!toc Quser K  ½Ause ƒearlier V ‘versions.4  ‡	  Q�__init__T,|¯ í ,     RInitiHáan instance, uo Q0pasžÁc  8 D �. dG " =” : ² !en ± rfn E+ # a×€ • ñThe base implementß _ðs put_nowait. You may want8…overrideß tÎ`methodw5you,  �óblocking, timeouts or customÛ  �   
‹ ®  Ô .§ y–  &bprepar+,ÿ ØP+ s' L e Ã *ùobject returned by ÷ sx  « ždkPformaõ#he¡  `Pmergeƒv messagi  @argu­!s,¯ðremoves unpickleabÕ‘tems fromG "¡ ‡in-place¡ ãEight¹å
æ (f ÝuconvertY  l  Ç `a dictë�JSON stroñ b€odified ØE 'of´ 0 wh¥@leavÑ a @orig0r intactÑ x##´_R operÛ gemðraceback text into record.e“xc_text
  ð # (if there's exception data), and also returns* § formattedF ð message. We can( Àn use this tA @plac ¨e original@ Ásg + args, ag òse might be unpickleablc ” 0zaph F �exc_info¸    ì ¥ attribute\ ÷ y are no longerB `needed@ ñ, if not None, will typically 7be — E ²msg = self.*…(record)" ò# bpo-35726: make copy of *  0ðavoid affecting o¤± handlers icu chain.Y ? =P .U | # .°k = msg@ .Â     ! =4  n{ �  Xø 
U �def emit(C, !):  ¶5""" cEmit a$ .@  $ QWriteGQ LogR€ Vðthe queue, prepar[ itÓÌ  VfirstUp 6try‰  i  ¤ 1.enT ± .X eyö]$ EdI  ßTError@  


class Q· ó Listener(object¢ Tl. ðimplements an internal threaálI à which watches\5@s be ad6 Dto a@Rremovdm0T pass  ) I  h  ÙÚ rb ² processingfÀ ”_sentineldC  �__init__c,ƒ *V  &cspect_ Ã_level=False% ®i   ¢Initialise"°stance withV P Rifiedn  ã �  < f s¿   Z " == 9  > % =Ð
! _§ `   =  re™ é ? =   A!de‘ @_blockD* V ù ÿa it, o!G ÆÀ •The base �aPuðget. You may want“poverrid†is methoYeif you, Qò imeouts or work²bcustomn| ¦Ò¨Q.get(Ó )8BstarŠ/S! 1 ë œ‡‘C ós up a background‹ qmonitorE Š ‡ ö‹$to;y=1t =f Àading.Threadó	(target=self._monitor)
  ÷ t.daemon = True �start()
 Àdef prepare(J ¡, record):  M 5""" P+ # a' â for handling.S  4 óThis method just returns the passed-inE õ. You may want too §override tP ðif you need to do any custom marshal� 5 orI ñ manipulation of‡ é b befor• Ping i�   × Eers.F 
Ñ Â ù  L5 KH6eJ=6@loop4Yrough• ` offer± Athem Ð ­ "to™eÀ  ç0 = ö.D FßRer in, ã &rs" òbif not" ƒrespect_* j_level/  3 |process¢  Oelse1 	¨ .Y Sno >=ì r  L iâj R ¢ . (W XÑM{„QqueueK ¡s, and ask g — ¿qeal witßmC°runs on a s«öate, internal threadæ Th0  ð will terminate ifßAseesJ Ðntinel objectß �Â M óq.$ dàhas_task_done Š¥sattr(q, ' 'TQwhile•
�:try  ½Gy !de{ (ÒQ  (   #if�2 is‰2_seå Y 1 	½ &  * %q.Ê (y  " Ubreak    ]ö]   ?if † ‚ qexcept _.EmptG ž Ÿ  ¦!en. ß	ËRis usp< Ð_x	¾òe base implement|ý uses put_nowaitû ó±  ,û' “ ò timeouts or workLæ E 
‹ Ø²8 .§  ./!Astop AStop+‰listener$ is â³&to±=Pthen -às for it to doc so.
  ðNote that if you don't call this before õr application exits, thereN ðmay be some records still left on0 ñ  queue, which wp Æbe processed� 5"""[ qself.en< º_sentinel()  Ï_thread.join ð@ = None
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.£ 0
# Gs> ó authors of new * ð subclasses:
#
# Remember to fsync() changes Ddisk{ðclosing a modified file
# or return ðfrom a flush() method.  See func¶0s _l _% Sand
#  g �e().

im$os
 Dtime „calendar dsocket Terrno Dcopy !wa¦ S e  u.messagi  …generatop i_ ‘ntextlib
ü ctypes ½ G8 ÁicAlias
try:) áfcntl
except Iî RError%  'Ð
__all__ = ['abox',  0dir  '   MH + 	 aMMDF',w l"'Mâ  e  G  %MH 	D `    'g  È  a cNoSuch²  	I ƒNotEmpty õ  'ExternalClash bFormat ó]

linesep = os. ñ.encode('ascii')

ëI2boxV """A groupìñ	s in a particular place.V 6Ðdef __init__(ð, path, factory=Ìâ, create=True)o  = ô """Initialize a� s instang  )    ]  ._] Ü  
 @.abs @(os. À.expanduser( )– $ =  
s Æ 3addÁ ü 
© CAdd  gØÑ assigned key «   Praisew±Implemented¥1('MúP must�i! 5 by‰ § I  œ cremoveŸ :key› R ºEkeye¨ "; … "KeD Bpit doesC_exist´ G•__delitem
¹ ÐÙ   ŠddiscarŽ  
3fë  îsïQ * iÙ ` Q  }     t3y   Fpass§ \__setá ,%£8¹ ¤ÀKeyError if óit doesn't exist."""
  öraise NotImplementedError('Method must be i! ñ  by subclass')
M ñdef get(self, key, default=None):&  v Ð"""Return the* äed message, or7 O if » 
6tryU  Y rV  ‚ õ.__getitem__(key)~ ¡except Keyç B ¹ Ù N  _ á Ó "; cq × pif not g ._factoè 	Cget_=è :lseÝ ñwith contextlib.closing².H AfileE P) as  
A dž (+ 
”  Ç .2a Mùð  representation7aª·JD_str¯ 	' ® = 3³Uses email.ª.ö òto create a 7bit clean f ³f9L 	Î	m ¶_from_bytesë  D).asþ Ä% Â & ² 	¯ }<_‰å Ä	 % _-like¯ jriterkey”K0an % �ator over+sG� � list of†  u   |.¶ N )Q  Cvalu†ò 4all
ú !fo2 in) ^ s 
³$ ‘‡ ! =: U[key]j  !
 !  CIinue6 ayield Z ú  __˜ !__ò r2 Z-7 's(.  " 8 :a�ðs. Memory intensive."""
     ðreturn list(self.itervalues())

$ @def  Qitems& !):   B"""RD !an& õator over (key, message) tuples."""= µfor key in } Wkeys(a  e 6tryr     ¦ ! =: U[key]W   þ except KeyError? ‰continue6 Syield¹ ` 
ÿ 
E3 of? ø ` Memorì ytensive
ˆq‡ __· aains__Š,@.�°True if the$ $edŠû exists, False otherwis� ñaise NotImplementedIö('Method must be i! × by subclass':S__len± ¬ pa count=7s » zmailbox-� 9QclearL
› ¤Delete all9¼¸Õpdiscard1popu Áï, default=Noneˆ  7keyÇCand 7dit, orE 	,;oresult84
k © 6ã  ~  1 p J0popØý ê Ìan arbitraryLYpair ù 	í P›  “,@.�Pkey))º õ
 # This is only run once.ö JelseSr”oE('No7 ËÇaupdate_, argü aChangeÃðthat correspond to certainç
¤õif hasattr(arg, 'Ç'{ ó €source =‰  ¤7s()ò M /msI mE 7x l @bad_=£ ßT YA 
Œôâ 1elf'$ =šY    ý
 ! –  [< 3if  
… P with­8(s)Qflush�`"""Wri‰Ány pending csü Idisk| ¾ À('Method musñ$t be implemented by subclass')

    def lock(self):   õ"""Lock the mailbox."""  ¦raise NotI` ÿError('Method mus� /unƒ U … ‘ if it is¶ /ed• G_close ¡Flush and " � � Gñ_string_to_bytes˜ —, message¸d# If a  (ðnot 7bit clean, we refuse to handleR@sinc	 âô# likely came from reading invalidf ñ s in text mode,‰that wayO Åes mojibake. 6tryw {dreturn] õ.encode('ascii')8  except Uni  |H £QValue 1("SEe input ÆASCII-only; à ‰   ")sr or a Mr“ instead"Gä# Whether each¼ d 0end!‘a newlineÂ ƒ_append_ † = False•c_dump_á
ïð, target, mangle_�!_=A 	ÁThis assumes¨8 0 fiô`s open› abinary¾˜u"""DumpÌ €contents7H 	ô �sSance(½ 0, eB. .Cª  iÐbuffer = io.Bã6IO(í " Sgen =L ’generator, G (G 
=, 0J „.flatten¥ 
! F k.seek(< sdata = "  § !   ð.replace(b'\n', þ:sepl Lp.write(6 
 0if ›.1 � Û 2 ¤.endswith(b 

 >±# Make sureŽ ;  <  ¡ 4  	£ c Ç " /el÷a(str, =,×;IO)û? 5io.2 Ð �warnings.	 ”("Use of 1 äïis deprecated,ß  À ãsØ3, D9 BionWl :, 3œ > H=)P.getvuæ ;str
V ýÿv 
� ðif mangle_from_:+
  £message = 
 ð.replace(b'\nFrom ',  > )C 5 ? ª', linesep6 Ótarget.write(C 
" ðif self._append_newJ … and not­ �endswith(  h :Ÿ  í ô # Make sure the;  ;  < 3 a _ < 	© c & Äelif hasattrÇ š, 'read')‰ ) lbuffer+  ´ �warnings.	 õ("Use of text mode files is deprecated, "™  C  Ö"use a binary> Ã instead", DD BionWx :, 3� M ¨ëÀ 	v @last(y = None ªwhile True ] 4 d .C  (‡ ´# Universal·™ support.o  W !if�.ì ë Õ?r\ns /  s ! =3 q[:-2] +ú'X ú . 
Z X 1X !ifÞ Z $ ¢ ]break� ñ if mangle_from_& D b.start!#b'ÀY  / S = b'ç" +=5:]o ,   	.ï ¹ JÚ< [ 	w 	8  � P _séõ	raise TypeError('Invalid“Àtype: %s' %  U1))
ñ__class_getitem__ =  ñmethod(GenericAlias)


 � Maildir( 3boxšô"""A qmail-style'   rbox."""v ²colon = ':' Ðdef __init__(§ð, dirname, factory=þ�, create=ôw  À"""Initializœ ™ 1dir“Aance{  )      � q l W ™ ±._paths = {A Q    'tmp': os.  Q.joinÉ 0 !,   *),4 ?new4 
   4 ?cur4 
   4 }v ¦ gexists¨ S Õ #ifpâÀ   os.mkdir(ûself._path, 0o700)
  @for ! F in / ½s.values():2  A �os.mkdir(; \ Nelse< ö
raise NoSuchMailboxError({ £  …toc = {}ˆ  p_mtimes à'cur': 0, 'new
 0 Ðlast_read = 0Ã   # Records    P A we ( {cur/newx  skewfactorI !.1G ð # Adjust if os/fs clocks are 3 Aing
J qdef addñ —, messagefd"""Add ñ and return assigned key."""O   £tmp_file =Â¶create_tmp(N:try�HSdump_‡ ( $, S ? Áexcept BaseE :ionP 4 g.closez  ¤ ¥os.remove(' Fname`  % × b_sync_M 5 0 Öif isinstance¹  UMdirMX ` Psubdi¸è R.get_ ¯ dsuffixQtcolon +•7 Kinfo5 4if 8 Š9 
&ˆ ^ %''î 0™ " =Ó) A  uniq = os.”P.basebpa.split~.ž E)[0]\ GdestD Bjoin+ D“ !, l +î ”+@os.uw
¨ ,“  ï  (Þ Ngeta6 )Q£vdate())  Q# No *òmodification should be done after the+ 0is ¸…d to its™ Á# final posiG `in ord; ño prevent race cond# Ùs with changeJ örom other program ¸  {os.linkF Ñ  ) È¡(Attribute€Á, Permission ’ 6   ÃS,e ýA  L
¦   œ !OSƒ K as CB  ¨ áif e.errno == 	 ~.EEXISTŠrá ExternalClash| €('Name c µ„existingF: %s¾ x  
%&“ fü q@J Á,­à"""Remove the ó(keyed message; raise KeyError if it doesn't exist."""
  ðos.remove(os.path.join(self._ ",  álookup(key)))
@ ±def discard1  ,  :  _ �"""If the ¤ † 2s, y * i’ ð# This overrides an inapplicable implementatio c µsuperclass.� 6tryŽ  ’ Ë w Ê * „except (8á, FileNotFoundK)K Fpass¶__setitem__,–; ¡"""Replace¶ ½,`ld_sub§. =¨Þ „temp_key% Cadd(1)% N A .  X”sinstanceM ¢, MaildirMŽø  ~ # H ô's subdir and suffix were specified by;Í B ‡dominantö  S  Ì Jelse¯| àdefaults from !){ oz Û $= OŒdirname(» 	K˜2colÏ+ 
Ê 2ð5 ,+ 4 a.splitŒ.$ U)[-1]§ !W %''& — â Ü 1tmp é 8šî ?new: EO# +#B {!”os.utime(¹ ,Ë  X  ge_1 )Î .get_date(
; ò# No file modificžñshould be done afterú+ 0is |…d to its” Ä# final posiå0ord; °o prevent rEAcond# Ùs with changeJ  ÑÖother program þŸ ¡å ñ 0RšÝÕsturn a ûu repres¦#oršaœ	ˆy	uá Eopen¦tG Ú), 'rb') as f?#if)\facto! Î4msg)_% &(f # ?  9 
: × q9ªÈh amsg.seëBdir(=  À   if self.c÷ olon in name:
  Ðmsg.set_info( Ð.split(self.c8 e)[-1])5 1 ödate(os.path.getmtim BjoinD _! P, sub	 &))J ±return msg
^ Ñdef get_bytes= f, key)± B"""R5 !a & ñ representation or raise a KeyError."""_  õ •with openº ©  ù €_lookup( Ö), 'rb') as fŒ  O Â úf.read().replace(linesep, b'\n')ß OfileÞ  % _-likeâ ?f =á %&rdp_ProxyF¯ fÄ riterkey¢� n % �ator overÆsˆ^–_refresh(!fo-  «# :tocs:try  ˆ, ´Ë   eexcept? ‰continue6 Pyieldº ¾ __* oains__Â°True if theD ÿed message exists, False otherwise™9key"¢ 3len� ›” count of‘ sK  § mailbox‰ $leå7toc#Qflush"
… ùWrite any pending changes to disk} •# Maildir& ðare always written immediately, soqÅre's nothingÓ#c %o. Fpass9Olock±  @LockS  ŽD /unF U H  `it is 3 )edø X Bclos2
NFfQ and " ` P 
¿list_folderÅ	 (  )+ <
Æµresult = []W ÂAentr¢0os.E 1dir\.Å  ž0if G4 Q) > 1Ò  ¡[0] == '.' \e  8 4   ~ isb  ÒL )w  C À 0.apŽ(' 7[1:ìŠ ( é ¥× ",  b ©Å�instance # q nd< ± þ« +A ,),À        factÿory=self._factory,
  ácreate=False)
& ð def add_folder(H ",  !):"  K A"""C< # a õ# and return a Maildir instance representing it."""M  path = os.
 Q.joinx  ._ s, '.' +g )6 „result =l (- ó 
6 m™ Ñ ` z G ') 'A eif not­ yexists(. W - 1ÿos.close(os.open2  ,U ’O_CREAT | nWRONLYÀf0o666)– ryÉoremoveÌóDelete the namedmÿ, which must be empty»0Àfor entry inè plistdir ~ 
 Õ, 'new')) + \ú P ?os.? 	[cur')Œqif len(‚ d) < 1 � `[0] !=qëj  raise NotE�Error('F&ó contains message(s): %s' %Jªü  ï ¨ ¤ “  d  Ü  Atmp' .^/isjX + ý ù "ù qsubdireoP '%s' ?" %µ W  (�,× -óroot, dirs, files5CwalkôstopdownÈ
» C Û  7 @ 
   ‡ 2os.*
‚z = ”  1 	U  › T mkS  € , ¿Bclea3"""¯6oldY"tmp"œ°now = time. („$‚ X ­ = /· 5 Ô	D0w -ü F Q.geta¤   ò) > 129600:   # 60 * )36G  Š ;åÄP_coun1@ ñThis is used to generate uniqueC÷&s.{_A_tmpŒ
�ü0ileY :Itmp   ì‘¢û¤@hostŒ� = socket% Ìðif '/' in hostname:'
  ´hostname =  õ.replace('/', r'\057')6 •if ':' in1 :  Y G R :R '72R óuniq = "%s.M%sP%sQ%s.%s" % (int(now), 
 ù
 % 1 * 1e6), os.getpid(),…  ‰  õ Maildir._count,Ã ß `path =Z  
 À.join(self._ �, 'tmp', ´ 5 :try€os.stat(4 ' ú	except FileNotFoundError< 
¤ Y += 1Ü m  é û	return _create_carefully‚  + † oExists„   ( Upass
z ð# Fall through to here if é õ succeeded or open raised EEXIST.H  á ExternalClash€ 0('N‡c ñ prevented file Õ ¥ion: %s' %L  ¦  w( Ádef _refreshÉ)nñ"""Update table of contents mapping."""H  h ö&# If it has been less than two seconds since the last~ f) call©�# we haveN un= ñitionally re-readG Àmailbox justyCcaseˆ œ ’ õmodified, becauseÊqmtime()½ 0a 2® p resolut  W 7theO ð most common wor  w Ü(FAT) and a 1E @typiä ‡y.  ThisO presultsh õa few unnecessarí hs when1!is4'edJ �multiple Ñ Q 0thaÔterval, but oƒøclock ticks over, wæ wwill onqAas nÊC.  BD Ì Š÷system might be being› ó
served by an independent 9 Ñwith its own š  � p recordUL �compare 4  � Áas from‘ ª WotherJ } "'sr ¾ âskewing relati‡2our' ™  ad– K °extra deltaµ . Awaitïðe default is one Ih# on�u 'anO PinstaªAvariƒ Y`so can` adó edg@deal® aE Ðparticularly Ô …Pirreg }ƒ!if;.@R() - à ­_tS> 2 +  Q Lfact¦S  =sS ( for subdirï^ Btoc_Â€ ,    u1get °y"s[Q ]N :   1if . # >³ k 5 Ð:
             ô refresh = True
  ñself._toc_mtimes[subdir] =  	1 sif not S :  Q ereturn 3# R} 5toc r U = {} Bfor | E in % — 
l 0patÑ %   · O  �  S PentryR °os.listdir(2 )R  / pp = os. Q.join( !, B )Y  . %if- !isV S   ) ocontin{ buniq =` q.split(Ò �colon)[0]t   ­[<  ¤	° ?² 6 Àlast_read = ê. 1()
e ±def _lookup„ W, keyÐ â"""Use TOC to ç ® , gPgiven5 ñ
, or raise a KeyError."""h  :try|Jzexists(Ö ¢ j ,g[key])¢  Z   œ 5 1toc) | eexcept˜ 
ˆ Epass* 5ê(ÿ¾ q ('%ð('No message withOp: %s' % ²) from Noneµñ# This method is‰ñbackward compatibility only.Ý  ë2nexlAA"""R¿P the " � �in a one-3© iterationÖshasattrEP'_one5 g_keys'n  «c" " =â c  2 xQwhileÃ
µ� Z ”[Ê � .� )^TStopIà 
i X ƒ   > Ê9 ó

class _singlefileMailbox( %R"""A % -& " m' uÉ�__init__á ", %€factory=§ �, create=ý[  ¶ À"""Initializªj  ,   � .q 	l -fc1pen° "._° V'rb+'5 M!OS;Z as eQáif e.errno == 	 z.ENOENT(  ¸ #if   � w�  (   ;els‰     ÈcNoSuch)¼ æ ß  1 'elÄ Cin (Å dACCES,Ó GROFS³ 9   ´ ðrb')
           ‹ else:
  Uraise ëself._file = f œtoc = Non0 Ënext_key = 04 ó pending = False} ð# No changes require rewrit- @the „ .M @_synŠ R M �need to  @ ? dlocked‹   p s_lengthå  ¬ B# UsY ñrecord mailbox size
C €def add(;¦, message)id"""Add ñ and return assigned key."""O  v  K «._lookup() Btoc[! wB] =   app_… ( B 8 U += 1^ :# _?    s OK  c  66. W�# don't �ca fullÙ²e + rename,¦Ÿis enoughç6Tru` ;ï É 6- 1�cremove�:keyŒR Ô Ekeye™!; 
ð KeyError if it doesÐ _exist¥ g J3del� ¬Ekey] ¸  ¥ è!= Ü   G¶__setitem__¿ TReplaceÉ J® Å få �iterkeysâ œ n % �ator over s|ß¦yield from€.l )¨__containsf‰  ž  ò	- #s,ÕŸotherwise¥ Â /&in¨ ¡ 3lenœ — ¤a count ofVAs in
Ÿˆ 1lenŠW._toc' - 
ƒ OLockj cif notÔ  A &ed Ù_ _[ jÀ # t ( « ƒ un < 
— U ™  ¸`it is 3 )ed/if¥ 	f § ‹¨ _flush§  ¤Write any |to disk¦ O1 
PÈ  # À       # Mesû"sages have only been added, so syncing the file
  Í# is enough. _? Ð_flush(self._D )(  qpending5 z = Falsp ureturn
? ð# In order to be writ® Panyth	 Âout at all, e ‡toc mustE ralready ð	generated (and presumabl$ s#‡modifiedH  by9w cr deleŒ f item)gassert� ¸is not NoneÝ ó Check length of1  Bò ; if it's chang¬÷me other processš Dhas ± Ëömailbox since we scanned it¨ 1 p ¦.seek(0, 2¼—cur_len =˜ f.tell($ 4if ' !(  9 Egth:£  Uðraise ExternalClashError('Size¶  “ ú ) 'E  I  p'(expecÔÿ%i, found %i)' %A Á¿ ,Ý &))·1newåó = _create_temporaryC Fpath$:try B  ¦I= {}› �Cpre_	`_hook(0  S  ófor key in sorted} ºtoc.keys())w  5 µstart, stopØ‰toc[key]‹ - Ñ= 
… ' ¶  esn¶ 	 1  Ð L 0 =   Ü Y (   ®while TrueÍ    ebufferÌ K  í­(min(4096,×  7  
-ö)ü  H !ifÝŠ ¦  ' _break�  Þ"e(I l  ' ¬1 = G,F< Z_ost_m¥.  L	©jexcept÷  ª  > g.close/ ‘os.removeÁ ' Jname´ +-1_M \ 0 #ª ¬ abÒto get replac@€ no needL ¸	f ^ ‘Make sureY1new('qeq  ;qsame as# 3old# Â ãmode = os.statª'.“&odŠos.chmod,ß%UW Ið(new_file.name, Óself._path)
  õexcept FileExistsError:   ' ¯os.remove(B " àname(new_file. /, 1   % w = openW v, 'rb+'  - `toc = \ 5tocœ  ÿ pending = False @_synC 
# #if¡ jlockedö _ Ì    ² P, dot =J !)
o ñdef _pre_mailbox_hook6 F, f)W ð"""Called before writ¼ Cthe < @ to j a f."""_  blreturno oessageo beach m= p Cost_4 q Uafterß p  Bclosp
@¡Flush and "  :	06tryx A-f> (^kfinall* ;  ? +
 !   d  un e   i   3 f.Ñ p()  # S®òhas been done by¬Ã w above.clookupvŠkey=None=REñ (start, stop) or raise Keyý	Hø  ƒ0is U Y ×_generate_tocü ßif key is not=  lìï  P U[key]
 6¶² 
‘  ! 
Ò E('Noð@with• p: %s' % a) fromŸ Q ap[ôY
XA* b %toÍ ©Ï viffsetsl–seek(0, 2¬3= $Z.tellnlO‘toc) == 0. `  Õ :ing4`# This¨ QTfirstÏ ,@   ã	”Â# hasn't yet¸cì4. Ig{  g [True,@ \bs haveC x^d, sob[ mustD ; ~ ™ already.( 
².�w¢< B<  Šoé ¸uinstallWõ q  5 d se QBaseEÍ6ionÝÀ    self._fi÷le.truncate(before)
  Uraise öself._file.flush(-  ¦_length =  ó.tell()  # Record current - ¥of mailboxm ðreturn offsets



class _mboxMMDF(_single� M= !):? `"""An ( @ or , ^ Q."""
$ 0_ma= Ò_from_ = True ðdef get_message(Ç S, key^  B"""R  2a M( ð  representationz >± a KeyError~  ?   µstart, stop,plookup(l ¥ ( uQseek(8 yÀ ElineE  P.read °().replace( †sep, b''@ nstring= (™ -Å; &ms8 -’_factory(W | I\n')D A.set‡(Ì ø[5:].decode('ascii4 :msg±t °!, Q o=False½4 ¼‚ e´.û  Jebytes(½Á Q 3key™ b)).as_‚ P(unix¯ = *_)Ú : ‰@ Ù @]•/bif not“ 	   Ä C£/�"“B x
V ). 2 _-like1Xlr¬²_PartialFil×Š,å†‹_installü
]“Format a  ø and blindly write tot  •   ÿlÐ6Non}Qif is† Cnce([  ¨ r~  B  FB_to_G  „Z . )½ 3 .Çëswith(b'From '} 3new½ 4 pfind(b'÷è §  $- Z!= -1( " N #[:a ]L  . " $ =w[+ W + 1:0 À   else:
     øfrom_line = message
     e = b'' óelif isinstance(& Â, _mboxMMDFMP %):4  N fauthoro P.get_‡ ù().encode('ascii')8  # ª ²b'From ' + O * – cemail.¥ .› c *  ž @unix õ()  # May be None.x  Ú 0if & ¥ ais not& 
  * ' =3 þ X  z 
T P ÑMAILER-DAEMON*€time.asc ( 0.gm %()yr÷	start = self._file.tell("  fwrite(…  + R<sep. Sdump_Z1d ,p amangle_D ?top“ 
�return (½ ð, stop)


class –(œ•Q"""A   !ic"  '�box."""
Þ_� r = True T# All6ðs must end in a newñ  character, andR t# _post	ñ_hooks outputs an emptyD… betweenf r„_append_e – Ðdef __init__([ð, path, factory=?�, create=Î  ™Ð"""Initialize‹  6	 &    Z .Ã \  Ö ýùí  , v.™ 	” )^È (Ò f´ ÐCalled after Ž„ing each8@ to Å! fÙ •    f.-  e(ª¯³ z Ágenerate_tocu 
r G ‰ key-to-tù table of contentsv Ÿs ¡s = [], []{  • ’last_was_f= Fals–y Í v.seek(0!Qwhile¡
 ß  s=
{ 	c @read? ù ) !ifŸ.Ë Swith(x'( *    . 0en(�as) < l Oarts-  1 	
Ð  #  U .Èé -d  ¹  ×"6   OelseX `# The Œê Ñ before the "}" ewasn't½ Y  ð # blank, but we±sider it a ? (aA 0r anywayc  
û À           sû	tarts.append(line_pos)
  ùlast_was_empty = False' �elif not F :  M :if E #  ' Mstop� a - lenŸ Nsep)Ÿ OelseP A Ybreak´ Ï  Ë 1 ==Ó >sepc 
Ó l = Tru› 8 
Pñself._toc = dict(enumerate(zip(s¶!, -)8 pnext_ke§ 7 6toc÷  æfile_length =  ð.tell()


class MMDF(_mbox
 )Q"""An Ñ mailbox."""
DÐdef __init__(X ð, path, factory=None, create=3U  ÿ """Initialize ad   &    Z £._message_\ ! =• M �  , ¿ .™ 	” )È 5pred ChookÑ f³ óCalled before writing each ¡ @ to r! f) •    f.- ˆe(b'\001 4' +y	� ?ost‘ _after� ! ûosep + š 1gen¤ ¹&
#G ‚ key-to-ÇÆù) table of contents&	ò• = [], []Þ
 ^v.seek(0ëupos = 00 Qwhile¬Í ‰   õ  4 = 8 4   
+@read6 (r  ) > 
- X !   Bine.á Owith

±  G ; Äz 
�  ( õ      Ç ý 	 $    ( 
Ø  -   “ 
5   -    z}
 >    ± Ù G :       å #    ’ +   p h 
1 þ.À        selfó._next_key = len(self._toc)
   ïfile.seek(0, 2 §_length = 2 ñtell()


class MH(Mailbox):a ¢"""An MH m Q."""
 Ádef __init__— ó, path, factory=None, create=TrueS  · ñ """Initialize ab �instancec  %   Ž .j 	e õ  if not os.“ q.exists¥  ._ Š  e #if§ ô    ‡os.mkdir= v, 0o700n , Ðclose(os.open  n D.joiº  ñ, '.mh_sequences'),RH  Àos.O_CREAT |Ù dO_EXCL `WRONLYš J600)› NelseÙ Ãraise NoSucheHErroé G 1ælocked = False1add‹, messagé4Add ù	 and return assigned keyóDkeys¥  (ˆ !if  j) == 0Ø 3new+1Qþ & Bmax(L &+ 2     §  =h 
 Á@str(( 7keynRf = _ñ¡_carefully(  F Ç &Ið:tryÐ #if«z
  6 _ _û&(f_   L    àSdump_Ã( +, Y  / Áexcept BaseE >ion�  * @# Un¤ ù÷ õ so it can be deleted on Windows¹ ?  	) !_uo $ Qsync_� 6#   ¡ ·’ Ÿos.removeß F   gB Tif isðk=MHMA E  §=> �	n kfinallX P SOV u<_w½ U^ ó ,#³A"""R|@ the ea!; qA KeyÎ j¡t doesn't 		m ™é
åZ öï L v, 'rb+'�,"OS� ;as � if e.errnoÒð errno.ENOENT:
   ðraise KeyError('No message with key: %s' % ()
> Yelse:   R  $ Šf.close(L ños.remove(path)
A ðdef __setitem__(self,ˆ ,¥ )€ à"""Replace the& $ed' !; – è ñ	 if it doesn't exist."""v  Å  … ` = os.
 Q.join~  ._ ¦, str(key)Å 6tryŒ  C f@ 1penÑ v, 'rb+'/ ‘except OSxK as Káif e.errno == 	 z.ENOENTg  k 
Ý Å?Ü 0if ŒŽ._locked’  v_file(fõ  ¬ L   #osFos.o4Ðos.O_WRONLY |�wO_TRUNCw >   � Sdump_À( +, ‚  /   –sinstance* 2MHMýX /  f –sequences>  B 3 kfinall  @ % 0_un_FV b_sync_Zf?5get ¾ ?Þ 6sturn a ü ó representation or>a@	,ÒÞ `9 U  V Ž¥˜fts‘emsg = Åƒ „ˆ  % Ùqor name¤‚_list ini Çr ).'s(È X  ifö 4 1key@ 
% $ „msg.add_M (q ¢!re6msg‚ | Qbytes� y A& ?€À')
         «   else:
  ðf = open(os.path.join(self._ õ, str(key)), 'rb')C ûexcept OSError as ` áif e.errno == 	 ~.ENOENTˆ ‘raise KeyM ð('No message with key: %s' % …  Ï Ú R ­ E fx 2if é jlocked  Y _ z_file(fs >try/ ÷return f.read().replace(linesep, b'\nA c ofinallM  �  > 9_un£ ï rdef get¸  á ,3° B"""R«  a Ý ñ	-like representation or B% a–A."""b  { JÕr;s_ProxyF y�iterkeysC)t n % �ator over�s[b  & ñ(sorted(int(entry) for  á in os.listdirq ´
« ­    T Õ.isdigit()))
Ê Á__contains__] G°True if theÎ %ed¼ÿexists, False otherwiseï �3 �	¬ 3len§ u” count of› s? ± mailbox“ @len(_ÿ .�Û	' €  
x ALock_ oif not} ¶.ÁŸò '.mh_sequences'¦+fÉ[ 
'  Î Ped = Ógç  U€é  bit is L 	XÕ
	Í�  ž
§ ±_sync_close� &
$ 3del\ @ ÑW š " =—ç QflushW 
ÍñWrite any pending changes toü Idiské ÃZ ± 
Z Fr Q and " M 2» X Ù  £Àlist_folders“(self):
  õ"""Return a list of folder names."""- µresult = [] ðfor entry in os.E 1dirh g._pathn  u  if'   0.is* 1os. Gjoin7 ,W )?  C ˆ �.append(~ )‘ rÏ $ 
 ‚def get_Ù d ,æ ^ àn MH instance ã 1thed8 B?MH(Ì { !),�  Ä  €factory=š#._ ö , create=False)È ?addÈ C< # a­ S and aÜ ÿ representing it× MÉ oremoveÌ |Delete �ù, which must be empty¿  U% =m_“’ H2ies3 Ç E \!if•& ö= ['.mh_sequences']W Þ2os.ä 
 R +, ; )d +elf W Fpass´ :lsev  raise NotEƒError('FÒ"ot(‚: %s' % s ’ €  · m˜ k Aì D<'€-to-key-Gô dictionary to define each P 	¸º ˆ!{}~  Mšwith openMÁ SP, 'r'Fúcoding='ASCII') as f5pall_keyt 1setÝ . (˜ †  
l¾ ,inC   :tryX      K�, contentf  E ¦.split(':'} -   � 0 = ‘ !  Ž @specz\ U ›O  0if 5 }Ogit(+  3  † �.add(int(9  $  eŽ  ástart, stop = T 0x) É xÆ  ` Â ?'-'j  P š Øupdate(range(^ ?+ 1@ `[•]Í1keyƒ    in sorted(_ 5) \‚ s  
3if B O&9 yif len(‡ o) == 0= < Idel 1 — Áexcept ValueöM À            ÿ+raise FormatError('Invalid sequence specification: %s' %
  åline.rstrip())5 ñ return results
 „def set_w us(self,‡ 1s):(  x f"""Set ð using the given name-to-key-list dic¾ uary."""I ñf = open(os.path.joiny  ._ f, '.mh” ö'), 'r+', encoding='ASCII'Ý 6tryª  ® €os.closee m  f.  ò , os.O_WRONLY | WTRUNC* @ 1forÑ –, keys inù w.items( 1   pif len(2 j) == 0”  #   …continue    €f.write(ª W + ':â      ®prev = Non@ pcomplet—n= Fals#  Ø 1keyÑ ’orted(set² Ñ   q  if@ - 1Ó   Ö , Fnot ˆ +  / ( _ = Tr  &  /'-  % Oelif| 	x ( P   u "%s…  (3 /   Oelseø Q O 6keyÇ ?   g   =|(ç g 1str± )P/\n: ¯ D '8 kfinallob_sync_r&f)]ApackÛ]a"""Re-äðmessages to eliminate numberÆcgaps. @atessN»0 = ½).gÐ\P0N@chan| E= []  0elfìrÐï0!= \ óa €.append(f,+ O + 1= Åpos.linkÌ !1 æ I%),É <  q @  Ä ™ 4= ñexcept (Attribute·Á, Permission å:   Pos.reðÁ . ±Ã 
–_os.un`
p 5= 1v‚`_next_fð + 1
        if ÷len(changes) == 0:
  ereturn úfor name, key_list in sequences.items()D  5 €old, new/ o 
%  t `if old# ^ $  (  [	 à.index(old)] =h ² •self.set_¥ (
 !)
' ™def _dump$ ¢lf, messagî Õ À"""Inspect am B MHM* ¶ and updateñ appropriately."""w  Ê vpendingy $ =u ).gµ )4 9all0 â -  |±	C µ!ifé �¥ –‰ ap. F(key±  é @elif4 P - G 0del% YÝ S ] Ø È T  v 	I
] %if�1 noµ	
.  ± 	 [k  ^ ™ ‰ ~
`	; ó)


class Babyl(_singlefileMailboxYò"""An Rmail-style1   1box7ÿ _zðial_labels = frozenset({'unseen', 'deleted  n 	 `answer K  é  €'forward. S 'ediM ˆresent'}>€_init__(ó, path, factory=None, create=Trueñ  y J¯itialize aó   &   8/._v q † › .4&{}ý3addº ñ
¢ 4Add•à� assigned²ž §   okey = ±  h †ãif isinstance(‡ ,\•  f Ð “;(· 6keyú cremoveý  b	A"""R @ theä eð; raise KeyError ¾ ù t doesn't exist z  BX$lf³™  ý  )× P__setŒ“5keyÏIå _placeæ C‰ ô ÿEd  ã #YÀe(self, key)3:
  õ+"""Return a Message representation or raise a KeyError."""C östart, stop = self._lookup(key)(  ¡file.seek(8  ðreadline()   # Skip b'1,'  õ specifying labels.d öoriginal_headers = io.BytesIO(m ¦while True ` Å « Œ e  ) "ifŒ ñ== b'*** EOOH ***' + 0sep:1not 
g  B YbreakT ½ p.write(” r.replac ¶sep, b'\n')Ò visibleù YOlineç  ª æ ñ# Read up to thev,i 5endTn� –-–ÑGtell
Õassert n >= 0; @body> ³ &(np"   �N ³msg = Babyld(ìpgetvaluô + V k ƒmsg.set_9( ë.; 4 “if key inû )
†X  (ºRV[key]N r#Amsg
Õ �def get_bY9 ,o )` X0str¬Wÿ£)90 Ç1“ Sñ(Odatañ"   ñ0¾  + 6 
; Œ: % _-like”r±üÐself.get_byteñ+s(key).replace(b'\n', linesep))

    def get_labels(self):   ò"""Return a list of user-defined 7 õ in the mailbox."""C  R ¥._lookup() 9 W= set 2forT _o 3in @ Ÿ ‡.values(¢  ¦ L �.update( ? n Ã.difference_- ^ sspecial7 rü  ‹ W s6ß_generate_toc9 G ð key-to-(start, stop) tableOŠcontents5 + s, ¥s = [], []=¶ ¶file.seek(0³ pnext_po5 00   I ¦while TrueôR3ineF Q M    ¼Alf._ˆ @read[Ì ) > 
- Ktell) !ifšñ == b'\037\014' + :sep   [  2 0en(Oas) < l Karts -   * €.append(¬ â -9    *  ¶s7 Ð q, d_
 •.strip() Ò	A6  õYþ [1:].split(b','ƒ M    * @” I    ³ 4ê  se  elK 6ine§ ' ² ¶k¦ 1not;8#UbreakÃ�ñ toc = dict(enumB(zipê¿&))E8 [;  †4 yQkey =°I <toc\ 4?, 2 _length’á  S_pre_ÏQ_hooká+, øCalled before writing@ to “ ) fà`babyl ëçBABYL OPTIONS:ñ‹  œ, +- ¯Version: 5) ? ‚Õ# Ïx.encode¦ Ë& 6 ‚ LHs¨  „R.joinL &s)­¼  Ô'  f.-!e([ Uxoessagexð each message toÓ file f."""
  ñf.write(b'\014' + linesep)
$ ñdef _post_message_hook(self, f):%  L ð"""Called after W “ing each < ? to„ 	z 0 + Ž 837'„ tinstall‡ ‚ Y 
ˆ WÒ t ùcontents and return (start, stop) 0 = á  ._1u.tell()é Qif isŽ Cnce(� ‚, BabylM$�  õspecial_labels = []N     Afor  4 inÏ C.getI (g  K &if2 Ã 
} ° .  
$ �.append({ ø - OelseG 1 s? ’ U  v*1'b 	ô 
˜ u P  !, Ä jš.encode()b 5 ,† 	× ~ }  Î` „ ûª f4 Qb'1,,î ²££cemail.².¬÷	orig_buffer = io.BytesIO f ' €generato* \  7 G! (0 W ¦, False, 0î S „.flattena,  O k.seek(L  whê?Truª  k7 = ’ P.read å  – v ( p.replacÀE\n',3
¥  ?  �`ine ==Ô‘n' or not2 R 2 Ybreakƒ ïb'*** EOOH *** J © 6 ?vis * ñ? = Y U ýmvisibl× = ÷	    ¼6 = Š ú	 1 { B þ C  6  ( Æ	Ð    while TruOe:
   ðline = orig_buffer.read /()2 ðself._file.write(, ð.replace(b'\n',  Osep)C !if! A == 0 q or not §  º Ybreak“ Ÿwhile TruÝ  Í Û  ¡(4096) # Bï ù size is arbitrary.d  z !ifŸ S ¡ �  9 ,C .ú$elif isinstance(message, (bytes, str, io.StringIO))˜ ? 2 
1  ¯ �warnings.	 ”("Use of c ` input+Ýdeprecated, ". J `"use B« 0IO Æ sead", D9 BionWl >, 3$î 3 = 
 ›.getvalue”æ ;str ” L 2 = —s;A_to_Td
� §body_startŽ Afindê‰\n') + 27if 6 ž- 2 != -1o‡ J¢ &[:@ ], Ü   O ñb'*** EOOH ***' +a —	° < ‹ <O Ù :Ú ?elsÞ ì ö !t thasattr94, ';'>if - +  Ž iˆ text mode 3s‰†a binary> ”1À 	K G‡inal_pos0Ktellº�first_pas(  Â	H Ù	 [\ s`  Gñ # Universal new9 supportä ! �.endswithàrà¸ \  , ! =Qr[:-2] +Ë	Ç  ) * . 
Z ÷ /  * X 1X  : ¹À linesep))
   ñif line == b'\n' or not *:
,  ßif first_pass#  ) $ � = FalseN  + ñself._file.write(b'*** EOOH ***' +� Osep)D ÿ
message.seek(original_pos3 Oelse¼ Ybreakk Ÿwhile Tru6  @ ‚ @read (z /if\y   ð # Universal new] ™ support.¦  - Ñÿ.endswith(b'\r\n')ï M =`V[:-2]lZ /el\ Z 1Z ´ Z 
[ ð ™ô	raise TypeError('InvalidßÁ type: %s' % (ø)V wstop = | Gtellð return (start, 0 ²)


class MÊs(email.^ . Æ3"""  ä + ñbox-format-specific properties."""
ÓÐdef __init__(¤ ,Ü S=Noneb  Kô """Initialize aš ‘ instanceT  )   Tif is /, Æ 	 7    … “._become_ñ  (copy.deep	 P e 9 t Ê  -   ] Á._explain_to¼åÉ [bytesS ¹ 	ò a_from_< Ä  m ?strk $ostringl ÿ io.TextIOWrappey % ¿w thasattr 0, "%"ã $abinary0R Tè@ is Ô
û	¡Y.)")�î Jˆý"""Assume the nonã„state ofÅ	• ­ð _specific = getðattr(message, '_type_specific_ ãibutes', [])
  Ãfor name in > ¥.__dict__:&  - "if) 0not- 	` 
*  . EselfI [b =] =b  
h ðdef _explain_to(B ,2 )b ô """Copy format-ã ” state to3 ñ	 insofar as possible."""m  £ Öif isinstance;MDr  - ý
return  # There's nothingˆ 3to Æ .k FelseÂ P ðaise TypeError('CanZpconvertÈ Ú 0ed ló')


class Maildir© ( ± 3""" T with- (¡properties¤ .Ð = ['_subdir'WAinfo	 gdate']»z_init__¸S=Noneš  ÷ ô """Initialize až ² Žš  0    	.„ � = 'new'¶   –     ¥ € = time. (ùs /._¸ )Ù 3get} Û 
Í R” ™ or 'cur'¾ 9Å \ s\ ", j
d 3Set  k $if( =' “ S    � 
‡— # =? ]·CValu¸"_ rmust bež w 
s: %s" %X U_flagsT€as a strdAthe / Ù that are seth ý t p.startsW('2,'Q 5	” 0 O[2:]ö 	æ'º’ Á ,ž g 0"""¸ ¹ Rgiven! ò and unset all other‡ —   ‘ ”  Ðñ2,' + ''.join(sorted(w )M@add_ ‹ Š 1(s)�out changf�  ¦ ` %s(Š !etm . @)) |•Ÿ )Ÿ oremove¢ U.ø [ « “ ì Ì -Ì  ]  Uþ 
e�delivery ' 4 of�,5àseconds since ï YepochÉ	� E 
u  ~ ð , date):
      ñ6  """Set delivery date of message, in seconds since the epoch."""
    Etry:   aself._O €= float( )% úexcept ValueError@ ’raise Typ ò("can't convert toU q: %s" %¸ Á) from None
g Ðdef get_info(‘ )d a"""GetÎ ì @'s "* Ù" as a stringå Pretur Û  + g sg  6*fom  f ;m h  àif isinstance(i ,� Q b  0 =  ô   Felseê   N'0 … must beí  Mr' % typw &))â ¢_explain_tL,$— ð"""Copy Maildir-specific stX$to4 € insofark‰possiblek
5,Y Mžz  å & .ŒQflagsô. )~0 fsubdir1  2  Î0  . /elÂ Ÿ_mboxMMDFÄ © f = set]  (^  ¾ `if 'S'  
ð ! @add_# J('R'0if "ñ Ÿ == 'cur'Q OQ /'T” DC  FC FC  RC AC <Kðrom('MAILER-DAEMON', time.gm ©f/MH 4?notPsequeQ{'unseenó  P6L repliedM  ÆM  §gM A_BabylD^olabel(AýI Ydeletñ  º‹J oanswerK PÀ            ó   message.add_label('forwarded')
  óelif isinstance(7 2, M@ %):+  2 Epass Jelse õ)raise TypeError('Cannot convert to specified type: %s' %S  d   ( ˜ ó))


class _mboxMMDFª ( ² 3""" ` with . P- or 3 -† ñc properties."""
‰ _r _# ò_attributes = ['_from']+ ôdef __init__(self,yS=NoneŒ  Ò ñ"""Initialize an‘  Œ ¦ ƒˆ  2    S A.setu ö('MAILER-DAEMON', TrueÌÊcemail.Ù.o š  h @unixØ $ =À T.get_ (e  . 4if  @ is â î E and p.starts|‹('From 't  J 
à U F[5:]r ² .h)‰ ²  Å ‰m �"""Returnˆ¡tents of "• i" linetr, › xb Š   , m �_, time_ð 9Setf Á, formatting,`append C 6 if	“ "ife n
z"  
  kc =I 0.gm ×Ï ’ += ' ' +) 1asc*   _”  ." =%‡Olagsˆ�as a strû @he f/ Ù that are setÿ ’ñget('Status', '') + Ž  (X- ” ¹ e ” ,q 
# ®’the given! ¥ò unset all other( Q  ¹ =² ( #¤ _ G, xs A = '½ oH !ors p in ('R O0%if# U ã	d !+=/ c  g   < q.remove´ ³ f† D† F A‹ 
ð Œ  A á''.join(sortedº &s)¼ :tryçreplace_header9+E ¡except KeyÀQ   OM ’ ²	ó • Àeader('X-Stañtus', xstatus_flags)

    def add p(self,  !):  " ñ"""Set the given  õ(s) without changing others."""=  R A.set` Ñs(''.join(setm %.g P)) |   )Ÿ aremoveB 5 ¢ 9Uns¤ 0str’  L « Qif 'S!P' in º { or 'X-   ( â -â ³_explain_toâ zmessage‡ Copy mbox-™ àMMDF-specific ÛSe to : ù insofar as possiblešãif isinstance(6 ­, MaildirM€  ì  O1s =Å ø ¿ô *  MOH4 
3 ! q :Ýsubdir('cur')G FG Ã/'FC  AC RC  RC SC  DC TC 4delÝ ['ïIus'].	" /x-$ õ maybe_date = ' �"lfŒúrom().split()[-5:]’?tryÍ [ ð(calendar.timegm( P.strp	 („ ,À   ú	'%a %b %d %H:%M:%S %Y'))¬ ñexcept (ValueError, Overflow _x Epass• /el&_† �(Ý Öa |(© 	0  ‚]  . ’ /MH‹  ³`R' notÿ8 ê pPseque={'unseen° yL repliedM  	M  Æ gM 	(&	" J ‡_BabylŠ^klabel(‡À       if 'DÛ' in flags:
  ùmessage.add_label('deleted')- _if 'AJ manswerK Cdel x ©['status']m 	" -x-$ óelif isinstance(N 2, MÏ )é Epass` Jelse õ)raise TypeError('Cannot convert to specified type: %s' %S T  ( ˜ ó ))


class mbox¥ !(_ 3MDF ¶ 3""" Q with3 -� õc properties."""X #MH4 ( M /MHK  ¸ _¸ _n ð
_attributes = ['_sequence±ÿ ôdef __init__(self,ÛS=None†  Z õ"""Initialize an ³  ÈÒ  ,    M .q  € %å .{ %)
œ 6getD ¡ 
“ õReturn a list of â ô that include theÙ 	¦ r@ ­ 6[:]ƒ sƒ ,f 
Ž 1Setj � $† ! =Ö (Ó  ð ” 
“ 5Add®  
› #1ing» ‹	%
­w W, strm  õ0if z#  ¹Õ 
» 4 ! u.appendö Çúy  € must be¨ óÿ[ QeremovelT
R, WAfrom=]!:tryš µ  9²except Valuú
H 6- å£explain_toÜ êÂˆ"""Copy e ¼e9/  íÿofar as possible-6 “, Maildirùu  Ê · ¦1set¡ .û) 2  ÏaunseenÔA 
 * ‚ .Ç«ubdir('cur\< *  ˜ «;('Sb  ²   ?ged³ Àsage.add_fla‡g('F')
  ùif 'replied' in sequences:'  2 ÷message.add_flag('RM óelif isinstance(. Â, _mboxMMDFM@ )Z q õ = set(self.get_ .()³ ¿unseen' not¶ O·  Ù Jelse•   Á ï 8  < 	g<!‰:AÒ ‰/MH‚5for÷M‚«(	 ±Ž _Babyl‘ F s"Åslabel('L´  þ Ü S �answered—Epass‚¡ðraise TypeError('Canõconvert to specified type: %s' %S  ä   ( ¸¸))


class ª(²3""" R with+ -z ñc properties."""
} _f _#  _attributeí1['_Aò s', '_visible']9 Ádef __init__&#, £W=NoneWò """Initialize a– ¨ ¡’ u| Q = []«    ‹ 3 = G (. .œ )½  Õß ¿ 
± òReturn a list of * t on theê 	µ r3 ¢ / '[:-3setÓ p ,S 
x 1Seta w p ! =° (~ ì  $ { 
z 2Add’  ­ 
fd W, str]  ¸iB"3lf.ÍÔ r.appendÔ ç„� p must bxcstringz†U )bremove™ ,R& /Ofrom´À     try:
    ñself._labels.remove( $)
$ õexcept ValueError:  # Qpass
 ðdef get_visible(\ )- ó"""Return a Message representation of = Á headers."""]  k r? = ` .n )„ s„ ,U 
� Set theŒ $ Ý } $ =F (À � dupdate¨ ¶ 
‰ U! ° and/or sen?ÿy generate a set3for4I in ž g.keys(t  L+if/ ©    
E ‚replace_™( ,j [ ]4 ? NelseU 1del4 <= æ
Ê à('Date', 'From €Reply-To   CC �Subject'é  iü =not/´ 		° ! =È  ±_explain_toí2, mî™ ð
"""Copy Babyl-specific stð$to2 ð  insofar as poseãif isinstance(h “, Maildir)x  ˜ßs¿ t¡ .µ *()Ä°if 'unseen'(% !y .zÊsubdir('cur'M <  ¹ * »add_flag('Sb  ¯ —forwarded² R or 'i È b Pb  ianswera K RK  _deletJ TJ /elŸ_mboxMMDF;2
B'RO®  Ç9 8  Ý0#D‚  J Å$AK {/MHt;?in pPseque³	À if 'answereû d' in labels:
  õmessage.add_sequence('replied')0 Àelif isinsta# 8 ‚, BabylMF )` $ ÷.set_visible(self.g )d  › 2for¬  µ - ¾ (`  0 d  À & ( U ¹ ´ Gpassõ *seÓ õ)raise TypeError('Cannot convert to specified type: %s' %S  ´   ( (É ó ))


class MMDF¥ g(_mbox 
3"""" Q with3 -� õc properties."""X “_ProxyFilÜ ò"""A read-only wrapper of a file=  µ Ádef __init__ÊÓ, f, pos=None”  ) ö"""Initialize a s M  #   à_d E = f$ ifT @ is W 
�3 0pos2 h.tell(ì°/ Apos
d  Ç  ð Ã OsizeÁ  ƒRead byt> °   rreturn Y F Cize,  Ì . )k 1l I1m 2lini/, Ü 	 a ) 	‘Ý  8 t  så OhintU�multiple€ œ Z  ±result = []«  4ine
2 .´2nd(š  6  !if �  R ­V -  +& o-= lenK   & O J<= 0�  "   UbreakÁ Vª c__iterJ=¿terate over& “while TruÂ s    þ " =‹ …   # 0if   » © ¸  0 Qyieldƒ ¹ v 
µ R0the¿_ition]	�Cseek< offset, whŠ*=0c _Chang_ #if5 Z == 1Ý  ­ .i.l V._pos<# 
‰ ( �4 Bclos…Â    $+ ˜ g  £if hasattr'² 'A  ' :tryÝ   < À._file, 'close'):
   ùself._file.close()' ~finally< Fdel < 
5  def _read( €, size,  w_method„ q"""Read$ È bytes using/ A."""Y  ¸ "if, zis None’  j U = -1/  ‚ Ø Aseek’ V._posà ˆresult =s (J # F Wpos =î W.tell)rreturn P �_enter__} 
ü ùContext management protocol supportþ c  � 	a 3xit` g, *excf  , Ô   ŽLable” a 7* )r Owrit> * >  ‰> * > _flush· ' 8 •@property å¡,áif not hasattre 1, '9)ATrueU œ? E2, 'q F FFalsG [ ¹| ¿d€ñ__class_getitem__ =  \ñ(GenericAlias)


 ð _PartialFile(_Proxy ü A"""Aÿð-only wrapper of part !a  Šï  DG__inx�f, start=˜  !op d  !`"""Iniˆ Yize a– 	è¢ .f �{  Ÿ ƒ £  q DAstop "opD ¾ ½   
  RÅðthe position with×rpect toç 	° ³· _ # -4£ �  Ýcúoffset, whence=0“ VChang� ,™ 0sib©™ @ or ò 	¡ #if] [ == 06üÞª  A š 6 = [)elU 2U %op™ X T  AÔ Äf9p, honor|ÿ N andH`remain% 
 kã5posã 6if . <v38b''2  x ÜÉ )5< 0 >U q *  Å¡ V À return _Proð
xyFile._read(self, size,  ñ_method)

    def close( !):   ¢# do *not*  ñ the underlying file object for partial 's,G ñsince it's global toM smailboxE 2 ¡if hasattr“ @, '_l 'œ    @del Û . 0


Ê Q_lock p(f, dot S=True> q"""Lock¦ P f usË  % Pf and2   qing."""” F Ñ_done = False 6try/†if fcntl  ¥ 	#     ( .g f¦  ’LOCK_EX |G . 1NB)j  6   úexcept OSError as ep  % ñ if e.errno in (
 ”.EAGAIN,  ECCES CROFS  A  ñraise ExternalClash| !('À :.ù unavailable: %s' %· Q  jf.nameì  ) ?elsá    ˜ e  ifº ’ 
1pre'ò = _create_temporary(Š A + '¡'” ? .6
! ¡)“ôeturn  # Without write access, just skip Í+ =  [ , G  . …os.link() Ü/, Z = m º» ¡(Attribute’Á, Permission ÒPos.re“ ¡ H·^os.unE ÃaExistsÏ 
Ú ,Ê JmoveÊ 
M  ) -Å?dotÂ/Úw ¬ ó °"UNH  · Ö|U   ý  ³ø  uno A"""U Ò Î Áif os.path.eÒhÞ Ú 	å¶ðcarefully(path):
    """Crñ%eate a file if it doesn't exist and open for reading ð	writing."""
    fd = os.- `(path, ’O_CREAT | DEXCL ÁRDWR, 0o666)B Atry:	  O areturn{ N R'rb+'* gfinall. ðos.close(fd)

def _crÛ ¡_temporaryF )a A"""C 0 a ! ÿ �based on ¾ ä  Ì ù ª q äcarefully('%s. A' % ‚ °, int(time. E()),ô  ø  ÿsocket.gethostname(D  os@ dpid())1Æsync_flush(f(òEnsure changes to,Àf are physic‹ 7Fdisk.K ±ðif hasattr(os, 'fm "')Ž ó 1os. 0(f.‹:no(˜ Þ2  À ïŒ 0, e¦ š%ll¬ ¢ _„ ñ …fFö
)


class Error(Exception€ 0Rai. ðmodule-specific e4 s
F ÓNoSuchMailboxS  % O CThe A Bed m* ‹8 noŒ woœ2be àdg otEmptyb "is`  7 ó@deleê Ù was requestef ßExternalClashk ðAnother process cau,Qan ac\  F8ail¼ oFormatO çaappearƒð have an invalid£1matO 0"""h2cap6 Phandl¨á  See RFC 1524,  
iDt os
 òwarnings

__all__ = ["getcaps","findmatch"]
hólineno_sort_key(entryØñ # Sort in ascen;æorder, with unó 8 áies at the end’Bif 'c 'H  & ÷{0Dtry[+ ]< Felseb, ð1, 0


# Part 1: top-level™rerface.Û ÷ (Î B"""R•Aa diÉ ary contai6¹  » }@dataQ!.
Œ  à5 ðmaps a MIME type (%óll lowercase, e.g. 'text/plainü`to a l›&ofˆ  ;‚correspoi!toG Œ  6`ies.  ‡  < ” Ácollects all¼ (  OW that  Afrom( ”available^ K  ´ ` FEach• ÿs key-value pairsc  Qwhere� @viewÒ@comm…’is stored< %Pkey "( "fŒ ®Q = {}� @A = 0 àfor mailcap inó listmailcapfiles():
  6try   £fp = open(3 e, 'r')1 êexcept OSError< …continue- zwith fp& ó	morecaps, lineno = _readp  £ 4(fp z ôfor key, value in J Y.item×  Ê `if not3  ,  r 
ˆ  $   r[key] =W »   Oelse4 @ +@ preturn  _

def‚B"""R, a$ ƒ of all  ñ
s found on the system."""« ñ# This is mostly a Unix thing, but we use= ñ	OS path separator anywayK Ðif 'MAILCAPS'3¦os.environ ? 0str$ [7 ]J  <Ã 1s =s Ñstr.split(os.E "epÛ
e … OHOME�  \ Khome‚ 4 ~ 
U  4 ñ # Don't bother š’getpwuid(Š  '   _ ÿ'.' # Last resortÜ [- S+ '/.ò •', '/etc/ 8  ]   Z'/usr$   Ylocal Ô RS Ñs


# Part 2:Ùqparser.mLðnIad a`S and ` Àa dictionary9õ ed by MIME typev�warnings.	 +('r  Ž0depæAted,~0get­ instead',3  D4 BionWa 2, 2› < ?, _+BNone) É  0 
|\	Ø/
Î FEach- ñmapped to an entry consistingí÷A }Aies;Ø »P will8 #taôç than one such´F §if a given�  ‰  ar&r? cE UXp.E Ì � ·   s-�@pair�r� tl b, wher ] @viewï @comml’is stored… # Pkey "( "~ Þ ÇQ = {}” rwhile 1µ H @` = fp.‚  Êÿ  q: breakE  8 �# Ignore “ AentsQblank”s* i¼ñ ne[0] == '#' or# �.strip() '“  _ @nextˆ ! =< ^ a# JoinÛ@inuay! € ó @ B[-2:‰ K\\\nv % À.readline()
  õif not nextline:
 ‡ = '\n'
,  " ! = u[:-2] +/ ( ±# Parse the)  ð key, fields = p%  P ( )& � ƒ(key and1 %):!  � …continue !ifl Qno isÐ JNone4 z  ['o Cno']È %noE  Z  U += 1 ¢# NormalizÖ 5key @typeÏ Ökey.split('/'Î ñfor j in range(len(2 )Ñ   [j•  v.strip(L  ”= '/'.joiH g.lower& r# Updatª ydatabas( G zin caps!  Ò[key].append(2� ;elsT3 B = [/ ]Rreture ,š\

def÷‚ 2"""4�one entry3áa mailcap fileW áa dictionary.
q ðThe viewing comm;Áis stored as�¡value with  
"5 !",D  4  ¶qrest of$ Õ Ò produce key-F Ppairs§  2  � .D 1""" 8 2= [ i, n = 0,  fX whÜ Ri < n …= 4, i' ( , I ; * s±  @ ñi+1 # Skip semicolon¡  2$enäF < 2€ g D ,  2 À /!, "=œ4[0]Ø&[1 "2:ú ½  # {'= !':¨}S     I U „  ½  ‡.find('=V0if 20.  Ð• ^     f²#= œ  Ìf? M[:i]€ 7 K › ^[i+1:) 1if M #in"
¨ ¹# Ignore it§ Epass    :[Z  'Š 0 ¯ ˜ sl <� €"""Separ* v
Ù �’.Ú‘start = i| Àc\"[i :²if c == ';'‚     QbreakL   %el) +\\*  7i+2, �" º k[´ Ôa, i


ªpt 3: us8Ê2.C |`match(ë`, MIME¡,
=Ñ ýólename="/dev/null", plist=[]ë€"""Find X@tch ü  ãdÌR=€a tuple í4ain¢ Þ Ù , ¸ +H "pused; (¿ð, None) if no mañXtch is found.  This may invoke the
    'test' command of several matching entries before deciding whichE áentry to use.
 1"""   ñies = lookup(caps, MIMEtype, key)* R# XXX¨ ðcode should somehow check for» ñ needsterminal flag.E    De inµ :  é $ifì       ² = subst(e[ò], filename, plist¨  1   1if 8 7�s.system( j) != 0c  2 rcontinuy v{ Hkey]‚ dreturn¸", U  `None,  _

def{=% )« «![]7%if¨ S º*  ¼ . 
  + " [ÛD    ¢.split('/'R % =p ¿s[0] + '/*'‹ 6 ifm 1notÎ ![eeE : 2n eÖ ó “= sorted( Ï€=lineno_ _ß›) ˜q_fieldõ3=[]¢#°Actually, tÕñis Unix-specific0rs'=Ñ, n = 0, len(o y¶while i < nAc = $ Á[i]; i = i+1U  ÷@if cß6'%'3  k== '\\   U O:i+1Y   & ¶   "+ È   Jelsel N J §  Ž §  Q  a  =  g   %el9 sÆ   3 9 š@ t@ õ@ {@  Pstart‘	5  y Ê ‘Á«}K   5 Ü     ót ":iø   > 
%€ndparam(T GÔZTo doåà# %n == numberšPparts� : ÈPmulti )/*@# %F;  µ 9 Áalternating < #Ýï E sD v ù Ý D'%' AÞ2resÚ/fiù á  0 =  €.lower()ë=­ ª §  ¦ Ôp�…D  Œ …if p[:n]E Ð== name:
      Ðreturn p[n:]
  ñ''


# Part 4: test program.

def 1():5 ¡import sys  caps = get
 !() Qif no$ ’.argv[1:]=  v Pshow(- ,   ‰ ; ñ
for i in range(1, len(sysJ C), 2ˆ  8 0arg}  b[i:i+2Ü   !if=  & V) < 2„   öprint("usage: mailcap [MIMEtype file] ..."©  8 ­   0  = i &[0€  B   1 ñcommand, e = findmatch$, O ‘, 'view',ˆ ‚ [D Ò 0No ; ð er found for", Ô G Oelse= ÓExecuting:", f 7  ñ  stt¯os.system(% úwaitstatus_to_exitcode(stsV jif sts“  n ¦RExit H  ™ ? ›N< 0 MÏ ƒ#s:Â \ fn]Clistò" C(): : ‚\t" + fnŸ   {Paps: Áø. "} eentrie  L @ckeyGasortedü  ¤  « ¦ % ×   +   c ! =‘ [ i L eI & K  ; 
‚ eT    ; k;  & 
8   Ë ú"  %-15s" % k, e[k]F ' ò)

if __name__ == '__main__'[  sñ ()
"""Guess the	µQ of að .

This module defines two useful functions:

gK _ñ(url, strict=True) --   k Âand encodingx DURL.L  extension(V R 	*  }† a givenÓ ò.

It also containô ¡following,8 0tunˆ  ñbehavior:

Data:

known½ Í  Ñ ±  ð to parse
inited! Àflag set wheðit() has been called
suffix_map3 !diL€ary mapp‹ !  t$o  
1s9 0 
G6 , 7

Fâ Þ !([ó ]Óõ 9 a ,)Wault 3À(on Windows,%
 & ðvalues are taken from$ ñ registry)
read_mime` s(„ ‚ "on?", -7 a Mpor Noneï#

O$os
  Y ”posixpath qurllib.ç R

try?¡ ‚_winapi < À _mimetypes_ð(read_windows_registry
except ImportError:
    _mimetype, 9  Â = None

try2 iC ° winreg as m ?regc + J ±__all__ = [ƒ ð"knownfiles", "inited
 PMimeT› "",) `guess_®     L ‘extensionA   = 5add;  d  C ,  s+  suffix_map% ”encodings  �  ccommon@ F
]

Î â P/etc/h .< h  Yhttpd  ˜ ¢# Mac OS X; Oconf@ 	‡# Apache9 a 5 	 € 9 - 1; 2< ; 2; Ÿusr/local¹ 	, Élib/netscaper *  aJ‘ /1.“ ž ý  = 3z 0]

Cåed = False
_db+u
class ¿8�"""MIME-Á datastore.
R FThis ö can handle information from ª q-style ;F pand supäòs basic determinA 0of …  … N a? qname orE PURL, J  … Må a reasonable Z† given aS .A 2"""Õ `def __*…__(self,m òs=(), strict=True)& wpif not 8 &ed  Qnit()f    T . I = _ Ü_default.copy; é 8  5 
 <ÿò = ({}, {}) # dict for (non-Ú â ² B G_invF Ø G Aext,©R) in b ƒ� gitems(9ì(j ,²!, eb 
Ëe $î  È [&inú
ÒÃ ˆ() 1ª  AÌ  * Ò d>ñ"""Add a mapping betwe¨ Ú an4� <xWhen thãPis alŸ !y Ù,  1new   5 U Áwill replace" •old one. T  ( 5 W 4 YO …be added5 !to' rlist of� È Àsions.

    ð%    If strict is true, information will be added to
4   `list o= ôandard types, else to the $ bnon-st( A 0 . 5""" Qself.  R_map[  �][ext] =i + zexts = 2 D_inv6 À.setdefault(S U, [])? Ðif ext not in %s:  æ  _ Ñ.append(ext)
  def guess_R (} c, url,Kf=True)J @"""G/  3  9Àa file which|àeither a URL o	 òpath-like object.~  ˜ ÀReturn value= ƒa tuple ã ñ encoding) where3 ' qNone ifÅ  G  ¥� Pcan'tè× `ed (no… ð unknown suffix) aå %ngE !ofØ  4i @/subU ¡, usable fÎ ÐMIME Content-  A Äheader; and º ®  = &no !orn jname oÊ ¡program us«4 ðe (e.g. compressÃ µgzip).  The…  mappings a0¸ £driven.  EOe% 6cas? ¡sensitive;
* Àfirst tried 6  . ,Í n…  %in ò6TheU ¡.tgz, .taz5Q.tz (< : !!)É 5all]  â ð'.tar.gz'.  (Thisntô -ô @ too¿0ing¡ C 0dic3aryŒ   . Q!Op  2l `µ ' argumentŠ@n FaÀadds a bunchõ commonly found,o  bu›<[s4°url = os.fs8F(urlçascheme¤  =ªðlib.parse._split�
3 2if 6 ¦ == 'data'Ñ ë €# syntaxÁ    ¸> #   š `  := "  :" [ mediat ñ ] [ ";base64" ] ","5 k 1 A:= [S "/" kö ] *( ";" parameter þ C  }  
 ‹ ‹*urlcharg > ò:= attribute "="k/  Â î esý¶"text/plainÖ }  êaƒš.find(','©  if«jma < 0q @ Q# bad! o	�   r ç ,  	" Isemi| b;', 0,p † . />=†  ø I  [:' ]g  º 4 
5 `if '='…) dor '/'˜  R 'l'ˆ  =  "Ð       # neveór compressed, so encoding is None
  õbase, ext = posixpath.splitext(url), Qwhile, õin self.suffix_map:&  Y V   , +C V[ext]n )ifk Â sn  " =S  + V � † JelseÜ ^ * =JAtyper ‡  e[True]„ Ù " 
b ureturn  Ã ,ÄI "elK §.lower() i5 S 7 ][ ostrictI  D7  ³ OFalsžüšþ ‘ð
def guess_all_extensions(),Í", R=)X@"""G: 1 th_: € for a fu 2Ñd on its MIMEQ !.
{  rR4Pvalueå‘a list oft pngs giv d �possible\ 6nam¸ q, inclu5 4 1lea Ødot ('.').  T°  v 5not’ ð,guaranteed to have been associated with any particular data´ Eeam,L òbut would be mappU  ˜   `~C' byˆ  '()$¢Optional `ˆð' argument when f£Ð adds a bunch@êcommonly found” Ánon-standard’%s.´ 5"""  ‹ ! =" v s! =µ2.3 OB_invBP.get( V, [])¤`if not5¯ C Ý± > V ”
W — W  ec  in” *  . Ï .¨fnd(ext¬ B& Ã> 9!8, $ng/€ $ú #g?0str+à but would be ð
mapped to the MIME type ` c' by
  `guess_ ñ().  If no extension can be & ced forD e, NoneG Õis returned.
 õ6Optional `strict' argument when false adds a bunch of commonly found,N ñbut non-standardÓ %s.  5""" Â ‘s = self.Ã V_all_ (ø ", � )= it%s:  6é 
  [ 2[0]�def read(† ¤, filenamev f=True)a Å ðRead a single mime.± �s-formatL ð, specified by path_ …#Ifá Â is true, inB  â@willã1add2ë @list�
o0, e´Z$ —A ¬ Ÿ¦with open(öencoding='utf-8') as fp | E.OTfp(fpE)k$fpm" g-P�jhile 1,‘line = fp1  (ä Mè  
:   UbreakÌ  @wordO 0 k.splitP  ñ i in range(len(4 )à I   1if  Þ[i][0] == '#'†  + 4del, ):]’     ¬ Û c V vcontinu¿ E  ¯�, suffixeè = C[0],~ 1~  ï  /  ò    7 l ²2addde Q'.' +k Âó_windows_registryÑªÍ	JLoadõòs database from W[  [ Û„éË_  ? -ad"� and not  :regŠ ' í‘ v m
H ( ‘ = lambda…,,:h" \Qext, ä} °# AcceleratT0unc'` if it¥†availabl ?if  Ð:
           ð _mimetypes_read_window °gistry(add_  3)
  Pelif ) Ereg:   _self.H 3 Á@classmethod Odef ; Ucls, ˆ s  3 Aenum   s(Ê 6db)   “ Qi = 0a     ªwhile True*   >try   c$ =÷ ƒ.EnumKeyt 6, i /   ïexcept OSErrorW Ybreakž : /lsœ    ñ if '\0' not in – Z  . Ryield% d ui += 1
 EwithÞ @OpenÞ åû.HKEY_CLASSES_ROOT, '') as hkcÛ àfor subkeyname¦ £ / ¡ © w–  E ,d ‰ s à# Only check f¥extensions Œ  !ifj\  Ï p.starts— O("."Ë  ? �continue` „# raises% q ÿ 'Content Type' valD  ö �`, data
 §`QueryV@ ?Ex(‡  ´ ä ,| Ö ,   &ifp !oREG_SZ‡ ; ë^ Ò 	îÇ it 
5Qguess6Ð(url, strict=Ó@"""G% P the ƒ R of a9òbased on its URL.FbReturn®Ð is a tuple (? ó, encoding) wherU pis Noneø"th( . ¡ can't be ª ð
ed (no or unknown suffix) a¾  ng¡ D Aform¶ @/subQ �, usable žsa MIME e-  ² header; anŽ®  É ¢  9 %noÆ  z   z Â program useE t0 ðe (e.g. compress= ðgzip).  The mappings a ¨ ä£driven.  E;÷ e) `case sÃQtive;ð 	" E Êfirst tried 2 ,Ün %inI Î ˜ fÐes .tgz, .taz!j .tz (M !!)½ 1allÎ ð".tar.gz".  (ThisRtä -à @ tooŸ0ing‘ ± dictionaryÀ „ S_map)š !Op  2l `·p' argum0 when false/ ƒPbunch¡Pcommoàfound, but
   ñ non-standard types.
    """ ñ if _db is None:    ainit() `return' p.guess_G ò(url, strict)


def  ð all_extensions(- ) b=True)e @"""GN V the 0 ñ for a file based on its MIMEÁ !.
– R– Pvalue¿ ‘a list of• ¡ngs giving` �possibleX AnameC v „, includ0 1lea Ødot ('.').  T¨  r 1notG ñ,guaranteed to have been associated with any particular data@ ò
stream, but would be mappQ   ý   `PA' by; r  (£ VIf noM@ canL & !ed[@ ,îC 2is á#edZ¢Optional `ßð' argument when false adds a bunchvñ commonly found,\  Ò �Ac)‹á†*…# 3$ng|D  q–l)p lE p lK p ÞlJ p 5lžDg2add ,äëQAdd aÕ cAbetw"Ñp and an> 5ˆWm þƒ  Aáalready known,Þ1newl … Ñ will replace  olD5e. P  ( 1 9is O 0 n K bë!ed1 !to# j„ ¸ s¹ I„ ct° @trueóPformaY¢ W 1 toZ S 
¬0, elw S=  Ñ Ø*ÈÜ – s=)Åñglobal suffix_map,Òs @encoG "0s· >  [ 0ed,a  0 = . Œ0# sx�at MimeTÅ __' ð__() doesn't call us again

    iôf files is None or _db 3:
  õdb = MimeTypes() õ# Quick return if not supported( õdb.read_windows_registry()
$ iŽ   † © q= known 9 Oelse- � + list(: À 
7 ã 2_db� 1for1 in s` Ðif os.path.isO T )!  ® ð  © ùencodings_map = db. % fsuffix"   t~  a[True]# qcommon_ f   5 S[Fals' ð# Make the DB a global variable now that itó fully initializÙ + É q


def áBmime~ ü 2try	  �f = open! $, ƒ='utf-8'�Öxcept OSError= i ®ð fwith f  Çª’`fp(f, 0h  ‘ T 6db., " ]Ù —_default_Ý ð8¨6, _ 9 ª + ï 9, _ 1 ” ", Y Ì) û8, _ / Š ¡ / =¯ A = {)  ‘'.svgz': 	 W.gz', t =tar a6   1bz2l  6   	m x8 xˆ }µ	K Û 	 Þ Á IgzipÙ Z† ‰compress  – ‰: 'bzip2 ž 	™ @'.brI 'br* ® °# Before adQ new ì0, mœ1sur¡Òy are either 8Qered úBIANA#ñ# at http://www.iana.org/assignments/media-f Å#òñextensions, i.e. using’x- prefixa€# If you³ 0 to# ð se, please keep 1m sý@ by 2Ö .p wÛ b entryÊ  ‹ l  erÝ  X ™  �Æa particularX W “appears bS@ny o1@s of” Q same6  ý �  
 † + '0js'÷ : 'application/javascriptá3'.m/ . @json^ .   Ý { Ð'.webmanifestUˆ  +L 5 0doc\ ¹ Àation/mswordC',
  `'.dot' ù: 'application/msword* ?wiz* ?bin* Éoctet-streamZ a. +  „ 0 1dll2 0 ?exe0 o. � 1obj2 � sa 0 "od"0 )daG?pdf‡   ò?p7c' škcs7-mimeU s- œ©postscript. /ai. "ep] Ø \ 1m3u] . @vnd.º™e.mpegurl‘ @m3u86 5 /xl˜  j zms-excee 0xlbd $0 /ppt0 špowerpoin[p©5 p:5 ÿ 	Ÿ wj @wasm:ž ³@bcpi4( "x- + * Œ!x- 	*  sh| *  )shD"dvÖ~   R @gtarS )  * h« x- 	) 5Q ‹) 5¦ olatex'*   U /mi) x- ) c§ 0net , nVO,  1p12× )ipkcs12Ø  pfÖ Ø  ,  !raO„ Êpn-realaudio^ y· Š ›ython-cody‰� 1 f” f/sh= j/sw¿Úshockwave-fla_ À.sv4cpio': 'ó
application/x-sv4cpio',
   '. ~rc' : '- )rc, @tar'9 ,   U ?tcl) *clR /ex) ,ex) i* { ZexinfÔ t - OroffZ  	×  ( .  ,t+ *+ 1manX ®  V - … !me. Z 9-me8/ms. s.  usÊá   ‡ s5ªwais-sourcŠ /xsm!rdŽß ' 1wsdO 5' /xp' 1zip'N   ô &3g' ™udio/3gppA " 2k " 2E  %  Ž # :aacF   « 1adtúD ! ?loa! !as  ‰† B !auƒ ! Jbasi11snd$ † # :mp3# Impeg mp•‰ " 1opu¬ g  	iVD ix-aiffh 1aifUF $ I $ 	!raÑ  x-pn-reala{ 	t 1wav- P   » %bmu`image/ ! gÜ !   ! !ie´  ‘ !   ! 4jpg† ! j„"jpv?: '" E " 4hei`D  ˆ "heË D  " !pne Ë   ! +sv! [svg+xtû¦Š  G t‰ h " :ico4ùvnd.microsoft.iconêroR Éx-cmu-raster*  àfž Px-ms- ¢ :pnm€ ðx-portable-anymap',
   `'.pbm' ð: 'image/x-portable-bitmap',
!   O'.pg/ Mgray0 p0 <pix/ <rgbŽ   ‚ x± x©  xy xq  <xwdq ªxwindowdumû 4eml+ @mess,irfc822!?mht& N ?: 'L ?nwsL %cs& Ptext/ 14csvF   v² !ht‹ A : '   A %htÄ! %txô ! Yplaind /ba" c¤  † D h" "ks$ Ê D pÃf 1rtxh D @richÕ 	Ï tSùtab-separated-values1 !pyU x zx-pytho%e{ Mx-se{ s�  y/x-sgmlm   K#  1vcf‘ æ yx-vcardG x´ g 4mp4D `video/ 8@mpeg" 4: '! )egc %m1›"  paC  … " e" ‡ D 	oˆ ™quicktime¯ qÅI ' "we£ø  :avi´ Ax-msà 	p @moviÝ I  Ê"i- P !}
¡ð-# These are non-standard types, commonly found in the wild. ; y lK ) ñmatch if strict=0 flag is given toC ÄAPI methods.‹ °Please sort$ ase too\ ‡ _• H = _ Á_default = {- u@rtf'uÀapplication/ ñ'.midi': 'audio/  C  1jpg   = @pict\   	 'ct=  /ic 	1xul ÎuËD}


R_mime6ñ()


def _main():+ im¸r getopt‡ðUSAGE = """\
Usage: mimetypòes.py [options] type

O ð:
    --help / -h  ó print this message and exit5 plenient8 l8 p-- addih ñally search of some common, but non-standardN  @   « !s.  °--extensionp eµ v guess  pinsteadr  ; ñ 

More than oneú ` argum¶ ñmay be given.
"""
i Pdef uî â(code, msg='')) ¢ q(USAGE)2    if) :5F(msg @sys.5P )e 6tryQ Popts,˜ ²s = getopt. (< õargv[1:], 'hle',t  x   ['ÑC', '¤  ("']ž dexcepts �error asÉ e 1½ ¡strict = 1& W A = 0 qfor optÔ 0 in sï  if   @('-h™ d × z 0«   )el; l; á ¢ - ¥ “   @ e@ ¿ €  ê  Ø gY ½ :argÕ 0 ë  v ¤=¬_% (I ", ¨ å  3 bif not2 Sñ"I don't know anything aboutÙ1", S 
K DelseC Š   ° t   ! p, encod] µ  ó ° `'x 2:',	4, '™    ò)


if __name__ == '__main__'Š  ()ãðFind modules used by a scri° us÷ �introspecÉ.³import dis
  álib._bootstrapÞNrnal% ”machinery Vmarsh* oY o# ðsys


LOAD_CONST =� †.opmap[' ê']
IMPORT_NAME&  �']
STORE&   % jGLOBALM '  ) bOPS =   € , ' Ó
EXTENDED_ARGN  ð 

# Old imp conñts:

_SEARCH_ERRORY�_PY_SOURCâ  1
 ñCOMPILED = 2
_C_Y ðSION = 3
_PKG_DIRECTORY = 5$ `BUILTI" 6D PFROZE 7‹ Mðfinder does a good job at simulat&‚Python'sÐ`it can·ð
# handle __path__qPificaPð s packages makeU òruntime.  Theref´pere
# i‚ °mechanism w! aby youp €register0ra p ðs in this map forð0 a
# package, and it will be honored.

# Note this is a mapping ólists of paths.
N ÀPathMap = {}A òA Public interface
def AddP  1 (= Qname,Q d):
   £  $ êMap.setdefault2 °[]).append(Ž £)

replaced ‘ TÍ R ô6 mechanism allows modulefinder to work around
# situations in which a¬ ò injects itself uD 0he Þ  
#3wanother3 rto sys.x ús at runtime by calling
# ¸ s("real_=_` š", "faked  )
# beforeX nÃMã Fã !.
•^ 0oldS P, new	 ”[[) 4] =+ 
Q _B_Õ (C ÝS=NoneN ñ"""An importlib reimplementc /Gimp.J ñ	 (for our purposes)."""
2ð# It's necessary¾ôclear the caches @ þ p first,Ìƒcase anyK º €s are be6÷added/deleted/modified°ó. In particular,J Ctest	 Ê `er.py ug� ð ile tree conten=2n a® `-break| Bway:å /°.machinery.$Ð Â.invalidate_ñ "()8 fspec =n?  ¡ _+ ³A 0if     Ä¥ ©qraise IÇ“Error("NoGù0d {±!r}".format^ = !),#  ª a# Somem @ial ˜sý „ @.loaž ›w 7libÐ rBuiltin’ 'erª `eturn ¿ ,  ("7Ú", _C_BUILTINð l _Frozek „PY_FROZEk Pfile_¾! =÷ r.originxˆ 4.isßEKˆÞ 0os.Q @.dirg(c 6), ô ÖPKG_DIRECTORYø °isinstance(ó{ ,=±SourceFileL•‘ òkind = _PY_SOURCEÑ _elif c ŸExtensionf 
¿C_EXTENSIONh $Ë Olessi 
´PY_COMPILEDi ñse:  # Should never h–.Ÿƒ‰ÃSEARCH_ERRORˆ ² ±·o.open_codeÆW ”suffix = î‡splitext) ð[-1]

    return `file,  ó8_path, (suffix, "rb", kind)


class Module:

    def __init__(self, namN p=None, T  !):4  8 ñ self.__name__ =5  ‘    	   U :  	  2codW  �  ñ# The set of globalx ñs that are assigned to in the mï .F  is include< 3oseH `import? ²hrough star Gs ofD cPython] s^ œ  gs = {}8 Â \ CthisM B didÑ Çcould not beC ÷ resolved, ie. a¤ É from a non-¡   z   ^ CreprïB = "9q(%r" % -!,)C  1if  __÷Q__ isÄ  Ë@ *  zs + ", T 9 T  .T "9 T ~ %)"¼ Šreturn s+oFinder1 [  Ò, debug=0, ex_ qreplaceŸs ]!ifc )% ] p = sys. « d  ! => 
 õ ã ~3 ?bad ¿ " =Ç 
R  jnt = 0 é % =ô 7 if þŠ else []A 	: =  ,if P ’processedmà = []   # Usedå –ging only1msgÕú, level, str, *args­ 2 <=èO 
ÙPfor ik QrangeU .@I    �print("  vend=' 'N" Ž    o 0argq  ­ 
Œ A  Ú(arg), G ‰ )!in¾  = q &[0Ó"if>	ˆ Ú J 5+ 1 ¹ *  ˜†	› ?outœ Z-œ ”run_scrip   ¦ ýÙ 2¤1 "m- 	Ðwith io.open_ð(pathname) as fp:'
  ústuff = ("", "rb", _PY_SOURCE)+ ñelf.load_module('__main__', fp, pathname, V !)
? Adef 6 –file(self* !):#  � Pdir, > ` = os.L p.split(   Ž   \, ext, @ext( + öwith io.open_codeO f as fp‚  † ¹  ?ext z 
³import_hook6 ócaller=None, fromlist ‡level=-1. G—.msg(3, "T "D", P K !, F PparenAK ¢determine_ (@ 6 = < ¡q, tail = = ðfind_head_packagd ] Œ 7 #m 1  B (J $ eif not
ž…return q5pif m.__"*__, š tensure_P&(ms V  {² P W“|in(4, "A "= € ó r2 orª_ == 0Ó  omsgoutc @ -> Æ "\  Ôà     pv# ='0.__ (__Yã ò >= 1: # relative m)  M &ifH ‹ $ N L-= 1;  î  6 �7w!s[½ ]H  - sassert 4 #is• (  Ê <G"£ Ã
J f Nf 	\ 1if š Ò.count(".") <Í
ÈG aaise I{Error("c J› too deepÓh Á = ".".join( 0 y 1[:-X]Á ¶ P$' #™ å-#isï	‰½ @b'.' inà
Í2i =  .rK('.'t [% :[:i¹ù 0 ± &üÀtermine_pare÷nt ->", parent)
  creturn  òself.msgout(4, "determine_D – -> None"M I   
H ðdef find_head_package(Z Š �, name):/  ”    w !inv > Ä : 9 ‘if '.' inR Q  U 1i = .O F('.'´    ž " E[:i]S   Dtail Fi+1: Jelseg H D %"" #ifo
A qâ = "%s.%s" % (m0.__ @__, e ¿ … D  ( p Aq = Zàimport_module($ !, 2 ‘[ Jif qŸ B  N	Ûd@(q, 7)L  J ›  £ ,  G ! =}	 å ! R é   í + B ñ Y qraise I™¢Error: No ¢¶#d"¤P4 +("4 B " +Ú)ŒPload_›„Œ1  ƒ ÖtUm = q Qwhileø
5 | s | if i < 0: ) @len(- ê  I } ! =b  ¦ [” . m*
Em@1 	N :, m’ Šif not më  M Þ"e 
b  L æ> ‚ ÄžÊ ¡m!ó ensure_fromlist'4m,  ß, recursive=08 µF ?", B ò pfor sub¾j 
[!if  j== "*"  *�œ "  &  alË »rall_subk's( .  oif allR  $ P ó 0(m,5 6, 1ä  , #elª phasattr( 7subI &   ?subÈ 7 } 2   Î ÐÀ.import_moduûle(sub, subname, m)
  `if not# Mmod:  . ðraise ImportError("No module Y Pd " +C   !)
E ñdef find_all_subm/ `s(self‰ k ‚ ¦m.__path__ ~ QeturnT   H U = {} ò# 'suffixes' used to be a list hardcod €[".py",  Gc"].E óBut we must also collect Python extensioný Çs - althoughG awe canVý	eparate normal dlls fromR sˆ Ê U = []W  A+= i‹ÿlib.machinery.EXTENSION_SUFFIXES[:> oSOURCE; "BYTECOD= ¿for dir in à:tryñ æ Ips = os.Âzdir(dir¾‘except OS”D  jâ.msg(2, "can't€directorU  } …continue|   Ê  –  Ë   sq šmod = Non: >  Â >    ªA  * €n = len(& 
ð      0Àame[-n:] == * L  . •  ² F[:-n   Ybreakò    ifëA and ß!= "__init__"t  p[mod] =6 U rÊ  §ules.keys(.Ö_A (@part¼ B, fq vparent)} çyin(3, "F ?", B — �Bm = V ´[| <z?Key{ Epass\ Felse«  RY ^sgout° @ ->"@  2 7 #ifNrelf.bad7–m ­"go 	Ç ifH1ent
ƒ¯1 isH è 3 { ž fpÕ"thTstuff°p	(ø7 L â í  | �W 	!",…j ©Cload9À(fqname, fp,ó pathname, stuff)
  …finally:   Zif fp   –fp.close(? šif parent. ‚setattr( ,$ t m< ÷self.msgout(3, "import_module ->", . ‘return m
ª ƒdef load. (L B, fqe  fps ò ¦file_info)¥ õsuffix, mode, type = ) c  ò  W  £ win(2, "r "n – and "fp"w ç #if` ö= _PKG_DIRECTORYŽ  k Am = o e „package(Ò ÀW  4 0 B  @ 0 D    	œ ŠY_SOURCE˜ öco = compile(fp.read()é †, 'exec'š +elW ŠCOMPILEDY +trv ‘ @dataŠh Š    %ðlib._bootstrap_external._classify_pyc(M §&{}£  J �except IvÊError as exc§  + hXraise: ×: " + str(exc
r  K ; 	Ö a€marshal.ýÁs(memoryviewÄ f)[16:]L Jelse¥ D ENoneZ O%ad%MH Am.__ô5_ ="B Zif cog "if£€replace_–s#  ä Ž 4	) ¶_in_code(co„  0  ˆ   _ˆ %co‚   G 5sca; 	 ý`  A_AbadmrDBgcaller10if  r not in; –  [9 a] = {}{  ×  ]c 
>: [� 0.__I  __K 1J E 2"-"9 : ÿ Rsafe_Q__hook ÷, fromlist, level=-1Ò# wrapper forP Ñ) that won't ú5‰  Ú Xµ 9 ", "
Vðe o'® K î ô X 4?msgÇ 1msg5a :"€fr(msg)U  � Û ƒ eSyntax·ƒ  Àlf.msg(2, "S÷
yntaxError:", str(msg))
  öself._add_badmodule(name, caller. Yelse:< ºif fromlist  ` ¯for sub in% ) 0ullr 1 =  p+ "." += 	n  ,    v 3 1in Á ¼ s‰  4   ) ê fI î  2  �continue“ ?tryx ¹import_hook_ñ , [sub], level= s� �except II Õ as msgz ‡msg(2, "9 q 0ðdef scan_opcodes(< V, co)� °# Scan the $ ò, and yield 'interesting' D Ñ combinationse  œ  : � = co.co_   ;s   Vconst   Poparg °[(op, arg) ½3_,   ÄÂdis._unpack_2 (€ ¬õif op != EXTENDED_ARG]p  \ 1i, m J )` ¡enumerate( s: ù T Æin STORE_OPSZ     M‘"store", h!s[O .],© Ò if™ ñ  == IMPORT_NAME«ei >= 2Æ  q   Êg �s[i-1][0]A  2 «LOAD_CONSTÞ  I ûÁ ­·  P V2][1]> +   y2  12 "ife œ â0: # absolute �Û T+ _+  ^� ,¶hg7¯ # relativn + n ,Ju ÜÕ Ÿ ²œ7, m‡  LZ ÙRner =k  è^ Žqor what?sÐ ' Iner( + !if*  †«Ê ¿0, =Œü =   qm.globa4 s[+ U] = 1Œ  $ (elg ¾q 
Íz €have_sta0p  t  ˜» is not Non3 )   `if "*"){ •  (   w 
ç     D ð  = [f for f in ûfromlist if f != "*"]
  ôself._safe_import_hook(name, m, F ­, level=0)C Ýif have_star:  p ò	# We've encountered an "r ÿ *". If it is a Python module,Q ñthe code has already been pars` ÿd we can suck out theO pglobal ÷ /s.$ �mm = NonB ßif m.__path__	A† €is point¡ ðdon't know whether '‡ '‹ J 2sub#Ó of 'm' or a É  ÿ. Let's just tryN  P2fulo first } :h `s.get( º ¡__ + "." +P1 C  1mã  S1j  f W 1not®[ ., M ¸s.update(mm d  ¿  m.îÀ=  = ü 0.__À/__q [´ _] = 1ÒOelseø 	¥ J ôelif what == "relativ""\ - ¡ } = args£ !ifF  è V�z k‘parent = j ¢determine_ $(méY ¤ B 0.__ý 1__,€S Bª  2 ðexpect anything 1 — Ï® generator®ðraise RuntimeError(Ó%)
’úfor c in co.co_consts˜úif isinstance(c, type(co))( AscanÚ - mm ðdef load_package(}@, fq+ , 7 
 T  ! ¸.msgin(2, "= "9  Ó 0newJ ² = replacePr 1Map¥s 1 �3 
Ð ( 3 = Q a  � Badd_ÿ(- U  
…file__ =Ý B )D = [ü ]—Ð# As per comm­`at topè V Â, simulate rÝ zÀ additions.
  ×m.__path__ =  ó+ packagePathMap.get(fqname, [])

A ÷ fp, buf, stuff = self.find_module("__init__",c )B Etry:  W B 5loaB y 
l B 5 ±msgout(2, "@ Å 0 ->| 
1 …return m{ kfinallŒ Zif fpŸ  n “fp.close(
edef ad±  Â ", · )>  M D2 in(#s#  ] š  E .! [L ]­   ÃB = Mw2 ô V m» ± ¥ P ", à Ú, parent=NoneÃ  € is not   
¿ �# assert H ' ½  å @fullo # =j 0.__ p__+'.'+ 0 Jelsed > 	*  bY d{excludee ñ .0G3, "R -> E5 Dd", l K À ðraise ImportError(‰  ! %if$!ifl£ys.builtin2¯  R Â(O ,yp, ("",  ·_C_BUILTIN)…  7 ‡˜    Q _ü Æ  ý#thG  * reç (4²"""Print a ! ó to stdout, listing the found ËP with %irá —  s, as well - ð
that are missing, or seeml b .K 5""" pž (¸ ð"  %-25s %s" % ("NameFoFile")/ @----/  / "# » ö Œ @keysQortedJÜ. (I pfor key  
úmE  cg F[key Ö'ifg
=   ¶P", end=' 'ò    m  6 m6   Y V2keyî`file__¶#""R P -×/ïTmaybeô Cany_ _ Ý ÷ M 
ô š 
ä  ""M0 } *:"&  ˆ Õ ‰v 
[  É <modØ4bad� ? ]á 8   ‡ $?"z!"iP`ed frol ', '.join(h $@í!s (Fmay  ˜tiðn again, maybe not.C..
  •if maybe:   print()  ð%"Submodules that appear to be missing, but could als ¯", end=' 'V úglobal names in the parent package:"9 1for/  . Â   Æ ómods = sorted(self.bad¾ [l Š].keys()[  < A"?",f a, "impI ð from", ', '.join(h 1))
.ƒdef any_
v )]ó"""Return a list of ‘ OQ. Use^  š ^ _ù à() if you wantŠ¥know which] &arB Pcertae ™´3and5 W*may*Ð/5"""‰ ã ,A i bŸ  2 rû 9 " +: 9Û  µ?1twoA¦s, one witì ˜3re é $lyå Š  ì 8 ü ¢ The latteqsÙK `either.s¯*or* just ÚÓ.ú  Õ d ðreason it can't alwaysY Ãdetermined iwPit's “•ssible to‘ CtellÉ äQs are+  p when "Ä 0 *"] 6don)VÃan extension3 a, shor½ƒactuallyF oing it0
U = []­ Â
 Ú  µI 5!ifœ ( Šexcludes&  * vcontinuÚ   1i =@ ›.rfind(".bŽif i < 0O Á.ü0nd(fBt 0sub. z V[i+1: • 8pkg! -:i i7S.get(6 
… `if pkgÕ{not Nonå o $ r 1in F#ÿ  9 #œ` triedz ’srt this,0 itW E andõ A  °# failed. IÓ†definite´M3   ƒTelif s in.� ò (  Z #‰ aº )Ž´': ¢  X‰ Ý Mpass – ‚pkg.star1‹ n j ]!“ t did an¢& *£ Ð  À # from a noÿn-Python module, so we simply can't be sure.
   ýmaybe.append(name)' ]else:  L ø# It's not a global in the package,  didn'tK ð	do funny star imports, ib àvery likely toÒ missingÕ ð# The symbol could3 Ùinserted into˜ @from š ðoutside, but since tha˜  ú §good stylez?lisè ?it ½ 
 ”�7 
 Vsort(âý dreturn¤ !, % 
ödef replace_paths_in_code(self, co))€new_fileU¹ = original  s.G P.norm	 e(co.co" © €for f, r^ k .† t  •.ifl .T‡tswith(f¤  0   ¬ >r +D @[len= ] 6  Rbreak"  1if ¤ ždebug andL 3"in( ’processedTÎ 	� !J 
2  ƒ € ·msgout(2, "U° %r changedK]%r" \Ò  D  =% (Ä,œ &,)± = ¨› £remains un¥ Ÿ *’ | oüÜ )Ò�consts = ×¥ ò  £i r\(-# pâif isinstance($ €[i], typ )0  K& " =4	 †' ¼ Ï$co4B(co_) P=tupls  Þ )¿{=Ù@)


ûStest(ž À# Parse commãAlineG¹b getop6try¢ opÕ0argO% . ò	(sys.argv[1:], "dmp:qx:"ccexceptW Ö.error as msg\ ’print(msg3  9þ Ê2# Pj� options° ¦2= 1 @omod› 0 0add˜B = [÷vexclude  ÷@o, aú Ü Ž  ˆ† == '-d'  • s  +{   4 m4 ™ à1
        if o· == '-p':
  ¤addpath = 
 Ð+ a.split(os. Esep)4 Bif oJ qJ Ÿdebug = 0,  x, ñexclude.append(a)
5 ñ# Provide default arguments  Qif no sÆ ñscript = "hello.py"- Oelse&  targs[0]q €Set the é Â based on syû A and e ‘directoryb 4 =- 5[:] c[0] = A’.dirname(F M= v  @ 2if L6> 1Á pprint("& ":"C  Ç±for item inÄ 1   5 °   ", repr(, )oaCreateâ Òmodule finderø Ñurn its crank› amf = M* F) (� ,° #, ×ž  š 0arg™ t61:]�  ifÛIm¡domods = 1t  È   …continue  (+ W  ( [ Q[-2:]` +.*`  % òmf.import_hook(arg[:-2], None, ["*"]Ç  .   
O    H 6 2 Àmf.load_filet , rmf.run_	$  e¦ (* 0ret”`mf  # `"-i{Àging


if __j!__û ƒ__main__6try+ËCtest\ ö	except KeyboardInterrupt2 MD\n[i ñ2ed]")
#
# Package analogous to 'threading.py' but using processes< Smulti ñ ing/__init__.py  cThis pa 0is  @ndedc dduplicÅð functionality (¾‘much of
#æˆAPI) of ™ ˜ &es— † instead+ ´s.  A
# subŠ '¸ ±.dummy' hasl �same API` ðis a simple
# wrúrÄ%!'.ï ðCopyright (c) 2006-2008, R Oudkerk
# Licen®‚to PSF u·ð Contributor Agree> X 
ð ®ƒ
from .   YEext
} q stuff & ‰% €#

__allb1 [xÂ xäCdir(% #._6 _ #) ºðx.startswith('_')]
globals().update((Á�, getattT  , ( !))‚    … › )Ì ñXXX These should=Ñreally be doc\ ó�r public*ðSUBDEBUG = 5
SUBWARNIN "25Z QAliasz  a! m€ -- will\ ð reset by bootstï øVchildg!
#´'¨ Ä  |Q å [+ pÖ c ð]ÌàA higher levelðF module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
" ó†Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]

import io

 3os

 &sy ø  Ttruct Etime eempfil óitertools

try:
    ^ _'‘
except MtÒNotFoundError8 Äpass

from .E Lutil  AuthenticasA ó, BufferTooShortF tcontextM Preduc4 õ
_ForkingPickler =  . Ø  awinapië ­ _ f ñ WAIT_OBJECT_0,  •ABANDONED ôTIMEOUT, INFINITE Im°Ö òif sys.platform == 'win32'   sQraise’ � p= None
°ð
#

BUFSIZE = 8192
# A very generous åðout when it comesšflocal ãòs...
CONNECTION_TÉ ñ = 20.

_mmap_countX!. ñ()

default_family = 'AF_INET'
 uies = [ â]

if hasattr(¢,5 bUNIX')V ! Z +[  [ _
X _PIPE'X  !]
ç s _init_\( =>Ä areturnŒá.monotonic() + 3outV VcheckW > 5> tñdef arbitrary_address(yG "''Ú R� &an1 c free 6 6¢the given D B #if ´å¯¶b !('d0hosÎ!0)D -el> ²> `# Pref2ubstract½°if possibleÂðavoid problems with ¸ È o  �  # size.  W0cod �aI Capplsps, someñl�‰Rs hav…N Àun_path as s– 	 ±92 bytes in…  Ï ‰ Q_un sw.‘ 0if  #.aá _- pets_sup˜ &ed s ?Sf"\0lù-{os.getpid()}-{next(¤5)}"q A tå0.mk •(prefix='U q', dir=� @get_& o_dir()½¯ j `r'\\.\rp\pyc-%d 5' %©  î   (í /, ì  ð ), dir="")
    selse:
  ò(raise ValueError('unrecognized family')

def _validate_ ( )O 1'''W ÓChecks if theB A is = A for ñcurrent environment.? G ôif sys.platform != 'win32' anš Ò == 'AF_PIPE'‡  Ù Ö FÉ 0 %sŠ Fnot å C.' %§ !)
ƒ {  e { GUNIX{  # double cO  ’ 0if v ô hasattr(socket,w º  , ¾ ( ¦Óaddress_type( £aReturnˆ & 2s o­. ±This can bedaINET', ô A, or }ê ¼ X ~  §Htuplyƒ  ½Y @  el6¸  ¯1stróž ó.startswith('\\\\'Þ <W — W òor util.is_abstract_œœ_namespacDf ½ Y¿   q8%r l †# ñ)

#
# Connection classes
#

 & _ $Bax â_handle = NoneÆ ò __init__(self, & õ, readable=True, writ S/ # =8 .N qdex__()ø  #if O < 0Î2"inY "F  %˜ õ  š Y Ž  ’   Ð"at least ones`[ `\ `Y `` musté ’  1.W² h  T % =R" g % =e�ò# XXX should we use�ðFinalize instead½ ¢a __del__?= Ú Ù³ Á5elfº !is~ 
DÂ cclose(ýW ½_ d] Y Ä"OSU"9 ÍT "m Go   ª % 
Æ m c8!isroe-onlyu  šu 
% u  ¨ t ÿbad_message_lengthx  é t   ]  ©… = Falsen
Û 1 àclose()
      ñ%  raise OSError("bad message length")

    @property ñdef closed(self):  ( ó"""True if the connection is3 5"""/ preturn E €._handle) ONonex �readablez 5 | ! v Owritv 5 v ! v  VofilenoÜ  óFile descriptor or 0oko Zccheck_²)~	Š . ‰  CøÝr -ifÏ@not Ó' +:try   °  d (©   ofinall3 =i Æ ¡send_bytesË ð, buf, offset=0, size=œ 
ÄASendä ; Ñ data from a  È-like objectý ¿ o úå öm = memoryview(buf¡# HACK for€ ð-indexing of non-• wËñbuffers (e.g. array. L �if m.itemü J > 1†‡ <&m)@ 0n =&(m #ifSJ < 0O bSValuee} ç™negative"J 3n <N J í  � 5gth6 
N å !is
P  S= n -o  elÅ?izeÏ G ?is Í  H ï +kJ > n†  Ö  A Ý Oá"m[l : 2 ]Â ^ - ?objó €a (picklë)à<° �_ForkingPr �er.dumps(™ ³ IrecvÁ2max›· ÂqReceive-s¿$as½Ø .. Â"2Â Zž àøU and ¸ UM6 ùSbuf =ea 	N - ÿÀ         seló
f._bad_message_length()
  ñreturn buf.getvalue()
 ð
def recv_bytes_into(self,. Á, offset=0):.  P 5""" �Receive = ` data B ³ a writeabl ×-like object.? ˜ Óthe number ofL Fread) t  ž ç._check_closedê   C  ‚  ö
with memoryview(buf) as mß  ã R# Get‰ 0ize• �arbitrary5ferÃ  / Pitems) D= m. 	"  "   † * len(m¦K fsJ < 0•   praise VÁÀError("negatƒª"O 5eliQ >Ñ X O « too largeY ’result = qBm ± / [.tell! iñ <ü  + 8 § ó BufferTooShort(\ Ù
2# Mù can fit in dest¡E jseek(0A   N Ü3(m[5// Í¬  þ  (4 Ú ') < ]o  
¢—
ˆ€a (picklî)f35?bufç]�_ForkingP‰ €er.loadsa sb³'()uApollÓ Ë, timeout=0.h€Whether  ñe is any input avaið p to be Ÿó 5r/Û¨ ¢ ¿ ‘__enter__Ä —= Àc__exit- ¢, exc_type
 � 'tbJ € â ­Â
if _winapi:Y öclass PipeConnection(_ GBaseO %  F öbased on a Windows named pipeˆàOverlapped I/O’€used, so¤ð handles must haµeen createdq†öFILE_FLAG_OVERLAPPEDi ­ ¤_got_emptyâ‚ = False f Ç�@, _CH‘ =8.  @ / B "._Í ó $ d Bsend,' 'L ”ov, err =° .WAFile4 [ < 5, oTZ=True>try[ðif err == _winapiÿ.ERROR_IO_PENDING:
   ÿwaitres = _winapi.WaitForMultipleObjects(>  Q ÿ[ov.event], False, INFINITE)5 uassert z ù = WAIT_OBJECT_04 nexcept» ®ov.cancel(d YraiseF ~finallyG únwritten, err = ov.GetOverlappedResult(Trueh Ä 6 *= ´  \ Õ == len(buf)
— údef _recv_bytes(self, maxsize=None)¯ 0if $ ú._got_empty_message(  “) " =¡…  ,   °return io.B� +IOV?elsf  b« ” = 128 if¼ @ is ¿  5 S min(Õ ,) 
F | /tr˜   $ov–š�ReadFile-¡._handle, ˆ ,Õ  D  	oæ=à9 ž  ! "if7<t <   |& F   „ 5   ¬Š Œ	 0   ”    œ	     ¤    ¬    Tnread± :  ¸0<%   ?f = !   f.Mþe(ov.getbuffer()ñ4 yf½&el­ eŸMORE_DATAÃ b Ðet_more_data(aœ¦ åÏ OSError as   Ë    Q.wine( =¿BROKEN_PIPE© A EOFm  NA 	8 S qRuntimeW ü"("shouldn't get here; expected KeyboardInterrupt"®Apoll{ , U >out£  ¤ 9 orŸ  : ØÊPeekNamedPipä›)[0] != 0q  B á ÃÐ
            óreturn bool(wait([self], timeout))

  ðdef _get_more_data(- õ , ov, maxsize):/  6 ùbuf = ov.getbuffer()!   ¬io.BytesIO ª.write(buf6 ñleft = _winapi.PeekNamedPipe” É._handle)[1]p qassert A 9> 0 $ifÆ ñ is not None and len† $ +; ð 
ï  ó  û._bad_message_lengthÜ  47errÆ zReadFilÁ ,p  cÚerlapped=True rb?", P „ov.GetOv1 ~Result(7 6 = Z 1 ==‡ 	.f�
Ý™ ^öf


class Connection(_ 4Bas91"""f   : ñ&based on an arbitrary file descriptor (Unix only), orK ’a socket ± (Windows).  r 	 $ifQÕóBclos–1, _ ñ=_multiprocessing. h 2 
–p  -_á Q Fsend' Oread& Arecv& Oelse· "os© £ ""osòp ½ – 0os.
 )2 ½ ò q, buf, æ =í |  remaining `b^  whÜ ¶Ø  v 2n =P a éi }^ E-= nX  D 7if | := 0c  # Ybreak5 Ìwbuf[n:]í  „Œ  ,  ,  =_ ì > ë˜"= ; { © `  ! >Ç qchunk =� (V  � 
- V å4 
 @if n% H  K OÃraise EOFErr˜   
¿   9 !OS8 Ã("got end ofü ur@k"º $bu¥×  9	'ufã Ð_eé ’é =  Ÿ7b> 0x7f 0  Ø �pre_headeústruct.pack("!i", -1Ë + ZQ", n* E ² (d 	# À self._send(—header)
  æself._send(buf Yelse:* ù# For wire compatibility with 3.7 and lower8 v ö = struct.pack("!i", np  “ Êif n > 16384|   ð0# The payload is large so Nagle's algorithm won't be triggered
C  #¯ ðwe'd better avoid thà ùst of concatenation.Ö  K <å 
Ï # 	_  c  ÷ # Issue #20540:„ �e before ®sing, toµ ­delays due¥ #& "þ on a TCP socketÝ ð# Also note we wantJ %‚ ÿ a 0-length buffer separately,‹ A ñ"broken pipe" errors if~ò other end close“ ) ¥ ‚  +‰ !)
| ðdef _recv_bytes(. ö , maxsize=None)g0buf¤ 4 &(4Î 0 , Â'unÄæbuf.getvalue()4 0if 7 f == -1g  ãk 87     8 o 0Q",Þ o Ù  @not à ä O $ >ø 
‹ areturn, 3    ..?(B TCpollNwtimeoutI r = wait([B 4], # a ð
bool(r)


#
# Public funcnô
s
#

class Listener(objeck 1'''Q RÂ Ss a l(  ( .@Thisóa wrapper for a boundþ` which& 'E @ing'( b Rconne• 4, o@ ÑWindows namedÈŸ˜ }s_init__,qaddresszƒ, family òbacklog=1, authke W/ # =8  ‰ (Q æ T_type A)) \Ã  × ²or default_U # D 4 = 
  +“rbitrary_ (6  W “_validateQ "     $if· Ê== 'AF_PIPE'‹ ."._€eEEPipeü| #, *2GJ SäL É T 
$ifˆ 	O  ³isinstance(¯!, d± ø °raise TypeEã#('. ` shoulz Š0yte uUÆ 1 =� Ö ^aaccept\w €  ð Accept a connecó%tion on the bound socket or named pipe of `self`.

  ðReturns a `ConnecL •` object.' 5''' 0if F õ._listener is None:#  ] ø raise OSError('- …closed')0 ;c =T †.accept($ w zauthkeyn ódeliver_challenge(c,S 0 J  ž Oansw/ r#" c5Adef À ()† #Cá � ’   D 165if % ois not‡  ¦ «=# C  u D .× )è ‘@property,  ö |addressø 
h #._. M Rlast_ä/edS 	4 Y  ˜ Ÿ__enter__G 	. 3xit- ¢, exc_type
 Cvalu 'tbÜÝ 
v sClient(ç �, family=#, s G Ûqcp1 to-M  ©Ca `L_`‚@ h # =q  ã7 È ‘ î¢_validate_7 (  $ifD Æ== 'AF_PIPE'Ñ •JPipeê < 7elsï * Sr, » $if *§A and´³isinstance(8s, bytes: ¤MCTypeO* Á should be a5 ƒ string'Æ{ ä [ é  } \& ã @c


¨öys.platform != 'win32':† XÇ(duplex=Trueë é z -@pair3¢ð s at either end$ aí–  C O 2if t  # `s1, s2ƒÄ.= t ) Ñ.setblocking(¹ i ! 2! Vc1 = iÆ(s1.detach()p J c� ) 2)  
† 7 pfd1, fd= 0os.öÃ � 1 ïwritable=False‰ ˜fd2, read1 r1, c2

¡   4ö9À either end ³of a pipe
  5''' óaddress = arbitrary_ µ('AF_PIPE')/ ¥if duplex:  U ðopenmode = _winapi.9 é_ACCESS_DUPLEX2 2accw 0 åGENERIC_READ |G  YWRITEB ‘obsize, i ´ = BUFSIZE,	 . Oelse° uINBOUNDA  ã ± š 0” T 'h1-õCreateNamedPipe(& z £%, fùFILE_FLAG_OVERLAPPED |? a+ QFIRSTÚ¯_INSTANCE,3 ÄÇTYPE_MESSAGE™  ­7MOD  H JWAITg :1, Å,÷0NMP0 _ zFOREVER= ÿ.# default security descriptor: the handle cannot be inherited¦ INULL ÷-h2­?Fil¨+7, 0Ð 6ULL ÚOPEN_EXISTING× ®ÙA « A 5SetPH	KStat³ &h2T Ñb, None  ¨overlapped%Vonnecƒ  (hî* V=True`–_, err = L U.GetO0 zResult(6 bassert: E= 0
’ c\ IC† 1ion€ ’writable=Ä€ cà1 y2, read1 c õreturn c1, c2

#
# Definitions for c} ñs based on sockets
#

class S òListener(object)¯© Representa^  ÒI ó which is bound to an Áa and lZ 1ing» R `def __¯ „__(self,5 ó, family, backlog=1Ž  Œ + #._| =Î . ’(getattr( I )g2tryÙ  K   ð# SO_REUSEADDR has differenØpmantics8ñWindows (issue #2550).Ô  I   úif os.name == 'posix'p  ' Ã @.set® 3opt¶ «.SOL_SOCKE­ ;   C 8et.Ì 6, 1ø  8 w ‹blockingÔ+ Sbind(ÑR ç(´À)
          ó  self._address =  socket.get
 ƒname()
  õ except OSError:   O  5 xet.clos9  ! Uraise3 / ’family = 	  plast_act ¥ed = None
$ #if6 ò == 'AF_UNIX' and not util.is_abstract_› _Ó cspace(û )È „# Linux 8  8  8 As dob õneed to be explicitly unlinked¨  ü î  " =œ ™Finalize(* . R, os.1 t, args=° ý,), exitpriority=0A ²:lseà ‹ TBdef m($ #s,‘ ( .Y.< | ös.setblocking(True òreturn Connection(s.detach())ä � H g � ?tryÓ ¨{fgl2 Yõ 	G#ifÊ1 isî )
w «"._@ ¢    P()


Ô SbdClientÔÞ 1'''… R5a c t object z4theŸ£given by `×`J R `3 =  F_typ+ CwithN .L¢( getattr( ,q†) ) as së	#s.Æ í o  " #
# Defini"Ts for Ñions based onœñd pipes
#

if sys.platform rwin32':[òclass PipeListener(_ˆ œ :   Representa‰ W of at Ï 3  ê __» !__P,{ , backlog=Sr  j  ë•¯c $ òhandle_queue = [: Bnew_ q(first=w]÷  =   + Í Ž 	h BÃsub_debug('l,‘ created 2¢ D=%r'' îu Ð !._È@ize_ç_Œ ,²  h ,ã 
$� E\ Í[ ^ ", a[FalseÆ@flagSô_winapi.PIPE_ACCESS_DUPLEX |  õFILE_FLAG_OVERLAPPEDz  Ò  é Ìo    h /|=L  aFIRST_y ðINSTANCE
            ûreturn _winapi.CreateNamedPipe(
  ýself._address, flags,& O õPIPE_TYPE_MESSAGE |k  wREADMOD  L OWAITo öUNLIMITED_INSTANCES, BUFSIZE	 g 0NMPe _ …FOREVER,µ MNULL; %)
 °def accept(*%):  H  ñ._handle_queue.append- S._new 9()): 4 ? = C  Zpop(0/ :tryz  ~ Eov =É vConnectêb p, overl– jd=TrueX  exÛ Þ OSError as eh ‘if e.wine$ !t ÞERROR_NO_DATA8  ¤ Yraiseú   )# ; ò can occur if a client has already cß .ed-ð# written data and th %is6 ù -- see Issue 14725.– ?elsú  w Á 7res|þWaitForMultipleObjectsl :   ú[ov.event], False, INFINITEŸ - £^®ov.cancel(8  < ·aCloseH§(0 ®ofinall� c õ , err = ov.GetOn~Result(t 6   bassert> 9= 0�Æ ³Ù5ion» + Õ@staticmethod  ´_µ ñize_pipe_listener(¥#, ðÏô	util.sub_debug('closing > T with< F=%r'I }  Ú Bfor gA in s Àœ	N  Ç (³ 1''')  s R÷a)Qion oˆ Ped to ³ given by `Y `L X tçÇinit_timeoutjzwhile 1Û 3ì  )¢y [, 100ð Ó h{ 	Ç?FilÂ  , K j €GENERIC_�¤ ^WRITEK K 0 ßOPEN_EXISTING< ~ öFILE_FLAG_OVERLAPPEDI t { 
•ùœÀwinerror notÿ in (_winapi.ERROR_SEM_TIMEOUT,
  
A ÿPIPE_BUSY) or _check_timeout(t):U Yraise Nelse, Ubreak( $ H ! š õ	SetNamedPipeHandleState()  è 4h, 0 Ä òREADMODE_MESSAGE, None 	9 ) preturn g ðConnection(h)

#
# Authentica £ stuff
#

` ð_LENGTH = 20

CHAL uE = b'# “#'
WELCOM  “#'
FAILUR  õ#'

def deliver_challenge(c  “, authkeyœ±import hmacÙ óif not isinstance(0 s, bytes7  Cº ValueErrora"²key must be? ,^ õ{0!s}".format(typf "))`úmessage = os.urandom(;) Ú a.send_¥ (A3 + K / �digest =ñ F.newß ( ’, 'md5').+ (8 prespons‘ r Crecvr @256)  ä# reject large� _K "= d ú\ Î öŠ 
1 1  ’ « ’“´'ƒ ò received was wrong')NOanswMµ/¼ ½dassertÐV[:lenje)] == y GÄT%r' %8 m$ = [M !:]' �¯è HN † - 5if K 3!= «ÒzAsentv5 edy B1Supœðfor using xmlrpclib  �serializa [fclass Œ Wrapper(obŽº !á__init__(self,Ø, dumps, loadæ #  ._$! =* ™ U 7 " =?  L " =T   ¼ Aattr�ð'fileno', 'close	 @poll Ž  É'Ë  …   �obj = getV ì ,  ð )
            sÐetattr(self,  ó, obj)
    def send   :   @s = 6 €._dumps(   elf._conn.A †_bytes(sW ArecvW )R 9  # 9 8  v creturny AloadV 
ª G_xmlŒ X 0 ¢xmlrpclib.­  ® Š,), None ö1).encode('utf-8')
^ q \ E –method = f ) 9.deK È ” ôobj

class XmlListener(	  Ú laccept/fglobalu }cimport £.client as 5lib* dobj = r .h $ ® ñConnectionWrapperþ  u, ú 4AXmlC~ ã(*args, **kwdsÚ À ¼ ” o š ú ¦ ñ#
# Wait
#

if sys.platform == 'win32':
 ‹ó_exhaustive_wait(handles, timeoutÝ  ¬2# R®CALL ( ñ which are currently signalled.  (Onlyo C ë Öing the first0 ð might create starva£‚ issues.p I uL = lis°  ¥ready = []v rwhile Læ >    reò€_winapi.5öForMultipleObjects(L, FalseU  D 1if G ê= WAIT_TIMEOUTh  ( Ybreak: Belif5 ±OBJECT_0 <=M < w+ len(Lˆ R    { -{ F e �ABANDONEDh  k 2 n .seû �raise RunPöError('Should not get here'ÁÛ @ady.˜šnd(L[res]!    6+1:é ;  h uout = 0Ÿ u ü_  _e‘  {	úERROR_BROKEN_PIPE,  òNETNAME_DELETED}P  L@o:_œ5=—Á5'''›  y€ till anªTect i
 G 2 isº /´ Rable.t  î ’s“ of thoseH sI ¬ J yP  K   š $if ‚  Ã 
Þi…INFINITEÕ Þ  ?< 09 ¢,el=? d= int( Ô* 1000 + 0.5)À  object_lisðt = list(object_ 3)
  õwaithandle_to_obj = {} !ov0 U = [] Pready, ¶ects = set(R  T  = Etry:  … —for o in   
"  & 7     òfileno = getattr(o, ' '•  *   þexcept AttributeErrorn  + ù[o.__index__()] = oÉ  5 OelseO ð# start an overlapped -î of length zerT  X ÿ   òov, err = _winapi.ReadFile(	¾(), 0, True B !OSO as Æ  - o ÀNone, e.wineI /   !if¡ 0noté_ö !y_3 s. 5   _raiseW S =õ ÿERROR_IO_PENDINGZ Ö.„_nd(ov �  v.event 4   t# If o.š; isRpipe @O andþ I õ€= 0 then !reO HTomessagEG i<  x ÿ, but it HAS NOT been consumed...Ž Pif ov° ÿ sys.getwindowsversion()[:2] >= (6, 2)�” C... –Bon WL ! 8a ¿later, wher× G Cthe Ó 
Ï Í  = s
 !   _zuov.GetOÚ¿Result(Falst ?   æ | 1   úz - 0if z 4 uand has)³_got_empty_''› Q .o.8 ! =`Sôäs.add(ov`timeouº)0
R F  ]À_exhaustive_«(  Ð“.keys(), T u kfinallŽì# request that«is stop’ ¿v×VÚºov.cancel()Î  # ¯  C >allm /top "àtry:
           ö_, err = ov.GetOverlappedResult(True)
0 
 ýexcept OSError as e:%  + \ `e.wine+ % !if„ ánot in _ready_/ sV  Z ]raiseO K ÿ!= _winapi.ERROR_OPERATION_ABORTEDY ýo = waithandle_to_obj[ov.event]o ‰ ¯ Þobjects.add(o1 ) œ O== 0~  % õ# If o.fileno() is an o—b pipe   _ then” J ÿa zero length message HAS been consumed.C óif hasattr(o, '_got_empty_M /')Ê  „ .o.4 0 = U
v ðA~update(†€h] for h$3 sn‘return [o* o* W ‘_list if  >  ’s]

else:� òimport selectors r# poll/ P have{p advantT0of ¾ðrequiring any extra Êë Ð# descriptor,}Átrarily to e` Ðkqueue (also,b "y R ’e a singlñ¢# syscall)»§£ ³ors, 'PollSÉ ©T_Wait & =í .2 ´  Ê  9 N  "or51defL(iƒç, timeout=None=1'''q  g  Ÿ Q tillúXÊ!s Å/ Rable.t  ? R!s ó’of those … sI �which areP  K   š Ywith  ()ýv
 ®;objs 
$  b > �.register2,—¶EVENT_READ)ç  : $ifP ( ‚ Wb ¡deadline =0 á.monotonic() + :out[ Qwhile©O  uy9.Â (Ü� ¤   "if_K   r±Q [keyø 4 <a(key, z s)Fx …
¥ R   0 Á 5 = 2-2¨6  n <ã	 0 ô Ò  

#
# Makeõnection and socket¼@sharí Éàpossible
#

ifò.platform == 'win32'q ŠÐreduce_connecÓtion(conn):
  �handle =  •.fileno() òwith socket.fromfd(2 , uAF_INET öSOCK_STREAM) as sl  s  E õ
 . import resource_sharerw  * Lds =! Q.DupSŽ &(s¥  . ð return rebuild_Î  ecñ b, (ds,ß ƒreadable @writ J ?def?  = 8 3 Ö  Ç = ds.detach>• BConn� (- ( /, Y  Aredu¾ ¦.register(E  7 Gduceå !)
7 Ã  8pip! ÷Paccesaú((_winapi.FILE_GENERIC_READ if7¡ else 0) |n  w H UWRITEI >I y D !dhíö ADupH™¸ —", ¸ 8 b÷ö  ühík .‹ K 9;D 0(dhq98  hÛ!¡ FPipeÂD• X :   
B  “ è0)

¥� Ö '  ô ƒ  ,dfz*Fdv# ¦Í n J U  ifi? 0(dfÑ d fd`f`\/fdL X:  7 -#)
©$os
 %sy  thÀZing

×0pro_ Õð


__all__ = ()

#
# Excep°Âs
#

class PG eError(! ¼Dpass) ø BufferTooShort(8 .  rTimeoutW ,  Authenticaœ 3  È ÐBase type for?ðtexts. Bound methods of an instance Bthis8 ôare included in ,æof __init__.py& r 0Conh ’(object):Ü ) =O
7: =  $ -8 =    ! ? =   “ ƒcurrent_"’ = static( .' ‚/pa; 
& Ð)
    active_ôchildren = staticmethod(process.active_' ñ)

    def cpu_count(self):   ñ'''Returns the number of CPUs in •system'''7 –num = os.Y )  ifH † is Nonel  p øraise NotImplementedError('cannot determin� Vcpus'a <elsW Ä  w ô Managerò 2a m$ ó associated with a running server c^  É 4The> "s ˆõ s such as `Lock()`, `Condition()` and `Queue()`0õcan be used to create shared objects.. ‡cfrom .Å Ós import Syncý 6  ¯ P(ctx=æ.get_context()c†m.start( rcm UAPipe^ß, duplex=True]�wo connecÖ  Îed by a pipeß 7 á  y Ú ˜   (‡ øˆ è – óa non-recursive lockœ ˆ ´synchronizej _ ‰   _-  <R' š 	– '\ j  ©  ˜ ¯ œ ,=ÇAcà8f ¦  (‹/, §8  H„Semaphor‰value=1® s/ ® d v T (w ¯ vBounded9 f? ¶ b6  ¾ "s Å   Ì ?EveP
@an e# kT ¢  »SBarrið°, parties, !onÄ‘, timeout $bH · { ¹  (Œ ‡ 1ÐQueue(self, mÃaxsize=0):
  õ'''Returns a queue object'''% afrom .  s import Q, " rD  "(mh ñ, ctx=self.get_context())
7 Ádef JoinableM (+ #, > ¦ 3	a w  ø ® 	 ¶ HSimp´ O1T §  (RCPoolI÷processes=None, initializer …args=(),v  ! …Ñtasksperchild1 è i _ pool> < ¥ p �  (J )es®   © 	™ ¸ ½ #  l}ƒRawValue/Àtypecode_or_ 0, *s õ osharedï  cI 3q û  (. ƒ 1�RawArray´  á Â íÂ aP îÁ ~ Á   Á  � Ï €¿, lock=TrueÉ Âynchronized ¸ ˜† Ô  Ñ  •  š �û1óø7 3, *w â–   ¥  = % freeze_suphé
ùðCheck whether this i¾Ãfake forked Ið in a frozen executo.â ð If so then run }ö specified by commandline and exit? 7ñif sys.platform == 'win32'9 âgetattr(sys, '“ x', FalsÙ ÁoTspawnn
¿ . 	0^ vÐlogger(self):#
  õ.'''Return package logger -- if it does not already exist thenF åit is created. 5''' òfrom .util import get_m % r‹  1()
 0def™ ñ_to_stderr(self, level=None):)  × @'''TÒ  on4 òging and add a handler which prints to W ² 6log‚ o µ 	 (™ ½ ñ
allow_connection_picklingÉ 
½ ±Install sup)€for sendÉ B sÕ usockets� öbetween processe Û `# This´�undocumen¹0  I: ó	evious versions of multiT 5ingo ñ# its only effect waORmake � ö objects inheritable on Windows/#ê ‘set_execuE ;&,  
G SeÚphe pathãó a python.exe or w °binary used+ &ruÝVchildQ€ instead0sys> � € when us¨¦the 'spawnðstart method.  Useful ÞÁpeople embedçP© h½'\ ,
6 
 ()
Sóforkserver_preload[Ímodule_names]  l &  &  =0try  H F in ^ Eó‡°really just¤6int$ ü R L ê  Æ 		 (ß  tcontext´h#ifÍ I „ƒ ‡ ©‰ :try% `ctx = Pcrete	  x "s[']: ú except KeyErrorF ±raise Value P('can´Sfind Ì  ‰c %r' %· !) K º g ðctx._check_avail­%() Ô :ctx/Û_´ 4ò˜none=Fals¡F  .]M  ÉM  Z ,Ã cP  ÿ Aset N ò  ´1conk'¦‘@propertyí  qbreducek
þÅControls howß‚will be 7 Ga± Ñm that can be]  ôshared with other8es.òrálobals().get('d  H¾  ‘er.setterg Ä Àf, reductionC):
  õ
globals()['reduction'] =  
, ÷
def _check_available(selfL õ pass

#
# Type of default context -- underlying òcan be set at most once
#

class Process(p S.Base  ñ_start_method = None¸ r@static  Ê TPopenP C_objH  ƒreturn _½ _½ D.get 3().€ .._K · Dþ Cý (¶  n D $ =â lq_init__d,+8  ¦  |.¤ $ =* ë ( dactual¿ !%  Û  Y ", 1=Hu #if 1 isdI l 0if > +._o -  1 . =E €­  5   ¤@ ( Jelse  6 iuper()Ñð )�9setU‰( Ú, force=False “  .1not2P and  B   óaise RuntimeError('~ð has already been/%')í šh d    1 ^  ,` 7  > H  �HŸallow_nonE �
36if K 
 Æ yË   ¸ §yž
ãf._name> ö 9allBsû .úys.platform == 'win32'É x •['spawn']Ê âDs = .  , 'fork'] žo €darwin' J " [* -, i  3&ifú.HAVE_SEND_HANDLE±  / Š �.append([ gserver¶ ) Þ 0 
A(` typesmq fixed J„L
#

Ô !C'ARForkP=õE  Ž 	²# ==K   O   C 
pfrom .py_’� import @a  O  ¯ ¤`Ó SÔ Àt_method = 'ƒspawn'
  Õ@staticmethod õ	def _Popen(process_obj):!  > pfrom .p& _V á_posix import ? 	1 breturn 	X 
' òclass ForkServerPz * S.Base Š r_start_Á ‘ = 'forksA æ >[ å 0€Context(×  × DnameÏ É  ! =( ?SßO [ µ\ E ]  œb 1g O l  W  €÷check_available(self" ( úif not reduction.HAVE_SEND_HANDLE² 3 ÷raise ValueError(1 L L Z ~ "')f�_concrete	  ÀQs = {À ^ M !':ž$&), s!: b! 2F + }R öif sys.platform == 'darwin'ø ð# bpo-33725: running arbitrary code after { ð() is no longer reli}p  á ó# on macOS since ñ10.14 (Mojave). Use ì õ by default instead.M _ LB = D, ð   
o!['X 1'])G Felseí Q # ù  P 
M X �§�ˆ§ M  9i:_win32„,Ü h…Ì " =È !K ×Å#X p])

#
#€ice theÓA
#

[Yforce:(õ`ƒ €._actual� õ0 =  šC ]‚ C¾Q that‡ `curren @reade± �s child j ¥ 0_tlX th- ²ing.local()¿ 2getqAing_€(¸ b€getattr(G ð, 'spawning_popeñn', None)

def set_spawning_popen( Ê):
    _tls.  1 = " @ VasserC C(obj; Nif g] A) is€ `  d ñraise RuntimeError(|     ú%'%s objects should only be shared between processes'A ñ through inheritance' % type² ™.__name__8 ñ)
#
# Support for the API of Smultiu àing package us qthreadsE * ñ/dummy/__init__.py& ñTCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [
QP(Ã', 'current_Æ   àactive_childre0’'freeze_s!','P'Lock1 R	 �Semaphore  Boš d ”ConditionC QEvent. `arrier AQueuB RManag 1Pip @Pool$ ‚Joinable, � !]
D Im® v!
i  ýdeading 4sys tweakref ðarray

from .connec®  J  †  Ü æ  !, 
%, ô ,, ? ,Ä 2, B0 q† ô í  Ýpclass DP×(� !.Tƒ1):
" ðsÐ(self, group=ƒ, target   ±args=(), kw #{}â Ll .a \  , W  , G O )›  K  ’ q._pid =" �3 = ¶¡.WeakKeyDi¦Lary(N °start_calleW [FalseX  pa; = &()6G 3û i>Clf._B nis notG ê æ î $ ""P” ½is {0!r} buX  HÚ{1!r}".format5 G   UP ,œ )16Tru0¡if hasattrù 6, '-  .& [– ]çKv‹‘@propertyÃ Ï�exitcode‘ | œD 1and£  §.is_alive(7  ³ �return 0d   KelseÄ#  7ˆ}) =Œ
U& =�. ù + &()1ôÊ·× ðchildren = curreônt_process()._children
    for p in list( !):  ! ÷if not p.is_alive(  ! 4 Ñ.pop(p, None)? \returZ ô

def freeze_supportS qpass

# ó
class Namespace(object}  D ó	__init__(self, /, **kwds#  œ   ñ.__dict__.update($ ¡ F CreprF ; ritems =
H  "()å  g ‘temp = []V    W°name, valuea6 X & \ ) ÷ .startswith('_'‰  )    e ð.append('%s=%r' % (= f ’ !.s[” �q'%s(%s)= Ø kP__.__N à__, ', '.join(w @))

D0 =  
,ÏóArray(typecode, sequence, lock=TrueÒ … a1 . 7  #)
þV=úx mu  ?ë + 4 =   " C " =¸
 ‘@property  5% x×  b Û G ? . .setterC  ¾C 
Š  | /__±  '<à‘r, %r)>'%^ª ß` , ¦  é¤ef Manager˜[ Äsys.modules[+]„shutdown2 Ê ¯ SPool(~0es= , ¹wializer sargs=()Sàfrom ..pool im'p ThreadR G—  h 	c   ^ ñ)

JoinableQueue =   ró Analogue of `multi· ðing.connection` which uses qF �s instead: qsocketsR E v/dummy/K 1.py( ñtCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'Client', 'Listener', 'Pipe' ]

nÎ m�

familie[¾$]
žLI ¡— öœdaddresþR yù“backlog=1÷ J‘ _– ª( )\ l bacceptäDC¸/(*W  @.getÊ¹ \closeL 9  ! =é† !ñ I • P  I  Ï o__ente’ = 	. x@exc_Øà, exc_value, e“xc_tb):
  óself.close()


def Client(address, ô_in, _out = Queue(),	 M / `.put(() q, _in)) õreturn Connection(P v óPipe(duplex=Truex Oa, bs V  . (),h @b, ac Xclass ‘object):
¡  ø �__init__(¾ ò Š  1  .Ý ! =<   in *in qsend = <   `_bytes* 0out0
/ Drecv/   / fin.get± Cpoll­ ·timeout=0.0¯ "ifv ö _in.qsize() > 0þ » F t‰ 3if R o <= 0.3 UFalse4 Fwitho šnot_emptym  �   c.wait(n .– 0 ¿ ¸ $ õ Fpass# s__enterÖ' ÷  = 	. xe.Pype, 
 Cvalu CÓimport errno
 $os
 †selector Uignal Uocket Ftruc y5 ”threading* ówarnings

from . y cp sprocess tcontext6 Aredu¥  ësource_tracker [spawn ðutil

__all__ = ['ensure_run² ð', 'get_inherited_fds º ƒ_to_new_° %',nñ   'set_forkserver_preload']

# ð
MAXFDS_TO_SEND = 256
SIGNED_STRUCTig!.S P('q')€ñ
 # large enough for pid_t] % Fw  ZA
#

	  S‘ (c� †.Ì Nf = Nond( `live_f`) /pi$ 	{p ulock = wf.Lock(¬– a_modulà ['__main__” VgAstop·ð# Method used by unit tests to 3 R the ët ¥ l ; 0_un  edä	ˆ   Å ‘ ;aQid is’
j LG _ !# š²  "a£ñ" file descriptor asks! Ó æ Û #os— ™ 
 Q <_fd�ª t Àe

        oós.waitpid(self._forkserver_pid, 0)
  ! … = None
% þif not util.is_abstract_socket_namespaceo •address):L  x Ÿos.unlink1 0 ¡ S 	¥ ydef seté Rreloa’, modules« Ž ã'''Set list of'  Ñ p to try  I F in HÅ process.'''« 'ðall(type(mod) is str;  ^  F Ò p  _š ”  "òraise TypeError('' À ¥ must be a¹ Œstrings'Ùf   =… 
ã >ñget_inherited_fds›– •'''Returnt Efds 3 Å from parent_  Ð aThis r@ s]¸ if the cur3 A wasl started by;kdÇ. €`  `š  Í ‰  è ó connect_to_new_Çí H, fdªò Qquestƒ z  Pcreat~_childî  )€s a pairY ,ð(status_r, data_w).  TdallingI • can readå )l ô's pid and (eventually) itfBcode”v 4t €should w  ä ¢ £`pickleè �eparationz ž DÕ e ™’ö ensure_running(ªpif len(}ú + 4 >= MAXFDS_TO_SEND=DValu€too manyÀRwith £. ( ú.AF_UNIX) as clientc  .,	EƒÃ  ãü ÞÇ_w = os.pipeí  *   #r,/* 0all:5= [4 	 #w,ç“¥_alive_fd,š m  �resource_½Éker.getfd()]0 s  +=N	 :try' [ PreducP.send8=", I 
$2 F/
 wm [excep— > “os.close(6 ra # w# D	p 0finCá N yp 	" &w)nô 
SPMake q that aj k 3..S  J "`be cal™{Àany process.ó  Note that usually a child
  ðprocess will just reus5 õe forkserver started by its parent, soI òensure_running()R µdo nothing.* 5''' õwith self._lock:  Ÿ üresource_tracker.d 	. #ifI · p_pid isƒ Z None_  c #å  was launchê `efore,? Pit st Ý ?x  G @pid,$òtus = os.waitpid(Û 
’ ,! �WNOHANG)K !if¯ >pid®  k #Œ ]alive>  " mreturn s# dead,â Ž it agai( Žos.close¼ s >_fdµ ç @addrW=xŒ 0  Î O_fd 1  Ú, 	^  cmD Ã('from multiâ ƒˆù import main; ' +E  F@   ' Q(%d,  ¹r, **%r)')
. yþ preload_modulesÀ°desired_key({a Â_path', 'sys }_  � ðdata = spawn.get_preparation_ ž('ignore'œ  € = {x: yî� x, y in  Ñ.items() if x £ 
ˆ ?elsA  E  ^ }Øqocket.s (  .AF_UNIX) m~istener*@`connecé ³.arbitrary_ #('N ÷  l\ c.bind(1 o°util.is_absm"t_® ¥_namespaceB ¬  ¡ 55hmoi ~, 0o600p — 	 (L L Ó# all client ¾ñes own the write end of "˜}" pipe;;Q# whe: yX qterminaae readL qbecomes y¬ �   c B_r, 	 wæ r (ä ?try& fds_to_pasÿ[´er.fileno()_ -r]Ç  …  ÜO%= (8 ,Š,O  S    ÃÅ   9exev¯executableö   1 1argÚ qexe] + V_ _�ÿ_interpreter_flagsG 	ß+= ['-c', cmdf ð v_passfds(exe, ûargs, fds_to_pass)
  }except:  ' þos.close(alive_w>  & ]raise@ finallyY rY óself._forkserver_address = 
 r 3 ¶  fd4  w4  pi/ apid

# ò
def main(listener_fd, ±r, preload,$ ö _path=None, sys )v'''Run × A.'''• $ifJ *  Y`if '__| d__' in" F ando € is not v <  @ óprocess.current_ ú()._inheriting = TruÀ/tr¸ Âspawn.import•  í (Ÿ  
 
ÄÿCdel ‰ ™  Ç ·for modname
ë ² #__® #_(@ 
¤ û! IÓ ZErrorU  }  5
‹ autil._‚_stdin() psig_r,  Âw = os.pipe(l ðos.set_blocking(& �r, False" w" {  ƒó	sigchld_handler(*_unusedZ ¬ p# DummyŠ Cnal * ñ, doesn't do anythingW  4 à /  b{ D# un¼ ð SIGCHLD allows the wakeup fd to†õify our event loopK ssignal.E :¦ Ñ ,) # Atectb ,… from ^C& O 1INTN ^ F_IGNM }1 o9à 5sig3 I  ™R, val•   „#  ‡/’.items()}`# callX os.write()/  -`Pythonù Ÿ ¿Aracy¨ Œ 2Z0_fdw  {! ð# map child pidsw0clim1fds# 0pidî÷{– Âwith socket. ( ÷.AF_UNIX, fileno=åT) as  1, \^ óselectors.DefaultS (4  NÉÕh @.get›  îa t T @.regˆr�$,  Æs.EVENT_READÇ : ¼ 9 ½7 QwhileU Ã ¤-  1   0rfd²P[key.£0obj?b (key,gsa• Ð.select()]
    �if rfds:
  mbreak
 ßif alive_r inC ý# EOF because no more client processes leftd  ‚ ó assert os.read(t ð, 1) == b'', "Not ati /?"E ÿraise SystemExitÏ ?sigÍ ¿Got SIGCHLDj ¨ M ÿ, 65536)  # exhausä ¯while True‡ö# Scan for child<ˆ  ;?tryP  !  pid, sts =`°waitpid(-1, �WNOHANG)_ €except CŽ PÉ_Errort O ~  `if pidÚ0G )"@_w =N ±_to_fd.pop(ñ ONoneÖ "if` _w is not 0 � ¦returncodeJ`status| @exit ^(sts)zp# Send 2  3 ; to+Ž G ñ % Ówrite_signed()&, Ã  > õ¯BrokenPipeó 8 #È �vanishedÉ 
 2 Opass% 
„os.closeÅ ¹ ?elsZ m ÿ# This shouldn't happen really‡ 
�warnings.	 ã('forkserver: R]Oed 'J 
 ‰  °'unexpectedÆ` %d' %
 D ¯if listeneŽ€IncomingJk reque–5ithW 0.acîŸ()[0] as 1ó# Receive fds fromüý  ( ÿ= reduction.recvfds(s, MAXFDS_TO_SEND + 1ç ›en(fds) >: Á bRuntimÒ(­ ¢ñ"Too many ({0:n})ï ÿ to send".formatG  O l¶ )Ü ©$r,�2, *6/fd&!Àe()
          ûpid = os.fork()
  1if + O= 0:%  . # Child$ 
�code = 1% 
?tryj  n ïlistener.closeÀ  -   selecto1 ð	unused_fds = [alive_r, cå p_w, sig   /w]Ñ 
  N ÿ.extend(pid_to_fd.values()… B   @²_serve_one(� r, fds,†  D 
 ˜ > !Ïold_handlers¾ �except E ?ionâBsys.6 chook(* __info, 0 Ïstderr.flush$ofinallz�os._exit(�õ Oelseå a# Send^ÿto client processÊ
!Ãwrite_signed& w,m ³  rÿ BrokenPipeErrorÉ  8 #Á vanishe 2 /paç !t[pid] ={
#osî �for fd in?å ] Ifd)
‡ 7!OS/O as ý áif e.errno != 	 ß.ECONNABORTED� Ïraise


def ù% u­%, ‘P  š€ose unne[ðary stuff and resetÌ5nal: Û  ;òal.set_wakeup_fd(-1Q 9€sig, val?t ‚.items(){  çG dignal(4 F À : n (_­ý'r. _ž#fdÄþresource_tracker._ - *I `._inhe:ù0) =ëT# Run ñ object received over pipe<ò parent_sentineli3dup‰rÿ  Aä = spawn._main  +, B opreturn 9 ±


#
# ReadÉðÉðed numbers
#

def readñ_signed(fd):
    data = b'' ñlength = SIGNED_STRUCT.size   while len(9 0) < 2gthM  Q  s = os.reaf ,    -	 5 )J  , †if not s>   ðraise EOFError('unexpected '?  ƒ Q += sQ kreturn¹ bunpackx æ[0]

def write
3, n=msgû @ nu þ 6msg± Snbyteô X ‚(fd, msg2  Ð  æ & 6= 0;   ì sRuntimeð ashould‡get hereõ ¤ Bmsg[{ Q:]

# ñ
_forkserver = ForkS ð()
ensure_runninå , . �
get_inhe&@d_fdÞ /   ü
connect_to_new_proces7 % G
set] ·_preload =  .%  ö ñ) Module which supports allocation of memory from an mmap< Smulti® ±ing/heap.py ðJCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

im¡ � bisect
’ `collec¬ #s  Ãdefaultdict
 µ  $os %sy „tempfile  th„Bing
g „.contextd Areduv Ð, assert_spaw0 ) òutil

__all__ = ['BufferWrapper'�" I3£able class”TwrapswR, and‰²Ôblocks can be·!ed+ñf sys.platform == 'win32':
òr_winapi z ÃArena(objectÜ n1"""9   „A sharedô	area backed by anonymous  ¥(Windows).C  O   _rÚ $= ‡ò._RandomNameSequence()¥  €  ‰ð __init__(self, f®  &   ~! = o   ûfor i in range(100>  % ñname = 'pym-%d-%s' % (os.getpid(), nextƒ .Å )» A   Qbuf =8.ˆ2(-1® P, tagb = 8 3if ž‚.GetLastä)Í h   Ybreakè   ð# We have reopened a preexistÓ ˜ › 3   €buf.clos{   JelseŠ  ŽPFileEW s­ @'Can§Pfind è  y1new› C ±% =, 	É  b= t.uf P_stat±‘ !, 8  U @1get1 D ØÀ_spawning(seWlf)
  õreturn self._state
  ‘def __set 0__(& !,  %):'  N   b.size,K bname = W   _  /  þ# Reopen existing mmapZ �buffer = .$ 3(-1k v 0tagt =‰  
 
ç ñ	# XXX Temporarily prevent ùbuildbot failures while determining“ M ðthe correct long-- ú fix. See issue 23060= õassert _winapi.GetLastError() == òERROR_ALREADY_EXISTS

else:¤÷class Arena(object–5"""x óA shared memory area backed by a t0y fù …(POSIX).A  M  ð if sys.platform³ z'linux'õ_dir_candidates = ['/dev/shm']O Ñ   9  ]ò   –Finit’yWfd=-1 -  " 5izev  yfd = fd 0if  J= -1Ó  6 #rò is created anew (6 !6 ð , it means we'r)mFL qfrom reƒ!_aËz) belowÁ . Í @fd, à! =¶ °@.mksÂ(Å  2  ÿprefix='pym-%d-'%os.getpid(),3 2dirJp_choose’(G)–  os.unlink(—   Óutil.FinalizeC¡os.close,  O.fd,Z ‚ftruncat9  (  ‡ 	· #   0	 8 9 GÞ Belf,] 
ô1# Cä a non-storage? di Uºif possibleVð# to improve per5:ancŒtfor d iŠ
;
‘  Õ€st = os.Œ^vfs(dx §àt.f_bavail * s  fr1 >=ë õ:  # enough free space?% k  *
* ä@get_‡-)± fcreduceÝa¡_if a.i²raise Value'ç uÿunpicklable because '² º ` 'fork^`was en; `d when§  É'FÙ 	šC, (aårÔ °tion.DupFd(È )ô Ò sw, dupfdÿ c Ù ]# „.detach(P l ‘register(4 !,  Z�)

#
# CPallowñ  	 Ðcation of chuðDnks of memory from arenas
#

class Heap(object):

    # Minimum malloc() alignment
! _ B = 85 ð _DISCARD_FREE_SPACE_LARGER_THAN = 4 * 1024 ** 2f A4 MBq ü	_DOUBLE_ARENA_SIZE_UNTIL5 j ðdef __init__(self, size=mmap.PAGEA !):Z  ®  # ð._lastpid = os.ge ,()$ ÷ock = threading.Lock& ’# CurrentF Qation‚ N  • * = ð # A sorted list�Àavailable bl€  7 Bs ind sU Âlengths = [] ã T# FreA ¦managementÇ# - map eachh U to aŠ 0`(Ap, start Bop)`/ ˆ  Å_to_seq = {}¦ i 
L €)` tuplep Jthe  
j K  Š  ing at tha12fse† ù Ü°  � B‘ Ö � # enŽ +op� Ô 3MapÚ/ir
5useC ó {1ed_ô  ü defaultdict(setÝù9L‡pÛ O @to fS�- see comP –  ‹() below” C _# — 
¨œStatisticQ1n_mÔ  Ê 0Y nS    @sG qcmethod µroundup(n, ¢	# ð must be a power‰2I  V0masD E - 1 Àreturn (n + ) P) & ~	 �‰ Anew_p 	‰ PCreat~ 2newP withY@leasí�e given **  XTelf._ó 1maxl  ._/ :), E õ# We carve larger and  ös, for efficiency, until wŠ1# rPa: A-ishîð (roughly L3 cache-• d’2if Ç  # < Æ œ8 6*= ´±util.info('H!at7 a  â<R%d',  “ ¯1 = ( v $ @s.apê( A  6, 0c wydiscard0 	ðPossibly delete 2‚(unused)3X  ® ! = Àa.size
     ñ   # Reusing an exist ò	rena is faster than crea ã new one, so
  õ# we only reclaim space if it's large enough.6 õ"if length < self._DISCARD_FREE_SPACE_LARGER_THAN::  w ereturn ƒblocks =J ¢allocated_ `.pop(aÛ )3 ²assert not %  3delH ‚start_toG [C _, 0)]- .op, ä 1 ì � ‚s.removeX › 5seqË 0lenU Bseq[K { 4seqA B C, 0,U)N !ifå :seqCç d  l² ~ ³  !)
	adef _mv(. v, size)p "# ±9s a{ò -- it might be much' r_  … ²i = bisect. Q_leftn "._� sw 4 `f i ==
) š  \ œ ôAnew_ž(Ä M FelseÑ  7 v ªfgths[i¢ & Í + ˆP q²Ä  È  Ì	,Ù ¯   Õ 8ép, stop)i O% ] '  �ª  ã1 g &T P‚add_free}Á,0¿b# make ð	 available and try to me~ñwith its neighbours in the íí 
& :tryBprev© À Ï æ ,û except KeyErrorV 5asst �x5, _s vabsorb(�   #³ Mnext³ ð Ê ß³ )_e² Œ ² ? = “Ö P atop - Fö  Ÿ1 ›V�.append(u yì 
L A = [H ä Œ ¸m.insorºÈ þ ] Ï  « P r«5 vÀstop)] = bloñck

    def _absorb(self, block):  " ò# deregister this" õ so it can be merged with a neighbourE Ð(arena, start Rop) =J % @del „ !._' A_to_� [> /)]1 /op0 Bop)]é  Ë ò length = stop -Ž N 0seq €elf._lenO Bseq[5 u ±seq.remove(ž )A ¦if not seq> w Ø W  ) ý q se  )Æ breturn½ K Ëš ¢_allocatedBÛ•”ã sX !s[C / » (È¤ )(, 
+0# A)ð is entirely free, discardtBfromŠuprocess‚E/ _  @C' T ‚_pending#s$	øÂFree all the«As in ; Ä list - callÿ -  Ce held.› ªwhile Trueò :try  Ä um _µ  fs.pop(R 4 ÿexcept IndexErrorW  Ereak’  5 r7add] ×( ]“ ^ ¨ NM  " aO Ëqed by m\Õ q# Since $()jkàasynchronously@  x0GC,!Åcould happenï µ# that it's°”³!is¶:çaß7se,C , Á.acquire() wo AdeadE ñ	(issue #12352). To avoid€ 7, aO 1try3 ñis used instead, and ifk! Pcan'tiv dE Áimmediately,2 � C¢added to a©"ofxs bZJ 
TÀsometimes laüw¦3 or™,} –7ing– Q»“ Qs() (• wä ±retrieving _ ©  isJN òstrictly thread-safe but under CPythonÝ`atomicn!nkê 6IL)�óif os.getpid() !=x0las 
:±raise ValueX(˜    ð "My pid ({0:n}){ 	 N  Þ{1:n}".format?  C � ,eŒ 8 5ock„WFalse¼ R #23't 2ð  the lock rightñ now, add the block to —list of
  ’# pending+ s, Ifree% cself._) _ _Y @s.ap ( )4 Uelse:  n ‚# we hol–  • 	 :try0  4 v np is += 14 # ‘  ˆ 3ing™ (�  (   O 1addQ ( ¹  (   , ÿremove_allocated4 ofinallÄ  ð ±.release()
Ç Qdef m[ (n v, size)¢# return aš‘ of right) ö (possibly rounded upô "if& 6< 0R  Ù ðraise ValueError("Size {0:n} ouñ  range".format(— 
Z `ys.max 1 <=i e ŽOverflowh too lare 
ð os.getpid() != #P._las 
n  �_init__()æ   M ! 0ialï ¡after fork‹ / Dwithf ?ockc "n_°Œ  # ÊwL ÿbe marked availabl[Ânóaup(max S, 1),¾ –alignment´ à Ð(arena, start Dop) P Ø K 
6 �real_stop+  : ! +ð7 [ 6if (  < / 
? % A# if…Ö#edÖ1is ñr than necessary,7	h G  ÖŸremainderU * ï° 

ö ; 
÷!s[Bs].add((GH )B å  o . ð

#
# Class wrapp�é Kp‘ð	a Heap -- can be inheritE°y child pro:Q
#

cW pBufferW] ²er(object):| _hP =W �_F ’U¬¤9 = .. ¢._state = +˜`util.Fþ3izeÉa  ás, args=I )ñcreate_memoryviewJ I c ñ Ìð= self._state
    ñreturn memoryview(arena.buffer)[start: ñ>+size]
#
# Module providing manager classes for dealing
# with shared objectsG ómultiprocessing/F As.py  òZCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'BaseM¾ –', 'SyncM �BaseProxy ‘Token' ]
� QImporÉ !
i D sys Pthrea dsignal Tarray Tqueue 6tim 5ypeR ³os
from os o rgetpid
 ”traceback £format_exc" . ¢connection; „.context  Aredu ò, get_spawning_popen, P°SErrorA : Lpool .  <uti)  k ‰ `
try:
Ÿò ¹ B_¬‚
except ‡Ž 4 þHAS_SHMEM = False
else ATruee °.append('Sh©M)ôòRegister some thingìBpickía

def D!e_è2(a)~ l . ñ, (a.typecode, a.tobytes())
C  ¦#.rv (4 :   c 0)

¼_K Ps = [	 ñ(getattr({}, name)())š  ð in ('items','key Övalues')]
if R ð[0] is not list:›ð   # only neededP QPy3.0T�build_as_6 C(obj	 @   0, ( ! !,)@  @€  [  sLC ©"' I, re ÂAType€identify¾Y›
È ñ — 3ect» 1'''¡ H Äto uniquely P 9 a O . 6 €__slots_| ('¥ idZpaddress Qid')
5  Dò __init__(self, 2 #, 0 C, id˜  % O@id, 2 .)  id) = (F s ƒgetstatew b µi Q sQ !, _ X Q " =7 Y Orepr¦ 3'%së 5=%r4 ±id=%r)' % \k > ‹ !__P__.__.#__Q<P^&1Fun@h�communicaË
a/�'s serverJ  ž ÷ dispatch(cã€, method‰ ó, args=(), kwds={}GcàSend a messageVð using connectioñn `c` and return response
    ''' ñc.send((id, methodname, args, kwds))) Pkind,D Òult = c.recv( 0if  á == '#RETURN':6  k  1ult ðraise convert_to_error(D c o)

def$ d 	~ _ERROR} 
$el1 òin ('#TRACEBACK', '#UNSERIALIZABLE')c  Ç ÷if not isinstance(result, str(  , á QTypeEÚ ö    !"R< q {0!r} ú ñ '{1}') type is {2},r Ístr".format(I  Q ˆ @ @ › )¼ % õ ¤æ å  * °SRemotÀ ó'Unserializable message: %s\n' % D OelseV ¸ 5 
1 ƒ FValu‚ ¤recognized€ ,T{!r}'! ¨))

class Ä “Exception¬ _Ã__str__(self  ¾   ('Ý ³+ '-'*75 +  1str2 .%@[0]) $ °)

#
# Funcj ðs for finding th9 c dòs of an object
#ñBall_ˆSs(obj• ®RÊ`a list@ I 4   Q`obj`)7 ‘temp = []  ”  8 w in dirg  ü Ñfunc = getatt ,¯ § " pif call	(. ¤      m @.appW g 9 S  é opublicì 2“ which do/²art with '_å… [— ›	 <in v í�ame[0] !=H ]ÚcServerq `is runG�a process±ðtrolled by a managerß“B  u3ect;    ) Õ Orunsb H ƒP d ú�'shutdownå`create
  aca_conne²  4get—!',2 T  °'debug_info+ ¢number_of_Æs Pdummy	 `incref
 !de
 !]
O zCinit{ õôgistry, address, authkey, zef ¡
Ž0 SbytesZ¶ /  ‘Ao ’#is\31!s‡W ‰ƒ „ … h2.reì 4 =   ¬ ! 9 $ =V.� `enticaWsString(' ` = àListener, Clieónt = listener_client[serializer]

  õ
# do authentication later" Tself.L C = LW “(address= Ú, backlog=16)> " 9 = M . Ž  úid_to_obj = {'0': (None, ())}Y + arefcouô {! ´local_proxyX ( ò	mutex = threading.Lock()› ðdef serve_forever(© %):� 5''' rRun the1 #r 2  +  F ‘.stop_eveÀ € E (Ið process.currentÎ   Á()._manager_£ rfq 6try©  öpaccepte) o Tù �(target=™ ( „ > å.daemon = Truen 	# WstartÄ   �   ’while not!‡.is_set(l 0  ¨ . jwait(1±  exï ÿ (KeyboardInterrupt, SystemExit`  Epass× kfinallIñif sys.stdout != "__ Ð__: # what ab  ustderr?S Ä òutil.debug('resetting E , Jerr'Ó  ; z y c ,  erô  ¥ Yerr__,   gexit(0ùô´ ý
_ác–I.W ¬zOSErrorX  õ kcontino ìÉ
ú
handle_request, args=(c,)VtÓ$t.Ì1 _W 7, cJq 0 = À9  Å !`connec{`.deliv³²hallenge(c, ¤:key³ : Oansw9 › kc.recvˆòignore, funcname4“, kwds = > Ò  Ö eassert2 2 in¸ õpublic, '%r unrecognized' %- 	I  t ’ = getattj‰ ÿ +EÞ:ion-ðmsg = ('#TRACEBACK',‹‡mat_exc(ûJelse= ¡ à Presulk    –*G@, **˜  , œ  "    / ¤   E ðRETURN', result)
#
  Etry:   µc.send(msg) �except E Šion as e7 H L ö('#TRACEBACK', format_exc())e  1 i 
d  " Epass˜   ðutil.info('Failure to Ä ù  message: %r', Ò : ò ... request was2  
£ p 6 ³  8 1e)
£ ³def handle_K Æ(self, conn)Ü 1'''0  • H0 a a new( eection  , t ^ +._s m @ ¯ ¶ SystemExit‡    # Server.s õ_client() calls sys.exit(0) on EOFX  = 	œlfinall]§onn.close($	l  Ä "Rðs from the proxies in a particular µcess/thread² JÕ�debug('st; 1ng — "r 7 UQrviceG  ù  * Âing.current_ d().nam - arecv =à. N ¸    Àid_to_obj = #. l V ’while not" östop_event.is_set():-  1 A  `method± 2 = q ENoneŠ  $   �0 = Â (& ! vident, P Á, args, kwds7 pY –  Q õobj, exposed, gettypeid = [u ]T ÷€KeyErrorÁkÂ b      ƒ \t  0  ³`local_­yÐ²  : ¶ 
« !  Šraise keß  'if�$inDP L ‘Attribute0(Ý 'ßa %r of ‹bject ism o=%r' %H (H  w , ØU(obj)ï^ Ý   H   1fun5  =%@attrM Š5  ÷ re­T "(*Ä **Æ— ³+	§ ÿmsg = ('#ERROR', eO  /ls§ü0andñ  >iid.getUÐNone)
         ¸if typeid:
  órident, rexposed = self.create(conn,E  % /s)J �token = T (x ,M ’address, n D ômsg = ('#PROXY', (˜ !, ` )< Oelseä V sRETURN'É 	Ê þexcept AttributeErrorS ÿif methodname is Nonz v ÿTRACEBACK', format_exc(Ë  Ç >try� ÈÔfallback_funcÁ †mapping[¸ ]ú F   •result = >  S (0  4  /", )Mÿobj, *args, **kwdsB 
Ô \ Dº?ult2 ÄEË?ion2X œ	² Z /OFðutil.debug('got EOF -- exiting thread serv I%r',`  ì  / Âing.current_ 0().xþ @sys.l I(0)
Y ¹ Š  Ñ Žsend(msg³ š @ ü('#UNSERIALIZABLEI
^ Z O as ¤ ³binfo('2 oion in¬—©u ð ... message was  ,6 ° 8 e < “~.close( 2126deföŸgetvalue(Ý)Z¢return objy	G ?strB  , ?objŽ ?repH - I ÉE = {"¥'__str__':' 6str›0'__O 	!   " —#GETVALUED >h }TdummyHGpass&  J_�‚+ 5'''Z ðReturn some info ó--- useful to spot problems with refcounting
  5''' õ# Perhaps include debug info about 'c'?0 U µself.mutex:  \ ¹result = [] Ákeys = list(< did_to_œ .  =())4 j.sort( Ðfor ident in 9 
ƒ  ‡ #if" n!= '0'!  % ¬ à.append('  %s: %  4P=%s\n Y%s' %ž    (™ /, ä  [ /],F H str'3obj> ›[0])[:75],òreturn '\n'.join(Ý !)
n ñdef number_of_objectsa F, c)N0 ³ of shared 7 Q  ù - �# Doesn't‹Q (len^ .æðobj) - 1) as we should. ™«6='0”Ï H .Ö rshutdowo Í S' P this OcessÊ 6try ç Qutil.ô('manager received  š message'ª0c.s[÷('#RETURN', None¼jexceptr õimport traceback¨  �  §.print_exckfinallÂ ŒÐstop_event.seRV  acreate°ÿ, c, typeid, /, *args, **kwds(C? j a new+S and Êaits idt  Æ <P
ñ	callable, exposed, metho>ª Pproxy E = \d  h  �registry[- 2id]% 4if o 1 isª
™ ) 0if 2 orç "g) != 1  )  ÿraise ValueError(¡ p  "Witho† ú, must have one non-keyword argument"r v Pobj =! :s[0†NelseÓ 0 u (õ#ˆ"! ’= public_± s(	ý -ifÍ W ?not}  ²isinstance(\  KÓo, dict‹
?TypŠMdq {0!r}:€ {1!s}, Š  m �".formatÙ •©  ± À ) 7   Q?ð exposed) + list÷(method_to_typeid)

  ù.ident = '%x' % id(obj)  # convert to string because xmlrpclibJ U 	 ù# only has 32 bit signed integersF ðutil.debug('%r callable retur6 òobject with id %r', Ú !, Í á aself.iAobj[# @] = è þ, set(exposed), ,Ê "ifa ‡ not in Z ™refcount:Ì  = %  „ 0Œ( uncref(cÊ  B   þ  u, tuple· D ‚def get_Ã  s(P ¶, c, token)™ 5'''¥ RUC theû As of sshared mÂindicated byQ C O ¦ Ÿ  � x‡ s.id][1]¢ ³ öaccept_connection¹ Oname¸ ñSpawn a new thread¦�erve this¼P © 4 Âing.current_ 0().v 0 =  ; õ
c.send(('#RETURN', None))" í s€ —_client(cå i× % “„Û Ì  f.mutex¬ û:try   - Õ{VE+= 1˜  ,  excþ  KeyError as keS ñ# If no external references exist but an·! 0(to,	m  q ó
# manager) still does and²b  ³ rebN  ð from it, restorãec €'s trackŸaof it . ?theI  ópreviously stash„Í Mref.3 ò
îþ local_proxy_objL £¢ /   3 	«\™  .   2 • : Sobj, ö,6@( =Ó‚ D ¨Sùpr re-en­d”‚& INCREF¨ùP ?els‘  à †raise keä!de# ù L³¥‹
T™ ÔQ
æÿ  !DEé Pskipp�šY (Ô uÒ   þ
(if”ìJ<= 0˜  Q Ðraise Asserti¯onError(
   ÿ%"Id {0!s} ({1!r}) has refcount {2:n}, not 1+".formatJ  ] ñident, self.id_to_obj[ /],€  6 / y 4 )))5 ) Y -= 1, (if‡ X i == 0:0  ‰ ?del5 
0 1if Ô /in4 
] ð2# Two-step process in case the object turns out to contain other
ž  #D #xy6 ù
s (e.g. a managed list of 5s).¾  H 0# OX èwise, deletingÈ ¸à would trigger° J ?  of ñ stored value (anÂ Ž ì r) which\ P !in
q attempbacquir-úmutex that is already held hereè 2Ò Ð= (None, (), 
 p)  # thK Y-safe’ ðutil.debug('dispos, of�Ò with id %r',
³  † ¸ 
 Št¦ À


#
# Classð represent stateâôar
#

c) S (en á__slots__ = ['—!']â ±INITIAL = 0 „STARTED LÂSHUTDOWN = 2Ž @Mappþ ðfrom serializer name¥ ðListener and Cli¯ Ptypes¢  ™  "_c 1= {w ô'pickle' : (connection.L , T )M¬'xmlrpclib< ?Xml? 3XmlB z }Ö `Definiu  VQBaseMLX 
^1'''K  !  „3forï!rs $ á_registry = {} ¢_Server = 	 e`def __” 0__(> , address=¯“, authkey ‰=L! a 1ctx0 )  $ifJ  L [     g   =s ·“.current_Ç3().$ Î  4  ¯ #._¯ $ =¹   a # XXX6Ufinal Æif eg ('', 0@J ë „  Authentica³sString(‡ > ,"=  . ‚ <.Ð c' =ù& t¼ l! =”û[O Š 3 `ctx =  por get_	Vext()  s8ÑjÀ    Return sðerver object with s ó_forever() method and address attribute
  5''' ñ
if self._state.value != S …INITIAL:/  B 3 =3 zSTARTED3  7 òraise ProcessError("Already startedÏ 9r")p /elr HUTDOWNs ýManager has shut downr /seN 	¨  å   €"UnknownÖ ýte {!r}".format(l)ì €return SÓr* “registry,¦Õ,y  % Uuthke4 Áserializer)
8 ¢def connec‘ )ì C# # m2xcto the«" pÐX  ý A óListener, Client = l !_c [¢ ]I  ¡ # =: þ " aâ =?  J�dispatch(E ö , None, 'dummy'& = øÄ. … c, initP=Z   args=()K{Spawn a5› for thiscM©ÿ\˜(ifq is notgz  �callable(/ +BType'+ ´ must be a J '¾ ; €# pipe oõwhich we will retrieveÿoá 8¾  s •„writer =ùion.Pipe(duplex=Falseu sÇó y ErunsÚd \* =™Cctx.(+  Ð ±target=typefq)._run_Þríi` o 
@  o )", 	ß  q )D D"idØñ ':'.join(str(i)ÚCi inŠ 	!._0 6ityB Ê ! wname = 	À__name__  + Ó'-' + ident
  õself._process.start()
 õ# get address of server  åwriter.close() V 7 ×= reader.recv&  = > ÷# register a finalizt ] ñ state.value = S uSTARTEDI * óshutdown = util.FQ ('   + p, type( 4)._y ™_manager,0 Qargs=+ > , : #._÷  juthkey?  s  0 Ê . zClient). éexitpriority=0ˆ ¬Á@classmethod  ’def _run_±S(cls,W4ry,Ò3, až  Ùii", Ö
„ ² c  init) a=None, 1)):}  , 5''' €Create ae 0ver‰ „port itsŠ ¦ and run iœC ó# bpo-36368: protectO    ¾õ from KeyboardInterrupt signalsŽ  . ( ƒ.SIGINT,-   C_IGN^ Ð !ifé û € is not ô (   (*- H 2# c™– Y‘ = cls._S (±	^ Õinform parentcof the1'v~ òb.send(™ .ÇÕ$ ¯!un_ *V p ‘ #(' ‚  ing at %r'ö Pm …  „_forever™ÜF‚¸€id, /, *p�, **kwds�ò	new shared object; returÏ Qtoken™Õexposed tupleß  Passer’ OÒœ�1, 'Õ r@Ayet u&ed/0con®Nè [·=$  «;try–4d, Å °= dispatch(j ,Å2, 'R@', (Rid,)+LJö l`  I KTGT ô]U, id)š w ÞAjoinó ‘, timeoutlÏ2Joi±eÏ  (µöt has been spawned(Â#ifœ > ãu' .¬ ¦ Z fä
/ —is_alive(Í  -   	* ! =™q_debug_P * A È RÁðsome info about theó servers shared objects and connections
  5'''    ò = self._Client( óaddress, authkey=  )B Etry:  b ðreturn dispatch(c ö, None, 'debug_info'C kfinallG  7 ‘.close()
a ó def _number_of_ç ¯ )ƒ Þ R‹ Bthe 8 ; of&Z  · 8  | Y� Õ $Œ_enter__#ifâñstate.value == S vINITIALC îfstart(©H !H zSTARTEDH 3 {   ñraise ProcessError("Unable to ˜ ÷"Ÿ  9 /elr ŠSHUTDOWN¦  : s  Manager ha^}ut downr /seN k n  €"UnknownÔ äte {!r}".forma‰´)ì f §S_exit ¢, exc_type
 2val	 'tb/ A P.shutÚ j@t �icmethod· |¨Rize_m"(p ,, -,Ï #, Tq hSx  ¢U  U ð; will be registeÛTas a ‡ rš  IT $ifB §.is_alive(  / Putil.„¤('sending q messagf‘ Œ = ð  1î (=D¿ 5   N   ?§ ”  1 E       M   �except E >ionÉBpassb4 ¡ú.join(timeout=1.0Þ ˆ Q Œp0 stùºè   ifŽFattr»'terminate'ë c   g 0tryòEto `7 D()`  ß {   I  .; ‡    ( 	%:0.1%. -/ àutil.info('manóager still alive after terminate')

  ñ state.value = S …SHUTDOWN% Etry:  9 ódel BaseProxy._address_to_local[ ]5 ú except KeyErrorN Bpass’ ‘@property9 Cdef J f(self)7 preturn   C µclassmethodF ðregister(cls, typeid, callable=None, pÍ    rexposed K  û  c  ô  4 i( ‚ create_ W=True· 5'''I R” # a‘ Ñ with the manÄ Y 0 < Rif '_Õ öry' not in cls.__dict__+ ±  0 " =*  g.copy(&if@ is 
P +q = Auto€ o :4 = 
 µor getattr(< C, '_  1_',f … A_= =  Eor \  y  s F |  -ifl 
 ’for key, 9Œin list([ ý	.items()): # isinstance?´ aassertP(key)v€str, '%r  á°a string' %| D 
— F & ¶	%[|yid] = (k 5,Ü,,K	; Þ*if)
_ ùAtempö÷, /, *args, **kwdsQñòutil.debug('requestingd ôion of a shared %r object')§  T Qtokenã # =fÙ(’ A æ& =I
F d   h È´serializer,= ,^  ; qauthkey" #._ ³ ¶?exp7 ì Econnæ qClient(˜ .}#, ^ 
l J �dispatch(S ÒÃ, 'decref', V Nid,)< Ò8	¹  	±.__name__ =%iÛ   s[	Þ 8 ¡)

#
# Sub �set which‘A cle"¢a fork
#

/ €ProcessLÔsSet(set| ¢�__init__¦  Ž Œ]1er_Z _X ( €, lambdaƒ: .ƒ (X nreduceZ $ ƒM 0), ¸ð#
# Definition oöf BaseProxy
#

class ñ(object):
    ''' òA base for proxies of shared 2 s) 1 ñ_address_to_local = {}# ñ_mutex = util.ForkAwareThreadLock()
) ñ$def __init__(self, token, serializer, manager=None,8  ¹  rauthkey ƒ exposed µincref=TrueH Ã_owned=False L Fwith%.Ä $    ¸tls_idset =* 	Q.get(È .  , ¼ )¼ 6if P !is" 
o s 
NLt±(), Process JSet(g  E .µ[¨ 6] =• £ @  # œò._tls is used to record the connection bby thi1B tý 7 Ácommunicate u A ä2 at:3‚ £ >[0]¦ ¢¨ sidentitÞ3allâg #ì
Rwhichá `urrent m÷ owns references andD 8 aare in? ß » á 1á  ! ¨  t  Did =¬  &.i– " ‰ =VB xJ …& 0CliÁ= listener_c [? (][» À# Should be @0to ”À only when a[#xy gÆbeing createÇ :# oSð server; primary€Ù case: nestedX %s.Ê ‘# Rebuild(Š detects� 9is † | L 0andÙ s÷ö value appropriatelyy ‰…M_by_’ Ø3if ã ?not+ T ' =ô  §P.Authò caœsString(' (Celif7Ž ?is j z 7 #._\ JelseÖ1 (  « cb"_pÏ3().$ 	
ÑR  Z u00reg¤Ãr_after_forkj ™Õ/ )W ¡debug('mak¥ÿ$toZ'aOnameë 
 ! 4 .Ding.@0().+ ’ != 'MainSð':
            nòame += '|' + threading.current_ “().name
  òconn = self._Client( òtoken.address, authkey=  )H �dispatch(Q ð, None, 'accept_  ection', (€ &,); R Ftls.( 0 =  
` ñ def _callmethod  ",  M ñ args=(), kwds={}):9  ä 5''' pTry to K # aA À of the refe(ö and return a copy" EsultM Y 6tryr  v  ½ W
Û A  exú  AttributeErrorG Âutil.debug('Àò  %r does not ow¤ $nn^]  …  = � 4 ‘ Ã Ject(   Ù }  % a.send(¬N._id°­€kind, ref r.recv() › 0if ' Ú == '#RETURN'3»G ’ )el: [PROXY9  exposed, tù# =Š C   •proxytypeñmanager._registry[? .% yid][-1]B  VF 	 	0 r 1 =   U (  • = ,ÃÃserializer, œ ³ ,@ Ì'  #, = 7 H™ B Ë F`decref;R (id? 8 õ%© PraiseG�vert_to_ea(@gZa�getvalue³A;Get3 "Dƒ $¤ ]Î¸'#GETVALUE'�  inõ � #ifè“owned_by_×
8* ð  skipped INCREF¼ 4%r'@b
Þ¼ ‡ á½îÙ @ à6$û  ðT 
ðÜ Ã À …E 0set�S “n @MstatÔ
= e!._)  @clos> š 1Fin€
¨ ) p, BasePC"._Ô
�Æ + !._H•” 5 À        selfô._tls, self._idset §Client),
  ù exitpriority=10 !)
 Ñ@staticmethod ðdef _decref(token, authkey, - 1e, …  _z :=  }  ‚.discardC 3.idp  ! ö# check whether manager is still aliveP fx    rNone or ö.value == State.STARTEDŠ m Etelld ðthis process no lon{ õcares about referent�  G :tryX   ñ	util.debug('DECREF %r', 7ô  &  sconn = 5uaddressh=p)‚  G �dispatch(H  , 2, '­3', P Jid,)< �except E �ion as eÐ B... Y ç failed %s', eÈ;elsE 5 --ùalready shutdown-ï !Ñwe can close Â thH 0's 	0ectÔ fbecaus8U# theì1ownñDmoreãòces to objects for^ ‘� qif not ÙÑ and hasattr(	'„ *')U³ 0 %r>  {Š ¡proxies soß 1ingÓ 'É ü G ping.cur§_ z().nameøFtls.ž .A(# 0delÐ' °after_fork(tÞ   #._)! =‹0-. !inU€ —Åáxy may just be¬aWQwhichXYŒ  7‡binfo('„ Ó:Ô% %Õô œ_reduce__ó •kwds = {}\ ðif get_spawning_popen()© 0 Ÿ
 C #['ßC'] =Ë z ² Z d <÷, '_isauto', False‹ 0 Y wexposedY  _³  - ÿreturn (RebuildProxypR(Auto  ª ÛuÀserializer, ‚ vv Btype~j w à ¿ƒdeepcopyÁg, memo/ˆ  WQ._getE(×C Crepr? 9 C'<%s3 , ª  idÕÁat %#x>' % \Ž  j (' Ñ 0.__§)__Ú .! bid, id' � À__str__(selfC):
  5''' ð(Return representation of the referent (or a fall-back i  •at fails)M Y 6tryr  y rj ðself._callmethod('__~ 6__'I �except E ?ionJ  6 (O ñ)[:-1] + "; '__str__()'ž áed>"

#
# FuncÝ ó6used for unpickling
#

def RebuildProxy(func, token, serializer, kwdsOò ] 	  pO ‘ objects..8 ðserver = getattr(process.curz_ â(), '_manager_6 r', None6 if£  L 3and ².address ==Ç  OÃutil.debug('ý $ a± ƒwned by w C=%r' {  Ý #[')  _o: ‘'] = Trueñ  %  6 N¤.id not in© °id_to_localò fxy_obj¦  = ô .* [¥0.ids \p  7   	; 6obj/ + ¡incref = (  2  Ï b.pop(' !',Ê U) and%  Ã ·óinheriting', Fals´ j C r(Ì 
q… = @, **  )×±s to createÀ0ies®  ty typesæAMakeãûType(name, exposed, _cache={}â) Q r whose È°s are given4`Q `/ï “ = tuple( 	2Ž [¥ !)]U %†KeyError/Qpass
# ‚dic = {}  ô ­  yz 5 €exec('''!%sX¥, /, *argst0 ¡  €	ÏB%r, 3 ¥p''' % (w ,*r), dic)’ † �B(Bas¢,/  ,. #._¿ 4_ =ºð /5 = < ( ½  ÿAAuto …Ý=t’, authkey T  ¢  �   ¶=
,K"=T#hnc "o-< º`
P@_Cli Á= listener_c [°B][1]n$if-1 is<{  ¶ sconn = Q  /î ö ° 7 	´  ü À = dispatch([ «p, 'get_bods', h &,)Q kfinall; B s.close(9 if ‚Ë í¤  ðnot None:
      ó  authkey = manager._ u
    if" �is None:   ( ó = process.current_ 3().$ 
5 õProxyType = Make a('Auto ñ[%s]' % token.typeid, exposed)G pG 1 = 0  O (- Ô, serializer,Î =Ö ,Ç =’ ,K  Ç 
 rincref= G d_ownedM  � ñ ._isauto = True[ `return€xy

#
# « òs/callables which we will register with SyncM‘ò
#

class Namespace(object)Œódef __init__(self, /, **kwds#  ä   ñ.__dict__.update($ ° F CreprF ; Áitems = listb H  "() g ‘temp = []V   ñfor name, value in 6 ¾  "   aif not) p.starts	G('_'‰  )    e à.append('%s=%r4(f ’ f.sort(¦ žq'%s(%s)=  kP__.__N à__, ', '.join(w $))�VÎ ‹ Ã4codþ p, lock='Ø | + 4 =  E" A=I  ·"ge–Q à 6 . s. �5 .  d /__i I�r, %r)'%(¾ ()G^    Ò ˜ N�perty(getÕ@t)

ç QArray\ A nquenceS• a1 . 7  )–FpŸs used by~�Iterator1 B(BasÀ@_£à_ = ('__next__;@send Pthrow	 bclose'ô  Ø ___itev Æ  (½Y ^h, *argä3  ._jimethod‘ 3 Q  ž M  4 :', I ß J 5 K !K 5 K ¤Acquireµa,  £Yrelea¥ – bÅ1ingÈ , timeout=  ¦ ! .  ,)P-  Pu else ($ M   G Õ” õ  -  Q¾ ¬ � H Àself._callmeñthod('release')
    def __enter__(self):   preturn  ‚._callmeD kacquirD 3xitC ¢, exc_type
 2val	 /tb^ ¢ ò	

class ConditionProxy(A r R ä_exposed_ = ('¡ %, ð ö, 'wait', 'notify
 G_all ' ã, timeout=Nonei 
 ; C', (8 &,)fu X ?n=1O 4  Q nK  ¶ O J  3 é A_forF ¿, predicateø fsult =+ (á  Pif re  A  E [$if\€ is not c
: 0endH! =+ á.monotonic() + 5outQ Oelse?  [ )  ”  §[ 	 QwhileŽ ¯ 
Q 4if “ ´ ^ 0 -° Ã 	�  6 5if — J<= 0|  "   Ybreak< ž : (  Ö “ 2 Ê ´
�oQEvent]Q(Base
 e
gQis_seS PclearY Œ j) hI › `/ @ ?set=  ‹  Ý’ < . x  Ç = Ä  ;  º ’0outÀ`bBarrie¿bõ__getattribute__\q, 'abor}*reô  { ¶ 7 ª Jo W Ã. J¤ > . > ‘@property÷ Š partiesN E #('E '™ ã g  n_I?ingi +G k obrokenh +D e iàNamespaceProxyò'(BaseProxy):
    _exposed_ = ('__getattribute__', '__s  0del# A__')C Edef 9 ´__(self, kec  g  if ¢[0] == '_'}     åreturn object.L … Q p  2 Ïcallmethod =8 &'_- ²  B t  þ h(key,)è — s, valueR ] ï S ñ M{ 1', ì Ë ò ðò ë &L ä Mt ä À))


class V¹0get3setD ö1getW .y ('A Vs: ;A  { 1, (k“ ñ = property(get, set)
V!__ç  ÖPitem_æ <ð(types.GenericAlias $AListb = Mak4iType('  Tk d'__add$„contains 2del�  Eá 0len) H 0mul  {PreverŸ‹r 4setE : `appendb Acoun°3ext Pindex Qinser 0pop ‚remove',E r   "so( 2__iw " #))<#;   1__i%ë%¯ 
ç S‡ ` ™ ` Ê Ib _

Dic ýòDiteräþ×p 'clearŒ@copy  G0, 'ùs³@keys Ð0pop   ‘setdefaulð`update 8!s'I&))ì "._@_to_i{( 3'__¶ ³: 'Iteratorƒ Ÿ}


Array3 3ù  ègÌ  { ± wOPoolc  b ðapply', 'apply_asyn c', 'close	 Dimap  _unordered Ãjoin',
    '% �map_asynC Cstar   “terminateA ò))
BasePoolProxy._method_to_typeid_ = {m SapplyL @: 'Aq cResultN  �   

� D ù ´: 'Iterator\   	" Ÿ …}
class Ì (Ú !):& ódef __enter__(self  Opreturn  - 3xit, Q, exc
 2val	 'tbG  @ .jó()

#
# Definition of SyncManager
#
»  ½ ! [ 1'''– 2Subê @of `ä ' ð
` which supports a numberp àshared object Û1s.
O 2The p registgð are those intended for the öphronizaÍ D ÷ of threads, plus `dict`, `list` and `Namespace`z ó`multiprocessing.Í €()` funcc � creates ?ñted instances of€ Qthis .  +
N.Û `('Queuaq . )+ �Joinable% ?', 3 sEvent', Ð  !,  cn ILock:   ¯, Acquirer< 
R, 	=  > €SemaphorÇ ¹  F 0Bou(7 	�  ¿ t	 í ACondH	b  %,  4
yBarrierE  #, 	 A 
ÀPool', pool. ,{ä 0',  o, Lista 
 D0',  _, Dic. 1ValÙ !,  _ 
�Array',   1 
Á5',   = %
#P Obed by W ±&wù  p” ­= d ,­o=Falset	§9  0cMemory“ÆS BServ¿Âif HAS_SHMEMh�( _/ rTracker   ÷ð "Manages one oró more shared memory segments."

  ô	def __init__(self, name,- _ es=[]):4  ;  + ._ __ �_context2 ! =G 3  „ % :s =g 
— “register_¸ Ÿ  B • û"Adds the suppliedQblockš Ù to tracker."§ ãutil.debug(f"R„ ¨ ( { ù!r} in pid {getpid()}")O )ö ˆ.append(J )û destroyú ò""Calls unlink() on		 Bwith & å	¶ ñand removes it from2 �list of I ss beingHOd.""JDÓ I:¢ I ž c h«!.S M? |.close(ØM.q
Á  ý¤¨â±4allM¹ ¹Ú   4forO Œ r .÷  Js[:]» ; ' „ 7 ‘S__del"Ñ 	0 Ý  $álf.__class__._‰ C__}.G  © 1@† �getstate‹ qreturn )� Ý*lf&j sj !, x ü G?*# 
þ  jrServer( "):'  Ž’public =  . 9+ \• + 1 ['·¸', 'release  ¨ 6s']k ð °*args, **kw
 ã “ å  ó ,, 4 	¨ baddresÞ3lf. 	# c# The   Q�Linux absÞ t£ùspaces can be bytesD ãif isinstance(L ,) Å  :! ä = os.fsdecode7 Ü $2Ý/ =” _åTUƒ(f"shm_{v /}_ð	@J z x~rted byi ×Ðcreate(self, ð
c, typeid, /, *args, **kw
 G):
  ò,"""Create a new distributed-shared object (not backed by a  	N ñ(memory block) and return its id to be used in a Proxy Oa I."""M õ# Unless set up asu   p9 Ã, don't makeŽ _‚ ‹_contextP òa standard part of q.  ThisJ ûs things easier for supplyingQ ùsimple functions.  ðif hasattr(self.reg^"y[ž’][-1], "_I» Û "§ ²« *['/ ê Q'] = f  	˜ ”�Server.cÿ¢ ', ;8
D Ädef shutdown8 ° ð"Call unlink() on  "tr?£  ¬€, termin„Cthe — 
Ú .e Ÿ  ,
ã ­ 
Ì — „_segmentÑ #,  \_nameß 0Add(e3ied€Ô  :  ôÓ 1's j ?er.Ý 3'erž ¦ • 
Ç wrelease+ !lfÒÉ 	"ªs« †	£Ï Qwith    õ  á 	xóÑmoves it from2 ù 0 in‚ ce	 1ide ÿówdestroyê Dlist( sÜÎ1""R§ a 1   Û s	 
  û'at½ 	Âis currentlyò=ingß ¢æ ·"s
ìqclass S™MmÃManager(Base ß Ã"""Like Sync @ butƒ
G … —@teadø  .x  T ItwÑvides methodsA7ingð  ¥ X Uances* * [>  { -l¯ sD —ableList)~•M J®.  It also© Qthat l e¨ 	�œ -  ôð ort synchronizaäp acrossb ðcesses (i.e. multi-pro U-safež  sv ¶semaphores)+ ø, _w) =å ‹ ‚‚__init__ÕÀ *args, **kw‡args):
  úif os.name == "posix"#  . ù+# bpo-36867: Ensure the resource_tracker is running beforen K `launch#  C ÿmanager process, so that concurrentD  ñshared_memory manipulation both in  ] 3and L  f ‚ ý does not create twoé G  Á =es. ßfrom . importL V!.er_Z)()a RBaseMEð.__init__(self, *ò`, **kw
 
8 àutil.debug(f"{1 Ð.__class__.__3__}õd by pid {getpid()}")
ˆ “def __del{ fk .B k  ; Jpass| ¡get_serverú  p'BetterW²n monkeypatƒñfor now; merge into SJ Å ultimately'é  ƒ 2if .ñstate.value != S ~INITIALD7 =7 ~STARTED7  r rraise P"ñ	Error("Already started SMÁ "ð I /el† HUTDOWN‡ w †ï has shut down† /seb 	{ Ä  €"Unknownñ te {!r}".format'._ )creturnÇ.4 “registry, @addr—‡ � eauthke> «serializer-7z k, size¹A"""Rª ys a newåá instance withï‘specifiedM 9 in¶ Òbytes, to be ±×†I."""4 [ Û TClien[ ñ =$  @) asÀnæisms = ¿.SNone,vR=True=	œ  z>tryd   1disär(conn, V 'ö â_segment', (smþ,! C pexcept `E  ^Oas er  K kunlink¡ L   Æ
‰mÑrableList ‘_quenc%< À instance po÷
pulated with the values
  Afrom ñinput sequence, to be tracked by% ¹manager."""F b Òself._Client( óaddress, authkey=  ©) as conn:M  ž ðsl = shared_memory.S pableLis` © ); >tryP  T �dispatch(s ‘, None, 'â þ
_segment', (sl.shm.name,)_ Áexcept BaseE 0ionÈ eu N ~unlink(O  ™ yraise eÊ ñreturn sl
#
# Module providing�ñ`Pool` class for ž  a* ‚cess pooB €multipro @ing/ 1.py^ ðCopyright (c) 2006-2008, R Oudkerk
# LicensedðPSF under a Contributor AgreeHð.
#

__all__ = ['« ¡', 'Thread !]
} pImports1 i Ó collections
 …itertool o
 Tqueue( t_ 5ing &im …raceback 5ypeH õ warnings

# If J � is avail{ x&n Å p should*œð	ed.  Therefore
# we avoi7‚p-level Ô âs which are li] ñ	o fail on some systems.
¥.9 [ util ó
get_context, TimeoutError(  òSE Bwait�ðConstants representD 0¤state of aI�
INIT = " P"
RUN  RUN"
CLOSE 	 ¡"
TERMINAT  "u ÁMiscellaneouüåjob_counter = ð. ò()

def mapstar(args)p(lQmap(* 0  - 4 j - ] P[0], J R[1]))³ @Hackýðembed stringificaª %Rremot3g‘ in localF  æ°R- T“(LØ  ï �__init__MC, tb  4Iqtb = tb91 3str0 , $3 "

‚ r EWith‰ VM 	~ ;excƒ ~ Â ‚.format_ ô ion(type(exc), = ª  ¿ < ¦''.join(tb¥ Pexc =5 0  5 ú \n"""\n%s"""' % oreduceprebuild¥  ê ±› _ 7&  À ÷ ±exc.__causeÙÆÊ r2exc<€Code runHdworker¢eþ’�MaybeEncoã¿p"""WrapÙñ ssible unpickleBàerrors, so theñ!y can be
    safely sent through the socket."""
( ñdef __init__(self, exc, value):$ P úelf.exc = repr(exc) 2   ! ð
uper(MaybeEncodingError, s )).‚  g  .G i ª 3str© � �return "T  ô  a ò result: '%s'. Reason A" % í a ,`  æ  " Ã  ´ )R %© †<%s: %s>‰ ò__class__.__name__@)


ú óworker(inqueue, out
  ¼àializer=None,  òargs=(), maxtasks ê ôwrap_exception=FalsòDif (9 € is not \ Q) and µ(isinstance*  z tõM J d H>= 1Ñ aise Asserœ Ø3("MË T {!r}— Õvalid".format‹ )‡ Uput =,A.put ge L2.ge —if hasattg—'_writer'� 8  r.close(q  ô ›…._reader! | !if ²Æ  ]m Á!  (*  Î_Ñcompleted = 0R Uwhileè R  N 7 orÄ m: <. × 6try‚  È  7g = getÝ 0Q (EOF–A, OS	 J  = Âutil.debug('¼T got 7  ž 9 Æ -- exiting'E D RbreakU  1if “ !isŒ
­ p   Oinele àjob, i, func, x�, kwds =} q � .n` = (Tr¡ A "(*A  **C ” > FE}Z as eÑ :if ¡{ V  â ‘°_helper_rer/sÌ
J q 5 = n ôWithTraceback(e, e.__t *__†Ù "6, e  Tput((D: ÷  ô pÝ. « T 6[1]…  à ÿ³"Possible ek  el (9sen!%s…Ù N   ‰ ¾   	à (+ £ ) ªQ= job Š! =V! =W$ =X ® ¥A+= 1 Ü K0à after %d taskñ8s' % completed)

def _helper_reraises_exception(ex):
    'Pickle-able h0 P func& ð for use by _guarded_task_genera$ !.'G a ñ  ex

#
# Class representing a process pool
#

c% ó _PoolCache(dict– 1"""W I `that iÜ �ments a c1 Ÿ @the C  O + ±will notifyF  $  v p manageE ð threads every time ' Y ñ is emptied. TheE P !icõ q is don 6  $�of a queuI  ° sò ¡vided whenE ‘instantia ; q . õ »ò_init__(self, /, *args,× óier=None, **kwds6 Ð 0 .¬ Eer =0 b ! „uper()._b Y J 
) ƒ udelitem†   k J ) # D  m 1# N‡ ˜ð  @ ay_ is PimporP becaQtyH Ààkeeps maintainW×workers untilÂ¢gets drainÄ!isØ L �eliminateK race condiÏÀ in which a ê › àfinished aftere L  Ô  œ ´'s _handle_” Ðmethod has en: £another it=; ofO ñloop. In this situq,' P only±"ntP±can wake up   ˆ › !is bd to beÖ‘ (no moreä ps avail)Š ' if< P*      bP.put(‹)Ñ•Pool(objeÍ"''$Í^0supððs an async versionPapplyÞ‰s¿ @argu»!s.ä V V_wrapÚr = Trueƒr@static‰6  ÙP‰E(ctxWþê ´return ctx.0 )	¬è#es£  Uializµ   ÎA=(),–  W 0maxz“sperchildG qcontext …�# AttribuÎ Y k pd early8m" suí HÂthey exist i• z õ # __del__() if !) Ú¨>´ _w[ = []  }‚e = INIT� j 4 Pctx =w Ô ƒ or get_ã ,()I Qetup_\s  , " =!.S+Q‹. #Ê• _change_"; %toO¦ 
Ñ	M  Ó_¨!._l)5ß Ù )  re "a �  | E_/@variŠ   ¨ð8runfÀrkers.
     ô   self._change_notifier = ótx.SimpleQueue()
  8 Ðache = _PoolC (D =" 
Z A ümaxtasksperchild =  s ‘initializ§  (  pargs = %   
# õif processes is None:  ã  õ= os.cpu_count() or 1, 	J :< 1F øraise ValueError("Number o� ùmust be at least 1")¬  Á ô ais not² A and —callable() )Š 3Typ‰ '+  �  J '� É :tryp 5 ÷ repopulate_pool@�except E :ion> ƒfor p in‡ < 
!  £ {Ÿ.exitcodeÆ '   ¨p.terminatÄ  j gp.join¾  : Ü§€sentinelqý Eget_ (QÁworker_handlÌ±threading.T
 (^ o ptarget=i.5 _C )s,)  ê"=(ƒ c“,F iqÇ 3ctx P
I  v !ò1 Ï )inW 2out 	— N |D iâ s › Rwrap_O0ion@ ‰  Ý ƒ “  2Saõ r.daemon = TrueÐ + P_stat?RUN* Pstart'  ¡z ? =  A   š”quick_put+»Dpool. ^AO s Ó M
	) K	( I {   ™dresultw J"C L*	K%geKe ¨ 
+ !* #Àself._termin÷ate = util.Finalize(
  `self,  ù._terminate_pool,( cargs=(( „askqueue9 )in 9out N � N ô change_notifierT Æworker_handl Etask 	¡ S eresult( ß jcache)× ù exitpriority=15R ) © "stNARUN
 ð# Copy globals as function loc óto make sure that they are availableK ðduring Python shutdown when5 ñ Pool is destroyed.9 ±def __del__ž€, _warn= Pings.	 ±, RUN=RUN):5  ,#if× =$   # J ð(f"unclosed runn¥ Àmultiprocess  á  {&J!r}"b I Ð  ResourceWarB ",  =4 h , £if getattrÐ +'_"€', None)1not 
¹  H  Z .; Q.put(= Â>Crepr?!Scls =$…_class__>óreturn (f'<{cls.__module__}. pqualnam % '9  ›   !f'x=6!._ }(  ]¡_size={len.¡W)}>')È Ñget_sentinels( Î 9–$ B = ['²•._reader]°    œ; �B +/[*ƒ ?, *b ]Ú @�icmethod– ´ ì "ó  sö |  .+ R for  1 inV  ”  �s if has‹ 4, "C /")¡ Pjoin_^2ed_=  s(Ê� ô"""Cleanup after any– ]âes which have O õ due to reaching¿  their specI°d lifetime. ¯`s True× j €s were c‰ Red upW 5"""\   b= Fals´ $  Ið i in reversed(rÎ(ªï )ñ  1 0 =  &[ii  #if .ë Ocodeä#/ ®  L   øqdebug('Â  ­$up6 z%d' % i€ 8 ¥ .Ä( J Aed =Ou =delÝ ˆ: ÚÈtrepopult¶8  # Y	, 4!ic3 S._ctx:ÐProcess,
      ÿself._processes,
8 ' = Rool,  inqueueG !2out< K ŸitializerO !initargÒ "ÿmaxtasksperchild€ !ñwrap_exception)
YÑ@staticmethod òdef _repopulate_pool_& r(ctx, P›&, ¤ % /, lZ T  " Þ :Ì  ñ"""Bring the number of² Â a up to# “specified- kðfor use after reapW øworkers which have exited.ƒ   E µi in range(Dp - len(I&))¾  Â 4w =u‚ G2et=z    ,   K$=(• uŒ -   †“+  f -, ‘: ¯)/ ’w.name = 	 £.replace('{‘', 'PoolW{'= Ûdaemon = TrueY jstart(2  tš.append(w òutil.debug('added u'?�maintain=´» 6¡š-|uf€"""Clean3anyÁì as and 9 Š`ments ËUthem.d5""" âif Pool._join__>sç€  }- y"t  H  
Hï[  ‹ú#E �’€asetup_~ s(É  #._Ê # =�°ctx.SimpleQðã0 þ1 •quick_put2 s Â._writer.sen3 Ó f 5 #ge5 Àf._outqueue.ñ_reader.recv

    def _check_running(self):  " 0if  æ._state != RUN  # óraise ValueError("Pool not U &")o Qapplyf ÷	, func, args=(), kwds={}~ 5'''Š ð Equivalent of `<  (*< @, **; 5)`.- P‚ tmust be† . W breturnå œ p_async(` œ ™ g).get(É 9mapÇ ÿ	iterable, chunksize=NoneÏ AÇ à` to each elemá Din `P õ
`, collecting the resultsÏ ñin a list that is rÕ /edó I_mapò w —, mapstarÐ    ,`Like `E À)` method buË esñ ù õ are expected to4be Â ðs as well and will€unpacked @argup…s. HenceF ^`8 á(a, b) becomes³ \*9  `¡ ‰5å > n¢, callback Ó  ªeŸ_! ž ð hronous version†`² 	­@,µ  ¹  Â *, Ò žó	_guarded_task_generation³CL_jobQ
³Provides a D  or V ¡s for imap) 	 �_unorderep%thÈ €appropriCPhandlË> 5ðs which throw excep® …s duringI ÷  .Ä:try“ei = -16  ?n °, x in enum!e(P (bl¥ -   xyield (*i-•(x,), {})c ³ $ Eº  _e• Q á+1, _helper_reJ"s_L tion, (ei j  ° hÆ¤Ä 1Ç=  Õ EÊ`-- can°MUCH slowerM‚n `Pool.( .G } –.E&ifZ == 1^€ = IMapI1torÞ C  ¸ e  v¥queue.put(Ž  !    à    self._guarÿ$ded_task_generation(result._job, func, iterable),
   2 ­set_length' ))) rreturn 9  Uelse:  i úif chunksize < 1  " ùraise ValueError(@  "   %"CF ÿmust be 1+, not {0:n}".format>  B ‡ Ê >ñbatches = Pool._getW*s(@,Î  t€ = IMapInŠtor(self(   .[ �queue.pu³  Å ; OguarõB  mapstar7   A`=’(item forx$ is  "in !)
÷ ñdef imap_unordered†	É6=1)–1'''G  Ù `Like `M ñ ()` method but Y cing ofõ s is arbitrary.C O Àæcheck_running(	),==*i`UÛ im^Ò&!r^EXåvÍ  Nº¹apply_asyncKúargs=(), kwds={}, callback=NoneKeÛ_! vAi ð hronous versioni`ˆ ð()` method.
    €    '''
   õself._check_running() ñ result = ApplyR (3 ô, callback, error_ =  ( ò._taskqueue.put(([(T ö._job, 0, func, args, kwds)], None)J rreturn : 
ž Ódef map_async“ J ðiterable, chunksize=P ³  G    
Ä ! %):" 1Aq ÿhronous version of `map()` method.< È ¾ ¸ wmapstarÁ ¼ ,Y · )_^  n fXmappec ô h  m ! $aHelperÚtÀto implement¶ , à ámap and their Éß counterpartsD Ï ±ö if not hasattr(ð —'__len__'³  B" u = list2 L# fJ1 is� " iö, extra = divmod(lenS  ,  Á –pool) * 4æ J "ifB 
`   d U += 1™!ifU Ç j) == 0> : 2= 0# Q  ™ñ_batches = Pool._get²,s(•F ± �j = Mapyò � _
Ç �  �
  I Ç ` O (   3 qguardedé p_genera§	š;  ?  O6  ¼ ƒ) ¶	R ü 
 TŒÞr@staticŠA  .ð_wait_for_updates(sentinelsj°ange_notifi|timeoutæ D 8 '  — QwhileŒ)ch[ {.empty(‡% Cget(ƒl@classÍ ñhandle_workers(cÅ `ache, Vò, ctx, Process, p	 .eskÚ —C, in@ 3out
 �initializ  ±]<  0max‡ ðsperchild, wrap_excepl&, }E 3’thread = 	 Âing.current_ = ” Ð# Keep maintañ#ining workers until the cache gets drained, unless cpool
  õ# is terminated. òwhile thread._state == RUN or (d ;and# å!= TERMINATE):N  n àcls._maintain_† ò(ctx, Process, p	 e Ùool, inqueue,G  K  2out) À initializer? oitargs@ ùmaxtasksperchild, wrap_exception)
‚ ñcurrent_sentinels = [*ß Bget_‘ (ë E), *0 ]P  ýwait_for_updates(f õ, change_notifier)– `# send ‘ „ to stop(  æ *–.put(NoneD Âutil.debug('Ã ó handler exiting'@�icmethod\ Rdef _. _d  s( j v, put, £ ,¤!i# =ODing. (}  û@for a öseq, set_length in iter} a.get, è 
Œ > ! = Á  V   :try)   #V aw ¶ cannot faiL ,   Ÿ  �  i >seqU  ) #ifï a!a-  1 ¤ Z ¢?fou‹FRUN'â B  Ybreakÿ    ; } Y 5$ E<_ as eÒ €job, idxúask[:2]’  } – 
 ! •ÿ[job]._set(idx, (False, e)±  9 µ �KeyError¯  - Mpass¤ ?elsæ 'if£Z Û doÙÙ/()Æ=01] S@ask � = -1¨  Á   ]  A ?+ 1 coä-ueI =ofinall@  -àœseq = job} ° 
B `Ur gotê“ Ó Õ# tell result+âto finish when‰ Yemptyç ‚  m¢  elp
f °þw	j ª w¦ re” qno moreÈ1 À       util.ðdebug('task handler sending ÷tinel to workers')
  éfor p in pool:  & †put(None5 êexcept OSError2 _util.� %go2 P when™ 	¡  — } G ¡exiting')
, Ñ@staticmethod Rdef _ö_results(outqueue, get, cache)¸ ’thread = 	 Âing.current_ (n  vwhile 1>   :try   �=s (<  @(AQ, EOFK”  (   	Ï â R: /L F -- # A  breturn: #if÷  ._LŽe != RUNÏ kassert- ò== TERMINATE, "TJ0notP "šr   × Zfoundg =J » K ^breakÔ  }0is ºÌ   V1sen4n °job, i, objD9askï ƒ²[job]._set(? '1KeyÆ Jpassk  õ s= job =�   ½} , af úi
n Ä oà’ !PignorEPextra² co2)ue�˜§if hasattr- '_;er'˜>Aensu#Tthat i@ is KfullEð# If we don't make room available:H IthenT # attemptsÑ ad*eš ª  C ;mayB Ðblock.  There«  guaranteed: õbe no more than 2_ )s.J  NiÄ ‹range(10= ³  !if"§ .lo.poll(4  8 ïà                aget()
  ñexcept (OSError, EOF
 )):(  / Upass
 õ6util.debug('result handler exiting: len(cache)=%s, thread._state=%s',N  `  0 - )x @: �icmethod< ÷def _get_tasks(func, it, sizeÄ Æit = iter(itzwhile 1ë  x = tuple(0 °tools.islic Y C  ¹ Šif not xH   areturnª     cyield ª xÙ Ç ç_reduce__(self½ ñraise NotImplemented¥(Z ð  'pool objects can— 0be ºûed between processes or pickled'K ™ \close” ÿ ! @ing ~ '0if É ðz == RUN$	  i CLOSEˆ   sworker__P 0 ÷	change_notifier.put(NoneÔ �terminatØ 
% Ü  ™  �Æe = TERMINAT½   A 'e({ OjoinN	   r  N(RValue "Pöis still running"£+elW  1Ain (‹,Ù Ž Åj ±In unknown e Å æ Œ$  Åç" j$ fÐ3 inx �
p#p.V fOøhelp_stuff_finish(inqueue, ¡ a # ð may be blocked tryÖ`to put‹cms on [ �  ZXQremov5  ÝT from0 a untilq w­ (edƒ¹ 0._r† p.acquirŽ k   × ô .is_alive() andq  ._¼ MKoll(Å $ GrecvÝ i Ãtime.sleep(0l@classÍ4_¿0(cl93ask‚k S, out  ( +, õ,R ~  
‰Ô
a", ¿	åð his is guaranteÜQo onlïµcalled once‚ ÔpfinalizÖ ¸ ' ¡ #ãÚify that the « Y` has bÇò @d so- n ## À_workers looóp can be unblocked (and exited) in order to
  ð# send the finalization ‘tinel all …workers.:  õ_handler._state = TERMINATE* õchange_notifier.put(None)
# OtaskK 	) ðutil.debug('helping =  ˆ /— @s toÑ Uish')= Pcls._6 ñ_stuff_finish(inqueue,I † ·, len(pool)¨ äif (not result, Ð.is_alive()) r(< Õcache) != 0):„  x°raise AssermiError("  & @"Canl Qhave M X with| 0er " | "§ Ÿ œ" ƒ   1out·  
 F0Ó÷# We must wait forH¯ § Ÿõ before terminating$# Ôð because we don'Z %nt  toüö
restarted behind our backºD@joinDc — 4òif threading.current_ Q() is�> 
í
 .q («3# Tô eÊ `which ø å  al yÏ&edÉ 0if ¡sqhasattr²d[0], 'L+e' % sý  æ ¹p< k 
Û    „ .Ã@code Ú'  + $p.n e�   ‹ Ó� � < ‹ ‰‡ H%> ‹ 
 �  V?oolÚ)K ·ZK ‘ÛÛÕž2 ha3yetrÂ l  gAclea~#up¢ Æ %d' % p.pid¸<   p,÷def __enter__(selfì  °._check_runj (U Preturé"lfµL 3xitK ¢, exc_type
 2val	 ,tbf 	Ùñ#
# Class whose instances are rx   ñy `Pool.apply_async()`
#

c> A Rj˜(object):« ðinit__(self, pooôl, callback, error_ C):
  Ðself._pool =   ðevent = threading.E +()( üjob = next(job_counter& Scachei !._ H £ % =¾ " 
Ë + =Ü . d [æ pjob] =  
' @def ×  y( areturn* !._–.is_set(): ¬successful? bif not? ` \  yÀraise ValueEšq("{0!r}6 1 ‚".formatZ G	™ � ’ 2wai2 ç, timeout=None}  è Ò . ( × /geD 
=  Ô   ù T� û ‰< ž × ¤  	ù v99 Kelse- _N , -  ïÅ  �, i, obj ,¿_@   =+ E  � #if ®3and ? 
‘  q  ð�Õ.Z ÛU á [ N__ 
8 e ‰ ÒÏ Ð   3delÂ 3÷ =  %0 = Yzð__class_getitem__¼  ðmethod(types.GenericAlias)

AsyncResul^SApply  � À  # create a1 ð -- see #17805

#
# Cc ñ whose instances are r¾ðed by `Pool.map_ar q()`
#

± B Mapt (€ "):Ö -q_init__L,ÿ, chunksize, lengthhb /._W ¬o	 
å= M«-u = TrueY  Ù[Ê3] *Î & î  Õú $ &if_ <= 0÷ number_lefë0=  Ú ‹ �  ”ýS 
u ©&//Î r+ bool( & %Ç 

,M!_rµ7q E-= 1ç 8 ", 9  �9J )    ôÈ > XÁ2[i*) Û Àsize:(i+1)*s÷elf._chunksize] = result
  Aif s) ùnumber_left == 0:'  2 + Žcallback#  ' O $ ( mvalue)S 3del bcache[- Mjob]+  ®event.set(M " µpool = NoneD Jelse­ óif not success andˆ  
.  × õ# only store first exceptioni  )   ‹ L v = Fals�  "   & �.Ÿ Ãconsider theïø ready once all jobs are d# �   åderror_Ç - Á 
* ñjò

#
# Class whose instanceò ñreturned by `Pool.imap()`
#

c7 ñIMapIterator(object):
áÁdef __init__æ  , m)  ! = 8 *�cond = th“�ing.CondiB( fLock()ßU üjob = next(job_counter& F| !._ ƒ àitems = collec{ ws.dequeQr ›index = 0B llengthc4 punsorteå +{}8 Ž â! =s	\3ter\V¶- 
 u  , timeout=ó7 Awith5  ._x¦ �:try    –  ._ Ps.pop ) ù  I"E(L  XGí "._>0  W  Ï #._? Î B   “raise Sto¨Šion fromó. T  c.wait(-9)    	 -  ' f 8 Î " * &2 TMÖWŠÔ$, ·   Ø S
âÃ4 - £    __Ö#__é •  W# XXX3 
 ð, i, obj):
        w÷ith self._cond:
  #if ªindex == i!  , = ùitems.append(obj)I ( J M+= 1! Ywhileq #in {unsorteŸ  V   [obj =* S.pop(›  s �  : ! ¼ ,  M  À M  FŠ.notify(u Oelse?á ©[i] = obj
‰m nlengthU 3delbcache[. Ijob]W × ²pool = Nonez ’def _set_c K",  )q w?	v 4 # == 	� Ø R c Ñ ü +ð8#
# Class whose instances are returned by `Pool.imap_unordered()`
#

clA TIMapU �Iterator(  *):mf i,f€8Æ¼ U¥�.C`Threadi( ó_wrap_exception = Fals¹Ñ@staticmethodm ËóProcess(ctx, *args, **kwdsT  :ófrom .dummy import 8 H  #  (J Ís_init__Ñp~ 0es=a ,  wializer  – 7=()‘  ô /._L 	G   B )† Ásetup_queues‹ \ ö!in 1 =  €.SimpleQ2 ¾, 1out% - •quick_putšk E.putOY , &ge, k G.getÐ Íget_sentinelÑ ›ì€change_n‰Pier._I2er]N %_` gworkerg  (j M óhelp_stuff_finish(÷, task_handler, size™…# drain . @and Iú ó at its head to make §  l b6try® Âðwhile True:
      ô
inqueue.get(block=False)
$ rexcept & eEmpty:  $ Epass úfor i in range(size)/ p ¡put(None)
= ðdef _wait_for_updates(self, sentinels, chX ÷_notifier, timeoute   p.sleep(   ¤
import os
 ó signal

from .   ñ8util

__all__ = ['Popen']

#
# Start child process using fork
#

class 5 d(objec™  method = '+ 'ô s_init__ë W G_objÓ  ˜ ö._flush_std_streams(¥ )à.returncode = \Z ¤ Ÿfinalizer ˆ_launch(‚ § ‘duplicateŸ² 'fd© ‚ 6 fd: Dpoll+ çlag=os.WNOHANG8 1if £ @ Â !isÃ 
=+tr} Ý àpid, sts = os.D1pids . Fflag* 2 ÓzOSErrorc    9# Cåõnot yet created. See #1731717e :   Ñ# e.errno == 	 p.ECHILD -100 õ î 	 `if pid5 >pidª  A 6àstatus_to_exit F(sts4 v· GDc=R´ $if¥@ is K I Ë ‹Smultiƒäing.connection¤ ™ 	' s!ifY   !([4]À »  3  	 ” 	W ñ# This shouldn't A if f ") 9 `ed sucifully.D # eoý I Ÿ â¯0.0 else 0£b_send_Ê«7sigç V*Sos.ki»H ] 	ß GPoLookupR	% {< ƒ¼ m)P=0.1)E ­A W VraiseÆ‘terminate $
A‡.SIGTERM–? GKILL? X r ,7à ŸE = 1^€parent_rñRild_wÜGpipeõ‡ % / &  y ð .pid = os.fork(3)
  õif self.pid == 0:  ! :try   öos.close(parent_rN     # w# ôcode = process_obj._bootstrap[ ìsentinel=childj ofinall¢ `_exit(e { JelseÏ ¨ ` §  è 7ƒ Ðizer = util.F” @ize( , .Y_fds,] ) 3r, i6w,)Í  :  d .$ M‘
h Adef { Œ )ú ô½ «is not Non!b ( Ä()
import io
 óos

from .context # ñreduction, set_spawning_popen
ifr % ò.HAVE_SEND_HANDLE¯ qraise Iu ÑError('No sup† ôfor sending fds betweenUCes')œ • «forkserver – _  ¸   êð


__all__ = ['PÖ ð']

#
# Wrapper   ðan fd used while launch³ a© ó
#

class _DupFd(object³ È�__init__ËS, ind Pind = üadetach2 - `return› 	à.get_inherited§1()[ø3indÑ aStart %´ 2 usÄ O Ë (X. Š Pmetho± 'sC 'º # =
Ê8S 
 Ã  ”]P  uuper().D > c �duplicate_î >=, fo e .æVnd(fd—_1len; .( V) - 1g _  ,8 É Áprep_data = ‚¦  0araU (È f._name‰ 0buf¦o.BytesIO( �Œ ! ÷§Pdump(ˆ � V, buf8  l+ à- V¾›   •)> ` šôX, w =Ìó connect_to_new_ ß ‹•# Keep a ö� of the w€pipe's w� end as am�+ M £Îð!byP I .4 _3 _Â wos.dup(€ç #^5À          (_óparent_w, self.sentinel))
  õwith open(w, 'wb', closefd=True) as f:/  6 ÷f.write(buf.getbuffer(T l ñpid = forkserver.read_signed(" Ž 
_ �def poll ö, flag=os.WNOHANG)„ "ifÎ öreturncode is None$ ¨ ñrom multiprocessing.connection import wait�  4   átimeout = 0 if‰ F == Œ Q elseq 	8 Rif noP )([â 3], U Ç  k   Ç O :tryÐ  - W 2 ù b <  ñexcept (OSError, EOF
 �  Ñ# This shouldß ÷happen usually, but perhaps theò	 } ## ‰0 itÉ ½ got killed,    .é 2255) K  
Ó$io
 Pos

f ùDtextöAredu Àt_spawning_p3 ,  _Ë 6  ðutil

__all__ = ['PS °']


#
# WrAr(ô an fd used while launching a,ó
#

class _DupFd(object¬ 5„__init__9d  (GfŠd 1 adetach/ + S"fd­ ´Start child�   uHö a fresh interpreterª ò (7. l Pmetho’ '?'ûÛ # =ä è « Ü @C_objN å @_fdso]P   up˜.D > c �duplicateâ_ì =, fJ e .ÀVnd(fdF< 7 z º ÌK { Öšgõresource_trackerÉ  _È&  ƒ6fd(Œ ó© ? % Áprep_data = ‡ G _ 0ara (· f._nameB ù fp = io.BytesIO� P; Ú�`.dump(‡ € F, fp7  Z* Ù 
, 0finŸk = -se™  6) " 02r =õ%_w
       9 ¡«) 'r,G wos.pipe) r pC_r, 3  \ * m5­Öcommand_line(äÐ=tracker_fd,
  øpipe_handle=child_r)
= óself._fds.extend([' ", 	 /w]1  ñpid = util.spawnv_passfds( ù.get_executable(),t €   Ucmd, ˜ ~  ùsentinel = parent_r` £with open( ùw, 'wb', closefd=False) as f:;  �  f.write(fpÈ †buffer()ˆ zfinally9 qfds_to_a Y = []W ¤for fd in “ $r,¼ *w)J  ƒ !if/ ®s not None#  ' u @.appÀ&fdª  $ I³ Dizer¶FÄ @ize( ,Ê¼  (, Y /)
Ë !r*É '1os.~ (¾ £import os

 dmsvcrt esignal y' ó_winapi

from .context E °reduction, ž¨Ping_p) p*t_ G @    �

__all__ö 'PN Q']

# ð
TERMINATE = 0x10000
WINEX ð(sys.platform == 'win32' and¥ @attr$ Â, 'frozen', º)E `SERVICI  H o@.low²P.endsó("pythonservice.exe")


def _path_eq(p1, p2Ã�return p1– �p2 or os.+ Ð.normcase(p1)  02)
Ÿ QENV =Ád 
¨  ,  W_base-™ ¼2s(*Ås¡  Q  U
 s% .CðHÿ(%  _ ñ#
# We define a µñ class similar to the one Oósubprocess, but
# whose constructor takes a ) p objectfòits argument.
#

m y (' Ù 1'''o†Start a x  “ 1run— }code ofl ; C Pmetho¨'¼'Èõs_init__þ° C_obj†  9Áprep_data = A  _ 0araI (= g._name0 # read end­  Œò will be duplicated byÔ  Ÿ<É  † ‚# -- seeƒ p_main()ô“ 6py.+ 
 ñ bpo-33929: Previously,h “ ¹as "stolen"� P æ üÒ it leaked a V1 if\ Ä — had beenH btermin÷ PeforeM ±could stealF T x …ÆÀ process.
    ¢rhandle, w	 ñ = _winapi.CreatePipe(None, 0)
4 ò	   wfd = msvcrt.open_osfB (J 	0  cm0 ðspawn.get_command_line(parent_pid=os epid(),m u  Rpipe_z =Í § w õ' '.join('"%s"' % x for x in cmd)
k Öpython_exe = ¯ ·executable(- ð
# bpo-35797: When runningX õa venv, we bypass the redirectq "# \ ñ	or and launch our base P� ./ ‘if WINENV. –_path_eq(· b, sys.T  ° %):<  ?)  à @ys._g  ð à 	. öenv = os.environ.copy(_ R óenv["__PYVENV_LAUNCHER__"]b Œ \ Jelse˜ j  gŒPwith \ú(wfd, 'wb', closefd=True) as to_childP õ # start processz  ² :try-   ð hp, ht, pid, ti®J (K  :   W,Q» Þ ",  @FalsR!, %   
] \ ‡  ú H®:(ht( nexceptÖ < % e   Vraise  ù	# set attributes of self  !.p3>pid �returncodT ä # Á^ = hp úsentinel = int(hpý € ófinalizer = util.F ( 1, _9h s¡ ò   B .… ,„ E) ;  1ñnd information to ¡Ø !t__Qing_på ¨ 
Ù ©PreducY õ.dump(prep_data,

E  – 4 O_obj6 Ol( -se¹  Óòdef duplicate_forœB", ¦’aassertR@ is Ì F Aÿ h (X ,H ¨’ Cwaitƒ �timeout=´ 0i×.e «!is«$  I3if B  °  E 
   $ WmsecsG‰INFINITE ; Rmax(0io Ì* 1000 + 0.5u(rep ðWaitForSingleObject(7ðself._handle), mwsecs)
  ùif res == _winapi.WAIT_OBJECT_0:-  8 Vcode . úGetExitCodeProcess(self._handlem  @ 2if C ¾= TERMINATEf  * ' À -signal.SIG1 ‘ o creturn2   
(   '   �def poll´ )‡ 4 ö wait(timeout=0)9 œterminate> ,ifn † is Noneb  á :try   ‡T^ W1inti [,A
gîexcept OSErrorc   	Ú O1.0)§  –   Rraiseÿ ukill =   NMclos|ófinalizer()
#
# Module providing the `î ð` class which emulates `threa. !.T
 `K bmultipCing/ 1.py óXCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = ['Base» Ã', 'current_‰   õactive_children',¡i   'pa0 !]
¹ pImportsm i C os

 &sy ! …itertool 4ó
from _weakrefset L qWeakSetu  m ™ðORIGINAL_DIR = os.path.abs ï(os.getcwd())
v@  e ñ Public functionã ?
9(”1'''/Rç 4 jô object representF( ; C Û_$ £ 

 ¥ tlist of_ ‡ °s correspon¡ HQlive ò, )es� ’_cleanup(Áœ  ` (*")
œ 
#› q“ E Ž 	Œ } _# #‹ƒ ¯ U´# check forS e´Ñhave finishedi & K in à L  bÁif p._popen.—’?not=  ².discard(p)\TH ÕQ©(?cÆBsC €ity that+0runÏ ‘a separatÍ ™ ˆ u Àis analogousÇ  ÿ £ Š _Pñ¡  " ƒ� NotImplŠ!edår 9 q_init__; ð, group=None, taó rget=None, name ±args=(), kw \{},
  ‘*, daemon5 %):" òassert group is _ ' ñargument must be • for now'D ñcount = next(_process_ 5er)' ô
self._identity = _current3  1+ (@ ,? oconfig=  l.copy(7 "pai ïid = os.getpid'  ^c   Ï qpopen = Pclosep [False  taÎ2 = 	   É  Puple( Ð ì‚ = dict( $  ®  –Àame or type(„@).__ Å__ + '-' + \€ 	9ñ ':'.join(str(i)úPi in G ®y #ifg K1notm ] ; Œ ¿ •~ Ò_dangling.add­ 
 ²def _check_W [ #if•    t óraise ValueError("¥p object® 8 &")p <runf &''ö�Method to1run3ub-[ P; can •overridde" Qclass×  � T Æ 
Æ :_ "(*  3, * \  3_startÅ 	S! s child ¹ = ™ n 	�öD$ J0can	Š $ ae f twiceM
C ­	®,©'f\only b Û³created by o„ ~  ¨ ”WRget('¸/')‰  $ic_ pes are U aallowe,Bhavep6ren‚ Ž_cleanup’`]P Ð§ sVSnel =ˆ. . ó
# Avoid a refcycle if the‰ð function holds a¶gdirectD �referenceÿ = <Pæ(see bpo-30775*3delŸ Ç, ÇÊ Åm _�?renƒterminatÙ0UT% šð; sends SIGTERM signal$Uuses 0 PÊ”W ®  „¥ ]BkillÉµ Àe process; só!ends SIGKILL signal or uses TerminateProcess()
  5''' ÷self._check_closed)  Ñpopen.kill()
9 �def join(! ñ, timeout=None):"  j g òWait until child p– $ t§ s8  a Ÿ rassert $ ñparent_pid == os.getpid(), 'can onlyµ * aƒ 
P  ö € is not Ú H  estarteÍ J Tres =™  I c.wait()Š0if + f ? C_-±ren.discardr†‚is_alive = |åReturn whetherz1is ; x!ifÛ  B_curxÐ‚  ¿ rz ETruef 
eµNtestµQ Ž !._¨ •  ®‰ RFalseÃŸ Kcode­!poì $   ¦ D+ !isa 	ê Jelse& Ï e  4«  n›å	C¼S the ð† object.ï ðThis method relea'ÿresources held byD f  It i¢÷an error to call t[ !ifC ºmåstill running.¿ªË}
H
( .¯ú WÀraise ValueE· P("CanZ V% a¦ pwhile iì  ¯ % "±  R  ò"You should first))˜ìF()." M Ä+– †  ! =€	� 1del“©._sentinel x~ x Ad = ÆA ‘@property  ‰=namm³F  ! t@ ~.setter@  ,  /°isinstance(! P, strÄ    must be a 6ingr} ! =Z „ Á Rdaemoº} †0 > Î  —7 	`config„"('4 1', Ô½@  é,m )ic¨ À'
        Seót whether process is a daemon
  5''' ðassert self._popen3 tNone, 'E öhas already startedB ; ‚config['k C'] =v 1ic
m ‘@property Àdef authkey(A !):  ¡ creturn’ W , #']M  q.setter< S ,a \ ú 1Set" ôorization key of;U  ‘ 5  ¬ -._– Á = AuthenticL sString(§ )¶ Œexitcodes R +  , £ P or `¬€` if it ©¿yet to stopÃ 	Õheck_closed()) #ify	� 	¡( ?  o.poll(_identþ ( ¿ifier (PID)5artž VÉ
 
“_current_ˆos.getpiJOelse- z 8H andpB.pid+apid = ö  ?sn?nel>ð	a file descriptor (Unix)@òhandle (Windows) suitable foY ôpwaiting  q terminï.d?tryÝ X ûexcept AttributeErrorA ’aise Valu #("´D not¸€") from 6Z 8Œ__repr__L ut=1    '!­status = '8#elF .‡
Î : ¥q9 "paœgid != ‡L unknownM þA xinitialA è5ì	 ? 5if - !is§ ˜
|  -  ×p  l  5 ´O³info = [typ}À.__name__, '	 c=%r' %ž  ]= % aº  e ö .append('pid=%sS  ñ}6nfo0 Û
3  H_pid4 Àfo.append(stsatus)
  õ	if exitcode is not None:!  ( " 4= _ Ô_to_name.get( ,M b  A Ôinfo.append('- o=%s' %2  êif self.daemon‹ 	J ! 'l Àreturn '<%s>\ �' '.join(7 !)
Õ "## ð def _bootstrap(r ð, parent_sentinel=)‚ ñfrom . import util, context\  ì ±global _curL £process, _]   ò_counter, _children£  O 6try€   ß_start_method¼ 3 £ y._force9 ø . O < _¯ ¥ Ñ = itertools.¹ +(12 Å z = set(  5`._clos‰ ;din  4olds - =Ff› cp *lf$ 
u S PäP|(.  V  	.¬ â,Ž =pid(
ã úif threading._HAVE_THREAD_NATIVE_IDÓ w 2 Rmain_ û()._set_native_id- J bû	finalizer_registry.clearB 1 �run_after&Kkers* Q l� ? �# delay ! �ization oce old Aá object until j |?# _‡   Ý�executed3 0delf 4	  
 û!('”‹ rcallingÙWrun()E Ô Y. 	f  0 ÔI = 0 6œ NP_func5qûexcept SystemExit as – ».¹ ©U— ñelif isinstance(eI W, intï Ú   G ) 	ã ;elsš  4 ósys.stderr.write(strg {) + '\ns 5 i 1d 
Ý )  B ›•tracebackF   ” '` %s:\n2ä ö
ÓP §.print_exc®åÂ|shutdowëŸ$ Ø  ™Ewith0 %d›    ï
š E ð_flush_std_stream½û àreturn exitcodòHe

#
# We subclass bytes to avoid accidental transmission of auth keys over network
#

J ñAuthenticationString(_ ó):
    def __reduce__(self   ñfrom .context import get_spawning_popenJ  0 /if  ¢() is Nones  )   õraise TypeError(F     ß'Pickling an Ê p object_ '> þdisallowed for security reasons2 )D _returt ", @+2,)
¿dCreate‘ `represyöng the parent process !_P P S(Base 1):
� ¡CinitŸÒ, name, pid, d 'el´ Ã!._1 î 6= (Ø   @ ! =G c  l Ppid =Z  ¦ _  Ê   ! =å PcloseV [False ¿ % =Ê " ¶config = {}‚is_alive„V¯Smultii0ing¾0necÿÁEwaitg ë@not  "([
š Ò], timeout=0)‚ ‘@propertyD   m� Y O 2pid=  / Ajoin. \  TÄ&''ž«Wait untilF± terminatesŠ  Ç9 !	ý Omain CMainõ(]‚ ì'e [? œÝ?»'§_key':Çõ(os.urandom(32)),Ï Ó õ'semprefix': '/mp'}, ð# Note that some ver's(ÑFreeBSD only ÿd> ‚semaphorzAhave# ?  upŽö	14 characters.  ThereforÖð# we choose a sh/° .j 
 Ð On MacOSX in1 ðandbox it may be ne00ary€ uV > SdiffeX ï -- see #19478r pEverythU2in ©@willt öinherited by descendan2#Ä6es.ÕèÖ „pass


_cçà = None
_curreònt_process = _MainP 4()
 ñ_counter = itertools. ù
(1)
_children = set()
delK ð

#
# Give names to some return codes
#

_exit @_to_+ ¡ = {}

for: ð, signum in list( ñal.__dict__.items()):
    if6 ð[:3]=='SIG' and '_' notE  d ,  0   [-a  um] = f'-{/ ñ }'

# For debugR ñleak testing
_dangling = WeakS ð Module implemen. Q queuý s# multi�Bing/ 1.py?ðCopyright (c) 2006-2008, R Oudkerk
# LicensedbñPSF under a Contributor Agre .sÀ_all__ = ['QŒ Q', 'S£  ‚Joinable Ô]

import sys o
 `thread	& ¦collection$ 4ime: Etype tweakref ²errno

from) < z µEmpty, FullŽ _@8 .4 Bconnˆ Q  ñtext
_ForkingPicklî0con Q.reduÂ .# c Dutilg ð, info, Finalize, register_af �fork, iss -äa 0 usBÀa pipe, buffÉ2nd ` »aclass 4 ¡(object):
ùódef __init__(self, maxsize=0, *, ctx$ ø$if V <= 0  Ñ# Can raise IøñError (see issues #3770
q#23400)†  >   ¿±.synchroniz ÆôSEM_VALUE_MAX as† >  » #._» / =   pBer, .  wr¤6 = ðö.Pipe(duplex=False¡ 5 Prlock4 Œtx.Lock(! ÷opid = os.getpid!  if	ú.platform == 'win32'Ij wj ENoneè Oelse- 	c— 3sem¶  Boì³dSemaphore(6É µ`use byõ current.futures� ¨ €ignore_e€1 = 6# "reï 
!
 ¦Í.$)ÑƒgetstateÕÂ©ñ assert_spawningV o (._â =5 Z,ï  Ü  1C9 æ 4sem  G	Ó sÓ !, á Ú ­ 6¦ À, self._wlocÄk, self._sem ó opid) = state
  ' �reset()
 ðdef _after_fork(# !):  5 Ødebug('Queue.( 5)')%  4 "._W K X=Truef !  - ', ' WFalses 'if Š  Ž  < á._notempty._atµ `_reiniÓ  %   Oelse; 	ö = threading.Condition( lLock()ã ð buffer = collec4 Œs.deque(+ K l = Non�Ojoin  Ácancelled = "nOclos |  send_bytes7vwriter. k Krecv3  ;6er. 3 Epoll` -   t1putlÁ, obj, block2 , timeout=:
 û 
ßñraise ValueError(f"´  {4 r!r} is 9 "«fif not>‘.acquire(� Š …  ]l BFullÏ   CwithH Ÿ
¡ #if ù!is
%  J  ° ‚._start_, \! ‹¶.append(objÖ % ‹ x.notifyô$ge€ì {ay D andò ¤ õ
[r&
  í rÍ“7¨sem.releas³/"if“m €deadlineCôime.monotonic() +Ê  Ÿ 	fÃ h < lEï	T >try› µ  K W5 = Ã -° Ã 	e  6   	Á  Ç(L  ,  ¹    .elR K G 	÷ p Sû   ofinallQ 9 ³6ò# unserialize the data½ƒ having 6 d  ¾a÷return _ForkingPickler.loads(res:Qqsize.&À  # Raises Nò2otImplementedError on Mac OSX because of broken sem_getvalue()
   Pretur ðlf._maxsize - se Ðsem._semlock.> _? 
>  def empty(/ !):   U 3notI qpoll()
!  6 Ofull5  K u  z xis_zeroB ¯get_nowaitH 	—get(False| )pu: ^, obj¼ ‡ œput(obj, D \closey 3 _ �d = Trueñ  6try  - qreader.4 •kfinall2 % # =R _  R 1if  
h   l  f = Non˜      `pjoin_th¡ è Ødebug('Queue.( &)'XTasserÿ^ Ad, "4 p {0!r}  s".formaÊÕ #ifì  d ‹ 
Ü Ø  À pcancel_ Ç /  Î j ) /leâ � ¼ .; çñexcept AttributeÆ
ã Fpass7o_startÐ 
*  Ë W0# SF  – ö which transfers data from buffer to pip3 g.clearÓ  [ =d Ring.TK†  uqtarget=y._feed,  Qargs=~"._p ,1noty ªsend_bytesB  f  4 wL1 Dwrity €ignore_eî G @on_qú° @er_e{C Jsem); Rname=,bFeeder	'é 3<t.daemonG. |SdoingØ m.(êõ ÷ 
 I �... doneL 0 !if±¤  ÕÎ:led±! y @ = FÎEize(M ¢ $, / ¼
M 8 Ã[weakref.refj .)]- ý exitpriority=-5�  X ð # Send sentinel÷3theÂ ó *õect when garbage collected] Ûþ  $ ò 4 
Æ [* ÿÀ, self._note‡mpty],
  ù exitpriority=10 !)
 Ñ@staticmethod ñ	def _finalize_join(twr):  ] pdebug(' õing queue thread')&  v = twr( #if+ Æ is not None\  ` : .` 9   z 9...v  + e} ;elsU ;  al¸ 2y d¾ ¿ Ðclose(buffer,Å e|"Ltell"‡ to quit*EwithF 
d ö.append(_sentinelO 1not� �.notify(Ú=eed¼ ñ
, send_bytes, writelock, ë ê, ignore_epipec¢  onerror,“N_sem
PstartÜ �feed data  X ¥nacquire =. ¡ö ireleas$  $ HwaitE    pbpoplef! h " p5 = | úif sys.platform != 'win32'Äwº & =YÎ  Ò w¿ 	)  v Ú`  L×P jhile 1Ž :try  * po  0    ifœ :S  #   nsX  alŒ  5 ö 8  � wî  M  dobj = õ[  ) 0if ,  ispß  4 [ Ñ$erÞ5got? @ -- ‹7ingå ;  o›  0 freturnç   a# seri¾B thedrbefore ‹‰ e ãYC    ú= _ForkingPickler.dumps(objƒ 1  5if “/isà )  {Y ûB  x BDH   –  , Í
 !  ã¡  Ðexcept IndexEQuFpass´À   except Exû ception as e:
  ñif ignore_epipe and getattr(e, 'errno', 0) ==  n.EPIPEK  Z mreturnf ÿ+# Since this runs in a daemon thread the resources it usesK  ðmay be become unusable whilb ÿ
e process is cleaning up.K  #Weþ  Ú 0orsE ñ ch happen after— R /ha‘ ¢started top l  h¿s_exiting()>Pinfo(s or!@queuÒ  �: %s', e)Æ w?elsó  1 ‘ðe object has not been sentƒ  ”‡ Ÿ, we need€ #ü pdecreas² ‘e size of>A R. Thego acts K š i6 — d“ öilently removed from` ˜  Ðv@step ne0ary³ `have a1ßperly workingL È   €_sem.rel(©aonerro[Qobj)
M Â@staticmetho`‚def _on_W yfeeder_: A1"""F  =ðPrivate API hook called when G  DdataÜ�backgroun hK Ãraises an exCà.  For overridK öby concurrent.futuresi› Àimport tracev i  ð.print_exc()


_„cinel =£  a#
# A A typ÷°ch also supd �s join()ÌÂtask_done() a s
D 0Not©Áat if you doþ 1 5 ð for each finishç0askxàn
# eventually ð counter's semaphore ¯ 3�flow caus9±Bad Things
<rð .
#

class Join×Q( "):/ð_init__(self, maxq§=0, *, ctxa< /._1 , =0 � Q D._unï _0s =V $.SÖ &(0à2 Ccond& PCondit ± —² 0getée¶ £ r6 ª ) 1 + è  ._e ", q £ Ml sl !, z s l ) _[:-2]â } " =b V[-2:]§1putº ,Â÷, block=True, timeout=None˜ #ifß fclosedç H”q ValueEG!f"È   {0!r}áðclosed")
       ÷ if not self._sem.acquire(block, timeout):
  µraise Full
 CwithH “notempty, JcondA #if êthread is None%  q ™ Rtart_, %()s ! ÿbuffer.append(obj% ÿ	unfinished_tasks.releaseR Ä ’.notify()ê @def = `_done(ž ó j‹ wWFalseS  ã   rÆValueError('† ñ) called too many¶*s's|  ø î¯._is_zero(�   ë  ._× H_allOjoin8• @wait� ð#
# Simplified Queue type -- really just a ô òed pipe
#

class< e7  H ecür û�__init__é ‡, *, ctx.& Ó$erþòwriter = connection.Pipe(duplex=óc  êC  �  4 wtx.Lock¤! cpoll =Fq . H  ðúys.platform == 'win32'fO wp  †C ;els“
- c� 4  "Mclos7 ¦ " � &. P Ioggreturnº ú  þ A † £__getstate¬= òcontext.assert_spawningd x  F c  "._» 
Ò r; H,:__s‰ !, — � c # ü à ± G 	  Ð¶ (  1getr ‚ ¸Í 
!<resR §recv_bytes˜ð
# unserialize the data afþshaving rd  8— p÷
_ForkingPickler.loads(resT"puÂ  , é­ /#   rbefore ` ƒ  ™ 	z lobj = y Pdumps© RXå´!# Éñ	s to a message oriented �r  a– Utomic ÇE cr.sendh ë ) ™Ãž  U   Y Àter.send_bytñes(obj)

    __class_getitem__ =  ñ<method(types.GenericAlias)
#
# Module which deals with pickling of objects.1 ñmultiprocessing/reduction.py! ðhCopyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

from abc import ABCMeta
import cv 3eg
 ”functools $io
 o ä e esocket #yst .r ácontext

__allb÷['send_handle', 'recv €ForkingPM"er! Bgist ñ(dump']


HAVE_SEND_HANDLE = (sys.platform == 'win32' orð ô ’(hasattr(Ç ÿ, 'CMSG_LEN') and5  5 ¯SCM_RIGHTS7 .s  �msg')))
ù A sub�A
#

	  (‹.0 !):¯ 3''' A   u5;by ‡A.'''4 q_extra_–‚ers = {} c"ð _dispatch_table' . Wó	def __init__(self, *args¢  ‚…super().' ! u   ;elf\ 0 = L /._” . /()B 	q.update“ .ô @iÿK  Ì "re`(cls, ", ,Ò C'''R( # a  R`ion fo© ; u ç <cls‰ [% 3] =C R—  
s” ÷obj, protocol=Noneš ÷buf = io.BytesIO%vcls(buf<  ).V # ¡   ðreturn buf.getbuff»™ @load0‹ $

1+ =³.  

Yl f, file† Â XAplacÖIm > 0) uRh Ú2
g í zl;Àspecific defÈ¿ions
#

if c}‘# Windows<ó•+= ['DupHò�duplicatÿTsteal ]: ‘r_winapik18 (>“, target_\9�, inheri«q=False,V  Í ™*, source= 8 ''µ ¨ 2 a r J.  (t 5 is Ä not a pid!)ƒ r ecurren§ 3 = Û R.GetC Pž n	¢  k  Ým Y   
Æ  œQ Ø Ð
        if t÷	arget_process is None:
  t$ …= curren6 - õreturn _winapi.DuplicateHandle((  \ dsourcey 1, h$ *, m ,4 ö 0, inheritable,i ñUPLICATE_SAME_ACCESS)
< ¢def steal_b (y $idu )ï @'''S- # a‘ e from Ödentified by J A.'''n Ú w % =® ROpenPp
80PROÁ ÷_DUP_HANDLE, False,s )p 6tryÁ  � ‡ 0 È ” ± 
‚ / § BGetC	Î D), 0« Ÿ  3   7 D­% |  ÆCLOSE_SOURCEï kfinalló ] DCloso× 3endí U(connò û destination_pid 6endÐover a local F  ec7 	ƒdh = Dupˆ¾,… Q f ‡.send(dhÏ HrecvÏ 
¶ Receive¹ Iq  _ £().detach(x WclassÛ jobjectz PPickl°° wrapper fo3
)öef __init__(self“ ac `, pid=¢d  ] if ¿   ´# We just d•D theå!in Øï5andv F   Q# let. rS5ing0 h Ý > öpid = os.getpid(× \  g)á ª	q  d  W.(l ¬
 8   … ú	z  -   ,!$, ÄÌ0ý Ø E v Ü *
? Ø c # =l 	• " ‚2pid a  #Ø $ [C'''GòÏ ð.  This should only be calle )ceÕ b •# retrievr	WTwhichV©ly owns it¾ 0if � .‘) =D
þp TÝ has alread¨ ðen duplicated foûr this process.
  ùreturn self._handle$ ò# We must steal the ' Q from ] Ó whose pid isR :pidt  , ò = _winapi.OpenPœ ( ùPROCESS_DUP_HANDLE, False,š É  Î Ipid)2 Itry:  4 } ¡DuplicateH(0  4  Å ,â ,Ò ¤GetCurrentØ )¸ ¥  ac˜á F úDUPLICATE_CLOSE_SOURCEÏ ofinallÓ  Ì DClosÈ  ³ r)

elsea# Unixß ð__all__ += ['DupFd', 'sendfds @recv ]/ Ñimport array
 ð4# On MacOSX we should acknowledge receipt of fds -- see Issue14669
WòACKNOWLEDGE = sys.platform == 'darwin's Cdef ¢ `(sock,X )Û  L ¢'''Send an© z @over €AF_UNIX < aet.'''Ê  ;  ¡ =6 .å B('i'` $ ömsg = bytes([len(fds) % 256]¦ ] .¦ Ámsg([msg], [¯ äet.SOL_SOCKET,† ¢SCM_RIGHTSo K 8if 1and5 .›¶(1) != b'A' Ê òraise RuntimeError('did not’(ve¦3men¢&')f b 1fds· j, sizegRÛ I j-a h=]_p  & Q.item *„ Šð, ancdata, flags, addrC1ock" €1g¶CMSG_SPACE(e )z !if" ä h .a _1EOF[’ g
¼
D  §'(Ãˆ   0if _€ è1B ésqved %d = H 5' %¯  f  z 
— Ácmsg_level,  Ctype  Š ³”"[06c Aif (2 >  Ù ÿ 	M andŸ 4  f 3 0“i  À 8  “  ŸaGN!= 0I = MBValu4‹  a.û;Ë _ ' » y 0256£omsg[0]w 	‘AssertionT ¥ @"Leng¢{0:n} but \ ð is {1!r}".formaOt(
  ýlen(a), msg[0]))- Öreturn list(a ñ
except (ValueError, Index )):H Epass Âraise Runtim: ñ('Invalid data received')
5 òdef send_handle(conn,  ÷, destination_pidz “'''Send a, à over a local F  ec7 A.'''i  'ñwith socket.fromfdp ¤.fileno(), uAF_UNIX úSOCK_STREAM) as s Á ‚fds(s, [» ]ß Hrecvß 
Æ RÉ s ² Ð V1)[0]«{DupFd(fŠRGùa wrapper for an fd°popen_obj =¢ñtext.get_spawning_! (ˆ1if  4 ºis not None~µ * .¥  ñduplicate_for_chilÃ h úelif HAVE_SEND_HANDLEe  /õ
 . import resource_sharera e� # • (fdv sÊ >vÐ('SCM_RIGHTS Z"arð to be availableMñ#
# Try making some cal  ± types pick @
#

yó_reduce_method(mšûif m.__self__ istá  getattr, (- �class__,: ò func__.__name__ó (elï E r D b 2 _C˜ ¿  f(1 µ  {‹�register(õ ª(_C().f), ì /)
µ_descriptor© 1obj� ñ è 
|  W.·-nd� k *)
7 ¿int.__add__7 
Ã “partial(p¹ “_rebuild_  P, (p.¡€, p.args ô keywords or {})	9 (5 3 1 
l  " ctools.m 4 *5 %**7 ó 4 «E 0)

ÝCMake Ëöif sys.platform == 'win32',ÿþ#(s¹  6Û°êADupS1äXR 5, (+ B(s),ô ¦�) ((d| M “ds.detachý4 . Àuce_socket)
ò
else:
    def _reduce_socket(s)  ñf = DupFd(s.fileno()):   `returnA SbuildB ð , (df, s.family
 @type Rproto@ z 9 7 5 3 1 ‘ ò fd = df.detach(K ‹ Ä . (L  ", Ç 2=fd= ’register(4 ; ,Õ ñ)


class AbstractR50r(mŠ   ƒ=ABCMeta?4'''+ b base ? ñfor use in implementing a Q Btion* e—suitable 7 `replac4 Ñthe standard Å? ‘mechanismC @usedn ñmultiprocessing.'''  úForkingPickler =  $ $4 =   @dump�1ump çsend_handle =   Frecv  
 öif sys.platform == 'win32'ÿVstealD  D  
€duplicatƒ   DDupH¡    F  ½ 3fdsÇ 1fds$    ¹  
  )1Õ \Pmetho¼
 ; 
  _descripto� : @�partial =·	 ( Ì&  $ 9 %  Ñ ·ø_init__(self, *arg5#(Ã†(_C().f)Q}P�/ ½list.append4 ? ¿int.__add__? £functools.M²  t  ,4a#
# Weðña background threadÕ@sharÌ Rºon Unix, an g @s onQ €indows.
^ ñ
A client which wants to pÏµ a resource¹ s it with ? 0
# Š !er|  gets an idž@fierBrî‘.  The unc  » Uð  will connect
#† b ` ,s} _  ò rits pidÿ Ðthen receivesN %heÌ  û ¤
import os
 esignal Í y' |°ing

from .ˆ J Ç  tcontext ^  ÿutil

__all__ = ['stop']


Ð5 +6 ADupS²  ;  . s(object\ ! 1'''´ wr3rR"a /â . Ðdef __init__(çself, sock):
  @new_ ! = i.dup()" ûdef send(conn, pidC  N „share = O . (- 	M  ,  H .R q_bytes(+ 
t  ¯ ñ._id = _resource_( °r.register(C ,r uclose)
o  ¸ pdetach(O µ ¡'''Get theø ðet.  This should only be calle ece.'''^  É Nwith  @get_ã aection|  Ë P) as  
€ H Ù ! = S.recv
 * dreturn² Afrom< CR
else` ò__all__ += ['DupFd']aclass  w(objectð'''Wrapper for fd which canú used at any tim q�__init__÷ <, f,  f×!osk*fdå  D  Øm
Aredu]Fchandle2 a §	­ Z #(ï  T  2os. ? 
”  > Â�E „!/fd€hVW„WB)


7#_RŽSñrAƒ'''Manag=¹õ
s using background threadQ œ	:£~ukey = 0Ò @cachv+{} clock =g ‡ing.LockØ? lH«ner = NoneD address Á  Eutil ³_after_fork=."  ! 3 ß³Rend, XÚ °C'''R g", È kÕan identifierg : ´ÿ 6ockS   iêDlf._ü !is
&  * B WstartW  °E+= 1T µ[A skey] = Ëæ 	3 Ó  ! — %, > 9Ñ@staticmethodA  KŠZEP —¯ Tô¦to receiveMdo	V6 .G Ñimport Client‘  W , =V  3c =0 (( ó	authkey=process.current_ 3()." ²cð((key, os.getpidc()))
  ‘return c
 ñdef stop(self, timeout=None):"  7 ð2'''Stop the background thread and clear registered resources.'''
E   õfrom .connection import Clientp Pwith ’ f._lock‰  D #if ð address is not ´ 
*  . 3c =^ ã #._6 ,m  &  ó	authkey=process.current_ 3()." WB pc.send(�  nclose( í Qc.join(‹+  . —is_alive(±Ž   óutil.sub_warning('_R�dSharerÈFdid « ;  'q 8Î when asked'« Ö lOner.ý ! =ÉžK ½% p &  for key, («!, — C) inX¿cache.itemsT3 ÇA &()h¡_afterfork‹¯’ (Š (
‚ Ç  RP._at_Š w_reinitË _G`P ß
 Ž Ñ á9  °m_startD[LŸ ?  
cassertìå  ´P, "AlÖty have > "? Oqdebug('‰ Eing G  ·  Õ a   whandles#â 8 =j ([}M L ] . Ã 3t =ôQing.TÆ‚(target=; VserveÐö t.daemon = TrueI .>? 7= tþT ¶òif hasattr(signal, 'p? —_sigmask') À( .& ? Ã.SIG_BLOCK, ) PvalidM Wnals(
zwhile 14:try  s �OÐ.accept() as Ñ6  : Qmsg =  W.recv*   0if ) !isüJ  , Ubreak~   ÐpdestinaYÐ_pid = msg
    ýsend, close = self._cache.pop(key)
4    try:  -  T ÿ(conn, destination_pidM ofinallQ Ÿ (= nexcept… þ	if not util.is_exiting()* « 2ys.J rhook(*s ó_info())


_resource_sharer = _R S p()
stop , . /
# ;ô
# Server process to keep track of unlinked � �s (like Ã ù>d memory
# segments, semaphores etc.) and clean them.
#
# On Unix we run a se‰ QwhichŒ s� &
#� c. The > 1ignx aSIGINTy qSIGTERM ÷reads from a
# pipe.  Every oth of¬  ð gram has a copyôthe writable
# end  R @, so× úget EOF when allb €es have Uped.
# T(  [ Ì “‚õ s any remaining b namesTPThis  ðmportant becauseÌ õre may be system limits for suchR  s: À
# instance,? 6 €only supb  F �ed number ‘ d,{ ! â"d-1/q live ið RAM. If a python€—Rleaks§  ¹Œ š %isº Q will³ be+`oved t  Wð
next reboot.  Without
# t6R l	p, "kill¿“ p" wouldš €bably leÇ¥)edš1

iŠ4 os
 esignal y  th�4ing 0waré1s

°#. L [spawn  ¢ð	

__all__ = ['ensure_runE À', 'register %un ð]

_HAVE_SIGMASK =íRattr(¬ B, 'p� ð_sigmask')
_IGNORED6 sNALS = / .{", >    ð)

_CLEANUP_FUNC2 {öð'noop': lambda: None,
}

if os.N² == 'posix'{c_multi( ; ‡ 0 ashmem
h @# Us("m_¬ ()í—!upG¶.5   Î7 G@missŠi+P²2bui¸`detect†#heK pabsence*^POSIXz   I½at case, no# D werP e¿aopenedz"nol#upªPbe neŽ 2aryÖ %ifäCT, 'se#'ê¾ÀNUP_FUNCS.up‡date({
  õ'semaphore': _multiprocessing.sem_unlink,6 !}) û_CLEANUP_FUNCS.up] à'shared_memory] Úposixshmem.shX ñ})


class ResourceTracker(object):
v ñdef __init__(self):  Ò   ð ._lock = threadÄ RLock(´ & ›fd = None> %pi  p Lstopm Vwith r †  d #if Qfd ish 
!  % Ñ# not runningm    breturnõ  P# clo˜ð the "alive" file descriptor ® gs mainö  C 0os.@ eË F._fd  Í 	“ £os.waitpid> opid, 0B CBgetf: °sensure_² H
 �2  · U €'''Make V s that rQ" tR à šw .^  °This can beœ” from any6 ô.  Usually a child † will usS ¦~ õ
created by its parent.'''hS ; ¿Ws ñ  was launch€ `efore,þ Pit stµ ?‹  
  Éacheck_r(n $  C# =>P ( M  ) Ö < Sdead,© � it again+ Æ $ ô# Clean-up to avoid dangling¯=es.8 >tryQ · 0# _× yP if t,N4]otherd O dpythonŒ ð, which has star(=_Ê²  N ¥ £ !isW £ Ë  2 Î ) €except CèP_Error[ U# Thepµ Ö  al�Ðy been terminÑ Mpass8 è µ¸ §      ÙB 0wark ÊDrn(''¨ :Žö died unexpectedly, ¦ l  2'reb rV  Som	ö s might leak.')l G pfds_to_ó Y = []¶ �2 ð.append(sys.stderr.Eno()šÀ     except ËException:
  Ipass ð*cmd = 'from multiprocessing.resource_tracker import main; Y(%d)'O ùr, w = os.pipe() >try’ pfds_to_™ š.append(r7  Ã ## ˜ ù will out live us, so no need to wait on pid}  F ü
exe = spawn.get_executablª  - ðargs = [exe] + util._ _-û_interpreter_flagsí C  += ['-c', lM% r]˜ ò# bpo-33613: Register a signal mask thatý @bloc e  /s.Q  CThis  @ 8ò
be inherited by the child_ �is goingP  Rto be;bed andŒ wprotectI  Ð a race condi‰Q  Ð ‡can make@ ó die before it rÌ zhandlerÅ lÁ# for SIGINT  ÂSIGTERM. TheTis unR  Æ fgõ bÌ ˆ þif _HAVE_SIGMASKò &   ÞÀ.pthread_sigé( ðSIG_BLOCK, _IGNOREDS NNALS O  piÊ§Ó vT�fds(exe, º', nF ofinall¤  _ Ø 9/UNÚ eÈA®os.close(wÄ YraiseoNelseD pself._f3w/  ì  QH%– 1r)
R Àdef _check_a­(W )‹ @'''C | ‹ 4á has not been è «�sending a
Vbe.''z�€# We canH @use = € here asWücalls ensure_running, creat
š# a cycle@os.wGÕ  Iö, b'PROBE:0:noop\n'žÊ† OSError m§return Fal¹µ' FTrue_Í† Ú, name, rtypehT " D of ÛV with é	] ¶ ._Bº('REGISTER'l ‘ `“ UŠ· • (ðUNREGISTER', nameô, rtype)

    def _send(self, cmd, name' :'  +  ! õ.ensure_running() ýmsg = '{0}:{1}:{2}\n'.format(V ö .encode('ascii'G pif len(‚ v) > 512�  … ð# posix guarantees that writ  o a pipe oI s ¥n PIPE_BUF® K  by4 ò are atomic, andP 2 0 >=… 	9 ðraise ValueError('¯ — too longÎ nb Q= os.¢ f–._fd, msg÷ tassert 0 = " 3, " •{0:n} but t {1:n}"e	¤ 5 ,, ó
)


_resource_tracker = R T :()
â= = 7 q
registO ,  4
un T  o
getfd%   

µ‚main(fd)t'''Run á  á A.'''Ð# protect the Ácess from ^Cöñ"killall python" etc; rsignal. ( –.SIGINT,  B_IGNÐ  1 OTERM2 òif _HAVE_SIGMASKÔ  ¤E ÷.pthread_sigmaskU  _UNBLOCK, � @OREDE CNALSáófor f in (sys.stdin,  3out@ l 6tryy   wf.closeå�except E :ion0 BpassV‘cache = {k€: set() ‹   � ñ_CLEANUP_FUNCS.keys()}r	‰ b# keepÑ ÕE6ed/3%edûsC  ¿ €with ope'Ê, 'rb') as fµ  • @line”   E 	Œ    Ó0 = G ¹.strip().deá—.split(':K   Àcleanup_funcû
Aget(:b, Noneh 7  9if F !is- 
ï 1 È;&  ”f'Cannot ‚  {÷}×”automaticƒ ": y>  ˆf'unknow´3ype2#}'¾7  ä ÿmd == 'REGISTER'á ‡[9R].addWæ 'el[ /UN] oremove` _PROBE¸ Iû   Oelseï ÐdRuntimš $àcognized commaû nd %r' % cmd)
  �except E Mion:"  1 ?try   Bsys.G chook(* ~_info()s  4 0 T ApassŠ gfinall~ ò0# all processes have terminated; cleanup any remaining resourceV  ƒ ¢for rtype, ¡_cache in 	 Š.items()¤ (if- 
  U )0warˆ  s.	 $('� ñ_tracker: There appear to be %d ' Z  ð'leaked %s objects@ ÿ up at shutdown' %P Q(len()!Ë Ç>ÍÄ  {1nammi Oô# For some reason theý  which creùö and registered thiìy #� has fail+ Do un; ð it. Presumably it+ 7°# died.  We” Ðrefore unlinkC 1   µ ñ _CLEANUP_FUNCS[- ](<X	‘^ as eX [    �?ing–`%r: %s>u ?, e ¤ [  ýð """Provides sha pmemory �direct acÓt acrossåñ es.

The API of×ð package is currently1 ávisional. RefeGòthe
documentationr ñetails.
"""


__all__ = [ 'S  MŸ #', óableList' ]


from functools import partial
 Dmmap $os
 Terrno estruct Uecret*  ›�s

if os.ò‚ == "nt"Ïf q_winapioó_USE_POSIX = False
elsÿ0 ®posixshmem4 @TruePO_CREE 1os. @AT |‡ ðO_EXCL

# FreeBSD (wðperhaps other BSDs) limit ¸ �ð14 characters.
_SHM_SAFE_NAME_LENGTH = 14] ƒ #QblockJ p prefixì Q L APREFw'/psm_'% !wn% ð

def _make_file¹ ý!"Ccp a randû! L ’
Ô†!."a€# number½? Abyte1useC  m - n 1= (« ! - œ ì q)) // 2B ðassert nbytes >= 2ý, '_SHM_NAME_PREFIX too long'
    name = & ñ+ secrets.token_hex(nbytes)8 °assert len(C 3) <E BSAFEp aLENGTH. areturnm ñ


class SharedMemory:& ñ"""Creates a new s# ! m$ ñ block or attaches to an existingD 3  !.
 _EveryS ñis assigned a unique¬ ñ .  This enablesG ¡one proces€ c± / aY ñwith a particularV G õso that a differentW 3canä  â ' s§	Ü F RusingO (  ‘õ AKÁresource for¨  / ´data acrossy 1es, )edsø ô	may outlive the original= € d" —m.  When 2µ n€´er needs acMFâmight still beH äeeded by other‰  Æ  ¡ ñclose() method should be called.D ¡ w :is ª l 4anyj ,ç G ounlinkm  ÈQensur<ò per cleanup."""Ÿ´# Defaults;p Ã Eand c pto run \¢out errorsÎ _úb = Non#�_fd = -1¥ Y_mmap 9buf óflags = os.O_RDWR8  od$R0o600 ò&prepend_leading_slash = True if _USE_POSIX else Falseè ñdef __init__(self,=´ ", @=0 ’, size=0) ®aif not V >= 0   Àraise ValueE0("'B `' mustúpa positÃ‚integer"Î > #if~ 
U  £ $._›_O_CREX |$ A   "if� =�   ¡ gnumberšfrom zero´ ó!isô )!4elfµ &« JEXCLÚ Ž   M  ' €@only3 — Ò™ á"")Ê Ò 	ì:   "# é ê
#  Ð ÚÀ 
   D QwhileW     ±  ¿�make_file (Õ $  th  ç /_%ñxshmem.shm_open(ø1   u ," 
_  `) Rmode=.   U ã ðexcept FileExistŸsError:
  �continue! Ðself._name =  & Ybreak Nelses  A � = "/" +N B if c ðprepend_leading_slash G ) 	]  É 6 ýfd = _posixshmem.shm_open(1  5  € , O Olags! Rmode=&   E ) -  s ;>try ÿif create and sizD  È Òos.ftruncate(h 1fd,1 ˆ  ptats = 5 Estat1 +   izè & Ps.st_‚ Ø pmmap =  . V ‡ Ÿexcept OS‹Ã ~unlink(– iraise
ˆ ùfrom .resource_tracker import register3  ©  ˜ö, "shared_memory")f  z:  vñ# Windows Named S< ! M< 
+ ÉäŸwhile TruÜDtempq _make_file¯  ()/ 
 � is None ± CN‚reserve ò  ò ÿ block with thislL òuntil it can be attached to by
	r 7   "h_,‚_winapi.• ¿FileMapping­ ; 3 ÿINVALID_HANDLE_VALUE¨6 ONULL& ßPAGE_READWRITV (Ó >> 32) & 0xF c 2 + ÷C è D    `last_eû@_cod×MqGetLastŒo  =   =if D $= E €ERROR_AL9ŽY_EXISTSí H  !if^ ¼1notÀ1  9 ü ,RExistÌ0 3  qerrno.E› £.   oõr4(> )?  š* E	  ž   ¸À               Ÿcontinue
   Ðself._mmap =  . ð	(-1, size, tagname=temp_
 )L �finally:  j ÿ
_winapi.CloseHandle(h_mapP ˜  p 5 = | ^ ibreak
 Nelse‹ 	T  [ 	4  ¥ �# DynamicÌ ð	 determine the existing : ÿ d shared memoryI  qblock'sFò which is likely a multiple ofw�PAGESIZE.L &4 = BýOpenFileMapping(1  Ê - ïFILE_MAP_READ,+ _False  ë 4 ±/trùWp_buf» �MapViewOfÀ ¹  ½ ò ’   Ü  / 0J  	ø  L ü ù
ª õ n*ñVirtualQuerySize(K Ô ´À Ë)&8 u   ï  ¸ÞRview(  i F ±def __del__ )q= cú(Ã æexcept OSError>  hBpass­ g nreducej zreturn Kn š__class__þ
*  k .  
)   2  4
2 ) 	#Oreprº 1f'{O ¯ !._fB__}(  › 2!r}�=  } 2})'"‚@propert† 0<buf“#"A« Í u @ents  ß	Ð ¾%."h« ?bufz  ­ { aUnique8ñ that identifiesZ{ aported2 = „  i ž óif _USE_POSIX and% úprepend_leading_slashi#if,  Q ÷ .startswith("/"Ò   /re� E[1:]‘ /	. 3 Ì3 óŸ in bytesˆð size

    def cÓlose(self):
  @"""C õ*s access to the shared memory from this instance but doesJ ¿not destroyB  •block."""0 0if Œ �._buf is @ FNoneœ  £ # ¥.release()B 	  0 = >  _ Ommap`  $  .c_   `  ã_USE_POSIX andÎ zfd >= 0Æ #os^ Ï /fdÅ �fd = -1
Ã ¯def unlink² ÑRequests thatm«underlyingºx4 be›2ed.a  =€In orderõóensure proper cleanup of resources,‘ ¡ should beª  I €called o(Aonly À) across all]  dÓes which havexK €Æ >;namB¼.Æ õ_tracker import unregister‚  Ñ ÷_posixshmem.shm_‹ ._d 
ÁF ®# 2, "F_F°")


_encod¨ð= "utf8"

class Sr‚ableList?ð"""Pattern for a mut" ò list-like objectõ Rvia a dÓ }  CÄ  It differsÖ Ìailt-inX … type in]sè t Qs canª`change|pir overàðlength (i.e. no append,5Aert,� Retc.)ƒðBecause values a �`d intoï ~°view as byt…žQtructP @packObformat(rny stor ] Ð must requireš 0mor½ Aan 8F pcharact to,�cribe itsR 1mat}+ =# T @aread�organized° rfollowsËR# - 8Ã €: number]�items (N)1 €a 64-bitÿ #eg’ 9 –(N + 1) *C poffsetsD Æeach elementÔPstart "thÀ#Ø @data{aÝ 4- K§  j R i ³ ³e(with Ó ú?sizp   de
 ? oY0eirXqpectiversR ï Né !`sì`ˆ@ strG  ù ¾ N¾ PindexKpo _backú ns'os_mappF &(i Rreconˆ  6  ‘corresponÌbPythonÈ _Fi 1= {¢  Z ‚int: "q"  @floa d ‚bool: "x ? —str: "%ds  ð None.__class__:1 "x ¡?x",
    } â_alignment = 8 ñback_transforms_mapping = {!  > ò0: lambda value: ,  õ# int, float, boolE 1E õ.rstrip(b'\x00').decode(_encoding),  # strI 2I  ž u# bytes: 3: _É @None* Ç 0 #  9 !}
 Ñ@staticmethod ñ	def _extract_recreation_À ` !):)  ] ÿ
"""Used in concert with _€ to) v) L Æ ð!into the appropriate Python objects when retrievÎ•them from‘  A Álist as well  6 Dstor3 E."""2 ñif not isinstance(™ r, (str,k,8·.__class__) …return 0U OelifS  ?str: 1: ò< 2< &seœ™ 3m ûBTypeùçð_init__(self, sequence=* ‚, *, nam z  0aame is5 or9    L @ 
ˆ [ & =- Uor ()¼  ® _¬yats = [    ¤ e._typeÎ[ }(item)]0  4  ¬ 
Ü - 	Û)ƒ  6   _else s O % (w  A < šb* (len­ 3 //\   B+ 1)Õ >  ¡ @for É  wZ	‰ 
‹  p_len = ‰ l
^ 0ass›1sum®  fmt) <= 8 s 0fmtr :   =ÎDlf._\ 	… Poffse“ × b# The   s of each B A eleÆæshared memory',H ódata area (0 meanà` start[  & ,è    	¬ #. 	r ] )).* M¤allocated_É J= [0w3 
 Æ ? $ +Jñif fmt[-1] != "s" ”@int( J:-1]¼ O ž ‚.append(n 
7 ä~	 �)$ 
  %—rosD@size truct.calc \À            û"q" + self._format_size_metainfo +
  ƒ"".join(0 /s)$  	Q packingT 		0  back_trans’ i_codes† ))
 = ðshm = SharedMemory(name, create=True, Ü ¡=requestedë )L Uelse:  ö Z 	… @if sT ënce is not NonL p_enc =  Zodingi `truct.*i_into(  ‹ ©,2 ½ N.buf 0 1 ž_list_len  "*(" `alloca@voffsetsC ª 
 sÚ Pz x ?shmË  _Œ ¾_data_startG `*(v.enP(‡ð	) if isinstance(v, str) µ v for v inÜ
Ù 
 ç ¦  Ò0at_é¬ / ó M \ sL ø Û Ä	>Û *¾“ ß Q Q*(_reì2ion4
Ç ° áé ûa = lenîp)  # Obs>b from m  0ybuffer.Bß _) Y >istÞ? unÌ_c $  \X é¾Uc0 F " Y1 * 8¼   ;vdef _ge¾ˆ (¶, position)Z "Gets the × 0ingT0mat ð a single value storedP 0  …%."— \ % =g  ¼ B>= 0· Õ J  ÏL Eif (& #>=ü' Q) or Ò .7< 0Ö   ðraise IndexError("R U¢ çout of range."€0v =j òòJ"8s"ÔüÌ kÚ& +‘ êÀ     )[0]
    ñ	fmt = v.rstrip(b'\x00')
 ð    fmt_as_str = õ.decode(_encoding)
, `return& 3  õdef _get_back_transform(self, position):H  "Gets the 2  2 a( R func	 òor a single value."r  ½ Dif (\ @ >= n ñ ._list_len) or ‚  G < 0†  E õraise IndexError("Requested¹ ÷  out of range."¹ _3Ð = struct.unp
Ufrom(õ  o I"b", µ shm.buf  ]_offsYn 5s +¢ S E)[0] ž R& w©¦s_mapping[3  Ñ ]mú  S #  ©  ø @ing_ fat_andg Ž,H,ß�D"""S%U  U O and8 ³  $ % a<1 ins "1 at wspecifií?.""d{S [_intoQ/8sR# P ©MJ * 8‹#.	 ×  
ñelf._extract_recreëÉ(Ú‘ñ BC
ñ ç TNã í ðkitem__×Äž=ª6 if –>= 0 else +Ç| 6try@ p t] Ä_data_start K “allocatedM$s[˜ + Q @(v,)O Ã + ¶ _G�)P4 ê  ¿ î   gexcept¦

ÄiÐ	·¶
ý ó BÁ )‹ 1v =|Öv ´ 'vO_set)ôo  0'À
        try7:
  óitem_offset = self._allocated ¹s[position]< 7  ç_data_start + _ 	; Öcurrent_formaz ³get_packing ({ )@ úexcept IndexErrorÒ Wraise à("assignment i5 õ out of range")
Z úif not isinstance(value, (str, bytes))o 3new« @àtypes_mapping[ H )?�encoded_d 1 =  Œ Jelsej —elengthp  ƒ°y + 1] -‡b  „ © . !(_ 6ing} 5  /if4 Pstr) Æ Ù 
C qif len(` F) > Ë ä 
 y ßV˜ý!("—A/strç  ñeds available storaê A  :if †¾[-1] == "s"w 	ç
8 
Q· p 	> e %‰str] % (L  :   ,& Ä^ sI _and_transt
i d
Y µ 
 
¨Øpstruct.Àg_into(A Z’shm.buf, ¨*,  ‰ð def __reduce__(Ð sáreturn partial ð.__class__, name=3 .l   C), (Z ?lenW Ã !unÅ ›from("q",¾ Z0)[0]­ /prT 1f'{‘ ¦ 0.__™ ‘__}({listÅ #)}½ - ¾ R!r})'k ‘@propertyþ Ì  Éa? ²0"Thó Œ Ç Bing * € used byfü!ly!ed=1s."^  vjz"".join1Ñ ®  i)l R i in_Ý  ._è F_len.”Ö Ná_size_metainfoG å rfor theÕ 'ã 3agexæ Qq" * f ­  >§ cª 5O  F?matª  8s« ‚W"LÀback_transfoórm_codes(self):
  ð"The struct packing format used ð the items' back trans% 5s."I Ðreturn "b" * e ±._list_len
% ‘@property üdef _offset_data_startž µ# - 8 bytesŠ  V q lengthJ  É  ( �(N + 1) *2 ‚element o s6 ³ u ® A + 2F · /_
-atZ^ { ê # +%“allocated_s[-1]{  ‡_‡Ú€ ³ …  T ª =|   Bcoun“x, value8"L.  ó  -> integer -- | ðnumber of occurrences 5 "."k  Á1 Asum( ‘ == entry÷
 !in3)6  ¡ Qindex¿¡  B""L.! R )£ afirst ( ™ "€Raises Vý �Error ifS ÷ is not present.""Ò Ófor position,Ì Áin enumerate· Q "ifhþ ¨    )Z ª Jelse. r¼ » A(f"{· 1!r}· óin this container"[°__class_get÷Q__ =  ó&method(types.GenericAlias)
#
# Module which supports á0ionac= ñ objects from shared memoryJ òmultiprocessing/" < ".p$ ðCopyright (c) 2006-2008, R Oudkerk
# LicenÈñto PSF under a Contributor Agre!p.
#

im·  l  ‘weakref

° #. % Kheap @get_Q4ext.  5 Rreducðassert_spawning
_For‚¥Pickler = - . q

__all›Q['Raw£0',  PArray   1cop ð synchronized']
u ý  � '@_to_ A = {cC'c':€.c_char,Ž8 'u w 1 b  Â1 B u 1 h Qshort2 ('H u 2 i "in0 H  'I u 0 l Alonga 8 'L u 1 q     H, 'Q 1  5 f Bfloa˜ ('d adouble1 }~ ÓQ_new_§g_"@size† • s. #of! E Qwrapp2 ”ð.BufferWrapper(sizeð)
    return rebuild_ctype( ò_, wrapper, None)

def RawValu$ €code_or_0 ‘, *args):W 1''' R_ As a Z ñs object allocated from shared memory9 A  [ @_ =  o !too A.get¨  „ '  å Åobj = _new_v½ _ ˜ ƒ.memset( óaddressof(obj), 0,À S.size @ Òobj.__init__(Á Y5obj9_Arrayµ   T  G E ializerGaK F\ïif isinstance(µ  S, intº  \ �¼O_ * 3  + , £	   ™§& D “  Belse®  ­ ?lenä õ 1 oresultX#  Q ‹ X 5k
°, lock=TrueŸ!x=§Ò ?€ô a synchronizationÜq for a h Œ9 �î4 !ifŠ i is FaUr) 2n (· ³  1`ctx =  ö or get_context(& ô $ c.RLock ð if not hasattr(& ·, 'acquire'•ð	raise AttributeError("%r; ¦ no method; 1" %Þ ‚ Ñ N ed#‹†3ctx,ð2, *D Ï21Raw| žÒ ‡B ·àü@copyþ^ _7j$ @Çƒpointer(3 `)[0] =pe 
rówJaassert±ðobj, Synchronizeñ dBase), 'object already synchronized'
    ctx = ñor get_context()
  ñif isinstance(obj, ctypes._SimpleCData):-  Q ‡return Sj 7 @lock= !x), /el[ WArrayT €if obj._y D_ isƒ fc_char| € oString† 2 � 1 Felseq `cls = —  - Ù  S 6try%   s* ñclass_cache[cls]
   ëexcept KeyErroÓ @nameh á[field[0] for  ‘ in cls._ &s_R  V Pd = {> ð: make_property( )F  
  E   %s}�  > ­   H = 'Ð2' +u _ )__6 ê 'U 8, (T  ±V,), dEJ Q  ^', Bá
#
# FunctionsÊ ´pickling/un ñ 
#

def reduce_¹ K [Ãassert_spawn!~ š¤ rrebuildb  , d ®,ºswrapper rlength_m 
RQ cB P TNone)æ … (2 5_, ) t ú 2if   M@not G ²< ²3_ *, ç�_ForkingPn´er.registerp kà Tbuf =ˆ ò.create_memoryview(& 4objq õ.from_buffer(buf! #._Î P ” 4Iobj
B to p  ú4ies 	¼[  ? · óf´wLñexec(template % (J,)*7ðe V = d[o  “�  
V Q= '''ì£get%s(selfì  ƒ.acquiremã ' _g!%sVgfinallÈ" `releasI  Ysm , valuet K m " =; u % )Çì !, †  )

 ª ü!}
p ñweakref.WeakKeyDi@0aryï S“´3H 	Ö ² éRect):- �__init__ƒ®¹=c 
 ) Õ  =-   ¥2ock–    -  
! =/ Àelse:
        `ctx =  ñor get_context(force=True)
*  ¢self._lock8 v.RLock(% ! ¡acquire =  0 . O  kreleas*  
+ àdef __enter__(5 !):  ’ hreturnf + )@ 3xit? , *argsF 1 + J creduceL E ò assert_spawningª © Ñynchronized, $ g._obj,Ã ¸  ’1obj( k 	ö 6objŸ  1  �2 
 ! 3 ___rep[ò'<%s wrapper for %s>' % (typeg ”.__name__Æ çobj)


class Só ( CBaseÕ @valuñ make_property(' 'K _ArrayP s5>len¨=1len¾ s“__getitem: 3, i¥  pAwith«ƒ  T  �P 8[i]asR !, Û Y R " =6 Z egetsli�p, start /op^ · > \:stopÀ f Ë O%Ì g Õ s00StrK6øÛ E? = 7š.aw! òraw')
#
# Code used to<ñ processes when using the Ú! o“kserver
#5 �methods.U SmultiG Aing/9 1.py óCopyright (c) 2006-2008, R Oudkerk
# Licen– ðPSF under a Contributor Agreementu ¤
import os
 %sy Trunpy  ·£s

from . 7  7•_É  É(t_ 1 Þ  5N "Ction  ðutil

__all__ = ['_main', 'freeze_supÇ   àset_executable  ¥  é ä@   ' ppreparaz T_data5 ±command_linI õ | �_path']
›p_pythonw 1 isô€assumed '  # &  ‹ ð.
# People embedd2PL P want9 ƒmodify i®ò
f sys.platform != 'win32'XáWINEXE = Falseé –WINSERVIC Kelse0 ±getattr(sysV0oze`G à)
    WINSERVIð$CE = sys.executable.lower().endswith("pythonservice+ ò	")

if WINSERVICE:
    _) ô_exe = os.path.join(d ¢_prefix, ',  N ')
elseD 7 › �

def setb ¯ R(exe); hglobal† –  2exeG gG D ireturnD !
# | ó is_forking(argv5 1'''j R= ówhether commandline indicates we are G 8 @ bif lenZ   >= 2 and i ð[1] == '--multiprocessing-H '  ƒÀ ATrue[ Y bFalse
ü freeze_support(Ò aun cod¯  v ô object if this in not the main'  Ú ; Ö Ö m  š ‘kwds = {}7   0forû  _ 0 F[2:]ë  %  name, valuråarg.split('=')J  ) $if& w= 'None4      „ [R @] = $ 	B 
J 0   	4 Aint(Œ | `spawn_0(**-  wCit()‹ ’4_52 ó Ke"s I4 ofh 4 P used] z ¿ing a child˜pgetattr¢Á, 'frozen', $¡Y ([�.,”9] +@ .ñ ['%s=%r' % item¨ 	 0in . Bs()]&
saprog =£ +m .î 0 imÅû u; B(%s)¨ ‹ N r%= ', '£œ ›  C 0opt´öutil._args_from_interpreter_flags(3 F[*A] + J €+ ['-c',©gX.ò å p(pipe_hkàe, parent_pid=Äp, trackŒ  ÔOâðspecified by data received over e Ñ: assert Ø`, "Notß +"7 !ifi�platformÏWwin32ŠÀamsvcrt6  h †_winapi
 fí 1 is‡ ô 1 ;   tsource_¾#= I b.OpenPJ(U  2   % ÕSYNCHRONIZE |; ýPROCESS_DUP_HANDLE,B B�
Ù o ¥  È S 3newàñ = reduction.duplV	6  X   À          soø urce_process=so 3)
  òfd = msvcrt.open_osfhandle(new_ Ö, os.O_RDONLY< úparent_sentinel = f e Qelse:
  r ófrom . import re1 utracker'  .._ º 9 5_fd<  Cpipe½  ¯ wos.dup(- Ý ûexitcode = _main(fd, ? * @sys.. (  3 )


def8 @withV fdva ð'rb', closefd=True) as 3_} ;  H×A.cur„ ð()._inheriting = F 6tryB F ðeparation_data = reduc ×.pickle.load(„ ø  >    prB "e( J 
& Oself\ kfinall¯ Cdel é ù ò preturn | Â._bootstrap(Jµ°¢check_not_�2ingü)4¿if getattr(„ 7, 'ƒ', FalseA  /ñraise RuntimeError('''¯   ôAn attempt has been made to start a newµ before theC #  H Õfinished its 
p"uphase.
? @This< ðbably means that you are not us; Ffork™ 6you¿PchildG  {aes andA àhave forgotten= !us¿  , •per idiom�  inÛ  ‚† module:ª  0ñif __name__ == '_²2__'³ #   freeze_supz(  % )..<e "3 ð" line can be omittTf¥ gprogra¼ s+ go+ to2 Bfrozö ô
produce an executable.'''ŽLget_S(é L5Rä£info about¦² needed by ŒRto unÒ l ˜q objectnP _(  -Qdict(  7ùlog_to_stderr=util._ ,+ �authkey=?." 3 )ð5if Z g']7Non[0d['y ™level'] =3 à.getEffectiveL# (\ �sys_path=Ë 	 S.copy!	2iá. p.index(² ²except Valu×�Apass
	w  [i« ÂORIGINAL_DIRû †d.updater = 'M à=sys_path,
     Ðsys_argv=sys.	  ,
   öorig_dir=process.ORIGINAL_DIR'  " ¶os.getcwd() østart_method=get_ ) !)
t ó## Figure out whether to initialise main in the sub™ Ã as a moduleJ ðor through direct execution ( ño leave it alone entirely)B  i _R 0 =  Qs['__ 9_']* ñ_name = getattr(% 5 À.__spec__, "& r", Nonej !ifÖ  m C ais not" :b  Œ0d['{ Afrom, J'] => 1 Aelif´ ð	platform != 'win32' or (` ¡WINEXE ando ¶WINSERVICE)v Ä OpathØ È, '__file__'Ó  ± × > Ó & � 0os.) b.isabs;  )Ÿ Ó  -  þ	— k É ; Ñ t _join(L ,[‰ 	… � $ �U @norm Ì åóreturn d

#
# Prepare current ‡ r
#

oldîDÒs = []

def p6 S(dataå 1'''£ 0Try3<getT Q read „unpicklen q object@ H @if '«'n h ¤ .´ _ 0().1 0 = / [> ]õ  N authkeyQ 4 T  'W Õlog_to_stderr]  8ˆ 
! ]È Yutil. (‰ ¯   UlevelT :  ÑÐlogger().setL- “&['= ]S  k R   a  ê , ë    ¢@   	@   +&di!Í ƒos.chdir»  % µ u  ù
€ÿ8 Á P  s#I6ç'], force=True\»b_fixupWEù B ]£P€ ¯Å  c  ( c   'ls# MultiP3ingÌ€ helpersÒafix upù Å" Çin
# spawned!es)� Ðname(mod_nameð#):
    # __main__.py files for packages, directori  zip archiv ƒetc, runJ ptheir "O ó% only" code unconditionally, so we don't even try toF õpopulate anything in¥ q, nor dA 1mak% † changesC Ó ± attributes] qcurrentñ ô = sys.modules['4 !']+ ôif mod_name == " E" or Å.endswith(".! Y ]qreturn
Q ñ# If this process wakEked,à ô may already be dD `if getÕ (Ë À.__spec__, "± €", None)¹ Å î• ›Otherwise„ ñcontain some non-ÖÐPwhereÂFneeduñ support unpickl¹tí ðperly. We rerun it asò p‰p__ and Îå @# ths @rmal& �€ an aliaåQ that+ 2oldC Æy.append)*  ¾ _& ¡ = types.MûPType(ßŽ "2  Pent =æcpy.runF (Y,`  Y 	 9  ›=j < çalter_sys=Truež Ð ñ.__dict__.update(ì º . é Q'] = I e Ã


def _fixu$ ’from_pathq  
 ûë1à¨  $'][°Unfortunatea A ½ ð ipython launch script hisÐcŽd had n|Q"if _õ __>t" guard½¶work around�£# by treatý li¢Åb2ó
# See https://github.com/´  ¡ssues/46989  Ù £ ` = os.x¤.splitext( @basepœ6)[0Û @   å r '$  & ¶§h–ahe setù ’we expectßÐrre's noÐ’more to dwÖR, '__k 'Ñ »  õ ® g@e paë €m ¥ sË a = ° through ra Ä0n aÙ1uleg!#  �we assume· isˆ¤executableQ ‘º v$ai
7%  3Äb% H eÛËRÀent = runpy.Ârun_path(mai
 ?,
   6 ±name="__mp_< 1_"):  òmodule.__dict__.updatee rcontent. Bsys.- Cs['_J \'] =  g  e Ò


def importA 
Ñ !):˜ 1''' =Set\  ü r_'] to � A at d  K 7 ? S_fixuŒ Kfrom>q)
#
# Mÿ  ” ñlementing synchronization primitives3 ömultiprocessing// Ae.py# ðCopyright (c) 2006-2008, R Oudkerk
# LicensedÌ ñPSF under a Contributor Agre˜ ò.
#

__all__ = [ê ”Lock', 'R	 �Semaphore  BoS d PCondiÖ  ! REventl2]

˜¤ threading 4sys „tempfile _ `time

u  .\Aort M+xt H °util

# Tryš We mp.pñcleanly, if it fails
# raise Ipð	Error for platforms lackñQa wor
 €sem_openµ ò.
# See issue 3770
try®æ 	 @  õ 0Sem› , Y ÷ unlink
except (˜ ù° e("This² ± €s a funcÅ ½  Z  ³ 1" +"Ž Î ±, therefore Ÿ requiredC 	vÿ needed will notF 	¹  OC.")
:`nstantkü.
RECURSIVE_MUTEX, SEMAPHORE = list(range(2))
SEM_VALUE_MAX = ’.‹.) u ¡Base class!sEÿs and mutexes; wraps `Z R`
#

F l ¡(object):
š _rO $= Fò._RandomNameSequence(),  )ó__init__(self, kind, value, max
 c*, ctxB ý if ‚ is None¥    Tctx =‹£._default_œ5.ge (ö 5  @ 6 !tx! Çstart_method& ÞC_nowhò  == 'win32' or N r= 'fork} e  šRi in Ó7100Ó  ! q    slm Ïelf._semlockû(†;  W tp._make_² /()nö 0 Z å¡FileExists€
� ( Ipass— 6els´À         breCak
  Uelse:   õ)raise FileExistsError('cannot find name for semaphore')
E ðutil.debug('created) òlock with handle %s' % sl. )A ÷self._make_methods(_ úif sys.platform != 'win32'È údef _after_fork(obj)"  î €obj._semž ./ �  ' Ô PregisP V  ¬ ,h ª Ë ` 80is I;Nonyð# We only get here if we ar R UnixA Ð 5ing1 ¢ ð# disabled.  When the object is garbage collec” or# E ðprocess shuts down‚ `unlink/  Êó	> ôfrom .resource_tracker import >	3  (H‰ )5, "_"Ž �Finalize; ñ, SemLock._cleanup,  T )),  9 ãexitpriority=0Ér@static‰= Yf (ª W$unð I  z Bsem_^K  ,  ' ‰ 	' FŽ   ±.acquire =  í J Š žlf.releas-  åx 0_en_ft kreturnl _. VC Bxit_B , *argsI 4 . � 0get«eQ J òcontext.assert_spawningº  l# s=sDh = m &gej ð_popen().duplicate“_child( • Z ) ˜ l0(h,GAkind	 �maxvalue ¡(s(!, 6/	'“ = _multiEing.k@rebuÃ *C ˜ .$rebd"erÃô1 %rvtate[0]æ„ 	Ü:�+  ì (Ê  B'%s-m(Æ “.current_ ÿ()._config['semprefix']-	Vnext(
 and))

#
#Š"–
#

class 2 ():“'in»§=1, *, ctxÏ n _1 ±SEMAPHORE, < ñ , SEM_VALUE_MAXF à=ctx)

    defó get_value(self):
  preturn  ¶._semlock._/ !)
+ Ìdef __repr__C 6tryP  W i / =U 	 '   �except E ?ionI ‘'unknown'Œ  8 · Q'<%s(o ‘=%s)>' % ž ñ.__class__.__name__, ( ñ)

#
# Bounded semaphore
#

3  S (
 ():Cinit\ §=1, *, ctxaASemLT_1 “SEMAPHORE<  @ctx=B k x‹Q, max]…\© ­/  –,,Q ®àNon-recursive £¯ ] £  ¡˜ A1, 1Î�%+if× —_is_mine( ! ¦ó = process.current_ 0().! WÕ if threading4  3 ¡ != 'MainT( 'b	~ �+= '|' +S 	† .elç ?^ == 1t  Í † = 'NoneÖ Ž P ¿count() > 0K “SomeOtheré ¦ /se; P~’  Æ Ÿ
UownerŸ M ðRìRåí8ñ RECURSIVE_MUTEXðóÿ §“ä +()|"%!, P )?, 0Z 2 ð() > 0:
          óname, count = 'SomeOtherThread', 'nonzero'
2  Yelse:   M ProcessN �except E :ionV R punknownI  … ðreturn '<%s(%s, %s)>' % (self.__class__.__U @__,  ü ñ)

#
# Condition variable
#

:  ¡(object):
| Ádef __init__l ö, lock=None, *, ctx)Ö Ž  " ! =) 0 or# �.RLock()T  M) ”sleeping_£ü ctx.Semaphore(00 _woken- Tait_sM ! =ˆ ] èmake_methods()ÿ ƒgetstateð ñcontext.assert_spawning*½ ½  ._/, , #  & ÷ 9 wÝ 	® s® !, ¼ µ ˆ � " =g Â 9 T^enterQ+>  *4.__+ 	æ 'ex“W*argsâ F 1 + Þ	£  x H   €.acquireâ l–  
ï kreleas*  r O_repû  6tryI ý@num_èTers =ê
3.á‘ å_get_value() -˜  H  Õ _TE ¿Å	¦ 'º0¡  Ö ', ÿ Æ‘, timeout‘º‘f K å Ìis_mine(), \)c'must ÞE() c4Ñbefore using � ")'Õ `ñ# indicate that this tg` is go6 1to ¿u ê  .1ƒ^  T? 6G æ  rñ for i in range( 1 g H p …  # Y Pnotifÿ  ^$or–ª  ^ 	• A ¼êdU(TrueÔ‚kfinallsÀ this threadÇ has woken
  aself._ ù_count.release()
) ù# reacquire lock ñ for i in range(I )):#  t m  > .K f °def notify(% W, n=1A passert  !._@ B_sem	 Àis_mine(), ' 0 isK u owned'„ C $noG @waitF eaphore‘ 1  ± ±False), ('n� �: Shoulda óhave been able to Õ  v  E  J+ '_v 'e#B qtake acAð of timeouts since last| õify*() we subtract· #åÍã from sleeping ¨and rezero+ A SwhilekÝ (
ÝSres =4 
n X7 f  “8resb0BugJG Z N P+ '- ‰ s£1be x hY  er± 0� õ  )  @< n 'q2 @Ò 
	1 
åR §   0# wèbup oneŸ%erŒ  " s  Š F+= 1‰$if. sx �? C V   ¢  	Ð ) 0   ž 0it S ao  œ ´ ‹  -  H	L ¿–case someÃÙjust happenedî ~‹	K � ÇÏ  Bpass• CA_allG0 ÷ Åã(n=sys.maxsize‚ > ·1for< Ä, predicate,Ä W=NoneU †result =+ %()Ù  ifŽ:ultªcreturn - ë¿ k 
: 0end$ ! =� á.monotonic() + &ouOelse?  [ z  È ù [ 	 ˜ 3ê 
Q 4if “ s = 
$ ^ 0 -° Ã 	�  6 5if — N<= 0X  & Jbrea‹é : (  Ö “ 2 Ê ´
�ò
#
# Event
#

class –(object):zƒ__init__<g*, ctx+— p_cond = ö.Condition(ctx.Lock()ª / Cflag/ 2Sem©'(0²ais_sett l Awith�À._cond:
      óif self._flag.acquire(False):
%  + �release()% ¹return True  \ 
  de~  t(W n Cwith– Jcond‡  , ® R ª & © !  _ Ö.notify_all()˜ _clearš 4›  í 2waiî Ø, timeout=Nonjü 
­<Jelse] ?¯ ©  "   ‹ < S  8ô#
# Barrier
#

class ³(threading.# &):Ò�__init__Õñ, parties, action‰
—‡, *, ctx›Ñimport struct× º ³from .heap ! ÕBufferWrapper( w 9 =   (O ö.calcsize('i') * 2\ ©  =� `.Condi² {´Û_setstate__((ß Ú  , L #, Œ )d E A E = 0¶  Qcount   Î_q  & !, > 0l%._�  & "._r,äa,X  O ¨ 2 ® " =c ,  Parray Ë- @.creñmemoryview().cast`g8 P À ”Ç #Ì  Î „ ‘@propertyÕ YGu Œ  ¢ !._ò 3[0]C _2 S.settpH h, valuj
H " =! P “  “ 1“ 2 “  H “ %1]“  óÀModule proviáð  various faciliÊ‘ to otherÛðs of the package
F ñmultiprocessing/util.py ðCopyright (c) 2006-2008, R Oudkerk
# Licensedl ðPSF under a Contributor Agreement.¡3os

 …itertool %sy tweakref+ datexit ÝX¶ # we want  ñ to install it'sS0 À            ó(# cleanup function before multiprocessing does
from sub à import _args_ ò_interpreter_flags
5 ., ; õ

__all__ = [
    'sub_debug', '	 @info   awarnin  Âget_logger',? Ðlog_to_stderr2  # qtemp_di Pregis˜  af Dfork< sis_exit\ €FinalizeE ùForkAwareThreadLock TLocalG Qclose×  fdR @cept. ƒSUBDEBUG sWARNING6 ô]

#
# Logging
#

NOTSET = 0
: Q = 5
D á = 10
INFO = 2" P   û5

LOGGER_NAME = 'È '
DEFAULT_( �ING_FORMAn ó'[%(levelname)s/%(¬N ó] %(message)s'

q = None €Ð = False

def2Úp(msg, */!):·3if I   
 T.log(', ; V #R FO   iN  ‰M  ®T 3SUBÓZ   Öù(C1'''K‚Returns  Œ used byÉ+ 3 dglobal‚ Ó E  �  �._acquire!() 6try¹dif notO !:
"  Ò  Ö! =¡ ping.getö0er(Œ´W  1   5 ¡.propagate	X \# XXXæ u shouldÞÕÉ 	@ Ðif hasattr(atT, 'un-'e �  ' .% (>_C
Ã  6 2 U 0 
FelseS >   B i ûhandlers.remove(O Ÿ, (), {})ˆ 
F oappendF /flíL„._releas- r‹	¯	 i=:a“tTurn on%³ and add a ÷ ò which prints to òx E Ø”" ßXer = \. qformatt ð F (Jv­ îrStreamH¼>& F.setW u J  x der.add< 6 )`1if ¶42 @setLÏlM ð_log_to_stderr =ò6 True
    return _logger


# Abstract socket support

def _platform_s 3s_a0 _0 As():[ tif sys.1 ² == "linux"   � óif hasattr(sys, 'getandroidapilevel'_ ? Î bFalse
± i¡ ó_namespace(addressR sif not  ¥ V  w ¶if isinstanE d, byteL  ' Ž P 0[0]0/elD 3strŽ B A"\0"E óraise TypeError('j £ type of { ü!r} unrecognized')


·ÑOed =çã

#
# FunctionKò%ing a temp directory which will be removed on exit
#ª_ _< Á_dir(rmtree,M $di (&   
ócurrent_process = 
 . !()0 -#  @ canž óNone if the finalizer is called? €late durï dPython- a& ,iff  G  c d `‹ £._config['ä P'] = 3 (6get$-`# get Ù? of€€automatiÑ Áy cleaned upµ t B	¡ U.get(¥ Y 9Qempdi3 µ è  imHr shutil×2filˆ î{  
   @.mkd ò (prefix='pymp-'k  3 Ñinfo('created)v2%s'f ( /   ó# keep a strong reference toœ .dQ), si 'J 3 I?ed   ì Edown4 FR(,, ô€, args=(8 #ilˆ Å ,H  €   BÖpriority=-100Á
b i1dirc r éSñÀ for reinitið vðobjects when bootG pp"ta child• òñ_afterfork_registry = weakref.WeakValueDi]gary()
4 ñcounter = itertools. "()&B_run0 _e &er˜0tem"Rlist(#  " ‡  .i! "()I S.sort; ÿ ð(index, ident, func), obj in‘ &msö6try  ³ . B(obj`   �except E  KJas e5 é4 �Aker ÿ"d =  6 ðe U"erá ð _fork(obj, func÷):
    _afterfork_registry[(next( ñ8counter), id(obj), func)] = obj

#
# Finalization using weakrefs
#

_fi  %eri X = {} h Ñ = itertools. ¤()


classg eˆ 3ectÇ 1'''Ï C$ àwhich supports£ Cect � ¡  D ðdef __init__(self,B ñ, callback, args=(), kw ðNone, exitpriority= œ  \ Hif (  � is not ' A and ©isinstance- 4,inè  L   ñraise TypeError(ý    '"EŽ ñ ({0!r}) must bew � or int,z Þ{1!s}".formatN  V ¿ Z, typ¥ E)))
†  if3å n H    V#._$ =)@.refØ , ! )O Ielif_ Z  ;
V CValu€"Without� :ect£@ canƒ"¿  ~ $._ð% =û’ "  ý! = # =" l,{}$ Jey =", {«1er_ÿ6er){ 0pid}€s.getpid! Y  _> Ó5 0key³  ¬ë é ë!wr¼,­  S  ð# Need to bind these lo> �y because € globalsa_ haveK þ	been cleared at shutdown, Ï  =  ±  ¥sub_debug=
 ", 0$=o:¥ î 1RunÌ  Þ  õð unless it has alread÷  Ç Palledäc¼  Ç T :try±Odel Ë  [¡ ._®H ¡except Keyñ
H ß %('ü² no longer Vered'GJelseF !ifw ._\#!=*(!   p @ignoÍ
÷different process}  E   Qres =Žé   œ   v    kq%s withŒ1 %sS…?%s'  R  m H  è{ ._Û H ;7 2   ¾ 
@ "(* @ * B (  ˆ # =� I I = \!‚  < f : k` '< À     return ñres

    def cancel(self):   5''' C" õ finalization of the object* 6 6tryO  S Sdel _E Àer_registry[z e._key]H ú except KeyErrorH Fpass* :lse O ¢weakref =  …callback …args = \J  £  < #kw-  –ey = NoneEÏstill_activeK	ôReturn whether thisXaer is I ô waiting to invoke À ¯ krV Ÿ /inj¯ Œ__repr__« ´5obj2S%()„ §¡(Attribute®R, Typ Q [N :   ifE û   
ËØ @'<%s% Óect, dead>' %Øò_class__.__name__å  Z Ix = ; D0=%sA (È  .   AS ,) qgetattr?$._X 4, '† #',   )6#if  V
ñ €x += ',  e=' + se   D  œF  H  J Pey[0]‰1notßV Ìexitpriority\ C \ À x + '>'


pF_runUs(minO  4àvRun all&€s whose ˆ  : · ç and at least _ FÇöers with highestK "aro™ed first;| 1ith þFsame8 ewill b< ðin reverse order31cre?.C ã /if® Ó  †1# T01unc„7mayp 4aftRñmodule's globals arer  åñ# destroyed.  SeeÉ_O$_f[ 	 "in¥S y for moN RnotesÑ  _ ôk(ifÑ  ŸËlambda p : p€³ eá2 ûG (>={ � ¯# Careful:pOÀmutated whil ¢‘ #È @runn¡1(eiÉð by a GC run or  !no „thread).ƒ Vlist( €) shouldÒratomic,ƒ u 8 �.items())— 2notŠ0keyÞA[key´àkey in list(_fñ+inalizer_registry) if f(key)]
    keys.sort(reverse=True)
 0for! 0 in !s:  6 fY E = _ f A.getd 1 #A ô may have been removed from the ¥ 6  ¬ j ¶is not None‰  � õ	sub_debug('calling %s', ˜ )Q  / :try@   , (- �except E >ion: ùimport tracebackl  [  ³.print_exc(`ûif minpriority isÞ [PclearA ð#
# Clean up on exit
#

def is_ Ring()³ 1'''š ÀReturns true xpprocess€ PshuttBAdown1 9 r9  X 6 or ¹ %

 r= FalseŽ  ð _function(info= !, ·= f, _runò +s= ,�  R óactive_children=Ë . < ƒcurrent_4 <  A�# We holdlôto references to Ý s, T°arglist due  1the¿ p# situaõ described below, where thisP  ” Õ�ed after J ðmodule's globals areU rtroyed.Ã « !ifK˜2ing" V 0 = .    ¯#('* &'2É`('runnDpall "atŠ"Žus with öG>= 0D ö#(0,† +f � ()"²Tchecké=  È ¸ x`becaus` p   R# it'™`, any � Ó+``eâ()`` will raisð B   û# an AttributeError (@ ` windsÎ0try@+toŠ Tget aE s9cutil._Ú Ìl).  Onƒ {j can happenJëif someone has òmanipulated sys.�0s, 9±  »  "b� ógarbage collected.  Thµ`uctor s @F ,ypE !th<0pla| dUvaluez: Bdictj 2.Ë ÓFor instance,[òsetuptools runs a test it ren E j ¡a copy cre$üearlier.  See issueSð#9775 and #15881.  Als^gà: #4106, #9205€d„   7ì ià    for p in aûctive_children():
  ¾if p.daemon  , òinfo('calling terminate() for : Ý %s', p.name)c  F —p._popen.A 
*  N op in aµ 	” Cjoin� process� "p.2 € ±debug('runnå �he remai ö"atexit" finalizers'å V_run_ B()

0 °.register(_? ð_function)

#
# SomeBðk aware types
#

class ForkA óThreadLock(objectÄódef __init__(self  m  ¡._lock = tA Aing.E º & ¡acquire =  5 . Ÿ kreleas*  * ô ±_after_fork� ,Ñ A._at# 0_reÉ )‘Ú 
 D á D  € E 0_en†  hreturnò _+ … ¹? w, *args… F x�+ 
ÍfLocal(’l S ²  ÑWÀlambda obj : ò.__dict__.clear()ð] oreduce_  ƒj , H §ðClose fds except th �specified²2try;óMAXFD = os.sysconf("SC_OPEN_MAX")
E EL is8 P256

« cv ’_all_fds_5 4(fd~ � a= list � + [-1, G ]Œ’fds.sort(ÿ `assertÇ r[-1] ==, ò, 'fd too large'; @or iˆ’range(lene 3- 1ª `1os.¥ % ‘fds[i]+1,c Qi+1])å>psys.stdÛ²nd replace  @with0pdevnullO _] _$ ¶6if J ris Nonex ‘ ŽB‘  4 ± Tñ (OSError, Value æ OpassS  "fdå ÑC(os.½ ,É ‚O_RDONLYy � 	Ž   ’  F p`ñ, encoding="utf-8", wfd=FalsVº ù  R Ž6(fdx   Qraise×7 ñ  ùõFlush standard streams, if any¨f'  ¨_" ®	ö ò Aout.1 …‚Attribut€Œ	 Ô Z 5errZ À    except (òAttributeError, Valu C):
  òPpass

#
# Start a program with only specified fds kept open
#

def spawnv_passfds(path, args, p p ñimport _posixsubprocessŒ  ˆ  ^ õ= tuple(sorted(map(int,J !))/ äerrpipe_read,  °write = os. (, 6tryð mreturn„ ±.fork_exec(` Ç Á[os.fsencodeà …)], True˜ c, None 	B O-1,  ´ Â  ,A sFalse,  g s  ]   í gfinallñ ˜os.close(q ,  å  D")
Û: “_fds(*fdsÇ@"""CR ð each file descriptor given as an>�ument"""Ó �for fd inI”„ $fdy ø _cleanup_tests(z  c multiAýing resources when G „  completed.–  Pfrom "  ¢0supª
 ## Œ U  ƒ .± $()6 ðStop the ForkServer\ òñ if it's runningJ † × ‘  žsC + 2ork &._ o._stop�  R_Track† (d"_tI Œ  .._ 
˜ ñbpo-37421: Explicitly call _run_Ãñizers() to remove immediatelyy @# teQüary directories created by± .util.get_: q_dir().L x  ´.gc_collect] ðreap_children()
"""An object-� nŠ �interfaceÎ a.netrc7sƒñ# Module and doc3PationÄ óEric S. Raymond, 21 Dec 1998

 ños, shlex, stat

__all__ = ["q P", "Nz BPars»"]


class  `(Excep‚ y ð raised on syntax0ors× ïá à  f 'ñ__init__(self, msg,Pname=Á�, lineno y  =  0 .g * % =5 ¤! < # =E 
 Pmsg =s  Ï .˜ Ãµ 3str´ “ Fr"%s (%s¹ � %s)" % à .ß 	º !,  ¨  è{žq 	& ÷ �default_: 1 isÀ
        if ÷ file is None:
   ô = os.path.join( õexpanduser("~"), ".netrc")C ú self.hosts = {} [macro :try�  with open(‹ ú
, encoding="utf-8") as fp5  Á { c_parse; Áfp, default_© ¨ ðexcept UnicodeDe ZErrorX � olocaleŽ ,Cdef ·  Ã ", ø ½ › álexer = shlex. 6(fpÞ   ñ&.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""’  NC �commenter¶ ö.replace('#', ''€  wh`1±  R õ# Look for a machine @, or  Ðtop-level keyÅ •  G ò saved_lineno = •  	( 2topE E= tt) ¦get_token(®  V šif not tt´   Ybreak[ þelif tt[0] == '#'5 )ifš  ( 	¹ °and len(tt) + w   Ý Ðinstream.readê ¼  * �continue¨  a 'q«  Ÿentryname%ø P XP '' ˜ 	Pdef':Å  ó# Just skip to end of"sN  6 Ä  .  g.�[: m] = []Z ƒ�whitespac%]' \t') ô n    ¶_Ð 5 ”< 1or   pO\012x  3   ² N\r\n¶  1   å    -€.append(• 
J 4 Žsl + praise NGP»…(^ + U"bad ×Æ” %r" % tt6ý  – Ino)
G ð	# We're looking at startX1an 	ž dm ¤ šÇ.Q šlogin = 'W`accouns@passÀ! =i	= W)
ƒ4 ô VÔ @ ðif (tt.startswith('#') Oor
   ðtt in {'', 'machine pdefault ¯macdef'}):A ¿if password!  u õself.hosts[entryname] = (login, account,K )l  K ÿlexer.push_token(tt- _breakK Oelse° ÿraise NetrcParseError(I  ”   á"malformed %s æ  	 ÿterminated by %s"E 
Â% (toplevel,D  *`, repré /),? 
bfile, "nlinenoÁelif tt == '~D' or _user', # =^ 3getb ÙT  V qW `if os.:æ ³posix' and × _nÚè  Ì`prop =E �fstat(fp.[Nno()ï  1    	Árop.st_uid !@ getuid(< 7   ¯import pwdß
?try´  H   €fowner =N `.getpw�  Ò š O)[0]g 
¡except Key÷s 'ù g%s' % q m 
Ô  —Ò  osÞ  Ü )Ò ?q Ð o Ð 
:  ¶Q("~/.– j Åÿ(%s) does not match@ K ± " current Ç  E b") % (, J I  ‰ N (   Dif (ó€mode & (;·.S_IRWXG |  /O)F#DÀaccess too p�`ssive:g/esƒE   "5 óons must restrictC � to onlyŽR" theÎ!",ÛRàÊÐraise NetrcPaÿrseError("bad follower token %r" % tt,
  ñfile, lexer.lineno)
? ñdef authenticators(self, host):$  f ñ&"""Return a (user, account, password) tuple for givenE E."""G !if @ in g .f sf  j rg  [% ]C ïelif 'default'J 7 O /se� FNone$�__repr__
ðDump the class data–   ðformat of a .netrc Š	grep = $ ? ó  E g.keys(z  ,wattrs =L- %  a à+= f"machine {^ Á}\n\tlogin {G f[0]}\n« ; 2if  *1]$  X #\tJ 1J - /. 2.  ÿ Umacro  sW 0macË{, È  T  ÷S [. Û  3 xó "(°òrep

if __name__ == '__main__'>aprint(ó())
"""An NNTP clientBó$based on:
- RFC 977: Network News Transfer Protocol* ³2980: CommoY £Extensions# 3N P (ver5 ñ 2)

Example:

>>> from nntplib importÃ   Œ Ð �('news') cresp, ,�first, la  * ¾ó	.group('comp.lang.pythonA 7 'G% 0', 6 u, 'has'W ó'articles, range', j B'to'p !)
B  f ‹ has 51 C × 5770 to 5821É 0subç òs.xhdr('subject', '{0}-{1}'.÷(‚  ì )ñ Qquit( €

Here '&A' isJpserver  Ponse ‰!.
 `s are “àed into exceptìÔ.

To post anÙ »a‚:Ñ �f = open(•Warb') #% ´ containingD €, includ aheaderI  © Ø  s #(fÙ ¢For descri– �ll method«1eadð €comments  8òcode below.
Note that all argu+ Cand |pvalues ¢ esÊ± � numbers
-Ästrings, not `, sincb !eyR€rarely u„ 8scalculaX Í$
#—ð by Brian Kantor • ðPhil Lapsley.
# xov/Pxgtit†`xpath,(eð by Kevan HeydonðR

# Incompatible changes from the 2.x nntplib:
# - all commands are encoded as UTF-8 data (using C ò."surrogateescape"
#   error handler), except for raw message M ÅPOST, IHAVE)† ‘responses‡ ?dec‡ NòARTICLE, HEAD, BODY�  ç ñ%`file` argument to various methods is keyword-only
#Ì ðNNTP.date() returns aù Æetime object* ñnewgroups() and ? `newnew Htake? 1(orL )I ,~ðrather than a pair of (†  , w ¯) strings.z Elist¹ 0 a   L G¤ öInfo named tuplesM °description· ù €ict mapp@ê B sQ5 K Uxover„  =… UdictsM SfieldM  (header oržag Ë f ( Ðvalues; each I   representš a£ ~ Gview*¢article(),Ÿ m ¯Ebody± D a (Ì2, A;  :‘  9\  g "internal"¹ Wñhave been marked private (they now start withÿàan underscore)OÿK/3.1àutomatic queryÐof capabiliti’et conn¹eÒ 8get/ (ê ;- N&  Y °helper func6 ò_\ ÿ!po“i! cc$ilVÅs, bytes-lik  V&ðrbitrary iterables yD ò ClineñAn extensive test suite :-[BTODO<å Zpucturedš6a (,ñetc.) everywhereÕ °support HDR« Im 1s
i 4 re
 dsocket Qcolle*+  ß Ý# ãsys

try:
    P Cssl
�j Eª# _Jþ_ssl = False
else aTrue

Ebemail.¥c 	º 9_& _ ? Ô 9 ð_GLOBAL_DEFAULT_TIMEOUT

__all__ = ["!",Ó  × 1    Ç "", YReply  TeO$ar @ ™Permanent7 ‰Protocol CData 	G 	à 
£ ]Ú€maximal \ð length when callu@read q(). ThiR�to preven$ !  ) a»G  6 ðs. RFC 3977 limitsð· NNTP line length to
# 512 characters, including CRLF. We have selected 2048 just to be on
# the safe side.
_MAXLINE = 2048


# Exceptions raised when an error or invalid response is received
class Å E0 $(EP ò ):
    """Base ( ôfor all nntplib e. As"""0 ó	def __init__(self, *argsO  S c .) G  ( 2try„      O .Æ  = X 5[0]1 Ž a IndexÎ ? E'No N ‚given'

è  QReplyG ( 
 Æ ‘"""Unexpe»�[123]xx r1 HpassN �TemporarR 24xx´LD ‘PermanentŒ – 5D rotocolC #Re&ÿ
does not begin with [1-5]ã ODataW  6 inrJdataK ò	
# Standard port used byd€servers
�²_PORT = 119 4SSL u563

# È ònumbers that are followZ @addi>ñal text (e.g. article)
_LONGRESP = {hô '100',   # HELP 1 ÂCAPABILITIES $21 ñLISTGROUP   (also^amulti-Ac" )< 5X  <  2€ tARTICLE g ¤HEAD, XHDR 2E DBODY 4 pOVER, X  t B 3s dNEWNEWÚ 3s 1NEW·  8r �XGTITLE
}’ðDefault decoded valuŽ r Þ  ƒ ±VIEW.FMT if0sup	Äed
_DEFAULT_' _' 1= [¶ ð"subject", "from @date  message-id  references C:byt
  ‚0s"]© ðAlternative namesô2/in¬  D
œ Ö_ALTERNATIVES?q B': '{ !',À '~  
 ,3LXñterminators (we always outputPó, but accept any of �CR, LF)
_w€ = b'\r\èð GroupInfo = col†Pions.ð …dtuple('$ ¦  „ 0['gU €', 'last 3fir	 ’lag'])

A[z & | B  ['é w ó0_id R } à
# Helper funcø@(s)
³”‚_header( F_strñ0Tak	ð unicode string ñJrepresenting a munged header value
    and decodes it as a (possibly non-ASCII) readable < A."""@ ¡parts = [] òfor v, enc in _email_` _| ( a_str):4  ‡ ÷if isinstance(v, bytes!  % l ¢.append(v.W (l Åor 'ascii'))T Felseb A * ñ return ''.join(d õ)

def _parse_overview_fmt(lin˜ @"""P" à a list of strp	}ñthe response to LIST OVERVIEW.FMT²  ‰rŒ O ,ñ/metadata names.0 ù	Raises NNTPDataError if n ñis not compliant: õ(cf. RFC 3977, section 8.4)×:fmtÕ ø  Ó  sV0if  ¦[0] == ':'  q8# M» ‘ (e.g. ":Þ"� (    Ü Ò, _, suffix =Z @1:].•i¥ N(':'6  z ! +ã  P ÿ2# Hÿ k Œ ÿSubject:" or "Xref:full� ™ ` =� v.lower(µ  _ð_FMT_ALTERNATIVES.get(& ,A : ð# Should we do somethnAwithø:?4fmt/ Q K adefaulµ‰_DEFAULT� >  Øäen(fmt) < len(7 ”rƒ
‚-("Þüso short]‰if fmt[:_ T] != m Nl 0def£C s fieldsr a?fmtâÞ,–  , qó_process_func=Noneÿ û	oQto anÛ MXã |mÜ`accord¯ to­g[Õ format `fmt`…$n_ ?en(°ÖJ 	‹ œ¶ Q = {}‡  /ðarticle_number, *tokenÛ E §.split('\t€
3 z = int( �  `  1i, V  “ ¡enumerate( ì 1 >={ †
 M   P# XXXP"@an eð? Some servers mightð  C   ž# support˜cstill 91addˆ/alH  ­Ÿ [   co†q „_—  =q"[iB  5is_÷=Æ. 0.sts ôÀ if i >= n_dûefaults and not is_metadata:
  r# Non-d4 ð header names are included in full Ïthe responseP  €(unless ' ýfield is totally empty)6 Ah = , _{ } + ": "& �if tokenÚ 
 þ[:len(h)].lower() != hæ  õ ðraise NNTPDataError("OVER/X Ó „ doesn'tü ‰   O  "¾ ó s of additionalT.s"ö Ã " =Õ [Ê 5:] ç  el± *onf(”s[fmt[i]]? -òoverview.append((article_number,h"s)� treturn 5 ð

def _parse_datetime(	 `_str,   
 b=None)h@"""P0 p a pairþ 2 . ¡) strings,¶p  a T  N � object.À qIf only; !  :€given, iÈá assumed to beD V  I A ¡concatenat% Ægether (e.g.à!toa ÒDATE command)€ """u ‚0imeê  ƒ  í ì  õ m  =�   Q[-6:]�  !  º    ! 2:-6! Ähours = int(J B[:2]�mminute  32:4! msecond! #4:  Cyear^ ‡ 4[:-> @montk }  D-4:-€ <day> $-2\ ¥# RFC 3977#psay how�ðinterpret 2-char ‹ Qs.  A´Q that##~!re_!noDós before 1970 on Usene!ifK V < 70† ^ � += 2000W &el) /10*  #19* „  ‚.	 (T !, %q, day, ®#, —#, )(,un*çt, legacy=Fals#rFormat ù1 orø   ? asAæ  in>" fN ¢required b4qNEWNEWS”NEWGROUPSä ŒAIf aH  ô z ¡is passed,\ • +islñmidnight (00h00).
H T DÐed representaû0 de�sÐ R flagÇ*ê 1is 1  (+ �a ,2 haT„YYYYMMDD ç´  : cHHMMSS ¢ f BTrue W U *
ðcompliant servers should understž Cboth“  s;drî,  û0neeoÀwhen talking^4olda � «ðnot isinstance(dÄt, datetime.	 C):
    ‘_str = "0 " Oelse& ô{0.hour:02d}{0.minute asecond Á".format(dt)S ±y = dt.year –if legacyh  # qy % 100#  ¥  µ ¢ !{0[ „{1.month 1day s 4y, v 
É M ?4d}M areturnQ “ $, ?ñ


if _have_ssl:
¿ ÷def _encrypt_on(sock, context, hostname� """Wrap a , ö	et in SSL/TLS. Arguments1-( ñ: Socket to wrap}  <-m :F   ' Ãuse for the ¢  ed! unectionC Ró s  GNew,; ° .8 """I ‡ ù# Generate a default‘ öif none was passedI  if—  2w is Non˜ ] Oó = ssl._create_stdlib_ (‚ / Ã ./_¼ Ÿtserver_�=	 À)


# The cl£ s<�mselves
 R NNTPœp# UTF-8²  bÑcharacter setx1all/ ð	 commands and responses:] yMð# are automaticallywñoded (when sending)C 2dec P @ceiv K rby thisÃ dð# However, some multi-lineèÁa blocks canˆòain arbitrary bytes (foÓò# example, latin-1 or utf-16N  inÚ ó body of a message). C
« ðtaking (POST, IHAVE)N Á ô	HEAD, BODY, ARTICLE) rawU J �data will{ ñrefore only accept7sproduceÑ tobjects!òFurthermore, sinceJ � could be¾²-compliant CRs out) ,Š 0we yñ'surrogateescape' aNá error handler(,“toleranceH  Üñeasy round-tripping. TÝ– ausefulH ÛpapplicaàsJ R(e.g.Š � bways).¾@encoX@ = 'Ã!8'4 ¤ s Æ 7 õÂ_init__(selfép, port=#`_PORT,
 r=Ð,ôBword g  ¬ @read€"de"  < ²netrc=False_.  	  ™úout=_GLOBAL_DEFAULT_TIMEOUTsðInitialize an instl/. r :½ M0con75 to» -ï : 
# $ (  k Bdardƒ #«-ç !r:  ( H `authenxte withr 0assFÐ: password to� use with	 srname
  ð- readermode: if true, send '   õ ' command after@ G  µconnecting." -u ðnetrc: allow loading �  W ñpassword from ~/.3 F fil­ f  ÷if not specified explicitly{ “timeout: 	 Ð (in seconds)� Ôd for socket ¿ Eons
E  € is someL °s necessary6uyou areB …ng to anF ñNNTP server on the local machine0intxuto call< ‚ -ë cŠð	s, such as `group'.  If Œ 5get? °unexpected † ñPermanentErrors,0  might need¸ s> }  
Ó5"""^ Àself.host =  
 0por   
  r1 = > €_create_ 0et(_Jout)1  	f = NonEtry:&  O *   S P.make f("rwb"X 2 ¶_base_init(ï 
(  if.@r or œ
{ M Älogin(user, Õ,5 V jexceptE "if ® 
 _   v.close(L  ð  RraiseÕGdef ò  (,æ ç)y °"""Partial ¡ialization5 Ä Q– protocol!ðThis instance method>QextraŠv up  L 0tesƒ&deH i`debugg2 5= 0û Ã ….welcomeU’getresp()ö  #ö# Inquire about capabilities (RFC 3977)€ Y \_caps{ 8getC 
k Ð'MODE READER'ý ;²to enable 'z ' „‚ p# HowevM $ú order in which d  G¤'AUTHINFO'Î&ñ	# arrive differs betweenÔ¡ s.G _sA‡() failsN Q•an author0ailŽ ]ð , it will set t‡to True;H  Ø 5`) rout5  1rpr;  atè`a requ(¶to try agaie#�€ perform'ð its normal func½]E}1onlÇQwe'reX al�ykÃ˜v anywayB  * B_ v = Fals¬'ifdî'Y  ' È—1lf.m‚ ¶d Ž@ "  ‹� Àde_afterauth;:
  ý$# Capabilities might have changed after MODE READERD ÿself._caps = None" Ggetcl 5()
( ñ# RFC 4642 2.2.2: Both the client and @serv� °UST know if Wre isO ô	a TLS session active.  AO M@ ñNOT attempt to start : J D "if U ¤is already` 6 ètls_on = Falseì aLog inÓ pencrypt¥ òsetup order is lef– ªubclasses.` Úauthenticatedg àdef __enter__(Ž )úpreturn  • . 3xit- w, *args4 ’is_conneck ñ lambda: hasattrb •, "file")¦ 8if 8 (P  …6try•      – f.quit(H   ñexcept (OSError, EOF
 U  , 6pas  ofinalln  ¢  <   • d_closeµ4Ócreate_socketwtimeout—  ¡  ×1not#þ  1 
±raise Valueæ ò ('Non-blocking r # (< 4=0)[ ¦supported'@ósys.audit("nntplib.Í!", S.host  D A 2è .ö C Aion(û ? #, Ÿ è 3¡getwelcome4 &`"""GetË " Ñ message from ü`P(thisù  …P€squirrel¶±way by __inÙ&))@I4Ð response cod@  200, posteàelowed;s  1Yt 201'  Ç!al+ B."""V 9!if`ó.debugging: print('*å r*', repC. ){ b _ N	Q ¨S: . Q, as :	&%ðCAPABILITIES commŠ0is õ nP, an Hhy dictŒ=!ed   5!is
 Í .°A_verÆ5= 1‰ E " ¡implementaJ… m  , ¸N !‚ÑNNTPPermanent� ,  ‘Temporary ‡ «   2# S¼ƒdoesn't > � �	á  6 — 'I= {}  Jelse52 ð caps
            ñif 'VERSION' in caps:
  ð
# The server can advertis ÿ
veral supported versions,K ÿchoose the highest.* £self.nntp_R ñ  = max(map(int,° [Â =]))G  â ¿IMPLEMENTATé t ðimplementation = ' '.join('+['W ]} qreturn K _- 
˜ ðdef set_debuglevel(# !,  )ya"""Set , Bging% p.  Argu– ! '7 g' mean¶f0: no 8 ö output (default¦ ö&1: print commands and responses but not body text etc©s2: alsoD áraw lines readJ ðsent before strippÇ ‚CR/LF""" f .° =ê 2[bug =6;  N@_putv H:ineGñInternal: send one¦ 1 to^Ð‚, appendŸ &LFä  ô`a P` musÎ ð a bytes-like object.Ï  Ê   °sys.audit("ºClib.¥ !",,‚ ‡ _ ! = � + _CRLFü  M i1'lf$> ·ð ('*put*', repr(G  U¢file.write X  zflush()S?cmdR@
U¥ (through ¥/))Zbunicod.)ngW
½o('*cmd \0.en\ Ø  2ing’v.errors“·  E !(getÚŸ_crlf=Tru�IfromƒH "* Rae@EOFE¦ 1 if7 aconnec™—is closed4 �s­¨ Ö Z1lf.( ¸  Æ(_MAXLINE +1bif lenG4 > $ ´ ¯r« �NNTPData°  ('T © too long'R hú Ü£ P Ÿ_('*geè!if¤ e ": € +K  < €¦
²  × ²ine[-2:] ==
#  ‰  _ HU[:-2][   %elF 01:]GÂF 1F  f ‰0get�²ÖUget a´ Vðaise various erróors if the response indicates an error.
  õReturns a unicode string."""%  J õ = self._getline() "if ðdebugging: print('*: �*', repr( )7   ! =§ 0.de| (b ’encoding,V ± s7 c4 H[:1]ƒ •c == '4':  ã ðraise NNTPTemporaryE� + 2if @ 5@ ŸPermanent@ ¿not in '123F rotocolE rŒ
š Adef p0ong. Æ, file=None)ì ñ"""Internal: get aH  ñ	plus following text from&Xserve1rvarious.R²  sSe ƒ  , 3ðs) tuple where `Ó   7` i�H ‰a and `? (  list of byÓvobjectsÒ@If `".   b-like * ð, it must be open³¶binary modeI  �  * �edFile = | 6try‡  c# If aH° was passedons aÄõ  with that nameR  E àif isinstance(Å r, (str,÷ )û /   	£  2 ! =n > R"wb")X .    �Ø  Ø # !ifHS[:3] àš_LONGRESP÷  . nIReplj	Þ ÏF = [Â ? "if!isl  gd R# XXXP‹ (Iead?d  Q €terminatö= (b'.' + _CRLF, b'.\n'Y 1    whæ1z    º 3  n(FalseI  0 !if«  e� \  0 ]breakÈ   J p.starts; Ð /.'
  /    � ! =� :[1:l      )p.write(/ 
Æ Nelse¬ É   =F'° C
x  ™   ô  Úu ‘  +   =^ 2‹s.append?ofinallòthis method creatû,%£0cloÀta!if×Žð:
              ó  openedFile.close()

  òreturn resp, lines òdef _shortcmd(self %):; ð
"""Internal: send a comma
 ¡nd get the\ Uonse.: 0Sam z Ðvalue as _get‡ e().""",  { A._puˆ  ¡ ) r¼ " > À Jlong¿ ¿, file=NoneÊ (ÿ plus following textÞ  � â +B  Æ Æª  —cmdstring¯ð V Á… 0()  Ð  ò p, excepa 1e r¾@ed `Ö%s`×Âare unicode Ñ ös rather than bytes objectsw5êUst = ;© Y¤ Â0, [¨ 0.de™ c¢.encoding,I ferrors F  1fora— in list]©ágetoverviewfmt] ŸV0 ñ format. QueriessÖserver if notYólready done, elseá 5 qcached ‘	ƒ6tryö Í r»õ _7 � &fmp ò AttributeE 
J Epass  h  ¬5nes­ ªêö"LIST OVERVIEW.FMT"€€ ßNNTPPermanent„  ò# Not supported by @?š  õ  fm2”_DEFAULT_t u_FMT[:]+  W
ä 9 dparse_(_è Q0ŽP8 = V}  u  PgroupV<«sC0# P ��s into "4 � last fir 6lagyh  [G[ `Info(*° �.split())yP Ñ7nesÒÁcapabilities“ Œ ô
"""Process a CAPABILITIES>.. ’3all–óRˆn-ª �ÿ z y 0sucr 1ful5 Ñð
- caps: a dictionary mappÓÁ Py namWo¶¦s of token¸(Ûðexample {'VERSION': ['2'], ',  0], °  öACTIVE', 'HEADERS'] }»Í ¦ U = {}º  Ù äÀ("CAPABILITIcES")
  ±for line in %s:  " ñ name, *tokens =# v.split(D  ) Pcaps[. B] = / I Ðreturn resp, ) 
 ðdef newgroups(self, datp Æ, file=None)‘ ÷"""Process a NEWGROUPS command.  ArgumentÅ -S 1: a 1 or ±time object‹  Â R¦ n -± �: server °onse if suc† 5ful> q- list: ! oÙ sÚ  s( 5""" òif not isinstance(ÿ   £ .    ) · õraise TypeError(^     A"theõ ÿ parameter must be&, §  E   "­ ñ '{:40}'".format« Ð.__class__.__ï 6__) ¾ `_str, Ä  
 À = _unparse_   I  , ö.nntp_version < 2L vcmd = 'üˆ{0} {1}'�  c m = € í Êj ò_longcmdstring(cmdz5 ¼4 × î(L )Î4newÌ( Ó?NEWÑX !:  ^ Ö5'*'úôe¯message idðÿ@î6 {2òfùÄ¾ò? ”Û - ,d�_pattern�2, *# Œ	�@LIST– fACTIVE§¦Ç j  ¯u ò indicating which” ¡s to query·  Ÿ-4`: File… Õ ‡  Mï 8 `store •result inF 	A 8%(Ø `, last8r blag) (  sl; 1 is- ¤ ø ÿ o2' ++B Àern
        welse:
  õcommand = 'LIST' óresp, lines = self._longcmdstring(; w, file)9 Rturn @ 8 ¡grouplist(P !)
- ðdef _getdescriptions(1 !, 1 À_pattern, reS V_all)¾  K  # ñ = re.compile('^(?P<@ ¡>[^ \t]+)[ f(.*)$'¨ ð# Try the more std (acc. to RFC2980) ñ NEWSGROUPS first¾  Dä  ‰ $UA :' +Þ ‘ aif not9÷.startswith('215'ø  y Q# Now¼ õ!deprecated XGTITLE.  This either raises an error¼ G Àor succeeds n T ñ	same output structure asA . °  È \%{}^  foÕ  w_w2 in£ Ø qmatch =  #¢.search(ra7 .Â6p()| 6 1if 9 
L   `name, ¨" =$ .š Z(1, 2E  / É¶R  ' ÖW Ý     _  s[y :] =$ 'if
[ S }D [ ü Fµthing found*  � J &''¬  ¨§›�"""Get a° +  °‚a singleûR.  Ifv…than one| µ dQes (' s' is a )­’R /noG 0  @mptyÖBing.Ü  ï 2QlidesV  Báonse code from pserver,Î •ce it cant �only be ±° or '285' (ò xgtitle) anyway°  |i F q áis needed, use{ '—s' methodÂ RNOTE:únûcchecks�€wildcard3V…nor does}  Ò  5 A whe> £ ƒõ actually exists."""7 - ¼.Ò? w, FalseúÏ O ° öW2 Õ ‚range ofX• k X, Truœ ³ •  ƒ
Œ `Proces‘ ¶.  Argument•-š :ÃW  Q :RÚs1  ": jˆ"if©Ussful? ð - count: number
garticlÔÀ- first: firóst article number
  q- last: $ ðname: the group  C 5""" ñresp = self._shortcmd('GROUP ' +: )/ pif not 6 õ.startswith('211'):'  ¬ ðraise NNTPReplyError(9 N swords =O Vplit( Àcount = firs  ÷ E = 0e �n = len(F 8  £ J > 1Ž N - 5[1]F  « 3 23   } 7 27  ! ; 3;   ´ > 3>  $ B 4B  "  ½2 = F ‡4].lower*areturnFa, int(í ) Â   � !),Ó
�def help( ç, *, file=NoneÎö"""Process a HELP command. Argument½ -C a: File¹ ‘string or ñ object to store¤‘result in•  ó RÓ sW  ;�: serverì °onse if sucœ 5ful? A- li%rist of „ "s *Qed byy N i=Q  to J  �   ÷  
I… I’._longcmdw  ('= '\)y£_statparse â 
w¡Internal: (  š û @lineÝ õa STAT, NEXT, LAST,¢ ÐARTICLE, HEAD„EBODY¿À  ‡Ú2Ù=‘art_num =¬Ö&1]Á¥message_idõyÃ,  K &, 4 ` Î ” , /^ßK . M. «7c |ª  ~ .ì ;   Å Ospec„
 ¥ —  …L :(L Ú   S id (û w Vified? rfcurren’ is0Vected¶².¶ý¸ 2_id)  5 idxÖ" _ß P Ô¡ -']È{0}'.format(A )ñ OelseP 'ñAnextñ
�àProcess a NEXTó# command.  No arguments.  Return as for STAT."""
  r ñself._statcmd('NEXT')
& �def last($ !):  = ÿ"""Process a LAST„ < S „ 1_ar�  ‡ ú, line, file=None˜ µInternal: p¢ õHEAD, BODY or ARTICLE³ 
"spa @s = o `._longw )	 re0 õart_num, message_id>  X`parse(, : œ  ï, ArticleInfo(M  ’ •Ahead•t Aspec?, *¶ 3  A7ä-Î  Z 2: a¤ p numberIî 5 id-—: °name string.  °ð object to store the Ì eers inG ¹s�  )�: server  °onse if suc‰5ful? -Q : S _» 30 idZSst of† \s¦)if€ is not ƒ©   cmÿ'bÃ{0}'.format(0_Pc Oelse@ 'Ô 	­2cmdêObody+(Th Ì lƒ  ú4]( @ ¼*n96jÓ l† "8Ÿ%
À     else:
   ôcmd = 'ARTICLE'
 ñreturn self._artcmd(cmd, file)
(  def slave(' !):  A ñ"""Process a SLAVE command.  RZ s. á- resp: server °onse if sucF 8ful\  	¥ 2sho§ 'r '¥ Axhdr¤ Ò, hdr, str, *Ì _=None¼ dn XHDR¼ ¤ (optional« ùextension).  ArgumentÚ õhdr: the header type (e.g. 'subject')Ð -š ð: an article nr, a message id, or a rang W1-nr2?  � : FilenameN 0ing3   ! op ‘ to store˜ •result inF  ,q- list: P of (Ã cvalue)� sk 5""" ÷pat = re.compile('^([0-9]+) ?(.*)\n?+ 3“, lines =§ñ longcmdstring('¼ô{0} {1}'.format( )þ| Íàremove_number(]  ÙÒm = pat.match! Á    ‘Ðm.group(1, 2)Èam else¯ 0 , É [{  A for3 1 in &s]xDxoveÔ¯start, endÖ?OVE×Õp !:   ãŽØ -‰ :   ‰¢|Ðdicts contain0 ° —†_field³ $ „jH{0}-…:±%),8 @  <± fm1 zP._get†viewfmt(% 	et_parse_* Àgs, fmt,  ,w__specZï ì!Ife ð  isn't supporteM&alÚ@back�XE .{“ B 7p- eithe% /tindicat×X‹to fetch~"in'™ion about  -J7a (¿‡ tuple, g ž&ofÆQ)s;N  pend is „ E ~  up Šenewest{will beK ™retrieved ± \ Àndicating thóe current article number must be used
  ñ- file: Filename string or õ object to store the result inF …Returns: -% ‘p: server ÷onse if successful. `list:  ð of dicts containŽ v pD ufields
> QNOTE:™ õ"message id" form isn't supported by XOVER= 5""" pcmd = '  'ª 
 ñn self._caps else 'E ': ãif isinstance(† á_spec, (tuple,Ý &))# ��start, eny 7 Z  &  ˜ à+= ' {0}-{1}'.Ü 7at(? eor '')7 Xelif Q Ê is not None„  ^  =  y+ ' ' +8 R @respÅ Snes =rlongcmd3Q(cmd,5‡ 5fmt- ö getoverviewfmt(% r=$”, _parse_* Â(lines, fmt)ò�def date(”O`"""ProZÕDATE command.Å ¨. z :€ Ctime_ M 0ü  shortcmd("˜ "ü !if– - .Î·swith('111'Ý  ðraise NNTPReplyError(9 N aelem =JX.splifpif len(# j) != 2^ OData]  û 0 = A 5[1]ô X   X /14Y   O  b(	 ,¶ Q_post,ä7, f0 }00# RU@s a ¬àific exception h  €=Wallow=¾3¼ 
Cpf, (bytû  \array=Rf = fè&Sp# We doü€use _put# —() becausT# - w-  wa70ddipal CRLF € ( €iterableRualreadya#   in�Qright…'at  m ð spurious flush() after each µ  h fwrittep3for :n fp” : B.endP_É   P   & ! =K  .rÇÑp(b"\r\n") + 6 ¼  0  í8ine«<b'.î * Z   ! +a 	I  ½.R.Û eç˜ 2b".• D " 6À()
        rðeturn self._getresp()

    def post( �, data):   ö"""Process a POST command.  Arguments/ -@ õ(: bytes object, iterable or file containing the articleu R¯ 	W  ² �: server  °onse if sucž eful"""B rB ñ Þ '½ 'à ú Sihaveû £message_id' Ø n IHAVE	N #:  o-id ofó 9G�Note that? VXfusesŸ ÿ	 an exception is raised.k Ã{0}'.format(C_id)\ƒR_clos„y6try Š ì À "
    ½. .N )ï     2del &  kfinallk M EsockM 0  *2qui*« T QUITQ and � U R _et.  à/ " =á °_shortcmd('Ž 'î …+ B X «Slogin.óuser=None, password ×usenetrc=True(ÂÚauthenticatedË`ö ValueError("Already logged in."¥ pif not ‹ l ~ Y Ò  Ð"At least one§`W `X   U ÷` must be specified� 0# I‘  ¬ 4in/F was/ Q but L  ¥requested,‘ À# try to get8¡m from ~/.7 ( fPresumÍ! A has¹·ntry, NNRP sÊ…equired.P T ifZu ^rZ @Simpor× P     @credïRals =û © (É (    ¨ 7 = 3 .  ? acators}^.host= !ifè Ÿ  Z  Í! =! =[0]¥  # ±' 2' 1 OS–
b  7 P P# PerõN NNTxhf needvÃ
W �Y  ‰á  @infoªQr ' +	 À     if resp÷.startswith('381'):
  ú if not password  ( ùraise NNTPReplyError(resp)H Oelse=  ñesp = self._shortcmd('authinfow A ' +	  € 
U  € ¡  r 	Ì 2Ì  /   ³ ŸPermanent· õ# Capabilities might have changed after loginí Ì ºcaps = None GgetcV (Ñ ú # Attempt to send mode reader if it was request .f À# Only do so6 Qwe'reÄ$inM Y  al[ y: "if‰   er$ _á  ŽÔ and 'READER'N ë 
Ú 6setJ è  ‚[RMODE v á  @ b e iB Zdef _›  M ö?tryÏ  welcome­  )Y'Îaexcept
e
\ !# zð 5xx, probably 'sÁimplemented'»  Û    Œ h ‚Temporar„K as rPif e.)Ionse-<480ù j @# Nehøuthorization before 'ø �  6    T.ÿIV= Tru -  Y
Z @if _yF_ssl@ Ë¾@tls(q  , context=xÓ e ð"""Process a STARTTLS command. Argums`  6 -S T: SSL  ¢ðuse for the encryp“`connec(¹  C   9""" ö # Per RFC 4642,� °MUST NOT betc ƒRenticƒoQ  a Ð @sess¥Ýv existsä � èjtls_onð    QValue� ("Z 5is U †nabled."ï 8 X ­ e1_ 0canõ ÷  ‘ v]M <ions  Í“ ß�¡  1 	ú?382ú O».file.close¿ M " ƒsock = _1_on‰. Ž,WJhost1G  i Ç  ; P.make [("rwbg6 À Q  # c#ay·à after TLS staû
rts up, so ask for them
  �# again. ÿself._caps = None" ùgetcapabilities()' Yelse:   ò'raise NNTPError("TLS failed to start.")


if _have_sslH Qclass< P_SSL(E 5):
c Ðdef __init__(Ã Ð, host, port=.  7 e_PORT,5  ”  Puser=ï £, password ²ssl_context @ ¢readermode% ÿ  usenetrc=Falseu òtimeout=_GLOBAL_DEFAULT_TIMEOUT)û £ ð
"""This works identically= ã .„, exceptÿj changÊ¡in default$@ and*' `ð ’` argumenJ ú SSL connections<9""" ….L 7 =  
+ euper()¿ (»,Hr”&, iT. 9 �#, g)/Ócreate_socket5+ 
z #  À ¨ 
: 4 	Ô :tryD  ˜ H À_encrypt_on( ,, -  YØZ k.closeŠ w x	ž  `eturn “ +ð__all__.append("e H¤ñ# Test retrieval when run as a script.Ëò_name__ == '__main__'Å  im¢ hRparsex  5r = #.AˆP% Br(de_ …ion="""\Ý ánntplib built-äÁmo - displayâ0lat¹ òarticles in a newsgroup"""s… T.add_¡('-g', '--+ $',Cÿ='gmane.comp.python.general'§ahelp='K  Ãófetch messages from (¤4: % O)s)'¢ 	s¢ hserver£  ã .¨ /io—  ì E K Ã� !p�  æ� Ï-1, type=int!Š  @ x number† ±s / %s)' % â( ).	nŸ 4nb-¦ /10¦ œ 4of I Ô»ÆS˜ qssl', aqÇ='store_true¥ àFalse,
         ðhelp='use NNTP over SSL')
* áargs = parser. _ 1()
  pport =  .  bif not Assl:  N 0if % f == -1    „ U_PORT4    š a(host=i qserver,L =9 ¬ FelseU l ?SSLp O_SSLt £ 0cap¢ òs.getcapabilities(” ðif 'STARTTLS' in 0 ¥ ”s.starttl0 ðresp, count, first, la ñ name = s.group(	 i €print('G 0', . u, 'has'O õ'articles, range'b B'to'h ×ö def cut(s, lim)± °if len(s) >   Ä	ñ[:lim - 4] + "..."(   ‚return s;Þ  Ò 0tr(¼  ç 2) -74nb_® B + 1ä  ¢Aviewn  .x (L Â  k ²for artnum,Ó!in 9 ¶ ðauthor = decode_header(T õ['from']).split('<', 1)[0]Ð `subjec ?  "']½  – @line·  ï d : $ É "{:7} {:20 õ42} ({})".format(ƒ  V  ê  ³Ó b, 20),Ä¦ P, 42)Ï6nes’ @ öð0s.quit()
# Module 'ntpath' -- common operations on WinNT/Win95 *  xbs
"""C.  ‚ manipul: ,8 ðdowsNT/95 version.

Instead of imÚ¢ing this m‘ “directly,  ñ os and refer to- 
- `as os.ƒ .“ ð

# strings representa €various * Â-related bit[ ðpieces
# These are primarily h exª  ; internalž Athey+ @hard[ó
d.
# Should be set beforeÉ sK `resolv” ð	cyclic dependency.
curdi­e'.'
pa À.'
extsep =  
  \\& #th T;'
al& `/'
defð 4 €;C:\\bin Pvnull bnul'

‡4 os
 &sy 4tat pgenericS 
9  ã ñ *

__all__ = ["normcase","isabs","join","r@driv   Xext",þP"basevc","dir
 ¬ð prefix","getsizM ‹getmtimeE Bgeta  , c ð "islink","exist¡ l
 Qisdir» <filP 0ismÃÐ", "expanduse-  0varL    0b","abs
 	Û ñ2","í !ep Ö ò Å B Ü× Ð","devnull","órealpath","supports_unicode_filenames","re' &
  P"same& 1",  Hopen @stat acommonh ð]

def _get_bothseps( !):[ Ñif isinstance s, bytes   ~ Ñreturn b'\\/'6 Belse@    ð
# Normalize the case of a w  á ó	 and map slashes to back ³.
# Other nI ð0ations (such as optimizing '../' away) are not done
# (this is  1 byO  „ "). _  ž (í 6"""¼    ¸  2  ¶ !.
û ñMakes all characters lower1  Û   Ì ; inÝ 1"""H �s = os.fs` 1(s) 
Žs‹ñ s.replace(b'/',›1').‡ (K £8 7 7'\\6 R

# Rë1whe�´ D€absolute�ðTrivial in Posix, harder on Windows' 4For 8 itE  è ò t starts with a6 orð (current
# volume),! iMAfterj$ ð-letter-and-colon3 °UNC-resourcz !Xisabs_Test Ü
à# Paths beginn¼ù A\\?\ºtalways i@, buË Òñ# necessarily contain a drive.#  WÍ? 6if 	; ’ (è – '\'èATrueo 
c	\ _Z ?'\\Y  QsplitÜ a(s)[1]r Š¡len(s) > 0K@s[0]�
å0s)
ÒñJoin two (or more)ˆ!s.Cjoinö*‰
  	¡  Y
e  §`sep = I0 > z F  ¢ , :+ 
UI  ¨  2 H n    G 'F 6try  ifE÷   7  ¾ p[:0] + j ð #23780: Ensure compatible data type evenÁpÒBnull| O qresult_¶#,   d 7 = Ð  L 5 Pfor p¿Emap(,¯ ‚p\  p_E W T  X 3if &  ” ) C
	 1 �# Secondz  Ý ‹{ &   [ æ  \ sì  Z À      result¢_drive = p
 +
  ±result_path&  	 % ‰continue DelifW E and 3!= V } :6   8 ›.lower() 4  <  @ Á# Different c ðs => ignore the first Ë � entirely…  I § þ N + 	T  N 	 ) , m b# Same± U in dÄ :cas[ / œ `# Secoz ¾€is relatð&to	¦ $ifœ Á ·i   €[-1] notŸ Nseps-  ç ; i + sepl , 	pr/ `## addB ñarator between UNC¥ Ánon-absoluteÙ; Hif (j  Š )[0Ò  M ; g< 
P[-1:]œjcolon)dreturnO0 $ +  n 0 « * ôexcept (TypeError, Attribut ÇBytesWarning” pgenerict ñ
._check_arg_types('join',;0, *% !s)q ñaise


# Split a(  a°ô specification (  letter folÉ’d by a
# / l‡ n  B ð.
# It is always tru»aÑQpec +†  8 ° == p
def s  l#(pü 8"""¶ neBintoº /B¡sharepoint” '™ Aers.RØÑs a 2-tuple (q r_or_uncDñ); either part may be empty.
G ÑIf you assign jo* =É  t* Ð`2[1]@ fm …jained ª,Ë c will , ± everythingO Qup to/‘including` Üx.  e.g.Æ ¢"c:/dir") é¢s ("c:", "  ¡yy ¥  ¦  ,d p
¥  = Phost ç¨  ´à ² 3butÃ¶ ÷fourth directoryk’characterÿØ  //q ’/computerÎ å   ò �Paths canXó [ both›kañ 	F1"""æ �p = os.fs "(p»åif len(p) >= 2*À if isinstan÷ ce(p, bytes):
  ¹sep = b'\\' 4alt / Qcolon4 : OelseY X 'W 'V @normŸ ¢p.replace(— e, sep)° Aif (+ €[0:2] == t*2) and a2:3] ! ú # is a UNC pathÆ ?# v  õ drive letter or= “  bû# \\machine\mountpoint\directory\etc\...5  ;  * * ^ 	2 �index = Æ.find(sep, 2! O 3if * J= -1æ    þ return p[:0], pc 2d  R :+ 1l #Pù can't have two slashes in a rowi P# (afT°the initial6 
_ Ë 2ëƒ Ó D X  ô Glen(m
,&  1[ %:]Ñ "if”#[1–:
§ v2E 2@  Ž±

# Split a¦ ?ðhead (everything up to ;‚last '/'õtail (the
# rest).  AgPtrail? 0'/'‘stripped,J ðinvariant
# join(v  , S )àp holds.
# The_ 0ultN  ( 0 woü0end°  ` �unless itj  ª Àroot.

def sà #(pŸ8"""ñ aname.
\Rªituple � Qwhereœ  _ URfinal…yñEither part may be empty."""o  �Pos.fs
ðseps = _get_both  0d, 4 Ï ) p# set i¥-Á beyond p's ²u Gi = yqwhile iÑ p[i-1] notU y Sai -= 1B  €¨  =Öi`¢i:]  # now'Uhas n•9  $ mo®— ‚es from X ÈS's alQ!esA  " ! =) !.rN ‘ s))  % rÅ1d +) ª 
ç "ù ”extensionm îAstar„!atÄ\d0 t  !
#H W± component;/ q 7is @@befoZ0hat} I¿ñalways true that 9 Q+ ext×5extÚ Q Ôsinstan­1pgenericŒ!._c[ ,Ã   /' à.')
    else:
  ðreturn genericpath._splitext(p, '\\', '/ D.')
 ¯.__doc__ =<   b


# Re ñthe tail (basename) part of a | d

def  P(p):
© 2"""D  s E çfinal componen@  T 1"""4 Ú ± l(p)[1]Œ �head (dir7 ‹  Š ŸdirectoryŽ  0]#Isù ó a symbolic link?
# This will always Ò òfalse on systems where os.lstat doesn't exist.R isV (dS@Test= Dtherˆ i’ 	‹ .N� ò	for Windows prior to 6.0< ’2tryÏ ÓEst =´ ™ i óexcept (OSError, Value ‚Attribut Ê  N FG   ð.S_ISLNK(st.st_mode)}°Being true À Pdangl 	þ  s £lso usefulPl]s¸ Õ ?"""Q) #. 4s Tq PbrokeÆøs,5 ‰  …°mount pointƒðAny drive letter root (eg c:\)
# ! ‘share UNC ‘\\server\ $ qvolume _  ed½ba fileÃð: folder
#
# No one method detects all three situations. Historically we'v¨ !xi #
#= .edÃ as and ¢  ¹ Às. The canon> Å approach toH  À Ï €s (query  —`reparsä�g) failsY  `most
#%Ÿmon case:–  ‡ €alternatwPwhich{as GetVF£PathName
#e !if	©i*Sresul!uSUBST.
†òfrom nt import _getØ  & 
ŒI! ƒë+ q = None¾!is' [s3 (a h,Ö  
 !×³0, o°f 2ed µ ): ¾ [ fs ˆ > Qeps =ê ƒ_bothsepÃ  . \ = ab8  „ 0, r/!= QlZ "if W . p[0] in a 3¥A(notM )È (W , )ˆ  M  l  A ¹ R !ifÍ  ¿  ·0   ð.rstrip(seps) ==ð _getvolumepathname(	 ñ	).rstrip(seps)
    else:
   ð	return False


# Expand = ñs beginning with '~' or '~user'.
# Ämeans $HOME;   Qthat - ðs home directory= aIf thek ‚ doesn'tr n ,o i'  G   i æ is unknown,
#G 2is Ò ðed unchanged (leavÆ Àerror report ðto whatever
# function] bcalled‰  ¥ eeÐ as argument)Ê ñSee also module 'glob' for 9 sV €of *, ? _�[...] iný  ®sG &(A„ bshouldV ðbe defined to do full *sh-style environ� �
# variab  ´  { r.)

defŒ dI3"""õ~œ ÞÑ constructs.
.!IfÊƒ ” ±nothing."""0  B€ = os.fs s  Âif isinstanc¨‚, bytes)’  ™Átilde = b'~'5 
¸  aif notOp.starts²(' V ' U ×i, n = 1, len¢ ±while i < n Á 1[i]d !innP_bothW7 º bi += 15ðif 'USERPROFILE'ó3os.±4  ”!1 [; ]± #elê 'pOPATHT ì A&ry  q@drivqŸ [d bDRIVE'~  ( °except KeyENE '´ 0 Û Qjoin(h ,ç Ë %])7‘i != 1: #�ü  N ptarget_U ! =ÈF[1:iž 
[. bO ¬wdecode(; 8 / ecurren +Q.get(¯SNAME'Ç  3  ¾´ 8!= E 
>P# TryãRguesso7@  By�ault all%  q `# prof¿6  ie¯�e located„ Ó¡same placeã;areH  ˜ð d by correspond5 |  Cs.  ¥ iÁaE ]ormal” ‚y, this ê ûis likely wrong,D ù so we bail out. )ifQ 6@base¡ (ª  ›  "      3 2 = ®*irK ), Œ 
u ,nY g!eng 2—  " +ã>i:]�Àcontaining sò-hell variable substitutions.
# The following rules apply:
#  ÷- no expansion within single quotes, ø'$$' is translated into '$'& /%%&   0f ' ðare not seen in %var1% '2%K  ${varname}w €acceptedÜ ¿ $!    S  A %! @ ð$s can be made out of letters, digits and the charac F '_-ü �  (thoughm  ß averifi'9 Ð  L � ñcases)
# XXX With COMMAND.COM youŸ xuse any€ Fin a ê ,F  ex.â '^|<>='.

defëÐdvars(path):
I@"""E9d sSs ñ `forms l!, Ä } À 1%.
D uUnknownŒ  s äñleft unchanged."""-  | € = os.fs �  Ñif isinstance s, bytes¬  ° qif b'$'B0in B � 9b'% Þ  2   Rretur. j   Õimport string 0varã2s ={ (  s.ascii_# +7 .+1, '' %')O H L E'\'' qpercent % Qbrace { r } adollar, $ óenviron = getattr(os, ' ‚b', Nonež Felse% ifÊVU?O/ED'C 'B'A Á   )Ÿ †  re mA[:0] ‘index = 0    lez1len»fbwhile , <®6lenw1c = [" : "+1a  ‘ rif c ==�_:   #µ 9   ˜ 	d V + 1:a  (  $ ¼     6try²     « Z . "(có     8b+= c +ç â  „ 
ƒ ±®ValueErrorq K vg   „ ‘  Î 5- 1$ $elIz:J>8or DN f± V  4
  2]‘H c  5   §  @ =—  0 
‡     “Ì ð+1:]
            ð    pathlen = len(  )
  Mtry:  ! qindex =E . Ž(percentE ÿexcept ValueErrorS sres += G ! +\ }  Â =- 1( Oelseh 3var¹ ![:º ]=  â û   ÿif environ is Nonl  ,   vü ó = os.fsencode(os.D [ !de ^var)]E F   Ø     l ] ?varâ ˜?Key–R › D+«?Î� ! õelif c == dollar:  # variable or '$$'.  { !if[©B + 1³W + 2]H 	4  8  c I =3š  j Obracæ  4 O\ >+2:o &  ªl5rŽ &Ók…1 + N rÿ‚¢yÿÜù
x  9 P Æ>[:0¸Ò –acö—1E ðwhile c and c inò_chars >+= » Æ ‘   • ßÛf×.š Ï   d Ï
øË
À value = dol»lar + var
  Íres += value ]if c:  B ¥index -= 1 Jelse- \ c# 6 +6 ñ.return res


# Normalize a path, e.g. A//B, A/./B and A/foo/. ñ*ll become A\B.
# Previously, this function also truncateda ànames to 8+3 f~ ²t,
# but as? ðmodule is called "ntœ "_ sat's obq ð wrong!

def norm( ( )6"""ã   ñ, eliminating double slashes, etc."""= . € = os.fs W  Ñif isinstance s, bytesv  ®±sep = b'\\'4   4alt / acurdir- . &pa  ðspecial_prefixes = (e q\\.\\',q q\\?\\')w 
"~ ” '“ '{ ’ ''. ‘ 4'\\�  � !ifÌ.startswith(A Dò # in the case o<  s 7   4se î d # { ± -> device r  ?\ qliteral� s  Ñdo not do anyU !aÑ,¨C ˜  ; ðunchanged apart from© É õMž ’ O K  	 ! =— ’.replace(9R, sep9 ø ,& Â = splitdrivŽ!)
• ó# collapse initial backî# �'epƒi  ¯1sep3  ´ ¤ qlstrip(› ! @comp˜ % .š   9 Qi = 0& 0whiåq < len(4 w iÏ!t  f[i] or 2== 3õ [ 5del$ b    elP ‘  F =W W
:  ÏA > 0ës _-1] !/  X m u-1:i+1]s     i«  Ž Ci ==l ]C.end	{ 2   l 
f 
Ü +   i­#	! A# If¡ ¬ rônow empty, substitute –· . *2R ‚.append(©´éº  +ÍD.joiýÅ1_abnP_fall®_B"""RÀ }PabsolŸ @verso#ofÆ K$a B �!inJ«À`nt._getfullþ  '`€t availaðor raises OSError. See bpo-31047ÄP ðmore.

    """

 ð    path = os.fs ( ò)
    if not isabs :  ¡isinstance †, bytes)$  ( 2cwd^ ‚getcwdb([   Oelse- 
,  • Á = join(cwd,· K °return norm& Œ b)

# R ±an absolute6 R.
tryx ðfrom nt import _getfullG áname

except I  �Error: #ðrunning on Windows - mock up someth �sensible8!abbC = _ ±_fallback

å  # use nativeZ  N 'odl O 0defÚ  ® õ Õ  [3"""þ 0the% ÿ Âversion of a1"""L  5     Z v † 0 .1(OS+q, Value Z R 
¢5ina£ô, readlink as _nt_ ¼ë #3 A ° is a no-op\ãsystems withoum @ sup).H "re‡   =a †Ä  œ‹ R_deepÛ £�# These eVð codes indicate that we should stop¶ dS í Qs andi  x Ò  í ‰  ; âcurrently have³ - ÷
1: ERROR_INVALID_FUNCTIONQ 2$ çFILE_NOT_FOUND" 3" ŸDIRECTORY' 5' ÈACCESS_DENIEH 2�  f ðREADY (implies dr ‘– no mediao5# 3§ ÐSHARING_VIOLAÌ ð (probably an NTFS pag@HfileE $50£  � –SUPPORTED… $noùø for reparse pointsJ $67J ÆBAD_NET_NAMEI úremote server unavailab� 8E Ÿ—PARAMETER~9439· ú A_REPARSE_POINT* &R , JDATA+ Ö# 4TAG(* ²allowed_win¾ð= 1, 2, 3, 5, 21, 32, 50, 67, 87, °  2 %3
M §seen = setïQwhileÓ2cas_)w0in 1 G Ó  P.add(1 › % Þ  Aold_1=•      XÈ* ñ# Links may be relÃ°, so resolvÖ`em aga7o theirG  Íown location ’	 °  —# If it's‹ðother than a symlinkÿ, we don't know
   ÿ&# what it's actually going to be resolved against, soJ ÿ
just return the old path.0 ðif not islink(old_, /):-  º     =V * ( _break B @norm Ö(join(dirname‚ ,µ )))C þexcept OSError as ex« ¡if ex.wine& ´in allowed_ 4  Û ³ _raise† QValue‰ O ð# Stop on reparse points tè1arev0symws^ Š Í -
+ Ðdef _getfinal  ;°_nonstrict( Ã‚# These âcodes indicate‘ °we should s· n~!heˆw  š X# and_v ãæcurrently haven÷# 1: ERROR_INVALID_FUNCTIONV 2$ çFILE_NOT_FOUND" 3" ŸDIRECTORY' 5' ÈACCESS_DENIEH 2�  f öREADY (implies drive with no media‚5# 3§ ÐSHARING_VIOLAÌ ð (probably an NTFS pagDHfileE $50£  � ySUPPORT£ $67" ÆBAD_NET_NAME¦ úremote server unavailabg 8E w—PARAMETERV%12X'  l " %92± SCANT_Y ©
' Y' €RESOLVE_(  S ¿ @unfo‘ ²  !¬ñ = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 1920 1%®BNon-Ð algorithm isW@findCqmuch of-÷target directoryá !asæ!an µ2 Frestí•tail = ''9 BwhilD
&:try  °  ¹. =ÜÒT  +    Œ "  , € A) if	 0 ely9ath: E"%I3 ® ò    Q OS cƒ k ‚ ž!is�` fully÷ †yattempt×  J   #Üa¡ bà ourselves. IfB �succeed, =(  ;Q óê k  1new »ðreadlink_deep(patOh)
   ð if new_path !=  :)  < Äreturn join(6 ¡, tail) if	 U elseS J ïexcept OSErrorj ý"# If we fail to readlink(), let's keep traversingf  ¬ Mpass  ß ð , name = split( ð# TODO (bpo-38186): Request the” bl fileM Afrom �directory{ �# entry u² ð
 FindFirstFileW. For now,ø bwill rk l  ¢ O  @as b� ­we have it% !ifÑ� and not¬ to  k ! +ÉM  ç# =ý?ameù5ame: U  9 
 1def: g yö, *, strict=False)Ÿ  % p = norm 0 ©Ñif isinstance w, bytesB ñrefix = b'\\\\?\\'‹     ]unc_p$ <UNC)  ð-  
N öcwd = os.getcwdb(±  m "# Pö081: Special case forjb'nul';  ¨0orm- î 2) = ûos.fsencode(devnull)	 € ‘f.\\NULÀ  ¹~ / ;# :, y  k 98#7+
÷  � *ª )6had3 ›Â.startswith(4¼¸'t 4 �RisabsÌ
€  S iAcwd,ÄR ?try0 �_getfinal@  ã\ 	îÀinitial_wine�E = 0! 
œj as exj #if­
 16aisú  l  4ex.z v  +  ² = = Â B_nonÌ Q# The)^ed byA  Lqalways ¦ ¦ 	% -„ #× ²p off that Æð unless it was alŠÑy provided onô@origxO  Ñ . $ ” 	:
[#1UNCí !s,q ž Ü ¡ctually beÖ  €y À    # Handle÷ that case as well.
  ùif path.startswith(unc_prefix):,  7 s. v = new_) ! +F I[len? ]@ OelseR  Y A | 
= ‚# EnsureÑ ‚the non-, !ed Ð resolves to " Asame 	‡ >try† Àif _getfinalŠ Qname(í A) ==E 5   - 1 = + 	g àexcept OSError~.exC A# If¬ H ðdoes not exist and orig• fly did ,6 nr  � p# strip  z anyway÷ + ¡if ex.wine¡ ´== initial_ ¯  8 ª ò areturn(ñ


# Win9x familyÈ °earlier hav»Ð Unicode filem£ support.
	 2s_u# _# ðs = (hasattr(sys, "getwindowsversion")n  ¸  Msys.: ñ()[3] >= 2)

def re
(ð !, !S=NoneB"""Rõ a+ cative † Q of a1"""�  E q = os.f+V ) Ñif isinstance s, bytesi  ¸ ±sep = b'\\'4   acurdir . &pa  
xK J '2  _ I Q'..'
v "if@ is 
 2 = ” .  Ë ú ) ±raise ValueA("no)Â specified")@ T 4 5	Å 0_ab!"ab`@norm{ ( )6 Ø /th,  1 + ; c_driveQ_restï1lit `  Q c  ,Ü 6   j 
5 0if ´  «T B F) != 7  T Ö X +  ©³on mount %rÅ   Q" % (Ý F   < 
ø t š ' l§Ò= [x for x in"ò ö.split(sep) if xÑ` <    c; ð# Work out how muchn ï ( B  ö ’shared by�  ‹Ui = 0ú  ¿ `e1, e2Ä 3zip„ ¥ Å  “ ´*e1«+e2-  1 Ubreaku   bi += 1ò  @rel_j B = [ƒP] * (ZsC)-i)t- 6[i:]Ðif not rel_liWst:
  Õreturn curdir  ñ join(*rel_list) ôexcept (TypeError, Valu „Attribut ó
BytesWarning, Deprecation )� ðgenericpath._check_arg_types('rel 0',  c, star“  Ï ²raise


# RÒ ðthe longest common sub-= @ of  €sequence   ðs given as input.
# The func³ ø is case-insensitive and 'separator ‘', i.e. in á
# only differw ±between twoÕ sa  ™ !us” à'\' versus '/'— h 0,
#Ã ðy are deemed to be equal.
#
# However,*  Ó!edj ¡ will have �standard r d 0 (e¿ )1had: qalterna
 ¤ = )
g  < l²the
# firstŽ Z !inS –`. Addixõally, any trailing h ñ is
# stripped fromF 	ï c.

def Á ( s|B"""Gø |  ¦  # s names,=sZ UQ."""
"Rif noÚ sÞ¡+"('– g `() argþ…an emptyŠ "')U  ' ðs = tuple(map(os.fs "s) pif isinÓ"ceè `[0], b‰ò  1±sep = b'\\'¶   4alt / - . FelseÚ 3 I 'H 2'.'Õ 6tryG  drivesplitè [
  ²(p.replace(¡ ,ÿñ).lower()) for p inM%s]Ï C _#R !p. B(sep4 "d,7 f  "s]™  	�   ðisabs, = set(p[:1] = p� M  ‘ ; 5)÷   ò"Can't mix absoluti2rellÕ "")ðFNone¸ 0# C<¡ that all ß ò  letters or UNC+q match.åq ƒAmade«Hð# now otherwise ’  eüsû 1mix”atringsùna would'beN ucaught. pif len(WdQ Lo) != 18€Paths do>ß2ame"N u< Ô y 4vÔ¿! =K[× ! ![cÖ c£ Aif c)c× b|�ºA sP< b  ¸ < À   s1 = min(ãsplit_paths)
  Ÿs2 = max( õfor i, c in enumerate(s1):A  H Úif c != s2[i]   ’common = 	 I[:i]?  $ Ubreak JelseH ; D 0len‰ %]
5 ðprefix = drive + sep if isabs S  1 sreturn 8 0 b.join(m %òexcept (TypeError, Attribut pgenericcò._check_arg_types('V   @', * ˆ²raise


tryù h# The R ñisdir implementation uses os.stat and w ¡s the modeí 4# a³ ñ to tell whether or not0  “ ó is a directory.@ @This òoverkill on Windows - just pasw G ¥to GetFile.sL ¦ u š @from "rev   ntò Rort _ aˆ Cdir
™aImportš9/Us9 9 , sed abovf  · ð
"""Convert a NT Ã @name.¡a file URL`Ñvice versa.

ðmodule only exists7 ðprovide OS-specific c‘ Tñ	urllib.requests, thus do‹3use�0ly.›  
# Testingƒódone through test_N ¤

def url2¿ C(urlŸ:"""Š  î sBgpa relat8 é  of‰  'ú r' schemJ3to asystem*;·  reá`ended ä » al¢C."""ý2e.gÞó#   ///C|/foo/bar/spam.foo* 3and
 ) :) by Ÿ  U ¹C:\foo\bar\R iý€ string,( ƒDpars< Ñ`itself¹  s ":" evenBURLs½ Purl =C ò.replace(':', '|'5!if0'|'8 2url› éB# Noˆ 2er,Bcƒbslashe/ 3 iÖæ[:4] == '////'Q  " #ˆ `someth+@likeb`/host/¡/on/remote ^ >   $# ~ tëPto \\9 \9 B\on\9  9 @(not@halvy 3of Â " aYcstart U Q & x   N6[2:£componentsk¢3('/d : ±# make sureq%toÇ equotedŠ &:-t ø71.un1 U('\\'€ );  ‘ 
‹ ï � ! )2V  q[0][-1]œ #in|æ.ascii_lettersÉe^p = 'BadoP: ' +ep%1 OSî(0 › òapt ð.upper()
    compoñ"nents = comp[1].split('/')
    path = drive + ':' 1for2 1 in oG :  7 !if    L  ð+ '\\' + urllib.parse.unquote(� € ð	# Issue #11474 - handing8 Ñ such as |c/|{ !if± ð.endswith(':') and/  6/')› � =‘ F areturnJ B

deT £name2url(p; ñ"""OS-specific conversion from a file systemL ° to a relatM1URLn €of the '/ ð' scheme; not recommended qñ general use."""> c# e.g. ó  C:\foo\bar\spam.foo bM #es ù  ///C:/foo/bar/- `import3š7 ñFirst, clean up some  al£ Ðms. We are go¦pto sacr"eD  í ðadditional informa q anyway(  Êa[:4] =™g\\?\\'´� = p[4:]-  ]1 �.upper()9 9UNC7  ) !p R  |
B !elD p1:2] !=ëp  9 ñraise OSError('Bad×!: K ¯0if º0':'pA C# NoF0£fier, just:‘t slashes¯ xå 2#Ž 1 is– thÀlike \\host\ç¡\on\remote X #… @this©@////7 /7 B/on/7  7 Ð(notice doublr &ofÈ tÁ cstart æ N * R  �p[  U ê–#\\— : §	A8 ¾Q.joinHF )v  W Q q:', maxõ"=2$ Rif le< )	E2 or †[0]) > 1Úe TË 
8/ !)
 V=j.Ã  © 4[0]Îš   Ï ± c � 0///™d º;Y x    ª œ Œ ð
# Copyright 2007 Google, Inc. All R ðs Reserved.
# LicensedŒð4PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs)�ñ  numbers, accorFð to PEP 3141.

TODO: Fill out more detailed docum «!onÝ‘operators‘
ú3bc C£ABCMeta, aœ ñmethod

__all__ = ["N— °", "Complex AReal o  ÐIntegral"]

cß  ; Q(meta =q £ _ø ð inherit from this clað:ss.

    If you just want to check if an argument x is a number, without
D ñcaring what kind, use isinstance(x, N8 !).u 1""" â__slots__ = ()‘  # Concretel Àeric types m£ ðprovide their own hash imple§ Sation\   [ ðNone


## Notes on Decimal -     ] p all ofr ñ methods specified by ðReal abc, but it shouldK ðnot be registered aH2 @beca+dŽ Ps do 0 Ðinteroperate j I ôbinary floats (i.e. È ð('3.14') + 2.71828®ðundefined).  But,G ðabstract reals are expectedü	{ e sR1 + R2Ô 0 beG 4 1wor/`R1 and+  V Pboth ç Ðs).

class Co©#x(:ª3"""  ° sT 0ion 1at f !on ’builtin cP "Ñn© �rt, thoseá À: a conversiA o8 0, .á, .imag, +, -,” ñ*, /, **, abs(), .conjugate, ==,é $!=t fô°is given he¿`geneoubBs5 Âdoesn't haveI!als ð knowledge aboutè  m,X L  f‰@back§Kthe E  + apdescrib¢Feloww& x@å( cdef __e‚__(self)µ ø¼"""Return a�  üÄ. Called forwH .g Oboold @TrueŽ ~ Y != 0T  7 Q  ˜   r™ 4 ]!@pW!tyx ó  S ì Ariev}>Ð  on! is³3ber ˆ @This‘ruld sub “ #      Praise§I) ÒedErrorÀ  ÍÀ  $ Q ßÅ [j3addz, othermÍ+ 5p rq „ 0 + y q 23negá 
Ú -b 6?posb ð +self"""
      ñ+  raise NotImplementedError

    def __sub__(self, other):  " 0""" " - 5""" qreturn  1+ -: W rX 1 ! -A X  -Y ' X ñ @abstractmethodŠ Ã ?mulÃ *Ã  p rq µ . *Ü q %truedivå /å ù: Should promote to float when necessary.y� %rž /75powŽexponent¹$** ?; sPor co xCª Jbase¦   / *+83abs
i R°ñs the Real distance from 0. Called for abs)"1’conjugateS 	^†(x+y*i).$ ") ZQs (x- ¥2#eqå"==>p C5£.register(F‘)


classg(' �c"""To  ," B add—�operation  ­€ork on r¯‚numbers. InÐõrt, those are: a conversionóñ, trunc(), divmod,9ó%, <, <=, >, and >=[ @also>Pvides)Qaults A†derived ² .V  ;	 â__slots__ = ()´ Pœ )~2Any%ccan beá 0tedà ƒa nativeÜcobjectÆ  @ Ñb €Ó1!__U³  k 0: T|Aatesúµ §n Integral« ža Æ i such that4±  * i>0 iffS 1>0;q ð ð   * abs(i) <= aµbs(self);
  ÷** for any Integral j satisfying the first two conditions,D ±  abs(i) >=
 ð	j) [i.e. i has "maximal" A amoW Uose].E / ö"truncate towards 0"# 5"""/ ñraise NotImplementedError
# ñ @abstractmethod Òdef __floor__:  �"""Findsï †greatest0<= 9.ƒ 2Oceil‚ 8lea > 9Sround€ ù , ndigits=None)R( sø 4 to) @ decÌñ places, default+Bo 0.� T%If5 àis omitted or l Å, returns anhµ, otherwiseš' s Real. — Chalf&_ even'"Vdivmoƒ 
" 4£ Á): The pair  2 //½ ,2% )€Sometimeeð is can be compu±faster than†\ %of	Qopera{ì PŽ �÷ rÖ 
ø  Ø ø ˆ¦  ‡ ª§! %Ž)ø ?div	 W  _ h ÿMQ() ofg / %3r\ “ p  ”  œ “  / “ 3% i  ÷(2rq à âq 2/lt <×P åA< onšs
ñines a total ordering, except perhapsq?NaN–3/leµ Àlf <= other"C""
  ñraise NotImplementedError
# Ä# Concrete i! Àations of Co ñx abstract methods.< rdef __c$ ‘__(self):  } 3"""  D ==  Rfloat X, 0)"± _eturn* )³ ‘@propertyj  … BrealM 	~ ðReal numbers are their . _ oonent.|  +Ê m Oimagm €have no , _inaryp 0l  Ë Ÿconjugatec  C ð is a no-op for é sÉ    ¡.register(|±)


class Rï0al(& ¿ñ""".numerator and .denomin ò	should be in lowest term„ —ß__slots__ = (¹@UT6  x Ê
^ Ç ` * ) <ñ's conversion to i+ ) ‘ 0 = €/ » 0 e@It'sº ortant tha i‹ !usûö integer's "true$Adiviµ `ratherF õn casting one sideÒ € before 6 Adingº Œ  so: 0t rR@0hug$w “ öt without overflowing.Ò � ÍIã rÍ „ 6nalÑ T addsÉ± rwork on!r5– �In short,A!seK
ê�int, powÛ ‘ modulus,91the!qbit-strRpY d ò $ 5'___intL#inZ X  ˜  = y R ?dexT àCalled wheneve` indexŠð needed, such asyslicing� ×� ñ§S__powŠ Q, exp¬,[S=NoneÛ Þ 0"""$5 **, $ %- à, but maybe faØ : PAccep3e/ ñ argument if you wY�o suppor, ® ? %3-. ù of
Q(). R{aa Types R Ì E < 0G eyz Tsn't ²0. O— wise, justñÌ ’F À  2-argumentó version described in Complex.
  5"""  raise NotI% ÁmentedError
# ñ @abstractmethod ñdef __lshift__(self, other):!  g 0""" 2 << t 2ru ˆ  v  ~ u 3é />>é 9ru é ?>> é 6?andÏ&å 9q â &á 7?xorá ^á 9q á ^á 7à |à 9p ß |ß 7Tinvers
l~Ä# Concrete iù±ations of R �al and Re	  sM
Ofloa–  !R) ==  2int )Ÿ]eturn# †�property_ v ’numeratorK 	xõIntegers are their own 3 /s.y  +An denominp whave a .  M1o 11

§ ðral.register(int)

� ñopcode module - potentially shared between dis§nm2 €s which
5°ate on byteT ñs (e.g. peephole optimizers).| ó
__all__ = ["cmp_op", "hasconst Cname Djrel Qabs",¦ !  8 Dloca" dcompar; 1fre $opP [opmapC ÐHAVE_ARGUMENTj ð	EXTENDED_ARG", "hasnargsñt"]

# It's a chicken-and-egg I'm afraid:
# We're imported before _opcode's made.
# With exception unheeded
# (stack_effect is not n Ä)
# Both ourˆ ðs and eggs are allayedc ð    --Larry Hastings, 2013/11/23

try:
' Sfrom ¥ ½ ' s‡ % ø__all__.append('! A')
eÍ ! Iû RError\ ð	pass

cmp_op = ('<', '<= = ! > ð>=')

hasconst = [] Ename Fjrel 5abs Floca @compE 6freE Bnarg9 ð  # unused

opma¤ T{}
opt ð"'<%r>' % (op,) for op in range(256)]

def def_op(9 R, op) J p[op] =  Mk [   "opB   C  Y B 0has/ �2op)D  D  / D ?absD 9absD ‘# InstrucÝoýs; •�iled codeÏólank lines correspond to available @ ß  – Ð'POP_TOP', 1)z »ROT_TWO', 2 †HREE', 3 $DUA 4 E 5  Z ‚FOUR', 6eq N‚ 9( ÐUNARY_POSITIVr ,10 DNEGA ¼ : 0NOTÓ 2d  QINVER – !BIo ð MATRIX_MULTIPLYA 6v �INPLACE_&  7g L @POWEæ 1Õ  ` .20: QMODUL|}; 0ADD• pSUBTRACÙ 2ˆ  SCŽ 2õ °FLOOR_DIVIDh2ò > GTRUE! 7D 8# E pGET_LENVäÐMATCH_MAPPING ã pSEQUENCµ 3* @KEYS6 *ôCOPY_DICT_WITHOUT_% 4…  ±_EXCEPT_STA+4® 1AITÜ5°  Æ @ANEX‚5¬ ÁBEFORE_ASYNCy H', 5—3END  FO£5¿s÷5½ ø5º k5¥  l5ã  ST² 2SUB46æ vDELETE_ ê EPLSHIF6•À('BINARY_RSHðIFT', 63)
def_op('BINARY_AND 4 0XOR 5  6 ÁINPLACE_POWE4 7 bGET_IT 8 ¥YIELD_FROM" 9" �PRINT_EXPR &70 öLOAD_BUILD_CLASS', 71 V   2  Š �AWAITABLE T ÑASSERTION_ERRå 7å 2LSHL7 R  j77 k7  ‡ 59)
·±LIST_TO_TUPÇ 8ã °RETURN_VALUâ 8â  IMPORT_STAP8Ù ÀSETUP_ANNOTAþ  Q8Ü QT Ù çPOP_BLOCK', 87¤   PEXCEPt8¾ ùHAVE_ARGUMENT = 90  ñ# Opcodes from here have an argument:

name½�STORE_NAMè 390)M °# Index in + V list5 VDELET6 16 E# ""_áUNPACK_SEQUENC^ 2( ñ# Number of tuple items
jrel’ 4FORÇ9xP †EX', 94)� Â 0ATT� 95d  Å Â 6 66 Â  ñ Š Z `GLOBALv 7& 
% & 8& % "PROT_NB —*@CONSÛ/10zRconst{1has €.append(1 L Ä$10� ” ùý!10�?    
8  =a', 103î 8  .×
7 "SEî 46 	o ?set6 1MAPl Ü	6 Ëdict entriesß$10à’COMPARE_Oo ï ñComparison operator
“  e•7˜)—‚ s5  Ìó 9)Ê2°JUMP_FORWARƒ"11MÊñbytes to skip
jabsâ: ÒIF_FALSE_OR_Pü Ð11) # Target < @ offŸU�beginningÄ mQ 9TRUP  ^
{ pABSOLUT%11K *  	©  1C*  ‚ ) 6* h2´#11!hàdef_op('IS_OP'ð, 117)
def_op('CONTAINS_OP' 8 qRERAISE �9)

jabs4 ðJUMP_IF_NOT_EXC_MATCH' �21)
jrel& ÑSETUP_FINALLY õ2)   # Distance to target address
— ‘LOAD_FAST9 49   ð# Local variable number
hasl ¶.append(124É VSTOREN 5N M 5M WDELETN 6N M &6)è ‚GEN_STARè 9L  &õKind of generator/coroutine& €_VARARGS*!30B 1# N @ öraise arguments (1, 2, or 3Õ ÑCALL_FUNCTIONI 1I U#argsq JMAKE( Ôg # Fla( ¡BUILD_SLIC?!33N  × ™ LitemòbCLOSUR4  5)ÖEfreeÕ3ˆ"QDEREF° 6.  6á / 7/  å0 80  8È	A0_KW” 4D!# Bi + #kwL
3 !EX3  OMJ1WITe4¸ÁEXTENDED_ARG@ 84)
 e = 144¿±LIST_APPEND. ObSET_AD 85MAP  }UCLASS#4#   } &_5  }  52S
-dASYNC_é 5Ã±FORMAT_VALU5» mÁCONST_KEY_MAË5Ç # QSTRIN(‘57)

nameªÎ QMETHO &608¥ 1 Mm Ð &62  MQUPDAT¬ 6±’DICT_MERG â  5 5^"l ©#, ® #, #, �r
"""
Op%ð Interface

This module exports a setñfunctions corresponding”ãhe intrinsic
oZ s6 ôPython.  For example, # ð
.add(x, y) is equivalent
éh…  æäion x+y.  The ‰ á òs are those used for special
methods;ý Ì±without lea½ �and trailÊ A'__'O àalso provided
R Ãconvenience.(Âis the pure æ   iÞ  5a) ÿ  " mQ.vñ
__all__ = ['abs', 'add 1nd_  ttâ0ter cconcat
 Atain3  countOf',
ã @'del# -  eq €floordiv "ge t# gV i~ GiandO À   'iconcat'Ð, 'ifloordiv' alshift bmatmul "od   &
  a'index  	 "Of L BnverK !or 1pow re 
J !s_ Bs_no6 1sub ‚temgetteE Dtrue® xY Ile',L ¡length_hinJ Õ l Ú ¢methodcall^ mé 	K  ne‹ 1neg !ot¬ !or 0pos Þ Ý psetitem' Ö Ç Ptruth  Ï ÿ2]

from builtins import abs as _abs


# Comparison Operations *** !ñ#

def lt(a, b):P"Samet qa < b." qreturn  5 e5 =6  2= b7 /eq7 =7    7 nn !7    7 g7 >7    7 >Û >Ú Ÿ# Logical•03***˜lnot_(a—Znot a— » U5 R¸ÐTrue if a is ƒú, False otherwiseQ 0 e& , ` ?is_Á.is  8 /noW0is Ã m  ù€Mathematf@/Bitµ n&a6abs+÷ 
 2(a)Ë ?add++ e?and:&7 &7 ¦r .//<   ª ¦â  1.__ J__()é a E vC ~‚A~a
iøb = inv: €º <]<÷ /mod%ñ %6 /uln *6 *6 ñ9 @9 @9 >neg-"-a/orÿ|c |c /po¢ +c +c ?powÆ ð** b."
    returñ"n a ** b

def rshift(a, b):
    "Same as a >> b." Pretur;   ; ?sub8 -7 -q truediv: /: /: ?xor6 ^6 ^6 ÿ# Sequence Operations * %#ø _conca3ó+ b, for a and b s‚ sIÑif not hasattÑ Ó'__getitem__'… ‰òmsg = "'%s' object can't be „ ñenated" % type(a).__name__´ E ñraise TypeError(msg) Ñ+* �containse0b iþð(note reversed oVCnds)Ý r&- .YuntOfU R' àthe number of sf âwhich are, or  eequal,é‘count = 0Í  qi< Ä ú �if i is bD fi == b  ! C A+= 1D ¼  » 0del• 	» ƒdel a[b]ù  9 Ï9 5 r   8 _index,afirst %  1f� 0, j@enumî ó  if j � iFelse< FCValuG'×.� a(x): xÙ%inó"')× sÞ3, cãhs[b] = cÊ    < ôlength_hint(obj, default=0G "¡T°an estimate$cAobj.ç @This%auseful¹�presizinge àers when build pfrom an³qrable.
M 0If p ¬ñ supports len(), °result willÆñ	exact. Otherwise, it mayN Pover-¼eunder-Ö  by{ Àarbitrary amk. The ` !anJ Âinteger >= 0÷ "5�³isinstance(_S, intb ,Œ(� Ê be, �erpreted9n ager" %‚  C  ªf °” # k±E 7try’C \2obj? fexceptí. Bpass¤	E  V" == F 7.__pFV ‚Attribut[ r‰ Ò e  `val = k  Áª O  0if D ÿis NotImplemented„ 5  �ÚÀnce(val, intC):
  õ#msg = ('__length_hint__ must be integer, not %s' %; B õtype(val).__name__)# òraise TypeError(msg ¬if val < 0‹ Š û() should return >= 0'b LValuc / ÿval

# Generalized Lookup Objects * ò#

class attrgetterÇ 1"""š R« Áa callable om ñ that fetches the givenH ñibute(s) from its operand.S ‘After f =- u  ('q1'),K  l S f(r)*@s r.  @  íµ @ y, 'dateH gH (I @, r.) )R h’  ‘.first',   Y.last] h] Ý a 8  g ¸  8 l Y’__slots__µ Ë sh _ý 1')
N ñdef __init__(self,41, *0 þ!ifØ ÂÕ  °isinstance(% W, str@ . è'- Ñ Ê Na@ Bing'?  ¤  ._4 sØ  	 ,"  F     ›.split('.F  ÷ �func(obj¤  2for� !in sñ Œ �obj = getk  K ,. 
�  - `1obju    Ì  �0 = �  Jelset ,  i  Ü b1) +®s8  V ð & ‘tuple(map/  ', J )« Æ V N  õ  ) / 0 inJters[ u ë ´  r _‘
’t ? r ¼Crepr= Ê8 á'%s.%s(%s)' % á1.__‘á__.__module__,Ž  > € 9 @quali;  sQ.join‰ ® ƒ	ŠoreduceÐ 
ˆ 	I hBitem�Ah H c ( p /(2^8[2]
 \9 h, 5, 3? U�[2], r[5 "3]]Û ê Y ê ) 0, * s<Ðif not items:'
  ð self._items = (	 ),)" édef func(obj):  H °return obj[= ]! ^ acall =E  JelseM ,  D  Š  ’ 1 +  @  { š Ptuple½ Â[i] for i inN 
é � ­ n  f  __ 0__($ ,í 
  .(  m ')
= Crepr= 8 á'%s.%s(%s)' % b ñ.__class__.__module__,Q  ø  € 9 ?nam7 à', '.join(map(ª ", K q+))Ê OduceÌ 9 „ 	I !

Ó p methodO"er1"""Û RJ a  @ableh�ect that ³s the givenH   oË¡s operand.I “After f =%  P @er('1'),E   b f(r) ¿@s r.  (()D gD ø , 'date', foo=1S gS � W 
1 d ù �__slots__‚ '_‡  –Q_args	 !kw 	ŠCinitˆ , 3 `, /, *) B, **3 n› ) ! =0 ž  Kóif not isinstance„ , W, strF  0 òraise TypeError('ÓU   must be a9 Fing'd‚  ¡ 0 =  ‚  ³ 2 = 	 A ®í 
ˆ¿€ getattr{w À 2)(*]  p   b 	P úc ð  7 @ = [ )ç " }.extendB  )  + a'%s=%ròQk, v)š 
  �¥ .‡(G ò 8v × &jß  W  Û ! GzC,) +  x CPAfromtõtools import partial8 v  m ~ Ž  NAk‹ à

# In-place O‘tions * %0#

}“iadd(a, b˜ò"Same as a += b.> Ø Fa? ð nd(a, b):
    "óSame as a &= b."
     ñreturn a

def iconcat(a, b):! "B ó+= b, for a and b sequencesY àif not hasattrG Ó'__getitem__'S  ƒ òmsg = "'%s' object can't be … ñenated" % type(a).__name__˜  E ñraise TypeError(msg)  a ¬  á €floordivœ ã  (//& F _lshif'(<<D  D ?mod… %@   ? /ul? *?   ? ?atmB @B   B oàD |>   > ?pow¿  ³ Poa **=b@ r‚	(>>ƒ  D ?sub„ -@   ? OtrueJC  VC xE^?   ? B
try¡ñfrom _operator import *
except I  0 ’pass
else ? ð__doc__

# All of these "__func__ = 	 ô" assignments have to happen afte‘ king
# m Àto make surea €y're setD ‘the righth ‘tion
__ltz  lt e ae
__eq beq
__n n g g < g< "no   a
__abs@ 0abs "dd  dd n dnd_
__@"  �
__index 
  v v "eru Pinver† F%  R
__moo  mo} 1mul 0mul ´  î g �neg
__or  or« "poÖ  poÖ 1pow bpow
__?  a
__sub csub
__Þ  C
__xb bxor
__©#   Btain{ 1con b
__del3 =  
3 = ( Š 2  = 8  Ca™!iaš#ia› 	    „ � É  ¥    u    ‚iƒi„ 	   {6 m   iim 	   d4    qirig'   ( uivñ"""A powerful, extensible,”ðeasy-to-use optiðron parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge[ ð mailing list
(http:// s+   finfo/o\ ð).

Simple usage exa  :

   fromŠ î € import · 1onP&  9r =  ()A  P.add_u ð
on("-f", "--file", dest=" `name",6   áhelp="write re‡ ñto FILE", metavar=" x qx _quieth öaction="store_fals¤ Sverbo ¯fault=True± 
ðdon't print status meshÑs to stdout")F(!¤s, args) =dD_ ñ()
"""

__version__ = "1.5.3 1all "['¥'ž S'makeˆ ßSUPPRESS_HELP [USAGE kValues } ŸContainer _Group Z ½HelpFormattQ �Indented$ 	OTitl" 1Optz OErro³  �Conflict" ( 2Bad/ àcheck_choice']ù‘copyrightè C á (c) 2001-2006–aory P.œq.  All < Ís reserved.
? 2? PÄð Software FoundaJ 5
Reáqion andÎAin s» ñbinary forms, with or ±out
modifich  	ñ
e permitted provided that$`followPcondi� ‘s are
metÁ** ” Ds of� Àcode must re¨R eabove e�Ánotice, thism E q n“ &e Ž �disclaim!.  † 7in † produce‰ B0 inX Ñ �documentf •ö/or other materialsn£6the¾@ion.³Q* Nei7    ¿    author noru   {1its‚ 2con	�ors may b Û�o endorseppromoteŒ Ñducts derived˜I ”s¤ « €out specG z ]rAnKs8ð0.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRÿJIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE7  ñ OF MERCHANTABILITYp @FITNl ñ+FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALLq ô AUTHOR OR
CONTRÚ ¡BE LIABLE ` �NY DIRECTÅ 
 ðCIDENTAL, SPECIAL,
EXEMPLARY,ÿCONSEQUENTIAL DAMAGES (	Ð TO,
PROCUREMª ñOF SUBSTITUTE GOOD_ÀSERVICES; LOq°F USE, DATAy  C PFITS;… ABUSI+ðINTERRUPTION) HOWEVER CAUSEÀAD ONÇ THEORY OF
s�, WHETHERG*AaSTRICT+' wOR TORTä °
NEGLIGENCEŽ OF ÐWISE) ARISINGS  >pWAY OUTñ0THEÑ  ÁIS
SOFTWARE,À€ IF ADVI· !OFÇSPOSSI3#CHoô.
"""

import sys, os ñ,textwrap

def _repr(self):
    return "<%s at 0x%x: %s>" % ( ñ.__class__.__name__, id 1), K ûJ


# This file was generated from:
#   Id: option_parser.py 527 2006-07-23 15:21:30Z greg7 0 20 õ6-11 16:22:03Z gward1 Bhelp/ 7/ 7_ aerrors0 #090 Ô4-20 00:58:24_ B
try9 × @ get` { 3, n
 ‘
except I›Ef >  Œ$ ƒ(message‘• 
© 2 W ÷(singular, plural, n? ’if n == 1l  R   ë< V  J T

_ =Ø 1


üP OptP²Â 1 (EÖ $iou  œ �__init__W, msg’  &`.msg = Ñ S__str4 / ª 0elf6 ‡ 3ion… 	” =   Ó ÀRaised if an½ ñion instance is creœñ with invalid orñinconsistent arguments.  ` 	 ò ,ßŽ  Š ú      ’id = str( )!ifw.0 ?_idè" 0 %sÑÐ 2_id½ a)Ô  ˜ OelseN ± 7msg¶ionConflict“  1 X ‘c3 3ing.æs are added to²rryŒ†ionValuew ,  y aê…  vD  ðencountered on the ñcommand
    line.
 ñ"""

class BadOptionError (OptParse %):/  A ñRaised if an invalid o> ó is seen on the x t  E ðdef __init__(self,C C_strn  %   @.opt $ =! 
Ž A 3str@ 7 ðreturn _("no such: Èion: %s") % X ™Ambiguous
d  8 Ÿ 		a@ m 1ó , possibilities  { 
˜ .J) / ñ 	L * =\ UL(_("ë  X… (%s?)")s  w   !% ßÇ², ", ".join 	– D)))
‘âHelpFormatter:  zâAbstract base ÃRfor f0 4ing†rhelp.  ÕÓr£ ñinstances should use one ofº	~ A sube  esc A k  d ú; by default IndentedE  ise "d.Ë I� ² attributesg0  pz>r :¶  QX`ntrollé Û  × £ 1  i‰ ó_increment : int  é `number÷ £columns to8 � per nestg Slevel: @max_õ P_posi6X  Ámaximum starA _  @œD tex‘ S ¯calculatedV ;®  qitiallyò qsame as ¦ * \widthÌ ^otal & o�output (pCN>Âto construct�[  m€is valuebÑbe taken from‹ ñ$COLUMNS environ°„variableX†¢ @currÜía�( {   _  = R (in ´s~ ¡%Pavailº ñ& (Ì] =’_tag : st¨ò0ext4õ replace with eaØ%'sz`C, "%N " ŸQ.  SeQ Vfalse”1dis² <  ’expansion5 ¾ ”ƒings : {©· % }t Dmaps š` Äpsnippetz X	µ explainingE , Pyntax+ Cthat‚ à, e.g. "-h, --D 6" o6À"-fFILE, --f±ile=FILE"
  ó_short_opt_fmt : str €  format Àing controll Ahow : õ	 options with values areD ñ"printed in help text.  Must be either "%s%s" ("-fž 6) o‡ D"%s    ð , because thoser õ the two syntaxes thatˆ ó Optik supports. __longþ °similar but
 + ï =; mÁ ¤ S-file¨ g 1  oä =Ç # ˆ)‹ A"""
- ó	NO_DEFAULT_VALUE = "none ñdef __init__(self,6 Ì ÿindent_increment#  @max_�P_posiÁ$  _width  ø…_first):~  Œ Ö.parser = Non • < =  L 1if } 1 isJ f  ã :try   0  T õ	t(os.environ['COLUMNS'])^  / ðexcept (KeyError, V» Õ  +   ^ )80F  E-= 2 ì  =Å 
 	u1 = 0 ŽE = \8  �   Mmin(* b, max(q ]- 20,VV * 2)þ q Bcurr# *6 = Ø   ^level ½ l ã —  p# compuêFlate½P 3 ô sAå ' °default_tag÷% ¬ .rÚ_strings = {}G Ô=^ �&  Ðû%  Ÿ† gBset_Ñi  µ  # = 
@ ù  ^“delimiterM  L 1if  @ not-‡("", " "#  jWraise­(Õ     ò"invalid metavarW  z Æ’ Çr: %r" %# $F2" +,   +U” -QÉ  r ì =í C ’ ì  ) 
ë ·Û �X+à2 ‘´5 mF+= 1< de™d -d àassert self.cuòrrent_indent >= 0, "I ódecreased below 0."
  ñself.level -= 1
 ðdef format_usage(& !,  !):#  ? ôraise NotImplementedError("subclasses must i" -")c sheadinge  g 8_Ë Ctexte   b &""Fø ð a paragraph of free-H  ;  õ inclusion in theàhelp output at 1 cuŸ Ÿ at6 u.6 „  d Á_width = max¶ .  - �.R ñU, 11)K f  = " "*.  ) areturnÓ  wrap.fill(} ,#  è  #   ) sinitial¦ =™ 4 vsubsequÎ7 9pdescripN"',  ß(if À Ø &	)K f + "\n$OelseG -""ÞTepiloÝ 
›  O R\n" +ñ	� 4 )˜ Ó ÚÔexpand_defauloG
š òparser is None or not“ B O_tag¿ T . q5 rvalue =J e . cs.get(> GdestÛ Ë¸ _A  ˜ �O_DEFAULTž D  +on­
# ƒ NF f_VALUE² #�  Î r.replac¶  i, str(` )¸J ³ y`# The g gReach % � consists’0two£&ts{Q#   *p0optŠ ñings and metavars † + À  eg. ("-x",:ô"-fFILENAME, --file= "ƒ ; f Òuser-supplied² ostringg kÿon expert mode", "read data from q O ñ
If possible, we write bot¦qthese o�ˆ same liý »  -x /  �  h 
 { But ifV0 liÕ¡s too long�  ñt¼B  — �a second— ,Qed to` ² ù column it wouldH 0artm if ð fit on the firs“t line.
  ô#   -fFILENAME, --file= 	( 3 ý read data from , µresult = []@ òopts = self.option_strings[ 	+ d_width0 �help_posi7 " -E õcurrent_indent - 2l pif len(s r) > optP :"  Ê   ñ = "%*s%s\n" % (Ÿ 
Z P, "",D )s)? x P_firsë : 	© . Pelse:r   €# start : � on same¢1 asu F  = ³ _-*s  µ ù À 0i ¾r.appendE  if• Šion.helpP  E_texàexpand_defaultJ :ionE4  ‘  < Pwrap. (   ,ð 
C 
¯ 	Î£ÇE p O[0])I 0extø [J ÞP  K 
F  § 2forÏ!inä_2 fs[1:]]8 "elXÚs[-1] != "\n"]æ 6\n"? ò return "".join(+ !)
µ¢def store_fuê–, parser)l é 8(b ¦max_len = ' Ú copt inF ×FlistQ  éÏlformat‘ 6optq 6 +]G :â  +   ¤ Cmax( ,	€ 2) +K
áv ý  é ^groupë  sí  /   ¶ ›  Ô  ï :  0 
Õ J 3 ? = #+ des 9 r¼T= min�C + 2Ý š 	* • ý½ r  # i G, 11W D  —ÅB"""RRða comma-separated Ü$ o ¾õ& metavariables."""œÛ 3Çtakes_value(sš? $ =_P 4 or §dest.uppery < AshorN D[Õ %._ ð_fmt % (sopt, metavar)
  ùfor sopt in option._short_opts]: Along ¤ = [self._ ÿ_fmt % (lopt, metx  w  , w L v Yelse:„ œ / =±  	, Q +  
+ 1if Í [ Zfirstt  
2 =    &+ H [¬ + =+ ' +D € ðreturn ", ".join(8 ù)

class IndentedHelpFormatter ( )° 2"""" Ã help with i? @ secÞ� bodies.þ 2"""‡ Ðdef __init__(,  Û  J Ï_increment=2%  @max_} P_posip ?=24'  ¯width=None  hˆ#=1Û  ‚ 	ó .¯ 	ª ¼ õ « -, ˜ !, „ ,’n )fjb_usage  � ·@_("U& ¢: %s\n") %* L sheadingN  P  "%*s%s:\n"P Ð ’.current_‚d, "", @ 
(OTitl&&¥underlined( a /er)20å ‘),0J)/ (*lB"%s %Úg l LB")),F“,   &—"Ž  G5 b, "=-"»Ólevel] * len(  Q))


óparse_num(val, typeaðif val[:2].lower() == "0x":  Õ# hexadecimalv¡radix = 16 /elK bK �# binary1  [ D 2 Qval =“  2:] or "0"*  ñ# have to remove "0b" prefixE ˆ "1]Ë  D o # octË  8B &seý 5 		 /# 0+¹ kuì )‘0int ‹2 _­Ðint)

_builtiðn_cvt = { "int" : (_parse_int, _( ¬eger")),
  _"long6 Bfloam 
 h 
 `ing-poŠ o qcomplexr  =  ñ")) }

def check_builtin(option, opt, value):Î ä(cvt, what) = 0  [4 a.type], 2try5  ²return cvt(P # €except Vb WError1 aaise O‰   (7  Q   2_("v ò  %s: invalid %s³ �: %r") % Ï µ Í )õ `choice% ô "ifP 0 inBion.3 s® ß Û £ Felse 0 ñ = ", ".join(map(reprfU !))A  à r&q  ö (choose from %s)"`  d » ", 9 òs))

# Not supplying a default is differentX  ôof None,
# so we need an explicit "nW Bied"\ð.
NO_DEFAULT = ("NO* £")


classZ1"""+õInstance attributešò_short_opts : [stringŸ0  _Ž S @  ac2 : 4   Þ Ndest *S: any< @narg† 3int 1con; $ ¬ ácallback : funœ E  __ T(any*ä7 3_kw {Ñ  › # }F LhelpÅ zmetavar  u4 þ # The list of i„ó	 that may be set through> �keyword ˜ qto the qructor.' ¢ATTRS = ['�'U'‘  ’  “ — Š  +s „ � ž   • –1']
"‡ _#ofµÃs allowed by² ¥crs.  Eˆ!ly½#edG @here³ˆ@ can¤�idate its±cuments£PCTION¥‹("store"¤"   _T ?tru; Ofals oappendT   s _count7  0 À      "help":,
  ±"version")
 ó-# The set of actions that involve storing a value somewhere;A ðalso listed just for constructor argumentA 0idad c.  (IfA 3the{ p is oneŒ €these, tj   mW ²be a destinD )@ ðSTORE_ACTIONS = ("² -e"û 	 _  $ ?truG Ofals$ oappendf  ‹ _count®
 oôwhich it makes sense to supply¼0Â# type, ie. 7 1may°fume an¯@from�á command line.E _TYPEDuë 
�callbackè 
­ ”*require*Õ Ï  ¸Ÿ �# always× ALWAYS_Þ Y# "å Z	Ä 0takÌ'…£' attribut\^CONST\(} % ƒ Qknown-s¢ op‰ô parsers.  Again,Êx3forP« Ð'  8ƒ 4p", "int @long Afloa pcomplex fchoiceü!Diˆ0ary	>PcheckŠ1fun! #s,Á±convert andˆ #j#e æ E €s accordG !toÝ"  Ü#D �Signatur�} C is:* !   (K 1: O\,~ P : st,• %ue ƒ) -> anyD S  9 0ion O   instance /Â "hez e§: 7 dactualL qseen onô Ñ-Ñt    (eg. "-a•P--fil• Þ3#  ¾ iW ] c  jcreturnM ²should be i˜ ðappropriate Pyth¯ 3ype@  éc.®@ -- ± Óan integer ifî ! "==€
ØTIf no8 ,qdefineda",„s will b„ !unë edms remainásg  Â_CHECKER = {ƒ  F:u �_builtin¡+?   / R/ Àuiltin,
      ü"complex": check_builtin,
*  ”"choice" /  . 1}

E ð6# CHECK_METHODS is a list of unbound method objects; they are called
~ @# by ð constructor, in order, after all attributesD † òinitialized.  The… ðis created and filledV 9latV G 3the® ] ñ  actually defin\ ó(I just put it here because IG slike to6 { �documentÃ XclassÉ !inü CsameC Áplace.)  Sub/  es that adÌ rother _×3*()¶ d shoulRµ  Z kir own¬§T  ^ 2eir)N ‹ ðto those from thU Á .  
 e= NoneF-- CÐ/¦Sationf ?s - g`def __? ð__(self, *opts, **1s):� J²Set _short_% Q_long usÊ ' r' tupleÌ ? 1Hav¾¡be set now‰¡case no op½ bstring'†suppliedF  ¤ .„ U = []£  • 	  – 2 = $ áCopt_p ( )J !seê $ %  #  <72@ (acÉ Ó, type, etc.)! e' dictE �  j  ( )Ÿ8Cdà G   §"we32set� re»… lots ofc !# ±!ic±ñinterdependencies, but luckil,ây can be farmeö‹ 0out€ ˆ $s
½‰-- which‘ 0uldc µhandy for s‘!j0one ngj!seBsharË‘ i` at" ‘y raise OH‚Error if `discové† problemS |  erÂ�	À  t + .§F  . J ,×
F0Fils K ÔåÐearly versionÀÊ ×k had exactlyA ‹ a  õ ˆ   þ A, eiÐ/of� „   T1opt•   -0ptsM6optn`if notl s#ˆAType†€("at lea½ ne0  ° x  mô ë"„`return0 sh *¸f Ô» 
Ÿ `if lenñZ) < 2  ãð raise OptionErr_or(
   ÿ"invalid option string %r: "1 ðmust be at least two characters long" %Q y, self)H ùelif len(opt) == 2:   ¤ pif not # 0[0]% a"-" an¦ ¾[1] != "-"):  > qraise OÐ ?Errú  + þ Pshort³ ; ñof the form -x, (x any non-dash)ë  K   ) !._� À_opts.appendV.se	H#:2JK2K@  J ö
start with --, followed bKE* — D�ð def _set_attrs(‹!,  b1for 1 inÖj.ATTRSt%if# ? 
 Ñt d j [ ]Õ 1 1delT s! °     /elõ L  6ž'default'‰  @ .se� ®NO_DEFAULTŒ p J 6oneD sŠ  © ±s = sorted( v.keys();  a ÔÌðkeyword arguments: %s<’", ".joini )),N g  û1)

 ñ# -- Constructor (a&Ÿmethods - J `€check_ac@ ÿ\"ifS { is NonÐ › .! †= "store¢V#  @ª[CTION¬RAf @: %r6V Ð Ö OtypeÔ   Ò ö XßLWAYS_TYPED_A»  ª= pchoicesb  ó 8 -   s# The "0 "UÔibute implies  " ³ .ä  9    % =/ ) 'A# No^ € given? È p"À  Fãmost sensible ¿Œ ·ð se:
           ò # Allow type objects or builtin ÷conversion functions
  ù%# (int, str, etc.) as an alternative to their names.A ðif isinstance(self.’ ,€ )):,  x " 5 =  0.__[ 9__
0 &if# Ÿ == "str"S  # Oing"I bnot inZ ^TYPESR €raise Op0ñError("invalid o Þ r: %r" %J õ  Ò )Ä a} } �D_ACTION… 	Y  M  Q"mustX �supply a� S for u §  ,´ )%ó def _check_choiÆ»‡' Š&  Ÿs is None]Ø Ô „list of _  ß  t" ' $'"Õ   Aelif¤5 °s, (tuple, ` )õ B ® Q  ŽAbe aR  ² ástrings ('%s' Ñ _ied)"H %Š(Ù LW ü)).split("'")[1]ì è  }.1   lƒÑ SU uR ¬ � Ó PAdestÈ YP# No  i^ñ
on given, and we need oneÀCthisÅa.  Thea  ›#Âk ¼ ñ  Ÿ ðcallbacks that takŒVvalue¹  !s_ 1 = ¢ .TSTORE�5 orz  ~  u  � r ñ  "  �ë ƒ :ˆU P# Gle‚	&@from†´ first longŒa,¢ #4 Zshort5  N ßâ _q ^_optsÑð# eg. "--foo-bar" -> "foo_ 	—  ä P \ ö	[0][2:].replace('-', '_'P A ?elsW W ð ´  X "1]gŸ>con ² Ó.UCONST ±u G  Ý ,  á
#q'D '> G %be*
Ž Àn %r" % self«.action,
  aself)
 ñdef _check_nargs( :  6 0if  K 2 in ÖTYPED_ACTIONS. 2 O Š is None#  ' V $ 5= 1p $elr  ois notD  €raise Opâ eError(D  _   !"'D a' mustG òbe supplied for !b %r" %Ù  3�callback6D== "+ "!if™   AableI .  W ),  Ô ÷  ' o 	^ :ê e ,ù )>:if Š _ Í�I and3  v   ›isinstancÌ B �, tuple)Ù 0P  .Ò,èBbe ag :ý =%r"©  ­ ñP  —/kw/D o, dict2Q  h Q 
;elsÍ q 5elfµ&À0°A(%r)µDnon-¶! oâé à ½ Â ;S Ç  wÂ ž ”  <U ¢ 9óCHECK_METHODS = [FA sjNtypec" _choic$ OdestF /on# "F å"]
ú ÿ# -- Miscellaneous methods - J }a_str__oñ return "/".join á._short_opts +·a._long ÑÀ __repr__ = ñ_repr

    def takes_value(self):   preturn  ö.type is not NoneA ìget_opt_stringD "if@ P_long( s` d $ 5[0]† Oelse4 Ashor� s5 — ÿ
# -- Processing methods - J  "Wcheck"q, opt, 3.' Ber =ñ ñTYPE_CHECKER.getG)Û 4if 6 !isWé j 5 K i 	¤ Ë oonvertÍ "ifà ó
œ Ùªnargs == 1  Ýž y @×  0 Û   ‡qtuple([ŽM ¢) for v in¹ &])ö p
Ä²s, parser):4  u ¢# First, c3B theZ a(s) to `right å.  Howl if anyÕ #3 ¥are bogus. Ø0h " 0 P# Andy n¶ð whatever action¬Èexpected of k `# This" £a separate Í ðmake life easierMw  subclasses- sadd newv Ð ©¢ W_˜ (J  Y  ,* deh—– ‹V  I ,… /, E ž ¤1¦== "store" ¤ atattr(¡s]  ½/elI  o_constO  À ./ T ?tru¢ OTrueM OfalsN F* O kappendë $ƒs.ensureÌ›B[]).3 WY J_ YOcoun§s o0) + 1È ‹callback#0û# _ For (O  ‰!kw S.  ^or {}]' ðÀ value, parsð er, *args, **kw
 3)
  õelif action == "help":  & Ðparser.print_  (?   Gexit Y version\ 	# E _ 	*se§ ô
raise ValueError("unknownß ²%r" % self.ñ %)
è ðreturn 1

# class Opô


SUPPRESS_HELP = " 0"+" "" [USAGE#  2"

V Ÿ "s:y Ðdef __init__(˜ ö, defaults=None)á %if   õfor (attr, val) in) w.items(F  1   0set3 t   > — 3str– A '1str< “.__dict__J±__repr__ = 
 P #eqO w, otherV áif isinstance( ,És&  ¹ €  Ä|  ·4 Ž Ö„[  ´ Y P u8çNotImplemented÷ áupdate_careful5+, € 5"""b U0 a the o� Öñues from an arbitraryF õionary, but onlyH suse key8  q ð that already have a corresponding 	UibuteG "in0R  AnyQ  a¿ict withoutE õare silently ignored.c þ  Í … Æid© ®2ttr" *ct #adval =[L ]j      L % pis not jG  ) ' _ î¿á_looseßEÂ !us§"ll‹ + àð regardless of whelA ?theü Z Œ0 or© ! o.(† [, modÖ   Â"# i a Fi  ¢  åG ‰E 	! ¬  ?   -elØM‚invalid Œ Ê ": S } ù  bd_modulrmodname =ë Ûp__impor	- d¢mod = sys.U #s[# Û'ð(vars(mod), mode)ð

    def read_file(self,  ñname, mode="careful"):3  7 •vars = {} ¤exec(open(?  ).Y @(), . )*  e �._update( h )‘ ´ensure_valu” @attrI 7lue‡  if not has  ¿   €) or get 	 vis NoneÊ  Î s) k µ oreturnS ò



class OptionContainer:Ð 1"""E áAbstract base 2 ." C>  ª dibutesœ ¡standard_oY ’_list : [h ]V  ¾  4of 0  0 ðs that will be accepted by all in0 5cesH âof this parser£ Ð (intended toG  overriddenI 1subÊ 3es)Í IW  Ð — Ç Dthe Ë ã £ objects cT½ ¤ ! lÄ `_short0Ó : { string :š ­0dic¬€ary mapp& ; ;: °s, eg. "-f"OS"-X",j   ² ‰ Nuóimplement them.  If anˆ C ßhas multiple € iÁ‘appear in£B È I ”times. [1"__long# : -ç � Ï"--exclude",B ÔAgain, a give/¦ can occur-ä ÿ Šdefaults?any®€ destina. sÚ S ¸ ©©s for each5  ˆ) ”[1] ThesesÀs are commonV Q(shar¡)¢±components ›eG  ò @roll¸�P´p, whereuy] óinitially created¦ •N  ÿ __' #__(ù _Ø,{àflict_handler,Ý 1cri“Š2# Il !iz€ 6Òpand rel� P data`�uctures.‡  Õ 0# T~°method mustpPprovi6by n , S !it' B  É 0ial„ qat leas‚p follow/÷  3  #¶ ¤&, O%, E Q» Òc i1ionC (Ô ß $ \$ =n kÆ ) yset_con{( S 4 4des�( ˆ Ðdef _create_oóption_mappings(self):
  á# For use by O, ÷Parser constructor -- create the mainA o6  b  M dN JthisS wand all< r õGroups that it owns.%  ± ó._short_opt = {}½  ó# single letter ->u › instanceK OlongJ 0 #   Ñ I �defaults’ 0  #sI @dest— 1 � value

—  def _share“ ª1, pŽ²@± ÔY dˆ p  3ž Q fromÔ‰û‰ † Äe —	ª «q Ã \ å # =Õ $._ 
* ( YT  4ñset_conflict_handlerÜ#,  3$if ÷ not in ("error", "resolve"0  %praise V«E+ �("invalidhw : u_Ód %r" %k )Õ ­ $ =) 
Õ adescriSÐ  ¤ T 7 =  T Gget_ T G |return N ž ¾<roy9 c"""seek8.+ U)."""ÿ 2del` Å  7 ý7 #Ž¯ÿ-adding methods - e_checkKæ ,1'¾!opñ![]Œ  )0for0  V9si + $if* p
'  + 	q Ü.append((opt,Lf[opt])n�  \� ' Ž  ; � &if0 <
\ «" =Õ õ  F  Å3== À
O  ' ¸ C!Á	N  +   "t  HÀæ string(s): %sÈ /   % ;Ð.join([co[0] x coS  íOs]),y l · Z +elå b>ve"ç  n cg Gion){ Àt_opts:
      û
if opt.startswith("--"):
(  àc_option._long ßs.remove(opt)8 †del self8 _[opt]0 Oelse‚ _shortƒ !9 „ †if not (ð 5 Vs or  6¢container.GT_listAT !)
pdef addá @ion(>Ð, *args, **kw
 t 7""". O¦	� áopt_str, ..., K A=val 4 1"""‰  ýàif isinstance({ ‡[0], strƒ  ) Ø " =î |_class(¼ ] �elif lenX ¡) == 1 and‚� sV 3 = ˆ I  � º® / #, 
L  3 ðraise TypeError("û#an1  ÷ p: %r" %26ion(°Q pinvalid± suments"å   Úð._check_conflictNe Ü & Ë 6eappend)  J   # .j‹H 0forÂ 0 in ËÛ
s _ .# =7 Q 	P  O P ” ™ qdest isPNone:à # #� p has a % ‘, we need UfaultO  4 S  V šO_DEFAULTª  5 þ !de0 s­ “ ]. 	m Î† � ¿ "in1 Ño  þ  + Tretur¿ 
-s.† /§6ion$ 
 
5’D# -- aquery/Ïal methods - º !geÈç¡µ ô Ù .”1.ge, ÏI) orŠ ,Æ ­	/ ƒ ;:hash�   ;\   . þ} :e€ ÌÎÿ òà is None:
      óoption = self._long_opt.get(opt_str)
, C if 0 …is None:  # ô
raise ValueError("no such6 P%r" % W = 0for 0 in  ion._shortŠ sd 3del« " _[opt]L 	Õ K ! 
J ë ².container. À_list.remove#aion)

€ ÿ# -- Help-formatting methods - J Bdef D  �ion_help(¥, Fter)bif not¨ ! ¡�eturn ""®  �sult = [B /inR w r .¤ ú is SUPPRESS_HELPƒ u ‚.append(ç Bter.
 ñ [~r¾ €.join(re» )0adescri×0M s } >  	_ )r  ÷ k 
 © 
d"ifYZ 
(Þ $ ø3 <)'[ ”®[ 3 Ð [ 5K"\n"„�
class OwrGroup ( C?&):«ƒ__init__6÷ parser, title, â =fç	/ 2 = 	 Íq .f "  ~ C ,; Ó¾  àconflict_handl™ ’ i I .³ " =» á ccreateÌ…ì Ë r S
!] U_sharE �mappingsI .ü �Aset_Ž   Mp ! ¯ qdestroy: 3 c"""seeÖP¥.+ 7)."H{&  Ç 2½÷ 4:BÈ ‚ 3c& =PcqheadingâÄ †.indent( Q #+=2ûX Ä �Z -deZ ¹a )

n˜o¦ð Class attributeAs:
  ñ
standard_option_list : [O ]& !   4of 0  0 ðs that will be accepted by all in0 5cesH ðof this parser class (intended toG  overriddenI 1sub' Qes).
I IW ¥ attributeÐ áusage : string.  è "a   õ for your program.  Before it is displayedA ð to the user, "%8 "÷ Dexpa¿  & uname of= k p (self.A ð or os.path.base7 ó (sys.argv[0])).C . Õ k � tcurrentÕ S (to KeI  q adescriMA¾pagraph Ðñext giving a briefw @view  þ Ñ  @  ry0matK[ ito fitÚ …terminalÎ ðwidth and printsÀAwhen6  ­ò requests help (after,F Pbut b‡ e8 ìã†nepilog3par³ "ofg t"to•  t N   Æ tfgroupsvG {A . iä 0 I( &arò¡irrelevantø v « >àcommand-line, @veryæ&fue .pgenerat9  I)Ã `allow_ÀÀrspersed_argÍ §bool = tru‹ f `, posip�al argume¼0mayþM P with,Fions=PAssumŒ !-aýõ-b each take a singleZ ,Öì úñ  -ablah foo bar -bb
 z# Ü— 0preß <såaÚK C %--T &baN I ð flag were false£ 3at ¤  �e wouldz q k | q à-- ie. we stop0ces!V€ as soon  & eUfirstCnon-b°P.  (TËiºae tradÔ0 foA ñPython's getopt module, Perl's G a::Std,ÒUotherÂ-H ¾’libraries··¥�lly annoy! toÎ5rs.²0proï_default_value±ý 5  5 4areRÀed similarlyÇ1 ¸ 1 HfromŽê:E is1ey V 2ass&th@ type-checkÜ @funcE× “t 0's ( p (as lo•¡Ð
        defaó,ult value is a string).  (This really only matters if you
  ó2have defined custom types; see SF bug #955889.)  Set it to false
H   ó#restore the behaviour of Optik 1.4.1 and earlier.
‡ ’rargs : [Á ]  J ðargument list currently being parsed.  Oå …set whenA  __ !()$active,† qcontinu#õ trimmed down as@ ´we consume ˆ ps.  Maio ‘there for© ¥benefit of? ócallback options. l’ ñ è ¶of leftoverz ‘ that we ¶Æskipped whilˆ ò  r Ð  If allow_in pe2 ÆV, thiö ‚  R´lways empty» o ­Vx4  õ #ofí ™s²•accumulat·   @  ¿Ö£ ·’.  Also m~ xasLpBecauseu ‘ 'ZA', 'r'ù'Ä Ñ' attributes,„  ¨0onPSrðnot thread-safe.L,ð�some pervM hEson,Y@need Œ A—mmand-linFð	 simultaneously in diffeÞ� y 0s, Ð  L¤ tnstanceÿ 2"""T  Rdard__ÒB= [] òdef __init__(self Ì ¯usage=None  W # bclass=ZI   A?ionE ÿ	conflict_handler="error"J  adescrihN 2for! ƒadd_help7O=Truþ OprogC Cepil !):É N ¥Container.}"  & Š?_9,	', é )?  ; Q.set_·(   ¶ 0 =  
7 „3 = 
 
 = = 
, òprocess_default_j +  ifE‹ h e, 
ªô = IndentedHelpFÂ(Ý 1  
œ  (œrýK Â2 = 	 2 • Q# Popºð— ; LÒial sources a‚ /# “åˆ ˆ2e 'Z µ'B ‚Ànt, and (if óapplicable) the _add_version_option() and
  #$ Fhelp! …methods.& ãself._populate) b_list(V  ,0 ]   ’  n =	 N %)
> n òinit_parsing_state()
% Àdef destroy(- %):< 5""" ðDeclare that you  ñdone with this O Parser.  T •cleans upJ ñreference cycles so`> õ (and all objects 6 Ed byL õ&it) can be garbage-collected promptly.  After callingï  ),y M 	� pis unusÿ». ©Container.DT Ðfor group in _.ä sl ß I )E 9del<  , E s “formatterøÓ# -- Private ¥/ - f `# (use—s our orã's constructorœ wL_cre $ƒ  3 ÷ Q = []w  1 ø    f €mappings D ‰ @	h  $ ½ ("-h", "--}"« ac&/="'   ‚=_("showJ  € messagecx exit")< � Ž § < ' ¶ -1 ³ *  ¤ ¶ £program's 9  number½ þ ¿ ", ­  ¾ h GTrueÛ "ifƒstandardø6 
T U .G X sÛ.8 p(if† P X z 	B y C  NÙ%ifû <  ÷ 	Ëë  ‹ =q# TheseÂ0setš @e_ar ´ ñqconveni«!of>LbackËr7 u = NoneÁ  s /.l dvalues5 ‰‘ÿ Simple modifier™J  de0t_u?ñ!,  "if 1 isº gÀ        selfó.usage = _("%prog [options]")
  Relif * õis SUPPRESS_USAGE:&  - EselfT ENone õ*# For backwards compatibility with Optik 1.3 and earlier.B † ð .lower().starts= !("  O: ")’ $ G[7:]U /se1 
. ðdef enable_interspersed_args(ø y ò"""Set parsing to not stop on the first non-p¡, allowingm  Lf  D  æ Bches+@comm%ðarguments. This is^ C ÿdefault behavior. See also disÌ )&th¼‘class docl a q descri,0 ofv – attribut9 Ô /E."""¤  ;.) v = True�¶  G ‚
~	q. Use tBfš  you have a®põprocessor which runs another% EthatE Bhas ãs(qits ownc ` @want €make sur† 4ese3 G ödon't get confusedNGFalsOCset_Ó _,b_valueÒ#,  Y h. 4 $ =0 ± b Z %,91t, f W ) ’s[dest] =& M ¡  **P/gsK ƒ.update(& L “_get_all_�ž F  1 = ò  g_list[?Éfor group in)  sZD ‘s.extend(# . Y qereturn € ´ %¨· "ifk ˆ¦
” P# Oldè$e-5/u} ‘– V!.� "s)Y &  : f.copy(ä  ;ý <”Ù [ 5 = U Bget(F .5_  0 ãif isinstance(4 [, strY  - “opt_str =w.m 7ingº  .   Q s3�  ¶� Rcheck§ £  ]  þ’0
VT ")
RA# --1onGhŸmethods - J  @ðadd_option_group(ðself, *args, **kw
 C):
  ñ!# XXX lots of overlap with OptionContainer.add_o %()@ àif isinstance(] ‡[0], stre  l sgroup =V G (� \ �elif lenW ò ) == 1 and not É È c † H   !if7 ¬ ‘ ,� ²  7 ðraise TypeError("| (an6  þ �: %r" % Y " G "if ¡.parser isŽ   
Ã  - t DValuu yinvalidv r(wrong Q &)"p JelseU Q Å P Åarguments")
. • .è_Ë ‘s.append( i breturnÙ ? sdef get&> åJopt_c 1 = " a._shor; T.get(0 5 orš   ¤ P_longl 	1   3if d  5 $.cÏ„Ø 1 ‡   RNone
ø C# --�-‘ßing methods - J  B_C Ä ,  ›!if  À  ƒ ë”Åsys.argv[1:]¸  .  a 2[:][ ö# don't modify caller's list¬  î  e_A ­ =˜ 0, vÂs ¿ 5"""’ >  C è : [string] = Ä ,3 Ÿ #  ` 1 : +@s = x  B-> („ $ Mh øP›ó the command-lineCÀs found in '« ¦' (default€± �).  Any e6€s result> aJQ to ' ¥()', whichã 3by \ q prints• ‘usage mes ‘to stderr �s@  ˆ bexit()È"an‡ = À.  On succes›  Ævs a pail:1’) where 'O'|awÿ! (65allŠ CyourA®)° CiÚ  R }ŽU leftE  ”a afterí \›%s.$ Ur  @Felf.L  #if‘  Ë  7Ç bè E  �’_ (8q# Store¥QhalveJ HÑ 4Ð as attributeOr2 Â Ð# convenience ÔVbacksš A#   Þ 6  ®  l @rest7 ðthe command-lineó (the "r" stands for
  # ù"remaining" or "right-hand")+ Ylargs    ^ ðleftover arguments -- ie. what's ! û  after removingG °options andS iL Â lÂ   "S  t "I r À `self.rÁ 1 =  9  Ü 4 =  *[]  ’values = 	 
 Etry:  Pqstop = V �_process_y (\ ,~ ,I bÁexcept (BadOrError,  V€  ‹) as errv  à e2 ¦(str(err))¥   Ý +‚ µ breturn± bcheck_ä ( ,×sM Idef $  ç Ì * ™ &""Ÿ	6 Z 1 : × s9 ¶ : [string]3-> ˆ . 	Ì CÀ P thatG¢ supplied `tfA Þ µ5areI ‘valid.  RsN E A õ(possibly adjusted,  àcompletely new. *eD5youD ðlike).  Default i6  aa. W  ¾¡ •passed-inB ip; subcl `s may :@rideK…desired.4 ¶^ ƒ¨
àæ	
6 0 ü,‰  N	 ¸+ ù 4´  N P“Ø command-lineÒnd populate 'G ˜', consum¹³ùafrom '© ñ'.  If 'allow_interspersed6' iMqfalse, <¼¢first non-j ¤ W ²true, accum¬ 5any:m C as in 'z'ùRwhile)¼ ?4argB&[0%  P# We 8ñ	le bare "--" explicitly,y C" is- @d bya¿ M ±0ardù * pr since- a short °case ensure@M alen of9 Bopt h ƒ @grea™fthan 1 „ !if` !==Ê 
   2del#
  ;	‡ "elR o[0:2] W ## 7  að „gle longÅZBwithÔ6(s)4À        self÷._process_long_opt(rargs, values)
  ùelif arg[:1] == "-" and len(arg) > 1:2  = ## d ÿ a cluster of short options (possibly withD  � ú
(s) for the last one only¨  v FselfÞ m  ß sà 9 ðallow_interspersed_Ý l q.append» Adel T9[0] NelseQ `returnÂ 
 ð# stop now, leave thisŽ2 ina 
_ R# Say! !is.€original1 ¦ument list €# [arg0,  a1, ... S(i-1)
  + ! FN-1)Ø #µ 
 ^  ö(we are about to$vrg(i))., 
 C Theì 1 is² 7(i)® � “ ˜ % ×a *subset* ofK ï È  é e] (any” ÛPtheir5·s will haveK  be– Áemoved from Ä ² while loopQ ðusually consume 1 or mo #rgz ‡per passd If it6 €s 1 (eg.® ú nÊ à that takes no S '),Å t[ af�Parg()K dh uPsitua²7 is=H  ý 2 = w ël2# =Ñ`
j ?If § ³ cfalse,� ¶ˆalways b»Ð*empty* -- stÛa· 	 ëW, but† ±not a very /cestingF !“¦def _matchg g,¡)H<"""' óopt : string) -> X  _�DetermineU0ch È W 3ion, q 'opt' € ses, ie., &on it6òan unambiguous abbreviòñfor.  Raises BadO»vError i[n xdoesn'tN "ly„  d§ Ø5"""a� `(opt, A.P)jo (+ ,$ÙvRarg = c.pop(0L  ^0# Vð explicitly attachedµòarg?  Pretend it'm8nex#aÄâ `if "="¹6argŠ  r Ý  B  r0) =°Ú.split("=", 1ì<µ.insert(0, : C V Dhad_Ä À_value = Tru3e
  Uelse:   ™opt = arg õhad_explicit_value = False
( : ø
self._match_long_opt(opt)( bion = + % U[opt]% ò if option.takest *()¬ tnargs =*  B  Í €if len(r( A) < " 
D  ' ‰ ù error(ngettext(H  %    "%Ë Sion)su ð requires %(number)d>ument",F 1sG Í b) % {"+ ":• 2, "‰ "":ð }{ Ä Belif ^ == 1ß6l.pop(0B 5 X 7 Rtuples1[0:¥ ]@  . Adel a $ I¢ r
ª ´E_("%��does not 81 a — "'…‘ú* j = NonÖ †pprocessÿ,T  !s,È)¿ Sdef _, `_short  s(® ,ñ 8 ÌRarg = pEstopk 9  Ui = 1Ê �for ch inxJ[1:])—…"-" + ch6  H 7Š° ;.ge´ . `i += 1
  ò# we have consumed a character6   ot«:ion¬  # ¡raise BadO E—¼     - V# Any‹ cs left-ð?  Pretend they're 	#C @next^a, and ”è 8ing\  of& .B aif i <Œ7argú _   .insert(0,J ?[i:<  1 „ W= Tru¬    u	 %  +  ¾.  - $3J  ( K  , ; Ž@ 0 % <Ä4  % s    ? < 2 @	   l  	  À           #û option doesn't take a value
   ‰ = None
 F Ò.process(opt,D  Šs, self)6 ‰if stop:K  t bbreak
- ÿ# -- Feedback methods - J ñdef get_prog_name(”   � 0elfÇ Ag isè   ™ òreturn os.path.baseI µys.argv[0])Î Oelse?  w e ˜ kexpand› F, s)A | Às.replace("%Ê "[.Ú )kô adescriìö X  ú ‡ .= W AexitL ð, status=0, msg=¸  if È  Hösys.stderr.write(msg9  ^ X t Crroru  3 V A"""e Ãmsg : string:  r ñPrint a usage mes òincorporating 'msg' to › P and ˆ .Óó#If you override this in a subclass, it should not ^U-- itG   aeitherc ñ or raise an exce«y 6""">  ªpÐ _Î (0³ D %  ½ ‘(2, "%s: ¡: %s\n" % F6Á<e  Àp,   kó æ¢formatter.
 ² Ì  0   - ~b )Ú W&""P	œelf, file›8""")  # ! :*   ==outC;theE@for  €current –3ramb¿ 5 toô 'h ¤' (defaulti ’.  Any ocH Qce ofX Ì ï5 inJ 6a  ¯ad with:  œF V ž D (Å )  JÈp.  DoesÆh	ò p UemptyH  or* � definedº	C 
5ˆ”Õ #()· 1‰Ñqversion2 
m 
d ™l7 m"< ’ ¸ 
o+  Ø q1 ¸s+isl' )nÀdout).  As wóith print_usage(), any occurrence
  òof "%prog" in self.version is replaced by the ?  t 1 Uram'sH ýname.  Does nothing ifQ õempty or undefined.C 5""" ; :  · Ú (¬ Cget_° �(), file= !)
2 ñdef format_option_help; , –ter=None)d i5 0ter    ‚ T   =ã  w 	# d.store€ qstringsƒ )- »result = [] ….append(a .
 Ñ_heading(_("OÛ Fs"))R & ¶ter.indent( \JlistÞ Ž z ^ ”Container€ > P‡  

O F"\n"Œ •for group~X  s˜ 	" Ž ‡ ô � 0mat(+de(a# DropøPlast º ,¼ 
  Rf no ´ s  Ô ¿ ò return "".join(^[:-1]ªaepilog"¥ M ï 9 . ] ) ;[  Bã 
Óz•Ü	 ¡ .Ü* A() +~8J adescri P 0_3 Vb À ‘ A ãJ 7ters: •v Ñ Ô
!¿ôt  Œ ë š7"""(  ! :“ = stdoutR  —P Ð an extended @ mes3 ,  Æ5allá0andI¤2 1tex viE w| them, to '… p' (defaâ† õ / s0ileÇ 2ys.E …  4 a.write4 œ Ò())

# class É�Parser


ó	_match_abbrev(s, wordmapT;"""" 2 : Â+ B : { # :c S}) ->( ˆRÿ 9, 0keyó'q 'Ž  which 's'Òan unambiguoui¨  iaÊT.  If, ðfound to be ambið2guous or doesn't match any of
    'words', raise BadOptionError.
# 1"""+ ó# Is there an exacP ? €if s in Q Amap:  @ �return s Felse  S ‘olate all: òs with s as a prefix‡  K ðpossibilities = [m A for< ~ q.keys()s  9  !if3 p.startst E(s)]0 H# Noã C, soü öhad better be just one › y° vif len( –ies) == 1 › #	( &[0� ‡elif notf ;iesD Á &(s
z v ·# More thanÃ �le compleb: ambiG� C 	² [.sortuWAE ]:(s,Ï ó )


# Some day,oPmightjm¶@ ð classes.  As of  Qk 1.36 !
#9ðerred way to instantil . Pons i°ñdirectly, via make_oð(),
# which will becœ àa factory func%S when¯ Gare ª %
#¬ 
\ ! =³ ñon
r"""OS routinesÌ NT³ñ&Posix depending on what system we're on.

This export-Nž `s fromk ixX ðnt, e.g. unlink, sta  tc¸�- os.path eiï;  Por nt
 1
  * Gname*  'pµ 'g D'nt'& `curdir( Pa strÎ �represent Âthe current � _°(always '.'Æp /paJ /paI J 0sep‘  {  (or a mostúPmon) ä Ü Òseparator ('/Ù &\\� 7extI §extension 7 Æ  (al6 `altern™v N]Vor '/v  ( w  ¯ on=w @used”$PATH etcŒlgü   ® óin text files ('\rô n 6r\nˆ 0def‹ Hádefault searchDÐ executableÈtdevnull:  o 0  ofI  `devicey@dev/  ',Ë °.)

Program‘Pat imýÐ and use 'os'×Dnd a¬`chance-`being
1  “    ¡ween diffe:€platform`‘Of courseZ0y mð‘then
onlyn it  ¡defined by‹Q   (z,{
° oà1r),¾ Bleav Y‚�manipulaj$to 
K Qsplit< ðjoin).
"""

#'
impoõrt abc
import sys ótat as st

from _collections_abc 4 ð&_check_methods

GenericAlias = type(list[int])

_name òsys.builtin_module ò

# Note:  more 0 ôare added to __all__ later.
 ð= ["altsep", "curdir
 $pa
  Cpath Aline &
  @"def$  =      pdevnull …SEEK_SET YCUR",I # 0END# ‚fsencode $de ”get_exec_c kfdopenJ !exÙ ð ]

def _exists(ž !):s areturn/Ó in globals()1 f  ç s_�!(mt= 2tryF  J & .c)j ýexcept AttributeError? €[n for n� 4dirp ð if n[0] != '_']ïòAny new dependencies of the os ª ð  and/or changesW  1ó separator
# requires updating¦0libÍðwell.
if 'posix'D u¾  N$ = ì    1\n' A ^ ! * 	D%  ³t)  dQ0.apó !(' '`I•]ApassE ˆ 0as  
 Œ ‚have_funÐ3 Öv & w  É �extend(_h¢ )Ú Adel  @

elˆ/nt…"nto‚r„/nt�" `± ~9 nts [  {"nì'nt"ntD ¿Ê ¼"Belseågraise ç@('nog„specificp�found')

ª„`s['os.ì B'] =pê �(}", {,¥  w#, _", Õ", ¶;a¸"l Ÿ 

¶ Ä õ*"_"Å_ô' =þ ï2³add(str, fn0   Qif (f¤> )i + 
k :  > P_set.Y = 0[fnå r = set(ý_) à"HAVE_FACCESSA;ž "access"& RCHMOD%  "chmod% 6OWN% ?own%  CSTAT$ Ð "stat")
    ÷_add("HAVE_FUTIMESAT",  "utime")
    % BLINK" Ž   "link$ TMKDIR% o"mkdir% CFIFO& "mkfifo& 3NOD% ~ "mknod% DOPEN$ n "open$ EREAD¼ _"read¼ cRENAMEN _"rena5SYMM _ "symM &UN& O "un& /rm/œN�òsupports_dir_fd = _set
¹­set = set(ÊdFACCESR caccess8S ßeffective_idsZ PCHDIRF $/chÑ fFCHMOD% mÚfFCHOWN% /owÛ  FDr _"listq 	' Oscan' bEXECVEt e"execv@set.0�stat) # f	 Ò always worksv $ TqTRUNCATP …"truncatP ( àw |¡$ ¡�FPATHCONF' “"pathconfÙÀif _exists("¼ –vfs") and Ô  ñ: # mac os x10.3Ü ¶FSTATVFS", Q ) D“3ó# Some platforms don't f ò lchmod().  Often the function ó — ô	# anyway, as a stub thatÆóreturns ENOSUP or perhaps EOPNOTSUPP.J c(No, IŠ �know whyN '\ ðgood design.)  ./‰óigure will detectL Athis‰áreject it--so ™L+0 st6 wø óbe defined on suchH !@.  TT ó is Very Helpful¼ . ÐHowever, someñsb‘without aÛ5ingf£ *do* haveH f!at�ð(Examples: Linux kernel 3.2 T Ã glibc 2.15,@ ð OpenIndiana 3.x/FAnd W ! h¯Aflaga àò oretically make|p# it beœ U like´ q.  So i0ory' €would beduitablÐ ø replacement forE …But when P doesŒ ,´ '’ ¶ & � *either*• IadlyiN `sophisá 3ted'“enough to<  tâPcondiè‘--it only `rmines¬  k  Ê"nonÀ# fchmodat()ò minimally works.
    # ð	 Therefore we simply ign ð	fchmodat() when deciding ³ther or notI 1os.0 ð supports follow_symlinks.  Just checkG l0 S() isD ñsufficient.  After all--if you have aÆ  @   , rE W @almop dertainÿ J tooñ
_add("HAVE_FCHMODAT",   "  !")X 
% 6OWN% ?own%  CSTAT$ n "stat$ „LCHFLAGSn _flags' 1MOD% • ñ if _exists("lch‰ ñ: # mac os x10.3¾  òÂ €LCHOWN",ã 5 % ! 4INK½   "¿—  RUTIME½  "utime%   » F$ n +l "NS& m  “MS_WINDOW�  m “_“� = _set
ÿ 2del  -  p’_function¤ gglobal ðadd


# Python uses fixed valu ðor the SEEK_ constants; ö	y are mapped
# to native' ñ if necessary in posixmodule.c
# O�rpossiblf z  \ `directÙmš{ed fromF › �SET = 0
 rCUR = 1 pEND = 2æ bSuper U ñory utilities.
# (Inspired by Eric Raymondì Â doc strings÷  os™ ðhis)

def makedirs(name, mode=0o777, eê±_ok=False):¶9"""3 ( [5 ,][7 "])îÅ Ð-mkdir; creat[GleafÚ 0and�  intermedi& 0oneÌWLQ likeˆ J  m Àcept that an­: ðpath segment (not j Pright¯nswill be™ dpit doesr
@. If@x target· already˜ 5ðs, raise an OSErrorS  q_ok is T.Jw+ Pno exÍ 4ion¢E €d.  This6 ¢recursive.V1"""v Ðhead, tail = ÷ a.splitÕâ  Ó!ot# É v7   7    š_  	  Je Ñ  s("  V 6tryc   1 )  ´0istX? 2_okk  * ` FileE~s<
N Ñ# Defeats rac¶ di1 'Qn ano� th”Ñ ô ³ . j   2pasU  Âcdir = curdiÛ  aif isi?0ce(w, bytesð ð     cdir = byteós(curdir, 'ASCII')
  óif tail == cdir:   ÷	# xxx/newdir/. exists if  N  7 areturn Atry:	   òmkdir(name, mode„ æexcept OSError. ð'# Cannot rely on checking for EEXIST, since the operat  esystemw ð# could give priority to other ew às like EACCES ` EROFSC 0if Š 0_ok!   tpath.isÖ )½  ï ñraise

def removedirsÿ ) <""" 
s ÃSuper-rmdir;< ñ a leaf directory and all empty intermediateD ³ones.  WorkÝ P  oPthat,Ë ;Z !isB Ãsuccessfully† %d,� àies correspondwÐto rightmost F àegments will b‚ñuned away until ei‰ Š Qwhole=  † €consumedt"an®` occurß 4Qs dur‚ òhis latter phase ar ignored --,€y generaÙ Pmean % aÜ Ry wasò ].–1"""Ò HÈ Shead,D» g.split" ? g#7   `while  í
? 	Zo /(. >   í\  QbreakÁ    8 Å   )Å »¨s(old, newÆ 1Çe …; created @ eedaÐñ delete any leftž àÊS ,ÌZ aion of; 5 t `neededÿ2mak:1new¸ ¨ � good is FQmpted…  first.  Af\ ªr„ \ E  $ s of‹Q old y  B 	 A non+byÇ SfoundÁpNote: t%Pfunct3Pcan fÿAwith‘  Õ ó y structure madLöf you lack permissions ZaunlinkN [!orÈ Cfile• V i� i4 *if†›sÿd ãv ^ ¸Å\   } 2old6 } c ˆì W @  c�	ôpass

__all__.extend(["À 7", +  53s"]�ðwalk(top, topdown=True, onerrorñ-=None, followlinks=False):
    """Directory tree generator.
" ¥For each d( gin the 9 ð	rooted at top (including J äitself, but ex ò'.' and '..'), yields a 3-tuple…  « €dirpath,x ±names, file & "   i@ qstring,ª  8 1 to Ç %. J 2 qlist of¬  à Z 1 of7 4sub: `ies in= X (Ì .I £ 	d S 	` Dnon-a yÙ e L pNote thb2he ? Œ ¼ ¢s are just ¡, with no ¨ ¢componentsN ÒTo get a full# Ò(which begins> @top);a” 0 orø 0!inã w€, do os.m e.join(  « )Pð
If optional arg 'topdown'!@trued Ònot specifiedÄÄtriple for aw ˆ s¶€ed befor'"e 3 s4  nyËJits ËL  « M  Ü F ed¾   `).  If    ­ fH� K ¡ %� Qafterý	œ #llœ B 
   œ ”bottom up]HWhen£  P¢ ñcaller can modify† 0dirœ s @‘ in-place† à(e.g., via del•ñslice assignment),¹pwalk wiÄ ânly recurse inqM Ó DwhosÁcremainQ� a; this« Qbe us…Q prun×Q `earch,— `to impQ a4pc orderUÁvisiting.  Mø  ’÷ 2wheÄ…×@ has:‚effect oòqbehavioY 0os.ú †(), sinc› Æ K'Ö ø have already beenµ�1timW1 è 4 — ’„. No matJ0val5›ðÑÍ~«is retriev/ p. ÿÈ yæ1its‘ L 	,âñBy default errors frompÐos.scandir() “³qignoredae 
!!onG !€it shoulóÆ ncWA; itE “!beg "edÎ0oneuu¿ ¾@ OSE£ � instance„ t{C areportº ƒ  	‚continueQ  ) ŠArais ßeåG Tto abI  . :.  Ì& é€availablk { C ! �attributeÝ ~ 2exck ð object.

    By defauñvlt, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, s eL "op ² argument 'Ž „ '… atrue.
. 0Cau/ ð:  if you pass a relative pathname foƒ òp, don't change thv @currl „working å ñ y between resumœ Ps of 0!.  a never� V sW  S K À, and assume# a$@ cliz  |1n'tG ceitherã ‚Example:ñ 0imp]!os) @from¾ æ   Pjoin,k2sizÝ  û Proot,× °s, files in:  È ñ('python/Lib/email'):` ¢    print(@ A"con¿ «", end="")( psum(get| (Š 9  ƒ!))…   } † )H A"byt¥ t", len(. U"non-SË … €if 'CVS'a FdirsÇ  Ë   �.remove(' C)  #�visit CVS%át1"""æ ³sys.audit("2a", top ãdown, onerror,B´#�return _q fs²_(top)= C
def7 l ñ  é Q = []¸ :non  „ _ % �# We may ñhave read permission½‚ ôin which case we caº#yp a list'2the¤¸¤contains. …… palways Earessed9 Aexce|  Pn, ra! p0n bª!upŸ aF PminorÁ  so¬ ðen (say) a thousˆ Þ Hableï£ are stillH @leftr@.  Táñlogic is copied here.1 2try€ mP# Notb`at scaƒ 5 `global t
@modu… u«9 £to earlierÕ"-*a   L T_it =Y Jƒ *@ OSEˆA as ‘— $if¥ Ž  íFNone   c Æ(; ¿  rÃDwith~ 6_it@ ›while TruT 	 N      Öentry = next(ò Œ  %   ð ‘StopItera
   Ybreak < ,? 4, < D  is¢1 = . (
Á „Y T# If : ð raises an OSError, conûsider that the entry is not
  ñ# a directory, same behaviouD ýn os.path.isdir().D ù is_dir = False
  2if  :  † Ádirs.append(¤ i.name)( Nelse: ?non= 	>  ifô Ï topdown and� ÷# Bottom-up: recurse into sub-"ùbut exclude symlinks tox  Þ #WÒies if follow0 #is, *  
( ú  , Qwalk_› m= True{ 5 ; ?tryT   3is_Ñ " =5. (˜ 0   ïexcept OSError\ 1# I	a Ä() raises an= Z, con»Ú  s   #  Õ  aŠ`bolic `ÇL á > â t   î   ¢0notuù 
 8 5if / @ ð ”)P ã# Yield before¿0ionwPgoing  if   q yA @top,¸3s, da  © ?# R1iesY  '  isE�, join = ¦ .    . 0forp  ù0 in s”  O @new_7 ! =R (¢  2 
“÷ # Issue #23605:· ‘  ()-õused instead of caching�  r \	ü± result durN‘he loop o0sca�š() becaus’#…ñcaller can replace YÑa "“"œ Zaboveƒ
41 orõt(@)W é ` p from _d, ,P, oneÙ,¾w
e ï’  ð w _Û
ž š + Ü _afterbî5 up`u `t__all__¬"¶ ñ")

if {open, stat} <= support1_fds{ ' 2fd:bPdef fY  âE="."…=äŠ„=None, *’³Às=False, dirÃ_fd=None):
  õ"""Directory tree generator.
& ö2This behaves exactly like walk(), except that it yields a 4-tupleK  x ódirpath, dirnames, file Vdirfd1 `. 0`,  % u` and `5 ó` are identical to™ … output,Ê 8 b 0` i¡  D ð descriptor referringE 0the¤    ¸ `òe advantage of fT over… $isõ's safe against symlinkŸ óraces (when follow_# s¯ gFalse)  If  0_fd @not ß,‚±should be a]ä @openß a= Ý " \Ftop C  relative;  `will t£ 4be   P þdO.Ö c  (dir¦ òalways supported for6&.)övCaution©RSince( $()`½�s, thoseñ only valid unti² ’ 0nex¨ éôion step, so you÷ Pdup()ç Am if @wantç Akeep O  Ã ÷ a longer period¥†Example:Þ  imü 9 osB Aroot0s,   ÝRn os.[÷'python/Lib/email'Ï ^`print(: õ, "consumes", end="")s , Àsum(os.stat(`…  - E ±fd).st_size« ! 1 inU(s)8 Q   i ð"bytes in", len(À•s), "non-9[ ª €if 'CVS'{ Fdirs s     �.remove(+ õ)  # don't visit CVSò&ie}5"""´sys.audit("s ",÷ ìdown, onerror,£8d0if – isîñance(top, int) or rhasattr ¬'__index__Ö y@= fs� , d ü# Note: To guard] U€, we use¹• standardö 1# lþ )/B()/f f trickÊÐ ›
Œ�orig_st =g t¬ )=É/=Ò �topfd = Œ 1�O_RDONLY3 *ry† Kif (§  rÃ(st.S_ISDIR(©  ÞPmode)ù R  „ .s¹ 2G ,ï [fd)))• K r from _Ìé Y,, $+` L  ?top˜Àinks)
      Ç  finally:
  Ñclose(topfd)
 ¢def _fwalk ñ, toppath, isbytes ödown, onerror, follow_symlinks)f ñ6# Note: This uses O(depth of the directory tree) file descriptors: ifš  · ð4# necessary, it can be adapted to only require O(1) FDs, see issue
G   ’# #13734.ø   Óscandir_it =  )‚ •dirs = []  no5  `entrie pNone ifG 5< or.X elseR @for A Dy inˆ 6_itU ­ bname =( . ‘   $if¯
6    - À = fsencode( á  " +tr(  #ifm wis_dir(å    !.appendZ  & M  #pis not (¬ 0  4iesY   y´  *  ID ¥@ ó  except OSEÒE  t ô # Add dangling p, ignoràsAaredÜs¨ B   Dy.isFa / Ï  % Ó  $ Fpass§
@yiel^	 ã#, „ &fdE  ¾ ` ½ *  ý °ì èò@zip(! ,X(ie7 œ s!if.q
¯  =   Ï    aorig_sñ1tat²,”A_fd=Ýn=False} R �  dassertî  ù 3  I @y =  + Ê  n0y.sÐ (¼ Ãdirfd = openŠO_RDONLY
÷ 
b~ as errŒ$if*ô (  ñ SJ(errl   vcontinuÅ  'û  y ÈQ.same1!,  )Õ < 0 =  P.join  ,–¬  › 8DfromTf S< TÖ G  0topEzI À  finally:
   äclose(dirfd)

 õ if not topdown:    Pyield ò path, dirs, non	 RtopfdI ò __all__.append("fwalk")

def execl(file, *args)f >""" P ±Execute the? putable D ð with argument list Às, replacing7 È @curr% Áprocess. """  x v“ ’ ª e « 	 S, envJ±  B and� anvironÏ ;envÉ  Å Anv =ü B[-1]K Dxecv¥  Ù T[:-1]© �pã 
 �ñ(which is searched for along $PATH)› ·î  Û �  Û ^pô µ
  à¶	Ø , Þ  Ú£ÞÎ  ßv&	l
 Ýnú  È ’ may be aÐ÷or tuple of string¼_½	v í, y ! 	Nì  ¨ !,ç ¨0ext¨[�"", e	 p	  v Svpe"]pŠ i S=Noneå if  f  Ž  Éq_func =æ!veð   °argrest = (ÿ W HOelseC B >  \ eZevû0if ãr.dirnam!Á 2 1xec© 8 Ÿ T areturn} €saved_exÖ  ð   ^ _¬Q= get:_ (D e  ‰¶ame != 'nt'ä ö“= fsencod� V  7  E Z ð map(fsencode, pôath_list)
    for dir in p :  ‘ullname = ò .join(dir, fileB  ( 6try5   ³exec_func(fC „, *argrey & ñcept (FileNotFoundError, NotADirectory j) as eg Ålast_exc = eµ !exV !OS7 6  � �if savedS kis Nonq  & # v 8 ;not< Vraise] ¬  Ã �


def geÑ 0ec_ŽP(env=… )÷ ð"""Returns the sequence ofÄ, ie �at will b% aarchedê"th' Ô d ¥ñ'utable (similar to a shell) when launching a process.
À  *env* musth ñan environment variZ qdict orb.  If 8 _,K 3os.= ¸ Qused. 1""" ð# Use a local import insteadfa glob �to limit,“number ofK ñmodules loaded at startup:/ 2os " Ÿ is alway+  3 byN òPython. It may also avoid a bootstrap issueÔ ¾ ‚warningsQ ifC r  ôó q0envá^+ ò# {b'PATH': ...}.get( r) and {  0 0) eaº bBytesW‡ ñ usípÒ 0 -b¼ ‘b: ignore%¾ J Swith  „s.catch_ (¿ Ì  ò .simplefilter("V 8", � )ì  7 a Ç �  5 	ATypeR  B  pm  Ï up_0s_b _�
A ” 	V b™ [w]–  & š 2(KeÜ%, ¥ , *   Jpass? /ls˜ !if¥>is † M  ~BValu(b &   "€0canP ‚contain ^já f keys" :   g bm $ º `  isäUance(@ !, ˜,ß§ = fsdecod8 Rp  ÿÜf ` = def r{da.split• ð sep)


# ChangeÇ 
NÐutomatically  ‚ putenv(©Bunse ô
from _collections_abcéMª“Mapping, 	 ¢

class _E(( "Àdef __init__õ(self, data, encodekey, de  Tvalue  C):
   E .( Vkey =J 
# V & =b 
# F a H  
' J  L  
' _Ù  ! Aata
 ó def __getitem__ 7keyÏ 6tryÜ  ã Z 1 = è T [ ­ @key(A ]a  0 ú except KeyErrorM u# raise ð with the original Et R  V 
7 s ¥ from None* breturn« &(P )s", ' ²  ‹ ù 
î q 2 $  r  »   `putenv· f C MXbkey] =‡ ­ ?del²w d­ Aunse‡ 2 )‡ ø2delIœ 4 ëk± ÉCiterÆÁ‚# list()ñdict object is an atomic operationQ  ¤bkeys => •"1for� in s' = Ryield0yÈ>len° ´1len�.o	¬?repè  8 õ'environ({{{}}})'.format(', '.join(â  © €('{!r}:  , ï 
¸ ,Í Ô O Ö# i}Å .µWs()))Ï Acopyé ³Ë  ¬ 5¡setdefault ,{m A  if D not‚ 
ž à [^ ¼   { ! z D__ioww, otherr  1 ‚.update( fS N M "if» ƒsinstancS —, Mappingx ´ åNotImplemented 0newõ"ic2¯?new² 8new± r² `K³  qÌ d² dcreate1 Xðame == 'nt':
        # Wheróe Env Var Names Must Be UPPERCASE
  õdef check_str(value):  % òif not isinstance& [, str+  / ñraise TypeError("str expected,K “%s" % typK ¹).__name__)z qreturn •  †encode =¶  #de 7str "f 4 {key(key´ e #   v.upper(Œ •data = {}U ‚for key,œ û in environ.items(d  A [b … 2] == T Felsevl# WherÄ0CanÃ¡Mixed Case:  sZ ôing = sys.getfilesystem Ï eÊ­ ðs.¹ !e( ÷ing, 'surrogateescape'¡2ef ýÒ ãH.( X % cekey =Dt Ó ÷ g "_E(# , ¥ L ,«   �)

# uniÌW
 p = _cree [)
del 0


×`getenvÓ [ ”fault=Nonà…"""Get a¼ó ment variable, Ï  2 ñ if it doesn't exist.Ú ñ	The optional second arguL °can specifyg Áalternate deŽ C H ð and the result aregA."""o r ê	ß ó)

supports_bytes_* @ = (bò != 'nt')
__all__.extend((".O", "C �"))

if  ½Rdef _N Ž\/ ‰J% L 6 
H## L F +bdÃ *._Ìä ,K Î  ª©l~ ‹  4|bÌ« @¯2 I ³0 G ·ã ¹ 2 ‡Tb¾ ' š1  œ*"�dn fs(ðc():
    encodinÿg = sys.getfilesystemencoding()
    errors) e  1()
. adef fsC  e(T aname):  N @"""E` $e  ò (an os.PathLike, bytes, or str) to th0 ¡ M g òing with 'surrogateescape'» ò handler, return_ µ unchanged.O ûOn Windows, use 'strictH 5 if�  =Etem ‰ %isN ñ'mbcs' (which is5 udefault1 )~ 5"""< †= fspathKð  # Does type-checkDof `6 `U Æif isinstanc�,Y• ™D .Ó !e( Bing,Ms 1 OelseC 
Vdecod� 
D AfromN ­ 27str5 OnŠÕt— âÅ.X 'B, fs[ $

; ` = _fs>uc()
del ö8

# Supply spawn*() (probably only for Unix)
if _exists("fork") and not F v . ‚execv"):Ï¡P_WAIT = 0#CP_NO  RO = 1- ò__all__.extend(["> D", ".  3O"]Fò# XXX Should we support P_DETACH?  I qse it c)  Ø Q()**2› #á Qclose-pstd I/Oûôeams.  Also, P_OVERLAY¤DsameB !s ÿ B*()?Ó  à_)�ef(mode,¹÷, args, env, funcLñ# Internal helper;" p  b  ¼ 6 @tionñ"usƒ  ‡!if§Èk ×(tuple, list)o  4 °raise TypeE¿ñ('argv must be a ;  ba? '×n  c    1notÚ ;[0]íb IValuc €first elGPt canA ‡be emptyg Ppid = kg ¶ | :pidl q# Child• (   :try%    if� Y;Nonž   ð    func(file, akrgs)
  ]else:  % úfunc(file, args, env@ nexcept> –_exit(127/ g ‰# Parent| þif mode == P_NOWAIT_ ù return pid # Caller is responsible for waiting!a ~while 1U ±wpid, sts =: Apid( 0Å    þif WIFSTOPPED(sts)P  ( ™continue
ƒ   Ã  £ ‘status_to6AcodeR 4 °def spawnv(&, �t ?"""% ñ -> integer

ExecuteE P withÙ°uments from þs in a subprocess.
I• Á 1theˆ1of  3  Æ	1 & 0's ( ó a if it ôs normally;
otherwise? ð -SIG, where SIG÷ x õsignal that killed it. """zr5_)-efPì, None, execv)e0   ù…+ ‹/´Ðthe
specified•@ironÅª×3env©eªs# Note:-àp[e] isn't curfüly supported on Windowsçpçg&  Ý`(whichªalookedœÂalong $PATH)Ö7argŠ
rŠòpá
paŒ , °QÙ Ouppl®bÀif it exits ò@normally;
otherwise return -SIG, where SIG is the signal that killed it. """
   A ð_spawnvef(mode, file, args, env, execvpe)


9 ò__all__.extend(["@ 3", 
 e p 0e"]C ³if _exists(0 1"):Y ñ# These aren't supplied byÒ óbasic Windows code6 òbut can be easily implemented in Python¾ Adef ± lï *ð ˆ  å """� & ñ -> integer

Execute6P with:u| `s from s… ða subprocess.
If nÄ == P_NOWAITÑ ¾apid of÷ 3 1 Y q's exita if it /s AIOvONqe# r'  ‰)x/¡Ethe
]penviron±–´Qenv =wA[-1]$ Òî­
d ®R[:-1]hè
lÒlÑpÒ!AtÅ moa,¾@doesä©”avp[e],³ @# so¿ wo( Bhave# l# 0 ei.* Òpa' \`(whichWòlooked for along $PATH)U7argö
Sö)  ß~È	g
j )p‹( ¯»ÅÀess's exit còPode if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
   ò env = args[-1]
  X òspawnvpe(mode, file,- Á:-1], env)

6 ñ__all__.extend(["< Tlp",  ðe"])

# VxWorks haÕ ó0 user space shell provided. As a result, running
# command in a4 ðcan't be supported.
if sys.platform != 'vxw| !':µ ñ# Supply os.popen() Bdef  Pcmd, þ ò="r", buffering=-1)D  3ñif not isinstance(8 7str%  )  ra¶ðTypeError("invalid cmd type (%s, expected stm A)" %  W )£  N !if› | 1n (£ ?"w"u LValuv  Ù 0 %r_   	Z ë † == 0 orý  `FNone Ž Ü g CP) doeêt�2 un^ â Weams"| mÁñ  subprocess, io— f ô j== "r"‚  0 ' =: !.PÕ �A  E  €²=True, text ; ftdout=¶ o.PIPE,< ‚bufsize=6ing ª åÀ_wrap_close(ê !.ss ,0c2 ;els™ - h/in]$inÃ# Helper for×`) -- a:!xy aÝq whose d0 wav 4 0the+  ŒQ gclass �‡ :à__init__(self,Ä3eam’ *  Ú ! €._stream¢	 c     " Â    j © g ó7 Y .& " X Tcd"= .  ^ .õ  '   #if. := 0Å  $ O  ¡    0ameC3'ntv   9   a 	? Ì 8 - • õ<< 8  # Shift left to match old behavior]  =s__enter¨Ad  5 xÜ*:;  4 tq dgetatts i, name> À  return getóattr(self._stream, name)
  Ádef __iter__) %):  # preturn !  H !)
' ð__all__.append("popen")

# Supply os.fd 0()
m  ðfd, mode="r", buffering=-1, encod ðNone, *args, **kw
 ¡ ðif not isinstance(S 3int  ½ ñ*aise TypeError("invalid fd type (%s, expected integer)" % B(fd)*‘import ioõ bif "b" nÆ 4¼ ´ = io.text_ (	 T Z!o. ¾  

cð0For testing purposes, make sure the function is available when  áC
# implementa) qexists.®€_fspath( YB"""R @   u represA Pof a  Ò-like object.1ð If str or bytes– Apass~0, iÑ ðed unchanged. OtherwÏ1the†€os.PathLc  ºPrfaceP uN ato get Š £ @. If I     G  ^« ,I  r\dI qrovidedü  $ C ,ì ,ö ¶ Q “ 1""" (ifá © c, (strR )“ì” $ j°# Work fromë ‡!'sÛñ to match method resolu @of ona magicˆ #' !s.  e _A=N  6try(  ! =4 #._U'__8 ò except Attribut±J aif hasÎU  } 6, 'K ' Ÿ’   FelseM   ¿Ò%("_°B", œ F  "ö9" +ò  u"__ùÕ_$Ú) Ö 
Ò Î ({}p)ø_	‡Ô 	Ð ¡{}".format´É× ,’   ·A  ò B).__B )2”rÅKno C™Úv Þ°Python versà Ìóas transparently as possible.
D_ò"('íK 3 = °æ  ¹ B = " ¤"


class –¢(abc.ABC):‘ò"""Abstract base / 6foré  Ê á ±file systemH  protocol.Š @_ aQ Æ Ðdef __fspath_£_(self):
  ñ!"""Return the file system path representation of' ¥object."""H ñraise NotImplementedError
# Á@classmethod ‘def __sub Ähook__(cls,  ¥ öif cls is PathLikeÁ  È rÂ r_check_f $s(I p, '__fsÐ A__') 6 
´ ¯ !__— Ñ_getitem__ =  \ ò(GenericAlias)


if name == 'nt'ž 1 ò _AddedDllDirectory  ‚ Rinit_™,vô, cookie, remove_dll_d?  D  Ð.Ü ! == ß  _N  Ã W "  h / = >  ½ \closeSy W . .” �5 Ë INonek  __Tr) 5 x][*args;  4 .È Ž  Ü  __ýp 1if 8  ­ Ï Ä   Ž -"<ûò ({!r})>".format E { A 2)>"£ £ :add(L ’ �"""Add a1 to¾¡DLL search .P  x HThis  ròused when resolving dependencies for importeÛ J `extens3�modules (` 0 it> ^ T  ed through}Î%),É÷and also by ctypes³ R"Ø ") 0all« Ú" oá›2ed Ã5 org  us0 ñit in a with statÌ.& ôö 5 nt jOnt._ž- Œ ! (#  K Ó  f 
  q oK #)
¯ ufnmatch „unctools $io
  nt|  o" Xposix $re% %sy& ðwarnings
from _collecFSs_abc3’ Sequence& Terrno áEINVAL, ENOENT òTDIR, EBADF, ELOOP8 eoperat‰² attrgetter   ÉW AS_ISG  	 PLNK, 	 2REG	 3SOC #BL	 2CHR BFIFOQ Äurllib.parseY `quote_î Ü_bytes as url �


__allU[ P"PureÛ2",   b rWindows 4 1ath0 , ( à]

#
# Internaö6ls
#

_WINERROR_NOT_READY = 21  # drive exists but is not accessible
? ðINVALID_NAME = 123C ÷fix for bpo-35306q ôCANT_RESOLVE_FILE; 9 ð>broken symlink pointing to itself

# EBADF - guard against macOS `stat` throw9 ,  
_IGNORED_÷ òS = (ENOENT, ENOTDIR,U –, ELOOP)
2 ,6 V
     ?,  ñ)

def _ignore_error(exception):` çreturn (getatt  û, 'errno', None) in ó !orC  À   C 1winx F $)
« ós_wildcard_pattern(pat¬ ó # Whether this ! ð needs actual match¥ us !fn �, or can° ñ# be looked up directly as a file.' 0"*"û 0patD )"? [ ô


class _Flavour(objecº b"""A f   implementp ðparticular (platform-specific) set ofë h• ásemantics."""
 ä€_init__(Ï. “  �.join =  1sep ; `parse_‡ s> !,  E " ad = []q Y pS  Ualtse   õ drv = root = '' i ’reversed(~   õ   „"it´ �   !ifG  
    coæ%ueJ   2if • 0  F ! =ý ’.replace(, i, sep)H Adrv,Ê U, rel
@plità Å 
2  ifF  Æ >rel~  ç x Prel.sQ (~ � È  þif x and x != '.'Z + Æá.append(sys.in`*x)ª NelseG !ifê  l  ò n 	j ;rell 0if !orMv  )>drv  Ù 0# Ib °resent, tryá€find one[Éthe previousÎ J   #þ@s. T_`makes 5 SresulˆrW2e.g% 7  °# ("C:", "/ óa") reasonably intuitivb9    ‡<in ì    ø
%      #   • Àce(altsep, s_ep)
  ÿdrv = self.splitroot(part)[0]6 if drv:   m ]break" 
 H @ or x 
P àparsed.append(¨ +& Ì " †reverse( `return£ ,3 ", + 
� ’def join_   0ts(,3 !ts 2F 2G Fts2)© 1"""T  ñ ñJoin the two paths represented by ¥respective9 b(drivee d Â) tuples.  RÍ oa new + .O ” !if2²  ª `if notí P2 and	 
!  % EF2, [†@2] +Vfts2[1:*"elÔr pdrv2 ==m  ñ p�.casefolß 2)  m –   q# Same 6¡ => seconds  iu la`1 torUfirst A   ß yÖ *se":# Sv ðnon-anchored (common à —w ¨   ó


class _WindowsFlavour(_	 3ó# Reference for . (ps can b Rund a ñ6# http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
Â ¡sep = '\\' 3alt / @has_MR= Tru
 2€mod = nt ­�is_supporCp= (os.ný‚== 'nt')& �_lettersÐò)t('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'®@ext_g Âspace_prefixÐ 0\\?Õ Ö  ÛBrved+ A = (  ç±{'CON', 'PR 0AUX 0NUL cCONIN$
 ‰OUT$'} |< �M%s' % c¹ðc in '123456789\xb [2\xb39 ?LPT9 p Dò# Interesting findings about extendees0# *âp?\c:\a'z*an) õ, which bypasses normalŠ1API† 1#  –÷ processing. ThuÌ Qs areº�resolved¾Pslash $noÇ�  transla6qto back' �. It hasn'"NT} ålimit of 32767™ `characYò, but a bit less after �  5õdevice symbolic links,J ðsuch as '\??\C:'¼1'\D5 ò\HarddiskVolume2'Ðd‘/a' looks#a m  §Pd 'C:  ðbecause slash is a
   ñ #   regular name character in the object ò&space.
    # * '\\?\c:\foo/bar' is invalid because '/ `llegalT äNT filesystemsN 0  Tl ñnly path separator at‡ 4 ` levelm ”backslashF ô* '//?/c:\a' and / ðre effectively equivalent toÌ .Ì  ) #ndã à  thus limited' †MAX_PATHq PPrior ñ
Windows 8, ANSI API bytesÑ _s areJ ,l ‘even withð ]¡' prefix.
& ð
def splitroot(self, part,/a=sep):(  ¡qfirst =  U[0:1] dsecond 61:2 Dif ( =U EK  b  f ã# XXX extendedê ñshould also disableÓ õcollapsing of "."“ K ðcomponents (accord+ Òto MSDN docs)x /    Ÿ Alf._!_“ _N(%)n Ô   Y  	#Felsef - † U = ''c Ethirc?2:3ctA !Õ Ö p #ûQa UNCp
� ?# v  2ž F ú\\machine\mountpoint\directory\etc\..q . =  + ) ^ 	g SindexlÊ.find(sep, 2Ž2if ) Z!= -1Ò  l  2G  J + 1O  3 &# #ñ can't have two 4e­i a row² = 0(af pinitial: g º C2 !=Ä /+ Â   V , =ç  %   ×  ï ?len¼  #   #if1    creturn' $ +Ða ]8?[ 6+1:« A  ÷   g Rart[:J ] Qdrv =—
:4if ~B= ':Ç®0in ôê.drive_lettersü V  ï[Ø ¤   B+[2æ ` != v3if  ‡
j  Q" =! 2 h p.lstripó:,Ùq + drv,‰êpcasefol2 és{D žs.lower()5 _ï s$? À  return [p.ó(lower() for p in parts]

    def compile_pattern(self,  !):(  , £return re.2 ô(fnmatch.translate(6 ,' ñIGNORECASE).full- x ð _split_extended€ h} às, ext_prefix= “namespace ˜ & U = ''¬ pif s.stê Pwith(C ( 9  Õ  … = s[:4]@   s *4: Z {'UNC\\'W  @ [ +\ 3F     ` §'\\' + s[3g i@ 6, s3³is_reserved*Í} ñ# NOTE: the rulesø5  Gá seem somewhat ulicated õ# (e.g. r"..\NUL" is F Óbut not r"foo  f  `" does K ñexist). We err onž óside of caution and ú ATrue¸ WpathsJ �which areb @ conE  re9 Å by Windows.8 !if/ +Ï ƒp XFalse/ + 8[0]C>'\\èP# UNC,"hs— Eever)S l  �" =“P[-1].z iP('.')ƒ  : µrstrip(' ')b Ê  P A.uppò0in Ì.¸_ N…make_uriK)thJTUnderOñ , file URIs useÃæUTF-8 encodingqQdrive× 1th. ¨ qif len( a) == 2ù 0[1] :':'¦�# It's ah ?�a local 6 P => 'œ ¦:///c:/a/by$st� óas_posix()[2:].lJ/J3 ëW ¥%s/%s' % (É  '   „ ñ, urlquote_from_bytes(rest.¶e('utf-8'))³Oelseé ~networkë ¯host/shareò ¿  `ž  \.© °


class _P2“Flavour(_	 *0sepz/s3alt  ¦has_drv = c x 0mod’ X   á°is_supporte @(os.±’ != 'nt')&  ²9Erootº³rt, sep=sep™  œ!ifZb G![0a:sepxpƒr+$rt R 	õp# Accorò’ to POSIXšQresolÍ
_ ð# http://pubs.opengroup.org/online û/009695399/basedefs/xbd_chap04.html#tag_04_11’ !"A‚ /ðthat begins with÷ two successive slashes may be
  ü0# interpreted in an implementation-defined manner, although morM Athan~ uleading{ Ðshall be treak £as a singl  )".™ áif len(part) - ’stripped_ Y== 2:4  Ø ùreturn '', sep * 2, 9 	2 OelseD @ < |  €  § 
o ödef casefold(self, s)x 8 s- ë s3  P 7   ; åompile_pattern<  u Bre.c2 ó(fnmatch.translate(D q)).full i ¤is_reserveÔ Š c VFalse8 †make_uriš h4 €# We rep[ Ðnt the path u, ðlocal filesystem encom,l ñ# for portability to other applicÚsrbd p= bytes÷ %h)M rR r ò://' + urlquote_from_5 C ò
)


_windows_flavour = _W F ˜()
_posix# P ! ¡

class _AÇ"or/s"""An a « N ‚icular (ñ	-specific or not) way ofÜ E  ¥ ý As on_ ç > U."""
ˆ dNormalŽ (˜ "):Û stat = os.
   open = io.
  `listdi3os.  Escan   Rchmod]   %mk.   bunlink-   ðif hasattr(os, "& "y  6  
 "
â Å  ¸‡src, dstC  {¤raise NotIF‘edError("ð @nk()‹¢ availabley2is v"")° %rmÞ   Rename¨ r  Eplac   ø 0symÆ û  V   ñ, target_is_directory=ø^ " ‘StouchŽ  Ç÷, mode=0o666, exist_ok=TrueŠ %if W º  ¡# First tr3@bumpQ  C3L timôé" ¡note: GNU œ Q usesYÀUTIME_NOW opYˆ x   #& ub £nsat() / f p() func7 ¶ 6 1tryÃ À            ÷ os.utime(path, None)
  ù except OSError:  ' ‚# Avoid ( Íion chaining+ Ipass NelseR ereturn) pflags =ª ’O_CREAT | eWRONLY) ú if not exist_okY F |G EEXCL8 "fd^ Copen. W, modÑos.close(fd)
> öif hasattr(os, "readlink")}  d  ? 
ÿ Ddef  p(self, ”K  oñraise NotImplementedšU("os.@ )ó
available on this system"À  s _ownerp 6tryÈ  } ¡import pwdÀ     ±  ‘.getpwuidQ Q.statRõ).st_uid).pw_name@ 7! IZ É 
s ð RPath.¿  ) is unsup¡ /edð QgroupŸ `ð 5grp° ð 0grpð ?grgð gð /grð ;¿ ð SgetcwÞ ¸Ðexpanduser = ¥Àicmethod(os.u." +@real 1   ð)


_normal_accessoe !_N A (' ð	#
# Globbing helpers
#

–à_make_selectorDótern_parts, flavourPpat =,# 1[0]²Rchild6 # "1:$  if< † == '**'~ clvó_RecursiveWildcardS• a Aelif8 0 inG ? ¹QValue×�("Invalid'  ª :8 ðcan only be an entire$ Âh component"“m S_is_w‹ @_patK     º ± s* yPreciseÚ Õ0cls^ ', K�'

€functool
”lru_cache
Ñ5 = . ., :()('  &tclass _œ aT"""A ð	 matches a specific globE  6Â against theÌ "red‘of a giveÁRh."""&ˆs_init__1“  y ¶.$ " =k ‚1 ' (if ?   C #su(: = (^ ‡ :  B 1dirUW= Trunðlse:
           ÷ self.successor = _TerminatingSelector()
  4 ñdironly = False
" 0defR �ect_from(* ñ , parent_path):(  M ð"""Iterate over all child ) gs of `: õ` matched by thisI s¦ ø.  This can contain{ 0 it� E.""";  j Ç_cls = type(p ó Pis_di. . F PexistD !  ! DscanC 3._av.  0 rif not g 	• ? Cæreturn iter([]²  ï _�à ,_ ", ­ #, † Ÿ)


class:é	Z  l 	ê` Ä 1yieï{ uPrecise‚_
 )‚ s_init__hRname,D÷ _parts, flavourw © .* 0 =  ub *._W •Q 96try Ø H( =½r._make_‹ 0rel" ö Ë ú > Bif (;! i�$f.­Celseð )(D  ;   €for p inÉ.ï < â Q  îq€except PpªssionError
Ê„Wildcard(¶?patb$ =6€.compileº@tern2kz 0oDwith¿	/4 as :_it[ —`entrie»Slist(6_itç  '   + y 	 >iesM m!  K ì   0# "^ ya1()"Í\raise(G=  #¥ ðsome cases (see bpo-38894), which isdF °among the e˜rs ignor€_ _ ˆ   É
Õ  /    ºOinueš 3!OS+ ÞeN } 
¬ ð e):
             lraise
  ~continu! Ðname = entry. C àif self.match(# -):%  h àpath = parent_ ð._make_child_rel B A ‚for p inp ðsuccessor._select_from(D ÿ
, is_dir, exists, scandirš  ž uyield py úexcept PermissionErrorÚ ñreturn


class _RecursiveWildcardS™ Dor(_
 1):
c Ðdef __init__(@r, pat, 0par¶ hflavou¶ H .= 8 k piterate…ectoriesw �80 ½Ç  ::tryDwithr(ïD) as :_it5  J  f³ies = list(… E_it)m  '   + y 	 ?iesM "y_	o = Fal  ¼  `    W >  .M (Ž . -!OS% ç e‘  ) ðif not _ignore_eT/(e—·"if’ß 1andX § �symlink(Z  %‹O Ó	� Ê    ‰‘_d j W	 G  go ‡ H X\å — ‹ed = set-  ˆ ž�: 5lf. 	¶ï  ;    Zàstarting_pointì Ì .gà  @ c ½I« (y ¾0 ³  Aif p‘3in ;5 % ~  $ Šed.add(p„kfinall‡ < 4 Wclear¸Wõ
#
# Public API
#ðQPathP”s(SequencÌó
"""This object provides s' q-like aÃñ
 to the logical ancestors@of aÐh.  Don't try3 ðconstruct it yourself."""
   ñ __slots__ = ('_pathcls', '_drv Aroot	 ðparts')

    def __init__(self, = !):  " ð# We don't store the instance to avoid refere ecycles@  U .’ � = type(d # Qdrv =~ .µ   ¿      Ö !  â 3lená Û 2if ž  { #or  ] ÿ  ¡return len# Î …rts) - 1† Oelse6 – sgetitemš Z, idxŸ $isj·(idx, slice# ž Qtuple  ô[i] for i in range(*idx.indices(È 3))) G  if 5 >=è  ) E edx < -4 ä ð aise IndexError¦ )8d óðcls._from_parsed !tsµ ô,ƒ,G  ž  h �rts[:-idx¡]ã éCreprnF¨ ó"<{}.parents>".format� ¾ ó_name__)


class PurePath(objectW ‚"""Base $  ŽÁmanipulatingæâs without I/O.M  ©  esŠ Ñ a filesystem9 ñ and offers operations which5®øimply any actualG  r €  Depend� ‚on your f {z"ti² aé c will 4seither  @osix 9a‹  Ñ rWindows %ó .  You can alsoO k #e R  ofiBPødirectly, regardless of¼ .w 1""" 	  Iù # 1str/Ahash	 pU ƒcached_c Y 	hónew__(cls, *args Z Ä"""Construct8@ath @ one<ò several stringsñ`r exis?p  L  ^Wys.  The7  ¹ ›ös are combined so a§ to yield a—¡onicalizedr,]ð is incorporated into§‘ 6new(v ‘ ® •  `if clsQ Ä 
Y  =K >`if os.‚� == 'nt' x( P}� £	u1ts(�oNduce@# Us ñê d� helps shNPinterNh& € À# when picklH 1rel6 + s§ i_22__,m  Y ®@# Àmethod
    dðef _parse_args(cls, 
 C):
  ó2# This is useful when you don't want to create an instance, just
H ð # canonicalize some constructorx uuments.| ¥parts = [] f* 0 in/ s¦  e Tif is} Ç(a, PurePathÎ  (   Z P+= a.%tsa   Jelse\   ùa = os.fspath(a)3  ! � ?str|   + ð# Force-cast str subclassesM  Þ(issue #21127m  F Æ î.append(str(a)) Í  ? ýraise TypeError(Ñ  %   A"argœÁ should be a· pobject •n ooLike "M 4 �returningI �, not %r7 i% typeâ B â cls._flavour.Î( !)
Š @^amethod düBfrom üpWe need”Hcall.w on theïAso a¿0get h  @„# right ¥  @selfVF€.__new__‹ Ç±drv, root, Ð 0 = 6 ·¸³	U »._drv = drv  K ! =R  _   e t J8sedQ¾  R ü  # Ê _PormatÅ Ì  ifj  _
;A �+w* +³Bjoin¬F[1:]ú¹K 	ñ> êÙ°make_child(EÖ˜V2 Õ ‰ 
6D  ‡ Ì,À * s,D	ìú E ¶ � a_str__~A"""R� © ‚ ‰ñrepresentation of  ïå, suitable forÙ @pass9  to system &Fs.""É?tryÌ &stN ò except Attribut–
< 5 ±f¯ &  l¶ À              øself._parts) or '.'
3 rreturn ' Astr
 ð def __fspath__( !):  < 4 "tr 4 ‚as_posix 2 B"""Ri ðthe string representation of   s õ with forward (/){ µslashes.""" 3f =À uflavour © ö.replace(f.sep, '/')½ ~__bytesð 
¾ % ½ ÷ .  This is only� ùcommended to use under UnixÑ · ²os.fsencodeP«  =ª : ñ"{}({!r})".format@ ò.__class__.__name__,9·)aas_uri: ü
­ù as a 'file' URIË bif notf Çis_absolute(R Rñaise ValueError("relative c °can't be ex4Ased v  u  t "" ³#._V.makeÎ H‚@propert¢òc(ó ð# Cached casefolÁ) ,£P hashÏåand comparison÷6tryì 	¡ cZ _y 4 ò except Attribut
F ?  .° ÿ× k ’ ( 3_eqpw, otherÃæ±isinstance(" §, PurePath, q áNotImplementedk  â j2 ==u .+ n" äp ˜ öç½  ¥¿ Œ œ 4 • “ 6 ! =R(tupl¼¸ )©ë  : ´ #lt² q! ì  ‹š$
U<˜<—	¿ e¿ �WÀ g†Àf._cparts > ñother._cparts

    def __ge__(self, $ !):  ! ñif not isinstance(" ð , PurePath) or < Á._flavour is4 )  S  W õreturn NotImplementedu  V ¯ 2 >=œ À ÷
class_getitem__(cls, typeÉ T $clú õrive = property(attrgetter('_drv'),‘  ³  Ádoc="""The dE ‘prefix (l>  PUNC pÒ, if any.""")sOrootx   y x  ' q of theh g  @Ù Å  èaanchorèÊ Ôconcatenation[ ß @and q ,Ú  ''Ë T  T # =Sdrv +  3 ( ~/ ¡ OnameŸ Qfinalë ¨ componentõ i Ü�   qif len( p) == (1Ÿs .ó á u ½ ‡) else 0- ó Ë %''X  X O[-1]à asuffixo T 5"""J  Të æ ‚'s last = ô d  � ÑThis includesðleading period. For exaiv: '.txt¼ ~  €;  — @i =  ¶.rfind('.') ‘f 0 < i <] ' _) - 1ð  E[i:]>  b* "''â &	/esH	dA listÇRD O4esePO sPæ['.tar', '.gz'Ú YfX�endswith[[Z  E‘alstrip7 T�@['.'�u  f¦ "inu Qsplit; O[1:]¶?teml « é–‰minus it¹	6Â k  » i;&:i5i€ �  $ …_ ò ,)
¬RºRa new‘ 4 )Afile2 ‰ changedõ Jõ çñaise ValueError("%r has an emptyY B" % š )‚Cdrv,¡ƒÃ�Àour.parse_paãrts((name,))
  €if (not  1 or ú[-1] in [self._flavour.sep,  ualtsep]N  U `or drvL @root ùlen(parts) != 1):0 ñ
raise ValueError("InvalidŒ q %r" % ¸ · dreturnŽ  rom_parsed 2ts(¦ 4drv±  ‹ ,w  «  > ²  [:0+ [ 1])
C Ñdef with_steml  ,  Ù B"""R£ ¡a new path4 A the- Á changed."""V  � × b  w (\ " +í msuffix‰  ‹  � Rfile W ” A  Ifª  ¸ ž chas no, ³, add given .6  Å is an emptyJ ástring, removej ‚ Afrom  z .1 %2f =š& @if f§ ½P Ror f.§F and i· ŽQ � J h  T 0.stü ÏP('.')  == '.'� ) +   Ž   k 0%r å°‚ í Dold_Å � u ( 
{  � ! =`  Ú²< Oelse/ 0[:-PY .)]B H_S Y³relative_to–o*other– 1 *Qto an1  Óidentified byEssed3–arguments…�operation‚ ðpossible (becausx#is J @ sub}" o‡ <), ­¢R# For§ burposeL ñis method, drive) š× are considerÖ ±# separate Žf, i.e.ô#   Path('c:/').E va'c:') ¡s% &/'ø; 
/: ì #0if P� ÀÌ4TypËôneed at least one ª"Œ Ü » ª%tsl  Kï5drv 7    0if  ™ À        abs_ñparts = [drv, root] +  c[1:]
  Uelse:   Aabs_( " =0  1to_N 0to_Q E, to* Pself. åse_args(other)<  if.  7 
n 8to_q [d  µ f ¸ J 6 ‚ ˆn = len((   Rcf = Å ðflavour.casefoldÖ %tsH @if (È ð or drv) if n == 0 ME cf(Ò €[:n]) != 	x 
–formatted„   z #se�  ¹ Æ  Àð!raise ValueError("{!r} is not in the subpath of  "Þ  B  ‘" OR one + ñ is relative andG å [ Ÿabsolute.J R " .ë P(str(n0),   Vted))Í dreturn•:rom"''Ø€1€?'',Î „ 	 ¨Qn:])
7 tdef is_ë 1_to© 1, *í )ºB"""R£ @True‡  Z,Qto an< H‘or False.o  � &""66tryb    &.Ž ˆ >  % + ˆ  gexcept	
X 3 ‹ ú ‘@propertyC  ÿ 
÷ ðAn object providing sequence-like access to'P  § ¤componentsˆ¡filesystem. # We cacheE ` tupleR ¡avoid buily Qa new§±each time .º x #£“ €ed.  XXX  theª Eary?/ „,‹*_p\ g‚Attributt
k8 " =É V1&tsó %m ›  ’@joinb? 0, *k
œ`Combin3!isT0 wié ne±Ðseveral argum‰,Ìt ah  …  S h   representä eiÕ% a?g(if alO E are'N  J  s)€ òa totally different¥  J  k!ofí  & izŸanchored);r�n±make_child($ã C³__truediv__F7keyDþX W(key,°
?Typž €NotImple}(ed– r— )ðfrom_parts([key] ó+ self._parts)
  õexcept TypeError:  ! ñreturn NotImplemented
# ‘@property °def parent(g )G ã"""The logical% ñ of the path."""D  q Sdrv =ª 5drv Eroot    Ð    qif len( À) == 1 and (f 0or H ª  € ñ  Ä F  `._fromD0sed  tsM ,K ,Ý �ts[:-1])%s& ¢A sequence!is+'s<s1� a_PathP�\ �  ˜¿is_absolutew  fTrue i�D is / Á (has both aã  ?,. µapplicable,(‰a drive)  cif notÒ qpUFalseI Ô 8 Ãflavour.has_¼AboolÎ . oî �reserved  áB"""RÑõ ³contains onôe special names U ¦ !byÃbsystem)nyü È  M$._Ä 4is_K   ’Y  Â Qmatch  Rªth_patternÊ /  CÓ 9 H !es¦ PgivenP I .< {%cfF¬ …casefold0  °� h = cf( V6drvt)^ Rparse (H &,)J @#paF ?’aise Valu¾t("emptyé "H  : ÿ  !½ š7drv[ S¹
–%if	 D  ÚE ‹
c ^0if œ š
ê ËG) !=Ý
- Ä   K  =(�E[1:]ˆ .eln >m -1forÂó in zip(reversed‘',  × Eÿ!fnÍ.  ˜E _ 3  ä ”   üð

# Can't subclass os.DPLike åP Pure  ôQ keepIðconstructor
# optimizationsç 5 Ö·se_args().
^ ¤.register(- B)


…  @osixy   Þ1"""  6ath·  iÂnon-Windows �!s.ÿÀ On a POSIX ÷Fsystem, instantiating a PurePath should return this object.
    However, you can alsoN òe it directly on any u A 1"""I ô_flavour = _posix  ñ_slots__ = ()


class¦ pWindows­ (¶ !):6 4""" B sub4 Cfor 4 ‰ 1s.
/ KOn a |wì b# Filedp-accessÔþ &es<?ath1Pthat ÛCmake3T call8 {õ  represents a f�   pE¡but unlike³ 1 !, *aoffersÙmethods to doh  8H z�s. Depend× @on y7ð ,J Í „ DwillÇ`eitherç j �   o   I p O. YoÝ8a PB @  õ“  icannotp s  ç ta POSIXÿ Ûor vice versa1Ûo2tnormal_ ½ _4 ¯ðdef __new__(cls, *arg 0*kw
 9 +  if cls is œ Q      =+  ö	 if os.name == 'nt' else“  < `self =\ Ñ._from_parts(~ % 0if + , .îÚ.is_supported� ÿraise NotImplementedError("u  %rj6‚ �   % 50.__è U__,))±   ± Mj 2 _child_relÃ("  , ô l0# TYð	is an optimization used ³ð dir walking.  `A •` must be† @# a í!leb � relativeT» ƒ G ê  E @s = ” .ˆ@ + [ ]T Ú ±2sed0 Ð c._drv,G Brootá 's)_•1r__1 û _ 	. 3xit- §, t, v, tb7 õ# https://bugs.python.org/issue39682Ã Ñ# In previousLqions ofžBlib,Ù‚r marked  1" a¡ 3�# closed;Qñ sequent attempt»Òperform I/O w;�Qan IO”€÷@funcí°ality was nTR docuÌ€, and ha• ·e effect ofá  ma« ðs mutable, contraryð PEP 428. In PytÓhon 3.9 the
  ó0# _closed attribute was removed, and this method made a no-op.
F G # T$  4 ð__enter__()/__exit ð should be deprecat{ 'nd‘ { 0 inª v futurek Qpass
/ Â# Public API b@classª # Ñdef cwd(cls):  ² �"""ReturnÉ ñew path pointing tox Àcurrent work •directoryG (( H Àed by os.geto &))° 5"""2 rv 0cls’ ¦._accessor8 È @home7 É puser's ?  Å K (as— Å  p.expand< O('~'Ñ H"~")6 )Ë  ‚ÿ
samefile(self, other_pathË 0whe! ' 1 is“ H � or not a 0is X É ’  g .9  ) (È Pst = ž u.stat()R 6try8 <½ 0  a 
6 „except AS_ErrorH x ‚ \ Œ >2os.t 1ame, $stT'stvqiterdiru
iÁIterate overY sq&is%q.  Doesp†yield anÿ’result foD qspecialMQs '.';O'..' 8 @namew Olistº   4if 5 `{'.', a }[ ( 0# Y±  ¹a“ e objec¯ öse makes little sens B    cou 
³  D  _child_rel—(Ÿ †Aglobƒ,‡ OternŒ
¡is subtree?l �all exisŸ¬9(of�Àkind, includõ é ies) match ôthe given relative• ¤°sys.audit("Ü �lib.Path.Õ !",1× 4 ¤$otZ 
œ±raise Value@("UnUptablŽ ñ: {!r}".format(pat9•drv, root d_partsÆâ_flavour.parse (H &,)I `if drvU N ¬ �NotImplemÐdµ LNon-Cös are unsupported"g 1sel=A = _4 d(tupleš © )Z.Å G  4p1P .H Q_fromf] ÁÐyield p

    ódef rglob(self, pattern):
  õ0"""Recursively yield all existing files (of any kind, includingH ðdirectories) match< ôthe given relativeƒ ,N …where inF Õthis subtree. 5""" ñ	sys.audit("pathlib.Path.æ :", è 7 •drv, root�_parts =2 ò ._flavour.parse #((/5,))I ‘if drv orN H Oüraise NotImplementedError("Non-ös are unsupported"g 1selO” = _make_ ô(("**",) + tuple¤ ³ )Ï Q €for p inï Z .R Q_from Í 
!p
ú  HŒabsolute- B„turn an % Á version of Õ ­@.  TáPfunct Qworksa  r e(i0 &ðh doesn't point to3tX.–  5 ÁNo normalizaT Ñis done, i.e.Êö'.' and '..' will be kept alonghÐUse resolve()p @get Ã�canonical¾h a; £õ# XXX untested yet!ä  if�Tf.is_+(y!reM É7 r# FIXMEK must deferŠ    “specific Æ0 (a¦çunder Windows,M ð use nt._getfullœWname(è† .$a ([˜ ò._accessor.getcwd()] +Ú ( )¢ 8R 9 ç, strict=Falseù @AMakew ˜ R,› W  ±symlinks on- 1wayæEalsoë  5 @it (0exaŸ f  ôslashes into back ?K G)ô  ê Ècheck_eloop(Ý  ¨@wineô  = getattr(e, ' F', 0­ 1 ðif e.errno == ELOOPv1   ú_WINERROR_CANT_RESOLVE_FILENAME� T ¡sRuntimešSH ¶  � %r" % e.ù Ì A :tryV A1reaR(ñøã 0exc‚!OS‡ Z as eZ 
Mh † Ç  pÄ2rom0((sµ$ ’# In non-‡ P modeQª )k[  S_sô°# Ensure weÈ óÊ  Ïqby callUFtat(î cif notý
è S â :p.sA   i  3 % àcheck_eloop(e)#
  ‘return p
 ñdef stat(self, *, follow_symlinks=True):-  B 5""" RK àthe result of  R õ) system call on this path, likeG 3os.1 Udoes. k rk  ¦ ¢._accessor7   · Ç )ï Qownerð × ¤login nameÛ Qfile C © 1 t ‰ Rgroup `, ‰ ?gid‡ F r ‡ Aopen ð, mode='r', buffering=-1, encod UNone,¡ � errors= � newline ^0Ope!e J¦pointed byS and ña' ¥object, as}  h‘built-in Ä ¿) function IÑif "b" not inñ | Ð ë ´ = io.text_ (	 )… ¦  ƒ—Ž   RNK,9N ƒ  WÅ¡read_bytes»l1in 2 ö  , C   iU�nd close¼ —TPwith × .á -Šb') as fG f.f (¹  W¸ 3 Ô  M Ó %Òî'Å P É "WwriteÜo, dataâJ ? toæñ# type-check for ¬ñrface before truncating'  <Ðview = memory (È   NwOÓ (N T _U i –œ‹[,©0in a ir Z"ifw‘sinstanceW, strÞ þ°raise TypeE^ ('Ñ € must be0 ,J U%s' %P 9 
 À  data.__claóss__.__name__)
  ôencoding = io.text_ (	 . ô
with self.open(mode='w', + =	 ’, errors= £, newline= u) as f:ˆ  � ñreturn f.write(data)
" Ðdef readlink(€ ): 1"""$  B RB ðthe path to which  �symbolic F … points.; G < =é ª_accessor.� 9 ¶  – à._from_parts((F ',)Â Qtouch¿ !, ;ÿ0o666, exist_ok=TrueÚ ñCreate this file ‹ × bgiven ¦ W ò , if it doesn't_ é µ < <or.¡ › Æ ZmkdirÆ ö777, parents=False:  Ö aÒ directory até Û  H¿ 6try  Ð « Éðexcept FileNotFoundE°
O dif notÚ 2 orê " ="
3  † Uraise   ˜ 7 .•  só-; 4  4hFå /OSÛ  P# CanÝ Ðrely on check	ðfor EEXIST, sincu€e operat  isystem¤ €# could °� priority}Sother
À like EACCESKYEROFSG oÉ  %  ¢ =0is_wH X  nI  'WchmodŸð , *, follow_symüvK üRChangô ápermissions ofD Œ,Ê 2os.l )�· >,   ý• ¥ sl= ¼ Lb, )Uäiº õ š#a ,Ø  !'sH Wý Qare cQd, raÕÿthan its target'K ñ (¿æ ç un£Á  ngWø PRemov´!orå™IFis am�, use rm^† instead9 o» …joð V  è²  _Àove this diròectory.  The dir ó must be empty.
  5""" ðself._accessor.rmdir( !)
$ ’def lstat :  H E QLike % ñ), except if the path points to a symlink,  %'sW  F ðus information is returned, rather than iT arget'sÞ 8  Ð .Z ƒ(follow_x ws=Falseë arenameì 1, t\ )ô R* R thiså !toÓ 5  .C . ˜ @ may™óabsolute or relative. R
 E Us areµinterpreted1  X kö current workingp, *not*Ÿ I %o©P©gobject¸ Rys; Q new & ‚instanceØ k ü  ÷   )‰nD
n¢ ¼¢__class__(E	²Oplac³5 , overwrit× Ä!atˆw existsÔÿ� Õ 9_to“E_is_ÁÄ¦GMake¤»0Not>  ŸÐder of argumeÍ(Æ$ ¥ „preverse+ 3os.Ç œ, á,´ð ü@hard‡ (³ @  A âsame file as *u*ü
 Ú » ) u µ ? “ + 	  ý eÖÔ/a Öó qis funcš¬does not mgW %to@,Sdespi\bimplicëŒa 5ands š!s.ãðorder
        ofð% arguments (target, link) is the reverse of Path.sym  £_to, but
  `matche4  at- 0os.( %.
" ÷*Deprecated since Python 3.10 and scheduled for removal in) %2.O �Use `hardg æ_to()` instead% 5"""1 �warnings.	 ¡("pathlib.Ö D  ÷ d©  — 'isš O ø  "³  5  Ä 	ˆ 	Ð Ï %",Å o  SBionWÞ õ , stacklevel=2)8 áself._accessor›( ", ö)¨ # Convenie¡‘functions‘�queryingÂstat results; ¡def existsY %):| …ÐWhether this û 4 ³6tryG  ô  ³ .| (Û úexcept OSError as e5 ðif not _ignore_e' '(e¡  Z   Uraise·  —eturn Fal q QValuet 
o ñ # Non-encodableæ U rj FTruePois_dirPïis a directoryX~ qS_ISDIRq g�.st_modepS#e‚ doesn't0 or–“a broken ‚	Sð# (see http://web.archive.org ð/20200623061726/* Ñs://bitbucket) ppitrou/˜ö lib/issues/12/ ÿ SÞ  Sqis_file“³T€regular ? p (also ^ÌD¡s pointingp  Û 8to 9 /s)B1REG¯ BÿxQmount”ð):
        """
   òCheck if this path is a POSIX mount point
0 U  """ õ# Need to exist and be a dir% Áif not self.' fs() or •is_dir():3  l Õreturn False
 :try' Âparent_dev =d  ‘.stat().s @ êexcept OSErrorK r Z S 0if $ 2!= z  Œ Y ETrue‰ 4ino± W 5ino! M (  Ù / ½ / Š  ! Q ð def is_symlink(ŒoÓ|Whether�symbolic @ .T  ¥: ›“ qS_ISLNKu &.lí Umode)J 
™Z as eEG�_ignore_eÀ'(eÆ  �   Fraish  0# PÙrdoesn't¬y  ! ª l    ’ _Value. ñ # Non-encodable<U  †Pblock&1iceÅ Q‹?  s?iceŠ#BLŠ‰u ssbroken ¤1 ‡  ð# (see http://web.archive.org ð/20200623061726/* Ñs://bitbucket) ppitrou/æö lib/issues/12/ ˆ o [Ochar' > _acter&1CHR†Y›kîAfifo“OFIFO
À          reóturn S_ISFIFO(self.stat().st_mode)
  õexcept OSError as e:  $ ðif not _ignore_e' :(e)%  ) Yraise; û# Path doesn't exist or is a broken symlink8 ð(see http://web.archive.org ð/20200623061726/* Ñs://bitbucket) öpitrou/pathlib/issues/12/ ÿ ¹ e07FalÀ QValue
ñ ð# Non-encodable e 	Ä rU  �def is_so¡ •E1"""%  � ÁWhether thisY 19 .' 3 :try    ASOCKo ÿu¡expanduser–
" R8Ra newýRwith 5  ed ~ and ~? µ constructsB(as ü�ed by os.›.@  6 üA@if (ç“ P._drv©:`_root)w f  ¦ Pparts   ç[0][:1] == '~'á  8 “homedir =2 ‡accessor£ … \ 6[0]²  @ 3if C d :"~"ý ' Žr RuntimÁq("CouldÎ‘determineL Ê directory."m Kª Qfrom_• #([ƒ 3] +  e[1:])
'> à


class Posix( e, Pure +0""" B sub5 ò	for non-Windows systems.k £On a POSIX ð , instantiating  ˆ!sh – ^bobjectTä__slots__ = ()¸ {  ˜ º  ¼ 	' Ÿ 	¸ 
 º ; vQmountX¨   $áNotImplementedì(€B.is_8 )‚âunsupported onž‰ð")
#! /usr/bin/env python3

VQThe P ÿ  Debugger Pdb
= ä

To use the d1 �in its si¬ ‚st form: Ì Ð>>> import pd3b
  ù`>>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in b ÷.

Alternatively, if ƒ ð terminated with an unhandled exception,
you c  seÍ  ª ñost-mortem facility to inspect£ °contents of É
traceback:
	´  <€  9 >  W`import‘ 	  n3pm(^ðcommands recognized by� y€ are lis^qnext
se\q.  Most¡be abbrevi5€as indic ô; e.g., h(elp) means
that 'help'@ ô typed as 'h' or ‚(but not e a',
nor H HN  : ¡HELP').  O¨pal argu]sÔ ð enclosed in
squç ·brackets.   Ç .q syntaxE Psepará ð
by a vertical bar (|)dñ blank line repeatsN p)Dous W pliteralŠÞ` for
'|±', where itŒB  ˆ1 11[ Ts.

CÎYt>† doesn'tè¾ passumed›¥be Python
„Qs and( Wexecu¼#xt» ™³gram being
²3d. R Ösççalso be prefix^pexclamaV¡
point ('!ÃTæýis a powerful waS?proˆ  ;5ðis even possibleó ðchange variablesp*f8ps.
Whenù‘ LQoccurHsuch1,×* Àname is
prin= Ä•"'s Ò Ü� *d.ù@ supÊ�s aliases1ichK°save typing´ ¯%    
h   ±meters (see¤ J  y  entry) whS ðallows one a certain
levelëuadaptabÎ Ì 
‘under exa2äion.

MultipleáPs mayù entered on?@inglbEne, O†à
pair ';;'.  NA�telligenc[b appliÁ; 1ingã U s; Q
inpu:€split at &^ ,#if,éamiddleü @
quoÅ0strm0

I-ñfile ".pdbrc" existðyour home directory^W …current
 ,w 0rea�xt G˜ €had beenñ %Å or†4mptPis pa� ularly use6f.#°.  If both
Ç s¿ Å ­ Æ i,#ad<!O `
definŒ©0canëðoverridden by the locñBal file.  This behavior can be
disabled by passing the "readrc=False" argument to ñPdb constructor.

Aside from aliases,* ðdebugger is not directly programm ò; but it
is implemented as a classZ ‘which you¿ `derive dr own k 
2 *, . @makeQ Pfancy	  G ”like.


D¦ ¬commands
= Ñ

"""
# NOTE:Û sactual 3 A doc$Pationï `collecÈ Ðdocstrings ofA $
#< Ps and3 ð
appended to __doc__ after0 
 haÇeð ôfined.

import os
 $io
 $re
 %sy 4cmd 4bdb &di! %od8 5glo# dpprint1 dsignal einspec utokenizG ”traceback0 ²linecache

²à Restart(ExcepFð ):
    """Causeå "Bbe r3 Red fo%! „d pythonh.¾ M  æð

__all__ = ["run", "pm 0Pdb sruneval 4ctx
 !al Aset_Ò !",£  Z  ª ¡post_morteN ðhelp"]

def find_funcÚ (	 Qname,Ÿ 
 í ðcre = re.compile(r'def\s+%s\s*[(]' % eescapeH !))ˆ 2try4 ‘ Tfp = ˆ`.open(m . ei† OSError9 ±return None(  ©bnsumer» §`nfo exòs�`first Õ›1; vwith fp\  ¨ & 2no,. Pin en\ �ate(fp, #=1 É   Ðif cre.match(A    $ ¸ \k !no“ & Þ š�getsourceW Ss(obj\  < 3 = ã.Ë2 - V %if qisframe Ú`obj.f_I0alsè flocalsð# must be a modulQqame: do=0try]ð cut a block out”!it… ¼ †)elŸ m]   ~ 	8  ø 1getv € s[+ Tno:])#"+1ëblasti2 q(code,  W êÁs = list(disU 3 ÿs7 Õ ’.reverse(î Li} 1 inQ@ Ø "if} V >= i +
0”“_rstr(str¼ A"""SÆõ that doesn't quote its reprm ø __ s__(selfF }   ±


# Intera µ#mpNÑwill separate.T`call i†^ fð
# text using value ðof line_prefix string.  A new ò and arrow may
# be to your lik. ð%You can set it once pdb is imported using the
# commX P"pdb.f € É= '\n% '".
#™ ð= ': '    # Use thisˆ 0getT ý old situation back
X !->B ð,# Probably a better default

class Pdb(bdb.Bdb, cmd.Cmd):

€  « òvious_sigint_handler = None% ðdef __init__(self,ô ðpletekey='tab', stdin=6  4out 2kip s  w  "nox õ=False, readrc=True):/ ¾ .… sY   )* ß * 4com¯ � !in 6out; ¡sys.audit(ÉFPdb"  ifà 6out•  Ä  õ.use_rawinput = 0�  Ppromp Š'(Pdb) ' Êaliases = {} pdisplayh ëmainpyfile = 'T ©_wait_for_' c
d 0tb_Y*no€ P# Try‘Aload” & 0 ifeexistsH :try$6 )  0Ð# remove someEAmon Æ æname delimiter_  6   � T.set_Ë!r_. ös(' \t\n`@#$%^&*()=+[{]}\\|;:\'",<>?'È�except IÈZError½ 6pas| À°allow_kbdinÆE Ä4 =  8 ¼ ñ # Read ~/.pdbrc�. i QrcLin
%[] !ifI*rc§ u k ôwith open(os.path.expanduser('‚ Ú')) as rcFileV  E   � ‚.extend(0 I ( M/OSI    	M  · "$"¡ [l÷ Í‘ñ  # associates a± ê@listpbreakpoHnumb¸	M 5_doð{} # for each bp num, tellsaBthe , ˜  : `# mustÇ /@. af@exec8 M @cmd ° O 
š AsileÙ˜ µstack traceN ™  Û› ,PdefinÇ != v —Pue wh÷!in+Ðprocess of de�fining
  õ# a command list8 Sself. õ's_bnum = None # The breakpoint number for which we areK Š B# de° " a 5 ðdef sigint_handler(� , Ánum, frame):-  ^ 0if ! Ö.allow_kbdint  " ûraise KeyboardInterrupï ômessage("\nProgram i* õed. (Use 'cont' to resume).")‰ † Ÿset_step(  btrace(À 
7  í Qresetä Õ ‡bdb.Bdb. 1  Ï h †forget()H    I   ‚.lineno Ä
H ªstack = [] Ícurindex = 0 Ã O 2tb_m h.clear  Qsetupè |, f, tb¦ Á 9 ¡ ,ã• Ø gmBack(Q © Šwhile tbð# when setting up post-mortem debugg qwith a ¯åback, save alla  ˆ€# the or­0al ø s"ñbe displayed along0 qcurrent/ O L2s (JAcan E 0ffe3  , e.g. due_ ö finally clauses6 ›  Œ ñblasti2 q(tb.tb_½p.f_code‡  ' 
C aÏ[< 1] =¾ )noÀ Rtb = ' ;nex^1curx " =Êw[d Õ6][0„hñf_locals dictionary is updated fromTbactual” ## =  õAever+ .T €accessorR Æcalled, so w¼á# cache it herv@ensu
 Àhat modificaš sõõ not overwritten.Œ é Õ š 6 Pretur°älf.execRcLinesU2# C"  uQearlié Aan 'qÁ' if desiredY  s 1 M  › Š!ifÆ   ".rp 
E• K  jf� copy bec�Õ of recursion* N    .r«'se@ # ° @ute  y|– only onc®³ 
Ñq 
Î  3 =  ¸.pop().striÁ è "ifx ,Êne[0] != '#'Q , � ponecmd(d b "  #ž'  YPs Tru˜%heœAwantS6exiXD À    # from tÿhe interaction, save leftover rc lines
   ø	# to execute before nextQ 9 €self.rcLZ Ó += reversed( )6 Áreturn True
! ò# Override Bdb methods àdef user_call(q ñ	, frame, argument_list):K  Þ s"""ThisH @ is < Ðed when there õthe remote possibilityF €that we Ó P need%`stop iE ais funlE."""7 0if ¥ ö._wait_for_mainpyfile£  § r9  c _¤ (ç Ø  5 \ úmessage('--Call--'i% J {, None)W Wp Hè  5J0we ­ à or break at ty T $1if Ž .62 !=SrcanonicÎ °.f_code.co_[Jname ."or,0.f_” wno <= 0ã  %   Œ  EÆ� = Falseº²bp_commands¤ i R —G  3 ðM 0"""ø›#y t  ± as set forê� current "ve¨Upoint¾ 0(if*  !." R£s« ( x normal	ƒ must bep,d 0  o{Iwise#Ý©  bpf Â `in bdbmABdb.a ˆ aÉ v was hiÑ ¡if getattrJ3, "Bbp",»u) and \   ì -  ‰ n Õ
¿U  ŸÂ 	W  Â., 0 Älastcmd_backI  	( G Rsetup[Íº   ô ç 40 %s[€ ]Ä  7 * ponecmd(> 
F ‘ 3 = 
 ¯ 	  jif not0_silent~ ñprint_stack_entry¹. [‚ šcurindex]ž mé �_doprompt š_cmdloop(R n kforget # " 1-¦ À ,|",  j_valueÆ§_a9 E tra ?À   if self._÷wait_for_mainpyfile:
  ereturn òframe.f_locals['__! s__'] =  Uvalue4 ñself.message('--RS J--')# Áinteraction(h �, None)
' ádef user_excep%  Y #, + –exc_info)À ±"""This funV õ is called if an K � occurs,j  þ €but only) ðwe are to stop at or just below td •level."""C 0if ¡ /._d Ê Ptype,  _L ±traceback =  ï o 	šÞ �X  [ ñ p# An 'Iƒ�nal StopI� i'n t C	9µdebug event‹ ñ# issued by the Ù÷preter when handling a subgenerator run withJ À'yield from'x&a / acontroÐ÷by a for loop. No³ 7hasQ ‚actuallyórnÃ¡case. The Õ 0gerqs  è 7 toP Ö  ë ' 0gee( ç  ¾ V such½ %s.D ‡prefix ='x@(notÇ _ø3  ² 2and6 !yp‡ 	Ë•) else ''K ¤ž’%s%s' % (•  n ˆ v.format‹_,(a ï)[-1].strip())ñC çú1# G"lI"ÕÉ  @_cmdþ(Ò ›while TruÚ6try+ ß   ¢# keyboardm €rupts alè _ üpasy wayacancelƒ  >  #÷ócurrent command, soJ €them dur Ô v)&puGN  Ð .ƒ ‘_kbdint =Ï w ) lH 	FFalsª* Ybreak_ L# K( B… P---3 ù] 2# CŽabefore¼,òes display expressionÇ ì?preë3  W=} A.getA.cur-"$ifn :ingÓ  õ ‚ Q, oldŒ7 in. w.items(pE2new0 ‹ s_getval5(U ‚ 5 q# checkËò identity first;ˆ!prlø s custom __eq__“K $beï at»!rycÀ, and also pû
revents instances whose
  ý# fields are changed to be displayed5 òif newvalue is not old 6and %!= :F  Š d µing[expr] == 0 ãself.message('> Ð %s: %r  [old
 O]' %?  s  (r ,p ,« 1))
> ðdef interaction(} ö, frame, traceback)Ú ñ# Restore the previous signal handler at ±Pdb prompt.n  ˜ „if Pdb._; ƒ_sigint_; j  - :try   l . ( �.SIGINT,\ 
)…  G €except Vã™Error:  # [   only workk¾ main threa5Jpassd >lseÁ  	f = NonÅ0if ”.setup(™ Ó H# noÏ‚ desired�úis time (happens if .pdbrc contain½ €# a commï`like "' Zinue"J¡ zforget( ereturn)  prï±stack_entryu. [" –curindex]M  ‡_cmdloope  { i  Ó6Ahook^ W, objÆ”"""Custom * A for·ñ	exec in default(), whichï sh  q as$qment of<  _ variableB  $†builtins5"""B ¢# reproducR„behaviorP  ÛHdard© ,�H=ing04obj³ K
€1^ { (õ  ) g, line8!if Á[:1] == '!': ! = E[1:]Ú ‚locals =À1cur½_ & Oglob'  3.f_ * `code =£Ppile(« ð + '\n', '<stdin> vsingle'M º°save_stdout£ 2ys. o % &in$ iÏ# o)  	R Å D ~ f  þ¼ 	8 ' ² ( ?out) �  “  .  3  ó(Q#, x", ª
7ofinall•Ä � ]j s) í ( Tí ±  Ä ðave_displayhook
  ƒexcept:
  ñself._error_exc()
 °def precmd(" v, line); ñ!"""Handle alias expansion and ';;' separator."""U  q aif notO w.strip(V  ! areturn! 5 aargs = ….split() 0whi†  rgs[0] in ° .– &es±  [  Ä ) =! [[ E[0]]P  ) iii = 1  for tmpArgd 6 :1:]`  ; d   ù.replace("%" + str(ii),W  3  m è & Lii +�  n  u Ô*", ' '.join(² )R   : Z!#  Y intoÓµed commandsÍ ó# unless it's an( ' 0if s  «A!= '§'Fdmarker• Pfind(P
¸ 3if ( J>= 0A  *ó# queue up everything after9 “  /   Cnextv [\ c+2:].l¦0 h1cmdi €.append(E 
ª  [  "[:\ <].rY ún  …/on…
ÐInterpret the[ðument as though it had been typed¿�responsef  ¡ !to@ rprompt.  ñChecks whether this†3 isN az rnormal A e or in] Äa breakpoint9õ list definition.. - jr_5 *ngõ=Žcmd.Cmd.7a Oelse< g hÖ_¸ m (¾"   : #Ws oneù `ne dur�f @cmd,Ù` ¿Pparse™ ž  ­  _?cmdã ûif cmd == 'silent„ Ñ .ž "s_# [ ¶bnum] = TruH ƒ Šâ# continue to 5! oG {  Ü!inv   ž 'el  ?end� yJ = [½€ ’1 # end oë 	a 0cmd Mé â • º
VH ý¶cmd+' '+argo6 . õ# Determine if we must stopŠ :try‡ âfunc = getattr±À 'do_' + cmd3)
  õexcept AttributeError:  & õfunc = self.default  õ# one of the resuming commands' 0if F Â.__name__ inP * _< 
{ t $ šdoprompt[ Õbnum] = Falses  º ( Émdqueue = [] …return 1  
 ñ# interface abstractionÈ  	 s' Àdef message(o f, msg)Æ ðprint(msg, file=$ †.stdout)B ev@ Q'***'[ G �# Generic~0ple¤ ­ Ô.  Individual" òe_foo methods can b@÷# assigned below toè'seX Ä @_comx `e_loca Ñ ÷text, line, begidx, endidx(3# C? ! a*€/module/8 M  V Â for break/t aclear.¶ ö!ifm ÷.strip().endswith((':', ',')y  2 `# HereAes a> ñ number or a condi… €which we. 't2 ó }  O GnÀ# First, tryM find match/ã ös (i.e. expressions)Z 6tryWg —|< (x,ÿE?ionb 6e# ThenÇ ò± Û–s as well¸ €globs =  . ( q.escape¥ v) + '*'• â fn% + s• ûif os.path.isdir(fnÏ .append(fn` /`  ! )elI  � J Ú and fn.lower=0.py?M.pywB R :rets :s ?ret2"bpo2&	Spoint¹Ð.  (This woulÇñ more helpful ifÅ  Â# display adïàal info along Dè÷  `, suchõ A/åP � .äq[str(i)ÕPi, bpöð enumerate(bdb.BìÜ R.bpby*I  {  !if> ps not N— Ë_ b.start /)]†exˆ%·n arbitraryÆ!ifž ŠcurframeÞª QllectB1als£  ls×Át is usually^ !re €sensiblepðalso
        # cðomplete builtins, and they clutter ó namespace quite heavily, so we
  p# leave3 em out. ûns = {**self.curframe.f_globals,  …_locals}A õ if '.' in text:  z ð# Walk an attribute chain up to� ð last part, similar KwhatK 3rlcñr does.  This will bail if any ofY  T Œs are noL  si_– àaccess, which V §hat we wan. Õ �dotted =ð ¹.split('.')¯ :try : ’obj = ns[C I[0]]5  $ 1for Q' ^1:-1]N  . R 0get`Q(obj,= 
Œ ôexcept (KeyError, AŽ )\ Šreturn [  €prefix =ñc.join(¢  ¡ 0) + 	Ñ G 9 @+ n à nÝ  ir± )¶Än.startswithT F-1]) Jelse§ 3# C  a:1pleÛ !‚ y Žns.keys(z  Á1)]
Ã _ mt�definitio…òcalled by cmdloop(là# The argumentAðthe remaining str !on›1com[ 2lin¤2# Rr@true šexit from0 2oopŸ sdef do_I  s(¿,€ Í4"""  ¦ [bpnumberS†(com) ..1 1end ?R(Pdb)r   àSpecify a listia  Ø²breakpoint m  v d  '5 ’themselve¨ƒentered &`follow7 (sD 1ype„ sne contd just 'end'B�terminatõ s E h= ˆ~ @xecuÚ2whe§Ð vis hit. ToÞuove all_ ³&a : 0, t® €  Æ^á ð it immediately p end; t„pis, givÆg ˆ uWith noj „,. q refers!heqƒ © 8 seà ·You can useÎ T 1to ´õ your program upZ �again.  SkyH   °5inu|‘, or step	 a¿EtherG 9‘resumes e«7ion	œ / F 8 3   4 ± (currently> Ž ,p ‹ qnext, r”q, jump,a ¿ ’±ir abbrevia #ws( 000(asî×  5was| Àimmediately ó"followed by end).  This is because any time you
  ð$resume execution (even with a simple next or step),@ E mayD õ)encounter another breakpoint -- which could have its ownA ócommand list, leading to ambiguities aboutL  ) 5 toA ¿ 5e.
 !If§  ø Ôthe 'silent' k 0in    Q , UusualG smessage} Pstopp› Hat aå ãis not printed|E øay be desirable fo#@s thQ  reó D  {vpecificF ‹  nd© ðn continue.  If none of  …Ü sB [ rnythingÈð will see no sig!atE Ä&waE …reached.V 5""" iˆ et arg:  iõbnum = len(bdb.Bõ.bpbynumber) - 16 JelseD :try Y …int(arg)?   nexcept4 Ðself.error("UÞ:0s [ª 0]\n@   6... Jend"c  # VreturÌ^ {_O 0 =  œ 0# S old definixs“!asÉ°a keyboard VVrruptv!ifU I in r 
ï Cold_Œ ™_defs = (/ ð ,œ  Ñ  	5 Ÿ_doprompt> #‹< Oñ½  ENone¬ 	” O _ = []! µ o = TruM _£ † = False\ý r_back = 
z  º = '(com) ' ˜s™ inV“ ññ wmdloop(:è# K.IŠ -
«# Restore yT ù if  	5
H  % ‰ µsz°&[0‹ 6   	: “C 1C ªA 2A f –  de4lf.”Ô ° $   ( Â 1 ° 	/ –'‡  �Prted,ž¯Às restored')#
  …finally:   þself.commands_defining = False+ ’prompt = 	 a_back
' ”complete_N 0 =   ‚bpnumber, Ðdef do_break(ƒ ö, arg, temporary = 0)ª P"""b(- ð) [ ([filename:]lineno | function) [, condi 1] ]œ  ê pWithouti ñument, list all ˆ "s.œ , 0 a ^  ¸ 7 Rset a4 ‚ at this* Vin th4€current ® 0.  € % a©  Á -, M ue first· ¢executablee uof thatH  .  If a seö § 5 isC Apresñ Pit is,  tråpspecify Pan ex( Øsion which mu‡ ðvaluate to true beforeñ Apoin_ whonoredN#Th¼ Kðmay be prefixed withiÖÕ and a colon,Å 3to ° }r ‘n anotheriÐ (probably onŸ aKðhasn't been loaded yet).  ¢  § õ searched for on� ‘sys.path;ô ³.py suffix Ï Pomittø  A  5"""= Qif no|Õ $ 0if ÿ.‚@:  #Œ @re's[PleastÈ H  4   5 ðmessage("Num Type  ýDisp Enb   Where")B  Þ °bp in bdb.B]QR.bpby©
« Y �   if bp  # 	š Úbp.bpformat()„ Vretur^u# parseÀ1s; H° has lowest1fcedencd#-0can^PoccurÒ  Ë _õ  f = Non?  á,no I* � =  –.find(','Ñ #if® :> 0Ø ²stuff after+ 0: "h §( B   j [v Æ+1:].lstrip(s  *  arªQarg[:* <].r' 
€ µ- /: H	;‡� ".rú :ú  x kDllon >=�» ?lon»   â 2f =!Ôlookupmodule(B 
df� F ”‘error('%rŠ´found from Ù1' %C Ï 
Z  D °  Nelsem � E = fF / ®T×+tr¥ > «zint(arg¢ ðexcept ValueError:
          óself.error('Bad lineno: %s' % arg)
*  ereturn Uelse:  & ó# no colon; can beW ¶ or functio@  2 :tryC   ‹ } = int(Š Ðexcept ValueEÀ A V  Z  „ p = evalY ,¾  !  &ÿcurframe.f_globals9 ~_localsRÌ Á  ‡ ¬ =arg¦ à °if hasattr(? P, '__	 O__')f j  ) .0 t  ) acode =Ê0.__ /__) ñ#use co_name to identify the bkpt     $ sF PcouldFÅaliased, butX Îis invariant[ °  Ò  _ 0 = ­ .’ m u* Rfirst 1 Kfile]  0 è	À# last thing,=try@  Í T(ok, b �, ln) =   ¥ @infoÓ	Ÿif not okJ ñThe specified object %r isG a½'«  ¯  b'or wa< ÿfound along sys.path.rE z   ä÷ok # ok contains ©  ª¬  =#nom&ln@4r
: ƒÆdefaultFile(C õ# Check for reasonable breakpoint’  † L c4   (f ,GZ !if 
•  @w seMf  g  14errj Aset_� j À, temporary,N!d,ò Dƒ  L jif err†   M:err4 7 2 $bp• g• s– U)[-1]2 5   k ¥message("B[ý  %d at %s:%d" %8  <  ð (bp.number, bp.x	  †1))
= @# ToŒòoverridden in derived debuggerÊHdef  ¥ �È"""Produce a3 A."""s     Œ  y�ªŠ4 %if)ð == '<string>' an÷d self.mainpyfile:
    lname =( ' treturn * 
 pdo_b =  Break  complete_b E = _ �location=   C $  % 0def_ tL (Å f, arg)À 2""" T [ ([  ð :]lineno | funcu  ) [, condi 1] ]a  Sû Ñarguments as o €, but se ¢ temporary •point: itE ðis automatically dePd whe8…rst hit.1 5"""  Ù .G‹(arg, 1)Oæ PI  , ö Cinfo+§identifier2öfailed = (None,  )H  ¶# Input is D õ
, may be in single quotes7 §idstring =7 ¦.split("'"` tif len(0 f) == 1Õƒ ?notk  # iÆ D @[0].~ &p(g /eli 3i Æ dÆ [ 1[ sF#_M 0if § o= '': # Qparts3+6'.'Ä q# ProteÄ÷ for derived debugger!f L 0[0]Q'W'í 5del$ ¤ ñ ’@ �09  $ ¿ �# Best fiãpguess a Æle to look a(fi·defaultFile¶´‹ nitem =Ç ,el“ñ # More than one3 ‚ Ó 1# F¸ Ðis module, se& û¶method/clase 6 f* Þ "up: (± 6[0]¼ , Nif fKf…Ú 1¢äanswer = find_Ò(	!, K t ¥3 2or ðN $Pcheck)%4 ,  'no+@"""C.  Å�ther specPd, ` seemsæâbe executable.l  ý R7`Z  `  V0, 0  â°(e.g. a doc¿ ng¦m‹u, blank" E ð or EOF). Warning: testt0is P  X–rehensiveío@# thñßp shouldØ ¹ Á @ bef8Astar[ kiœ 3so ¶˜ #À"no globals"Û  /eEõno current frame7  £ = getattrŽA'cur 'šÙ ^  ' 0.f_ 0alsm    Îc À    line = lðinecache.getline(filename,  Ãno, globs)
  aif not :   ðself.message('End of O '=  ( …return 0=  i ! =R v.strip(1 ñ# Don't allow setting breakpoint at a blankA U Dif (¨ P or (f å[0] == '#') or,  – ! ":3" 1"""$ U [ o"'''")ö  �error('B‡ ¯or commentù 
 š 1no
� àdef do_enable(SW, argu 2""" µ bpnumber [
 A...]H  Ó EE Ws the2õs given as a space separated list ofC il %s. 5""" `args =ª g.splitÂ€for i in s<:try  ¶ Pbp = ù  “R_bpbyz &(i ( Ðexcept ValueE€ Ò >errR M £;errF >lse2 2bp.dÈ  t   N ç ©²d %s' % bp)ÇƒcompleteÉE = _ ­* ñ0disI ò óDG ô="  Y  |aLõ means it cannotQcauseyñprogram to stop execution, but unlike clear^ C {,a Premail nW ©Œ Ps andˆ 5 beE R(re-)ËdºÕ,»Óe¼I ½PcondiÔ¿! Á ± SeÍEnew   ?
Áõ, an expression whichòÐmust evaluatev¢true befor‘Xö  is honored.  Iö~ �is absentu ay exis�	" åremoved; i.e.,Š 
¶  m umade un= /al”f' ', 1º9 S €6s[1Q$QIndex$ëÀ         con£d = None
  Etry:   õbp = self.get_bpbynumber(args[0].strip())6 úexcept IndexErrorQ L e Ò('Breakpoint V ­ expected'P QValueP o as erW 7err> :lse� `bp.conú   ·  í pif not  
4   ¹ ymessage» À%d is now un; ò itional.' % bp.Ú ’  L e–   
b 1NewŠ O ¦ set for b3,%dc Í •complete_Œ E = _ "bp‘ 
- àdef do_ignore(� f, arg)ÿ 2"""  : � [count]A  ¸ ƒSet the (  ­   Xgiven·  U.  IfB 3 ¾is omitted,P !is‡to 0.  AR F ÿbecomes active whenH €zero.  W  @non- ,F  µ � ñdecremented each timeU ‰@is r %edE ?and&   ]�disabled # Çany associat> ºõevaluates to true.c 5"""  �  =ºv.split(oÒÜ R= intÅ1Å ç9 0w \ .Â×!= ý  "if J > 0- 1  " R ðstr = '%d crossings; 	n  2 :  0 L 1K 'B  å.ÈDWill¹§next %s of^ gG  s  (} ,ò„ ( ¹ �  Qstop ‹ lhik.Ú  g  	|¾ Ñ_clearô
cl(ear) filename:lineno\n [0
 F...]7ðWith a space separ[ listƒ31s, ’ Í  è Wthose«sÕ`ithoutu¸4 B all* Ðs (but
      ò0  first ask confirmation).  With a filename:lineno argument,
   ð
clear all breaks at that 2 2 in  H .4 5""" `if notY :  Z :try   ûreply = input('C| I? ')E ÿ except EOFErrorQ I'no': j  ú .strip().lower(d 1if %  ì Î('y', 'yes')m ðbplist = [bp for bp5 Pbdb.B<ùpoint.bpbynumber if bp]˜  Qself.xR_all_x–  ( c z ’  & N ú
message('Deleted %s' % bpì ereturn‘ `if ':'Ä :arg^ ñ# Make sure it worksô "¹ ö C:\foo\bar.py:12 ” 0i =›.rfind(':× N –& :[:i$3arg Ji+1: W «!noXZt(argõ E_ValueGâerr = "InvalidûÄp(%s)" %Ï 8 ã Jelse3  #–4getÞó ,] Kno)[Ù  > ‡ ; f= (< 	‰ _if er G e7K(err½ pNSE—arg.splitú ‚ i�* 
dÿQbp = ï q€+(iö N	? as<5 µ�  ä) ¯�do_cl =   Ÿñ# 'c' is already an abbreviòš±'continue'
!@comp_— E = _ 1loc8 ( % & 0def� `where(Å ,&P"""w( uðPrint a stack trace, wšòthe most recent frame{†e bottomoðAn arrow indicates @ U"curr= ò", which determin& ¼  x bext ofy âcommands.  'bt]bn aliaèSthis % ‹ ú  .pã _á _á ÎBdo_wÂ2‡ @do_b?   )§ Y�_select_^aðassert 0 <= numbeór < len(self.stack)
   ýcurindex = number �frame = / C [ : O][0]5 t_locals< 1curL #.f 
6 aprint_a g_entryµ r Ä álineno = None
V ‘def do_upE q, arg):  ý æ"""u(p) [count¾ ñMove the current °  & ð (default one) levels up in3 \ Á ò trace (to an olderL %).) 5""" "if_TV == 0°  ´ tÃerror('Oldesž ' ' ereturnY :tryG Ì æ= int(arg or 1B Ðexcept ValueEl 
= „ rInvalid× #a%s)' %nƒ –  #if1 <æ 2newt5= 0B Jelse‰ ' kmax(0,?-` Ù º �_select_b (D %  -" =4	C2dow?E _d(ownG1 e IO newH0+ 1L
MZ?NewZÏO - 1l?in(=  ~+~!d~ 
	€_untilÆ‚nt(il) [ÊpWithoutŠñument, continue execution [  ½ ? u with a
Á greater thaéðone is reached.  t ! aL E ~ 0 | ƒt F °or equal toˆ tx ÷In both cases, also stop whe
×+s’:arg)M Û ;}RO    Q # t 	1arg¸O: %rR : Á &  ðif lineno <= selûf.curframe.f_lineno:
  ðself.error('"until" , ý number is smaller than current 'J Y 'B -')* ereturn Jelse™  ? •no = None( « Aset_§ ( â ,µ &nom e ! 1?  do5 2 = 	 2il
  ef AstepO f, arg)Œ †"""s(tepV µExecute the ® ‘, stop at öfirst possible occasioò P(eith]Àn a function`tpco`d or i i ³  f2 %). 5"""  (Ø ¼ s & 	OnextVn(extS ¡Continue e Æ � H —È ò ² ’is reacheö "t « sà  a © éš B ÿní  3 	í 1runC û Õrun [args...]¬ bRestarèðdebugged python program. If a stringÒ…suppliedE iéñsplit with "shlex", and=Qresul& qused as 5newD ñsys.argv.  History, breakpoints, aWsS ª @r oplsF òare preserved.  "rà "¸ ÿan alias for "run"’ if98 ¥qimport Ø n    ´ D0 = À F[0:1_ " :tryL   /  :  ,.>(±	_ Ðexcept ValueEØ <`P ùpCannot ñ %s: %s' % [ F, e)T 7   \	v ž `[:0] =%v0! `# thisQdcaughtUmain šEloop3 craise l±#o_œË3run Æ– Í(uÍ »
æj‘ƒ “rÈ ™ 	Ë cWÍ `c(ont(yžÑ b, onlyš0whem! �¿encounteredÙ RŠnosigint›¬âPdb._previous_7 P_handG5= \ç N rsignal. ( ‘.SIGINT, ‚ 
I Ë B ÷ÀValueError:
  û)# ValueError happens when do_continue() is invoked from
G ô # a non-main thread in which case we just U � withoutK  ðSIGINT set. Would pri‹ ÿg a message here (once) makeH  msense? Epass ‡self.setí  �return 1  $ =
  !
"  ef Pjump(W q, arg):  0õ"""j(ump) lineno ÁSet the next õ that will be executed.  Only available inD  @ ðbottom-most frame.  This lets you œ ” back andY D âcode again, or- ñforward to skip $ Ÿ  P –don't wanÇrto run. ÷ QIt shÆ‚be notedß qnot allg Ps are µowed -- for— °instance itˆ 8 Ppossi!to@ Q intoDµmiddle of aA €for loopÕ 1out õ finally clause.- 5""" 0if Éñ.curindex + 1 != lenâg.stackã ð 2 eQ°('You can o¸} ö#"e ¯ª%')u  D z 6tryG   Parg =õ (c( gexceptÓ
6 š `"The '’ `' comm¢requires a…vnumber"š JelseR ™  � 2# DŒ _ ð, fix up our copy~ ­;,ˆpdisplayÀË  I   Ö# new positioï    Ó 2curï"f_Z  ={L - x [ ×2] =è 1[0]ÉN ™_8 g_entrye H ¹ «K as ^ ( © NòJump failed: %s' % eV Bdo_j“ t|d�Qdebug– Ç ­1""" Ôß ñEnter a recursive % 2ger·Pstepsã@ough³
? ¢argument (üðis an arbitrary expressionŽQstate/ Fto bÄó D -@currU penviron2 )³0sysÏ“trace(Non! Ktglobalsí6 ?loc)  _ & qp = Pdb\Ô.completekey,MdIÁbstdout¬ ‹ òp.prompt = "(%s) " %6  v.strip(1 F û÷("ENTERING RECURSIVE DEBUGGER¯�À         sysó.call_tracing(p.run, (arg, globals, locals))
  �except E Eion:  ! öself._error_exc(8  ÷message("LEAVING RECURSIVE DEBUGGER"3 `ys.set¡ !e(@  —_dispatch*  w Ãlastcmd = p. 
� õcomplete_debug = _ ¢expression+ ±def do_quitr f, arg)ä ñ """q(uit)\nexit_  ø áQuit from the h õger. The program being executed is aborted.G 5""" ñ ñ _user_requested™ z = True) 1set rƒreturn 1Ú To_q =Ý = 0do_Å   ?EOF1EOF*  ú qHandlesø ÿreceipt of EOF as a commanä 	+''Ñý 8Ó OargsÔ Va(rgs� QPrintÕ Áargument lisÛ  â@curr �functionÃQco = Èæcurframe.f_cod¼Ldict$ _tbón = co.co_argcount + dkwonly 2 #if  ðflags & inspect.CO_VARARGS: W ?n+15 KEYWORD9  ÷for i in range(n/ !EnameÂ 0var Es[i]y  % 0if   F  q    F*À%s = %r' % (8  , 6 [ ]¬ 9 OelseO ö*** undefined ***^ S Bdo_a- IWZoretval\ ñ \£`value H \ ¼  _of a ebif '__0 0__'C-sO
" OArepr» .4 [Y YUQ ø“('Not yetÄ 3ed!ÙRdo_rvA t/_gA:try½ ì   er®} ¼ 5.f_¾	 	äË
\ 2 Á MVraiseù¶  ê'ep1!, íW=NoneÉ "if)   , 
‹ q Äë . L µÀ
             öreturn eval(arg, frame.f_globals €locals)
6   uexcept:  ñ _info = sys.exc j()[:2]* òrr = traceback.format_U ¤ion_only(*B Æ)[-1].strip(ƒ  s Á ñ_rstr('** raised %s **' % err)
|  def _errorh f(self)À k ¼  5 .D (½ #Œ Ámsg_val_func� ", „7uncš 6try§  ô 0val¦ ƒelf._get¼F
4 (4 # 3 ð) has displayed the-!or- h y þ �message(¶ Oval)y 4 wFdo_pø ò õ """p expression‘ QPrint© �value of * .+ 5""" ƒ 	nh8rep � � ‘ oetty-p˜ ;pP ".p1‘complete_ E = _  ó  p& ' N  6do_list¬òl(ist) [first [,last] | .]y LñList source code for½ðcurrent file.  Without	quments,†  C  ƒ ò  11 lines aroun¶C   Á or continue` ‰previousG 3ingl @ . aM gn /, e G n° E one± C  starting aº!at¿ ¨ ð E two@ sA  �âgiven range; iíesecond‡ "arº Ñ is less thanù Ž@, it †a count.‘IThe 9i7  	 ; öindicated by "->"½ bIf an o0ion.  beì ‘debugged,Š ˜Awher’» 8 äwas originallyÃ‘or propag} 8is Š F P">>",ñ it differs fromz Í  ‚ ·  ±pcmd = ' ']   u = None  if¬A and j!= '.'m9 ¿�if ',' in7 
0     ³v Öarg.split(','e )  1 q = int( $/ Ðlast = int(laßst.strip())
   ÿif last < first:%  8 ÿ# assume it's a count. T =T ! +c , Oelsep ‹ ¯ = int(argÂ - cmax(1,s :- 5ð þexcept ValueErrorz `self.e !('# ð in argument: %r' % 
Y  ereturná Qelif N ðlineno is None or@ z == '.'� Æ > ³curframe.f_I 	× @E > 3 5+ 1™ í� 
‚ ³%107 ¢filename =Ö ˜ „code.co_# 4 ”breaklist5 1get& _ $s(2 N;try’ pines = Ê �cache.get > ,’ vglobalsW  ¡a_printK!s(G [10-1:ü ]<!, ¢  ¼ ,Ï  E  W r   e �no = min(d R, len| � › ! <2
  q ö message('[EOF]'x äûKeyboardInterrupÕApassØ pdo_l =  Bist
 !ef 0ong(q ,µ)� C"""l  Q | ll9  ž Lïðthe whole source #P for  ðcurrent functionäF 5""" %El0.f_W zK,yÀ2getÎ  Òs.Œ €"OS>[as erh Pd6err;  ?F+ ´– §
V  ×ß®	ãÐ Ë á  ¦ expressioÝ¯Try to getáõgiven object and display it.×ãö4objïp_getvalÕ  'æ�  ;T ·:  =¾ â  L(obj` # (ÇR, Typ3/) ÓK)¡’complete_£ E = _ ‘NIdef $ðself, lines, staórt, breaks=(), frame=None):
  õ"""Print a range of lines."""& "if> 8  ? €current_0 Bno =$ #.f >  , 3exc £ = self.tb Q.get(� U, -1)7 Oelseq 	V %-1; 1forÆ 1no, à in enumerate(° ‡s, start § sž !tr# ¶no).rjust(3•  % Úif len(s) < 4¢   …s += ' 'Ž    4 Pineno‹ •: B:  P e :== žm ,->n ª 6== aA >A Üñmessage(s + '\t' +‡±.rstrip())
àdef do_whatis(: W, arg”2"""   4  ý ²qthe typ³  •argument.( Ã:tryÃ Pvalueï �€_getval(~ ? jexcept6 $# + °) already pA0ed … UerrorB  ­ ereturn 0codv  ‡ õ# Is it an instance method?$ À I Ç À.__func__.__ %__8 Å ! EÌ :ionÏ Epass+ 0if = 
"  –.Ð!'M– a %s' %- Š.co_name"ô à  ¦ OtionØ  ’ Ï F@Func� Ñ 'VclassÎ 4if ‘ Q__ is¦V	CE B %s.X(C •module__,U @qualo?__)r a Í •vabove..	Õ Ds ˜ƒcompletešE = _ ©expressionÄdisplayÅ & [? ]@  #D= Aü ¹ . 0 if" ch¥ðd, each time execuÅÈPstopsh ü œt †Without c  +tst all ¯   s TQ   À   l`if not³ö
?$lyo Zing:'× u @itemÎ µš 1ing7 3cur?à{}).items():
   ôself.message('%s: %r' % item)
, Uelse:   aval = > ö_getval_except(arg9  + % ñdisplaying.setdefault( ù	curframe, {})[arg] = valp * ¨ N  °  w ,6 1))
9 ”complete_, 5= _ ¢expression- “def do_un- ™  , Ë ÷ 5"""! & [C ]D  ë sDo not F V the ( Á any more in �current þ .F wWithout; µ, clear all] Y _s forR  “   1"""   if× Ö   :try   2delàÎ  »/ge´a  < ž KeyError] Ïe '('2`ing %s€ {S @ ™ 1pop´.MCNone ßüÄ1 ö, text, line, begidx, endidx)¸ ‘return [ekÂƒ Ä    ðif e.startswith( )C ¨ ¢do_interack†   2SP D an   iv¤ õterpreter whose global namespace� �containsa ¶(+ ¢and local)6 l foundÁescope.N o�ns = {**.�2.f_` ;s,  _n %s}M Tcode.× 4("* bive*",� 7=nsêƒdo_aliasà JÉ1"""   [` [commå 0[pa„ ,
 u...] ]]Œ `CreatehD €called 'K P' tha´ƒecutes 'Z h'.  Thkq ñmust *not* be encloseZöquotes.  Replaceabl? � Ps can; ðindicated by %1, %2, Ó õso on, while %* isÉ rZ 3  T óZ “.  If no Ã   is given,eE ¿ ƒ  - cshown.E  B &alÙ: ×es are listedAÄ`es mayç  ne  Ù  ù ² T th7~  b-ðlegally typed at¿ ö pdb prompt.  Note!  You *can* overridD p1nal8  s » ¿ !á _+ ' + á ñthen hidden untilŽ D  4¡removed.  ù  Ó 	±ñcursively applied toB Ñfirst word of  Ôð; all
        othóer words in the line are left alone.

  òAs an example, her- õtwo useful aliases (especially whenD dplacedp Ö.pdbrc file):i ð	# Print instance variablY õusage "pi classInst")_ € � pi for kg ð%1.__dict__.keys(): p^ ×("%1.",k,"=",& 6[k]P Š |in self{ s~ 	 6"""% örgs = arg.split(k õif len(args) == 0:6  € ¼   = sorted(a .í #es× J  /       < 
N  # D 0mesQ0("%˜ q%s" % (9 ,ß e [ *])f VreturÝ ifÚ @s[0]v ` 7 e9dß 1‘ - �  rgR �  ‘ OelseU  ‚ [Yâ[0]] = ' '.joimR[1:])|‘def do_un4 e,Ò )W 3""" U name£aDeleteEúBfied.$ 	& h©  â;delÅ6ï  coÍ+teõ Qtext,÷, begidx, endidx– 1 [anaô À.startswith(U ")]| Ñ# List of all7ñ commands making ò	program resume executionT2 _  4 ð= ['do_continue',  Cstep Cnext ¾ %',Ÿ 2	  < 4qui1 Ujump'¿ ¢Áa traceback ê  † !at½ 0top ‚ck frame´ ò# The most recently entered' A is  �ed last;  `# this ðdifferent from dbx and gdb, but consist!  u>  e Python in ƒpreter's¡ Å ¡  Ith LalsoM × „up/down ~p (which7m  Tpatible ƒ ¤ ð : up moves towa{ƒ'main()'=  Í ` 
&  ž6¸ Y)£ ¾:q_stack_Õ Å´:try$ )G _ý%noÆE 
,  ©g hentry(C $ðexcept KeyboardI{JruptW BpassÃ \  s ,¥ ð, prompt_prefix=»  ì ” ÆCno =B Àlineno
     ñ   if frame is self.cur 7:
  Õprefix = '> ' Oelse(  ( Y ƒmessage(K +F g  „ ñformat_stack_entry(” ò_lineno, prompt_K 1))
L â# Provide help pdef do_ († f, arg)´ ‘"""h(elp)B  Š pWithout( Pumentm ùint the list of available commands.@ $ a   n\-asO  ’ 0 abj Dthat0 H "" ¡pdb" shows� Áfull pdb docž \ation5 ±exec" gives1 on> !f  %""º Qif noù   þ return cmd.Cmd.OB :try;   P ó topic = getattr˜'ð @_' ++� 1   … < ( úexcept AttributeErrorˆ  B «y .dow T  O .el B('Noišfor %r' %Å (þif sys.flags.optimize >= 2¹ i ±; please do»÷run Python with -OO†  Ä'if you needÊ Ã 9 ˆò    Þfô.__doc__.rstrip(¤ =$ =“¤ý ¸
¡�(!) state�z qExecuteÙP(one-) " iõacontex· ÃucurrentG dÑ.  The exclamY0 poûñcan be omitted unles�F  first word h ± ô resembles a debuggerl s oF ñassign to a global varii ¦Âmust always ûþ sG û2a 'C 'l f, e.g._T(Pdb)h  Ú_ˆAons;è • = ['-l']` 9  "B	
Ê.Ù‹ or '').!efxA_pdb9  C (äQother, per funcsJÁlookupmoduleJ `, fileˆT w"""HelpC  ¼ñbreak/clear parsing -- may¢verridden.p  þ	p ñ) translates (possibly incomplete)�  ¢  L inüpn absolÝ º # ãpðif os.path.isabs(0 ê U and  Sexist Àame):
        ñreturn filename
 ò   f = os.path.join(sy E[0],/ )0 5if 0 ðexists(f) and self.canonic "== `mainpyy :F  ~ ’  —root, ext“ �splitext(@  ¹ 	Š , J= ''Z , % =Á … + '.py'm %ifÇ Visabsa 
L ¦ 8`or dir“ D in 6
= Wwhileh Slink(6 )+   ÿ Iread0 »  + Afull| ¾C º 7 ö ½I �  û " €  QNone
 ð def _runmodule(	",  _¥ \   ¶._wait_for_f = Tru˜) ðuser_requested_quiFFals* Áimport runpy�  é 1mod{ ˆ Ò_spec, code =) c._get_¤ ƒdetails( ³ J ‰ 	¨  é U D.co_t ˜ _å %__Q  ö.__dict__.clear(: " …update({E  ä !"_ã d__": "4 ,",$  š $ ¸ Ê ) qpackage,  @ 6}.parent, jloader+  +  G 	) " �builtins& &__ * }Ç @run({)‚cscript‚ ù Ìjb# The & p has to ÂA 3 ¢space (or ^es fromZ%# . Æwill break).  
 q So we ãv up the= 7 t several +×ial variablesH ñ(this gets rid of pdb's globalsƒ f fns oldC Ç on restarts£ Ø ‹ i Ù ž!‘ Ÿ•   !"_E0__" :»   "68":  @ }G ] À# When bdb smðtracing, a number{Acallrøline events happen´ñ BEFORE debugger) � reaches Ü"'s–(
 @exac•quence of™#>  ts dependsØópython version).màtake special mÃeasures to
  ÷4# avoid stopping before we reach the main script (see user_line andL  õcall for details)." ð self._wait_for_X Úpyfile = True) 	 ; €canonic(3 Zname)1 _€ örequested_quit = Fals[ öwith io.open_codeN u as fp:U  $€statemenI ð"exec(compile(%r,  ' ‰'))" % \<  @  Á(fp.read(), Ì Þ Æ Erun(v Ð)

# Collect Yñcommand help into docstring, if not run ç ñ-OO

if __doc__ is  BNoneæ ð # unfortunately÷ñcan't guess this order fromñclass definitionò _� _* 1= [  ú ' �', 'where	 @down  up Pbreak	 t
 Pclear –disable',N "en b 'ignoQ Acond‰  4 s 1sted @next XuntilN 1jum! Qretur• `retval- !ru qcontinuº 1lisH Blong ™ 1argt P p Qwhati QsourcC pdisplaya %un G qinteracg Aalia? %un Pdebug>  ÚË !]
@  q_ÿ G in ’ë �ô	+= getattr(Pdb, 'do_' + A #).* .ZÁp() + '\n\n'l  € += Pdb.ä_6 ’ 8del† ,^ 
Ô SimplifiedÆ°erface

def¾  , globals=µT, loc )Ø iPdb().55 0 )Z õ eval(expression* _  è f A k ?ctxÈ  ( ¾ `# B/W S‘atibilitycÐ  m (*ƒ, **kwds¸ )  ñset_trace(*, headerH Apdb ç(§#if% M bÂpdb.message(M 7   j ñsys._getframe().f_backì¼Post-Mortemapost_m ((t¤ p# handl¿ ¯qdefaultH@if tª  >r ¦  # ‚ ²exc_info() .ñs (type, value, š  Z€an excepõ1 is_ M  be{ „ õed, otherwise itZ  � 3  M
‚ 1[2] °  raN V– €Error("A¤ &id£ Ð must be passU ð  "
              ð"exception is being handled")

+ ’p = Pdb() e.reset pinteracB ò(None, t)

def pm():4 òLost_mortem(sys.last_traceback)


# Main program for testing

TESTCMD = 'import x; x.main()'l  - n Crun(4 )Z ¡print help—  	 + iP Rpydocª  
 ñ.pager(__doc__)

_usage = """\
 ñ$: pdb.py [-c command] ... [-m module | pyfile] [arg ö

Debug the Pythoõ ƒgiven by5 ô. Alternatively,
an executablec por packŸ Ato d\ ðcan be specified usI s ô-m switch.

Initial¾ ðs are read from .pdbrc À ðs in your home directory
and  Z vcurrent @, ifç ²y exist.  C'ps suppl™ qwith
-cz Ü †ed after– � �.

To let^ ñ script run until 'ÔÑoccurs, use "ª�ntinue".D rp to a �dline Xã ^1gedT 
T 'x rX'"."""�m�þebgetoptSÒopts, args =  .  ðargv[1:], 'mhc:', ['·C', 'l3=']Ÿaif notM p ´ ô(¸¸   |cexit(2< M  † ![]‚run_as_mÁq= False  ”°opt, optarg Ç t  if   @['-h¬ !--¶ ]$  † �œ     ³ )elW cW ¸ 'Z  ’s.append(ª M m@ ý BTrue± ÐÌ! =k0[0]² d # Get… ,2nam0˜
T  1 ®�os.path.e&s(_ 2 \ (`'Error% q, 'doesøB 'ä D1ä ifÕ�™Qrunpyã v 6try"    @._geÃ ×y_detail¶ ? O$ EV
L ô.Ý C_excI j   ¿   #:]{ ' ¢  # Hide "‡ " Z0pdbƒBionsÄPargum–3lis{—¥ d4 = ¥@real®§ñ �# Replace 's  ×  in‘ Tnt ofºpsearch Y .N  î    _� 0dirW	€ 3 ð# Note on saving/restorÅ J  8ð: it's a good ideaò@ when sys.argv was
    # modified by the script being debugged. It's a bad ideaO 'itI VchangH ‘user fromV ðcommand line. There iQ £"restart" # — ôwhich allows explicit specification of5 X ± arguments.E ´pdb = Pdb() ó.rcLines.extend(t s! ±while True:1  !6try   ÷ if run_as_modul+     ‚pdb._run  ²(mainpyfilef  #   ?els= ‡= 1if g  fú _requested_quit¯  j UbreakÒ   ðprint("The program finished §ƒwill be �6ed"¼ ‚except R¸
n X  fing",  v, "with¨:W — ô \t" + " ".join(µ][1:])ˆ ŒSystemExù ö# In most cases ( € does no½òrrant a post-mortem sessionE —   Ú 2¡exited viaX  @(). ‹ ö status:", end=' '¸ N  Ù Öexc_info()[1]% eºSyntaxErrori¡traceback.™ C_excæ _   ] Lit(1V J b ²("Uncaught œ  "` Enter) @ @5 ýz  ’ H @Runn3 ð'cont' or 'step' wur5›%3t =p:*2]Þ@db.iš  ac(�(None, tŽ P"	¹  ·.ª �Å) +l  Ù 2  "½ 2P

# WwPinvok[st",  í 6ser on a†ð
if __name__ == '__‰ 2__'Ä`import
”     Ð()
"""Create " ñ
able serialized representHsI@PythS@bjecA@
Seeðule copyreg for a meê1ism Sregisøcustom picklers.D  Átools source? ˆ0sive m¼¡
Classes:
Ö PO  "UnH ar

FunÞ' adump(o¿ &, n  s p) -> st±N Qload(+   <  qs(bytes4   
Misc variQy P__ver1!__= dformat  ²compatible_  s
¢"

 Sypes Ì× BType ~!  dispatch_t… # _VÀon_registry,ó2 _inverted_registry, _extension_cache
from itertools import islic Ifunc ƒpartial
, 2sysF %sy@ cmaxsizA dstruct[ €pack, un C $re
 $io
 dcodecs ñ_compat_pickle

__all__ = ["P ‚Error",  5ing !Un6  3 Vr",
  ") eG @dumpO   s	 Dload ‘s"]

try:@ D› ç b aBuffer% ² ‚.append(§ e! "")# ñHAVE_PICKLE_BUFFER = True
except IŸÚ { _3 ð2False


# Shortcut for use in isinstance testing
bytes_types = (b  ,  `array)K ðThese are purely informational; no ´ f 0s t- ".
! @_vers† = "4.0"s
 `# File¥ Dmat / ’we write
ýRible_R  ¦ t["1.0",C   ñ# Original protocol 0[  
 L"1.1> P5 ÿ with INST addedE 2E ƒ 1> 3> ƒ 1ƒ BINFLOA‡ 2
I 2~ 35 35  Àtj 45 5j 55 ]¯‹   # Old$Òs we can read¦Ais i�† highest`number3 ±know how to; ò.
HIGHEST_PROTOCOL = 5Q eA ’ð	 by default.  May be lesx <an L ð.
# Only bump th£ f$@ old¢ �still sup~%edÀof Python alâ ùy
# includes it.
DEFAUL¶ ’4

class ƒ-!(E@Bion)8ò"""A common base 3  &¤the other 7 ~�ions."""±Ipassi _(w m Tô G  ¡àraised when an Ç�able obje1 s f  ed¥1thex  �±() method.
 ” Ì– ) e« aDblem¦ 0ing´ ¨ Dñsuch as a security viol§ “Note that_ s may alsoG0durg u½,ú ° ð(but not necessarily limited to)ó AttributeError, EOF
 bImport á
    and Index !.
 1""" ðjpass

# An instance of _Stop is raised by Unpickler.load_stop() in response to
# the STOP opcode, passing the object that]  , `resultt ua ¢ing.
class† Á(Exception):³ ó	def __init__(self, value  ó   . " =  ä òJython has PyStringMap; it's a dict sub| awith s% ’ keys
try€ ¡from org.pP q.core ivX !
e¸  �@ | p = None� P]6‚s.  See rðtools.py for extensive doc( ðThe listing
# he� s˜ðkind-of alphabetical ordern³1-characterg ƒ code.
# v p groups½màpurpose.

MARKk ò= b'('   # push special markoö‘on stack
8 0   ; .; Severy€ a ends ‡ 1 F
POP4 6 06 ò discard topmostf P item5 _ª  k 15 “  ; € through G » =
DU| 2G €uplicate7 z VFLOAT±  z F3  Sfloat£; decimal p·argument
INC ô IE PintegÏor boolH 8BINK  � JH òfour-byte signed int
4 1Ã  4 K4 11 'un3 DLONG0 ÙL3 Olong¤ 2@  p M= 2p  DNONE0 p N3 [ePERSID&  W P$ –persisten�!idœQaken ì– Q  N QN # "d    ;      qf
REDUC½  I RI Ðapply callablW÷ argtuple, both H'RIq D SD c· ý ; NL-terminatedcVBINSTH  E TE  @coun? mbinaryF eSHORT_L  F UF   ù   ;"   `< 256 ……s
UNICOD N VN Ù 0Uni«… r; raw-u  -escaped'd6E8BINQ  N XN  ”  • $; ê SUTF-8d M ZAPPENOaM Pappen`1ack!to˜æ below it
BUIL; øb<  îð __setstate__ or __’ð__.update()
GLOBAL      ð= b'c'   # push self.find_class(modname,  ð); 2 string args
DICTF   M dM õbuild a dict from stack items
EMPTY_>  8 }8 … Qempty; ƒ
APPENDSa  * e* ãextend list on_ £by topmost ˆslice
GE§ F gF p  • ¥ EmemoN §; index isõ H
BINO  ’ hL 0  "¨ 
   U"  ;  `1-byteAH
INS™  L iL @&•‹ö  instance
LONG_‡  6 j6 Î 4‚ -LI‚ lL ‚ _À
X 3ÈD  Š ]> Š È C @
OBJ  * o* h ê (PU¸p6 Sstoreäptop in ¼³J  } qG •¹¯®xL  G rG sxSETITEMsG òadd key+value pair toTTUPLE3  
t5 @RtupleÄ©E  » )? ©D 
Ÿ s + u+ Rmodif˜p by add	o 
¹ s(DFLOAÁ H GH s `float; `8’ P enco[ W

TRUõ ö `I01\n'°ðnot an opcode; see INT docs÷pickletools.py
FALSL  � ?I00K "ú
# Protocol 2

PROTO›A\x80¤ Pident5Ž # p8 H
NEW � A\x815 Òaobjecti@pplyk°cls.__new__2arg³FEXT1� 'A\x82M mL È8ó sion registry; “ï^
EXT2N 3N Âditto, but 2³4 44 44 4 Ž¸ 54 !1-à ×@Atop
9 £ 9 69 29 ;two½G 3¶ G 7G 3G OhreeI 8NEW©I 8I @Trueò„& 9& BFalsÝÌa' Blong±< 256 bytes‚^ b7 ðreally big long

_ñtuplesize2code = [EMPTY_TUPLE,  1 2 ò3]

# Protocol 3 (Python 3.x)

BINBYTES  õ-= b'B'   # push bytes; counted binary string argument
SHORT_K  E CE ! "X   ;
  	 #    r" < 256n 	¯ &4
] €UNICODE _ U\x8c'¦ Sshort– é; UTF-8 lengthY 3BIND 8Œ  J dJ “very longN  2 4 e4 .: ›2SETl : f: ôempty set on the stack
ADDITEM”: !90: Rmodif6 `by add‹`topmosýack items
FROZEN� !91G Àbuild frozen‚ _from G šNEWOBJ_EXÈ !92G Rlike # õ but work with keyword only+ás
STACK_GLOBALR Ï!93O ƒsame as    R  usá Ynames'‘s
MEMOIZEF  K 4K @toreÒ 6 of]× in memo
FRAM; e5= �indicate9 `beginn† éof a new frameª05

ITARRAY-� 6S Pñarray
NEXT_BUFFER¼ �&97- õnext out-of-band buffer
READONLY? h 8; 5mak÷ PP read†ð


__all__.extend([x for xð	dir() if re.match("[A-Z] ð
0-9_]+$", x)])


class _F@r:

Â _RÝ_SIZE_MIN = 4 òTARGET = 64 * 1024< ñdef __init__(self, file_write):H  d   . ' =' 
% �current_©v = Nonel Bstar 1ingq e @ @io.BFIO()H 1endb F  1if ® 
I  Æ ¶.tell() > 0ì ð Rcommi® Õe(force=True)ñ * õ 
	H  … ,þxce=Falsf» 
™ ?f =ß  	’ Eif fÙ . $"or† 
`  Ó @dataâB.getú(ô  % "� 	Š  (  if(T ?) >�  >MINƒ  :  # Issue a ‰¡le call to dmethodh­underlying† P  § p objectü I ¨!opÙ@àize of the
     ò!# frame. The concatenation is expected to be les lnsive
L   P# tha< Ðsuing an addiP pal callK owrite.@  ý(FRAME + pack("<Q", len(data)))
: ú# Issue a separatel  u ¢append theó E  ûcontents without!to> QaboveR ovoid aI  ¾memory copyç ã Ì Ê QStarti 2new« � 0 a  ðio.BytesIO instance s™ /at‰  î ðile object can have delayed accÕÛ ‚previousw P  "0viaÝ²unreleased ô qview ofÀ N H  Æ  )Ñself.current_§6 = : (	Bdef T 1 !, Z:u 0if  
I   µoreturn'  .X R Q Oelse@ Xfile_7 8 ¤ €_large_bÃ(˜ ö, header, payload)\ G " =™ Y R  ¸ Û €# Termin OáÐ and flush itÒ "  h 
Œ § c.commi‡³(force=True„ Ž Ð# Perform dirm¿ æ r é 'u binaryÛ #²0. BÌ�reful no¦ §eh[  Á _ K Ppriorà  � —'› ¡' as we doZ 1wan_ @allo1 a › I ¡temporary Á¤ " AWe iEtionally] óinsert a protocol 4„QopcodP6makU#“qpossibl ‘optimize ¡AreadäAs in <&erºã ()¢  #Ñ)


class _Una"r:“ °ƒ__init__§ w _w ,‚  Cline —tell=NoneÀ98 & =9 � 
#  P '   
+ À r ³  Ÿ Cinto³ 7bufŽ .nm	g .W  Q �  ô‘if n == 0Ù ¤ # V != 0Ç )   ì 	Z 1 = Á     ˆ M 	p  % dbuf[:]ª _&(næ '   ÙÀn n
        ð    if n < len(buf):
  ýraise UnpicklingError('  3 "$ ùe exhausted before end of frame")< …return n Jelse† 5n =  '  p ÿ
buf[:] = self.file_read(nc = Adef &  5 7, nó "ifJ �current_° 
Œ Ddataq 	' .T z  ]1ot 5 ªand n != 0R  É  ‹ .O q = None²  "  /1 ñ !if0 w ^) < nq ÕS � Â ØÌ 4 ¨Pline(ð ©9U 
&¬0 € ¡(o  @[-1]Žb'\n'[0]{ «‡Ö ®Bload4°,ð__size¼ eU)!' "beginning‚Ra new˜ œ~ ¤• Ñ = io.BytesIOê {3ó ñ)


# Tools used for "`ing.

áô_getattribute(obj, nam/ 1 ¡subpath in «.split('.'S' Ï== '<locals>1An È±"Can't get 6  Ž � {!r} on "å… €.format(À f, obj)`:try½ paa  =( 	[ Pobj =�  ˆ N zexcept Ê 
` 
" (ì  ^ tÞ æ +V from®ÖÌç ë®whichmoduléÂ"""Find the # 0 anòect belong to.""ˆ# _j-3'__ 1_',• 8#ifY À_name is notƒ None:
  ñreturn module_name ò%# Protect the iteration by using a list copy of sys.D ós against dynamicP  ðthat trigger importsB Sotherˆ ñ	s upon calls to getattr.K $fo' ¯ ,4 8 in† .š ¦().items()ñ Bif (Œ ? á == '__main__'a  h ) p, ß  # bpo-424069 1 iso  ] rcontinuj  6try¡   Cif _õ Sibute²  , ¡@)[0]Z :obj6  : Ð  ±except AttrU ZErrorB ApassË G ó
def encode_long(xÖ Qr"""E  0ong²òa two's complement little-endian binary stringÙQNote 0ß òa special case, “ |dn empt> ,q asave a¼ @byte º°LONG1 pickl:  zQext.
) 9>>>Ò !0) "b' 4255! �\xff\x00) Z32767+ /7f+ F-256*  00Y *  V 8, 8� 7-12* & '12¥ ¡ 1""" @if xû0)‰ 'npñs = (x.bit_length() >> 3) + 1I áresult = x.to_4 (;  ,  rorder='&â', signed=Trueõ Š ‚< 0 and : F > 1˜ 2if e A[-1]´ 1xff. ( ç2] & 0x80) != Ô   % $ =F C:-1]» $  
	&de	GdataD _from v  g 2b''	0 "< •"' ?255) 
#7f)  Y7+ ”+  ¯* 
$80*  V 8, ( /12& £ "12¡ –ƒ@int.aO ‰MT

# Pñmachinery

class _ 2er:$ öð__init__(self, file, protocol=P0, * #x_Ñ·,þ  Z pbuffer_ÙAback< ; $ ô """This takes a% q  ÷@writÇaÒ e ò  D3eamÔ G `The op°ðal *protocol* argumðent tells the pickler to use #
  õ
given protocol; supported õs are 0, 1, 2, 3, 4 and 5.E µThe default7 ð is 4. It was introduced in Python 3.4,K H i) õcompatible with previous versions.
1 öSpecifying a negativeƒ 2 r selectuhighestC û _ 0.  Ù 1 r5Y Pused, G �more recy%heN $ofî `needed„@read= ˜D p#á  � À*file* argum_ ð
must have a write() methoU Åat accepts aY °single byteÎH œ can thus bN  i õ object opened forG abinaryt 0ing»P io.BV õIO instance, or any other customD ^ �that mee•÷wterfaceü  If *fix_im’ s*R@True3$ *¸ 0lesÞ anŸîr €will tryz1mapy4new—p3 names  +¢old module G  ó¼a2, so Ç  7 t À data stream®  éEableE Ñþ2ë ñ buffer_callbackØ `None (a _2), ( P viewÍ] �serializd to=8‘s part ofû ª ¥ ƒ @not ‡ ïPn it 40be © !edêVnumbe( j iTï a² B.  Iˆ  ?  è ö returns a false valuÕ �(such as„ )…  ´ò is out-of-band;v+wiç- 	&4 `, i.e.À!id˜É$tÖÒan error if *Y 
¶3©iÎ  (Asmalš8hanR6"""/ fy; :  Çõ = DEFAULT_PROTOCOL( iE ?< 0A oHIGHESA  Pelif Ú F0 <=‘ <<= 3 
\  raŒVÕE6#("‚¶ Ð beW ]%d" %Q )Æ q ‘ –  £pW ?< 5Š L  £sÜ V>= 5"} lself._4 =ß­ :try� A  e_¸0 =  . 7  ex¿¡ Attribute6
I T2Typ  ("G Ð must have a ó'write' attribute")
  ñself.framer = _F
 ( a_file_< 0  1 = ' = . 
W < Ï_large_bytes4   
@ šmemo = {} @prot Aint( ;col¡ dbin =  Z >= 1D ‹fast = 0 �ix_importª f 6andO A< 3
9  def clear_« 6!):  ^@"""C ðs the pickler's "- "".C  ) @The  " i+ ñdata structure that remembers which object0 q c ò has already seen, soF ôshared or recursiveJ F $ar­ ð d by reference 0not õvalue.  This method isC ôuseful when re-using%s.' 5""" K .Q"() bAdump\,¬ 
aWÚ# a] ðd representation of3   tÿ pe open Õ.z p# Check® bther P©ò was initialized correctly.÷ ð Ð# only neededn Qmimic÷€behavior‹ _¡.b .Ù )0if `0hasªó "‡"ý  9Rraise± ¤ingError("^  __¾ A__()Ë  Z QcalleÖy H  F"%s.C A" % ‘ ö.__class__.__name__,)~"if{ x2 f ç+÷(PROTO + pack("<B",; S 	4S  …`start_ Fing(— w ‹save(obj Ž KSTOP  G ger.endR ± – ¬1ize™ @Stor3 €aect in 6 ~H   # ÿµPa dicÃ€ary mappBô@ idsdv2-tuplev#äScontao "UnsrY 1keyÆ �M  beZ  —  åŒ—    6 0is (0ten{  @ Y O ·will become×  % ; ú ‹ '2!mo>~ ús2d)H 	É“transient` s ·pkept alÖgduringG ° 7ingxä 0use� ¯ ¤ /�length af Ñ ‡s just a^ `conven±Ø  Prequiº ntâ É h WD¸s be unique|0But/ Bðppears no advantageƒQany o°qscheme,Š$th–À   # scheme ó.allows the Unpickler memo to be implemented as a plain (but
  ò# growable) array, indexed byM Ekey.0 Õif self.fast:  M ereturn òassert id(obj) not in<  £ ( ¡idx = len(X   )  Rwrite ‹put(idx)"  5 [j Ñ] = idx, obj
I 1# R› ò a PUT (BINPUT, LONG_ ð) opcode string, with argu?" i @def ‚  – ,e )¦proto >= 4 � MEMOIZE˜   $el9 :bin2  ifc j < 256  9 n ¿ Â + pack("<B"™ a  , OelseB G IG C �  Ra+ repr™0.enHý("ascii") + b'\n'Š"GEŠ'GEŠ?GETŠ1get?, iˆ OM — 
MkK	E K)  B 8$ 8)6 w2savØ ,  ÷_persistent_id=True	 ¥ñ .framer.commit_ (Œ Æ# Check for M ¢ id (defin¦a subclassRpid =Î9 _ƒ}0if ) !isÿ�None and½  
ž» â F(pidy CSÇ  	 €  ZM   .1¢ P Wif x ¡ Š  € C Gx[0]�‘ –rv = NotI�” óreduce = getattrÄ" Ðr_override", 1	ª $ ¯ x % v#Pif rv9 
– 
î Hð type dispatch t!Ã  ó @t = $ h    f> ytÉ  ) @if f�   ç 
‰  " f>ò # Call unbound method¦�explicitŽ	¤  G o	  è lprivatç À if any, or ÷	S ¤# copyreg.Þ _‚ã'3 %',`D ))O ¥À None:
       örv = reduce(obj)
 y  else:   ð	# Check for a class with ¡ustom meta ÿ; treat as regularN  *  �if issub ž(t, type)Ž  ’ þself.save_globalÊ  &   }return
n 
Ô "__P_ex__Î õhod, fall back to # _L <   = getattrŽ 5, "2  U z", Noneo ¡ #ifŽq is not' ö »^protoS Æ m ª _§  > «  / ¯ ¥  " ©   ðraise PicklingError("Can't p ýe %r object: %r" %š G  À(t.__name__,G &))&rstring ISed by±€(), mean "� ö�"Š Öûinstance(rv, strÖÌ A ÎJ, rv5� ¤ µAssert that“ ¨ xa tupleŠ  _)isŽ $ � y`%s musi  Q Æ  ø "orf 3" %ƒ 	F¢ i< ò
ed an appropriately sizedK ± ˆl = len(	!if$p(2 <= l 6½ T
4by Ï Vhave ¯-@"twoÏsix elementsô SR 3theð() output and finally memoize ( Ã÷ ® Np=obj, *
( ðdef persistent_id(6 Ç<ô# This exists so a `ñ can override itV  ý r0…k k œ p g 7pidv!# ó a’ É id referenc‚ § F.bin¥  u   e `(pid, 
 _o ß [=Fals=5 ö write(BINPERSID2[:tryv z E B   +Û ˆ ö
).encode("ascii") + b'\n'e  B  except Uni- E3 ¬m Xy L  "ý � IDs in ëRcol 0‡€be ASCII® Sings"x¯Ðreduce(self, òfunc, args, state=None, listitems /
   8dic$ @ r_setter7 A obj
 %):B õ# This API is called by some subclasses
1 òif not isinstance(¯ WtupleY  ¢ ðraise PicklingError("/ ñ from save_reduce() must be a K ,")s  � Pable(&j  ( j 	Q &")ß  ” € = self. … Twrite  5  i @_nam  qgetattr¥ A, "_ j__", "Ó c ÷ proto >= 2 and I =< ¶ewobj_ex__"´ [4cls)!kwS=8°  % ¬1has“ 4  ’ [ew__"B 0 °2[0]I!{}f ± has no __nL 	v  J  q.format)ã 0  if¡ ‡ a ù4cls aobj.__“*__ A ¿ ¡the wrong Q "Ä 5
Ø4§  WJ(clsþ  Á   Í ê �ª(NEWOBJ_EX! Nelse…  j  = partial� .Í!, (*ˆ O, **u ­  G 
o È (ß  © fREDUCE7 BelifrS# A _Iñ__ implementation can direct _ ùcol 2 or newer toù`# use ò more efficient ^û opcode, while still@ †allowingn 0È°1 to work n°lly.  For t�‡  * ,‰  dÊ breturn ð ›should be‰  ß"ed¤ F!_,ˆ �its firstÊu( B , aD  ÿl.  TheX7for\ 8 R @s fo °�lthough peF>way‡averify
¾#k 7defˆ  Ê!, ½á#� D ãð2 
[ 
   P¬Tcols ÑDwillÌ °a referenceéMvG :‹À (and above)÷ will pickle a reference to
  ñ# cls, the remaining args tuple, and ËNEWOBJ code,B °which callsN ‘.__new__(Z *M q) at un�  a KtimeE �(see load= ûobj below).  If __reduce__ returns a@ cthree-µ  Ï ¡state fromÀ RthirdÕ R item!b‡ £ ñed regardless ofA ‘protocol,ê  Æ Q__setg +__Ž ï  á Tbuildà 
9 
 ñ Note that no standard `ûobj__ implementation exists;F pyou havüü provide your own.  This is to enforcòcompatibility with Python 2.2 (3û s written usingƒ =¦ 0 or 1 inC a3 shou${able byE u )). Qcls =¶9[0] âif not hasattr’"@Y__"):,  praise P7�ingError(%  ) "×2[0]aR ’   p  ²  i 	C 0if à!is› ANonee Å  ßobj.__class__¥ J )awrong n )")ª Ì Y*1:Z@saveP
2   7 
  "e(C JelseÞ ? Ffunc%  m V …REDUCE)
º `
e #R ù `objectûpalready—  @memo is means i& a  “ ð# recursive. In tE@case8 ðrow away everyth-€we put o+ aRstackkQfetchpž Bbackeš 
ü if id(obj)¾ Pself.¿ 
ó  ² „aPOP + ' Aget(	  0 [E Z][0])~§ O : 1ize �ð# More new special 1s (ËBworkFPolder“YEs asdß# well): when Ì�4V5Øsž#H14th`15th! n’iteratorsdGlist‰  .sC  di/òtems (as (key, value)Ž 0s),Š  Ô.0if S H ã # 
¤Qõ _batch_appends(7 
ß ˆ N  À            ò	self._batch_setitems(dic
 C)

  õif state is not None:  % "  H 0ter) %  ) Qsave(M )A   ºwrite(BUILD ;elsp  / b# If aš x ýspecified, call it instead of load_build €# to updé òobj's with its previousm .;  ²First, push% ’ 1andC Ptuple‚ ÿexpected argumentsO  R(obj,I  ) onto the .ck~ Tu 
> ,# °obj)  # simŒ ðBINGET opcode as obj¹ÿalready memoizedq 	j ÅnTUPLE2 ›# Trigger¹	ð �functionÀ~ b oREDUCEb ‘he purpospm ß ÿ to carry-out an} ñinplace modificaŒ  of q. We dopcare abG @what¢M  ñmethod might return, so`output• ÿeventually removed fromP  3POP»1# M} ðs below this point » @dispü ed throughÃ   b table C= {} 0ef V`_none(K,!)  .” 3NON«J `[type($F)] =J ] Obool]  q ¿¦proto >= 2y ñ  } �EWTRUE iÂ Mƒ NEWFALS•  1   C @ = Ò  ¬ Ì   Ì OlongÌ 
:bin‚ â ñ ³Pis smÑ"en¬1o fÜ Kùigned 4-byte 2's-comp>ð# format, we can storem ñefficiently than{generalH Jcase–!# ÿ` one- ñ2two‹ 2uns› JintsÝ �J>= 0  Ž ~<= 0xff   $ `òBININT1 + pack("<B"Ž  : ‡	×   
u w 2w Hw À# Next check¡Ã6	R-0x80 0 <=u  B0x7f .*ÀBININT + pacû k("<i", obj))
  ereturn õif self.proto >= 2:  : ¢encoded = 
 `_long([ 	' ‚n = len(% dw ªif n < 256\  ` } ðwrite(LONG1 + pacÃ ƒB", n) +y T OelseN 4N  N R-0x80 0 <=L  B0x7f 
| Æ ¡INT + repr&.€("ascii"Ð Vb'\n'"Ê N  O LP ñdispatch[int] = save²
®2def `float(h 'Î 6bin ©pBINFLOAè ¬B'>d'H Ö > &Ö · Ø  Ù _bytesÙ 
é:< 3ß  ¤ otèA: # G   Áect is emptyC   @.cqreduce(7 A, ()=&ë K G  r#cs:,w  4 	 1(stm¹, 'latin1') >objŒ óÁ	´  ÷*ff/´ ·æSHORT_BINBYTESrÀ	S !elU B> 0xIkff and…4n  _o q_large_j(u 8v Q6€�u =g ÿ
framer._FRAME_SIZE_TARGETv u Iu ¢5º D   +vº 3 qmemoizeP  _array5 6L 4 / ß K   s,má>4�YTEARRAYŽ	F 
Àobj)
    disõ	patch[bytearray] = save_ ñ

    if _HAVE_PICKLE_BUFFER:    2def8 öpicklebuffer(self, obj)*  . 0if  ª.proto < 5  # praise PN ¡ingError(" !eB] ¢ can only s …d with "“  F  "z ©col >= 5")5 H îobj.raw() as m  þif not m.contiguous%   É  L &beË ?henË  d ö"pointing to a non-—  �å  7 éin_band = True ¦_A Á_callback isü ONoneô Y Abool.F (
yu > [ ð# Write data in-Á º  I þ# XXX The C implementation avoids a copy herü  B �if m.readfŽ  ' Ê4`s(m.to>>s()ß  1 ?els8  
O •S O 	,oout-of0x w\S(NEXTâÂ S …READONLYW ´2dis„Ý‡Ü�Šj/sta]:binµ`encodeï Ý ú
('utf-8', 'surrogatepass'ù ‚n = len(5 d  � <= 0xff PKb _4† äÿSHORT_BINUNICODE + pack("<B", n) + u !elw >v f | _} R_largë&s(ƒ 8„ Q„ ,ƒ =Íÿ
framer._FRAME_SIZE_TARGET „ 
ƒ Iƒ K€â Ö R YKPobj =Âû.replace("\\", "\\u005cV/ 0/ /00/ n/ a/ r/ d/ ðx1a", "\\u001a") ÷  # EOF on DOS
  ðself.write(UNICODE + obj.encode('raw-uni ¹-escape') +D O eb'\n') ^ ²memoize(obj ñ
dispatch[str] = save_str
8 2def `tuple(C ,’ !):  m `if not A: # ( • is empty% )  @ F.bin>      û ²EMPTY_TUPLE£      Oelse: 
MARK + ;  breturnÔ  K vn = len   û   †  ¾  5     ü ¡ <= 3 and Ä ªproto >= 2« áfor element in/G  }    u (% 
û ð# Subtle.  Same asE ±the big comX ibelow.W Qif idç  1  ½ 
—  w 4getÞ @get(% [5 J][0]Š  1 é ­ÚPOP * n + get* ¯_-Psize2Ò/[nk  ’ 	µ …   ×"# C0 or 1›j b isn'tš," '> $ =ô# has more than 3¾sa; ?  (‘
ÿK ÃQd was�0in 6ø when we enteredÍU), sof  O # R‘process oû1ing B%'s¡ must haveT dI  3 0 it/&: F  €recursivÒ0The­«per actionL 0now3 ðto throw away everythŸ `we putQ ¿ `stack,öG §simply GET‹ û(it's already constructed).  This checkK Rcouldý �been done` € "çû" loop instead, butJ :�s are a r Þ n ¢«"if“q¡@POP_¥À6   U5-- 1  ô™availableÕ  ¨ ^ � * (n+1)a ¾3No &onù M Ö U.ã… Ï}Ñ ÿÓOlistÒ^ 8 Ž ¥FLISTàñ1ðcan't use EMPTY_LIGST
  õ	self.write(MARK + LIST)
% ! Êmemoize(obj) â_batch_appends! " @disp à[list] = save_ \ ò_BATCHSIZE = 1000 Kdef T  ‚ ‘, items):\  À Á# Helper to „ õ up APPENDS sequences/  ~  …  ï    ü   ‰  d pif not � F.bin}   ‚for x inš 
     f &(x/    d (ª 
 greturn 0t =^ "r(ý ´ šhile Truew `tmp = d²(islice(it,¿ o)u n2 jen(tmp  ý J > 1c Â  /
2   >tmp:  " SY  el� O K jtmp[0]1  h hp# else .õ	is empty, and we're donek J  } , <H� À È Ÿ `_dict(B , >6 "ifR Y - “¦EMPTY_DICTà  ¼ ö:   # proto 0 -- can't use 3 	Ä U  ¹2 + V % ! è1setŒ é.
 )-ñ ò ñ  d ñif PyStringMap is[7NonÄC * 
J K  \$�  ¿ %wSETITEM&;K‘>= 1 onlyg  û Ã   ^  ¸7Ok, v:kò ‰    � .(v  (× 
 “ C iS¤2V4  õ 8s‰ =<5[0] f   j †   º¥9À            ñreturn

    def save_set(self, obj):  !   0 =  .  Twrite  R  5 "if1 –proto < 4P   M ð_reduce(set, (list(~ !,)† = p  9 º   w µ(EMPTY_SET)- b qmemoizeS œ ‚t = iter  G   ªwhile True¬ �batch = � ¢islice(it,à ¶_BATCHSIZE)|  N n2 1en(> 
 Šif n > 0g  5 Î JMARK2   0forµ Qm in U ?  '  ¢^(itemB ^ ŠADDITEMS  ” <Ô c € j @dispP[set]EiWofrozen]jƒ c(
•�:obj(ƒ�Qif idp À�
9 €# If the�àect is already5    Ñà, this means i& f  —ò # recursive. In- @case8 ðrow away everything we put o+ eK Ðstack, and fe … 0objž ‘back from³  š .> o@POP_<" +]gf.1 [K][0]@iR N oFROZENé �ü£ ©fglobal·, name=Noneˆ  îAelf. £  Ò    `  Ž  ^0ameÑ O 
ö f ‘ = getatt”�, '__qual P__', 6 ±O bobj.__A ‰ amodule ‚ = which  ›ñ g :tryª ²__import__(6 I –, level=0:  ô "  2ys. "s[ 7 ]8 . °obj2, parenž_Sibutem Ÿ ‘except (I” £Error, Key
 AAttr?  Â o áraise Pickling" (�  % €"Can't p& ýe %r: it's not found as %s.%s" %= Qð ¿ )3 Ñ4 ;elst if21 o c Ÿ Ä  ) È À pickle %r: ÿit's not the same object as %s.%s" %
   ð(obj, module_name,  5))
/ õif self.proto >= 2:  R ÿcode = _extension_registry.get((]  8  0if C 
U   aassert I > 0u    9 Ž <= 0xffA  % ñwrite(EXT1 + pack("<B",V -))T +elV X 2X HX 	/se¡ 4I iI ereturn¸ @last±! =¸õ.rpartition('.')[2]+ Ãif parent isò
’ H S 9 ñ!# Non-ASCII identifiers are supported only with )@cols-%3.H I4€ fHsave3
£#  ­ 
 êÆSTACK_GLOBAL  ×þ  *—‚ ò_reduce(getattr, (= $, <] š ú ö 
X › • ˆ + byteså  , "utf-8") e'\n' +7 Æ 8  ú 1 ì ky`fix_im°s   _ rÿ€_mappingÑýcompat_pickle.REVERSE_NAME_MAPPING¤ r` G oIMPORTI :if ! ö Z) in ¨ È  Ì ÜÑ Ð+ =8 [^  + D   ÚM € Cã ‚ | 
4 [T 
v >tryQ ?_ascii? Ò 	C5 C *  except Uniž!En Nrror  praise P(@ingE% ( T r"can't Rw globalS! '¬@' usƒ"D > l”col %i" %.ï,²p)) fromÄeÕ¯pmemoizeð@def ‚`_type(% ,J)ô  if  C# GNone  å ¢‚ L L 0 0, (2 !,)W F=objum7obj\ ÍtImplementedf Àturn self.saóve_reduce(type, (NotImplemented,), obj=obj)
  @elif @ is 6 e(...):  & íreturn self.sae ?...Z 7 qglobal( a ñ
dispatch[FunctionType] = f / 
)  ¢ !   ó


# Unpickling machinery

class _ Ber:
L Àef __init__(Ô �, file, *	 ñ x_imports=True,2   ÷ encoding="ASCII", errors="strict", buffers=NoneKP"""ThfÑakes a binary} € for reaY 1 a Î âe data stream.¼  † ð
The protocol version of t  eËõdetected automatically, soÓ "noH P argu" 8 kneededo ! **ñ* must have two methods, aÃ #() U thatn tö •n integerv S, and< Jline@ • requiresI %no; ƒs.  Bothq “s should z@byte# RThus » F kcan be†Øobject opened” ¤ P io.BR %IOF 1 ð, or any other customT M  € meets tþ ÿ [rfaced ZT-like9 e‹ h e$E m eB lÌ nE 
 RrjC rCIf *§*÷0ot ¯D, itF  n iterablec2 0-en dl  à atM øconsumed each time�Ñ— referencÚ°an out-of-bn Ä view.  SuchZ|�been giveTe order“ !tos ä _ýPback*Æ 1a P'rU‰   (Z�default),X n � @are yn~ Afrom# Éó p, assum¦Pthey 8  serialized0 5re.D IK"an_�Î Ps* to½ž iúj E 0wasä Ñd with a non-: O 	OÊ op•&alqµ 5*fi'D*, **Ê| *�*, which:  usé ðo control compatibility sup{ ì F 	Bp genera×ðby Python 2.  If *fixó_imports* is True,
  ðpickle will try to map the old Python 2 names   2new G tused in0 ó3.  The *encoding* and *errors* tell { 5howG óto decode 8-bit string instances4 Dd byk  2;­ %seD pdefault¬ q'ASCII'| 'L øct', respectively.£ Vcan bI p'bytes'I Breadg ™ 1as / • objects.� 5""" óself._buffers = iter( S) if   ¨Ñnot None else
 G Pfile_š pline =  . , ( 
$ šmemo = {} Â4 =  ! Ô  	 
 @protV 0 4fix”‘  
( �def load(0!):  °@"""RŠanð representation from¯R openY  E aReturn Óreconstitutedº° hierarchy '2ifiÚ øbŽ  ò# Check whether UnÞð
r was initialized correct{wThis isE °only neededwQmimicª Òbehavior of _[ .d v.dump()s0if >qhasattrF@, "_¿ 1"T Traise´ @ingEÊ&("a  __Ã A__()Ð  ] Qcalle‰ß L  F"%s.E A" % – Ð.__class__.__cU__,)) ÿó ._unframer = _U > Ò ", ,   I  # =) U 1
q  ( !in·U 	,   0  o \   
0 êmetastack = []  dappendb & . 
@ p Î 8   0 „dispatch  ! 6try{ ×Qwhile@
   `key = a &(1x    ‘+keR     �1EOFz‚     ”assert is	R(key,qn_typess Ï �[key[0]]2' ðexcept _Stop as stop^ 
Ú r, b.valueK## I`a list™¦items push3«ñ after last MARKÑ0ruc­¶ ò‚pop_markª ‰ W ¹P !  Æ]À.pop()
     ò   self.append = Sstack #
  Ñreturn items
 ðdef persistent_load(N q, pid):$  = ÷raise UnpicklingError("unsupportedG ó id encountered")l Ãispatch = {} 0ef t a_protoz u  Ñ ¥read(1)[0]• Âif not 0 <= , ö<= HIGHEST_PROTOCOLÄ È _ValueÃ  Þ eL ¢col: %d" % )w   .p x  dß [z g[0]] =Ý ñ \frameñ  ò_size, = unpack('<Q',Õ&8)‹ 6if 4   > sys.maxB ø 8  * 8 õ   Œ o ú 1_un !r.º ( . XFRAME* ‚yÿ:tryÅ %piß 
öline()[:-1].decode("ascii"²  except Uni  D& ù
Z ß× 6 "© +r IDs in÷col 0 must be ASCII stringsŒ >¦ù.N y s» ?hPERSID@5 dA2bin Y D3Bpop(d  Õ “ !>BIN– � ™ =nonæu BNone� ó 9NON1 C V OfalsW 
F! X iEWFALS\ I ] ?tru\ 
=Tru³ YEWTRUZ  F Y <intŸHdataáÓx2if " "= » :1:]¹aval = ï 6 'el8 ˜ 7  Ê 6 /se\  ¶  … 2, 0Q82val Â8INT²;int
0binW  	¬  ²(üiü 4)o ;BINr ` u 1ƒv   [ih 1Û i 1j 2j 	à Hà 2à 2x Àbinint2

   ó def load_long(self):
  `val =  õ.readline()[:-1]# 0if & 0and ö [-1] == b'L'[0]J  Q  ( =& 	B _ ñappend(int(val, 0))c ödispatch[LONG[0]] =¯ 
# Â 1Ã nÁ V(1)[0¼ Idata nu  ­ – bdecode" 4 œ 1� 1ž  4ž ö, = unpack('<i',m#(4g  Ž Šif n < 0Qñ,# Corrupt or hostile pickle -- we never write one like this: Z   �raise Un;  ingError("sO ö	has negative byte count"1 M54M4M\floatM³! ºVYXFLOATp ; p 1bin s 	Ç)>dÇ 8)t(u =BINx d { _yCstri�,@'ue¤ò# Used to allow - ð s from Python 2 2be P ¦d either a#ÕsI0UniïI ð.  This should be up Õonly with theNÒ# STRING, BIN  fSHORT_  opc %s.9 "ifú€encodingE"h*s"ôbreturn> Oelse' .÷ ¼.a jeë&s)tD1 jâö# Strip outermost quoteipif len(L a) >= 2   ![0;  G 8 Ê0] in b'"\''æ   0 =  )[1U å3the´ •à argument mustðÂ dëi © Ü“cs.escape ò <[0]€&�~“2bin –Ç# Deprecatedvðuses signed 32-bitx5gth5?len~/le€ 8çQ/e = /leŒp  W… ZEÀing

    defó load_binbytes(self):
  ðlen, = unpack('<I', # •.read(4))* öif len > maxsizeD  K ð!raise UnpicklingError("BINBYTES exceeds system'sF Pimum K % "f  L  q"of %d Æ 0" %A  < ¡ · aappendæ Ã 3lenÅ ”dispatch[• j[0]] = 
Š 2def qunicodeP 6	k !tr o óline()[:-1], 'raw-B Œ-escape'Œ xUNICODE‹ 2 Š 3bin n � ÃO¥ Å^Z(Éý
, 'utf-8', 'surrogatepassX3BIN¶ [E^8_Q"8Ñ ´"%© 8`£8a8b»``‚^_1elfº§ƒ=#;�ytearray<^�YTEARRAY=R1b =Þë 5Œ Zp ’binto(bM ô d¾ 	¢Mf¢next_buffeÐb"if �s is Nonÿe stream refers to out-of-band data‚but no *© ðs* argument was given")
        try:'
  õ
buf = next(self._buffers)& õexcept StopIteration:  K óraise UnpicklingError("not enough out-of-band a "b y ¢append(buf ðdispatch[NEXT_BUFFER[0]] = load_³ ­ 
Ž 2def ƒreadonly Ø )² ò t ‘stack[-1]A  Ë ñ with memoryview� V as m@  ' 0if Þ $m.l 
  # 
a t = m.to/ (ä �READONLYè  3 Î ì ü short_binstringì alen = ‹  H V(1)[0í Idata 2len™ Á –B ƒ_decode_k  > )/ ¬ø SHORT_BINSTRING°ª È _bytesÇ � © ë  Ì ž _BYTES�  œ 0uniž (!tr= 7(¢ ÿ, 'utf-8', 'surrogatepass'[UNICODE¿ ¢ Á Qtupley Titemsþƒpop_mark˜ÿA 2 — ITUPLŒ , � aempty_ ‡ ½(] mEMPTY_c O i c 1d ì1 = ! . ,(q 1aX m 2L XÑ [  2:¯[# o 22],‘$ 21])’E 2 2 3\  3  3 � 3� 3� •2lisI“  +[]lãHLISTb M f 0dic†?aryÿ l /{}l ?DICl  S r /se× 
  ½/SEm  ;setf `frozenG  @=u§E 6 ‘ Àtch[FROZENSEòT[0]] = load_frozenset

    def ±list(self):   €items =  µ.pop_mark()   qappend(,  Édispatch[LIS|  d w ?dicw Qd = {p S[i]: 
 5+1]™  ½ ó for i in range(0, len¨ U, 2)}/ È dÄ 9DICÄ  ± Ä ð# INST and OBJ differ onlyu ñhow they get a class object.  It's notƒ #5 àsensible to do= P restM ña common routine, 4two sI ñpreviously diverged¡ Cgrew¢ “ent bugs.3 kš !isS § ñ to instantiate,B €k pointsž  th¥ `pmost J Þ ñ, following which are] `argumeD  ›x ’.__init__Ž  Ž_{ ‘!, + h, argsž0f ( 0 orK2 is: 3ce(1 �type) or  ¤   hasattr$ `"__get…  L G__")c  4 6try    rvalue =š  (*; 8    þexcept TypeError as errJ Vraise( ñ("in constructorÆ™%s: %s" %É  g  Ö ö.__name__, str(err)), sys.exc_info()[2]² Jelse› 	á  P Bew__^ 7 81 ) Çm ‘ÄTPmodul<> öreadline()[:-1].decode("ascii"k  Ð Š4 5 Qfind_ß!(m‚  , T b � 	}@ ,þ2 ä ` ó <objá# Stack is ...E>) @arg1ö2% ü mÖ •  cl³ %  ³"(0°  )â 3clsW^ Õ 8OBJÔ ;objÓ ?newÖ   u š sà ‚ � › ‡  •obj = clsp  ^? u2obj^ º ;NEW½ « À <_ex™/kwÅ   å (B, **� Ö µï 8_EX¯ðnewobj_ex

    dóef load_global(self):
  �module =  õ.readline()[:-1].decode("utf-8")6 ?nam4 Tklassi `find_c !(m‚  , T b � qappend(:  ødispatch[GLOBAL[0]] =à 
¤ dõ _stackû  q � ( R.pop(h  ™ " 	€if type(J ò ) is not str or C  z c òraise UnpicklingError("STACK_ã � requiresY ƒ! SÑ 9\ ?*ELext18  6a(1)[0]} Ù ’ àget_extension(2 Œ HEXT1„  i | 2| ö, = unpack('<H',À2(2)g ˆ 2ˆ 2ˆ 4ˆ iˆ 4ˆ !4ˆ 4ˆ 
O b!, UTvnil = [ˆfobj = †¡_cache.get�V, nil.0if 1 É6nilZ M”6obj8   ereturn0keyy õinverted_registry{ > !if8:keyo !ifß € <= 0: #% €e that 0l†forbiddet  ‡   �# Corruptˆ�hostile c%e.¡  )   ƒÖEXT specifiesˆ �= SValue»"unê Uered ýA Q%d" % ý  p}ÁF*key$ ¿[ö ø5objÐ  .�  	X  % ", –rtQ# Sub”àes may overridu&is:³sys.audit('Ub '^ …  *"if¢Òproto < 3 and ¶fix_imports� 4 
Ã in _compat_{ ÊNAME_MAPPING>  B ê  �< [j B G Celif6ƒ  oIMPORT…  
8 [¬ y _%__› vlevel=0
VB>= 4À        retuòrn _getattribute(sys.modules[ Ó], name)[0]
  Uelse:   sreturn L G 
7 ödef load_reduce(self)R €stack =  . 6  i @args  " e.pop() Dfunc 6[-1¯ B   0 = %  (*F 9 ødispatch[REDUCE[0]] =œ ±  s  — ® 'if© Å  ® 7del  ƒ ® D W  Ó S_markØ Ÿ 8POPœ >pop™ 9  G ž   V 	[_MARK[ I ` =dup§¡elf.append « æ \)DU½ ,du½ 1getB ¸ bi = in ò.readline()[:-1]_  a:tryrï ” gmemo[i3 ú except KeyError? 0msg%õ'Memo value not found at index {i}'É ‡ ñraise UnpicklingZ ñ (msg) from None1 Ð8GETu;getp?binã  )(1–/ as excd;BINRlong_ 4ò, = unpack('<I',},/4)69*k^LONG_/4"puI`Šif i < 0ïVêö"negative PUT argument"r´‹ ¤ :—
)PU/pu Ð f î
Æ ?BINÉ /E æ>binÏ ¶Ô Ðà Œ> maxsizš›¬À"negative LOóNG_BINPUT argument")
  ñ self.memo[i] =  ‘stack[-1]& µdispatch[LOJ 0[0]. òload_long_binput
1 1ef   W @ize(U !):  v   k   	 P[len( )a  : .� xMEMOIZE‹  8 ;ize‡ lappend† V ‡  ˆ Pvalue  V.pop(0Dlist # Ö   .k A 4 >hAPPEND® - ­ s® Pitemsx  ¯‹pop_mark— D_obj# Ñ 	  6tryƒ ± �extend = º  < . úexcept AttributeErrorD Fpass0 :lse Q (½  y   ereturn; ó# Even if the PEP 307 requires H b) and 7·() methods,F Æfall back on) W Öobject has noT G E !orD õward compatibility.& … = ! @for ø 1 in s. (S)s*0seta *ú	” —  Ø ?key ?dicò  @[key©[ i É xSETITEMÉ ³ É ô €  ´  ö 	ð� ~�range(0, Z 2Ws), 2� � L [ ![iÛ < + Ø 	¢Ù £1addH ¤ » Î 0set‘" Ý Àif isinstanc`/ [, setØ J q.updatepsq ö e² ad6 1addÔ ,   T0temWÄ 
Õ # 1addf e 0ADD	5Obuil®Ostat® # FtÑ § 4set8 €getattr(, T, "__ ’__", NoneÌ  7  ifd: iGt! 
@ (( =  A ø5sloˆ  j ná ã r, tuple Ì_ [ == 2� àtate, slotstat³e = state
  "if :   Àinst_dict =  !._ +__& @ternS Pys.in 	  ²for k, v ine Š.items()m q þf type(k) is str# ' ˜ [o ‰(k)] = vw  ) OelseC k;  
1lot
; 	È # Ì €setattr(9,)  ðdispatch[BUILD[0]€ ²load_build
% 1ef  —mark(self.  ñ.metastack.append% . h   *  Q = [][  8  ¸2elf: L ( ¨ HMARK§  “ ¦ Astop� ¦ Avalui^ Fpop(� €raise _S< -  x HSTOPx  e ð'


# Shorthands

def _dump(obj, file, protocol=None, * ñx_imports=True, buffer_callback+ ¾ š_Pickler(N 
F %fiR ,0 X Z  $).¯ )¿ sÀ º ,f©“o.BytesIOlÏ Ì @ ü ±res = f.getÒ‚ �assert is°ance(res, b§ _ñsû”return reÙ †Åøencoding="ASCII", errors="strict"›ˆsêq I_UnpóÝ= 6#s=L _    — 	 ˜ Ÿ !).Ù    os(s, /¬G ç Ú	è (if} s,[í ³ ŠPTypeE?q("Can't� Ð from unicode> Bing"µ %
w
Î]= 	 ^ó# Use the faster _Î ò if possible
tryèã " -% (Û ö ;ing O 0 &erA *   !   s  +
 s¢ ¡)
except I¸ � Ö s À Unpickler =ò  _Pickler, _Unp ¡
    dump, rs, load Rs = _  Bs, _  ðs

# Doctest
def _
 1():T ƒimport d   g dreturn .. ùmod()

if __name__ == "__main__"L �argparse` 
 Dr =   .ArgumentP$ !r(&  w òdescription='display contents of the � files')< b c.add_a[ U '1 _1 …', type=Š ñ FileType('br'),N  Š ûnargs='*', help='z y €-t', '--?R', acÙ ¶store_true'q f �run self3 o suitej v` ÷verbosely; only affectsx 3runv  3 = `  b"s(x ifÔs   <]LFelse bif not4 –!  ? f €r.print_m   
O   ½p/ s     �for f ino  + Qobj =O"(fÚ    \ . ð(obj)
'''"Executable(Ðaá " z 0ðmodule.

Extensive com xs about×Óprotocols andìñ-machine opcodes
can be found here.  Some funeqs meantŠ  external u‹‚
genops(í ÁGenerate all‹ g <ƒ b, as ( ,R`, posið ä) triples.

diZ ó, out=None, memo Ñindentlevel=4~ Pèð a symbolic disassemblyóa‚ .u#

ð $cs $io
 ×  $re
  sys

__all¸  [^ � 
 ðoptimize']

bytes_* YT .  OóOther ideas:
#
# - A« ô verifier:  read Ä Ôðcheck it exhaustivelyªð
#   well-formedness. Ð() does a lotpthis al] &y.~ < – $nt‚ @exam=	… áDits rq number† 1(==
‘highest .% ÿ attr value among2ù!).L  )­  ¨!s Á binfo aÿ7endÉ ò “ H T Ê ðple, tuple-building ñ is sometimes more} QelaboÝðthan necessary, cater>  Z µ Óossibility th— j J €is recurÀP.  OrŒ•s Pa PUT† gOdF °'s never ac{ !edM  byÌ ‚ ð GET.


# "A pickle" ñBis a program for a virtual pickle machine (PM, but more accurately
# called an un6 4ing8 p).  It'g òsequence of opcodes, interpreted by the
# k 0ildI ðan arbitrarily complex Python object.
#
# ForA ± most part, ÐPM is very si=  :   Æ ñre no looping, test	 ð	or
# conditional instruc  s,4 àarithmetic and 1fun   Rs.  Oä 0 arÔ Pexecuæ oóeach, from first to last, until a STOP' ¿ r2 "edé ðThe PM has two dataf ñ as, "the stack"™  Rmemo"; CManyW js pushI`s ontoE ±; e.g., INT. eÉ{!
#½3ger…6 on9 Ð, whose valueÁ bgottenó ð	a decimal string
# literiQmmediZp follow Õ  ƒ 7" ii l@e by¸@reamu0the½* ms takeã &ff© 0.  O`result›Ä¶is
# whatevæ yis leftî B whe”  fi/½üƒ o  ’ ‘y;Parray€ Òñs, or it can be ¹0menBa… dict
# map¼ @4tle’sPI á r @servÃs ð PM's "long termN qemory",; u9litW Tindex’S aHk’�o variablï@nameFSomepBop aY4ioM ¡t a given j 1,
#‹ oÖ°!a + Þ + a2 Àb againxSAt hea“#ll K°.  Subtleti#Ariseáthese reasons:i1+ Ow� identityy s°a³V2sub»  \P  mayß€shared (ƒ0exa¦½ñlist [a, a] referÛ › saZv Â a
#   twiceq‡ @vitaå 7at Ø€recreatex£isomorphic“K @grap¡ðaithfully reproducý ® 2ingW³+ RecursiveB  ø ŒÉ ðafter "L = []; L.append(L)", LÁ  í &@L[0] é   Ê is @rela¬R�Ã RpointN s…se;& Åsý \�order toG 1get%cright 'Äin all casesdThings7Ðdoesn't know ? yt  ¢ about.  Eå�  : u  > ;  èÐñ's builtin scalar+qcontainP  typf1likðs and tuples.  ThñNey generally have opcodes dedicated to
#   them.  For things like module references and insta ñ of user-definedK ðclasses, pickle's knowledge iX ðmited.  HistoricŸ ñ, many enhancementsM ¶ Àbeen made toª Z ð protocol in order  ñdo a better (faster,K ò"and/or more compact) job on those.
#
# + Backward& �tibilityú ðmicro-optimization.  As explab belowq  tônever go away, not even when± EwaysÅ ‰» ’get inven9 Th“±pertoire ofðPM just keeps growing ou 0timÞ  á†example,@•0 had two­ �for buildD ñPython integers (INT˜ —and LONG)L P1 addYBhreen M  w¢-efficientÂ \ �of shortP b ,mß2S /woQ K Glong² 0beføS ,4Tonly u°#a ð  C L ðtook time quadratics the numberƒ€digits, í Fbothã "an!unb ‘ing).  "OŒð bloat" isn't so much a subtlews @ourcê� Pweary= ÇlÉ ‰ ¾A
# PvÜ s: Ù . aÏ @meanI Bof a± $ ¯úchanges.  Instead new
#,  s ¡÷ºó each version's ù ðer can handle allƒL !in «H Ãate.  So old… �s continu@
# b`adable� v0.  4† b8 l
ò restrict itself ç`subsetçBQavaild  unz…previousy  ¸  o,Ú0thaç 1s
ecreateÇ I  o @curr&û 3 reÐ  byù Eer
#_  I owæ ,ÄAdoesb 0ainÑ 2 ´@embeªP
# wil0 itèBf anf ¹@trieÊ ‹ h  us>Qa lat• µ^`resultõAmostRlH` excep>! d¶A seeI @n un.pn (in
#!‹ )¤® ×ƒoriginalI° used what' w aDed "� 2 0"§ $ 0 wa�!ll¾P"textö3e" 332.3F0entvM@ byt51eamè  ¥Pup ofØArint#ð7-bit ASCII character"1lusä vnewline ,a± R.
# TÒ gwhy it·  ´ ð.  Protocol 0 isðn small and elegant, but
# sometimes painfully inefficient.
#
# The second major set of additions is now called "protocol 1", v 3was ðd
# "binary mode" before Python 2.3.  This added many opcodes with arguments
# consisting of arbitrary bytes, includ 2NUL ò	unprintable "high bit"
## F.  B¢ p pickleÀ ð n be substantia,Yðer than equivalenZAtextã A 
q@fast: ðoo; e.g., BININT represâ ò a 4-byte
# int as 4¤ p followÛ 3the!ñ, which is cheap^ 2 unÂ ¤  thM ð(perhaps) 11-characŒ °decimal strZ õattached to INT.  PÙR also¤°
# a number­ò that operate onÊPstack…mà ðt once (like APPENDSP Ând SETITEMS)9£"shortcut"î s6 ¡EMPTY_DICTÜ fTUPLE)¿@thirMj¾wcame in„s  HÒY
# 2"¢:#p- A betE0way1u in.0cesó
new-style classes (NEWOBJª  F  ? Sfor a8 L äidentify its p„e(PROTO; QTime-uspace- ÆJ  Òpof longMÅs (LONG{1,4}D Sd s ƒ Ý@ tupÿ(S‚{1,2,3}}Zµ- Dedicated• 9 BboolÜ ÔTRUE, NEWFALS‘ - Rñ"extension registry", a vectoJð popular objectsÁAt ca‡¦pushed
#  è @ly b¿�dex (EXT­  Þ R U0kinR 5Amemo04GET    �  `t©ðre predefined (there's nothYaX !'s› 3PUT\A*  er indepenÑr changeÖ  ¿ … pabandon) <Pany
#„  5e�it might˜0afeÚ Bloadññ	es received from untrust7ôparties -- no suòñ security analysis has been donc €guaranteJt« nd8óre isn't a use cas¨ 0war1  Â�e expenseÔ qsuch anñm X@To tX Pend, ºBtest”³__safe_for_Ù€ing__ or³±
# copyreg.' pconstruQ¥s are remo fE  d°.
# Referen´t‰ €ese vari/s( 8 rdescripÿQbelow` !toŒ!eeÕ "s ' b#j l2ƒø.


# Meta-rule:  Dg  Á `stored† 	Zh p9.À,
# with plaö@in constructors.  No meta-language is defined from which
# descriptors could beM ð2ed.  If you want, e.g., XML, write a little
# program to generate* q ÿ the objects.

# :ð
# Some pickle opcodes have an argume¾ ¡following � ( 0 in ö
# bytestream.  A8  =óof a specific type,<`bed byh pinstancCof Av Dbð.  These are not)n¥fused with­ Ðs taken
# off¡ Ÿ stack --Z  Ð applies onlyW ó Às embedded iL ÷ ê æ, immediately  #anG ­± RepresentsŠ ’number of30%um} ‚ delimit  thÿnext newline character.
UP_TO_NEWLINE = -1

#x U two-{ P wherw  ø Ufirst`_ giveÏ u second1 ð.
TAKEN_FROM_ARGUMENT1 ¬ “2   # numPis 1-N` unsigu?int@ 4@ 3@ 4@ > c�-endian L UŒ 4L Œ N 8N 5N 8š N o
class§ (ñ):
    __slots__ = (   `# name\›ñ record, also a module global0 ;žUtringI 'H 5',
 €# length\ (,þ ª"s;Â:t; ‹7andB  r{1,4,8}Õòegative values for variable-~ M Ucases *'n­  a function
 ´@a fiH $ikK`, read ˜this kindÞ \ #„1 atÊÀcurrent posik ‚, advancS #e   I *  ônðÄ, and return9  Œ  znG '· *erñ `human-  /B docAÛ 3argp ¬ïQdoc',b )ôñdef __init__(self,+2, n70er,e Ž |”assert isÊ(Da, str)Z  %  J . ! =P m   ?   `!t) ¥(n >= 0 orK  5   ê) (�á ð                  ÿTAKEN_FROM_ARGUMENT1,
.  C  4C 0UD /E8U))Ì ºself.n = n
 ’reader = 	  ûassert isinstance(doc, strV ð doc = doc

from" òuct import unpack as _ Q

defn ¡_uint1(f):“ Ar"""	 4>>>> %io    2 óio.BytesIO(b'\xff'ê 12550  J 	 �data = f.> "(1º 0if  v  Õareturn 1[0]9 ñraise ValueError("not enough) 0 inê aeam toÏ  Ï A")

	 ñ = ArgumentDescriptor(]  t   aname='. 'ð+n=ˆ À 0er= 
0 ðdoc="One-byte unsigned integer.• 
w2w-2(wL\x00{ ½¦ 4 ¯O6553±
2±@len(µm) == 2»\a("<H", )Ê-25 œ2Ê2Ê2« Ê Ê?TwoÊû , little-endianÙOint4Ø1 × Û  ß;  003  8 ­c-(2**3{ATrue¢4ñ4ñiñ1 Î  ð  ï¸ , 
í*n=ûë . 		éBFourê
²èÀ, 2's compleQø ¦ù2 ú#< ûùïø@IøÀor("not enouñgh data in stream to read uint4")

	 ÷	 = ArgumentDescriptor(
  aname='. *', *=4  a 0er= _1 
 ð doc="Four-byte unsigned integer, little-endian.¥ A
def¸ P Q8(f):ƒ Ar"""	 Õ>>> import io ‚ ÿ8(io.BytesIO(b'\xff\x00 1'))D 1255  ^ L 	ñ' * 8)) == 2**64-17 ATrue	  ¦ 	 �@= f.N "(8f pif len( C 8Ü  |ñreturn _unpack("<Q",ÒA)[0]R ÿraise ValueError("not enouü8W �8ü8ü8Ý Ù ü ü_Eightý!ðstringnl(f, decode=d,Ý�ipquotes T "ó "'abcd'\nefg\n" 
x@ 5 óTraceback (most recent call last« 1...X ÊA: noÙ 2ng Û ¿ around b''… 
RFalsevD &''Ë 3  '"<"D +‘newline fù µwhen tryingÉ€ðEmbedded escapes arb@done¢the resultnÆ�r"'a\n\\b(öc\td'" + b"\n'e'
# Æñ Ê (~0if ¨ ô�.endswith™#n'þÜ  "k  d ! =6P[:-1]Z p# lose P ?!ifrKˆPfor qA·(b'"', b"'"©  S !ifc b.startÐ q# ' ù )  - Ýîq1 %rE‚at both  >  
"vÃ of %r" % (qX4; @1Aâ" Ubreak Felse: ( Ç Ú�  r )‘éR   0 = þ2cs.è_% DÀ)[0].decode(ñ)"ascii")
    return data

stringnl = ArgumentDescriptor(0  4  dname='4 -',  í=UP_TO_NEWLINE  preader= _F % òdoc="""A newline-terminated 5 ,.
y    óThis is a repr-style1 ÿ, with embedded escapes, andK ÿbracketing quotes.& ©""")

def Ñ 2_no` A(f):8 r	& 1(f,� pa v=False)‘F š  
£F ¬.   nµ $   À ¾a Ç3   Ð% <  Õ/stÔ>out×u?  >or Ûÿ  It should consist solely ofK ÿ
printable ASCII character,‰ 1V_pair61""" Õ>>> import io  ŽE‡C òio.BytesIO(b"Queue\nEmpty\njunk")
'   'Y  s 	 ³¿"%s %s" % (p O(f),ÿÐ¢ Õ>ÚP ß< ä.  ë ép îA ó Ñ? ofËsÌF  �These arË	ÕsÖ»7  –?s, CThey	I & !£ AThe %#is™@ed aÅKsingÁ– #a 3 Áblank separaÄqthe twop/ng¡“ ¦Ø1˜ )1(‰E\x00{p Û nÉ1 u3abcdef7 2abc: ª2n =�@uint¦ &àassert n >= 0
ð    data = f.read(n)
 pif len( q) == n:   areturn7 ò.decode("latin-1"= ð+raise ValueError("expected %d bytes in a string1, but only  •remain" %r  v  6(n,› C))

E û = ArgumentDescriptor(D cname="2 ,", ü=TAKEN_FROM_ARGUMENT1&  '0er= _J # Ðdoc="""A coun÷ ( +.
q ³The first a» € is a 1-%û unsigned int giving the numberL &ofZ % s Q, and5 isecondi ›that manyK  } +s. ·""")


def û B4(f)Ar"""3 Õ>>> import io 	4 @io.B˜IO(b"\x00 Rabc")I/''@ 3@ 5defC ?abcF † G3abcF óTraceback (most recent call last"..6û%: û†50331648§4"6  ù  S	 2n =v0ints ‚if n < 0€ !y4t Ž2 s %d" % í æj#%d444ß Ì
# -4ílittle-endian  ù  ÷ L ;313 ºbþ1 «%b'ò?@uint¦ í Ñassert n >= 0 	(@ €þ
ùË ÷ö D õ1 Ð",
          ð    n=TAKEN_FROM_ARGUMENT1,
  preader= m_bytes" ñdoc="""A counted ' › string.
P ðThe first argument is a 1-7 û unsigned int giving the numberL "ofl Q, and' isecond[ ’that many, .D ¶""")


def ä Q4(f):) Ar"""	 Õ>>> import io 3 @io.B!˜IO(b"\x00 aabc"))8 1b''  R @ 	3@ 6defC ?abcF † G3abcF ðTraceback (most rec�“call last"..4ðValueError: expecì‚50331648]R in a ñ4, but only 6 remain÷  Q	 2n =s@uintr Ñassert n >= 0  if Â sys.maxsize› ¤fraise š  ("F!s4„ ‘) >; ‚ %d" % nŒ�data = f.‰( pif len( g) == np `eturn  œ € %	#%d1" %K  Ï 	 6(n,ˆ C))

Û 3= A:»Descriptor(C Sname="Óù,4U'  	ú4" ú34úßlittle-endianã  F8,æ@uct,c  
Õ/8(
á  %P 	% D  
ï)b'50bigL38 =Å ¡.pack("<Q"Ï m2//3,Û 	L E+ b"v ñ  #doctest: +ELLIPSIS&z11...æsu8u ß� u2u~Àly %d remain_" %
  û(n, len(data)))

bytes8 = ArgumentDescriptor(C bname="1 ,", ü=TAKEN_FROM_ARGUMENT8U' preader= _J " ñdoc="""A counted ' › string.
w ³The first aÀ � is an 8-8 û little-endian unsigned int givingP Òthe number of{ `, and  isecondj ’that many, .O µ""")


def ó ¡array8(f):- Ar"""	 à>>> import io,ñ …uct, sys D @io.BÀŸIO(b"\x00 	aabc"))L  ‡ B(b''  ~ _ 3_ ?defb 7abce pbigsizesñstruct.pack("<Q"í @.max! ?//3š P r+ b"abc… ñ  #doctest: +ELLIPSISü óTraceback (most recent call last—"..ÌðValueError: expec“2...ðQ in a Oñ8, but only 6 remainu  ä	 2n =
@uint Ñassert n >= 0  if  ý. Ôfraise ™ (”� Œ ;) >? ‚ %d" % nU  P = f.ô( &ifW == nt Qeturn^ i A« � (%¾'#%d(³…  D·5 »5N ¿+ ¼£d»runicodeˆ/nlÀT< 	¸`abc\\uº�\njunk"))}'  'M ATrue	 L	ÄRline(Ü <0ot  ó .endswith(b'\n'ÜE`no newH ñ found when trying to· « A  "æ "Ž  ‡ ! =Ž P[:-1]8 a# loseTs Ú re1str_s, 'raw-W ³-escape')

 ‹ ½ÀmentDescript_or(
  ÿname='unicodestringnl',. ï=UP_TO_NEWLINE' preader= _[ 3 òdoc="""A newline-terminated Už  Ÿ /.
� ÃThis is raw-v  -escape enß ÿd, so consists ofI ðprintable ASCII characters, and mayF ßtain embeddedK € ¯sequences.( ¾""")


def 6Q1(f):9 Ar"""	 Õ>>> import io °s = 'abcd\u ' ‚enc = s.˜('utf-8')   b> ¶xea\xaf\x8dD ðn = bytes([len(enc)])  # little-endian 1-% q lengthU  ¬ ?t =Ù @io.BT `IO(n +¨¶ + b'junk')  as == tN BTrue X -T S[:-1]O óTraceback (most recent call lastj"..«ðValueError: expec‘7	c in a k�ñ1, but only 6 remain·  ¹	  G¶ 0intÚ Ñassert n >= 0 �data = f.- "(n ifY( )n Ú`return$ #, åó, 'surrogatepassöfraise Þ %("Þ /%dß 2%d Œ ~ 	 "ø v" % (n,² J))

.ÿ = ArgumentDescript«©"? "Nÿn=TAKEN_FROM_ARGUMENT1,  ^«0 ¨@coun�³The first aï  ©a-	B’signed inñ	[ö   giving the number of±  ‹¬ Oecon¢� !--Q PUTF-8† odd "of 	€1 --¡˜ 0con²s that many– H. ñ
4ñ…2, 0 ú4ú.4(¦ú-T À+ enc[:-1]))ñ
    Traceback (most recent call last):' 1... ñ4ValueError: expected 7 bytes in a unicodestring4, but only 6 remainH A"""
	 ñn = read_uint4(f) Ñassert n >= 0  if Â sys.maxsize™  Ä fraise › *("… Ÿ ‰ count >C ‚ %d" % nv �data = f.‘ ( pif len( g) == nx ‘eturn str ò, 'utf-8', 'surrogatepass'_ § B!%d¤ CA%d " ö 	 "\ Í 6(n,² K))

ÿ= ArgumentDescriptor(V [name=L/",+ ÿ=TAKEN_FROM_ARGUMENT4U-  _0er= _� 0 ‚doc="""AÃBed Ud zBing.J	 Ú£he first að € is a 4-®ÿ
 little-endian signed intß ögiving the number of²  ðQ, and' osecondM � !--* °UTF-8 encodd "of 	ã ? --K òcontains that many– ­£""")


defsd » 38(fìr� < Ñ>>> import io€   °s = 'abcd\u ' �enc = s.Ë #e(ü 9 1enc, b> ¶xea\xaf\x8dD   Ÿ0s([vûenc)]) + b'\0' * 7  #»8ÐQengtha  m tX
å @io.B­`IO(n +w^ fjunk')¬ sëBTrueb X µ.8(T S[:-1]O bK8b æ$b:8vŸbŸCb0/8 b*8b8bÀ8,
           ödoc="""A counted Unicode string.

, 
 ÿ)The first argument is an 8-byte little-endian signed intM ðgiving the number of G As in Œ R, and _econdM � !--* °UTF-8 encodd "of 	ä ? --K òcontains that many– .. ñ""")


def read_decimalnl_short(f):8 Ar"""	 Õ>>> import io < ñ	io.BytesIO(b"1234\n56"))6   ¦ R @ LA ðTraceback (most recÑ“call last¹ "..ù ðValueError: invalidð€eral forçð() with base 10: b'¦ !L'±  	 2s =,à€nl(f, deq=False,†rpquotes )ë Ð# There's a h»  z ATrue$=  ! ³ Òif s == b"00"‡ Ìqreturn . ‘ 'el* 1*  a € ; oint(s)öOlongõu ¶ < õ	µ P‹ @ `5678909 
 9L\nI 
 ¦ µ, o \Q[-1:]‹6'L'Š 
as[:-1]m ^
LC = Aw±Descriptor(:  h 
 kname='B /',. ï=UP_TO_NEWLINE'  f0er= é3 ið newline-terminatž  ;DegerO}à ÐThis never haPtrailå6'L'+1intS /fi}M Qin a ¨p Python‹ " o~Pbox wM<opickle? N ðwas written -- but8 ¬ÿno guarantee it will š W!iso «  Æ�0nl_Šon @ mnl dk X jiÀated decimalÿ integer literal.

  ôThis has a trailing 'L', and can representV sM Ïof any size.& ñ""")


def read_floatnl(f):5 Ar"""	 Õ>>> import io 	4 ñ	io.BytesIO(b"-1.25\n6")).  
 R 2s =t `stringu ð, decode=False,  rpquotes L qreturn ¬ Q(s)


 ñ	nl = ArgumentDescriptor(u scname='2 ,', ì=UP_TO_NEWLINE  ð 0er= +# ðdoc="""A newline-terminatedÞ Bimalº  Þ`In gen0  tûrequires 17 significant digits for roundtripÒ ‚identityFApickXuthen un ñinfinities, NaNs/ K ðminus zero doesn't work across box> ¢or on some [ evenJ ð	on itself (e.g., Windowsæ!'tA theìngs it produceò û ¼ 1 or¾ )óèdç8æ€1uct¼   Praw =” ñ uct.pack(">d", Ü›' 3 ïb'\xbf\xf4\x00 '( 4 }'8(H r + b"\n"H@ �data = f.—"(8‰ pif len( b) == 8Ð ?7_unÄ ) 1[0]R ðraise ValueError("not enough * 0 inbeam to¯R8N Ž�8Œ;n=8\ à 	~! |ö n 8-byte binary8`ation „Ì, big-endianš0TheYÐmat is uniqueî aPython Ä shared with°1 j °module (forL  Ô Ø€>d') "in8 cory" (ñ1uctñ›e�H   PimpleàÉ @s do…†  H  =0 -- û y should).  It'8pstrongll› to5 ô  IEEE-754 doublí ,õnÅ l• 0casø is! Rfact t0cal0 × f ] «ƒOn other= > Ðdynamic range�@limiPµ "atÑ:754˜ Ã ¼ ° "add a halrd chop"4 ˆ á0sed¯  reg
J  … `precis?ñto 53 bits.  However,æ ùð a 754 box,
      ô0infinities, NaNs, and minus zero may not be handled correctly
 G   (+ úsurvive roundtrip pickling intact).: ò""")

# Protocol 2 formats

from@ ñe import decode_long

def read Q1(f):\ Ar"""	 4>>>8 %io 2 ñio.BytesIO(b"\x00"))( 0  @ . X2\xff6 ?2558 $7fn _32767:  00v : O-2569 8á -t 8;  .	 2n =O@uintO �data = f.
"(n pif len( b) != nz ðraise ValueError("Cpenough 1 Ñ in stream toq  Ï"1"[ hreturnég !

& ñ = ArgumentDescriptor(ª aname="& "", ò=TAKEN_FROM_ARGUMENT1  Ï 0er= @ ñ doc="""A binary› ð, little-endian, usÑÑ1-byte size.
p ¡This firstØ as one % áas an unsigned4 c, then) AthatC Amany3  1 d5perprets.  m H 
Ž ° 2's-comple± d If4 l P is 0q ¢at's takenK €shortcutu.  ?2 0LB �dg4g,4(g25 ED QF ]E iO0‰£0intŠ3�if n < 0„	 ×4Xa count0 s %d" % ÔœéP4é4é4é	4Ò âé éñrepresentation of aLýêAfour`sYé@ (buQquireÈ· 8 €be >= 0)Ÿ	 E À  If the sizð#e is 0, that's taken
    as a shortcut for the int. àalthough LONG1' ñuld really be usedF ñ'then instead (and in any case where # of bytes < 256).; �""")


# :ñ
# Object descriptors.  The stack» 1 byî ñpickle machine holds o@ Ss,
# Ð  = q_before  Ðafter attribuâ ø of OpcodeInfo
#‡ ó we need names to !be� Ðvarious types3‰ »@ can‘ �ppear on2 ƒ  .

class Sß ý (; !):iÑ__slots__ = (   #‡  h *� record,•info only3 '¹ 5',
 #­  D q  , G@uple  É N‘ (meaning¹ . Ô  ‹   #W!of<9 iä tN )r 0'ob 
… ñhuman-readable docsÂ �this kindŽ -� ;ûVtringY Qdoc', )á ñdef __init__(self,2", ƒ ,h b Á �assert isPance(.V, str¿  G . ! =M j ? g  ð )Y[  
(if€ 
%  k    ð�containe´- 
%  ) × 7 ,þÝ H # =&á 	?docPdoc =]< ‡Crepr‡tureturn VP


pyÃ©= pylong =ß S='intï² B=intÿÀdoc="A PythoÜSteger9.³c   �_or_boolf 
% 
n (o  = )v 
r$ :ean�  9 v   
o   h   ] _float^  
_  `  »  	 @str ¨s‰p :1 
w ( D~   :@(Uni”)Ž …�Î' * 
y  r B^ _arrayâ # f  j  
^ðunicode = StackObñject(
    name='str', ¢obtype=str ðdoc="A Python (Unicode) string obK ñ.")

pynone = StackO d b"None"U e  j ( ) l 4Then   
b Otuplc  d  2 _ Ë , 
^ OlistÀ   
\   [   
Z ?dicZ   
Z   Z   
Z /seY :setX ?setW  E 	Ê`frozen Ï# b . 
¾ obuffert'  
›© Ç . X-likeg 2any4 h ?anye £ny kind of\ ± whatsoever Omarkh "$ 
0-Ó 0""' / Å' is a uniqu× @

Opˆös that operate on a variable number± ÷s
generally don't embed the count+ 1 in og °,
or pull i% f sç’.  InsteaG RMARK 4  · ðused
to push a special ×  ™ # µ  ‚ O A, anJ  n
some oth) … ¡s grab all kas from utop of
L ô down to (but not including)1 Cmost� 
Q @.
""Î� Oslico$ Ô$An;�representDÒa contiguous s ocd

ThisP šñconjunction withÃ À ,ò _  .
M p followw  )5top@ ñ .  For example,OHPOP_Ú`change|!e …
@Y[...,� " × E]
to% ô]

No matter how many !arÍ £ ? 0 af'   ³ 
E³ %, ¡ qgets ri¦ )û 5m (û ú
D § T too)ü# :ð
# Descriptors fKSickle)¢s.

class ÔRInfo(Ú "):UÂ__slots__ = S »¡# symbolicÆ¾*;l n , ð 'name',

      ñ  # the code used in a bytestream to represent+  op- S; a
  õ# one-character string '0 5',
 G# IfK Ð has an argumf bembeddŒ  �  Ž U G, anH Óinstance of A? ÷Descriptor specifying its type.  Note thatI óarg.reader(s) can b �ad and deË » ­ GfromI ° >s± dÛ �.doc docã sD `format¼  6 7rawH `  ý ;s. 3Ïdoesn't have<K !inn I Ô,� p shouldè UNone.1 J'arg®2whaûðstack looks like beforM2is Æ runs; a lisa': _/ ]  afM/th\ . 
[  Vð protocol numberßhwhich X ð was introduced;Q'in¾ E 
\ `human-3@ableÙXs forW  Qdoc',k)ñ	def __init__(self, name,’©/ k N",   !, « ,� !):h  2 ”assert is0(d Estr)%  } . ! =ƒ   ?   y ? d @len( j) == 1]   ! =Ú ] parg is ‹8 or« Oarg,Ý ¹  @ =ØZ ö *†,¢F  ½x% C@x, SfObjectM LI # =§} ¥ Ï FW ¤ $ £ 0H ¢  ¡ 	cAint)B0 <=x	 úickle.HIGHEST_PROTOCOL
C  6 l 	;doch[ L=åq

I = O“RInfo
†Rs = [X `# WaysÇPspellèbegers. IS='INT™ ¡5='I ôarg=decimalnl_short•ä:=[] Jp=[pyintt …_or_bool' $=06 ³doc="""Pushƒ 6   6 ± P  TheéI 4ña newline-terminate« ° ƒ literal?D À    The inteð0nt may have been that this always fit in a short Python int,
   ð	but INT can be generated6 ðpickles written oI ¡64-bit boxn G ”require ac Blong1 $321 ð.  The differencµ "tw¸ #isJ ñand LONG then isf £ ðskips a trailing 'L', 0 pproduce è K óint whenever possible.
 xAnother� ‘is due tou ,= � bool was6h cd as aG Ðdistinct type6ñ2.3, builtin names True© €False we*Ãlso added toL °2.2.2, mappà  tot 1s 1< ð0.  For compatibilityq ô both directionsÚu Rgets È¶  ë¢+ "I01\\n">• !ase 0 .• @LeadŽ @zeroc3re RPfor a;0uinStegerí32.3H (ª’later) un” ð rs special-caseôs*breturn}ƒinstead;I xearlierE Qignor? # l¯ 1"0"7I !thš Õ R"""),
 I(¥”='BININT'?ucode='J „arg=int4  ú stack_before=[] Åafter=[pyint tproto=1* ñdoc="""Push a four-byte sign€G¥  :pis hand’ Î Ôfull range ofw( )8 …sƒ?Cbox,/ lyÊpbinary } Ps (1 Ï a  opE4 !in— )I Ifµp  °²non-negativË0fit=r 1 or 2h ,• X$viK‚'  `2 save$4acer »1¬ ¸ 5='K  ¼Euint|½<2one¼/un¾	 —ð  space optimiza²\©ery small J5intÛ"inùE(256Š2M 2”<?two6AposiY3 inÕ Â, 2**16).  I«|  )êa}"be…<ed „2Â"t †#1 �ŽaÃ� ¿dtL  t decimalnl_'}Àint],
      ¡proto=0,
  ódoc="""Push a long integer.
# ðThe same as INT, except tha óe literal ends with 'L', and alwaysI ñunpickles to a Pythont ð.  There doesn't seem a real purpose5 3theL €trailingk ª BNote— €LONG takl óime quadratic in the number of digits when\ ¨  ^ ô(this is simply duˆ q natureB ãecimal->binaryF ð conversion).  Pwð 2 added linear-t› Æ(in C; still¨  J #in, ) Ø 1Z 
 £4 opcodes.* R"""),¸€I(name="( $1"ï . t='\x8a' @arg=ø1 ú stack_before=[] Åafter=[pyint T2* TLM0 usOõ one-byte length¹ñA more efficient encod2 f*;¾° % ý Ïsays it all.	4	b	4È 	H_found640# W$ðto spell strings (8-bit, not Uni%)œGu'STRING, # 5='S  EN /nl? ‹s_or_strQ¥8o s object® G` argumF!isDƒpr-styleð ,¤pbrackete qu9¤charactersÂ  ÂÁperhaps embe¼rescapes³l 1ext Quntil¥Cnext›0newó c > Àse are usual]eWd�  ´str instancöF À!Sgiven# Ubñr constructor. or‘ tdefaultÞ Á'ASCII'.  If  T Qwas 'Ÿ ' however,( 0y w«b• d· 1as . “¼ ?eadœO'BINXTX –Š Wé¨üWr­5twoõ s:` first%3a 4Ô´ittle-endiaVQsigneÝ@ givw Èˆ² ŸÝDõ`secondj |Bmanysq, whichN ön”ðly as the string
   ð'content.  These are usually decoded into a str instanc$ €ing the
F p  encod €given to ñ Unpickler constructor. or ƒdefault,C Á'ASCII'.  If  T ðwas 'bytes' however,( „y will b‹ · 1as . q object¼ Cead.o a"""),
 ô	I(name='SHORT_BINSTRING'š  5='U ´arg=string1# ú stack_before=[] ‘after=[py� u_or_str$ eproto=J ðdoc="""Push a Python| ]Ê .¶ ³r³àtwo arguments:à first is a 1-y r unsignÑq givingÿ  0 “number of6!in è R, and PecondX “that manyE  d �s, whichH±taken literP"asB : zI €zF ?the€ zB €1zH ¶€0# B×! (Qcol 3prhigher)ï¥…BINBYTESŽžB  žŒ4†�–3C –f _•ý–4–Ùlittle-endian¤?ª> ¤–
Ç�O –Ì , $	…C…Ø"…X!w qQ' x ÷8cøE\x8e û8¸v'>û?2n 8ü’EüN’Àaken literalñly as the string content.
  a"""),
 ò# Bytearray (protocol 5 and higher)) ñI(name='BYTEARRAY8',B Å  code='\x96 Targ=bY 8) ú stack_before=[] •after=[py8 ! ˜ $=50 õdoc="""Push a Python 6 ‚ object.· ñ  There are two arguments: !àfirst is an 8-E ó unsigned int givingé  R‘number ofr As inH  : F,; * `second\ ’that many4 È Rwhichš Æaken literal¾U Á
€Out-of-b³obufferÊµNEXT_BUFFER¸Ë7  ËDNone¶ Å‰ Â
À>n oÀ Ã¦}�READONLY· •· "py*¡ Ö „¿ @Make6¿ µ read-only.É ð# Ways to spell Yªä ENONE}�N Ö Î Enone M0ÏM‹ Œ " oÏ· Àbools, start`Qwith Y ñ 2.  See INT for how this wasGr# done 5 ®\EWTRU?\x8àî É _Ø5ool ± .=2
‘True ontoÛC ¤ OFALS¥  9¯, ^¥ OFals¦ i0UniLstlUNICODË VÈ uB R$nl6Ô= Ö R0,  #ñmay be pure-text, but it's a later additionF!  ¹
ç   ˜ca raw-œ Ð-escape encodÕZof a Q õ  k0so µ  [Óain embedded G ¡sequences.ƒx bextendq  untilgÿnext newline character³ �‘SHORT_BIN¾ÀDE',
      cÑode='\x8c',
  ôarg=unicodestring1 ú stack_before=[] “after=[py<  tproto=4. òdoc="""Push a Python Up  q “ object.
’ ñ:There are two arguments:  the first is a 1-byte little-endian signed int
à q giving<  number of 9 As in ‡ Ð.  The seconda “that many˜ 4 4, a Ðe UTF-8 encodc !ofO 
Þ .> R"""),ã õI(name='BINUNICODEŽ ‡5='X žYž)ãžI4ž?uns ¡8‘¡E\x8d ¤8ý¤)é¤H?n 8¥£�ó# Ways to spell floatsC`UFLOAT§ºF  ·7 /nl°5 ð0C ®ó
Newline-terminated decima«  µCeral² {ë }qrepr(a_l )uPn gen6 Á requires 17ñdificanòðdigits for roundtrip conversion6ðbe an identity (thisw  so7 ³ñIEEE-754 double preciB Ðvalues, which8 w,Þ´ @ map K åon most boxes)ö IÓ !, ®ð  cannot be used« ðtransport infinitiz ƒNaNs, or` òminus zero acrossj ð (or even on a single 2, i­£platform CJ plibrary‰ q't readÕ$Âs it produceaósuch things -- WindowsL €is like JP), buPñ y do less damag Rn BIN on  ses withH wgreater�äor dynamic ranE ±{À """),

    ñI(name='BINFLOAT',
  ucode='G ¤arg=float8" ú stack_before=[] ‘after=[py4  tproto=1, €doc="""FX ó stored in binary form, with 8 bytes of data.
¦ ð!This generally requires less than half the spaceA è £ encoding.J $InH $, ó" cannot be used to transport infinities, NaNs, orL òminus zero, raises an exception i’ �exponent  ed± `e rang§ K òan IEEE-754 double, and retains no moreì a53 bit&`precism 3(ifL —there are3 Âthat, "add a, ^  chop" roun#4 is J °cut it backá53 significant„ )XR"""),¯`# Ways1 ³build listsËˆœEMPTY_LISŠ]ŠDNoneEˆ m ‡
APush§Amptyœ .º ž eAPPENDŠ $a  $š  py„  ¿uyobject� Â 3 '  20í 2`Append¯ K  Uaµ l0  SŸ Ÿr:  ... ‚ 3 an� Î*  (: * %+[+ ]W „althoughM Qis re}aextendÂo-place 
IS:Je JBmark !, DUslice; _Ø  ŠW ‰EÃ  Ja by a S  7N  o ¶f	� œ rf t q;R lnÉ f$½Bþe0out^ ¢rtopmost/y!, ¿ „ 0R  AllØèñentries following R ? ÿž j#to‘ñ a single PythonJt, which  ?ÿ1 reC Ss all¾ I À_ from� óonward.  For example!O ´» ³1 2 3 'abc'n 
º / ’[1, 2, 3,( ]) 	†ÀWays to builñd tuples.

    I(name='EMPTY_TUPLE', •  code=') „arg=None  ú stack_before=[] ‘after=[pyo  tproto=1, òdoc="Push an emptyŸ J."),¡ › t› Ámarkobject, µ Uslice”  _± 
0± ’""Build a­ ò out of the topmostg  h !, [  † |Q  All6 ‚ ñ entries following R ? ó are placed into¯ò a single Pythonœ t, which � 1 reE Ss allÀ K � Ofromƒ óonward.  For example²0  S W: ...ü Ã 1 2 3 'abc'n / %!: / ’(1, 2, 3,( )) /""1³E\x85 ¶2any2Cone-bPitem —"heAThismò pops one value ofU�¦and pushesyfálength 1 whoseC p sis thatP óback onto it.  In otherD bwords:v  § b[-1] =N(Š _[-1:]”2�”6 ”/, Ÿ:?twoŸ0 tw em|ñç   .  s¡2¡ �sÈt±P ¡$ 2:¢[{£S2:])]Ú83‘¤7 ¤¯=?hreP  t  ES0 eV3µB3µ 3µ±# Ways to bxOdictÁEDICTÂÕð }',
      arg=Naone,
  ú stack_before=[] Õafter=[pydict tproto=1+ ðdoc="Push an empty / Q."),
e ÔI(name='DICT'6 ucode='d _arg=N˜ Ámarkobject, ² Uslice’  _® 	0x ® ‘""Build aª ò out of the topmoste  f !, Y  „ .Ø Q  All6 € ñ entries following R ? ñ are placed into%ñ  a single Python› t, which  X 1 reC Ss all¾ I Ž Ofrom� Èonward.  Theë ³ alternatesL Èkey, value,  ó....  For exampleì0  SQ Q : ' ú ³1 2 3 'abc'a / b!: / ’{1: 2, 3:( }) -""QuSETITEMDTs TÖR, anyS Z( AdXAkey+7� pair to@xist ÈE1›  q|* ,* �0whe[¯ò has been modified via [ r[key] =^ ._ bSScu c¿$
m!""eðn arbitrary number
zs{
ÿ J 9  ÿ;Á¤is taken a(%an< á€sequenceX ‚keys andm€s, added˜  r  €ÿimmediately under¿ .  Everythk !at]  1 M w ð is popped, leav=  ‚ qmutatedp0 atD  H ³ê ¾"_1õ !_1­Skey_n n` Ô;%_iÖ¤_i for i ik  1,X`..., nì ~¿ that order Q# WayCb0BsetslÔŒEMPTY_SEÙO\x8f%l,ses4Å
s>setr0ADD!¿À     code='\qx90',
  „arg=None ñstack_before=[pyset, markobject, ! jslice]4 Safter3  tproto=4* ðdoc="""Add an arbitrary number of items to  ãexisting set.
± AThe   . t  ² p follow-   wtopmost¹ Ã is taken asJ  a sequenceK y p, added€  G ðset immediately under  a J   .  Everyth‹ qat and 7 ˜ dpopped$@leav=  g pmutated4 atC  ¯   ‹Sºq:  ... ¿	m Qtem_1  ð #_nÁ < ¨ ': < uSwhereO òhas been modified via Q.add(Y Ai) =Ì¤_i for i il P1, 2,ƒ A, n, ãin that order.“ R"""),€ P# Way”òbuild frozensets õI(name='FROZENSETÝ¥code='\x91 ðÉé‰ ïB· a¹ D outÅJÔ,,ˆ ß1All õ� entries÷a¸£laced into]ö a single Pythonš t, which â  ÿ@ repM Ss allL 'of˜ Afrom × Ê ó onward.  For exampleâ"  ‚¾ ½: S1 2 3o ) « ) ¥ "({\33})- 	E: Ãmanipulation]A5POP(;(2any!
§_§ %=[ 0ëtDiscard6a<„, shrinkT q by one! .#Ã ,DUÃ 2Ó ûÃ   ³í × OPushÔ  Q onto Î áagain, duplicaî.itØ EMARKÉ œ( Ù }q “^  Æ !""È . À B e£s a unique7a, usedº thèpÃ ç£identify a³dregion´ € contain§a variable5| žmK ð	to work on.  See markobjñect.doc for more detail.
  a"""),
 ñI(name='POP_MARK', •  code='1 „arg=None  ñstack_before=[markobject,  jslice]- uafter=[ tproto=1% òdoc="""Pop all theK  Y ás at and above †topmost ~ .Ö À  When an opÉ û using a variable number ofd Gis dæ ò  is used to rem� 4oseœ ,š  e– SÀthat delimitK @heir  rt� ±position onÝ G² ð # Memo manipula3 ñ.  There are really only two oper& Rs (geCBput)w�# each intò-text, "short binary"Û T"long ƒ flavorsnD5GET/ v5='g  ?¡decimalnl_a �  J _42any =0E =ARead÷ŒQ fromMm3 ={push ite¡�The index €7 y  ú= ¡s given by[ ónewline-terminatedN ï @ stràñfollowing.  BINGET4TLONG_ õre space-optimizL �versions ~D q�h  �Euinto`ÁX wE wgÕ1-byte unsign(†integer m�ó z&6j 64h6¦46ïlittle-endian D,PUóp<ó!’ê StØ ¥“@ topº o” ¸^ ¿£not popped·5ð 1loc0 ò@writ toC øaÿ õ ù*PUù #reG ÿ ùðPUT',
      codeq='q',
  ”arg=uint1 ú stack_before=[] Wafter eproto=< ñdoc="""Store the M ‘ top into …memo.  T ó is not popped.
˜    …index of8 ò location to writeX ±is given by, c1-byteJ €unsigned+ ó eger following." R"""),y õI(name='LONG_BINPUT+ucode='r ;4$;«4;ßlittle-endianIuMEMOIZE5EE\x94  HONoneGŸanyobject‹ ”•”as†“number ofgñelements currently present in2 . •r# AccesV `extensðregistry (predefiå,ps).  AkW v1GETX ƒ# familyhïEEXT1�£%82  £&›2é›EÒ  z š  "0is  A andÁsimilar EXT2 `EXT4 aÎ” using a î  =@popu6 ð that are pickled5 õô, typically classes! It is enviyeŽ òat through a global negoti¡3andƒ ’  0proÊð, third parties can set up a mappÍ sbetweenG i: 
È  ³ s-€In order„guaranteâ °àrchangeability€ %e Kc m¯  y Ü tP #beá `, alth  i O  ` 6 Ss mayF 0be Öõrved for private use¯  pr has a ¬¤  �@argu&# isx usr"o In Ä ú, ~*«ae O is pushed G†êv	 í m='\x83×õB,0See01.  2K1two¾Mà
      """),

ð    I(name='EXT4',
 ¶  code='\x8 „arg=int4# ú stack_before=[] õafter=[anyobject tproto=2. ñdoc="""Extensiony #.
†  See EXT1.  ó4 has a four-byte integer argument.8 R"""),E ò # Push a class Ž ñ, or module function, on the Ø “, via its' Y `# and .¢ ;kGLOBAL=c  :ôstringnl_noescape_pairt L$0E Lð cglobalñ 1 (mî i.attr)ê Ë ò
  Two newline-terminated ¹ �s follow"ï 0 op&ñ .  The first is)�  taken ¯z 7,AeRecond! šWL  I ±†. ª is pushedÉ ð  More accurately,® 
H ñreturned by self.find_W #,*)f I «ñ, so unpickling subD ðes can override thi:Ïrm of lookup¤ GbSTACK_^= d Š%93  PDNoneù“ >Ppyuni6 %,  + žãR%D	†ÓWays to build–s8Lñe doesn't know about directly�À# (user-defiÈ? �).  I desV W 1doc žt†H  Ìpcompreh|ðbly -- you really have³ @readJ £  \3 toG  AA all" Óspecial casesZÞeREDUCEÅ F 5='R ÕI CTÕ'n‹˜`t from,qallable¯%an`c tupleØ ¬ - Ád0@mind… êõ__reduce__() methodA SC Ct: ... cz !pyl e"  ) ·): ) #(** )ð– G  å † "Â 0 arœ¶¤two items w Vby a Á ¿ r  Apply[e´ !to1arg¼ ssuppose0pro, eorigin¨™ð at least get it‘Drted9!If: — ½  "!3-�    lK  éðonent is an
      aðrgument to be passed ðthe object's __setstate__, and then ‘ REDUCE
  ñopcode is followed by  ¤to create K C's a~ T aK cBUILD Q ™to apply Š § %atG #.
= óIf not isinstance(callable, type),¸ ð complains unlessÔ E 3 ð
 has been registered with, ó copyreg module's= òsafe_constructors dict, or6 � \ sa magic: 1'__= òfor_unpickling__' attribute~ ña true value.  I'mõ CsureK  why it doeØ Ðis, but I've &   sÕ Ethisót often enough whenL ²I didn't wa.s<wink>. R"""),�I(name='Â#',!  5='b „arg=None  òstack_before=[any}  ]+ Wafter*  tproto=0. ó
doc="""Finish building anßZ, viaX!or®u updateVS£  £ e: ... § ƒî + £ *: + % \'reB ‚may havek munDd, aL$s:: !IfD!B¢s method�™h .* (�)\  Ualledö AElsep , P must-a&, �  Æ  S ó1V %`d�€  ® V2.__C .* ¯  ( /  v EINSTeui  uôstringnl_noescape_pair.
‡BmarkÚ !,  Uslicej _æ‰B‚” a class ¡oT�i°!e Êöcol 0 version of s1's OBJ%Š  ]‚òtwo newline-terminated as, giv¦Ìè¦  Ñ0, jø�ÅcGLOBAL   ($se| ñfor more details about that).  self.find_i (z  , q )Ž Cis u•5get:˜8÷In addition, all–2s o¬°› ð  Žstopmostl ñ‘ are gathï inƒP tupl´ò d popped (along�$thü T  N )>STUPLE=Æ 0Now²3get” icª ßfÖ oü!seŸ   `  + Th g§ ¦is empty (ˆ ð was at the top ofÅ the stack
  $at Urt).
 õ-+ The class object does not have a __getinitargs__ attributeG ôthen we want to create an old-stylc ó
instance without invoking‘ `its __m ñ__() method (pickle has waffled on this overÛ `years;¹ L xcallingP óis current wisdom).  IJ Pcase,µ ¥ #ofK 	Ê Sdummy3 Q í d: d‰ 
0try	£rebind itsI !__kF (  ²sdesiredY Œ ž fè “succeeds,J  3 Fnew ­ ¾tis push"
ž –we're don»`Else (M ¢argtuple iþ¢empty, it' 	Æ 1’ oˆ LH ),8S codeÝ @firsƒsists th¾	[ V ±safe_for_un(Sing__I ¬Ó  Unlike as f« /__< ô check in REDUCEá iñn't matter wheth€&is¨Àa true or fadPvalueOš ConlyG sH Qit exô B(XXXù Z A bug«‘º  ¼   F 5, UPErrorÛeraised» 	] H  & \) B	B ðobtained from INST's argumentsŠ sapplied †
@  _ ÓÉ  `resultáJ 	ù bNOTE: ëTw/@away³Python 2.3.h I  “ ødistinction betweexand new!es"J ­ {§make senseu s R"""),ÄÄI(name='OBJ'Œ I5='o „arg=None  IÒ_before=[markn \y % jslice]8 “after=[an+  tproto=1. ãdoc="""Build a×«‡TÄiä!e A  col 1 versF&of 10'sH0 opâ  ® 4d iZ¡very much æAit. ÛÐmajor differezm Q …   ak¹fz@Allownã¤be retrievã CmemoH 0repådly if several®3s o^ $am3are:d¼ Û  caOÝ °more effici—ð(in both time and spñace) than repeatedly
  ó'embedding the module and class names in INST opcodes.
= aUnlike ñ, OBJ takes no arguments from\ = ó stream.  InsteadK  ~ s ‘object isN Qn off@ ð	stack, immediately above E ²opmost markG :« S> Ç before: ...% ì 1  g SsliceU : qafter: : Ònew_instance_7 g cAs for Ô ·remainder oÇ º ‡ #iss õgathered into anOq tuple,¡@thenü ó logic seems identical,K `exceptýt˜ð__safe_for_unpickling__ checktõ done (XXX this “ ²a bug).  Señè  â ¶gory detailPNOTE:äÁ Python 2.3,¼  ,6are¯  ¨  =0howØ ¢ ge¿ e¥ oð.  That was always2  /Bent; @mpleƒTationZÁhad divergedÂ 1acc4³al reasons.:R"""),Ø I(”='NEWOBJ'\ e='\x81 „arg=None# N_wR=[anyÀ  Â ]+ h*  tproto=2. Àdoc="""Build"X  —£2TheÓü� should b8Pought™ as contain
alZ °followed byp á’S (the  beD   ý F 0top>@CallŸsÐsAargsÐ0ey kpopped÷F  ™ Z Âvalue return“ `cls.__š€_(cls, *X )Ó@push% 3ackG oW H ¢ ñ5_EXáô%92 ôÿ&4ÿ„ ˜ † keyword±Cdictv$   # J #M Õ6 #U, *kw, -/  (‘# Machine?3rolx1UPROTO)<%80  <Tuint1Ù’1þ  P*Ðcol version iÁndicator.

  ó0For protocol 2 and above, a pickle must start with this opcode.F öThe argument is theV Ðversion, an i  ón range(2, 256).E R"""),˜ ãI(name='STOP',   q 5='. „arg=None  ú	stack_before=[anyobject]  uafter=[ ý $=0% ±doc="""StopÆ !unµing machine;TEvery%Nends   ˆ 1 atR  Z !of ² Þ �is popped(rd that'I¦result of � .Z A £ should beK Pemptya n[ `# FramÐ ssupportÐ sUFRAMEdtE\x95  wTuint83… xY o4< oI˜eµ p beginn¢ Öof a new framy T�er may us; —ó to safely prefetch data from its)punderlyk ostream0@WaysR BdealãpÒ stí;IDsAePERSID/BÆ ?ÿstringnl_noescapÃKÙÃ@Pushs~Ðidentified byÝÄ Ã Uñüe module doesn't define what> “ means.  û _Èòline-terminated str-style (no embedded Ss, no©pbracket©ðquote characters)F ñing, which *is* "�â "Û
=Ppasseg#isH  êVself.åó_load().  Whatever— [ ¬€ returnsþ‘pushed onÏ° re €no imple-TationN -f t Ä in Python'sÿrer:  it˜0be ÈlØM  „subclassg 3BIN»˜¶QÆ ¶l&²1n ²"CLikeyr, excepgK0 IDw^7 of|– (insteadƒ befa•iÎøR byte3  Tp L v  adUî V X RG X$Se ó for more detailòÀ """),
]
delð% I

# Verify uniqueness of .name and .code members.
 €2i = {}
  ð

for i, d in enumerate(op% Âs):
    if dZ 2in J    ñraise ValueError("repeated+ ñ %r at indices %dž Q%d" %\  C  (o ,B 22i[ a], i))6 ’  £  ·   /2i’  + ’ % <  ,  ’  	 ’ “ « A = i  ' 0  C
delÚ P ,„?

# :¢
# Build a· òop dict, mapping çñ characters to OüðInfo records.
# Also ensure we've got the ssðstuff as pickle.py, although& ð	
# introspection here is‘ Bey.
•"op¢ •’¡ sÜKAop[dÜQ] = dKPd

de}  � _� ó_consistency(verbose=False):
™Dpy =b.copy(] ~  Î \N ‚.__all__ˆ  ¯ðif not re.match("[A-Z] ‚0-9_]+$"½B 3   3if � K     ¢print("ski�ð%r: it doesn't look likß¹ ¦ 1" %M¼  I   �continueë   É  C² = getattr( ª + Ü £isinstance(  = ÷ , bytes) or len j) != 1× ï ð vG ¡ö  [% "©  Ø  "¡  (,0   )7-  8 0.de ¦("latin-1"e'if`  * Aþ `"checkŠ ²  ø !w/’   ‡ÆÙ û  > 
ð 	) dè6py[Ú ]! O E  Ä  
É  7ç   Q ³ ƒ �.py uses˜ Ë ³ Z  @"butYWre us÷ g  ‹,¸ ;   Ý D -ŽSp# Forgeôis one.  Any left over$  7ùend are a problemÚ #Îða different kind.
       òdel copy[picklecode]
 u  else:   òraise ValueError("8 ò.py appears to have a  0 opW y with "O  S 	 Ñ"name %r and 6 ÿ%r, but we don't" %C (C ,|  C !))1 !ifé Ð £msg = ["we» º 	¸ cs thatP  è qdoesn'tå &:".1for³ a, d inm †.items()u  î @msg.-@nd("  ±  ô ! ²   %r" % (d. ,V Æ  0 …ò\n".join(msg))

assure_È ð _consistency()
ò  ?

# :C
# A;ó"generator.

def _genops(data, yield_end_pos=False>Óif isinstance. ³bytes_types&    J p = io.B  !IO. $)
qhasattr ‡, "tell"? �getpos = H . 9 
% Âlambda: Noneb —while Tru<Q 5 (� ª íi fread(1 6=þ€2op.get(1 !.d§§("latin-1"$ifg!is“ 
zšde == b""  � ZCö exhausted before seeing STOP"´  D 
(    Z  T´osition %s,¸ ¡%r unknown{ A  #"<0 `>" if jü À  ,F  YHS.arg P 
0  =d^ û % Ë K .æe{7*ifø
i a, arg,Ô  N ; ° :'.'w cassertx ‰ 7'ò'B  –RbreakÌË5SB"""Gó“e all theU s'&.='< 'tða file-like object, or stringPntain‡ T 9 G CEachf  e    X ‚�ed, from’ dcurrenç aš:Pstopph qafter a÷_ ùs delivered.  A triplei A for4e˜ :ñ  B Ü   H Aan ODðInfo record, describ˜  à Â 7 !IfÞ  Ð has an argumð(ent embedded in the pickle, arg is its decoded
    valu ñs a Python object.  IfB  op/ ð doesn't have anQ Qument[ L ‘is None.
 > € 0 hab ñtell() method, pos wasf ‰ 3 of± .+ J ábefore reading. @currî œ ¬ n im SbytesÎ ,I ¢it's wrapp 0a B$ $IO& A and` ’latter's ‡ ¡ result isH Öused.  Else (e#< ,U { ñ not obvious howL �to queryš× ‘position)#X ±1"""8 ò return _genops(ù O)

# :C
# A’õ optimizer.

def A(p):“ #'O" $ a4 0str³€by remov  un?R PUT ¾!s'> ¢put = 'PUT !ge #GE àoldids = set() #  91allV "id¦2new1 "{}*  1   Œ tby a GE‘ � œ S = []9  ñ# (op, idx) or (pos, end_pos): –proto = 0 ²header = b'Ý 3forþ ?G  »Øƒ, yield_c S=Truep � "if3 4 ³ R.name‘ !   ;‚.add(arg¦     5  s.bnd((puÒ)' 0eliî ] Ú == 'MEMOIZE'j ¢idx = len(t E l Ãˆ  @     ˆ  & C ˆ 'FRAME'ð 
2pas Y 6  G4 
ã À!>  
ß  P  # =¿. 	Ê xq[arg] =	 é /geq\PROTOof‡ ¬ 9arg„ !ifYO== 0á ²cp[pos:~]F ;elsi  à 	!Í= 9 Bdel Yda# Copy²> € except añ	PUTS without a corresponF1GETÍ   S= io.(£ q# Write[ z �¢any framinZPout.w2 (- K › þ
 1._P”0r(ol0 *  —=F>= 4™7  r.p �er.start_ ðing()
    idx = ñ0
    for op, arg in opcodes:   õrameless = False Æif op is put0  4 !ifO 0notS WnewidR  "   vcontinuQ   õdata = pickler.put(idx)u  $ Q ¹[arg] = idx …idx += 1 %elª +geª o Gget(^ w Jelseä : @[op:Š o  ¢ f5@len(- 5) >×   õr._FRAME_SIZE_TARGETF * qcommit_ q(force=  ™¦ 5if  
® O ¢file_write› w è : .  q Qr.endž Bing(‘ ÿ	return out.getvalue()

# :Ó
# A symbolic_  disassembBP

def (² ,’ ³=None, memo òindentlevel=4, annotate=0)IÆ"""Produce aq j cy of a‚ !.
Q'r '$ a tð
-like object, or string, òaining a (at least oneMJ c.  Thee  V € ñed from the current position, through–  " £first STOPñÃ encountered¾  Op< !alËO'outÈ ‘ to which| ’ Ay isq ðprinted.  It defaults6 psys.std"1
s  žt �Python di7qused aso !'sËb s �may be muÄAd byW), if7 vPs PUTŽ1BIN
 .K @Pass— 7Asamej Ã Å ranothera P callb €n allows ŒyO €to proceÃ Ôcross multipl× Ø pat wereD q createÄ ƒ I ú Rr witz� ð
.  Ordinarily you don't nu  ­ÿ orry about thisð„ | `numberé`blanksXú"o 1 › ±a new MARK Q˜	ú4t u'§`nonzerX astructK!()s�dd shortn adescri­ ›  © ÅÐ on each line œ ed2putä U¡` givend '� @mustN0an Épger andŠa‰ AhintO ƒ ‘column whÈN0ion¸ “uld startÏD † @is 0ža$no�4ion®aIn addß ¯ d§è ðy, some sanity checks are madô&e:

    + All embedded opcode arguments "make sense".3 ó Explicit and im õpop operations have enough items on the stackL tWhen anz N ùly refers to a markobject, 1 isÇ ¯  actuallyf òA memo entry isn't_ õ
enced before it's defined  7The~ < ‚stored iÑ  [ 0 j U  s2"""I‘# Most ofphair heˆ ós for sanity checks, but m0 Áit is needed €# anyway.�detect wYò protocol 0 POP takes a MARK of{ ’H a(whichÛ 6urng  Z bindent< óblocks correctly)L P = []ì  Á# crude emul ô ’unpickler "if¨�is None:  D  cP = {} ?   R  / < 1maxU = -1< 6max@numb… 3een3 ,rkÅ a# byteBposiá"of
4ˆ"âchunk = ' ' *  Qlevela ¡errormsg =å  1ann¥ = 
 Atateä ¡olumn hint  _6  &~ ,³P, posºrgenops(`)F"if" Qs not}   àprint("%5d:" %, ò, end=' ', file=out)½ 0 ðline = "%-4s %s%s6 b(repr(— .3�)[1:-1],³  7  ';`* len(õŠ)< n GnameŸ ýDmax( ,l.)— = { _ t do9 mu 7 kafter 6  é /# 7 Pnumto3=ì g ½ P# SeeÅDther±Pshoul°P popp¦c !  £T   Q; h D or £ 5� == "POP"ÒÚ  A  . @[-1]P ×Ì› h aassertË   §1in N	— Êif __debug__Ä I ö )  - v ¤ ß \slicew  ¾  N    ‚=Ã % V.pop(c p   ¡  - ë     R Ö!"(²•at unknow1‰offset)"¨  @ 7elsAð            markûmsg = "(MARK at %d)" % markpos
  ð# Pop everything3 ñand after the topmostB }object.F øwhile stack[-1] is no3 :3  ˆ 1 m.pop()   	�# Stop la¤ àcode from poppÃ Žtoo much¨ ?tryŠ ð	numtopop = before.index(7õ ¢ ÿexcept ValueError[ �assert op© í.name == "POP"õ  ‹ 0! Nelsec ez õ ­ 
 A"no ’exists on�%"
R ö# Check for correct memo usage;)if» ó in ("PUT", "BIN
 VLONG_ šMEMOIZE")¯ K  * 
)   Œ °_idx = len( ƒò 5(asì0emo; ì  P >�4arg´INone9  =  ~  R i = arg !if7 !in Í ¥"L ð key %r already defined©` AelifM[ #  É ñ
empty -- can't store into  
xa : » Võo ] 4 1 in8 è j Á ( [  C2] =ª Œ h£ A†$GE†
 †  {ä¡ jú)¤1�     1 = ° `[arg]] ! #G0bet‘L© emulationE †Phas nœ@ beeÃAoredÈ*]  ifš ü y Å1 or´:msgÇð# make a mild effort to alignF Zument+ñline += ' ' * (10 -—•)Ÿ‘ 
†  8V ­+ repr(argH  \Æ @ ' 	knnotat7w £* (annocolÒ   Ë 1d :ion3W ÀW ›  ½  !z N> 50A  
  Ç 	@  R “À + opcode.doóc.split('\n', 1)[0]
  õprint(line, file=out)
 Åif errormsg:  ; ð$# Note that we delayed complaining until the offend kopcodeJ Awas ˆ 9ed. Àraise ValueE† (Œ ¢ q# EmulaŒ ö e stack effectsM qif len( Ê) < numtopopÔ o ó"tries to pop %d items fromj iwith "µ  	 U"only> T" % (€ ,— %))G /if¢ 2dely $[-C :Ìúif markobject in afterä hassert( !no, Zbeforš M 3·.append(posz 0ext k  Ìò
("highest protocol among ‘s =", max | <"ifç ¼ œ  ¾ Remptyí � STOP: %rg" À)

# For use �ðdoctest, simply as an exampl®r a clasúrickle.
 "_E% ™ ðdef __init__(self, v­)  Ê   . " = p

_dis_� ñ = r"""
>>> import po  ñx = [1, 2, (3, 4), {b'abc': "def"}]( cpkl0 =: Á.dumps(x, 0) @dis(" ^@0: (— AMARKo@1: l   @LIST @   (! 0 atF   @2: p $PU" ! 0@ @5: I %IN 1 @8: a aAPPEND 9, 2 -12, +13© #14=  T m 3A 7 4 P20: t6   PTUPLE	 ã !13.21ä Ë -24Ÿ +25Ÿ R26: dX T  DICH"25e 7e P30: cA `GLOBAL
 0 '_-Pcs en	 'Î .46A +49“ Q50: VH ‘   UNICODú B K #55K  % Ù6/58> alatin1Œ 6Œ A 5^ /69w!49#70† ‚ 6A P73: RZ aREDUCE 4, 7 7® è 1def§ 8½ 86 P85: sb qSETITEM 6íQ87: .' OTOP
Öá 0

Try again  ¤a "binary"¥
›Opkl1¹ 1¹1&P 0: ]„ `EMPTY_ª ® P 1: q 4BIN@˜À3: (    MARK�
    4: K   pBININT1 1 6 2 @8: (+   AMARK 92   S 3! /11! 4! @3: t:  RTUPLE (g a at 8)+ B4: q �  BINPUT ¼ Q16: } Ñ   EMPTY_DICT8 78 × T19: c8 aGLOBAL °'_codecs en	 'I /35I ê /37  Q38: XP  ñ BINUNICODE 'abcW '46W  ( Ü $4F 	alatin1I /59I 5Á /61m!37n'62M ’ 6I @4: R«   aREDUCE !7 71def¿ 7> 8> P77: sn   qSETITEM @8: e   pAPPENDS <3Î P79: . ðSTOP
highest protocol among opëð4s = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
 Bdis( T.dump ! �.dis, 0)› # 0‚~: - A dis P17: pÄ ù@   0/20Ý 0¸ Hfrom¶ É �_ExampleÝ Tx = [ ‘(42)] * 2 á xÓ , Á ¢ P 1: l»   2LIS¹%  ¦02â / 5$ ñcopy_reg _reconstructor,.30J (#33§› #34[  › ƒ\ #56\  2 ŒP „Pñ_builtin__ objectM  ™ÕM TP82: N   1NONe82.3ó#84§ £ O#87½¹.88, 2+91/P92: d�    b   Ê!91Ë.93R ;P96: V5 �   'value/108   ?`106: I8 $IN>  4s31101xb. ±�
  112: a % @3: g %GES  ö 1M, 7d!$1÷]} ­ *åså ¹ ËjÀconstructor'£
   29: q  aBINPUT 1 Q31: ( q   MARK D2: c   `GLOBAL
 ð 'pickletools _Example'6 '54h  , l 2! 6W ñ__builtin__ objectU /76U 3U P78: Nn  ANONE D9: t   PTUPLE	 0  (ê p at 31), '80f · 4 B2: R8 q  REDUC` /834 54 D5: }4 ¡EMPTY_DICT Ò l 6 D8: X8 òBINUNICODE 'valug/98x §7
  100: K@ @INT1 4�`102: s   qSETITEM6 @3: b   QBUILD @4: h   RBINGE8 á `106: e   pAPPENDS Z Y`107: . ò8STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-ñ test.

>>> L = [] aT = L, ²L.append(T) Ñ[0] is T
True T L NL[0]  )  ? Bdis(À.dumps(L, 0)õ 3  0T f ÖP 1: l  2LISH‡08 @2: p# ¢A   0@ 5Q @6: g*   ˜. ùõ5n .10n P13: aY × � /14Ç0›#1#]d   h  )«3�. 6û3# 7Jn . 90ð1

Note that, in Ò÷"0 :1 of àq tuple, ñ
disassembler
has to emulaW pe stack[ Porder brealizu C 3POP] ì´16 gets
ridy  ¡  0M²TÕ:' 2ê à Ú   ît# 3€  ò6ð   ¦ 7ö  ú Óó6ü/11~   ï e @5: 0   0POP” *16     Û1» ³ k 2XZ5T, ZÀ: (    MARK
€    1: ]   °EMPTY_LIST
 @2: q   `BINPUT
 ! 0 A4: ( q   MARK D5: h   XBINGE6 @7: t  RTUPLE (F a at 4)L 8~ 1 R10: a7 �  APPEND D1: 1 APOP_S %  [ 0[ #12§ Ÿ W @4: .@ öSTOP
highest protocol among opcodes = 1

Try  ñ2.

>>> dis(pickle.dumps(L, 2){ à 0: \x80 PROTOk 0  2» # 2ˆ„3€kÄ ™7b !5 [×  KE  G
C2ò Tò ›0Š0POPŠ52ÿ3 with annotations:=43),* ?e=1;43 P�ðversion indicator.Í W `   Pus‰ ² empty list- mñ
 Store the stack top into …memo.  T Òis not poppedV ªõ Read an object fromQ ` and p¤ Qit on | P 
á ºñ   Build a one-tuple out of= Ïtopmost itemQ   ÷ -\§ XAppenù Fto a‚D11: Œ2 ¤   DiscardË ˆ Í ±, shrinking &0 byî 2Ò‚(1'§ S '!uný ” �machine.L�2

"""

_R _tx0= r  Rqimport X 'e
 !io ñf = io.BytesIO() 3p =2 !.PŽ0r(f— Ñx = [1, 2, 3] p­#(x= 	 ±f.seek(0)
0,  ¥ Q = {}  ð0f,  = ¯ê&j ÍÔD6: KwaBININTõÓ ì { ð10: K        BINðINT1    3
   12: e   pAPPENDS ±(MARK at 5)' @3: . ð)STOP
highest protocol among opcodes = 2
>>> dis(f, memo= J Ð4: \x80 PROTOS 1  2c @6: h `BINGET
 ! 0 8| ñ"""

__test__ = {'disassembler q': _dis ,e o   
,  · %  1  	2 q}

def & 1():M  import doc…  dreturn . ðmod()

if __name­ É= "__main__"L �argparseM 
 Dr =   .ArgumentP$ !r(&  Ï Èdescription=Û ñ one or more pickle files'¦ b c.add_a[ U '1 _1 …', type=Š æFileType('br')+ùnargs='*', help='thz y ÿ-o', '--output', default=sys.stdout� w� „  Æ p where “ [ ÿ should be written  m   +R', acy¶store_true'‚ �preserve'€ between;±i“"-lz  indentleve 4<int�  ô ònumber of blanks by which to R q a new ^ )"-a– ¿annotate', / ð each line with a—#rtj ÝžpŽ @prea@`"==> {†l} <=="&"if+Athan<4õ is specified, print this before'Ž'Ñ �y¸  ê0'--5V�run self3 o suitej v` ÷verbosely; only affectsx $ru6 ü$ =V] X"s(E ifÊsö ¼S>Felse  T= 30 >   - < G    2notb ·ºO  & ” !r.½_››   �elif len(Ç .C j) == 1I  ö( B[0],€ ^f, Noned e   8 pd$, Ô ( $  Ý 
r  m ç}ê C   ) h ð 
            foûr f in args.pickle_file:
  £preamble =-  ð .format(name=f. )= _ Õoutput.write(O n+ '\n'3 bdis(f,l : c, memo ö:indentlevel, annotate)
"""Conversion pipeline templates.

The problem:
-- ñ

Suppose you have some data that ‘want to cg  ‚another 
ó	,
such as from GIF image  < 9PPM Ò.  Maybe the
Y À ðinvolves several steps (e.g.Ý ðing it through compress or
uuencode).  SÆ  of^ · ^ M  may requir aN ðeir input
is a disk !, è  s 4 @be aòto read standard: �; simila0
thS Æ0.  ‚`  pthe ent ú  b qalso be_ 
LŒ 2 or`san open¡ 8andz S its x ú±module letsÏ°construct aR
/� by sticki0oneYNmoreF@togeð.  It will take care of creatF �and
remov  —Qorary¾ 1s i¤ y 5 `necess `to holY°termediate
• .  You canÛ@n usÃî _dª ó“ðmany
different sources.     Ãdestinations¸³ 
 ïsy dµ ; ‹each tim’ i- ‡ M —= ¢objects soš"an7Ñ sD ¥ ¿ 6Òt§AthemÞ@ dicÆ @ary,D 0
in°¡ce.


Dire sD

To� aBSt = TT!()* \add a T< ñt.append(command, kind)
where  v0str# ·àwo characters:ì` first) 3'-'7
Q 0sú ä ” 3!'f/ $itô á Ê;W ñ 
second likewis³  Cºg @mustŸðvalid /bin/sh
syntax X0putv ‚å Ýq d,^ ðàpassed as
$IN ÄR$OUT;s � ,ëu c possi€øš 6in
Í k/o žî¡ beginningÝ_t.pre¢öaÍ ßý`ile us´
òð sts = t.copy(inm,Q 	 0)
I'  (  #0mpt‚ 
,b ýy5or
èi0is f�ten, respßCvelyÄÀreturn valueð is the
exit status of ð* conversion pipeline.

To open a file for reading or writ Ÿthrough aF À:
   fp = t.L (J Ñ, mode)
where  › a'r' tob ” * Qor 'w  p ðe it -- just like
• ðthe built-in functÉ o )ª  $ Bos.p Ù ðcreate a new templ ðobject initialized“ ±a given oneÐ !t2Ð Ïclone()
"""  ô # '


import re
 $os
  ‡  ö c
# we )  Ý VquoteÚ ±rather than*Cmodu òbackward compat
# (= "usÌ ñbe an undocumented but  ;iÔs)
from shlex� O ó 

__all__ = ["T?v"]

# CLðstep kinds

FILEIN_ ¯OUT = 'ff'7 0# MÝ i! &eel„Ws
STDF  G -G 	5aB ˆ 0STD‡  A /f-ˆ @ � ?  @ -@ eNormalQ@ eleru
SOURCEû O= '.B 
’be first,Õs stdout
SINKE  ‰ .É Pbe laF  ZE @in

¢¡ É œ]", ë   POUT, 	 2IN_û   \é� ä  , ¥ ¤]


class )FQ """C �represenOa1  —Q."""
` `def __Ÿ‚__(self)K  y %""‰ () returns¼OreshU  8    K p.debuggÓ1= 0o   Ÿ 8t()…  µ … Ct.__ )5ö s  1(t)Í  Y   ¦ 4 '<° instance, ›‘s=%r>' % í . ,‡ ˜  ¾ 
	"t.  Pstore	Úïdto itsïe   Z v   ] ü  y   y � b| pwith idö5calo Ü2ialŒ ! a²€ current�	Ÿ 5t =T%()D t³  ¡  7[:]  ë$  % ›tô $ ‰l, flagú     ü  R on‰9offÀ 
{ ! =W q cappendr Acmd,Lw &   @ addððnew step at the “end."""
  õif not isinstance(cmd, str):%  , ð raise TypeError('Template.append: cmd must be aB Uing')E rif kindo `n step sg OValuh 2badJ p%r' % (F .,)i Ÿ== SOURCEb 7 � can onlyÑ 0preæ *edÒ Pself.Ë fs and  €[-1][1] … ?INKƒ úalready ends with SINK}  ù ![0d 1'f'�  Ìðre.search(r'\$IN\b',�Ñj
àmissing $IN inD �  å � ?OUT‚ 0>OUTƒ o…(¾ 1))
{Cdef ½(0 ,AT"""t.' D ± adds a new±ß at the frontH= IOi JÅa  ´	G,F0EÊ‚ HTbeginJL Ë LAŠ Mgƒ N¯insert(0, QCopenNŒfile, rwM#  p returnL€pipe or  € object - A for²n0eadz²or writing;yaile is Pother!1 of  Z Lline™ rw‡;'r'†“ ´ � 0_r(” 	I; w; w; .] k E: rw,P\'r\'a\'w\',!5%r' 	 P% (rwò#  á T '_r’	ŽÀ"t.open_r(fiðle) and t.open_w(fi ³implement
  !  X, 'r'7  õw') respectively."""A õif not self.steps:  c preturn † O 5r')# 'if: û [-1][1] == SINKI ò
aise ValueError('Templateã ñr: pipeline ends widthI p Rcmd =s Dmake2 › * ¹ 1s.p½ 2cmd!
½ 1defÕ 0_w(û !, a³ w} 
0VOURCEe awPbegin L t #''Ý ø s Ô
 À #  Ccopy inP, out	 )¿ casystem1 .˜= )~	( „. k Ý 	3 -  ; º¤ È  ë ‰–debuggingS   –print(cmdÒ  n õ'set -x; ' + cmdU ø    

.˜  M“ y ô# Build a list with for each command* a[input™€name or Ì& Ñ string, kindg - ]nk A= []Â  o  9 K in ö . ‘.append([q  : - R, '']*#K ñ# Make sure there is at least one\ +  V c æ  n  	q  'cat', '-- s Ts pcare ofv  ' .0out ?o ¦ [î 1] =x[’":3!ifC![0¹1'f'y b© ¡insert(0, ¬  Ó  e  T  G ‘ :’ K’ „“ ­�  d -T Ë“ ñ# Invent temporaryxòs to connect stages that need" E ‰garbage kicÐrange(1, len()Gl\ši¦ 2š r '][ 1if ; s (1or 1 Í+ N A(fd,ã 1) =  Ò0.mk¾"p(Û (   «os.close(fç ³ 2
:  á [É o ]• v 4 Žðitem in list:
     ó   [inf, cmd, kind, outf] = item
  !if µ[1] == 'f':  " ðcmd = 'OUT=' + quote(I p) + ';  5cmd4 O 0O 
'INN ?infM ¯-' and inf¤  ª P+ ' <“ ¨  Z š é M  Ë N 	>N  + )O 1tem5 b #  cmdlist =  a[0][1] 1forz2 in 61:]z [¨¢B[1:3:  ˆ!if= [X¦ ifº Z  êV  :    D= '{¯¼!}'™  !   º 
  O0|\näJelsed 1 = ø  a 
9 —if garbagA #rmŸ Vrm -f”  1@file× 5  ± 9   ­  ª û 9 ­Ctrape   ( < q; exit'Šö  1 2 3 13 14 15“ è  G  R 5+ 'è 
ù Z aû dreturn!ñ+
"""Utilities to support packages."""

from collections im& ¢namedtuple# …functool! ósingledispatch as simplegeneric
H  =lib ^.util ”machinery &os
 T.path 2sysœ Etype˜ ¤ModuleType( ñwarnings

__all__ = [8R'get_¢ ¥er', 'iter s  " Bload  Tfind_ C Twalk_T 2 D m† B bdata',1 AImpIdS EImpL` �read_codeI pextend_ó < Ý ¶Info',
]


 6 = ´&('  K � _¿ !er( ‡ ispkg')B a.__doc!'A% Ð with minimal¢o about a X  .'


def _.Rspec(j ,F )ËB"""R¢Bthe ! -- CificJ   ™ r# Works€ clegacy8 !s.L2try\  .  R _@ # =& . . öexcept AttributeError@ ×= á (Zí3if - gis Nonk ‰ ˆ  x  l1libý.® _‚Th ,] p 
[ Ø 1 )~=s(streamxð# This helper is needeæp order  “ÐPEP 302 emula1 toÁ ð# correctly handle coñmpiled files
    import marshal
 ñmagic = stream.read(4) 2if  #!=; ñlib.util.MAGIC_NUMBER:-  ` ²return None] U ñ12) # Skip rest of the headerC ? Ÿ b.load(B ð)


def walk_packages(path=m ñ, prefix='', onerror )œ ñ"""Yields ModuleInfo for all m Ñs recursivelyŽ 0on a �, or, if 1 isÞ ,: ¤accessibleE .÷ '9 ñ' should be either;  w 2 li ) �s to look“ { “ %inQ à '€ a«0ing6 ‘output onKAfronXSevery” Q nameV 2on 0 U óNote that this function mustðç *q`* (NOT P ¦ $!)€ Dgive5€in order¦ (£  __ò !__A pattribu† £o find subV ¤ 'Îú ¤ àwhich gets calæ@withüÒ argument (thù  oÌ  A `was beM0ed)ë�any excep«  oc 6 `le try3 %to& W €.  If no‰  …Ui‚±supplied, IŒE& ðs are caught and ignor% Pwhileq  oA‹ ™ 7 €propagat/ �terminatž “he searchK’Examples:¤#„²python can ³p 
t)> ´ dCctypn
9  .%,   Ÿb__+'.'w2"""e  òÃseen(p, m={}Î j �R in má    B2Truú  qm[p] =  Ñ  ùiƒin iter_sPKl y; 2 —  U !if j.ispkg„ :try  0 "__a0__(I .ô î     ×F %ifYais notR(  P 9o EæE m 8 � Nelsee   Frais¯  ,  :  =õ 9S(sys.º[TD], 'c!',)r&[]¼ b   ó# don't traverseâ�tems we'v@Šen befor   > Ž  [p¶  p� i "t ¸)w  OOfromÏ ,W  Î°çµð =''):
    """Yiñelds ModuleInfo for all subm ñs on path,
    or, if ‘ is None,1 §top-level 8 @sys.< !.
= ' ñ' should be eitherF  y r list o` �s to look• @ Z %inQ `refix'‹ €a string6 `outputº �the fronV Severy  Q nameV 2on 0 . 1""" æ :  õimporters = iter_ !()% ðelif isinstance(ö ,ž )E ðraise ValueError("& P must X  ¥  �  "'"‘ &se{ ¯ ¥ = map(getÃ ,Ú)¯Áyielded = {}Ù  Ui in C V    Sq, ispkg& _– Q(i, p¶ Ã !if“@ not= } a  $    [m Q] = 1›    " Õ s  . › ú)


@simplegeneric
defË® íµ 3=''¸  ° ´ot hasattr(1, 'ï .  œ ‘return []²  8 .6 ("`


# Iª ðment a file walker ßcnormal”1libÃQ hookØ _Y  9 _finderÜ ˜ ˜ë “  o×Fisdiû ëð L` � inspect6tryï ±  µ f0os.	l 7 ‘except OSIB ó# ignore unreadable directories like6Q doesM  ¸ { ­ ð.sort()  # handle packages befn Psame-º djs ! fnÛM ¬ 0mod3  RB.getC  2(fnÊ Ÿ  ifY   À=='__init__'›F 1in &edb  : ‚continue‘   Ý$= ÐEjoinÊÏ), { Ûg= FalsF  5andR " g  )  4'.'â*fnž ? E= fnŒ ¥ 	    0dirÏ ;ent"l 	@ ! G   )& =   
Œ 3    ø' 
ú  ' 0subÓ 0    if¨ 7 
\ , »ð True
            ebreak
 ‰   else:   €continue õ# not a package
- ñif modname and '.'* $in 
X ƒyielded[4 U] = 1L  i ! ” prefix +E ð, ispkg

iter_impor	 ñmodules.register(K  ñlib.machinery.FileFinder, _E afile_f _H ƒ)


def a   "()À ¡global impc ôwith warnings.catch_ 3  Î   .simplefil¦ ò'ignore', DeprecationWN )`  < Pimp =r 0ortÍ × ¬ ó('imp')

class ImpI° ²"""PEP 302 ÷ ñ that wraps Python's "> 3ic"g ¢ algorithmáW @(diræÔ) produces a c Gc �searches Í ¸directory. © _(NoneO J ðthe current sys.path, plus any- z ò	 are frozen or built-in.Ù BNote' ã Q does¾d `ly suplñ	 being used by placement– !on� Pmeta_’ . 2"""l Rà_init__(self, & =ÿ ® ïb  > 	 ±("This emul0S is d?!ed}ñslated for removal "Œ  M 
 3"in` 3.12;Û  Tmº' instead",A ±	 00ort (Ç ò ©! =ø  6Ï & `, fulle" # ·R: we A  'I`' arguŽ� since it@onlyÖ ed via �Ï 0subk % =v õ .split(".")[-1]* 4if - !. r2elfÝ 0is ÑÐ pareturn 	N 6  Õ * =6 ¢& "[oP.real c” )Ã :tryš  þ ,   R, etcm.–$�Ó`exceptÌŠortError] ÷  ¦ImpLoader(ì † Œ )&­¡Ü ,3=''� k ¥W ù ·#QisdirD  ¶ y  R Šved = {}¾f 2pecÿ , ` Zºs = os.list| R M/OSI #é´unreadable N„ies like» ½U  ” ð filenames = []
  ð!filenames.sort()  # handle packages before same-, ³d modules

F µ for fn in Q :  % 0mod; â = inspect.getG   I(fn)0  ife   ô =='__init__' or  l zyieldedj  n †continue¡    path = os.
 ¡.join(self -, ƒ »spkg = FalsJ eif not‹ 5andV `isdir(a  )  1'.',  nª )fn ± >try2   0dirã BentsÑ Elistx H ïexcept OSErrorS P# ignçýunreadable directories like import doese ˜ -[]% (Ã ‘ 0subÿ2 €   3if ; :d 0 çMTrue°  !   ]break OelseY  ž � < # aP
”è.` ö[! ]] = 1› % ” prefix +ª0, iî ó


class ImpLoade²"""PEP 302  ñ that wraps Python's "< 4ic"‘algorithm† 1""" Àcode = sourc	 3NonFDdef Ó�`, fullî,@  Fetc)�warnings.	 ñ("This emulation is deprecatedP!sl  wpremoval8¡  œ
 "ä Â 3.12; use 'ò@lib'¹atead",ß 
:   D{ BionW§ Ó_H   ( } 1! =ø Y      ! 5 !  
! ’etc = etct xRload_x{f w_reopen¯ �0modŸ8mp.W ÌH  à %,   Ç   Û± kfinallð Ì ¡ D  m  T g.closeª ð# Note: we don't set __¦ �er__ becaß°we want the#¦ule to looì ¾Àrmal; i.e. tr‘is just a@per a„standard•machineryä `returnj ‘ƒget_dataŽ 9 #ŽQwith ‹ ¡, "rb") as7
e  3.Ê$()m Àf _reopen(seclf):
  öif self.file and v.closed+  2 ¢mod_type =) eetc[2]N  # 4if & ú ==imp.PY_SOURCEK  , { u= open( ©name, 'r')] 'el_ S in (b  COMPILED,  ·C_EXTENSIONì  r   e  v Ab')
x �def _fix_� ž `, full Z %if Š is Noneí 4 8 e  ” Ù  # !_ 
M ðraise ImportError("Loader for}õule %s cannot handle "l  p  Q"modu9 A" % ì .€ õ �ereturnù 1¡is_packageF = È Z e i ·qYÆKG_DIRECTORY |get_cod} =–´h ‚ & W áóN ¨ 	sºÀ Eourcf Ò s (¶ Ê¡ ¢= compile(5 ,¬ ã ¸, 'execZ	  W¹	o 1_re·Ž >try4  < § Fread«„J ofinallN 	 Ù ®(? UšÔ 4¢ ž  _|°delegate().  ej /   
Šƒ	Œ1Y ŽS "ì%¨ Ò@ile.øA   ê</Y_¾ñif os.path.exists¡‚ #W[:-1], ž  Owith­ 3 ²^ as f\A )f¹$U c »Àe().get_sourcce()
  ñreturn self.source
 ðdef _get_delegate(# !):  < ñfinder = ImpImporter$ –.filenamee bspec =P   (= Æ, '__init__'- ’ ¦pec.loader’  ‘ _ m `, fulln X=None   " =Ý P_fix_) (2 s „mod_type, eetc[2]ë 4if " ö==imp.PKG_DIRECTORY ¾  P
@)).¾ ~ 'ela Q in (d £Y_SOURCE,  ‚COMPILED ·C_EXTENSIONö ƒ -Ì    -b


try¿ iÂB zip
 0 Ffrom  ‡ 6ort ™Uiter_> €_modulesÉ ·, prefix=''­ pdirlistv & %d(A .L ò_directory_cache[› ¶er.archive]D_` # =¦ 2er. É  ³plen = len(- > Åyielded = {}1 n 0 in²t `for fn§¿ A c   õif not fn.startswithq 
+  / scontinuu    fª 0fn[´ ò:].split(os.sep) &   !ifÒ øfn)==2 and fn[1]} d8.py~ ?    if4 !0]¸ 3in ¬  -  µ[fn[0]] = 1   ' ô" +` L, Tré ¿ >!=1r 0modÈ ìœ Yr  (œ Ý ” a  %=='q > b4'.',‹  y  ÿG	3ed[0 E% A, c, Fals-s¥$err`.regis‹LAer, ,  - �)

exceptÄ‚ortErrorppass


 ¶g £(path_itemÇâ"""Retrieve a × # the given 3  � mºQThe ru$ed1 1is âdW@sys.4 _u þhòif it was newly created by ai Vhook.j W ° (or part o@ ñ) can be cleared manually if ah 0res$ 5of Ž  Y 0s iz �cessary.+ 1""" KpOA 
Ï [ã 2temh‰7Key† K  M,  � 	   s¯ )   	…     ðimporter = path_ûhook(path_item)
  Bsys. ö	mporter_cache.setdefault> 3, i% H Ybreak^ �except I3 iError:   ‰ Epass Jelse# o q = None* ereturnŠ €


def iº / âs(fullname="")S ð"""Yield finders for the given module 4 
g 4If E ñ contains a '.',7 G uwill beO bpackag« 8 5ingL °, otherwiseG $y @ ñ	all registered top level� m ð(i.e. those on both ÁPmeta_ÆA and   _ü5s).Ñ  ï  â dï ƒis in a µ  Ú $at   ½@ed aý 2sidÙ ð effect of invoká Öthis functions $nol  y  S °specified, ô é ™Ñare produced.ÿ 1""" i”ó .startswith('.'å Sù msg = "Relative Á{!r} not supî•d".format2Ú ra¥¿B(msg  if	 <$e € P# GetÜ7 aA's _¨!__Ñ  0 Apkg_=%p.rpartiJˆ(".")[0]/ # =þBlib.ô!_mÀ(M § _ Ðath = getattr! 4, '… !',X. 0if : ¨ qÖ  K zŠ 
«yY1rom|Ž+  : T =     € “ F  l O Bget_Ý 0er() )ë  rloader(ö 1_orB0"""‚2a "& P" obj¯ r 
2 RRs1 if¼( @ can/àcund or{›I/  ÁV 5 ualready1 _, its €(if any)zö  d,ñorder to establish  QO)Á  J )'sl' ¤ "s[ D „#ifV  ¶ 0Wä Ûif isinstance¼1, M› CTypeÈ 9‚ + =p O    âà1 ã /__å  ·  ª» ' n %ifHh  Ñf  T P   N ;Þ !._Ç
c- {O šBð_loader(fullnameò)


def find_loader(fullname):
    """Find a "! Ô" object for - 
, ñ!This is a backwards compatibility wrapper around5 ñ importlib.util.‹ ñspec that converts most failures to I8 QErrorH òand only returns the ³ p ratherR n  ·  e : 1""" %ifÐ ó .startswith('.' ðmsg = "Relative module 2Ð {!r} not supÕ ¦ed".formatVj  I XraiseÆ Q(msg) 2try} (  § ? = 'Z ‡except (±, Attribute.T, Typ BValu v) as exy !# ÐÐhack fixes an‡ ðedance mismatch between pkgÂ# aÙ ½ #1 ßq, where€qlatter 1s o�eÊsVRcases/ J ` €previousë DdE0 ¨ò a whileæ4ing À²‚({}: {}) m ™ W  œËñ	, type(ex), ex)) from exƒ …d.…!if  ! $ None else 
 ‰Àextend_path( ,YA"""E  Ð a package's ' .€ In> `ed useg rto plact`follow ycode inF Â__init__.py:M  Ò x‚ £ ê  ( _² H__ = ( @, __!2__)\ Y€will addÍ ¬Ó 8 ñ all subdirectories ofv 	 `n sys.	/@d af_U ". Í is1fulE 0if …AwantS3dis)À different p	° of a singlUBgicaC µ  <—multiple œ ™²t also lookãð*.pkg files beginnš"!* Y çhZ® „argumentÌ afeaturépsimilarJS*.pthY á(see site.py),E  \¡it doesn't™@ial-zq lines • Rith 'þ!'.F &A À i€rusted a£@ce vV0: a<PcheckN f¯±duplicates,ç1entàfžd 0are+e-†  ñ°, regardles 5NPthey 6 Qexistum�ystem.  (ƒF °L. !If2 @inpu thå  µ0a lO !(aè a2 KafrozenS Ps) it:  ˜�nchangedÄ …a ? �modified;qoxed copyM �.  Itemsæ ù [2ndeW!toÃ 6 aðend.

    It is asösumed that sys.path is a sequence.  Items of"  0 ð
    are not (unicode or 8-bit) strings refer Á to existing= ±directoriesI ³ignored.  UN iz a causeC òerrors when used as filenames may, à this function‰ ‚raise anF Axcep ò (in line with oñ.isdir() behavior).7 A"""
	 !if°isinstance(H�, list):#  -0# T‡ òcould happen e.g.¿ £ ÷is called from inside aC Ðfrozen packagž°Return the v À unchanged i rat case²  † r0  , ¾ s-p_pkg =  ƒ + ".pkgÝ  ) ! =\ ²[:] # Start!`a copy  Ý, \ sparent_® ±, _, final_i p p.rparti€Q('.')í :if < G6try  Ò ssearch_©  ÇŠmodules[C 1]._% !__c  ; eú` (KeyEK±, Attribute ¾ / ð# We can't do anything:Ô pd_loade'b@s NoI"hee @   Q# pas«q dottedu  $ B H  Felseô ð  û qpfor dirü' < «@dir,­ë ‚continueW  … ò
finder = get_importer(dir² # !if erD  }  #  7 •ions = []ˆ  ²if hasattr(k 0, '	 k_spec'Ÿ  1   # =r .+  > bš  0   1if 7 !is³   %   ¨  1 B.subV_X@loca´sôË C# Ist5ùPEP 420 compliant?û /elý Vÿ 7_, ¥  ÿ "er4 		o  %;  ) s© R# XXX¶ Lñstill add duplicate entÁ!to¯* oîF  ‚Á-insensitive¤0sysß	š  /  û or[£ií.th�  ,  ù.J#d(Ç )²¿ ‹ £Prightš0ng 3subœ°s like zopeQ  ¡# It looks2 a¼ ´4d "/ 0 ’   0pkg…% =B@join+%, nœ%if(  is9 (A ôù l ff 5pen4 	Pà!OSÎ ð msg:
            ñsys.stderr.write("Can't open %s: %s\n" %
.  	ù (pkgfile, msg))1 Yelse:  J nwith f   ¿for line in#  ' # =* Ê.rstrip('\n'~  )  aif not1  c p.startsŽ _('#')‘ A �continueÎ ! Àpath.append(Ÿ `) # DoT`check Ú ±existence!
H preturn ; ó


def get_data(package, resource  …"""Get a ƒ from a 1 .Z ÀThis is a wr• õr round the PEP 302 loaders ” API. TheK £ ñargument should beD vname ofx ,²ð standard moduleô 1matH ’(foo.bar)c Ö  `  !inc Bformc rrelativ| l ~ á, using '/' as2  H¢ separatori 0par¾  directory < Q '..'— !isòallowed, and nor;brooted2 (. q  1  ax )m²e function Ô zpbinary Ÿ�ng, whichY  „ O@entsá "thÚ •specifiedÜ` 4For”`s loca– &”ilesystemb ñhave already been imported,ó t ‡ Ðrough equival("of@ Öpd = os.V@.dir9(8mÝ#s[r@].__•&__ Ã > Dpen(C gjoin(dÑ€, 'rb').ª "()x #IfÊþ@ can·%be÷  ½ ¸ d,È`it usem
Õé q2doeä0supð0(),l @n Nopsº1ed.> 2"""“  —# =Eàlib.util.find_ ªý 0if   ç W Tl _ }=/ .  $if™!is/  è  ‚hasattr(, 4, ',»g ò # XXX needs tesŒ moÛÌE.getÉ 1 orŠ  '  ù À_bootstrap._† (ë ó ifõø ´ dmod, '(± v €# Modifyœ	„ to±compatible ‹ È Ž  erÆ >I äsignature - anÌ–  "µ Õ*" Ü Q ð3 ofL   ñ4's Ê  pG% =­ “.split('/�  ¤.insert(0,ˆ T6modCG_   I‡D*Q ) B (@ à)


_NAME_PATTðERN = None

def resolve_name( ¡):
    """ R  0 a  ñ  to an object.
" ðIt is expected that `- ñ` will be a string in one of the followingH ðformats, where WV ðshorthand for a valid Python identifier " ¤dot standsO ð a literal period€ òthese pseudo-regexes:Ê aW(.W)*>  ":( ")?! Tµ @irst� m¡ rintende  ñbackward compatibility only. It assumes#f ”some part0dotD > ^ ¡a package,â  41resp†I 7awithinc = Àpossibly nes` Ãinside otherÍ!s.I qBecauseŸSplaceŽ { Œ e stops‘   hierarchy„"rt„Pcan'tð inferred by ins+ ion, repea’ €attemptsa¡import mus< d¬ “ Û Q this~~ ì be seco&!m,½ ¡caller makqðe division point clear through2 ÿ 3pro&  of¶Àingle colon:%  ¡!to 5lefÀ* ºO ¾ Õ 2be Ø &edÍN  Arighá r\K ` âP. Onlie  ƒ 0nee™+ 41 IfN €it ends L Å ¹ :£n a module L ƒreturnedu@unctPå! ‘ (which mÏ mU °), or raiseŽ ` excep] šô ValueError - if` is`i³ ‚recognis‹1matZ IK9 #an‡p failedß°n it shouldO Ahave= ˆAttributy a8 �ure occuÓÀwhen traversä¹P  Ä	  ~Ÿ·$ed´ 30get  P @desi?«¢ñglobal _NAME_PATTERNp *if  É ùá Š d# Lazy¤to speedupb²startup tim 5 Ç& r Ç÷
_words = r'(?!\d)(\w+)(\. 1)*'›  H 	±  7  e.8øile(f'^(?P<pkg>{] &})?  C   f'> Pcln>:	 <objG e?)?$',‹ H   ²re.UNICODE):m =Wp.match(´)R †if not mhïÅR(f'inÌö0: {@ B!r}'D ògd = m.groupdict( ó if gd.get('cln'¬ ¨ #Ç reäa±@ - acà-step import iós all that's needed
  òmod = importlib.
 õ_module(gd['pkg'])1 þparts = gd.get('obj' & ñ .split('.') if  � else []P   :
  Ž ñ# no colon - have to iterat õ
find the package boundaryB b g= name}   0mod " =Œ f.pop(0½ q# first Ò *must* be a /x .P =n ` @whil¾ 6rtsö  ú p’ "[0     i3f'{J e}.{p}'~  ! :tryK   Ôs‘  -   8    } I = s{ �except I;^ErrorŠ Qbreak6 #ðwe reach this point,]1 isÙh“, already—bed, an³#�s1 dlist o[!inF ðobject hierarchyG be traversN #or” ‘an empty I qif justE ‹  h bwantedõ€result =µ C ‚for p in— ) ‚getattr( 2, p~rreturn  ð
#!/usr/bin/env python3

""" T+Ž PtriesÏ  re òve as much platform-identifying data a¶ðpossible. It makH  Z  in7 ñ	ation available via func aAPIs.
ï áIf called from)òcommand line, it printÐ– < j ÀconcatenatedÄ  single str¸ ñto stdout. The outputD ¬  –1useª !as{ `a fileá.; 
#¿@ò&is maintained by Marc-Andre Lemburg <mal@egenix.com>.G qIf you „ðproblems, please submit bug reJ‘s/patchesJ2theE PÙ( òtracker (http://bugs.ùP.org)òa assigÕmö""l¤ B".
#Q SStillÓ: P* sup„  œ‚MS-DOS (z _DX ?)' QAmigas qother sX #unK %eda`s runn¦S N @addi:°al Linux diÚ bu s¼ @Many•!nkÓ£Àose who help ddk H’-specificv  checks (in: Åäicular order):j ð!  Charles G Waldman, David Arnold, Gordon McMill ÂBen Darnell,n ð  Jeff Bauer, Cliff Crawford, Ivan Van La¤ham, Josef= ðBetancourt, Randð @HoppM ÀKarl Putland7 phn Farr| T GregD  ªPuk, J¦ q ðRossum, Thomas HellP ð Mark R. Levinso¡n, Mark
#  ô.Hammond, Bill Tutt, Hans Nowak, Uwe Zessin (OpenVMS support),E ô0Colin Kong, Trent Mick, Guido van Rossum, Anthony Baxter, SteveG rDower
# „History: ò<see CVS and SVN checkin messages for h6 >6 ô1.0.8 - changed WindowsÃ ò to read version from kernel32.dll�  G ö7 - added DEV_NULL 6 ölinux_distribution()( è5 - fixed Java† ðallow running the module on Jy5F 4n QIronP L & 3& �normaliza� 6 of¦ystem name8 28 Fmore, õ( p1 - ref\ @ttedKömake doc.py happy. 0. Qa bitÌÈƒed into Í 2CVS; @0.8.; yDsys.ªaparserB òvarious new access= á¡   APIs (p(_@ C(),  €compiler Cetc.°@0.7.°àarchitecture()í óuse sizeof(pointer) where availablU I  -Ä H®€Caldera YL9¸  1  õ Asome/Üð WinCE; untabifis€he sourc' o 6¸ ¦i  a  º ²equiresò±1.5.2-V006 @"ghV‹ Còvms_lib.getsyi() configured) F0.6.å @code$@prev 'ud@ -p'Ð@plat8£s which ar*n �known notD È &itj  ˜Pwin32Õ•àhopefully workm ±Win95,98,NT-bWin2k;K p Adid mpcleanup$ ƒÖrfaces -! KDhaveRI F0.5.Ü@anotFqtype inÎ`MacOS °... should I A Š Qused xPcoffeEeday ;-• 5.ÿý ¾a few typosh Y  š 
Òexperimental “ _;Üµbetter popeº�  Saaroundo s_syscmd}P-- stD ·³100% elegan¶D fthoughœ b#Æàreturn '' inst aof 'un  $ ašX 3 €values (¾sÞX P comm: te¾ ÷ d ‰ E c x ”just leav™·field empty– ýPinclu" èy slackware eQexcep�{handler±ñto cover up situ¹ . ^>Qdon'tEA os.³
Ð ð(e.g. Mac) or fail o÷n socket.gethostname(); fixed libc
#  Âdetection RE ð	0.5.0 - changed the API J ðs referring to system commands ’*syscmd*;M j àadded java_ver‘ @madeA 2cmd ª a private;  | @(was- 3tem- ðin previous versions) -- use u¬ *()H àinstead; exten�  Ú Swin32T Ðto also retur` zocessorH Àtype informa9 10.46é V £and modifiM@plat> ô() output for WinXXL S3.4 -´ô
a bug in _follow_symlinksá U0.3.3/ €popen() w d"file" a invoc´  S sm B2 - ¹ ParchiQure()ø I bsuppor©  it� Å G 1… W REC ¦Windows NT9  o€ R0aliñv ( 2æ öremoved 'wince' again... oh well./ × - ´s• 4ed Ð  2.Ï – ±cache logicX9 1 st Ú&at…  Ü 0  Ï!to§1fun{#s œ0 of+£ule globalŽ Fsó q some a: Â take too lo“”be run onI  imº� 1¥ò first release
# ñYou can always getûdlatestd ¢ Dthis^ 4at:@ ¥ ð http://www.egenix.com/‹”s/python/54.py? ðIf that URL should fail, try contò  ä ðhe author.

__copyright__ = """
ˆ C ò! (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@l  ± H   C ”-2010, eGÙ å Software GmbHN  !@ÿ 
O `Permis¬ Puse, À ,NAify,] diJQbute js`  ‰1itsJ ‚documentÎ @±any purposeG Pwitho\ñee or royalty is hereby granted,P RproviaøQaboveŸ _à notice appear0all 1iesp  ½K BbothË Ü 
= nOFis p	X D ˜ g
ê 0or Ï î žÀreof, includ- häsÚ  ˜ ¢ you make.ˆð2EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
dETHIS? ±, INCLUDING; xIMPLIEDC ñOF MERCHANTABILITY ANDï pFITNESSE À NO EVENT SH„ ð!THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIREðCT OR CONSEQUENTIAL DAMAGES 5ANY ð WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA? ðPROFITS, WHETHER IN AN ACTION. ‘CONTRACT,I  NEGLIGENCE= O2 ƒTORTIOUS5 Ð, ARISING OUTB OU QCONNEV I €WITH THEŽ  K �PERFORMAZ ô2F THIS SOFTWARE !

"""

__version__ = '1.0.8'

import collections $os
 $re
 %sy •subproces …functool Biter ó&
### Globals & Constants

# Helper for comparing two °   number st ð
s.
# Based on the descrip¼ 1 of TPHP's@ _V ñe():
# http://php.net/manual/en/¾ Cion.w -7 `.php

=±_stages = {‡S# any— À not found i— ñis dict, will get 0 assigned= ’'dev': 10ã'alpha': 20, '	 ) 0bet 3 Tb': 33 Tc': 4 `RC': 5$ r 5 #>‰ ,10‹ !ply  = p
 A
}

9àonent_re = re.ñile(r'([0-9]+|[._+-])')

def 4 `arable3 p(Q!):Ð ±result = []  øv5; o k.split;  ŽAif vm@in '| 'W     :try   áv = int(v, 10)w     Ž 9100 þexcept ValueErrorV  7  å 1.geb a ð â.extend((t, v)ƒ rreturn ! 
#úPlatform specific APIs

_libc_searchŠBb'(_ iinit)'Å á  ?b'| q(GLIBC_ÛO.]+)N *0r'(µ ð(_\w+)?\.so(?:\.(\d:�.]*))?)',VSASCIIA 4  Up(executIä=None, lib='',× ñchunksize=16384):
 ñ""" Tries to determine ` C Q that Vfile r E  5á(which defaultO  s`PythonS@erpr` ò) is linked against.Œ  G Rê�s a tuple§Î %," o  ½ 5the� °given params s53casØ ·ookup failsz 0Not  ç  ¢`ion ha> ñ timate knowledg˜ Õhow different{ 6Ås add symbol<� and thus…probablyI €only useØó9 sÿpiled us7gccÊ AThe §qis readh ascannetð  of chunksize báytes.

    """ ñif not executable:  # 6try   õver = os.confstr('CS_GNU_LIBC_VERSION')A  4 ò
# parse 'glibc 2.28' as ( A', ' 
6 ñparts = ver.split(max	 *=1* qif len(1 j) == 2´  „ Ãreturn tuple* ¤ ôexcept (AttributeError, Valu !OS )Z #
_) or    vH cPavailb|  œ Bpass’  ‡v = sys. % °V = _comparK �_versionS ð
if hasattr(os.path, 'real '¾ €# PythonŽ° introducedÐ  + .4 á(); it is usedd  ¥ ñ# here to work around problems with Cygwinø Wbeing=  ¸  = øopen symlinks for read, ý w
�  x  U (  0b')qf¾ binary = fë ²d(chunksizeI  ä  po0· `while  <pC T 5 Pif b'çR' in #  0b'G" Œ  8   mÙ < ‚_search. (F ,{ ž  1 7els¬     G ENone¹   ämŒ am.end(* 8_ È  4 #
 &   1if - Ô   a # =˜[max(pos,FÂ - 1000):] +L 	¿  G    ~&= ”   zcontinuø   ü ž Ireakm  ƒainit, ± g€, so, th©s  I = [F  z ðs.decode('latin1') if sO r ¦ Å- s;  sD¹m.groups()]%  ö0ibc© A andh>libå blib = •	B Belifã 5 ^ 3 !=¶'#  á \ (']     %  + Œ (V($ c) > V(1 Ÿ ^ Z .soÀ ã  â  Òo§ Š(Ü dor V(s  
Ô Õ 
Ù < 4 ( $ifŒ{ v  [-Ù¥à):] != threads?:
  ¤version = 
 ™+ threads4 Ñpos = m.end() ´return lib,< Ã

def _norm_O ( Ñ, build=''):
@ ô""" Normalize theF B and. � strings p �a singleD  Õ a ,   u O f] át major.minor.„ ñ (or patchlevel).K 1""" l¢.split('.'ò "if— NPl.appY & 6try! Á ð= list(map(str, 	 ‚int, l))7 ÿexcept ValueErrorE £ ò  = '.'.joinU  )B[:3]O .+  

�ð_output = re.compile(r'(?:([\w ]+) 	 .	 'j  ` Or'.* 
@\[.*J dJ ð\])')

# Examples of VER commê• ù:
#
#   Windows 2000:  Microsoft 3 [V·©5.00.2195]> 0XP:· > (XP< j1.2600; oVista:y  t ‘6.0.6002]³ 0Not¾!att"™ "��gets locæõd on different
#Õ §#s.B`syscmd´ñ(system='', release 2   O ð  àsupported_platÀs=('win32', 	  16	 Xdos')�òTries to figure ouÖ %OSœGused�%ƒa tuple ± ® &).© PIt usk åhe "ver" shellõfor this which is known”�to existsQ3ð, DOS. XXX OtherÉ 7o ?u Pn cas­‘is fails,´Ðgiven paramet8 0areŸ 6d aß pdefault¢ f.tif sys.h� not in ‚ Ï›Ù(± ¡# Try somecon cmdU–  imå¢ subproces  : * €in ('verèj /cÇ 3md  )™ 	º æ ginfo =c c.checkHU(cmd,“ 0  fstdin=± �.DEVNULLE ?errF -Ÿtext=True|  ¥7 e ð ¸1(OS¶,.rCalledPŸ 0) aÕ" D “#print('C% ¡ed: %s' % kC why- 5   vcontinuCelseÑÀ       break¡
    else:
   ñreturn system, release, version
) ñ# Parse the output pinfo =  �.strip() ’m = _ver_, p.match('   ÷ if m is not NonŽ ‡ ³ = m.groupsd  ¼ 0# Sv ô trailing dots from¿ D andÔ ›  7 $if ¶[-1] == '.' # % =* H:-1]B  B   $ =‹ [B ¢# NormalizV/  ° `build QÐngs (eliminatá ¥additionalŒ r# zerosZ ¼ K p= _norm‰ Ê( ) ÷ñ_WIN32_CLIENT_RELEASES = {z õ (5, 0): "2000", 1 #XP ¡ðctly, 5.2 clientûñXP 64-bit, but platform.py historicallyX Ð# has always  ñed it 2003 Server'  “ 2    ‡    h  @post! "",Û#(6É TVista1 16, Ê 7 \ 8 3P 78.1 f  › #10f 1-  /  C}

#Ô zô name lookup will default toQ # ó s if necessary
ÀoSERVERÀÑ  -­ E2008  Z , 'R2þ Q -126 +$20 	6 # ò}

def win32_is_iot()ªÁ eò() in ('IoTUAP', 'Nano�   ðWindowsCoreHeadless ¸IoTEdgeOS')p U q 2try	  
	   `importª 1regG  �except I VErrorC    6 ¨_winreg asA = 	Apassf 
Í— PcvkeyÆó'SOFTWARE\Microsoft\Â NT\CurrentVõ'[  ¡   Cwith˜ ².OpenKeyEx(³ ñ.HKEY_LOCAL_MACHINE, u )Î 'ke4 L   ºò	reg.QueryValueEx(key, 'EÎfId')[0u/OSI ¶ ^  UÍCver(Õ5=''ß 1csd ƒptype=''b	MUCsys ³BgetwNW} £ ð™ … ‚ q, csd, | ’�winver = d û	™  major, min ;ð
= map(int, _syscmd_ver()[ñ2].split('.'))
    except ValueError:    major, min óbuild = winver.platform_version or A[:3]D  ð= '{0}.{1}.{2}'.7 ?at(_  !)
9 ùrelease = (_WIN32_CLIENT_RELEASES.get(A Q)) or=  º  = ONone< „ ’ Ã# getwindows× ñ() reflect the compatibility mode Python is˜ ñ# running under, and so= àservice pack v‹° is only go3 Sto beG �valid if: � �s match.# %ifŠj2] == *á6try  4 csâF'SP{§ð£ _£ _»@ 7 DŒAttributH # ¡if csd[:13’ #'Sò Pò '†  0 Š 1' +: B13:]ô# VER_NT_SERVER = 3÷ ‚getattr(´ ñ, 'product_type', î 3r émX m ¶ qA 	ƒ ­ @ Œ u	Ÿ	  , `importê1reg  ‹I Ð   6 ¨_winreg asA = 	2pasÈFelse>— òcvkey = r'SOFTWARE\Microsoft\WBÂ NT\CurrentV>'Á  ¥ Cwith˜  .OpenKeyExÕñ	reg.HKEY_LOCAL_MACHINE, u )Î +keÓ P pÿ» B RQueryñƒx(key, 'Ž T'2)[0À ; /OSL ¹ sreturn ¿#, –,º!,  °


def _mac3b_xml()Hófn = '/System/Library/Core&s -b.plist3ó	if not os.path.exists(fn[  Ã �  yA	´S 1libÏ õ EN ­Ñopen(fn, 'rb'‰fÜ  � Tpl = a r.load(f=1 2['P­æ '…K@info£B'',  B `machin+³os.uname(). Ì 3if  � in ('ppcC ÷Power Macintosh'0À# Canonical Q G  È H 1= '? 2PC'QÎ ÿ ´ ,~  ÿ(, =Ì ã  =(  )<  ='  ˆ p""" GetV $OSh j @rmatˆ W‘ ðit as tuple (relecase,
  ÷versioninfo, machine) with  ó being a tuple ( G ódev_stage, non_release_( 5).
q ð(Entries which cannot be determined are set to the param u valuesK C adefaul. s''. All¦ ej O qtrings.< 2"""� ð# First try readä  r  ó	rmation from an XML file¹ ashouldO €# alwaysÆ qpresent  F p = _mac	b_xml() !f  0is þ QNone:  •areturn! ¦ óIf that also doesn't work -  µ % Ž,Òíó

def _java_getprop(name, Q "):‡ 	 ' ñ.lang import System½ 6tryÆ † # =  Á.getProperty^  ï "if×J is 	  Â ‹ g  e  öexcept AttributeErrorŽ G ó  Ë  ˜(0=''"Bndor m¤ =(  ]), os  R""" VN÷ interface for JythonRãsPƒ € 1, v} p ‘ Œö  ”"m_¸$vm€ H 0_veÓ S) and¿ B % aD Ö#osB  os  ‚ X_archÃV‡	Â¿º†given asÜ2s (Ï4allz $''z  ¶ ñ 2# I{ õ¢needed API] 	„£ é´ð *D 'ŽW à ` ;' . PîW 3 ‰3', ( 5 vÖ
# =*Û , a  m.  • T a ® 7   9  ; ¬ < 	× —>  KÂ w" ¹Ú š	# =×*  ¯‘ 0os. '×5  5   5  
 À %8  ;  > þ Û 	j½k$S

###o ¦ ð
 aliasing

def system_aliÿ as(system, release, version):

    """ Returns - ñ aliased to common=  A ðmarketing names u' ’for some  "s.m  0 ÂIt also does$ preorderC òof the information in& Ucasesv ðwhere it would otherwise cau @onfuç y 1"""; #if’ Á == 'SunOS':  › ¥# Sun's OS $if:W < '5- 1 TThese# ý Á 1old Q N  4 rm‡ ˜z „# Modify] & (jÍ" =` # E- 3)A 4l = ¦.split('.' Fif lû  š :try   ömajor = int(l[0]A   þexcept ValueErrorA 6pas·4 >lse' h  5- 3È  4    ~ q = str(% 
Š  " ¦'.'.join(l& 
Ë6Ë© uolaris'� e± á# XXX Whateverò3new�§ e is...L  § k    &elŸÐin ('win32', 	 F16')6P# In S one 6f trickrm ‚Windows'‹ð"# bpo-35516: Don't replace Darwin with macOS sinc– pu& IA and¶ #Rñ arguments can be different than'0cur ply runnó�©À
### Various”ð	ernal helpers

def _plat@h(*argséH(  Å   a˜ $e /  Z ‘ �in a file¿ã  µ³compatible < be.g. "`-Æ ’-machine"òw1# FÐp b  C= '-»�x.strip()q   x	°filter(len,n4s))ÍrCleanup+Bpossª Æ • obstacleŒq  . 0(' t_, % =** /* -* /\\+ :* ;* "* (* )* Ãr# No ne$øreport 'unknown'ÒY
9 E, ''åFWP'--'s~Ð remove trail¹ð'-'
    while 1:
   òcleaned = platform.replace('--', '-')
, U  if 1 2 :   ( Ubreak V $ =:  Uwhiles p[-1] ==l L :  a[:-1]
A ereturnB ò	

def _node(default=''):- ð""" Helper to determine the 3 ñ name of this machine.h 1""" 6try› Ñimport socket �except I VError. C# No, 2s..W  )Ã ¯ G 	f   f €.gethostª (‘t -OSp ÿStill not workingw 9ø	follow_symlinks(filepathB„In case  c is a 3 ", C ± it until aÒ é !al6  2 rreached^S P= os.y @.abs Š O 8$  is® # tQ  AnormR I  ˜   K Tjoin( 1dirhF  ),— Jreadp )‰©. 
�psyscmd_ “(target, íœ�InterfaceŸ •‚system's6‚command.Í ¶ ñThe function usesËQ-b op Ëª >  [ bhave i² G Aomit:  ¤  ò ñ in its output. F# èbs. It ò sJ×  ? # Ä x ³should failÂ ötif sys.Þ > P('dosvSwin32	  16	  emscriptenØ ¿   õ# XXX Others too ?• ¥ s=º‚ubprocesÃ žB = _Å ç0# "(" Íðlocale dependent: forÇshe usagUBe C + � #Œ5getŠâistic behavior env = dict—óenviron, LC_ALL='C–	2�# -b: doû!pr– C Ü » òlines (brief modeâ  QûE = s$r.check_ 0([' ’R-b', "!],Ú  A  wstderr=` DEVNULLD renv=env· 	(
,» rCalledPí))&" º !if=ì * 
a# WithÞ, <  øðbe mostly ASCII-co†3iblað# Decode from Latin-1!±prevent Uni  d' e]#¿ p .  2('lC  ')

### InÕaÀabout the usùed architecture

# Default values for# ò; non-empty strings override the
# dB ós given as parameters
_ _x õ = {
    'win32': ('', 'WindowsPE'),  ,16   5dos PMSDOS i}

defÅ ö(executable=sys. p, bits=~ Ñlinkage=''):
~ °""" Queriesë à = # (Ý As to" àPython interprI  ë qbinary)ayvarious¤ Ò information.€  7 ðReturns a tuple (° #, ­ ø) which containsE e about€ 0theì 
t 1and¸ O  � €mat used   A ø d. Both2Qare r¦  ^s&Ä V[ðthat cannot be d0min6 C I)by€ UÀ presets. IfÓ 7s i| Ë ì ‘sizeof(po�)Ç C(or  “long) on ·ðversion < 1.5.2)X %as? ”indicator ³ supported l _ ÿ €The funcÚ@ relO onÜ ñ system's "file" comm”1o dRx ñactual work. Thiõ PavailÖ Å €most if _…all Unix? @plat_¡s. On someØ $   Q wherÖ� G Adoesa aexist « 6he  3?set=_from . b ˆT1"""‘ B# Us® Ð€)ƒš” number o* ChingC @elseµ s$as‘ .  O t:  “ imð è&uc` „ # = P.calc F('P'| H $ ( Ò * 8) + 'bit'ó±# Get data  Ê'',#Ž 'if{¡  0 àout = _syscmd_ 3, '–  ÿ 9 '�  @  R  ñ\{ '  { 0 ==Ÿ XT #LA didC4P anyt�°; we'll try>tprovidel " #µpsensibl>·™2n..¯žf‹ Õ? inV¢  6 @b, l07	®[3P ]’  7 Jif bI   çb+ l+ y5= l.  F éFif 'l'G8in žð'shared object' not in fileout3:
  õ# Format not supported ñreturn bits, linkage
 a# Bits öif '32-bit' in fileoutd  >   =$  # 3  el5 /645 !645 6 3# Lƒ  ¾  B ?ELFt ¬  w  $ ? u /PE2 ñ# E.g. Windows uses this f!B w % I  %  , 5PE'C Felse0 ) ® ?COFâ % ^ 5 oMS-DOSž š  MS& 8 ’ ó # XXX the A.OUTò also falls under�class...H  Ì Bpass$>ò

def _get_machine_win32()€# Try to‚„ òPROCESSOR_* environment variable…p# avail 0 onÇñ XP and later; see£ “# http://îð	.microsoft.com/kb/888731< 
1 Ñwww.geocities- órick_lively/MANUALS/ENV/MSWIN/¹ RI.HTMà# WOW64 procesbAmaskæ ònative architectur¯ D(‹  _3os.c.get('f ÿ	OR_ARCHITEW6432', '') or8 RCTURE8 5 A)


Ý2 _P° "or£@ Rmetho+ Ò � 3clsÆ ª ðfunc = getattr(cls, f'ù�{sys.plat\ó}', cls.from_sub)…  H  O (Ó 2 ''Ow 
@2 +ÏIDENTIFIER',Œ)b tOpenVMS¤ d 2try     im=… vms_lib¾ �except I 4ErrE 3   / 	   ôcsid, cpu_number =b  ÿösyi('SYI$_CPU', 06 O :¨'Alpha' ifI p>= 128 s W 'VAXU‹÷ 5"""Û �Fall back¯¥`uname -p`  , /œ ñÖ.check_outputð È   !['a  ¡U-p'],f     wstderr=Q ~DEVNULL+ štext=True †).strip(E½1(OSº', ^ cCalled ü ‘ Ú
ïòunknown_as_blank(val)@	' ƒval == '0 'Ÿával


### PortäÄ() interface­ c_resulFðcollections.namedtsuple(
  ö"uname_result_base", õsystem node release version machine")/ !): 1""" (A \ ñ that's largely compatible with a4 psimple ”  dtª q except> ñ  'processor' is1 ðresolved late and cached to avoi blling ê › U Áwhen needed.N  » 	 ²@functools.P ‘_property Edef Œ S(selfü  Vôreturn _unknown_as_blank(_P¿ ….get())
M �__iter__L   Ž Fhain¿ p …super().D )Â   T .¯ ,±� Æ@classmethod’  make(cls, ~ Rable)à T ñ# override factoryqñffect length checkP  2 Ànum_fields ="  [ . ’ ˆà = cls.__new__* 5, *† S !ifI 4 W) != e 6+ 1¯  � ömsg = f'Expected {. ó} arguments, got {len(Y %}'r  H øraise TypeError(msgÀ ü: ^ ,¢__getitem_âW, keyO3ò¯h)[key]A 3len= 8  ­ <  %A 
^oreduceA ©", K Ö [:\   ¬R]


_1   = None


ê  2():» ð """ Fairly portEÑ interface. R02s ay mÑof strings (s‰,Š,‹,Œ,�,–”€identify¡the underl ’platform.¯  ßBNotenPunlik Qe os.Ù   þ¢this also ¼Ž A Aposs×r0 ine  at9  as an addi "alõ g entry‡ ðEntries which cannot be determined are sety#'';  Á … `global„ Þ¨ã )if @ is Z  Â/Ó 	) > ¡# Get someÔ ps from Uvbuiltin*RAPI..V6try\ Ê# =b =S (Ó¼‚Attribut†` t = sys.àTÊ0= _ P  /Ü=R$ =SF = ' Ê Á(¼!if?Aany( œ#êbPavailJ v Ð# Try win32_vÃ2 on  ¹ W ifÒ  ŽA== '5 'ö  O Å ðcsd, ptype = win32_veWr()
  ¤machine = 
 ƒor _get_ •_win32()
7 ÷!# Try the 'ver' system command available on some9 •platforms ðif not (release B •version):&  ± g #, * #, ' ò  = _syscmd_ver(' 
å ´# Normalize® �to what Þ 9 1) n% –ly return¥   8# (g £) tends to. úvendor name as wellŠ $if� ú== 'Microsoft Windows'ó  x Ð D = '$ 	/elS 'K- n @ d t# Under† a Vista@ 4 Ù Server 2008,€  £ &# É qchanged‘output of  @ $F. Th C   #Ûð is no longer printed.  This causesR ˆ  - Eú ýto be misidentified.: 8 e ž €if '6.0'KzN[:3]M - } 1= 'L'r Oelse< 'u@In c"ðwe still don't know anything useful, we'll t¨o| ö # help ourselveàCQin ('0', 	 ;16'ˆ²Ä M  uL &  &C  Ü_32bit&< -16< Ð 2@[:4]Ð['java|Ã g ÔÀ, vminfo, os 0 = 5 :\  Ö | JV 	 ¶ ’, '.join(X ' / > 2 = r(2# S‹àspecific extenLì
›wOpenVMSø ##  Q seemÝEhave˜ X{ …mixed upà 85 or7  0g  &'  Â îH   e 3= '## Ÿ Ä `0 
Ñ †ü§ä~œ ¾m cvals =Àn, nodeŽ,H3 Ð# Replace 'unªàn' values withÆ¡ more port4'‡  _uä P_cachœ Óresult(*map(_P  _as_blank,Y "s)HrÁ F Àcache

### Dñ@irect interfaces to some of the uname() return values

def system():

    """ R& s:  @/OS C ñ, e.g. 'Linux', 'Windows' or 'Java'.
H ó    An empty string is� Bed i™ Š ó cannot be determinedH 1"""P º É .— Â OnodeÀ ñcomputer's networkÉ Ã (which may { Qfullyl  ¼ ¯qualified)Ð R Ä Î oreleasÑ ú 'K) “R2.2.0ˆ?NT'µ R« ¸ version‰¸  1 À ¿#3 on degas¾ S€ ¾ omachinv  T type² Oi386« S~ « Ÿprocessorku(true) ) ò¶ Oamdk· +$­ñ Note that many platforms doa`provid# %isA  in$ PationAcsimply$~2ame®ƒ as for 5(),F “  NetBSD doþ?his@ò

### Various APIg qextract¶¥ @from2.=S_sys_ Ð_parser = re.yAile(§ ór'([\w.+]+)\s*'  # "5 s<space>æÂ'\(#?([^,]+)' ”(#buildno" p(?:,\s*Q 3 ]*& !, & Odate( –:]*))?)?\ 2 \time)„ `[([^\]­ @]?',Î aASCII)¸ [Ú ÿr]"

_ironpython
QIronP2  0d\.õ  ‚?: \(([\ S\))?'  (d(.NET  ¤ F

# c Q cove}¸2.6 and 2.7¶ /26¸  Œ  ¢ ¶ &\(j  g[\d.]+ É = )¾   ]+À A.]+(ë p\d+-bité ß)\)'
)

_pypyŸ Àcompile(
   ð r'([\w.+]+)\s*'
    r'\(#?([^,]+),\s*#   :/ 	1 ø![PyPy [^\]]+\]?')

_sys_version_cache = {}

def  () �=None):
‰ ó""" Returns a parsed R ô of Python's sys. �as tupleB  Ï d(name,8 à, branch, reviœ “, buildno	 õ date, compiler)H óreferring to the ÿ implementation n F 	v s number{  | ±/time as stn 1ando ’ K ’identificy / .; ù ð Note that unlik µ 2,^ rh `6alu=1for kEò will always includ^ åpatchlevel (itª €defaults:W'.0')¦ �The func=† ss empty!s …  Ô� entriesÖ ^ ÷cannot be determineda ^@ may( Pgiven� Tô  an alternativeå ` Y‘, e.g. ifnó
was read from a differentE pinterpr¡ œ 1""" Q# GetU 
e  ifÝG@ is !:  äÝ =+ Q# Try\ �Bfirs—‰result =Š§H.get”,t 	3if : 0is v
� À# ƒ P¹ ‚if 'Ironì @' in¶ á Ù &# & î  \) =A  
*È.startswith(p )b  ?m° QironpOš_ !r.'  B OelseT /26V Î u ò u praise VªeError(8     v'failedäN p&}: %s' %? Ireprð )Í [ û,4¸01 = ¹ †.groups(*f Àh M   ö ‰ "elÌ™.platformÍWjava'Ç1# J¸;  S % k —  ì4á"ifÑ Š6˜ †$ á   …A¼  F>, _�À        if b÷uilddate is None:
  b E= '' ñ	compiler = sys.platform
! àelif "PyPy" in! †_version\  #   /  n cname =5  ômatch = _pypy_sysH �_parser.! ( )< 1if  × ñraise ValueError("failed to \ Ÿ  » .» e %s" %`  ¶  Irepr� � G !, R#no	  z !ti¶ †.groups(@ r$""hs®•# CPython£ J  ?!:?o 'K˜ N'N A.', )\œ [}'¨ æ"if® ¥HÍ 	  Õö # 3  r+ ' ' +p  5 ã‘if hasattW–, '_git')R ð _, branch, revie” *  � F ŸmercurialL 0 R y€  Œ "''Ë °# Add the p×clevel  ®aissinga 4l = ¢.split('.'æif len(l) == 2	³l.append('0*  m` �= '.'.joi: � BÜ¡ and cacheœ aresult…  @ = (!,‘ qÀÔˆ· 	¾o [–B] = o z Dturn a
def pÛò_implementation():Ì `""" Re5 ðs a string identify  w C .A  ,¡Currently,
`follow= 
2 Ts are] 6iedƒ%  C; (Ci B of ‚ !),å  s r  'Iron ' (.NET8 J' (Java4  s2' (o 4 1"""© rY Âh()[0]
™i’}' 4 as¦Ö'major.minor.5 %0Notœ€at unlik eKS¶­ @ed vÜÀ  D ðwill always include the patñchlevel (it defaults to 0).

    """ ôreturn _sys_version()[1]

def python •_tuple():C ! R? qs the P-  F A as 0 À (major, min 3patž )‚  Ž £of stringsŸ   ð Note that unlik e Csys.i ,} È …ed valueY òwill always includG … #Í ()É.split('.'))5obranch.aî Á identifyingÆ CåimplementationÍ R "SFor C4 bthis iŠBSCM - ° from whicha K 5 ÷binary was built\ õIf not available, an empty½ $s v8  Uc  V2VBrevipQ #$T ‘  G%	/ '_ š &3& ˜dF“! (# 1no,Ä€ddate) s<	V™ w / À number and 2  ¯
ƒ Í / ¦ :4:6¨ �compiler« \ ñ6 ¢ used for  5ing° ¬Ò–  ” ó### The Opus Magnum of platform¾„s :-)

_ ³_cache = {}Æ0 ÿ(aliased=0, terse=0ƒa single_ é aunderlés á @with€@much	`ful in­    €possibleí´t no more :Î ¨ ô `output€intendedõÐbe human readÌp rather]^Ðmachine parse& ö. It may look different on Ä Õ sR�† ½ § CIf "S"© BtrueÃ@funcð µBuse ( si uvariousÐ òóat report system names÷¹ âE Atheik2mon- Â, e.g. SunOS� #beU Ued as; �Solaris.do _¨ 5() Â  isÈ}ÌB  ASett  ] ¯ ` causeÜ eV #toqY onlyÐðabsolute minimumð information needed to identify the plat% ¡.

    """ ¤result = _! ñ_cache.get((aliased, terse), None)9 3if < ais not :  ` creturn# s ¹# Get uname± 0and¢ un apply© ñ specific cosmetics^ #Û At... ò%system, node, release, version, machine, processor =… (É $ 6 ==& Ë 9 !''u 3if ' ‰ ƒ 2 =  _3 ( « )&#if/  Ž †'Darwin'f #Ñ QOS (d r kernelÊ  xcmacos_„   =. ‘_ver()[0]»  %  if ( _   ¡ ’ = 'macOSò     	Z B ¼ yWindows½ %MSàÎT ±ñ, csd, ptype = win32¾ Îç "if“
º ÃÏpD Oelse@ ª [3csdµ&el·Öin ('Linux',)` ð# check for libc vs. g
 —   ,! ô ! = ¼ ê ü,m  y o'with'% § +	 ¦ š ‰== 'Javaÿ  p, v, vmÇb, (os_ os÷ Èð os_arch) = java Á Æ 1 or�C  % 5	Ò  7 (-s b ?'onu ' Õ /, ‚
¬  rÕneric handler‹ 0!ê � 
l   @bits½@nkagÁ ±€itectureˆ£.executablE 5   š§ŸP ì), ” ¯ì[è5] =¦3Î§ €

### frjÔsktop.org os-ûstandard
# https://www.2 ¢/software/sfd/man/G ð.html

# NAME=value ¡ð optional quotes ð8(' or "). The regular expression is less
# strict than shell lexer, but ð6t's ok.
_os_release_line = re.compile(
    "^(?P<name>[a-zA-Z0-9_]+)= àquote>[\"\']?) €value>.* = ø4)$"
)
# unescape five special characters mentioned in the standard
¨ G 	¬  r"\\([\\\$Œ @`])"s ù/etc takes precedence over /usr/libð candidates = ("? C/os-#D", "7  )D  chI÷None


def _parseÅ (m1s):b#Ðs elds are mø qtory fi ó	with well-known defaultsA @in pFðice all Linux di buUsö ðride NAME, ID, and PRETTY_ .N �info = {   A": "V &",  ID lm  S    7 !}
> @for  é  s
 n m} +˜a.match6)A  * Pif moõ@not nE  ànfo[mo.group('Âh')] = ] MB.subð ;  vr"\1", E Ý'ƒ  ) )Ó preturn >ö·freedesktops (öB"""R3 Popera¤  system id	2fic Wfrom M V.org –1""" iglobalã Rcache¤ .if  A
=@errn…  U  æ  ² ·Ó _ È 5 :try”  ËUopen(7 þ	, encoding="utf-8") as f=  A 
z mbf¦ 9 UbreakÒ   àexcept OSErrort et !e.
 A ;els. TraiseN O? ? �   úf"Unable to read files {', '.join(ò £")}ô D   
‰
4 ðche.copy()


### Come†�terface

#_,ò__ == '__main__'2# Dz 7pto prinh wñiased verbose platformŒ!ng6 æ !('
 'H€sys.argvÜ>'-- È"al_ 0= (ïC'non 
F  Ó! /--# P ¹ (¥ (L !, € )$  › ðexit(0)
r"""plistlib.py -- a tool¶0genÃeQì‘ MacOSX .4 Ò0.

¹ prñ0ty N " (" )#  1 at\ða simple XML pickleò  supporting
basic object types, like dictionari ô sts, numbers and strings.
Usually the top levelS Fis aL ñy.

To write out a plist file, useF ±dump(value, Q)
fun� 1. ' A' is+ q 0, 'L    @
a (j Qable)H • … Vparse� Qrom a& ˆ Pload(O $) � í,
with a (read[ " a— ò	only argument. It
return µ p (againy K3)¯ Qwork | 2Ódata in bytesÙ ¡s, you canK ¿ @s()
® S s(L VXs% $beÆð, integers, floaíæbooleans, tupl
a (but ï � Ò keys), Data,£  ôarray, or
datetime.	 Ä Ñ.

Generate Pñexample:

    pl =R(   !aSŒÆ = "Doodah", L`ð= ["A", "B", 12, 32.1, [1,  ']]1 F g = 0.1 §nInt = 728 0Dic  Ž ’ fnother˜ °<hello & hi¸Gre!>¥ 3 qUnicode  Ë üM\xe4ssig, Ma\xdf1 5Tru.   ™ P EFals   ! ) @some¨ø = b"<binary gunk¡  % 7Mor) ‰lots of 1 V * 10[  aDÅ$= ãìP.fromþ`stamp(
 0.mk  g 3())¨ )ÏaAopen”°Name, 'wb')v1fp:%  û  í±(pl, fp)

PéKQ rQ  t O(R  c ñprint(pl["aKey"])
"""
__all__ = [� ð"InvalidFileExcepS ‡tFMT_XML `BINARY  e    Ã     s	   	  UID"
]

imÄ€Dscii  C$cs z Penum
}C io B BB$IO# …itertoolD o
 $re% bstructJ Axml.M„rs.expatY y¡rCreate


‚PForma4 Š w.Enum(' C', '  ð', module=__name__)
globalÓ upæ (F Q.__meª * ²

class UID#ðdef __init__(self,¢"a)  Þðif not isinstance(o%&  * ðraise TypeError(") ° must be anX"¿ / !ifk ¶ >= 1 << 64u    O P 1UID­ �  be9 _2**64T  ?< 0M Àrror("UIDs móust be positive")
  Àself.data =  
 àdef __index__($ !):  6 preturn  : 3 Orepr2 ±"%s(%s)" % T ð.__class__.__name__, B   � *))^ Oduce` ’ T ,e  G ,G #eqC w, otherÜ ñif not isinstance(" W, UID' ïNotImplemented%2 ==m 3Chash� b e  ó

#
# XML support
#

 ð\'header'
PLISTHEADER = b"""\
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD Pa ð 1.0//EN" "http://www.apple.com) ñs/PropertyList-1.0.dtd">
"""· ó+Regex to find any control chars, except for \t \n and \r
_( ±CharPat = rv Qpile(„ó)r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"= ñ6\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")

Ffóe_base64(s, maxlinelength=76õâ# copied from / .= úbytes(), with addedF P argu�¾ émaxbinsize = (o a//4)*3& ±pieces = []  dñi in range(0, len(s)± P «  þðchunk = s[i : i +’ ' Q  & e  ôend(binascii.b2aH )�ô’b''.join(> )IVdecodIŒ (if­Xs, stÐS z 4a2bz s^„("utf-8"kMelseí» A ){ð Contents shouldÂ@formÖñ#a subset of ISO 8601
# (in particular, YYYY '-' MM ÂDD 'T' HH ': ð:' SS 'Z'.  Smaller units
# mayÛromitted#�#  a lossz úprecision)
_dateParser3Òr"(?P<year>\d P)(?:- Qmonth  5day T$ 2hou:  # : eminute&  bsecond $)?  Z"õ„.ASCII)
í@ate_
“_string(sð1ord½  ('® A', '   	 0day  Œ   ‚  
 x 'eWgd = 	ò.match(s).groupdict(*  lsY0key!ƒ "Æval = gd[keyú0if  gis NonP Qbreaku  4lst!zint(val ´Ttime.	 Z(*lst*$to(d(àreturn '%04d-%�02d-%02dT : ƒZ' % (
  ð d.year, d.month	 Gday,  2hou  Pinute! asecond# ñ)

def _escape(text): òm = _controlCharPat.search& % òif m is not None;  › ðraise ValueError("strings can't Z Aains	 ñrol characters; "]  G  ñ"use bytes instead").  » 0 =  ó.replace("\r\n", "\n")K #r ðvert DOS line endš G 	E &  G ?MacG &F W&amp;Ž zO '&'€ <9 &lt8 4 # 9 <9 >9 g9 >9 areturn9ò

class _PlistParserÓ%ó_init__(self, dict_type1 `  ±.stack = []Ò  Ñcurrent_key =/
  Oroot _k & =w 
>  ™ p© – |fileobj” # Br = Õ rCreate(:¡ % ð.StartElementHandle9 Û h ‚_begin_e# ‡ D ?EndB 
?end@ 
 rOData… Odata| �tityDecl9  en  __decl@ #TFile(M' , ¯„\ ‘ òname, is_parameter_ 0, v%ñ
, base, system_id, public �notation_G Ü # Reject p± ° rs with ]  å !ar< ñs to avoid XML vulnerabiliLu expat.ë  [ Ygular\ 'do½a thosed ed ñ, and Apple's plutil tool doe(a öaccept them either @pInvalid� Ex- Pion("¿ à 1areŠÈsupported in¾ -")°	Ê²Øw, attrsn÷ w
Ýû $0get4 H "] C" + +,öv4if = E V! (Y sÁ Iw l ¸ C ; = ¡  = Ÿ 4š  )“   � H�.append(  ð

    def add_obóject(self, value):
  0if  ö	.current_key is not None)  0 !if ¡isinstanceU ÷.stack[-1], type({})b  9   praise V€ õError("unexpected element at line %d" %¥  ?  » ‚parser.CÂ ¹LineNumber)@ + ª [ õ 2] =5 & ! =$ #elO ^ 
2`# thisR°the root ob�C  Ø >  … ?els„#/[]„Ž‚.append(“
Ádef get_data]I  ¡ = ''.join . èH  Q = []Q  _preturn  f #p‚handlers  ~ …begin_di2Xattrs‡ " =3% _òƒ Badd_ç+(d $ú &d)x 1endQ Ø o ¡ 
cXrmissingÐP for ÖO'%s'`‰ ,_né Kpop(å 1key[ ä ? orl$h 	dò a' 
' Ê`Barra,, aa¾J RaiLaj  Rh oR ‰  2truØ2 „ KTruej Ofals8 F% 9 |integer4rawiG Ï  `if rawzÐrtswith('0x')6 'X'Ê  =  Î Æint(raw, 16)]{8 )Ñ LrealÎ ; Bfloa“.Þ I ostringK [ E SÀef end_data(ƒself):
    ñ.add_object(_decode_base64( Ñget_data()))
: pdef end e$ R 
ñ ate_from_string1 .U ò
class _DumbXMLWriter¦  l �__init__; ô, file, indent_level=0 \="\t"�  1 ! =8 À  ý Û ªstack = [] _] ) =l 
* ) #  Óbegin_element¹  Ÿ † „.append($ 
g wÏln("<%s>" % ' 
¸ F+= 1‘  ±6 � qassert 
L 5> 0’ & ¼ „pop() ==— + J  -–  ‚    Ý /Þ I  osimplePÇ, value=None\"if € is not  T z   7 ± = _escape( )t     ¡ d%s>%s<§ ­� ,ÿ ( A Jelsev S /Ò€  ô  1 L, liÞ   
[ ò# plist has fixed encoding of utf-8 š   `# XXX:"ñthis test needed?‡  $   àif isinstance(y W, strn &     ! =® .} 1e('y 'Y  ™.ç “.t*‰c>  v "  1.\ „b'\n')

gP%e(tÑ  ~u		 [ ‚bƒ!, × šHeader=1,E ñort_keys=True, skip @FalsÃ. (ifH 
íá ¶PLISTHEADER
Ú .Ð Ã CB  * 4._s® 5 =  ¢ $ Â  #  i J
á)f /? ! Þ¿ûversion=\"1.0\">"“ 0 _®´P /Q  A ± Ž =  . ” 
íg î = .˜"ä"U  é (el� ø
ÎN Strue"uE .F Àfalse")

     ðelif isinstance(value, int):
!  ñ if -1 << 63 <= ( 2 <  4,  4 òself.simple_element("integer", "%d" %G )i NelseO òraise OverflowError¬ %)
> Ì LfloaÎ ž ¤real", rep\ ] ?dic\ `write_ § €(bytes,  karray)‚´ X  $ sY ”datetime.	 X ª , @", _ £_to_strings Ï(tuple, listÈ è U ÈþBTypeúð"unsupported type: %sP  P ¥ Hdef 5 Fg, data  f.begin¬ # "›# õ_indent_level -= 1}õmaxlinelength = max(  916, ‘76 - len(Z Y ñ.replace(b"\t", b" " * 8) * ' 	� )ã  ^ @for € ð in _encode_base64(É ,�      p).splitg 'n" J !ifI ƒ� K0ln(L 
+; =end^£0 - 7, d— Jif d�  $ ±7ict±Ì * ª_sort_keysG $ ptems = # `ed(d.i &()Þ  & –+ 5 = 5 Å 5  •Bkey,ç ›1 „  Xf notˆ7 7str R  #ifOskipØ + �continuek  Y L ’ must be õsU < V4škey", key;0 <_:¤	” T 
%Ò& …4 ˆ  F"\l 1 !,  ["if 
š , e:  çÖ  â! 
H 'M Ë  G 8 
 ð_is_fmt_xml(header):
  õ#  prefixes = (b'<?xml', b'<plist')

    for pfx in1 :   ö
if header.startswith(pfx)#  ' ²return TrueU Á# Also checkb ñalternative XML encodings, this is slightly} ñ# overkill because the Apple tools (and Ë `lib) w, 3not? ð generate files ¹  B &se{ .+   Ebom,  
(  Û  ÿ(codecs.BOM_UTF8, "utf-8"),, S16_BE0 _16-be4 L4 l4 ð
# expat does not support š -32˜ #Å &32™ /32™ 5  š >32-š !if— C7bom'  ddcontin@   ™v ‘Ì
x ‘ = bom + . 0.de«¡('ascii').k!e( Iing)áb[:len(Q S)] ==
q  ˜ í ðFalse

#
# Binary Phó
#


class InvalidFileException (ValueErroródef __init__(self, message="C Ö"0  • E .; ô<)

_BINARY_FORMAT = {1: 'B', 2: 'H', 4: 'L', 8: 'Q'}

_undefined = object()Ï _ç æ bParser-1"""dòRead or write a b³Á °, followingœr descri!of 4 O ïformat.  RaiseMÀin case of eR€, otherw1 §1theO Rroot Ó .µðsee also: http://opensource.ayR.com/ ó/CF/CF-744.18/CFaList.c` Î —dict_typeÁ è%._ 5 =  ž  H pf'fp> 2try|   ±# The basick …<mat% aHEADER°  6   #.      # O­d->offset. [TRAILM Ö yfp = fpg  ú.seek(-32, os.SEEK_END¥¥trailer = 6 zread(32( 0if Å/ z) != 32ó  Ê r@(P ü c_size,� 3ref Bnum_Q Ö#op  F btable_ 	)ê ô
truct.unpack('>6xBBQQQ', ß 	3 Àfp.seek(offs÷et_table_offset)
  Ãself._object! Bs =  Óread_ints(num% 2s, H __sizeM  F ÷ [_undefined] * E 	„ hreturnt � C(topv %)
2 óexcept (OSError, Index ‚struct.e ‚Overflow B ÿ QValue )): ñraise InvalidFileEt Cion(‰ �def _get(.‡, tokenLK C""" Ü @the 0@ of  Rnext æ E."""~ #ifG z == 0xF˜ mš0fp.�Å(1)[0] & 0x3D  ß  ~i1 << m ùf = '>' + _BINARY_FORMAT[s]( ¶ N“unpack(f,£}  s)~ š6  ( ª G)!n,*MdataÜ 06* nd!if9 ; inÀ 
'ˆ ¾ l'>{n}{ø €ize]}', ‚ i JelseT bif not qor len(3 2 != :* n2  ‡I
 !  ³ ñtuple(int.from_bytesh q[i: i +k †], 'big'¯ F  Pfor i'rrange(0q ƒ
 )ÇŸCrefsÈn™˜  ¸!._) 1refP ÜR 7refT ð S 0 â by reference.C Õ  Ma €cursivel rad sub-7  s (content`éan array/dict/ò
{ EsultvJ F[refQif re' !is Ñ
í(- ¸ *d g
k c‚fp.seek(9 âTH �þ¹$ Hˆ" =J#F0  &0F¢ qp,00× ý f= None5 +el7 87 OFals8 	98 7Tru7 V# Theõ!d source code also mentions URL (0x0c, 0x0d) and!a# UUID  ñe), but neither can be generated usingš÷ Cocoa libraries–fÏ ?b''=Hu¥10:  # intª 4   y= ) <(åú6L),@ À              ô'big', signed=tokenL >= 3)

* Qelif  õ == 0x22: # real#  + ðresult = struct.unpack('>fa ÿelf._fp.read(4))[0]b 3b db 8b ¹33:  # dateÅ fÀ  ^  ö  ù'# timestamp 0 of binary plists corresponds to 1/1/2001| p# (year= ðMac OS X 10.0), instead  ; Y1970.< }(Ó  ‹ .	 (i ™, 1, 1) +6 ½  	6   �delta(sec¯ ?=f)H$40Ia[ sIõ‘get_size(C)L)' ¸ s, !s& rif len(- y) != s:G  É ÿraise InvalidFileException(Á 	5Á Pascii»9ing[ É Edataó Ç  + Å " æ    =º¡a.decode('Æ 'ï 	6ï 0uni2 ñ I * 2 Ê õ o�utf-16beø 
8ø 9UIDÂ ò# used by Key-Archiver¶i files/ vúUID(int.from_bytes(Â21 +4AL), fG
AŸ Yarrayr vobj_ref.  h (LÃ *[]i �ò objects[ref] = - 	(  s.extendõ m ; Ô(x) for x in – ‘#>ðB0 is documented as 'ordset', but ¶not actualls# imple7 ðin the Apple reference ã.g
| C| y  se· an~ "be'%in#$s_ (Þ DÕEdict8  À¦
1keyÂbg æÔh* À           r÷esult = self._dict_type()
   ñobjects[ref] = r< 	( Itry:  D ñfor k, o in zip(key_refs, obj
 )5  9 a [} Rread_‚ 0(k)€  o¶ þexcept TypeErrorf ñraise InvalidFileE3 7ionJelse; 7 
   ³ 5dreturnKñ
def _count_to_size( !1if  – < 1 << 8— I !1
 ,el+ -16, 2, -32, 4, t ô8

_scalars = (str, int, float, datetime.	 ò, bytes)

class _BinaryPlistWriter (7ø €_init__(Wð, fp, sort_keys, skip
 1  > ( ‘._fp = fp :  úF $ S  #   Ž w§ ‹ rvalue):  d °# Flattenedã@ect Û U› 0obj X = []= ÓMappings fromA "->%id¦ €# First ´a has (¹( )]÷ect) as the key,< bsecond= Ãis used whenp p is notX ˆhable anz  o $id¥c .c ä t@ N= {} 'id  �# Create6s of all˜ sE Ï p;2 m fv(‘S@SizeI ¡ referenceO õserialized containers[ Á# depends onIfnumberN D “ 3num° 1len/.  ¼ «½ › p_offset2 G[0]*D ‘ / 1ref , =14 )6 Pformaóå_BINARY_FORMATgX 	’•Ë file header� 2fp.1b'b™700'| "# A ã ÖA  0obj×£ - R d  @0ect|c  drefnum. N es 3topE  Ûø2get: < u   A _A œ5 wfp.tell*.  ¸˜ K  œk'>' + ¢%  _ G] * éÜ )�Ãstruct.pack(> ð format, *self._óobject_offsets))

  õ # Write trailer õsort_version = 0 ) E = (  L 1 ", j ó_size, self._ref Bnum_’ )s,D 3top B Stable¹ , )
 [ @fp.wÆ ó(struct.pack('>5xBBBQQQ', *· û Ðdef _flatten(E •, value):[ ò# First check if the · h is in § Ö, not used foK÷# containers to ensure that two sub! AwithZ Asame: Gents– òwill be serialized as distinctÇ %s.1 áif isinstance(å §, _scalarsï  Äsif (typ' ) ì  $.�ê & 7   freturnX ely dq )B /idD  @ P# Add.rÕreference mapÜ £refnum = lÆ¢ Llist"0obj d.appen– H  « $
	[0B] = › b Jelse5H $[i— ? @ ñ# And finally recurse into#]. Ð Kdictð•keys = []:  Ë$  @item   . (h : #ifì ^ 
ô $ F  # 1ed(G � # €for k, v6  F  flÚkk, strá  N   ™ ?kip˜  '    ‹Iinue    ðraise TypeError("L Q must’ztrings" 8  ' |k Rs! v oÐrtools.chain(V ¤Ê u båoV �ò(#‹, tuple)J ”… ¬ ‘m g2geti®¢'f1objJ…Á|F ƒÉ¿ ZºÀ ptoken, Ü% cŠize < 15¤AB', Q " |R § g  U _ << 8Y ÀBB', token |ó 0xF, 0x10, size))

  Aelif µ < 1 << 16:  $ õself._fp.write(struct.pack('>BBH', token |g 1g /32g Lg  2g /seX QX  3X Qdef _ý €_object(†, value)n `ref =  Â._getrefnum(& R H Õ_offsets[ref]; •fp.tell()4 "ifl  is Noná |b'\x00'â‡  A ?Fal#B 8B ?Truƒ 9A ¢isinstanceW, int@ më 6< 0Z    >try   V¤!q'ý3³Z <   sexcept Ü_errori ð raise OverflowE) Í a) fromŸ¸Z  _}`8Z ¿ B¿ 0¿ À	a Á ‡ b  ÄO0x11b ¼b  ¿O0x12b /63& É?0x1å&/64b  	R14' +ð.to_bytes(16, 'big')Pgned=)Xeh 'A“.Lfloa0Ød:2œd ”datetime.	   âñ4 - $ - p(2001,  ÷)).total_secondsÏ ¸ ]33, f«´ (• ,  karray)µ m Â ÿ¢(0x40, lenË ¹/ M\O† ;strw ®3t =Nêencode('ascii'<#	¶ 5¶ Ã0UniW àEncodeError:
   út = value.encode('utf-16be')
+ ù  self._write_size(0x60, len(t) // 2)
5 1 1fp.4 '(t ñelif isinstance(… y, UID):D #if¡ Šdata < 0  ¤ praise VÇ úError("UIDs must be positive"Ò ‚ w .[ n1 << 8` Ç ò	struct.pack('>BB', 0x80,¨ )f /16g Hg 1g /32g Lg 3g /64g Qg 7g .seR ç‚OverflowêÀWÛ(list, tuple)a‚refs = [æògetrefnum(o) for o inÚ]˜ 4  ú ? 
óI ó'_A0, s& 
U3' +nñref_format * s, *p ò Kdicté qkeyRefss 	  õ Z], []µ#if{ Ÿsort_keys‹ pootItem ' "edÁ .i (ÏD Ç= 
�  „@k, v‡r3 ’ hif notRkk, str /  å ?kipä  '   ‰continueþ    ”BType�"L z{stringsy 8 Œ‚.append(3|kB 3 0val¶3 'v) 0  œ ¡k ~	¤D¤7s t òù à ,elR‰Rô)


def _is_fmt_binary(headerreturn  À[:8] == b'bp3ñ00'


#
# Generic bits
#

_FORMATS={�FMT_XML: x(  „tdetect=€ Exml, �parser=_Pi P  š Wrr )  p oBINARYs ðbinary,
        ñparser=_BinaryPlistP 3,
  Kwrit# W # ð)
}


def load(fp, *, fmt=None, dict_type=
 !):X À"""Read a .pt ñ file. 'fp' should be a readable and b¤ + � object.M ó	Return the unpacked root% ñ (which usually is a–  ioô )E 1"""M  if¼  %  ¿ ®  	Àheader = fp.– A(32)1   —fp.seek(0 óor info in _FORMATS.values( :   !if* ²['detect'](m '  + 3P =, ¹%']„     ebreak
 FelseÆ  ! òraise InvalidFileException()8 
4  t Â u[fmt]['} g `p = P(Þè
 rŸ!p.6 G(fp)0!s(4&Ó from a bytesñÑ:fä Bd "IO² 	Ü ú ÷<fmtö'BdumpD ', .ñFMT_XML, sort_keys=True, skip SFalse1"""…! '@O' toM É M¸N	8notÃKGVÒðError("Unsupported format: %r"%()\ … H
S" !"]A
 ƒ9 . W` i`f	VvfG
bQ withq€contentsñ �N	A¹  Ÿ ± <à =	 ž E ]afp.getò()
"""A POP3 client class.

Based o,‚J. Myers* àdraft, Jan. 96C ð

# Author: David Ascher <d !_a Ð@brown.edu>
#_ ò[heavily stealing¨ð
nntplib.py]
# Updated: Pi‡ 0Laub <p ð@cs.su.oz.au> [Jul '976 0StrP ñmethod conversion#ñtest jig improvemœðby ESR, February 2001.ß AddedÈ .C_SSL+! M_ ´s loosely b:@IMAP) ò. Hector Urtubia <u	 ð@mrbook.org> Augm 3LÁExample (seet ­ @func|1 at ±end of thisê);  ImWAs

i	 d errno $re
 esocket rys

try³: ðssl
    HAVE_SSLñH = True
except ImportError:
    HAVE_SSL = False

__all__ = ["POP3","error_proto"]

# EN ñion raised when an * ò or invalid response is received:

class. _X $(ES ð): pass

# Standard Port
POP3_PORT = 110! @POP ½     4SSL$ 0995$ ñ Line terminators (we always output CRLF, but ac'cany of òLFCR, LF)
CR = b'\r'
LF 0n'
> € = CR+LFq �maximal ly blength Àcalling read €(). ThisÁto prevent
#!  ) £arbitrary G  6 ðs. RFC 1939 limits 	o ðto
# 512 characters, includX  ² ñ2. We have selected 2048 just to be on
# the safe side.
_MAXLINE =/ 
Ë ƒ !:
S1"""Ö ä0supsas bothN 1min ðand optional comm Qsets.G ÐArguments can� rstrings^AtegeÌñhere appropriate)= ð (e.g.: retr(1) Z  B'1')Š òwork equally well.¾ Mž C‘ 2Set* .  �USER name  Puser( ‚  RPASS »    ä"_( 
2 ASTAT#  Zstat(+ ªLIST [msg], ãlist(msg = Non# PRETR    !:msgc ODELE. @delec 
. CNOOPO 	 Knoop¼ ?RSEç <rseç ?QUI+ 0qui+ òOJ¹`s (somÞ rv*ˆ ‚:se)ÓRH »	´ o  rpopÓ A/ ddigest6 a/ ",  
1TOPIn0  0topI:, n0 OUIDLÝ@uidl1 ÝCCAPAX 	 Kcapa�ISTLS$  Kstls+ CUTF8 	 butf8()9R
bs one maion: 'ä'cpInstant®Z with� JP(host‘ , =C=110f 1NB:‚  — ‡=�col locksÞà mailbox from – 6 À   authorizayp until `1, sõ@sure Éget in, suckA  z ‘messages,Z ‡ñ , each time youIs� 	= œ 	”  É Ais aÄ0-baRÙ ñ, which means largeâ 
W � ð consume lots of p÷ython cycles reading them
  €line-by- ).
 ù!If it's available on your mail server, use IMAP4= ðinstead, it doesn't suffer from‰ Ù two problems= aabove. 2"""– AencoÃ ’= 'UTF-8' ñdef __init__(self, host, port=POP3_PORT,N ù õ  timeout=socket._GLOBAL_DEFAULT_TIMEOUT)::  ^ .] ! =d 
  p ! =w 
 ö	_tls_established = False& ðys.audit("poplib.connect", t Ò )6 @elf.¼ ! =& �._create_ 3et(ß 1 Dfile1  ) P.make [('rb'- p_debugg9:= 0z ewelcomL §_getresp()—
‘ Ë — W$if‹ñ is not None and 1 0  Åðraise ValueError('Non-block®  Ú 4et 4=0)[ 0sup©'edì rreturn 5 .µ ƒAion(Wù�.B $),¶ ò 0putJ2  ,  @#if©Wñ
> 1: print('*put*', repr(; �#j #1 
£ Ñ �.sendallQ ’ + CRLF)
¤À# Internal: '  w@comm{!to¤æ³ (through _x +()÷ ?cmdö ò ?cmdò  Ð � = bytes½ | 	˜  8 á å ã  # †â €, stripp> $~`# This<‘where all1CPUþP of t" `module) „consumedA Rªe¥ð_proto('-ERR EOF') ü6he mC 0losA Îà&geWQÉ þ Ä.ç  Ö(_MAXLINE + 1*aif lenND) > % [	±  S £ too long'ù ‡Ò/geÒ!ifÞ [ ": Ï	t % n †octets =Å  #�B canÌð any combinationªwCR & LF5 AhoweÅ':2)' +s¿As enw*in; ðso only possibilities are ...LF,  IA, CR w  †±ine[-2:] ==“ƒ‘ r[:-2], û C #:1B @ À       returón line[1:-1], octets
  Sretur" 	! 
# ó# Internal: get a response from the server.0 ñRaise 'error_proto' if) ; òdoesn't start with '+'.s €def _get. q(self):[  ±   `, o =  .'  Ü %()" #if ðdebugging > 1: print('*B �*', repr( )< 1notâ .› s› W(b'+'„ ˆ å ä K † V ` 
Ö I°plus follow¯ Ntext][ @long\ $ à £list = [];A = 0Y  Ô  I\QwhileM† != b'.'š B !if 
<,..= +  Ã5o-1}      … ! =G I[1:]  º$ =½ 9+ o   ß €.append(H ù Z ß µ , M -ÃÀsend a comma
 !nd  u !5 ³�shortcmd° \ 'neQË!pu" 
¹ “ " )S �  h ¤  T£ 1 H  (§ öThese can be useful:z ¡getwelcomeþ # û  VAset_åQlevel< !,  C :' =" G €# Here a !ll¤4POPÖs¥ Cuserc   b @"""S  P name\T 	 „ò(should indicate password required)G - 5"""ß
_N°'USER %s' %Wrr  Z _² Opswd²   #  } ± 	Ä ó includes message count, mailbox size)Â ¾ 5NB: Ãis locked by.áh~µto 'quit()'ð ü CPASSü à Ó ü Astatû 
õ 5Get“  # 'us° ÿResult is tuple of 2 ints (ò 	² 5val‰°VSTAT'—ðrets = retval.splR ÊÆ ¿ Æ'tsÆðnumMessages = int³(rets[1])
  òsizeMessages = int$ 2$ ´return (num+ (, 9 1)

Q ñdef list(self, which=None):   t ¡"""Request+ Sing, a rresult.L  , R Â without a mª õ number argument is in formh ó['response', ['mesg_num octets', ...], ]u  ?henr Pgiven{ au tsingle z ´: the "scaní "¦ T thatÍ .> 5""" "if? ` @not FE r– kò._shortcmd('LIST %s' %A ë	1 Elong0 'ÁHretrÁ¼Ätrieve wholeÄ ‘'ó'N¡ ™0lin¢Ž á   À JRETRð @ ŒOdeleË _DeletÃ Sµ	¢ “ODELE£ Anoop£ 
gÇDoes nothingNÁOne supposes\jƒ indicat `server<_alive® JNOOP"seÒ
£ ¤Unmark all s  !edã |_tion.Ã!IRSETs ?quis ðSignoff: commit chan¸2on ò ÿ, unlock mailbox, close connec�  \sp = C0QUI�  €   H (M €p%  0 
+C…  ‰ Ö±ssuming anyð0 abî)it;:try Dfile½   ;´   ! =;	 1if  ic  
[  B  " .Ñ ö kfinall‰ sqF  	l  . ‰  ‰ 
ù  ž    ;  .shutdown( Æet.SHUT_RDWRµ  ,   þexcept OSError as excù  + S# TheTò might already haveVd‚Òf C  ð# On Windows, thi&y#0ult¶ÁWSAEINVAL (e™ W10022AJ   ð# An invalid operaÕë was attemptedˆ À       if (eÁxc.errno != 	 ¿.ENOTCONN
  ðand getattr(exc, 'winerror', 0)I 10022):B m raise finally7 Ñsock.close()
; ó#__del__ = quit
 ò optional commands: ÷def rpop(self, user£ ñ"""Not sure what this does."""q  preturn C ò._shortcmd('RPOP %s' %X � ótimestamp = re.compile(br'\+OK.[^<]*(<.*>)'Õ  ¥ a¥ ª, password¯ �Authorisaï ã  ¢ ö- only possible if server has supplied a � öin initial greeting.Q NArgs” ? o ¡ - mailboxú ;* %  ½ ) Ð e 5NB:H Äis locked by¼ àfrom here to 'ð5()'l ¢ô secret = bytes(l ,´•encoding)< 2m = a.match'†.welcome/ Šif not mÑ @ðor_proto('-ERR A 0  x8ortÔ 'U Pmport¡Ehlib› PdigesË ²m.group(1)+ß # 0has< R.md5(8 R).hex (k Á© #%sÄ(Þ", = #))Î œt@êwhich, howmuch›õRetrieve message header of �number 'G Ê ]sfirst 'Z x' lines< Gbody<ðResult is in form ['response', ['A õ', ...], octets].C=	AlongÞTÝ² ù Auidl8!, & ]=None Ac÷ (unique id) listÞ $If%2, rê •contains 6  ÷   t·Y Þ `in the  %m  †ôgnum uid', otherwisea %is@  =  ’ T7mesB 	[< Z"if §  D[CUIDL{TË­ 0  N†  ³Autf8•
‰0TryLñenter UTF-8 mode (see RFC 6856). R— s‰Y@IUTF8” Ocapa”  l k  %  bilities (“ à2449) as a dicø1aryé  n÷>>> c=poplib.POP3('localhostmà>>> c.capa()
   ð{'IMPLEMENTATION': ['Cyrus', 'POP3 `server
 ²v2.2.12'],
A p   'TOP8 ð ], 'LOGIN-DELAY 0'0' àAUTH-RESP-CODE 	@ QEXPIR a'NEVER4 BUSER* d 'STLS ¢PIPELINING ˆ BUIDL % 'n 9 }' E>>>
 ðReally, according to RFC 2449, the cõ folks should avoidD 1hav9 ðhe implementation split into multiple argu" Es...C 5""" õdef _parsecap(line):  t`lst =  ñ.decode('ascii').q )()/ áreturn lst[0], 61:]†caps = {":tryr ûresp = self._longcmd('CAPA'l #awO  3 9[1]Š pfor capº R in r- 
k  á `capnm,+ 0argœ ? 
v 4 !s[9 4] =; ~ úexcept error_protov Xraise p('-ERR ã ó not supported by … c û 
Y ÅPstls(4É, context=NoÎð"""Start a TLS sess7!ony`active< 1necPÀas specifiedB©B595.u   r Ò - a ssl.SSLC… u!ifç �HAVE_SSL´ ‡ missing#if1ÿ tls_established\ ‡already E h  v�GcapaÿÖ ? 1 , €  rú if  Ü@ is ß
_ ‡=…ó _create_stdlib_ ±  6Ì a_shortj � ò  TP.sockêÕ`.wrap_ !ett  ¤ Ó¡_hostname=c   å Dfile¡  n P.make L('rb£ _úu = True�7 õ f


if $ `class „ ”(	 0""" ‚ client - €over SSL–6öInstantiate with:\  ë  ù  , ç�=995, keyÚ µf, cert   L ß@ )†  r ! -í !of Qpop3 Î 3sslru  « ! -² | number" Ã ð - PEM formatted filúe that contains your private key
  ð
certfile - PEM formatted  @ific8 `chain ' ? òontext - a ssl.SSLC 
+  Se• õ+e methods of the parent class POP3 for more documentation.I 6"""V ðdef __init__(self, host, port=P  _SSL_PORT,ù  ¾ a=None,Û  _ 	ñtimeout=socket._GLOBAL_DEFAULT_TIMEOUT,i1extZ )):L $if € is not  D and�  
<  Œ ðraise ValueError("Ö nC 1arg,ùs are mutually "‹  O  É"exclusive"). ¹   ;º )D » C<key¢ 5 orõº  im?™ warnings A .	 $("l  ‘× pe depre<�d, use a‘v"custom3£nstead", DL BionW˜ :, 2²  .� =_	¾ # ¤ =	% 
ú ¯—…=ñó _create_stdlib_ (i =	 ,h  K Ô = ö  r $ =:	i  .'#, ç)XÕ ý^+ 
  ! =À.7 	— 6 ”0`.wrap_ 0et( 2pserver_Qname=[   
3preturn ` 
ó Cstlsé lÓ-e ðT"""Thç€ uncondiÂ‘Î s an excep Q sinc	�STLS commVð
doesn't make any sense onJ úalready establishedJ 0SL/M IsessJ | N   ¡   ej×_proto('-ERR A  q  '<ð__all__.append("z ‚P")

i« —ò__ == "__main__"Lu"sypaPÂ(sys.argv[1]Æðprint(a.getwelcome())
    a.user(syó
s.argv[2])
    a.pass_(sy 3 Rlist(& ô(numMsgs, totalSize) = a.sta$ ófor i in range(1, 5 a + 1):n  r ò(header, msg, octetsM bretr(ir  * ÷print("Message %d:" % !  s @linev 6msgd > €'   ' + ' Z /'- ') Pa.quiÞ òF"""Common operations on Posix pathnames.

Instead of importing this module directly,   ø os and refer to
- `as os.` ƒ.  The "  " q   i< p alias  < "
mi Ÿ €systems;± cother  ó (e.g. Windows),
] ø provides the same÷ �in a mannI ñ
pecific to that
platform,Ô Ÿ Rto an ¡ ~  ntß `).

Soi  f Å ð can actually be usefulÃ Bnon-xÇ Ptoo, Ë 
qmanipul¥ ‡ Ä  c 1�component ñURLs.
"""

# Strings represen¹qvariousâÀ-related bitw`d piecõ#›ñse are primarily� ex€; internÌ ,Ty+  hardcoded. Phouldê £set beforeBÛ`resolvNõcyclic dependency.
curdir = '.'
pa “.'
extsep 
 /% #th `:'
def# & �/bin:/usr	 C'
al? ÁNone
devnull( @dev/ 5'

Ê
 5sys 4tat pgenerick g
from  í ð$ *

__all__ = ["normcase","isabs","join","splitdriv   Uext",n€   "base c","dir
 cÒð prefix","getsizM ‹getmtimeE Bgeta  , c àislink","exist  l
 Qisdirº <filO ðismount", "expanduse-  0varL  ÿ  /b","abs
 	Ú  ž] " Gopen  �Æ +2","' 4!ep  " s ýÜ  J r","realœ @"supóPs_uniÝ_Ž  q Î #re' 	Ã ˆpath"]

Œ  _get_sep(V :Ñif isinstance s, bytes   ò±return b'/'c Felse   À
# Normalize’ d aì ±  r`rivial]r1, s&`.lower�0Mac¾’On MS-DOS½‘may also Ž pslashesco back p; howev	0
# ï ” ½€s (such `ptimizþ±'../' away)F`not al‘ Td
# (d@func§! sYÀ be defined ð!to do that).

def normcase(s):
    """Normalize  ñ of pathname.  Has no effect under Posix"""A Àreturn os.fs8 ’(s)


# R ‘whether aU ò is absolute.
# Trivial inU P, harc óon the Mac or MS-DOSÃ XisabsÀ _Test h © :s =¦  ÿ àsep = _get_sep¼   Ô òs.startswith(sepÙ AJoinÍ  "sÆ aIgnore±  previous p9 1 ifù ,rtù ñInsert a '/' unless@ Qfirst=  2 PemptyÀalready ends-3'/'¦join(a, *pÑ¢ 0two: mš  ˜ ® á components, iƒ 1ing„  çaeeded.ÖfIf any0  Ž %an¼ g, all ò &th1 sG Àwill be discÙrd.  An Ø $laë ' `resultÞ , ¸F ö  …Ô a separator.ØaØ!a)3 Ø  A = a# 2try òi6t p    0 `[:0] +x ñ  #23780: Ensureí ðatible data type evenøp3BnullQ O Pfor bá Emap(1$, » $   Lif b{
™  &  � A = bÍ     $elÊ 0ath  & .A @ÅJ +K /se,  a+} ôexcept (TypeError, Attribut ÃBytesWarning© ¯ qgeneric¥ °_check_arg_I0s('Ü2', Þç Qraise § > s@SpliT   gÐhead (everythé@up t!e |ñ'/') and tail (the
# rest).  If‘L  @ Q B'/',- ²"beÊ. !reõ1o
#TiÅ C !, �  8 0ailœ ò'/'es are stripped from8 "iH Crootsö (D8""" ö#. � s tuple "(� Ê  )";@re "2" i¹5Qafterñfinal slash.  EiÙ é@ mayçØ™ Zæ/(p™ ±i = p.rfind¤A + 1ã©  " ±[:i], p[i:] "if Ä * 0 !=©A*lenã j =/ !.rbi G H # N s.�extensionüEThe   þ:> Ü!at@u!doä Å  !
#L ¨Pž;/ q  isRÁ0befÐ  } Iðalways true that root + exñt == p.

def splitext(p):
    p = os.fspath(p) óif isinstance(p, bytes2  6  se8 Ab'/'0   4ext . Belsee     2 '1 àreturn generic‘ &._± Ò, sep, None, n $)
 ¯.__doc__ =?   P

# S0 a a ð name into a drive specification and the rest of !
#: ð.  Useful on DOS/Windows/NT; PUnix,0 X ø is always empty�y ’?"""¢ ' ’  º €. On Posf  b ”f 1"""  ¯çrp�p[:0], p
R  ô  tail (base&Q) par:0, s<"asT(” C)[1]Ù 7 × \ sçfinal componenX  l ¶ 
I…_get_sep³ åárfind(sep) + 1ú å <i:]â �head (diru á 0á 6 à Ÿdirectoryä QÈ q= p[:i]õ 1if   ¿	  !=>P*len( Ë  ! =/ q.rstrip@G < # ;#Is7ô a symbolic link?
# This willè> PfalseÐsystems whereuólstat doesn't exist> isV TC@"""T„twhetherˆ  ô
‹ <2try: }tçr W á óexcept (OSError, Value ‚Attribut 3Ù FÙ G   Ï ð.S_ISLNK(st.st_mode)XðBeing true for dangl 	G s Ð Qlso u[ls¸ Õ ) 4.  kTq jbroken+s,?os.' „ ?°mount point=@(Doe C1ork$ðall UNIXes?  Is it even guaranteed to w/ "by"?)ç!is` 2 q - � /s1?;# IæÈ -- so not a} B. :-‚ µVg
Q0# AÏ )ð can never be a mount point
   òif stat.S_ISLNK(s1.st_mode):
#  Ñreturn False
 ÷
if isinstance(path, bytes: Ôparent = join$ Q'..')C Felseg - ,  @realn ( J 6tryI �s2 = os.lÛ 	' ñexcept (OSError, Value ¶ ì rdev1 = 1dev¾ 0devi  s23 1if -  != 2• U ATrueR # Å á/.. on a diffe-‘device as! j 6ino 4ino   "f - =  úis the same i-nod| ¸ ù‘
# Expand� ñs beginning with '~' or '~user'.
# Ämeans $HOME;   Qthat - ðs home directory= !If›  )‚ doesn'tr n ,o i'  G   i æ is unknown,
#G 2is Ò ðed unchanged (leavÆ ep report ðto whatever
# function] bcalled‰  @ee ¾�argument)Ê ñSee also module 'glob' for 9 sV €of *, ? _�[...] inhPnamesG &(A„ bshouldV ðbe defined to do full *sh-style environ� �
# variab  ´  { r.)

defŒ dI­3"""õ~œ Þ� construas.  IfÉ‚ óádo nothing."""ÄÚ¬ fs v  _Átilde = b'~'5 
Q   if� Rp.startsµ(' ë  ¨  ' U èsep = _get_sep£ ! =& Â.find(sep, 1� ½ F < 0ÿbi = le$ G== 1% 0f '&'¨  inÅ»%  £  im¡A pwd¢     	     Î[=0 À.getpwuid(os  
 ™)).pw_dirM ,1Key 
�  Y Ó# bpo-10496: „1curÅ u µ identifier¾Pexist×9then Q ópassword database,®Áµ? ¸ S 
   š 3os.^[w]T 
4 k  �ûB[1:i6  \  ÷ '  (    O0tr( ƒ, 'ASCII " Ê"pwI0pwd·Qpwnam= M 4 ±
ð# bpo-10496: if ðthe user name from  ðpath doesn't exist in '
  ñ# password database, retur,  F ™unchanged; &  "   ˆ ñhome = pwent.pw_dir  r# if no¬  % i ± on VxWorks< !if7  6 ð is None and sys.platform == "vxw5 !":7  é § àif isinstance(¾ †, bytes)4 Ç Äos.fsencode( )] ¡oot = b'/' FelseG r  ? % =Í €.rstrip(* V ¯ l ! +„�[i:]) or * €


# Exp Á ñ$s containing shell variable substitutions.
# This e= s <5s $2  V $${ `} only9 ANon-H5ent` µs are left &Ñ.

_varprog =¬ b C
def† Avarsˆ�3"""Ü 
Ë As of­ ¬ ÿ§ ¶}.  Unknown— Ž›  1"""  71 = Þ  �  tglobal Ã ,
 b @¡if b'$' nou a •  tn 
2 ‘import re…  0   ¥  Xðre.compile(br'\$(\w+|\{[^}]*\})'ob.ASCIIj @ †search =v . f Bstarã{ã 7 1endö} ñviron = getattr(os, 'en 1b',	z 
&?if ,-+7 = *)&('''&3os.kQi = 0
 —while TruIBm = ˜¨2, iI Œ7mQbreakP $ æ, j = m.span(0= 3  vgroup(1  W Aame. aswith( )y 8 B.end 3end¼ m      ! =’e[1:-1]‹ :tryª 3if 	Ú
   O @valuT¯�A[ !de¤ z &)]È  ? 
p    U ~ [: ¨ ú except KeyError”  ®jÓ _ @tailfath[j:U  w   a:i] + ‰ N  $  ` 1lení
Ë > à+= tail
    reñ
turn path


# Normalize a ñ, e.g. A//B, A/./B and A/foo/. ñBll become A/B.
# It should be understood that this may change the meaning of the � ð# if it contains symbolic links!

def norm/ ( ¦):
    """Æ   ñ, eliminating double slashes, etc.""";  . € = os.fs W   Ž ‘sinstance s, bytesv  z ¡sep = b'/'3   Qempty  1dot .   BelseÑ  H [ Z 'F C = 'A  7 2dotX #'. !ifØA == œ c !re1dot¾ ƒinitial_)! =8 ñ.startswith(sep)+ ó# POSIX allows one or two E nñ but treats thre) CmoreH tas sing . ð(see http://pubs.opengroup.org/online ò/9699919799/basedefs/V1_chap04.html#tag_04_13½ Cif (§ ì 1andz  C ö 1*2)?not7*3)\ 1= 2\ UcompsVFplitQDnew_  ![]/ @for  1 in s¹!if   (ÔW, dotƒ  Ç  H2inui   ø Q  !=/  '@or (Ô ³  ò  — A) or–  I  ( Á @[-1]l‰ 7 5 €.append(‘ —  Uelif $ ñ    R.pop(4  >  S ¤  Á± = sep.joind s1  Õ
çe 7 *+ö] 5-  orI
š'abBV B"""Rd¢an absolutî� „Qisabs€á È � 52cwdßsgetcwdb8  
o  - , î "= N1wd,R
˜Zû ¡ canonical7 a (i.e.€location�a file on# !
# ‚system).j@real’ () óname, *, strict=False*€ f‡  ofa ¡ specifiedi N >Jany
ŠÀ encounteredƒ \  � Ô— zY 6 0 €, ok = _VÓ W[:0],“ Þ B, {}A w	u ÏAJoin‰ b !s,0ð alizing and elið<minating any symbolic links
# encountered in the second path.
def _joinreal ( Ð, rest, stric óeen):
    if isinstance- Sbytes   $ ¡sep = b'/'3   acurdir . &pa  Belsej  7 J I '1  ' H Q'..'
u ¨ @abs(Ê œ   ! =à A[1:], C ‚th = sep@ Qwhile' Ž rname, _E õ .partition(sep)P pif not 3 2 or 2== S  { # …rent dirA   …continue  V rame == ô J /paI !ifð
.  b î¦ q= splitÔÈ  %   z  #    P 0 = RI ,¨  
Y 
í @   D á û   3new. r  Î h :try÷ ãst = os.lstat(B 0 êexcept OSError; #if
  › Frais¨  0is_†g = Fal õ *  “ ö.S_ISLNK(st.st_modež  ‡3ot 2 
‡ 
Ò 9’# Resolve79  l `zin seenp ‘# Already Q thisfA  •  > [š u ! ›1 is17Non  !   ÷# use cached val      0# Tò!ymŠc rú ðd, so we must have aA+ Yloop.É ü0# Rþ4Æ(errno.ELOOPº �   0os.æy     ­cturn apÂ  ]1t +§1 ofÌqšunchangedÄ  M !reK 0‘Ñ+),©	´0 = ›! #¦� s[* ~ o, ok =W0os.2 cgK  Zot okvÀ n  Ó½  +   #* ödéíT  $ ð, True


supports_unicode_file[ðs = (sys.platformŽ¡'darwin')
S0relM `start=?‰B"""R‡ða relative versionÈaH2"""Ÿ 
 R À    raise VaòlueError("no path specified")

    p= os.fs" ( ) Ñif isinstance ‘, bytes):   ? Õcurdir = b'.' 1sep / &pa) * OelseJ  I 'H B'..'Ã ÷ if start is NonT  "= ¦ Ÿ 
u ! ÿ  6try   ò_list = [x for x in ab9! ñ).split(sep) if x]v  + Y@ 	   ? ð# Work out how much of the file>  “shared by1andä.ˆ ñi = len(commonprefix([¾ Ÿ ,0  #])
 À 1rel  ÿ ÎP] * (K = f)-i) +B 6[i:tif not I \_ Hturn« djoin(*9 Ÿ²except (Typæ¤, Attribut B®óWarning, Deprecation ÉpgenericGð._check_arg_types('rel ',\‡ ¦ ±aise


# ReÆ  –‚longest hP sub-D µ€sequence   ñs given as input.
# TheKQs are<€normalizãPefore_ `paringpm (this	ðthe
# responsibilityl  › ðcaller). Any trail@ �separator? Ðstripped from[ M  Ý eQ@
def  F1ath"B"""GÏ  é ‘ names, r+s\  ,E."""ä ;)8rx5 Vaè'm ' `() argË …an emptyŠ 'Ö ' ås = tuple(map(é"s)ä
Ns[0]ø {÷3 â2  	¶
ˆ `_» [	 t —   š  "s]A §	H   ðisabs, = set(p[:1] = pÞpD  2 us�  ‘ "Can't mix(`olute “srelativß"")g ¾¯ Jê ![c– c– s\cJ 4c !á]!  @ < €—s1 = min( Û  s2 /ax Y +1” î  l1i, ’ Çenumerate(s1W ' 1if ¥ Zs2[i]0  Z 6[:i®     Vbreak± ‰  epÄ ×ð sep[:0]
        rò0eturn prefix + sep.join(common)
    except (TypeError, Attribut !):(  , ògenericpath._check_arg_types('V   @', * sc  ; ðraise
#  Author: ð  Fred L. Drake, Jr.#    fd  @acm.org
#! ðThis is a simple little module I wrote to mak ðfe easier.  I didn'tI ðsee anything quit- °ke it in th ñbrary, though I may have overlookedK 1omeH c �  ¨ @when“ `as tryi ò
to read some heavily nestJ ðtuples with fair ô
on-descriptive content.  ðmodeled very much” ð
after Lisp/Scheme - style�tty-print“ €of lists½ Áf you find i&`usefulð#ank small children who sleep at night.

"""Support…5prem g ", å ð, & dictionaries recursively.

VÍ ãd, but Š  especially¨`debuggÇ òdata structures.

Classes
- 1

P� Pù 2er(¡OHand@peraœ `s ontoo€tream usm a‡qfigured#Ñset of formatW�parameter‹ 1Funê � R--

p. ‰ F; ð  a Python objecŒ~ HÁed represent¤ A.

pÏK è âQ O sÍ €[defaultQðsys.stdout].

safee R Gþñate a 'standard'† Ò()-like valueªp‚¦ct againstÙ*¨q"""

im3Rcolle+W as _ #  A cÛ#  # $re
 1sys% 4sys ³ 
 “
from io ‚ �StringIO"  â

__all__ = ["m3","ÂP","is×Cable Ì4","K!", Ü"¥�ò ", "pp"]


def a (,Öóeam=None, indent=1, width=80, depth  *g ðcompact=False, sort_v@s=Tr°òunderscore_numbers+ ú#""¨ M( ß õ ¢Yer = û (•= é ð î ô ñ ÷ ï ì  	î ù 0 ü   &¼ .™)­Ç®± ¡ ® w	´ ¢:ÀPython objecñ(t into a pretty-printed representation."""
    return P- P, ’r(indent= �, width= �, depth= ,B  F  ƒcompact= Ö, sort_dicts= A þunderscore_numbers= ó
).pformat(object)

def pp y, *args~ °False, **kw !):Å 2"""0¢ a Python Y .pN^ Ü c – @safe…> y PVersik f¥ÿ() which can handle recursive data structuresÈ0)._v _w ò, {}, None, 0)[0]� ­isreadableŸ ÐDetermine if O N T) is : ¯ by eval()– -1– ù — ¦· requires a2 ¯ ù1¢2]

class [5keyB°Helper funcd… for key as when°ing unorderug1s.
ŽÃThe wrapped-Û áwill fallback áÁPy2.x style hPrisonv E _ ptypes (ž z Tfirst4 png the # � name and An byI   ö	obj ids).  Does not workh lyg ãñ.items() must haveH 1€ appliedÇ @bothn )z c value {? ò_slots__ = ['obj']. óà__init__(self,O` š  .Â = 5 l3 Gther5 #trÙ B   r*M 0< o3  Y    $ òexcept TypeError    B `((str(p®  A g)), id E < \V  <  < ~ =  qstuple(tÛ "¥>Qng 2-/ sH ¦key(t[0]),ûd(t[1])BEû œ V$=1X$80U–rstream= *# ® 3ct=Ê ÕZnTrue, (+  JB"""HZ& Ø Aoper"2s oH� 0 us …a set ofœðconfigured param-Ç j î /   NÐ  of spaces'  ¼° each level# snesting ? ˆ	Q ÐAttempted maxóimum number of columns in the output.

  Udepth   qThe maxH  � to print> ÷ nested structuresM mstreamN pdesired? 0put; Ðeam.  If omitO ±(or false),¨ ‰standardL ½ @ ò available at con’ ÷ion will be usedž ycompactS õIf true, several itemsB €combined?‡one lineR ¯sort_dictsU     keys are . 	‘ 5"""8 Òindent = int( ) Swidth   2if . U < 0:2  Éóraise ValueError('* @must Y>= 0'K ð€is not Nò Band  /<=a * ` _  V À © %  H !¨ bself._k =� ø  è ¡_per_level; `( g !=   $ifc	
² g ï# =/ A Oelse0 
¦_sys.stdouŽS ¤ƒ = bool( ¤&  Jx } …& ²underscore_Ns =  Qdef pæ(> –, object)È   ’._format(  7 Œ	1, 0 ]{}, 0³ Ç.write("\n")x U  b y ü io = _StringIO([ > “ !io‡ ;0, Š ð return sio.getv(‡ ¿isrecursiveB  ‚w l  ù 6[2]Û  T  ad¦S Rs, re#  
 �  Øe 	l’ C  ° gË Œ ¼g,¼,FÀ, allowance,Uatext, EPobjidUd	“ if:i20con@ C –,	_§ $onI J -  % •ve = Trueý # C@ = FG	# $ 4rep_S_repr{ ð 1 Amax_#7  -5& -65 Ðif len(rep) >QC 
‰ €dispatchšS(type– 1)._¥ 1__,‘
 ðif p is not None:
   úcontext[objid] = 1
! ó  p(self, object, stream, indent, allowance, N Í, level + 1)O 4del( v # ireturn öelif (_dataclasses.is (� Y) and8 Í  not isinst¨ - o, type3 Q &._d ï_params__.reprj …# Check © ñ  has generated ; method.©  shasattr¢ 0.__0 ÿ__, "__wrapped__"´ ó"__create_fn__" inµI .G ý .__qualname__):Ž Í¥ †._pprint)¾ *`›Á.write(rep)
Ö Ndef ¦  ½ Ö *@cls_?& =hžA__._ !__�  †/„ += len(; )%$ °tems = [(f.Y W, get",  €)) for fâx“es.fields�a) if f®]c 	#† f + '('¬ �._formatÈ pspace_iŸ ( ÝW :Ÿ3')'Ÿï_dispatch = {}³ ?ict„%®# =À†  7('{2if ºR_per_Ø:> 1/> ¤ -._/ —- 1) * ' ] Plengtñ  l( if$:gthf ‘ ªsort_dicts! g ¤ æ Sorted
.´ö(), key=_safe_tuplet  < OelseR ¦ K : 9 (0 ™ + ý,J  N  �Z· z-'}L[‡ ø Ú>icteqorderedWÉ+0if uÞ
Y	‡ åª)Û  
 cl‰#__lA	U 4cls…À_ + '(')
     ðself._format(list(object.items()), stream,
/  ñindent + len(cls.__name__) + 1, allowance D õ context, level)% y Á.write(')')
 ò)_dispatch[_collections.OrderedDict.__repr__] = _pprint_o  R_dictI 5def û  ", ø  ã Ë +, ² :˜  
³ '['Í i_]i 4 m  ˆ ‡ ]: ï &  otuple(=(ñendchar = ',)' ifQ"ö ) == 1 else ')'æ S# ªo )Ö^J 5œ3c / ‚?setb0hif not=� Ö 	¡ %ð)ª ' ereturnjStyp =¥.__class__ 0if " ois setp ''{ò g = ö}Ø éF 5typf_ + '(V 	/ q Ì1 +="J °Ò y“ = sorted%ö , key=_safe_key3 FÝŠS/se1setð ´ofrozen0 	1 	¶/tr¶0ã nkòk ´Ó= (Ìµchunks = []c @line ÷a.split V(Trueè—1vel‘
£Z1W  ¾ &=  Õmax_width1 =   Õ # -|Q pfor i, › à in enumerate( *s)’  reµ  Æ À         if ûi == len(lines) - 1:
  ùmax_width1 -= allowance( !ifG †rep) <= 3 O àchunks.append(2 	J Nelse5 ñ# A list of alternating (non-space,  ™) stringsU  Ò ðparts = re.findall(r'\S*\s*', )4 qassert ;  #no! M[-1]% ; ò	.pop()  # drop empty las9 4 >'2 K' Ícurrent = '' afor j,º á in enumerate(‘ )b #Äcandidate = ^ +D `  / Dif jAW  A_ and Y D   ð a (   i%r(¯ F)) >t2Ý > Ø $  ( ¤#r(8 )% 1   " / =2Ý =   A Ú x$ifšÂ º E, )Ã÷^writeœereturn” G ?velA 6'('/ ’ji, rep‘† 
Ï Šif i > 0  %› ö'\n' + ' '*indenth % 	\­ A)')
Ü ò_dispatch[str.__repr__] = _pprint_str+ 5def ðbytes(self, object,�Ream, ¥ ,>÷, context, level’â # =< . ˜  Ú Ç "n(` l4$/  »r% 
ÄPparen† Êl  
b Ì U += 1+  ›  • 	Zdelim¼ "a_wrap_RÌ  , _.�. -WG “ x k 
 	! 0 0if Ï1 
õ     ³ } ifü:ens= n 'a â c e_arrayi&À:
        wróite = stream.write
   å('bytearray(') Ðself._pprint_" "s( ƒobject),S å, indent + 10,? b  �allowance+ ð, context, level } ™ A)')
R  _dispatch[„ ¬ Ø.__repr__] = ¨  7 5def Ðmappingproxy(Ý ", Ê É %, © ¥ !):Ž  Õ P)('] Erformat(o o.copy(?3{  N
95
“ < ‚_types.M
P
OTypeJÒ Mÿ simplenamespaceP00if ž %S) is ¯ Sl Nl ƒ ‡k# The #   B "¢ õ" instead of the classÎK  . ¡, so we do' ñsame here. For sub9 qes; use#   < .P @cls_ @ = ' *'# JelseÌ 1 +!__] A__._K %__? ud= len(; )7$ ctems =è°.__dict__.i (9K N + 'Ë� Ð _L  I¤ µã´–··  ¬ ² ¸ ±  + Á¾t¹ …"._ Q_per_H i pdelimnl?@,\n'�C ' *o' AlastE "x Ô U) - 1$ òfor i, (key, ent) in enumerate(2 
� W € = i ==  c R  0repå ( r_ ž 2 F(rep| 7': :  !¼L(ent©! +ý P O + 2/ J Ò1 ifÏ  / 13 È 	aif notI 
6 l å ¾À‰É < æ !, „á ‹q  ŠãÀe
        deólimnl = ',\n' + ' ' * indent
  Plast_ õx = len(items) - 1$ ófor i, (key, ent) in enumerate2 :/  Z  W € = i ==  c 	# PwriteT )  :'=' dif id(} zcontextt  x ð# Special-case representation of recurs ùto match standard‡ M . Áve dataclassT ., Î Z"..."¹ Nelse¨ Àself._formatÖ “, stream, ! +��key) + 1,p     Áallowance ifo v 7 Fz, level· aif notM ¾ í !deb!)
� Cdef Ñ _D(ä !,  ß %, ³ +, ‡ o g # =. l  ù  ´`nt += h .aqnt_per_Ï ) f" F > 1m  T b (¹ Q  0) *G+f'  % '— Äwidth = max_ Ê  -
Š itU3teruN :tryË pnext_en0   6(itµ Ðexcept StopItÄ:ion> ereturn^  Â… = False _while%y  „ 3  dª    £  * 0 =  	®    ²  & § 6Tru¦     g&-=}	š  ' |# iLocompac� 0rep²ß ~Ýãw }0repð2! 2if › :< w« ¶    PD  & 1if ŒD  "  " =' -nlF Š />=‹ M-= w>  b fh ”     .&, 0   B  -a  n+in4 [ 
v  ñ ‘§˜á” ¸ 5ext�Ý XJ � �, object6À   repr, reaÿ)dable, recursive = self.format(object, context.copy(),
  T å_depth, level)D ¡if not rea� :  d 9  … = False# &if» 9 Ø 6Tru9 Áreturn repr
N Cdef õ  t +, û Q, maxº sÂ q A"""F16  J ´ a specific? h w 0ing Qtring}  ê ðand flags indicat& ±whether the¬ ô esentation is ''F 5 Æ < 6s a2 ˜ ustruct.A 5""" r% p._safe_0 Sð_pprint_default_dict(Q apstream,÷ åent, allowancewq43lenŽ )� MT w.write(µ )w ' á ð $df ê .½ }factory˜ A Scls =¥.__class__  indent += ¹ õcls.__name__) + 1( 	¾ ø'%s(%s,\n%s' % (7 Ã, rdf, ' ' *@â  g.� y", a s  ‡ ß 7 VB')')èð_dispatch[_collec s6 ò!._Pe__] = ’ I  „ counter,†ë	+³v + '({'ˆ"ifr_Q_per_hO > 1Ö.6 `- 1) *d 7temšÆmost_common(% /¨ _i7 ( 4¥ @ Ç / +äßO + 2Jz 	a/'}�CO‰k„ �hain_mapl²<_.maps·2‹À__name__ + 'S(')
  õindent += len(cls.__name__) + 1( õfor i, m in enumerate(object.maps):,  [ bif i =V & J - 1*  . ò	self._format(m, stream, ž °, allowance” ö, context, levelÍ  K   ? —.write(')ï   Oelseƒ 1w Ã,\n' + ' ' *É !)
$ð&_dispatch[_collections.ChainMap.__repr__] = _pprint_c B_mapC 5def `deque(C", kAÆ 
aif notG Ó	V ¢ ÿ)�areturné  nScls =˜ ¥.__class__ 	U  ;©!	Q ''[ü$if‡ Ûmaxlen is Non H‹c_itemsç UU + 2,Ó  ö   µ	
µ ]²®¢ – +brml = o ð.?J	Ò R,\n%s8 ˜=%s)' % (o, rml) è Ÿuser_dict0¢_.data! ûâ �UserDictå Î é ?lisé š?Lisé  Î é ostringÔ™S² ÖÒ ï Asafeæ DKDvelsÇ1# R‚� triple (»Ð_string, isreóadable, isrecursive).
  õtyp = type(object)  if õ in _builtin_scalars:$  F ´return reprD å, True, False
. ðr = getattr(typ, "__7 ¦__", None), Òif issubclass. ôint) and r is int.? 
‘ ü
if self._underscore_numbeº ¾ 2f"{ Z:_d}"À  '  Jelsen   ×  8dicØ   Ù Cnot © W ‚   † /"{Á 	¤objid = id­	H Áif maxlevelsl 6 >= ÿ P"{...| ÷,¨  id@|contexti ‹ 3in   Y _º$on´ [¨	X L [] Y] = 1 "re! =£  # =º V ù components = []: PappenV% . 	' L+” °Psort_ b ƒ @itemz  $ e¼. ö(), key=_safe_tupleÆ < µ<   =§4ectK 	± €for k, vÅ/ £kÁ4, kY  cuë…yformat(W  ”   $k,û,_!, '
Â  . vj vj v" =ïj 	vj »Ó("%s: %s" % (ç „ )œ ” 5 =   ªL»  ifB 72or × k ò  ÄÁ4delQ 	i  0%s}Õ ¦", ".join(·%),Á  
 	—(˜8lisÁ  Áh) or \‡ ? ±!Ù A 
@  p )&  *?if -	 # /[]ò ) [˜ = "[%s]"Ï … elif le›^ == 1� C \(%s,)D VÂ )()Â Àe
            ñformat = "(%s)"
  ùobjid = id(object) ñif maxlevels and  6 >= :1  W sreturn w ò% "...", False, r ©in context? -if  ` ¤_recursion» d ITrueX l [} Y] = 1 ½readable = ; f v Ã 	: ù components = [] Pappen]% . 	' S+” €for o in>ect„orepr, o½  ²cur = self.€(l  Ÿ  $o,,Ê,Þ
 . µ (q  fif notˆ ª  D ¦ " =	—  ûl@ í‡¤4delÐ ã	_ ‘–, ".join(š4), £  
 m 
H `rep = sn ð`rep, ((  ) órep.startswith('<'))¤ð

_builtin_scalar@òfrozenset({str, bytes Àarray, float¼emplex,ƒ  b þ	bool, type(None)})

def :t(D("<R[p on %s À z id=%s>@1% (` =§.__name__,R3))
x “perfcheckD=— } ¢import tim» ’@ is ( '  æ m  qð("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 10 3 ËâPrettyPrinter(×At1 =‚ .ª G_cou ‡p._safe_Q, {},� A, 0,<I 2I 
pœÉ 3 33 	 § &("� ²:", t2 - t1? p" Z  3 2ôQwrap_R
Â òwidth, allowance)h`curren61b''50las %lep‘ // 4 * 4   ±i±prange(0O+ 3, 4Y  Á0parK ÿ v[i: i+4<€candidatr‡  + 4 h  A €if i == ” °     Ï 6 -=Ñ 5  ½ Àd Q)) > 5 
H 3if | 
  d Ryield$ „     * =µ JelseM ) � ® } u D
if r ð"__main__":
    ó-_perfcheck()
#! /usr/bin/env python3
#
# Class for profiling  ñ code. rev 1.0  6/2/945 õWritten by James Roskind
# Based on priU €e module1 ð0Sjoerd Mullender...
#   which was hacked somewhat by: Guido vank �sum

"""¼ PÜ ¼ @"""
ã ðopyright Disney Enterprises, Inc.  All R$  s Reserved— PLicenÑ €to PSF u² ñ	 a Contributor Agreement2 + ³the Apache  ð , Version 2.0 (! " ð+");
# you may not use this file except in compliance with F E  · YC øobtain a copy of( " a± Áhttp://www.a© b.org/lù Ñs/LICENSE-2.0à ð Unless requiredÒðapplicable law or a@d to¬ òwriting, software
# dis@#edTÂ 9 is! ð4on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND0 °either exprÂ @or iEped.  Seh¤ ’ ðspecific languag¼ agovern(PermisÌþs and limitationsÖ ä.


import sys Dtime ðmarshal

__all__ = ["run",  0ctx
 P§0e"]ÛpSample F rµ  1 ñ
#i_count = 0
#def integer_- 1():v³    global 1   $ = E + 1 dreturn 0
#iW s- g „ # repla¨C™d± D  Jœ As

c�€_Utils:
Ÿ a"""Sup9  ­Âutility funcq@rare shaš? ×Ae.py¤c@  m•!s.( PNot sh ï be~¢d directly& S –  Rã__init__(self,A2er)¸  &   .‚ 5r =# 
s  D 3run? AstatH,î@name4'rtP  K 9 = W !()M  o 6try|    0 .c ] - N«SystemExit; 5assY kfinall] † `_show(h · 	å >ctxè z�s, localsB ’  a ù !w ü ,ëq b2 =3ö %if  FNoneäðdump_stats(filencame)
  Uelse:   ÿprof.print_stats(sort)


#* 6ð

# The following are the r ñic member functions for   � ðiler class
# Not: ð$at an instance of Profile() is *not* needed to callP /m.Ö :�
def run(Ç pement, … °name=None, MB=-1)ta"""Runö / u under æ  opÿ €ally sav)¥results inZ 
¿EThis1ð takes a single argu� ò that can be pass1theD f"exec"� P, andYˆ t  Ï `.  In G¡cases thisD ðroutine attemptsoX –its first�  ` Egathõ 1ingG  B°istics from­ ž uv. If noŽ  äApresrFthen� D� automatiü!y á"CmplesbBportªPed by| ” Qndard@ str/ (ád/line/k -!)l3is ™ Qed inH Peach 2 . 1""" ãreturn _Utils(À/).P¡ $)
t8ctxwÁglobals, loc  §  ˜ ˆ!€, supplyð “your own b #e Ç ,´
.µ æù 	£ @ havÕÁe same seman
aM× n =Q
\A©‘{Á pelf.cur�PalwayS�tuple.  EèQsuch  ± correspondai!ckÇ  frê žóis currently active (sh [-2]). >J `defini&s tN�s.  We us[òis external "parallel� A" toJ ðavoid contaminatþ ¤`progra“@at w]?c. (oldO!erI ug write intoS ô s¡1 diêâary!!) DerivedæeY ¶PchangÀ &e è  ç ð some entries, aV  V ˜rey leavâP[-2:]ƒ Qact (‚ Á‚previousª b0In Ú þ#in*@erroëÖ ‘detected,Í R-3 elË ised†  /67 [ 0] = TimÍ !at›…be charg™0 pa.'ã< ±P   It�hs] ð call will not höave to access the
  ð timing data for á parent frame.- ð[ 1] = Total time sp# rin this+ ð's function, exclud[ / !inH x 4sub* 1s (B ôlatter is tallied in cur[2])„ 2„ P { aexecutŠ 
û à µ Š 1Š  -3Š qName of3Ï ð that correspondszá n Ê -Ê bActual<8 'we;  : P(used	 @syncT ep_” handling-Ÿ4Our¼›6-tuple (‹ † ‘f_back).
•TEeachÊ ’Óstored as a 5Y úAe dið1aryK Rself.Sð s[].  The indexH Qalway‚  n<X 1in 8  î2-3]$ 9 `followº1areg`definisz‚members:Ì  [0š =  nu & 0imev  ¨ ð  was called, no²!un$adirectÍ ­ orÁ  p recursà! [vNi 
�appears o*Ðe stack, minu ‹[] @ternqof¾ } „€Cumulatiã —p- ë @pres°† H.  I–Cnon-á %ve "s,|  ™hH S N  u @fromÚ r80to ¬ shƒS`invoca½  ac I, in-\è †Hall æ% [4îA†¬ e !ngÏy � v Ð +e j !it2b by usm 2"""d°bias = 0  #D2ibrÕ ‚constant& `def __®0__(à,9€r=None, E  %):}  & >Z = {} `cur = ?  {md = "" _÷ _ó   !if~  ’ M €  k ˜ " =‘  6 �   " =?  . À# Materializéa local�`lookup-#edn 7 !ifu r f  … @get_ ! =@@.proÈ �  U ; �dispatche+ dtrace_ %_i4 Oelse}  t r-  a t“  Ñ() # test out› rÒ
7 *ryg  L ù length = len(t)1 û except TypeErro" > Ù 
¬ À    self.disñ	patcher = self.trace_dis G_i
  Yelse:   îif length == 2   $ \ V n Z p P -_lR ÿ%# This get_time() implementation needs to be definedE  @here% Pcaptu Ðhe passed-in Z  r 	  rameterG  ÿ#list (for performance).  Note that we can't assumeE  2ther ð() result contains two values� /almcases.Y 5def',!r(Ø = ¯, sum=sum)ð`return% 6 =())b Š+ =n / ' t 0 (P ! ñsimulate_call('profiler')
I ô# Heavily optimized �� routine ‰ Þ �.process÷ "()^H  
#( 0, fæÇ, event, arg T a'im Ø  Ð  Ã[0] + t[1] -š	 BbiasŽ  
"ifu  }!"cÿ "” ¡ à.c_func_name =  !._ )__K , [Î ]â tØ   ­  Ó Á   I  Ê Š  Ø  * G rG rðt # put back unrecordÓBeltaÑ 3# DÅ	àBbestÑ£ program (­à= scalar, fast( !if³ ð# an integer but flo›0ork+�o -- andW <‘relies onÏ").� G)_igÔI#(t	 1j 2Óð+ _ - t û&¢macintosh ” øs¸  tticks oõÓ1/60th secondH¹ ?mac»6T/60.0·ÀGÀ        if s÷elf.dispatch[event](self, frame, t):
    õ.t = timer()/60.0" Oelse0 ñ - t  # put back unrecorded delta
R ô # SLOW generic ¨ Â routine for‡ ò returning lists of numbersJ ¤def trace_E *_lè ü W, argñ @get_è 1 = ø  ž   	 B() -' t	 3bia�  - 1if f Ï == "c_call"- Ðc_func_name =‘ !._ "__Ì K ‘ Î »² É ¹. ·¶cIn theí ‘handlers, âfirst 3 elemenªÊ ñcur are unpackedš ð
# into vrbls w/ 3-letter ñs.  The last two charactersJ ³meant to beM ‚mnemonicu#IR _pt ¶Àcur[0] "pare9 aime"  aF a 0ged % %^  O (_iN Á1] "internalH " 0 spa ¢directly i/ öHtionO eO o2] "exO din subE wø Pexceph 
 èprpt, ri e Qfn, rë 0, r©1cur­  ú Bif ($ r is notAQ) and5 u +   ±y™ M  �d )$= £ +  ¥ 6 P 2 1
?  Š"if§  ù  Í 	1.f_¹ì š K[-2]é L  !!ifE¥isinstanceÑProfile.fake_� ² ;   cassert¶­ 0  €, ("Bad ÿ "â%n,5 D  ú D  6` N %¥ ,AL )L s;06 î.ÒÍis None or \d ‘ Š  ß|  0J-2])GD L  T &3]¸ @fcod‚   c afn = (# @.co_ ',  –rstlineno À_name)
     ñ   self.cur = (t, 0 ¥fn, frame,  3)
  ’timings =   “if fn in  :  @ Ðcc, ns, tt, c PallerM / I[fn]2  2 = @ M + 1D 6 Jelsev 
D ä  %{}7 ‘return 1
 ðdef trace_dispatch_c_call (3 &t)k  fnF!""D & Æ.c_func_nameA sœ+q`’p k ¦r is not�vcur[-2]– wbassertÔ . ƒ * ò .f_back, ("Bad u "úF[-3]½ N > 7 ¬  O Y B, 0)M 5 ñ# Prefix "r" means part of the R~°ing or exit „.�
C pC €PreviousB `Parent
 Rolderú .Ž prpt, ri e òrå 5cur~ Prit =4 E + t £ e_total 6retj pj pj pj pj p6 2, pk  r Q x 4 = ; 1 + ° Rpet +Ë r -, O y õ¨JF$ =¹([r‹!ifc*nsY`# ThisS Åô only occurrenceÜ qtion onìVstack×ÛcElse tM �a (directP Dr in À) recursive ŽU, and<J °its cumulat' ò
time will get updated whe� qtopmostN = toL s° cc�	< !cc¯ «” if²  ½ +erN P[pfn]>  ù	+ 1  # hack: gather moreu ñ # stats such asn@amoufÙûe added to ct courtesyD “±is specificjQ �contribuÓ I c@ W  !is@ @ ø ƒ ÎÅŒ ?" -ÿ  YIk‘ Ïž ÆÐ = {
        ð"call": trace_dispatch_ 3,
  ®"exception*  / _retur,   ) ci U  	) h . W à  # the C func®   &edÊ "c_ F + 1}

 å# The next few\ ós play with self.cmd. By carefully preloadingI ñour parallel stack, we can force¿ óprofiled result to includeF ñan arbitrary string as< qname of  Ã  .? eWe use´ ; #atJ Q, and@   B £stats lookC âvery nice :-).'Àdef set_cmd(q, cmd):2  Gi  'sur[-1]:œ ¶palready@ 0  D  T  =I 
 �simulate>(h „ ö class fake_code}  � ƒ__init__ž  d /€, line,  ¯  ³ ƒ $o_+ 4 =  � (  I ! =P    c ! =j   PfirstE bno = 0Ô  a ¿ Crepr¿ © Ó ! (ß &.c¶ ,ë o_[   Ž "))e 9Ofram: [{, priorˆ 1f| ·o³ Ã    bback =A   à 
Ô + ” y " =Ï å#('1C', 03 ^u ‹ pç M c”%2]7 7els	0 2Nonˆ  	E ’  (© ", d )V  Ô .b [' !']¯!, 8 3, 0�€# collec– |€from penL9  @gett Qfinalo �# timingsX12cmdf °H±md_complete’ Ù„get_time- i  Dt =  B() -p t  Dwhilp i*1]ŒÐ# We *can* ca›QasserÀåerrors here ifR  v $# K_¼Rcheckø añ   mÓ!> Œ< Ž 6, tÃ y  ï 0M +   	t< Ùaprint_D[—, sort=-1d�import p& \   .S;  ).ï�p_dirs().H Y uort). \<  ª  € _À def dump_stóats(self, file):
   with open( Æ, 'wb') as f$  +  =  .create_stO )D    Ámarshal.dumpj .& Q, f)
) Idef @  R ‰   `.simulc Öcmd_complete(j % unapshotˆ ` s  . b  ¼ Q = {}6  » ð	for func, (cc, ns, tt, c °allers) in N ÷ .timings.items(]  I c. 3 = 
 W.copy¿  % enc = 0}    �  2 0cnti   �ers.valuee  1 Bnc +e 9cntK ¥ z[Ó ]Œ  Ô cÔ 
—ò# The following two methods can beÍ ñd by clients to usey p# a pro=r  0 a † Àement, givenU  Rring.}  1run0W, cmdQñ import __main__m  ü edict = 0.__ ! Sretur¯Àrunctx(cmd, '  ’!  7� ÷, globals, locals’  % €.set_cmdS — ys ü Ï ¶.dispatcher( :tryV@execK w ð kfinall8 sq FNonef g ä#is× 
 0oreÂ;ful´QingleAtionû.‹ « œà ,% ÿ, /, *args, **kw.Prepr(‘)§ Ä ^5à  O (| ¨  #3 * .|  hLAcalcÏð s the overhead ð usn< . ‰G pproblem«ðthat it takes a fair amount of timr ra €rF qto stop  	 w�a (from < �it receiv^ ‚n event)óÀ# Similarly,1  re‘ Ša delay G §  å „ pre-star4!he� † 0bef„ 2 àuser's code reì0 ge1 oÈ ‚continue#¬3 Atrie’pmeasureª ã difference onG aa per-á c basisæ  0Not< xat thisB ðis only significa§fh @re a 0 loŽJ c ñs, and relatively littlwrí 2perp .  For exañ,G Þ ŸQsmallp •°s will typiŽ’y benefit’0havYðthe
    # profilð8er calibrated for the current platform.  This *could* be
    # done on 5 ðfly during init() time, but it is not worthe B Ðeffort.  Also" ðe that if too large a value specified,B nC �xecutionq  � �some func ós will actually appear as aA ñnegative number.  I° �*normal*T £(with veryE 0lowKõl counts) to have such c ±stats, evenä hK‡ È `figure3¢"correct."g  ² One altern¹ °to profile-u ‰ Ô M óadjustments (i.e.,E 2add­ Mô magic little deltaÎAeach±  t)“ ƒto trackF °more carefu^ 
G2 of6 Ás (and cumul¯ !lyÀoH . E6subÄ)€are seen£0f t”4werC ŽZ ‘ arithmetic”`ld be # R afteéCfact3 atŠ qdisplayNR).  C ¶ "weü P onlyfƒl/returnê .C RTheseµQs can{ ðeduced by examin} /�callees %  #rsG qvectors€†Ôó
.  Hence we *can* almost 0 ÓE !in(lÐ  [‚at print C(notxwþ Ï4on'ô` excepVñ  v@cessË øP.  UnÔPunate5&th£$is]ð ly no similar i3 !maZ  †-T sub-ø Ó  ä  O0uld7 b@hardw‚"get all! [ !" ñ "rE ST … y,Owä»�to extendOp tuplesa CkeepF ö  ìŽ2in © raü ÓHthenG Adefs0 SimingG \ `includŽ°e significa©#wo½ôs. I'm a bit fearfulG  ;‰  Ý N al# tOs¨ vóheavily optimizedC  š t/b  r� 4 d"r $@run P per, fur§
"·dadded"ˆ ".)j * *
E 0def†ì e(self, m,—�bose=0):'  ­0if    .__class__Ì ’P9*  . ñraise TypeError("Sub8 ôes must override .¹be().")˜  C Âsaved_bias ={   � �   E = 0 ;try‰ _. _k v_inner(ë T w 0finç
F ? m Ðsaved_bias

 ó   def _calibrate_inner(self, m, verbose):
  °get_time = & . 
" ñ# Set up a test case to be run with and	 ÷out profiling.  IncludeL ðlots of calls, because we're trying] ÷quantify stopwatch overhead.N øDo not raise any exceptions, thoughd P want_ GknowG Ðexactly how mG Ä ðe events are geneSad (oneÀ  7, +K   dreturn ñper Python-level; &).a ³Gf1(n– �ífor i in range  # [x = 1I Ÿ(m, f1=f1O m  O vf1(100)Q @f(m) `# warm thû 6che% Ä# elapsed_no81<- UA _takes 6Tt0 = y%()  >  /t1% } •= t1 - t0< $ifúù Ø sprint("C ³  Ð	ÇN =",ã &ÿ    ØThe differenc"&is( õ°, only some>`which �S Åer subtractsö  # È @on is&wn9Qp = P§eo‡ p.runctx('‘ñ', globals(), loc
 µ¨±  ¦/'£a 	¡‚reportedëú<- "CPU seconds"Ipcharged'fÙ&f1:Ptotal`vls = 0.d
c 
  Ëð(filename, line, func �), (cc, ³@t, c pallers)ÿ\Ñ ³  ûp.timings.items(Ë%if\  @ «("f", "f1"(  K Ð ]+= ccm 
Ø V+= ttüY'f'¯4er S Z ›G � Ÿ¤ ! #8s4  †2 7if  š != m + 1ò*ðValueError("internal e :D l b %d" % p "#É ¼ . -&% =Â
egwasn'tK 1ablVñ
measure.  Divide by twice@ `number@ð (since there
    ñ4# are two profiler events per call in this test) to get the hidden
H Ñ   # overhead< G $.
 ómean = (reported_time - elapsed_no� ð) / 2.0 / total_„ sG µif verbose:  c qprint("f šstopwatch‘ ` à P =", . )G areturn O

#* 8Â

def main()·  im" oÙ ãfrom optparse  pOptionP !r
¥ “usage = "Ê ð .py [-o output_¾ð _path] [-s sort
 ðm module | script( Á] [arg] ..."\ { Hr = w (r = (' ð.allow_intersperÀÇargs = FalseR a.add_oË Á('-o', '--ou… “', dest=" !",9  Ïðhelp="Save statsw<'  >"8 ªfault=Noneš o mb mP", acVÍ="store_truev P	£ a libraryA.x ç y sè  ƒƒ   l ñSort order when Ç0ingð ñstdout, based on p!.SWclassP "de2-1).òif not sys.argv[1:]| `Èo _à(Î    3 cexit(2K (Á0s, æD) = @  ž_ ?  ; n A:] =. � S# The€³ that we'reu ñ ðmay chdir, so captu™Àhe absolute Ü"# ‚ú Ò0 at+Brtupu ifSSions.91 is 5Ü % P= os.k @.abs þ " pif len(ý V) > 0R z x  _àQrunpyÏ     1codßBrun_9  (modname,   
 @='__IB__')º :   @glob‚{T   '= Q  ':J 6py. u ,   'v !':Â9[0]S } .el‡ og§ ý;   S¥.insert(0,m0dir9 2(prB )� ” •with open! Ú, 'rb') as fpb 1 Mðcompile(fp.read(),t¤ Š, 'exec'i G_c6_':D  t   0'__È _& ¬e ‘__package+  ”% ocached$ ‹:tryprunctx(!, Õ ð , None, optionsó
.outfile, options.sort)
  õexcept BrokenPipeError as exc:'  . Á# Prevent "E6 ùion ignored" during interpreter shutdown.G ýsys.stdout = None âexit(exc.errno¬ Felse� òparser.print_usage(' rreturn   ð

# When invokedÖ Ómain program, @ the  (ðr on a script
if __name__ == '__@ 2__'‹   ñ()
"""Class for ”  
preportsP 0pro\ ñd python code."""¡ òritten by James Roskind
# Based@ iZ F p module1 ðSjoerd Mullender...
#   which was hacù ðsomewhat by: Guido vank 0sum† òCopyright Disney EÈðises, Inc.  All R$  s Reservedo PLicen© €to PSF uŠ õ a Contributor Agreement
#
# 2 +  ~dApache `, Vers_P2.0 (! "5 ð");
# you may not use this c ¶ ÐieÑmpliance withåE  · YC 0obt˜a copy of( " a± Áhttp://www.a© b.org/lù Ñs/LICENSE-2.0à ð Unless requiredªð applicable law b òd to in writing, software
# dis@#edT Â 9 is!  µðn "AS IS" BASIS,þðITHOUT WARRANTIES OR CONDITIONS OF ANY KIND0 °either exprÂ @or iEped.  Seh¤í ’ ðspecific languag¼ `govern`permisÌÁs and limitaŠÖ `.


im7D sys o
 Dtime tmarshal Ðre

from enum¶ ‚ort Enum ”functools ¢cmp_to_key! PdatacÅe#  " 0typÑ   °Dict

__allð ["Stats", "SortKey Fw BionP  '  1]

u  4 Q(str,· )bòCALLS = 'calls', 'n
 5¡CUMULATIVE# �umulative( 0cum/') qFILENAM'  ' Ó % mK$ 1LIN  Bline 2 . H 0NFLj 2nfl" P  p— 4STD; 6std> "TI‚ ˜ a, 'tot 
\ !demóew__(cls, *values
 ‚ 1 =  As[0]9   Öobj = str.__nC ) & !._ _F B  ¼oþ!  –* Rs[1:]� C   3clsG ×2member_map_[> u] = obj] Aobj.+S } s! ¸ 4 5

@zó(unsafe_hash=True)0Y  à: int
    tottûime: float
    percall_tott <cum .   pfile_na^ 1str\ ñ line_number: int

@dataclass(unsafe_hash=True)
 � StatsProP :G @'''C3 ñ for keeping track of an item in inventory.'''; ˆtotal_ttò bfunc_pa ós: Dict[str, Function} (]
’ ‹ ‚"""This « qis used˜ Pcreat™ Ðreports from ï ñ generated by theš e J ð.  It is a "friend"Û Bthat! ‚, and im[ V Reithehðby direct access to mewsG 	k @, orˆ @read¯ qin a diù 1aryœ x €was emit¸ Ò(via marshal)Ú Ithe Y !.
< æThe big change, „previous5 ¡r (in term¤ @raw ™ €aality)N 1is � ðan "add()" method has been providedõ rcombineD| F ðseveral distinct4  _À runs.  Both™Á constructorq å w G z ñnow take arbitrarily many T  ãs as arguments1Alle SprintÇ &s N n2 ô Òindicates howa  QsŒ 1to H  :fW 2argBÜ Û poi €P betw/0Ù @1.0,6 nM i| Ô n¹ � decimal`entageH‘vailable Œ  u"be‹ !edM ò (e.g., .1 means @ 10%C Zall aC )Ã „  Íqnteger,M  š Õ an·  Õ #of‡ "ofk-€you wish� 2havp.#edŒ ¦`sort_sn#()�Ž0proEÂes some addi–0 op	 ¢s (i.e., i>!  o  #Áold -1, 0, 1n2Ððare respectivelyPerpreba×@'stdA@', '—s	  …'p'cumulaA '9t‹"s # a“ šy)0quoi pstringsÀSortKey enum½ 0selD Ä  �Sorder5ÀFor example ! ='  '¹ )Z  e R.TIMEÔ QNAME)I 2s o×1majãy,•'internal j  oê  ­ 7min6    Š  C   V±'.  Look atCPtwo tÊsÉ¶ )&Aget_ áarg_defs(self)ðDmoreâ%�s return 1 P, so •Bcan €P togeÀâ commands likee —P('foo`goo').; ‘p_dirs().˜ ¾*1).\³ ?  À     print_sðtats(5).print_caller ‘
    """
	 ñdef __init__(self, *args, stream=None):,  9  # . # =$ å or sys.stdout+ °if not len(R E  I `arg = ^ 1 Felsej %  > 5[0](  As =  &1:    Ï  t )3  Aadd(Ý )ü +   ,L ¤   B.all:em  ­ à  # calc only ã Zeededi 1fil1 [˜ Œfcn_listù l ptotal_t 0O   Â †  Aprim¤   û max_name_len = : �top_levelÉ;et(.sAZ = {}Ž Àsort_arg_dic­   Qload_= 
ƒ:tryÝö Eget_‰ 7 ‰ �except E :ionA Úõ("Invalid timing data %s" %¸  1 ã. @[-1]Á‡   �` ''),  = ì“  H VraiseDò  3 J if[1 isî
Ã  0 .-
jf UeturnÅ ð elif isinstance]¥´ 6 rwith opuÊ, 'rb') as fy  + 	} €marshal.Í *(fð » >  #±@ = oþ at• 
;  * ë`time.c (; P.st_m P) + "- 0" +/÷   :|Àin case thisS bIunix0  4 Ipass î  z  )F[arg�[phasattrÃ ’, 'createà 'cHarg.  : z i Ô ,  	Œ  
ö O6ot A 
´wð  TypeError("Can Œ  †ùconstruct a %r object from %r"ƒ  ª  "% ’__class__ÇÎr�E  6º º -ð for func, (cc, 	 Ptt, c �G) inð w.items(C  £  V .Q+= nc‰     # _ += c#  F  tt4 F+= t®  �if ("jpro's", 0, " !r"«  …:ers˜ ; � É.k ú ? % !if  0_st&Pring( B)) >	µh # ' =T Àtd_string(fuñnc))

    def add(self, *arg_list):  " tif not     preturn > 1 ôfor item in reversed(? Y  @ qif type B) !=  > ) -  U �= Stats($ t    … ‘.files +=‚  % ¦total_call+  1 Kprim0  / L %ttˆ  	+  (@func( Î ª.top_leveldÜ   .² ; Å "   !ifŠò .max_name_len < ` #  B 2 i   o!cn0z = None" á e, statç    s.ò /s(æ f Û  / c / ²  ƒ @old_, _$ " =ý    s[ ]o 1 OelseK E(0,  M{},)L � m   =I� )s(Ÿ G :\  ŠAdumpÍ s , Ï Ê(ð"""Write the pro# ¡ data to a2 À we know how Ñload back."""m   with open(C  f Ê, 'wb') as f'€marshal.¡ › .g3, fƒ # 7” ðtuple indices and directions �sorting,Š �# along Ž 0somÔ ð intable descrip: ,  9 _Jñdict_default = {  Ô  "Û" ±: (((1,-1),  1), ( ‚ count")�  6 "nF E 'pcumtimeŒ E 3Š ¡umulative 0 � c" "J ,ï1"  J ?4,  (   1linÕ  D 5D  (  numberF  RmodulH Š &¡ ·D 6Š   JÒ 0nfl¦ J H ((à  4 p //Ü Õ  p80ó Biò 1 ‡0stds  œ ˜ 7à �standardà Àtime"      :¹ (((2,-1),  ù), "internal time"),
" Q "tot O   :H (!}
Y ñdef get_sort_arg_defs(self):!  ~ õ """Expand all abbreviations that are unique."""8 pif not N .a 6ict[  _   Å = dict = {}N  + bad_lis  ÿfor word, tup inv   Ü ·ault.items(á  [   pfragmen_  L 	{    dwhile & 
Æ      õ %  ) ]breakc   %ifd  Ê  l  - [r _] = 0X / v  g 	E ?tupG i % =§ Y[:-1]- � Á £ Å 1delê[oA _returÃµPBstat®‡, *fieldÕ‰  
z q4fcnK
.} Ò rif len(c ` == 1 ¢isinstance ‡[0], int†  tõ# Be compatible with old profilerh  . e ü = [ {-1: "stdname"
 ,  ¯0:  "calls$ 1$ 8G 2# Ñcumulative"}[Š V[0]] ›*elJ>= 2^ ú0argùA :1:]"  ¶ ò if type(arg) != 0 +0]@ 0   ñraise TypeError("Can't have mixed arguÁ \ "")/ ; /à" =ù2 ¥tuple = ()£=O  d 7 = ñšconnector   á
7if I ) Ÿ, SortKey	    ! =ìe.valueš è ¶ ¦ Ã !+  p&[0Ø= 2elf©Û 6+= Ñ A õ/ g= ", "€ ªp[w  °func, (cc, 	 Ptt, c pallers)6u D ½	_ ‹.append(O @) + h ) +/ ö 
 (& ±_std_string !),= ) � r  Zð(key=cmp_to_key(TvPComp( ð_tuple).compare)C)

  ÷self.fcn_list =  %[]& ñfor tuple in stats0 :!  N ; �.append(1 U[-1])' preturn u ƒ ðdef reverse_order( )Y !if. £   s  -  .I (p ¬strip_dirsm 1oldÝ " =u  ½ m  d = new %{}# õmax_name_len = 0  A°func, (cc, 	 Ptt, c pallers)[� w.items( î 0newD  ¦Bunc_È Ppath( ö  , aif len A_std- 3ng(C X)) > ­ 
W A  / =M ç  9 BnewcÓ 7 =   22, $  õ 
 sô  6 R [é Ì %p_ù S2)] =P V 5    if¨ 4  h ³ì  [ P @add_: _ç(ã  \  L ,; ù )ÞOelseÇ T 	™ told_top÷•top_level! û ÿ2 tqá pV 
¨ 0new9 D.add� ŽÍ)œˆ í  €z = None½ Aall_i,es  •Dcalc1 '”T 
å R � 	; 
&A)ñ š7 ú0ot Á ‹o 
ª  Æ ` þ¸2… 2† Š 2‹  ( ¹  '   ‹Œ/#* .H á The followingfðtions support actual print" oæ  sA ˆ .*ü@# Opz ðal "amount" is either a line c Ð, or a percenð2tage of lines.

    def eval_print_amount(self, sel, list, msg):
1   @new_ ! = I   Ðif isinstanceE f, str)9  % :try   ñ rex = re.compil= )X  " `except# ^errorC ð msg += "   <Invalid regular expression %r>\n" %Þ 	a  e treturn à ø 	%  Y = [] ±for func in¡ àif rex.search(, ±_std_string )+ “   v r.append, ~ Jelsen cÅ �0en(¨
J¦ ðfloat) and 0.0 <=j < 1.0Z  Ž ^ Bint( */ J+ .5j  . ¼  � Qist[:3 
</el”  $in’ � < ’ 5sel |   € Dif l'1 != 4 �b0LisŒðduced from %r to 0due
  reÙ ctt<u(  } ,{ )¥ È ›N  Ããget_stats_profAfÀ Ð"""This metho éTs an ° SC PB ñ, which contains a mappingv  ” !ofóä Pnamesù P sQ 1FunT {. Each  P ; á holds informa_ prelateda 5thew 3's ñ Å such as howQ Xlong 0 P tookE @run,+ € many ti½ õit was called, etc...L 5""" ½ Z *Qf.fcn`[:] if  ¡ !f.¨v.keys()0aif notÙ J 
æþ g(0, {}"±total_tt = Ð2(f8q  n Á :es = {}Ü Ÿ G9 = t K ,© B † f  '
Í Ðcc, nc, tt, c  qr‡  x [< 
& ×_g •“ne_numberŠ    ù 5uncÊ  £nÎ[ `tr(nc)ž‚nc == cc™#(s p+ '/' +³7(cc- H 0tot% c  , \+tt$ 0pern _, &-1p 0o ›Ltt/nf <cumf cf , f cÖ f Àct/cc))
      ò	func_profile = FunctionP #(
'  }ncalls, °tottime, #  ð  spent in this f  W m alone= 0perW _E ! 0cumV ^ e] …plus all ks thatƒ  j .edÂ … l …  #^_name< ¹line_number7 )  l!s[  O 1] =²  
5 Êreturn stats ñdef get_print_list(self, sel %):F pwidth = Qf.maxÄ E_len" "if 1fcn= <  ø   D ' 5[:]C  ) ò
msg = "   Ordered by: " +^ õsort_type + '\n'< Oelses Ý .‰ Šs.keys()Zz pRandom 5 Ping o‰ Æ was used\n"]0for˜ eð ª;‹ ", f  hS.eval}QamounK ,°13 )s c* p = len(Í %   fif not@ 
Š 0a C`(msg, §=¥ fstream*2if ‚ <‚ 2elfT- È10_    0 ´+"tav
¢  ' 1if ^  + À_std_string( Q)) > ^ 8  <    0 @ ’ 2 (+2#   _hs*¬ï Õ 0ileˆÙ   Bs¢ L (  * e} , E   nd5‘= ' ' * 8Ê  ¦ 5unc¢ Ÿtop_level¦ iG ,T % K ~ù‰Â o í G Î `total_;Ds, "Q   ¯", end=' 'V  À   dJ # !•Bprim] Ð P"(%d # Ritivet @)" %¾ f. < ‡ Ü p"in %.3÷UcondsN ž /ttÊ 	C  àÇ”,ƒ2 †7 ò(‡q!if. 
ý x5 ftitle(É P î
=  " A   à(func)
         ð	print(file=self.stream)
  $ preturn @ 
9 Adef 5 �_callees( ±, *amount):&  _ Ñwidth, list =B R.get_=   (3 2 !if. C  G  _ U.calcq )Š     ! V  “ “_heading(€ " jed..."û ¿for func inw   Z %if! e 4all… 
¤  -   & ‹ Dlineˆ  k ,H [ ]™  J Oelsed %*{}P ‘ LrSË „çBwas ë? byî!Ðcc, nc, tt, c  à$rs¼Rstats¯± ª  øš {rs, "<-ˆÔ ŸK- © ÷
, name_size, column_title¼” õ"Function ".ljust(: 9) +< /, h#1P sub-�òer only if we have new-styleÃ%rsc3sub4 u= False  À´i³.µ‡.values(à  µ$ifm i2 Ó = next(iter(ÁL )d Q « ±isinstance(L ~, tuple5 UbreakÔ  if&ñ 
– ’5 "*„@ + "x nœ ð s  tottime  cum	 "•k 
Å_§Psourc# ¯ di§arrow="->"Lš  È€_std_str~> )8F Ÿ, end=' '¥  Ö   aif not§_‚ x B Àõ   cx ÒQortedÕY g.keys(ÔPinden¸%""=  q ç  1I 
�  ˜! =2	 2 
÷& =× V ?if C
v  Ö  ¶àcc, tt, ct = vkalue
  Íif nc != cc:  , ýsubstats = '%d/%d' % (nc, cc)2 OelseH E B 	p 1s % 1 %s2  ý	.rjust(7+2*len(indent)),�  Â  Àf8(tt), f8(c Nname‘ Ðleft_width = # ™_size + 1n ú ± >Ts(%r)Ë  J 0, v•‚ Qself.j¯[func][3])� 3� Sprint*Á $+ ‘ s, file=v Jreamm Sq = " "
\ Adef X p_title(; )ì ð
('   ncalls  tottime  per Y  cum ¯', end=' '� 	Z  °  5€:lineno(&_tion)= ³  4 ²  , 8 ò):  # hack: shouldÛ « qentagesB  <@cc, ðPtt, c Paller ´3 ‡ = str(n#jÑc = c + '/' +7 Zþ cò/9)3àd� F== 0Ò ü ~ _' '*8y B ‹ ?/nc¿ —¿ ?cc ¿ JOct/c¿ áunc_std_string° mwò
class TupleComp‚‚"""This  ñprovides a genericÈ    for compag   any two tO !s.“ðEach instance recordK rlist of, ñ-indices (from most significantI jto lea ñ), and sort direc• ó(ascending or de )® K e” ¥  y ƒex.  TheÉ eÞ ðs can then be used as " N ±argument to asystem• %()+   wH )a ø `s need9 b Ê Aed iw 7§s order.""ƒ__init__[ †€_select_d +   ù8omp3 l - Care \  Æw, rightW  ü «'x,|4in o Àp_select_lisGt:
  ù l = left[index] �r = righ Šif l < rO  Z ùreturn -directionU 8 >8 7 Q o0


#* 6ð"
# func_name is a triple (file:string, line:int, )  b)

def@  ) up_path(P ) I  6 F B " =7   Þ 0os.D P.base †  	 )> x @get_q  bÅ  z U    7[2]6 @std_² !ng/ 9 ð): # match what old pro¾   Qduced« ió  — ó [:2] == ('~', 0x   ñ# special case for built-inû  ± sP  .  L  ¯     !ifuò.startswith('<') and 3end '>'‚  < �'{%s}' %0 V[1:-1äBelse© 1   5  ” ¡ 
"  Ñ"%s:%d(%s)" %Ò F�= Th<qllowingg 9ð combine statistics cVpairs' @.
# B °bulk of theÌ@cessO Àinvolves cor¦€ly handl ð	"call" lists,
# such as  1ers~ ?es.‘:T1add×_à ós(target, sourceäñ"""Add together allá 3 0twoï Ã±entries."""ÕÐcc, nc, tt, c 0allØ =e %  t_' !t_) _+  t_- !t_û Rrs = œ / B(cc+: n	 = 1t+t@ c	 1ct,0  m  ð S (] ,m)j	& C ü R Ä` in a ÷!le 
7newÏ !{}›  M 8„  ? ê s.items(… ¿ A [4 3] =º K ÉK \ n V 
Ÿâif isinstance(ä d, tupl •  #
âmat used by cPÕœ &   q Ç V `(i + jH P i, j� 5zipz 8 )))\ 
? j   ˜ l	;  ) _ ) +_ $ c 6 Ð= caller
    ñreturn new_callers

def count #s( ò):
    """Sum the  ñ statistics to get total number of) ás received."""K anc = 0 3for& !in	 ³ers.values(y  } Qnc +=  s7 ¿ _c

#* 6ð
# The following functions support print Pof re s‚ :…Cf8(xý é ¿"%8.3f" % xò =SÆÿbrowser added by ESR, April 2001ê ;ò
if __name__ == '__main__'p im^A cmdò2try   �readline! �except I7 VError0 Qpass
& âclass ProfileBð ƒ(cmd.Cmds a  ò__init__(self, p4 W=None*  . @ .2 )p      D Ò.prompt = "% 
      P@s = b = ùstream = sys.stdout% $if£ q is notH  g   k 0do_=(Õ )   ú sgenericù @fn, fõ 0arg­   z.split(ò éprocessed = []«  õ€term in G ¥ 	î —  V À.append(int(L )~ 0  co¯u#   /Vk.   :  ž 0fraÛCfloa– 	ø @ 1if * b> 1 or >< 01 vQ("Fra� 5Ðument must beI�[0, 1]", Ú=æ3 [   j ³ L H e)€ æ	P3if è >ats>qgetattrÇ.]u, fn)(*[ 
Ï NelseF |(Noð`objecti@loadÛxÉö `iQ_help§ d| 1ArgïŸs may be:æ9 ð* An integer maximum numbe÷r of entries to print.", file=self.stream)
  ' ÿ-("* A decimal fractional number between 0 and 1, controllingb e  what]  ® �selected· +õ	regular expression; onlyV �with funÕ o namesµ tµ Âmatch it areY/ed[\°def do_add(|…, line):   ƒ0if  j.stats   >try   5 .` Z 	Y  % ÿexcept OSError as eN `Failed:Pload ” ðistics for %s: %s" % (o O, e)Z?elsr  n (Nob  object is | \ Ö  …return 0÷  pEhelprlx pAdd proñ info from given)  ~current¡ ócallees÷¼ Æ‘generic('  _< '/Þ ! ] â Pø ( Ä ê Hthe à  {Ú m  ® _i9()
Ÿ "do¾ rú (/rsú ] ú /rsú [1EOF“¸
iÛ/("t1W k__ ø `Leave ÚÚbrowserÖ	_ do_quit½ • 8 – B?rea: ‡
h §4@ = SqÉ
 B 8 .rri  + Ù¿err.args[1] 5   U‰    { Eº1ionµ} 	Àt(err.__clasÿs__.__name__ + ':', err, file=self.stream)
   mreturn 8 ùprompt = line + "% "* —elif len(/ i) > 2:'  w C '= ) ][:-2]( ! €do_read(5 
· Nelse] ÿ*print("No statistics object is current -- cannot reload."&% 0§ ‚def help   ­ )� ‹ °Read in proˆñ data from a specified£… S óWithout argument,Æ E theã  m R 	Ã aQverse»,âÊ "if® Sså  Ñ ü . 1.reK _order(±0 �eŸ,“ Þ Ø ORµ >Qsort ¾ 1 of ¸¯ing reportT H s Q |9Uœ É  »ö  ƒabbrevs ‡½@get_¸ ›_arg_defsÁ â ÿ and all((xØK a) for   ¬‹.split()r | ö .n } )(*6 	­ ê
`Valid I ÿ keys (unique prefixes are accepted):è ¢  Ê À(key, value)ç RStats± 0ict$¿ault.items(ë   M É %sug%s" % \ O[1]){' ÷ f| t SÍÀex`accordÍ'to~ :Ø Â  V @(TypB `~ ;' w�ps lists;!id”/.)v
 I�complete€Ò Û, text, *argsß Ñ1 [ataŸP if a 0rts­ (Y 5)]
d � 2do_ˆ ž´u    ¡.generic(': '6 	W !Y È > 0("P´°Ì B Æ§Àtream)
       òself.generic_help()

 ð   def do_strip(* …, line):"  * 0if  j.stats    .I y_dirs()C Nelse:  print("No [ óistics object is loaded.", file=h Fream]  Â  Ö Ä ¾ e Sä ñ leading path information fromg ÿnames in the report‚ à ƒ  ˆ F‚ @how $ ÿ for a given commanæ 	d qpostcmdb o, stop®>topnareturn9 X  À BNoneöif len(sys.argv) > 1O pinitpro“4 = % 1[1]U 
é
, b  r 6tryP ²browser = PV B (= ð ;~ &in 62:]S  d W ƒ.do_add(4 I ¡Welcome toñ' �I ‡ 9strŠ `cmdloog ‡   k uGoodbyeN1 I ö	except KeyboardInterruptÜ ð,pass

# That's all, folks.
"""Pseudo terminal utilities."""7 `Bugs: r ig! òhandling.  Doesn't set slaveG ðos and window size.
#× ñ   Only tested on Linux, FreeBSD,8 PmacOS2 ðSee:  W. Richard Stevens. 1992.  AdvancedPgramm©‰q ðUNIX Environment.  Chapter 19f pAuthor:] ðen Lumholt -- with addiïÑs by Guido.

û1selvmñ ïRect
i $os
 %sy 0ttyP/) ±ed directlyã P mockÉ ‚purposeso 3os ] âclose, waitpid 4tty ðsetraw, tcgetattr s ð

__all__ = ["openpty", "fork ð
spawn"]

STDIN_FILENO = 0 6OUT 1 6ERR �2

CHILD/ 
äa (Þ$""s ò() -> (master_fd,?2_fdo²Open a pty $ /_€pair, us5os.` Â if possible¸ o	5´6 @ñ(AttributeError, OS	 »  O H 	 “ ·  Ó@ = _� _JÐ¹ 0_fdú #% (  8 ñ ž Z 1fd
J  a N	 Rc TmÀreturn the fñd, and the filename of ñ&slave end.
    Deprecated, use openpty() instead."""
+ Atry:	  8 ±master_fd, R •_fd = os.A + ñexcept (AttributeError, OS	 )Q Bpass3 6lse ] Á _ 0tty ( 1fd)4  ’ �os.close  }return ´  J Ü " _¾ ü_terminal()

def  ž ³"""Open ptyZ tJ (m @tty_k )L ¬ òfor x in 'pqrstuvwxyzPQRST'] % y% ÷0123456789abcdef%  ) p` õ = '/dev/pty' + x + y  * 	Ã    º(L ,ÌfO_RDWRc . ÒÁ®     ‰continuex  /£ t£ a TraiseP('out³ ^ƒdevices'�û ª(Zˆ ?""" 5 ->¥— ¸  ^ 2 »qacquire' Ç „rolling ", È 1ingG  ƒ !edb¯descriptorWfresult=Õ ƒ	¾ñfrom fcntl import ioctl, I_PUSH¡ ¬I  q( ¨Ë  ~ . 	_ M ( T ‚, "ptem"° E &  ld3( … 1ñ
Š rSfork(2"""  ÇS(pid,o_þAForkÁ3mak¾ÿhild a session leader with a Ü›o ! ‡ ( Ø Û'ö if pid == CHILD› Z	�    ¦os.setsid(ƒ  ‹ c    #Í¾ û  already set us%Ü  5  ¨  ¬<êLIQ é † ¾   # Establis®4new£ \ ˆ 
‘ )¡  1 1# Sùðbecomes stdin/stdout 0erroc9	g Edup2Sæ, STDIN_FILENO…>os.( ?OUT) =ERR) %if³  >v % 
)ö Àslave_fd)

   ð*# Explicitly open the tty to make it become a controlling$ ".
E à  tmp_fd = os.F ð(os.ttyname(STDOUT_FILENO),# uO_RDWR)? ’os.close(H  ^else:# ¡slave_fd)
 ò# Parent and child processž òreturn pid, master_fd

def _writen(fd, data)n @"""W A all   ña descriptor."""€ Qwhile? >  n	_ ^ /   P =4 C[n:]� vread(fd… €Default  • functionx Ø 0os.  f S1024)N Ucopy(ð û  ,  =_ q, stdin  z R D R loopJeCopiesÆ  Ê 3ptyUô -> standard output   ‚  q Õ 6   ,  in+ 7-> L  : ž )kwfds = [Ö SSTDINZ]š �6fdsŽ‚rfds, _w xF qselect( c[], []P � #ifÖ  Ô0in B P  " 0# SòOSes signal EOF by ˜ !Pan emÖ Ábyte string,¥  B   0# sF Óthrow OSError·    :tryz   A	 ]i  "  dexcept\ J bÍ7 aif not¢À:  # Reachedä )   ò  
 �# Assume6	Œ± has exited©iH =  P# unrr óable, so we clean uŒ- 
$ 2os.|	{å7 + 8if A êl� Ðu
Õ7	é n  fd«1movB Ð ©ñ°ì¯spawn(argvçPCreat×B e9qqif type\ B) == #''* Ö  w 1 = # ,ñ sys.audit('pty.] 0', * d
�‚ = fork(>  if¬ m VCHILD³‘os.execlpl g[0], *T 	)ÿmode = tcgetattr´osetraw `restorG ATrueÏNPtty.e¬:‘# This isö sa)ps termi³  ( =  , T RFalse‹	º _uÎ	Ò³-gfinall"3if d 9 y ðtcsetattr(STDIN_FIñ!LENO, tty.TCSAFLUSH, mode)

    close(master_fd) ñ,return waitpid(pid, 0)[1]
"""Routine to "compile" a .py fil  c p.

Thiss ðule has intimate knowledge of the format 2.py@  s.t Ô

import enum  þlib._bootstrap_external% žmachinery 5uti1 $os  tos.path %sy õtraceback

__all__ = [â, "main", "PyC#RError úcInvalidationMode"]


class 0 `(Excep' !):™5""" ð raised when an eb   occurs wh‹Ñattempting toA ±nBile."ToN   t¬ev R, use"  ,q £ �exc_type,	 `value,c[,msg]eGwherH  *  3 E:   l    U bev 4d iÓ qmessageÀ  ‡  5 ò	name can be accesses as Svariabl@ 'Œ _E 'ì   Î :¤  ¥ ›  ‡ ] ƒ  G # ð  ž    0 beÒËd� A g Š 4msg‰ @ str~ •} Pwritt‡s‡ ´aIf no î ÷ is given, a defaultF  will bÂ? óconsistent with 'standard' py_,� output.— m 4(or‹ )V%3msg?2"""Uðdef __init__(self,é ;
 ,5ƒ, msg=''ö  � í¨! =2   !._ %__Ô %if  _aSyntaxD N   õtbtext = ''.join(Ö.ˆ_œe_only(b  >   ” Ê À )A    ’errmsg = m °.replace('FŸ""<MS>"',  a%s"' %K Jelse½ Y  "Sorry: %s T" % (— —Œ — D.’ ¬  orÃ1msg:  cH ßM  Ì.t Ÿ< 9+ ,'  
#  ! =
  ¡ = § ^ðstr__(self):
      ñ<  return self.msg


class PycInvalidationMode(enum.Enum):
    TIMESTAMP = 1 ñCHECKED_HASH = 2 +UN ÷3


def _get_default_in  _mo f óif os.environ.get('SOURCE_DATE_EPOCH',  – Ò Á  .ˆ › BelseÌ : Të » ð compile(file, c ˆ=None, d ñoraise=False, optimize=-1,  u   ü L squiet=0Ý ƒ"""Byte-| ð one Python source { 4 to ¡bytecode.
n a:param% Y: The6 Xname.' Ô ( ptarget O  } dG  6 ñ  When not given, thisL  Ý ás™ Ðthe PEP 3147/	 q488 locd	 G§: Purportep p, i.e. K ð  „ õ that shows up in~ òerror messages.  Dp� ; K 
† Á°: Flag indi« Ñng whether orø €an excep+ ‡ euld be… d5 4n aC › éis found.  If I ªoccurs andRf� Ps setU^ya strin§  %‘nature of3§ � ówill be printed,p ae funcÑ " W!toG rcaller.³ K ]  »  ³ ²True, a PyCIE§H  { 2be B	œN¤ I¢ level for¬ c Pr.  VÑf value¡Áare -1, 0, 1ý R2.  A&  7q-1 mean21useT o · w i€current U²rpreter, as#` by -O
mÞAline9onsä ­Ê2: RÃñfull output with  ¢"0,lbs only ‚ ‚ )no; 23ö`: Pathl Q`resultj8 0Not(ð at it isn't nec… ryG  9 ÈÄ`modulerRQexecu€Ôefficiency --Ý it´•J Bs a F kF € T loadÛ if• °can, writesú Õ –  0 ¢ "th¿ correspondñ A.pycúè PHowevÙ!ifÎ�rinstall‹€is shareÀtween users,„ Ais a¥ �good ideaz  † Ò C allÓ  Ù8on ] b, sinc¨ o�\ A may–pbe ableU ê ð in the source dirð#ectories,
    and thus they won't be able to write ³ .pyc file,4 !enA 8 0uld8 ñ$byte-compiling every module each time it is loaded.F ñ#This can slow down program start-up considerably.
7 BSee n òeall.py for a script/my €that useå $is� !toC ² ñ e all installedî 0s (R #ll ±in selected? 4dirQ)• QDo no6ðat FileExistsErrorø °raised if cPà ends up point6Aat a] ±non-regular ò or symlink. Becaus�Rationé a0 ‚renamingì‘the resulf | #wo¹g 1notøÂsame type ofU !as� ð it was previous” Q2""" ‘f invalid— P_modeþ QNone:"  . # ý = _get_default_! !()= >;is S ö f optimize >= 0m  q  ” & =* i6 ‘1 else ''m  9   °ð= importlib.util.cache_from_source(\t 7  ¡ = ø  L  › 
Ö ™ I  ñ �s.path.isR(E )Y  msg = ('{}¸azÿ@willðPchangÍdnto a F   á
?B   ';XHs a r w2it'¦  ï 0I³(msg.format¹ 1 'elÙ ey  ¸  Öo÷  §  ÷ … # ø 0oneÿ MT(r £±machinery.S� ’L{rr('<py_<Ae>',ßGÈ_ž2s =«!r.™1ataà) 6try;cä. D 0to_ ( S 0, d| Ð  +_ee„ �except E  fas err˜ Ápy_exc = PyCœe�ð (err.__class__,4 ™ `  …Æif quiet < 2Y  !do¤
      	JÃ / psys.std— y(: .ŠX+ '\nCeturƒ„@dirn³$= èð dirname(cfile)
  Ãif dirname:
  Ãos.makedirs(! )! öexcept FileExistsError= Apass) ÷if invalidation_mode == PycI æMode.TIMESTAMPH òsource_stats = loader.path R(file“  ± Qbytecb ð importlib._bootstrap_external._& ñ_to_timestamp_pyc(³  I    # (, ‚ 0['m0 ,'] bsize']ˆ 7elsF? ghash =• Wutil. (  Â sI  „    ˆ 	< Ñ 
 j Ì 	Þ p  / , (°ÖCHECKED_HASH)E ¾ éò ¶ 1alcÉºàwrite_atomic(c $, ' , w � qreturn " Ò


def main()^f ¡ argparse
pdescripªð# = 'A simple command-line interface for py_compile| Qule.'K V 5r =b  .ArgumentPp 'r(l = ½ > c.add_a7 �ö '-q', '--quiet'z acº Ç='store_true ðhelp='Suppress e±d outpuC {  p (sZ ‡nargs='+ m  @s to@ "! h  5 3 = ê   ì "s(  if:%s.q  6R['-']À  $ [ Ñ.rstrip('\n')£ ð in sys.stdin.readÐAs()]²
¹5  w « ‰ -  û#  X  sž 6try  ¯ (ë D×, doraise=TruÆ]2PyCY\# a´
T '
  s W‚r.exit(1Y    
ï     	1 ,&F.msg< ž /OS— hAstr(Á ))


if __Q __%0"__é2__"  a()
"""z“ a Python°R and �ábe its classes 1funUBs.

? –enough ofI  ý ç“recognize÷C O  M 
M p defini­ s,  = @find�¡ the super9 "esk  X.

Th‚@cons$ tsingle g ÿ  èð	module_ex(module, path=Nóone)
where module is the name of a Python  , and path) ðan optional
list1 Âdirectories Y  O m] ôo be searched.  If present,
Y Áprepended to� csystem7 € @sys.0 ñ.  The return value
is a dicœ #ry# @keys£  ‘  A ared  ó   �
classesï 1funJ Ás defined in2 Ö ´(including 7 @thatY 
2 1via3 ófrom XXX import YYY construct)© Å s@ �instance™ ^ C� › F› ñ.  One special key/E “ pair is
cá for packages:’ pkey '__K`__' ha<Îbas itsSâ which
contain$H –1.

� :Ÿ ñs have a common superÎ ô: _Object.  Every ò 
Š  «`follow^ó attributes:
   ”E  --° 1 —;#  Õ + # ot # Cfile#  "iní )  íÊ4 alinenoz   @ ö= '8iŽr startsF @end_?  noÃ  
 I 3endG aparent�  ‚of this � ‚, if anyu €childrens cnested' s‰ ÞáA  .
b': %' ‰ jP mapp« xs¾ƒ Xs.

IË¦ describe fAwith}g !s 8+R,
pluƒ€is_asyncÜ  ô U  ¨ Á _ Aan '+ '~;fix  Cc� ¬ Ò› &ó ¥]"of3(s ÿsµ’possible)»pmethodsÞ h2of  r`beginn…R numbers.
IÚ“ Û   ñ not recognized,‚�corresponÞA
ent¡ Æ 0is H a× Í  but a
str˜ 0giv  ¬ (”� „.  Since'°statements
¯§ L#ed:P scan¬pas wellÐ òis
shouldn't happen often.
"""

H D ast 4sys  òlib.util

__all__ = ["readv7",  0_ex Ú 	 öR"]

_1 ñ
s = {}  # Initialize cach$ @we'v6 « 
�9ú�"InformadTabout¹à%orÀ."
    def _ð_init__(self, module, name, fi Älineno, end_ £parent):
   ? .> # =G 
  S ! =Z 
  f ! =m 
 m 2 = 	 
 Ž ' =› 
% § 2 = 	 
 Õchildren = {} #if- Æ is not Noneè  ï M .@ [Ú @] = ð6


# Odd Function and Class signatures are for back-compatibility.
cl- @ t(_Objecl‚"Informa[ ó bout a Python fs ñ, including methods."á _def _ò3  ñ  ú =ø, is_async=False, *#$  uuper().~ ,jŒ  e.{ % =† ! âif isinstance(² ,‚�  Ó  .#Çn"

‰¼†6 ps_jË  ¥  ª ThZŸ  Ú§ e or []ž Š=D üuThese 2�ì‘used in t Àtests
# Lib/  �_pyclbr, €idlelib/ _# ±browser.py
ËTnest_÷A(ob,w _‘,6•´—"Return aµPfter _  E“within ob×r0 £#obû	€ 0ob.Û‰ 9Ó Ú » Õ=	 » =ð')
ý nú 
 û ÌC÷ ã/ aô + (ñ w c ,(ù ö Ø 
ã ä Bread)( i, pathÆ "¿› ! o.s^áthe top-level ª  es‡M !.
“@Thisí . õoriginal interface, beforeÑs were added.A 2"""J  ÚM ß key, valuev _Ï Xƒ).items(ž  
ËH Êpres[key…& — ¦2res1~ À_ex(module, ñ$path=None):
    """Return a dictionary with all fun ñ
s and classes in module.
F £Search for  " °PATH + sys.v .* óIf possible, include imported supere 0 ñDo this by reading source,¤ 3out>   (¤ Òexecuting) itE 1"""} rê _J À (  , ¢ ï or [])


def &  · {packageI¬ ±e hard workl S[_ex]1SIf inF ð is given, it must be the dotqname of 4 nÒ áwhich we are s† 	 ‰Ta subß  Qthen •d F U A  ; otherwisj` ‘top-levelE k N±is combined¬
•‚# Computó DfullDø q(prepenú3bf set)ßiM@not ãâ æ V   å = "%s.%s" % (Q ,t )Ë Oelse= F öp# Checkì ®Ucache’ s Bin _8 sV Œ [0 ]^ ’Initializ ŸS8 'dbntentsz ”tree = {}E £ f\µis a built-Â;>³don't do muÇFthesÍ m  é  ÎB #inÔ _§O Ó
‚- "s[K @] = « o ¢  ]Ë
=  r ï 3i =º¢.rfind('.'Ä V >= 0sç3 A[:i]l  � -R V[i+1:! ‰parent =S @„  X  ˆ ê� & H ž  	W  J 0'__l0__'�£ ñ  Z qraise Ib£Error('No P JÓd {}'.format( )j š, ø  [ˆ ] )ƒ $ ­ Äe¹ƒ1f =´ 4ªü ! =±9 
¹% �0 cspec =B lib.util._J_ Q_fromf ( ,i (0if / ÷~M,‚NotFound†Cf"no†c Q!r}", = k I 	MD# IsX aèÀge?
    if sópec.submodule_search_locations is not None:
  ÿtree['__path__'] = sH ; 6tryD dsource: ²loader.get_ R(full• )= ñexcept (AttributeError, Import )^ R# If ? Ã rPython _ €, we canÜ Ádo anything.k  æ preturn ê  7els#ifH  ] 
= > Ofnamì @file î  €_create_‡ $  , z!, W ,‹ ,­ ñ, inpackage)


class _MÞóBrowser(ast.NodeVisitor7ódef __init__(self,An >ilee t 4 .™ ! =  ú    Ã ! =¤ 
  0 =  
 ¿=‡ 
 æ & =ò 
# ±stack = []
  á vó  _C3Defç Cnode ¯ Rbases8     @for  @ in . . sû  $  È0 = ]€unparse(& ¾ !   1if ( 5in 
G  & ñ# We know this super Ë¡ (    d �s.appendÐ .j[f ]| �elif len( As :=‹ ÿ.split(".")) > 1Ž S� P formöž.– 4 @look/(  7 Â &*_jO "_ › s· å  iÕ2n _[ ‡+ 	+ [3 ]i(l ,)+îS  E)Y   `parentÏAelf.{P[-1] *  FLÚ … 1 = ”Á¥ ,j h ,}"s,4 * ulineno,N  Š  • = b, end_2 =Å þ 2if /  äÚµ[B  �  þÆ ‡ & ™! g " �generic_•(Q ! C Cpop(jÃ@Func¢
Æø, *, is_async=FalsÙÙ =G] ¤fl 4 = w ©Ù ¢­˜ ¹ ªIÌ Àion
        óself.stack.append(function)
  $ ûgeneric_visit(node! E apop()
; Adef . s_AsyncFX @Def(R !, E :,  j   .1 ,  & `, is_aF ]=Truea oImportW !ifi ö.col_offset != 0x  | breturn¸   Òfor module in@ Znames6 :try  ;    a_readmU ( .T !, ù Cpath ‡inpackagb @   rexcept ð ^Error�  ( l &[]· ) Q (R �, Syntax_ )` ñ# If we can't find or parse the i�#edA,á p   ð # too bad -- doF �die here.- ‚continueœT± OFrom÷/ •   »§‚ = "." *Ylevel§ b. 1 2 +=A  	B  > = ¸Æî ‹ì	 å 1ame³ ( ³ í ÍPtree[R 0.as  !  > 3] =#   ])eln n== "*"k  ¥m_D ,zQ_valu¸¤ .items(Ê  ô$if7  D  ¿rtswith("_"4  8 ˜      ø  ¢ 0


Ï€_create_4R(full¶ ", óf—  , source, & &, "€mbrowserBMbB Q I �H ‡Q(ast.Ø( )<? -  K Í Dmainkc"Printìð output (default this file) ÉPquick0±ual check."” 31 os 	£òmod = sys.argv[1F ™&  __l !__F `if os.ap.exists‘í  D = [% 0dir‡& e Y $ Ebase% f  $  if Ã.lower().end]<.py_© rmod[:-3g FelseÊ —   w6 = V0_ex¢ :«ðlineno_key = lambda a: getattr(a,ò$ 'lineno', 0)
    objs = sorted(tree.values(), key=1 ò_key, reverse=True? ñindent_level = 2T QwhileZ : h ! = R.pop(>   ö	if isinstance(obj, list);  & 0# V– à is a __path__  .b  ' …continue âif not hasattr_ 'µ 'c Bobj. X = 0
C ¡ l_Objec¤ Jnew_O S †childrenWZ  ²  u4 ¤for ob in { 
5 ( &obÕ  � â "+ 	 º	’  Ã „.extend(X ¯
[ClassM print("{}c 2 {} "j    ð   .format(' ' *"± , Bname
 Rsuper ”)– /elG �Function› 3def– ƒ x `
if __œ ò__ == "__main__"‚ ñ()
#!/usr/bin/env python3
"""Generate P   documenta²  ÓÐHTML or text êõinteractive use.

At thB   ôprompt, calling help(thing) on av oÈ
} sP  Z, andA ÷ ) starts up an q 
a ò session.

Or, až  shell commP  B³ outside ofˆ ð :

Run "pydoc <X«>" to showqon someÍ #. - € may be
 >  [ 3a fð, module, packagQðr a dotted referencer "a
²%or? 0 win # aG  –Q  ¨aU P.  IfAA
argÌ �0ain´ ²@ segäð delimiter (e.g. slash™¥Unix,
back °Windows) itþ@treaµ a¬W &toÒ source fil"V³-k <keyword\Qearch[aJ   Ñ  D�synopsis °ós
of all available	)s.¸€-n <host�c  / +±HTTP serverN 't given
2 ð (default: local ­ �  | machinØ p <portr &onp  ,  kJthe
W ñ  Port number 0 can bld0getË ñarbitrary unusedQ 	b½þ  ~?n aE  q@
ope °web browser| k#ly 
¡.  Combinea
ð-n and -p options ð(to control the hostname and port used.

Run "pydoc -w <$ ñ >" to write out@ ðHTML documentation for a module
to a file B 2d "J ¡.html".

M'  B s9 Ccore< Ðs are assumedz ðDbe in

    https://docs.python.org/X.Y/library/

This can be overridden by setting ðPYTHONDOCS environÌ t variabÃ ðdifferent URL or� ña local directoryZ4ainZ LŠ 1
Re< ðce Manual pages.
"""
__all__ = ['help'] Quthor P"Ka-PQ ÐYee <ping@lfwí >= Bdate( ò26 February 2001"

__credits" à""Guido van RoX,t�an excellß €programms ñ
language.
Tommy Burnette,ûóoriginal creator of manpy.
Paul Prescodd 0ll Žàwork on onlineñ ò.
Richard Chamberlain5  ž°first imple—c¢of textdocEð
# Known bugs that÷ 'tùðfixed here:
#   - synopsis()& !no' ðprevented from clobber�existing> „  loaded¤. A- If __ì __ attribu*nð is a relative pathxC  @ 1cureS Âðhanged with os.chdir(), an incorE T @willû qdisplayÐ!imÞ“builtins
  ïlib._bootstrap 	ž_external% žmachinery 6uti1 enspect% o
 o• 8pkg2 „platform) $re
 %sy4 ”sysconfig 5tim( utokeniz 0urló Epars 0war¹"s
 PollecÐs} Rdeque treprlib BRepr ”traceback  ¸ 0at_`pN ¿_only


# - %ñ common routines

defMqdirs():"ñ """Convert sys.!in�@list­`absoluÏãr, uniqu› s.  n X  ¡]Z Jnorm  òedir inl … =   =· ƒ @.abs (/ qor '.')U  * Y .   @case/ ( 0if   C  ½$in sNk  is'3dir c    ¼ z.appendX   Y s!  } `returnðuó _findclass(funci Qcls =
mÞQs.get! 2.__ "__R 0if . vis None5j    b A c j p.__qual �__.split(LV[:-1]G  \ ð = getattr(cls, ñname)
    if not inspect.isclass(cls):!  % ±return None  ócls

def _finddoc(obj7 'ifT gmethod  U  „ ð = obj.__func__.__ !__f  % Eself%    Lif (¸  # U) andB  F „getattr(  &  , k ,Õ D), '„ Y') is– Ò  I   !# #Ô 	g `cls = ]  FelseH ? % 1.__J Ó )el4 Otion6	 Â > [ �Y ; ‹ 0if | !isó D or 2clsû  :obj¶ ò­ obuilti¬  &Ù/ F r.__qual� + '.' +Ý$ =_! ÍTð# Should be teste
 ñ	fore isdatadescriptor().£R�sinstance¼§, property¶  9Afget<  ý  0 =  G ù=§ '  < I(ð  $ ~» ! ~Ø '  ñ 1objÛ  /ifã)§ kmemberÊ ©  0 @slot	Z1'__ 3__'oµ 4  ö÷* a, dictÈÉ1in  
n  > ™ []] 
x% ¾°for base in†.__mro__^ 6try  g Ðdoc = _getownêâ  G =Púexcept AttributeErrorQ rcontinuP b 0if e !is� « 
1 Ä 1docá   ( „œ A """Get the] `umentaU€ string 	 anî0ect itþ"noX`inheri½‚from itsüA."""† 	( ¿ q I_, u"__Ð–'__doc__',ø  Ì ô   o (3obj¦ Z type4   Š  
  w !).v À__
         ó   if isinstance(typedoc, str) and  « == doc:
  µreturn None  1doc öexcept AttributeErrorJ . B ò
def _getdoc(object)*  """Get theˆ  umentationª ²ing for an 4 !.
y ðAll tabs are expanded to spaces.  To clean upW Àstrings that5 F bindent9 @line, ñwith blocks of code, any white_  E rn can bñuniformly removed fromÒ qsecond ^ ¤onwards is( A."""Š Qdoc =7own"  ifÂ  7  J5 ¬6try   F LfindD   ®(¯R, Typº‘ ,   ¿  hif notUQˆ 5  �inspect.” � Qdoc)

`or com!sHcresultK g 6T) or ƒ 4getF ‰gª C  "òre.sub('^ *\n', '',   .rQ1p()Z "''Ê Asplià Ý @"""S ! aÄ 6 òng into a synopsis0(ifi� hek t" B!s «.F Ap().p a('\n')Â qif len(+ )Ø1…  ½rÎ 0[0]Í 4 *el6 A>= 2 ë. %1]ï P 	s\n'.joi€ B[2:]– z  = « $ “classname�P, mod �!!a )   ¢ ±qualify it ¶a8 2ule"  ®…ecessaryF< =L __ !__	&if °module__ !=T  & ú    D - q+ '.' + S ú  1 !cisdataç Þ PCheck°ç íAof a¥ pðt probably means it's N Ü n Dot (ì"isž s !isP µ  - G droutin¢ö &fr½  H —tracebackw š iso PreplaÁ¶ext, *pairs;DHAerie¯sglobal 4 * onk ,awhile L Ù0tex; 2[1]©  i 20])Ø % " =J  óû Š ; øPcram( †, maxlenÁ �Omit partnaê½eÔ@makeåPfit iÍ pmaximumí5gthÕ Àif len(text)Ã > maxlen:
  Ppre = R(0, ( v-3)//2)$ 6ost% $ F-pre$ òreturn text[:pre] + '...' + @len( �)-post:]^ 6 ð)

_re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(>+)$',) óIGNORECASE)
def F p ì ð6"""Remove the hexadecimal id from a Python object representation."""
4ô# The behaviour of %p is implem0 À-dependent i0rms+ Xcase.û õ ±.sub(r'\1',3!)
Í õ_is_bound_method(fn)Ô K R|Às True if fn� !a 6  6  (qgardles‰ qwhether@ Wfn waÁ  ed´ r Cµ Òif inspect.isa —  &Ù ’ c 	1 zbuiltin2 ðself = getattr(fn, '__ Ž__', NonnWnot (‰ `odule(4 Q) or 
  = ¬™ bFalse
a2allÃ Cs(cl[ Q = {}Á Àfor key, valfn�getmember? , “isroutineR  V •[key] = 1Z @basegPcl.__ 2s__ä7 ‡.update(°  +  )) # all y�  0 ar¢¥long to ush 0keyg ˆ o.keys(  Œ0cl,ü 	AC Bô_split_list(s, predicatû @"""S! ö  sequence s via( c, and ›ðpair ([true], [fªA]).
Å  |( ‰°s a 2-tuplea „ !s,,  ;@([x »x÷ s� F(x)])  )  ]	-   _ ryes = [É&no p Ã&ifî '(xs ¥ `yes.ap/"(xe   FelseA   +no' 
ryes, noŒÀvisiblename( ,=,Ú
 € £"""Decide  .•show docuËð  on a variable. Ž  # Certain 	@ial o s}�redundant‡‚internalCc# XXX Œñ__initializing__?Z!ifK  ³¡{'__author3'__=s ecached  {t K  ©  0'__@+ 4doc Dfile  Í   ? UloadeŠ mo ,  ª ý  apackagS G Dpath+ Hqual; 2slo¿  T ¶version__'}
õ0Z ‘# Private2}ðhidden, but special names ò are displayed.
    if name.startswith('__') and 7end ¡: return 1? ñ# Namedtuples have public fieldsG €methods ^ ñ a single leading underscoreR ‘ � ò hasattr(obj, '_c 1'):9  Î œ 5TruM ö all is not None, ü.# only document that which the programmer exported in __all__r  D  1all 7elsk —  „  ) 
mñ')

def classify_	 _é sê 3ectâ ñ"""Wrap inspect.) 2 ,fñfixup for data descriptors."""£ Áresults = []  . (  ð, kind, cls, value)Ü w 	
©  ‹%if¨  is… „ (T ‹ 0  s @ = '+ ° '›  !    U ’sinstanceG ,ªRperty´\ P.fset÷
ó C   l Aread1proC n �.append()Ÿ à4 ÏAsortÅqibutes(ÐV, objÑ@'Sory!e  ó list in-place by ãFðthen alphabetically#  ±· Ý# This allowsøð to be ordered accor€Á # ao 1ttr·  rpresent/s` = get´ øŽB, []6tryã9 _~ @ = {¶ ‘ : i-len( !s)¯1(i,wr”enumerate# }® ÿexcept TypeErrorf / ñkeyfunc = lambdam": T “ A.get¢�[0], 0),$ #[0Ê  ê  s.ÒS(key=Q o)

# - !ò module manipulation6æispackage(pathøðGuess whether a  r refers»7 ¥ directoryè`if os.1 h.isdirZ   ÷ exx� ('.py',  cX ( 	H Tfile(W AjoinV  ó _init__' + ext)Ã  A  .¥ RFalseðsource_synopsis(n I pline =  .¿  (p0whiWñine[:1] == '#' orü ( s.strip(J  �   N    Œ0ot & q: break€   N in8S  !if+ 2[:4~ ar"""': / 2[1:l+ 3+ * E  x a #[32   6 2-1:7 +\\` 2:-1a  / À not line.st‡rip():
  ðline = file.read )()# pif not  u: break �result = ñ.split('"""')[0].stq . eelse: 0 ANone creturn ð 

def synopsis(• ãname, cache={}½ ð """Get the one-š ò	 summary out of a moduleÚ 1"""n @mtimï uos.statb Q).st_ ' ³lastupdate,š " =„ 6.ge6 0, (È  ,  )56if > 1 is 8 or !< k ‰à# Look for binÆ ñsuffixes first, falling back to source.®  Î!ifé  .ó'.endswith(tuple(importlib.machinery.BYTECODE_SUFFIXES)Z L   ßloader_cls = B S� ‘lessFileL/ Ž /el� ŸEXTENSION‘ 'ŸExtension� &senà  ¿¼ Á# Now handlebKchoikâ
^ ³# Must be aªž¯ ƒ :try6    óö = tokenize.open¦¥  + îexcept OSErrorK #Acan'�  M éed, so skip itQ  U �	  c# textR Ps canÞ ùdirectly examinedP  „ø œ È_óI v 5	T Z+mè°, which has #be¶*edv» ²³ âÁ('__temp__',°  F…  ‰ ð# XXX We probably doU@needo qpass in0b 7her  E IspecNPutil. `_from_üŸ_location• , T  — = 
Þ ŠW	° À_bootstrap._H (¼ 
K •ñçX‚del sys.n &s[‹]ì 1) ‘.__doc__.s   s(s3 if¤"  D…P 0# CO­X #i[Š Q] = (¬î &= @

clÿ‡qDuringIs!(E¢3ion]1"""% ð s that occurredº l ryâ#toºs someth Ädocument it.Î -Ö__init__(self¿ð, exc_info):
        sô elf.filename =  #
  s! Qexc, 
 Svalue átb = exc_info
2 Àdef __str__(0 !):  L Rexc =E `exc.__r %__  ñreturn 'problem in %s - %s: %s' % R ­ ,{ Š – 0)

 `importÈ S(path‚ A"""I ñ a Python sourceò Â or compiled  given its E A."""© @magiÇ e ñlib.util.MAGIC_NUMBER( ‘with open„ ¡, 'rb') as]  is_bytecod|] …¡.read(len( !))X  ×  8a = os.› 1bas½j &  "  t' ”splitext(C + 7if … š –loader = ê ñ_bootstrap_external.SD‘lessFileL5 (  � d OelseZ $V �# XXX We 1ðably don't need to passECthe Î Qhere.H?speÇ   `_from_%—_locationÑ ,K =R à 6tryß Ç7 ._6 (f 9 gexcept< òaise ErrorDuring³Úd, sys.n#()îBsafel & Pforceh Ï=0, cache={} ðmodule; handle eu 3s; ¿ €None if =* 0 is^bfound.íI  Q*is*  p but an  epAð occurs, it's wrappedœ!anŽò ; pand rerÒd.  Unlike __õ 0__,§ aG qpackage²@ is ihified,È !at Rend oÁ  ª 0 ü 1ed,N "no) V 8 Ãbeginning.  oå Eal '}¡' argumentL ¡is 1, we r›� W o� disk (unI% a dynamic lension)†	q#‡ fö È  1 5»òhas been previouslyÈ d  £  £#‰ © °always haveM¸ ±.  CheckingÎ  1''sJ Smtime5ñgood enough (e.g.3 øcould contain a clasI  that inherŽ ° “ another B "  ä ‚changed)ä Ò 6if  ìnM? s€2 $  ÿi( ‚builtin_0 ¸5  9 `# Remo/$heš ®  ¸; s™2re-½ Y5try5 F   #' QavoidÝQlems Rvpartial¿X ñ  @   ‚# Also r“ sany sub. Ð because theyû  won't appear
  ð# in the newly loaded module's namespace if' Ïy're alreadyL Bsys.? -s." ð subs = [m for m| 0  d ý
m.startswith(path + '.')]L  B 0keyD [) @] + ` :*  ó þ# Prevent garbage collection¨  2 ×cache[key] = ¦  d ?del) Ñ = __import__à )K fexcept» P# Didqñ error occur before or after  X ¡was found?P  Á ó(exc, value, tb) = infoÎ @exc_ (�  1 0if I Rð •  $ H# An” ñred while executing— ä K
cpraise EÚ qDuringI(v Ó¡.__file__,» « ñelif exc is SyntaxN ¬  E ± Hw3uld» e¹ P° \.¢  (¤ ¢issubclass�ê ­ R) and .@ 1 ==€Å sNo such• ž ° ª¦ ¥eturn NoneLelseP ¬Some otherÉd�À ÎkprocesÍÂ – ,`¶ ¯@partÀ  & p.split(ÜF[1:]¥ Dtry:ì ¢= getattr(— , C Q  Ž7¡ AttributeX;: r
 D _

# -   ³0matxQbase Õ!

 a Doc:
vöPYTHONDOCS = os.environ.get(" !",.  Å  ÿ"https://docs.python.org/%d.%d/library"H %�qversionôR[:2])¯ ñdef document(self, object,ü=N†, *args)¤µ"""Generate> aK %3 anD 6.""Ÿ  C H = (_ @) +  Ä p# 'try']0useÞ0to uÂmpt to handl©ð possibility thaYWspectL ðidentifies somethÐsin a wa5 €pydoc itû P has ±"esi Ging;O  @ ‘k 'super'½`how it§ ña descriptor (which %sO©7ionO pby lack” @a __ __í Ì¶an instanceî #I  ? if&  þ ð.ismodule(object):÷ return self.docmodule(*args)
  üif inspect.isclass(object):E  D routineF   H ùexcept AttributeError:« Epass 	¸ ïdatadescriptor{  ' )Tother$ m �def fail(L", Ò, name=None, Ê ¬ Â"""Raise an × ñion for unimplemented types."""h  ”ðmessage = "don't know how to docu: ƒ Q%s ofD … %s" % (G  K    ð and ' ' + repr( !),4 $0.__ &__r¼ 2Typ„(• !)
` M  =’  Ù H ‚property  „! =RQ Ëef getdocloceúbasedir=sysconfig.get_path('stdlib'))yø�the locatz2of   ± Ps or ¸ xÒ  .6tryG   0fil‡`getabs 9; â 0H Â'(built-in)'÷  e ô Ð = os.environá â("PYTHONDOCS",Ä ˆ @ A  £.normcase( ÖÔif (isinstancž0s)),Ô  ] é !ò  in ('errno', '÷ @ions  gc Yimp',E  I  €'marshal3 Pposix	 Bsign ?sysF p_thread= êzipimport') or‚ (¶µ.startswithò l  not / 1os.[Djoin< ÿ, 'site-packages'))B +A ^ E�xml.etree¼ étest.pydoc_modÐ : if¶8locÃ Á("http://",  s  ;   cò"{}/{}.html".format( Ä.rstrip("/")àµ †.lower()I V Jelseè  O Ž3 Y B + "– c _ E ! =ºà¼ _

# - P HTML\U*²generator

Ù $ R;  j@"""C(ÒÐsafely makingñ 2 nResentW ³of a Python½ö ^�__init__ýe  P t . û  �¡.maxlist =$À.maxtuple = C20
  þself.maxdict = 1 ”string = + Qother, !0
H °def escape($ �, text):  g ð return replace( P, '&' @amp;	 < 1&lt > Vgt;')b Crepr` _objecb  ^Repr.( 
D 1E ‡x, level© ÷if hasattr(type(x), '__name__')  Ö `method @ = 'v Ô_' + '_'.joinB .@ •.split()) F s <W p  . J1get¥ 2 (Õ e 3  + .¥Pcram(×@pid(¹ Z(x)),à)z_0 /ng<0tesA\ xM 7 ô  '  s   = r(  °if '\\' in  B and 0not C stF 0, r0 <, 'žð# Backslashes are only literalL Bthe ž g  # Unever: qó'# needed to make any special characters, so show a rawX .K ‰ 'r& Þ  Á R[0] +z�  1) + " G C ñre.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x ¥u....)+)',H  Ú  ðr'<font color="#c040c0">\1</ >: U ¸  ° 9   5é  :ing‹„_instanc8¾<6try  ´ { t ËÐ  'ngxoexceptW T'<%s ¢ õ>' % x.__class__×(ï |unicodeó 3 Ã HTMLDoc(DocÚÒ"""Formatter % 1for) ò documentation.""":?# - J fc  Ä’utilitiesM _µ â ! =0  D(’  : = ' `J±!  c  4pagáó title, contents ×1 anˆ  7 ù     úò'''\
<!DOCTYPE html PUBLIC "-//W3C//DTDE  4.0 TransiH al//EN">
<6 �><head><• Ò>Python: %s</ ò
<meta http-equiv="C¹ d-Type"Ç  ="Ò/S ;�set=utf-8j /e tbody bgdPf0f0f  P%s
</ !><B 0>''j(ƒ *O P iŠ( fZ ,a ™, extras=À"""Format a ópage heading."""
  ñreturn '''
<table width="100%%" cellspacing=0 0padF ó=2 border=0 summary="b ñ">
<tr bgcolor="%s öd valign=bottom>&nbsp;<br>
<font / P faceP ÷ lvetica, arial"4 @%s</6 ²></td
><td ^ iright k /
>a 	W  \ r  >5q''' % (Ü 0, fã u, title ²extras or 'ã 1')
< üdef section(self9 U “contents,Œ!6,> ² õprelude='', marginalia=None, gap=z :< ´"""Format a†  with a'ifZ @ is ] N  ‡ z µ = '<tt>' +õ " *À    </ ‹ `result5 @''<p. a/ {$Xi{ coÈ:n=3Q…$ Û )   43if ½
L	 +”Ì  ç rowspan=2>‰  td@d=
 @</tr r+ 
£ Á,– ?¯ Oelse©  g 
ôŸ ?<td 3gap& &— \nú 	œT è !</¾>�@u3big 
xf*args)à #?big'û ÊÁ<big><strong›   </  ˜ + 	ã  .� " ", — ¿ Aprefº¾ ?ext¶ pliteralÌ1 ‰ted textô  1 = z pescape( Ö.expandtabs()¨ breplac* �, '\n\n'  	   ç  Î  ' < F    
(\n-¤multicolum1blist, Ý ,ô/=4 a + ñ of items into a R -S " 	pE= ''Á  n€ = (len(S  )+KP-1)//	 ( 0for�   in range( ›  ` 	 +6dø %dr¹1topÍB(100j “ K  o im  ¦ d*col, 
 Ð+rows):
       öif i < len(list):
 
 “result = 	 �+ format4 ù [i]) + '<br>\n'A 0 9 f'</td>& ðreturn '<table width="100%%" summary="œ ñ "><tr>%s</tr></0 C>' %• 
y õdef grey(self, text): e ð font color="#90 "S   M  2 K ƒnamelinkO   ‡, *dicts+ """Make a ,  ð an identifier, given ? ñ-to-URL mappings."""º  n@for ] 1 in s�!ifC  
  @ è ¢a href="%sß aÜ (\ [† !],J )z :   þ PclassÓ ÿ °object, mod)  ? 	à  6 ? bule = P 0.__ õ__, sys.modules.get(!  &__± ²if hasattr( Ò � and get  #isr 
9û &'<5k.html#=, j  x ¿  Ç ,÷   ¿ ñ   )¾ t "  + …f †}7 	~u é 	#s —  ” )š 7pkgš ¯modpkginfož ð or package to displayß ?IndexÀ  ’ £, path, is9 À, shadowed =™� ­%if! ÷ (.2 _ ¢!ifj 
4 Áurl = '%s.%s$ (’ 
? Oelse<  ] 9  2 ¨ Ô 
9  ’ v q<strong¯ s&nbsp;()U † M 	{  	3urlJü8fil#  ù to source < 	Ù�  " :c † cmarkupž Û ó, escape=None, funcs={}•e `method ® ñrk up some plain@¾Pa cone ° of symbols·@lookô.ÌEEach-  t`ionaryôƒ? banchor 	Ê # =Ó  -­ m rœes = [] 0hera0 Ðpattern = re.ðcompile(r'\b((http| ÿs|ftp)://\S+[\w/]|'
  ÿ r'RFC[- ]?(\d+)2 ?PEP2 õ(self\.)?(\w+))')˜ µwhile True:  ³ ömatch = pattern.search(text, hereC  / qif not 6 y: breakO Âstart, end =& j.span(F ñresults.append(escapet [s :F I]))
\ ðall, scheme, rfc, pep, ó •dot, namev kgroupsx #if@ 
 Ù curl = Š ÷
all).replace('"', '&quot;Q 5   Ì ú'<a href="%s">%s</a>' % (url, url)@elifÍ ’ 'qð
://www.rfc-editor.org/rfc `%d.txtd zint(rfca ¤ ¬ ?pep¬ 
s­ apython© €dev/peps d-%04d/® ?pep® K² ð# Create a link for methods like '; . ^(...)äñ# and use <strong>G ™attributeJ   C 0if kþ[end:end+1] == '('² É¤ 1' +. Í (	 ,Ï Å G ;els    Îa Þ  Îé  Á f 
¾ÍÐ k j  S Â û, funcs, classesÒ Î _ O  ‚ %nd~L "é  . :« >  ó return ''.join(; Ë?# - ò type-specific routines0defpmZ!eeû°, tree, modKæ, parent=None)Sð """Produce HTMLF " a^A ð  as given by in€ Qt.get1 b k().""" F = 'â Q@entrA U   ' ùAype(# A) isë 7(()§  (   �c, bases–5tryx     e3 = 	 ö+ '<dt><font face="helvetica, arial">«  C   > Àt = result +û self.classlink(c, modname)
  Ãif bases and
 Ý!= (parent,):1  @  os = []! 1forM 1 in sH L ‹.append(»  œ ¾ ¿  B “result = 	 ó+ '(' + ', '.joinÎ  s) -)'² 8 A ê\n</font></dt>3 òelif type(entry) is /[]0 ]  ¡<dd>\n%s</	 2' %²½formattree(¤  é o 6, c´return '<dl[  	  [ � 
R Ñdef docmodulel , object,  Q=Noneb 
 ‡*ignoredÙ ð """Produce HTMLP °umentation úao3ule[ A."""~  Ä  f $ =  __ R__ # i á the passed-in” ; :tryG8allK Uall__. ÿexcept AttributeError@  ó 6 @partØ — ¦.split('.'h P   ø ò ié�range(lepWts)-16 ü = és     ð'<a href="%s.html"><ƒ¡ color="#f  ">9  �></a>' %J  ³ ù±ts[:i+1]), Ý J[i])Ð eS = '.0© # +1 F-1:]2 @head, R<big> astrong˜  !</   „ Q g ­ Îòpath = inspect.getabsfile(¢ƒ  . urüðurllib.parse.quote(G 
+  D  � # =g0ile @(url&th0 6?Typ1J §'(built-inQJinfo`if hasÕÆ û , '__version__'"  ª #tr2 .0 ©  3if 1 ±[:11] == '$ú@Revib 1: 'Ù'  Ë' 
 O % % =V Û11:-1].strip(| 4nfoË':  %síÃsescape( rNdate Pe V s; )c  : 
â ¸ €+ ' (%s)® & 4 å `doclocŠ M2get •( iR + pis not P
{ : 5&r>ç( Q)s">M’£ ReferenceÛw locals|Oelse^ À = ''
      ÷  result = self.heading(
    Q, '#f ' ‰7799ee',( õ"'<a href=".">index</a><br>' + filelink + docloc)
> õmodules = inspect.getmembers(object, "is/ @ Ðclasses, cdicÍ e[], {}` õfor key, value inM h 
W %):G  ð0# if __all__ exists, believe it.  Otherwise use old heuristic.
C  ùif (all is not None orn  + ()(Ç R) or )D  
¯  A ñ if visiblename(	Dall,= 2  6 ý ¢es.append(7 y )¤ 1  |r[key] =‰[/    '#5key: “q 
Ž  ' 1bas´N 0.__ :s__)  ‚ Ú 0modç 0 = ( 0.__ 4__, mC%__Š  :     
2ys. sˆ(R ö 3if  @ != h @ and 1ule phasattrC @ule,…P z   mif get-  Ù È í  5   !if>0keyØ-  1 # 
¨ b  §Î Ž+ '.html¶puncs, fë? = g3{routinei_h—isbuiltinh  0A /isGy#fdwŒÏ<'#-i ó %ifù ish 4tioæ :Ö´Y +Adata÷   w� ‚*ÂsA è% E  — 0docÉ ÓÓmarkup(getdocM"),ï“preformatÓAêH    Ùð '<tt>%s</tt>' %Èr H	 Q+ '<p- Dp>\n. / 4if ¸Ë, '__path__'"`modpkg%[]A  Ó }�importer,w ƒp, ispkg‹ápkgutil.iter_m·ð s(object.__pathk__):
  ò
modpkgs.append((modname,  ©ispkg, 0)): 6 Zsort( ðcontents = self.multicolumn]  m , { JlinkB “result = 	 +/ ¹bigsection(Œ  Ñ £'Package C~ a', '#f  ”aa55cc', Ÿ s Êelif modules , Ë ƒ B ², lambda t:·   æ [(t[1]Iã ì M¬ Ø â f ã  ¥ �if classâ   0lisnñ[value for (key,  D) in< ]P  t[   ûñformattree(inspect.get‰  
  ~ B, 1)r)d  � Œ ‹ 
© r � Ê‚ ‘document(Ì !, L Ú€fdict, c •0CJ!esŠ•`ee77aa „ '.join(¨ t if func~[?  p1Fun° Oaa77Jdataê>? = >   7 ©!1Datû‰ 55¨ û o<br>\n
0has@P(obje­Ë'__author__'Ìú£markup(str> .< )�2pre£ë %A—  × í o7799eev?if Þ  creditsß #= à @C™ á creturnÅ
 qdef docø(§$, Û •`=None,Œ
 ×D={},‚  J  ¨ ‡*ignoredð"""Produce HTML docuómentation for a class object."""
  ¤realname =  __ %__#   1 =  4or 2   Xbases@  5__
" pcontent% %[] tpush =  v.append6 Ó# Cute littleÂ ðto pump out a horizontal rule between secü %s.l  H0 URule:  údef __init__(self)   $   p.needon10A _maybe> 8if A _  c  ©('<hr>\n')a   A E = 1! Zhr = à (()LöList the mro, if non-trivial(ðmro = deque(insp/rgetmro(=)” ú if len(mro) > 2Ð 2hr.0  À ß ðdl><dt>Method resolu²¾ order:</dt  Ê [0 inÅ 
p ] €d>%s</ddC " %uPlink(C ,8 8  ·.__module__ F ß 0/dl| € ^ûspill(msg, attrs, predicatel#ok# ý  = _split_list(7 	Ç ^if okŠ¯ :msg¤   l ñð, kind, homecls, value‚k  : >try„     > P= getÌ T,\…  2 �except E ?ion\ ð# Some descriptors may mee+afailurº Ötheir __get__û n  Ï# (bug #1785œ  . ò–�docdata(ä Ó [, mod# 5   ;els‚   	W uÎX Äbfuncs,B£es, mdict,ðŸ � '„breturnÀ^Þ}éÎ"ú< =)Àattrs, prediwcate)
  iif ok:   šhr.maybe(.   Žpush(msg ÿfor name, kind, homecls, value ink  T ñbase = self.docother(getattr(object,[ ) ^, mod�  K Ñdoc = getdoc(y ( ®if not docþ  H   ë ð'<dl><dt>%s</dl>\n' % ² Y OelseS Ÿ é `markupç « ,­preformat,š ˜  ÿfuncs, classes, mdict¤  A Š r'<dd><tÞ 0tt>Ü ?docw 	(,T)x > :\n' preturn î%s
{  X = [(UQ
D  Ó  ‚-  ~Aify_	 _` ^L   if visible „ Bobj=�&)]ª jU = {}½  Š ?key~ 
(G ñ[key] = anchor = '#' +ýP + '- 5keyi  ø :tryJ   ü l é @
ï �except E >ionL ñ# Some descriptors may meet a failuráétheir __get__.¥  ” Ê# (bug #1785„   Ipass3 Ø S# TheS …  Æñ
be hashable (e.g., a dataTY withY  n ## ²ict or listS )µ —O™	O AžTypeErrorAÛ 4 Qwhile› s+ jif mro  ¬ Athisµ  =! ‹.popleftžz<  	us[0][2]�  `  ð, inherited = _split_( õlambda t: t[2] is \ ) P  V¶ % ¡‚uiltins.=F and=  % b! „ & =¤ 	Á  u ‰continue Jelifj ‚ a 0tagnÛdefined here'K Ù7 ;pfrom %sIç¸Ulink(.Ö Ú 	 À º.__module__I � €+= ':<br¬Ð

           ð sort_attributes( ×s, object)

  ó # Pump out the + ùsegregated by kind.6 ' ó = spill('Methods %s' % tag,I 	5 v ñ   lambda t: t[1] == 'mG )')6 k bClass * q .cM w oStaticx 5sN y 	ðdescriptors("Readonly propertie"r€} r^ y˜ g'Data ª • d[ “ 
Bata(Œ ‘and other†• #  Ž ƒ Qsserth sÄ/[]½–inherited}ôcontents = ''.join( £pif name[ @real :b PtitleD !<a* b="%s">ÙÃ<strong>%s</ @</a>¤(E  … [ $, e „Oelses U ` ? = ‰   ! x ~ Šif bases‚ 3par;p1for0 1 in 8  è < Ñ.append(self./Plink(m *Æ.__module__) D u p+ '(%s)W3', Ìg Ë@decl©'{:tryØ €signaturÑ…inspect. (À ‚   òexcept (ValueError, Typ )Z ENone„ 5if b 
3 0arg‚  æ5tr(% 

4if (  v z!= '()'Q  ´  ï1 + }sescape(; ¦) + '\n\n'+Ídoc = getdoc0if U 
k 2   @ + ( Gor '¼  =€ `markup% , ñpreformat, funcs,  pes, mdiB Ê   F    ý @'<ttlÑbr>&nbsp;</ttn6docÎ breturnk �section(IQ, '#0  G¤#ffc8d8', ƒ, 3, docTBdef ¨ ð value(self, objsect):
  õ """Format an argument default value as text."""8 òreturn self.grey('=' + €repr(objj !)
3 ð def docroutine(7 ", # ò, name=None, mod
 6 ¤  òfuncs={}, classe bmethod !cl> 
à ÀProduce HTML… ã Àation for a X  2or N › ò  alª $ =  __ %__¬   ! =Ð b or re2   ôanchor = (cl and cl.E  1 €'') + '-J L 9 •note = '' Åskipdocs = 0 Òif _is_bound_Ê ˆò N!imBË  “Q__.__ Õ 0 Jf clC  J ois not&  * Á ` from à  p .l Slink(H )Ñ  ; Oelse{ ?0.__K 3__ ƒ  I0  J … ò of %s instance' %¿• 	ˆ  B  { 6À   4 Ä   ” !un· ’ Ÿ �  %3modX C óif (inspect.iscoeÖ= orÐ 7 Œasyncgen6 K l ' €qualifieÊ'  ™ë " 	4 ' Q "if/%==/
½Atitlü!<a* ó="%s"><strong>%s</ @</a>4(f,P Oœ iÙ‹ögetattr_static(clI P, [])gÿ
¨  Í  ñ Î « <a href="#°  ¨ Ÿ … : 	 N  � Ê  4   1Y ë  /  S ¡    ^ 	6 mQ = %sr	D  h ƒ a ¿  v ¿ 0arg°0 = ®?  ifŽÉÇ¿
n:try  v €signatur/Ï H m  2 �except (Vè±Error, Type û 0 N º   5if   � ó Estr()  C   %ifºî == '<lambda>'T  / ³ k ð <em>lambda</em> ' % oname
   ÿ-# XXX lambda's won't usually have func_annotations['return']Q ðsince the syntax doesW ÿsupport but it is possible.K ñ
So removing parentheses iP Ÿtruly saf@ £argspec = 
 ‚[1:-1] #U eS � dif not2 :  <G µ = '(...)'
 @decli ósyncqualifier + title + self.escape(G Õ) + (note andI  h "  0 ðgrey('<font face="helvetica, arial">%s</! @>' %º 6e))– ºif skipdocsÊ Ã‘ '<dl><dtF  dt></dl>\nK  Ñ • JelseA  doXÖ umarkup(- Â ò getdoc(object),Ó ¡preformat,Yùs, classes, methods)I h   0and° Bd><t° t° dù 9doc7 à  -â (ã S, doc20def Pdata(Ú ", ¼  , ?£=None, mod
 !cl	 )ð """Produce htmlM Bumen9p for a ^ õ  descriptor."""º ¶results = []spush =  y.appendã ž …   4 (Ýq<strongå C</dté > t j=«ØÇ: i=ˆ µe | ±   µ ƒ”  Ís'.join(
! Ðdocproperty =r aÐ_otherÑ�*ignoredÒ@HTML` Ò*	Î lhÊ _ á/ '‡  J ·—ame or '' d D =DreprMà SindexÝ Âdir, shadowe¥
Ê aGenerap Î = ˜°irectory ofåIulesÏ `modpkgÓ � aq  Ð #:ƒ U = {}Ò  ÿ im"erRð, ispkg in pkgutil.iter_mod~ g([dir]Ã  ð
if any((0xD800 <= ord(ch) q0xDFFF)Ò  chX  ~B  F "# ë# aë q if itséð contains a surrog4•characterÑ  I    / :inu`.¯ ((‰ C, ''ô  ¢ °)J U  [9 R] = 1ô  \ Vsort(7  ˆ !en? ¾Ð.multicolumn(âmodpkgs, self. slink)
  breturn  ñbigsection(dir, '#f ' ÿee77aa', contents)

# - ð  text documentah ð generator

class TextRepr( !):¨ A"""C òfor safely making aU erepresV ñof a Python object."""L Ðdef __init__(d   s . 4    + ¢.maxlist =0Ýmaxtuple = 20* 0dic* 1 0str¼ F Áother = 100
H  ¦  Ô 1£ §, x, level­ ÷if hasattr(type(x), '__name__')  ¾ `method @ = 'Z Ô_' + '_'.joinB .@ †.split()( F s  &, W p  . Z1get¥ 2 (Õ ó 3 Pcram(%@pid(­ D(x))Ä!ax.))_/ /ng/!te¸[ xL 7 ç  '  r 0 =  (  °if '\\' in  B and 0not qreplace6  ? 0, r0 <, '‘ð# Backslashes are only literalL Bthe ž g  # Unever- 1°# needed toðe any special character Ão show a rawX .K ¯ 'r Þ  Á R[0] +ì   : 6 0 • %  ‘E  2ing ÚŸ_instance³"ry  ê   m Ä   &ngµoexceptJ T'<%s ‰ ‘>' % x.__‰%__›sDoc(DocïÑ"""Formatter 7  £è53Ýfc  3’utilitiesM_jÁ & =>ÿ   : = ' . @  �Cbold„ ¸ Ú  oÞ # a2 ˜ 0 € by overk ‡ß  3   ¦'[ chi \bW!ch  chI n ˆ gindentŠ  , prefix='V AA"""I.   by* @pend#pa given 0fix™each line§ 0if ¶ † %: ´ ¤ p  0 Rs = [… ! +B ¿   Á )e'\n')]= !if. "s: f[-1] = .9"p(¥ n € #\n6 d  b   ¦˜FWtitleŠÝð """Format a secótion with a given heading."""
  ôclean_contents = self.indent( ¥).rstrip()8 breturn. ûbold(title) + '\n' + Y  A\n'
B ?# - ò type-specific routinesM ð def formattree(Á  ,  ð, modname, parent=Non ¡refix=''):Ž  ñ
"""Render in text a classJ B as ò €ed by inŒ Qt.get%  n )()Yµresult = ''e €for entrA X €  „ !ifè (# B) is '()¨  (   pc, base²/ d     € 	 1+ p÷ ›0ass%(c#Ú =   #ifb 3and
 B!= (J,“   5   – (f  ©  cd¾ v  E ² #= 	 ó+ '(%s)' % ', '.joinˆ sB 5 >  x Y  /elk/[]Ø  Q  c.s} i —`F, c,‚'! '¼ \ð Ö„docmodulÕ€object, VÌ1mod
 ¸ ¢"""ProduceÉ‘documenta „]  W 	¾ b $ =  __ ñ
__ # ignore the passed-in� °synop, descO¡plitdoc(ge l )û (U0sec¦ r('NAME'ê A + (U  Š@' - ` H �all = get(g Ð, '__all__', üw Qdoclo¡  ð� 3loc9 ( 3if + ais notG 
· Ë ð MODULE REFERENC× S  + ‹à
The followingo ¯ñis automatically generated from‰ñPython
source files.  It may be incomplete, prrect oëðclude features that
are considered i; @adetail‹ _ 0vard ctween ‰ 
2  Œ @Whenõadoubt,^   F„Àreference atÕ B
loc±0lisî ²above.
""")! C ž?esc�ÂDESCRIPTION'¨R ¶W%[]Ó 4�key, valuPsmembers: b!isL ™ ² S# if •õ# exists, believe it.  Otherwise use old heuristic.’  K @if (ö™À
             ôor (inspect.getmodule(value) or object) is  :
8  ÿ	if visiblename(key, all,2  > ò classes.append(7 y )c ¦funcs = [] 1or c , H in À rembers(· , ªisroutine)¿ ð0# if __all__ exists, believe it.  Otherwise use old heuristic.
È  pif (all*µnot None or· ' m—isbuiltinmÉ 	‰~?Y|Odata{)sA p+ E ¨ [kmodpkg' _“  Fset(X¥if hasattr+«'__path__'´ ðfor importer, modS p, ispkgápkgutil.iter_m¸�.T S  	¡ S.add([ ¦  '   "ifn 
¼    I %F þ  + ' (package)'U OelseQ %)
qv 8sorY  “result = 	 ù + self.section(G  0 ð'PACKAGE CONTENTS', '\n'.join Þ)€ Ã# Detect subqõ as sometimes created by C extensionsz 8 \1„ ä ë G!._„à__.startswith(C ¢p.') andÑ 6 ina ð 5 s¡» ñ6keyÞ'if
> : µ1šSUBMODULE¯f ²3if ð
”  0lis.[Ñ o
à% &es 5pcontentÛ[_@formÑ.eebYM Qtree(
  | `, 1), “)d ‹ 
Å � •“ ‚documentã,æh ± = (1k'CLASSh fØ
Ÿ * ð = []
          û  for key, value in funcs:
  ñcontents.append(self.document(> ,J iname))A “result = 	 !+ ? ôsection('FUNCTIONS', '\n'.join(s 5))
N zif data  ) U = []+  Á ß >  ( B Þ ]otherÞ ¿, maxlen=70é ODATAä úhasattr(object, '__version__')þ  E = s2 .0 
‹3if 1 ð[:11] == '$' + 'Revib u: ' and' 4-1:' 
y  9L % =/ Ú11:-1].strip(| þ”VERSION',M ? ?if  Ndateg jDATE',.J Îq oauthors lAUTHORu N w creditsx `CREDITW	P z :tryßðfile = inspect.getabs –�ÿexcept TypeErrorH Å'(built-in)'¤«0FIL« v o creturnLÁdef docclass›$, ; �£=None, mod
 ‡*ignoredKð """Produce textO Üa£ I�a given f ` G."""Î  alo $ =  __ %__#   1 =  Ror re2   Xbases@  "__ç  r ë @makeC b(c, m=ê ·.__module__Ö  2 0· 6 
T   � 
Â1tit'C  .ÀTbold(3  OelseA 6  q )v# =P V L 1if 
O 0par‹t = map(,+ ˆ  ü »  °+ '(%s)' % †gN 
P@push® 
	™AˆsignaturF E (V‰G,RÒF 0 = Û0 
40argÈà = str(signatuWre)
  åif argspec and ‰!= '()':,  7 µpush(name +- …+ '\n')
- ödoc = getdoc(objectv jif docZ V  6 K õ# List the mro, if non-trivial.s àmro = deque(inÐ „t.getmro� 	‚ Ïlen(mro) > 2‹  ö"Method resolution order:"F  °for base inŸ 
J  ! Ù '
 €' + make<(4 )K * Fû ñbuilt-in subclasses6anyt  ¥ = sorted(  ƒ °(str(cls.__† @__) Á 0clsÀ vtype.__F $__;	F ƒ(t I ñ.startswith("_")L! Ñmodule__ == "È iins"),T Õkey=str.lower !Wno_of› 0 = Â¬ + õMAX_SUBCLASSES_TO_DISPLAY = 4[ 'ifKC &‰."Brý‚  P E Oes[:Š ]q u (F  V Ú  ( ÿ/> j i 	1...§5' + c   .y-m )I w' otherr'Ö s'üÁCute little óð to pump out a horizontal rule between sec°s> H0 JRuleúdef __init__(self)     É.needone = 04 A _maybe>  p4elfA _  c z-' * 70"  ‚ 1‚ Zhr = à (Žûef spill(msg, attrs, predicateì #ok# ý  = _split_list(7   œ ^if okÖ 2hr.Î í >msg  ” úñ, kind, homecls, valukk  † 'tr   > — Ì Ü , k …  : �except E >ionà  &   ð# Some descriptors may mee«afailurº Ötheir __get__£ D  Ï# (bug #1785œ  . C�docdata(ä Ó R, moddÀ              `else:

  ÿ
push(self.document(value,2 F ùname, mod, object))< Õreturn attrs
 ò
def spilldescriptors(msg,) Ê, predicate)½ #ok# ñ  = _split_list(` 7 k  ± Zif okI   šhr.maybe(³   >msg Bfor õ ñ kind, homecls, 9? ink T mCdatalO ?mod< C 5ÍÂdoc = getdoc0“ ]>tryá    2objE  '(¨,wM ÿexcept AttributeError_ 	 .__dict__[&]ˆ Œ   ^
Pother• ’ Mÿmaxlen=70, doc=doc) +M  Q Z '\n'Ì y `s = [(ž ", ÄÀ
D [ ñ-  í‘classify_	 _`  Í  
¯  if visible „ Bobj=”&)]#Rwhile
zjif mro  © Athis…   =! ‹.popleftÝ< Ã Z[0][2½ ¿, inherited‚õlambda t: t[2] is \ )Ý  °  •2 % Ònot builtins.F and=  % ! £ & =¤ ‚‰continue Jelifj ‚ a ûtag = "defined here"K o7 ;±from %s" % ³)~ H ¶ ».__module__rAsort¢Õs57 , Ó# Pump out thˆ�, segregaþ!by=.ÿ �Üð ("Methods %s:\ní %taã	8 Ä  
 D�1] == 'mJ ãn ðClass methods %sÿ:\n" % tag, attrs,
  ùlambda t: t[1] == 'class method')< O ó = spill("Static+ Os %s{ -sQ | 	ÿdescriptors("Readonly propertieŒ   ra y› WData ­ $˜ d^ – 
Qata("� ‘and otherOibut0#)  ‘ :')
4Qssertl s`*[]  ¢Æ = inherited> ôcontents = '\n'.join( ™tif not  :_ áreturn title +H     å + self.indentm ô.rstrip(), ' |  ')L M ðdef formatvalue(C –, object)� A"""F& ñ an argument default ; Á as text."""[  ¨ 4'='Ÿ Srepr(` 0 ƒ šdocroutin‚ ó, name=None, mod
 !cl	 
  qProduce„ A doc£ Pationá q a func #orøè ²  alu $ =  __ %__Õ   ! =› b or re2   0oteù' pskipdoc0 Òif _is_bound_´y E"imØ’  §Q__.__ œ 0 Jf clC  J "isx&   * nÁ ` from »g  ø (C �É 6 Oelsev î2.__¶  ~  Ö0  J € ö of %s instance' % � O 9  v ,»   8 ¿   � !un­ � š 
‹ 7modIóif (inspect.iscoèŽó= orË 7 Œasyncgen6  ª ' �qualifier„  Šæ " 	4 '˜ Q  ¡0ameýç
³ž={Tbold(( t i¢ Îàinspect.getattûr_static(cl, realname, []) is object:
  Éskipdocs = 1 ðtitle = self.bold(P µ) + ' = ' +d 7 õ argspec = None
 Pif in Ât.isroutine(‘ )’ :try  ® €signaturŽ H  H m  2 òexcept (ValueError, Typ s  0 N »    5if   � ô Estr() )�  K %if1î == '<lambda>'T  / 	: - 'd  9 b# XXX # ð's won't usually have func_anno/ßons['return']Q ðsince the syntax doesW àsupport but itgŸpossible.K ñ
So removing parentheses iP Ÿtruly saf@ m
 ‚[1:-1] #U eS � sif not 2 
n  ÑV(...)Sò	decl = asyncqualifier + ˜+O   +] 
ìS
k d X V+ '\nl Jelse-  doFdgetdocâV or '5  ìT @ + (= 2andº`indent ‘).rstrip(ÄB\n')¢Àdef docdata(í,, , ñ=ËS, mod
 !cl	 F€"""Produ$0extM Bumen^p for a ^ õ  descriptor."""¡`result‚[‚spush =  r.append±  ú  Õ+am6 4 Ã °
‰"  |  ./= k
i!
¢J  /.bV  ¤ # 
m ±ƒ''.join(Þ ‰Àocproperty =F 5ó ¤Qotherâ ¥[©ƒ, maxlen 1doc
 À!³¼$pr%Drepr­Ý#if€ 
?0linÏT ­ l\ê § S K  Tcchop =S p - len(L 
z1if ) P< 0: D J@pr[: ]h 6...L B 6 = Ž Ùõ ™  �oø
å [Î Uˆ !+=) +Á ^@doc) TH À   return lió	ne

class _PlainTextDoc( Ò):
    """Sub( 3of  ñ which overrides string styling"""= ódef bold(self, textW  [ areturn _

# - %ð user interfaces

x gpager(s ñ*"""The first time this is called, determine what kind of J 0 toh .Û bglobal ì & Q= get &() ‡ ˜   aSDecidu cmethodn @ forc  [qthrough/† ðif not hasattr(sys.stdin, "i .y"ppí£ ¡ C ?outD  .} Q() or¡  5out þ ˜ Ause_¦ ñ = os.environ.get('MANPAGER'a   Þ I r 0if ’ ñ*platform == 'win32': # pipes completely broken in Windows[  »   ÇalambdaŸ¡: tempfileÁ (Ú ,EØ   B Melifä `TERM')u ÷('dumb', 'emacs'Ó > €  Ã | &seP  QÅ ¿ %»  ¯ Yž  ¥ u‚'more <'t%if2ð os, 'system') añ"s. ð('(less) 2>/dev/null'),01Â 	ý}-'G 1')
½ eimport! P(fd, /uname) = 0.mkš pL²os.close(fdÉ 6try‹ Ö x"%s"' %v '= Ø dÜ  N W 4 /elO6ttyâgfinall¼ ¥os.unlink(.;ê ‘"""RemoveY ð %@matt%Afromƒ"¡¡re.sub('.\I'�e #ipª±3cmdd`"""Pag*}€ by feedp  itªõ another program| ì’subproces8  6 =  ñ	.Popen(cmd, shell=True, Ê=( AIPE,2 k ó	errors='backslashreplace¢Ðtry:
        ÷with proc.stdin as pipe:
  :try    ' É.write(text)2 þ	except KeyboardInterruptG ð# We've hereby abandoned whatever ^ Ð hasn't been u Iten,r  “ ñ# but the pager is still in control of! �terminal.E Apass Ä vOSErrorº  ! ñ # Ignore broken5ñs caused by quittingm Ž rprogramr —while Trukg˜Zwait(^Qbreak¤  ö ¨ l± §ctl-c likeœ ùitself does.  Otherwis"  q   °# left runnæ 1andN W {Àin raw mode   ‚unusable E    Ná

def tempfile.Tb, cmd)z`"""Pag’ Rrough�by invokƒ  Ç aQ on aN `orary T A."""1aimport    ~ 0.Te# àaryDirectory() ! 'di @ óname = os.path.join() Ö, 'pydoc.out'Àm Topen(@ €, 'w', efþs='backslashreplace'èô  encoding=os.device_ a(0) ifÙ  ` ÿsys.platform == 'win32' else None4  ú  © …M   üños.system(cmd + ' "' +ƒ+b+ '"')ðá_escape_stdoutñì1# E Q non-Ø  8õ characters to avoid	?a laterÉ 8   = getattr(n 4, '  !',ý Á) or 'utf-8'@ areturnh., !e( ^ing, ¦v).decod% æ 6ttyÑà Ì¶x�œµïlines = plain(8³).split('\nl	Mö!tyÛ  ÇSfd = 0in.Ò'noh ol! dtty.tc@&fdÈ  AsetcŒ( 0getª§ = lambda:g bread(1F ¸ (Ipte³, Attribute €io.Unsup¶³edOperationI É Qtty =ÃÜ ‚  PÁ()[:-1][:1]
9 	1	  f òh = int(os.environ.get('LINES', 0)Õ  , Ù BValuÇ 
= K 0s  - žif h <= 1% %25& r •c = h - 1 Á3out� ‡ å €s[:inc])ŠÐ    while lin—es[r:]:
  ÿsys.stdout.write('-- more --')+ jflush( éc = getchar()
: úif c in ('q', 'Q')…  � ‰  \r  +\r�   Ybreaki &elk  \rl /\nm "` + lin1P] + 'F 	i   �r = r + 1 ‰continue š b™ B O\x1b  [ a- inc  	J  }  if r < 0: , 0  K #n'Ç c.join(Ü ƒ:r+inc]) 
Ð X  ß 2incÎvfinally»Wif tt  ˜ ðtty.tcsetattr(fd,# ó.TCSAFLUSH, old)

def plainpager(textð"""Simply print unformatted ' ñ.  This is the ultimate fallback."""p ’(_escape_õz )’ ædescribe(thing‘ òProduce a short ( �ption ofˆ agiven 8 ‚ úif inspect.ismodulZ  0 D m �.__name__( » ‚builtin_8  s{ ; �return '* B-in +  ë‰ T  3 aif has›" ¼, '__path__‡^ packageV 	Oelse› ’ 	 Æ )in{ ³ ˆ    æ Afunczè 	V dgetset°/or_ ) Úaor %s. U' % (B “ ;ô .__objclass__._¨#_, Ý,H  ~	¾ omember¾ ) ¾ |q V	ñK ! N omethodL  J �4typÊ¸Ôplocate(SÖ, forceload=0LL" à an object by a or doç> õimporting as necessary]�parts = [	  k  	 0in ? ð.split('.') if part]
ð	    module, n = None, 0
 ñwhile n < len(parts):   Bnext: ó = safeimport('.'.joi1 õ[:n+1]), forceload)B 6if E :‡   — 5+ 15 ±else: break #if9 š ƒobject = ' 7 
  ¼ " �builtins @for æ 1 in Vs[n:]W 6try 	F ‚getattr(W ,= ç úexcept AttributeErrorJ areturn}Š  P _

# - Â interactive bpreter �face

texÐTextDoc()
pla7   _P  ²html = HTML- ÷
def resolve(thingÛ#=0 Â"""Given an Å Ö or a path to ”, get the' ñand its name."""Åif isinstancv 3strn 	ŒUlocat% v“ !isr‹aaise IÌªð('''\
No Python documentation foundÝð  %r.
Use help()æ Û  ^•  ‡ utility0  Í F   !onñstr class.''' % oX	%, /
ì J  =h¤E P, '__ A__',W (  %  €  !, ²  j ? 
„nder_docstitle=';˜Library DCY: %s'E,Æ  Ö reQ ser=NoneîA"""R  Ê	�?, gwZd   =k – ;, / =
Opdesc =  Cribe  ;£inspect.geO	'  $@ame 0'.'› €´ ] A +=  1' +š  [:% `.rfind‘!)]½ %el.Q „ cis not‚Z +  a  .A
[  ¨ Dot (Î "is' Í 1 or(  Ö * ä) eroutinHT 	@dataTriptoš)2 @_get°Ø)d ¢ A# If‡cpassed &°a piece of g Û$n  ¾#,Óñavailable methods3 0eadI  ôevalue.'aif hasµž ¶—origin__'«  ¯ # # =¨ 4.__* Q  ®ð:
            obàject = type(ob 7)
  ¢desc += '  ' ò return title % % ó '\n\n' + renderer.document[ ò, name)

def doc(thing,H ó='Python Library D= ñ	ation: %s', forceload=0,Š  « Ñoutput=None): ð """Display textl ˆ K £, given anÔ Ö or a path to A."""N 2tryW  m 2if p @ is s    bpager(_ã À )gJelseE a o.writeL p, plainê W ñexcept (ImportError,  bDuring —) as valu aprint( ¨† Ê ƒnW« Z HTMLlQÿ file in the current directorygn1¤ = resolve1„ F y€ = html. (•5rib×, “H  with open(¬P + '.T ñ	', 'w', encoding='utf-8'D à 
Â  À � _ `s'wrote'ß d ' ½A s(dir, pkgç›='', done4Æ?outÊf& ll modulesÐaÆU treeËiß%ne#m Q = {}Q K i›0er,Q  kp, ispkgX õpkgutil.walk_packages([dir]Ä | t¢0modJ G¤ñ

class Helper:
€ °# These dic\ñaries map a topic§ »`eitherbalias,*StupleI ð	(label, seealso-items). b ! " " û 2 of€orresponNM !se�   0 B.rst<uP P/ and� ¡index intoN Ê yK áin pydoc_data/Ö Rs.py.  ó CAUTION: if you change one¦ $�, be surePadapt} M  Š @list@ qneeded ö /ðDoc/tools/extensions/pyspecific.pyÞ O  regeneratem Ö %¬by runningC  — Bmake= -% &inaqcopyingq �c pFLib/ý.W€keywordsé^  x ¶'False': ''²'9 =Tru( 0and' xBOOLEANB  as  ®
 ±sert': ('as W, '')z ð async': ('async“', ''),
  £'await': (
   Qbreak  
 É, 'while forI Qclass) 
 ú
, 'CLASSES SPECIALMETHODS6 rontinue9  e 1def* �functionÏ 1del!   �, 'BASICx 0eliJ G'if'2elsŠ 	 † Pexcep5H'try@ ­finally':  !or˜  61, 'L# cð  R	@fromG himportd Rglobaå  ú, 'nonlocal NAMESPACEgí (î É 'TRUTHVALUEs k   Œ, 'MODULM nË i~�SEQUENCEei¸'COMPARISONÇ alambdaI  º, 'FUNCTION½ Ý -  2, ' ô !no£iBOOLEA| Œ'  pÃ	 3rai
 Ž, 'EXCEP² Rretur& Ý  B s  Q ! ( 
 C?if ØAwith;	  —ö ONTEXTMANAGERS Å i yield  z 
 }Fñ# Either add symbols to this di§bary or e%  I ñ&directly: Whichever is easier. They are merged later.< ð_strprefixes = [p + q£� p in ('b*f r 1u') q £"'", '"')]M Æ Á_inverse = {  4Ñ'STRINGS' : (9 3"''@  E h""', *� n‚OPERATOR?  '+Œ - *  / / %  <<  >> &C Ž   '|! ^ ~ 6 
 = > = ! )<>ê¨ Ü 'A QUNARY'Ô ~_ ð AUGMENTEDASSIGN , +� - * / % & /|=ù !'^, !<< >ñ *S )/=Ž rBITWISE‚ b K¿ #2LEX6 jV1J')ÿ	1%Èù· FORMATTINGÓ 0'**& XPOWER , ÖTUPLES LISTS #¸.' óATTRIBUTES FLOAT ¼Ð OBJECTS',
    ñ'...': 'ELLIPSIS',
 P   ': ùSLICINGS DICTIONARYLITERAL, @, ˜def classF  \\ 0STRF  _ ¹PRIVATENAMEP _ é SPECIALMETHOD- `J ŠBACKQUOTH ( ¡TUPLES FUNÃ ZS CAL¿ )' [' àLISTS SUBSCRIP #Ý ]* e} ô	for topic, symbols_ in _ ñinverse.items():5  ¤ 9 %  0 
 &s_   $ Y 4s =[ R.get(+ ,v )P  0 "if @ notV @ 
T  (  " =. ’s + ' ' + 	R m "s[ ]3 
& H {  [ ó'TYPES': ('types', '>ð UNICODE NUMBERS SEQUENCES MAPPa% 'I  M  'ú@LASS0 1ODUI —inspect')þt ‰ astring‹ 5str‡  - ›„ â  'FORMATTING ä o B u q-method| f &S I 	²   >gformat» ™OPERATORS6 Ts l Pencodõ ‡ unicodemˆ ¬ î "Áu anumberu ÿINTEGER FLOAT COMPLEX- ( ? Sinteg@ ™int rangeâ N , €floatingT Y math- u / �imaginary0 �complex c3 5 µ0seq4 
) ¥  J	~ Ç >qIÓÍo �functionE †`®4 X´ 8 C@  xbOBJECTœ`bltin-q-object|  %7ilekJ   J  7J   sû VFRAME? .¸�TRACEBACK¨  ANONEÁ Cnullw  ±	� N/ ‡ellipsis3 !	; ¬pATTRIBU” D  ebialattï	3 {œ ý  � šN Ã 4DMÕC RmodulCðimport'),
       ó	 'PACKAGES': 'import',
  °'EXPRESSION! õ(('operator-summary', 'lambda or and not in is BOOLEAN 'O V  ñ'COMPARISON BITWISE SHIFTING BINARY FORMAT _POWERO 	U2 ÿATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLESM 	÷LISTS DICTIONARIES')€OPERATOR	'$  PRECEDENCE^L% `OBJECTG �('objectsV;TYPr ÒSPECIALMETHOD0 ±specialname5 SBASIC!   ‰@   'DABLE. @SEQU»  tMAPPING M dNUMBER, [CLASSÎ « ð': ('customizationëhash repr str þ ‹é O ñ attribute-acces) SO 		N Âcallable-typk & G 
@G wsequencG & $S 
 5a
?  '
«z % Ä 
	ÇH vnumeric# ðS AUGMENTEDASSIGN ^À PEXECUws �execmodelðNAMESPACES DYNAMICFEATURES EXCEP6 
©2 N `namingK ÷global nonlocal ¹ @DELEJ d 	€ ^  dy` ‚c-featur*	5 0SCOF ™  FRâ   æ  6Pexcep2áBtry  é finally raiseƒ fCONVERÔ¡conversionD 	, ‘IDENTIFIEèÁ('identifier, „keywordsO/ ¢¬  ½ �id-class( qPRIVATE$Z[atom- 	« rLITERAL. qliteralª 1STRþ¯ 3 ©'% Y 	€ R  ~ 'ÊSJ 9  þ sexprlisï�! > †  Y !('~pseq-mut� Ç  7   q m À 'LISTS LITE“RALS'),
  ö'DICTIONARIES': ('typesmapping', ! _YLITE@   F Idict> OIES A ƒATTRIBUT ðattribute-referencesI 0get A has s ? jMETHODÝ ’SUBSCRIPTÛ ÁsubscriptionU �SEQUENCE< cLICING: olicing5 BCALL2 Acall/ ªEXPRESSIONœ QPOWERrPpowerä + QUNARY+ _unary+ 	%BI, /bi- �SHIFTING[ Sshiftô‰ qBITWISE0 bitwise� 	¡COMPARISON2 ƒcomparis}e o BASIC†bBOOLEA@ bbooleaº= ©TRUTHVALUEÚPASSERÜ·': 'assert'ù¡ASSIGNMENT� ‘assignmen·0AUG 'ED& 6   ÷2augI  oNUMBERÖ DDELEš 8del— bRETURN•x'return SIMPOR´Z'impoÕ PCONDIZ  ALö (if< BLOOPY  ('Œ@ound¨ ù	for while break continueNe é Ptruth= #if< ¯and or notÎdDEBUGG„ bdebuggû9pdbo ãCONTEXTMANAGERSáontext-manager^Dwith9 !}
×ôdef __init__(self, input=None, out !):1   ( !._( " =0  8 # =A l ‘@property-  z C w ^ È e Ïor sys.stdinL s M 
#  yN 2outO  � c__repr� öif inspect.stack()[1][3] == '?'!()á     Ð %''  `<%s.%s^ ¡tance>' % Á ö.__class__.__module__� V  8@ ²qualname__)í à_GoInteractive¥Sbject·  ’ª, request=9 
#$ 1 isÖ† 	i )c.help(: 5Oelse-  Sintro¥ þ g iÍ  óð.write('''
You are now leaving ‡  “ð returning to th÷Le Python interpreter.
If you want to ask for help on a particular object directly from the
R ,O  can type "I !(o9 ã)".  Executing ð'string')"
has the same effl    yp/ 	Š 5 1 at1  d ò> prompt.
''')

    defí ¡act(self):     õ.output.write('\n')  ¦while True4  8 :try   ¡request = W ’getline('™ V  -   sif not 8 u: break|  " ðexcept (KeyboardIµçrupt, EOFErrorÎ  2   H c $ =m .<#p(# 5   ñ# Make sure signific@rail1quo¶ùmarks of literals don't¼ â# get deleted JPcleanI Jinpu/ ƒif (len(« ”) > 2 and² U[0] =À ÿ[-1] in ("'", '"^  Ñ @  n%inR _1:-1]@ ƒ .[* 	Þ $ifG �.lower()� Ï'q', 'quit')Ñ7  Í 'J@fintro(Œ Ð ;elsŠ  /  f=ú† $ ,ó À"""Read one ®E, us õ() when appropriate.""""ifêÍÚ is sys.stdinÓ PreturrBput(¡× Ó  « 
•4 õ »[flush+u M ¡ P.readä ö 6 $ ,Ï!if¿V ã  Ð7(''&  � 2`   ý¢keywords':GDlist Í +el< isymbol;  : Ytopic9  8 imodule9  : 1[:8¶'+  í ü $ o¶.split()[1]. K	"in=þ KBshow N C  ['ä »PFalse	 jNone']É ~ à# special casez4se ·Q sinc Sy are,Us too6 E   …doc(eval¢ C, 'Hq;%s:Òõ w ö ÍS u À       elif òrequest in self.topics: Ashow (' 7)
  Selif  T: doc' ñ	, 'Help on %s:', output=b _ K "seC ?str? † ¦isinstance„  ƒ 2er)Ì (p $ell ¼ p Å Ä Ñ.write('\n')
 def intro(' !):  3  .6 ð''
Welcome to Python {0}'s h>óutility!

If this is your first time using= , ð	 should definitely check„Ð
the tutorialž  ñinternet at https://docs.p’ ”.org/{0}/8 P/.

E4  > ñname of any module, keyword, or ? à 2get× 0on 7Cing
ô Éprograms andÑ R ²s.  To quit 5 p
returng  ” Ò  preter, ju+Pype "A p".

To Ž aa list½ „vailableq Ä ¦s, symbolsÎ ’s, type
"ð Ss", "ó  1 "2 "“s".  Eacha ` also ûð
s
with a one-line summary˜ Ðwhat it does;Þ ±  ã { p whose …5
or; ðcontain a given str&âsuch as "spam"Æ  Æ   ÷.
'''.format('%d.%d' % sys.version_info[:2])ó ˜ ò÷, items, columns=4, width=80% ! =��(sorted( )§bcolw => 4 //R R³rows = (len< $ +% _ - 1)5 pfor rowï`range(F ™  « $ 6col$ Ì '  + 0i =s   *U 0s + ¡  !   vif i < ¨    "6[i],   !if{ <  k ô Z  . ^ `' ' +  1* (mV- 1 -¨  z �F 
ü 	5ƒ  p''
HereÙŽ àK  >s g   ÇAmoreZ .
½-p  ‘ ‰ .7 s	 ,s(¾µ+ ´ $´punctuation5c whichŸÐ assigns spec�@meanBto. R ß Š Þ 6 Ý „Ü À       self.ò0output.write('''
Here is a list of available topics.  Enter any @ nam ó get more help.

''')
  Pself.U (
 M �keys())
' �def show ' ,b ,W ±_xrefs=''):/  Y 6try   ñimport pydoc_data.N s2 �except I( ZErrorA ž SSorryŽ ð and keyword documentation:7not4ýbecause the
module "œ €" could ; šbe found.> Û ereturnÉ 0tarq!= ² æ Q.get( , § s )“!ifs I +noí ¨ ò for %s\n' % repr f »  ‚if type(z )7 	Û8 Ë 7 A 3 qlabel, ,2 = , 50^doc =/6[N ]? =?Key:48© õdoc.strip() + '\n'œ 'if&
Î(	 Qor ''@ G ' +6 L + 
G \…textwrap.  w  ± = 'Related½!s:f ’', '.join… �.split()‡ Ç  M  ^ Cped_U     . ( F, 72È 3   +=� q  7 O 6 “pager(doc= ~A_get?~A"""R•ð unbuffered tuple:
‹").ä ¬ pIf an e|Ð occurs here,& cMacaughtqÅdisplayed byz÷ the url handlerd ‘This func˜¡duplicatesd KÂ method but _Fs it-ñresult directly so it can ¨@rmatí   0 inÝ Phtml b.¬ 5""" ·?¾ ÄS¬b  ,Uâ žI±raise Valueˆ&('ABfindy}ð	if isinstance(target, stWr):
  õreturn self._gettopic(target, more_xrefs)6 qlabel,  2 = +  ñdoc = pydoc_data.Q s [= ]. 'ifc 
™ ` (	 çor '') + ' ' +6 L Ê 3doc� 
 ð def showsymbol(é ",  Æ " =	 "s[ ¯ Ì 3, _a þ æ.partition(' '+ m .} 9 ( < )ž ³listmodulesŸ gkey=''Ÿ jif key!] ðoutput.write('''
Here is a W   oa[ ð whose name or summary contains '{}'.
If thC òare any, enter a ¢ @ ato get…ö help.

'''.format(key) lqapropos •  OelseÒ ±Please wait‡ ð ment while I ga¯ î Óall availableµ 2s..¢ 
– Ò es = {}–  š  3Ðcallback(path	d:a, desc  ¯=C ª @   Ú4 @ and‰  @ ú[-9:] == '.__init__' <   "mo= =; A:-9] ©(package)'¶  6 v ï.find('.') < 0d  Æ [l Y] = 1S  	ƒonerror(% ë  +ANone ë  ,  
rMæäScanner().run(> #, j = 
; î Ó ‰  ¶ k.keys(i& EÃ nyL#ulÅÑ  Or, type "mª ós spam" to search
forE sQ G‘ string "F .$0)

1p = Help‰

class °p"""An i¾ PruptiÒs=S that• #es“ Ö synopses."""` f &, l b  Â, completer= ~ í‚ ‡  = A.lowÀ  x   c Õ.quit = FalseKBseenf H )ò in sys.builtin_{_ s ^   Þ¿ != '__mainB r ×L 0key* ÷ 
h      /(# Ù'ã (   Î     É Ð = __import__Â  @).__'_�'Í =  o! =væ.split('\n')[0• '   W  3.ð - ' + desc
      ûif name.lower().find(key) >= 0:
/  ðcallback(None, modG …, desc)
7 Çfor importer& óispkg in pkgutil.walk_packages(onerror= )‡ Êif self.quit  ž Vbreak�    if key is ­ 3 Ì 5'')É  H Nelse> >try  / espec =ã P_get_ (
g  < àexcept SyntaxEd ð# raised by tests rù
bad coding cookies or BOMÏ  h   �continue �loader = ¶ . % ²if hasattr(" 1, 'ê kource'¼ p   5  s; 2 = Q .O (h1 8 5E<?ion3 * 3if \$  ( % w  ) D    F× ò_synopsis(io.StringIO(ó  ))¨-''e F i@file|k < JpathP6 Û ò R   V  U² : û
ƒmodule =5ðlib._bootstrap._(Ž
Iq6 ½ bmß ð.__doc__.splitlines()[0] ifI4ule"  G 1get~\ @,'__Ü@__',™) ,  =i 
 ‘+ ' - ' +»È !P ¢ ö Êif completer‡ ñ ()

def apropos™+ ð"""Print all theÐ-K Ù  ule summarûPthat ¡°ain a substwA."""ð  b ´ 
s 6ƒö[-9:] == '.__init__'(  , ) l`[:-9] q(ë)ëpÎ ŽHf and '�Ì ® ˜y ApassÕ ðwith warnings.catch_war£nings():
  1war t.filter Ò('ignore') #  õ problems during importJ óModuleScanner().run(callback, key, onerror= o)

# - ð: enhanced web browser interface

def _start_server(urlhandler, hostname, ´  @"""S1 ’ an HTTP 9 ð thread on a specific 8 !.
î 5 zML/text: Ñ, so HTML or  ñdocuments can beG Å €d dynami+Ry andÕ ø actively with aö ò .  Example use:”  Ï3>>>•B time  Vpydoc2 ÓDefine a URL -À.  To determ ñ
what the client is askingÅ  ` ¡for, check(  L  È Ãcontent_type: . €Then getÒgenerate some+"or;Acode—return itD  ê  ñsmy_url_º  ò(, w é w 0... e 0= 'Ò  ª sÔ ÿwas: (%s, %s)' % K  ï J ™  áRI >5 0.D `If youÀY1 0,;8 òwill pick a random& fnumberF 1YouQtS3use‡À.t !tol î  C Š  K 9= 0 Œ L 1 = :.b
\C@Q  @qreally ®�ed.  If iZd, openß�  N 2ìfirst page.  Uð burl asH × ¤, ’  í *if' — 6ingàß y©rG PThe n÷ðtwo lines are comå`ed outaÊ ‚ doesn'tß %ifÚ `doctesû @ runsathis mLñ#• 3webŽ .*(½ "er¥U.url)Z V#True³ "LeÅ1 ` do it,ñing. We just need to monitor# fstatust w ^`.sleepæ  \Eloopå 1hog†7CPUÃ  |ò > ! =£¶.monotonic(º  )  $  E1= 1¶ †#secondsà T7 ›a short^  A fƒ!st{urposes• Kwhil; &W ú F(.01´ Ÿ ]É Ô ñ " -  ! >[ =outˆû  ’ éGstop1} * Vbreakð Print any errorós that may have occurred.

  õ>>> print(serverthread.error)& @None 0""" Ò import http.8  Áemail.messag7 0 hselect+ o 2ing’ ÷class DocHandler(b ó.BaseHTTPRequest# "):;  Ð ñdef do_GET(self):k     â"""Process a rE ÷ from an HTML browser 8 ðThe URL received is in b i.path.f 5GetP Bpageb - BurlhØ Ê and send it? b y   'ifi û endswith('.css'à  / ðcontent_type = 'text/, 	¤ Jelse< Yhtml'= Ë  ¼ Ö_response(200, K $ ’header('C™ ø-Type', '%s; charset=UTF-8' % ¾ Q  Bend_P /s(  ±wfile.writeÿ.p(Â ¢  ¾,v ú.encode('utf-8'))^Clog_Ùd {, *argsŠÃ# Don't log . sçBpassZ óS€	ò î æƒ__init__… `host, ”«, callback” “ ( 0 =  	 @addr!= V .& U m f % =q R [base.« k ,Üf  Âquit = False/ ¼ çvp_until_& ³ ó ’while notg  ' öÀrd, wr, ex =( Bect.¨!([¬ psocket.]ƒno()], [ 1²  › ^if rde   M ë _~ÆÙ ‹r_close(~ cactivaæô f x- 	¤\Ì¸ N  c‡¶œT3(Ë. ³�,�j
„ € * 6 =  	Ë )  ±Þ 0 = ê  
»¼ 
µ
, k  ]5ingœ á ! A1 = :«  º2runJ
ë Ð"""Start the _ <er.:try5  s 2Docˆ.÷Ð = http.serveër.HTTPServer
  2Doc ò .handler = DocH /  ò.MessageClass = email.m  @ 	6urls östaticmethod(self. )F Sdocsvª ¾ 4 ahost, ? 4por ^readyE '  J 0 =  v"  .s' Ê_until_quit(R �except E �ion as e:º u @erro¾ %e
  Adef ¨ É  Ä  ®)A =  ˆ ¥ing = TrueA  ×   0 = ' 0er. $  $ + _ + ñ	url = 'http://%s:%d/' % ¨ _  ­ 0lf.? )Ñ Astop( È ³"""Stop the¨ À and this th® nicely"""’  � Œ r.‡Kjoin¤ð# explicitly break a reference cycle:þT™.callback„ Ð# has indirecI C 2to < TÇ .: Ÿ¾ o = NonÁ  �áOFals!  “= ` 3={ (@ , bname, ¦ -6 T.starÌq# Wait ä‰÷ Ž !ispò to make sure we ar¢ #¿òlly up before returning”while not[  ú þ ùâtime.sleep(.01uZ H 0


>S_url_Q ý ó, content_type="text/html"ŽÐ"""The pydoc T= Ñ for use with¤#  š 2er.ã!If c Q is 'f Qcss',  _; ’.css styl+Psheet. ê  Ð ïed if it exitsi  Ï j no ‘result of@get_" P_page)u  –"ed•bcÆ¢_HTMLDoc(H "):î  0 dI  Çu, titledsT )   Ð"""Format an M  ; .n  #   Ácss_path = "*f_data/6
ÿ / �link = (â  D  !'< Qrel="lg'" þýcss" href="%s">' %F  c  ’ h\  ð '''\
<!DOCTYPE \ò PUBLIC "-//W3C//DTDñ ð	4.0 Transitional//EN">
<6 �><head><E >P‚b: %s</ p
<meta t’-equiv="CÌd-Type"ÚÕð; charset=utf-8">
%s</head><ñ2body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;, €/div>
</N ð></html>''' % (title, css_link,  ñ_navbar(), contents)


    Ò = _HTMLDoc() 1def : :.  2 ‘version =! ð.escape("%s [%s, %s]"‰ óplatform.python_7 5(),J  N  J ¯build()[0]K .Åcompiler()))— ¥return """  ¦ ¢Ù'float:left'>%  ) Pñ ™ %s<br>%s  <» '  X OrighY * ÿtext-align:center‰  ð  <a href="index. ">Module I ></aÁ 6  :: ctopics; T 5 tkeyword7 K 9    í › 0  <WÓ action="get"9ÿ'display:inline;\ °input type=Iÿ name=key size=15y 7  <9 ÿsubmit value="Get"6  </° y>&nbsp; ‹   
Ñ osearchÔ qSŠ × 
Ñ Ï   !""%¦KðC°(terse=True¨s ¡Ú&() 8"""â` page.Í8  p < 1blt& k(ü?  ! '?%Ê %sÄj 8 ,:4 : 0hea° ({  $ b'<big> qstrong>ŒB of º 3s</ !</,  'ï1'#f Æ', '#7799ee'Å ž Ps = [	 A forª € in sys.CQtin_m_$ 
¨ ¨ 2 if5 å!= '__main__']Ì Kí ±multicolumnU5s, f™ 6 [’, '<p>' +RQbigseÞ8„Built-in&ú f wee77aa'å]Î Î 0see´%{}À  4dirFpathF 3 « €.append(?.pPdir, S )ý0 j À      '<p alðign=right><font color="#90 ÷" face="helvetica,'
  ó'arial"><strong>pydoc</ û  by Ka-Ping Yee; ð&lt;ping@lfw.org&gt;</… 5>')f ñreturn 'Index of Modules', ''.join(contents)
6 ñdef html_search(key):  ¹ A"""S õ results page."""# Â# scan for mm  S _; R = []t  Z  x àcallback(path,? §name, desc…  / $if ö[-9:] == '.__init__'±  ,   0modL % =7 ú:-9] + ' (package)b	­ “.append((H ” ² and '- ' +¤ D q ôwith warnings.catch_ (Í  t.filter Ò('ignore') #  Ð problems dureimportb z  Jtonerror¯ p  & Ipass7 äScanner().run(‘s, key, V = î #ð1matW  Š  bltinlink(€‰ ŸÀ<a href="%s.}Á">%s</a>' % 8 !, > /DsE Ð   @head=Â. (�  $ b'<big> iÒRÒ€!</*  *',E !#f  Gw#7799eeu û ¯ %9in L
�É a/Y~ ®3 = ß " +î «bigsectionñ €key = %sMÇ'¾ `ee77aaÉ C<br>• )I
,4', ‘ › ò Áx_topicsé5"""† ò  texts availablFé  J 9Û<U ?key=%sA>,_INDEX#/  ½ásorted(Helper.Â ‡s.keys()^d õñ tml.multicolumn5s, +³6 +T¶ #R d Á9 # keyword  	J£�ð keywords.keys()C)

  õdef bltinlink(name):  $ ñreturn '<a href="topic?key=%s">%s</a>' % = !, C ` ñcontents = html.multicolumn1 &s, )y 6 ‚eading +@ µbigsection(.  § ñ 'Keywords', '#f  ”ee77aa', T f Û ; % Á   ¶ _ô Qpage(
 #@"""TR or kƒ ` help . E."""¦ öbuf = io.StringIO(Š  e 6 ö= Helper(buf, buf$ › d, xrefQ 6 Q._get™ Ÿ t 1if  1 in?. § sèõtitle = 'KEYWORD'E Oelse, VTOPIC* h¬ì ©R<big> astrongD !</   U– ,‹ êÞ~7799ee'& Ê A<pre]    N  g„.markup(O; ) kEZ/'#Y"if¤
6·qsorted( ‡.split()’ ä  y–
 % ¿š$ C „ › ›7 �‚'Relatedÿ2Js: '½ >  °ƒ žî p('%s %sÎ(â)h “''.join((ˆC)w o ó Hwobj(urlãÀobj = locate Ö, forceload=1¡ 0if * ðis None and url != ' 'ðraise ValueError('could not findL 7ectÚî ö  = describe(obj~ ÏÌ€document% ,ˆ * IO ðe“ ‡url, excKg  âã /</å
¸	Ý3br>á »Ð.escape(line)¡ 
 9 in<{ + �mat_excepW°_only(type(û >hîš9	Ë obb0000£ m  ½"Q€ - %s" %àÊsË@get_ð_page(url):
     ó   """Generate an HTML page for url."""
  àcomplete_url =   if õ.endswith('.html'):"  D 8 U[:-5] :try( N û in ("", "index"M  Q ðtitle, content = v _/ %()`  * #elU º== "topics"u  & P / Q 	keywordS 1 U 0'='û >url¡ `op, _,l�ê.partition('='ó  Ñ `if op ô ¯search?keyø   + ü 7 N(url] T_ $^ a# try & ùs first, then objects.® �      ± c  Ã´  = þexcept ValueErrorh '   d ogetobja ?get 	Ä Ç ¿   Ã $ .   Oelse® 3  q 4	> ™ 3 i =Ý Wraise°('bad pydocq^H “ ü ì EŒªion as excxÐ# Catch any eªÐs and displayAm+"an »
J‘ L (Ð,} ãareturnO.L
H !)
¯Œc.startø/ôð"1:ï$if­P_typeš¦'text/css'ü ð path_here = os. ”.dirname( @real ¦(__file__)¿ @css_ ? Pjoin( X C0  ´d open(: )�&fp“  q1''.N Ófp.readlines(~ ÿ�ã  œä M @get_ _gh!# š�s outsideì †ñ handler are caught b
r serverÿÌ2Typáð('unknown content typeð %r for url %s' % (content_type, ò))


def browse(port=0, *, open_ ðr=True, hostname='local ñ#'):
    """Start the enhanced pydoc web server andY ! a _ !.
D @Use � • '0' to sQ > ñ on an arbitrary- .; 1SetX ±  ? PFalse	 �suppress" Sing aï r= 1"""E !im~ 3web˜  | ¡thread = _– _ Ö(_url_handler ,š )? #ifü B b.error4 8bprint(N " =  " oreturnL  7 6ingN   òer_help_msg = 'SyÑcommands: [b]ì¡r, [q]uit'\  k !if#EX   .
´ 6url² :try; å ‹  Ijy at',	D  r 7 Ô g  # ZwhileG  0 	 (    cmÀpinput('& Zer> 'P ( ®cmd.lower(" 1if M Z= 'q'ë  A   UbreakY    'el; b; i S   Oelse‡ Cðexcept (KeyboardInterrupt, EOFE«à g   Q kfinallðô m“  #erøOstopm r = % @ped'¸?# -  	p-line ið Bfaceƒispath(xô zp isinstÑ�(x, str)Çòx.find(os.sep) >= 0F Ñ_get_revised_Q Qgiven s, argv0a ò"""Ensures current directory is on „  KAath,y B 
) 2notCEÑBion:i  '  J €left aloô ²f it's also¡ 's' w ‹Ru€s a new Å ó entry list, or NL  no adjustm¿ šis neededZò# Scripts may ge'ô  n@"irr Ðby default if Ay'reT # run with ¡ -m switchš Cqly from  i ž C# ThÀactive promp)¢so allows sM 
” ÃAccordingly,² Ø"al –äent, don't makß °any changesÂ UEo –if '' in  ð  or os.curdir iøn given_path or os.getcwd() i 3:
  Áreturn None
 ñ# Otherwise, add the current directory to p  p À, and remove M Xscrip9 °(as long as' ö latter isn't also pydoc'sm .L Àstdlib_dir =Ú  u ò.dirname(__file__)+ u + Rargv0( rrevised0==b.copy(% 2if Å P 	Gó 5not� @same‰ (2 &, ¹ )x{ .65 z Ÿ  .insert(0,m Ö( Ä/ ¡


# Note:eøtests only cover _get_1  , È ²_adjust_cli¸itself
def  1sys  (Ò ¯"""Ensures+ iz P sys.³(†__main__å0 isƒ .†¸Exception: +  % 0lef)¿one if it's7
1"""í . =(¡  
  &2[0]a9if ? « 5Ò 6  á Y[:] =0 !

A7cli0 Command-liÉ ñnterface (looks at1 †  k±decide what 4o).Ø Ñimport getoptê õ class BadUsage(Kr): passaÎ 6try× Ãopts, args =f  U1opt2 ¢ ò[1:], 'bk:n:p:w'5 añ writing = FalseŸ   �start_serŒ °open_browseë
: í 5= 0K @host� = 'local ' fppt, val Ï Ý  Œ êif opt == '-b'    ¬ 6TruÈ      ³ $ d kd  ¶apropos(val= Y   £Ò   P pP  ´ J?val[ w[  Óæ 
n;  –  ¾Ï š ›  †5
§-(Ò $, B =	 (, Ÿ= 
mit   üu: raiseV$  `0arg[(  § is](arg).aexists 
Ð  < pprint('Nq %r doe  5 0' %“ð)
              —  break
  Itry:   ðif ispath(arg) and os. q.isfile 8  < Åarg = import+ b writingF ‚ 
?dir�  …  \ Qedocs( ~  # Oelse|   A @ < Phelp. 9 ñexcept ErrorDuringI%� as valuŽ  aprint( !)
Æ E �(getopt.eM ¶, BadUsage)Ñ Ucmd =¶”splitext(Çñ
basename(sys.argv[0]))[0]f  | ð""""pydoc - the Python documentation tool

{cmd} <U Q> ...I PShow y 3 äon something. 6 amay bei  G Q of aG w ðkeyword, topic, func‚ ò, module, or packag �a dottedE ðreference to a class1 F 0 wi� # aN   X 3 in‰ ] T.  If¶ ðcontains a '{sep}', it is usedÞ : =y Œ Ñ psource '  W.^ Cis 'ö Qs', 'ù 1s',E Bor '¡   Pa lisQ 7@thesI@ingsŠ ¤displayed.©C-k <Z >N ÓSearch for a   ù  ½ àsynopsis linesa Óall available1s] pn <hostÄ ^ ñtart an HTTP serverqîdgiven 2 ð (default: local )\ 0p <\X  ”2he V  ,   O ñ  machine.  Portý Ànumber 0 canƒºQto geµ Áarbitrary un  U ’ bD Sã  onõ a@ Wñpen a web browserL óto interactively 
F .  This op	» !inG bcombin¦ Þ  -� vd/or -pÀ wË·‘Write outžJHTMLz &} ºaÄ!in1 bcurrenZŸdirectory4Rtreat7U  DA; ifÑ 0it   lY ,œ 0is ¾2ten§ "ll• ð!ontents.
""".format(cmd=cmd, sep=os.sep))

if __i ò__ == '__main__'`�cli()
/*“ 2CSSý  :,.«Cq  /t¨ç°are subject9achange
 oðnotice.

*/
# -*- cod%` utf-8 Á
# Autogener*�by SphinxæðThu Jan 13 18:49:56 2022
topiòcs = {'assert': 'The " ö" statement\n'
  /'* &  Af V ðs are a convenient way to in� º debugging    Lionsc ü into a program:  2   L –_stmt ::=ý öexpression [","  ]G   EÄsimple form,U D Ð", is equivalú ,toF  �   if __-__Ý  gif notk ‚: raise ŒionError^   Ä �extendedÆ '1,h 2Ô 
«â R1ã (³,2)à  VThese‘0ces¥ume that "xz" and "N"¢Mrefecñ to the built-in variables with those names.  In- Ocurr� ] šaation,+ X 	µ Þis "True" undœ ñnormal circumstances, "False" when optimizr  ½›requestedü Œ(commandbAlineE °on "-O").  fã ò	 code generator emits no ;forg ,ana Ë`· ûat compile time. b LNoted  it £unnecessar´@clud/†e sourceº  ÷^b ‚failed ie±  ml ûge; it will be displayed as part ofÆ -thÅ Ìstack trace.  `Assignksš	£re illegalËAvaluô‘
ò Ÿa  S¢determined¼ 8pinterpr  Û0rts´ 0,
 ¶›  º©  ' ¸  #½– )  f È@used"‚(re)bindÊ  s7	e ø ðmodify attributes or itemsá0mut8Œ objects
B ½ ïÀignment_stmtú  ::= (target_list "=")+ (starred_expression '
  x'| yiel% >)\n' 8   b  E  w  S (","  �)* [","]E 
 ?   E ¯identifier5 +  r| "(" [x î _] ")"9 [9 ]9 Ïattributerefi Ïsubscription0 olicing+ $"*h.  €(See sec� ð Primaries for the syntax defini$  */*,k *ù ’*, and *sÝ /*.WG ñAn assignment state
 ‘evaluates¹ Õô² €(remembeé /atj ÷this can be a single Y ðor a comma-separated n ,ƒ s OlattÆeÁing a tuple)è Ñ  `result* Ÿobject to¶ oeach oŽ Ö« ±s, from lefL oright. A‰"is&ñed recursively depend° nqform of "š k (Yp). When&Ð€ is partQ £a mutable /(aÑ¨e ¸reference, ­C or ©)Ük ?musB «0mat	1perû  €Ø¶ ÿdecide about itsÑ �validity6º ñmay raise an exce_" iiq pis unac!  -o.  Ther  _rulesj ñ
observed by various types³ ß  s“ ¯d are give‘@withl x â \ Üq '(s½ Ç �standard‘ Q ¯hierarchy)ä! of^ƒ o‡ œ1, otßally enclosedY iõ±parenthesesn qu4�brackets,é
Wfined a-àfollows.\n'
    X'\n'
 õ   '* If the target list is a singl þwith no trailing K ocomma,e ñ  optionally in parentheses,} Robjecx ÿ ssigned to thath  ª .i  Ã* Else: The h ñmust be an iterable á  	ïsame number of€  _itemsj @  asÏ Tre ar:sñ  X · aP, and*   !ms. PaS�from left+`right,
  k  correspondªy s1/  ´contains onÜ ’ prefixed>/an. �asteriskÆ ó	  called a â€œstarredâ€��·7É/at¡p  least©Dmany€·h  *o, minu *!. y0firX : U ¥z ,ì ×n  éÖ 
 òP befo‰3he ZW– g Rfinalk o0¿ �� Qafterék ’ g C A.  A36`remain×‡]Ž /is„ Othenh z» — )  (« ë@ can4oempty)M€'6/ofž‚$i ?are3,­„` à–A@ment$anÌ-to¬ïis recursively @defidaºofollowš . >ÿn identifier (name):O € 9 ð  does not occuròða "global" or "nonloc ð'
              ú 'statement\n'
  ' ñin the current code block: ñname is bound to ~object Q M k d `local Z ospace.0  ß  * OtherwiseŸ �  global­  � l B  orî Futer¯ ñ determined by "nonÑ /",d  Ïrespectivelyè 1Theq  z"re|òif it was already”ÿ.  This may cause†  ?theä ôreference count fó á“previousll   :g o reachl Qzero,£ 2ingYf  to be dealH¿ted and itsc  Ádestructor (l €has one)± Ÿbe called€A* If¡ `target…Õan attribute 6 : ©primary®  ßexpression inª  |P  j ðevaluated.  It should yiel {?witg¦assignable² @s; iÒ  isb 1notÞ ÿcase, "TypeError"Â  /is· Arais£ DThat•  isX an aske,Œ     /edd  Ó /tok  "Ggive‚Ï `it canÍ wperformh  ñ,/£º Ö �an except²`(usualû0ut g ¯necessarilì$"A M)oƒ  Note: uðis a class insta¥  ‹à  ÓNPoccurÐ both sides oe¤ <¡ operator,Uf  `ight-h‘  C l eÿp, "a.x"±0 acG0 eiÊ  aß B zt  ñn%#D uexists)F52Se lefÂ k Ô Ï  ¤ lways set šÎ Pcreat_it if?py± "usŒAtwo Å¸¼� !do¦Ð'
           ð    'necessarily\n'
  ñ'  refer to the same attribute: if þright-hand side H ¯expressionf sg va classf ,c 8lefb Ÿcreates al  ?newe winstancÂ 1 as^ ‚target oÏ ¿assignment:I  4¹ ?Cls7 #   Px = 3	  #ô �variableb  Â � = Cls()% 
.e  . à.x + 1   # wri3 Àas 4 leavingQ /.xK Oas 3h  ÷  This description does not f` applyê* /orO hps, such­²properties ƒd with " _y()".O  2* IñÿiP5subÁ æ: The primary Ä? in- /th¹Ceyðis evaluated.  It should yield either a mute  @sequK Ð ¤  object (/‘a list) oU 0appí% °0dicÂOary)Ob  Next›2	"ê ­   ‘s’û æ  Á ø   i µ Cmust€ an integer�ñf it is negativeN “Oâ€™sm `lengthL Paddedý0it.1€e result˜ !e � /beÚ$on� i ¾ @ lesÙ!anÞ9 ¡  Œ  , ­ÓQ ž G_askedl 2to )d  $ed�²to its item¢Ïthat index. E Šj 6    !ou¤�range, "IN `Error" ‚raised (‹  ¿ iÔ  f 4ed 2@ canÀqadd newÏ ¦a_ á MÚ’€,. kÅ H0havJðtype compatible with túhe mappingâ€™s key '
  Ž'type,\n v  and tE 0 is ðn asked to create a[ ¿/datum pairf  PwhichŽ sk  g �subscript[   ÿassigned object.  This can eithei ¯replace ani �existing³ Rvalue³ @withÞ P same   ß, or insert aØ  ?newh Akey/B _ a(if noX 
j $ – Oed).M  ö   For user-defi%!s,Æ ð"__setitem__()" methodÂépcalled ˜ k �appropriì�rguments« A* If” `target„ ña slicing: The primary expression in3 ­ Ÿreference« @is eSðated.  It should yield a mutable sequG \Û ¯(such as ak Qlist)”+e ªu bj /ofm   ï zk  ¤r.  NextßQlower ·upper bound@_s areg  òpinsofar|yC  ‘Âent; defaultY Azero~  · ¤ò  vÑ clength=½ s4£  �integers.Có@ / iZ‚negative9›  † ‘"ddÒif<Presul;Ó † RclippP Élie between 6	‰ C› ¦úclusive.  FinallyÞ Õ&is¬l /thM ¥e  N2s oÍòÉ Í¹ { 8 <i ¡may be difãat fromz U C mË � 9 thus chang ½
Z ¢F " ií i * Î [Ÿallows it,`*CPyth@mplei at²detail:** I}currentiÀ 'implementaêtion, the\n'
  ð'syntax for targets is taken to be9 � same as' Þexpressions, Q ?andh ƒinvalid p ñis rejected duringh °code genera¶ o phasef causingj ÿless detailed error messages.1  �Although– adefini‘ ÿof assignment implies that overlaps betweeni ðthe left-hand side 	   Irigh ÿre â€˜simultaneousâ€™o  O(forl ð	example "a, b = b, a" swµ ö two variables),Î �*within*h  Sjcollec/Ged-ta b occurù 1to-ê çŸsometimesÏ `result;€in confu•ñ .  For instanceùp follow+ programÎ  _printi Ÿ"[0, 2]":†  p   x = 7 /1]! _i = 0 Õ, x[i] = 1, 2²0# i�qupdatedÚ n) iv( d ï ?(x)  �See alsoð**PEP 3132** - Extended Iterh UnpackÈ÷ ÂThe specificªRhe "*°Ÿ" featureÜÞ 0AugÒ(edßPstate = f  z  ƒ‘he combinø p, in a õ/le¾ ¬  , ¤j  K Try op^oand anò æ$ a<_�_stmt ::= © 
 /op»  (Ræ_list | yield_ ¦   S ] .  { ÿidentifier | attributeref |‡  �subscrip¹o| slicšWaugopo   y ’"+=" | "- * @ 2!"/ #"/ % O**="Çk    e ">>0 "<< ð&=" | "^=" | "|="Z\n'
  ' ð(See section Primaries for the syntax defini$ As of ^last d _threei Ÿsymbols.)  ðAn augmented assign ¡ evaluates‡ ÿtarget (which, unlike˜  onormalh [ Pstatee ñs, cannot be an unpacking) andy û ¯expressiong Òlist, perform¼ Àbinary opera\Á specific tod @typepl µ l "on? "wo] Ands,¹ 7 ~ dresultk �original; c.i BThe  … is onlyŸod once6 J îU Ú€"x += 1"  �Ïrewritten asj €"x = x +E ðto achieve a similar, but üPexactÓ /qu‘effect. Iol Á0ver_, "x",¿ Also, when‡ Ÿpossible,i  ¬0act¨ O$ispÿed *in-place*, meaning thaÄPrathe aÊPcreat? Ça new object_  Z Æ£,“¯3oldC Ø ÿis modified insteadSUúB Y s»ª _left-¥ hÔside *before*K …e right-( o.  Forä ïexample, "a[i]l ò+= f(x)" first looks-up1 "eDn it� Bes "0  ¤ ~�k T!dd÷? ô0ly,`  dƒI@backNe Í "¸AWithƒQexcep#ofÀQ�o tuplesttmultiplˆsV Oin aá usingle ö>i  � done byˆQ @ ã ï"le.Îsame way as ‘.µ  SŽ/lyðw$À the possiblúe *in-place* behavior, the '
  ž'binary\n ðoperation performed by augmented assign 1 is_ bsame a Q onormalk …  r /s.&  òFor targets which are attribute references¢ ocaveat _aboutg ÷class and instancd �s appliesú ¿for regular` 2â � kAnnota„s  Žs3 = 3  *{ Oion* 0comÌ 6Ï, in a singly¯ O, ofk ×a variable orÓaý  ™ ‘Pan opq 'al‘ Q r :  3   n 6ed_ï�_stmt ::=~ÿ  ":" expressionM 
| æ["=" (starred_M / |K Hyiel% /)]t  sThe difb from ›% A  -sÝat onlyŠ  âj ¯is allowed×¢simple nam[€ò@, iffžor modum_cope,¤ $heäAions?Revalu_€nd storeù Îupecial r æm„ k –3"__X t €__" thatiQa dicÎ¢ry mapping£j l 60(ma~d(Èprivate) to á J ‡ o. Thisá ¸ i[Awrit§ � íòutomatically creKt#tart ofC# body execu$ I½1fouµ� tuÎs Gt œb�¶s¤ƒ but notw¾ À'If a name iú's annotated in a function scope, then this name is '
  Ž'local\n ‚for thatM 2. Al ñions are never evalu‚ ‚and stor� P  � l ° /s.   IfÛ � right hy !idà ·present, an¯assignment �performsi ·the actual D dbeforeû 4ingk o(whereN ßapplicable). Ä Cnot È  …/an¶   ex# Osionj etarget·e interpret³sE+ q exceptp » Olastk ò"__setitem__()" or  Battr OcallÜŸSee also:m  ñ  **PEP 526** - SyntaxÊ @Vario¼C ò    The proposalùvadded sP o ò OtypeS/ofe v’ �s (includL fclass   Ñ�instanceû ) /),h  ? tead of * ngðÐm through comvi1484iŸType hint;gT >ð"typing" module tovÉaö   Odardó ¨ ™	”È’can be us¢ostaticj  analysiÖ @tool|_d IDE@RChang| 0ver»” 3.8: Now­ 'edh¿s allow samOÙ ‘ièeaäregularì È õPreviously, someN u ÿ(like un-parenthesized tupl¸° )Æ!ca›arPerror8û,
 'async': 'Coroutine %'* 
] ' 0New.ƒ5d 1 @ � o`definiz, = 	,  1   ô _Õðdef ::= [decorators] "õasync" "def" funcname "(" '
  ù'[parameter_list] ")"\n# - 	 û["->" expression] ":" suite?  ð*Execution of Python coroutines can be suspended and resum t½ Kmany_ Õpoints (see *X ¨*). "await´ As, "'Q for"j 	ù  a Qwith"§ @only¬ ðused in the bodyÙ aÔ } ñ .J  @Func'  s defined k ¢ Çösyntax are alwaysf M  ñM �, even ifŸ õy do not contain#orh �keywords» ¡It is a "S¡ 0ErrP`to use ¨yield fromp inside™ 
× EÐ ?of S ¯An example”:h  2   !1defÈ(/11,  ,2)@ #®do_stuff()Q  # ‹e some_¤, ; RChangj0vertU 3.7:Ä )²""Dnow À;L  previously~qy were ÐPtreatkhs such¤ —HM Â " v/@ 3The~ˆ›statement( = (  ÄÓ_for_stmt ::=q "r  5  AAn *	ðhronous iterable* provides an "__a ì__" method thaÈ ñ directly return: ^  ±tor*, whichoKcall— 	“ @code‡1its‰ Fnext‰ “„` allowi‚nvenientü  ç_ over“ 	  &@ ~  foi @ing É Xf Ô ¿p TARGETû LITER:  oŽ   SUITEF Oelse2 	23   Is semantiž�y equival&,toX < !  J@ = (¸ *  ?€ = type( %).` R À  running = •True\n'
  ' þ   while running:   < ?try   òTARGET = await type(iter).__anext__ ] ÿ
except StopAsyncIterations ¯ | = Falså  •    elseD ^SUITE“ 6 2 23  ÐSee also "__a‘__()" and û )" for details.D  ðIt is a "SyntaxError" to use an "a7 Q ù	" statement outside the Kbodyb ðof a coroutine func�˜ E 4The‹ GwithŒ ) = )  1   ê __ “_stmt ::=t %"  7  AAn *G ò	hronous context manager*m* 1tha‰	M<abl~ðto suspend execuJÀ in its *entc  ß*exit* method ]Ýfollowing codÚç -ò  EXPRESSION as ±åM  ðis semantically equivalv,toW < $  iF = (˜ )( a-" =RŸU /__3 ?xit2 ?xit1 Uvalue»r (k ` Chit_°{3 <‡1 = … :  ÇŽ Û4k 1 9   ¥  ' cif notµa�ù ÿ, *sys.exc_info())j  J ?rai�0fin9 | ª (  a V¡ fNone,  ?N	–>— þ ©—> —˜¥  ™ ‹#à à:\n'
         u '\n'
  ý('  **PEP 492** - Coroutines with async and await syntaxE ö   The proposal that made cQ a  Àer standalon incept • /ina rPython,� ó dded supporting˜ .8  û -[ Footnotes ]-  1[1]Ô  ex¡ aion isÁ ðagated to the invocat  Êstack unlessÑ [there`  „ðis a "finally" clause which happensh �raise anoH 
Z ž û  _ T†Enew &   cb sº @old ƒ¬to be lostD ² ð[2] In pattern matching, a sequence$¡defined as_  ofn K  ž «following:   , `   * a!s½ ð	at inherits from "collec‡ss.abc.S‘ "M  \ _c ñhas been registerÕ B  ƒ 1|builtin„  æ "(C  )ÿü"Py_TPFLAGS_SEQUENCEó ä 0  bÀ+etÁ  . n
Bany ×\ abovÚR   ð ¢rd libraryñ ees areKsq"array. ü ‹  K	0d,: Olist- ¯memoryview3 _range. Otupl. ONoteQáSubject valuesçòype "str", "bytes"… w: do™,nohY5äLsz3z@mapp?is y
— „tM‹ ¼"a Óþ3s,‚ À '\n'
      P    ' ó   * a builtin class that has its (CPython) '
2  = ù"Py_TPFLAGS_MAPPING"\n# . {bit set  .  Ž † Pinher‡ ûfrom any of the aboveC   R òThe standard libraryæ Ûes "dict" andÜ ÿtypes.MappingProxyTypeà Rare m( +s.€  ñ[4] A string literal appea axpe first³ ‘tement inï 	Y‹functiona  ð ñ	body is transformed intoE 8 ú	â€™s "__doc__" attribute?anda  žthereforeR B*docß *5(š  û 
›namespaceü 0iteWê v = ç ö
,
 'atom-identifiers': 'I 0 (N )µ  ¯ .'* -  6An † d occur\0an ¦   a Z.  SeóŽ   1'sec Ç x  Bðkeywords for lexical defini¬fU 0NamÕ u  'O @bind$ ?forx @docu&ab  ofÙ  5 A Šc   'X 2Whew ) 3õ
bound to an object, evaluz  ”Ð ¯tom yieldst u\ !. � ¨  Anot ƒ ,� pattempt� r œ ;e iv ù  °'raises a "ŸÀError" excepO9"�**PrivateŠ “ngling:**Ó 	¡ó Ã ’textuallyÈ;s iðÇ   "'aÔpðbegins with two or m·pundersc {  characters¶³Pdoes œ enfg Ps, itÆo âonsidered a *pAv  ”*"atø (. w s – ¹Ð '
            ö'longer form\n'
 
 ð
'before code is generated7 ð them.  The transK oation O pinserts: t ÿ#class name, with leading underscores removed and ap gsingle9 v › ð ed, in front of© Š ñ .  For example, å ÿdentifier "__spam"w `occurrÞ Vin a ü çd "Ham" will bb_ed toò S"_Hamv .w LThisµ is indepenÁ þ ¿syntacticalu pcontext:_whichx Pthe i_  ²is used.  IlH!edx uh extremely Ët ( ðer than 255 characters), iÑBmentºdefinedë Rtrunc+ ?mayu thappen.Ø Øà consists onlyf×,x /nol 5˜ pis doneþó,
 'atom-literals': 'L Q #'*   ÀPython suppoâ!stÕ Ÿdbytes ‚ ²variousî �'numerici H :   $  ‚ R ::= Ÿ L 1 | ¤  B p | inteBÐ| floatnumber 2mag J  REvaluÃEof a° õ yields an objec˜¯given typeH(å ,o ó  îÆ ,Å  ‰bpoint Â @, co!x )’“'Ü” q  ß e0 @ mayÛ�approximY!in]@casej p« o  {³imaginary (È #) æ±s.  See sec³O forPpdetailsX. '‡ 5Alls ¡ corresponÄáimmutable dataÊ!s, OhencÖ?thej Câ€™scðty is less importaýnt than its value.  '
  ¿'Multiple\n e= òations of literals with the sameb � (either M  , h Ñoccurrence inB öprogram text or a different . )Ö ¯may obtainp » ^objeca  
æ Ô   õe.\n',
 'attribute-access': 'Customizing      � _   '* 6   The followˆ ómethods can be defined to c® e„ò  ž @meanH /ofr ì ð (use of, assignmÉ0to,Ü@deled ct ß"x.name") forw ð class instancesš÷  Å D `.__getÇ �__(self, � )8  Ò   Called wheà}defaultD faiaa× × T   "AˆeError"š"Ó ¦Ï__()" raisesH P l @becaê*-�* is not ‹”j ¶  w  —Ä /ø0treè0r "± ";J ERof a ² Å
„property5j’).  This bë rshould 1r 
Rretur2§(computed)5€ ç Ç hð w 
Pexcep“A"`   NotDQat ifL²âs found througH¶ ÿnormal mechanism,· 
Ô k Ø~c|A.  (�/is(	Pintenû Ïal asymmetryv 
Œbetween ~ 0and sFB)".) iqŸdone bothéð   efficiency reasons and becaÿuse otherwise '
  ÿ'"__getattr__()" would have\n4 ò   no way to accessj  H ÿ	ibutes of the instance. ƒ ÏNote that atu 
•least forV ÿ variables, you can fake totalr ßcontrol by not ùinserting any values inÜ ÷ r ïdictionary (bus @teadå { @themu !anÑÐ object).  Se;¬ã›èÁmethod belowSaÑöÂactually get`­
dGover!/.;  ö .±Î ¿self, name)=  ñ   Called uncondi© é °to implemenœ!trr äÛ  esOo 
%‚class. I3 ß also definess ÛÖ,w 
 �°latter willûT be cý lÈþj o 0 ei`u 
 ^ ós it explicitly or raises an "AtYError".í RThis ¸s 
!shÄRretur©§(computed)ŠÌŒ v /anm 
¿ ` excepC¡. In order'Ovoide ÿinfinite recursion ix tV, itsªa}  aalwaysä}  Qbase yî 
~Q withAsamezã 
 (/ity oneeds,/0exa†?, ""["0   †:ý  Wœp may stbðbe bypassed when lookL/upsspecialésx !asˆðresult of implicit iÿnvocation via language '
  Ï'syntax or\n# 8 Ðbuilt-in func_ ÿs. See Special method lookup.M  ÿ'   For certain sensitive attribute accesses, raises anÙ ïauditing eventw 
Ð"object.__getn ð__" with arguments $ _" andq o"name"û "€ s€ p(self, S �, value)Ã  à   Called when/ ß MPssignÞ 0 ise�empted. â @This, cS v 
ñinstead of the norm%ñchanism (i.e. store! ã y  in% q qance diŸpary). *A*´  † ü   ,o *Ž 7 w 
* � to be aQ ed /it	"–   If "__	P)" wa‚#tob  ` 0an cò ¸ï ?, ipshould Ø i´ base classØ DCsame—x Ïfor example,=
 Txï øS#N° QÔ 4an QÓ 
m-Ù Q„N1, "b#W0del'__WP%MLike¢@but ÷ f ^@dele'e ¿"Q
U ¥1.  �­@onlyvih   ¯ed if "delt @obj.ûO" isv 
¡meaningful×  ùM7  Œ/ŠÛÀ
             ñ'   "object.__delattr__" with arguments$ …" and '
= 	 ¯'"name".\n!  € ¯ir__(self).  ò   Called when "dir()" is c son the p / AÍ ÿsequence must bet 
•returned.r �convertsn   U Oto a{ @listis 
 so^ /ito"Z ðCustomizing module Ïibute access= = =  €Special _€s "__get•  ¥ �@"__d7ß" can be also^used too cð = toks. TheŒ ÷¿function atv  –mqÁlevel shouldtept oneŒ` whichÕ 5 v  .o of anu  FÛ2nd §²ÿcomputed value or raise anXQ"AttrM _Error	I– XÐis not found (p§� through{  onormalë Álookup, i.e.ÌðK¸ `__()", æ 	~i¢searched isÝ­ ct¼abeforeZ o\6H@, it#øÍ (ó! @  FPresulI Z7/edŠ"FÀ*
ý%noü s,
Œ / a® ƒ�of string¤‘at represë  s~ossibles #on®O. Ifx ]  _5is é €override… ¥e standardG—],s r—À            �    '\n'
	  ÿ&'For a more fine grained customization of the module L ÿbehavior (settingw ðattributes, properti ñetc.), one can sety r Å"__class__" S v !ofì Å ñ object to a subG  è �"types.Më oType".ñ  =�example:v  ß   import sys' 
Qfrom š 2 ¡ 9  2   ò rVerboseN (  ö )Ñ Fÿdef __repr__(self4 "4   “return f'|   {= ï.__name__}'\n"®Ñ 
 \ ” 0set— ,, value¤ ’print(f'SÉ  {P o}...')ž  �  ¦super().__Œ  C † É     '!.mš$s[0%].3 = TÉL  ?NotÍ%„Defining(D"__gŠP" andÐ ! ×Oonly® P  affÈð lookups made us†  ² thï access syntaxÒ¯â€“ directv N f “ÿ globals (whether by code withinu  © C O, orí 	ð via a reference¾= Eâ€™s„ 0dicºary) is{ "un@?ed.x  ð Changed in vers+X3.5: ˜Ú „Š� Ïnow writable‘ ":New� 7� ‡`"__dir5� ‰?sŽ "�See alsoL\ò  **PEP 562** - Ó TSË 	H À             '  ðDescribes the "__getattr__" and !di Àfunctions '
:  ï'on modules.\n%  !ÒImplementing ² _ptorsL = 2   The follow ñmethods only apply when an instance ofNOclas¼ pcontainm  ”q ñ (a so-called *d· !* O )–�appears i¤ æ c*ownerN   (z e € must beE oeitherá 
K Bâ€™sœ u !diS`ary or]  w Ð   afor onW/itÐparents).  In  x 0exaSÀs below, â€œz  ùðibuteâ€� refers toK   hÏwhose name iÞ h 4key$„propertyý ;72â€™_ct__"S"qobject.Ö…__(self,§!, m o=None), B   C�kto get)e Ò " (Üet 
paccess)2.ofx$atm �p 2 . 	 op4al 0@argu›" iCï r  , whileå 
*½ *Y  L thak/wa/¿ed through,x 
@or ""Ö ®– Š N ôî $»"ƒ   This ÿÁshould returÝŸ computed›Pvalue0�raise an
Q"Attr±Error" exce÷É %ñ**PEP 252** specifiq atá€get__()"_ àOablef2ith_r twoÉ 
›ðs.  Pythonâ€™s own buiÿlt-in descriptors support '
  'this\n ÿ"   specification; however, it is likely that someh 	ßrd-party toolu IhaveÇ a ÿ	require both arguments. u ïPythonâ€™s ownç 
ð"__getattribute__()" implee ý ÿ always passes inx 
¡ x 
ówhether they are å Ÿd or not.>  ÿobject.__set__(self, instance, value)?  ð   Called to set·  5e on ani $ *s **!ofC _ownerw 
Pclassv Ra newÃ 1, *Ë *%"ô   Note, adding "/ )"|t"__delechangesÉ ¿the kind ofÈ 
œÍ wâ€œdataíð â€�.  See Invok› ŸDé/foA0morS_tails0"U
XQ/Y TlT†
p T"7The÷a"__objN 0__"Ðinterpreted b0"inc¿t" module a * 0ify qs p where É ¤Ï was defined±R(settI 	 appropriatè can assistÿÐruntime intro›  #? oft rdynamicy¡ýñs). For callableswpmay ind“ ÷  atuƒ — ?theu ñgiven type (or a sub`)ÑPexpecÎ&or¢a_firstq @posi1%alÌ� (for exax2, CÀ isàæ À   'attribut¯e for\n'
  ÿ'unbound methods that are implemented in C).E  !ÿInvoking DescriptorsH =  .  õ In general, a d{ ÿ is an object attribute with <¯â€œbindingq ÷behaviorâ€�, one whoseb ÿ access has beenm Ôoverridden by¯x hin theâ ðprotocol:  "__get__()", s ë ?andl ‘"__deleteR Ñ. If any of tí \ Wpdefined•ë ‰O, itw Ùis said to beÎ«"T/dfault ¶§ ¬ ist Oget,Ã s 2or Ä  ¤` Ffrom‡ÿâ€™s dictionary. For instance{ Q"a.x"Pax ðlookup chain start‹îP"a.__w °__[\'x\']",LnN �"type(a)9  °and continub pthroughP <ÿ base classes ofw p" exclu‰ a< " However, i¾ e )ºed-up value(Í × 7 ñeÆ …)oÃ Python may ýe8"de¥u ½µ
i€Q ‚ ? hoñÀstead.  Wher& Ÿis occurs·rè £precedencewødepends on which­
m w– ?ed è 
0how6!y 3 ocalled"  *Qpoint¿ S ca¯'½ 5!, «_. How7"0rgu‹sš gmbled BE"a":E À            �    '\n'
	  Ï'Direct Call% ÿ)   The simplest and least common call is when user code u du /lyr 
ðinvokes a descriptor method:È ÿ "x.__get__(a)".L  ÿInstance Binding* r   If b'   to an obj;iE p, "a.x"ø ÿtransformed into thet 
 Xö: "type(a).__dict__[\'x\'] #, # 	$_Class!  c: C, "Aû ã ß 
/"Aõ None, Aò $_Superò !"a×4an í` of "sD  ",Æn   2 ?(B,ô 
ñobj).m()" searches "obj.__mñ __.__mro__" fory q Bbase£O "A"v 
ñ
immediately following "B"îtÙ’/thÛ¬@withž w 
 ?ÜmÜOobj,A	
$6For×âsÕ€ precede"(of‡p "ïcation dependsý ˆon whichX ßøs are defined.  A# {  cat  3 ? anZbcombin¤  ÅD�)", "__sQ)öl ñ "__delete__()"./itë ƒdoes notÔ  h ¹ u [`accessr]	ÿattribute will returnw  K <°Àtself unless  re´¯a value inn P E ?â€™Ú% ®bionary$ A ‘ âsp �?/orì 	“À", it is a dÿata descriptor; if it defines '
  �'neither,, Ois\n( za non-de Û.  Normally,  s “ _ bothp ó"__get__()" and "__s , while‘ u ßhave just thew ªmethod.  Dö `s with’ ¢ 6
º x p(and/orU adeleteú )¿ÿd always override aÑ!re`¿ition in anv Àinstance dic0 ÿary.  In contrast,e_can b^¿ tden by ~ /s.¢  rPython ¥òs (including those decorated®¢‚"@staticH lt s"@class, à) are implemenj &as0q £�s.  Accor¶ ?ly,x * bâeSe	o.  Thiÿallows individualv ðto acquire behaviors that differ from oI˜Ä /of„Qsame i"ÐThe "property?1funÞ< is®a¶¬Š ÃÔ ª6not²&th=? ofÂ¼ t µ Ÿ__slots__# = #  *a !* fð us to explicitly”l4+omemberªO(likL&Aies)	@denyXP creaÍ e0"__Û!__Ùœß*__weakref__*â (unlessÒ  djÏor availablew  žŸ parent.)w  ÐThe space savÿed over using "__dict__" can be '
  ÿ
'significant. Attribute\n0 Älookup speed\ D ÿly improved as well.M  ÿobject.__slots__*  ô   This class variableµ  as·  § � string,$@iter; Ï, or sequenc#S   ofU fs with} ÿ
names used by instances. } **ë 
õreserves space for the declaredƒ _s andn €prevents< o 
ðautomatic creationõ x f ß*__weakref__*t  « Oeachp 
+N"Z ƒNotes on8m- h  à* When inherit½cfrom a· ?Gout š ,�N
ƒx  S žaü È :r ÃŸll alwaysw ßbe accessible¥"`* Withì aÀ¸,. Ã?not×	Þ?new	^  s Q ‘listed inbsp definiç«`Attemp=ot 	œ “ to an unu Š  #o raisen"ª¯Error". Ifs 	‚dynamic { @mentæ7new¡is desiredanë?addl 	4"\'~0\'"ç  N7 x pshk€p 	âƒx.
±“¢ƒ,meK 1/ngº 	á 1 do‚�support "š` refermsH*itÀ           'ÿinstances. If\n'
  ÿ'  weak reference support is needed, then add E P"\'__H °ref__\'" to6 w 	Asequq Ðof strings in6 ÿ
 *__slots__* declaration.O  *N ñare implemented atq ïclass level byç �creatingn ÿ$  descriptors for each variable name.  As a result,n • ¯attributesv 	àcannot be used~òset default value� v « s> Oinedw 	(by^±; otherwise4 WÂ _ woulE�overwrite“v 	cp assignÍ$`The ac^X of aÏ {pot limi8	÷ù Ã 	0wheŠtX 0defh/. }   edparents´ ÖPavaildw 	‚in child¡  ƒHowever, 1subµßes will get ax ¯"__dict__"u 	0andÚ €* unlessçcy alsok & øb�(which shLw 	Áonly containxsâ€ny *addióAal* q )>$I31Ã  Ø R × Ãoa baseJD 5¢Ü 	¥v dµ2thed L Ø  ^H�inaccessi—¯(except byv 	Ðretrieving it êà directly fromØŠ | ¢ o). ThiÖ
arender)P meanz !of` ¦program un?I>v Ÿfuture, aä 	�check mayL2addM`preven,/is+$yNonempt1` does ¹Awork/e]Orive- iÈ À       '  â€ÿ&œvariable-lengthâ€� built-in types such as "int", '
  ÿ'"bytes" and "tuple".\n.  ð* Any non-string *iter£ ÿ* may be assigned to� ¿*__slots__*‡ $òIf a "dictionary" is usw ƒ  f _, the� G _ keysÿ `  willæ k !asW  Ë ñ names. The values of eu ocan bew 	o òto provide per-attribute doc� � %at¥ { precogni./byw 	ò"inspect.getdoc()B displayed ˆ�he outputò s "help()v%³"__class__"añ	ment works only if both ' oes havñ ?sams
>¤$ôMultiple inheritance with m  ;pted parÐ >Õ )0, b� 4one\ ‚is allow#
Z`s crea¡ ( Ç 0s (Wòother bases must‰`empty ' ¿ layouts) -�PviolaÙ‹
ÿraise "TypeError\% KnÉEtor*J8forD Î?n a¶ ƒ*descripD X	V b @each: =Mstorâ€™sGŸ. HoweverÝ : ®y 	Ú$2an �|  íE,
 '+ õ-references': 'Aw s  �/'*  2  5An �  …  ·Ãa primary foì/by³ž aperiodaÆ:~  &  œ uref ::=” ï"." identifierH À      '\n'
   ÿ%'The primary must evaluate to an object of a type '
K ÿ  'that supports\n+ 	óattribute references, which mosty ¿s do.  Thisz 
§ is then{ @skedß pproduce3  � ²whose name O y 
£identifier§ | s ñtion can be customized by overriding– B	`"__get¸ ß__()" method.€ @If tL 7 ñis not available,y Qexcep§ ƒ 
AÆ�Error" iöóraised.  Otherwiso Z@and }en3the
P/edz ‚determing^ ´.  Multipleû@ionsƒ ú 	 A s#Ixåá may yield difúì ¼ò,
 'augassign': 'Augmented    ` state
 p /'* © '  w pcombinaÖ, in a single— ,µ'Bh   I qry operQ  /aní :@    D   a5_5�_stmt ::= `target
 .op¬ ò(expression_list |³_ )y [ & y -& |r^ref |… rsubscri†Ÿ| slicingw ,opr   w ’"+=" | "- * @ å1'"/ #"/ % O**="| g  R| ">>/ "<< & ^ |D W  €(See secc! PŸqies foržÐsyntax defini$ ° ”NlastK_threeg  �symbols.Í/   An1 w
Ž3}  (Ì~, unlik7'normalf  ²P s,/ ¨ be–¡unpacking)0 ú ÉÐexpression\n')
  ñ!'list, performs the binary operation specific to! œtype of 'M Íassignment\n "on= "wo[ ’nds, and 6 | dresulti Žoriginalj target.g  BThe  ÿ is only evaluated once5 H  `An augÌ e£   € expressþlike "x += 1" can be« Ïrewritten ash  €"x = x +C ðto achieve a similar, but not exactÏ Îqual effect.p Ihj  Ï 0verÁ _, "x"&¾ Also, whend Ÿpossible,g   C0act¤ C$isdþed *in-place*, meaning thath `rather nj  Pcreat= Ça new objectS  X ¸5,‡>oldo B j  ÿis modified insteadG!Un&cnormalë H ü_ s­¦ E_left-¡  hIÔside *before*I …e right-( n.  Forïexample, "a[i]j  ò+= f(x)" first looks-up0 "]Dn it Bes "0  ¢ Ð yi  H0ddiƒ)plastly,^  Se3@back8¸ "žAWithiPexcepj  Ø‘9�o tuplesVtmultipl`s>Oin aË  Àsingle stateý&� done byrP I s¾ Ô1ledÈ Îsame way as t. Sf/lyËw ™Ì’ behaviorÞ ëWÎ  &/ed ï   ç a i ø i  ‚ ~ ìs& )Sòs which are attribute referencesû ž OcaveÓOabouBclasg a7ancb ps appli‡Ïs for regula¿ » dÝ ð,
 'await': 'Awaitõ expression\n'
  +'*   ð%Suspend the execution of *coroutine* on an *awaitabl œbject. Ca ÷only be used inside aN P funce +*.‹  1   q _ê a ::= " ›" primary0   New in ver$@ 3.5p ñ ,
 'binary': 'B
 ð arithmetic operaž sO  Wf,  BThe v l Q haveƒ`conven�  alè Korité à 'levels.  Not7 pat some¶WtheseÆ ø also apply to certain 1l 'non-³ Ànumeric typek ¡Apart from¨ Spowerh 0or, qre are  <twoQ µ ô, one for multiplicativ³ uors and% @addi M §Lors:  F   mBu | M"*"  $@" |N  iY ?"//F   F %E /  a¸  Î #|  &"+¯  - L   š (�5on)Ûp yieldsá€ producth;itsE�argumentsg�  'd  ð must either both,±numbers, orû. - ,bek t‘ 'integer< Êo_ k bÁsequence. InË ±former case½’ Ò”@rtedB�a commonp nÎ+ed¬ @toge� ‰ Elatt‰ § p repetiq is per° �d; a neg2² 3 dfactorº”an empty ^ ‹ K CThis 0can¥ñcustomized usingHûspecial "__mul__()"<and` E"__r. nmethod65  Fw"@" (atž0is ü"ndžxa\atrixG 
èDÓ builtin PythÚps impleÑ& t/or=x	” Û €/" (divi®)YXq(floor  Àion) operatoörs yield the\n'
  À'quotient of öir arguments.  The numeric ¬ are firstM ðconverted to a common type. Divisioni dintege— ºs a float, œ Mwhil± floor dN ãresults in an e ;×   ; isc =thaÆ ö of mathematicall AwithN 1â€˜‡ �â€™ functØ Rappliû h � &. áby zero raisesX T"Zero)kError"° Pexcepo .|  This opera/ ñ	 can be customized usingw üspecial "__truediv__(){ <andd 1"__2 methods� ãe "%" (modulo)© "or©áremainder fromª ÷
),ofš #th£·1 byC osecondÜ

] ê# AÙFight€ è­ ÷é†–@ mayÊ2 Â
® MpoinÒònumbers, e.g., "3.14%0.7" equals "0.34" (since   
` Œ"4*0.7 +Ä A ".)­ ÖÕSalway… î PKsameéLsignd ras its Â^ and (orp)êàabsolute valuen r 
Ì ,isb ñstrictly smaller than7W ‹ 
_ ?[1]	CfKand Ass`connec^Ë
o œfollowingÕ úidentity: "x == (x//y)*y + (x%y)".  FV„  í
i Lalsod œ Õ†built-in"Ä"divmod()":  Œx, y) ==Q ¥ #,   /[2KqIn addiî to perform" 	R ¯ onÚ ! 
ä <"%"’ L orE ° overloaded\ ; ng objects‚ Ù~old-styÙA  µ 0att¸ (g `known üqnterpolÑ)Âªsyntax for° À 'string forö+matting is described in the Python Library Reference,\n'
  ð
'section printf-style StrY 3Ford .7  ñThe *modulo* operaV ðcan be customized usZ  £ Šspecial � ¼"__mod__()"d omethod‹ °floor divisÝ ‘ 1or,§ ¦   1and Š odivmod‰  2fun5û*are not defined for complex numbers.  Instead, convert toõ aë AfloaÜSpointL <…"abs()" Š ïif appropriate$�"+" (addiª)q yieldsðsum of its argumentÑ <The±  ð must either both & o @sequ‘sa  
}=samd AtypeOœ ²former case×e  •j edla”;monu O Ç 
Qn add=  geÉ 2. IWIlattu Ç -ar± ¿concatenate·#is… ³:R"__ad,Ü <andÛ E"__r. Ks(¡-" (subtraö+3difc Ñ 2
Ñ!t  ;vnumericf ÆTfirst6� Ì ¾K ô /ThT!1sub€T4 t ð,
 'bitwise': 'Bind Äs� ? '* *  @EachZ +nthree p t has a ‹tÕZorityÊ � 'level:d  ò   and_expr ::= shift | 7"&" E 2xor6  E R %|  5"^"P A @ † 6 $|  5"|"M @   r µ óV0ANDo É»|, whichN òd °be integers÷0oneO Bthem" beÌý object overridingN  êðnd__()" or "__ran÷d__()" special methods.\n'
  ' ý.The "^" operator yields the bitwise XOR (exclusive OR) of itsN ðarguments, which must be integers or one@ Ethem  +a © mcustoma ò	object overriding "__xorÿ  or r $|3(in@) ORË <itsÀ 
Ä  û N 

 	 ò ,
 'bltin-code-^ ±s': 'Code OiâL* — (  	l | Á are used by€PimpleO‹ation toee ÿrepresent â€œpseudo-y 	ðcompiledâ€� executable Python ñ  such as a funcƒ 
¥€ ÿbody. They differ} 	FfromU ÿ pbecauseû üy donâ€™t contain !| �reference#Othei} 
cglobalõ  Xpenvironi=.  ’ô freturn°_builtv
Cin "z ¯Xpand can*¡extracted &~ = @q	pthrough[i$ áð__" attribute. See also% i"; �" modulea—‘ 	cAccessÀ R  � ð raises an audit  evÓ"ý `.__getÍ ?__"x 	Uwith œ ?  " ~C""__ˆ "Ö '9” Ñ ^ edû`evaluaÝRby paÞ °it (insteadgaÚ 	ãsource string)
  "Ü k  ~    ©/inç^Dã P ^ÿstandard type hierarchy for more… ainformþ ”³ðellipsis-object':ÿ 'The Ellipsis Object\n'
  .'* 2  aThis o{ ÿ is commonly used by slicing (see › 
S* ÿs).  It supports€ ðno special operations.  There’ ¯exactly on€ eIÎ , named "Ñ" (a built-in;  È d"type($ O)()"Ïproduces thez ¯singleton.4   It1·written as Þ €or "..."c ò ,
 'bltin-null-0"':�ONullŒˆ™ ' |breturnwAfuncß that donâ€™t}@'exp )G / ay Zvalue§ ‰ý'¢ Qy k›o "Noney	   u
'qo'same g¯	_   R 1RsS3ypeO		QA   0 'Tl c°s representŒu variouê ¦  f/AnS" 'J Pâ€™s 0 / iÁ 
Sacces56theLË M%)"Þ/arÓ'‘	51 on¨  Ø  Yò standard module sÁ�'definesþ_s fory 	Eall c 9 )sdÅÁ s Åölike this: "<class \'int\'>yaooleanoB LÄ 	kO$  ò   or_test  ::= and | E"or" B Ðand_test ::= ânot_test | and d"and"  X\n'
  5'   ÿ ::= comparison | "not= 	O ðIn the context of Boolean operations,ž ð also when express  Ÿ >aree qused byf ñrol flow statements,ƒ ýfollowing values are_ ¾interpretedg Àas false: "F ð", "None", numeric zeroå ƒall typeÜ ^emptyQ qstringsÿ  "àainers (includ« " `, tuplN nlists,K 0dicL0ari& 2setV `frozen ß).  All other)ðtrue.  User-defined objects can customizev‚ir truthq ob Qproviý þa "__bool__()" method.ü  3The`#orµðyields "True" if i#0rgu## iÛ,£ ëd IOwise’ Ø1 "xõ y" first e”�ates *x*;Ÿ ?*x*– >its’  D e5 ’returned;î ¥ A, *yQ j d�  œ`resultnmQ h 4is b ü $?or û  i,§˜ ú ê üie ú 0Notaat neiy�r "or" reâ ct,$1and;Ž ?the/ � 4 to•Øç�, but raz ) }he last_ ña'p.  Thiscðsometimes useful, e.g.,º0"s""  a Û -ngi Nthatd òshould be replacÒ“a default¸ ^ RÙgf ó "s or \'foo\'"  rdesiredh £.  Because>0hasck Žcreate ai 2newK  Â/@s a Ï þq regardless5 ‡  5  j ñ˜ð	 (for example, "not \'foøo\'" produces "False" rather '
  ñ'than "\'\'".)\n',
 'break': 'The " Ø" statement\nD /'* $  1   U ”_stmt ::=e (  Š û*may only occur syntactically nested in a "for" or "while"P Ùloop, but not9 €function< Áclass defini ¬within tha Q .e  ðIt terminates the nearest enclosing G p, skipp  %  op{ )al¿0'"eÚb ‘clause if^  L � has one› f36 &is« Dd by¥,Y Ücontrol targeÿkeeps its current valu† DWhenj „ passes g Qout o¦ 7try’ “+ a0finö  Å Dat "%   � is execuD�before reG P leav�	ý;the ; i H ’ able-typesQ`EmulatG  Š objectsG £_s2  i 0.__{ ð__(self[, args...]ý
… 'P °   Called w´ §€instanceG0â€œi ´edâ€� as a V;�Gi ÿ    'this methodw i�±ed, "x(arg1È ò2, ...)" roughly translkoQ "¡6(x)xQ 1Q ÑÈ ù ³ª
e <0'A       ´ (e.g., a *+/*)Ü‹possiblyn Àempty series)P*argu³;s*:+  !  • ‰	  œÔprimary "(" [R Ú_list [","] |yücomprehension] ")‚   u™ G n m !osf4al_k sg 
d þstarred_and_keywords]Ô Y 	  ´  4 e > |y    ` &9 Ö p$ À ::= positioônal_item ("," positio u)*\n'
  <'  #  ö::= assignment_expression | "*"  Q ðstarred_and_keywords Q (: 3 |  ± )J Œ   Ü N  ñ 	Þ 	_ û    `s_argué 2s  ª  ™ ó 	ô « © M ‰," "**" ¬ R¥	C  Tßidentifier "=˜]RAn opð trailing comma may be ñ×ent after the)K andQ ¡  J°but does noF AfectG «semantics.C  Ts ðrimary must evaluate to a callable obj[ Ì(user-define� @funcí Çs, built-in  ¦methods of V ‹s, class›  : ( ° instances,$C all  Ps haveaL 0"__Ë b__()" P E areà u).  AllY{s) O %�d befores a ð is attempted.  Please refßAo se#O F: YKBs fo`syntax7ÿformal *parameter* listã$Ifß Ô },¾ yæ û first converted toª êL 0, a® �llows.  FD 1, aœ  · êunfilled slots�iõ@creaz þ ô ó  b  If² !re³ N2­ &â �placed inC ð Nš �.  Next,zKeachO }V  Qis us6  dŸ1minH  correspondª 1 (iÓ M  @same`  ž	Ða -R name§ < m § <Pso onþU
£‚already Ö ê "TypeError!ceô @rais‚Otherwis� ¯  qe) ä ´ > 
¬ ¼ ,u  7ºit (even if¯ ;the` ô U ¡"None", itL s \  AWhenO‡ QQ À        'beeñn processed, the slots that are still unfilled  …with '
  i'the\n ñcorresponding default value fromr €function  0ini *. Z "(D; _ I s• €calculatÇ ªonce, when` "isc »ed; thus, aQ ñmutable object such as a list or di« `ary usS Ö 	ÿ Kwillb óbe shared by all callpõdonâ€™t specify an argumen4*ors Î í ðis should usually be avoided.)  If+!reL	Ä ;anyÃ  ] às for which no` v Ì i—a» »"TypeError"a Pexcepò is raised.  Otherwise¨’#f ŽŒ "is—
Â s`  çYH  Ä    �..  ð **CPython imple�a¬ ½detail:** A 0mayh<vid"”built-in ±s whose posúal parameters do not have names,UKeven± iÛyÚ0â€˜6 Tdâ€™ ô @purpq aof docnÑ R, andÚR  ‰�efore can�  ÕRuppli×`keywor´3In . µ isÑ h	 <cas œ ired in Cžúuse "PyArg_ParseTuple()" top Ã %ir^sô	mù žJÅnGmformalŒ Ë� ¿G, a   p, unles“_  us€ zðsyntax "*identifier"–€present;aPthis – µ*atÂ w ¿ ¢€ receive¡ t‘„ contain€  Ô (ssÞ	Ma 0(orbempty Y Øpre were|[ N )áCany ¹Q doesqÉ _a= Üø ¯  eÎ"Q Á Â'Àormal\n'
     ò4'parameter receives a dictionary containing the excess keyword\n'
 I ô   'arguments (us2 + 1s a7 Qs andK . P valuw *s\O  correspondL & ø), or a (new) empty®  if[ ˜re were '� +no_ 
Ë  � +s.(  Ic ð syntax "*expression" appears in‡ A funHj call,� "8 b `must eð òate to an *iterable*.  Eleg@fromj 4se   [s areQ ptreated‚!y AaddièTl pos 	P  For` 
»  Î b õ"f(x1, x2, *y, x3, x4)", if *y*Î sÏ û sequence *y1*, â€¦[*yM*,d òthis is equivalentM  � Ÿ with M+4É 0 *xg 	=*x2b Ž � ¿ *x3*, *x4*A(Ö o#­ Ñthat althoughK
2G	› ;mayû Xô *after* explicit‡¼@, it$0pro¨*edº‹*before*_  Ù§K   (©jany "*åækâ€“ sehlbelow)0;So:u  ü   >>> def f(a, b)1 a   ...nRprint& G ,..} \ Þf(b=1, *(2,))8 >2 1  ” ?f(a8 	ñ Traceback (mostH!ntô_ lastÉ ð
  File "<stdin>", line 1,;Š<module>Ž ô"   TypeError: f() got multipleF=forx 'a'\n":1 2ƒ ' Il€unusual z Mboth ó
ü	õ	a  to be used §Asame[@, so ‘practice PconfuŒZ doesý;not_ \arise-$ ï
ð	I ñ ã± *mapping*,' xKŠof whichÍ å
Ø	×Àents.  If a õkeyword is already\n'
  ô
'present (as an explicit 9 ùargument, or from another G »unpacking),a ða "TypeError" exception’ {raised.1  ð!Formal parameters using the syntax "*identifier"¨ ("* Q ðcannot be used as posi” 4al ï ` slotsL -asQ _namesÆ ð Changed in vers�3.5: Func{ � calls acú any number of "*"m;andƒ U"**" „/s,Ó ús may follow iterableY B ` ­("*"), and	W !diÎ 7aryŽ 
d (¬ )/ðOriginally propošìby **PEP 448**2 ¢ ABñ always returns some valueñ	sibly "None", unless it ‰s¨ +anb »².  How this\  Ìñcomputed depends on£@typeÅ;theP  òƒoobjectà  If© [isâ€”H  a×³r-defined fa:' ñ   The code block for² 2  Ö @execÖ Q, pasw it% M 9Rlist.] @firs/ ¯m pwill dod Jbind{,   Ÿ  to‹  z "s;“¢is describp	¨!se¡À ‰9rs.  WheÈ¼ Rs a "i"P Rstate9)@spec¡s´ 7 >!of x	±  &¥a built-inî ¹omethodø`result3up Ipinterpret; see BW  s %	  ¬€èsý   l"d ¢ ;‚a class 'Ð  ÓA new instancm#at6 iih I Ÿ q  9€rrespondÞ>uses ^ ¿€ed, with`	<º> EA tha¢�one longe a�;  * B m ð : the\n'
      ð!    '   instance becomes the first argument.\n'
0  ' ua classJ :  c   The% ñmust define a "__call__()" method;� �effect i� )n  >theb ó same as if thatM P was b  edÅ A,
 '¬ Q': 'Cµ ‹ kitionsU *    Aá Q ç $s !0objÕ €(see secu 	Þ  ŽKdard_ ü type hierarchy)d. "  Ž 0def´ñ::= [decorators] ""% n;q[inheriZ] ":"tOsuitv 5  e T"(" [7¯_list] ")"ž y  9 «identifier,  f ñis an executable state¸y¥ 	k   ` Àusually give¹ # s of basÂ1es ÁAMetaF¬es for mor!0advZñ	d uses), so each item inéa úshould evaluate to a€j ¬ Oñwhich allows sub+ aing.  ã es without(, @, byÌ¡ault, fromº " "‹ ›"; hence,©  �L FooÈ ®l   pas�E ûis equivalent to  s (­ C{ Í0â€™r5ite©‡ edßSa new™`ion fri =ž ñNaming and binding), us  D ðly created local 9Qspace4 Øoriginal glob0 B. (Uâ,Ä×û contains mostlyž 2fun«Ú‚s.)  WheÃq†finishesû ,Í,itÝ7%ýis discarded but itsü Úis saved. [5]b AÄ £  ù¬Tj ÷ñ µ ™ Ù  	7 ù`  1"ndX ˜ ± N šattributeµ !dih0ary¬qrú Á 0bouk bo thisÇß –3° À        'namÅespace.\n'
  ' ðThe order in which attributes are defined  ûthe class body isM vpreserv- 2new1 ùâ€™s "__dict__".  Note that this is § ‹reliableb öonly right after “ ñ is created and * 2for€ "esl 	d <wer` í Qusing]  Ïition syntaxQC Š  4 òcan be customized heavily c AmetaS/esY 0es R @alsoW Pdecoró ó: just like when   Æ 	ô @funcÍ +s,Z ¿   @f1(arg) 2 Æ œ Foo: pas0 û	is roughly equivalent to'  "  Îf     3 = » Œ(f2(Foo)Ä X  `evaluap rules < ^JPor exáBsion  ksame a½;forb w˜`ors.  x `result t¸�bound to|S?namÆRChangw0ver¢ a 3.9: �ies may/û  with any valid­ Æ"assignment_ô á". Previously,  ýgrammar was much moRñrestrictive; see **PEP 614**dodetailþQ**Prop !erM±note:** Var)s©¿	a© mý;ã yðshared by instance¾I 
¹A V ¸`be setK‚a methodŠ`"self.é  =“ ue#CBothñ,an¥Š ¯�accessibl^d È B notÝ	6â€œ{ L"â€� J%an÷ m @ hid!  4Ð 	n  à ¬³ ¿Rway. ½r úPbe usãs|defaultw Å* T, but‚ utiws-!reeJleadÜ punexpectÈ ªDescriptor³ #to¡OvËŸ`differPimple�Ã2À          'SÕee also:\n'
  ' ý  **PEP 3115** - Metaclasses in Python 3000: ÷"   The proposal that changed the declaration of m[ 9to — ?the` òcurrent syntax, anZ ôsemantics for how ´ OwithJ } ûare constructed.0  #!29#C½ Decorators0 Radded§  < q.  Func# Ý 	omethod_ d} ð were introducedµÓ08**Ü ö,
 'comparisons': 'C 
_ )&'*    æUnlike C, all r B opeSAhave&Isame„ Ÿpriority,m àwhich is lower|n tiÿany arithmetic, shifting ori kbitwis€… » •.  Also uå Áexpressions ù Á"a < b < c" Þ ÍP è ’interpret.K is¦0ven alÚpmathemaúÙH ,(  Ž    ::= or_Â   (©_è $or /)*J 	/  J �"<" | "> !== > < ?!="O ¸  õ| "is" ["not"] |
 ?"inG \ ãð yield boolean values: "True"ÿ "False". Custom%K*ricYµ [ âúhods* may return non-z 0. I¬/ish Ccasev×  wi\ a"V ²()" on suchØ  &   é €contexts¸ _ 6`can beÒÿined arbitrarily, e.g., "x < y <= z"Í iz pequivalÙ$toE  þK ‚, exceptÑ0"y"èM eÊŸated onlyÐ ’once (but0th aAs "zU Fnot F !atºBwhen– t  � k 0foužo4fP)x`FormalZ if *a*, *b °c*, â€¦, *y 0z* ½e{ 8¨ À          '*«op1*,\n'
  ÿ2'*op2*, â€¦, *opN* are comparison operators, then "a op1 b op2 c S  _... ym öopN z" is equivalent toT 5andZ   K  7 h  ¯z", exceptm ñthat each expression{ ÿvaluated at most once.D  QNote ^ 
ÿ" doesnâ€™t imply any kind of Á  fbetweenp @*a* q*c*, so{ ó, e.g., "x < y >Wÿ perfectly legalu (thoughj ÿperhaps not pretty)S HValuPs& = &  6The¤€ "<", ">  == > <  DC"!="Þe@the  e¨ ñof two objects.  ~  1 do9@needÕ0hav'_e saml /ypw’Chapter Oo ,¨ Átypes states £  † aë ç ? (iuPaddit20to ^ g `identiú C Sof anq  an oratherÂ€abstract> r ñin Python: For example rea ¯no canonicã_accesÁ¦method for´ Bâ€™sMz.  Alsok r¬0rem¬Å 	?theÛ ! €should b`nstruc‹ÿin a particular way,µ öj  LAriselÿall its data attributes. CØ g  ¿ò an ª !no'@of wqA ô`.  One¹q �think ofn ðthem as defining‰±e Andirÿ¯, by meansm  Æ?heiŽ Iûaã 
€Because ˆ =sU(ž S or iª R) sub" #"k"“UqinheritqdefaultâÀarison behavûior from "object".  Types '
  o'can\n ðustomize their comparison behave ÿby implementing *riche = l ómethods* like "__lt__()", described in Basic c™ oation.P  ¶The defaultÂ Èfor equalityã ÿ ("==" and "!=")Ô �is basedm  on70 idQty of �¯s.  Hence,| � /off áinstances withb Fsamew presults=æ ,Ö d  ! j þ;of x ”differenty Fies { Q $inp ¡.  A motivÒ “Nthis­!isã ¼  Pdesirª/atn Call |ñ should be reflexive (i.e. "x is y"Õ Ä _"x ==ü?y")zAË IordeK€("<", "> 2<="� ">sois not~ Ÿprovided;ì ðn attempt raises "ýPError
m] ïn ”@lackåña similar invariant asÔðH   ³~  ^ tÃO ¶_, tha2
±l ÅÂare always u±P, may=¯in contrasr _to whŽtŒ’will need¶ áhave a sensibl«0iniä ú ½PvalueÔÖ  -¨l�.  Such ‡ o\ej f ¯Êðin fact, a numberÌ ƒbuilt-in� r Odonen  å~ E`follow£ElistVP¾   §  mœ  ?mosd`importñ
á « 1* N&s€ F snumeric/#(N  Õðs â€” int, '
           ²'float,\n'
  ÿ'  complex) and of the standard library types @  Ã"fractions.F
 "J m ¢"decimal.D �" can be† °ared withinC p across‘ /ir| • ×  H  ; q restri¤ Q thatk ÿlex numbers do not supporti _orderÒ  ?¢arison.  W½  CdlimitsQ«   involved,™ yj N el ò
mathematically (algorithm ‘) correctEPout l@/ofj ¯precision.m  P  The-2-a->‘ values "c‘(\'NaN\')v  2 q ñare special.  Any �!edÇy eaÏ_ to az 5not¶ l Ì ð is false. A counter-intuitive implicaò * Q n  s á  Pequal¾  ãðselves.  For exa¢Ÿ, if "x =¾ ‚ , "3 < x",5 2< 3” A A= x"x ?all+ÿ ¯, while "xp !G €is true.°is behavior ÌBlian�Ÿ IEEE 754ps* "Noneº @NotI	bmentedÂ psinglet¿  **PEP 8**Õ `adviseN/atÒ  ± Rfs for ] Ð should alwayæ Q doneg_ "is"q  or k °not", never þßity operators'0Bin¦Ðsequences (inÄ  °of "bytes" “   qarray")|½ b€!¥ç#ey¡L ²lexicograph¾  uptnumeric]•0ele/mString&0str0omp•¡ + ´ èÊ �al Unicodé°de points ()`resultÄ  �built-inR1funÇl ð"ord()") of their ûcharacters. [3]\n'
  ' ÿ,  Strings and binary sequences cannot be directly compared.P  5* SR a(insta] ðof "tuple", "list", or "range")}  z Ë  „ n ñ  only within each of their types,   ÿ restriction that m  � Os don  !Ósupport order#äison.  Equalit9   acrossm _thesei ½  ³ ³ults in ine] ,¿~ 7ing� k +ÿaises "TypeError"õ õ°û lexicographically us° /ofþ  correspond2 ðelements.  The built-in containersìe Õ _assumiPident< Ñ objects are l0 to9bmselve~ qat lets ÓobypassÖ U  ®tests for ~ ðto improve performAl  Åt©1mai ª ðir internal invariaN¦  :  LÍuxbetween—1llegöworks a%�follows:‰  æ  * For two co| t ÀÏ,Qy muså(Y/sa. jpe, haveO  , r length˜„@pair‰� 	ÛÐ $  ó® SA  (9ÿexample, "[1,2] ==Ê �(1,2)" imâ  false becausÒ  z@ is ë1theâ )8* C‡ k4mË!edP2 c0 7 ¢ir first u&@- _,x] </ KO,y]"—!haûÀ value as "xP ¹y").  If a ä˜ßO doe› �ðexist, the shorter cûollection is ordered first (for '
  ¿'example,\n   - �"[1,2] <  @,3]"\ otrue).4  ð+* Mappings (instances of "dict") compare equal if and only š  Otheyj T  havH ð*(key, value)* pairs. Ed 3ityu @ison‹ ?the!@keysŽ n \ ps enforÔ ¿reflexivity 0  O®’  s ("<", "> @<=",… ¿ ">=") rais­ ¿"TypeError"~ ]* Setšð set" or "frozen ƒ) can be¨ /ed1`within® 3ÿacross their types¬ Ò  They defineäŽ Èðperators to mean subset� ­ �superset« `tests.t €ose rela^„s do not† RtotalŒ ãl# �Ptwo s�q"{1,2}"¸ P"{2,3 !rew %S, norÞ sÛ oof oneÙ tanotherE ’Cone  ò).  Accordingly,š Ž  º/noEðappropriate arguments $1fun¯Ás which depeø Sk  Ö?ingØ çÔp "min()A1max	  Wÿ"sorted()" producK"unddj ðresults given a listG¾Ÿas inputs%1  CÉfnY g qits eleL?@* Mo¨  ý’ built-in…9(noOomethod_i7  oed, so& ¨€ inheritò 3Haulte �behaviorÇ SUser- p classeQÀat customizen /irh -_shoulë follow somøðnsistency rules, Ÿpossible: *††  aGae. In ¬| words,¾ À   'identicakl\n'
  ÿ'  objects should compare equal:4  Y ÿ
"x is y" implies "x == y"3  1* C‚ Dison” ÿbe symmetric. In other words, the Ú  Ÿfollowingg Å  expressionü AhaveO ¿same result ò p and "yÿ xÿ G!6D ?!= D !<Š‡ >B #† >† Éõtransitive. The §Ä°(non-exhaus2 )Ëðamples illustratÇa¼!1> yvYy > zÈ  €  È<P +<=Q ?< z“* Inverse¢ ª1 in½ÿboolean negation.ZE½ [¡2† › E+anot x ¯  �"Ò"G >Óÿ(for total ordering]\ 
>a\ <\ 2 ‰last two¦‚apply to¹ "ly» /edà`collecÿs (e.g.É ðto sequences, but Ë  ð
ts or mappings). See alsofO "T_Tß()" decoratorƒ I *P"hashC Eò consistent with­?ityëOáOthatn %  ñd !eib
 � p value,bwŸmarked ask  unG Oable±Python does `enforcåe�cy rules$ðfact, '
          ƒ'the\n'
  ÿ-'not-a-number values are an example for not following these N  orules.i   Me� ÿship test operationsD = /  3Theg àors "in" and "÷   ˆ  mœ �.  "x in/s"f e`òates to "True" if *x* is a ] ‚ of *s*,‚ oFalse"e Ÿotherwisep!"xµÐin s" returns¹A negN h Â ÿ s".  All built-Ô equence… .ðset types support thØ Ðs well as dicÈAary,V_whichÜ ‚ un 0wheý Ï T 0 haFó	given key. For containerœ ¶ osuch ak ñ	list, tuple, set, frozen  | !, e 1lleÜ 0s.d),œ “xpression@ y"þ¡equivalentQany(x  _ _x == q ”Oe ink ?y)".  -pthe strä Ò!by­ Ô,® ½ ' S ConlyÜm  C subm  ó y*†(n 
 ÿÿis "y.find(x) !=0/-1ê SEmptyÓ ÙPlwayspsideredpJbe a� ?anyi uÒ Ê €, so """³"abc"" will�õ•òuser-defined classes ;  lC "__ë_s__()3`methodËÃ Fin y,ä9"y.] &x)& _a tru› íeÆm "ÚRÇ<  «	oûobut dol F Aiter[ A áº(BsomeD_ "z",@ °»l  e 5s zz* p,€producedlƒÀ         'itËerating\n'
  ñ#'over "y". If an exception is raised during the itM on, it P  �is as ifm D"in"U Fthatn .0  qLastly,� ‡old-styl™ � protocolÁ ÿtried: if a class³ definesm ð
"__getitem__()", "x in y"^ a"True"^ pnd only Pthere am Onon-j ñnegative integer index *i* such 0 ~ ïs y[i] or x ==d    Ÿ", and nom 1lowb j ísW "I| gError"¤_  (Ifq Pany oø m S >+ X E )+`The op²€or "not �2is ó‘d to haveõ ßinverse truthæ value oÛš )ÿIdentity comparison–=  R  as "is"+ð"is not" test forŸobjectâ€™:i± :¬ +@true ”)1*x*y b*y* ar…Rsame u /. …/AnÔ O¨ •  ƒÔdetermined usÄ°"id()" funcéh j?noto ‚y" yield/
:'À. [4]\n',
 'ÎÀound': 'Comp ® statement6.'* † ' \  ò contain (groups of)ª� ;ÿymn'affecÿ 1'orV 0rol8 ` execuH� of thosea  2Žsome wayn.'IÓ‘'general,1ð span multiple l½ , althoughm @~'simple2pincarna¾ Ÿs a wholer  ` may b M edd =one3 ‹ «  ƒ0"ifPSwhile‚fp ·  %` tradi¨ -alv  ä:rolß À   'flow conø(structs.  "try" specifies exception handlers and/or '
  ­'cleanup\n ö ode for a group of statements, while the "with" d `allows, g Qexecuª Ñof initializa vand fin c” íaround a blockm .ofe  8 u.  FuncY ‘class defu ýons are also syntacticallya @comp‚ g .  $A K <€consistsoþone or more â€˜clauses.â€™  A˜  g R €a header  aU RsuiteS BThe d & … aR ¯particularÂ G@l atòÂ same indentÖi_level1 JEach� € begins pÐ a uniquely i] íifying keyword LNendsÎ N `colon.Y? isúÿ  controlled by  DK xcan be ÏAsemir þ-separated simple¡ W6 onTaline aW°@, fok  ™jü?â€™ � ,o?it ±  Â ¦  Ž c ®subsequentÈ  ±  ­AOnlyÇ `latteremï"a z ~  epain nesg 9e -;d ðis illegal, mostly becSí it wouldnâ€™t;b”  7@r totch "if"¬a†U"else d _  ^long:Ë  Ä   if test1:
 ¾2: print(x)1  Aá0not»¢Œ° binds tigh˜2thao= in» ?thiKàntext, so that:  �‹0exaë`, eithŽ llzn"fg  ‚ "ö 0)" §¾M/edM–x < y < zG;Q$y)
 z[ŸSummariziÎÈÁ_stmt ::= if ¹¶À            ø  | while_stmt\n'
  '  _| for1 ?try1 Owith2 Omatc3 funcdef÷ _class1 oasync_Ì 8 f7 Ö UsuiteÉ@::= øõ _list NEWLINE |
 |INDENT Ðstatement+ DE" A& o k �compoundì¡  I H 3imp²v (";" s Ž)* [";"]“  ¥Note that ¬ ós always end in a "ý" possibly followedNby ag "%¥".  Also nw ðoptional continua u clauseŠ ~^beginf  e¢ a keyword× QcannoÞ Frt aæ þ, thus there are noQ ñ(ambiguities (the â€˜dangling "else"â€™ problem is solve7oPython  g `requirT ¶nested "if"« þs to be indented).C  0The¤@mattZ  ofì à grammar rulesÞ Ö Í & 0sec€s· nplacesf Ceach®  o,Áseparate lin�   Orityµ a  Ç 
$ = $  Z  Á@used8 � di€al execu :G  Q   ifÍ «¾ `assign1ñ_expression ":" �E  ì @("elH /)*J [¸| (óIt selects exactly one VÄ �s by evalÄ!ngo¹ü s@ ­ bX Puntil"  “f£true (see «~ BooleaiAoperM¶ Ðfor the definø!ition of true and false); then that suite is '
  ¼'executed\n (J Ñno other partd ðhe "if" statementV F > orb ®valuated).e òIf all expressions areÁ ,À º  Þ  z Ýelse" clause,k .ifb  Y Hent,§ ‰  9  T‚ Wwhileÿ ' = '  `  ¸ Ðused for repeK q øžas long aÜ.and j Y  2:%  1   ù ±_stmt ::= " €" assign	_\ 2":"ºK ‚R   ["×5 ]6  EThis�ly tests3ˆ ‘and, if i§ ï 6Le< g Cfirs@;J 7the¯ Ená (which may be‡ : WNtimef    es(> ²ø8if ×c Ñ Ô  Ó Á ÿ loop terminates‡A "breakü‡@ed ih"e ó » _ Ð ¥  ƒ swithoutY 1ing<  ÷Bâ€™s\ý .  A "continue"£h #¹ AskipE resõÕ  A>goelNbackg !to—È ™rP "7for„%  %  \   Þ|ñ to iterate over•!elÿsa|oequencë P(such¯ð a string, tuple<Plist)	 ut b _bjectª7for¨/ptarget_` W "in"Ã :@  5)¾¿&	Hš Dis e.` once;¹ñ should yield ankÀ           'Øiterable\n'
  Ñ'object.  An & ðtor is created for the result of G ð"expression_list".  The suiteP  then execuV Aonce[ \each ” Nitemc °provided by„ ® A, in Æorder return' ]  Îrator.  Eachh  ~ S 0urnº PassigQ !tog ptarget æ a using �standardÍ ^rulesf  XZ Áments (see Ak   ` state
 ps), ande ç S× d  o@.  W È Þ Às are exhausŽ`(whichì ½immediatelyÉ wC Ì PsequeÒ×is empty or aPð raises a "StopI�]tion"d Pexcep .),g  ¿ ý ñð"else" clause, if „@ent,Ì þ ?n Oloopg  ®erminates.  –A "break"³è© Sfirstt_  Ó” swithoutY t	 Bâ€™sc  Í® "continuee[Í 4 8he ¹ Qskips´ 4res
r ¡’� ™  Ï J @nextÉ m,3 	Ù  ØAtherG-no2 D Ê  èÀ ¦@for-@ mak¨‡#s õ@variAsõ  w  ÐThis overwritb  ll¬hvious o Fose q c žincludingõ  th; Dmade§ 0¶ qç ::     0   iJ Ÿrange(10):  N�print(i)I  $ Pi = 5	  0# tñ will not affect‘N E 	 P# bec	1 i S %berAten ]L S@X 	 p# index > §  LName> .Œ ÿ @deleŽh ’-isñ�finished# 3but/à sequence is eømpty, they will not have been assigned '
  Œ'to at\n `all byO Ñ loop.  Hint: ýbuilt-in function "range()" returnsg .and ñiterator of integers suitable to emulateu `effect+ žPascalâ€™f n"for ij @:= aQ òb do"; e.g., "list(º '3)¼ @the  � "[0, 1,Í N2]".e  ÿThe "try" statemen| = \ $ñ specifies excep­Phandlkíand/or cleanupæ Ncodex  bpa group�Ç .s:,  ð   try_stmt  ::= 1 | 2 8 *  8 E1":"1¨  å "(" " [expressº°["as" ident(@r]] U  –?e)+™ ^  q["else"F 6 ]5 finally8 2try$>"i    ¸@“clause(s)_ßy one or morei .[~When noh c  ™‘occurs inþé y N, nof ? isO �ecuted. r 'an8 a ±­, a search¸ ýÊ · ]0 isâr| 0 Th S  in”!ts× 8 g è Ð   ‘urn untilvøis found that matche\ �ion.  And -84les2 � P, if 6öent, must be last; iy >anyN æ Š EFor ‡\ R with  b  ˜ É/atµ f ñ is evaluated, aeb  Ó  ìížresultinge 0obj†òis â€œcompatibleâ€�Å  O ï 6An 3 h @ i · ifiiÝðclass or a base claØss of the '
  Ì'exception\n ñobject, or a tuple containing an item that is] 0claj  0 M Nbasec 1 › ‹  z .0  bIf no ; â clause matche“  Aion,¢ €search fÔ nqhandler‚inues inR purround¢code and o `invoca^k _stackâ  >[1]å  I3Bvalua  of“¤expression  `headerÿ$an(�8f braisesX 'G˜original P $-isï €canceledh aH astartsŸ ­3new³ Ñ sqÎ �f  R Qcall |2 (i¸@reat™ 3s iU°ntire "try", mtementÓ dg v)ã 3 bWhen a¸ H? Ïi2und{ g¾assigned tof   àtarget specifi÷ AfterÉÂ"as" keyword=#at~ü 1N, ifg  �@ent,ëY ² Î  â€™s suite5ãexecuted.  Alln S o  s must have < Ñable block.  H ç e„ Î‹ - > isg ƒreached,[  d ñï¥normally a2e)=try!2sta7   (This mean£ >�f two nes‰Fus exist?sam¾,Î  âe occur¹ · Y  * TinnerÆ,Ô /thÂ  ou@´ € will no¥ /ÿ^ion.)¥  Ä« „`has be"Þ us&B"as Ð2", Íocleare¥ "atœ (e|¦1.  ¥@is a§  $  D E5 /N:#  }/fož . wà Qransl¡Ó5 † ÀE as N:\n'
   ' ƒtry:\n'
     ?foo  ofinallA ^del NC  ð.This means the exception must be assigned to a different name Æ .bee 1abl, Prefer5 `it aft t ´ clause.  E„ ls are a ~clearedf 0becB Q withÍ òtraceback attachÅ Pthem,  �y form ab § ?encÊ  Vcycleb  st^ ñframe, keeping all locals in that " h Oalivd  Puntil¡ ñ next garbage collecœ~occurs. “Before anÛgðâ€™s suite is executed, details about„ R # žbstoredé Ðe "sys" modult Qd canE}ccessed>viab  F Ñ.exc_info()".X  ð returns a 3-tuplPnsist�2/ofÊ Qclass' rinstancÉ &a NmobjectÌ ?(seÎ s´@The P ðdard type hierarchy) identify¾  ‡PpointUË /thc  Ðprogram whereë Å +`red.  ‚ àÆ ß˜aÆ>via“ #re toˆ ½ir previoush nvaluese �when leav· �handler: F ÷   >>> print(sys=). v(None,  '  U ¾0...½ÿ raise TypeErrorp  , kÐ  0      M Â 2 Ÿ  W ¤ V…¥  . ©  ( ­ 2 Ia"   (<½% 'p6'>,}](), <»Kat "~Î0x10efad080>ü	j 6 k  l Àeback objectx at "
  ú'0x10efad040>)\n' õ"   (<class 'TypeError'>,  ÿ(), <traceback objectj 
8j þ'   >>> print(sys.exc_info()˜  . v(None,  '  Ñ û-'The optional "else" clause is executed if the control flow p'leaves( g ñ"try" suite, no excev ð was raised, and �"return",c "� Ÿinue", org  ñbreak" statement_ Æ D.  Ex @s in« ô Ô >aref ánot handled byF ²preceding "Û F.s.@  ÀIf "finally"xópresent, it specifies a â€˜cleanupâ€™„ @r.  Æ» sk Ýq, inclu¾ 6anyÂ  �	=s. “^If ang ‘ion occuro ] oIcsò7is R,PP 	ñis temporarily saved.Cå .Ifg AtherúaY © itš2re-® Ó Cend Õ l � h ¡ B.  I+ }e   o“ ‡ …f …�is set aŸÇ4ext¸ 6newa .“ Î . ©Ã"“6or ¾¡Ð '®discarded:ù  Odef f()3  a   ...?try!  & ?1/0f E ÏI í? 42O   /f(ã /  K E  4!`nforma	 ç ‘Àavailable to•� program~nduringb læWhen a R ¿ z  ¸n® À 'the\n'
     ñ'"try" suite of a   â€¦"finall ætatement, the  •clause '
O  	 \'is\n ñalso executed â€˜onM ¾way out.â€™5  ó The return valu³ ñ
function is determined byc Mlast¤ "F "c sî ¯ �.  SinceN þ dalways- -s,k ad ~  m " ih Swill m ^bœ h û 4onež .d:$  ÿ   >>> def foo()5  `   ...îN try! "!  & n› 'try'\n"1- uR 1 V ß Û   ¹ 'T 0 P'Addi| al informa � on excep às can be foundá!se°N E4 1, a, 	S Rusing‡graise"A-tozŽgenerateh œ ?mayœ  k e d .I  aChangeç @vers—ð
3.8: Prior to Python 3.8,o�continue"¿ e ‘was illegw¶#" —0dueo àa problem with+ O Aimplâ½ç E  1"d –& =  &  ^  ð@usedç @wrapÝ ë wÏ]block[ § d `methodDfA a  óext manager (see Á  WSŽSBb @ContM MM ös). This allows commonƒ§"Žn Ousagâ €patternsÀbe encapsula0for× ßvenient reuseõ!  EP_stmt× C::= ùV( "("$ _=�nts ","?†_")" |. C) ":•D… a  …  Ö“_item (",‡   ð)*\n'
           õ  '   with_item  õ::= expression ["as" target]\n'
)  	 '  The execut? €of the "i ±" statementy € one â€œ€ Üâ€� proceeds e .asg Žfollows:  01. – xcontextÞ (� î �given inµ ‡ Å .O") i”  ô
   evaluated to obtain a z Žmanager.£  2µ ; ÿâ€™s "__enter__()" is loaded for later usee 3e ?xitd /4d É `methodÐ invokedÃ s5. If a£  was incluÉ¹~,ßmreturnm Áe�~   from|bassignñ/it³    Note¼ f¾Å ó guarantees that ik	Ädß "  s�Áout an error0nû ßwill always b0€  called 0us,¡ R á occurs during�H-to–/thd ›€ list, iZ’ll be treˆ¥he same asÑ _ �  ‹  ¿Mÿsuite would be. See step 6 below6"e L #is1ò7= U£ìP +nå Qexcep´@causÐ 9í  toQ`exitedd�s type, +,M?andb ðtraceback are pasf  –0rguøs4 ÜÂ ¾. Otherwisef Othre…"None" aW  o osupplib ) ¢ Uÿ @ due§  É1Q, andÄA(S h ÷  ¹ v 0falý  # ¡i#oreraisß Í Àreturn valueø was true, the exception is suppressed, '
  l'and\n �   execuA ácontinues with^ ñstatement following "" "P 3 .  Q   IfS QsuiteÝ ýexited for any reason other than anÞ h ðreturn value from "__l P__()"?Pignor<7and5�proceedsf !atÎ ±normal loca\ Í  ¯€kind of x  Í tò _taken07The‹^code:‡  "  ÔÿEXPRESSION as TARGETA  9^SUITEM   {ðemantically equival8/to`  B æ   manager = (§ )+ 1ent) Stype(8 A).__ /__4 mxit = 3 ?xit2 *!= V g ] Bhit_ƒŽ = False'  o   try  € " =´@  * §Ü a 	· ?Tru¶   a ‘   if not·
ÿ, *sys.exc_info())i  F ?rai`   fin7? ~ ¯ +  j  ]¦ fNone,  S [W@more¥¡n one item^ )4ext²as are  { Z3.ifc ’multiple M 9ßs were nestedê  K ß0A()~ Ba, B
 b?   "?   6] Ý2 0 Ÿ • ' ¼  Ã À PYou c6`lso wrfm{-ÑÌ1in   š]lineslÍ Ü P ÿsurrounded by parentheses. For examplºÀth (\n'
      '	 ÓA() as a,\n'
  " B" b" /):9 ^SUITE  ü&Changed in version 3.1: Support for multiple context ® `expres= .s.c  u 0v °using group	 ½parentheses€ .tod ðbreak the statementå Ì Oline® �See alson w ö  **PEP 343** - The â€œwithâ€�Œ : !  / ðspecification, backñnd, and examples› à mPython"t "h °E  × "match"Ô 	= N  0New®“0ª  ˜ — – � is used0�pattern $ Ïing.  SyntaxÝ9 á_stmt   ::= \'L °\' subject_ý ":" NEWLINE INDENT¡àcase_block+ DE# *  W  r ¡star_namedk yM ","b * /s?g y ,| d 8 Æ   3\' l‘s [guard]ð I  ONote•€This sec0 ë s ;ÿle quotes to denote soft keywordýP1„ takes aÞ  ÁÐinput (follow¬"!")¯,aë 9i valueH [2").Q½ (which mayò ¢?aind ?  s)Z ¢ed against)Áˆ t ooutcomt /arŸ2* A5ð success or failure (XP term‹ T* É  = )ð * Possible bindž"of‘ "edê !aîõ ´ prerequisiO?for— t†ðare further discussed below.X\n'
  ' õThe "match" and "case" keywords are soft .D  žSee also:  ð  * **PEP 634** â€“ Structural Pattern M¥ þing: SpecificationP  b 6b ŽTutorialK  ŽOverview, -   ÓHereâ€™s an oR ð of the logical flow !a Ã¯ statementy01. ÿósubject expression " _ á" is evaluated&,a ZžresultingÉ 3   O  E Òe obtained. IÏ   n ‚ 0con% .s k ocomma,h pa tuple± AconsE�ed using9ïstandard rulesÌ“2. Each pˆQin a 'a_block   mp#toŒMwith'?the¹ !—æ« ð for success or failure Q ò described belowS %¬ A can¥  bind someY =all¶ vh Q°lone names ÷ !inm2| upreciseGA … ?­• vary perC Btype� ¥/ñ o **Namom  s made dur a`5fuld 3poutliveÖ Pexecuþ”  ^Pbe us3@fter= §/**ƒÄONoteØ/ 2  DØ  +*edÒ 2es,ò3sub§ yûs/ed§  f Ño not rely onMpings beUa ¼a³"edP ÚConversely, d\ ðvariables remaina �unchanged» av¯» ‘  àexact behaviorH¯dependent lJ q   imply”1may³.Z  isL €an inten¸agd"Óg NPto alù`differ›  Àtions to addH '
  ü'optimizations.\n   ñ3. If the pattern succeeds, ýcorresponding guard (if present)ƒ .ise ñ   evaluated. In this case all name bic Qs areh �anteed toc Ohavee �happenedú D   *ü Ø ¤ òs as true or is missing}"block"• _insid— 0  "ì _: €is execuÇ  © ’Otherwise† MnextV  ÁPmptedÀ �describedª _above#!re™`no furŒ ¿Ó +ý match statementx �  comple^Note:& õ  Users should generally never rely on aú beä4Va  Depe¹ K iÈ  ü �ªðinterpreter may cache -es#_or usEot	à@ whiq€kip repe^h @A sa¶  ¾bÿ  >>> flag = Fal¼ % ` ¯(100, 200)a  `   ...Ñ / , 3, q  # MisD :? } != 300õ"D  H €print('Cjk1')\n"1/ s  Ÿ 1 ifØ :{ SRssful'N, buàENfail˜ 2˜ !y)Ž Mhaes and60s y&2fŸ3, y: {y}€ _y Paprn not  lƒB4, IB¯ anything!~ Z A'   Ë» ñ '5 o3, "Ø"Ùai°d.  Read moæ°bout that i©e¥ |g 0secvX> GY7!'- 0 À     '\n'
    ö'   guard ::= "if" named_expression\n'
1 N   ' 1A "F ü'" (which is part of the "case") must succeed for code ` ninsidef J ñ block to execute.  It takesq Rform:Ð �followedg Oby aÞ  ú .ƒ  ðThe logical flowó añ § ewith a#‘ .s:L  `1. Cheë 1hatÚ ¡pattern in Zi Z edfñ /thU 4   S rfailed,X Ðñis not evaluated and! Mnextb Ž Ç #  ¢ @is cÐ /ed]B2. IB¤ ã ,” � €V D   *X 8 ¥ conditionW ’s as true ÂÅ °sò �  selectì – Ofals— ( Ñ› .ñ raises an excep;dduringB1ion;7 ¯bubbles up¿G°ss are aÛ€to have 8r effect¿1hey) ³åst  b Ç ¸2pro¸1romtPfirst… ™Qlast %l ¬,ðone at a time, skipp?E 5 ts whose¡°(s) donâ€™tú R ƒ. (I.e.,Ú¼ Ü€QhappeA�order.) ð O 9 ²stop once aê ¥  ìNi ðIrrefutable Case BßV - R  GAn ig e À ·a match-allÚ B.  A O Òstatement may}€at most Øk ,>i8˜bž  V¡ � A¸  Ò !coE2red÷ Àutable if itø has no guard and '
  l'its\n ÷pattern is irrefutable.  A  ¨considered& = ife owe canh  ý.rove from its syntax alone that it will always succeed.  Onlyg >thed ”following» Xs are² :5  b* AS Pàs whose left-hV .C  F* ORU pcontain« �at least 
ƒÄ K  •* Captureb $  p* Wildc/î %  Û* parenthesiz3h H  † - 4  ONoteèð  This section uses grammar nota às beyond stand+OEBNF_ U* theK À "SEP.RULE+"AQshortSPfor " ] (SEPì  >)*"ê  ,  t !> p  ÿa negative lookaheadP p  asser  ÔThe top-levelæà  Œ @sÇó::= open_sequence_U $ |+ ’ $   F  G 'as< $or ? dclosed# ? ”| literal 9 q  2| cª9 w­: Evalu,ª _groupn �q mappings EclasÑp   §pdescripÚ æ2low�§include a " Ý â€œin simple¢¾termsâ€� ofl wÞa…Pdoes qillustrg` purpo�P(cred"-tog gRaymon§À       'Hettø#inger for a document that inspired most of the '
  ü'descriptions). Note\n% O hthese 0 ± are purely� €illustraM   �poses andv ^**mayh Ànot** reflecÅ ðe underlying impleÞ ` ð .  Furthermore,Ü yg ndo noth ð cover all valid½ >ms.(  ¾OR Patterns/ ~   rAn OR pO ° is two or ã  ýs separated by vertical bars?"|"×  ~Syntax:€  d   or_’ @::= S dclosed +7  @Only¥¤ final subU ñmay be irrefutable,4MeachÑ 8 /usÛ Abindh qsame seùÿ	names to avoid ambiguity º 
•�matches ž gof itsÍ �s in turnm oosubjec¸  üvalue, until one succeeds.  Theîhen consideredµ > �ssful.  O' wise, if n^ O Æ q Kx.ORd ÁOfail>AIn sÇð terms, "P1 | P2 | ..." will try?j " "· -it• y ˜ /itH 42",UO`mediat½mif any` ENeds,d  {  F o[KH /AS>:$AS' ?<!on1lef £M"as"û okeyworY �against aö Ë?.  P$as9 P_Š tcapture$ 3 IÛ; ŸsÊ 
 î.ASc ì _sCÊ ª E  c ^Erigh_a–]$nd£Ks. "ð" cannot be a a "_".\n8'
  <'\n û2In simple terms "P as NAME" will match with "P", and on success 'b .itd H Pset "X î = <subject>"..  þLiteral Patterns4 ~ "  3A lX pX ô corresponds to most$ Ýs in Python. ~Syntax:d  $  S _w ÿ::= signed_number6 Ú |8 ¿ "+" NUMBERC '-C !_tring˜ ©  �| "None"¦ O"Tru1 OFals2 	„:IO | "Â ²The rule "s"E²the token "¢Ð" are defined^ " °Žstandardg Œó
 grammar.  Triple-quoted | d ý supported.  Raw¾, nh  ObyteN @Form<p Ûsx /no � Ô   M!foª	žc \'+\'£a"! =-\'ë {i  Œðfor expressing co)"x ”ós; they require a real h  on. g AleftÄan imaginaryE 5 ÿ right. E.g. "3 + 4j9Ý£, "LITERALÜÅeÐuly if "™> ==¬ = P. ForÏ  cletonsÀ", —Ó "q,+ É?"isî ÿoperator is used $Capture >cX ©!bi3he ÒP valuØŸ a name. 
C"   a 	
A!'_'’;\n"n¤àA single underðscore "_" is not a capture pattern (this ˆwhat '
  ¼'"!\'_\'"\n àexpresses). ItA óinstead treated as a "wildcard_q .".L  ¤In a given© , þname can only be bound once.  E.g.Ç Ncasef ‘x, x: ... ð invalid while "3 h [x] |% allowedÅ Ckðs always succeed.  The binding fo[ `s scop q^rulesÄ óestablished by the assignment ¦ýion operator in **PEP&`572**;C g u`become×àlocal variableS  y ð closest containÆ Pfunct Ï  ç “ `unless„ ñreâ€™s an applici ñ"global" or "nonˆ p" stateñ ˜ûIn simple terms "NAME" will£r and it 2set+ 9=0Ÿ<subject>ðA W8" P©û ~ F  AÍ ’Zô €s (matchè�nything) ©sü .nod  -®.  Syntax:   5"  — )» ::= '_'\n"•? 'âða soft keyword wi¾ D anyë R, but8 —¦sI æàan identifier,å€usual, e­V "B#" ± ˜Ás, "guard"s,gy" block‡ M Ð,ñÎ Ô  M  _Value‡@  1A vT m0 reL0ent[ =d! ¯in Python.M2'  ? 	JNattrŠ 0    ô u ‚ A_or_ @"."  < 	* ±4 |2 D  0dot/ L Ið is looked up usQ�standard‰)à name\n'
       ó0'resolution rules.  The pattern succeeds if the value found '
 F  ¼'compares\n �equal toC ssubjectK a(using Q"==" + îity operator).P  ðIn simple terms "NAME1. t2" willË P onlyÏ #"<Š >Ê .==b  K Q   ^Note:  2  I\4samaÁoccurs multiÕ qimes in(( ]match¹ ¯statement,h  Áñinterpreter may cacheW Dfirs–áÍand reuse itk oratherg ‘an repeatY ° alookup^#isv ðis strictly tied"ai _givenh BexecºQof a (  =] rGroup PÑ ~ @  1A gT YÁallows usersø 0dd >¡ntheses ard/ s.tod ‚emphasizÐ êBndedy ping.  O´Pwise,Ómhas no[ @addi.alc ‘syntax. S à‚ _Ì … ::= "("d>")"i  ãP(P)" Ä  Øe0effZoas "P"û$�Sequenceþ>~~~­  4A sZ 	ð contains severa£b "beÏel ag9 tg e !el	!s.Ð¸ r`imilart 8`unpackƒEºolist oç _tuplec%  ú 1	¤[" [maybe_» & O] "] <  |U_[openK e   g/  › – 4tar’ M ","/¾ œ   sê  o N",".s +t ?L 	    _s |jÀn\n'
         ñ'   star_pattern  õ::= "*" (capture# B| '
#  ”'wildcard# <)\n#  ð+There is no difference if parentheses  or square brackets  ` Žused forh AsequZ ã þs (i.e. "(...)" vs "[...]" ).?  ^Note:  ³  A single | ` enclo« )inç ýwithout a trailinge_commae @(e.gÏ €3 | 4)")Tta groupx «. While a � G  h -inŠ{ [{ ]{ Pstillj xd l±At most one¨C sub@ ¨ may be inm  m.  TheD ëÛ T QoccurW ð ny position. Ifª B … .isP Üpresent, the žÆfixed-length# *;c Âotherwise itR �variableU E   4`follow‚!isÂ Àlogical flowc` match! a» c `againsêÏsubject valuQ1†V<  !noS t;[2]\¡ �   fails 2’ 0an é aÕÿof "str", "bytes" ª"   aarray"|>› !3.2subE ðt steps depend on wheGi 0é + É ¥€>   VÐ¹® Ó$p "\"ofß 0 g x¡t equal to% ó _numbeR ÷'ofsnÇ ¯d u   2. SÞs� þ‚#ed¹ i¤  correspond¯Ðitems in the øsubject sequence from left to '
  œ'right.\n % ðMatching stops as soon ÿa subpattern fails.  If allM 1 äs succeed in md ðtheir correspondx ]item,µ ?thee ö œ j sä  D öOtherwise, if theIS þis variable-length:K  P   1.$ U 8 # oc ´Áis less than…  Ÿnumber ofh ·   non-star¨!s,K Ð ¿I  Ñ   2. The lea¡g B are× edtÙM /  ð h“for fixedb†É3lÔprevious step{
#· ssaÀ ´list formedÎ`remain¿Œ Ç�s, exclu7Â> 6 !/toÚ° Ÿfollowing¸  … #E4. Rã <2 as\* aÒÁ ONote³ ï çá¥ x ý	 is obtained via "len()"–O(i.e¥  m 8  •€"__len__@  protocol).‡ ˆ Ýmay be cachedf  byèù°interpreter~ða similar mannerÜcvalue p InH õple terms "[P1, P2, P3," â€¦ ", P<N>]"d@onlye=allÄ !Õ� happensÅ£* check "<¸ >"±aS* *ÔB ž) == <N>")  V* "P1ö ‡  [0]" (noteèbt thisŽ can als°Nbindc À  names)\n'
  X'\n'
 ò  '* "P2" matches "<subject>[1]" (note that this' ¬ can also M Nbindc Ž  names)  þ'* â€¦ and so on for the corresponding pattern/element.H  @MappN PN s4 ~ "  3A mX ¦ ô contains one or more key-valueÍ }s.  TheTnsyntaxh Óis similar to$ñnstruction of a di aary. SH :I  $  Ä _Ä  5ä::= "{" [items _] "}"D 	'  A 1   D q,".key_ÿ G o+ ","?H , H „(literalC 9 | S ]) ":"PÒ j ¥  Ô| double_starm @ (  ò ¿**" captureA S qAt most9\  „ 3Ä may be in a² -. ú >Thec W 0ustX  yƒlast sub7 l   äP ( “�Duplicats[ W Å ös are disallowed. 3 |’ òkeys will raise a "°Error". Two�sè`otherw) >hav� ý ?samJ |i Vâh ¿ at runtime  foø  ¤iž áe logical flow¸ ! ’ ag–0t aà ô?#Q1. Ifv0< ` is noS Ê@[3],4 ž �   fails-2� PeveryË` givenQ{ 	 ¤ tpresent" • Ô 3,¥ _ W  «Aeach� ˜eµ^ 	Ìd  : Â _ Œ à,uN| ssucceed-À            h'\n'
  ñ+'3. If duplicate keys are detected in the mapping pattern, N  g á   is considerV ðvalid. A "SyntaxError"' ¼raised for a © c ðliteral values; or a "V ^  T Rnamedé !ofÇ Msamek E .h  ^Note:  a  Key-Y R pairj matched us` lÀtwo-argumentMm of  ?theb ¨ósubjectâ€™s "get()" method.  Ms k� oOmuste ð already be pres§ 
'à, and not creaG­on-the-flyÊ ?viae `"__mis __¾ Ñor "__getitem žòIn simple terms "{KEY1: P1, KEY2: P2, ... }" ŒÝs only if all¯ y`followÁhappens£* check "<¯>an 0* "Ñ  ¨F '  V* "P1ó „ [P .]"2  Q* â€¦ìPso on­R correspondCKEY/ø¸m rClass P�s  ~    1A cT � #reÏ3s a  Èáits positionalï *~keywordc È0s (Pbny).  ò#"  ‰ _¤ ¿@::= Éã_or_attr "(" [$ _u ¨ �","?] ")Þ $  Ý@    j ý ‡ ms [","& ]À   |” E> = Œ  ¤ C",". +9 œ  ƒ 9  A  @ „NAME "="?~  AThe wz b shoul3bbe rep7"inÿ\ s< ^ ’Àng is the loøgical flow for matching a class pattern '
  ­'against\n þ  subject value:"  ð1. If "name_or_attr" is not an i ýance of the builtin "type" ,� ^raiseg þ    "TypeError".!  2š  u 	Ö � Â ~(testedf ¤   via "isë Q()"),í 
‡_failsº 3º %noÂòarguments are presentd åsucceeda Â   Otherwise5 ðsubsequent steps depend on whe, ¿ keyword orô ´positional � ® 	¥ ð ð    For a number,(@-in (ÿs (specified below), a singl,Ÿ 4sub$òis accepted which will9±ö_entirb T;{Sthese« 9u ás also work as. f oqfý CuIf onlyº� 4yF¯ocessed as} ð follows, one by •   I. TheŠ Àis looked up0an (Pibutet¤í `   * IT1is 4so exßAion U± than "Attrm >u/thå7T ¯bubbles up§ )�   
,=has @/edz 'Elò� associa1ithùµ| i# x GWP Gâ€™sëV%. ¸	 â /s,�j (2 3; i	æ™ Ë 1pro)g oÄ DnextÃv!II»4all: � œ 
ï	+ Í À'\n'
         ñ!'   If any positional patterns are present, they Áconverted '
F  \'to\n ¦   keywordX PusingQ ñ "__match_args__" attribute on" P _classg �"name_or_D ‘" before _ Ning:4   ð	. The equivalent of "getV ](cls,µ �, ())" i— ~called.m  I*“ðthis raises an excepŸˆ ¿ bubbles upb òe returned value is not a tuplek îMsionï@failž dÊ À  "TypeError Ñ  1ere{mÒªOthan† 0len».n?)",¡ 0¯Otherwise,D 1 "iù F 4Mto aJ"Â “ :6q[i]" as/J  ] ¾= ñmust be a string; ifÀŠðh ºé(”duplicate= wL,�See also
É €Customiz±yÑarguments in “ÞÜ�Ý  €`I. Onc« lQ És have been Už	d N/s, !  J¸ � proceeds` if @re w�Donlyžõ b ˆ t 0For\ p followmÒbuilt-in typeÜPhandl 'ofP 4subƒ  ÖŸdifferentüŽ* "bool"]  0   / �ytearray4 s0 Odict/ Hfloa0 À       '\n'
  ø'   * "frozenset"\n'
! . ' 4 /in. ?lis/ ‹ ?str¹ _tuple0 ü,These classes accept a single positional argument, and the IpatternPñ	there is matched againstI ð whole object ra, � than ane ¯attribute.h óFor example "int(0|1)"v sn òvalue "0", but no… Î ' se ÿ"0.0" or "False"‹  8 QIn si˜ ð terms "CLS(P1, Ò 7=P2¦ qonly if® — žfollowingb Žhappens:  P* "is��ance(<su}>, CLS)<ó* convert "P1" to a keyword 
  uGê 1.__ú_args__b Î5achY …# "6"î  ß`* "has& Þ 7 "á G &P2@"*.[ Ç 1â€¦5‘so on forÚÝcorrespondingâ /DOpairq�See also"  &ò**PEP 634** â€“ Structural PÛ  M¾àing: SpecificaP  b 6b ŽTutorialK  @Func› a definÅÍ =  ^ >A f` k  Fa user-z &ed+ âÒN(seeu "seÀ ÿThe standard type hierarchy)Û‚ 1defÒ
 ñ::= [decorators] "def"1 �name "("ƒ°[parameter_ö/] Q
h ÿ ["->" expression] ":" suitü  6   ” I  ³  +9À           'Ü   decorator  ù::= "@" assignment_expression '
0 ¬'NEWLINE\n ø   parameter_list8  d 5def! ] (","\ " 0)* # P"/" [	 [< ] ß_no_posonly]]�   |¤ G E u  Ò "Ê �starargsÈ Ñ N Ï , !  Ï F"*" g]¤Ò F"**"Z±]Ï  /| I Ê 
	  ™öidentifier [":" Ð,yH   N O ["=M ‚funcnameA   M › Ø   A N t‰adefini ðis an executable stateºc.  Its  6 ¦^bindsh 6thej ½ 0in  àcurrent local  ¦space to a2 f nobjectg ñ(a wrapper aroundd É �code for û ).  Thi·  "  q ò contains a referen« Ê mglobal|Û ¶ !as� 9 )  ²be used whe0’ ®is called.Q  T€êƒdoes notÒe‰ d ­body; thisÏ ?get0 j0ed 8µ 
? [4+ ¹ ¡cmay beìõd by one or more *Œ*Q «Es. Dµ È are evaluat{…':dCed, è@scop^&atE 6E 1 -. n>TheÊ °result musta ¯ð, which is invokÅ :ithÜÎ âf �ÑBarguð The returned vaølue is bound to the '
  ü'function name\n ¡instead of> . ýobject.  Multiple decorators are appliedp .ine ònested fashion. For example,w Ïollowing cod¦  S ¿   @f1(arg) 2 @def å Ž(): pass%  þ	is roughly equivalent to*  ?   s !  ” 3 = Ó @(f2(¦ )Ý  d  except tha ¡e originalU üöis not temporarily5 E,"“ .".�  ð Changed in vers€c3.9: FŽus may bV½ed with anyR^validc ð"assignment_expresg Ò". Previously]ÿgrammar was much mord ÿrestrictive; see **PEP 614** for details pWhen onŒo ó *parameters* haveø'rm ^* "="ê *ß *Ó  ‰Ù1saiýU µâ€œdefault q Q~ues.â€�l  ›a< – ÄU Cvalu´ correspond¸FP*arguœ*êh qbe omit°rom a call,1’which cas$È Eâ€™s‰ p ™ / iÐ øsubstituted.  If ß Uhas aU E t, all f’» ‘ ¡s up untilÍòâ€œ"*"â€� must alsoêa M â€””Othis¿ Åa syntactic £"onîØ Qed by‹ ó«=**D2	èe a¨0lefû€ right wç‹/th^ ²ddefini½Aexecš@** TRmeansÝ  ‰\ ê  Pì­ Ronce,   H  iCpined, a65>sam=~â€œpre-@comp¸  î !ˆ uså ÜaÁBll. Ö Îis especiallái–Ntanth  to underst­ ðwhen a default pøarameter value is a mutable '
  ü 'object, such\n a; ñlist or a dictionary: if the fun ‘ modifies V m ^(e.g.f ðby appending an item to a { !),S ždefault pÞ ¶ .ind deffect¦ €d.  Thisðgenerally not what was intende* AÉ >wayc ƒaround tX ò to use "None" aÆ ý, and explicitly testf >forf Qit injbody o‡ , c:7  a   defñ ðs_on_the_telly(penguin=º )L  A3if *  G - ,  3 - O= []� % .•("properté _zoo")> dreturn— '  FÀðcall semantics are describedr!mo @tail "se÷|_Callsä A*j âalways assignsªsõ&lläs0menƒ” Î  ’! >ð, either from posi? pal arguM "s, É ~keywordd 9 oW ÖÆ C.  I–°orm â€œ"*id¸ �fier"â€�Ö .ish �present, ò �‘itialized'Ò tuple receiv9~y exces5÷ g  P s, d N !todRemptyk .Ö H ç è ?is Ç ¯new orderel @mappŽ æ ¢Ê‰ 3 @Õ>newº ä k QÕsame type.  P#0 afXì É¢ ñ O° X-onlyã Amay  b£�passed bs S 
® 0bef¶ ‘ /¯  ‡ Š As¦› ‹ J÷ ^ QChang¿ö version 3.8: The "/"'‡ € syntax ‰  ðused\n'
          ö6   'to indicate positional-only parameters. See **PEP 570** for '
    Ë'details.\n'  P\ ð may have an *annota† €* of thek }m â€œ":r îexpression"â€�f ‘followingI Ð § name.  Anå 	ˆ Á — ,f ©even those³ ø"*identifier" or "* -. Ï @Funcû sŒ h %Öâ€œreturnâ€� — 	z  -:-> m aftert >thej *°list.  Thes¡�ps can b íy valid Python` …  @The Â1enc<Ð ñs does not changeÂ�semanticsï a¸ fA² ðvalues are available as¼   ?of O  !di�Áary keyed by‡ Asâ€™M0s ieÿ 7"__Õ >__"µ �attributñÆ ` objecI
"K �" importr Nfrome ÷"__future__" is used,!Œ@rvedžstrings ad oruntim9 €which en_sQ€tponed e€×Ð.  Otherwise,Ny•q1 .edË !who$e îa defin» Û Àexecuted.  I•i­s›Me  •$be¸  edàða different order thab �ey appear&  ÂÎ _sourc/ Ocode �  ItÚ @alsoU si¾`to cre¹•anonymous4s (E’ Oboun\ Ato aÑ ),xp immedid 0useÞ ÏseKs lambdC 0 ’, describN!se]! L:  N 0Notç atØb  #Ðmerely a shorŸdÈ pa simplŒd%c H;ƒa8 ( Æ aš0def�p statem @passNrop /org  @ssig3 ‹ no+‘¿ just like Š  bó ä2À   'expressiø.on.  The â€œ"def"â€� form is actually more powerful since '
  \'it\n ð'allows the execution of multiple statements and annota& .s.N  ñ**Programmerâ€™s note:** FuncG ý are first-class objects.  AÃ l « Ë Óed inside a fo p definiz  ®es a localQ 5 ý'that can be returned or passed around.  Free variables¾ Nusedf !infnested©  o aaccess £ \ !of Ð³ g ¡containing9 Ádef.  See se‰@ Nam  æ@bind =forÅ odetailþ _ ^also:�  õ  **PEP 3107** -#& Au7   ñoriginal specific§ +U¿” 1484“ ¯Type Hints‰ D_@of a?‘ndard mea| S† 0: tS ÇOhintc¢ 1526¢ aSyntaxö V‰@¢Ability to�  € mq declarO�s, inclu¶ À aPinsta¤ 7  ì !63ì `PostpoŒQEvalu¡  ½0qSupport'@forw¢øreferences withiní= by
¯preserving« )  @  O C strWÀm at runtime¦@tead» _eagerO eå {F C`Å = F  !A úQ\ Õ7 (sq ÕC  0e (¯hierarchy)Sš 0def
ñ::= [decorators] "� "% Áname [inheri�]òž":" suiteŸ 7   ;  k �"(" [argu?¯_list] ")"< ‰ ‚ ð  ::= identifierX\n'
  ' û2A class definition is an executable statement.  The inheritance 'b Nlistf ðusually gives a & ‚ of base� Áes (see Meta’ ¾es for moreP 0adv~ òd uses), so each item in thed ýshould evaluate to a´ p e ñobject which allows sub. ping.  C; es without72 @, by†¡ault, fromÆ "" "‘ ž"; hence,²  "  __ Foo:   Npass  þis equivalent to"  ‚ (Â )Š / ‡‰0â€™–0ite¸4theº ed	Sa newÌ Ü]frame zº ñNaming and binding), us  W ñly created local namespace4 |/thÉ Øoriginal globC B. (U5, suã þ contains mostly´ AfuncÅÐ`s.)  W 5 öMshes ion, it    Tðis discarded but6 �is saved.o ^[5] AÐ ¯  7ávŒ Ö D ø ;  … Of  ™"ndm ¤ ½ T ŽattributH!di}Nary.e ³( Í 0bouq co this¨ë ÄÈ qd ‚€  .  ’ Porder*çÜ Ps are�"inJ NŽobody i vpreserv0  |4 ¦0"__!€__".  NoŽ2hatý i�@reli¸ ñonly right after´h  V ¸*  ¸ @es tr M/wedBec ò ÿ  $osyntaxf%* ‚ó
can be customized heavily[m_ 0es X ð also be decoratøed: just like when decorating '
  Ü'functions,\n  ¿   @f1(arg) 2 þ class Foo: pass$  þ	is roughly equivalent to*  ?   r    � 3 = Ð �(f2(Foo)Ù  a  The evalua<ä rules for then or express_A are Msame†a> h žT @s.  ~ �result isU  n bound to ü Î^name.c  àChanged in ver¾ p 3.9: CÅ…es may bç þed with any validQ Æ"assignment_á". Previously,¹ þgrammar was much moreP ñrestrictive; see **PEP 614**†detailsî Q**Proy ðerâ€™s note:** VariabÙRdefin à[ iÿjaµ 6 °attributes;ò yðshared by instanceæI -D 0canœ0set¿sa metho¢`"self.  =«¯ue".  Both2/anÍ £  Ë Å 0accë blçº á  N$%6â€œ‘ O"â€�� eand ans ƒ hides a¹ ‹ ‹ ¥g ü 4#¿ å‚is way. ôx #s a}used asœdefaultâ  < €, but usœ0mutqœs?!req Mleadk ²unexpected ! IªDescriptor¿ •to createavå`differ‰PimpleÒÞržSee also:o   ÝÑ3115** - MetaL esã¿Python 3000=  .ó proposal that cá (PdeclaPon of0^ .toth� P1cur€syntax, » ` �semanticáB how³!es«³ mä  8pconstruØÔÀ
           ø  '  **PEP 3129** - Class Decorators\n'
  ' ñ
The proposal that added c? d? ü.  Function and M omethode G õ were introduced in¹ N8**.A  ŸCoroutineæ  = J 0New“ @versê ?3.5“ -$ f7`definiBŠ - 	/  �   async_o –def ::= [y1] "  q" "def"– �name "("Íÿ[parameter_list] ")"s C	 À["->" expresC¾] ":" suiteB  PExecu#Å of Python cÞà can be suspen§ ‹­resumed atÉ Nmanye Õpoints (see *^ ¨*). "awaitÀ #s,9_ for"ûYg Qwith"³ @only¸ "usò€the bodyå aà • ý t�!s Y0ed q ® åösyntax are alwaysl ¯  9 } õs, even if they do not contain##ork ?�keywordsÇ ¡It is a "S­ 0Errh`to use ¨yield from—} insideñZß ?of k&¯An example²:q  ¤ ±ì(h11,  /2)F  ]¯do_stuff()W  & »e some_Ô/ A RChangšù%7:ë eå"LDnow ä;O ¢previouslyAóPtreatªds suchÅµ]P Î 4 £YI  ìÈ Ížstatement+ �+  è‘_for_stmt�z "{  8  AAn *·ðhronous iterable* provides an ø"__aiter__" method that\n'
  ð'directly returns an *asynchronous G þator*, which can callM 	8 Àcode in its � Fnext� .>  QThe "U ð for" statement allows conveni § Žion overL G 	Ô Obles‡  for @ing Ø :`  1   u  ¼ p TARGETOITER@  –_SUITEL Oelse8 29   Is semantiÅ�y equivalD/toa  B !  @ = (Í )" 	Ptype(œ%).“ 6 @runnen= True#     —3le ; Â  [?try  $ ¤Š= await » ¿»  B Àexcept StopADŸIterationy »  = Fals÷   \ ?    % ?O�See alsoÔ Ù‘__()" and '!)"öodetailfðIt is a "SyntaxErró`to use–	Œoutside ØŽthe body1ðof a coroutine func¢
N £Gwith¤, - ,  O_h “_stmt ::= %"  :  Aåòcontext manager*‹*  E  o?abl· ðto suspend execuh  @*enti  9c*exit*©. x”) /ã EXPRESSION as£ª\^ib1Š e§ kaKÐ = type(managøer).__aenter__\n'
  ô'   aexit = type(manag5 ?xit4 âvalue = await _ < f �hit_excepk ^False'     try:  È ‘TARGET = ‘ ' _SUITE “ a 	· ?Tru¶   ˆ •   if not4xitÿ, *sys.exc_info())p  M ?raiŸ   finall… ¶ j ¿	­ fNone,  )9 ¦See also "nr()" and L  Îfor details.H  ü0It is a "SyntaxError" to use an "async with" statement outside ñ/thÃ ÿbody of a coroutine function¥ ÿ o Ò ô  **PEP 492** - Ct sÆ  Ñ  : sù H ö
   The proposal that madeÈ  ;    ernndalon1con›/ing qPython,Ðòadded supporting ¡ )þ -[ Footnotes ]-n  1[1]æ «0ion Ó `agated the invoca² é ¯ck unless  r  yheP" cladÐwhich happensn  � another` §   e T¤Enew )   ch  s Æ @old ¡¯to be lostG  $ ð2] In pattern matching, a sequence6¡defined ase  oft N  § ŸfollowingÓ 4   *B0lasÌ ñat inherits from "colleTss.abc.Sš "‚  `  b Œ Ÿi ñhas been registerä E  Œ 7|builtin�  õ "(C© )#ÿ"Py_TPFLAGS_SEQUENCE ó ž  bit setÐ  ð       * a classø that inherits from any of the above\n'
  '   þ&The following standard library classes are sequences:K   ] Á   * "array. "(  : Ðcollections.d~ @ Olist3 ¯memoryview9 _range4 Otupl4 ONote{áSubject valuesòype "str", "bytes", and ¡L do :?not¦Umatch® patterns.0  d[3] In4  K °ing, a mapp�ñis defined as oneÇ -he£ Ã!B * aáQ"}Rabc.M” ãˆa Pythonh ñhas been registerÞ  /  ‹ 5mbuiltiŒ  D"(C¨ )Zÿ"Py_TPFLAGS_MAPPING ¬ obit se0 à †
×)Ía"dict"úëd"typesì�ProxyTyp¤ ò  «ó€4] A strÝÑliteral appea !asÁPfirstŒPtemenê ¬ 1funZñ	body is transformed intoK ; þâ€™s "__doc__" attribut`?andg žthereforeX B*docë *58¹³ 
›namespace0itee| @ ó,
 'context-managers': 'With StaðC# # M# ð\n'
              /'* D\n'
, 	 ' ÿ#A *context manager* is an object that defines the d „runtime O /tov ÿ$be established when executing a "with" statement. Tz r Á w ShandlÇ ñ entry into, andÛ ¡exit from, desiredò x 1forQ ã Qon of Pblock ƒcode.  C‹dâ ïs are normallyx  invoked usW ½Yÿ (described in sectionò  † ›s ³ð), but can also be used by directl~0vok› ð ïtheir methods.v  pTypical| si	íÐs include savŠ  Ž `restor& variousw Akindp bglobalÊ , ï @  f $un ¯resources,y1cloÄoopenedx 0filG ?etc."ÀFor more inf^%onÔ€_, see®MQ_ Type¾#„ÿ.__enter__(self)ÿ  @   ED w«ó related to thisûuJq 
� will big#isÑòâ€™s return value€ b�target(s¢   specifiÑô as" clause  š O, ifu?anyF"¶3xitµ¢, exc_type
 ñ ¿, tracebackÔ d
E³ Ó Ô1ŸparameterÚ4   3LQexcep(*cgN—týU tQed. Iì À              ð*'   context was exited without an exception, all three '
=  ÿ'arguments will\n( ß   be "None".'  Y   IfŸ ð is supplied, and the methoÐ shes toº  ; @ress6 w 
ÿ (i.e., prevent it from being propagated),u Ÿit shouldr 
ðreturn a true value. Otherwise,² ¦y ]{�processet Ànormally upoÝ CthisU¸%ÐNote that "__pS__()"U s° not rerais- r paÌ ?-inC
µ!; Â ièÿ callerâ€™s responsibilityÜ "ŸSee also:‹  ð  **PEP 343** - The â€œ‰�â€� stateZB 	!  7 ’specifica¶“backgrounÁexamples for<*€Python "„ "x    :@,
 'U€inue': 'Ì " "Ì /'* ~ ' Ê u ¦_stmt ::= w 1  . ð	 may only occur syntacti2Py nes&i•Œ"for" orå~'"while9¡'loop, butåL @funcµ O Áclass defini  ‡-ing  JÊ  d Q.  ItÞ  “!thñnîƒcycle of Àarest enclosÀµ  Ü
ù‡ GWhenw ¡s‡ @rol V—of a "trys. aÊ @"finŠb" clauð <  ÿPexecu™]befor40'reI c Pstartõ  2 ? " ô Ð€versionsÓ ArithmeticÚ  [ ?   Ô+  Q�a descriŠ ¶Fan a„ ðoperator below usíhÐ   'phrase\n'+
  þ4'â€œthe numeric arguments are converted to a common typeâ€�, this 'T Žmeans\n' Pthat p àoperator impler òation for built-ii ¯s works asj �follows:m  µ* If eitherí 2 isÞ @plex0berÞ 1e o( æ k  1 S ;  *s wise, iª åfloating point± pÄ m  ù Ç  Z ¸ %óboth must be integers and noTsíX¯necessary.µ  �Some addiEáal rules applyS„certain w¯s (e.g., aV0str^Oas an Fleft=!toÒuâ€˜%â€™c �).  Extenë sodefines Ÿtheir ownq ¤ I � behaviorÁ,
 'customiz?©': 'Basic  T N  '* *  ÿobject.__new__(cls[, ...])1  r   Callgÿcreate a new instance of class *cls*. D D  '"‹  )"Û¾ð  '   static method (special-cased so you nee²`t decl/itw as suchö 2   øAakes,Ë ¶of which ané  was requeswÓ�  'as it`Ü Ffirs Ñ.  The remain×	ãOthos’`  'pasà» ØPstrucÕaexpres°(î@callC  Ç Ü « ?tur	à Avaluï`shouldq e  <˜ Cp ¯(usually aq C "of€)~Þ?  '&{Typicalð/s ï Ç ³ =/byl Pinvokë D Ðsuperclassâ€™ýs "__new__()" method using\n'
  Ô'   "super().: ÿcls[, ...])" with appropriate arguments Q �and thenp �modifying( ÿ newly-created instance as necessary beforep oreturná 
?it.Ž  Y   IfJàis invoked dur¼ ðobject construction ü 2it ¨ sr &anþ �of *cls*,#n  (  ?â€™~x"__initÿr uwill beÚ @likeö B Eself_, whe„*+ @* isª p 5newÃ ,�the remaiÀY0areJ A sam
TOwerel ‘passed toI ­/or.tdoes noÙ ¿º  — ?newÂ íØ  ¿ ‚ ÃÖ /åptended • ly@°allow subclTOs ofŠ�immutabl–qtypes (iðint, str, or tuple)o €customiz—E2�ion.  ItFð
s also commonly overriddeo n  )aß /inß �order tol M  » L  £ 3  ­.Ê ]ˆ3  Ð   Called aft½ hV‚has been§ oed (byú $_), buoª itr›†cŒ hr.  ThG îãOthosM
ãs�£or express$f a basF>  aº† ¢‘ derived G ±Þ �O, if¾�any, mustÍ €licitly G0 it-ðensure proper '
   ü'initialization of the\n'
* ó  '   base class part0 ÿ instance; for example:G °"super().__� ÿ __([args...])".8  ð   Because "__new__()" and _ ÿ)" work together in ä Ïconstructingq ˜objects (r Þto create it,€ /tor ustomizvÿit), no non-"None" value may be returned byd "hÏ)"; doing soà Rwill Tña "TypeError" top ÿaised at runtime³?ï.__del__(self)�  à   Called when´„“ is about­ ÿdestroyed.  This" 5 l	co Pa fin0ñer or (improperly) a l Ïuctor.  If am Fß Phas aÂ$¡)" method,í rderived‹?â€™Ö "c? r ð	if any, must explicitly ú ! iOrensure ó Ü OdeleK1SP   Itûñpossible (though not recommended!)¤?theÀ 32µto postponeûF’"by wÏnew referenc
Tto itÉ!isœ2ed Q  *resurrec�*ƒ À i§Amentý@-dep# ntU&n Ã osecondn  ) Z En a © ½  ‚·;¨§
cÚnt *CPython* ë 3 onÙsÚ?oncÃp _ÿ guaranteed that¶ Ts are®y?for;às^  stžAexis©þ€terprete€5its@À            �  '\n'
  Ÿ'   Note:  H ÿ'"del x" doesnâ€™t directly call "x.__del__()" â€” the † oformerm 	¡decrementsF ñreference count for "x" by one, and( n Ÿlatter isq 	#onÈ ped when_ \â€™s { ßreaches zero.R  ñ   **CPython implâ ñation detail:** It is possibleë aG› p ñcycle to prevent&8 Nÿof an object fromo �going ton ñ   In this case,r ‡  will be la��detectedm  Òdeletedp !by^ *_ �ic garbag$ÿllector*.  A common cause ofp n  f  es�!�an excep¿qhas beef ïght in a localo �variableBÁ   The frame‡L n“ b… , whichq à ôits own tracebackR = pŒ  7là ¹ st?ghtSi*eq B àSee also: Docu2P " Ÿ"gc" modul] Warning.!!Duw ƒ ÿprecarious circumstances underµ	"Q¥ ö  methods are invoked,œ 5Àat occur durÅ(°their execuÔr 	j @gnorj  «2a w, @prinÙÿ to "sys.stderr"™insteadú{ßIn particularŽ!'* K@ can‡+ïàarbitrary codeÆ $_being	 A `includpUFany g 0thr÷ ?  I’² q ðneeds to take a loýck or invoke any other blocking '
  ÿ 'resource, it\n# 5 €may deadO „ as the >   ÿalready be taken byt  : Ocodep ÿthat gets interrupted to execute "__del__()".K  Ò *A @ can¹ \ Pd dur4{ opreterÌ ÿ shutdown.  As aq 	°  consequenp ð
global variables it needsè oaccessw ¯(includingr ‰modules)§àhave been dele\oor setq �to "NonekTð  Python guarantee( Èé °s whose nam{ ?ginß Ïwith a singl'åunderscore areÌ @from£2ir þ @ bef% ã'ŽsRe s; if nohPreferÛ½Ssuch Q R¯exist, thir  \²help in ass™Pimporºmá_stills Pavailiã t:¡ time when nÿ method is calledÿobject.__repr__(self)“  A   C{  e J"L ð()" built-in functionK@comp3 * ïâ€œofficialâ€�u !st m aesentab cof an × ÿ  If at all possible,�üàshould look liÔd validdqexpressã  ,c/ /bel !us>Û precreat;Ë  ‡ 4s±Àvalue (givenð I¯appropriat¸Ñenvironment).0 
 P7not5#a p!of„r OformÖ ð	"<...some useful descrip¸c...>" gbÎturned.BTñ # o $@mustNÀ òß class define "ÒšÀ not "__str_ð_()", then "__repr_ ð  is also used w man '
  ÿ'â€œinformalâ€�\n%     string c ðesentation of instances  that classƒ L Ÿrequired.l  a   ThiW ’typicallyß ðfor debugging, so it~ Ÿimportantù « ?thep ì  } * û ÿ-rich and unambiguousÔ °object.__st¸_self)�  ò   Called by "str(T !)"› ðthe built-in funcº s""t(; p Q"prin'  to compute‚ J± or nicely 1 Oabley Zq ‡bof an ç .ÿ	e return value must be an #Y �  �ómethod differs from "R 	Ÿ!n !PthereÁ/noo Sexpec…K "F$)"a�id Pythoÿßexpression: ao ð more convenientÝ|concise0can~ yEõe default implemjRdefinè	Ö?typXy"Ö  Es¡º â�bytes__(Ê-H  ` a  -+sF'û ³ Tfshould7"m $s"eF  Z "__P#,  Ospecå) ý«Þ,ù/byþPextenî,¾ @   eHß· 4ted�literalsh  Ž  Œ.< /()ƒ2,ì`produc¹2â€œ; dtedâ€�z 	Àntation '
    «'of an\n'
 ÿ,   '   object. The *format_spec* argument is a string that L ¯contains am òdescription of the s t\ o ’s desired” l  interpretaK p d Ø Qup toˆ OtypeÙ Pimple	?ingk 2"__Ë ÿ__()", however most classes will eitherl �delegateh e 0dto oneI�built-in Ê ¿s, or use ai similarh ˜� syntax.3  �   See FY‘ Specific·Ñ Mini-Languag	  aü"ûÓn ˆstandardYº % ðreturn value must bU>�  ð   Changed in versA3.4:†Ip methodâ" �" itselfo 0raiða "TypeError" if p—ó d any non-emptyêèÔ 37: ¦ .Ø  (x, \'\')"\Û ?nowÏ pequivalœáto "str(x)" raYbthan "(( ,„ ê t€.__lt__(x0, oy )± 1 e1 /eq1 nb gÄ gb    ã —!rewóso-called â€œrich comparisonâ€�sT ócorrespondence between operator symbols andR o names ðsm ð follows: "x<y" ¿ Ds "xyþE"x<= á1  N 1 n 6"x=J 5  5 A "x! Àalls "x.__ne½__(y)", '
  ï'"x>y" calls\n" ¤   "x.__gtI „and "x>=9   e  .H  ÿ%   A rich comparison method may return the singletonË ÿ NotImplemented"q ôif it does not i5 f ÿoperation for a given pairw /ofi @arguŽ Às. By conven[ ¡, "False" L0Tru /reb "ed‘ n §successfulL . However,Þ #se\Ts can]ø¯any value,r @o ifX q  Aÿor is used in a Boolea»ßcontext (e.g.p i	PcondiHñ of an "if" statûá), Python willÜX"bool())op Ô to determine÷ `resultê otrue o$fíöBy default, "object"®ðs "__eq__()" by u ê Cis",î?ingÑ"D ¼ {Acasem Ë ï:r  Ô &xyr [else v P. ForÞ nT ¼b
 º°Ïdelegates too 3 {qinvertsÃÌ`unlessg /isÜ ¯ o ñThere are no otherÀqied relg±ships among‡ Ý l xs‡8n l ;D0exaóã otruth Û	P"(x<yj jx==y)"Nðy "x<=y". To automatieyo 0genueÝ srdering^³ions from aV root O, seO ó"functools.total_o` ?()"¨1See»Àparagraph on¿BhashŸ K@some�oortant	 noÁ/on	Pcreat	*^ bable* @s whHðsupport custom '-
  ï'comparison\n'! ð   operations and are usable as dic Ÿary keys.G  �   ThereU ñ	no swapped-argument versz ÿof these methods ® P(to bŸ /edr @whenM e left k ñdoes not support# ü p "bu' _rightr 	d ñ); rather, "__lt__()"ZD"__g /rer `each o? Oâ€™ss Qrefle›g eg  :re R v N s  Y"__eqk nk ¦their own Q .r Iðm ™1nds:�of differ3atypes,Q—À nd0l  2 _ is ao Ãdirect or in ’subclass ›N— l  W ,r /hel #edìa 	Î ß has priorityf '@wiseËp ¹ c	b ´.  Virtual ø ?ingÝ iGp ¯considered.ÿobject.__hash__(self)h  ñ
   Called by built-in fun+  "Z �2for< áqŸon member‹ ofKshed col•€s includEâ"set", "frozen  Lâ"q"9   T Å „ð
should return an integer.wï only requiredÌ pr/tyO‚is that �‚s which X@e eq31hav„Q samen ¿value; it iPðadvised to mix toge å\ G ˜G   Tonent' á Ù å óalso play a part inë  C ©. s_y packingo @them§po a tupf!ndØ  ,2the ¯. Example:K  À            P    ' ò
  def __hash__(self):\n'
  0   preturn 5 (4 p.name, ? S.nick color))P     Note† 6 1  "’ ñ	)" truncates the value rµ ÿed from an objectâ€™s ð ocustomp 
9Á)" method tot ð size of a "Py_s __t". k This isl 	àtypically 8 byÛ öon 64-bit builds and 4 Õ '322 .q 	+If%9  "ð ÿust interoperate onÞ Ÿ /ofo 	 different Ò  0 s, be sureUQcheck[Pwidthm ?allq Ÿsupportedq 	– à.  An easy wayi dÁ�ÿ with "python -cm 0"imm _ sys;p 	 print(sys.¦a_info.Ë ?)""‰P  žð  class does notË0ine¶†"__eq__(—/it¾ `should? l 1defX 
 öôion either; if i† T™ o 0but� 	n ñ, its instances will% Ÿbe usableß pas item; q  �C ècollections.  cQs mut) [P‡l �implement(  ã 
¨ è  ”Õ D g ªq, since<; aæ  ¡ý Ô m arequirm�at a keyV [ } Pm>1(if� r F@ v Öqchanges8Qbe in_ Qwrong¥� bucket)gRUser- doxes have» xq¶ Os byÔ ‚default;z`them, æÿ	s compare unequal (excepÛ ¾k À           'ý-   themselves) and "x.__hash__()" returns an appropriate '
  ß'value such\n! o òat "x == y" implies both th  is Œ  ˆ 0(x). Q   Oy)".q  ¢   A classu ò overrides "__eqú  � ïdoes not defin÷ "0q Áwill have ith  ¼ j ÿcitly set to "None". h@When¸m “ Ã method of aõ #isb °, instances  d2the7 o Ü \raise(Ð"TypeError" w· Ÿa programÛ ¿attempts too €retrieve0ir I |,ÂŽ àalso be correc[Ý ßidentified asr  une BableÆ Ächecking "isB_(obj,C ðcollections.abc.HashQ ½!IË5À@needH Ã?ainp?the³  ˜`ementa·  !	XÒfrom a parent#,“j ¿interpreterr @must¶ò told this explibtws/ =M !<Pš Cè>Õ, ox7Qwishexqsuppresl j ' ðort, it should includel  # Q__ = '! iwæ$Øiß.Swhichòs®6ownw  Û  ‹j É*Is a å  beè ´2 % a0 by–ª/¦_ callh_Note: Y By‚BaultT	zí²1strô_bytesÓ ¢objects arëÀ              ' ñ0 â€œsaltedâ€� with an unpredictable random value.  Although '
 C  'they\n ( ñ remain constants  inu ÿindividual Python process,j � are notr 	Ë ÿbetween repeated invocations ofi Ž �.This isk 	°intended to½ @vide 0tecb ¯ against ah ÿ	denial-of-service causedr 	ÿ"by carefully-chosen inputs that exploit the worst{ Ocaseg 	°performance' a ` inserÚ ÿ, O(n^2) complexity. j /Sei 
ñhttp://www.ocert.org/advisories/ ï-2011-003.htmlh ?forÑ 	òdetails.Changing hashãqs affecBae iter g Porder_sets.r 	F h ð never made guarantees abou©1is V  – Ho(and iô
Àtypically va8 ùp32-bit B !64 ¿builds).Seeã OalsoÙ 	ÿ"PYTHONHASHSEED"D …�ð  version 3.3: H”~"iz…Pis en–Od by° default‡ ÿobject.__bool__(self)³  r   Callÿi	“ment trut[P testØ € “ }Ot-inÊ #op|q "¯ ð()"; should return "False" or "True".  When tÆWŸmethod isQðdefined, "__len__()"5  o  Pif it )  í r  xX
 ,@iderYArue b qs resulj ÿnonzero.  If a classR” ÄyneitherÝ nE°)", all itstn /arìÖ  ¯ô,
 'debugger': '"pdb" â€” TheD! /'* ð \n'
           ˆ  '\n'
  þ'**Source code:** Lib/pdb.py-  = 2X  öThe module "pdb" defines an interactive sÏ ¬ debugger ö >forb ý0Python programs.  It supports setting (conditional) breakpointse >ande Àsingle steppO Uat th¶ ðline level, inspeci � of stackc frames,g  0lisº Ä, and evaluaV £arbitrary ý  = ini >thee pcontextŸ 3any£ “ <FalsoA½post-mortem_ ©>inge  µ ôcan be called under§ … Nrol.:   Dk ðer is extensible â€“ it ƒactuallyaAd as£D^classd °"Pdb". ThisN �currently· òocumented but easi ­erstood byOread60.  Ù Í o‚face use½ m:@s "b; TÏ _"cmd"F@â€™s‹!mp<`"(Pdb)ÿ ðypical usage to run a*  \æ ÓLÜ a ï »:-  �   >>> imÂO pdb# "my(( "K  Trun('* Ë.test()')\n"Z 3 ý  <string>(0)?()X A'   3Ç?inuf 
H 1H % Ã ÿNameError: 'spam'¶ n Ð  pChangedUñversion 3.3: Tab-comple�1viaf"ñ "î©iu `availaÈ°for commandd A arg}qs, e.g.m ��nglobalÌ  8 loØnx± are offere&c ±4"p"€ Z ÙP.py" ñ>ƒbe invoka p scriptQO othß & ðs.  For\n'
       Ó'example:\n'
  ' þ   python3 -m pdb myscript.py/  òWhen invoked as a ? ,M ü
will automatically enter š ¾post-mortemd ðdebugging if the program be  ð ed exits abnorml _.  Afn h €  P  Z Q(or aB S b ) o… )ê Ñ  ú b xrestartÅ  ¥ !    | �preservesI­â€™s state:^(suchj ð,as breakpoints) and in most cases is more useful than quitt~ Ï >thed )ter upon•«  Š.1  0New— ðversion 3.2: "pdb.py" now accepÖ� "-c" opt( Mthat
Žexecutesf €commands¡aif givµñ a ".pdbrc" file, see DnCer C6 É #7É mÉ È ñmodules similar toJVway "Ç÷ " does. As with“Ö Ãr pause [ z€just bef: ‹£first line¶ FpThe typ+` usageã È3 inî v is oinsertí`importS; Î.set_trace()¹  a»Alocaˆ€you want‰ § ,{t'0runÀg à�. You ca& àn step through8 À code follow´Mthis5^ment,g  Ðcontinue runnF  3"ouè k us  ð"1 "P gêù07: þ¡built-in "P¿`()", wB C-edå  ´ � ‘defaults,Cbê Pstead®""Æ  ² °ôinspect a crashed? is¨F>>> ž Ü ð   >>> import mymodˆule\n'
  ÿ'   >>> mymodule.test()( ÿTraceback (most recent call last):7 ò  File "<stdin>", line 1, in <w >: 
%./Ÿ $py@ 4@  ¯ <     2Í – \ 3\ 2] ¯print(spam.°NameError: % H  zopdb.pm¦ )>   ?(3)Ô 	?-> – O(Pdb°  ž BThe œò defines the following functions; each enter% dŽdebuggerf ðin a slightly differT?wayM @  =ôrun(statement, globals=None, loc ÷ ¡   Executeï *Y °* (given as³  trüor a code object) û ?undø 4   ° control.  t ý
prompt appears before anyd � .isB   eÍ ðd; you can set breakpoints and type "‰ ‘inue", or0 Î ?canf Ástep through870 us)"" "W €"next" (5Othes“ócommands are explained below)* opCal *ó*Ì ´ **¹ @argu7‘s specify¾ penviron  ¤Bwhic× j‚f/byh qdefault^ !di8aary of hý"__main__" is used. k 1(Se›g * na\  built-in "¥ "()…@eval Å.o> ¯expressiont1Tvaluau[ vì†Šv‘When "run× Ð)" returns, iä ‡/th¹ È e|È °.  Otherwis¾%is? ë~similare oÊ  ¬ N()".  Àpdb.runcall(øfunction, *args, **kwds)\n'
  ' Ô   Call the *I T* (a  ü
 or method object, not a ] ostringv  q   withd ýgiven arguments.  When "runcall()" returns, itd  È �whateverh ¾  V S þed.  The debugger prompf appearsf ªas soon ash ¾is entered.8  ÿpdb.set_trace(*, header=NoneC A @   Ep † Ñ !at  õ ñ ing stack frameû ]is isUŸuseful tof ð	hard-code a breakpoint aÎ @in aQpgram, eç-ifl ?thef a !is[Àotherwise beÆ Þ �d (e.g. w1a‚0serøQ Áfails).  If § 2, *d*¢printed to1®onsole jus_befor· ›  ¥ obeginsü tñhanged in version 3.7:žÅkeyword-only*½ b  ^Ápost_mortem(fOback`  H -H 9 ï !of8Z% *` *$-. úOIf nb? $is®bit usefCone r PexcepöN tha¬i¶“currentlySÆhandled (an R mþbw$ èiû updefaultaPto beÂ /d)³/m(üœ
•P founl´ ƒ"sys.lasŒ &"²  J ¸%*",vs and "Ù°)" are aliaÌ=forÞinstantiating¢  ™¢"Pdb" clasa ß  ›•r same nïmIf youp Owantg  Ào access fur€¡ features,F @have-d0 is nrself:K  "º  •ñPdb(completekey='tab', stdinœ 3out "ÁAskip À, nosigint=Føalse, readrc=True)\n'
  ' þ   "Pdb" is the debugger class.1  ñ   The *completekey*, *stdin* and üout* arguments are passed ¥  toŠ h òunderlying "cmd.Cmd"ª P; see8 À description /reÅ Fskip¨ ý, if given, must be an iterable of¾ ¯glob-styleÂ  module nam rtterns.A{ý
will not step into framesm Othatg òoriginate in a mv  / ± matches onÀ Hthes‹ Ž>[1]b  ð   By default, Pdb seèÀ handler for�ý SIGINT signal (whichÙ ois senÜ 1wheÚò user presses "Ctrl-C" ÷¡ console) / 1youÈi aË ð"continue" command. This allows O ‚to break¡ <;Ñc ‚again byÁ ÒÂ Q.  Ifc AwantK  /ou, /thki€,�P *nos0t* P /ru^ ñsN ï =@rols{Mtheru?Pdbùñload .pdbrc files from; _ystemÔ0Exa•P call¤ !en¸@tracsawith *ô:’  "M°import pdb; P.Pdb(D ð=['django.*']).set_i oe()\n"Š0RaiË€an audit¢  event "pdbg !" ² &noJ
0New@versB3.1:· º ÒO &2O aíý.  Previously, a©n5'  =‘was neverÆ by« zChangedþ 6¯ ÒU �run(stateÏ , öÔals=None, loc … Ñ   runeval(ex¿?ionC !àcall(function,ø *args, **kwds)\n'
  ï'   set_trace(   2 ñ   See the documentation for @func þs explained above.P  þDebugger Commands5 = #  SThe cS á recognized byÇ dw €are list ¾elow.  MostQ M ð can be abbrevia: pto one #ðwo letters as indic# ,; Ÿ?e.g3 ð"h(elp)" means that either "h"b s"help" † Ýused to enterd  Ç / Î Õ (but not "he_ ’", nor "H Hq  _ELP")·  1Arg,sŒ *@must+Psepar ~Áwhitespace ( s· .or±  tabs).  Op~Eal as  ÃPenclo`in squ ~bracket_ Ÿ("[]") inf  6� syntax;/S Ú  7�be typed lternative	H \  § 	­a vertical/ba ?("|�Ú E!ðing a blank line repeathde last3PMed. ˆ AExce„N: ifh  s	J pwas a "d"_ ,qnext 11Š s$ 5 \x ?3 † ã–doesnâ€™tn Rassum?-beè _Pytho# PstateQs andI Pexecu!inÙ @contÜ !of Þprogram beingº ¨  lt  c  ç@alsoGýprefixed with an³ aexclam°g  point ("!"G`This išÀpowerful way¾yinspectº ˜Ê @; it] Ðeven possible\ àchange a varia �or call aÍ iZ @When e‹a occurffsuch aCk* >namìiv @prinÔ !OBâ€™s_  ã  Ö † —ñòr supports aliases.  A
 ßPhave :!mePà'
            È 'which\n'
  ý2'allows one a certain level of adaptability to the context under\Q Îexamination.o  pMultiplX ü&mmands may be entered on a single line, separated by Ñ O";;"y  $(AD ð";" is not used as it  Ý [ „or for mœ e "co¬ Ï i®  § A thaW 0pasg >ýPython parser.)  No intelligenceÐ .ise papplied’± 3ing�™ ; Ainpu„ �split at Í ^firste  Iã pair, even if(!inG amiddle&@ quo�ostring~ ^ óIf a file ".pdbrc" exists _ ðuserâ€™s home directory or" Ä >thed vcurrent= ,Â @readF �and execu½  ã �had been‹^typedg Wðdebugger prompt.  ThisYÀparticularlyt1ful_Å Îaliases.  Ifg Aboth2s*,† ¹2)1is è ßÌ /anÊ � ` defin`€here can� overriddenw -Qlocal“ óaChangeyÆversion 3.2: i 1nowb ‡fK ‰Rinue z�ing, suchÒ" "1ý"next".  Previously,OthesEë Ÿno effectñ ƒh(elp) [È ]Ã  ò
   Without argument, prin¼Alistsgvailab7.9 × ad *” *-i phelp ab„ Å, A.  " ¸Opdb"f �displaysª�full docÔ    (F2doc8 Ø   "P Àmodule).  Si, . Ê 0P must²Þan identifierñÍ ¸  "G ‰qto get oD"!" J   w(R)   ® ÷ña stack trace, withP€most recâ\frameàÀ       'bottÈom.  An\n'
  ó&'   arrow indicates the current frame, which determin$ K ¯context ofg îmost commands.#  îd(own) [count]   ~   MoveÃ ! *E ü* (default one) levels down in Ò ?thed òstack trace (to a newer.)Ü ?u(pÚ Q upØ  ÒÜ Ä Þ Ø _n oldÙ ðb(reak) [([filename:]lineno | functioÖp, condi ]Ý‚With a *P ð* argument, set a b|  þ$reø Ê  � ª 4   e ¬ *g  atj m first;ŸexecutablB teº Å within thatp.  The æ í number may beg �prefixedÉ [ 0 a ê  ‡ô	 and a colon, to specify8Ppoint7+anotherd  ]   (probablyVË ó
hasnâ€™t been loaded yet)Ü 8 i /isd ðsearched on "sys.path".  Notìrat eachþÆ s+¯assigned ae h#toí1allßû [ Ão referC _ pIf a seóO� is preseÁ it Pan ex CsionŠ &Omustd `evaluaÀo true befor"eÁ ¯is honored½  5out¹ p, list #ròs, including for�¸ + Ÿ,¿  ¦†aof timh(at¼ 2hasRAhit, f ðb  ig÷  , t ¦associated’ if any!tÙ ñC—Temporary�€is removÓðutomatically when it '
         °    'is\n'
  þ*'   first hit. The arguments are the same as for "break".J  þcl(ear) [filename:lineno | bpnumber ...]:  »   With a *N *² ±, clear all¸ « 0poiÌ ø /atd Pthis ¦ .o ö	space separated list of ]  Ë <s, e � h 7oseD sp ?outÎ m ms (bute ¿e ÿask confirmation)¶Ÿdisable [¤!D=  7µ PgivenD/a QÂ C e2.  d Wing aBþ  means it canno(_causef  ­ ðprogram to stop execu5 , ubunlike`z ì« ?, i]Premai¤ nŸJPs andÀ ° be (re-)enŒd¹, ¸#Eh — É ¯s specifie� fignoreÜo[countß1Set€ F < s Ÿ@› ].  If; îŽomitted,l @is s„ xo 0.  A\}becomesj _activU2wheç	Ð °is zero.  W  @non- Ž ¸ 
Pdecre˜²ed each timŸ@is r !edJ :¨0is =G ¡any associPcondi  evaluates7i Otrue¸P r[ >ua new *< *?#ý, an expression whichØ?musÃò  ñ  á @ befô je ` is hod¢¤ †`absent¯ py existwÛ  b Òremoved; i.e.B	„À  'breakpoinht\n'
  þ'   is made unconditional.+  þcommands [bpnumber]%  õ   Specify a list of L ò for breakpoint X $ *b L*.  Å ?Thef T ý"themselves appear on the following lines.  Type ac   d PntainC ñjust "end" to terminatei ‹ Þ. An example:Q  ®V(Pdb)$1( ÿcom) p some_variablA   (- ?endN  v   ö   To remove allª gfrom aÑ0, tb""ka‘ ¬ò it immediately withuõ; that is, give no‡ Î@   WM 'non· argument, ³ arefersæohe lasZÇ?set… ·You can use8Ì  v þstart your program upIOgainv   €Qimplyc  ¤"continue"g ±, or "step" �any otherf É‘Ðresumes execu^“  > % [  i  P   Q ½ (currentlyŸ Û ,e ä ð "next", "return
 0jumþ  "quit" andÊi€abbreviaÜ /s)f sD eýb(as if½ä =wasÊ öd  ðed by end). Thisß@becaN F@time:Gef Ud R(event0a sE e 9 . -!),\  maƒ ¡counter an:Q #ùâ€”which could have its own0`, lead /toS �ambiguitiîRbout X j#toˆe†!IfÓ  @ +Åâ€˜silentâ€™˜ iN¾ j ,éª_usual¶ ‘message a² Pstoppä )at> Î°not printed° äg  €bøÀ            ÷0'   desirable for breakpoints that are to print a specific '
   ì'message and\n ð   then continue.  If none of ô  other commandso �nything,n ?youf ²see no sign¿ 7theÔ Þ was reached.A  ns(tep)  ¡   ExecuteÐ ñcurrent line, stop at °first possiu+�occasionb 1(ei(Ãin a functioé Ñis called or  Re nex‚ = inC?thed º _ ))_n(ext)C! e2 Ä Quntil 	µ  ¿‘ *¡ ? isÉ è ðit returns.  (The difference between "z "Á,o"step"f i(# ê¤s inside a“« s, whilek P eÎ; s@Ð(nearly) fullŒ�ed, only²  rping atg  Y ð ¡   jt .Ñ�unt(il) [ì>no]p  �   Withouaugument, ] } with aí onumberf pgreater )$e ä  |iµ " a5v · ( µ '€or equal��± ý  In both cases, also O wheO	ôErame&L     Changed@0ver·ñ  3.2: Allow giv‚“n explici�ÉIg!r(Ç˜   i	
îý 0c(o÷Onue)� '¼¥( a¬-isÏŸencounter¿aj(ump)¯#noÂÀ          '\Hn'
  û2'   Set the next line that will be executed.  Only available in 'O Othe\d ô bottom-most frame.  This lets you jump back andu ] codee oagain,h "orI ò forward to skipH ×  l Àdonâ€™t want# Nrun.O  À   It shouldRnoted.qnot all~ Ps are Íowed â€“ forÆ ¿instance itj 0is U Ppossin!to] Q into°ÿmiddle of a "for" loop k  1out' h ÿ"finally" clause
þl(ist) [first[, last]]`  â   List source™  ‚°current fil!@With» ­arguments,ElK /11g  Ë ‹0oun¥$e _    'pcontinuð¯e previousc ?ing 0   £ ` "." aj § #, – M  ‚ -. k  N Ë Done _ aÅaÁ.™ ?twoO K sL  |ñ given range; ifbesecondz / i ?essd AthanE #@, it? €interpre8 3o count\ T +ThÅic ÙZg @dicae by "->"m _If ang �exceptionK ñ being debugged,Ó ABwher;0 ^/waBorigvp raised�apropag¶ Xis inÃ @>>",–-it5odifferh Afrom² " º n0Newã@versP3.2: ‚¿">>" markerK �ll | longq # P'
1unc§#orUL It0estÈ   ’eÁ d¸ ~"œ "Ï >   : na(rgs)¤  `   Pri�hùWo›Ñf� À         'p ø expression\n'
  ' ö   Evaluate the *? A* in ücurrent context and print ` ?itsc  b .e.  Ž   Note:  Û "Š ð!()" can also be used, but is not a debugger commÃ =â€”Á ?thiÂ ¡  executesvPython } �functionå 6pp gØ  b   Lik¢4"p"Ã �, except“ d1 of _  §pretty-h O�ed usingL !"p " modulÇowhatisæ PW ‰DtypeÎ •aosource ³Try to get C �code for
²given objec¯display it—  Ý ewW0ver¢O 3.2: i [Ù]¿ C   D¤  U$ f it chang8Ÿeach timeQ 	�ion stopsÏ  \ &Ofram%§   Withoutª´, list all õ ô s‹Ó~ ± ’ N¡#$un® £!o¤B  Nô Ÿ any moreiW_clearXžŽinteractÙ p   Star› 8  iv80terôGer (Ø ÜÖ)Owhosñglobal namespaceAains^ ¾(#  gblocal). e found i« !  sØ_ scopVÀ           'ø   New in version 3.2.\n'
  ' þalias [name [command]](  Ò   Create an G €called *N ó* that executes *] Œ*.  The ›  h ðmust *not* be enclosedï ýquotes.  Replaceable parameters canj /bee ò$indicated by "%1", "%2", and so on, while "%*" is rt 1 Ï ?allf (th  ƒ. If no ý  U pgiven, ( scurrent]b ?forb ~„is shownc ãarguments are f 2all^ e d olistedI@   AL`es may¨ ne= ? ‡òcontain anything   blegallyá �typed at$òpdb prompt.  NoteW �internal   ^s
@*canSg  overriddenájhSuch a³bthen h+ ]untili /thtV  öƒremoved.E añcursively applied toø ª_firstÈ qword of6 
p line; þ`other $ sP w  %d ?lefc _alone&s1Ñexample, heren –two usefu“p(especi
  we’ ôd÷ !inò þ ".pdbrc" file):+  2ð# Print instance vari_ÿ	s (usage "pi classInst")I ä€pi for keý%1.__dict__.keys():2p} ×("%1.",k,"=",6 ?[k]o ¸ in self© Os pi( : "unß  ò  q   Dele§!e ÞfÖF Bp! stateË_  B   EƒP(one-á5) *H *• ú £4ext.n�e pstack fy.à€exclamat� poJë@omitfaunless– i ÍÀ statement røesembles a debugger command.  To set '
  L'a\n ô"   global variable, you can prefix the assignmentf _ withb "c q" stateF !onX þsame line, e.g.:¡  "Ó T(Pdb)¼ èlist_options;  Ë = ['-l']\n"H e ' ïrun [args ...]   oestart$ 
6 C   R9  hÌpd Pythoƒñogram.  If an argu@-is|Ÿsupplied,f ²it is split»±"shlex" and‹Qresul% qused as ?newO ñ"sys.argv". History, breakpoints, ac�` × r´ ´O areg Òpreserved. "r("È  þ lias for "run".@  nq(uit)  Á   Quit from	Ã  ^Qhe pr™ð  being executed› baborted  e O cod ¤ öEnter a recursive�that stepÉQroughÈ  ] ‡Wd `(whichÛ  v°rbitrary ex�wsion orÚVto be/ine  ý@currbaenviron)7nretvalX  �   PrintÁreturn valueI … Slast  �of a funÊŠ þ -[ Footnotes ]-�  ‘[1] WhethÉ frýis considered to originate in a certainÈžmodule isg  îÑdetermined by "__name__"Y   � ±sô ÷,
 'del': 'The "delÉi .'* 	  	 ó    del_stmt ::=Y ptarget_Ã	. 	 @Dele] ”úaly defÝ Àvery similar> Ø 8wayÆ—'.'E A. Ra” than spellê`it out-ðfull details, hereÆI som½ 'h I	]'Í n ÃÕÛ àletes each taróget, from left\n'
  ©'to right. 	 ðDeletion of a name removes the binding Bthat! m   glocal q )or] aglobal5 ³space, depeR ‘n whetheri z Òoccurs in a "= "Q �statement$  ‚ s± ö code block.  IfP Ùis unbound, aI ñ"NameError" excepïwill be raised6pttribut9ñferences, subscriX øs and slicings is3ipassed� !toÃ Ðprimary objecò ™volved; d´X  W ©in generalP pequival7‘to assignE ôqn emptyŸ eèe6¨ type (but° Ieven^ 1thiÔ Ñdetermined byÁ  š #edÀ )OpChangedÕ@vers�ò3.2: Previously it was illegal toeµ	’   [0 ifH fðas a free variable€ ka nest‘\ð\n',
 'dict': 'Dic5 ¢ˆdisplays† > '* 
! 
  A Z 7ionR  Õ¤a possiblyªPeries«ëkey/datum pair benclosVÚcurly braces:w 
 !  † _Ò IÑ::= "{" [key_q r_list |- �comprehenº]-I '"}Á[ '   E  d  a  V (","& �)* [","]© 1  C   H `expres‹ 0 ":Þ  | "**" or_$ P  _Ì  P  , *_fô* 'X ÖPyield1newCöê	)P I§ðcomma-separated sequx  B`given,“Zy are¡ QevaluF 7 D ^8 	 `define= D entz |øÅ _@eachÌ � u•~ckey inï C  w Astorv 
® ‚correspoD‹@.  Tƒ@meanµóat you can specif� *:keyP Ñmultiple timez Ú X ç,¿  Wfinal±8â€™Ì  'L` foá!ata M ‘last one Ÿõ
PA dou¡ðasterisk "**" denoteôs *dictionary unpacking*. Its operand\n'
  ò'must be a *mapp. c Each  ú
 item is added to the newI y ô.  Later values replace úalready set by earlierM ôkey/datum pairs and)  i â *s.@ 
 ôNew in version 3.5: UX intoU údisplays, originallyP €proposed¿ ¿**PEP 448**„ 
Ac   comprehenŠ ,– €contrastYAlistì  	+ *s,ƒ ðneeds two expresO òs separated with a colon follow°  ¼ZusualP ‘â€œforâ€� Pâ€œif Ñclauses. Whenø	–  Arun, Všresultingf 1key` ð elements are inserº ih 1new2Ì d <ord7 tha ¿re produced“
RRestr/2s ow �types ofÒ  ¯ « £  žeˆ*inÝ !sezà The standard P ò hierarchy.  (To summarize9 g  ( O Phould›ð*hashable*, which excludes all mut ú objects.)  ClashesQ òbetween duplicate keyÚ Ñnot detected;û l’‚n(textu�rightmostÆ W9ð) stored for a givenk  � prevail²pChangedZ ¶€8: Prior*APythË8E  	§= ­ eÙa+ I ô ‰ j  `e was ûwell-defined.  I÷C‹ Ë: `  uQeforeV ke@Star¥¶ ;3.8è «  — ?is R q @, asó•2572•ò,
 'dynamic-features': 'Intera¶1%  % 	A3  /'* ;  ²Name resolu™Pf fre9 riã`s occu¡t runtime,£D ž  1'atq?ileu  F ñ. This means that®7ÿing code will print 42:Q  Ÿ   i = 10# 
def f()b à Œ Ð(i)\n'
        ê'   i = 42\n'
   # ?f()   ðThe "eval()" and "exec ÿfunctions do not have access ‰ ¿to the fullt ðenvironment for resolving names.  N s may be /edu !inu Olocav  Ý bglobalg �paces of< ÿcaller.  Free variables arew  » /edí � ånearest enclosì  … c, but ( ¢ `! 5 o.  [1]w ØË û åØÑ opå/alç @argu«Os top �overrideNÅ  w •qß.  If only on[   ç ? ist ñspecified, it is usedRñboth.\n',
 'else': '�if" stateÒ 	Z -'* 
  
 N 	� ScondiY Qu :C 
  æÀf_stmt ::= "ª Qassig(ý_expression ":" suiteA  O("elD /)*F 
 ["?"t 
s'= óIt selects exactæd´ Ps by p0uat .Ü 	Y;'onã b6Quntil@°is found to*Átrue (see se¼ˆ BooleanÝ`'opera�
['‹ � Qdefin½ T  Êpfalse);á p"at… ÷â '(6 Ñno other partP  q ™‡B 4 or0ed)Ãòˆ'If all /  ™ ,˜ ’ p»ªclause, if­ PHent,  q 41xces:E 	B g 8  P `aa mean‹Pbreak%ou-°normal flow@'controúð'of a code blockePorder0Ðhandle errorsx¨` eÿ ^  ë ¹5An /  Y±*raised* at¡¢point wher*n À         'erºror is\n'
  ý2'detected; it may be *handled* by the surrounding code block or 'Q oby anyk : Ðthat directlyH %in qinvokedy 3 » _wherei  ³  erô Ÿoccurred.'  ð The Python interpreter raises an exception when5B?s a run-tim¦ ¢ à(such as divisX Äby zero).  AŒ ÿprogram can also» pexpliciQ¯ ® 1ithS" Ï" statement.¸  Eæ i õrs are specified wb ¢try" â€¦ ".	m n  /Th!ò"finally" clause of .½ Pbe us2o� ye  cleanupÑ fò which does not å 2Å ÿion, but is executedg  ¯whether anj K  š ý p !inl Upreceh·³u¥ þ â€œtermina«�â€� modelBwß @ing:&[¨ Å < !er{ find out wÒóhappened and continue. Û/at2  anA /erk Slevelwtq  +arepair/c õ Ú  { Oretrti@failÛAoper1" (  @re-e
 !  f Boffe
_pieceÑ  !of%Ð Afrom¹ Otop)ÞWj	|i¥‘d at all,Z ·ÙeØ ª!ofM x,¦âreturns to its¿active main	 �loop.  Ii(Pcase,GPprintFóstack traceback,sp ‚Ö ® ¸ åÏ"SystemExit"véRidentê by’s stances.  :ð£ Ã  1sel…C dep]oPclass· ù "ino :0?musNðreference the\n'
       ò'class of the instance or a base   ¸thereof.  T' %'
I 	 ž'can be\n ±received byl Àhandler and 6 ð	carry additional informa  O PaboutI l Pexcep9 bal conS .*  _Note:  4  Em ô messages are not part\¢Python APIF/irÖ  �contentsj ðmay change from one versionf b  to  next with(@warningi  ”ashouldÇ Àbe relied on¿ÿ	code which will run undeÒ multipl ¾ �Ÿterpreter¯rSee alsö adescriü  Õð"try" statement in secÍ?tryB  o"raiseX   ã G á ÿ -[ Footnotes ]-œ  â[1] This limitHáoccurs because(Íÿthat is executed¸  ·sÉa  opere sI  þ±available aªB timt `module( ~€compiled@,
 '“ ¡model': 'E   ð ÷ *'* "   �StructureGŸa program<  = )    #A ´_  Acons| "edæ¡±blocks. A * *+ ='a piec£ <'ofk t ø¯as a unit. 'followingäÒ  � as: a mär, a funoQbody,ñaXQdefinñ.s_'Eachc  @comm‚ðtyped interactively!a „ R.  A ‚ file (a 5_givenh   as5@ndarf pnds ¥ )`specif=Ÿ h ?linšAargu˜¸^ )Ð Õ h /(aÍ  àcommand specifñied on the interpreter command line with" 9'
  }'"-c"\n ðoption) is a code block. A module run a ýtop level script (as Q m6 j  ñ"__main__") from§ 	½ ñusing a "-m" argumentš >lsoj ° j  Â qThe strT M ‘passed to~ Ðbuilt-in funcÐ  "eval()< v�"exec()"§ A˜    A3  C  N Âuted in an * âion frame*.  A �containsg  ðsome administrativDPforma÷ 0 (uð for debugging) ß ßdtOmineg Qwhere8 Fhow ¼  š €inues af³ Ãl?â€™x > /hal ¯completed.ð   1Nam¯nd binding8  = %   Be  of namB- Y  *NO p* referÝ¡objects.   0 arð±troduced by� C0ope8?onsp ~`followd¡constructsk /s:Þ  ©@l pa@tersä ´,G Àclass defini÷s: l = "aassignÌ¯expression| Âtargets thatÉpdentifi�if occuræ4o `ÿ  * "for" loop header < ÔA"as"¶  "…p" stateö ð, "except" clause or*  `?as-Ï  Ëppattern: K0ura �matching¸  /Ÿ capture ^ ›    —* "import7> Àatement of tùhe form "from ... import *" binds '
  Í'all names\n ãdefined in theL ÿed module, except those beginning with anQ  òunderscore. This® ðmay only be used aT eg  level.N    ð A target occurrŽ þin a "del" statement is also consideredPbound¢ h  t½ @purpú q(though$ðactual semantics are to un€# g )á ±Each assignÉ #or—Ý ü s‡ý ^blockà ÞOby aã  ñclass or function 1 i /or¥  ('à Atop-Åf Aode ¡ AIf a² Å¤æ 2, iÝþ local variable of that| ,š  Àunless decla qas "nonX "¿"global".  ”  Õi  NçÀ ] Á u.  (The sÒ eÑ O h  ck•É R and k #.)È 4"is�_Ð  O f  P‚ but not3 edø&reÝ F*freÌ *üÝArencÔ
¡ðprogram text refers|•*�Oing*Ä  - ™ð  established byÊ p follow]" aresolu&_rulesà Š  R[ !ofö¨- L    “A *scope*©sß  visibilityec Õ	áôî awj  UHWaü !s ‹ € include‹ "at .. çIÑej  ^ ¦ s¿aÆÀ ,é q @extento anyj 1 wQconta! i ƒng one, Eai, O f �introduc‰€a differ»¸ ™Å Àname.\n'
     V'\n'
  
 ð'When a name is used i àcode block, it ýresolved using the O nearesti  Qenclo9 ñscope.  The set of all such  ñ s visible to a Š j › h  ‘is called¡ & ÿâ€™s *environment*.9    Ànot found at³ ð
, a "NameError" exception.± ¯raised. Ifj   Mrcurrent C aa funcQ B, an× ¯brefers$n _locali  Qvaria[€hat has Ö ¡yet been bß wPvalueê  œ ^pointïPwhereij  ¤ S º A "Un_ L› 3"L  ; Ðis a subclassE‹à$Ifû@bindÕQoperar¢occurs anyå Fwithpi,¿  1use¢  JM   9   aG¡reated as ÛAenceßm ?thef  @R ``n lead'e§?s wó c ¢ ah  ` s beforeØs 1rulLPsubtléÏPython lacksP  Rdeclav pdE2ows”™��­e  Ð NÃ ° !e * ¨t& N canj b�ðdetermined by scannT æ@entiã!exð  ^ 2foré ‚ú Ì  ¥sè r à"global" state	 I%s • Ç ™  K  ÆÌrspecifiE ) k Ô ‡  Ý a Qthosesi/in_’top-level: 0pack ŽsN®B  0 Ñ Í  A ? byo dsearchÊDu `, i.e.¥   Ž æ j _modul;econtai/óŒôrbuiltins¯ ,v e ànamespace\n'
   ø0'of the module "builtins".  The global namespace is searched '
K ý   'first.  If\n  g H à are not found 0re,  ~ 
p J � .f   µ "¶ ó" statement must precede all uses ý OlistÏ ® e x 1hasÚ ñ same scope as aá Ž bindingHŸoperationi  &inQ Qblockp ànearest enclosZ r ®for a freek �variablej  pcontain¯ QP¯R A  rtreatedã ·E PˆnonlocalÊ!ca»‚correspoBªž to referæ /toà  Ápreviously bŠË #s eQ@func™c kÝ Ð"SyntaxError"&@rais%òt compile time iŠRgiven Ndoesi ?notÍ  Pexist¸ 7any° Ÿ L   DRò>m!óis automatically có Þÿ± Þ ah  T ƒimportedvDmain“ `script>_alway  � /edf  0"__P ?__"ž1  ÁClass definiìg s and arguQsm�"exec()" P"eval ø/ar^pspecial³ < m0ext“ {p resolu \. A c“ e  ™/ £  utâ¾� that may½ í ev s.ùs+ \_ences5 bfollow‡Àormal rules ¿Ñ à with an excepã 4 /haæ"unª ° R”looked upSpÕ  Ê.g /Th› ° î!bbecomeÛ�attribut2 !di-_ary o\ t "of³ ‚ edÏ aŠ  @limi{êÐthe class bloù!ck; it does not extend to the code blocks of '
  í'methods â€“\n ò"this includes comprehensions and generator expres ^sincel �they arei  ðimplemented using a function scope.  TŽ ¡means thatà ³ Ÿfollowingf  ¯will fail:    ¯   class A1 Ioa = 42>  # ÿb = list(a + i for i in range(10))<   cBuilti‹prestricBPexecu;G  - 4    ¥**CPython »ar @ detañ ** Users shouldš_touchL  C"__bÊ 1__"Î2is Î Oly ad .. ct c  @wantVðto override valueßI‚ ¤ namespace» c�"import"h   s"K �" module*ÿmodify its attributes appropriately.Q    DThe c ® PassocI ad withÕ 	 üaÏ h  ð
is actually found by lookI!upa  - À Ü æ h oglobali   E r!; q3qbe a di„ary or aR1(in€ e ¯latter casg Ÿm”Hâ€™s] ðis used).  By default, whenÑ  9 l Ÿ"__main__
g , ¼À4-inÐ 4;t m oin any> SotherH o �an aliasz È S /th:¡ k  Ê?elf´¸  aInteraÞ±ÿdynamic features4  ¼-4    ¡Name resol& 0freÐriables occurª‘ runtime,Â.ats /il4 8 .¶¥“˜�print 42kÄ À  '   i = 10Y\n'
  Ï'   def f():  / �print(i)" oi = 42 /f(5 ,  ðThe "eval()" and "exec ýfunctions do not have access to the × Ofullf  ðenvironment for resolving names.  N s may be _ed ing Olocah  Á bglobalY �paces ofF ñcaller.  Free variables areà Í ¦ /edÑ  ™ ånearest enclosÐ  w T, butÁ ” b þ  . o.  [1]i   “ ß ­ ™ op­pal argui ¥Q  �override˜  X S6æ.  If only one ó/isf  ñspecified, it is usedû_both.2   AExceé u = M aa mean/PbreakÏ4out?°normal flow Ìocontro–ð of a code blockPorderFô	handle errors or other eè çPcondiï :&An.  j±*raised* atä¢point wherô¹ |  Ç�detected;Æ�*³ Qd* bya €surround0æ .or,oby anyž 8 °that direct}Er in qinvokedw 3 Ó î g   ´ï �occurred‹ ‡ñPython interpreter k8s aƒ@when/<>s a�run-time¢  ž ð(such as divisionl£zero).  A Š ÿprogram can alsoO `xpliciJ¬ « 1ithL" p" state=.µ {g  rLü% w` €try" â€¦_ Â	k l /Thð"finally" clause‡)¹ "bep2to � yc cleanupÍ  Y¡which doesá ,›â s 2Iutede À    'whether‰ an\n'
  ÿ"'exception occurred or not in the preceding code.C    ±Python usesE  â€œterminak ÿâ€� model of error handling: an ¥ k  : ð!er can find out what happened and continue execu† ? atm _outeri  Ðlevel, but ito  %arepairä PcauseÒ  6Ö  y ^retryÓ ?thed  0faiQ oper+" (¡À by re-enterŒ d QoffenšApiec{ : ´h 1romµ Otop)Ô@When1‘  2!is)‚dP1ll,X i© opreterü  /es›   !ofK €program,˜ñ returns to its f ¯active mai: �loop.  Iû1ith90se,Óòprints a stack traceback, ó   w zg! Ô  Ï"SystemExit"nE˜ðs are identified
@clasþ ò stances.  The "† "q!clœipÃselected depOoúf †"inm :*Nmustf �reference· P  Öra base    ”3eofÔ w n  ðbD °"iv) ­ŸrÐan carry addi’al informoÚ abP®pPional`Q à_Note:%   %  ‚ message �Dpartuv2API>i|  ?ent
à  may change f"€one versÙ3of `  toá  next with!8warningÏ  ashould@`be relÛ!onÞÿode which will run undJmultipl º s.”¥rSee alsð cdescri,›P"try"/Qtemen30secW‘?try 3sta@  o"raiseV   F Ü À       '\n'
  ù'-[ Footnotes ]-\n'
! / '  ð[1] This limitation occurs because the cod	 ýat is executed by d _thesei   ‹ Aoperc sG ñnot available ati 0timi €e module( c ðcompiled.\n',
 'exprlists': 'ExpressÈ  ‹  * #    0   i \ _\  Ó 7::= W ("," �)* [","]O ustarredL 0   O  BitemQ  .)*td » d  8| (` O ","d % Ñ º  Ñ ¹assignment_x a"*" or !   ñExcept when part of a ‹÷or set display, an‡# P   containing€least onîðmma yields a tuple.  The lengthy — (+ j  !isÞ`number> 	As in  È f  /arO`evalua…ðfrom left to rightûÀAn asterisk ‹"de;Q*iter”ñunpacking*.  Its Á~nd must‡_be aný  Q  G  Ea Mðpanded into a sequence% H.s,i _whichi  ’are incluP V2newÁ,", *,ò ²1sitl Ïc  e0Newà1ver“m3.5: I` # ô© ø ¯originallyš  bpropos–¿**PEP 448**¨  —Ptrail co ðis required only``create§RingleZ¡Ÿ(a.k.a. a¨  !*s; �ton*); iR opy alòall other cases.  A 3 h 4i  pwithoutÁ
Ù ¥doesnâ€™t Ï ¸�, but ra} /th� ŽGGthatzU. (Tog rn empty6 , ]/anÖ  % NpairÖ À'of parentheóses: "()".)\n',
 'floating': 'F ø point literals\n'
  /'* )  d þ are described by the following lexicalP Îdefinitions:  1   ó Ânumber   ::=ð  ± | exponent A    A ð[digitpart] frac� 5 |  O "."K 	m Œ (5 |™ )˜ H 5 “  r (["_"]‰ /)*; °  : ƒ 2"."2  Ñ 4 · 3 4 ñ ("e" | "E") ["+ -z H Z ‘Note thatþµinteger andý  K s.palways & Œrpreted ¨^usingg ñradix 10. For example, "077e010" is legal,| qdenotes” Msameg Lh ðas "77e10". The aÎ²ed range ofŠ ßRq/ it i¥ Pmenta]à-dependent.  A	 /·Ý, underscores´ >are± `supporJ2for® grouping./  DSomeQsâ «@3.14d ¬q   .001 @e100	    1e-1 !0e  # n_15_93¯   Chœ÷d in version 3.6: UK «5nowÏ ,v 6b qpurpose³« \� orˆ ,°"for" stateõH 	  	 M   à�used to äqte overâ!elq ¾a7‰'sequenc7ð'(such as a string, tuple or list)	 Rotherj b Ybject'³  ¤qor_stmt\ptarget_V P "in"0res¤ z:" suit¢  ' ”["else" ". ]| 	  <3expf Ñ  <`evalua'õ	once; it should yield aní 	O où  ±! 0torP 1creN  I ÷`result?*thÍ %"eŽ ô 1". Z÷  K ¤then execuŸ Ð for each itecm\n'
  ñ'provided by the iterator, in Îorder return' 7.  M IEach^ AitemI Àurn is assigG !to] ñtarget list using éstandard rulesQ 3forE Áments (see AV   ` state
 ps), andP È zsuite iO âexecuted.  Whe)  ´ ðs are exhausted (whichÂ Ðimmediately w3 ÿ 9the­ psequencv p empty ¾ ndñ raises a "StopI{Hion"T¹exception),]  ­Ô ¸ ð"else" clause, if present,¸ ê d Jloop] ©erminates. 	 –A "break"v g õ’he first ¨ tU  – u swithoutD 	× Bâ€™sN ç.  A "continueƒ 	£ � 	QskipsŠ qrest of «  :Ùg 
= ° 4 @nextÕ m,á 	º  �Ather0no 4 	«  wmTM0or-6@ mak7÷#s P”variables€a
] ÐThis overwritM  ll0Dviou§GZ Fose \ ™includingÌ  th1 Dmadeˆ WdfÈ :5 	 0   ëi@ šrange(10)0 ÂŒprint(i)?   Pi = 5	  0# tù ñ will not affectÆ– I @ 	 P# becj1 i N %beOEten -ôN 	 p# indexþ  è	˜ 	 ?NamòÅ æ @deleÇ± Q Fºis finished[3but¯ Ã,,yó  [ “have been— ed2)at¡ 4all` z €.  Hint:K à built-in funcè! "ï 3()"vIs anO ¤ ´rinteger û  qemulate` eâ‘of PascalC"]ši` @:= aG àb do"; e.g., "¥(› '3)� P Á°"[0, 1, 2]"lñ,
 'formatstrings': 'F ! S x Syntax| 	/'*  +   4ð"str.format()" metýhod and the "Formatter" class share '
  '1 osame\n  syntax for ñ	mat strings (although inw case ofg ” ,k !ub® Ðes can defineZ jir own€  ™ o).  ThÛ # ? isq ð related to that¼ f:dç ÿ literals, but it isá ?lesh ‘sophisticn @and,3ÿparticular, does not supportc ŸarbitraryÐ Ïexpressions.#  1ô ÿ!s contain â€œreplacement fieldsâ€� surrounded by­ ¿curly braceâ"{}". Anything„i‚  ed*E z¤considered®æ °text, whichM äcopied unchangÿe output.  If you needä Ÿto includ>a  characterÏ  rW “ !itò�be escapVŸdoubling:ã A"{{"O"}}" Hagrammaì= a ý 7¯as follows… œ |T _Q¡ ::= "{" [ ¿_name] ["!"u`converæ & #:"¯_spec] "}" 
d �   1argx ò  ("." attribute |ˆ a"[" elÏ_index "]")*~ 
h } ~ ÿ[identifier | digit+]H 
¢  Æ G = 

µ  Š  ‚w 1 | Ì _æH 
)  F … ·<any source÷_excep×o"]"> +k 
ôi k �"r" | "s aøÙ%C  õ ‚<describh ™?nex§ �section>©  0In ¥€l terms,Õ]  ö¯start withvah À           'û2*field_name* that specifies the object whose value is to be '
    Ï'formatted\n  °and inserte	 "tog Putput qtead of ¿replacementm  ½ _. Then 	ß ÿis optionally followed by a  *conversion*m ¯, which isr cprecedW �n exclamav ð point "\'!\'", 
ak *F_Œ*s ` colonf `:\'". #seÖ ê ¯non-defaulUÂ@ for…ç ›.)  rSee alsþFr Szc.ðMini-Language secDf JThe ø
tself begins with an *arg/is—�either aÔ ònumber or a keyword.  If itâ€™s a " ¡, it referJ@posió /alo @arguJig } h  ædÛ 3 k Ï  ¤numerical <`s in a7mF_tringl Ïare 0, 1, 2,q 0â€¦O �sequence,Š�y can all|0omieñ (not just some)Uxµ ?berº“  } "wih @auto¿c4¹-oorder.ç oBecausš8*Q Æ ñ quote-delimited¾0is  €possibleyÞ  )?ifyNÁarbitrary diG  ¡keys (e.g.^! s²s:P10\'"Èl ¡"\':-]\'")A/inv 
§k Î*beˆ/nyL9 _indexr  zð ttribute expresÐ@s. AŠ  G   eo @"\'.- oselect5 H  * 5d az  usû@"get 1()"Â lek– z ú › å A"\'[ ƒP doesX  ƒ lookup � æ__getitem__()";À            } '\n'
  ÿ-'Changed in version 3.1: The positional argument specifiers P ocan bem ôomitted for "str.format()", so "\'{} {}\' �a, b)" im pequival˜ /tot  U ]0} {1W .2  *4*QF&Oter"³ °Some simpletàmat string exa /s:í  ð$   "First, thou shalt count to {0}"  # References f. +_ w B¸ `me a {f ËÏ# Implicitlyq r— 3the› † qFrom {}í †  Sa¥ 2s ", 0- ,O{1}"ò €My questÿ\{nameq 	ikeywordú "¿'H O'\n" Þ`Weight‘tons {0.w | B# \' Ï\' attributew ?'ofeô ñUnits destroyed: {players[0]ƒ !# €A ele�/of{ "ú I /'.þ –  	C*conð* field causes a type coerc<_beforíOtingÇNé0lly^`e job B  t7 € a value€done by É]2"__q O__()g`methodf  H ] ðtself.  However,sJ caó i‘t ¯desirable �@forcÄ7Dto bš aQ¢�, overrid® q ?own·Qdefin¾ Þ 
 Db.  By Ð  Aù Oto aM'“  Ýq @call¬ 
xÊnÃlƒv PlogicÈ× �bypassed(ƒ @ThreŒ¬Àn flags are ýcurrently supported: "\'!s\'" '
  ï'which calls\n" ñ"str()" on the value,V rV A Q "rep, ?ando  � a7 r Ž ¿ "ascii()".'  ïSome examples:%  ô   "Harold\'s a clever {0!s}"=0# C/ ;ïargument firstt ‘Bring outcÂholy {name!rw s `t 3‚More {!ab Ý  t ‡u / ðThe *format_spec* field contain‡  ñification of how*v¢m ðshould be presented, includ‚ó such details asŠ owidth,ÑPalignä,r 0pad[ �, decimaly 0cisÉ  &Âso on.  Each\Ÿ type canq Ÿdefine it°rown â€œRtÖ õmini-languageâ€� or interpretT ÝP	��ÑMost built-inÚ sœ _gommon « � 	À !, rnÐis described r °he next sec=¿ Ašsan also9 b Àsted replace¼Ù¸ÿ within it. ThesV A D may/ ak  D™aconver‰Pflag ŽŠ pÏ, but deeperl 1nesh_is noç�allowed. Þ 	+Õ   ‡‡ r ?are€substitu�0befä R 	Ä º &is š }?Thi²Ó s‰² Dof aÊoj`dynamiÕyÎ o/edžðSee the Format exòamples section for some ex m.\n'
  ' ñFormat Specifical ßMini-LanguageP = 9  3â€œŒ sŒ ÿsâ€� are used within replacement fields Ÿcontainedt O a] ñstring to define how individual values� p presentp S(see æ Sl £Syntax and Cted ˆ ¯literals).ß �They canÞ °also be pas<€directlyß ñ the built-in "f?()"g 1funƒ.  Eachn E ètable type mayG s $  á/ i½t½ m ¿interpretedFMostû  © 0s ijM¥ @llow ops9¤ 	æ ²s, althoughÆ2of m  tn  í^Oonlyl Puppor;!byX qnumericŠs#PA genyp conven ¦Ðthat an empty3­&�produces¼  ðsame result as if you had called "str¡!onß ‰aA non-¥ r ‡@typim ¡y modifiesj • B5TheD m û  of a *standard<er* is:­  #  F _h?::=�ñ [[fill]align][s ò#][0][width][grouping_òà][.precision][$]† 1ill   † ÿ <any character>= “ 9    = �"<" | "> = /^"C  Ï  ;  C +7 -  =  : 0   = odigit+q -4 !"_k ,k Ro k À           '‡   type  Á::= "b" | "c d e E f ''
5  0'"F !"g G n o s x X O%"\nJ  ðIf a valid *align* ÿue is specified, it can be preceded f ¿by a *fill*q Õcharacter thaV Fany  ÿand defaults to a spaces /ifj °omitted. ItÎ Ànot possibleU ÿuse a literal curly brg ß(â€�"{"â€� orr Pâ€œ"}# ƒ) as theÛ  in a formaœ  stringÙ › or whent  usA  l R"str.[ ñ()" method.  HoweverÅ&isÁ¿to insert aq *ðwith a nested replacement fiel} OThisß ÿmitation doesnâ€™ts aaffectQ"á @func? .6  €The mean7!ofU �various ¿  opZ s8aÀ �follows:g  /  &+-   
 +y 1| O×  ]|‡ M #  O|Ž 0 = | 
 y ‘| "\'<\'"á r| Force¯¶ �be left-í þ!inB`availaZ/  { 
t  |Õ (t#i� ö "_ most¦‘objects).I  y mh j' t
O"\'>mOrighn"ô |/  m!mnumberhX y À            � '   '
  6'+-   
 ?+\na Á   | "\'=\'" ÿ| Forces the padding to be placed after¯  4 Ðsign (if any)S |{ 	 !  Á| but before} ÿ	digits.  This is used fo| Pprint­ `fieldsÙ y !inq ¡form â€˜+0 r120â€™. Ÿalignmentù `option¥ @onlyÑ ö Bvali× Ànumeric typeø I3com�Àqdefault w /  y Ànumbers when÷  î ÿ immediately preced~ 	kq width.~ } ¿ Ô Ö' à^àÀ Þÿ centered withinè á‘availableò qRspace=P  P ‚~…0Notçòat unless a minimum –V R�defined,¤ô 1 n °will alwaysÊ Ç²same size aí@dataêf, oit, so at� l +°has no mean n�is case.D  PThe *a#* \ 1is r	F2berE�, and caÎŸbe one ofo  '¯following:%  ÒkO� ÄM�m) ƒwÐ|===========|= (m|\n'
  Ñ'   | "\'+\'" ÿ| indicates that a sign should be used for Q ÿboth positive as  { 
t  `| well2 Anega> a �numbers.5  
y Z &+-   
 +m-m® Aonly‡/ ô |   #| G€ (this iíŸe defaultÚ�ehavior){y ¿ a c' m
Qspaceô Ø ‚leading % á° ö&onÛØkÒ, and a minusU5on ¾v ; 
rk~ï0The[#î±option causYàe â€œalternateÈumâ€� tob w?theq Ðconversion.  ~ 
a  æódefined differentEn % p @type‰TCâ 1is šBvali'Àinteger, floP/nd`complexl CFor Q ÿs, when binary, octal, or hexadecimalk Ÿoutput ism  í!, × 2add#arespecŸ`prefixão0b\'",l Q"\'0o  
 x
 v !orL X0sto the © pvalue. ý E0( ¿þp Hform’0resý!ofS M –ïalways containê #a u-q Ðpoint charactðeven if no digits follow it. Normally, a '
     Ú'decimal-\n'
   ð'point character appears in the result of ÿ se conversions P Ÿonly if ap ðdigit follows it. In addition, for "\'g\'" and G l � ,o ðtrailing zeros are not removed fromÚ è .F  0The¡ ,¡  opÁ � signalsT 0use9qa commaÛ a5ÿthousands separator‹ ð For a locale awÑ 4  , s  ·@"\'n– integerv �presenta¹ Otypeç instead’ 6 pChangedI2± 3.1: Added 8"\';Ÿ(see also® Ï**PEP 378**)‹ ¨_¨Ïn underscore®ú �E Pfloat‚jusè øäÂk N  �pd\'".  *>  ( ¾€"\'b\'",G o	 x @"\'x ¼ A"\'X ?ÿs will be inserted every 4Ýsµ s _otherÉ  �, specifydSthis ãiZo ?errb€ Ð6ÐcÐ?515Ð€*width* â  à ëRdefinÿ e minimum totalafield R E`includT 0anyƒffixes,­!s,	£aformatóÒlsÇ!If¥Ø@ied,/�® c¯determinedâ  by@ ×content‹ 6 ðWhen no explicit alignment•`given,)!ce7 “µ× /by7 ¿§ ("\'0\'")°ðenables sign-awarýe zero-padding '
  ï'for numeric\n" ÿ,types.  This is equivalent to a *fill* character of "\'0\'"s with ano À*alignment* { O _=\'".3  ñChanged in version 3.10: Preceÿthe *width* field byµ Ò /non ð longer affects Z …default Ò  nstringsÍ Tª PpreciÉ *‰�a decimalÁ°ber indicatìhow manÍ ßdigits shouldÐ ð be displayed afÙÔ s QpointÐ Ra flov  F_valuek ¡formatted @"\'f=0andIðF\'", or before  � m � u  » ¦  Ö � g� /orGž0  FM?on-s 0num§ Ö!s·e smaximum�osize -x �in othern uwords, 
¡ñs will be used from¯Ž Q¿content. ThÅ*� noø0lowb oœ te bý�Finally,§ *@Á* determinesã œ3ataÕ Þ Ê Ÿpresented€ ¢available Ä M  at\ — os are:‘ /  ß&+-   
 +y b| Type|‡ @MeanR%  �|Ž 0 = | 
 y |hsä à 1| S£ õúdÔ î1ä¬?   { 
 s  _| mayº0omi$.,  À            �  |\n'
  O'    &+-   
 +y b| None” ß| The same as“ ‚"\'s\'".1  ô ~ ú ÿavailable integer presentation types are:D  ßk5TypßfMeaningÌ# P ò&|=   
 y ‘| "\'b\'"Ã ÿ| Binary format. Outputs the number inlbase 2 { $Î Ð' Ú
F"\'cô óCharacter. Converñ ì!to ° ¦correspond*ô |g ´| unicode c�  beforeaŒprintingcN   y ½ a F
 mdm’Decimal IIc)10ô †oô _OctalT?¦8ð èŠxô ?Hexò 	Àin base '
    ð'16, using lower-  P|\n'
	 
 W'   | ÿ| case letters for the digits above H '9.F  y I &+-   
 +ò 	q"\'X\'"© P| Hexë Ámat. Outputs÷ °number in b° m?uppm?_9. Insª@"\'#É !isÌ  o
è¡specified,ë Àprefix "\'0xP owill bíê  € Ad to5 N} /asÓ OwellIà  y µY [' enL ´ 1| NM‚. This iapsame asB_d\'",òexcept that it use> ö 
ìðcurrent locale sett€to inser[ êÃappropriate  2[	 î  ¿| separatorÙ `characjõò èhDNoneò DThe Ö“ 0"\'ëñ ma Ð µ
 Üý°In addition 70‚presenta °ypes, integb/caÞ#be“?tedr Awith½AfloaÒnpoint q ß listed belowŒ(f0"\'µs Pand "ð°"). When doKQso, "‡ 0()"Þ1use@convb« $
p Qto a X  f ß ðnumber before foírmatting.\n'
  ' ÿ,The available presentation types for "float" and "Decimal" g ¿values are:r  /  Q &+-   
 +y b| Type4|‡ rMeaning$  (|Ž 0 = | 
 y ‘| "\'e\'"à ò | Scientific noß. For a given*`precisA@"p",@@matsS { 
 !  þ| the number in s‡ Q with' -ãletter â€˜eâ€™V q|"  €| separaKa acoeffiƒ Q from v  exponent. UN   ö j òhas one digit beforepy* @s afú  A y dÒa point²ÿ a total of "p + 1v @sign!2ant¬ ?s. y WÆ now3X@, usD q � #6"x k&	ü  ­í,ox �shows allt  kä²aU. If noZ1 Allowˆk	è ,= 	   iÒ sz ßremoved unlesÌa"#" opU/isÜ Qused.L k­4 6' @
O"\'E9uSame asd® “except itn upperèÀ '   |        ð| case â€˜Eâ€™ as the separator '
& 
 º'character.  ?|\n9 /  Q &+-   
 +y ‘| "\'f\'"¦ ÿ| Fixed-point notation. For a given« ÿ
precision "p", formats   ô |s  |a`numbero£a decimal  Owith{ pexactlyy Q digiw y ‘followingƒ w 0. Ww /noz õ o, usesò &a A dof "6"À Qafter� 0	¤  lDæ	#   â| "float", and´ ‹ ¿large enougr°to show allQ ò ´coefficientë bfor "Dìo". If nÜ¯y 	2,= 	  is alsèÐremoved unlesÕy  7`"#" opI g ÒOused6c OY 7 9' CFC@SameÚo,Sÿbut converts "nan" tooQ"NAN"×A"inf< _"INF"qo†gopGeneralYmat. ­bpp >= 1"iÚ9Rround¥!to†¿significantæË CthenÝm
+^ ]÷result in either fÁô > 0 or5 { Ð|\n'
          U'   |   ÷scientific notation, depending on its '
5  Ó'magnitude. A _  |\n- y ÿprecision of "0" is treated as equivalent} Vto a D y  o ƒ1".  TheB °e rules are| �follows:z Àsuppose that÷ ò ðthe result formatë @with† 2sen~u ðtype "\'e\'" andy ô )ÿ"p-1" would have expongC"exp,¿n, if "m <=æñexp < p", where "mé -4q floatsÐ 5!-6' í  mÀ"Decimals", y`numbere|y 6pre‘|y 4\'f¥
w-Lr œOtherwise¯ æÚ Å A‚  V± nèWð. In both cases insign\aÇ@railiBzero�z oÁremoved fromés !d,Z þñ d"` point z y Talso ~  if|  >Are n 0ainØ z  igVh &  9 it, unlesst  #p op¼ Ç oused. HWo nor~{ €given, uÝ~ S66" {µdø rkÚ"*t". For ÛÚacoeffiÇ Kq {/isò  S^m Î oüobvalue;í  _˜ ÜZ ™ðsmaller than "1e­-6" |\n'
  W'   | ò| in absolute value and
 Ïs where the M Dplac6 !of( y ÿleast significant digit is larger than 1,|  ¦ Ïfixed-point y €notationj ò	used otherwise.  Positivõ Anega" Gk˜finity, pf Q Qzero,y �ans, arey óformatted as "inf", "- 0 /0"y T"nan"u   ò `respec.ó ly, regardless .è  precision.l 	 y K &+-   
 +O	b"\'G\'"¢| General ua. Samex0\'g& oexceptÕðswitches to "\'E0 /ifÜ « number getH oN?. TÆ‚represenœ"inªU �1NaNŸ¯uppercased¼>tooÜ	éy 	êkn” ¬ 1| Ni Z isM }sî that it usó/heö 	
¶ðcurrent locale setting7ainsertŒ)Ãappropriate * à	 î  ¿| separatorÁ¯charactersáQ ò 	¿ Æ È' Ò%è@PercÃge. Multipli±Boby 100 €displaysnÎà£ ("\'f\'")Sò , followed by av À            õ   'percent sign.  U|\n'
 	 '3  &+-   
 +y b| NoneŒ ÿ| For "float" this is the same as "\'g\'", È ðexcept that whenV ô |   ð| fixed-point notation Ðused to forma] e} ¢result, itS y ð
always includes at least pdigit p ó  �decimal ¼ /. y  The precisë è  isfAlargooneededð �to represi ‡ y ò	given value faithfully. ÿDÏ å y ”as eitherI pÿ\'G\'" depending onó #he¶ "ofå } ð"context.capitals"Tß@currGÊë?    ¹y àoverall effectÔ�to match} Ÿoutput ofõ p"str()"ô a¢altered byi zHã —modifiersµu   y O ´ ¶' À× FB�examples& = &  T41sec½ 1Tains r  ä ª Ó.ˆ Úosyntaxþ?andk ãcomparison witKrld "%"-\ _ting.>  PIn moûf2Ccase¤  is similar“ Ì /ol 
ˆ ,q » Aaddi6o{ ‚"{}" andÝ B":" !`nsteadJs@"%".Ço Š,€`%03.2fzò can be translatpQ"\'{:# O}\'"HÀ            ñ    'The new format syntax also supports  ðand different '
= 
 ÿ'options, shown\n% ÿin the following examples.1  `AccessA ðarguments by posi† :7  ð"   >>> '{0}, {1 B2}'.€('a', 'b oc')\n"þ   C Ÿ'a, b, c'# f  `  c ß  # 3.1+ onlyM p 2m Ö 0Ö  cÖ aÖ f r*'abc')+€# unpack·E'ÌŸ sequence°'— i0}{1}{ù !brÒ1cadš $# x ?s' ˜ ÿindices can be repeatedž pabracad 9'> 'ÚOnameÖ$ÿ	Coordinates: {latitude},ì b"{long" Ÿ4 Ÿ='37.24N'< ; ¯='-115.81W1
	š [ %, : ú GcÖ T = {'ž 6':   'Œ /':é £ }j '§ A"!**¯ =		e D°â€™ attribu}  �c = 3-5j&   ™(U co×ñ x number {0} isgqed fromOrealž€part {0." /} D s `...  '  Y¤imaginary A   D}.')Îc…	 º (ò )½ g 5_"3.0 — _-5.0.Ô 'm¯lass Pointø1   þ û   def __init__(self, x, y); À        '   D...  �self.x,  Äy = x, y\n'
!  D'   ; Àdef __str__(; /):4 "4  J ð return 'Point({; o.x}, "p  " ±y})'.formatk =5 ?)\n3 £ Œ   ‚>>> str(€ o4, 2)).  º § ' 'r > ÿ'Accessing argumentsâ€™ items,'K 0   · ßcoord = (3, 5µ  , á'X: {0[0]};  Y 51]}GK Cø BX: 3: 5ø `Replacø ß"%s" and "%r"ó #ñ"repr() shows quotes: {!r};ÆÏ) doesn\'t: ²T{!s}"=²\'test1\',  ?2\'H +} : >1\'‚  ^ /2"Å PAlign.�the text2pspecify a width@ ÄV{:<30øp'left at  edü D = 	)  ¸
  : w >w Orighx 
h :   ; „x ^x ocenterë s 0  ë *t ÿ  # use '*' as a fillê_'char" Ü &'* £  *£ O¢€+f", "%- «" fµ	ƒOsign‚&–+f}; {:+fˆp3.14, - )& à? itoalways+H R0000;S    N¢ —  — a spaceœ ÿfor positive numberª 	 ª "-ª -ª Ponly HÖÀ"minus -- saÐme as '{:f};  m'\n"
  ô"   '3.140000; - / O'\n'F  ò'Replacing "%x" and "%o	 pconvert ßthe value to I ÿdifferent bases:p  ÿ   >>> # format also supports binary numbersC ñ"int: {0:d};  hex x "oc o Obin:Ê r{0:b}".Š O(42)q �m $42j Q2a;  g 5 d  10 —ù ðwith 0x, 0o, or 0boprefixM= ó #ô #õ #ö %&0xø &0oú  0bú /10ü X4'UsrPcommaÿa thousands separatorW  ¯ cd'{:,}'Þ¿1234567890)gÏ1,234,567,89Î aExpresÓ Ïa percentage½ 'ê¿points = 19æ ) ¯total = 22( öCorrect answers: {:.2%!r /P #	H o86.36%û#Ãype-specific †4# imEŸ datetime85d =* .3 ÿ(2010, 7, 4, 12, 15, 58iö%Y-%m-%d %H:%M:%SXdM	 p ÿ -07-04 12:15:58I0Nes2p argume4 Úðmore complex exa	 ª9ðfor align, text in zip('<^>', ['left', 'ï_er', Ä¯'right']):~1...ý±'{0:{fill}{y 6}16O „  ,  = p ' " ¾ 	?...& ý Ú < š, ^  
 ^, À"   '>>>>>>>ý >>>>right'\n"
  ¯'   >>>\n' ÿ octets = [192, 168, 0, 1]7 "T Ž '{:02X} ¢'.format(*Z )œ  H Ÿ'C0A80001À ` int(_› )”  è ¯3232235521$ Ÿwidth = 5D 
ÿ
 for num in range(5,12): 6  ê 1...ž : @base; 'dXob':5  :  prQ'{0:{¥  }{G %}}n_num, ") = !, ; = ¯), end=' '¡ U‚ ~ ~?...ý  F  À 5   /10¨ , 6   ?110b 71  /11b 81  10  100b 91  !111 b  V @   A7  121 Ä  V A   B1 31  b ó,
 'function': 'F p defini s/'*  &  $A l `  ¡es a user-z &ed+ {object i^'(seec !seÌ þ The standard type hierarchy):7  !  ‚ 0def3 ñ::= [decorators] "def"1 �name "("° ÿ[parameter_list] ")"w l ÿ["->" expression] ":" suitü  6   ” F    ³  +y   0 	  = ö "@" assignment_” ê NEWLINEd 
e  d 5def! N (",F" 0)* # P"/" [	 bÎ_no_posonly]r>ƒ  %| ƒ ©G Ò .  Ò "Ê �starargsÈ Í   Ñ N Ï À '   parametø er_list_starargs   ::= "*" [parameter] ("," '
  E'def# @)* [$ e["**"   \]]]\n= J   /| I G m H  Ê ÿidentifier [":" expression• Õ 
P  N l ?["=M ŠfuncnameI    M › Ø   A N ±tion defini óis an executable statement.  Its  6 ‚^bindsh 6thej ½ 0in  àcurrent local  ¦space to a2 f nobjectg ñ(a wrapper aroundd É �code for û ).  Thi·  "  q ò contains a referen« Ê mglobalØÛ ¶ !as� 9 )  ²be used whe0’ ®is called.Q  T€êƒdoes notÒe‰ d ­body; thisÏ ?get0 jed onlyµ 
? [4+ ¹ ¡cmay beìþd by one or more *decorator*Q «Ds. D) ÂØs are evaluat{…':dCed, è@scop^&atE 6E 1 -. n>TheÊ °result musta ¯ð, which is invokÅ :ithÜÎ âf �ÑBargu P�returned +en bsoj a ê  áh ¡instead of> . ˜ Å.  Multiple Þª}applied4.ine 0nesÓòfashion. For example,w �ollowing *A  ¿   @f1(arg) 2 1defà(): pasM 7 ðis roughly equival;.to*     âs !  ! 3 = Ó @(f2(‹)Ý  
d À   'except tø*hat the original function is not temporarily bound to '
  'B lname\n "P .".  ð Changed in vers„ c3.9: F’ ýs may be decorated with any‘ ^validc ð"assignment_expresg á". Previously,ÿgrammar was much morÞ  ÿrestrictive; see **PEP 614** for details pWhen onŒo ñ *parameters* have› Gform ^* "="ê *ß *Ó  ‰Ù1saiÈU µâ€œdefault q Q~ues.â€�l WFor a< – U Rvalue„ Ýcorrespondingd P*arguœ*êh pbe omitùÀfrom a call,1’which cas$È Eâ€™s‰ œ™ > isj ùsubstituted.  Ifß Uhas aU E þ , all followingQ ‘ ¡s up untilÍòâ€œ"*"â€� must alsoêa M â€”0Othis¿ Åa syntactic £@on tîØ Qed by‹ ó«=**D2	ps are e ¡¨@left6pright wç‹/th^ ²ddefini½Aexecš@** TRmeansÝ  ‰\ ê  Pì­ Ronce,   H  iCpined, a G " Msame–~â€œpre-@comp¸  î !ecAused*!eaÁBll. Ö Îis especiallái–Ntanth  to underst­ oN‰ ƒ Ža mutablË Îobject, suchh Qlist  d‘onary: ifSBpmodifie¥"e V 8O(e.g} rby appe2pan itemM a { )XkÞ  .inÊ seffect ¦  óX�is gener� wù aintendAÉ >wayc "ar< ° isÁ Âuse "None" aÆ eý explicitly testf >forf  it ›jbody o‡ , cà:\n'
         �    '\n'
	  ÿ'   def whats_on_the_telly(penguin=None)::  G 3if * @ is - ,  0 - O= []U % ÿ.append("property of the zoo")> dreturn— '  ñFunction call semantics are described in mo @tail "se7 VnCalls.h 9A fj ð
always assigns values to ‡ ¼parameters ` 0men¯ ” f  "= ð list, either from posi? pal arguM "s, i ~keywordd 9 oW sdefaultÆ B.  I­Àform â€œ"*id¸ �fier"â€�Ö .ish °present, it`±initialized'þ tuple receiving any exces5÷ g  l, È  N !tooRemptyk .Ö H ç è ?is Ç ¯new orderel @mappŽ æ ¢Ê‰ 3  Kh>newº ä k hÕsame type.  P#b afterÓÉ.orP 
ñ O° e-only ¦¡s and may  -beµ žpassed byk S 
® 0bef¶ ‘ /¯  ‡ Š U › ‹ J÷ ^ QChang¿P vers{Æ3.8: The "/"'‡ q syntax$ /us:·to indicate¬ ò |ý. See **PEP 570** for� deöÖß , Ôð have an *annota|*Ë:r  ex7  ·f afollowç&heÐ @ nam±'Ana8ˆ æ— ,f ©even those³ 	Îh or "*ø-. Ï esŒ h � Aâ€œr¾  — 	z  É:-> ”
Ú À 'the\n'
     ð'parameter list.  These annotations can b õy valid Python '
G  	 ì'expression.\n @The  yence ofa ñdoes not change the semantics- P @funcŸ ² O  ¤ ôues are available as  | O !diN Áary keyed by‡ Ñsâ€™ names in â 7"__6>__"f �attribut æ Æ ` objec!If] "K �" importqNfrome ÷"__future__" is used,!Œ@rvedžstrings ad ~runtimeg €which en_ñs postponed evalu:Ð.  Otherwise,Ö y•81 /edd el(`definiù Û Àexecuted.  I) i­-se)Me 0mayß‡  àða different order thab �ey appear&  ÂÎ _sourc/ Ocode �  ItÚ @alsoU si¾€to creat…„onymous 6s (  E’ Oboun\ Ato aÑÐ), for immedid 0useÞ ÏseKŽs lambda¹ 0 °, describedJ !se]! L:  N 0Notç at¯b  #Ðmerely a shorŸdÈ Åa simplified%c H;Ê a8 ( Æ ða â€œ"def"â€� statem @passNrop /org  @ssig3 ‹ no+‘¿ just like Š  bó ä2ÃeÃ @formIð
actually more powerful si«j /itÉ  QllowsË’0ion·†multiple-Xs andŒñ **Programmerâ€™,ce:** FÓ³first-classP kAŒÇÌ ØË ü>sidŒ†!žs a localQ � BtLPreturû9or 9Â.  Free variZ� Ïf ”Hnest÷ œðaccess the local vaøriables of the '
  ¼'function\n ¡containing9 Ádef.  See se2 @ Nam €and bind =forb Ždetails.b   _ ^also:  ó  **PEP 3107** - FÌ p Annota× s7 ñ	   The original specific2  Ä & aJ Á ” 1484“ ŸType Hint‰ `Defini«  ¢áa standard mea| � † 0: tS ­Ohintc¢ 1526¢ aSyntaxö "Va-@¢Ability to�  € $ v@ adeclarO�s, inclu¶ OclasM  s a in%ced 7  ë"1563ì ñ Postponed Evalu¡  w0qSupport'@forw¢øreferences within.= by
¯preserving« )  @  O C strWÐm at runtime 0ead» _eagerO eå  ¼à,
 'global': '" "uktementI /'* &  2   Z ¥_stmt ::= k öidentifier (","  ,)*H  ´ g is a sÁ which holds±ø'„ ,re` ñcurrent code block.  It‹as that
glistedº Ps are	à-'ba €interpre? #as%se ñwould be impossiblS `assign] aPÌÄ 7“5outzç, although freIQ may Ì< toO Èá N  be�m#edÂ  ^W'F dNames 85n a– {� must not usano;sam·'¡d °ñ textually precev¹�2staì¶ ?dÌ[ed as«lformal² àparameters, or6 Àtargets in "Sšs# ‹"except"_ aclauseF d À         'inð a "for" target list, "class" definition, func
  V\n'
  ð'"import" statement, or variable annotaF .;  á**CPython implL 9 ý detail:** The current% Joes œ <notd ñenforce some of these restriì ûs, but programs should not abusec Lthisd ûfreedom, as future¬ ds may ‹ @them3‹silentlyb lchanged ³the meaningÇ ³ gPÝ pmerâ€™sÜ e]ð"global" is a directive to'½ parser.  IVÀapplies only/ Bcode0 Ad at> �same time ¾ n Ú H@. InE €ticular,¸¢ % û  contained in a< Ö,ngb 1or ¡ ‘object su¾ d¹  ™ ÷built-in "exec()"d0affX  L h sblock *ª Aing*^‘call, and— ® 7 á rsuch a Ø  ¨"unn ded by T�s
-thN§ i  R » 	Ÿ !. {Åí
] Œ"eval()"Æ  Þ ˆ"compileSs¯q,
 'id-‚ó es': 'Reserved   ä¬identifierr �/'* ‘ 3  0CerPy û (besides keywords) hav] speciald ¹sV%sem a+ç Ò Š€patterns	nh @lead´?andl Ptrail  ÿunderscore characters:3  <"_*Ô~ Q   NoŒ3ort…¡from modulù`ort *"è9> j i Iás"case" Q withùi"match‡#"_Ë5<sofÅ‘ $  ÙÀ that denote�wildcardÈ á   Separately,ò@intey U Ápreter makes" oresulté¸³ Plast yu0Qavail~!inW Ðvariable "_".º (It is '
  þ'stored in the\n! ñ   "builtins" module, alongside  ÿ-in functions likek  Ÿ"print".)g  ð   Elsewhere, "_"Ã òa regular identifier. ß ßoften used to‚  ?namä ñâ€œspecialâ€� items, but i9Cnot    [ ïPython itself.¼  �   Note:  «@The ¸  ä sin conjx_ withG pinterna¡Aaliz	 p; referÑ Áthe document O for¤  "gettext1 ²more informF oXy@convÀ1on.½º Òalso commonlyÝ œ !unèŸvariables†"__*__"p áSystem-definedz$s,Ó ðlly known as â€œdunder1 ¢/s.s OThest5 T are o  byt ­ preter andh[  Uimple±Ð ¡(includingZ ñstandard library). Current sú ò  • Q `discusc4" S7c metho21 se¾ TeÖ_. MorAwillLFly b$ik‘ture versq2of ’�.  *Any*. ouse ofÕ ý  ï@ any] âÀ, that does ofollowc  ¯explicitlyg b edÈ,Ïpsubject„�breakageÉ¿out warningÚØÂClass-privatQ’s.  Namesýô is category, whH½ gûæ 0con7p of a cx ài},[€ re-writ® to/ aP €mangled Ol Âto help avoi|r °hes between¨÷  © attributes  Þ @base¶p qderivede …ses. SeeíI‘1s ([)¼F,
 '¬Xs': '*  á�keywordsv  ? '* -  À          'Iû.dentifiers (also referred to as *names*) are described by '
  o'the\n  ÿfollowing lexical definitions.3  ÷ The syntax of i¼ ÿin Python is based on the Unicode¯ �standardl ðannex UAX-31, with elabora¶ À and changes'Ð  _elow;m 0ee am ÿ**PEP 3131** for further detail$RWithiû pASCII r¥   (U+0001.. A7F),AvaliÈ @ract½r´   m@same�A2.x:k ‘uppercase;h  2low! n 1let¡ ò "A" through "Z"Ç àunderscore "_"a �, exceptMm   ­ _firstm 2cha_ —digits "0{ /9"¸›À3.0 introduc7!dd alJq ás from outside9¾  Ùº íHsee Tp).  ForP 'sen à b  ‘classificîk @usesQ € version“ WqCEP Data” l  ’included ·m ""uÇÏdata" module�I+ ¬runlimitt  length.  Cžqis signü /ntd '  ’ñ   ::= xid_start
 Ÿcontinue*ã @ .  Y @ 9<al€in gener3ßategories Lu,ròLl, Lt, Lm, Lo, Nlï.,+ç Å§ O‘Q_ID_SÑ Ÿproperty>Í ñ Í  o, plusÅ ‹s& cù áMn, Mc, Nd, PcÍ o¦ sÉ Å   Ü É C� Ì ÈÙÌ ¿ whose NFKCÑ �normalizY ®Din "
'"\ � ])5id_# 
“ À            û   'normalization is in "id_continue*">\n'
  ' ðThe Unicode category  Ps menb ÿed above stand for:J  ÿ* *Lu* - uppercase letters/   D lD ?lowD )tD _titleˆ 'mD �modifierË #oC ?oth@ $NE_ numbL Mn� ÿ nonspacing mark� McC @ ocombinJ # NdJ decimalÏ "PŒ ñconnector punctuÕ O“�_ID_Star,ðexplicit list of charac¾ tc ÿ PropList.txt toÏÿ  support backwards compatibility6  5* *¶ Cþ¿ - likewise5  `All idñ Ùò
s are converted into the { ßm NFKC while 
 �parsing;n ï PrisonVx ±is based ona .@  aA non-¢ °tive HTML fŸ  ¿ Ÿ—all validë ¼ ç?form 3ÿ4.1 can be found at0 Òhttps://www.uoð.org/Public/13.0.0/ucd/DerivedCoreN`ertiesPX  Keyword= O  8`followZÃ ;uÃÁas reserved { O, orp#*kœ O* ofƒ  | language, ‡`cannotxl ‡ordinaryÝ?s. p �They mus«ÿbe spelled exactly as written here ‚   FalseŒRawait e 1 im  >pas¡À   '   None   Qbreak
 q except !in   �raise\n'
  ƒ'   True Rclass pfinally i Ÿ   returnJ 0and0   acontinY 0for   `lambda
 O tryG p 1def. s   from ÿ nonlocal   whilÚ Rasser de. @ Aglob< B  no  I ?ith‘ 1ync< D eli’ 	 &  â o yieldI  ßSoft Keywords7 = "  ÿNew in version 3.10.)  ð#Some identifiers are only reserved under specific oexts. { PTheseD m °known as *skj*.  Th‡ ÿ "match", "case"l  šo"_" ca½‘syntacticô0actz t  3Ê ÿ  related to thel _patte%ª ðing statement, but this distinct›  Pone a g ¿rser level,C Þÿ when tokenizingî9As z,ð Ãir use with è  Ô ¯is possibl± «rstill pF Òcompatibilityn !ex°g code thatŠ s�$'asÒo names$b RNWes ofd ÐÜ h  �Certain | ¤ (besides Ü_) hav¯Å/alf ‚meanings�%seo  "@d by5*
	 @leadö/an9Ptrail! ^ÿscore characters:¢  O"_*" À   Not imporÝAby "pcmodule ? *"/"_l DIn a­F Si P"" ºBis aíÀ            » 'soft\n'
  ÿ'   keyword that denotes a wildcard.8  ó   Separately, the interactiv Ápreter makes" result œ   of! j ð	last evaluation availablh  8 Q vari ¿"_". (It isg �stored in6 n ñ"builtins" module, alongside  €-in func� os likem Ÿ"print".)i  ð   Elsewhere, "_"È òa regular identifier. ä ¯often used‚ to namek ñâ€œspecialâ€� items, but i@Cnot   ÿ to Python itself*_Note:†  ¹1The½ ê sin conj�_ withH –n8Aaliz	 p; referÖ  ¹�document O forLhH¤  "gettext2E 0mor¡BformZ ow™@convÜ1on.ÙÐ Òalso commonlyú ² !un	s¡"__*__"s áSystem-defined”Qs, inØ ðlly known as â€œdunderO y/s.JOThesL7 T are q  by­^R0andˆ] UimpleÍÔ ¡(including\ ñstandard library). Current sþ ö p /arË `discus›p" Smc methoJ1 seG Ô  eO. Mol Awill‰Fly b<i¨óture versions ofÊ/. Ð P*Any*W? of>1 @ any“   ]@oes Bofollowk ¯explicitlyi ™ ed’ ,psubject»�breakage¿out warningûùÂClass-privatŒ’s.  NamesBÿ is category, wh‰ £ë 0con> Ÿ0a cz id,pre-writñ to" aWÀ            û 'mangled form\n'
  ÿ4'   to help avoid name clashes between â€œprivateâ€� attributes of U  �base andr qderivedg ö6ses. See section Identifiers (Names).\n',
 'if': 'The "if" statement\Ú -'* † ' H b is us/` condi’ €al execu :A  â   if_stmt ::=  ðassignment_expressà ›":" suite? š@("elâ B /)*D …["else" p ]-  ðIt selects exactly oneÜ2the¬ ðs by evaluating  Ô %s 9'onÙ bL QuntilV €is foundw§be true (s ÐBoolean operats¬ 1for} QdefinŸ¨  F °and false);# bn that¿  ÙÄe• '(4 Ñno other partN a@ 4 or
!ed›V`'If al.íRs are• ,” Ž !of ¡¨clause, ifé  C Hent,{ €maginaryI ˆ literal0U%   ] Ò �described `followvlexicalK ²sF }   T‘magnumberWc(float p| digit¶ß) ("j" | "J")J    LAn i:ó yields a complex k ²with a real&ð¿ `of 0.0¡ CK #reß@ed ap @pair{à  G^pointE� â ÊAhaveZsÅarestriU0s oþeir range.  To create ag ÿ 7 �  vnonzero‹, add a È 6 .tok ?it,g  ðe.g., "(3+4j)".  Somež —s*½V°3.14j   10. 1 10 P .001
 A1e10  ) "e- ó  t_15_93j Pmport•\ ¨ –  ½´6  i o  so À" module ["aös" identifier] ("," '
  º'module ["a, J)*\n* 5 
 ò| "from" relative_mO x"import~ x q o ¿ Ð µ F,"(&u 	¹ 3¯ [","] ")"P x/"*H žÀW::= (Ü W".")*2‹  ê C S"."* \ l| "."+9  ¢The basic )ä statement (noVüclause) is executed in twoP lsteps:  “1. find a­ À, loading anZ pitializ ü it if necessaryJ  ñ2. define a name or s° ‚he local ûpace for the scope\whereb !  0 Y1|occurs.1  AWhenC : òcontains multiple rûs (separated by commas)§ -th¥ Atwo ‹ô are carried out P !lyû Ceachm �, just as_ LoughÆ  4¥ …had been] k ô into individualb
Í9 ¬¡details ofCQfirstê ,R 2 COsÁ rdescribÊ‚greater _ ,’section o°"kystem,&Mwhic%Talso i s² Ávarious typeÇ �packagesû° ‹that cane bé” 0ed,¸@well 1alll @hookv L übe used to customizòK b ! sö q. Note Ÿ sfailureZ!is‡A mayô<cat] leitherˆL  Nü Â could not b®tÞ B*or*w ‘an error o<redQ ‡while inE_ !, ©„ includeÐæSN – Ÿâ€™s codeÞIF ð requested moduleö is retrieved successfully, it will be '
  z'made\n ñavailable in the local namespac üone of three ways:F  0* I0 �e moduleO  ³ ðfollowed by "as",s x  r    ;ingº  , d  Q ðbound directly toQ “ imported .;  ¯ …no other­ áspecified, andY mÏ  be£ f +is¯ aa ³  top level” ú  Eâ€™sv Ò 	�
² )›e ïas a reference7   
í *not* aÔ n-tht í S ¦ øpackage that containsx2is 
,inÄ  6 Ëš€ .Â TÂ ý&@mustraŠQed us$0ts —Q qualMü ° !ra|EthanÏ&  ðThe "from" form usePslighðmore complex pro$»Z1. fiï	$u Àclause, loadí <and£ À   initializ# €it if ne‹ Lary;0   2.Û R eachƒpe identK>rs š ˜"" œ ª°   1. checkš  øC >  h8°n attribute½£ Š±  P   2.Z @not,D @emptšf c a subDBwithý Z u
é?theë  âÁ ¾ ’again forZ Æ ©  A   3¹  U 6  tPnot fxA, "Ij`Error" oraisedqR   4.o wiC·€at valueU dstored}Ö®   W, ¼ LP H ” Ž¼�present,b " ³ a  k 8  0Exa‘š$ðfoo                ö # foo imported and bound locally\n'
  3'  -  8 ….bar.baz  N  V ,, W 
N e ras fbb ³ e » :as g ?fbbÈ  @fromš  K Õ Í È c 	?bazc _ Cattr-c  yAfoo." ‚Ç   e  û0If the list of identifiers is replaced by a star ("\'*\'"), all9lpublicd ñnames defined inr £module areê ã 3 ‹pace fore <theb ±scope where] "K"³ ìtement occurs.:  RThe *Ç … *¹ m· adetermÔ ¿by checking­ C Bâ€™sb ç ¡a variable ô d "__all__"; ifˆ K, ite LmustÉ  be²pequenceÛÑstrings whichxeW 6 or^+byb =thab È 0.  4L Pgivenâº i  )³considered _
t<andÃ  Prequi5 Öto exist.  If ¦4notÆ ,ÿ!seÍ
a v d ¸ �includesÓ fÖ•mö³I+do+-no*òbegin with an underscore characteW_W'. Ý kshoulda |containÊ  Ç ½$reapAPI. It#ñintended to avoid accí µa  exÞ<ingc `items × x1parl ~ pAPI (su^¢s library ;w
“=werËºâAused8	ˆ)Æ�wild cardCm[ a â€” "Íœ ÷1 *" ^is onÉPallow— tc; ð level.  Attempt `to use¥¼in class orJ‚function¸i °s will rais»ß"SyntaxError"ñ ÀWhen specify… Cwhat{ óú pyou do ¸@have 4 	cÀ     'absoluóte name of the module. When a ö or package is '
  Ê'contained\n ×within anotheA tD ûpossible to make a relative importg N d  ³ s¿ 5top£  + ¡out havingb aentionâ É  ö .e ,Bya  usC @lead bdots iH Ÿspecified% Ëafter "from"c <youd Bcan N  y how high¶ ±traverse upº ucurrentè �hierarchµ U  º Qexactêws. One Ó h meansc ¢ 4Qwhere) ( » ^  ‡¶Áexists. Two /] 
,upb 5oneØ Âlevel. ThreeD !is1wo  ûs, etc. So if youd|executed �$ .`Pmod" £èÛU"pkg"� te Lwillb 0end©   J .i 2. Iª œ ¤ ..subpkg2• 
( : d ²  â1in _ B !1"	 – L  2… -Th%1ica"<for‰s°æÿPž RÅIÅPs secY .)  "5Blib.
 !_m‹0()"€ €provided1sup!Cappl¸ •Lthatb ÷determine dynamicallyÍs\ Ÿbe loaded± ð Raises an auditî evŸÊ  " ¥Â arguments "Ñ +",®P"fileŽ,",³ Á"sys.path",  Xmeta_   _hooks"² ^ ÁFuture state£ ! = !  KA *fU *¾Pa dir	vñ /�compiler «+ a¬particularc E³ should be I "d «`syntax²€semanticÚ1at bÿ`availaŠ ¬ˆ ÖÉ areleas vPython 
­0feaP± pbecomesgOndarYCThe } › ESinten“ Bmigr¶$to2 
“  ?Kions” À'of Python tö)hat introduce incompatible changes to the language.  '
  Z'It\n Ñallows use of= ðnew features on a per-module basis before. O `releasž ` which$ N ü becomes standard.>  P   fu‰ ó_stmt ::= "from" "__ µ_" "import"i [["as"û ¿identifier]g  $
 <(",O A /)*C |¬ &"(a 
“¾ o m ° ¯ [","] ")"M  îú  d{ -  A  Óðtement must appear n  ‘4top_mIk.  The£Lonlyb 0linØ ü4canY �a Lare:D  *–‰ ü docstring (if any),0  P* comí s+ ablank Ç \, andM  }* otherÚ s. Q Ct6PrequiË uså  Ž:´,is† ÿ"annotations" (see **PEP 563**)Œ äAll historical’ Ás enabled by„Š œare still‘ ‚recogniz< ƒPython 3G0lisócludes "absolute_¦ù"division", "generators P_stop þunicode_literals"O  print_func1 5 ànested_scopes"ø¢ "with_sta)"¼  y ó 
aÿ pdundantEa®2the< UalwayZd ‹kept forf�backwardôP_ilityâ¢G is §ð	and treated specially at=Lpileâztime: CÊ�semantics?cu¡constructs:\oftenK AimplŽ.â ÿ`differ¨ Ôñ.  It may even bÓ/>cas«  Y'a *™s 	žûsyntax (such as ac <newÂ ðreserved word), in wòhich case the compiler may need to par V\n'
  ü0'module differently.  Such decisions cannot be pushed off untilN r <me.  úFor any given release,¿ qknows wÝ êfeature names Â Lhave` ôbeen defined, and raises añ-time error if a fub 
\ œstatementa pcontainQ œ 0ot ´ np/it ThwSrect 7Ò semantics arÍ“same as f1kimport¦ :§ pthere i§ ¢standard mò2"__ó ò__", described later4ii Lwillc 2be • Qed inÃÁusual way at l œr  ± < isP �executed@¿interestingE ‚depend o– “specific ±y ‘nabled by´ « � 0Not´ó v@noth› { ral abou³— #  ` ±A [as].  @That  Àä} ô; itâ€™s an ordinaryn % mLwithf 4no ã Ã or syntax ¢@rictMG5CodÄ�PcallsT AÂbuilt-in funQ   "20()"ç™ "  tPoccur¨a3M" Î «%	 ,4¢default, uiD new Û ssociated L_-thÍŠQ  Thi— ” ½ 3rol» opg l0rguº//to%	`â€” seÈQe docB aR A of By “detailsÕA_VPtyped!1an Çbactive Ïpreter promp…€take effM ˜  + v¶ 
U 0ses×Œ.  If anŒ €  is«r« W R"-i" f,Z@passÉ  A­  ±b 0to ³2uteg V = ainclud¨öP, it n ôà'
           'vin\n'
  ñ!'effect in the interactive session started after& �script isM Œxecuted.  œSee also:  ñ  **PEP 236** - Back to‡ ®__future__6 ò   The original proposal foÄ =   mechanism· ø,
 'in': 'Membership test operation÷ /'* • ' ˜ L ðors "in" and "no‡"m  § m� P.  "x¤(s"J �evaluatesò"True" if *x* is a A ‚ of *s*,f ðFalse" otherwiseô B'"x † ± s" returnsk1negû  L Š õ.  All built-in X™'sequence) ä ðset types support thª Ðs well as diccAary,«Rwhich%`  �	\ 0wheÐ « B 0 haðgiven key. For containËŠ Ich aO ñ	list, tuple, set, frozen  ` !, I 1lle® 0s.dò ,€ 	 3xprE5 y"™¡equivalent¸Qany(x  V ax == eü  �O 9y)"®  Ú  Áastringë!by å ,?€ * ”Conly6Q  —C subQ  D y*ó(n À  úis "y.find(x) != -1© bEmpty J @s arü@waysŒpsidered
Jbe as 2anyªš H €, so """³"abc"" will¶ ä /
òuser-defined classes p  ÏC "__2Ðs__()" methodR• Fin y3~  V9"y.A &x)& pa true ÅežQ "©
*  ûÌ 	oÔÓ Ï hbut doP * Aiterõ  î  i@3somÀ G "z"²P  —e
5s zìz 
,€producedŠ'leU � Xating\ ðover "y". If an excepA K ‘raised du ‡ D Pon, iÀ r(ifQ �9 FthatR LaLastlyýµ old-style k  {Ptocol“ `tried:as n	¯"__getitem}
½ þea ha non-Ò Ðnegative inteñger index *i* such that "x is y[i] or x == â", and no\n'
  A'lowF &teN Ðraises the "I` øError" exception.  (If any otherQ %  „ J Pd, it ²as if "in"  ¯ 2 ().I  ðThe operator "not E ñis defined to have´ øinverse truth value ofO  ƒ  l a,
 'inû bs': 'I — literals4 /* "  V ñ are described by¶ õfollowing lexical ¥| ì i€.s:f  3   Ý A t::= dec V| bin 6oct { 3hex g V    g ñnonzerodigit (["_"]  ”)* | "0"+ j _"0")*e ® e €"0" ("b"R 4B")R 2bink +G è G oG OG ?octG 	 G xG XG ?hexG 		) :Ÿ"1"..."9"½ K Îv / 2 ^ 0  1^ ó /  ^ 7/ Û / ž A| "aÄ fl A FC  â PThere*Áno limit for•length ofÓ¤½ apart from2Nwhatf ðcan be stored in available memory!Ý . 'F ±UnderscoresÑ1ignP  ² `determ^g¾ unumericŒ© >theb â ƒ.  They · "usïRgroupUs'�enhanced] ¯readabilitÚ UOne uÌ f Óoccur betweenc <­after basef Ÿspecifier6 Ÿlike "0x"Z0NotÉpat lead LsªP non- Ê¡mal numberƒ PaV/edy  @Thisl±�isambigua_õ with C-style octal}, whichÿ nPythonÅ¯pbefore —ion 3.0�  < ÓSome examplesüÀeger literalxs:\n'
  ' A   7# ’214748364  
 A0o17 ¿0b100110111Q 38 ñ79228162514264337593543950336" 30o3Q ŸxdeadbeefP - f 100_0  	 ¿0b_1110_010™  [ ü)Changed in version 3.6: Underscores are now allowed for VŽgroupingb €purposesc ñliterals.\n',
 'lambda': 'L
 s? "'*   2   K ²_expr ::= " ð" [parameter_list] ":" '  esï K  ™ 1 ós (sometimes called}  1ms)0zused to(|'createc ÷	anonymous functions. Theu Ï  Í +s:\ Ó "a …yields a` ‘ object. g sunnamed û  behaves like af ¢ c Q Ü defined with|z0'  0 " <ª&>(Ü )< ågreturnˆ  aSee seU# F^ v 1inii ´æ the syntax ofcû  >ºQ¥'Note that]"s çŸ 6Knnot_ |containÁ ð statements or a9 aº DAistsC»ist displayIHN—0'A é I   i8ðpossibly empty series,Ö Penclo÷'Ò @'squQ|bracket¢Ž  ÚCist_Ø Û±[" [starredÔÀ | comprehenÔK] "]X æ "2new Ñ, ›‚Ybeing¸ª'specified¹Ã'by either aQ f·Í
¶ �.  When a ;ma-Q  se tn éoO óis supplied, its el6 m	’}evaluat² �from left¸áright and plac!!to ÓûPorder‘'Í š O¨  xO °is construcá Š +th)'Ó `result‹*  3f Àion.\n',
 'n¡aming': 'N
 ö and binding\n'
  -'* "  BY œ of names0 =     *NF ñ* refer to objects.   ñ are introduced byx á ¼operations.j  ñ	The following constructs[ e ,s:4  ð* formal parametersÄ Afunc… ,1  ï* class defini4 ` 7 ðassignment express)¤ Âtargets that‘pdentifið �if occurrGfin an i Bÿ  * "for" loop header“  6 °after "as" v Ð "with" stateä  , "except"d`use or* Jthe <as-˜ 4ppattern4 !urê �matching¬ ¡ �capture X ’  —* "importó õ8  Î  Í² "from ... ` 1 *"[s all:Ì ed8 U F ²ed module, –Ð those beginn; ¿< anè ñunderscore. Thisrð may only be used at m d o level"A ÙÀW "delV  iû !so$@ider‡Kound<for½ t± @purpë q(though¨ ñactual semanticsVPto unº# 
¤ j)Ò GEach~ò%í  s o—RblockJeÓ Lby aÔ ±?or †  q Š   (œ
Ñ Atop-§` Aode • ð AIf a« ¤b”Ô @, it òa local variableî+at¿s ÎAunle 0claùqas "nonR "ï ¿"global".  Ž  f <theñ ´´ W µ @.  (²Å Àes of the '
  ¶'module\n'
 ý2 'code block are local and global.)  If a variable is used in a 'L ` [ ð
but not defined there, itO ua *freec ,*.E  ðEach occurrence o¢ @name– ðthe program text refers tow ³ œ*binding*c �of that V áestablished byG ’following" ÿresolution rulesÃ p RA !ofT s# = #  “A *scope*zs¼ §visibility:AwithÔ².÷
-d àI  å!s … € include… "atuh 
f -th¦X i_÷séaa func ´ ,Ý k aextendõ;anyõ. _Qcontaž Iy öng one, unless a , L ` �introduced Ãa different zA for¹  j70Whex ,  ;ŠÈ r  “`ved us§ Î 
h|nearestÐQenclo3 K¡.  The set-rll suchÒ!s K le] +deb ris callÿâ€™s *environment _ñfound at all, a "NameError" excep-+is¥ ¬raised. Ifª  5ftò  Yx",0 + —oah ?o1has)¡yet been bÓ !toƒ0lueÞ  k ppoint wHf ? ˜ ¹ ® A "UnY Lï!8 i€subclass$vÐ\Ÿ Qopera¨ê2anyç —hZ,ü <all³ 1use–  5i G   D ø¢treated as/ W>
3\ L -ß`n leade€s«º‹ 
d aÂ Z s before3½m  q ˜ðsubtle.  Python lacvks\n'
  ô'declarations and allows name binding ope# üto occur anywhereQ ùwithin a code block.  The local variables of& m can bP ðdetermined by scann“ ð the entire textM   p B forÁ 
ì Ï ² Þ .  0If f ò"global" statement%s þ ‰ ,N2 usí  : 
‘  e’Áspecified inn e �refer to Î HQthoseó s6 
f -thU’top-level4 öpace.  Names are resolvƒ 0 
[ Á  > < by,dsearch¬2o a, i.e.É E o_]modul´ econtaiý_,¸ ^rbuiltin¾s˜ ,b µ ² 	 $ "N "ÀÃ B is å :ed c ¬first.  Ifd  § ñ h�not found§ "re® x - j 
a x ² iŸ Ímust precede•blistedo Q Á a 0hasÄ   s8¡scope as aU H
Ä xc ø K HJ_ ànearest enclos]l  òka freeŠod N £ Øg†L >  �rtreated× 
Ê B ;1non	=!ca$‚correspou&4to öÃ Ápreviously bD® i.@funcì&EÀ Ð"SyntaxError"@raisòt compile time i·RgivenñKdoesc <notÁ Pexist°7anyÒ¤ – F  ‘, ðû1a mB ³ ó automatically cÄ ¤Á 
Îab N ƒimportedDmainl ‚ascripty Llway † ,ed` 0"__J =__"ƒ+ ÁClass definiÈ º0rguŒs"ð"exec()" and "eval()" 6'
  j'are\n ð*special in the context of name resolution. A class defini J is O ,ana òexecutable statement that may use andT et ‹s. TheseZ ¬referencesb afollow¿ ñnormal rules forQ Å á with an excepÃ 
À  ™ ` ðunbound local variÎ ô s are looked upAaglobalx kspace.Ç -Thƒ i,  v…gqbecomesã Ðattribute dicÂ ;aryd ,ofÃ V \` scopen { }dÃ aäPblockß{limitedb /tob  ; ñ; it does not extend toÂ Bcode& s„ lmethodI>â€“c ñis includes comprehensionsEògenerator expres Psincey ' Aimpl¢ Ô¡sing a funh6À.  This mean‘aÍ¬’<ingÃ ¬will fail:  #  ŠA+ Ñoa = 428     áb = list(a + iià¬range(10))9  cBuiltijprestricà-ioù= r ¥**CPython —añ@ detCñ ** Users shouldj\touchY C"__b¾ 1__"›2is Â  lya ". ` O @wantðto override valuež i n ¤ 
nŒ"import"b  ¯"E r" modul(µmodify its 	üs appropriately.N  ?The¢ PassocC d& … Ý ©!a º
Ã îb Ñis actually f<!by+ 7!up$ { š ¡ Ú 
b Rc  ? 50; t�Hbe aDor a@(äklatterÒ=cas™ m|Hâ€™sW  isºpd).  By@ ault, whenÅ  9 
Å �"__main__ìa , ]¨4-inÄ ;n 
j àany\n'
       ð8    'other module, "__builtins__" is an alias for the dictionary of '
 G  y'the\n' "P "e Œ itself.)  aIntera| ü with dynamic featuresA = 1  °Name resoluò ð of free variables occurs at runtime, not 
mcompil 2 ñ. This means thateüfollowing code will print 42:¨  Ÿ   i = 10  }def f()D Ád ?(i):   S /42  -f(/ & ðThe "eval()" and "exec 1funÓAs do<áhave access to
LLfull` ±environment¨µv?€names.  Ìss may bÔoved ina  Mlocab  µ qglobal S 0pac f@ ªcaller.  F1areÔ 
Á � ,edÅ � ånearest enclosÄ  q T, butµ Ž +. �<[1]c ˆ{ Ó •ˆ� opòpal arguW �N �override�  U A'æ.  If only one ¯ iÁÐspecified, itŒAusedà@bothAq,
 'nonq A': 'à  p" state¾ º O  '* *  4   d ´_stmt ::= " p" ident¹ Xr (", .)*N  Æ ` cause&`e listÁk  ¡j referX^  'tod ÷previously boundÕˆ]scope^ žexcludinge sãñ is important beÍ ;`defaul ahaviorã	4`  'bine  'á q searchO g€first.  W  aasÀ  'encapsula_}Pto re $@outsúos ³ 0 be; Ç"" (€!) 3  ÚD>  'F Ñ8n a‚ç p, unlik£ðose listed in '
    f'a\n'
 þ2   '"global" statement, must refer to pre-existing bindings in anO `enclos* ²scope (the  äin which a newJ ¼ should be › ~createde `cannot3 þdetermined unambiguously).6  ÁNames listedÑ ‰ "nonloc q Ícollide with®  'c 9 f ¬ žSee also:d  ð  **PEP 3104** - AccessÎô  in Outer S¦sB @   T¼ðpecification for ¾ ( Ç ý,
 'numbers': 'Numeric literalh +'* ‰ ' ûThere are three types of nl ñ: integers, floa¿
cm'pointc Á ð , and imaginarya  Ø .„ ¿no complex ä (" X @ can¼Àformed by adTs a realh } b'� ê40Not/ at\ 	‘@ do Úüinclude a sign; a phrase lik™]'"-1"5ðis actually an express4 ÿ @osed¥ <uNûoperator â€˜"-"â€™R'~=thej iG "1"s × - yBEmulò L †•.   -`followþtmethodsì1def¥Ato e› e‹
“’ pobjectsà 
°  $'M^ qorrespo” ÞV‘ions that( à`supporço  byÖÙ áparticular kinÇÊ  iú 3üed (e.g., bitwis3¶ ' 'ž ?foro Anon-ºr's)&sleft unR"] Xÿ.__add__(self, other)2 ?sub2 ?mul2 /at5 xtruedivk Àer)\n'
       ø'object.__floordiv__(self, other)\n'
1  7 ?mod2 ?div5 :powg ¯[, modulo]£ jlshift? 5 r5 !/an?xor™ 1 ¹ÿ%   These methods are called to implement the binary ¯arithmeticj ðoperations ("+", "- * @ /  ?%",i "1O()",j @"pow" 1 "*^  <<Z  >> & ^ Ÿ|").  Forj Ïinstance, tok �evaluate"ÿexpression "x + y", where *x* is anl _ of am Ñclass that haN P"__adg#)"ÄT, "x. 0y)"w ³ç.n rThe "__q5__(c “ should bö aquival'oà _usingj "q`)" and{ d)"; itu 0noty Ó Qrelat»l 
BtrueÜq)".  No¿ ats [$)"o /beÒ Qdefink  acceptr Pan opøÑal third arguW!if81ter[1ver=o ä �built-inp þP funcw   to5ŸsupportedöU `If one 7tho1Pdoes ”\ Ð ê<@with( n  M 6lie*'s,Äreturn "NotI¢?ed"Õ ìrBèOrsubªOrmul3 /at6  ßÓ À           'ýobject.__rfloordiv__(self, other)\n'
  '8 ?mod3 ?div6  :powi ¯[, modulo]¦ jlshift@ 6 r6 "/an?xorœ 2 Áÿ%   These methods are called to implement the binary 
¯arithmeticj ðoperations ("+", "- * @ /  ?%",i "7O()",j @"pow" 1 "*^  <<Z  >> & ^ ÿ|") with reflecteds �(swapped*1   Û Dnds.PBfuncë  RDonlyW!ifMOlefto L _ doesã ¢not suppor�Òcorresponding�  € � [3] andt ºo û/ofr adifferðypes. [4] For instance,3�evaluateq ÿ expression "x -q õy", where *y* is anl ñ of a class that ha  ã Ï"__rsub__()"o @, "y	0 0x)"y ‚if "x.__ ?y)"Áoreturn¼T*NotI[Oed*.•  Q   Nobaat ter–ó` will "trs N)" (theo Pcoerc±ÿrules would become too complicated)Í #:}  ‹IJRrightò°ndâ€™s type·Ra sub$o, v @ t 	[ Pa�_ ¶provides a 'vS
 Çz
 �¡A for]¹ äc, thisÃ{ bÛá À              ' ñ+ before the left operandâ€™s non-reflected method. This '
> 	 ¿'behavior\n - ñallows subclasses to overrid‡ ÿ ir ancestorsâ€™j ¦ otions.m  ÿobject.__iadd__(self, other)3 ?sub3 ?mul3 /at6  truedivm _floor8  /mo>:powž ¯[, modulo]{jlshift@ 6 r6 "/anÜ ?xorœ 2 –ƒ   These—Às are calledR‘implementÚ0aug /edN¯arithmeticm `assignF ±s ("+=", "- * @ /  % 
 "*5 m 0"<<< 1">> & ^ \|=").ü _shoulÝ Ÿttempt top !do'Vð in-place (modifying *,ß*) and returnN Koresultq �(which c· °be, but doet`t haveÅ  v .  If ar ospecif¾	¼" i` �defined,õ ã_ fallå0ack� ?theà dnormalœ°.  For instÛ€, if *x*� %an ? ofß !a +n •with an "×#)"|  , "x += y"n qequivalom O"x =j x:py)" . O:@wisei 2.__V   'ýRy.__r) 0x)"¹q €consider®1as ê  a`evalua 7 ä o y". I”ð certain\n'
      ð'   situations, augmented assign ù can result in '
B  €'unexpec9 �errors\n( ð+   (see Why does a_tuple[i] += [â€˜itemâ€™] raise an excep¡ | �when thes Aaddi@ ðworks?), but this behavior isÝ Ïfact part ofn �the datan omodel.   ÿobject.__neg__(self)+ ?pos+ /ab+ oinvertY › ñ   Called to imple@ 3òunary arithmetic opervh¯("-", "+",m ÿ"abs()" and "~")u% co¬ xõ ¤/in + Ofloa- à MÐbuilt-in funcÙ3s "Ä O()",QC"int-r "± ð()".  Should return a value Ð¿appropriateo Otype�%OindeŽÄ 6"o1or.\ & 6 <OeverÄ ¿Python needÑñto losslessly coA ‘` numerìÞ �an integr 9o (suchâ a¬�slicing, ¾ A"binå C"hexöä 0"ocm d£). Presencðis method indicates thaZm   isø*Ke  MustŽHd’   If "__Å .1"__ö$__)3"__O rÐ ¯ot definedÔ t Öcorresponding¨] Ÿ%, ƒ°/ank ð	 fall back to "__index__�()".\n'
  ' ÿobject.__round__(self[, ndigits])8 Strunc8 - _floor- Oceil, � ñ   Called to implement the built-in function "ú �()" and <o"math"m L 1s "a()", "í X "Î  Ÿ Unlessi *wO* iso BpassÜ "¸ À  llä ÿ	se methods should returns  _valuep  ofW  + â "at� ÿan "Integral" (typically ao o"int")¥O   T¼0intb falls backòÄ!__º  __1 /ifï âneither "__int0 #no 2dex  is definedÍ B,
 ' as': 'OV1s, ZsZMtypeÕ/'*   Á#'*f ò* are Pythonâ€™s abstraÞáfor data.  All [ in a'? u ðprogram is represenú#byÀs or by relaNŒs betweeþ]. (Inf �a sense,(àin conformanceÐ¢Von Neumanà ýmodel of a â€œstoredT º ðcomputerâ€�, codeÌ OalsoÑ .ÅzDEver0 haàÐ identity, a ëÌ a }n2 ¢­ *> ð* never changes o!ite bW0cre|ü ; you may thinkÎ]of itf 'asÈ ˆ P addr�¢in memory.jðâ€˜"is"â€™ operator I<areº='th;'Ï  ¥3twoû !s;€ 0"idƒ5žE K-erº |uing itsn |	î­2**CÝ
«ó  detail:** For %  , Ÿ 0x)"' 
M''¡ I�where "x? š£ A>“determine´†0ion aËpÐ '
          ÷  'supports\n'
  ú6'(e.g., â€œdoes it have a length?â€�) and also defines the possible 'R ^valuei ðfor objects of that type.  The " ü()" function returns anb G >â€™f  F ‘ (which i< - ð  itself).  Like ¯ identity,c *d *^  ýunchangeable. [1]c  ð *'*EsomeBcan Q C.  O0awhose 2 M canQ 1 ð are said to be *mut– %*;^ I ,isXË d @onceøyg rcreated ”alled *imq 0. (ä ± ?of ³  - ” containe ¡s a refere <o aµ t ° < /PP whenÂ p latter@T#is$ ¬d; howeverg =thec ¤  erPstillÍ …sidered â �, becaus?b colleâ‹-ofb ½—m sÒ 0notá÷td.  So,p Pility‘ =notP �strictlypsame asñ0ing,|is more�subtle.)f #Anqc¡– Ñdetermined by‡ O ; �instance,R �numbers, Á  ngÙ�d tuplesƒl�while dicMarieç=anda BlistK ¯ =le.#  ž wn4pexplicia†destroyeR,�yJ^becom`punreachÄ ±Py mayøƒgarbage-KeÑAn implementa@iaallowe “postpone M ˜ ª0mitûàaltogether â€” µ ema Ü” 1quaŸ?howy ³  A 0ed,­ lo«Cs nod¶> “‘› Rá�**CPytho[¤detail:** ! `currenù us”âÄ-’ Pcount�ð scheme with (opÅÀal) delayed :Õ X�cyclicallLðlinked\n'
         ñ   'garbage, which collects most obj ÷as soon as they become\n'
  ô'unreachable, but is not guaranteed toc  z ½ containingQ ð
circular references.  See‡ ñ documentation of Ë"gc" module Ÿ =forb cinformB nŒ qrollingN ` dcyclic¹ .` OOtheb  Emple§ ‘s act difÐ ñtly and CPython may change. Do<Ä mdependÇ óon immediate finalizÕ fÆ@whenÖ À °Ì =(soe ðyou should always closp ýles explicitly).;  0NotÅ at‘ D useÀi/�â€™s trac‘Ÿor debugg+¡facilitiesFEkeepù Calivn w¿ nô ll	ù ò ÄÇ 1Als–M Pcatchš �an excep‰òwith a â€˜"try"â€¦" L"â€™o Astat" Æ ” 9 ESomeû ]A ƒðâ€œexternalâ€� resources suchævMopenh  fi÷�or windowšIóÒunderstood thâ'see .ar›>reeÖ±Î  O5-§"ediTsince™d,  Å-isÇ ¡rhappen, û�provide ðïm ^way t<`releas8$e {`, usua�1a "T­()" methodf~ProgramÉ  W strongly r¢Bmendt�´éÜ ^.  ThÎÁSlÍ%™ ³»1theë öá .r±convenient F¯to do thisÞ3oˆ4 s;a0se ÖOcallv *4�ers*. Exa’s  O Ðtuples, listsê 0dic1ari¹ Thú m “ @part[ a{Qainerô|value. ^I‡©0casŠ 1Âwe talk abou_M f Àontainer, we§ imply '
  k'the\n ñvalues, not the identities of ücontained objects; however,a nwhen we ’talk aboud  mutabilityd $a b qr, onlyv 
ˆ µ É µimmediatelyQ ³ A areñied.  So, if an im� l´ • ô  (like a tuple)] ós a reference to a K 7_, its€ changes” EthatI : 3 is" -d.A  ðTypes affect almos Pl asp½ rW ð behavior.  EvenwN pimportaã #of$y™ i üed in some sense: forlt´ Ñ, operations Âcompute new ¨ý may actually return a¶ 
˜´ny existingÂ @withð ` same  B ande Ö i   á ñQ ¶  is MQallownüE.g., after "a = 1; b ==1",É 1"a"™ 1"b"û !or  ` ä  x ¶Ç †  Ü 5Bb ±one, depend +Qement�T, butÁ ‘c = []; d ".="c"e  \1"d"† guaranteed½ Æ awo difP t, unique,û-lyP òcreated empty lists. (Note9"¥ ¡ a assigSeï7d £to both "cƒ²d".)\n',
 '©ñ or-summary': 'O½�or precedT Œ.'* -  `The foi ¼btable “ 0ize�eT	— y– ÿ in Python, fromx whighestë ! (i!biG)Û ÿ
$ 
yx o(leasto V 4.  fspúpbox havþäk ��.  Unles”- ` PyntaxÕôexplicitly given°1orsÙ�binary. _¼ í u  – Õ  group leftRÝright (exceptbÀ           'ÿexponentiation, which\n'
  ÿ'groups from right to left).5  ð Note that comparisons, membership tests, and id¨ ?ty � , ll havew ñthe same precedenceb  6 ! aÐ B-to-á �chainingw ¯feature asr Ðdescribed in  Cð @ sec}B"/+- 2 +Î ¯| Operator% |>Dp9  |� = |1 u 	ú	 "(expressions...)",  "[ ¿]", "{key: @Bind`öor parenthesized L ?,  � 
‘value...}p 8  ™ #}"D o| list”±display, dišEary  ?set� h  t F ìD2 
�"x[indexÿ : Ï 0Sub9ö, slicing, call,H Ð| "x(argument ¨Í"x.attribute� 4 a refer7… 
 � ]�=�await" "xí µ 	 AI ˜	7  €'**û À              O| '
 ÿ'Exponentiation [5]( ?|\nA /+- 2 +u ¡| "+x", "- ?~x"¶  âPositive, nega
 ³bitwise NOTE €*@ /  %
‘Multiplicƒ, matrixù  |% 	 � m� ó division, floora � T} Ìremainder [6#� ìD2  -F �AAddi±and subtrac <  	 € <</>>`Shiftsæ  	€&û × B3AND,  €^=?XORû  eÀ'
            f'| "|" 
 O| '
' ¿'Bitwise OR   ?|\nA /+- 2 +u Ò| "in", "not 
  is `is not
 < = O>", ñComparisons, including membershipA| ">h ! /==œ� òtests and identity  …  � ]µ2 � v? "xû Ã ³Boolean NOT,  €?andþ  Ò 0AND)  €/or“•ŸÏf" â€“ "elseüConditional expression€olambdaý Í LI ý @ &Ú=:»  À'Assignment ¼expression  \|\n'
  ?'+- 2 +u  ÿ -[ Footnotes ]-)  ð[1] While "abs(x%y) <  ÿy)" is true mathematically,  ßfor floats itu  M¢may not bec Rnumer` ÿ due to roundoff.  Foru Ïexample, andt òassuming a platform on which a PythonÁ  û /ant ÿ IEEE 754 double{ ì Qprecilÿnumber, in order that "-1e-100 % 1e100"x ßhave the sameí ’sign as "S ,7 ð computed resultæ } +v B )v 8is ÊÐexactly equalÔŽ o.  Theq �functionl "—ô.fmod()" returns aÜ awhose matchesp R 0 of'w ñfirst argument instead5 soˆ X"í1¯this case.t W£ppproach·`more a àpriate dependsÑ Ï r papplica^t Ž €[2] If x„ pvery clgato an ïÿ integer multiple ofzŸy, itâ€™sr B€ossible b`"x//y"N be one larp /th²@"(x-Þ; as ~Ñing.  In such©$s,(q n_latte£n ÷t  o �!erì  0divæÿx,y)[0] * y + x % y+6be  w oto "x"#!3]ÊðUnicode standard distinguisy‘between *% œÏpoints* (e.gŽ  pU+0041)ôà *abstract cha $erE ð
 â€œLATIN '
               ó'CAPITAL LETTER Aâ€�).\n'
! 
 ' ðWhile most abstract cha ÿ	ers in Unicode are only O ¿representedt ¡using one Y öpoint, there is a number of” u ¬ t €that canÒ Çaddition be µ  ˜ ¯a sequenceê Ïof more thanw 
å á.  For exampleó â Ê w �â€œLATINs ÐC WITH CEDILLú /asu  a ®/leu Æ*precomposed@ * u =2poss¯U+00C7, orr  „w  "o *baseu A43 (>x 9r [ð
C), followed by a *combinÚÊ ºu ôU+0327 (COMBININGÏÞ	S  Th~ðmparison operators on strings Ñ ö at�8�level ofq Gó°s. This mayŠÿcounter-intuitiv’to humansPx mP""\\u}R" ==   43 P327""z�"False",ë ÿeven though both{ HdGOsameöÞ}  öÅ %ToÐ øÍ ëQ(‰?is,v –in a way ö_), us""u±ÿdata.normalize()""ð[4] Due to automatic garbage-collecKÿ, free lists, andÆ¿the dynamic@natus�f descripŸð, you may notice seemŸingly '
  ÿ'unusual behaviour\n+  @ ÿ!in certain uses of the "is" operator, like thosex Ÿinvolvingp ñcomparisons between instance methods, or co Ots. t PCheck° iæ ÿdocumentation for more info.°  Õ[5] The power(ÿ "**" binds less tightly than anÈ Ïarithmetic oÊ Öbitwise unaryz €on its rq ,p _t is,q ÿ"2**-1" is "0.5"#6&"%+ R @alsoMdi`string �matting;–  yOsamex ²pprecede0papplies¾ À,
 'pass': 'š" p" stateú	T /'*  
" 
 0   P ¢_stmt ::= _ 
% 
 " S null¬ €`â€” whù ¦ð  executed, noth-ˆhappens.*:'Ita  iseòful as a placeholder] aý  † ‰requiredT êsyntactically,` ÷but no code needs to be¯  HŠexample:< 
 á   def f(arg):J É�# a func”•that doesZ(yet)I 
 ¦   class CT 0   W  @withÃ W R , º-
Ç	f  , !   ~
Q s	
Å"s ÆP ƒleft; itF YF = _ Jx isÃ+ '(   4ÿñ	(await_expr | primary) [u ]@  qThus, iñunparenthesized sequà#ofb;andòÝ;'th7'¾òs are evaluated from Ñ ^e (this~"! 'ˆKrainÁ  ­U  Ô ory   | ðnds): "-1**2" resultsó <"-1rnEÀor has the sõame semantics as the built-in "pow()"\n'
  ø0'function, when called with two arguments: it yields its left 'J + a ‘raised toŽ �power ofD Urightc å.  The numeric sf ea Òfirst convertj ña common type, and} �result is� Athat  .P  øFor int operands,K hes{ m v. 
½ kunlessa  ¥esecondô  £ Ñnegative; in ­ 0casÍ %ll( Ls ar		Qfloat "a  °delivered. ä ‹example,ž ð"10**2" returns "100", but 8**- _0.01"PÐRaising "0.0"$a ë  £ sø a@ý"ZeroDivisionErrorn _ V bnumberk 1fraï/alm  cox2O ð. (In earlier ver“   ñƒa "Value§ )X  Th– c �ñ can be customized u5,úpecial "__pow__()"&`method‡A,
 '� @': ']" p" stateØ‡ * $  "  ò ¤_stmt ::= e p[expres– ["from"  +]]I  WIf no0 ì Q Eent,e 1re-Ô í;las–PexcepT_ R@was  vem ]ôcurrent scope.  † E  ™1 	F-in_  ¾L ³, a "Runtim ›  V Å Íd indicatingQ  ¯ &pis an eþ äƒ4 pOtherwi6”‚evaluate/;”¾š Q `object`t must¤ eif à a subclass or¡ »instance ofF d"BaseE˜ ".ei—!a B c…  K lwill bò`obtain¶ Â“needed by7 !tiO¶^ ÝnÜG 9*Ý*8eº 7¬ Gâ€™sÎ *‡ e*ù ? á oitself� ð
A traceback object is norñmally created automatic µwhen an '
  É'exception\n pis raisE ðnd attached to it as the "__traceback__"& zribute,d ^which` ówritable. You can¸  ¤ — õ and set your own s 
e iÂ âone step using± Fwith´ F()" i �method (® 
\ {returnsÃ  GsameD  instance, j G its¯  Æ @s^ «argument),a ‹like so:  "  ª$ EËð("foo occurred").� ÷ BKobj)N  Tçðfrom" clause is u7forù ñchaining: if given,r	Tksecondb ù*expression* must be anothea „lass or c@. Ifc O d  U  ± 'an« A ,ÊAwillq á	´ ;theb 9c"	
O4is ï*).ÿ+Ifa  XÀ c
^  Ä 	¸ æ  ti`  R d `resultÌ 7 %ceU ú 5 	e _ M 	¿¼d ;notb Öhandled, both: sµ printed9|>>> try) a   ...%K l(1 / 0+& ð ~ ?excT 7ð RuntimeError("So€ � bad happen¼ } ä }  T‘à (most recent o last)˜  þ  File "<stdin>", line 2, in <module>k €ZeroDivi»Æ 3: d ‹ by zero5  0   `HabovEw8Pdirec»  woíp follow'	‰„<ionÞ r  !74!â/: â¡  ð"A similar mechanism works implicitly if an exceptõion is raised '
  ™'inside\n �an except9 ÷handler or a "finally" clause: the previous6 	P +isa ñthen attached asF 6newA ðâ€™s "__context__"0 {ribute:N  ¬   >>> try) a   ...ý Îprint(1 / 0)@  & C Oÿ RuntimeError("Something bad happened"c x ÿTraceback (most recent call last)�  þ  File "<stdin>", line 2, in <module>k ÁZeroDivision½ 3: d ‹ by zero5  `   Durë " 	 !ofÉVaboveË–, another 
„ŒoccurredÝ q  84 Ø/: Ø¡  ECPchain!Pcan bðplicitly suppres˜ by specify+ 	Ak"None"` !innU"from�$  � À  á ­ >... š@AddiG al informa ' ob#s Pfound¶0sec& û PsR ) P eabout ‰¼@ionsø*inp_ 0The4¬ statement{� `Change‡ @ verGb 3.3: ¬ x ²now permittæ0"Y"ß ":XQ /Y"w 0NewD 	s  » 4"__L5; toz† @auto¥£c display ÖT ” © á,
 'return': 'ˆ  "H
a ? '* &  2   Z ²_stmt ::= " Q" [exEð	ion_list]\n'
           f'\n'
  ú-'"return" may only occur syntactically nested in a function I `defini ,d �not with? K fclass 5 .5  ÐIf an express €list is  aent, i ü
evaluated, else "None" isQ ¿substituted} &öleaves the current +è  ª 
.<(or� © R) as ” Ê eœ UWhen ¡ ðpasses control out of a "try" statem¶  �+ aÄ@"finð"œ Õclause, that &    …@execJ  before reH  /;ingg <thea Uî Iƒ•generator} › eè qindicat´/at‰ [ ðis done and will c€ "StopIt€ ûion" to be raised.` Té ro"edÝ0 (i× y)D@usedþqan argu§ toËlstruct4Š  © Qbecomí eª .N¯" attributY kö n asynchronous ±,–Fmpty~
ëŒÀ › Tm ‹P A¯ ŸŠ A non-e° ¢ ¿4aqx error" Óð,
 'sequence-types': 'Emulat  ¯aainer  Ú ¯/'* 1   The follow~ °methods canÌ• edÚBimpl0	Ô‘ ¸ pobjectsí `* AContâ Qs usuTare *€s* (such"ÛZs" or‘M ­"tuples") G$ €*mappingY �like "di¸0ari; Q, butó #reC_ othet ë Ir ¡as well.  _qirst se€biþ Qed eij /toá e?e aÁ7 $5to 0  ö ;„ðdifference is thatN '
  �'for a\n ñsequence, the allowable keys should be Ïintegers *k*k �which "0r ñ<= k < N" where *N* isb ‘length of › /orp ÿ"slice" objects,t ” àdefine a rangeg  items.  Itƒ ÿalso recommendedu ßthat mappingsr bprovid9�methods "UÂ()", "values …  £@"get k `"clear" ± "setdefaul2 R "pop 0poph  Acopy
 q ?andl ðupdate()" behaving similar to those q¯Pythonâ€™sFstandarj ¥dictionaryàÑ.  The "colle ßs.abc" modulej ‹s@"MutöMÕð" *abstract base class*á ¯help creatn óGbfrom a] 0set‹`"__get¤!__œI"__s ­f"__del8 s 5and�#. ñ  dì- Á Sp"append¨ p S"coun†Pindex- S "ext9 s "inser# ©å Premovwãp"revers$  ì #so\ Rlike � v "list"ß O.Ü …Finally,?U typeDàimplement addiÅh �(meaningh �concatenaD )× ‘multiplic  B @ rep-ion) byp  ³?thet ùf"__addŒr i ²R__mul? k D"__r% Ý E"__i €describe€@low;y“u Anot ä Þ ö	other numerical operator êObothP ½ å b k±"__contains&r e†s `effici\ðuse\n'
             ò'of the "in" operator; for mappings, Ñshould search4 #'
E  '7 oâ€™s\n# Bkeysd ìsequences, it c Brougk Ÿvalues.  Q OIt in õfurther recommended that bothæ 0 anÝ � h �implement Þ ð"__iter__()" method to allow efficiB  $ ‚ation thé Ü ?thej Žcontaine±ƒ Vp eÚ „ n `objectØ Ák U Ù  Øá  ‹ ï.__len__(self),  p   Call)o Ùá built-in func£"len()"�Soreturnr  kslength yË ñ, an integer ">=" 0.  Also A; Ìs ùdoesnâ€™t define a "__bool¢ ÿOwhos!"mÕt òs zero is considermÿbe false in a Boolean˜ ãOext.m  Æ   **CPythonÞpÓdetail:** In $ ,Ò„ ±b†   requià ò	at most "sys.maxsize". ImQ q  ar?thaL		\ ó	 some features (such as ¹_) mayn Oraiscð   "OverflowErrorpTo prevÆ = <ing% / bn Rtruthø¼qtestingýç?musÃ$Y F�gth_hintN<"S.ôd I2Ú@ ÿ
 "bmated [  ´ `× ` (whicàðy be greater '
        ø'or less than\n'
  ó'   the actual length). The ÿ
 must be an integer ">=" P 0< n ðreturn value may also` ÿ"NotImplemented", which isk ptreatedÀ p  same as if) B "__å ÿ_hint__" method didnâ€™t exist atv 0allã /ist S �is purely<ðoptimization andØ ïnever requiredq ?fork Ïcorrectness.'  à   New in vers˜ ?3.4F _Note:c  �  SlicingÐdone exclusiv/Awith®`follow' _three"o_s.  Ap Ÿcall like#  *¯a[1:2] = b'   â btransl®o*  � ÿslice(1, 2, None)� $ |ð so forth.  Missa_ ð	 items are always filled$ð«"� ":Àobject.__gety ß__(self, key) Q   Ca¬ Dto iH  eiu@of "` ¿[key]". ForQ¯*sequence*n atypes,§Paccep‹°keys shouldÓ0sðaF
Â ª0oteÊtr qspecial’Urpretã negativ,’indexes (à ðclass wishes to emuÂ6 a  )â up$ Þ /thu   ’ )� . If *key*^  ofCÏinappropriatà  ‘ ,Ö ±"TypeError"~ be raised;" h ›`outsidsk sset of Rt 2forµVÏ (after any ÉLßo À            ý0 '   values), "IndexError" should be raised. For *mapping* '
   Ï'types, if\n! ð   *key* is missing (not in the container� 3KeyŽ M ¤ n ¾ "  �   Note:    "fBúloops expect that and@willbÞ º O form 
�illegal i½ñes to allow proper detection ofc?end¾! n 
Ÿsequence.&  Q*àWhen subscript4¡a *class*,Ô �special  Þ omethod  Q  "__B ð_getitem__()" may¦àcalled insteadN¸)"_? *+MSee u ‡ versus I  _ moreÝ detailsm ÷ ¥object.__sò ¢self, key,)<  B   C,ñto implement assign @to "g Ï[key]".  SamÚ pnote asq ud  ThisÆ1onlÃ�  edP LäsÇ ®>ò s support chang„  Zj �keys, ors `if newuså 0can‰QaddedM Dfor ’ ¯ " el#s + ¢`replacÔO Theq s—PexcepAOÛ #imjÙs È 7Ì ¹Û'3delÍ tÛÔ5@dele Ò ¼
.Ò5Àn'
           õ-'   the objects support removal of keys, or for sequences '
E 	 ï'if elements\n# ’   can bee qed from† ^ ÿ.  The same exceptions Ÿshould beq @raisi ñor improper *key* values asß  ¶ ÿ"__getitem__()" method.t  hð.__missing__(self,f)5  ü   Called by "dict".¨  toò “´"‚ a[key]" I s ð subclasses whenº ¡ is not inÇ A oionary 'Citer!CThis¤ � c'° @an *^ Pator* �required ÷a¸container. v —Ôreturn a new w j P that#t I ¡e over allw? s†˜ O Fort Ïmappings, itq Î 	x  -  %  q I  º ¿.__reversedú(À(if present) ¡ "_  Á`built-²o2imp8· 3   R Ú“ion.  It /ý$p �sú Ï¸ _order¦Q   Ift"´ W ‘provided,- ‹ –ú °`will fõ�back to uJb AŸ protocolÛq("__lenËt Kand QS).  O-©2 aá • r 9@onlyÄ  = ‚ ¯ A)" i|y$à x5 anl À            ð  '   implementation that is more efficient   že one '
  ï'provided by\n# ÿ   "reversed()".(  ÿ%The membership test operators ("in" and "not in") ar¯ normall¬ °ed as an itj %ðrough a container. HowÛ ,* Ý ð$objects can supply the following special method wit‚ j
¿s ä üð, which also does GqrequireŒ £ / bT"?bleÙY 3.__&�s__(self,u/m)À  Æ   Called toá;Ÿ.  Should¼¿return trues �if *item*@@in *Â ð*, false otherwise.  For mappÖÀs, thist s· �consider¦qkeys of f  ra Çv Ÿvalues orr  ”@key-ê o pairsî ä  • ùt donâ€™t define " )"	v¼ °first triesYr÷@ viap  ½3__(l îsequenc
0„protocolk 0get?n  se^/is}1secši“ Þ àlanguage refer�  šó,
 'shifting': 'S 9>ion`.'* y '   l ` ð have lower prioritÜaÑ ¾ arithmeticQ Ý ¤ :  1    ²_expr ::= a | °("<<" | ">>"" L  0TheÈpPaccephategers&0rguL‚s.  Theyw Šr'Œe aB  º kð left or right b8@e nu ä bits given d ,th À  'second arÈgument.\n'
  ' ü$This operation can be customized using the special U þ"__lshift__()" andg G"__r$ methods¢ �A right ? ð by *n* bits is defined as floor divisÊ .by© Ÿpow(2,n)"y  _A leff ’multiplic0Owithh ó,
 'slicings': 'S %*   #A T ý& selects a range of items in a sequence object (e.g.,³ ab ô
string, tuple or list).  Á @ may-"us�`expres}s/ '.asd PtargeÊ€n assign¸ = °"del" state Ps.  Tƒ½yntax for aÄ :g  %  @!ñ ::= primary "["  e_ò O "]"@ #    @  €  e_|D (",D   �)* [","]H  '  H HP | pr�_\ ? ! ‡ ö[lower_bound] ":" [upp [ ž[ïOde] ¥ T ¥ – r 0 ~ ‹0 r PThere�ambiguityþ µ‚formal s9 ' r: anythÖ-atG®looks likeh 7an žValso 4  sAlice.@, son d €subscriptf …’interpret_a•ñing.  Rather than fur Ò3com¨Àh 0, t M"is@as "by^)"in* @caseQ ² a•ë ` takesi or¤!ovÅ i J 9$ (°  à�  if�  y› ³contains noT/ ) > |ƒemantics “ 1areTollow©L-isüoindexe$ (k ame "__getY5 l nÕFÐ) '
         ð     'with a\n'
  ñ.'key that is constructed from the slice list, as follows.  If  Q 0 h  A  a ñ
tains at least one comma,M  Ž �is a tupl n0 Ling g >thee Âconversion ož Ž ò items; otherwisem . e ?lonf  T  5 $�key.  Th² ‚ a> € fe .anÉ aexpresÉ "is:  k cproperr e  Ug Ê ðobject (see sect? Ì ýstandard type hierarchy) whose’Ž"start",g ð "stop" and "ste Ñttributes areûdvalues¸î si Ogive4 ðas lower bound, up { Àstride, respæ ]vely,] ÏsubstitutingÊ  àNone" for miss™ª €.\n',
 '` õialattrs': 'Special Aö Z  ‘-'* (   ³¡implementaÆ0addMCfew ” ° read-only Ÿ „.� ¯to severalo 6 bs, wheÈyÑó relevant.  SomeÖ!se n Ïnot reportedp b¨ñe "dir()" built-in fun³ }
ÜÇ M ½ Ÿ.__dict__%  P   A 7 ’ionary orXP mapp\ ` used E|tore anjž , Oâ€™sm §(writable)²í  inÊ¯ce.__classð  Z:  Ð ‚which a  \ � belongs™ C .__base– #'0of C “ D  a– `defini@.__name0" 9 ÷˜ ,ªð, method, descriptor,HŸgenerator!ƒ	å À         '\n<'
  ÿ'definition.__qualname__\n-  €   The *> `ified D ð* of the class, funcg ¯, method, b ïdescriptor, orp ÿgenerator instance.,  ÿ   New in version 3.3B Õ o.__mro- Ðis attribute  ` tuple2Y ÿes that are considered1Owhenå ó looking for basŒ`es dur Šp resolu� _mro()‚  /#isð can be overridden by a aß to customize?thej â a order5its?`s.  ItŒOcalll"atÍn �0tiaL`, and e Qresul] 0stoÉCin "<"s Q__subOes__~BEachÉ Ð keeps a list~Ðweak referenc†oÁ ª�immediat|¥ ."óhreturnx �all thosá‘ z±still alivem eÓ iâ äþ¿.  Example:Q  <�>>> int.…"4 ![<®Ï 'bool'>]\n"‹ v ÿ -[ Footnotes ]-%  q[1] AddÞ‘al informœ0 onœ se specialp€hods may�ò0fouÑo S ” Python REå Manual (BasicË‡ )ýP[2] A6 0equ£,t ¿�"[1, 2]"Å5e—8�o "[1.0,> »R2.0]"É‘similarly<°s¿  3](ñy must have sinceÂ `parserqâ€™t teQe typ�ø	ð operands.\n'
         U'\n'
 	 ÿ''[4] Cased characters are those with general category I ïproperty beingm  v ñone of â€œLuâ€� (Letter, uppercase), l s 5low2 !or5 Otâ€�| l Qtitlel ..  ÿ*[5] To format only a tuple you should therefore provide a2Ÿsingletonm  -\ w‹o  element isg | Sto be– 0tedÓ ò,
 'specialnames': 'S � method  { *  *  ó A class can imp´ €certain (PationÄ !atnŸinvoked b]Ë n àsyntax (such a¾ˆithmetick ÿor subscripting and–¯licing) byo PdefinB Hs$¢ V`. This¥¯Pythonâ€™sm ¿approach tom *-ðor overloading*, allow… iaes to ™  ¹eir ownr �behavioro ï reÍ tS ƒlanguageIÿors.  For instance, ifßš • so aŒñd "__getitem__()",¤0"x"I Jt  ?ttv ,o ¡then "x[i]S ð roughly equivalWÈto "type(x).� /x,M0i)"mW €Except w ²áioned, attempt°—execute ag @rais' Ö ek 0ionn Qn no Vdpriatea#isŠ¿d (typicallàó	"AttributeError" or "Typ )ò � 2Setn T4ial‘  j None" indiZ?the0cor™ onm , 
óis not available¶0exaŽµ+O setœq"__iter‹p Ä ,�P {  ;  z P, so n ­" _()" o�/it)o m3ll —  (¼ðout falling back |to\n'
  ÿ'"__getitem__()"). [2]+  ÿ,When implementing a class that emulates any built-in type, � _it isj ’importantZ 3the^ ¶ion only beŠ `ed to % g bdegreeI /itp ñ makes sense forL �object beé ðmodelled.  For exaØ Osomeg ÿ%sequences may work well with retrieval of individual;eƒ_s, buÓ cextrac¦Qsliceu @not î í t.  (OneÐ  z Othist içÙ ð"NodeList" interface ýð he W3Câ€™s Docu8" OYMS/.)* ÿBasic customization? = )  ÿ.__new__(cls[, ...]Ä P   CaK ´ðcreate a new instance†W*cls*. �"ˆ )" is a´ ð   static method (special-cased so you need ¯declare itu as suchñ "  ftN �Ç ¶of which anå Pwas rOstedm /it!Á   first argVÐ.  The remain²  s Ð �those pasõ &AEü¡ constructPpress’(ì 0allÔ  )º¨ ?tur§q   valuæ`shouldú c  2– 9Ù ¯(usually ao A 1of t/).
 ¦   Typical”‡/s á Ã ¯ 2/byj Pinvoká B Qsuper3 c.ð_usingM "A /()Õ"—�appropri¨m!0and9gdmodify¼ bnewly-!d°as necessaræOfore reBÝ À            ð     '   it.\n'
 	 ' ÿ-   If "__new__()" is invoked during object construction and f ¯it returnsp ðan instance of *cls*, then E new  Oâ€™sg r"__init² omethodp uwill beÖ @likeò A ÿself[, ...])", wheret ** * ?then ¿ & the remainLÑarguments areð osame aç ?werj ‘passed toG ¥/or,tdoes noÐ ·	 ÷ ?new(ãÏ  · € »Ò ×ptended � ly:°allow subclNs‘Î �immutablŽqtypes (]ðint, str, or tuple)m €customiz‹ l @cread_.  It@ð
s also commonly overridde_ l T metaÛ /in×�order toj K  · J    2  Ÿ.· Lv2  Ð   Called aft¸ hN‚has been£ oed (byô _), bug�before itørÚtcŠ Šr.  The ÚÙOthosA
ÏksÐor expressionf a basª=  /anGt †‘ derived F ŸÚ ‚O, ifo �any, mustÉ €licitly A \ÿto ensure properµ °Qializ ªˆ	Ã S part/ Z1; fToample:¶ †"super()¹R[args-�aBecaus|n H	Šïwork together ´‹Àcting\n'
     õ#'   objects ("__new__()" to create it, and "__init )'
J   Ï'customize\n ù   it), no non-"None" value may be returned byr /; Q �doing soo ñwill cause a "TypeErrorà  n ÿaised at runtime.J  9ï.__del__(self)*  ð   Called when the instance is about‰ÿbe destroyed.  This 4 lcm òa finalizer or (improperly) aj Ïuctor.  If ak ¯base classÛ 0hast¡)" method,é rderivedD @â€™sîH/)"s > p ð	if any, must explicitly ö ! iIrensure ï Ÿ deletionn  of§ m  b part / ¿GP   Itñðpossible (though not recommended!) for˜ ³ "k¿ £to postpon[!uc
Ç  … f_a newy �referencöTto it»!is”#edz‘ *resurre„ *w ½  implementa´ @-dep ntFItherJm Éosecondl   X En a ¦ º  r¦®/th"cÚnt *CPython* ç 3 onÌsÍ?onc¬e Tù guaranteed that1gTs are§z?for5s\  stƒAexis¡çÿ terpreter exits1_Note:�   Ÿð "del x" doesnâ€™t diwZ5 "xÍo)" â€”l_formea  decr¥ %e #a countÈ0"x"a2onea  k0lat(ik M1"x"Vy Àence count rüeaches zero.\n'
  ' ÿ,   **CPython implementation detail:** It is possible for a e Ÿreferencen õcycle to prevent the 7 ÿ	 count of an object fromm �going tol ñ   In this case,p … Ðwill be laterî Ÿected ando deletedn !by\ *] ðic garbage collector*.  A common causeè F(s•@when-Qexcep·qhas beed ïght in a local× �variable7ò   The frameâ€™sJ së n¸ Æƒ , whicho ësIôits own tracebackP <   Š  -lÜ ¶ sm?ghtp   eo 
@ æSee also: Docu@ ' Ÿ"gc" modue[ �Warning:!  ú!Due  ÿprecarious circumstances under«¿"__del__()"j õmethods are invoked,  )Áat occur dur²OheirPexecuÅp h @gnorh  ¬2a w& @prinÅÿ to "sys.stderr"n insteadïGßIn particular†'* D@ cano% ºÐrbitrary codeÂ _being"  : `includh9Uany ae 0thrò O  If¯ o 
PneedsÆBtake_Ck or u °other block� × ¿resource, iž ˆ€may deadM   aT 4=    alØ y_ ’ On byà   iÝ 
 that gets LCrrupReÕ=` Z d#y 0pre™:ðshutdown.  As a\n<'
  ' ÿ&consequence, the global variables it needs to access P Ï(including\n  p ÿ$other modules) may already have been deleted or seto ¯to "None".o 
óPython guarantees thatå °s whose namy Ÿgins withq �a singleo 
åunderscore areÈ @from]iú @ bef% /‡sn 
c ‚; if no Q PreferÓµEsuchò l Pexistþip  ­òhelp in assuringPPimpor²mÙþ _stillL@vail^ß t4¡ time when ÿ"__del__()" method is callede ÿobject.__repr__(self)+  A   Cw 2 by›  J  ˜ ðbuilt-in function;qcompute* …ïâ€œofficialâ€�s !stv k aesenta` cof an Ó ÿ  If at all possible,ˆ/thòó
should look like a valid Tqexpressß  Tc/ /bej used to× †recreateÇ Š ’sŸÀvalue (given% C¯appropriat¦Ñenvironment).*  D7not/#a j/of³OformÒ ð	"<...some useful descrip°c...>" aÿ be returned. Th@" m `must b©¼ äß class defineÃ"o)" buto  +P"__st9 )";9en ? pis alsoý d¾/anPâ€œinJø$¡instances ª#até iä orequir,p   This&@typinyÚ ðfor debugging, so/ * /an½ 0/th¦ß Q $ >ý-rich and unambiguousüÀ     '\n'
    ú
'object.__str__(self)\n'
' O   ' ò   Called by "str(R ÿ)" and the built-in functions ` ‚"format(: n Q"prin& ¡to computeg Qâ€œinD ñ lâ€� or nicely 1 Oablew ostringo  representaº r of an ã ÿ.  The return value must be al !W Œ   „ ó	is method differs from "P  __Å  __Zin thatž ¿there is nom SexpecI ":$)"
aŸid Pythonk  exVsion: am ð more convenientÓ€concise Ò —0canv_used.O  ?õe default implemíRdefinÚ	È?typLr"m _calls™¶ Ø_bytes¶.F  N a  -k»õ ¯ Æ This should+"k $s"SE  X !__õt#,  OspecË' ñ’Ä,ß/byß0tenÞ,º @   e0T³ Cted u�literalsf  Œ w o.; /()u,â`producŸ2â€œ: 0ted/x X/ofà /anØ •*b _Š`* argu\ baè DÜ �containstdescrip˜ &q ating o ¡s desired.’ j ‚interpreÖÙ ffÔ  upb †  `r	"Ñð)", however most classes will ei³¢�delegateÏ À            ð-    '   formatting to one of the built-in types, or use a '
< 	 ¯'similar\n 
f ïoption syntax.2  �   See F² ¡ SpecificaO ÐMini-LanguageÕ ’ a descrio ˜ é l €standardN #¶ #ðThe return value must bM0str{oobjectð Changed in versWP3.4: p "__Ú�__ methodØ"h "Äoitselfòraises a "TypeError" if passed any non-empty × Ð 237: · .Ô ß(x, \'\')" isÎ ?nowË  equivalentôò"str(x)" rather than ">( ,c � å €€.__lt__(p0, ov )­ 0 e0 /eq0 n` gÀ g`    Ó }!reœóso-called â€œrich comparisonâ€�ò s.7 S ócorrespondence between operator symbols andQ _ nameo_is ask ð follows: "x<y" ¼ Ds "x@y)", = ¯0  H 0 l 6"x=H 4  4 K "x! ø s >“ p 1.__G  .;"x>g ÿ?y)"-[   A ÞŠ4mayS ­Ÿsingleton©ÿ"NotImplemented"Ì ôif it does not i4 u eÿfor a given pairu oK@argu‹ Às. By convenÆ‘, "False"t@"Tru #reê /edi Ž Ó ð	successful comparison. Hüowever, these methods can return '
  ß'any value,\n  €   so ifV ÿ comparison operator is used in a Booleaj ßcontext (e.g.n #ink Pnditij ÿf an "if" statement), Python will callÞ �"bool()"Ü on Ô to determineó `resultæ true orh ofalse.f  ñ   By default, "object" implã ÿs "__eq__()" by using "is",ƒ ä?ingp T"NotI_ 0ed"³áthe case of a Ç æ@: "Tö @if xyp [else t P. ForÚ !neÚ ,Û ? itÚ Ïdelegates tom - anŽQvertsKÃ`unlesse /ish  Ðñ   There are no other¸€ied rela·±ships among… CO× gsz(Åj �; for exa ÿß �truth ofl P"(x<yh ñ x==y)" does notÜ ðy "x<=y". To automatixym 0gen em PorderÒâ Àions from a ésle rootgion, seN ô"functools.total__ ?()"Çš 1See²Àparagraph on²Ahash´o@some_ortan¸ no´/onj Pcreat*\ bable* ÿs which support customjEc  ¸ uso p as dic°�ary keys.	Àswapped-argu§Q versx oA—a(to beO42whe³Uleft i ¬2 Ù[? bu£ & _rightp 	b P); raï,"lt TD"__g /re©Beach-Oâ€™sq Qrefle“e ( e  ðre each otherâ€™s ',
  ÿ 'reflection,\n'!  ô   and "__eq__()" #ne Öre their own P /. O  If- k ñoperands are of different types,} cright + Aâ€™s o Ois am Ãdirect or in €subclass| ~the lefj ,k ?thej ”ed method_ 	Ê ß has priorityd �otherwisrn µ u ` ´.  Virtual ô ?ingÙ ois notn ¿considered.$  ÿobject.__hash__(self)+  ñ
   Called by built-in funÎ  "X ¯2for0 ésæ ¯on memberso  of£shed col6€s includ=â"set", "frozen  <o"dict"2   p Á cÿshould return an integer. The only requiredÜ  pr-/tyÚ ‚is that •Às which compˆ eq'1havwQ same	l ¿value; it iJðadvised to mix togeÚ Z F † ‰ _onent»Tjá óalso play a part inç @ison—/byß packingJ@themŸ‘o a tuple² Ë " S ¯. Example:J  ¾Jdef 7E /   : ‡ (jp.name, uS.nick ocolor)‡?NotÈ  ¡€truncate„!e úëped fromò—íOocustom6"2$)"…!toq1sizlpa "Py_s __t".  OThisÚ	 Œ°ically 8 by× ‘on 64-bit§ ÝFnd 4 Ñ '321 'K  If<Àmust interopÌerate on '
  Ï'builds of\n 0 ð different bit sizes, be sure to check the widthk ?allo Ÿsupportedo “ à.  An easy wayg ÿdo this is with "python -ck 0"imk _ sys;n ñprint(sys.hash_info.Ç O)"".8  ð$   If a class does not define an "__eq__()" method N_houldÁ ?notj V  U ¸ W  opìàion either; ife . sf – m 1butË 5"__l à, its instance’!ll% ¿be usable aq @item: o  d A Êcollections.]TQs mut) oobjecto /anl¯implements  ä " s¡ Ë/ » 
"Qsince: aÎ E of å vù k ñrequires that a keyâ€™sY ` value)$im$1(if‹ p @? t W Pchangpit will!in] Rwrongƒ bucket)CRUser-°dKeÔ  veê?0and  DPÕ dOs byÐ ‚default;P`them, ºÿ
s compare unequal (exceptH “i  [ �selves) ½ 'x.Lq return…€appropri³Ö ƒOsuchm Àat "x == y" {‚ies both, "x"y"Š  E0(x). p  /y)A½r �overrides¶Å&‚ Tô ˆAhave—3 �citly setI�"None". È1WheÌk 	] e Ñù2is ` ,/ofl  3/m Ø AraisBÐ"TypeError" w´ ð
a program '
             ð    'attempts to\n'
 	 ÿ+'   retrieve their hash value, and will also be correctly M ßidentified asp  unc ÿable when checking "isinstance(obj,B ðcollections.abc.HashP ?)".4  ð   If a class that overrides "__eq__()" needB *0ain(Q  implementaŸ 0 ofI  ð K Òfrom a parenty ,P O¯nterpreterp @must™ðtold this explici¤qby sett\"__† / =L !<P— C$>.1 T.vdoes no] \Qwishe]QsuppresL Ô  & ðort, it should includej  # ²__ = None" Àp`definiÖ2. A»q which  ¦es its ownu  =×  kh Àñraises a "TypeError" wá  beä Ž0  <m by an„)€_ call…_Note: Ã ByyBaultB"± vÀs1strÇ_bytesÎ ¿objects areo ðâ€œsaltedâ€� with.‘unpredictBbrandom<¿.  Althoughu Otheyn 0remj!cotq  ins ÿindividual Python process,h  Ú  �p Ç ð between repeateM1vocÐRw  .TmÞi¯Ð  intended to¹ @vide tÏ@ aga/ aÍ ÿ	denial-of-service causedÙ ð	by carefully-chosen inpu ñ n1oit„Ÿworst cas	pperform¥ _ a ÿ` inser°, O(n^2) co
oxity. Í /Seg 	ñhttp://www.ocert.org/advisories/ ð-2011-003.html '
              €'for\n'
 	 ' ÿ$details.Changing hash values affects the iteration L ïorder of sets.p `Pythonf ð never made guarantet ¡bout this U  ” r (and itk ðtypically varies between 32-bit A !64 ¿builds).Seeß Oalsoj ÿ"PYTHONHASHSEED"B } ed in verse`3.3: HŒ‚randomiz}ßis enabled by¬ default„ ÿobject.__bool__(self)¯  `   Cal– óto implement trutNP testÍ w Q t?t-iPpno "« ò()"; should return "False" or "True".  WhenSJÏmethod is noPðdefined, "__len__()"4  b  Pif it ) é t q? isà  consideredF!e ` qs resulh ÿnonzero.  If a class?inej yneitherÙ n?ÿ)", all its instancel ?areÒ ¡U @CustWïttribute accesï = d   The follow| B“s can be S to c¢ eD
@meanD /ofj aØ ò (use of, assignh o,ñAdele£/of
¯"x.name") Gå¥Õ`.__get· I , u O$w»U × Y è  fÀ� with anDT   "AH†Error" (ö¯ V Ø@raisŒP @becaš*í *	 nod1’Î /or¿ 	( iÊeï0treˆ0r "²ð"; or "__get__()Œ" of '
  ¿'a *name*\n ÿ*   property raises "AttributeError").  This method shouldl oeitherj ôreturn the (computed) ao ’ value orŠ ? ane   o ¯exception.#  ñ    Note that if® £ ñis found through onormal­ ¯mechanism,n `"__getc ñ__()" is not called.  (} isPintenÓ o Ÿasymmetryn Œbetween v 0and sŠ ".)ø/isÛ Ïdone both foôðefficiency reasonÈ °d because o1@wise} 	®wzOhaveà òno way to accessb es( ‚“instance.ðp /atm Pleastÿ  N ÿ variables, you can fake total contro+ byøl Òinserting any+2s iN~  F»A dic(/ry½?(bu×  O 0eadÕ s @themm !an±p object Se+�h˜ ãJQbelow?aµ_tuallµ 2getH%`Foverôâ .œ¾ `self, R)†  A   CÑ� uncondi� é Íto implement³ e{q	 ½ Øé‚class. IË ¿ also definb ·²¾ K°latter willÃ3 be¾@ unl„N G/)"—A õ s it explicitly/ X¼.ÂÜ„®æ³Q · Ÿ‘ In order·0voi{ofinite&ðrecursion in\n'
      ø.'   this method, its implementation should always call the '
I  ß'base class\n  #  i Q withG `same n ÿto access any attributes itm ¯needs, form 0exaÌ õ , "object.__get[ �__(self,€ ?)".H  �   Note:  %Toÿ may still be bypassed when looking upý sspecialOoA  ash‘result ofß¢icit invocä¿via languagÚsyntax lð   built-in func;‰s. See S¬ Ú /upmöFor certain sensitive&;�es, raiseE9PauditY_event¨12__"µ@argusUp" and "Á@‘s‘	Œ�, value)Ÿ  t   Call@(anPssign¶ 0 is ‘empted.  Ž«ië/edn pinsteadS Anorm‘ñchanism (i.e. store‚Ó ? in—?thei 
qance diWpary). *t*Ð  ~ ÔÌ,d *‚ 3 o & 0 to”a9 ed /it´fIf "__á€)" wantsN Z 
  n Kâ ŠÛ  ž¶ ¦Ÿ‹$¾ ,s=+9o  ß LÀ?   æ� ÉéÃ ÅÉ é,æ\"6ð 0delå	üMLikenðbut for attribute deületion instead '
  _'of\n ð   assignment.  This should only be imple  ¯ed if "deld ¿bj.name" isn ÿmeaningful for the object.3  ò   For certain sensitive attribute deÏs, raises an· ïauditing eventp "§ P__delg Ð__" with argu s $ q" and "	Ô ` ¯ir__(self)Ž  ð   Called when "dir()Œ" c (ono¿ A sequencemust bel •returned.j �convertsf  e Oto aj @list5k  soV i#N €CustomizðXmodul3_acces»- r  €Special '„s "__getU@0__dP" can…�also useß/tog cï "e Ü [ to m÷ ks. The„ ,Afuncia& Í^ TlevelI | ept one,‚ which i-n  o of anÛ  .ê 0ozòcomputed value or ÿ$"A3oError"´IŠ _°is not foun*$ aXÇ� through’ ß _ormalÛ Álookup, i.e.T #õ `__()",^ nº�`search×½"} ctáabeforeB 3CD0@, itû˜E <Óý Ø  ?PresulE B/edÍ5 xîÅ%noÄ s,¶Ó€ / ai x�of string³at represenD sºfible oÂÀ           'ü module. If\n'
  ÿ0'present, this function overrides the standard "dir()" search 'Q  Oon ak ‹   òFor a more fine grained customiza­ f¦ ` Ÿ behaviorž �(settingo ðattributes, properti ñetc.), one can setq ¿"__class__"m O n !ofÜ   ñ object to a subW Á of "types.MÆpType". Ë�example:n  ß   import sys# Qfrom Š . ‘ 5  2   Ú rVerboseF (  Þ )½ ·ÿdef __repr__(self0 "0   “return f't   {9 ï.__name__}'\n"Ç Á  T ˆ 0setâ‹  ,  , value˜ ’print(f'S‘  {? o}...')’  y  ¦super().__„  ? ~ ½     û.=$s[%].Ý3 = <©H  ?Not‘’Defining “ T "__gjP" and€ Ä! ›Oonlyž P  affxð lookups made us~  ø Tÿ access syntax â€“ñodirectn F ^ à ñglobals (whether by code withinjã ? O, orÝ ð via a reference^ Ö 9 Tâ€™s | !di÷ary) isÜ "un,?ed.p  ð Changed in vers\@3.5:Ö <‘ @nois now‡ �writable… :New� 7� Wg"__dir‘ vs‚ �See alsoà<ò  **PEP 562** -  · D À           '  ðDescribes the "__getattr__" and !di ð functions on '
= 	 ¿'modules.\n  ÒImplementing ¢ _ptorsD - .   The follows `methodé ñly apply when an instance of2ë Oclas¬ pcontaine  pi ñ (a so-called *d“ ñ !* K )o�appears i˜ Ö c*ownerF   (r ] € must beA aeitherÑ 3 Oâ€™su � m !di`ary orU  o 0   afor on?/itd Ðparents).  In” p 0exa'Às below, â€œr  ½ðibuteâ€� refers toG   Û Ïwhose name i¾ ` 4keyü„propertyí ;³2â€™;_ct__"qobject.Š…__(self,w!, e o=None) B   C`kto getÎ] Â " (¼áIl paccess)
.of8$ate Ph * . Á op 4al ø@arguG" ißß j ì , whileÕ *­ *Q  L thaS/waß¿ed through,p @or "é"~ ~z ‚ J ÔÞ ‡ƒ   This £Áshould retur•— computedWPvalueô… �raise anï Q"Attr»±Error" exceÓ¹ ñ**PEP 252** specifiá at•€get__()"C tŸable with­_r two¹ g¡s.  Python@Öown built-in xŸs supporto /th}$  Ì  caèÐ; however, itÌ blikely‹Osome` À'third-party¼ tools\n'
  ÿ0'   have descriptors that require both arguments.  Pythonâ€™s 'Q  ?ownj ð"__getattribute__()" imple] òation always passes in� » • p ôwhether they areÕ Ÿd or not.:  ÿobject.__set__(self, instance, value);  ð   Called to set§   na $ *k O* ofzŸthe ownero Pclassn Ra new³ 1, *» *ô   Note, adding " )"\t"__deleã`changeYeº kind of¸ �½ wâ€œdataµð â€�.  See Invok“ 3Dæ/fo)0mor_tails%ÿ 
(!'Q $þ  of? f< $ô 7The·a"__objF P__" iÄÀterpreted byƒ ¯ "inspect"�module a³ : 0ifyä ók Â where this „ð was defined (sett1  5 ð	appropriately can assist—Ðruntime intro“ ¾¯of dynamicÚ ¬ l ðs). For callables, it may indicatç Gat a× î	ñgiven type (or a subœ )± exœe&?d a¿_firstÖ @posi%alD� (for exaø2, CP  b iV·àunbound methodL  %&rea ed¹/C)ÞØ fR* -  *  ÈIn general, ò ©$aní ðwith '
              ð 'â€œbinding\n'
 	 ÿ2'behaviorâ€�, one whose attribute access has been overridden by 'S  methodsp ðin the descriptor protocol:  "__get__()", s ?andP ‘"__delete6 Ñ. If any of tÉ � 0 aru Ïfined for an¼ ¯object, ito ÷ is said to be aÈ .1  Tdfault ‚— x isl `get, s /or¸ m  pÐ@fromþ ê ÿâ€™s dictionary. For instance,k Q"a.x"ap ðlookup chain starting with "a.__o °__[\'x\']",nJ �"type(a)5  °and continu^ pthroughL _ baseº ¯classes ofo p" exclu5S meta8 â However, iŠ e æed-up value is…` definÇ  �/of½ ?the¶ KíS´ Python mayµe "dey	 qTinvokI Åz : ead.  Wher& ¿is occurs irØ £precedenceK÷depends on which} § t  wv Ù c/edØ 0howyC ocalledò ÔîQpointÒŸ ; cakÿ ™g_. How÷Ö�rgumentsß Ýgmbled *O"a":A  ¿Direct Call! 1   ê pimplestQà least common ; à ßwhen user cod‘dm /lyj  29kesiì:È4"x.3?a)"¯Iå/ B	   R© Š2an :ì& ª¯ransformedÄ@intoeð  </: ÷ì #, õ À         '\n<'
  ÿ'Class Binding\n# r   If b# p to a c6 ÿ, "A.x" is transformed into the L _call:g ÿ"A.__dict__[\'x\'].__get__(None, A)".>  _SuperÞ !"aÈ ðan instance of "s@  ",Ï n Ü . ?(B,Œ ñ   obj).m()" searches "obj.__Qò __.__mro__" forq /asJ ƒO "A"n ðimmediately following "B" and]  í Pvokes ¿ descriptorº@with( o Û ÃmÃ@obj,ï Î6ForŸ�s�ƒ precede¸Ë ÿinvocation dependsÕ ˆon whichømethods are defined.  A# ?canB/ O anyo bcombin˜  }û�)", "__s)¾ÿ"__delete__()". q _If itl ƒdoes notÄ  ` h m °then access2 Ì�attributŒ¿will returno  C •ñobject itself unles„ reM’a value iskA ?â€™ºÅ Mqionary.Æ‰ “sÿ _p oand/orÜ 
‹B, itÅ Gdata0; i�qs±sneitherD o ka non-] Û.  Normally,  ss r Obothh "0‚,/le‰ _s hav%OjustAo dJ.  DC!s …+  Ê±® ß (Ó úI),ÿd always override a?!reBiLOin a �¿n contrast,MK/beÖ ¯ aden by,Àances.\n'
    Z'\n'
 ÿ$   'Python methods (including those decorated with C ‚"@staticD _" andl s"@class( à) are implemenb ÿ
as non-data descriptors. w PAccorª ?ly,p ðinstances can redefine  ” overrideù ï.  This allowsp ¯individualn ÿto acquire behaviors that differ from otherj ¸ oof thep Qsame Q.!  üThe "property()" function isŽ!a Œõ ~ Ÿ Š6not€&th%_ of a° l ê  Ÿ__slots__ -   *U *Bð us to explicitlyHlðQomembergO(likòAies)Å@deny Q creaÃÁof "__dict__‰Nß*__weakref__*Ò (unlessÂ  Xd in ñ Àor available Âarent.)o   «±space saved50 us�æ  Üÿ be significant.ö �Attribut]Álookup speed0
T  ly roˆ as well�uobject.)ò   �íQ varilù  asû ðed a string, iter# ,	¯or sequenc   ŠM søu Önames used byØ¤(Û ’reserves ë1forÔ0dec1dð sôprevent<,€   autom§.		 ‹ üOeachÏ ëN ƒNotes onôMà~~~~~~~~~~~~~~~ \\n'
  ' ÿ)* When inheriting from a class without *__slots__*, the b ï"__dict__" andp  K ñweakref__* attribute ofY €instance| ¿ll always br ¿accessible.o  3* WØ 'a µ ¦variable, … ocannot€ ¿ssigned newk $  V  s I ‘listed iní Wß definition. _¿Attempts tol a� “ to an unm ‚ Ï name raisesb $"AŽ¯Error". Ifk ‚dynamic s @mentÂ7newñ ¡is desired5On ad4"\'?0\'"Ã  gqsequenctstrings<‚P¸ aeclarah$  47*__Ã_…for each?,fZe ñ/ngp )t1 do>�support " ` refers0/itÖÍÏ	
Q  i xis needÁÔ ¾ D ×ÁÜ ØÄ/ d­&F �are imple¦Qed at}ˆŸ level by× @creaÇ Ådescriptors þ oó .  As a result,W¼
sn Œ@used#0set8¢ault value‡ òÔ Ÿ �e’ by¬ƒ±; otherwiseÍÊ ¶ o wouldr �overwritewÝ KSÖ`The acÛ Œa¿ K Öpot limi�/to·  €$³ 0wheZtP ¾;ed.·Àð€parents Ž @vailo ‚in childzð es. However, chüild subclasses will get a '
  ß'"__dict__"\n  ð  and *__weakref__* unless they also define& Pslots$ L ß(which shouldo ñonly contain names of any *additional* i /).F  q* If a ³ 1s aJ Ç ²d in a base, ,9Ïthe instancep £  variablen @d by6\ ~ Àis inaccessi/ =Ÿexcept byn ûretrieving its descriptor directly from‚ /).ß OThisi AnderP meanr !ofX ¢program unad.  In Õ Ÿfuture, ak ÿcheck may be added to prevent this‰Nonempty­òdoes not work forùeE_rived# M¸ 4â€œýÿ!-lengthâ€� built-in types such as "int", "bytes"l  …"tuple"ñ °Any non-str¨P*iter”*VRssignY1*__Y?__*g ["K ¡’ry" is usW ac s,C O key„×"bec aŒ » 3¢. The valu? ­€m _can bÊÊ ò
provide per-attribute doc_ ˆ "att/beÊprecogniËñ"inspect.getdoc()"‡�displaye£ Ô `output!Þ "help()21"__$B__" ºmm !s Ÿuif both&OhaveÑ?samWp'pMultipl„Aheri‡t with m  pted parÀ Ô /es•ý0, bi �4oneT ‚is allowçj 0rea• ü · 1s (ßAther.qs must b À ' ð layouts) - '
         õ 'violations\n'
 	 ÿ'  raise "TypeError".*  ÿ#* If an *iterator* is used for *__slots__* then a † ƒ*descrip@ k s  creatZ peach ofV  | ñâ€™s values. However," u œ q ðattribute will beë Uemptyt .h òCustomizing classé ?ion0 = 0  @When!# au òinherits from another ,¶±"__init_sub· __()" ijâcalled on thatX à. This way, it:ÿpossible to writez o �es whichß achangeý€behavior/¬  "| áis closely rel_-"to² m AdecoþÂs, but where1   Á only affect™ i ‚specific> o þtheyâ€™re applied to, �P" solÚ ' sUt ofuturel 1 ?&th× 0fin²  omethodÃ8 Ž object.OOcls)—  "  QX  Üvwí ® Rconta½ †  xû Ú q   *clsóÞ ^ Dnew : .ÿdefined as a normalÕinstancˆ2   Ö  Ñ#is  » ðimplicitly conver#%toØÛ K ±ó   Keyword argument�  are givena a Y   0pas" toËaparentÕO â ÿ. For compatibility]Qwith Òo d e½ ×l  ÿ, one should take outn Oededn kL@and  « `s overU Q ?basÀ, as\n'
      ¸'   in:\n'
  '  ÿ class PhilosopherD .   ádef __init_sub@ ÿ
__(cls, /, default_name, Ž Ÿ**kwargs)j  n Žsuper().r H ß 	 C   Hcls.› ) =ª C   O  8§AustralianB( Š �="Bruce"Opass“  d   Theè þ implementation "objectY"¶ßdoes nothing,p ð"but raises an error if it is called with any argu� /s.P     Note=4 Ameta²u hint " "¡ ÿonsumed by the rest of  l ðtype machinery, anda `never È_ed to\ "ê"i 
Õ!s.òuactual Ý Ð (rather thanº y �explicitn  5ð) can be accessed as "ñ  /)"Í ew in vers—?3.6B cWhen a� erreated,“ ñ.__new__()" scansþ œ�variableh ÇBmakeÌPbacksÇSthoseØb "__se x OhookÓ ™H Ðself, owner, \)§ °   Automati…y‹!atAtime	 cowningM*n *,i!B   c�ŠË p has be©Rssigný*Ç *ü?thah©êÁ A: Á  ¯x = C()  #  Ys: x.ÍAÎ�"'x')\n"yIA¨ u "a!1aft±e% ðis '
             ð    'created,\n'
 	 ð!'   "__set_name__()" will not be called automati oy. If M Oneedj 7cane Ÿdirectly:«  Ï class A: $    passG  9 c = C()# 	rA.x = c0  Ñ# The hook isU C/edM ": )c.’óA, 'x')   # Manually invoke t] ?\n"Ý e  óPSee C1ingD @ÿ	object for more details.H  ÿ   New in version 3.6B X AMeta¦ eÂ- B  ÃBy default, ` ð are constructed us(‘"type()".Ó @  body i¦ PexecuT �in a new x—space and�   4_boundo loL@y to7 ß ¢result of ¿  V †, bases,{ /)"¢ Óì ] å„process ÒÁustomized byw B?the¦ $"mÞð" keyword argumentK çq pdefinits _line,_or byj pinheritŽ Áfrom an exis b 0that °cluded such% ï¢ O. Inn  ¸ `followq ðexample, both "MyC¶"øa"MySub‚ "€q instanc å '"¤ "  ø ; (ä)@ žÎK  a ñ (í=s n GQ(jj <�Any other³!s E GšspecifiedÇÞÛH O  Áe&ProughúEall Qð  operations des¬cribed '
  Ÿ'below.\n  ÿ)When a class definition is executed, the following steps ooccur:i  ÿ* MRO entries are resolved;1  *£ òappropriate metaÕ iØ oterminV "F �namespaceopreparN (@bodyI cí  — `objectK createdýMR‚ êœ+ - +  ÿ
If a base that appears in’onot an{¿instance ofj a"type"ÌnE s"__mro_{0__"30hodL�searched 	/t.q ŸIf found,o i•¡alled with¢�originaló Ôs tuple. This~ Omustp �return ao J 2 of7"esOÐwill be used "0ead% tq  v | eo Q ?mayp �be empty,«bsuch cÅ)e ä  N_ignorš�See alsoMð  **PEP 560** - Core support for typ×ÿmodule and genericOypesÿ  "De} z  I¦Q ^ ;  0Thed&  LdÔ Oed a#0sÁs* if no  °no explicit"Ó (SgivenÏ£ ð_()" i¡  z if<“  1is ’ VýP*not*/ Ÿ  Ž°
$  Â ð, then it is useüd directly as the metaclass;\n'
  ' ô* if an instance of "type()" is givenc Ÿexplicit ` € O, orm ð  bases are defined,¼ n Ö most derivedÎ  … o _used.g  T$c Ñselected from� í /lyï Ÿspecifiedn ! (aay) andY  ƒes (i.e.q`cls)")�ð ?allj ‰ ] Oes. ð ?one× Pwhichtan  ub ¦ P*all*	 çthese candidatŠ ‡ @If nm /ofp ?thei O P meetïÇat criterionCý h o_itiono ÿwill fail with "TypeError"e] ‘Preparing ¥ �namespacÿ - 	f  OÕ  ‰appropri¢ñ  has been identÑP‰¿ l Ô  Apõ aed. Ifø øu Sa "__$ ?__"µ¯attribute,p  iti `called¤"� =B.h (" ,m ›i ñ **kwds)" (whereÏ 1addPòal keyword arguments,Vyj AcomehÖ  ­e$e )Ð
3ÿ method should bÑPimple• ªaas a "q Q "l  *¡Ï returned byµis passo Pin toG ò new__", but wheRfinalÄb objecâ0reaœ�AÀ ÿis copied into a new "dictÝÈnÍ Éµ '× ¹ r	» ðinitialised as an emptüy ordered mapping.\n'
  ' ŸSee also:  ÿ  **PEP 3115** - Metaclasses in Python 3000A ÿ   Introduced the "__prepare__" namespace hookF  ‘Executingl ¬ _ bodyD - .  FThe h Q is e„ ðed (approximately) as " (’ /, ¾¯globals(),n 0@)". { ÿkey difference from a normal call toj Š  )"² Othatp °lexical scot{ allows]€ (includw?anyo ¿methods) toj $reÄ ä Ê  1ñcurrent and outer� qes whenŠ I“j ðdefinition occurÌ°side a func \ÖHowever, even– ‚  m  Û ¹ ƒ HX Qed in»  N q @stilú‚nnot seec”œ Ped atG-U pcope. Cüñ
 variables must be accessáProughO r Ofirsj`parameß ofÖ  taÐ#or]ø , or thf implicii Ó"lyHd’æ  �†qdescribcÐ OnextÕ /se4mKCrea½_objecÊ ¾/--^  Og?}‘óas been populated byÝ ê 4 ÁLl ø 9 %  Ý  ‚cú b  µ ` \ $"m‚(© , bases+ " \À, **kwds)" (} 1addÿÐal keywords pÖ¯d here areé < OsameÝ a4oseK  toZì)UðThis class objectñ is the one that will be referenced by# <'
  �'zero-\n ðargument form of "super()". "__class__"� Ïan implicit K closureh © f creat° ñcompiler if any methods in a  m Bbodyþ p ™to eitherÆ #orà Ò". This allow\ %k 	#n 8ò to correctly identifœÏ ßbeing definedr �based onm ðlexical scoping, while0 or instanc  .@as uS ·`to mak* »@curr"@callÓ iÄ© zefirst .l 0pas‡  to1 Þ  .  ‚**CPytho eÏôation detail:** In $ ï3.6 and later,€/th"ce	Ô  ¿açOas a^ E  A  [_entryÚ  in)×ð	namespace. If present, tÈ@mustapropag`€ upžß  type.__new™ ñpn order!�  too d ¿initialisedÕ `. Fail‚to do soØbresultï"RuntimeError"P2in ÿo ?3.8NqWhen us—  he¨aŽ 3metÙ"&T", or±  ®˜ °ultimately i!s X ~ Ù@e fo¡ Œ @addiÕ/alO ‚customizúòsteps are invoked after} O  N¨¶ object:j  1ReÅ  ±hod collectp e ~ ¯attributesÖ¨,  T  aô@set_2S__()"ˆ ;»  2Ñ :oseM K ] ¹wed withRõi    e ˜ð ssigned name ofü that particular '
  ß'attribute;\n   ÿ-3. The "__init_subclass__()" hook is called on the immediate‡ Ÿparent ofp !  D Anew i ÿ in its method resolution order.F  QAfter_ [ aobjectÁ ‘reated, i ‘passed to- -A f ðdecorators includedÅ  6 @ defL Ä Ï(if any) andl Ÿresultingp Æ Ebounl ñlocal namespace asa } /ed›Ÿ RwWhen a ®2s cLñ by "type.__new__",� ¯ UPprovi//asë  DÒ `parameÓ ƒ2opi³� ¯ed mappingð ul “original ± Âis discardedö 0opyARwrappéal Ÿread-onlyn òproxy, which become°µ"__dict__" Á1 ofK°n ´ ËŸSee also:¡  ÿ  **PEP 3135** - New super0 £   Describá €implicitcÑ  ë ÿclosure referenceO  €Uses forJai ef-  j  0¿potential ux  Q are ®ÿless. Some ideasÎÞ?hav±been explor‚tð enum, logging, interf	Qcheck „Ÿautomaticò `delega€%, + ’ propertyü@ion, _xies,Ñ f¹`works,úk _  õqurce loº ±/synchroniz‹ èm €Customiz+`instan34nd ñ 72= |   F`follow” ÿs9uœÀo override tìhe default '
  ÿ'behavior of the\n% ð"isinstance()" and "issubclass ÿbuilt-in functions.K  àIn particular,‰ Q meta_ ð
 "abc.ABCMeta" implements' /seÖ ¯methods inp àorder to allowI P addi¹  	ð Abstract Base Cå Ÿes (ABCs)p /ash Àâ€œvirtual bK Ñ Qesâ€�} 1ny  ÿ or type (includingg fm  B Fs), D `other · Ž” 4.__ôÀcheck__(self_ 
)†  ô   Return true if *^ ÿ* should be considered a (direc·/orh "in8 $) b  Ó*Õ P*. IfÀined, called‹öjk m ,Ó/)"s"T
s s-H sGb 	st=e (	 t#�Note that  ser5ðare looked up on Ÿ&(©)õ a-~à.  They cannotð0defŠ2 as6„ iv q !acPR n rThis isO¡stent withÉ  Ú  × •f specialt r #re+o %onk�s, only À  ‚  ö5the!  —  itJ/ aäØ 	 ŸSee also:  ð
  **PEP 3119** - Introduc| H A   I¶e’WAficaNÀfor customiz[ `G_l yÀð	through "__instancecheckœ__()" '
  o'and\n * ñ"__subclasscheckH ÿ, with motivation for thisb @func& �ality ino ðthe context of adding Abstract Base C� €es (see 1 ½ _"abc"i ¡module) toC Ÿlanguage.3  `Emulat· ßgeneric typesC = -  pWhen usq *j a annot—Ñs*, it is oft& @efulô 3ÿ*parameterize* ao *Ö *y ôPythonâ€™s square-brackets Œ _. For�example,p  áÒ ð "list[int]" might be usedÖ ’signify a' ð�in whicho 1allÀelements areŠZ_"int"#ŸSee also:n  ÿ
  **PEP 484** - Type HintE©€Introduc�fÓBwork£ J NP – GÐQAlias– A ‘ @DocuCŠ~ ñobjects represen%ud q– 1   Ÿc8 Î  s,?£r-defined n ãs and "typing., Q	
ï `on how”iÜ Z ® _ thatñ ocan be¸ :   4¡at runtime´ ð understood by s
cg  Ó-Õ?ersÖAÄ  ©  ally* only�
   if…`!/thî sspecialo ¡method "__ñ�_getitem“À ? N •.T Ÿcls, key)‰ Ò   Return an [ 
ï ÏÖ "iz è¡‹þ p !byaA argpðs found in *key*.\n'
   ['\n'
 ñ  '   When defined on a class, "__
 ÿ_getitem__()" is I ÿ automatically an R ð method. As such, there\ ÿno need for it to beq ïdecorated withp !"@r q 0" wí  itj ó .;  ýThe purpose of *8*N - 8  † ¾ÿto allow runtimeN ðparameterizationÙ ò	standard-library generic1_es in«PorderË?moro @easi8ðpply *type hints*7 Tthesee °ýTo implement customµ �that cani
_ed at0Mð and understood by st Ô ÿ-checkers, users should5 eim àinherit from ab ˜ ˜ó Ù alreadyc sg C , š� ’"typing.G/",m Ïwhich has itp 6own¯v† Cùï [ sÒ\  Beë94aoutsid>the›pmay notm
'U¿third-partyn 	UKÿ  as mypy. UsingÅo©2anygn  ”è0s oŸ dnÛ¯ q ïis discouraged¨v O p versusjœd&…|  0Usuæ¶” subscrip%±an object u�ïsquare bracketRPwill :p  I+"_‡nŽ#ceKÁÀned on the oÜbjectâ€™s '
  Ÿ'class.\n ñHowever, if the oK ñ being subscribed is itself a P ,k  C  n ¡method "__% ð
_getitem__()" may be callq onstead· B ôshould return a GenericAliasÚ /if¹ _it isµ ÿ properly define“ = áPresented withcñ*expression* "obj[x]", oPython¡ ¯nterpreterj  follows sof ¿AlikeW    ÿprocess to decidel _whethh *"_·/orÐŽÓ:¸  ð   from inspect impor¤94     ¹Ì�(obj, x)� >B"""RG Ó‚result o$À" `¿O`"""~  e Ì à_of_obj = typež )5  K 2# I� T  ª  T ²'s ³,G  â™ .=  ž  <D "‹ ±if hasattr(� H 7, 'J '€"­ E   ÈE � '£ 'W ‘   # Elseõ '$isÖ@ and/?ineLºPMobj.: /(xé¥ qelif isÿ  y)� [ÆÒ -"'i l© dÿraise an exception7 
Oelse› U ¯TypeError(S 
 1   Qf"\'{O“Å.__name__}\' _s notoptableð h  Þ« 2In ýR, all�Qes arÂpmselvesðtances of other '
     ù'classes. The\n'
   " a of a - ò is known as that ¡â€™s *meta& *, and Q Omostk òes have the "type"a o Eeir e .! g does nok òdefine "__getitem__()", meaningÙ ðexpressions suchƒ k Ï"list[int]",Ú ñ"dict[str, float]"b"tuple Pbytes Ïll result inN !__e	¼ 0 be¹ called:9  �   >>> # Ç C hasq~fas itsvp, like Çà› /esƒ m  Ù(p )” Q"   <I   '+ _'>\n"� N  cP) == 1 \  h Ostr)¼ > �› '   Tru.‘ '#  ”s .»_int)" k  š (_& "  H âƒ ÿ returns a GenericAlias"oobjectÝµ Gâ(s.{ ð¦However, i¦ Ç†a custom¼ØýsM €subscrib^ •—6may§*�differen‚ðbehaviour. An examplehòthis can be found in_enum"l omodule–è ªPfrom Y Ï import Enum2 
 PMenu(, )v `   ...Cÿ """A breakfast menu""ó 7 ßSPAM = 'spam' . PBACON/ _bacon0  Q?...ß 
#ŒIõ  i‚ "ü {.HOMeta÷¬›  )  Ã À{ð    >>> # so __cülass_getitem__ is not called,\n'
  ô	'   >>> # and the result< ÿa GenericAlias object:K "K þ Menu['SPAM']\n"t  ) <& .% Ÿ: 'spam'>,    Ptype(4 Z )/ p<enum '- U 'À Ÿ'See alsoß 5 ñ  **PEP 560** - Core Support for typing modulefgR � è sŸ »€IntroducS J"__còA()",c `outlin% Owhenj af Ãsubscription_s in r 0 bei Î zi  instead of\ º?()"5  `Emulat›  ‡ Cable¿`= v "0.__u ÿ__(self[, args...])L A   C¼ Æ ž 1@ance 0â€œe ð edâ€� as a func´O; ifõ¿this method‰    Z ñdefined, "x(arg1À ÿ2, ...)" roughly translates toO "Ó6(x)xO 1O .:  êqontaineweét  The followbS“s can be @õ  to implement cœ +8sC< ðs usually are *sequences* (such¯"lists" orÏ"tuples") orñ @*map´ U �like "diW0ari9 @, buV @presÝ Oothep ÷ Ž¡as well.  S€irst setViö Qed eif Ato eÜeá Ù+ B #a î ;þ`differS 2thaÅ²h ,P a"|°keys should#Í¡tegers *k*,g �which "0¬à<= k < N" wherñe *N* is the length of üsequence, or '
  ÿ'"slice" objects,\n& ðwhich define a rangec  items.  It ÿalso recommended thatv �mappingsn qprovideÁ ó	methods "keys()", "value �  · @"get g `"clear  ± "setdefaul0 R "pop 0popd  Acopy
 m ?andh ÿ+update()" behaving similar to those for Pythonâ€™s standarR ¥dictionaryºÑ.  The "colle ãs.abc" module Us�aº ‚MutableM¯ð" *abstract base class*Å  help creat· Ñ #Ím bfrom aY 0set_`"__get€!__xI"__s f f"__del6 o 5andU#. é  0„s should7 » >p"append¢ l S"counZPindex+ S "ext7 s "inser# }Ý PremovM«p"revers"  ä #soX Cliked` "list"× .Ô …Finally,3U type8àimplement addi­Ÿ (meaningP �concatena, )» ‘multiplic @ @ repion) by¼ « i?thep Ñf"__add`r i ŽR__mul= g D"__r# Õ E"__i ðdescribed below;óy{q 3not‡o ö	other numerical operator¥ ObothD¥ · n .ï „±"__contains> )_allowo `effici2/us´ÕE"in"Ú ;;¬ ,J"B`searchUr 5  qà  t` ê M, it_ Brougg œ/. p &j 1furºž© sŠpÀces '
        ö'implement the\n'
 
 ð'"__iter__()" method to allow effici@  $ ïation through M f ù
container; for mappings,  rshould l ej #ò objectâ€™s keysp ïsequences, it g ?theÕ values.? … ï.__len__(self)*  �   Calle‹	Åá built-in func‘Ÿ"len()". ¾ SToreturnn  ü �length of- Ã ñ, an integer ">=" 0.  Also 9 _ thato ðdoesnâ€™t define a	Iboolˆ�and whos˜"_¹p þ òs zero is consideraÿbe false in a BooleanM Ç?extÕ   **CPython ÌLÓdetail:** In $ ,�a/isè 6quiÖ ò	at most "sys.maxsize". Iâc /isë 0larô?tha6	X ó	 some features (such as Ÿ¯) may rais‰ð   "OverflowErrorÒpTo prev‚ ; <ing% ? byÀ atruth ¼/qtestingË·?mus•üU �gth_hint8¢"operator.Ì` ö? × bmated W  ³ "Ï q (whichÐßbe greater orˆ@lessF Z cactualp c). The  ’/be‰ß Té3   û ¿ Ôalso be "NotI,Red", ã tó d©\@sameÿim­l2did
�exist atF0allûÀ   method isü" purely an optimization and is never required '
  o'for\n ÿ    correctness.%  à   New in vers� ?3.4B _Note:]  �  Slicing÷ Ðdone exclusivð with the follow' _three¿methods.  Al Ÿcall like!  {¯a[1:2] = b%   Ö ßtranslated to(  y ÿslice(1, 2, None)‡   Xð so forth.  MissM[ ð	 items are always filleda•"Š "Àobject.__gets ß__(self, key) Q   Ca¢ òto implement evaluG@of "\ ¿[key]". For3¯*sequence*j atypes,…PaccepÇñkeys should be integers¾S8 ’ |�ote thatn qspecial^ UrpretÛ pnegativy _dexesÛ 0(ifG Ø ðclass wishes to emu¤6 a  ý )Ä up$ /th9H   "Ø2)" Ž . If *key*F  ofñÏinappropriatÊ w ,º ð "TypeError" may‚°raised; if d  
€e outsidS_e set'Qof inFp 0forJ ,Ï (after any ¥¹k ¸ `s), "I• å jè ÐŸ*mapping*Ø  C_s, ifl –m@(notô p�containerŒ 3KeyŠ Õ ž j ¶    K ‡f°loops expecM atx	TFwill:Cb	   #gŸ> a¤ Û�er detecÔo‰à end of '
      ˆ'the\n'
  ' Ÿsequence.$  �   Note:  n ñWhen subscripting a *class*, the special   methodP 1"__* ÿ_getitem__()" may be called instead of )"_= ¾ MSee q ‡ versus G Ÿ for moreq detailsi í ¥object.__sè ÿself, key, value):  B   Cñto implement assign @to "c ÿ[key]".  Same notÕ  asõ m eñ  This should onl±‰  edN >¿mappings ifn  I2ñs support changes toh3´  Cs, or i!1new$ o 0canoQaddedI  ÿX © " e`#s + ˆ�replaced.²s‡•exceptionCsbe rais9ïimproper *key*H¸ J¼•¿#3del§ \¿¸1@dele ä¶ºpremovalØ 2key§^Nrµa  61rom¸‡ ol Æbµ›	‡� b ƒ9¯missing__(ƒ-¬by "dict".  	U‘Š Ð G «1subå@es w@`key isŒ1 in4ð dictionary.\n'
  \'\n'
 ÿ 'object.__iter__(self)+  ð   This method is called when an *Z Pator* ßrequired for ‘ ag ©container.r ôshould return a new s b ó Ÿ that canp E ò e over all the = As in ” / FÒ Ïmappings, itm Æ 	t  p {keys ofm G  ² ¿.__reversedæ$C×ñ (if present) by™ "[  ()" built- o�implemenN Æ“ion.  It #é"#  d /esæ ÷ž ½oorder.m  B   IÞ"¢')"RÑnot provided,r} †m ž`will f×Ñback to using^ €sequenceu _tocolÉÏ("__len__()"p áand "__getitem, Q).  Ows…zsupport{ â 1pro� n #@only¼  1 ~ ³ úA)" ipyü% n 	Ä@atio
 atÝÐmore efficienÐ a _e oneBÔ? byÓ ÖZð	The membership test oper‹�s ("in" ž ^in") ar§ normall¤ ÐPed asòÅ‡rough a )0HowŠ,( Ís¼ 7l�`follow¿tspecial=0wit~ ™ä­o Ü èð, which also does ;Ò¾Ÿ / bH?bleÇS 3.__s¿ N)em«À         '\n<'
  ÿ,'   Called to implement membership test operators.  Should N ßreturn true\n! ÿ)   if *item* is in *self*, false otherwise.  For mappingn ßobjects, thisp s¯ ñconsider the keys of b  ra{ Q than ¿ Ÿvalues orn ^ -â  pairs.,   ö Ú  � ðt donâ€™t define "__contains__()"ÿ e År àfirst tries itépion vial   h oÿsequencü^ „protocolg 0get3j 1seeÕP sect� �i� Ö àlanguage refer— ŠX `Emulat‘Ïnumeric type}= Z   The followt ãmethods can beºe˜ $e – 0UM\ �orrespondr #toûBions�ÿare not supporte
 byEÕ ð particular kind‰ nup�Ðed (e.g., bitá–› f”Ànon-integral ×#) ¢be left un]dÈ Q�.__add__(È,Á)1 ?sub1 ?mul1 /at4  ·?divi _floor6 /mo2?div4 :powÌ ¯[, modulo]¡jlshift> 4  /4 /an?xor– À_or__(self, ¼other)\n'
  ' ÿ%   These methods are called to implement the binary ^ ¯arithmetich ðoperations ("+", "- * @ /  ?%",g ¿"divmod()",h @"pow! 1 "*\  <<X  >> & ^ ÿ|").  For instancer /toi �evaluateõexpression "x + y", where *x* is anj Û Oof ak Ñclass that haL ³"__add__()"¼T, "x. 0y)"u «Þ.l rThe "__ja “ should bò aquivaloÓ _usingh ²"__floordivf 0andy "mo× D; its 0notw Ï Qrelat®j 	Dtruei Q.  No· atq 2pow� à definedÖ Ÿto acceptp Pan opêÑal third arguG!if.1terK1ver3o à �built-inn ðP funcu  ø to/ŸsupportedíS qIf one – oPdoes ŒZ Ì Ø.@with' l  K 6lie$'s,ùÄreturn "NotIŒ?ed"Ñ ¢object.__r2oself, ,	2 osub__(2 ?mul2 /at5 Ñ� q7 “2 >5 ‰2 ¯[, modulo]Õ©olshiftzr5 ! an ¦ œ ?xor™ 1 ð\n'
              ð('   These methods are called to implement the binary '
; 	 ß'arithmetic\n  ð   operations ("+", "- * @ /  ?%",g ¿"divmod()",h @"pow! 1 "*\  <<X  >> & ^ ÿ|") with reflectedq Ÿ(swapped)o × Dnds.JBfuncç  LDonlyQ!ifGOleftm K _ doesp ¢not suppor•Öcorrespondinge� [3] andr ’m ò/ofp adifferðypes. [4] For instance,)�evaluateo ÿ expression "x -o õy", where *y* is anj ñ of a class that ha  ß Ï"__rsub__()"m õU, "y./ 0x)"w ‚if "x.__K ?y)"¹oreturn´T*NotIKOed*.’  Q   NoZaat ter„å` will "trg 1pow_ (them Pcoerc¨ÿrules would become too complicated)É !:z  fI8Rrightâ°ndâ€™s type­Ra subo, d ? r Y >ao] ¶provides a n8ñ ¸r	 …“A forK¦ Nc, this§÷/be�ºÝ Rbeforª'd RFnon-� 0. T{ è �behaviorn eallows¡ es/qoverrid… 0ir G�storsâ€™Ô £  srÿobject.__iadd__(self, otherÑ2 ò2 ?muld ?mat5 truedivk ðfloordiv__(self, ¼other)\n'
  ÿ'object.__imod__(self, 2 :pow2 ¯[, modulo]n jlshift? 5 r5 !/anØ ?xor™ 1 ƒð!   These methods are called to implement the aug ?ed Î¯arithmetick `assignD ±s ("+=", "- * @ /  % o  "*4 k 0"<<: 1">> & ^ \|=").ø _shoulÙ Ÿttempt ton !do!ðoperation in-place (modifying *àß*) and returnH joresulto �(which c³ ðbe, but does not have½  t .  If ap ospecif¶" i^ �defined,ñ Ûo fallsk @backš ?theÜ dnormal�ð.  For instance, if *x*� af / oÝ _classl àwith an "__iad«#)"z  , "x += y"l qequival	o ’=h xäa py)" . O@wiseg 6.__  ] b"y.__r( 0x)"¨o €consider¦1as æ  VRevalu  ofÆ + y". Iˆcertainf 2sitM 's,Bcan ÉÏ in unexpect>_errorª‚(see Whyæ a_tuple[i]£ð[â€˜itemâ€™] raiseÔQexcepŒO@whenÂÞ Aaddi> rworks?)d°this behavi–sÙ �fact part†l  {Odatal omodel.  :3neg/Á?pos* /ab* TinverI� À            l'\n'
  ÿ0'   Called to implement the unary arithmetic operations ("-", 'Q  O"+",k ÿ"abs()" and "~").*  °object.__co¨ Ÿx__(self). ?int* Ofloa, l EÒbuilt-in func<"À /()C3int&p "­ ñ()".  Should return a value ofÆ¿appropriate°Otype‡#Oinde…¿ t"`1or.Z  )�whenever¿ ÏPython needsn òto losslessly converäPnumerÛ\ �an integp …o (suchp ðas in slicing, or  SA"biná C"hexìà 0"ock W£). Presencûòis method indicates thaø k û 7is $?e  Must�BX’   If "__± 1"__ç$__#"þ Iore not;definedÐ õthen corresponding  W" "�%, rm /ani ñ  fall backlí E/)"-Œƒ.__roundà¿[, ndigits]Strunc7 , _floor, Oceil+ �	4”! "õ Ëo"math"k J 1s "	Šè V "Ê _ Un8õ*o?* i}Bpass_"¯ » ll¡#se§9s sÈØ  ÞÛ ö À truncated tðo an "Integral" (typically <'
  ¯'"int").\n  ð
   The built-in function L ð()" falls back to "__trunc__ g /ifi pneitherE 2intC #no 2dex ¯is definedÉ v ÿWith Statement Context Managers5 = 5  CA *ct mt @* isÀ³object thatð ïs the runtime \K /ton ôbe established when executing a "with" s.üj 	µ o bhandle· ñ entry into, andË ¡exit from, desiredÚ ö â p 1forI Ó Qon of Pblock ecode. ç¾ ss €are normQp  invoked us? �Aò (described in se< RV k “ð), but can also be used by directlf3vok“ /irÝ methodsBT_ p sM-F°include sav~  çæ `restor" ovarioufAkindh bglobal– , Ë <  ^ $un ¯resources,ï 1clo¤oopenedc0fil? ?etcÀFor more inf.3on ª U, seezu_ Typeš,ÿ.__enter__(self)ç  @   E< /m€ relatedàSthis o i Ì� will bi2is •òâ€™s return valuex ò�target(sí ¢   specifi�¤ as" clauseÆ  ’ �, if any __Ð}¢, exc_type
 É p, trace,° 4E+ð the runtime conütext related to this object. The '
  ß'parameters\n  ð   describe the exception that causn ahe con‚ Oto bl  exited. IfK p I Bwas 3 ¶ without an� ¯, all thren ïarguments willn ¯be "None".#     Æ � ð is supplied, andä à method wishes•d 7 @ress2 o yð(i.e., prevent it from being propag ), p _houldj ðreturn a true value. Otherwise,¦ †]ñ�processel Ànormally upoÜÍ ¼=˜0Not«`at "__@S__()"Š1s sý 0 no,@rais- B pa¼ ?-in+•;niÄÿ callerâ€™s responsibilityÌ ŸSee also:  ñ   **PEP 343** -ø0â€œA�â€� state> !  3 �specificaë³, backgrounÛÁexamples forg€Python "| "p ” Q �Customiz0osi¿ 6al ÿ
in class pattern matchingP = &P  pWhen usµ aŸ `name i†© ?, pÐ yi�ek N A areðallowed by default, `  "case MyC.?(x,>_y)" i:@typi	€y invaliÆ]!al/0ortç "i _". Tok ¯be able toÙ uÉ¤at kind ofás±õAneed‡�define aL 1*__ÿ_args__* attribute£|
M r  �#isAvari0canrðassigned a tupleü of strings. '
  Ï'When this\n ó   class is used in a ÿpattern with positionalg ÿ arguments, eachm G 3 ñ will be convert… Ïto a keywordq 
,k €using thY €rrespond Pvalueè ñ*__match_args__* as/ (‹ .n °The absence” r  attribute^ðequivalent to sett� /itÞ to "()"o … ðFor example, if "MyCÛ.ç "� Ÿ"("left",~ �"center"\ð"right")" that mean9“at "case x a(x, y)o ü ] î  : Ø O  ± B=x, � ¢=y)". Note†  è`numberf psü?then õ@must•psmallere  n b@qualÂq 1ele? inl �;· it¡qlarger,�“  ­ U?emp7 Jk ÿraise a "TypeError]0New7Ïversion 3.10�ŸSee also:Ÿ  ó  **PEP 634** - Structural PœM?ingA 0   š�specificaÃ0 foÐ¡e Python "a" stat²Ú z Sq ÿal method lookup+ = +   ùbcustom¹ es, implicL2nvo÷ s	˜ sÿ�are onlyn  guaranteedàwork correctlyÀÿdefined on an objectâ€™s typep?not$ gE Pinstad0dicÌ@ary.ãa­phaviour@ 7 Ÿreason whÞ  8 `followžQcode ;sÍ Pexcepv ÆB >>>›/ C; a   ...¾?pas­ð...\n'
           ó'   >>> c = C()\n'
  $ ÿ.__len__ = lambda: 52 
_len(cU ÿTraceback (most recent call last):^ ÿ  File "<stdin>", line 1, in <module>> ð"   TypeError: object of type 'C' has no ½ O)\n" Y ð'The rationale behind this ð
aviour lies with a number{ uspecialk ðmethods such as "__hash__()" and Brepr Ÿthat are h ïimplemented byo  ‘)sarcluding2 �. If the P ¿icit lookupt  nOhesen Ý 0use@‚e convenYW €process,t y wouldk Ÿfail whenl  invoked onI Ò  itselfƒN M61 .�0 ==R?h(1		uR ?intS ?intU 	^oÄdescriptor ''òDint'}Ÿneeds an l@arguŸr ñIncorrectly attempt°"o ð l ‚unbound n ” aAPclassV Êo ðway is sometimes referr¾ožrâ€˜metaJ Ñconfusionâ€™,¬–Ÿs avoideds ‘by bypassØ  wqnstanceì%  3up Hè sÐ! 6(1)‚/1)Ö2X  ÄZ   \   ÿ  Är43 pIn addiF7 to>Tany i>“attributeó4`nteres7m n¢
‹¥ up general«?lso„ë/esm  ve"__get¾ øÛðeven of the objectâ€l™s '
  ß'metaclass:\n   q   >>> 9 ¿ Meta(type)D a   ...{ ÿdef __getattribute__(*args=  B pprint("t ~ L ¯ invoked")· ‰  L preturn » .• H 	 ¥C(object, h=» í *¯len__(self3 Ô /10ž a ?‹#C> H ‡#*‰?_ = C(­2.__j)D	 ÿ# Explicit lookup viaK�instancez*3 È ¹  »5(c)¿ cÀ ¹  F ‚  ¯j7 ¹ Hlen(­ sI# Imre 1 ý Bypassing the "òÿ)" machinery in this fashionñ�provideso ñsignificant scope for speed optimisations withp eg ÿ interpreter, atn  Ó ócost of some flexibilitÍ pe handl  $ opecialq ¿methods (thÍs> * ð *must* be set o;eÖ0 itÄ Ve¯order to bp °consistentlÎ å1 byÉò).\n',
 'string-Ÿ as': 'S  ¬ Û DI  '* &  d ð s implement all‘�òmmon sequence oper ,…�  'alongq  X @addiG ald Ý ð described below.\n'
   ]'\n'
 ñ  'Strings also support two styles of s# ÿ formatting, one P ¿providing as Àlarge degree` ÿflexibility and customization (sel R"str.— O()",p F¹  ê q Syntaxi Ci  '  à ) /thx ¿other basedt Òon C "printf"LA  that handc¯a narrowerTArang*_typess  ;ðis slightly harder to use correctly, but iÚ?tenr `faster² O ther Ãcases it canÎ " (ô -?[ .M  ðThe Text Process[ÁServices sec% of¨ Ÿ standardÖ ïlibrary covers¡`number›ê@modu©¶á°e various tœ orelatex  utÝi»a(inclu6Àregular exprî %on–!inå O"re"á © )d HÏcapitalize()Œ ð   Return a copy; ?:ðwith its first charac`CŠ _%  £`rest l> �dü P   ChaPd in  vP3.8: {³ ¯is now put„Ointo(Ptitleª 1 raG than upper Â. This means&$D_s lik¢ñ   digraphs will on veK#ir’0let�y,Þ �stead ofä 	vhe fullê–’osefold�,aF /ed› 6. C jÄs may bi	Aused2 È0les3 otchingþ  ”˜  ï Ö0imi%toì   Ëðmore '
              ò'aggressive because\n'
 	 ð"'   it is intended to remove all case distinction) ? a M ¿string. Forp ñ
example, the German lowerl ð letter "\'ÃŸ\'"› m  equivalent³ ""ss"".w SSinceí valreadyw 1, "ƒ Ï()" would doå qnothingu ¥ ;w "Ö @fold[ €converts‡ ?to µ V 1The› Y  � �algorithm0ñ described in se¸_ 3.13Ò  of‹n ÿUnicode StandardgD 0New� ¿version 3.3F ÿstr.center(width[, fillchar]){  ¢   Return S ."a ÄÁ of length *l p*. Paddl�ois donh	 us>  õ´specified *Á ‘* (defaul��an ASCII±¯space). Thp 	„originalÓ Ais rò  ë fØ  1Ïless than ors �equal toO"len(s)…< Øÿount(sub[, start[, end]Ù) k`numberÏÀnon-overlapp‰°occurrences Ö3sub_*sub*Â  FnE‘ range [*Ä à*, *end*].  Op?Ïal argumentsj; O ando X A are¹‘rpreted aŸ slice notas g"� enñ( ðing='utf-8', errors='ct')\n"X» w1an _ 4ed ‰°Ÿas a byte*’object. D9s i  õ isZÍ b\'". *Ð à* may be givenÛOset çŸdifferentr 	 (` handlx ascheme² è6for€ iå #"\lO\'",q À   '   meaniðng that encoding errors raise a "UnicodeE n". '
  ÿ'Other possible\n& ð   values are "\'ignore\'", breplac A ×"\'xmlcharref/ q Æ"\'backslash2 ¡ and any o¹ ÿ name registeredå ?viai 	 &4cs.G _Iñ()", see section HŸ HandlersP¯For a listr %ofr¿sn £Standard Eß/s.Q  ñ   By default, the *Û ÿs* argument is not checked forD/beÓ 
ñperformances, but only used at} Gfirs¯)¡ €. Enable7 Þ áPython DevelopÏ €Mode, ory ò a debug build toæ à g!ð Changed in vers.Á3.1: SupportVukeywordzsˆ _added… 6H9: Tøïw	± ‡dT�Amode‘#ink  ½ ÿstr.endswith(suffix[, start[, end]])†  ð   Return "True" ifNA str,@nds p  opecifi@*• /*,n �w{rx ”False".  ? ° can also b¡_tuple2of t /est pto look` .  With op­Aal *@à*, test beginnú /ats  Ml @posi[ i @end*¯�op compaaôl M q  + xpandtabs( _ize=8 (‰a copy o àwhere all tab ¸_acterµ3re ¤d» �   by oneŸ�more spa.QdepenÃ!on�@curr�gcolumn°À           'Îand the\n'
  ð$'   given tab size.  Tab positions occur every *tab% /* N ¯charactersp à(default is 8, 1ing€ u Ðat columns 0,& /16s  à so on).t `To exp, °the string,t curreno  ” ¿set to zerot Tb  N •examined 6 by Q.  If‰ R L aâ  Àö("\\t"), one or more spaceq ïs are insertedá !in“ oresultu Quntil+ GPequalI rAnextãæ ùO. (T¬
 æ I`itself noÂepied.)R) v ¿is a newlin 	 V0n")Qpreturn  rhiÅ coy  ^u ×/ i"	're„Æ.  Any otherÇ õ x unchangÍ˜ Ç² œ � incremen#!byPÿregardless of how<”`is repë f €when pri ÊÄ ò"   >>> '01\\t012 3 24'.ý ¾_()\n" E 2'01$1012	 @0123	   /4':  4€  |  p x 'ÿ'str.find(sub[, start[, end]])5  B   R÷ ÉÓlowest index 'í0wheo#ub  _*sub*ÿ¤found witha �lice "s[Ê :È `".  Op¢/al‰@arguÃ1s *8 *â  $S*end*`terpreþ asç s‚ @notas .ä "-1" ifp  ¹ð ô º_Note:f  À    '\n'
     ' ñ'The "find()" method should be used only if you need '
; 
 ï'to know the\n# 2 ðposition of *sub*.  To checkg  ÿ  is a substrings por not,§ s 
tå ßin" operator:/  "º à   >>> 'Py' in �thon'\n"4 ?Trup ð'str.format(*args, **kw
 )3  `   PerM  RO  0attZ0ion‡3he q/ont¯which thisq Iÿis called can contain literal text orh ÿreplacement fieldp 	ýdelimited by braces "{}".  Each M u £ �s eitherâ  SÐnumeric indexÏ$a Ýpal argu¾ ,ä / ?amex Oof am ukeywordS �.  Return%@copy}  c ½Owherk Oeachk *$is?Pd witü&Pvalue} ð correspondˆ/.�  –"Ê0sumŽ P1 + 2CD{0}"H?1+2< ß'@ 3ÝŽ QSee F¼" SoôSyntax for a descrip ·>ovariou÷		Ç Q as thatnÀbe specified®, €8s|!ONoteO{@WhenmŠña number ("int", "floa	 Ÿcomplex",wÂ  "decimal.D P" andE†classes)À"n" typ%?(exÔ ×•"\'{:n}\'^p234)"),ÿP func�Ï temporarilyz etµ!n ñLC_CTYPE" locale toi ¸"LC_NUMERIC PÀ            Î'decode\n'
  ' ÿ"decimal_point" and "thousands_sep" fields of I ÿ"localeconv()" ifr 
ñthey are non-ASCII or longer than 1 byte,Œ ?thev ¿LC_NUMERIC"q 
ž Ò is differenth  \ ²"LC_CTYPE" ( .  Thisu Ÿtemporaryr 
ñchange affects othÛ oreads.:  A   CP ÿ d in version 3.7: When formatting a number withÂ Ïhe "n" type,t  Pfunctn Tsets ü @ily  ;? tou k  I Ê† ë Ÿsome case4Bstr.ß_map(mapping)„      SimilarÛ "V 4(**T �", excepTt ". "†Ousedr �directlyÿ not copied‚ „a "dict"¤¿is useful iœ¯for exampl		   a e ¯ subclass:¬  q   >>> = � Default(S )K a   ...‘ÿ
def __missing__(self, key>  C `return3 ¢ /..‰"À ð'{name} was born“"I¸"{country}'uú  F Ï='Guido'))\nD 2   $ 	p Y '6 'á 0New² 02ñ F  ðÿ
index(sub[, start[, end]]M!ðLike "find()", but raise "ValueError" wÖ an`substrïois not_found÷ #salnum(æ !R€P"Trueð  all characters– Þ Å  
é Àalphanumericé  ae\Ðat least one þcharacter, "False" otherwise.  A '
  '7 /\n! ÿ'   "c" is alphanumeric if one of the following returnsn "True":l 
1.isj ÷()", "c.isdecimal Aigit /orj  9 ­ O()".s  6str‰ %  A   R ñ  .Eall mAs in90str6?areÈ Ÿbetic andq  ìe§qt least r óAét p Z  s ¾ Xthoseá tdefinedé oUnicodæ M q òdatabase as â€œLetterâ€�, i.e., ‚ ÿwith general category\�propertyu  beŸê v mr  
 t
 u
 l
 !or¡ ¿oâ€�.  Note� Ïthat this is… ádifferent from86â€œ¦Dâ€� Ì  xâŽt �Standard9%oscii()a  9 `'Ëis empty or Pè fn Y  Â_ASCII' Üm Phave åp UpointþÐrange U+0000- /7Fp`   Newg¿version 3.7F ïiÂ  ¸¡‹ qF„ j -s rùp %s D‚ 3sÆÿcan be used to formõ`numberq é€10, e.g."ð660, ARABIC-INDIC DIGIT ZERO.  '
  þ'Formally a decimal\n'
) ø '   character is a ÿn the Unicode General I ÿCategory â€œNdâ€�.s  ßstr.isdigit()%  ö   Return "True" if allÎ 2s iÏ ¯string areÊ ‚ Ps andÿ /res  1¶t least onen ð, "False" otherwise.  DÜ sw oincludn 	Ëf ¥ ° ÿ that need speci©ÿhandling, such asà  ÿòcompatibility superscript y Ï. This coverÜ * o whicho ðcannot be used to form numb\ ðin base 10, likeŸMŸKharosthin W 4.  /,0 ¤
\?hasr �propertyq ñvalue Numeric_Type=; or ´B$¯identifierG3 5 ðv valid f ƒ`accordk to8ð	language definition, sec	 % IÏ ï�keywords@   C"B 3.is
 0()"m€test whe² ò ?"s"à �reservedÝ )ra "def"b"class"Í !�Example:|  “>>> from … import ?  "W ¦'hello'.isü 6(),[ (" O)\n"–@   (Ê!, Iw ?defu 
   s  y r '!'sÀ?lowy5 ­ ca
£ðs [4] in the stringN '
  o'are\n ð   lowercase and there is at least one  Ïd character,i "False"m o` _wise.%  ÿ str.isnumeric()'  ö   Return "True" if allÔ @s inþ ¿ string areæ „ j )/s,U	O 5B   N
Ñ ·clude digit •  þ ¿ ä ‘that have5ƒUnicode ÿ value property, e.g.OïU+2155, VULGARr õFRACTION ONE FIFTH.  Formally,{ ¾ Ä¯those withq &thÃ Ò fp_Type=DX
* Ÿecimal oro 	2  '$Ÿprintable)j† 0 or&ü u`is emp1KüV  NonS » ýq ,tdefinedÑ" ¾Qdatab=sn @â€œOú0â€�ðâ€œSeparatorâ€�, exceptw t¯ASCII spacƒï(0x20) which iz 	µconsidered <p.  (Notº&at "í "o @text} c¤ ÿshould not be escaped whenk �"repr()"Þ Ãinvoked on a¹@.  I™�s no beaÍoÛPhandlf=#ofD Q	ðwritten to "sys.stdout"× _err".¢sáö¶À     '   Retþ'urn "True" if there are only whitespace characters '
  0'in> Ÿ string\n% `   and) ÷re is at least onc Ÿ, "False"k o§ _wise.h  F   AË  ‚ *ä *Ç gUnicod” ‹ �databaseq r(see "uQ  0 `"), eiÄ ð its general category– >O"Zs"i 	áâ€œSeparator, ¸�â€�), orj °bidirectionp @lassm  |q �of "WS",u 1"B"` ?"S"Žßstr.istitle()d  m   Ret¿� Ø !a [ Tcased  ~ì  �”s ®ðfor example uppers g21maygo �follow unR dS  É >lowl ¹ã E Oones«Vƒm'ßß3 al& ÎŽC[4] µ|ª/ar¥	¦    	I{ ,i ¼ÖS&ñ"   >>> 'BANANA'.is¹  _"–0   Ý� P obananaP Q NQ ; � /'µ '©ßjoin(iterable�(ajPwhich‡pthe conß na|0 of?ÅOs in¯ D   *ª ð*. A "TypeError" will be rai)	ÔÀ            þ  'any non-\n'
  ð'   string values in *iterable*, includ  �"bytes" H ßobjects.  Them 	ôeparator between elements is the� Qproviy Othisv method.p  ÿstr.ljust(width[, fillchar])4  ˜   Return½ Pleft a PifiedTaØ Ÿof lengthÓ *“ *Ô a   Pad is done us <2pecs *Ò ¯* (defaultq ¿is an ASCIIä pspace).Þ” originalÓ Ais r ë #f Â  Ð,0lesë_an ors ÿequal to "len(s)"E è_ower(×(˜a copy ofá�with all _cased^ U¯acters [4]© À   convertedò lµ  W ó  � A  °algorithm u¨  6`escrib¯Ÿn sectionÀ C3.13ü ½ ÿ Unicode Standar’$ ‰0p([3s‰)²1lea: c –£removedÏ*J ps* arguÆ õësŽy„� etJq  H ’ Oto bC	œ pIf omit5¡or "None",“˜ v Os toÞq  Æ Qwhite
 g �is not aNÿ prefix; rather,t  \pcombinažs:4its¦"ar)_pped:G  "A>>> ÿÒpacious   '.l„O)\n"/; '4 + f õ www.example.comg �'cmowz.'o < o 'í À            ò'  '   See "str.removeprefix()" for a method that will ' N '
  ¿'a single\n  2   a à string rather_ àn all of a set	 Ïcharacters. p ÏFor example:t  "¿ ð>>> 'Arthur: three!'.lž %p( _')\n"ñ E '6 # h Ln § q 'ñ p'staticzÿ.maketrans(x[, y[, z]])9  ƒ   This Y +¡returns a b ñ lation table us ?forj ¤R _e()".-  `   If pðe is only one argument, it must be a dicº ?ary}mappingo öUnicode ordinals (integers) or á  (r0ngsøÏlength 1) tos ,ðiZ (\PrbitrÓ O ˆ q _"NonefD   C¡R keys@then@Åconverted to ³*uare two¯ s,Ìy²Bbequal ù ,C`and in] p result©f, each½ , x#20be +/edt !top 1 at �same posi‹ j 'y.Æ¹i|?hirq 	õEv, whoseä Ý/beè à šP Ä 3theZ ©ApartO(sepµ!CSpli_†mðfirst occurrence�p*sep*, nrï/ aÝð 3-tuple containO  È P befoÙÁhe separatorÙj% p bitselfµ i ðafter the separatoîr.  If the '
  ÿ'separator is not\n( ñ   found, return a 3-tuple containingh 0str itself,w ¿followed byr ¢two empty U /s.-  òstr.removeprefix( O, /)3   J� Á starts withù *\ *­ *P "J C[len™ ô ):]". OtherwiseD Ÿ a copy oË	�originalq p :"  "8ê>>> 'TestHook'W _')\n"fA '9 $ e @Basei OCasei "	A q 'î ÿ'   New in version 3.9z(0sufz z28endxZ xŸ and that{*/ /is2not{ƒ­ :-¯E )®<2 Ät ÞÈH®)@MiscIsF· (¯s° ? '?Ô°¿TmpDirMixini #A p ¯Rÿplace(old, new[, count],!R' õ¹€3ð all occurrences# ?3sub8 _*old*A!reÁ  Vf *new*þñoptional argument *Ü *øx ¯given, onl¤
vhe firsQ Õ Dare – C#¢find(sub[,q[, end]”Àn'
           ò'   Return the highest index i óstring where sub %'
F 	 ¿'*sub* is\n  ô   found, such that 4 ÿ contained within D ÿ "s[start:end]".k ñOptional arguments *; ÿ* and *end* are interpreted asx �in sliceq @notas .Wÿ "-1" on failure® U Qstr.r�q(sub[, À 0[, ý /])7  ð   Like "rfind()" but raises "ValueError"ð …	¿s 2not÷ÿ #ÿjust(width[, fillcharü "ìÇ`right b Pifiedõ#a  Ÿof length*” *Õ p   Padd> is done us  lBspecs *Ó ¯* (defaultq ¿is an ASCIInðspace). The origiÓ Ais rð ë #f Â / iô@less¦On ors ÿequal to "len(s)–E èPparti@O(sepÜ!QSplitËð a ñ
last occurrence of *sep*,â(/ a² ¤   3-tuple¹Û Ç r beforeŒ ‘eparator, o s% p bitselfµ  Di QafterY C Q.  If l  ù?nots ®ó ƒwo empty8/s,¿¿followed byr  Ù ¾ð `E Ls H¡=None, max O=- 1[!;@a liL_Pwords4µ ,ä`	aTH	`delimiØ
.Ð*Ã  aï given, at mos13 À splits\n'
   ý('   are done, the *rightmost* ones.  If *sep* is not '
H ÿ  'specified or\n$ ð   "None", any whitespace stringb ÿa separator.  Exceps ßfor splittingt AfromÝ Ü A, "r6 õ()" behaves like " _whiché /isk ÿdescribed in detail below.5  Pstr.r¯p([chars])+  ñ   Return a copy of V Ðng with trail{ d oactersø ßremoved.  Thes *J ³s* argumentÕá&yq  n0set• . H ’ Oto bt 	œ �If omittˆn l ˜ v ¿defaults toå q  Æ Ä g 6aWÿ suffix; rather,t ðall combinations:¡its valuesÈ Ú_pped:G  "Ò@>>>  ”„ious   '…O)\n"ù; 7 '+ f @miss 5ppic _'ipz'h 9 d 'â     Seä XËz  Iña method that will åe¸a singl–	a Üá _  n Ë0of ìë/. p ¿For exampleÞ)ÆMonty Pythony }MwÛc l'i  § m ä 4Ä@sep=jQ, max O=- 1B*1lis¬ LPwordsã   uPng, u+\ as€¢“delimiter5~Ä ƒ given, at ¦.*3 À*\n'
         ÷)'   splits are done (thus, the list will have at most '
C  Q'"maxL _+1"\n$ ô   elements).  If *6 ÿ* is not specified or "-1",q @then§ _re isr ¡no limit o/ ¤ number ofû Ô(all possible Á  &omade).q   ï 1sepê ñgiven, consecutive de§ "er� … ÿgrouped togethers 2andÚ1eem2 f ÿ empty strings (for example,P ¡"\'1,,2\'.ëð(\',\')" returns "[\'1\', \' À p\'2\']"QThe *@argu} 1may1 –ðof multiple charact9È g<>2<>3Ë /<>Ì 2Í 	3Í SIting anÆ yw with aô•separatorSD i x ˆ!Fì:©  "ï¤>>> '1,2,3	',')\n"4 €['1', '2 ?3']- a $, -/=1m ,j ?,3,Í #Ñ ?, 'Õ 'N  ÿÿis "None", a differen�’ €n �algorithmnÐapplied: runsŽ¯whitespace �regardedr 	sà0ing[Ý , ™ cSresule¯contain nos ;ò	 at` startFcend if  ñ� has lead®/oro �trailingÞ &@.  CÍ‚quently,H �9 ann ’ Õa�q  £!isW Pof ju¡ªO4 LÀ'
            ô'returns "[]".\n'
  ' ÿ    For example:'  "c ÿ>>> '1 2 3'.split()\n"ˆ 1 €['1', '2 ?3']- ^ 1maxg /=1h  e ÿ    1   2   3   Í :‚2str5ÿlines(keepends=False)yN A   Rñ  a list of the ] 1 in ÿstring, breaking at 7 7 ƒ ò   boundaries.  LineS ôs are not includedz f `result‰  ³ p „unless *%ÿ* is given and true!ÁThis method Y2s o*bfollowš  Þ ð Ì /InÀ ±particular,‰@2‘a superse·¯*universal�0new /s*ô !¾ /+-  2 +÷ ò| Representation6  |Û zDescrip-  1  |l Ø /|=  2 l 	c| "\\nÔš  |Ž EFeed* 	 m 	K — ±O"\\rÙ �Carriage»× /  Ù {µ%| Ú Ä +ÅÚ YÀ+\n'
         à'   | "\\v" or	 Fx0b"! –| Line '
 
 µ'Tabulation 	 ?|\n2 /  K /+-  2 +l Ú fÚ cÚ OForm� BFeedË  Ú z(x1Ñ ª _| Fil³”Separator.  Ù |dª£ o Group³Ú Ù |eÙ oRecordÚ Ù {/85Ù BNextC¿(C1 Controlè PCode)�ÒW$ >]u2028Û 
Š ²z Ù 9Ù  ŸParagraph¦Þ Ù r6ð Changed in vers±@3.2:ï`v" and
 ÿf" added to list of linen ¿boundaries.&  ÿ    For example:'  Îð>>> 'ab c\\n\\nde fg\\rkl\\r\\n'þ.splitlines()\n"
  "  ['ab c', ' Pde fg	 Okl']9 A>>> < Ÿ\\n\\nde g èfg\\rkl\\r\\n'š ßkeepends=True§  B 3, ' ­ 2\\r° a ¶ O'\n'Á'   Unlike "6ÿ()" when a delimiter string *sep* is K ¿given, thisn ómethod returns an empty list for the w _, ands ¯a terminalr  	ñ
 break does not result in� Pxtra ' :G  F (""Ý)1 /[]  Q 1One• ?\\n\ Ó9 Ä	ô For comparison,\wP\')" çs)œ  Ø '(R 'ùÅ S 1Two+sˆ_ :  Gl 1ñ	str.startswith(prefix[,  �[, end]]R   "D" if„Y  s n **s /*,"“otherwisers ”"False". T ò	 can also be a tuple of s _es tov @lookÍ.o ñ With optional *Ù t*, testí `beginn{at thato @posiH o @end*§$opî$ngw m ,ô ,¯rip([chars)`a copy� /)Alead69�trailing¬ 0   ¤ ðacters removed. The * °s* argumenta;pspecify“ ?thet 0setÔ  b { t}� ñIf omitted or "None"ûÀ              ñ'the *chars*\n'
 
 ö '   argument defaults to removing whitespace. TP  O L /isr ÿ(not a prefix or suffix; rather, all combinations of itst ¯values ares Ÿstripped:$  "0@>>> , 	‘ious   '.T _()\n"[: '3 '( b ô www.example.comc �'cmowz.'k ; j 'ä  Ù  Ûàoutermost leadý�and trail J0�` from ¨ MÑng. CharacterÒˆ"ed( q  > ± á ð end until reachÑ "a u  #t � that is ¢n Àcontained in¹ s 0setº^ s3 Fà. A similar acæ_ takeäplace or ¬“end. For ÷(0com_,R= '#. 2 Seº Ï3.2.1 Issue B#32 5 .ž0 
s h_'.#! “ ?#32u Àstr.swapcaseãýÐReturn a copy §D with upper_ þÏconverted tos 3lowR  ¸óvice versa. NoteÜßò necessarily tru6 t '"s'  == s".:   wOtitlt,C  \d<ion‚Ÿhere wordtastart ª/an¯ /  Ç  ï`remaink?areÉÀ7ð   For example:\Nn'
  /'\ "+ ÿ>>> 'Hello world'.title()\n"O 7 3 W3 + z ÿ&'   The algorithm uses a simple language-independent Ü ÿ definition of aë  q àword as groups. òconsecutive letters.™ V w �works inp ðmany contexts but it means that apostropheI ß  @ 0racà _s andp ðpossessives formÎÿd boundaries, which may not be thex odesireo 	result:‘  tð	"they\'re bill\'s friend !omœ 6UK"�‰P !"TL ARe BL 3S FL AFroml?Uk"”  @   AF0karF V	¶0canF Gßtructed usingTregularn @exprÃ?onsY(Ÿimport rej 0   øAdef îcase(s)v g1...	 õreturn re.sub(r"[A-Za-z]+(\' O)?",‚ O T  ¯lambda mo:H1mo.Äÿ(0).capitalize()n "/s)¤ !  GCÕ/."i ÃrÃsÃ.¸ÿstr.translate(table} Ý Ræ`a copy0 /0strâ#inN€each cha¥oer has¶Ÿbeen mappV
qthroughþdgiven É  âË £ A musÊŸan objectæ Œw@ment‹0dexã ÿvia "__getitem__()", typicallyæ 0a *ä Oing*t ðor *sequence*.  When ìÿxed by a Unicode ordinal (anr Àinteger), thne\n'
  ÿ('   table object can do any of the following: return a L ÿ Unicode ordinals ñor a string, to mapl �character  onK ¿ more otherw 5 /s;s ¼ a"None"u kdeletex Afrom 0 ê » O; orr 	ñaise a "LookupError" exception„ ù q ¯to itself.q  a   YouØðuse "str.maketrans()"jPcreat«   laŸ m ±  $o �E-to-  äÿpings in different formats× !�See also¯"z�cs" modul¶ c<Pflexiã[�approach	_ustomÜ Ï º  �upper()i  D   Rƒ5cop£�‘ with all_casedÅ•_s [4]n �convertedµ  W Q.  No:/atb 1"s./ S().is
 Ÿ" might b�	ð"False" if "s" contains unz 'd »  or&  £Ù�ß 	eategorH–resultingg ÿ(s) is not â€œLuâ€�ó �(Letter,p 	 È ±), but e.g.W tW A a title' ]t   The i  Ë °algorithm uÀis described‹?secïC3.13	Ø jŸ Standard·  ¿zfill(width=Pleft _ "ed%_ASCIIÈÿ"\'0\'" digits toù  IÊ (�length *Ç �*. A lead‡¿sign prefixQ ñ("\'+\'"/"\'-\'"}ñhandled by inser¢ ø1pad\  À*after* the žsign\n'
  ÿ*'   character rather than before. The original string is N ¿returned ifq p*width*G Blessp ÿor equal to "len(s)".E  @   FI xample:'   ÿ>>> "42".zfill(5)/ "/ ¯'00042'\n"a1   T -U -U B,
 'wbs': 'S‚üand Bytes literals¥ /'* *  e [ ð are described by the follow{lexicalÍ'definitionsŠ't #  ^v ‚   ::= [ü Òprefix](short r | long ¤ Ù ;  ¬ P �"r" | "u R U f /F"™  = 	 B| "fI F fK F rM  rFT 
*2'"R Rk á  s ´ G\'"  pitem* " || \'"\'{- & Û C n t0"\' "`s  |q @\'""ˆ O 2  z ¤ î  –# |ŸescapeseqI 
t Ã  H }  {·<any source(ìexcept "\\" or`newlin6(oquote>¹ ¥ q J ê&J ž O C ž b_
� PŠ ‰ ˆ 7  e X "b!"B bDB bDB =r8 r9 R /RB¶Ð|  v J ¤I, H
( l m . � p  ½7ç 1 E\ w ÷ Àyteschar | b÷ytesescapeseq\n'
  �'   longb& –item  ::= qchar |  E 
Qshort' 3  E °<any ASCII  ûacter except "\\" or newline – ßor the quote>´ 
 Z ´ o H ² Ù ü › M A š ðOne syntactic restriction not indicated byà �se produ" Ls isMthatd  whitespace2  X PallowV `etween[   "{ �ngprefixkc"û   e 1andG  Ã 1 of ÷literal. The sourceÙ0set� |definedÊ -byc  áðencoding declara+1; iJ ÏUTF-8 if no ( c -isc rgiven i² Áfile; see sey/ E…  -s.M  ðIn plain English: Both types40€s can beÅ Plosed‘ ��matchingd Ssingl	€s ("\'")8Hdoub P""). ™yn @alsos g 1enc‚ g 4in ƒ a groupÁ 0thr'ƒ ;or u �these areO 0gen*ñly referred to as *triple-Ù"d ¤#s*¼ Ò�backslasha (¥)~@is u[2to Î  s Gí otherwise havqac ðspecial meaning, suchÄ ³%, Ÿ € itself,™ ÖÞ Q  ª[B� A²are always ±áed with "\'b\'ß€"\'B\'";«yJg©a`stance² ½ "Ç… instead 2str ma.maè�only cont+"s;[Î áa numeric valu’ <128Ì -or[@grea]@must÷`expres&ÓÁ– $ˆ`may op¥@allyj 
�F0let™ F"\'r¨R¨Pl sFÅ called *rawý  • tî Žðes as literal ch÷aracters.  As a result, in string '
  Ë'literals,\n á"\'\\U\'" and  u pescapesS 3rawW üs are not treatedh ­specially.i ðGiven that Python 2.xâ€™s ` „unicode © ü behave differentlyl Mthanf [ 3[ 0theÔ  urÓ ‘syntax isÂ žsupported« V 0New	âversion 3.3: T[  rb[ ‘prefix ofÍ VbytesË <has¼ >bee¼ padded aÑpsynonymQ @"\'b¿ § $Sç P for iTegacy¥ ò ñ("u\'value\'") was reintroduced to simplifyW °maintenanceµ eMdualc «12.x{@3.x ñbases. See **PEP 414**À LmoreJ¿information"AÉø P with"fÆ or F sin its Øi”Ô *x =tedÚ „Ì�*; see F§  4
  ÅL… -maê-bec …combinedÁ  #Q, butÝ× �×  Ö,¬?refH =rawe â 6ÿ‚possiblen $ ö *3?not¤ÐIn triple-quo0HRs, un—¡d newlines;( � r _allow¢ (í ¢ @retaH’), except¢Wthreeo b  inmo*�terminatea]‘.  (A â€œ> 0â€�{ „#chÁ2 usLLopenÚ.th÷Á, i.e. eithe´ " åM"".)Å PUnles9 í 7< 0\'Røñ’present, s� sequenceÌuj  e  *@rpreÜ`accord²€to rulesX@ilarcÎNthosDñ by Standard C. ž®recognizedÄ Mare:°  .+-  & $ +T 1| E[# SQ�   | Meanµ À| Notes   '
  g'|\n'
 N '|=  & $ T  Ä "\\newline"n ó| Backslash and   � ignored' œ    d .+-  & $ + ¸ %\\³  z (  ¹ b("\\") 	 º r'º þSingle quote ("\'½ º q"¹ GDoub¹ "¸ ƒa¸ ÿ ASCII Bell (BEL+ pqb¸  ¢‹pace (BS¼ ¸ qf¸ ËFormfeed (FF·  ¸ qn¸ BLine¸ L¸ ‚r¸ õCarriage Return (CRwpqt¸ ÿHorizontal Tab (TAB¸ zv¸ dVertic¶ %VTµ /  àÀ     |\n'
    >'+-  & $ U+\n'
Q Ø   '| "\\ooo" û| Character with octal value *ooo*  | J �(1,3)   |d € š   
 $ ¸ ?xhh¸ 4hex¶ 1hh*ã ¸ 2¸ Yý)Escape sequences only recognized in string literals are:I  ?O      $ w° S°  ñP Mean¡ a p| Notesr€· .|=  & $ ‚æuN{name}2æ  0d * *r1theÈ .4äæ|1 
 ò| Unicode databasV 	% 8 QÇ š°  
 $ Ò…"\\uxxxx Ýv16-bit P $ ° /(5*u •	 qU¦   6/326  u l¶ß•P1. AsbóStandard C, up to threekQdigité­ accepted.t  œ2. Unlikea ±exactly twoÄ_ orequir_  3. In a byËŽ,Q Ãadecimal andÂ eØ�s denote Q0 G Ã ð   with the given÷ value. In a string literal, these escapes '
  »'denote a\n ð
   Unicode character withP c givenv ;  ÿ24. Changed in version 3.3: Support for name aliases [1] has been\�  madded.k  ÿ5. Exactly four hex digits are requirJ o6. Any �can be en.Åd this way. z \eight{=hex® /  � $óUnlike Standard C, all unrecognized’ sequence@left–ÿ=the� Y2uncÍô, i.e., *the backslash is U   œresult*.  ](Thise €behaviorG üuseful when debugging: if anÎ  0 Ä �mistyped,e ˜  *`outputA Çmore easily 9 ‡¡roken.)  I* k Malsof  imÛqant to gAthat@Ž‹*ons ,in/~e ç0s fðAintoa ¿category ofsqÅ Nbyte‘a l/  èO6: U‰
|produceó –ò"DeprecationWarning". ûÆfuture Pythoi�they will¦ô c dSyntax^ ò and eventually a "! oError"E.i�6rawštquotes @¢deaQ,!buEƒpremainsØë;ôðexample, "r"\\"""øac ]valida ƒÀ � consistCVf two*7s: Â Ad ^doublf;Ÿ  ž Pnot am+idÝ  (—0 a Wž ámcannotË !enŒÐan odd number,Dàes).  Specificø2, *i b !c z  j g singl)�* (since°x l would�0	c À   'the follðowing quote character).  N ÷also that a single '
  Ë'backslash\n ö"followed by a newline is interpreted as those two€ s O Mpartd ðof the literal, *not*= !a n ðcontinuation.\n',
 'subscrip hs': 'S c ì ('* $  _ 0 ofJðequence (string, tuple or list)	 
þ † mappingi @(dicÕ ñary) object usually selects an item from;h 0col/ Oion:l  8   _ð ::= primary "[" expression_ê O "]"J  5TheQ ðmust evaluate toÝ ÷ ³‹supports³L¨ m (¤ sŽZð ies for example)ÃUser-definedws Ccan • r •  8W  ¡€a "__get½À__()" methodÕ	‘Þ ` ÄFor built-in¬ ,Rre ar†Ptypes©L ¡/atDbm Í HIØ;Sis a ý¯ I3 Ì
!« ë ! w‹ R©0one b1key  ‰ ?and?thei • U u n�ë zÖ °correspondsú ðr pkey.  (9~5W{ÿ except if it haÁ¯exactly onà   /.)‹  ís#îB �0gerÙPa sliŠâas discussed i‡Â „!seo)„ Šðformal syntax makes no special provi&l|negativ{ê`indiceV_Kðs; however, built-in sýequences all provide a '
  ÿ'"__getitem__()"\n& ðmethod that interprets negative indiq ßby adding theq �length of# o sÂ 0 to&  _ Pex (s ñat "x[-1]" selects# Olastq  Ü  o _"x").q  The result¼ Àvalue must b97nonê �teger lesy /anu  ÿ onumberr 0of ™ As inÀ ó @, aniée subscriptionë ¢ M o whoseq qindex iµ "t ã Q(counó òfrom zero). Since• _upporX/foÜ - Ó @slic]Uoccur÷ ¯objectâ€™sHŸ,3ãclasses overri‹3is Â�will need[I0expª !tlËM	sT; �A stringô  ¶ös are characters.  A  ²?not¿ßseparate datar ptype buD {  @exacä 'on| Ë S¢Ãof certain *…`* or * €s* creat”éßgeneric aliasˆ I,óis case, user-defined s S can ™ Bí/by46 °Qa "__^ 	)q V ¯ à,
 'truth': 'T	 ! VG0Tesb
h .'* "  BAny -ã ábe tested for y Ô,  us”œ an "if" ªá'"while" condia or as oper­ž‚ Boolean  ' ps belowñ M'¬  By defaultÎ·  ¸ponsiderarue unG2itsO 7 KinesP qeither ŠAboolªÒ‹àreturns "Falseñ . 1len- Q ·Ï;  ýñ, when called withxª. [1]  HerÚ;'artP'moste ƒbuilt-instf® :�  *1 Stants¼2be > ð "None" and "False"e.\n'
  ' ò* zero of any numeric type: "0", "0. j ËDecimal(0)",J û  "Fraction(0, 1)"!  ñ* empty sequences and colleE €s: "\'\'w  ()  [] Y{}", Ó @"set" a €  "range­   POpera¹ „ Âbuilt-in fun‹ ú that have a Boolean result‹ kalways_ `returnOð or "False" for f ø 1"1" 3Tru ¼true, unlesQ ðotherwise stated. (Important excepÍ U: the® oä 
=,or© ˆb"and" Ï  Á 0one)atheir P ònds.)\n',
 'try': 'The "try"œ Hment.'* 	  	 M  ¦ specifiesê � handler¿P/or c¡yup codeQ  upa groupË ? £ )s:' 	 ð   try_stmt  ::= 1 | 2 3  %  3 Š":" suit” œ	 "("Äð
" [expression ["as" identÿ @r]] P Í'[ ,)+Š W  1["e < 1 ]0 �finally"o 3 2try í "_ 	‘ 	 “clause(s)!y ¡or more g. When°9'no^ Y  l‘occurs inCÐ o N, no\ ) i£a'execu™s 'an3 \ V¡, a searchÙ/an¨ hø0 isnrr 0 Th I  in/!tsÈ à Ô 
¼  õ  ¯QuntilS‚is foundhmatcheR yion.  A[¹-¼  Î ~ P, if æôent, must be last; it o 9anyI Í { EFor dW R with  ]  C,Á › 	Q €is evaluQ,” ?¤ †   z  ¹   	9ingP `object›òâ€œcompatibleâ€�›  : K @3 0 	T Ô ä ƒ ie  O ðclass or a base clasÃs of the '
  Ç'exception\n ñobject, or a tuple containing an item that isS Rclass0 IbaseN  | q  e .+ 	 bIf no 1 â clause matchet  Aion,ƒ €search fµ nä qhandlerÙ ‚inues inH purroundë ¢code and o `invoca0a ZstackÉ 9[1]Ì 	 IBvaluM  ofV¤expressionŒ `header¸*an
	Q braisesC Ð˜original  û ¸is canceledÏ 9and^ a> astartsb G3new” ² s>	Q  = Qcall 92 (iG³reated as i!°ntire "try", htement« ù 
®  ] )–	† bWhen aR ì5 iiè 2undH ç Ùs assigned toQ  z àtarget specifiÎ AfterXÂ"as" keywordà#at@u ,Û )if]  Aent,Ž j “ :  â€™s suite‘ãexecuted.  Alld 	N N s must havå 7 Ñable block.  $n   –"is 	« s] ƒreached,Q  6 >e¥normally aeç8tryU 2stað
Ã (This mean ��f two nes=Ûus exist«?sam÷,º  êî e occur £ ; “ * TinnerQ,	Q  ouþ• € will nor |ÇYion.): 	 ‡ Q`has beÁ� usÅB"as „2", Xjcleare%"at} Öe%O1.  gií Š	š $  : E¹,N:  i*fo)	$ w² QranslþT	+ m ?try… ‰   @   f#l7 Ydel NŠ 	 +’J ¥^(be1� a differÉn–Jto b0‚`to ref;oÈ.œ©E ›ions are îÀ    'becauseð with the traceback attached to  m, óy form a reference\n'
  f'cycleM  stI ñframe, keeping all locals in that " Z alivO Puntilw ù next garbage collection occurs.… 	 ð-Before an except clauseâ€™s suite is executed, details aboutz 	M C  x ¢are storedÅ Ðe "sys" modulo ùd can be accessed viaM  1 Ñ.exc_info()".C  ð returns a 3-tuplû PnsistH7of z*th;« Qclass½ À rinstancª aöªobject (seP sq Thù ðandard type hierarchy) identifyŸ  MSpoint!	ü Ðprogram whereg› Ó`red.  m ’ö æ 	^ sU »#re½Üùir previous valuesP �when leavØ J G‰handler:/ 	 ÷   >>> print(sysà)) v(None,  "  K :tryp a   ...ƒü raise TypeErrora  ' 3B ©  H  p ‹ 	    � VS‘  ) •  # ™ - !a"   (<.% 'C6'>,PV(), <",Fat "É0x10efad080>À	`  a  b 4b 	Â @'Í8z'è opÑ“al "else"¨ž1 if+Ácontrol flow—(es
R"try"ìG, noj2was¢`d, and "s@", "g hinue",^ Uð"break" statement U PA.  Ev3ionîeà *arhBnot VAd byð `preced|"(ø	ÀIf "finally"Eðpresent, it specifies a â€˜cleó
anupâ€™ handler.  The '
  ‡'"try"\n ò'clause is executed, including any "except" and "else" 6 hs.  If` )an] : Ñion occurs inS dof theF Y cis notº  d,  K ñis temporarily saved.é „"finally  Ö (. ¨ )If] AtheraO  ¹  itF Àre-raised at› S end Æ M� 	^ -, ÷ &  [ Ps ano‰ } ’ 	Q ž �s set as• tcontext™ 6newL .ª ~ ¯ ðs a "return", "break" or "n ò inue" statement± b �¼ ©discarded:$ 	 ê   >>> def f()) a   ...Ý?try  ! <1/0W ; 6? 
? 42E    ¯ <f() < 	  §Öpnformat9Áavailable toìéprogram duringM É = ¢q./ 	 OWhenò p  edÞ9theP q` suite—!a  6â€¦” > 89 isR Dalso�qd â€˜on¹way out.â€™0 	  hËCvalu” DfuncmÑdetermined byY Elast	N º � �.  Since9 Ê UalwayiIs, aO gPX [ S Swill X bëŠÇ 5oneT 
ð	Š t/oov"’ vl†'try'\n"‰( H , L Á f½   X 'E & P'AddiGal iŒ&onPÑs can be founû!seE	I E;0ioní' ÚPon use –"K èIzgenerat]2Àtions may beó found in section The raise statement.\n'
  ' aChangeA @versA ö3.8: Prior to Python 3.8, a "continue"^ 	P °was illegal• ð	the "finally" clause dueZ ùa problem with theJ Aimpl¾ a×  Ã Ð,
 'types': 'ç �standard  ¨ hierarchyG O  '* *  ðBelow is a list of¥ m õs that are built in,6.  n€  'ExtenZ_ ðmodules (written0ðC, Java, or other languages, depending onŠ P 
1ð) can define addiF"al¾ £.  Future õKs ofO ù0may? 8  · Ó
p‘ (e.g., rª*alÿ ‹numbers,_ ð	efficiently stored arrayŠ  N eg5 ú etc.), although such` Ü sa pwill ofY bek�vided via< ¿<ð library insteadi,)  .x  'Some	€ descrip^1s b2 $ñ ain a paragraphA;ing¤ ðâ€˜special attributes.â€™ Ç!sea u0proË p access“	oH:  '0 ankAe no· enñfor general use.� *irkNIÈ  %cJ Å "f_M9Nonô@  ' y !iso0 ha|³single valu˜ "re– bobjectFi$  I SThis ;  äNaed thrj Æ Ü -in name "° *".+It   �  usK ‘o signifysaabsenc?a†  .‘many situ>*s,_ Zb  te ñreturned from funœð donâ€™t explicih0 N ôanything. Its truth  s falseÉ$tI¯.eda l5Ózª 8"NoË ñ". Numeric methods?ô rich comparison O rshould y  tsÈ! iLBy doˆ>)2opeL
1forb À         '  ð the operands provided.  (The interpreter will. Pn try	 U\n'
  Ò'   reflectedR ÿtion, or some other fallback, depending onO — ðtor.)  It should not be evalual ûin a boolean context.�  ð   See Implement†  	¦arithmeticÂ ÿs for more details] ò
Changed in version 3.9: Eµ  o E"Not€ 0ed", )a RÔ ¼ å 0 isF0recõ. While it currently&Þs as true, itQ Ü±emit a "DepS ÀionWarning".€% Praise& ‘TypeErrorº 	¸ aa efutureŸof PythonKŽEllipsisQ ðThis type has a single `�e.  There  ºobject withf/th` I g ; ðis accessed through¸à literal "..."ï>the± ô built-in name "Ú  ".Üœ"th¿  ·  «¡"numbers.N "s 0The¬`re cre#´ by numeric¶ às and returned&zresults%.by_ -"orN  ö @func:s. Z N� _ v0s aÉÖmmutable; oncÐ Stheir6qnever cz£#  q   6W ñof course strongly rel*þ to mathematicalŸ ~‚, but su^#toAmitaï 0 ofs  s*alú rh2sen* b iÎ@mputå   ò Æ  [
Y sƒ  Ýú±classes, co^ /d Þ0"__H Q__()"$a"__str a, haveë `followv  pr°[ties:ž  @   *¡y„Tvalid#–Ðwhich, when p° "d ]*irFÎ b  
�structor,Ù‚duce an X Â  ¶  ì&	Êooriginÿ ³ ¦í  Meî ä¤in base 10è ossibleS 1Lea<‚zeros, p; qy excepÐú # @ befÂbÀ         'de¥cimal\n'
  '
 ûpoint, are not shown.)  ð   * Trailing zeros, possibly except �a single# ™ after a ƒ /de™ >’A sign isÌ ð only when the number �negativeí  Python dis× ðuishes between integers, floa!  Sj *s,ñ >andNtcomplex3 :"  B   "Ç 0s.I~ Nral"$ ñ   These represent elements fromúmathematical set of° ß ` P(posiDT and Q)Rœ !rew�two types} p 1   þ ¿ers ("int")¥ l 	>ÿ in an unlimited range, subject toQ ñavailable (virtual) memoryoa.  ForappurposeÛ 	ù_shift_ önd mask operations, a binaryÐ  Ëassumedkô«rˆ(!edq varian_2â€™s¯ ¿ ZÁ which givesÿ €illusion a- finite str"	/ofa Ñ°bits extend; !toa OleftppBoolean,Obool- 6ñtruth values FalseòQTrue.g? tw-oNs¸¿ $heP "Q "R "S "�	?theàÞ  l .û   ]' Ú æ_ ‘¢,¤ W ±behave like’ 0Hø��1, respecJ1ly,}ñlmost all contexts,^ ^*on_ _being"Bthat`converëCto a†Y ’3s "�O" orQ "§¨`return~Æ ”ÔThe rules forJ(à š …qnded to]
ý ¾Àmost meaningñful interpretation of shift and mask oper es\n'
  '
 ñinvolving negativeS [gers.1  €   "numb* þ Real" ("float")* ð   These represent machine-level double precisÊ K  ˜ 	µ _point_ ‹ ð You are at the mercy  punderlyW  L àarchitecture (KòC or Java implemenqQ) forh �acceptedQ Qrange”Phandl€ ùof overflow. Python does not support ü single-a 8 + ;¤  saêês in processord /anÁ ñmemory usage thatcqusually\ areasonuª    se' ± ’dwarfed b>  @head©? aobject¬ @, soU *re³ iÙ3no “ Àto complicat½ pe languÊ àwith two kinds} 	r„Â 	`,CŒ  ex/— /ex1. Ó  as a pair¸ ÏN° b
Ê ªÚ same caveatsp_applyb !asÿ6 X  Thÿ!alÜimaginary parc Oof ab 
  "z" can bY ð trieved through+ Od-on° áttributes "z.rÄ í0"z.Ÿ "Õ�Sequence€ ìñfinite ordered seÙ2dexDnon-ø Ã.Bá built-in funcóñ "len()" returnsø 3  	ÐOitem®   o# sÎ a. WhenF `lengthF a � is *n*,! Zindex/seŸ icontaiœ Às 0, 1, â€¦,Q Ð-1.  Item *i*s � J *a*c ñbselectN_"a[i]½5   ÀU alsot�slicing: H R:j]" ] as all C 8©p*k* suc�!atÎ P"<="  ’"<" *j*. dAusedÆnL  ex( 
@, a ” e{Ða sequence ofõ
 the same type.  This '
  ©'implies\n q   that@ òindex set is renumbered so$ û it starts at 0.J  ð   Some sequences also support â€œextend` úlicingâ€� with a third¿ ®â€œstepâ€�i ðparameter: "a[i:j:k]" selec­ ò ll items of *a*e í :*x*g ^whereb ð"x = i + n*k", *n* ">=" "0" and *i* "<=" Q "<" *j*!ðre distinguished according tû eir mutability:¢  Q   Im. l�% À   An objectMan i8 Rú cannot change once it;i\ ñ   created.  (Ifhq pcontaink2fer$Što otherZ 1 /s,Â Sthese6 ) r may be1!le¢ Á *d;a howevera @ colM0ion(g ³directly reÂ zd by an^ TÀ M 
a+.)+  Ö¡The follow' ype/reÄ s1 °_tringÆ +! s!  aØ bvalues%úrepresent Unicode  Í á   points. All( ,  1 in rš"U+0000 -\ ŸU+10FFFF"a 0can£  edX aØ ú.  Python doesnâ€™t have ag o*char*d  €°; instead, W&y Ê  q ¬K	�› a 4as ² »6¡length "1"ÿ›e built-i��function_ Ñ"ord()" conveì¾ ƒfrom its3P form¡aP tintegerø Á ¼­j; "chrs N ' �  `‘corresponC	d) $1"Ý š�. "str.enÅ§ F@usedn )
$a_ @str"7 ¡"bytes" us½áhe given text m @ing,»K À"bytes.decodõe()" can be used to achieve the opposite.\n'
  '  oTuples ð   The items of a t- ò are arbitrary Python objects. Q  z /ofa ¤two or mori  ^ ðformed by comma-separated list� P ó expressions.  A² Rof ona ó (a â€˜singletonâ€™)MT Ž ¢affixing a™ z&n u 9 (a 	/byb ôitself does not createqÿ, since parentheses must beQ ðusable for group´ 'of©  s)sn empty& S
± ` D @pair&¦ �?Byt€0A b ^Á is an immutà harray.§ >	Ä _8-bit'] @, re5 enaáby integers inPürange 0 <= x < 256Ù K1   Í ñ literals (like "b\'abc\'") andT Šbuilt-in("‘ ?()"± ³constructorµ4B 0Jlso,f # b È^ Rdecodc±strings viaÃ "  �	rlmethod#p MÅsequenc& š  ch—pd after‘ y™:d. ô /ThÌÁsubscription�@slic.@nota sp j asj z targetb ä¡assignment_ ð"del" (delete) state s0�|Pe cur0ly B inœDsic U{ types:~ ¿L[ z 	 ‡oa P 
$/ar†   «ó1pla‚dý cps` /inÀ 0squ`bracke§@(Not/ atÒVÐno special cag	Ùoneededb !toÄ ¢� length 0à;1.)8  ƒ ?  AÕ’À         A bñytearray object is a mutable  õ. They are created '
  Y'by\n  ô the built-in "bk ÿ()" constructor.  Aside from beingQ ˜ ð(and hence unhash® 0), c µ ºs otherwise® provideb  ³ ð same interface l ôfunctionality as imŒ Ø /s"Q W+s.   3ñThe extension module "…#" ¹ ’s an addi� { examplå Oof ab µ Asequ?Ptype,Ñ Pdoes þ a"colleî #s"… ¾ @Set I st ö"These represent unordered, finite sets of unique,ZM L� As such,±  y cannot bµúdexed by any subscript.ŽHowever,b tê1canM 1terîo,   Ñ "len() breturnW`numberé  items in aü ð. Common uses for sn	UNfast°  meV ðship testing, removing duplicatX  [ p ÷,Î N PcompuE ð mathematical op	2ionv .s&,»/onN `differhq ¶ symmetric  [B   F‘ elementsö ¥†i–¡rules appl¢>forâ !diÙð	ary keys. Note that nume› ÉP obey^‚ normal ] 
’a F  Kàarison: if twoa Rbers  ÿe equal (e.g., "1"”ð"1.0"), only oneB œ ö ¦–containedR÷     ÐrÝ±e currently¢ �intrinsic„Ò:>  o   Setø f 	ûW?setU bq	dmw {   "setL Dðmodified afterwards	` s/al_ �methods,k õ"add()"²ProzenEnö 6 .£
s© %1 "fy c  abðzenset is '
      á'immutable\n'
  '   and *hash" ù*, it can be used again as an element of I another_ qset, orB û dictionary key.1  ‹Mappings ð    These repres� °finite setsœ ð
objects indexed by arbitrx 	¹ " `  I .f ð  subscript nota¼ ± "a[k]" sele ˆthe itemn 	d >"k"b Pfrom ; må © "a"; this}Pin exæ @sionƒdH	_ /th× Qtarge¨`assign¶s†¡"del" statÊsæ Šbuilt-inÖ1fun®¾ ñ "len()" returnsÉ `number  }3 a Þ éÒ0re þ ôurrently a single intrinsicO k type:—  D   Dm/ieD u Gnnearlyk '  bqvalues.§Q only° š  La accep–
va¬ “keys are C àcontaining lisør^!ieí•™ Athat\ bcompar2h 0 raÙ0 thyª g‘identity,PreasoR ® m  ú`effici¿2impYa	ß/ofa I ë  requires aVPâ€™s Ð+p to remÅŒconstant�sNumericü0forR as obeyË Ðnormal rules  	­ nC ² \Òison: if two 3"s  ñe equal (e.g., "1"›	a o"1.0")` @then£ yA°terchangeabŠo¨ * O sam< &  Ioy entr©@o ´0erv½1ser8¡order, mea¶ÖJwillZb— ¡produced iê À  W  Ï ðy were added sequƒšally overa 5	ù €. Replac³ ú@xist �key doesÄY } 
_ ” ,§@howe� PremovQ ´êQre-in. ng†0add *tob Á àend instead ofõ keeping its old place.\n'
  '  ð!Dictionaries are mutable; they can be created by � "{...}"Q @notaR � (see se_  g ¿y displays)  òThe extension modules "dbm.ndbm" and Ïgnu" provideš @addiš €al exampI aof map<átypes, as doesè 	?R"collÏ sû ž × áChanged in verÜ F3.7:( �ùdid not preserve � PinserÐ í Worder_  s of PythoÑãfore 3.6. In C O3.6,L j  V 5was”  d, but it  ßconsidered anL  x3men%Àdetail at th  ime rather ¿n a languagÓ�guaranteì@CallÖ å™ QTheseÿ2the% ‘ to which
2funÉ–call operåO ö w $s)E‹applied:0  ô   User-defined z s( o   A u- ¨ object is»aM L r "
¼Fü ! ÿs).  It should bž ,ð ed with an arguúÐ list contain¶ t°same numberª
ê?temÿ a¨$ñâ€™s formal parametero •`SpeciaŽ�tributes¬*  –/+-  	6 
" +§C| At  Ã Q| MeaT 	 	Y| |o 
1 = |  
" o ¹| "__doc__"�    | 	í1docTŽ�Q| WriÏ? à 
 (  ö| string, or "None" if  ü
K à ? 
 �| unavai«;ûcinheri{	o À '|         �    |\n'
	  ' |  ß| subclasses." 	Q 
K o 	1 /+-  	6 
" +Þ ¬"__name__"Á ð| The functionâ€™s * 	é 	¯  | WritableK à w@qualº ä à  *+ PifiedÂ ?   à 
äF  |@ò*.  New in version 3.3Vo 8  Ow^modul1O h‚ of the )  Ã Þ -Mšÿ was defined in, oro   Mo ð"None" if unavailé·V Þ   o 	1 
­Á  	$ 
" ë�defaultsðA tuple containingS , Ä 	­ éMñ	argument values for thos:x„  Mo ´s that haveß /s,o ?6or .4no î sz VØ  Þ "Ì N”T ¼  o 	1 
\p  	$ 
" š>codT"  V  ð object represent¤¼VÀ              ñ| the compiled function body.$ !'
  !'|  9|\n  	 /+-  	6 
" +o ò | "__globals__"„  ñ| A reference toí !diã iary   ­  | Read-onl Þ 
h   M�at holdsk OCâ€™s$ q   q !ù á variables â€”{  â j  q !Ánamespace ofi ’module inU à <Qwhichh LÜ was defined.À„  Þ 	  
`t  	$ 
" ž r›–   | The Q¢supportingÁ ¼@Writæ  Þ ž`arbitrùM½attributes.o  g  o Ma|closurePñ| "None" or a tupl¢@cellŒ,at+ë-ñcontain bindings for©3	
˜M
$ F  |šKFfreeô_. See¾ q QbelowÕ qinforma$onä à <"ª_Ueents" ™†¾ O	  
«¿  	$ 
" éQannot)	‹ ‡  ß 0ainâ+ ‡é-Àof parameterÙ hàkeys of the '
  %'|  	 P|\n'
	  ' 
$   ù| dict are the parameter names,   Q 
K o !ñand "\'return\'" for{ 	h  ?   q 1ÿnotation, if provided.  Forà ?±more informu ± on workingt	ç Þ /ñ	with this attribute, seel Þ ?$AnMñs Best Practices.r Þ 	1 /+-  	6 
" +ñ"__kwdefaults__"·  2| Apcontain²) ¦qWritabll!Ækeyword-onlyzJ¼!MV\qMost ofÍ�äs labelled â€œ2‘â€� check- @type9 	¿ ?thef û assigned value.$  ØP Func ð objects also support gettë ™s �rbitraryP Ý ñ, which can be used,+°example, to™:ach=�metadata` Cto f³  pRegularH áT dot-ˆ1 isx  j :getg ?andb †set suchT ps. *Not!at–�current iÉ 2menD
`  ºa ]sÉ j  �user-defiÊí 	¸b … P …built-inp Ps may”çPed inØ M ‹future.*  NcA cellL@ hasV ß   " _D€ents". Tž"Q  6¾ „Ù    M ð, as well as set õ the value.\n'
  '  ðAdditional informa Ð about a func ¡â€™s defin.  can beR ðretrieved from its code object; see ¤ pdescrip^ I of « �internala ð	types below. The "cell"  ™ Á accessed inm " /s"P _modul.ÿInstance methodsM JAn i( ù ô combines a class,	 1 	?andb ´any callablU0 (nº±lly a user-« ƒÀ)ð Special read-onO ñ	ttributes: "__self__" isVÈ º%» ,J  YJ   
&f"__doc" P ‰œrocument¿†(same asj .P *);± Ÿ"__name__ê j  *  ]   ?__"^  _`  ?   1 aw #wa}ÑK, orÄ ONoneÀ �f unavai0MßÓ also supportQñing (but not setting)ª 
»�rbitrary¶ìa]" o§punderlyg & 5º Uû<? òs may be created when gÂ ? an©    š¶÷  (perhaps via aîrof thatÝ*),¢/ifb 1 g iÀE$or6P 	ô 3WÇ 	C  é23by Û Ÿaà µ “ ŠÊ U L0oneh 0	MO/s,`  0 š	M N? Q, and«â 	e &a �s said to@qbound. x3newƒ0"__µ ´† 	f i4 § Porigi† C 
ÅÀhen an instaõ!nce method object is created by retrieving a '
  ‰'class\n  
P qfrom a / ú or instance, its "__self__"^ Ÿattributeb cis theT  itB T, andS @funcS F  Ö /thM  - Dtionpunderlyó e Ô .Ž  ÿ uWhen ané ` aalled,Ä n M � @("__ @__")Î cD jinsert­ 	”p_  V  >V ¡n front of› ùargument list.  F¾	e Owhena 0"C"®  ñwhich contains a defini`for a ä  	` o"f()",b  ÷""xf u€of "C", ( q"x.f(1)( pequivalÛ 	f /tob C ¯C.f(x, 1)"	4pderivedw$	“ x— °F2â€œaîØâ€� stored infKwillkctuallye !be] juso that\ueither c*orb "9?1)"b 7is �%toV P"f(C,²�where "f¼ “	"A²0Notð !atõ ¡transforma‘ÉŸ~: toë €ë Íhðhappens each timz )e ³r~*ede  Š a  ‚ ð.  In some cases,]ò ruitful optimizÙ  Núaassign˜ ñto a local variable| ' ¡ 1 À. Also noticø r ˆ 
sTonly (	ö?fora Quser-U W0unc»As; o¢ £ ° ¾0s (>�all non-Q 3 T) areºed without - }tµi-a�importantPn…Í  E/arÏ©sÈyð are not convertõed to bound\n'
  '
 ù&methods; this *only* happens when the function is an H Ÿattribute` !ofA kclass."  Å   Generatorr s% E   A  B or Ä ± which usess ÿ"yield" statement (se¥ "seÞ AThe 6 5 )ó µcalled a *g¡ 	 *ã eeSuch a´ ,YV ñ , always return`2*it*þ cobjectð `can be÷ êqexecuteSbody �¯ :_  ˜ 1ingC ‰ dâ€™s " Å.__next__()"~:illOcausp	S4to µ ð	until it provides a valuß ’ ² ëM.  W¼f  U "m"N 1 ˆralls ofÇÑend, a "StopI¤¡ion" excep 	gi½@raisN)ndc  wB have reachºdhe endÄ:setb/ofÁ 3sø L  W,edš: †CoroutinïÀ }Ðis defined us²`"async /"  o = *c� O*.  =	iC ,Ó &  W` "* Cÿ	.  It may contain "awaitðexpressions, as well ä £with" and  Jfor"°Z(qee also�Oð#s §ÊAu†hronous ³¦×;aZ�2is ¹ Y(³ ÈÇ W ,ü	-/an` *‚  ê*m -inù_   œ�ìª¦çp   Callh RÁ Àous iteratorõâ€™s "aiterator.__anext__" '
  ™'method\n  ñwill return an *awaitable* which when  1ed . zexecutec _untilb ð%it provides a value using the "yield" expression.  Wt ?theP “function ˆ s¸ rempty "É ú	" statement or falls off² ` ñend, a "StopAsyncI_0ion¦ 1cep} Ðis raised andÊ ¬ a@ „hronous §F±have reache@ p end ofK J set¬ /of_ M�s to be I;ed.*  Ä   Built-in Js$ l   A b) � object iÊõwrapper around a CQ „ kpExample‹[ Ñs are "len()"T€"math.si ¡ (" "Ž †standardZ ðmodule). The numb¬  ¬+yp¼^ Ÿ@arguHŸ Ñdetermined byªô Š Specialº_read-¿ ðonly attributes: "__doc½!is]  ç1docŠ aQ pstring,óð"None" if unavailÒ;b Gnamec 	p b  = F CselfF  ¬3to r �(but seeÀ  Œ ö?m);O 2"__¥K  q c  K › J wasa0def‘a /in£@ '>%@This�@realÏp differz€disguiseÎ a—Ê ,Ç ?thib Àtime contain5$an†0pas€!to"Š  aÑ ô   implicit extra Þ@.  AP ° þ  ž p"alist.
Ànd()", assum© * * a & ¸ _. In ï Qcase,Ñ sOB
- Éƒ	ÌÞÂRdenotÇ¨  Clq¦ Å1calp . { 6bs norm' ct¥	± �factorie` ðfor new instances of tõhemselves, but variations are possible '
  i'for\n  ÿ-class types that override "__new__()".  The arguments of theQ 2allˆ ˆassed toJ € and, in?  v ßical case, toP q"__initˆ  M   aializeD Ûnew instance.A  A   Cî I0 s! 5     æ ¡arbitrary )ðes can be made callak*byn�defininga a ; Ô cmethod"iri Ë oModuleÀ   �ñ a basic organiz#pal unitÛ ÀPython code,— 4 ° ¡created byoôimport system as invoked either' "( "P PstateE1, o/  	‚ing funcÅosuch aÝ  V Blib.` !_m1()"Á €built-in`! ¾AŸ7 � ñobject has a namespace impl´ Aa di«  3 Z(thise iÂ  8the= ‚referencX   þ"__globals__" attribute of® 2oeD ß U).  AA k %M atranslë�to lookupÞ Ù ñ ì, e.g., "m.x" ô ¯equivalentb  o5  __L ³__["x"]". A®  Iãdoes not conta) ¤Q 2 ufP (sinÃút isnâ€™t needed¬?oncÎ  ‘V ? ñ _done)  {`assignôa updatjeø Gâ€™sk ~ionary,ñ zA = 1~q 9"m.`' « 4PreBP(writÓ)}+s:‹  I /_ame__õ "  C–õ œ    Î?docY 1doc§²astringnš"None" ifýaunavaiÉ� ?filê @pathC k I 3 ± from whichNÊ was loaded,š iöÀ     '      ð   it was loaded from a file. The "__ õ__" attribute may '
  Y'be\n  ô missing for certain types of modules, such as C 
_ Othata ðare statically linked into the	 êerpreter.  ForZ Ÿextension_ £  Sdynamk ,úshared library, itâ€™sg /th!€pathname ± 
O Š�  lp"__anno
oons__"& ð   A dictionary con“ ¢§*variable H ¿* collectedP 0dur? )° body execuc sÀbest practicúnworkinga @withˆ— ö__", please see Aú O Bes-P„ .m  ö   Special read-only :Ž  E !ishÿ ú ÛOspac  Has aŒoobjectš ò**CPython implemenõõ detail:** BecausTCway 4 é cclearsy� i˜ ‘Ú  šy will beÅG &Gwhen#  falls outòÑscope even if&  X� sti 	X>hasÂ ülive references.  To avoid this, copy] zor keepÅ ¨áaround while uÕ8its�directlyÃßCustom classeÏ    , å3typy¢created byE p definiqx?(sey !se   C‚ =  ).™ ! hŸ¿l*ed4.by’Øo F² à QranslÙ 	ó.to` €lookups M(hi…à, e.g., "C.x" �W J P"C.__tð__["x"]" (although2!reœ €a number³Phooks*ch	^allow¬  ú¡other meanøPlocat5Ts). W)  
e i1 Qnot f� g  e,¹ ®q searchëðinues in the basee\n'
  ô'   classes. This search of the base! Q uses žC3 methodM ñ!resolution order which behaves correctly even inP ™presence › .of_ ðâ€˜diamondâ€™ inherita; ðstructures whereY ïre are multiplû  A ðpaths leading back to a common e  stor. Addiá .al  ’details oÙ `C3 MRO9ó	d by Python can be foundJ  €ocumentak   accompanyœ  ™€2.3 rele .at? Ñhttps://www.pw ã.org/download/< »s/2.3/mro/.D  p   When /ñ attribute refer¾B(for-ú "C", say) wouldÙ~yield ab Š[ð
 object, it is transforme3 ™ >sü�C ÷ whose "__self__"½  is« .Ý #it¯ ¢ 	Ž¯  s�c°  µ� [rappe.by 4 e ‘. See secPImple+ ºDescriptorsu>fora Panoth¥ ay‰¬Ûõs retrieved fromý:may] _diffe`  6 tñactually containÈ@ its™dict__"„C}`assigný qs updatø…Pâ€™s Z zionary,³ ?nev²  s4  a¡ A| ¾ëðcalled (see above)\fa2 	n"inÛ³D obelow)Ž vSpecialñ+s:R  ¯"__name__" S   Th ) ‰    ç_modulW  Q  x Š1 ›  %pwas defH~  ×Ó  # .§ Tv R   _spacex  Dsy |A tupler  7 0es, ‡ T*ofÌOthei~ Íàoccurrence in õ
the base class list.\n'
  '  Ÿ"__doc__" S   ThT ÿ"â€™s documentation string, or "None" if undefined€ BannoQ sˆ PA dicv ÷
ary containing *variable H ¿* collectedØ  du¼ / body execub ù
.  For best practices on Oworking` ‡with "__– €__", ple§Vsee Aù _ BestK P„ RCûžinstancesO Aï # ð is created by callSa' €object (¬ 	û labove)Ž =   a ðhas a namespace impleA1ed  Õ	c ^whichÂ 0is ê0firœlS !n - ð attribute refere¾ are search‘§   When an< Àis not foundl Rre, a  8i	µ /hau 	^ qby that,_ � Òainues 9 å a ç ts.  If ®  Ö¿  at aºSuser-¥` 1funh ÿ1, iD ðtransformed into6z methodf ? ` Pwhosezself__"| ù W @.  Sc` /anÏ '" u s÷Walso ·  ; É¼¥rœ 1â€œEPesâ€� e>I» #úDescriptors for another way.inf ¯6s oÆõretrieved via itsu<s m] _diffeÇ  Afrom]Áctually storÁ ;Í bict__"U	×.noÄ ; 
»t-| ^ - J `"__get¾S__()"Ê ½ –Àed to satisfBŒe lookupƒ^ A`assign|sÑ@deleî�s update{ · M ­t, never} /  D Ëú sú  G___del isÊŸÀ      'insteuad\n'
  û"'   of updating the instance dictionary directly.?  …   ClassD ùs can pretend to be numbers, sequences, or — Žmappings`  if¥ ñ#y have methods with certain special names.  See seË O S- J 4 '  4   6 ð attributes: "__1`__" is¤   J;M @"__c5: ƒQâ€™s  yôI/O objects (also known as file )~ 7A *" ñ* represents an openB ð.  Various shortcu! .reQ �availableïacreateB „ :"Z Ê()" built-in 1fun±,`  1nd â S"os.pG  ,  %fd ao€he "makeá  l 
c<` ”of socket±   (M ôperhaps by other £ s½?¯ €provided8 ÿextension modules)ÖU   Th½Õ "sys.stdin", Pout" ¡  oerr" aš¡initialize‹ ä ¡correspondo¥Qinter½rŠ, )ñdard input, output� àerror streams;O y– B allVóNtextb AmodeP  tÀefore followR  ¡  fa¬Befing/th– ÿ	"io.TextIOBase" abstract^ �nal typeå RA few @ use€ternallyøUK@expo* *toù½ Puser.@ir dé i˜Âs may change future verfsÚP 7ØP, butLž0men[ Qed hekpr complÀ?ess°C°ŠÎ  ! mp *byte-l Áiled* executG[Pytho Ocode  ÎrL  " *5p differj° between a   þ`a® å* Úa1 0con€8	jexpliciÞ T   reœ tus  r  globals (D6Ê in which it</waœ à   defined), wñhile a code object contains no õext; also the\n'
  '
 ðdefault argument values are stored in> “ functionl ), N ?not` = ¥ €(becauseV ‡y represz ªcalculatedb aa ürun-time).  Unlikeª (s,$Û 	¼ �immutabl"1andL0ainWôreferences (directly or in J) to» _ 	º+s.> ­ðSpecial read-only attributes: "co_name" gives_	ñ  & ;b  D ²argcount" iE ðtotal number of posi
%al7sN §(including4 ¹ p s `~js with=¢a ­!);ü 0pos¿ ¹ 	Æ ’ ` ˜ Ë  ­   9)X/kwŸ dkeyworÚ!™ � qnlocalsÒ	4: P vari"šs used by^� ® 2ª0varƒ� ta tupled -Athe !  n° ¦ `(startL ¤ Q … Z ¨cellvarž y 	¤ ,0than%e IO0nesòesÓFfree‹ P =
 A ½U  Œ
aQ 0str8˜   @@sequø ”@byteG q instrusú_constP
yliteral_ž z Ë %Ì F	´	§û
b @filef e   ± from which	a /wa‚compiledÃ ·firstlinenod @rst  v° À'
          !'  ðfunction; "co_lnotab" is a string encod	 €the mapp �from\n'
D  P ð#bytecode offsets to line numbers (for details see W osourceQ M ' Âinterpreter)± ‘stacksize´  K ™required � ( `  = L QflagsH 0an k 6gerþ aÂ A of * 
a ?for_  “  L · .%  J± The followkðlag bits are defined F ²‹  ":! 
‘ o"0x04"` iyAt ifUQ uses ð"*arguments" syntaxÇjacceptf /anb —arbitrary5@posij5al _ ;¸  « 8y+se` /if`  V¸ �*keyword¸ ¡ _ F ¨  %20¨ ? 4N Ÿgeneratorý¡Future fea pdeclara9@s ("xA __f% ‹__ impor4¯division")� @alsoì {As inùG æñindicate whether a ƒ	Ooobject_ õwas compiled with a particularØ renabled¹Š"0x2000"\/isa  $|u " 
Z } ;` k±"0x10" and   � @were9d5°earlier verl?s oªoPythonúOo 
– øcreservùQ0nalŽ [ $IfÇº@ repR nV J,þÏfirst item iÞ x@consi31doc1©:oa/, $@"NonÁCf unàÖ bFrame Ï )	" ò ` execuQ  fD 0s. r¿y may occurø ”tracebackw   (Áqbelow),- «a`passedQ	9¯registered|b �sð   Special read-only attributes: "f_² ¶Ðto the previoeus '
  ‰'stack\n  ò frame (towards the caller), or "None" if this i" obottomP j  V €; "f_cod@ 8   ú
 object being executed in²  o a [ tlocals"• ñdictionary used to look up * N ‘variables­ DglobS D Bfor   * I ¢"f_builtin’ ?  ð-in (intrinsic) nams 	�Ÿ"f_lasti"` BgiveEáprecise instruô   (/ 	Ðan index intoÎM AbyteŒs’ 0g oß!e  Ÿ+).9  =`AccessÈêð raises an audit ZeventÞ"f Ï.__getattr__÷ ð with arguments 8 t" and "r "ª ÀSpecial writð u pibutes:§ptrace",é3not÷,Rú 2funz- d ) "Aous ð Ps durþ Uç+ioå·` "isÅ byÅð debugger). Normallycj  ¥ 0tri e‰ Q òeach new source line -Ö can be dis€d by set¼K 1"f_/_D  s"io"False‹PImpleÏa¯òs *may* allow per-op3 6s] �be reques(	3/by¡ ½ Ø_S « PTrue"Hrte thatŠmay lead¨/toa qundefin·ðterpreter behaviourFRexcepá V?theP O T`escapeû  � 2, dõ RUineno$@curr� ºt numberýXA â€”$ º	k
xPfrom ªQin a ¡ Í AjumpÇ Ì  Æn|	^ O(onlÌ Y : sR-most^U).  A ÄiZ a Jumpl@commAñ(aka Set Next Stat•)þ & Ato fæ/noqFMÜûs support one method:’  U‰‹.clear()"  1 ð   This method cleaõrs all references to local variables held '
  Y'by\n  õthe frame.  Also, if  � belongedg Êa generator,_ ?the` 3 ñ is finalized.  Thiª †ps breakÔ 
\ ocycles_ ’involvingÅ ð objects (for example when catch) /anM ðexception and stor0 àits traceback X »later use).K  fà"RuntimeError"jraisedmÊis currentlyŸexecutingq °New in versÐ ?3.4: Tå FÎ & ð  represent a st%/u of an U*. Ô A_ ; j…  ,pimplicircreatedÓ^ 
\ occurs,b  Üímay also be ex^ ¯by callingB u"types.
_Type"`   For Î  õ "s,Ú  �asearchq³[` handl”anwindsÁ4"on•š, at each*unwoundè wlevel aþ”@nserŠ€in frontï · ÂQ è @.  W•	ÂÅ ±is entered,É TP  " made avail ­ ‹ ñprogram. (See secÜoThe tràstatement.) ItZ Âaccessible aX¤third itemó Otuplñreturned by "sys.exc_info()",fU 5"__?__"î ”attributex gcaughtb7  Žxñ contains no suitBŒ�
7­ ` ôis written (nicely formatted)š standard eŠ stream;c /if`  » i0pre‡1is  ’active, i· Ý	¶@userí±Flast›æV 4 Ûs¦ $upØ*oroÀ         '  ñ    the traceback to determine how ð"tb_next" attributes '
>  ™'should\n  �be linked\ áform a full stq  { .:  I ÷Special read-onlyŽ  : ¤ Ðframe" pointso  Ü 	“ Ÿexecutionb @ 1 ofõ ácurrent level;` Ñlineno" gives%   

onumber_ Qwhere7 Pexcep‡ 1 och da Àasti" indicaeÁ precise` pinstrucX A. Thx"e ‘ § and last & 0 in� M ð may differ from2  ÒZ sof its =Zbject/ifb >he 	 ” pa "try""0tem…ÿwith no matchingQ M ± clause or 6 “a finally l‘AccessingøÛ ð" raises an audit _event� !"o
`.__get73__"‘ 0rguÕ  s $ "š"¿"¡ †writable¯i¦  È ^	/thL�‚ (towardL  Ë	*),ÿo�"None" inPre isá« pChanged× àversion 3.7: TVÑ‡Ês can now bež ¯explicitlyÇ .‚antiatedÿÁPython code,¼ ¤ ¿ » "
g oAexisIh "ce© `be updt cSlice ç Ä 	" r are us�`represasF Zs for¸ "ÀŸitem__()"` �methods. uya €also creÃ 1 by4¡built-in "m N 2funÃl  `start"[ ¥Ëlower bound;æ OstopÝ C6upp< U"stepW   À value; eacho Ý	kromitted>sÉßhave any type:   ïÁsupport one ©Àd:\n'
      �    '\n'
	  ' ûslice.indices(self, length)0  ? ò!   This method takes a single integer argument *[ _* andP ñcomputes information about the ± H tha 	Ù oobject_ ðwould describe if applied toº ¦equence of® 	_ oitems._ �It returnAtuplJ Ethreð s; respectivelyÖ 9se d ?area  a*startFƒ *stop* Â Y Q   Ïep* or stridO ‘ î  Y ]P. MisÂ > Àout-of-bound“(   ðhandled in a manner consistÂwith regularÌLú dStaticeàs' ?   * à provide a wayì �defeating,I Vtrans€qof funcŒ€  0÷ 	Äcé¯above. A sÜ    i>Qwrapp> }¯ any other° ƒ ú	, usually a user-defined;P. WheŸ| P 	Ú  � ðretrieved from a class# šinstance,Ì/th}² B act² 7 :s– ÿ "d ( p, whichŠ /noÝ!suù ˜ ,0fur. Ê.#	»ßßalso callableJ Ñare created bÞ
�built-inw"“~1()";|tructortA C“= 8'A¾	+ P, lik%„ 
4,zaÊ ¢�#arµ³� ·Salterä ay)ÛÔ	ˆûè    Ž ’� ~#ndÞ ‘ús. The behaviourÆ /ofa O 
 s upon sucÃ alŠ ë ¨?ve,Q ®under â€œU™osâ€�. ¿ k
° \d pcÀ-in "classmeôthod()" constructor.\n',
 'typesfunctions': 'F ^\n'
  $'* !  Z ô	 objects are created by ‡ q defini’ .  The Š Oonlym PoperaC V on a\ | ÿ  is to call it:` "’ ð(argument-list)":Š QThereì üreally two flavors of› ¿s: built-in—  –  Ú sr ‘and user-I%edc ÿ	s.  Both support the samaE(.s  I ˜ R), bu\ Pimple=‹ÿis different, hencz ?thek B H Ä—ESee ’)rñ for more informº  ^ /pmapping-M   TG¿ â€” "dict"¼ :B ,  3A *~ *þ ñmaps *hashable* valueÞŸarbitraryH'	sÚ Ï'Ù ¤0mut\ r  EÔ`is curÍ0ly �? onÑŸ'standardÖ Ó É,”*Fðionary*.  (For otherÄ¯tainers sem  ŒCo @in "Ì ", "set", 1ò "tuple" classes  K b"colle!"K�module.)o  &A ã ‚â€™s keyn–*almost* ÀÔB.  VÝ P'thatfo 7not% edat is,/0conW@ing /s,é ³ oies ork ¨4�$ (ž r comparñ× 1 raÙ?thañ3'byyo àidentity) may è  beþ2d aU¡.  Numericas  æG‡?obeY'nql rules.n_ Ü �ison: ifè@numb¬k / e equalÝ P(suchÉ 2"1"¦P1.0")$n dy can ñ e À       'inteü
rchangeably to index\n'
  ÿ('the same dictionary entry.  (Note however, that since J ÿ computers storeo ðfloating-point numb2 Àas approxima† ÿ s it is usuallyp `unwiseß /usn xthem asÜ okeys.)�  Dñies can be created by placing a comma-separ %ßlist of "key:p ÿ+value" pairs within braces, for example: "{\'jack\': 4098,'ß"'sjoerd':\n"  À4127}" or "{E $: U  ,    B P\'}",) 0by 6ß "F"Ø Ïconstructor."  BclasÃŸ(**kwargsÀ* Ÿmapping, 3 �iterable4 § ø    Return a newtðinitialized from an opè/al´R'posi l ðargument and a possiî�empty sef„keyword - sy?   üs�al meansÏÂ _* Use7 	# z"„ ö/\Af  "p'Ql Z } J S prehensionò ƒ±"{x: x ** 2Ox inGrO(10)… $ æWtype »!: äC()",
 Ÿ[(\'foo\'€ß100), ('bar',3V200)]V Ðfoo=100, bar= HPIf noJ X`given,ˆ0 mý÷ 4'isòAR   If‡o ª×#a  ·Ÿobject, a$¯ › À with the saü
me key-value pairs as '
  ï'the mapping\n! ð   object.  Otherwise, 8 ÿpositional argument must be ano ¯*iterable*n ÁEach item inp < e oitselfl / Owitho ³exactly twoé Ós.  The first U of e� (�becomes azn Ê qnew dic=qry, andâ dsecondt  dk ¯correspond¶	ýR.  If” ó occurs more than oncÊQlast 1 ¶0for2 tÛ 
 ¶ 	¢ Y û .*  Í ukeywords²s are given—!  /ndØ _theirl ^ �added to¥¹Ñ created from ¯'k ?¯bbeing z òis already presentë o · ’ o  £&‘ replacesÈ E  h × Š  ó    To illustrat¢`follow`examplj¿ll return aß©_equalp ðto "{"one": 1, "two": 2
 0hre O3}":?  hq>>> a =ëp(one=1,h =2¾oree=3)? "? ¡b = {'one'› Q'two'›  't› Ž': 3}\n"ÚD cƒ Qzip([M !, J   G `], [1,ó O3]))Q dQ #[(G S2), (Z 1 Ÿ _, 3)]P eP {Ö !, O 	ö }J fJ 4ã  *G 'v`a == b c d e f°: OTrue   €   ProviÇ [×sùŠù_ onlyð À 'works for\Ln'
  ÿ-'   keys that are valid Python identifiers.  Otherwise, any O >  R \o Ïcan be used.%  �   These¦ Óthe operation¾ 0dic ÿaries support (andª  Ì oefore,o ðcustom mapping typY Uhould` _too):B  ¯   list(d)   ¸�Return aB € of all  qR1 in §?*d*|?len´ ) ¦ `number¸ _items¬  ˜  od[key]6 	L ˜  Ž  – €*d* withÿ *key*.  Raises aEß"KeyError" ifn 	N t is notø ?map…ð   If a subclass¶  ëa defin§ ÿmethod "__missing__()"¾  ™ º 	´ �present,^"u"ƒS callˆ–  ^m 	 Ž2key}Ñ as argument.ý y  n athen r-so 	Bor rß€whatever£9 4ed  @d byø K 		pQkey)"`. No ol,sY · % Ovoken 0)".	‚  )"Ê  m/d,Àn 	"is'-d.W@mustÎ"a ½ €; it canz ã _be anl 
`nstancˆoriable]ÞB>>> "€Counter(')M 4 a   ... Hdef APself,B  G I/ 0ð 	1   ¬ 4 = ª "R  0 ¯['red']\n"Õ* à 0\n'
          "	 õ >>> c['red'] += 1\n"
 	 0 + '4  K 'K ?'\n 6 ðThe example above shows part of the i Ïmentation ofQ 	p"collec* ÿs.Counter".  A different "__missing__" � ïmethod is usedp 	9by s ßdefaultdict".9  ÿ   d[key] = value'  MRSet "E a" to *H *‡ #el‹ m  ƒ 0RemÅ† ÿfrom *d*.  Raises a "KeyError" ifP*key*~?notn 	!in!?mapä key in Ût 	ÁReturn "TrueÁ `*d* haÙ  U » ß, else "False G ?not  $pEquivalè@to "I  Q  í Š iter(d) %0an C ‘ator over®DkeysÛ '�ionary. 
@This	an 	àshortcut for "r 0(d.g ?())ô oclear(ô "û0allõ 1ms ü Áæ Ç     copyŒ #€� shallowI u y   � Class Þ d pbable[,¸]< ÖCreate a new /` with f M*l _* and1óOs se9
'E   "û !)"œ  c athat r&  Ò cæ ¼JÄ XsØQ"NoneÕ$llÕø ð refer '
         å'to just a\n'
 	 '	 ÿ'single instance, so it generally doesnâ€™t make sense P ¿for *value*q 	ÿ&to be a mutable object such as an empty list.  To getq �distinctn 	� Ps, ust ñdict comprehensionù Oead.E     ” ÿ(key[, default]),  |±Return the ¨  C’key* if *	 2s i# t Ñ Ïionary, elsen 	*ª e*. If  à is not given,ü( Os tox`"None"*o 	ÿthat this method never raises a "KeyError"|oitems(p'Ña new view of~GQâ€™s a 0 ("â,¯/)" 	²pairs). Seed �ocumentatw#of� þs?keyJ ` $. ¼ ç 	d× 90poptV+ Ý;à€, removeèRand rƒ\2its—, 	 vF T/. c w p ðn 	 ©Ô N ÐeÔ0popúZ#U Û R#a ?+ Q fromÒ 6PYC arew ed"ÿ
LIFO (last-in, first-out)À_orderf €	"$"h`useful(ÐdestructivelyA`rate oò
ô ,þPoften­Ô âset algorithmsU -=À   'dictiona|ry\n'
  ' ÿ#is empty, calling "popitem()" raises a "KeyError".N  d ÿ'Changed in version 3.7: LIFO order is now guaranteed. ´ �In priorn 	c )s,Ê ÿ
would return an arbitraryh ïkey/value pairó  re„ _ed(d)©  -R£  F ñ iterator over the keys of &ÿdictionary. Thiso 	iÞãshortcut for "y @d(d.j ?())õ!:Newñ8Gósetdefault(key[,  ]V €If *key*i!in:&,Aits ÷_.  If¿not, insertW	m bwith aS  ±*Â E* an� /. r   p 	Y ¯s to "None³ßupdate([otherc!UA [ µSos fromð ‚ /*,ï 	 @writ°Aexis	  ­3.  A#C   "
Ð)" accepts ei1 an›  :¯ object orË /anÅ 	Ù0ble
qÀs (as tuples\ w ëD  l 	²length two)Üñkeyword arguments are specified,Èr ý p 	 isA "n Ld!os¾	::2"d.; o(red=1
oblue=2¥ê/s(N c a new viewÃ å3â€™Ls.  Seeç ?theF	1doc�aÏ d l tsO	À            P    ' ò(  An equality comparison between one "dict.values()" '
;  ¿'view and\n * ÿ&another will always return "False". This also appliesn Owhenj 	É -ng¼ ¯to itself:@  "À ÿ   >>> d = {'a': 1}\n" 
/ :U == d j •1   $  q   d | c"  ­ ÐCreate a new ððionary with the merged keysè—# of *d*n 	Qand *ª ö*, which must both be� 0ieseo k 	g ° take priorê A ¥ Ë # Osharj  ö .f  UÿNew in version 3.9E Od |=Ó%0UpdÓ ½Ñ2*d*Õ Ô ÿ ¶Ofromg,ê 	Ä ay¾!eiçða *mapping* or an *iterable*$)Akey/� m 	Cpair, sN ¦ èm †o 	 /¾?   /ADict� Ùe³1 ifÁ@only ‘they have±ò ¯same "(keyÎS1)" f± (regardlesfÀordering). O 3ª�(â€˜<â€™p  ! =" V â€˜>
 ÿâ€™) raise "TypeError"ƒ	>àpreserve inserV Ñ `.  Not7/atuKPing a-ñ does not affect‡a K9ñ dded after deleƒ u¥ eSab ?endÀ        '   ð   >>> d = {"one": 1, "two": 2
 0hre ü3, "four": 4}\n'
  ' O ! "! a{'one'h Q'two'h  'th p': 3, 'h 'h "h 
list(d)n 	[n !, k   h e ?]\nb Ÿ.values()k ú 0[1,3_3, 4]“ ( "[no] = 42- ! O 42Þ P+adel d[þÂ  & Â ONone£ ñ ! Ä ¢

Û  k }µa  ‚ ÿ+Changed in version 3.7: Dictionary order is guaranteed to æbë PinserS P ñ.  This behavior was an implementa, e Ÿdetail ofÕ ÿPython from 3.6.*  &  ý  ie• 6d dÁviews are re2?ble` Y°ý Oed(dø¾[± ¤» 	 Qwo', {cl lm 4,,O2, 1«'b @itemÍa Ö (× S4), (¡2, 3 á 2  ÏO, 1)ê ƒ˜8˜›ore nowŠ%ŸSee also:†  ò  "types.MappingProxyType" can be us!ÿcreate a read-only4 Q_ of ap  ~"dK Ôu ibjects- À        '====  \\n'
  ' óThe objects returned by "dict.keys()", Pvalue O andP 8 Bitem( „re *viewe ÿ*.  They provide a dynamic µ ; _n thep  § ñionaryâ€™s entries, which means that wheG  2 r �changes,o Athe ” Arefl5cthese 6 .6  BDict» S ðs can be iterated over to yield/ir³ ÿ respective data» ÿand support membership tests:¢  @len(E )#  A   Rc Ì 0 nu„ 4 ofµ, i¡O 7˜ -#an~#or~0he ", ü0 or" /ms‰�(represen¾/as`tuplesû S"(key] ?)"),p   Keysž° ,arQ€in inser| order.Í ¯This allowÉ rhe creaL Af "(',4ÿ)" pairs using "zip()":l "* =2 = !d.] cs(), d›ð)".  Another way/‘ edS¿same list iÙ ‘ ñ [(v, k) for (k, v¤#d.â/]"¤A   IÞ  @s©`le add €or delet ËË  †B9€may raisià"RuntimeError"Ë@fail3 <2ateô?all¥‘ ñ CQdÈ ×version 3.7: ÿ†à is guaranteed– ó b-  Ö xŸ  O •#  ÔÐ"True" if *x*Í ÏpunderlyÓ a °­à mr À or items (iün the latter case, *x* should be a "(key, '
  ¯'value)"\n ¯   tuple).   ÿreversed(dictview)(  Ã   Return a J á iterator overï akeys, ½ @s or" /msá  of1 l  ¤ Àionary. The ° P will:x Ued inŒ �order ofm ?thej ŸinsertionM‚   Chang…  YÀion 3.8: DicO 1ary¶ Ÿs are nowš KOible   �.mappingÞ  Ê‚"types.MF ðProxyType" that wraps§» �originalf  ¥ Ä‘ to whichM  ¹  refersõ `   Newõp/10C GKeys–àset-like since� ’ir entrie·¯unique and_hasha¼dIf all 1 B, sod3r)" pair{ ù� q ¤ _ 2the�Bitemó ” is also ö P.  (Vh¢ §‹ p ånot treated asU K	I generally 8 Ü .•6Forc š ,\G0 opŠò ions defined fo“l �abstractÚ ñbase class "colleÐ¡s.abc.Set"ÑPavailü  (j exampleÍ_"==",l @"<",)?"^"Î3An t  õk  usage:s  ñ"   >>> dishes = {'eggs': 2, 'saQ Â': 1, 'bacon "»ÿ "'spam': 500}\n"  'l  -# =s . (þ1 % � ¦ . 5 è | #› ra©( 
_n = 0" 
 þ1val—Àalues:\n'
    q'   ... Án += val\n'
   ) Ï>>> print(n)% ?504  0   W  # keys and‚ ÿues are iterated over in the same order ¨ ¢(insertion% ª  x Plist({ ' ð"   ['eggs', 'sausage Pbacon	 Ÿspam']\n"3d ovaluesf  \Q[2, 1 O500], B²view object?qdynamicVÿreflect dict changesP  ó  £del disheså / (2  î  a {hÈ g €# set opJ?ionõ  � E & {ó€ oalad'}é "{'+ "  ô ` 8^ {K_juiceZ 
" �	v 'ñget back a read-only proxy form�originalk Loionaryi 
û�.mapping+  B  € (‚7: 2÷ :"h u !"'’: 500})¯ �
˜ [9 ´ò500\n',
 'typesmethods': 'M Ú "'*   P @funcÍas that Ácalled using¥Ÿattribute¦@notaB .m QThereX ótwo flavors: built-in è ÿ (such as "append()"o 0on Úë âäclass instanceb L.  Bu  Ÿdescribedo @withÝ ª:psupport, mD ó If you access a¯ D (a œ€ defined¢"a Þ ›Ÿnamespace¥through an,|  ©“a specialãŸ: a *boun·ð* (also\n'
         ò'called *instance method*) object. When ' õ, it will add '
G 	 ß'the "self"\n  Àargument to ,  Ãlist.  Bound„ ¯s have twok ßspecial read-n ðonly attributes: "m.__Ÿ a__" isƒ è ‘ on which » i Âperates, andf Gfuncf    tion imple?ingl .m @Call=  "m(arg-1,  b2, ... !n)Þ  col OtelyArequivalŽk  ÷k 0.__Ã 6__(Cm € ¼ g PLike _ "‘Gs, b�às support gett› «Ÿarbitraryo æ.  However, siÿ5¿ are actualHŸstored onn  çpunderly° ç 0 ("Y__"), sÛ  - /odj Ø  Î>síñdisallowed.  AttempBt`Oet aÔ j  i a°ô results in an "Ay�Error" be °Arais– Ip Porder4s• p †  , you need$  explicitlyJû it¹ ?theI¯:1  ï   >>> class C;    ¸A3defÛ (¤)2  7 Opass€ /..‰œ o = C()@ "$ .uð.whoami = 'my nameV ¡'  # can'ttOon "0 q ð'   Traceback (most rec¡ ‰_ lastð
  File "<stdin>", line 1,‘�<module>y  ê 
®2: '© 'yv has noá ""'#?'\nÿ   f PSY
K  *	K x Ý ð 'my name is metœhod'\n"
  O'\n'  ð-See The standard type hierarchy for more information.\n',
 '+ Òsmodules': 'M i *    ˜ ñonly special oper‚ b on a { ÿ is attribute access: ì Ÿ"m.name",o ‘where *m*R ^ Pand *7 *\ Pes a  ¿ defined ino *m*â€™sm âsymbol table. :Ç às can be assigd ¯to.  (Notel �that them €"import"æ`tementã ²not, strictd—aking, aniH}p ƒobject; x ö foo" does not requireÁ/ TdÞ �*foo* ton õ exist, rather ia sÊ Á(external) *°iÂ*Øam mÆk  ÷"d � Asome3/.)-  AÎµ„of everytðis "__dict__". This±Œô > ðionary containing#e  › †0ify' j iÌk ÿwill actually changeu 	,ƒ¯but directDÈ!to_ /E 3 pßpossible (youp  mOwrit?$m.Žó[\'a\'] = 1", which s "m.a" to¸"  Ç J ‡ ocanâ€™à Œ  P w � = {}"). *¤ó , lyò q /noi °recommendedÕ  �°£s built in†ðinterpreter are È pten liki˜<t	‘\'sys\' (m ð-in)>".  If loaded from a file,y| � aÉ"‰ @ \'os Z I ð\'/usr/local/lib/pythonX.Y/os.pyc\'>"R'0seq#ðSequence Types â€” "list", "tuple	 r6"z'B À************* X\n'
  ' ý0There are three basic sequence types: lists, tuples, and range\b ûobjects. AdditionalN ü tailored for processing of ° nbinary¶ Adata† Átext stringsÆ ðdescribed in dedicated sec� .s.L  „Common SQOperaQ > = ,  UThe o^  Å  the follow%Btabl°`supporÝ }by most>Æf ×“, both muT Snd im  . ‰ �T"collJDabc.^" ABCg  isàðvided to make it easier ý
correctly implement theseÌ g ›on customjíRThis æ € H w " sm�in ascendŽ!�priorityz  !InZ j Q, *s*À1*t*·«s ò2sam~m, *n*,N*i*,
#*jW kW ‚integersl @x* i ² arbitrary ¯N tha?@meet/ €  @T €value reƒb Êposed byæ 
 ·  lA"in"S P"not  |0hav¡!e fmies as/th— §comparison^å€"+" (con)nÕ)ˆ -*"\ a(repetØ)Ç ± y¯  Ý÷2spoEnumericP 	^. [3]!  /+-  
8 	# +` %| ûY ‚| Result  1r| Notes, |p  MO===| 	 	# ` 0 "xe"s"ƒ 	 ð| "True" if an itemŸ ¼i³ Ð 4(1)E p    p| equalô*x*, else "FalseŸ p H À |\n'
        ?'+-  
8 	# R+\n'
Y  ó '| "x not in s"  ñ| "False" if an item of *s* is& P 1(1) O   |p    õ| equal to *x*, else "Trueš p H p  	   
' 	# @Us + t¡ � ô | the concatenation?Žand *t* Ð R(6)(7CÐ eÈ* n" or "n * pivalent¥aadding"toù Ð  2Ð 	|7  ò| itself *n* timet- p  @d?[i]ˆ | *i*thH¢, origin 0¸ Ð "(3P	 ³  
' 	# àO[i:jÒ t| sliceÔ@fromâ  1*j*Ñ Ð "(4Ó  fO:j:kÒ  Ð &5Ð àÂwith step *k16 @ `	Ðã  
' 	# olen(s)â„| length«  Ð €/miÐ ˆsmallest³Ë  Ð 9À-+----------- + h+\n'
  ¸'| "max(s)"  ó| largest item of *s*  P    |p 	� œ    
 ! )--# Ð ós.index(x[, i[, j]]Þ !|   É ðthe first occurrence Ð 0(8)Ì   Ð  |  �| *x* in7Ã(at or afterˆ >   p M p  Ói* and beforeg 5*j*Ã p 	pƒ  
' 	# °scount(x¦à| total numberŸ­s @?°‡ 
 @}b@SequÎ! çýsame type also support comparisons.  In‹¾particular,f atuplesl“lists areS óed lexicographically by >ingN ócorresponding elements. This means that toF îe equal, everyQ C D musê 3 ³  Utwo s,) b  ç Df U€nd have 8  ( ý length.  (For full details seehC‰? inf  ñhe language refe­..)*  qForwardõ r,0sedÍ÷rators over mutablemaccess© nvaluese  us¶"ano@.  T¬kÐwill continueÀsmarch f˜ >(orP @back¶ )ÞAn if[punderlyk · autatedv \1iteë e ðterminates only when an "I=aError"°q "StopII oion" i !enÄ‚ered (orN  þdrops below zero).‘  nNotes:  À         '1.ð
 While the "in" and "not  øoperations are used only for '
  œ'simple\n ñ
   containment testing inu ðgeneral case, some specialin M Ÿsequencesh ó(such as "str", "bytesÕ   Àarray") alsoÏ  ƒ mÎ O 4subp · :)  €>>> "gg"ê o"eggs"* ?Tru8 . ñ2. Values of *n* less than "0"£qtreatedý0" (which yields².and •   empty ú  of&  same type\  *s*).  Not;€at itemsê ±/thÛ  &  _ 1*s*º  tpcopied;p y Preferð­d multipleÆ otimes.Ê 0Thi,ðten haunts new Python programmers;¢_sideràÿlists = [[]] * 3† 0   , ! R[[],  ]$ E ß[0].append(3). ! 0[[3t  v  9 ¡What has h‚ Aed iƒ0t "" ‘a one-eleñ ø µ?ingf #an† =  ³ all three X  Ùt  yþ}?/@to t"gsingler �.  Modify©0anyp "{ · "¯ @s" m=  ie3is _   ±. You can c©0 a  ? ofP 1dif t& O ?way¦' ì  i©�range(3)ù À � so%[1�5�%[2. 7. %3   Ë5Ð/7]Ò  9 áFurther explanè¾€vailable& öþFAQ entry How do IÏÎh º±dimensionalÍ?² > ð3. If *i* or *j*  �negative,'` index 1rel  Ö]e end§ gÀ            ÷'   sequence *s*: "len(s) + i" or øj" is substituted.  '
  l'But\n ò   note that "-0H žtill "0".1  ð 4. The slice of« ð from *i* to *j*� Àdefined as t/ Ú ’ .ofc ó   items with index *k* such» ñi <= k < j".  If~ !or~ c /isc pgreaterQ n\e", use [  is omittedŠb "None",g P 0¦ K ; w i Ë ƒor equal�,€¯�is emptyé5é¡Astep 7is ÷¼ ?the!õ.of÷è "x = i + n*k"0n÷<d q(j-i)/k†Òn other wordsýindices are "i", "i+k",] o"i+2*ké@"i+3¤ ñ	and so on, stopping whenœÿis reached (but never³ `includ= �*j*).  WD k^‘positive,ø r  w ¿ v¯reduced tof d@" if(y.s Jnegas k ƒ h ‡ ]O - 1w Ð/arIV ýthey become â€œendâ€� values (which endé¯depends onÎ Ò1ign kž0NotŽñk* cannot be zero.Í ¶1üiªAis t¤Ÿd like "1¢Ð6. ConcatenatA•immutableaps alway�ísults in a new
oobject1 À   This meanäqat buil²Eup al p by repmic© lw�ðhave a quadratic runtime cost½  ’Vtotalw nolengthÊ éo get a linear_ ð , you must switƒ ÞýÔPalter~®ves below:Ià\n'
          ö8   '   * if concatenating "str" objects, you can build a list and '
    {'use\n'    R ÿ&.join()" at the end or else write to an "io.StringIO"P �instance‡ ÿretrieve its value when complet”  V 	_bytes ¯similarly ô = ö !orÚ BR @IO",ü Z¯do in-plac­  A¡°on with a "b Tarray£ ).  ŒÓ? arh bmutablX0hav	 þ efficient overallocation mechanismP kTtuple¿ `s, ext0a "g " ê>eadP  b ðfor other types, investigaaýhe relevant classÄ�documentâ d  Ð7. Some seque“x ý (such as "range") only support item| C sf ñ   that follow specific patterns,
h� udonâ€™tl g f 
i�or repetið.1  ð8. "index" raises "V“bError"™�*x* is noÐ ý und in *s*. Not>allf @   iÝªsî @passÅ c1addº aal argØ^s *i*e nb  P—j*. TheseA  w`searcht �of subsec/\/ofÊ  ª ”7. PÀ Wextraz ­is roughlyÂ pequival¦/tog u�"s[i:j].¤0(x)‰ ™ S€out copyË �any dataXB -  Äh preturneÖ`dex beO qrelativäð ptart ofF ;h  raÊf Bthan= 	J Olice¨U $ImýSËTC* = *  2The
AopereÙi~ ÁA genuóf ,cDalso.Ànted by mutaø
ble sequence types is '
  ì'support for\n þthe "hash()" built-in.(  TThis \ Øallows immuta— ýs, such as "tuple"  Þinstances, toh qbe usedB ñdict" keys and stored in "set" q"frozen í j á àAttempting to $? anã  Þ that contain un;  Ü ñvalues will resultÍ ¯TypeError"© X M†S R s( = (  àThe operations¶  J fo2 ñ ô are defined on ˜Äg Õ . n q"collecp S.abc.å ä P" ABC €provided¶j Nmakef �it easier3 ù	correctly implement thesð �on customÎÌ ~   Inr  J0*s*Ö  {)U of aMq ], *t*” i/yh Aiter¨aobject@$*xo £arbitrary  èAmeetO f  ¬ C h ç á2triÁ \oÖ0by á €(for exarÎ, "bytearray.?onlÊ  `acceptˆbtegers” ¬ J� € "0 <= x $_255")y/+- ! /--# +G4| Orá |”RU# 
 || Notes / |  - |  # o ½ "s[i] = x"Ÿ    | item *i* F½is replaced
`by   |8    (   m ;"   Ð---------+---- + h+\n'
  ø '| "s[i:j] = t"  ü| slice of *s* from *i* to *j* P Sis  |;  | %  ð| replaced by the contents’ ~     <�iterableê ;*t*¬  þ ¨¿! /--# ìBdel ðìgame asc)[]: î Šê /:kÜ|ODelemOM:k]"î@are Ú2(1)ç	 Ú1!osepgmŠ[@	:zremovesuî &of9 î + M çœ Ä +~ Glist3  		 ì „ÈG¹s.append(x)�ª "|  As *xª í ?end3 Ú;  î  m°sequence (sQh-asg    #¢"s[len(s):  „ E[x]"ËÓ   ìaðclear()"           ö| removes all items from *s* '
) ù    '(same | (5)  <|\n1 |  �| as "dell _s[:]"g N   /+- ! /--# +î ¯"s.copy()"¥ p| creatm� shallow 0 = of  €/  m<Á-asn "oÁmtóextend(t)" or "s += t|"|  sËþwith the content?of î + ø¡| *t* (forw ‘most part (X < Y’s[len(s): =] =úteÓ ìsS *= nÛe	 Q| updY 7ìiã üY6_Øh   EpÙNd *n7[times; m‹Í.insert(i, xÌ"|  ¡s *x* intob.at\"he÷ î + I ¹òindex given by *i* ÙWavT Ú +  o"s[i:iL/[x³T   nÈ! ²À--+\n'
       ô '| "s.pop()" or 3i)"! ô | retrieves the item at *i* '
&  @'and	 P| (2)	  <|\n2 |#  °| also remo‚ }it fromz 5*s*; T   /+- ! /--# +î 2"s.Ë &(xcº m é jRfirstpô O| (3m7þ	where "s[i]" is equal toqxqmŽPverseÞf
  Ú ÙPs of L¨!in5 O| (4m7e Qplaceh  m‡ìnNotes:  ñ1. *t* must haveýÒsame length a¡@slic€ ˜ re-Ning.P  ò2. The optional argumenÅ€defaultsæý"-1", so that by÷-  £ g T   la³#isµ d �returned° C3. "'ð)" raises "ValueError" when *x*Ànot found in½c 41"re !Ómethod modifiî`sequenw n r]e foreconomyPof spØ³ o Äing a large b A.  Tè�ind usersg •/itg pperatesµðside effect, it does &… ½ ‰ -ede � g  �5. "clear@ çQ"copy ±re included4ðconsistency with† Q Á   interface�ð mutable containðdonâ€™t support ?ingR oÐions (such asø "dict" and "set"). "copy()" is not part '
  œ'of the\n    @ ý&llections.abc.MutableSequence" ABC, but most concreted m8 e sM þ classes provide it.1  ð   New in version 3.3: "clearý 
methodsZ ð6. The value *n*Gÿan integer, or an object implementing¥ ñ"__index__()".  Zero®snegativi As ofm À  ›N2Å  €   ItemsDthe + A arepcopied;X y PreferÍdh multiplôtimes, as explained for "s * n" under Common 1c ROpera`5 ^Lists) =   @ 	¤3õs, typically used to store coÒ .ofe Ñhomogeneous iŸ`(where†ð  precise degreeþý similarity willc ~vary byh aapplicP) 1 s° list([iterÝ.])(  2   ;Pmay b�nstructed|Þseveral ways:>  ñ   * Using a pair	 qu¸€brackets�Rdenot9Qempty½ :#N"[]"e  w sm `, sepa�#ngµÿwith commas: "[a]",y  /a,g o  b, c– aá  v `prehená } xmxl¹ò  !7typ½Qor: " )"ß a )a  6#co£or builds Ì @whosÞ § ß ‡ Asame-inSž4  orgDas *¦ C*â€™g'.   ªmeitherf a¶@0, aÞtèár that supportk  '$onJš ?torb ?X.  If­ £is already7‚  py…1mad.À\n'
          ð('   returned, similar to "iterable[:]". For example, '
;  ü'"list(\'abc\')"\n! e âs "[\'a\', \'b ¢c\']" and H Ý (1, 2, 3) )"l ­  H & l 3² ý'If no argument is given, the constructor creates a newp _emptyf  õ ~, "[]".   ð   Many other operations also produce U Ás, including® O�"sorted(k�built-in— pLists iÜ+aall ofz acommon�0mut� sequence*Ó y  2   g î Avidec `followë @addi®al method:F 0   þ(*, key=None, reverse=False)5  ÎCThis} V s£  •Ð in place, us® ~only "<¢¿comparisonsg ðbetween items. Excepú ðs are not suppressed - if :i h “R failüaentireß ‡Q will%   (‹l ?thee ? àlikely be left2ÿa partially modified state)% b ð`()" ac)Fs twÚ £qat can “Qbe pa9b¸   )�word (key	 -: ,/s)yÐ   *key* specÝ  F@funcÍ D6oneƒ1thaˆuÖaoþ ¦extract a ñ Â ¡ from each6A ele¿M(for�¼e "<ñstr.lower"). Thef ’correspon�or  º áÇ hÄh ð is calculated oH oQthen  ½  ¢¦ nh processE Éð e default valueŽ"c" mean6¼ Ì zf  Y/edÌ ð directly withou„Ú  ± ’a separatF„ ®  \  ~"Jð ools.cmp_to_keyputilityÔQavail˜-toõ•convert af À        '   ö   2.x style *cmp* function to a *key h.\n'
  '  ð*reverse* is a boolean value.  If setd À"True", then  b Olistf ó elements are sorted as if each comparison were ” dÈ ñThis method modifies§ ýsequence in place for economy ofÈ _spaceÉ wþ  Á Äing a large c ð.  To remind user‚ ]at ite �operatesh ð by side effect,C âdoes not retur„ Š %ed� g ?(usË "= 0()"ßÀexplicitly r2„st a new® Þ_ Ÿinstance)©!e {  y ±Ðis guaranteedŽ €be stablƒAƒ | <:  ]&itX <‘to changeírelative orderc /ofŸÐCthat¿Ðe equal â€” tŽ¡is helpfuls o 68/inf ñmultiple passes (ºrxample,�by depart_�-byÊ osalaryh OgradÄ1For  Ï e� Ps andAErief Ýtutorial, see– Sorting— oHOW TO[°**CPython i# a#ð detail:** While¹0istò beÄ “ «?ed,™ $th™ @`attempÉ  º€mutate, d�ven inspÂ 5 h UiÉ�undefinedYLhe CØ 3of ñ 3makðT i oappearÐ  ¿ y¤ ¥ 1dur6,Ò0rai{ "VcError"Z=canÒ_detec- c ¤ ’has been 3Pd dur�a>÷Ñ OTuplV= 0  B © im› &blâÀs, typicallyâ­NstorÝQcolle¢/s Ið	heterogeneous data (such $Ð2-tuples prodø uced by the '
  ü'"enumerate()"\n ðbuilt-in). Tuples are also used for cases whe ®n immutabll Žsequenceg þ-of homogeneous data is needed (such as allowing storage in aÓ ~set" org þ"dict" instance).#  pclass tþ `([iterÜ .]))  $  6òmay be constructed¼ þ number of ways:C  p   * UsQa pai> €parentheŠ‘to denoteñRempty¿ :+õt Ptrail Qcomma a � Tletonk 0"a,…s  /a,ju pSeparato ±items with z ±s: "a, b, cj #"( _ H "â4)" ô&:  .orÉ 1 u 'Th!oro Bds a9r whose ì  l œ �same and„  inä;4 Porder:*§ R*â€™s_ 6.    ¢^eitheí ad Ñ0, aÛñtainer that supportk  Àžon, or anÄ  St¯è   object.  If­ iTready8@, it3�returned° ôunchanged. For example,è¢\'abc\')" F ­s "(\'a\',µ 0\'b !\'0 m  °A¹ [1, 2, 3] ]  0)".à ½no argumentp /isd `given, €[ ’@reat¬W new o, "()"÷B   ND#at\ractuallIƒ¡ which makn N, noÁ /th÷ 7   ¹ .  lðoptional, except8 ªæ %– ¦ƒ1whe6y_ cýto avoid syntacticƒŸambiguity? +  QfŒ –`a funcÉ R callÅNthre%/s,Í •while "f(a /)"b Àwith a 3-tupØle as the '
  |'sole\n Î   argument.  ð    Tuples imple8 q all ofu ÿcommon sequence operations^ ñ	For heterogeneous collecB  d ýdata where access by name isò ~clearerÅ Gthan@ ‡index, "l .T  dtê ÿ()" may be a morE òappropriate choice c ! s& I o objecg´ nRanges =   `The "rG ÷" type represents an immutable¾€f number! d`i�  óly used for looping a specificU  Ð0timK}n "for"b  < :aclass Þ n(stop) 
# Part, * [ ?ep]2  D  ÿ%he3As toøy ð constructor must4PintegBz_(eithžó	   built-in "int" or any@ [t~í1"__Ö___()"Ç �âal method).  IÃe*step*ã  Y½omitted, it£pdefault
h G"1".[ ?art\ L ] "0".m /Ifd ³ ðis zero, "ValueErrTiOised‚0   …²a positive ] ,çAcont0Bof an~ "r" arpdÈ_mined´ !byR ñ	formula "r[i] = start + …#i"ì¾"i >= 0" an‡; <f  á"ù Onegaù 
 ]ð ÷ _still|  ¥ 6 í P, butO ]!ai¯9re >Ñð AÂ˜P will²€empty if”ñ0]" does not meeŸ —voµ ". ÂÅ do support kuindicessOayð   interpreted as ñ	indexing from the end of Èsequence '
  ü'determined by\n !  ? þpositive indices.*  ð   Ranges contain� ýabsolute values larger than "sys.maxsize"ª ?ared pÀ  ttÁ ÿut some features (such as "len()") may raisL ÿ "OverflowError"ç ® examples:§  … >>> list(r)_(10))+ ÿ[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]6 a O, 11d a O, 10e �0, 30, 5h    S Ï, 15, 20, 25_ 1c _ 3@0, -V -	% ÿ, -2, -3, -4, -5, -6, -7, -8, -r À ?1, 2	G  (¦i¾„ment all9ucommon @­operations¡oexceptb �concaten: ° and repetiI � (due toi@fact!t d objectse pan only\ 0resÉ · sT ýfollow a strict patternf ?andb µ  Ä 
Ö òwill usually violatew Uw )_OstarX £ S   Th^Ä*A p* paramð¢ (or "0" i¡ ) /walÿ    not supplied¶ ž Nstop  É 'opÈ 9  o   stev ,ev >1>WH>9 ”advantageÚÀ"range" typeø over a regular "list" or '
  Ü'"tuple" is\n ü0that a "range" object will always take the same (small) amount O .ofc òmemory, no matterN aize of } ð it represents (as a >nlyc astoresL ð"start", "stop" and ýep" values, calculating,®individualf QitemsQ 1sub´ Þs as needed).1  Rgf²s implementº ðcollections.abc.Sequence" ABC,y Q Ðprovide featu@such– rcontain^ sests, em ]indexú ~lookup,c @slic+ Jðsupport for negative 4”ces (see µ ® Types â€”j ?isth  ¦!, Y.):ˆ  r>>> r =3 P(0, 2 ))  k 8 ~11 in r> ^False  • /104 ?Tru3 !r.—?(10À  5g Nr[5] .10  • ?r[:/ 1=	?[-1k 8k  1Teslj ý Cóequality with "==°�!=" compaÒothem aÌ s0Ps.  TØris, two y ñ are considered „ = if§?thek £´x  Ïdp.  (Not8'atƒ Ë oË  —¢ ðmight have differ8îe n"step"—€attribut� xa�T(0) =[�2, 1, 3)_Ø G3Ö 2G ¯0, 4, 2)".ä ¡  Ch.dKàversion 3.2: I§ ÙhqcABC. S¡Åe  ÖÊ . ³@ "inQsó membership• d  UNtante 0tim'Pstead&Biter€Áthrough all `G
À       'Chanðged in version 3.3: Define â€˜==â€™ and ! øto compare range '
  ¬'objects\n ðbased on the sequence of values 2y d| €(instead H  ?ingc … ¾ identity).,  =NewÀThe "start",	 1op"@"ste Ÿttributesb žSee also:}  @  *  õlinspace recipe shows how to implement a lazyÊ-ofš°h ð  suitable for floating poiY ¡pplicationæ ñ ,
 'typesseq-mu8 R': 'M $ SÛT% p -/'* 0   &Boper¤  Ä c`followÈ £  ³_†W— Ò ¢w .¤r"collec$Cabc.Œ" ABC is”v €providedÔOmakev �it easier+ —correctly	gthese /onw ocustomì –  Iñ„0*s*0an áa,a u±  tC, *tG yx AiterÓ Æ#*x8 ³ arbitrary  Othatv  meets any €  x Îr restri œoü0by (e0exa»,t ÿ "bytearray" onlê ð accepts integerJ0at ´  T_‘ � "0 <= x{ <= 255"6 ° /+- ! /--# +w 4| O¥ 
 |ï jResult. 	 y| Notes   C|§ = |  ?===# w 	ð	 "s[i] = x"               ó| item *i* of *s* is '
 
 ú'replaced by   |  ?|\nA 3 < | 5*x*& 	 \ Œ § /+- ! /--# +w ï| "s[i:j] = t"å  t| sliceª2froºã Qto *jÒ­D?the½€contentsº  ( � Diterablˆ /*tE<Ëà:! $%Bdel ($game asM )[]B š/:k, | gDelemws�:k]" are×?(1)}¹	0   *| *!osÅ” §•š›P   Zmoves� of5   3 Q éüL 4Ž Glist;  		 0‚ðs.append(x)"           ô| appends *x* to the '
 	 q'end of# I   |  ?|\nA 3 = ÿ | sequence (sam‹ %as4 	 \ � +¢"s[len(s): ?] =S[x]")Ž !/+- ! /--# +•	´"s.clear()"¿  ÿ| removes all itemsƒfrom *s*¿E| (5T •+as "del… 7s[:Šw   � Q«! •(?opy”€ | creat•� shallow@copy¹ ˜¹•A°a"—¹ t! •'óextend(t)" or "s += t8"|  sAwith-€contentsœ 3 Ú¡| *t* (for‡ Omost$Apart& w¿!�  ¹Q W<\ ¹ƒS *= n�	 Q| upd¹ �$/it6$¹6O   9À              õ| repeated *n* '
 	 h'times K   |  ?|\nG /+- ! /--# +w ô| "s.insert(i, x)"¬  "|  ßs *x* into *sbat the<  3 Q Zÿindex given by *i� s(same až\ •3 � Ÿ"s[i:i] =!U[x]")2 	 \ � à:! $'�pop()" or1  i+ *qtrievesþitem at ´0andO| (2  9 O  °| also remo’ it fromŽ !s*7   \ � t! •'ã (¶* ’afirst ˜�$ Û ¿/(3•?`where 0¿]" is equal– hx™•žPverse. S	  * )Os of �!inC O| (4•?CplacÇ~  •Q BÀ            ÿ    'Notes:\n'
  ' ò1. *t* must have the same length as ¿lice it is f ¯replacing.p  ÿ'2. The optional argument *i* defaults to "-1", so that� $by5  À w À   last itemÝ ÿremoved and returnedÐ "B3. "M ð()" raises "ValueError" when *x*w Ÿnot foundÑ oin *s*‹ "4[€"reverse� ãmethod modifieäPequenç n ÊeŒ ¿for economyZ
‚of spaceë  Óing a large sr ¯.  To remi@user© a­w ðperates by side effect,ÀPdoes nÝ ç ± &ed¨ w  �5. "clearx WQ"copy Àre included T¿consistency• @with¶ q õ   interfaces of mutable containGïdonâ€™t supporL0sli×r 
ot‘ions (suc9a"dict"K`"set")
ü H ž@part» ?thew 
p"collec4rs.abc.Mì SZï" ABC, but mosã „concrete,u 
·P clas×@provh/it "    New in  �ion 3.3:6»sj "6
v†1 *n{!an/ÿger, or an objec,Pimple›?ing(
ñ"__index__()".  Zero‘negative ‰ ¤ � &ùš×ý €   ItemsO3 A areùpcopied;Dy Ð0ferŸd multiplŒ`times,2@expliÖô"s * n" under Common ¡ï OQ í ð,
 'unary': 'Unary arithmeõtic and bitwise operations\n'
  /'* 6  ÿAll unary arithme ù  have the same Œ ›priority:_  ô
   u_expr ::= power | "-" H| "+ ~ I  3TheÆ  L s(minus):‘or yields» 1negMû  of its numericP ‘argument;4 ‚ñ can be overridden with% º"__neg__()"{specialb {method.  × o+" (plÖ Æ  ¸ 
‚ «unchanged;`  ÌÝ 2posÝ Ð 
c Ï ¯~" (invert§ý$ @sion°	r,ituinteger0.  AK ü"x" is defined aL ñ"-(x+1)".  It only applies to j 0ral>pbers or jcustom]objec« DthatFS1"__ì teXñIn all three cases, if–†does notÅ prûj type,´ a'ð"TypeError" excepŽ ?QraiseÅÐ,
 'while': 'v" p" stateKT ¼$  W  ‡ ñused for repeated execu¦ Ûas long as anQ  ‰!es^is true¿× Q_stmtÃç `assignè ßV ›":" suitey Ä	 …["else" 2 ]3  EThisï rly testáÕ 1and	 it& à ,*esò,th£ Rfirst½ ;M[ ðis false (which may Q: 	¬<tim` ” aested)«) ç E aclauseÅ €present,Ë 	] ì+ed" C J ÿ loop terminatesr‡A "break¹3Ad in© á ¯ Y  	™  z •  .3outS 1ing6 à"else" clauseâõ€™s suite.  A "continue" '
  É'statement\n òexecuted in the firstP a skips qrest of l š and goesf Kbacka ¡to testing> ðexpression.\n',
 'with': 'The " /" ­ /'*  	n ' R ó is used to wrap•  0ionä €a block ‹ 
P ðmethods defined by a pðext manager (see sectO oWith S{P'Cont9 M9 ñs). This allows common "try"â€¦"except yfinallyâj'usage° €patternsì Àbe encapsulaï0for» Ðvenient reuse’4M!  U_stmtWD ::=µV( "("$ _ènts ","? ")" |-øN * R) ":"}
Ê } /  }  ¦“_item (",   /)*B   
¿ ’ê ["as" target]@ 
  Z: æ½€ one â€œx ú â€� proceeds asS !foø: 
 1#e¸:º (¼ TgivenÔ™ %)")ƒi„ �   evalu"žto obtainå)
2¥ â§Ð"__enter__()"Šploaded � —r›] 
3] ?xit\ '4\ ¹  À invoked³ 
s5. If aW  was incluù u¡÷,–ireturn± �å�   from \Passig§_to it£ 
   Note|
5 ø­   guarantee,Bat i(
‘ u'@
Û_ ò s9Áout an errornã âÞwill always b€  calledÔ0us,• N ´ occurs dur–,  ,/thP ¡ list, it � bbe tre0¥he same as¹ k  g î   »T°would be. SD¼tep 6 below¾Àn'
         ô'6. The suite is executed.\n'
  ' 75 ðcontext managerâ€™s "__exit__()" methodW ú invoked.  If anO õ   exception caused t• `to be U ý	ed, its type, value, andN ðtraceback are pasR  as argumenC oª Ø. Otherwise, ø ]three` g"None"O  g osuppli: Ý  wasæited due to anÞ ireturn›  › Afrom2 ‰ n 0falå  ƒ u)is[ mreraisË ½ � ƒ  V  trŒU   reË ® n÷Ñontinues withÂ Pstate¯¡ following "" "L / »
Ä ó ½ \ð for any reason o[ than”
 	�	Œ€is ignorÎ3andr Y �proceedsç !at±normal loca7 ½  qkind of0 ½ tŸOaken
 gZcode:{ 
 "  ¨ûEXPRESSION as TARGET9 DZSUITEE 
 ûis semantically equivalent toT 
: $  ƒF = (“ )' qenter =B(·A).__ .__0 ?xit/ â. != N _ ' Bhit_{@ = F�
# 
 k   try Tp" =8  & w oU 	Ÿ >Truá X aif notgê ÿ, *sys.exc_info())a  ? `± 0finû7 r Ÿ '  ^  Ñ–  ­&,  
† W~@more=±n one item,uñ Q!e ª ã *ifO ’multiple µ ¥Ûs were nestedÊ 
C k0A()b Ba, B
 b7  ú ?   ò 
Q Àis semanticaôlly equivalent to:\n'
  ' û   with A() as a- 6 # B# b#  * ZSUITE` 
 ò"You can also write multi-item context managers in Êple lines ifQ @the < ûs are surrounded by parentheses. For exampleÀ 
Q (  á &, ! )t  L ?   0pChanged	ö	version 3.1: Support for"?`expres- *s.¨ 
 ] 0^ °using group	 T: toP `break ’`statem~Â’ 
1See.
g ð  **PEP 343** - The â€œ£Eâ€� | 6 !  + ðspecification, backÞ tnd, and$s[ Ì xPython B"l "`  |  æ Ð,
 'yield': '¥ " "¢ ? '* 	f  ½Q '   U “_stmt ::= @ -A • Ý is semanticaL" ab & 'o  ù lø ¢ ö ñ be used to omit6	\›hat wouldÁ àotherwise be rèr  ¬  ÷u ™ 
± 	©° ',• H 0 s�  �  <z > Ofrom# 2  ÕÕ 'to”  b ç\Ÿ (Ñ   )o 3     ¢ % 4 Yã � sG1™Bonlyñ when definOaM ò*generator* func¤ ˜ 
F !in	qbody of ¡% 'G ` T A.  UÙEin ap ž  { `ufficiÍ*toF[causeb t¹à B Åto create a – l pinsteadÅ ‹a normalQ ³  	 À 'For full dðetails of "yield" semantics, refer to the Y E '
  é'expressions\n ósection.\n'}
'''A multi-producer, õconsumer queue.'''

import threading âypes
from collb #s / Rdeque Theapq   apush, 
 "op$ Dtime# Ðmonotonic as  Q
try:é n _� . pSimpleQ° ‘
except I² RError7 $ ð = None

__all__ = ['Empty', 'Full O  	 …Priority ELifo X O']

¨ 
d ¢ aclass $ !(EÆ Bion)¾  á' ± raised by ˆ ö.get(block=0)/get_nowait().bpass

e  ä d ` 'pu` -pu` \ ] “ · ²'''Create aOñ object with a given maximum size.
å If   ‘ is <= 0,ò÷ ‘infinite.4 ª )`def __ „__(self,M '=0P  A.maxN =# K  F  F (% )œ   ð# mutex must be held whenevŸ#heï  is) õating.  All methodsg à# that acquire. W �release ib ²fore returnL € F pis sharaetween0 ²pe condiýSs, sol wing andC q    ]5 5 al6  es5  + eÞ "ex€ 5› & =/i.Lock(?ÀNotify not_ez=pan itemøTaddedíû7; a±  Þ 0ad ë¶ Po get9 n^ i< ;henž s ¢ C#1.Ã ± Ofull° �removed £ D´ ² a´ /pu´ v ³ ! ä¦tasks_done¹  ¡ `numberluL sh5 - µ Pdrops‡_zero;Â  jjoin()y@o reHH Œ Ï  U  > ¤ _Ñ B = 0” ó  ã Ãé€'''IndicˆmÁ formerly en¤ d >  Â  coL Tº Ul M Ø rÀs.  For each@() u0 pto fetcæ [ ,N `a subsðnt call to task_done() ñtells the queue that Ãprocessing
  !on õtask is complete.
" ±If a join()" õ!urrently blocking, it will resume when all itemsI £have been ˆ ²ed (meaning¤  a ˆ �_done() cC Åwas receivedJ ‘for everyb < 3had]  utª 1ntoÚ )Ð ñRaises a ValueError ifn Àed more timeAaqre werel Î �placed i# i.¡ 5''' àwith self.all_á sâ :"  ‹Âunfinished =.  5 I - 13 6if $ Z <= 0S  W $ #  ' r ('¨ § ‰²ed too many)')�  F å  Ê.notify_all(1 - À ä =Ó ƒ2def~ 1 )â @'''B�vs untilp“Qüu@gott˜&nd€¹The count oX 	‘s goes upÛ z1 an 1add ow&. V B GdownD @ con2�r thread…sP  to indicatÐ� ±trieved and`work o   ž Ò W  ð âdrops to zero,�A) unôsé)_whileâÝ N   ô7v.wait()`qsize(* 
RReturž€approxim= .  ã  ¥ÿ (not reliable!).½Zmutex¢ rb  { "._‡ ˜ _empty˜ @Truexˆ 1is 4 ý, False otherwise¢ ý  !°This methodíñlikely to be remoót some point.  Use ® U == 0daðdirect substitute, butP 0awa M eiœ  X€ach risk= EraceO �conditioòBre a&Ñ can grow befnh¬ 1sul{U() orI ­  9 xbe used¹Po creÛ0codqat need¿ - / Lïd_ b¬ ø d,Æ€ preferr×`echniq¬4  usc e{< {@Ofull?Àe is full, Fóalse otherwise (not reliable!).

  ó6This method is likely to be removed at some point.  Use qsize() >= n
L ð as a direct substitute, butP Ðaware that eiœ à approach risk= Eraceœ ñcondition where a queue can shrink befoT  ® õsult of full() orJ ®  : …be used. 5''' õwith self.mutex:  ã £return 0 <#  ax2 <= _g ^€def put(N ö, item, block=True, timeout=None)i ‘'''Put an3 ’ into theû ¹PIf op‘al args '] 'Æ£true and 'e   i   (L •default),ß < ð if necessary until a free slotZ PavailEI. If_ K ða non-negative numberþ sOGmost>  seës³ eraisesN  ¯ ‘Full exceð ¦ o— ww˜  Â"inf þ èOs,f+ ),«uo@ s o ™ °is immediat20, e|Ç ¹¾ (”	K tgnored º Vcase)» £@not_ì= ¦"ifŽmž:> 0! %  ÷ "  º.Õ ê X 6  : û  ÷ â     Delifù O “I RwhileÉ ‚ ¨ .wait()Œ <% ² Í ÅValueError("ÀB musØò"r /seî 0end¬! =A() +	 =out·  • *Äremaining = x -o %  n    if8 _<= 0.U  )  8# ¦ œ 
=* _M G  Ðunfinished_taJI+= 1;C  æempty.notify()«$ge«¥R³³Afromú®³WÀy until an iótem is available. If 'timeout' is
  ÷a non-negative number, it blocks at most> öseconds and raiseN ðthe Empty exception if no i“ 'wa” Ð within that › .• ÁOtherwise ('‡  ³ ò false), return anU `if oneï µimmediatelyK b, else±  ¨ ( … ignoredH © Vcase)ª 5'''#  Ð ° self.not_e:  o
Y
  A Ž_qsize()&  * uh	` AelifJ0outNNoneB ’while not¬ k Ž Ï .wait()u >< 0q ¯ ÆValueError("j�must be ‡"j sÏ  0end=! =ú A() +	 9out§  8ú Äremaining = d -[  Z   6if 4 _<= 0.  )   +§    x^ 
Z=Í,ge J @fullš;ifyÂ Q I 
Ž ¡def put_noñ C  'em‘f'''Put†1ntoWQqueueÜ †¾Bing.Y  Û rOnly en(  ‰ x  &¡a free slo¾ÎÉ  G $L J FFullz¦í  Ô P.put(~ ,í!=Fb«  )ge
þ bRemove
’Ofrom'geGÍÿ  	ÿ O  .¢	ú  # OverrideÅ ð
se methods to implement o€ Æ€organizaðò
# (e.g. stack or priority2 B`# Thes.@ll o‘be calledB€ approprÔ �Bheld¡±# Initializ© Z ¡ representŽ & Ë`_init(öP, max_Ï  .Ì ’= deque()f < Ž % 4 I1lenW ? 6 !# C new¥ èe£ ”  € V ]  Q q.append§] G2mÀqueue
    deó f _get(self):
  preturn  ñ.queue.popleft()
% p__class< ‘item__ =  ñmethod(types.GenericAlias)


"   PriorityQY ( { á'''Variant of  ð that retrieves open en cs in pM ò order (lowest first).­ E/ ðare typically tuplQ åf the form:  (P ánumber, data).õ 2'''Q ‚def _ini8“, maxsizeÆ  D:W = []7 q* p1len tkm $pul  oi ‡heappush8 !, $ t â? 'op> ¨ALifo„¤0mos³Åcently added³™.J�³�.append(G< 0pop%ì‘_PySimpleIa2''' €, unboun RFIFO k¹ñThis pure Python G pmentati @s nog 6ant£ €ü # Note: while tL @versE ñprovides fairnessèð# (by using a threading.SemaphoreW €ch is itû ? @, be2 SbasedH 7 on@ PCondi½ !),2  q  E  È 1parõ Œ³API contrac× !# aallows°$C Ä ûto use a different+H¶!__ðF Å !._¡ = deque()Ä  M wcount =Ð '(0¬
«ø
, block=True, timeout=Non.a'''PutØ  t6e ˆ `The opAAal 'X s' and 'X `' argu$ s í ignored, a52is žÙ Rnever¡ �s.  They8 dñ compatibility with© Ñô{ ¢  Ø    6T
Q    ! Wp.releasu�  ¬µBaRemove¿!an
Q from´ � ` ‚ &IfPEargsUbis truM ]0is ¹  (¥‘default),±  N ‘ô if necessary until ˆ ÷is available. If¸iz G ô a non-negative ˆ#it©A at b™ rsecondsü FaiseN  « ¡Empty exce=Ð if no item wóas available within that time.
  ð$Otherwise ('block' is false), return an item if one! µimmediatelyK o �, else raW ðthe Empty exception ('… 1outm uignoredH © Vcase)ª 6'''# fÇ 0out� Pnot N™ 5and E< 0:0  í � ÆValueError("† õmust be a non-negative number")H 0if m ñself._count.acquire(=, )| L \L ñqueue.popleft()
& ð def put_nowait(* ,‰^ f'''Put¢@nto sQ ø %� Bing.Y  @This=ðexactly equivalent to `put(ô0)` Vçis only provid­ñfor compatibilityt ƒ QÔ o classÆp !, ¬ !=F‚¯  )ge
aRemove© T ²Afrom� Oß 'geKíT%. ;­ Tc ëò 2getCú e=ýõ œ@True™ v å 1is 4 !, E& oã ½@reli8!).S91lenl !._M f) == 0‡Qqsize! �  … Àapproximate . 7 of‚(ƒ ~ !__J@_get˜B__ =\òmethod(types.GenericAlias)


if Simple�!is)� W= _Py ñ
#! /usr/bin/env python3

"""Conversions to/dÀquoted-print^ó& transport encoding as per RFC 1521."""

# (Dec 1991 V ‘).

__allå !["A ¡e", "decod
  fstring  ð]

ESCAPE = b'='
MAXLINESIZ a76
HEX ñ0123456789ABCDEF'
EMPTYSTRING" b'

try2ê ±binascii imß ò a2b_qp, b2a_qp
æ! I i< ' ! =�21   

çPneedsLping(c,  Óetabs, headerwÐ"""Decide wheàñ a particular byte ordinal T 0 toáP dQThe '  b õ' flag indicatesZ �embedded & eñspaces should beÏ I ‚d.  Notekqline-ený= ¢are always!3ed,!N %  * aPasserô€instance$ í s¤À if c in b' c\t':
  ñreturn quotetabs ð# if header, we have to escape _ becaus
 wis used QspaceG ¾if c == b'_r _ ( „ , ð	ESCAPE or not (b' ' <= c ¢b'~')

def° 2(c)É @"""QÁ ñ a single character."""e ñassert isinstance(c, bytes) and len(c)==1. ¡c = ord(c) ¢ � +8 á((HEX[c//16],  ‚%16]))

¥ ñencode(input, out k,cf=FalseË aRead '6 ‚', applyð Ád-printable \ Aing,½ Awrit¢'f 1'.
¸ F $  õ are binary file objects. The 'Ÿ a' flagG ð	indicates whether embeddø1abs_ ÷³s should be³ @. No› 1hatK Àline-ending p<  ™ balwaysß ñed, as per RFC 1521.E © A¦  ¢ !weé (   Gas _U O A1522( Áif b2a_qp is…BNoneh 4qdata = Ÿb.read(#  o @ ( , ë =[úÄ A $.Ï(N  „Ø % sY=ú , b“End=b'\n'V � #Eñ requires that the5  — inH Æ ‡�tab must!M ; @railËpº© + 3if "É[-1:] in b' … ' ¿ û ‚s[:-1] +=!(s: 1) +¨ 6End!el` f.fS }/(sE sâ; sy @prevh0 =   whM1*! *  .!if_  5  } QbreakT   0out# U = [] ð# Strip off any ‰& Pinduc˜š0new : s8 @ped ˜' !if\i´+\nO G " ='  Ÿ<  ¦ 	W &\nY ‘# Calculaôe un-length-limited2Y T Pfor c, v 
 œ¹V((c,) ‡  T@eedsî0ingä  Ûv 3    S ( ñ    ¨¢ “
‘  ) ¦€.append(ó
š ,eld7  o  ‘# First, è >© zJious.0if   ,¶À    write(pr“evline)
  ð# Now see if we need any soft , ÷ breaks because of RFC-imposedI ðlength limitations.  Then do the thisR B->prˆ u dance.E " ð = EMPTYSTRING.join(out= » ¤while len(7 õ) > MAXLINESIZE:X  í ð	# Don't forget to includ˜ eï À `=' sign in¼ J ë acalculì !" Uwrite— '[:• A-1],X¦End=b'=\n'Ó  ¨ Í % =1[@ %:]l 0# Wj @ out¦ r curren¸% mQ  = 2las: `, withT àa trailing new: 5if U ¶is not Nonep $ ð ðstripped)

def encode òng(s, quotetabs=False, header )_ ¯if b2a_qp z creturn# 
T ^ X _ €from io Ø¢rt BytesIOï Tnfp = "(s1 9out  Ó `(infp,—  y + « H Ò.getvalue()

 dea(inputK  ³ 	‘"""Read '+ ‚', applyMÁd-printable Q ‘ing, and £ ‚'output'†E #  Ð are binary ftrobjects2 BIf '– '“Rtrue,l ðe underscore as space (perB² 1522)."""
f_f a2bÙqdata = ä b.read(F 3o @ ( ä, î .ÿ (9 H ’� ‘new = b''� l1ƒ G  	�   “ !if  :BH  ; ‘i, n = 0,¼ " ‚  7 A > 0€  �[n-1:n] =Œ 6\n'‚  K ppartialN ;U 5n-1h  ! 0# SsÇQwhite‰	( à n{ ºin b" \t\r"~  a  Ê u 7els " ¤ › o Zi < nS 1c =f[i:i+1é I Bif c!_' v
A  ) »  �+ b' '; i«+€  & !elQ ‹!= ESCAP. "  B =ùO + cE 0i+1˜ n•  ó š  [ = 1; q “  N "< M qi+1:i+2« $ ° ð 2
            eþlif i+2 < n and ishex(line[i+1:i+2]) «2:i+3]):
  `new =  »+ bytes((unR ù 3]),)); i = i+3D ùelse: # Bad escape sequence -- leave it in7  †  u { c^ 1' êif not partialº Ðoutput.write(H …+ b'\n')> a 1b''  P &ewH D ó)

def decodestring(s, header=False@Áif a2b_qp is¤ FNoneY creturn# C J £ ðfrom io import Bz"IO¨ Tnfp = "(s1 9out  ­ q(infp, # ± n ’ ! ñ.getvalue()



# Other helper functions\c÷ B"""RÛ ±true if the5À ordinal 'c'ña hexadecimal dig¡ ASCII."""è ñassert isinstance(c,N ò µ �b'0' <= c ¸b'9' or b'a f A "F'ÑÏsÅ 1Getº �integer J of · enumber¯ �bits = 0¼ ¦for c in s÷2c =¿ R((c,)  †=if Ä 6 "   =B7('0Áeéè 9 Ra')-1›  Q < < <b'A= sÍ O ª£, "non-hexØ†"+repr(cñ *  ò*16 + (ord(c) - i& Û0its„ wSmain(¤1sysm agetopt 6tryÍ �opts, argŸ%  äóopt(sys.argv[1:], 'td`sexcept - Æerror as msgW  < “stdout =  1err€  ’print(msgÓ  ý"usage: quopri [-t | -d] [file] ..."4 !-t1 te tabs   #d:šÀ; default enª,  ¦ bexit(2`  1 = ¸¸  \ 	  È@o, aË Hÿ Ñif o == '-t':• q = TrueI  î " "d'� "  1absŠ ˆ Z  ¦ Y1"-t< ÿ
-d are mutually exclusiveø  ê!ot: � = ['-']¼ sÈ –   B¦ 1if  '  ú ‰Ç †in.buffej  ,   	¯    E Popen(h W, "rbÓ  " ¦ð OSError as msg:+
  þ(sys.stderr.write("%s: can't open (%s)\n" % (file, msg))H mts = 1 …continue Etry:  � zif deco     sde(fp, ¦ ªout.buffer� Nelse@ Oenco@ f, tabsF nfinallš  ó ~ != '-'a ’fp.close(H fif sts'  µ óexit(sts)



if __name__ == '__main__[   ñ()
"""Random variable generators.
<Qbytes
 - 
  3±   uniform # ò (values between 0 and 255)I wintegerL ?---O Âwithin range; xsequencˆ Œ @pick3  Í xelement\  Vsampl&1    „weightedF ' e" ²permutation¨ €distribu ós on the real lin7 ¹  ´ _ ¨triangular ònormal (Gaussian$¥2log  	2 øegative exponential  Xgamma 9bet hpareto" Weibull	òcircle (angles 0 to 2pi®   x  V  Ž Ávon Mises

GØel note›÷underlying Mersenne Twister corð:

* The period is 2**19937-1.
* It aone of÷ðmost extensively tes^E�ors in exn 0nceD  ` r�r() methi i¯ Ñ ed3 €C, execuÈ pin a siQñ  Python step,
 }0is,Œ `refore  readsafe.
ü°

# Translaš ð#by Guido van Rossum from C source provided by
# AdŽó Baddeley.  AdapJ ðRaymond Hettinger for use ß 
#˜ u¶ Eos.u
‡ •“ ðwarnings import  P as _	 
# Dmath 1log 0log>p qexp, pi Qpi, e
 qe, ceil  	 M Asqrt  	 a, acos  	 $,  @cos,› >sinH 0tau ÀTWOPI, floor _
 ’, isfinit–  F oø )8  # q_collecŠD_abc
"Se¼ cSet, SX?  @ "op8 Qindex( 
 % …itertool� Àaccumulate aòs _accumulate, repeat as _ ô
from bisect import  %  
 !os: $os ñD_random

try:
    # hashlib is pretty heavy to load, try lean internal module firstF • t_sha512–   –  ‘
except I¶ TError„ €fallbacku €officialH ¶lementationh ± H  ] é  Ñ

__all__ = [7 !"R÷ "", jSystem ´betavariate' [choic s Kexpo0 LgammD Egaus4 0get€8bit 'stt {lognormZ   +al \paret„ ` 5ytea   4int·   (om Erangå Vsampl 4eed+ 9set© Vshuff+ ¤triangular1 eunifork ‹vonmisesÅ gweibulÛ ð-]

NV_MAGICCONST = 4 * _exp(-0.5) / _sqrt(2.0)
LOG4 = _log(4 *SG= T1.0 +  °5)
BPF = 53ü  À# Number of ™ò in a float
RECIP_2 ò2 ** -BPF
_ONE = 1


class I(\. )Û#""|" ng ò generator base B äused by bound ^0uncù1s.
·U%  to instantª 0ces¿ y  CEget i Ás that don'tI ashare Î[ CÈ ñ can also be sub¢ àed if you wantc ð use a differentÎ !ic_ y  ” ðyour own devising:a‘ ñcase, override the followingI ¢methods:  ¶€(), seed g�  Dand Ÿ1().<  Op;Vally,H7 a ƒ2() b 2 so# g !()E  
c¡ ð arbitrarily large“ $ge›2"""¤¢VERSION = a$# Û± /ª 1 ó
def __init__(self, x=None@ £á"""Initialize ˆ #ce¾ $ ð P argu4± x controls5@ing,$3for±.L0 D Æ    Œ " x Ó€_next = « Ê R  : 1, aÆ ¿, version=2Ñ iV’ Ka´ à ÀThe only supôeó�ed types Ð Š ,£,¾ì¶ Ptr, b , ,  Warray`  > f or noB Î s� 1curæ@time' ¥ @n opÍ±m \� specific(àdomness sourceIƒavailablÂÀ     If *a* óis an int, all bits are used.

  òFor version 2 (the default)9 0of  	@ € if *a* d U str,O  bytes, or 
 ˆarray.  e õ1 (provided for reproducing randomM õsequences from olde­ Ñs of Python),¢ ‘algorithmW ustr andL  � ðs generates a narrowerv  geO Wseeds6""")%if(@== 1] ð isinstance(a, (
ø Es)):z  iða = a.decode('latin-1')H
D § ‰) else aC ðx = ord(a[0]) << 7> a+ 0+  Wû c in map(ord, a�  ”  Q @((10 û3 * x) ^ c) & 0xF 	_ ¹x ^= len(a)  å  -2– rx == -1œ xD*elF2F,MEQ+if}?strä   “ Aa.enx® @int.[_wû(a + _sha512(a).digest(), 'big')È ;not„ Â(type(None),zafloat,#Ì sÓ °_warn('SeedÐbased on hash ùis deprecated\n'| Ñƒ  'sinceA 3.9` wi �e removedRa sub_/t J ¿. The only s �upported ? i : 	,^ — 1and(ô&.'Xà   D×ionWarning, 2œ€super().Ž ¢ñself.gauss_next =  ÔÐdef getstate() K�"""ReturLaernal ( À; can be pasªDto sC €) later.A ´   rE  ^ ¤.VERSION, ­ } 1), " © ¢ _  "  U<ate© Pstore|ª >bbject ‡ egó )ª û" =é 5[0]k
¿3å8 û (Ñ X U  	ä 6intD ºBƒ 7E# Inã2TÂ p was sa; 	 1ignEùts, which causesÐ ò#   inconsistencies between 32/64-bit systemsel iH ¢really uns{ !32=  in‚ ð
so we convert negative in—ts from
  õ#   version 2 to positive longs for  )3.; Itry:  W ñinternalstate = tuple(x % (2 ** 32)T Yx in - )L þexcept ValueError as ep “raise Typ&  á ) eK ±super().set– (w ;elsa ] „ !("A U with�%s passed>"z  	 v"Random‹ G) ofJ ?" %A (¬ñ, self.VERSION))

8 O## - #? ò Methods below this point do not neî ù
be overridden or extendedN ñwhen subclassing °the purposeu ÿa different core generator.á ÿ pickle support "ò Issue 17489: Since __reduce__ was definâ ²fix #759889Ris noß "òer called; we leave it here becaus aN"en sv r r P àrewritten back!ð2001 and why risk breakE’something•sdef __gã0__( Q):  #o h  ‘breturnD4 "()"J -J !, úQ  n Ö, O r`— ‰ !__"c__, ()á� 5 â;ó !odí ñevenly distributed/ Agers™ Tinit_�ö__(cls, /, **kwargs)så"""Control howÒ$es§#e Ó a n .j  rõ The algorithm a> P can %°depends on J  ()þ1/orü  H 0get ðbits() implementatÁ�available‹ it< µ determinesD pwhether¨ ~ e¾ -ö arbitrarily larg\branges › 6"""ð  8cÃ¶cls.__mro__K / Qif '_Ì  f', |.__dict+  / õ# just inherit itÏ     	  c 1d ¬ “ : =  _ø d# &itR    ƒ  / /om~ 2?out� ÈÐrandbelow_witó
h_getrandbits(self, n):
   "Return a % Ðom int in the ²ge [0,n).  ) ås 0 if n==0."
G   Fot nY  ` r\ 0' Œ 0 = Ž . ' ð k = n.bit_length()  # don't use (n-1) here beca ¥n can be 1F Gr = ^ !(kF Õ0 <= r < 2**k, ­while r >=Ä F 5 ß rPdef _Eßbelow_withoutø, maxsize=1<<BPF�"‘)‰  zòThe implementation does noB , but onlyñEdom.á '""ã Û $om· *    =Ù 
ó_warn("Underlyingi Æ() generatorŸ ¥supply \n"^  Ò   €"enough Ìò to choose from a populì ÿrange this large.N €To remov* îBlimi1y, add aC¹) method.")� 
r_floor(f() * n( #J== 0; $ reeIE % nj œ D = ( -À 4) /P 'Bint(* * )G  | L  ¨  B ª % =¹3 ¿ ú  t ‘, =# 
/ O## - $— @ ! M«!s � poßuðe custom distribu'sC rbased oûð
s defined above.  They do\	= ádirectly touchRu… Por anc )ly= caccesspn 1thrý š‹ #: ! 9(),> ßg(), orw?().ic bytesêsŒª ó E1 ]2""Gá3e n« ^ .[ Ó  D²(n * 8).to_a Ïn, 'little')Ã uintegerÅ Æ 
Ä 3Ä ðstart, stop=None zep=_ONE¬C�=2tem�O I [E ]~ õ   T¡Qfixes€problem ;. Ëâ) which includ* ì A 1endÓ;³APyth«Àis is usuallóy not what you want.

  6""" õ## This code is a bit messy to make it fast for theH õ)# common case while still doing adequate error checking.A Etry:  � ñistart = _index( )# Àexcept TypeES = <int: ] #f ` 1!= Z 
@  $ ð_warn('randrange() wÑ Vraisey 0 in
• future',¢  D  öDeprecationWarning, 2Ï ) ] BValu× ñ("non-integer arg 1|– "F · 7 `umentsÇ: Ã have been dŸ Oed 'Â  ò'since Python 3.10 and be removedÏa subsequentK version*&pif stop�JNone´¢# We don't_(ñ"step != 1" becausÄ0has(  û 	î b# type@ !edä �converted=4an Œ6yet¾ ¿� e�  rJ_ONE¡  % à¶a('Miss! ² Ö ã 1arg´'Þi¹?> 0_  Àeturn self._êbbelow(ì
J Š jaempty ì< @  H()")&„¡ – suppliedÌ(opË&op� Ê; É8  Ooâ – Ì ¶ÿ ‰ »?theÆR © a  Ð  ¶  ppÅ®pwidth =�@op - 5art‡=e=e=; =8  i= '=”/ep=Àarn('non-intý'eger arguments to randrange() have been deprecated '
  ÿ''since Python 3.10 and will be removed in a subsequentK Ÿversion',h  D‡ åionWarning, 2)) Å# Fast path. åif istep == 1:  Ä Êif width > 0   `return= Àart + self._ abelow(; } 3 ðaise ValueError("emptyU`ge for
 _R(%d,  Ð)" % (istart,s 2op,œ 5))
´ ±# Non-unit Ò ¹Ÿ suppliedö  Û Bn = ¼   +j ¢ep - 1) // n %el;< E  +E *se[r$BzeroÑ ""^|if n <=ˆ M qO Ü"*än~1def»@int(v, a, b)Ú B"""R0 !aom int] in9 @ge [2 ö], including both end points½6"""õ«  v .\ � M B+1)
( O## -   i¿ce methods ' C  â cchoiceá :seqà €Choose aÐ pdom ele6Â from a non-}v .È    !# ¬qs Index0 if¢ A is 9 zó !q[÷ u@len(š &)]· dshuffl¸ #x,¡ Z=NoneÃ S* p list x�aplace,®v  6 .]  ¸ …Optional&^  ¶ Ea 0-„@func+  H  áaÒ  an3Pfloatw °[0.0, 1.0); itO °the defaultéee, theC ƒstandard€ %omd usÿ.  { i½ –sZ ¸ ã  VÓ, =C  (  ži¾  re¥2ed(Œ01, —7x))n 1   •# pick an0ðin x[:i+1] with which{@exchzY x[i]z  I 1j =û ª 0(i p%  : �, x[j] =   M ,el�À_warn('The *	Ðom* parameter– ^ s/\n9`).! 6‘floor = _	 0À        for ûi in reversed(range(1, len(x))):
  ð# pick an elementA ðx[:i+1] with which to exchQ ] x[i]I �j = floorv ýdom() * (i + 1)).  C �, x[j] =   1i]
) ÷def sample(self, population, k, *, counts=NoneÕ ô"""Chooses k unique randomÞ ‡s from aS ò sequence or set.…  (ûReturns a new list containingS 8theU QwhileÎ  I @leav3  % ˆoriginal. "un[àd.  The result2 u %isJ €in selecó! order so that all sub-slices will also be validL dst  is@ ðows raffle winners (´ * )€be parti� %edL `into gmü prize and second placQ "ub§ )o@Membs 0of u ö� need notË qhashabl¯äA.  I3 Ž ; ± s repeats,\ Ñn each occurrü  w possib¸k in8 —´ RV &ed0can§ àspecified one ŸA tim¶ W â  opF%al¸ × añ ameter.  For ex:š U•õ(['red', 'blue']Æ[4, 2], k=5)9  is equivalì/toT [ 
 i q 
b ATo c…# a/t�ñ of integers, us¢€ge() fordÅ@argu�« Æ a’ally fastppi•efficientJ  Z . RHlarg²	³ 2(10 W), 60M6"""Z0# S¦ c  á0outs û º   e8€ls track% çeither potenti#âPpool)™a…¸or previous,  ins	ÂR# Whe» nu^ Öps is sm9€comparedã&thº#§;Â 
H w0, rcEring‚`# onlyŸ n "se± an„@asio%reR ù? !a ±/r Ç ™  &_wmethod ;#50feræ  siñ „aÁtakes less sD1tha6‚ ´ òit doesn't sufferßfõ  TÆ s)#Ù¾ 0cal0o _5pbelow()�@kept0por nearñ
‘ðtheoretical minimum.  This iós important because running time
  õ# is dominated by _randbelow() and@ èit extracts thC ðleast entropy from! € underlyt  T ÷om number generators.
Š ñMemory requirements are kept toT ÷smaller of a k-lengthD ³set or an n Y listh QThereZ °other sampl¦ �algorithmá ”at do not‘ f ±auxiliary m´ P, but  0y w\ QrejecP|ˆthey mad6àtoo many callsá {P, mak•  them slowe× d†  ×" µto eat moreŠ th‡ecessary!ifÙ õisinstance(population, _Sequence):n  /?if 2 t-  1 „_warn('S` a ¤`deprect9\n'f  9  ñ'since Python 3.9�ñ
will be removed in a subsµ Ït version.',W D{ `ionWarM, 2)- x = tupl%
/ Jelse+ Á õraise TypeError("PdP mustÅ  l�.  For di_ or%0s, ¸¶sorted(d)."w wn = len¸ `if cou>!isè;Non  Ccum_$ =!p(_accum"e( )R  Ï !ifq : o) != nø CValuù D'Theûoœ 2doež Pmatch= s'| †total = } Z.pop(% Õ7 O, in�Ÿ"'C4›‹integers‹ 1if W _ <= 0ý ¼ ø ` �greater ¥Kzeroi Pselec‘‘s = self.¨�e(range(… j), k=k¢bisect = _
 	Ù†return [j[& ([p, s)] f„ ]ˆ ]K  Ï#› º$ �0)k +€'"(de larg¨  Ö ÏwegativePresulñ [èU] * k… Àsetsize = 21Å  !#  BO lf minus qn emptyN Šif k > 5÷d ò+= 4 ** _ceil(_log(k * 3, 4))  # tablec  ^0bigz s_ n)Q 
f ;# AÔ ºÀ -À a k-length gset.
  ù# Invariant:  non-selected at pool[0 : n-i]8   ù = list(population)$ ùfor i in range(k):  † 0j = Êdbelow(n - iD  % ²result[i] =’ jŒ  $  � %[j" J Ú - 1]  # moveÜ õitem into vacancyš Jelse¨ j= set(   P_add ! =E.addS    
h  D pwhile jRw 
ª  %   VJ ?  ¶ .(j  
rÞ[xrreturn ) 
ë ödef choices(self, ú, weights=None, *, cum_ 7k=1#B"""Re ‘a k sizedo7 ofY � elements{ ñ sen with replac .�  �If the re­$ve“ 0 or� Ã  ar4Át specified,æ  I  F CPions * Bmade| ÷equal probability‚ 5"""E brandom4"f.  n\/en[ if¯ <@ is T

%ifÞ    Æ ‘floor = _	 {     €n += 0.0 ð# convert to float Ñpa small#‘ed improvuM rÊ[[v (ø �() * n)]V 3€_repeat(Û J, k)ò:tryð  ¥ Q > š`_accumÚ#e(l)îþexcept TypeErrorW õif not isinstancJ ,A± „  ]raise4k =— 2 ˆ (!  [ Àf'The numberoð must be a keyword argu}: {k=}'N a) from: *el7 ÷  €
© @'Can* (dy bothæ @ and­ ‚i\'„wif len(¼o) != nt BValu¦(ÜQ does®Qmatchîrv ptotal =› Hc[-1] +ñð%2if > <¨ j o�«÷greater than zeroŸ s¡_isfinite(r kˆ	l Àe finite')
   ¢bisect = _
 
 Å  hi = n - 1 òreturn [population[5 õ(cum_weights, random() * total, 0, hi)]I d ñfor i in _repeat(None, k)]

- O## -  ð real-valued distribu� /s 0 L ñ	def uniform(self, a, b):i  ’ c"Get a¿ p number� 0the Age [2 2 or
 ñ] depending on rou %."S 2 a + (b - a } .%œ £triangularŸ alow=0.<@gh=1
 Pmode=%· 5""T; 	.]  Ü ©Continuous"   b´ õed by given lower and upper limits,Ò   0havó a3  •  �· in-between| ð	http://en.wikipedia.org/ /» _Éº &""OJu = > Ü   6tryÉ  ±c = 0.5 if   0is 8q else ( -í ¢) / (high  é ú	except ZeroDivisionErrorg á5low9 Šif u > c)  » u1.0 - u* ¨  c 0low5Pgh = Ÿ ,­ " w  Z   ¿ ò  * _sqrt(u * c)G úÓnormalvariateašmu, sigmaNN+ 	(Î`mu is Qmean,+E  Ñstandard devi&> Îñ# Uses KindermanK öMonahan method. Reference:) Žh# A.J.9 ñ, J.F., "Computer generˆ 0 ofÉ5domI!# pbles usÖ Ú /  . 0Ë çes", ACM TransD ÷Math Software, 3, (1977), pp257-260û
ËM «while True@31 =½ %().  BRu2 = CZ   ð
z = NV_MAGICCONST * (u1 -  ÿ)u2P z1 ¹z * z / 4.0 ÷if zz <= -_log(u2; �   Ubreak6 «Pmu + V ,˜_gauss�G# ?ian’9†  This iÆ sl¿`ly fas7Athanç
:`) funclÒðNot thread-safe withouMalock ag calls6 
aWhen xË—y are two�Äfrom [0, 1),Ç%lyf#0ed,¸ n 
 À#    cos(2*pó	i*x)*sqrt(-2*log(1-y))
  # sin(2*p+ 5 ÷)are two *independent* variables with normal distributionC ø(mu = 0, sigma = 1). øLambert Meertens´ ð(corrected version; bugk òcovered by Mike Miller, fix GLM)
h ñ
Multithreading note: Whenà  ûs call this funcÊ ð%simultaneously, it is possible that they will receiv e‡ ðsame return value.  The windowP rvery sm‰ @ough" oC Qavoid¥ €, you haf ðo use a lock around D  Ò gs.  (IC ñdidn't want to slowQ € down inÇ À serial casef us8aF k Where.jârandom = self. 4 z ¥gauss_next 0  f = Non;@if z  :5  Örx2pi = k –() * TWOPï  $ “g2rad = _"a.0 * _'E.0 -= 2 7  ° P_cos(d  Z H 	~ · _g
1 2 ú‚mu + z *§pdef logM`0te(\ C, mu<)ø P"""LoÆz.N  ¾ !If 1tak†€ naturalf “arithm of÷»U†'ll get ï ˜ åþðmean mu and standard devia?â ñbmu can´2any,=  ð must be greaterVgn zeroÙ <"""RA_exp0.© C=¤ gDexpo! dZlambd`€ExponentÛˆ 6  •’1.0 divid{€the desi  æ.  It should bÔ1nonÚ 0  (`parameõ w* �Aed "j `a", budazð a reserved wordÀ±Python.)  Rl A nsê¶ge from 0 tXPposit°Áinfinity if w  á  ª> @nega1 ‡ 9 Ito 0> + ;Ã#h b: rate  '/;^ A# ('�  a'‘ "a ã 
û ä ýA# we%1-pinstead÷ ¡to preclud%p Ù il ) ak Ü0logD ¼1 Û-V \R()) /Ü ¡ ˆŠvonmisesŒ ³Zkappa�ÐCircular dataàtribution.

    ñ4mu is the mean angle, expressed in radians between 0 and 2*pi, and
H „   kappaN ô(concentration parameter, which must be greater than or
L öequal to zero.  If_ 	 ñ , this distribun ureducesM òto a uniform randomé 1 ov| e @ge 0r  Ù %.
= 5""" @# Ba0upo+ñ algorithm publish10: F ‡r, N.I.,> ÷#"Statistical Analysis of Circular Data", Cambridge= ÀUniversity P�g, 1993ª €# ThanksÅ ñMagnus Kessler for a correc# toô^ €implemen¡  on” gstep 4` :r= self. B i¡…<= 1e-6:  Óàreturn TWOPI *nVdom()f’s = 0.5 /ç= ÷
r = s + _sqrt(1.0 + s * s< ªwhile Trueu Fu1 =k  ‡  ÷z = _cos(_pi * u1N  $ õ d = z / (r + z)Ž   /u2V €if u2 < ¦ ¡- d * d or != ¼ ê- d) * _exp(d)®  \ Vbreak1q =M &/ af = (q—  ¡  l X+ q *§ /u3£  Ÿ 03 >g
z PthetaW  mujaRf)) %°þ ;elsb: =- _: ;  0 à ðdef gammavariate(U€, alpha,ka @"""G, 	ç`.  NotÇI A funÝ!b  QPCondiñAs on+ ŠRs arep  Ôb	 "B ÀThe probabil{	ir F is:3  y  ax ** (Ö @ - 1þPmath.B-x /ê (ß  pdf(x) =  - ; t   e `}  y Þ "**ô ¯ 
á« 2> 0… ,"is: *H !, ¸0nceñ5  6**2Z ñ# Warning: a few older sources define–ª 	Þ yFtermÆ#•j u > -1.0û "ifš   <E0u ¤  
íñraise ValueError('| Î 3te:I  áC ¨ '0''ÿ ž© ;1.0ð# Uses R.C.H. Cheng, "hCgene11of òä  Õ#uöbles with non-integral shapej&s"z= ð Applied Statist÷ics, (1977), 26, No. 1, p71-74

  ùainv = _sqrt(2.0 * alpha - 1.0), Ubbb = ILOG4 5ccc  + Y 
k ¹while True:8  Ž Êu1 = random(u   òif not 1e-7 < u1 < 0.9 L  2 Žcontinuei 02 =Ú / -o òlog(u1 / (1.0 - u1)) /×  b  xø Ž* _exp(vÄ 0z =º * 2š @r = b + I}* v - x& ðif r + SG_MAGICCONST - 4.5 * z >= 0.0 or r _Æ /z)$ö return x * beta­Celifç=-
@ ð# expovariate(1/= 
ð Z - ?Ü)n  s#}  is™ úween 0 and 1 (exclusiver ù0# Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentleg¨
§	 R(_e +À  /_‚pèI * uu  Ooif p <r      hBp **”/g H ,elR =    A –`(b - p£ ï
N + ’0p >I
 :    ifè <=^1* (d S1  5 _breakÎ  M \/-xÐ? ˆ
â0defWaÁRself,K, _ ö"""Beta distribution.)PCondi òs on the parameters areV # >¿ )  .ä Rƒ�ed values“ ge… õq 5"""< V## Se_ð## http://mail.python.org/piper / ø-bugs-list/2001-January/003752.htmle ðfor Ivan Frohne's insightful analysism1whyðoriginal implemen…&onø(##` ?   “ ##+  ð# Discrete Event Simula�ö  in C, pp 87-88q{  I @y = .Ø³w  É. ;1.01 †hz/(y+zR ñ was dead wrong,ï÷how it probably got that wayð# This version duó e to Janne Sinkkonen, and matches all the std
  ð# texts (e.g., Knuth Vol 2 Ed 3 pg 134 "8 õbeta distribution").I õy = self.gammavariate(alpha, 1.0)* Uif y:  ˆ ÿ return y / (y +H   { G H 6 A0.0
N ¤def pareto~  � !, „ )r A"""P' 	Ì ". ) 2 is%@hapeP ¡ameter."""f  ° ò # Jain, pg. 495   0u =ì " -Ã }random(³ Âu ** (-1.0 /v )D  Ã weibullÄ   , 
Ê W. 
Ë M  ‘ ü Ó 7calÓ  R   ó G ý ö9; bug fix courtesy Bill ArmsA ¯  �_log(u))*) « �)


## - .F  ñ Operating System RÀ� Source v  ƒ


class1 0 ( ¨Ò"""Alternate ° number genq Por usv sh ’s provide¥!by�oœ sœ ó (such as /dev/uZ ¡on Unix or­‚CryptGen’ Ó on Windows).œÐNot available!  %c £s (see os.^ Õ() for detailC  m  ½‡ (y  †a"""GetÈ Knext!in ¢range [0.0é	rìô(int.from_bytes(_š ò7), 'big') >> 3) * RECIP_BPFê  ž 0get¡ Abits£ :, k¦ ! ²k) -> x.  G¨ BÄn int with kÇ  O 	­ †if k < 0s óraise ValueError('0of C ö must be non-negative'< .  õ ð  = (k + 7) // 8[   #T  !  ¡rounded up« 1 0x =Í Ol V6 ‰xg(' � * 8 - k)X  Ñ# trim excess’ �Š Ñ ‹n‹u% nh - 	i#�@n) f˜žh´n�Å #ûË ±s an empty T ß#ng6 F== 0ä2  vn·CseedÊ Ø*args, **kwdsÖ àStub method.  {Ausedk "a uí  [#.~† ðNone

    def _nóotimplemented(self, *args, **kwds):
  õ4"Method should not be called for a system random number generator."L ¦raise NotI ‚Error('SD ñentropy source doess Ñhave state.')P 1get F = s )_nÜ o


# - 2ð
# Create one instance, seed
ñrom current time, and export its mHös
# as module-level functions.  The S sharø ð  across all useH À(both in the �r's codez  ñPython libraries), but that's fine
#ÇÒmost programsB �s easier   d Qcasua rB €n making€ 3m
# ti%±their own R#() `ce.

_@% = 
F1 =  . 
N  …
uniform+  µ
triangular  L 5int  M ¥int
choice  . Frang  0  0
saº2  v
shuffl0  ` s/ a ±s
normalvar+ã 	 @
log % 
 
`#  œ
vonmises$  l
gamma%  V
gausÊ  M
bet5  |
paretoW 	 }
weibul
 
î$ 
ý V.  4  ¹b}d4get èFbyteÖ    O


#9%: 6 te_’p

def _+ _?1(n, , ¡™fn ÿ‘istics imgÁstdev, fmeanf1ean-0  –* Ñperf_counter
# Xt0 =  (h€data = [¥(%)iyò_repeat(None, n)]K 1K  !xb  Ÿ (X b @sigmc ¾   , *  ‘low = min  @high #ax ^ ñprint(f'{t1 - t0:.3f} sec, {n}•0s {È £.__name__}M; ñ 'avg %g, stddev 2min Àax %g\n' % (ž !, ¸ p, low, ’ 7))
Âs(N=2000±Õ#N,/B, ()Õ #   (¿, (0.0, 1.02 
3 À)
    _test_ù%generator(N, vonmisesvariate, (0.0, 1.0))
    _test_4 Ygamma1 12 1 !2” 5“ 91 1'21 Š/203 ?ussç7betæ3¿ 3ƒ	§triangular_ U2 / : o

## - ": ï fork support [ ð

if hasattr(_os, "6 2"):áð os.register_at_ 0(af ñin_child=_inst.seed)
O ó__name__ == '__main__'Q  2ñ()
#
# Secret Labs' Reñ Expression Engine+ ðre-compatible interfaceâ ö the sre matching e8 øCopyright (c) 1998-2001 by~ ¡ AB.  All , ±s reserved.} �This ver• !ofq ÷XSRE library can be redistributed under CNRI's
# Python 1.6 license.  For any other use, please contact #Ñ
# AB (info@pN ’ware.com)§ ‘Portions £ #isð have been developed in coopë jawith
#® ð.  Hewlett-Packard provided funda1forÊ  ˆ0grav r and
# Ê « ility work¢ c
r"""SŽ C róeó‘s (RE).

sdmodule  –#0 ôÌ ðs similar to
thos%!unó ”Perl.  ItÀs both 8-bitÂ � Unicode ÈAngs;  
bqpattern&   " 0 be‘processed¾Ðin null bytes7 ñ
characters outsideKôUS ASCII range.

è sW ´ pspecialY a ordinŠb o.
Most ò, like "A", "a", or "0", ar� Ÿsimplest
  ;² yc2ply~  Ðmselves.  You¬ Ï
concatenate… rso lastD  esF v  ' '$e è =2areM0"."†0  Mûf%y ) ñ except a newline.Ó+"^5 Ðthe start of ðthe string.
    "$"    Matches ! aend of , ñ  or just before ¡newline atI F !   A m *m 0Y mR ô(greedy) repetitions„ Âpreceding REI m G6 P mean» Àat it will mÐ ‰ as manyV ²as possibleN +"+— 1— $+"?I à %1 Ý UÑ Ò*?,+?,?? Non-[ vers@viouè òree special charactersÎ P{m,n}!Ò¹from m to n� B ??  �  “Dabov>"\\ö ïEither escapes    V•signals a  ssequencN  []» ±   Indicate+  ety ê * p  A "^"ì ½Vfirst' iI  complementN2set3""|Â ’ A|B, crex ‰n RE thaReæ AÍ B? P(...)� r ‡ ‚RE insid-£parenthese¦ /  ðThe contents can be retrievede É±ed later ina—  ?aiLmsux) M 0letA set+ ‘corresponBôflags defined belowF :Ç ‚0oup#„ ~�regular Ë ‘(?P<name>@  ƒ 2sub¡ † i yŒ Ògroup is acceƒ@ by > †  P= O	”EtextO pearlier<  lW  8 dL #’ ` A comõ”; ignoredm =! ¸cif ...f ðs next, but doesn't©2sumÓâ J !J 8 ÄP 0 <{ z , † "(mq@ fixÿeength)@ q @ Onot D @(id/5…)yes|no)p`yes paG2n icSwith 6 '*d,ÿÕ  š0(opËeal) noT o)qwise.

0Ësi!isö"`Wand aÕÔ a Rlist
Ç2  I¬ ‡ordinary0 0is  o> 5 ,‘ a
resul(RE= ` fsecondJ €z\number6ÆY3 Rsame 6 C A%C bonly a´Astarý ƒ ¯/\Z6 vÐ\b       Matcñhes the empty string, but only at ðstart or end of a word.
    \B    MatcO ?notN dN òany decimal digit; equivalent to  ±et [0-9] in• E ð  bytes patternsÃ ä  AwithE ¢ASCII flagÙ D #In
5 "ou8 °, it will mV Zwhole” PrangeGrUnicodeØ sv #\Dx O Anon-ý ¬ characterS[^\d]C sC  ¯whitespaceD ¿ \t\n\r\f\vK¤ç ZS  Z4 _ s_wH  Ïalphanumericaºa-zA-Z0-9_]/in«n
‘ ¥â Ps (le]cs plusË
K  ²underscore)¦E0  W�oLOCALEAsÜ"_]b šs definedn 4as ’ 1for„@curr.blocale #\W� h pcomplem, Sof \w+ \+ òa literal backslash.

This module export[ñfollowing functions:³ % \ „   a regular? tressionsê`beginnM ‡Í§ BfullS O 0all…aÝE `search” S
   MqpresencÁaŸ =  ub: ò   Substitute oc2ceso �¤ found in c E nF ²Same as sub“±also returnØ`numberV sp  ^C madæQsplitN S
 k 1 byB � ‹ @find&p  Find  1 È  =  &2  R² 0an   ator yieldÆa7q objecteBeachA†  • ile   Comp
 w’ into a PàF 7 @purg5 b  Clea	`Àr expressionð cache.
    escape
 óBBackslash all non-alphanumerics in a string.

Each function other than purge and [ pcan tak 0 op/ ðal 'flags' argument
consisting of one or more  the follow  pmodule 2 ðtants, joined by "|".
A, L, ƒ óU are mutually exclusivü €A  ASCIIþ c   Forà À patterns, mº ñ\w, \W, \b, \B, \d, \D@<  `match °  correspond´ h ÿcharacter categoriesF 6(raQ M ×whole Unicode=  , which ist K ‚default)î§   ò Wbytesñ Pthis žU ÿ  only availabled ‘behaviourtòneedn't be specified~ ñI  IGNORECASE  Perform case-insensitive Eg ¨ �L  LOCALE ?  M‘Àdependent on
P curr Slocalï°M  MULTILINL 2"^"j e=p beginn­Àof lines (af­Pa new )þ ’as well aG "® 	 *"$r 0endÞ Z `s (befïm  R  Z u  B   x ’S  DOTALL &".x Fany ‡ atíq, inclu© K î µ€X  VERBO²`   Ign¦ �whitespac×Pd comÆðs for nicer lookMBRE'sJ �U  UNICOD~oÑcompatibilityj.b dK Õ žO (itÿ ìü‘forbiddenJ 
ç@.

TèmK@also> õ an(eªô 'error'.

"""

import enum @sre_Ç 8ile Epars (‘ools
try:Â J _¡‘
except I` Et '   ð = None


# public symbR ±__all__ = [Y ">…", "full `search 3sub n bplit",< pfindall   @iter à   ß 	 €template êE 3  PF  M 	 A I L M S X UD 0  1  	 
 Ê  í 
 «G pñ ",
]

__version.ð
"2.2.1"

class RegexFlag(Ý@.Int )†Ž w = A = ð¢.SRE_FLAG_! ò# assume ascii "Ü"[È O = IH & 2# ik C ý O = L? " ˆ ð 8-bit locale
  ô  UNICODE = U = sre_compile.SRE_FLAG_# ð# assume unicode "locale"
    MULTILINK MK % ñ# make anchors look for newlineS ¯DOTALL = SP " M ™dot matchF `VERBOS— XG # ð# ignore whitespac¢ ¡d comments– #&ð extensions (experi" ñ	al, don't rely on these)9 pTEMPLATŠ TŠ $ ñ# disable backtrackingH _DEBUGA  ð# dump pattern afterÆ ‘pilation
I ñdef __repr__(self):  Ï0if  ö._name_ is not None$  ( ×return f're.{2 %}'K Pvalue° Qelf._ _ Åmembers = [] pnegativ5 / E < 0 4if   
‹ + 1= ~	 0  VCm inÐ Š_class__< 1if 6 D & m¤ 
"  í # 5= ~% g      Ñ ‚.append(mH"}' ) s 
g ? Ahex(v )9  re/“'|'.join(2   !Vif le1 J > 1}  — ^ ¦f'~({res})È  ;els  4 3 2 "re:ó__str__ = object. ó
globals().update(RegexFlag.__à T__)

|1cepÇPerror[¸  + - 0ð
# public interface

8h(aó, string, flags=0Ið """Try to apply”t ƒstart of F 8ð1a MÕ5A, orˆ èoñÂwas found.""�D  Ï« £ ").Á ¸ )Ô Bfull Ø ( í /llÒ a¿ 	Ö fsearch  « 0Sca°SroughÑ˜1ing›al!to­$j®KÅ ¼ ¯6subÖ Frepl‡count=0å  àReturn the strðing obtained by replac ðthe leftmost
    non-overlapp! ð occurrences of 0 àpattern in str%  by @ [ Qementg !.  ô can be either a: o ‘callable;B %if ð, backslash escapesv ñit are processed.  If it isB $a R �, it's pa'  ¤ ð Match object and musª Cturn= Ã á  to½ ul 1"""(  re3 £ _compile(Ð, flags).sub(J ,ë ö, count)

def subn3 (  #=0J A=0):q B"""Rt Ða 2-tuple conÖ „R(new_¯ ¡, number).9  1 is' C "asource} k ")ac« š  "of= °ubstitutionº Ñat were made.M X	C 
/; X B [ W? (a¯ ü W#nX	FplitYh `, maxs VS ¸± ) Í,á  ƒha list• @ `result  sÏ 1s²> Pcaptu Á parenthesesß n îYAthen§ @text�1allD Qgroup p 0 D Ralso ‚@ed a
r;  ) ™ E  » — - ”Ànonzero, at $ P!s 	 NX pmainder¤   † O ‹   �final el‡ dŽ k Á(f ìj~findall¨^ }  ¼ =allm@‡ Á u !.
¼ ö If one or more Û¡µ esiË­,¥G G2of 8 °; this will† sÙ ‹ K C 2has„ Athan• K ¨ dEmpty Ê  – €includedp L .�dyOiterz n 1 Pator „ �î w ð.  For each match, the iterðator returns a Match object.

    Empty m ñes are included in the result."""1 rN ÿ! _compile(pattern, flags).finditer(string)

def . A=0):U ""CN õ a regular expression c | ring a Px Î � Œ epurge(z Clearé z bcaches\ _  .c0 !()· a_repl.  _  ÷ |templat&ø + î ‘ Šð|T)

# SPECIAL_CHARS
# closAð')', '}' and ']'
# '-' (a rangð  character set)! &4  ~', (exten%	% ± operations0 Á#' (comment)i ðWHITESPACE (ignored)hðverbose mode
_special_\ ðs_map = {i: '\\' + chr(i) for i= òb'()[]{}?*+-|^$\\.&~# \t\n\r\v\f'}øUescap‹ ×E  { ü sb "a Í.ö
Åif isinstancW ,+ \  `¥Ãa.transæ TBelse ? 8   =W l‚'latin1'3  ) h †.encode(F 
N¤= type(sreÜ.»‚'', 0))
E) .TA('')ˆ- 0P
# inmRals

� ñ}  # ordered!

_MAXCACHE = 512‰Î C¯jX :ª‡ò
ê: ·, RegexFlagî " =a.valueA 2tryj «À [pç$),w O]> ö except KeyErrorJ Apass" 
¡ N ,$¡ "ifœ D ’ `aise V¯ b (U    ò "cannot processE P arguÝt with a<dÆ " ` 0if S l"isi§º r¤ BType£ f"firstƒ pmust be( à/orŽ  Nt à6Åº £ ( ‡ & DEBUG• rif len(ËU) >= }
ba# Dropg±oldest itemc	$ Bdel ^ a[next(Z "))+ &Ð(StopIteratioñn, RuntimeError, Key
 K):
  Epass ó_cache[type(pattern), 
 Á, flags] = p2 ò	return p

@functools.lruF ð(_MAXCACHE)
def _compile_repl( Z — @# ins Cal: -  ( tacementˆ | ¡sre_parse. ›_template` 
‚ dexpandÚ ”, match, 5 ‡  M" .8 Q implŠ ¡ation hookŒ @ ? = � $ ô ; C7 k È 8 ­ )Ê FsubxÈ % Á  PÆ�.sub/subnÅ QelperŒ F + =¬ ¼ eif not>Ä[0] and len(2 –[1]) == 1x˜# literalÛ€  ™@ 1[0]  Cqfilter(
·=. ÿ H X6 g ó!

# register myself for pickling

import copyregš 3e(p� Ñ ýU, (p.P!p.R3)

D .> ¶2, _ ,’)— - 0�
# experi[ñal stuff (see python-dev discussionsý pdetails² Âlass Scannerß £�__init__(0“, lexicon;#=0 mAfrom0�constantsœ QñBRANCH, SUBPATTERN 5 aif isi0 1ce(>·, RegexFlag^  -  " =·e.valueI  Ÿ .ž $ =¨  #�Àbine phrases›0o a Ypound� m Rp = [«  s St”)_ sùœ  `q A, acf$in� e ]   0gidc ¶.opengroup(_    –p.append(3SubYU(s, [v  /   (q‘, (gid, 0 C f(ÕM))),K *])Ž rs.close© Z Vp[-1]%  ?g ª (§(None, p)); Ës‰ $ren.F"(pi  ¡ ) �Xstrin5jresultÉF2 =  Vñ Œ v @elf.\ 4ner (a .% 3 Ui = 0 ªwhile Trueà2m = Øvm. à    break
      Ãj = m.end()
  ©if i == j:   Ybreak ùaction = self.lexicon[m.lastindex-1][1]4 Âif callable(@ )k P Pmatch§ 	@  Š 8 2 = 	 (/ ½, m.group()Ò ' Î is not Nones 0app+ B E = j… ðreturn result, string[i:]
"""Redo the builti' ðpr() (representa3ð*) but with limits on most sizes."""

__all__ = ["Repr", "G  �cursive_ ”]

importx ós
from itertools  bislice t_thread øget_ident

def reb ó(fillvalue='...'´ð'Decorator to make a ’ B fun/@ A for% _ !'
_ x dR Ding_D U(user {   j �_running†2t()J    N  wrØr"9   ‚key = id %,   + Ìo Aé Ò  i   ª Š.add(keye?tryT  e9 = ² 	` ofinallB $pr´ .discar}  ¼ ÔBp# Can't~ Ñ K.Tõs() here because of bootstrap issues¡  1 Áper.__moduleÔzgetattrÜ6, '% '!B ?doc? " < ?nam| # > Bqual   =-¾ ' F BannosÈ 	* V', {}°± @ €

class E:-  ‚__init__O} NÕ.maxlevel = 6É _tuple Olist @arrap5M 0dic3 4  se ~ ofrozen Odequœ ª] = 30l !loB4 Rother5 6  : Î67, xV‚& # B1(x,NžD 1E !, mL @typen0 =  `(x).__ !__‡  U‘if ' ' in#   Å   ðparts = typename.splgit()
  ö
typename = '_'.join(parts' ôif hasattr(self, 'repr_' + > )):U ¯return get6 –(x, levelm OelseM  { .y ‡instance> ~ Rdef _" sterable° f  m ÷ft, right, maxiter, trail=''Æ –n = len(xš "if¬ º <= 0 and n© sDA...'Ž  dÍ 1newñ _ uvel - 1/  3  À E1 = ï 
 Ppiecei [) t(elem, V `) for  ‚ in isli&ê ))]k dif n >2:  ] �.append('Ë ÿ  �  y 4', 'Œ 
" T A== 1!Y": q" =i" + Œ .0'%s p' % (le¨s«!)
,  à ö M_tupÜ¼P B
 '(É 2)',j1maxV \, ','p KlistKo [o ]o  U i _arrayj  ]Jot xwï "= °'%s')" % x.�Acode= ¿—header = , ?, [. X GS H, ']K‹ Ý /seEÛ 
'; )Wøx = _possibly_sortedªº  '{’}’<set´ `frozen  $, @ÿº A À >[ Ê 5)',ê î  É E.max? ô Ldequ:ð ]E õ r /ic‹ƒn == 0: � 6'{} 	ª# 7...& 5‹ h‡&F = [O w7keyv  kGdictS ª0keyt 0 =  W1(keyØ	Ù0val$ + ox[key]. àpieces.append(ð	'%s: %s' % (keyrepr, val	 C))
  öif n > self.maxdict: pieces.append('...'2 âs = ', '.join(+  Áreturn '{%s}| As,)
n @def } P_str(p Á, x, level):"  “  ^ �builtins./ @(x[:.  ž vstring]n —if len(s)Ã % R  V ±i = max(0, { M f-3)//2R  . j. 
z J-3-i+ ¯ pi] + x[š Wx)-j:±  _  4 1s[:& \A + s. s. Ls@1intÅ @õ) # XXX Hope this isn't too slow...s QOlongO & M+ K+ostance:tryÈ  Šm
ßà# Bugs in x.__�õ	__() can cause arbitraryB âõ# exceptions -- then make up something3 - $ E4 
¥ 0'<%‰ ä � at %#x>b › úclass__.__name__, id(xè �	*Zotherm )' Û, Ü0
0ð _possibly_sorteÓ ° ñ# Since not all sequences of items¥2be 9 ñ  and comparison{b# func¥xmay raiÒÄ#, …Ran unR C y  $’that caseP	oA < "(xgù/ @list- �
aRepr =  0()
Š1 =  &r
"""Worä  leÕ ñ for GNU readline.

TheUleter
 Ás keywords, A-ins2`globalx  a$€ectable
eðspace (which defaults to __main__); wù w “ �ng NAME. ð.., it
evaluates (!)(° expression-!to `last dìÇ Á ðs its attributes.

It's very cool� ñdo "import sys" type "sys.", hit_ ¢  on
  (twice),
5 se5 e ‹ ]û  ð qined byA ðsys module!

Tip:{   qthe tabW !as, 
m b, callâ©õparse_and_bind("tab:®Ö")

Notes:

-5ðs raised by the ó-completer function are *ignored* (and generally cause
  the <  4 ñ$to fail).  This is a feature -- since readline setsC óLtty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without som  ðicated hoopla to save, reset Ü trestore� ñ state.

- The evalua!of$ QNAME. £.. form mað  arbitrary appl{ 1ioná  fined code„ €be execuš Áif an objectÀ à a __getattr__º kP¡found.
  SL it  ‡ó responsibility § � R * Puser)€ Penabló Dis
 ¨P, I cI Pder tÆ‘an accept. €risk.  M-û à Ðed expressionM V(e.g.Màcalls or indexÄAoperQ"s)kDnot*h!edzAWhenmàoriginal stdinò 0not#ty6V, GNUZñis never
  used,ãÍ bmoduleÐ �m � ðsilently inactiv	ô"""

import atexit „builtins einspec ô__main__

__all__ = ["Cr¥"]

class  @:
  òf __init__(self, namespace = None)*  . ô """Create a new– ÒoÈmê {!.
c  9 v %([_ W]) ->C pinstanc 3   AIf uè 0ifia Lwdefault§ Awherz  ^ ì0per2%ed… 4is '€ (techni3%y, Ô.__dict__). N@s sh   b� — °  given as / �ionariesð  Ö F . =  Ï ÞeõÅmechanism ofµ ;1via§Cset_5 Per() Ã :j0 .( �5my_ƒ$).J )q ƒæ G  ifh Ø $isÕ (J ,
+ B õraise TypeError('/ p must bHB6y')Ç À# Don't bindF: ñ
quite yet, but flag whethJe]•r wants aÕ  # .GificÐ  ³o0  .[Àwill allow uq Õ 0  #‘ ™ R;4 atÕ®Pime, 70nowSD 	Y!isih $  �B.useÙens = 1Ð Oelse/ 0/ P G=	v4def¸ e
Rtext,¥Ú‚"""Retur6 next possiæO ù ðfor 'text'.

     ò6   This is called successively with state == 0, 1, 2, ... until it
   Ðreturns None.W ò
e completion should beginW ’'text'.

? U  """ õif self.use_main_ns:  1  Ònamespace = _( ¦_.__dict__Y pif not p Š.strip()M  n å 
  l þif _readline_available(  , ( €.insert_u i('\t')¿  +   / ¯redisplay()  ^= ''G ?elsŒ 4 *\t6 2 À¿	;ÿ
ò ‘if "." inY
  Û ¢’matches =ÏSattr_ (
í ™ I oglobalK :try� Û I [× ]Nÿexcept IndexErrorB  ÜPdef _3 �_postfix(b ·, val, wordg!ifa . G(val  , - f += "(  Ê   Ïñinspect.signatureX «.parameter1 :   k )k _Value  ; Bpassþ   U P   ˜éP³"""Compute B wheG ‰@a si8 ß Rað a list of all key‚ ðs, built-in functQs andE µs currentlyñpdefinedÀ ¦ .m LBthatš } 	�Tmport{ R Í 6= [X±seen = {"__¡ uins__"}5   ;len1forA ž â 0.kwø G „!if' @[:n]¡ i
!  %  ƒ P.add()
q  D  k þ{'finally', 'try'}N  3  I ! ={ Z + ':_ " $elW  z in {'FalseY  E  eTrue',
 7  `'break3 `contin7   'Ž?  WË  Ë ×l.appenE ©n7Jin [J”5ins•]Q ?  M4 ‚L l.items¦ Vñæ E å0in ð
g  :     à.add(word)
     ô#matches.append(self._callable_postfix(val, word))
B sreturn A 
 “def attr_ P �, text):"  > ¤"""Compute> Q when' ò contains a dot.X  6 ÂAssuming the+ Qis of ¡form NAME. @...[	 •], and is{ PevaluÛ A in í ònamespace, it will be ( 2tedA !ts× VibuteM ð(as revealed by dir()) are us; ös possible completions.  (For clasM ¢instances, � membersO @also–sidered.)ðWARNING: this can stÅ ðinvoke arbitrary C codæ µf an objectÁwith a __getÁ–_ hook isŒ5"""; •import re qm = re.ó	(r"(\w+(\.\w+)*)\.(\w*)"4 †if not m& ôd%[]( Qexpr,�ö  = m.group(1, 3™:tryF  ð ! =Ï (F 
 A �except E :ionN ” • Q# get‰ ¾4ent˜v #, R Å__builtins__=  W€s = set(B® m% ¨.discard("I "`if hasÁ(G Q, '__m7__'‡ aX Hadd($ œ # £update(getK Ÿh .f ¹ eà Å€n = len(© wi<j == ''tånoprefix = '_'Ÿ (el4 _5 		6 /se_ 6NonÉ›while Tru0 1for EB
O  6@if ( @[:n]Ò  ë  L¼  %   ú(ä  ³; !+1=  )¾@ eÓ = "%s.%s" % â G a/   Tif ist × ¡ W(typeÒ)õ , /),¼  M  �property©  ) ²# bpo-44752µ%.¬  pð a method decora„/by{ D# `@u ð`. What follows applieJÈ? ifI 2Œ 	Ò, but know we 6tha? Ø  #Ž!isÕF � (becauseji˜ /.˜ PAlso,b£2his2�)´± †L À          # ÿproperty method, which is not desirable.
  ñ matches.append( ). �continue! ôif (value := getattr(thisobject, word, None))£   :O  ± � ž  self._callÕ ‚_postfixu !, - )½ Oelseg I 	• "if_ Qes or\ŽnoprefixV \break> / ~ == '_'6 ! Y '__'@ ¾ 2  F2 ¿ †es.sort(dreturnÇ P

def¦ð_class_members(k )Ÿ “ret = dir b aif hasÜ, Ã,'__bases__'8  º@for  A in ( .' ]  %   e   +�   C Ã ¿ ‚ret

tryE ñ	import readline
except I RError( _" Q_avai>– = False
]% õ.set_completer(C
 $). ” ð# Release references early at shutdown (th" ¤ ‘ module'sN # Sðents are quasi-immortal, and = w ór function holds aF € Â to globals)öÀatexit.regisÏ ulambda:5î  KE6ñTrue
"""runpy.py - locating° @runn àPython code us  Ê þ ñ	 namespace

Provides supÎ ;R 	wscriptsU k 
\ ± instead ofFònative filesystem.

This allows G ² ö	to play nicely with non-= ß¢d PEP 302
‹†ers whenÖ ¶ €as well   ) 8  ¿  s.]ó
# Written by Nick Coghlan <nc
 €at gmail–0>
#N@to i¸Bment› ‘38 (Execu¡M}s~ SG3)

¼ D sys – ð lib.machinery #[ þortlib first so we can test #15386 via -mJ Eutil o
 Etypew ñ os

__all__ = [Ý i_1",  ¡path",
]

½b _TempÛ (mŠ0""" óorarily replace a… �Bsys.^ sæ†an empty¤1"""Š  2�__init__(Œ,H _Ìp  ƒ   R  % =# C ! aule =  .½ �Type(mod; c1 ð_saved_module = []

  ó	  def __enter__(self):
  °mod_name =  . ! 6try.  5 ' ð	_saved_module.append(sys@ Tules[H %])J ú except KeyErrorV Epass* I ¢ 5ule, areturn½ 
 ï 3xitî w, *argsõ !if0 .Æ 
� ƒ ò m)]ˆ 	= 1[0]}  !JelseM Odel Q 9 h 	W ó = []

class _ModifiedArgv0(objectÖ õ 'inõ Svalue  — ^  1 =  y  ä ¢entinel = p )()fU`S dis notyX 
(Ñraise Runtime%ñ("Already preserving |Ã "_à >r =uHargvŸ ‰ ç / 	Ø >	i 3 @ #_sÏ R;ys.e › ð@

# TODO: Replace these helpers with importlib._bootstrap_external functions.
dá�run_code(  ,  ‘globals,  e=None,©  $  Ý  Bspec , 1pkg2 v script rA"""HÍ 0 to�  — à in nominated w�space"""d )ifª  2 ± (Ù ˆ.update(ß %ifÄ  F 
B �loader =  y  f�  ÑÐ  hcached2 
äR  H 9. A ]   eorigin  a !  ! 4if xÑ  ¿  =ú q.parentD 6 _´2__ 2  ÿ  Y  a__file, Ë ) ¹ +  , 1doc)  ‰' M*  , bpackag« /  ­Y y@NexecI qR
‚‰�3‘W  €  ƒ# Ä 2 Þ # 	ˆÀNone):
    "ð@""Helper to run code in new namespace with sys modified"""
    fname = script_n  if' õ_spec is None else q.originA Z ñ _TempModule(modG ±) as temp_m C, _M} aArgv0({ !):F  ‹  9 ˜globals =: .A •.__dict__2 P_run_ñ ( ,  B t, init_ 3  i   o  !7  í Q, pkg¼ ', )= ³# Copy the U 1 of  ä Porary€ Aule,ù 3hey8 ÿmay be cleared when8 ’ goes awa9 `returnT Æ ¶.copy()

# ô1getN Afullñ , Ì B andPfor aG Ãule
def _get”…_detailsµð , error=ImportE ¢ 2p.startsúC("."!  VRraiseC ‘("Relativ71ule� �s not sup_ 2ed"\w`_, _ =® ˆ±.rpartitionj R%if¨=q# Try i· 1ing`parent°avoid catch  `ializaZ ° s\  Å 6tryX   "__X 4__(ª ¸   wexcept 1 ÿeB 2# I,“ ðor higher ancestor packageq¢missing, lÜš  p #¯  Rn‘d by find°�() belowÿtj zÛaught. But doN  � al3  ot‘  s5: 	3 Pif e. « Cor ( %!=œ ƒ 	9  ¾    r HKC  + TU 4   ï R ‚# Warn iXmc° has alreads#en°ed under it�2rma+M Pexist=%pUs.getò 0 iP t# r Ü „hasattr(U ¸, "__path__, Ó Ófrom warnings­  š  & “msg = "{mZ�!r} foundè4sys° @ aftå  ž9" \I  M "i{„Ñ!r}, but prioHQexecu?of E Œ p; this ç`result— Punpre¯OableD öbehaviour".formal=ê ’=® ˆ Î  <€(Runtime¡ing(msg))
ù 	Ë=f–lib.util.;u b Ø(Ù±, AttributeT, Typ BValu ù&ex0# T!€hack fixåš edþP mismš€ betweenB › 	A#¸ à, where the laðtter raises other errors for ca swhere
  ò# pkgutil previouslyA �d ImportEA 0 qmsg = " ñ while finding module specificationx å{!r} ({}: {})"K  if3 õ_name.endswith(".py"):%  §  t à+= (f". Try uso Q'{mod> ö[:-3]}' instead of f  A  &f"5 �}' as the…  ¸ ˆ %")z F?Ä(msg.format(u Á, type(ex)._† ñ__, ex)) from exI !if† is NoneØ ^ 8"No… pd %s" % Y “ J Q.submi¢_search_lokse ;noti fõ == "__main__" orc €! †	² 0Cank °use packageN;  X 7uleM6tryü  �2pkg‰  w  =2 í T + ".H 
ÆÃreturn _get_‰details(N ,µ7 l bexcept  § ‡  " Õ rin sys.c s·  0 	6 # · loaded; bešaÑis irrelevant A   E ��(("%s; %rÁ< Rand cg9" +=  A  õ"be directly executed") %(e,])® 1r =›. ` 2if   Š °«  ¼Gspacµ &beˆ ^ ²  	Qccode =¼ .   «ö Õ“íeÏÂ 0if Y "No& àobject availab)/orÛÙZ C,E ‘

class _q!(EÊ3ionœ#""Š”that _run!as_À() should reÍ eòout a traceback"""

# XXX ncoghlan: S6 Pthis [ ocumented ˜ðmade public?
# (Current thoughts: don'tu  ea ¡e mistake ª l§Âto its
# cre-Vwhen Å ò () no longer meH °needs of
# É¦�.c, but cë  y ð be changed beca¨cit was¶ _)
def1†ö alter_argv=Trues2Run:pdesignaˆ 1 inSÁ "
Ac   Not |ª £ðule will have full access toV B ] Àce. If this òis not desirable, the run_module()
  ðfunction should be used to/ 7 3 ô code in a fresh namespace.
M !At1 ¡very leastx pse variˆ sA Ð__main__ willq Äoverwritten:K  ž  __d *__ Lfile lcached lloader dpackagC 1"""_ 6try| ñif alter_argv or modŒ T != "À ñ": # i.e. -m switchK  »   5 ,? Rspec,Ec= _get‹–_details(/ e_Error£` else:R  u �directory¡ 0zip` execuÐŠ  �ç� … rexcept  v as exc.òmsg = "%s: %s" % (sys.Š  õ,/ Î  bit(msg  globals = ! � &s[mƒ].__dictÏ	£Œ  <  µU[0] =xq.origin€return _ Ó( (, „ q, None,/ s ’ Ø`)

def1ÕÍSinit_Ý =X  Š  é z¢sys=False)Ý A"""EÜ0e aØ Rule'sOõwithout importing it“Rï s˜Qresul! –top levelÆ ]aionaryù — 
 ÆÚi Þ 1 isWÏ  Qø © % z Û7sys. É ¸_º¿f,‰ O ¢ r Id   q# Leave3sysVe alone% /O{}, t ìb eæ!=I¶òî ñ# Helper that gives a nicer 4 ó message when attemp×¸ # +6or 1€by invok,Î".pø�# Also mow  6”standard *  m!of8bway soª "th7‘# preexis” $__‡ñ entry doesn't cause issues· ƒ · Nm žQsaved7 4 ]C 9del? 	åÚ‹ ® Š Æÿª"ifB 5  ässtr(exc½ n  RraiseÄ@("caafind %b!ul`Q%r" %Î  3  (Ù ,ð ðpath[0])) from eCxc
  Qraise �finally:   ðsys.modules[main_name] = saved_ ò


def _get_code_from_file(ru1 0, f8 )X ð# Check for a compiled 2 a first~  F ñ pkgutil import readd "  deo Àd_path = os.
 @.abs b(os.fs$ ( )7 Áwith io.openM (% I b) as f©   c & =z "(fF 1if  vis None1 ð# That didn't work, so try it] Ñnormal sourceE —  m ›  2 „ =E0(f.##()q‚, 'exec'³ areturnr   º ¦2  áð , init_globals=á  , '  Æ Ë’"""ExecutÉ ó located at the specifiÝbsystem$ Dion
÷ R˜ s2 ðresulting top level u õspace dictionary= 2The: ½ ô may refer directly to a Python script (i.e.~ Pone t²pcould bf ;  <uÏ ˜   ¤s) or el2   ×x o 0zip*  ) ˆ °ory containÜ aÞ � å _LS__.py§ ¢ 1""") %if� t›P = "<  >9 1pkgÔ Å�p.rpartiK�(".")[0]d s Ö~!er%  8 =  (s i mP# Tryì  CvoidÄ  0imp as�0not0sumˆ�e depreca� @ war0
�is_NullIter = Fa†„if type(� B).__·¶__ == 'imp'¤/  f- g 6  p… 2Tru<Æif isinstancŠ ,™  C):B • à# Not a valid y Sa entryC1run$ôX!ly” š $# ¡p() does@helptpwe wantpTallow1vsE  [ / =Ó ž ñ „ b_ƒ R ( 
TO,}  B  Â=	 ,"~ =ÜF  –Q`Finder0Pdefinˆ0or ¹ Q0add½!to=  { #a…start of…  –¡.insert(0,N ‰ ø F 'trB  Ð# Here's wherçðings are a littlu�fferent † >F€ M pcase. TL Ð, we only hadß@repl+ A ƒ0 inÉ ð while the
       ð
# code was running and do
 !so òsomewhat optional. Here, we
F  ñ# have no choiceJ "we üto remove it even while we read thM  ™ @. If# ÿdon't do this, a __loader__ attribute inG  PexistÎ ð__main__ module may pr‹ `t locaÜ 0 ofC C new' .ã �mod_name, b_spec,Ab= _getb m` ©_details()B ±with _TempM' A(runS ¢) as temp_@ 9, \9 dò_ModifiedArgv0(path= :,  « ˜globals =Y .` �.__dict__: €return _š  …( ò Q t, init_ B ¬   N ;2pkg¿ W.copy*zfinallyÖ +tr  b @sys..^	– úexcept ValueError[  J ±pass


if _• t__ == "7"2 A# Rug @ule “ÀÀhe next commIÑline argument’ pif len(¸ ’argv) < 2[ … Žrint("No_ �for execu©€", file=G bstderrgFelseN @del "  i ¡[0] # Makeâ•requestedi 3ys.( ¨  Ž m¨1_asÞ¹ ð [0])
"""A gener¯q usefulß`t scheiòr class.

Each instancek"is ð	 manages its own queue.
	pulti-th' Èð'is implied; you are supposed to hack that
yourself, orœ € a singl*… ’per appli ¥ ñis parametrized ¿€two func‰Ps, onShat is
‰ Hàthe current ti<1 º 
× e)ñ a delay.  You canó  Preal-I b ±by
substituí   �ôsleep from built-inò $  F7can€ `simula % q by wriY  T¡P.  ThÈ an
also bemŒ˜integrate¬ DbSTDWIN+!s;“ó 
X ’ is allowÖmùy( a  Time�be expres1as
v 0ers÷Afloa¹ Àpoint numberC@s loî s l  consistentRvents[2pecà°by tuples (Ñ, priority, a,êÐ, kwargs).
As˜`UNIX, Î r7 � ¶ mean highe ;6  î7
wa÷ ð  Ë`tainedwaT E*hðe
event means calñling the action fun	 `, pass "it  órgument
sequence in "a ð" (remember that õPython, multiple\ 
6 ð s are be packed5 $a ` ð	) and keyword parameters& ¾"kwargs".
T» @ mayU €an insta¬ ñmethod so it
has another way to referÖ ô*private data (besides global variables).
"""

import time ñheapq
from colleO#s * ¢namedtuple# …itertool! TcountL ’threading-  g I àmonotonic as _ ö

__all__ = ["scheduler"]

Event = ~ !(' @', '< µ, priority,�,$, °", x"')R .; a.__docv ñ('''Numeric type compatible withIð return value of 
H  z#~ ed› �åconstructor.'' ´ ƒ Ú $s @d fo–ae same¬P will$°executed
in‰ c order– %iru  u ñA continually increa@0 5 nup
    seÕPtes eŸBs if�  øÛ "Xequal„ ­‚ EÌ  ³ 3T r means æ  G9 &(*Ò"**Ô)X a  F is ¨@ hol£@@posiH'alå} È { g  e !di?9aryg d @
_se“öel = object()

clas1r:
Žñdef __init__(self,� –=_q, delay  °�.sleep):>  Ðõ"""Initialize a new�O œ ? ÞR A  [  =s[ R    ‹ p._queueØ].  ulock = )Š.RLock()'  q  ^  * 0ime 
! ‰   & =ç 
# _ÉÑ_generator = ¯ V ¬  D‡enterabsD]S4=()V=¯
UER PÖ­Òat an absolutß.Ó “ Rn ð5 ID	G �which can
"uso¥remove it,ÿ Çif necessary[ ¦#if ·È  ‹ ØF= {}  Ë
2 § != Ñ(ÅKAnextf.› )¿  | 	 À action, arg÷ument, kwargs)
  `heapq. öpush(self._queue, event/ breturn ¡ # The ID
N ‘def enterA ñ, delay, priority, action, arg� 4=()� Á=_sentinel):M  ž ò""""A variant that specifies the time as a relativ .�  B pThis isz Qually7 ðmore commonly used i· Gface< 5"""Š j !=   ‚func() +ä ' ' 
@abs(0 	)·  FccancelG�	„Remove aˆAfromÛ ´Ä  °must be pree!ed+  ID;² Sed by¼%).Ï !If* �  Fanot in i 0, t`÷raises ValueError� EBwithCV_lockÒ  ª4t!.rß (x z &  £©1ify ¨=Bempt 
KÖCheck whetherÅ  Ù 3 .¬ 5 · ¿1runœ 0, bé Šing=True� rExecuteJs until– ŽO  ´ rFalse eF ”scheduledU edue toB ñexpire soonest (if any) an#n Ù  \¡deadline oD Vnext i Dcall  1Whe1 re´ aa posi©ö Rfirst¸  Weq )  q = F  t $ed¶ 4   :lef ;E oôAwise\ 3 j*d A[ ZdD 1(itINion � °, passing i¬eåe).  IfF \6layD vs �maturely,F •is simply= —restartedb"Itü Ágal for bothH9å 5ionS Ê ‚to modif$àq or to àm@xcep†Ye Qs are’caught buõ's state remainsƒ ðwell-defined so ?P) mayµíGgainö `A quesŒ �able hack0addß�o allow ÷� threadsË &unwjQafterÝ  è D ù2, aß 0 Uð avoid monopoliz ä0CPUln„  %6als”@runnÃ Ü ˆ¢# localize	 í QaccesÏ Pminim voverhea­#ÄÐto improve thÓread safety
  Ðlock = self._  q Uqueue ”delayfunc   # Htime"  ! Àpop = heapq. 5pop µwhile True:  ­ Pwith ¢ 
   Žif not q   YbreakK   (• ý, priority, sequence, action,3 ý
 argument, kwargs) = q[0]* `now = b  -()! !if o > now· W! =
@ ;els Ô   7 FFalsµ   Zpop(q“ 1if 8 Š [by>ing!  V breturnÒ -Ò ° ^   % 
ƒ Ò ‹&(*z#**|d ð0)   # Let other thüas run
8 s@proper	Adef å()å ò"""An ordered list of upcoming events.S  	E ñ are named tuples ¼¦fields fora  5  ‰ô ,nsoh 1"""Ç  ? R# UseLÂ to sort theÑ 3 raPan usµ '" !edë !._÷ 7)'.O Wi –cq, twoæ Â scheduled aa BsameôÇwill show inI  † bactualC — öy would be retrieved} ( „Œ
(nvº &[:}r† ¦Q(map(Ã _2, [@ b]*len( ð8)))
"""Generate cryptographically strong pseudo-random numbers suitableÓ`
manag``secret ñ	ch as account authentica^ð tokens, and similar.

See PEP 506W Á more inform8 ð.
https://www.python.org/dev/peps p-0506/
Ü ð	

__all__ = ['choice', 'Ë Ubelow 0its qSystemRê ''² Q_byte*  0hex7  0url`8 êcompare_digest p]


impµebase64 óinascii

from hmac ) 
P    Ð $om" Å `

_sys  8 =  @()

 tbits = & D.get 
1   

4'  Eó(exclusive_upper_boundIB"""R› a 2  § Pnt in  ¤ge [0, n).Ø?if R V <= 0ðraise ValueError("U~  ~ ð must be positive.ð	")
    return _sysrand._ ó:below(exclusive_upper_bound)

DEFAULT_ENTROPY = 32  # number of bytes to ^ ðby default

def token_b& !(n q=None):“ B"""R–  a Ž !omQ ð  string contain *= *  1s.
? 5If  Pis ``[ ñ`` or not supplied, a reasonable: ¤ ƒ is usedP 9>>>± ñ16)  #doctest:+SKIP> ðb'\\xebr\\x17D*t\\xae\\xd4 p3S\\xb6 2 ’bP1\\x8b'µ 1"""E 2if Ô  …  ¹  ª += €8 iÇ 8Y`)y3hex wCtextwó, in hexadecimal3The! F hasy € ¸qs, each¤ ½`verted1two½ ßhex digits.  ¿G ÷ ½û'f9bf78b9a18ce6d46a0cd2b0b86df9da¨pþbinascii.hexlify(Ú±)).decode('+ '‹urlsafe�@URL-.  ˜ÿ Base64 encodingœqš4
Ô «0Ý uûDrmhze6EPcv0fN_81Bj-nAkYtok =‚
	Àb.r A_b64e‘0).r;np(b'='Žô
"""Selectors module.

Thi ð6 allows high-level and efficient I/O multiplexing, built upon the
`sea `_ Ð primitives.
úò

from abc import ABCMeta, abstractmethod( 0colO Dions0 ­namedtuple# .W ƒMapping
f Dmath £  òys


# generic events, that must be mappÊó#implementation-specific ones
EVENT_READ = (1 << 0) UWRITE 21)
¨ó _fileobj_to_fd(     Â descriptor H  cobject¢ParametersR " hobj ---  %  S  ‘< �corresponm? ƒ 0 Caise/ ÐValueError if š  8qinvalidm 
 éÔif isinstanceü  €t % Afd ={ 1obj> BelseÛ   6try   0 Àint(fileobj.³fileno())
  ôexcept (AttributeError, Typ BValu %):8  ? fraise   ("Invalid h © object: "5  9 	 à"{!r}".format(: ñ obj)) from None? –if fd < 0ƒ  ×descriptor: {a dþ ÷return fd


SelectorKey = namedtuple(' S', ['  `', 'fd `events
 ydata'])N ç.__doc__ = """M é b, fd, E  , C !)
ñ O>ø used to associate a^  ±its backing:  £  þ 1, sÞ "edg ñ mask, and attachedx ó.
"""
if sys.version_info >= (3, 5ÿÆ .l 7objç S'FileüÑ registered.'œ 	< d7 ¢Underlyingà Á ;  0? E‡ò that must be waited for on this[ ™W   U ñ('''Optional opaque*�›Y ê ÂFor example,| Pcould˜ Ô@storÐàper-client sesxô ID.''')


class _9ƒMapping( “3""" 8 ofå s! €or keys.æ¢ ôdef __init__(self*#orW  ¨  %._C =N"or§E 3lenD : a1len^ E ³._fd_to_keyíF sgetitemJ ,È  ó6try  ž 1fd ’ f^ Ôileobj_lookupjô 9 � 
Þ ™ A[fd]& - %1Key
ƒ ‡ (Ïw is not á
i CiterK  L
.DBase1Q(metaEƒ=ABCMetaX �ñ  abstract base . .àAð• supportsÖ ¬Qlpbe moniÚz�specificä 2I/O…s_  B/$isÞþt or any# €with a `7  Ê‘` method.` µAn arbitrar2 0canuìato the]U ƒ, which *  ŸN  9ÃG Õ � context  ²°ion, a call…U, etcÝ 7 [ Ðuse various iPmenta_ s Ö°ect(), poll e	 2...º`dependtÍ`e plat6ô . The default `ù`ÈÐ uses the mosðt
    efficient implementation on the curr ‘platform.6 A"""
	 ñ @abstractmethod ñ def register(self, fileobj, events, data=None):4  ‹ C"""R7 ! a3 ‚ object.l  $ ¦Parameters8 ] 8 --5 2 or ¥descriptorj †  2  òto monitor (bitwise mask of EVENT_READ| eWRITE)N  Ì  œ ±-- attachedà ¶ gReturn³ ÷SelectorKey instance/ Gaise. ÓValueError ifC¢ is invaliu � 5Key& ¥is already”e2 /OS1 `closedAQotherõis unacceptable to  {    /ùunderlying system call (if a †is made)ö FNoteÕš 0may‰   €not be rÃ  ‹ ~    T NotIÌ!edá f ­/un¯
œU& žDQ/, ?è "ed 5
x!If60objb0 ó but has since been (•this doesÁ R*not*© É(j À 'pwrapped  > QÓ lomodifyj‡Change aù s$edp*orÞ•íPAnythèWthat C)°9"()Ý .; µ
r9 ( S & 
MIãsq$timeout€ 0Peråú`actual|  ecÇ, until some Ž 5Us areu 7 q � expires;. !--/­ a > 0, k‘specifies§ Ámaximum waiti E, in…  á ðseconds
          ö*if timeout <= 0, the select() call won't block, and will
C 
 areportB ÿcurrently ready file objects; ‡ †is None,†  p € ÿ until a monitoredM m ‚ becomes‡ 
. …Returns: ò
list of (key, events) for: Á `( ð` is a bitwise maskK ²EVENT_READ| UWRITEr 5"""  ra9 òNotImplementedError² ö def close(self)¶ @"""C t¶2or.5  —ÁThis must beÍðed to make sure that any underlying resourceÖ efreed.¨ ´ Bpassj  Ÿ qget_key¡ ,.:objª t« Âkey associat“ Áa registered? .Í @ ´S§QorKeyªtî ý· @mappæ =` f.¸ Umap()- 4if $ ‹p T¬RŠ!me¥$('Š  3©&d'Q ;tryB }f [² Eobj]‚ ¡except Key_ = + `("{!r}w 7notC“".format(] q)) fromZµâ@abstractmethoHÉ j€ }C(ofªsZ„h keys./7ã
 __ù1r__F=r1 “ ½  © c__exit- w, *args4  - .Œô()


class _Base­ l( > 0"""   tector i•QationÖ ¬† %in† A  &!# ŽBmaps%¡descriptor)  E  - ¬ `_fd_toEU = {} #‚T-only3 ned by ÂO tmap = _î Mµ[F!q_lookup ÀaÐ Z ä¶ƒ wr_l pto_fd()1ð do an exhaustiv|Åarch in case —\  íðinvalid but we still have it; 0our,0.   E Ris us6$unpP() soF Fcan   — q  %D Áwas previousß¶ 1 ifƒ s°`d.  It² EalsoD … �i@O]xGðValueError:
         ð# Do an exhaustive search.
  ùfor key in self._fd_to_key.values():1  9  if4 Ã.fileobj is  +  / breturn3 dM �# Raise Vk ú Error after all¨ r( 
= Ðdef register(µ , ÷, events, data=None¾ sif (not$ b) or (0 ò & ~(EVENT_READ |  gWRITE)C Î  Š ² “("InvalidY ã: {!r}".formatb "))¼  A  oã= SelectorKey(>,ƒXt_lookup )Þ Q �dÆ 
’FA Keyl ("ª € (FD {})Çualready_1ed"s ·   ä À  7(fdí   U[" 0] =\ "' ã/unå�:tryà [t A.pop(#._© Z)‰ eexcept"
^ >0is U¬ %edúm €)) from Žh ñ amodifyª Ò [V]” ü U#if*! !.…
l´ M®  �ï€.- /   Aelif}  *
{ ñ# Use a shortcut to update the= 
œ‡  Ú�_replace(V = [ ~ Ö cQclose O v.clear(s   Rmap => ]bget_maQ —8 Ž _È1_fd‡ G, fd: B"""Rç $  associatedAqa givenªÂ descriptor.b  ¦Parameters�\fd --4 3 r 0 Ðcorrespondingb,æ z1 if¨Ffoun„&""àM	?[fd3 ~ ƒ


classöüd(_Base CImplR2""" `-based-.± Åð	__init__(self):
        ósuper().__init__()
  ýself._readers = set Hwrit = Ðdef register(F ñ, fileobj, events, data=None):4  t 0keyg ’ B < § #ifU Ö & EVENT_READV  Z  … Ë ¿.add(key.fdF 	_WRITEG ô G ±return key
×  %unË  ˆ ú 1 ü ¨  B Ê ndiscarÎ & © & ­ öif sys.platform == 'win32' Ñ s_selectÛür, w, _, timeoutÖ €$ xÞ; .B  w< è 6 M % � + x, []UFelse’ Ž \ €l  i ¥ ¼ 0 = ”4 ifÎ 2 is  u S max(+ 6, 0®  % ¼¡  ½ 6try¤    Ç 2, _¨ #f.· EÑ , ¦ #._º ò ³ n ûexcept InterruptedErroro =Aeady6„ ~ 6t(rM w w ú for fd in r | wX ÁE = 0V  Z $if3 
/   3 '|= = l = —Ý    8¯Èkey_from_fd(à (  if™  ¾€.append(§  &1 .À )!98 ñ


class _PollLikeSãuor(_Bas CImplò0"""  8 ðshared between poll, e � and dev Æqors.""">BPor_cl  º Ñ A  Ô  �¨  4 ˜ G 1  – "()ª b k9 02er_·	ª,
> |ø × T4 N \
aO 
0 P 3 Œ)5or.B½,,é Ÿ 
‡ Èðunregister(fileoWbj)
  Uraise ±return key
 ñdef unregister(self, fileobj):#  L çkey = super().1 + * 6try7  ;  S ¨._selector< fkey.fd® êexcept OSErrorF õ # This can happen if the FD was closed since it�  ‚ #" ä 9ed. Epass jmodify÷, events, data=None.?ò elf._fd_to_key[Bƒ_lookup( %)]” ?Key Þ  C(f"{A ¶!r} is not ú €") from °    ×changed = Fal,#ifæ 0 !=2.ô 
™Ù_ E = 0º  ] E Ê& EVENT_READD  ( H 2|=  5 X _WRITEY 6 	Z ¾Ÿ fÆÂ,ª ÞÓ ; À™  N @   ç	¦ µ6Truà!if’² ž
z 8 T 3if  
0 » é ’_replace(ê=  i 
÷ ¾î C Afd] Kw qq|timeoutcòis shared between poll() and e ï# ñ has a different signature9 Ãhandling of € ¦ parameterO  ‚ž  j T
;; =p È  'el9 O<= 06 IJelse& #é Ê  resolution´ ñ
1 millisecond, round awayþ| � õ
# zero to wait *at least*ù F s÷  7 Û ¤math.ceil( V* 1e3@read=[Òb"fd:P_listi*1or.È_ Y XÏ Interrupted ð… ù cfor fdÄI in € 
iæ×B & ~ê¨
A  /E #|=u'P * Q À_READ

       òkey = self._key_from_fd(fd)
"  yif key:   ðready.append((key, events &1 . )M qreturn 8 ñ


if hasattr(select, 'poll'):
m ±class PollS  @or(_ DLike )˜ 0""" `-basedØ ‘ector."""N  ³ _i bor_clsý @ect.v $ ¦EVENT_READ" lPOLLIN$ ZWRITE% ?OUTÛ ef Ü E Ë Ý - Þ  y » 
ß Eà & á  L   def filenoÃf�  ðbz.0 )ä (  F  F ë, timeout=NoneT $if @ is !  L   ? U = -1ø   'el? O<= 0< 	0; .se. !# ]p_wait()Ïù a resolution of 1 millisecond, round away_  ž  # ‚� zero to T µ *at least*÷ J -s.@ ÷ ¤math.ceil( p* 1e3)  &-3zw 	Ä Âexpects `maxÂ`Ž ñ be greater than¦ ;ƒ �# we want/ �make sure. 3t `ßû	)` can be called when noI  FDÝªregisteredì ñmax_ev = max(len5p._fd_toÉG), 1^ ä sY = []j /tr× 1fd_ø R_listÝ%f.9,W,ƒ 6_evã m þexcept InterruptedError> � 	˜ cfor fdOI in ” I °  Ð
´ � "if•B & ~….Ç.ING  0 K 2|= ã	�  & V ?OUTW  
‡ W ’ , –  Rš5 ž     œQclosef�Ú( 
„super(). ÷0dev
D  ÐSolaris /dev/O À"
        _sñ elector_cls = s £.devpoll
  ¶_EVENT_READ% lPOLLIN$ ZWRITE% EOUT
' õdef fileno(self):  l `return‡ 2f._� 3or.0 )F _closeE  X > ( )h „super(). À

if hasattrS ò ect, 'kqueue'):y qclass K S)„or(_Base GImplÒ 2""". `-based× mB."""S  ô  €__init__| ¬ $ Ë 'el,z½ (5K #©  ‡ {qregiste+!f,Ðûobj, events, data=Noned 0key¡ }F  • @ 
æ :try* ³ #ifr 6 & ¢(  , 0kev{ ·!.k© ƒ(key.fd,˜¡.KQ_FILTERé,1 C  ¨ ? jEV_ADDº 6  s–þontrol([kev], 0, 08 á _â 0H ã mnexceptÎ ò,un##Yraise«É:keydN  Œ·¤
5 ¦
ƒ 0if FPs‡ƒD	jDELETE¤  ‚@   —¸Ž OSErrorÀ X ñ# This can happen if the FD was z©d since itÂ @   #* ?ed.& Ipass ”ò¬ •D 6–…ðSee comment abovOe.
   Ipass µreturn key
 õdef select(self, timeout=None):(  `  0 =  4 if- 2 is “else max(+ I, 0)C @# If! 0_ev5 ô
0, kqueue will ignore theZ û. For consistentM Ñbehavior with8 SotherÒ  : ûlasses, we prevent that hereM `(usingž ù). See https://bugs.python.org/issue29255B 0max× =B A(lenQú ._fd_to_key), 1©ready = []I :tryy } kev_list =Þ 2f._¶°or.control(•,} 5_evÈ
q þexcept InterruptedErrorn +¡ 	œ Pfor k½ H’ > @fd =& <.id´ Ë Cflag! ifilterb  " ©]s = 0 2if @ þect.KQ_FILTER_READŽ Q �|= EVENT* [ _WRITE\ + b     keë e.º_from_fd(fd¤ ,  if¦o ”ã.append((key, /&5 . )U 	Ðù  ýQclose«îª f( 
V ‚super().D @)


R ó _can_use(methodW €"""Check7’we can usìd 0 deÕ  …@uponÐ« `operat ±system. """ ñ# Implementation based > ¾ôgithub.com/sethmlarson/u çs2/blob/master 1.pyd )   = getattr.Rect, á ,üiN orà “Æ#ºôect module does not iÅ R x  ·BFals®4# cE &ðOS and Kernel actually supporêeR ñ . Call may fail0f B# OSñ [Errno 38] FuncP	ž !ed3 	ŸB_obj›bector( Ä #if„ ¦ == 'poll' ! Ô ˜   É JworkÄp .- (b \  ¸  e+ m,50dev " fÖ  Š   	a Ù    �2Tru�PC( ¸ƒ

# Chooî7besò·À, roughly:
#? ® ||¨ !> ¯ >EÀt.
# select(ð\) also can't accept a FD > FD_SETSIZE (usually around 1024)
if _can_use('kqueue'):
    DefaultSelector = Kq  S 9
el> _epoll= E < 0dev > D! @ = GPoll: /seá %  ðor
"""Manage shelves of pickled objects.

A "  óf" is a persistent, dictionary-like5 ð.  The difference
with dbm databasesL òthat the values (no ±keys!) in a› fý³
be essentièãbitrary Python} ås -- anything c "Ø €"
moduleQ q handle® ðis includes most clas ñstances, recursiveÄ @
typ %an*€ containw 1lotM´shared sub-P â �
are ordi@p stringpÁTo summarizeàinterface (key:a/ ,�  Cn ar
l @):

é  aimportM%ve 3d = ð.open(filename) #  !, ¹0(g)¼  an¤ Fffixc ‚d[key] =“ ‚  # stor/@ at » �(overwritl"ld+ %if‘  «  @# usP€an exist Ekey)1  P s |  u ð retrieve a COPYÓ c) † Fraisq   á# KeyError if ê  ch¿ )ú DNOTEW%is‰  9  #ª�ss return9d*copy*‘ eentry!@ Cdel BG s# delet?JdFÀ s§ E :  #Á * `flag =Õ  f€d # true/  - «pà @listi.º(!!a  iof allŸ—s (slow!)ƒ.close()ž !#  ò it

Dependent onð�mplementa],+  ú|{p may
or  B�be necessðto flush changes to disk.

NormJ,y«:©%pneeds cºÐwhen
mutable % @ies    Àted: for exaÎ ,[àF <,� 0.ap
ñ	(anitem)
does NOT modify i y± ¢itself, asldÍ Á¤P
mapp=@-- ib"lyO  ®  +  •p, whichHôthen immediately
discarded, soù"e « 0 ha¢ ð effect whatsoever0o% 0an
Ñ {©Ú waÓ ’at will aC  “ ð persistent mapp³ing, use:
  Ùdata = d[key] ö .append(anitem) +  4 ñ-ata

To avoid the problem with mutable entries, you may pass/ ñkeyword
argument writeback=True in' ñcall to shelve.open.  WhenS 
Ð ( =( «(filename,\ 0)
t@ ðd keeps a cache of m ³ _ ²access, andD ¼ m(  « 1
to¦ ppersistÇ �mapping wc  ö Â ðd.close().  This ensureO óat
such usage as�ƒ` works ðintended.

However× s S S €ñconsume vast amount
of memory forÐ ÷ !it¸Umake Æ à very slow, if+
+P manyJ d'ä ýp after » ¦ "itÜðis way: d has no ð  to
check whichI  [“E areedand/or3 3nes‘ atually' pte, so Í 2ustñà w ÍA at ¦,à of
| @thatX  é ³.  You can á`sync()¬S  ¾%heF Ö2che€ Pemptyj • C (d.J Palso  €hronizes· kñdictionary on diskŽñ'feasible).
"""

from pickle import DEFAULT_PROTOCOL, P  Rr, Un+ r8 $io4 “BytesIO

D Qcolle� õs.abc

__all__ = ["Shelf", "BsdDb $Db”  `"]

cl _C'kdDict(a ".MTMa)Èq'Markerºa¿ d A.  A¾@ atteñs raise a ValueError.'
Ü3def< Ã(self, *argsc  .; 9 ð ('invalid opera‡ „?d…"f'7a__iterS__len
 0get[ s 5del ckeys =� ­ �__repr__¯ ¨ ‚eturn '<H I#4>'
e|_‚"""Base ž  ‰f le·û "s.š Úâis initializeda“‰ Ñ-like object.~1Seeðmodule's __doc__ str2 w ´an overview 	RrfaceF "ì ¬ Í __„  ,~ ,¢™tocol=NonaFalse,Œ  A  ÷keyencoding="utf-8"l *.k 5ict@ %ifk @ is n ­Y 1pro‰ - =ŠE ^ _*  
" l¾=¢  # Àself.cache =S {}
  ÷self.keyencoding =  
( Ðdef __iter__(1 !):  C �for k in  P.dictN 's(#  ' áyield k.decodeE  ( v )i >lenh ¢return len=  j 	6 ƒcontains; ,Ç … @ Akey.u „  	Æ ‘ 1gets R ç, default=None`  ifq \ > š  @U[key][ q ‘ Ÿ__getitemë :tryb rvalue =£Zcachei ú except KeyError= ±f = BytesIOä @ ì %])Ã  à ~ úUnpickler(f).load(( "if¡ šwritebackˆ  K  $.Á 1 = ] o 2  »s0,; 
Â` €  | (Ù Tp = P÷ ,á —_protocol' a.dump(¹  s  éo� = f.get> (?del)2del’ d M ƒ]E - Y
HpassÕ/enaÔ 	. 5xit CtypeÑa, trac@Ü > h.close    + ‡ @ is è
Š’ å  Q [.syncá)  P-  l Ÿ    AŸAttribute   + K 	   kfinall�# Catch eáñs that may happen when  ó õcalled from __del__î  b ð# because CPython5 @in iÂùpreter shutdown.: P = _C¥[dDict>
Š � A! =¬%» ¶
á±not hasattr 5, 'ö'+  ` #ûnmð didn't succeed, so do abotherA9ingò ñ# see http://bugs.p3ð.org/issue1339007 JydetailsB oð «Ëo  ¾ ÊÛ Àback and sel§f.cache:
  ùself.writeback = False# ñfor key, entry in 5 M Š.items()U  `  $ r[key] =9 	T   	w :Truv " d U = {}> ±if hasattr(# Ëdict, 'sync'‡   . ñ()


class BsdDbShelf( 8 1""" ñ implementation using the "BSD" db interface.
š ñThis adds methods first(), nex €previous  la A and> qset_locn ð() that have no coul @part{õ[g]dbm databases€ …e actual ó  must be openedÆ bone ofÍ absddb"‚ �modules "- ñ" routines (i.e. ) P.hash ,  bt 1 orB $  rn )Ú ¡ passed ton ³constructor´ 1See | à's __doc__ strq x´an overview· { h2"""ƒÁdef __init__", õ protocol=None, í=ë,¾  J  ókeyencoding="utf-8"" # #.j 
e ,;N )ª 	ó ©) g (s‚value) =s Ð .: Ekey)Á Âf = BytesIO(9  preturn U q.decode#.ë ÷), Unpickler(f).load()³ É « ¦ # .« š V[ž   ™ .1 £ V ‚ >    . � V� ~ œ - › Nª¡Dbfilenamew¯Ðdbm" generic 8=¸0is 7Áialized with™{  Š ÿ B z.@ ÄO… Ï, flag='c', ÒÅÐimport dbm
    þ<Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)


def o1 F='c'4 W=None9 �=False):
‰ ñ """Open a persistent dictionary for reading and Qing.
> DThe ¬ ÷ parameter is the bas  J   ¡underlyingC @data) ð".  As a side-effect, an extension may be added toc B �    Âmore than on} 8  created.  ¶ !opâ laG ¿ "haÀ ð same interpreta1    —ñ !ofC À*).e ¿3 �specifiek > v�Pon ofÛ u pickleúr Seß ðe module's __doc__ str¤ f ý tverviewM Æ Qface.k 2"""Á”return DbE˜€KFñ)
"""A lexical analyzer class7ñsimple shell-like syntaxes.€ 1# MÅ Xsdocumenfðby Eric S. Raymond, 21 Dec 1998
# Input stack÷  ûóerror message cleanup/ Q ñSR, March 2000
# push_source()† 6pop ämade explicit B @Januô2001.
# Posix compliance, split(),“1argÛ sÐÂd
# iterator\ – ^ ðGustavo Niemeyer, April­ 3i Pchang/�o tokeniz1re [‡ lsN ôVinay Sajip, July 2016.

import os
 $re
 ásys
from colle#s 0 bdeque
 $io Suñ
IO

__all__ = ["shlex", "
 	 Pquote	 ‚join"]

&) ˆK&ÑKdef Mƒinstreamÿ inã pµ,@   apunctuðb_chars* 2 ' Pif isa  ò(	  j ò& * † 4 = -0 ){  P ) pis not µ G    $.l 4 =  F %  ì #  	 ! OelseT •sys.stdin4 U  š  • O1 =   "if r  Qeof =ã . œ * %''( q 0com-‹ers = '# Aword¸ö = ('abcdfeghijklmnopqrstuvwxyz7  å 
 ù'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'Ã› ó Àlf.wordcharsÿ< += ('ÃŸÃ Ã¡Ã¢Ã£Ã¤Ã¥Ã¦Ã§Ã¨Ã©ÃªÃ«Ã¬Ã­Ã®Ã¯Ã°Ã±Ã²Ã³Ã´ÃµÃ¶Ã¸Ã¹ÃºÃ»Ã¼Ã½Ã¾Ã¿'
    	õ0'Ã€Ã�Ã‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃ�ÃŽÃ�Ã�Ã‘Ã’Ã“Ã”Ã•Ã–Ã˜Ã™ÃšÃ›ÃœÃ�Ãž')_ ÿself.whitespace = ' \t\r\n'$ ê_split = False& `quotesF ;\'"B Qescapb /\\ d> < Astat;  : úpushback = deque()‘ ªlineno = 1 šdebug = 0 Ptoken¿ g ofilesth Asour?6Nonõ
if not punctuation_chars:v  ä 
� NelifC � is TrueK {();<>|&Ó _w  © „ 
| 4# _Žæ  £  a   £õqueue used by lookahead logici  –N â + �# these X@ add^ ðecause allowed in Áþ names, args, wildcardsz BwordP ¶+= '~-./*?=?w ¨remove anyœ‡ Ufrom F 	a  9ß  ð.maketrans(dict.= ]keys(�)Ý „ 
G : =  .T �late(t)
… ‘@property /deX (E )Úbreturn[ 3W I 1sh_?B W, tokG p"Push a pen onto¸ T@popp·y 2getI � method"­  ñ "ifˆ ½F>= 1¨    Ñprint("shlex:y3ings �" + repr(˜ H î .£ ¢±.appendleft' Þ äß ànewstream, new_=ûó ‚n input > û zlexer's .ò ·isinstance(t 7strk  ý  ¶ = StringIO2 ò  ° l ó Ú 0.in ,j { å )N‡ 2 $ =	° (   
" V 	¤	ê
å Tq ` _ x
$  'i%s' % ò ×  @ ;els]  V À to stream %ñs' % (self.instream,))

    def pop_source% !):   ò "Pop the input % … stack."& 	Z ….close() T ™.infile, ,  ’lineno) =  ) c wpopleftM "if$ Vdebug¨  ¬ Ðprint('shlex:Ô Àping to %s, c e %d' \˜  4  d  4 6no)Ê ¼ ¶state = ' 'B‘get_tokení AaGet a  X fromNŠB (or ô ö if it's nonempty)hý Špushback 4tokB! .A ò H EZ >= 1J  $ N"N÷ken " + repr(tok 7 `returnð hU# No ’ '  .% 4raw½ CreadM{p# Handl‰…clusions< Ï ži<jt None× awhile j j2 
&  Æ Dspec� $ AhookÜ.Ÿ    6    Œ >pecS   @(newÝR, newˆõ5pecÍ  (  p :ž7 B  K ‚ à Á–' ð# Maybe we got EOF Eead?„ ):eofÓ bif notg  ˆ ¼
#  Æ É 5eofb   ;els¡  + ‘º     á £Neither in+@ norê   ¦ !if'!'þ  ‡ 
!á=;rawî E FEOF"ö B6rawnƒ /oåquoted = Falseð xescaped» Ã   ì;TruŒ#òpunctuation_chars andø_› ˆ þ@next4 K1  žÛ Ž &H  ± ÅŒ&(1- C  šx n= '\n'š  7.àU += 1*B   3A 
¹ inÀte %r I see ÷ ¥acter: %r"‚,n  r  f¶àstate is None:+
  ô self.token = '' ý# past end of file: Ybreak Qelif Q Ùstate == ' ':$  a þ if not nextchar!  % H � None  #� 
 5 ”   ˜ n 2 in¤ ¯whitespace� Ì ¯debug >= 2(  b öprint("shlex: I see `  s  -") I u ’Aor (ÿposix and quoted)‹  -Ámit current Q s ?els ‘ ~continuÿU¯commenters¢ Î ÿinstream.readline(-    }no += 1¿ „ & !è_escapâ  d’  -a'd  c % a * Ž   ô7 @wordæ	�% =[ … 'ª  € Ïpunctuation_ˆ @c2ˆ ¹0Ê=0—Z­ y ¢o_split„ + € °ye 0“eEƒ od = Trz .Ó:ð­ $ ,Ñ%0EOFÖ� !s Ê Æý# XXX what error should be raised here?� ¦ ! p ValueE< Á("No closingþËy   R zD¥ À:
            õif not self.posix:
 	 $ ÿtoken += nextchar/ ¿state = ' ') _break Oelse� a aa aelif (· Û E and¸ 2 inö aescape + R �  4 �dquotes)£ X dO " =l  \ {  \@ �( ‡ Í Å é:ß# end of fileË "ifí ®debug >= 2\ L ð
  print("shlex: I see EOFœ @ ¬ /")j ÿ# XXX what error should be raised here?< ! p ValueE< R("No t  d Ù_actery  R# In Pñshells, only the 0 itf1 or T „ #e @ may´ * ‚d withinM -s.:  Õ+  - q .~ sÊ4 pÍ( !’ 3 $!=_ ßr q / {  ) � ' B  € 	* Ä Ÿ('a', 'c'©  Ã	L ¡ z None   æ¶  ä ™ŸwhitespacÎ2-`  s Oword7
	ñ š” º-orIndu X"LÁmit current Q ‰Þ S ~continutt¯commenters~ÿinstream.readline(i-     noü1¿ 2u  È L o~ ) P 1 NË‚ F †À emit currenŸt token
  _else:  5 �continue% ÿelif self.state == 'c'M âif nextchar in6 Àpunctuation_ s;  „ f É 5 +=J ’  + Ñ ˆ 5notŒ Ÿwhitespac‰ ’_pushback· „.append(á )˜  œ > -O ' ') ]break q•posix andÊ _quoteK	€ ¯ g #_escap- dé aé Ž \ç Aword5? orÚ  „ 1 (| õ`_splitQ4  : 1 9Å/))Çr Ã¿mr p  ² t ®"‡ X ÿEleft§Â ¯debug >= 2» ÷print("shlex: I see ú    e"p ÿ ! / =o• ›2or bQdÖ ­ÿ   # emit currenx	]p‚result =6¨ ¦ã   ã hÖ Ç  µË  ç U ;= '³ F NonõQ ¼* 1»#ifR 
  
Ê2raw’¢=" + repr(q )Ä$L 7EOFcreturn‘ 
,ádef sourcehookã—, newfileÛð"Hook called on a ! £name to beD 1d."V  ß RH 1[0]"Qg  ¹) U1:-1]B õ2# This implements cpp-like semantics for relative-path inclusion.J ðif isinstance(self.ðinfile, str) and not os.path.isabs(new$ G):
   % =. Tjoin(; Òdirname(self.e 3), 5 )J treturn d f, open a"r"))
. ñdef error_leaderZ ", [ Ñ=None, lineno ® ò"Emit a C-compiler-like, Emacs-friendly^ ’-message f !."}  ø #ifm @ is p 
‰ 7 = ò < œ <  <  < #r"\"%s\"å ¢ %d: " % (w  'no,�__iter__(O  ¦ Yn__next- TtokenÔ Aget_ (À1if  # =½ :eofüraise StopIterationÛ B  

âósplit(s, comments=False, posix=TrueÌ @"""S- @ the¾ ing *s* us
 Qshellç¢ syntax.""ËNif s†õ import warnings¢  .	 Q("Pas_  ÿò for 's' to shlex.½ )^ Õdeprecated.",N  G D$ BionWx  ‡¢acklevel=2f0lex� a     Á.whitespace_„ 0 = *x !ifÓP� ²  �ers = ''1 !¢list(lex)
šÞ^ _6 6and‰RÆ"a wtescaped–ifrom *; *�n A' '.b ¡quote(arg)`yarg in =  ’ ó_find_unsafe = re.Üð(r'[^\w@%+=:,./-]', ÒASCII).searchÑ j sÆ «version ofkÄ cs\Ö 5"''u² !(s% F4 s–`# use m1le « !s, :put ¥ into doub* È#¯ 0$'b—BthenN Ùd as '$'"'"'bùñ	"'" + s.replace("'", "'\ ƒ") + "'"S_prins.#erPvwhile 1ß ¿tt = lexer.I z&tt2  *QbreakÏ   n 0("T– : § prepr(tt%Pif __t __Ž¢'__main__'R ðif len(sys.argv)$ Ÿ 
Ê Ð"()bBelseD  „ fF 5[1]� Bwith¿0fn)^	b ðf, fn))
"""Utility func%s @copyÐ š » iv  �s÷
directory trees.

XXX TheH °here don't O à the resource ôfork or other metadata on Mac.

"""

import os
 &sy 4tat tfnmatch ¥collection. óerrno

try:
    Z Azlib Edel  ñ_ZLIB_SUPPORTED = True
except I• RErrorL / ^Falsen 5bz2m  O_BZ2k . j Elzmak  __LZMAm / n ù _WINDOWS = os.name == 'nt'
posix = nt = None
if% ! '9… d
elif Z 	  ò
nt

COPY_BUFSIZE = 1024 * 7 t else 6 ð
_USE_CP_SENDFIL: ð4hasattr(os, "sendfile") and sys.platform.startswith("linux")
_HAS_FŒ N » < X  “, "_fcopy] ð # macOS

# CMD defaults in Windows 10
þ ó:_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC"

__all__ = ["c~ eobj",   Dmode Dstat  12",@ ,"  @ 1tre4 1mov $rm  ; ³SpecialFile 	F CExec Â "make_archiO 4get _‚;ats… ‹register'  y /un 	‚  e funpackd % "< 	 ~ c ' # " Î 	t ð ignore_patterns¯ Pchown	 Pwhich	  ™ Ûterminal_size~ FSameW]a ð# disk_usage is added later, if available^Dthe ä�

class “1(OS )|Dpass  	| (& ñ"""Raised when sourcepdestina…P are x s* .Þ} 3ˆ b òtrying to do a kind of operl `(e.g. |Qing) `1 is0pnot supT ed2a s± –  <  a Òwd pipe)© ½¢ `a commO`could u ·be executedQ AReadMQ #n XC canO :reaK  "ryO E©3ionÌD"a ð'ry8 é¥l 1ing3 È Ý w8 —ies failsÍ þ_GiveupOnFastCopy(† À"Raised as að: signal to fallback on using raw read()/write()
    file copy when fast-c Ñfunctions faiT ado so.6  """

def _1  ?  _f  N ô(fsrc, fdst, flags):5 CZ ”a regular} óntent or metadata by¶ ñhigh-performanceI k ö3) syscall (macOS)   Þ 2try|   pinfd = Ÿ .© #no  2out :dst �except E ¦ion as errX ðraise _GiveupOnFastè Ú(err)  # not ô 
Ç 	� gposix.F ® !, — G6 � }OSError� 2err¿ 4ameí 2nam9 é ! 2"  ñ 	"  ifà ±.errno in {
 €.EINVAL, ¶no.ENOTSUP} ] 	¾  % Oelse7 Üerr from None_@sendµ^W9@ 5onecÀmmap-like fduanotherb– f n 2aYñ This should wor`òLinux >= 2.6.33 only.  ' ò q# Note:h Å ðobj() is left al± €in order¥  2Ñintroduce any¦ õ# unexpected breakage. Possible risksÙ R zeroË  sC +in† #ar�1# -µ@ can� pbe openâ"a"(ppend) modL/ rsrc and8 Hmay 5 ot"(ext3 * Ða BufferedReaû ð (which hides un¯ ×ain a b- #),Ê p  GzipFÀ8 Ádecompresses8 ÷), HTTPResponse ( $deƒ  chunks; Ø pS!y ,às (e.g. encryp}€fs/parti ?Hñglobal _USE_CP_SENDFILE¬ 	é Ø w2src©†lò# Hopefully the wholeš@willÒ`copied	 a L 22allä#-Ó m- ploop 'tG 0EOFñòreached (0 return>B# soâÀsize smaller@bigg1hanŸ bactual   , a#“ ¸1mak41 di]�nce, alsÌAcaseH  ‡1 co{D  changes whT be6û ê 	ÇPblock� ð = max(os.fstat(àP).st_ ‘, 2 ** 23	�min 8MiBp 
ÈY = 7E%12: ð
# On 32-bit architecturesð truncate to 1GiB ñavoid OverflowError,
    # see bpo-38319. ñ
if sys.maxsize < 2 ** 32:  7 Qblock e= min( ,, 10)
- ¡offset = 0 ¦while TrueL 6try  ] 0sen2 ðos.sendfile(outfd, in T %, u )\  ; ‘except OSã z as err^ À# ...in oder°have a more` ’ormative K 2ion ^   @err.“ Àname = fsrc. ƒ % 2& 2dst& 	'  ifŸ �.errno == ºno.ENOTSOCK·  W  ­ð) on this platform (probably Linux·V.6.33 D   ð# does not support copies between regular ê ys (onlyº F Šsockets)"  ý	_USE_CP_SENDFILE = FalseE óraise _GiveupOnFastCopy(errB O   -@SPC:É¬ ßystem is fulln Òerr from None§ a    # Š 0 up_òfirst call and if no data was2dû 2if � Î06 „os.lseekÃñ 0, os.SEEK_CUR)) ê* 5errí 7els^ Ö  ÐT>= 0l PbreakA5EOFE  7 Ë 0+= ’°

def _copyjÐobj_readinto(ò, fdst, length=COPY_BUFSIZE)u 5"""2 ð)/memoryview() based variant of^g (`*f V* mus·P q methodtCboth». bxòopen in binary mode¿1"""ù p# Localô‹  ble access)Pminim soverheaü – 
 ì ˜ W  Q_writ1   Wwith ¢bytearray(H ))Å"mvB –C  n| Œ :(mvûÁ6t nL  8   �      el. # <Ï3 ¹ Pv[:n]¢ s£  A   ý .ð ,(s‘ ª 6  2 /Â wvm0b * ¥ã «Á-like object± Î ?dst	* 1-ot1È8 = l:º.6 2dst  2C Àbuf = fsrc_rÓead(length)
  µif not buf:   Ubreak òfdst_write(buf)

def _samefile(src, dst)D ñ# Macintosh, Unix.I Ãif isinstanc4 ðos.DirEntry) and hasattr(os.path, 'e Sstat']  � 2tryj     sreturn 6 .4  ™ .= 0(),   ¨  ïexcept OSErrorV dFalse
Ã ¢  ¢  4  ¢ ;`  Ì ’ ð# All other platforms: check for  LBname‰.e•.normcase 0abs2  � U)) ==œ    e6 a$ctat(fn½z #fn– !fn§Eelse¹$fnU oislinkW ais_sym )]  ë .S ÝIcopy¡´, *, followc cs=TrueÛ ð	"""Copy data from src toò in the most efficient way possible.a,Ifd 1 is¢1set" V àis a symbolic î q, a new©ð will be created {pead of Þ 1ing•  æ Ó it points to‹ 3"""O ðs.audit("shutil.>  6  ",ä ¿, i <áraise SameFilesa("{!r}Û 	 !re— ¸f .Ô atŽl ),  ‘_size = 0  ðPi, fnq´enumerate([ ]¬ ‹ Dast = _# j $   �	 # Ç ×¢likely doe°Qexist–  F   Epass  Ú
nó# XXX What aboutÕ€special î ös? (sockets, devices...Î g 0if Å ô.S_ISFIFO(st.st_mod« &  qfn = fnn1%fnÄ D Ö©  Ù@`%s`¿ a |¨d pipe" % _ D  6qWINDOWSji == 0 (  ñÕ  þÈ¡O _Ü7src 3os.) ÷@readH e)fç 
§�with open' ú , 'rb') as fsrc¯ ^ À ? tdst, 'w? :dst?  .   q# macOS‹     6ßHAS_FCOPYFILEC À     try:
    °_fastcopy_f ÿfile(fsrc, fdst, posix._COPYFILE_DATA)
O ß   return dst' ÿ
except _GiveupOnFastCopy:2  q Opass! # Linux ðelif _USE_CP_SENDÆ h /tr… 0Ksend/ÏWindows, seeö ó# https://github.com/python/c ÿpull/7160#discussion_r195405230yÀWINDOWS and -Ÿ_size > 0�  ç_ˆÉobj_readinto”Emin(M  , œŸ_BUFSIZE)ƒ˜± w n ))
- ò# Issue 43219, raise a less confusing à9ion<  ÿ IsADirectoryError as � ÿif not os.path.exists(dst)<Œ ÁFileNotFound^ 5(f'o Q doesV N ù: {dst}') from e®  ‹?els™    m X@def HQmode(FEó*, follow_symlinks=TrueÉ 0"""ý 5 R bits� `src toH.i ,IfF " iÎ Tset, [ s aren't, Qed ifAonlyâ Ñif both `src` P`dst`8 E ð.  If `lchmod` isR ‚availabl)R(e.g.zÕ) this methodeChing» 1"""{ ôsys.audit("shutil..4", 0s 9° 0_isF b) % 
%òif hasattr(os, 'Õ '~ Î  ±stat_func, õ    =€l ,
  Ë  4  ! 
  C S _ _ \ [ ; Pst =  2 ç  #  X # ð .S_IMODE(st.st_EM))

õ @istxø  «k  d ,l/, ­ ÷ ±rextendeÚpsystem c SibuteÆe1to d E ¡Overwrite Œ 7< (  ‡ �g falseö wo£%beøÀ.

        "S""

  Etry:   ûnames = os.listxattr(src, follow_symlinks= )G úexcept OSError as ed ñif e.errno not in ( ¥.ENOTSUP,  EDATA jINVAL)L  ´ Uraise  Ueturn @for Ù  k   sD  C Rvalue	(ge A  L   Dos.sH Adst,‘ !, g O a p eEPERMTr: J  ¤• 6 ™3els’def _copyW°*args, **kw
 Ú`pass

/  . Bstat„9*/CTrue? ò"""Copy file metadatañ óthe permission bits, last access time �modificat*  1andõflags from `src` to `dst`. On Linux, ½ `) also @ies ƒ ‚"extendeN  fòibutes" where possible. TheÍ `conten¯ òowner, and group ar ³unaffected.—  $ ˜  $ ñ path-like objects or Ž¡s given asã ‚strings.=!If¸  op0al + `A` isÔTset, + { 1n'tU 1 Qed ifÀ @only Oboth³ E .? 1""" ôsys.audit("shutil.l1", ¯Bdst)º  GS_nop(p~ns=NoneF  F ¾… 
 #ýÒ ¡(aka don'tï Ö   == : t ø@(_isK Û) s.¢.  Ã K #ifE ¹Q# use“ re�0uncš L‚it existÇ Á  plookup(¿å   r.@ getˆ4(os� 6� Ä 1 | Í� ó# *and* it supportsÒ Ø ^ ­ Ofn =« 
 C    4nò zt _”t O 2   f=  TÐif isinstanceÁ,2‡DirEntry`@st =‘.Å Dc8 ³"< "")g C 	0mod³ / ð.S_IMODE(st.st_mode)
    loðokup("utime")(dst, ns=(st.st_a R_ns,  m C),
  òfollow_symlinks= )  ó4# We must copy extended attributes before the file is (potentially)H ðchmod()'ed read-only, otherwise setxV ñ() will error with -EACCES.J _‰ * Qsrc, ð ³ Ã Atry::  ï "lo.Ž .omode, D 	ðexcept NotImplementedE¢ [ ß# if we got a+ P, it'0Ucause“ ]#   *~ VFalse¤% €lchown()dûunavailable, andP  eiZ	   1* fD -atF ? or/ ”doesn't iò AT_SYMLINK_NOFOLLOW¥ k  ³   ò  (it returned ENOSUP._   #;rEðwe're out of options--we su ‘y cannot Ã  7 ± ¿ð.  give up, suppress* Pž `(whichK÷what shutil always did in this circumstance¸ Apass€ aif has¼ |¶'st_flags')	… ö ‰, ‹¥ ’ D –!OSŠg as whì # 0forú  Ì ò'EOPNOTSUPP', 'E '¤  0   Ð `errno,B )d ` . q == getõ  % M  Q Qbreak+    Nelse, ¡raise

defn(à*CTruea@"""CžAdata§  Ñà bits ("cp src'Q"). R‡ ­ 's destinak!.
¥ 8The ó may be a directory) ,If· Nfº �@s wo5#be, red. Thi;ðresembles GNU's ® %-P± h asourceÝ ± # ay2sam~Â, a SameFileMboadV 1"""ï ðif os.path.isdirBY «Udst =" @join! , €basename®)Ö ¢ ^  ¡
±8  »8 \ ã=2E >0etaK.M.  ûbcopiedµ  stha. Pleaã' P funcyˆ «mJoinform’Ày be a direcõtory.

    If follow_symlinks is false,  ƒwon't be, �ed. ThisB ñresembles GNU's "cp -P src dst".% 1""" ñif os.path.isdir(dst):  Ž Udst =" @join! , ábasename(src))7 qcopyfil ,r ,¥ Ñ =á 8 @statK 8 `returni ô

def ignore_patterns(*
 × ð"""Function that canJ€used as À ctree()K £ parameter£P[  ™ô
a sequence of glob-style v h Aare e °to exclude )sŒ ¾ _¿  › , dsÁ  ˜& !d_ Q = []h   4for} 4 in sÔ % 	@ ñ.extend(fnmatch.filter(\ ,A Þ = rIset(H È É �_^€entries,˜ïÞ,y,Œ#_f®,ã  …  % •_dangling_ð, dirs_exist_ok=F<<i  ¼†not None	Ï # =c `(os.fs‰ œ`), [x. kxeÍ ]?elsT  7)ìpos.make¯ W´   Â V Vrrorsìpuse_src{ :y =+ Þ  jO2 or �  Á D 0in M 'ie, if   yó #in|< •…continueª1src*D1srcùY ä  D ?dst3 ?dst3 …srcobj =¬ 0 ifk  “   Z � :try¿ $isEL . (¦  ª  M2 0and b Š == 'nt'^  3 ñ # Special checkBPdirec# jêòs, which appear aÙ A  #òbut we want to recurseç/   l^Ù   (Œ.$ 9   1if @ ð .st_reparse_tagê  G þ.IO_REPARSE_TAG_MOUNT_POINTP 9!= ¢	s 	[B  "toš@read  œ }
¤l f-K  ! @# Weñ 't just leave iO`H„ù` because legacyµ  K   ü# code with a custom H Ðmay rely on cŸopytree
   ÿ	# doing the right thing.- °os.symlink( Ïto, dstname)0 õ copystat(srcobj. “, follow_N ds=not  L _else:b à# ignore danglÉ F 1 ifÔ ¯flag is on@ 0if { ãos.path.existsÝ S) and` _` ³ �  bcontinupÀotherwise len e 'q occur. �2 will ra% �an error¿ ÿsrcentry.is_dir()™ 		�5#s,ï ,n  Ý   µ ñ_function, dirs_?I_ok= Ð E Ô  	^ ° 
Q _elif  S  N ,yþ †Ý 	è ö 	î 7# WéÐ SpecialFileEóý for unsupported file types“  Þ ² ã 1q# catchd 1rom ‚recursiv� *æ so that we caA$# ãa with Ò� ˜ rexcept d  asÄ
™Õös.extend(err.args[0]­ D %OSF ?whyF 0appF  ø  Ži’str(why))W 'trA  4Ÿ3 $ w `# Copyk�öaccess times may fail on Window‚if getat‘ a, 'win€', None)§ 	 â « +, Ú  ifd6ors? A= a2orsá `return»Q

defî ð ?] çts=False=Ÿ ,0 l=F21•5O 
8d ¸D"""R‰!lyk   a^pectory ¨ ˜Å  ¸pdestina‰* !.
$	j Ð dictates whe‡7 tog³°ion in case"q or anyL @missøfparentk ‘ already  sz 2If Jbion(s)áC, an"is{ dE÷a list of reasonG  ä  opß %al­ ÚAtrueÄ`bolic ™ð s in the
    soðurce tree result in symbolic links ñ the destination1 ð; if
    it is false, * ±contents of õfiles pointed to byd B h Öare copied. I: 9 !byN 0sym0 � doesn'tA ñ exist, an excep¤ Ôwill be addedÅ @list— ±errors rais F @an E E !att 0end6 Ý Ápy process.
8 ¢You can se. o� óal ignore_dangling_» `s flag	±true if youJ @want Psilen™6hisŽ a. Noti ˜ ñis has no effect onF óplatforms that don't support os.‡ ¾ KThe ² � argumenÙ¡a callable—‚given, iy!is qed with,ð`src` parameter, which# ?‘directoryª  being visi by yŽ ()Îšd `names`D ÅB n rÐ, as returnedg0os.. bdir():® ³Ò a(src, d C) ->±!d_ /  Si‰3cop˜  É  ? ãed recursivelyù) |¢ - oG •for each £ GútÁ 1s a@  À  }” � relative& P O ashould> 0notXÓ 	ò Ú Q_func5ù¥ Õ B use\ !to°Ò  åD. Itü !sol€path and,¢ X s€ás. By default,n 02()ƒ … ‚, but anLÄ õï ñe same signature (likkAy())º!beÖ 1"""š ðsys.audit("shutil.- Ÿ1", :Adst)+ þ [0canm@src)ŒAitr:!  v entries = ÔB(itr= ±$ _^ () = m =q  =dëÄ$s=	 ,g  k  ƒ= Bî=q  A 
ÄS  H Qdirs_¨I_ok= P)

ifËPattr(FBtat_�`, 'st_]_ ‚ibutes')Uà# Special handc bjØs/@makev�m behave 6#� Us@ í rmë1, s in generalD Py do \“appear asI rregular;. Rdef _M 0_is ØyÄ  ª2tryÑ     Qst = & Å.stat(follow@ =Fm= /   E(0 ñ.S_ISDIR(st.st_mode)tðnot
              û0  (st.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT
   Band O âreparse_tag ==L %IO@ ’TAG_MOUNTJ %))L õ except OSError:  j Ñreturn False
 ö	def _rmtree_islink(path)8 6try  E �st = os.là . K     e ( ƒ.S_ISLNK$‰mode) or0  4   DžBelse
IŸdir(entryI	)( @.is_5  follow_symŒ!s=«ÝGƒ 0os.ö.ø

# version vulnerable to race conditions
û aunsafeP, one„	I@withE@scanø   S) as  2_itX    &¶ies = list(' öƒ C(os.3  , l ø , sys.exc_info(@2ntri ![]¨@for ~ Ay in	 6iesœ ¡fullname = yI8  ¶ i^ è I  !   	    #ifP $is(8  '   õ# This can only happen if someone replaces˜  7  á# a directory ™#a �ÿ after the call toC ` /Ó above.8 Traise«‚("Cannotj ”A on � `bolic "ñ¾ ù   øã$, ¸	B ‰continueÂ 4ðN p ¥ #Q ðPos.unà (L C  9 è H ã 	† Pos.rm  $y q á  R3 PC
# V?ðusing fd-based APIsHñ protect againstX
N L”_fd(topfdi � 	Ç ½‹8 W7  ðerr:
        erró.filename = path
  ñonerror(os.scandir,! õ, sys.exc_info())2 areturn Áfor entry in	 Aies:  ^ Cfulls 0os.v `.join(
 ,/  y.  [ 6try?  C ƒis_dir =.  ö(follow_symlinks=FalseF  except OSEÚ Q 4 « Kelse) "f n 
  • ¦     uorig_st¯ Ostat­  8  q 0 = 9 “.S_ISDIR(V w.st_modè 7 ð 	$ çl^ $, žé<   …continue2i ñdirfd = os.open(3û, öO_RDONLY, dir_fd=topfdÐ € ä à  c ß ø m Å    if°  ÀP.sameIŸÊ f ï .))9 C   ñ_rmtree_safe_fd(1 ³ Î 
 :  ¢ ! ‰os.rmdirl_7   k $  ©  >o Å @<   €    æ õ# This can only happen if someone replaces¸ X  0# a{ãectory with a ^ÿ after the call toK I9 orÊ above.@ 
Traise»‚("Cannotz 52 on� bolic "N 

é "."Uù$ is] ÿkfinallð± ‚os.close³ 0$Pos.un‘ ÿú çX é 	@
_us×ó _functions = ({ý( '	 N ¯O} <=Ò Waupport_fd and, ð candir in os.suÿ pports_fd and
  °os.stat in  u3 ñ*ollow_symlinks)

def rmtree(path, ignore_errors=False, on q=None):s ð"""Recursively delete a directory U !.
- *IfX ‘ is set, W Ss are!  d; otherwix $if{ G 6  itA òcalled to handle theQ ñ with arguments (func,C å ðexc_info) where    S €platformY` impleA õation dependent;I  3  u j  Œ AthatP 5  �caused it  Pfail;` F ‰  J ô	a tuple returned by sys.$ \().  JF @is f© W 1 R  ¯¡, an excep‘ “is raisedš1"""C  i âaudit("shutil.0", 3)% iÇ
 € G%c(*args&    ApassC &elÔ£ G » H °if _use_fd_½ Ü sH S# Whicunsafeåñ works fine on bytes,9Pfd ba§‘does not.h  ½  ÷ „sinstanc': å @th =qrfsdecod- < I ð# Note: To guard agaX  ‘@ rac� Rwe usÐ u 6darç0# lÚ²()/open()/f f trickµ 6try } rorig_st¡ D Ú ! %$ E,? A(os.= ,¢ì  R ÊH“ "fdŽ Ê  � ,=†O_RDONLYL š  I ™ 1 ¤ s.’ Q.sameb@£ t;fd) õ _9_vd_fd(fd’ !Ø  /       �os.rmdirœ8 0OSE®
° ?   u  ¸K �  ñZ
\ NelseN ¦ #Àsá"ieØõ	forbidden, see bug #1669 ¦  á Ñ �("Cannot êÁ@on ap `bolic Ç"½  K é isM lfinall[¢s.close(fdŒ 
A9 ½&v àsZÀ to directorûies are forbidden, see bug #1669
  õ'raise OSError("Cannot call rmtree on a symbolic link")G dexcept@ :  f 1oneU  os.path.is=  ,  ö, sys.exc_info()R  : ó
# can't continue even if S Ù hook returnst    " _Ë ‚_unsafe(� L ð)

# Allow introspection of whether or ðthe hardening against Ø ð
# attacks is supported? 8 òcurrent platform
“ °.avoids_symE _C Ñ= _use_fd_fun� ò s

def _basenamÆ )rU"""A  ð) variant which fir§ `trips Œ PtrailÃ `slash,Y�present.:ñThus we always get7 0las“@mponÊ !of M¡ñfor directories.
N  ! ò: Union[PathLike, str]  2e.gw D>>> ,Í ¢'/bar/foo'#' X / /0 '- ;U & V 1"""1  ¶   =�  fs 5ƒ 2sep   . 4+ (¹ 0alt Cor '‚ „! Ú >  rs—b(sep))áõmove(src, dst, copy= 2õÀRecursively 8 p a file°ˆ�y to anoÈ@locaÜP. Thi¨ë psimilar)  ñUnix "mv" command. Rjï` '�bdestin^ ØI   a"y§ Z ú ~  ,m asource¥ !isâ �d inside ä  Ð (e j  ]Q must¹qalreadyI Sexist›£  +  ' Ps but¶  þ	ž ‚it may b� ðoverwritten depend^ D2s.r®¤) semantic}   is/Dour / oasystem%n O ris used;Oß0wisY rc² `copiedV Ô0and> K  4Bd. S}:$`recrea¾Punder/ P new x .o× Ðfails because5Bcros½ · û `The opŠ@al `Õãp` argumaAis aŠ0ablñ¡at will beú ª !to"¢ . Vi* QdelegË "tok  Õ`7“By defauli02()< X,ûDany �T thatÙI2samñ signature (like” 0())Ç¯ s�A lot mor% 0uld àdone here...  " ðok at a mv.c show 9 "of÷ ð	he issues this implementñation glosses over.

    """ ñsys.audit("shutil.move", src, dst)'  real_dst =  ðif os.path.isdir(- :  a Õif _samefile(M    $ ð# We might be on a case insensitive @ usystem,\ < ùperform the rename anyway.) 2os. † 	  breturnY ¢Using _basV –instead oò  õs important, as we mustc q# ignorœ ` trail] áslash to avoidÃ S ‘  & %''G �v@joinu,«  ã &))Ì ¤texists(H )Šòraise Error("Destin; àâ '%s' already I E" % L ¦ 6tryT u
* ‘except OSp 5 ® aislinkÏ    ž  @to =| �   ' „  "   aos.sym   ;to,­  %   Pos.un# 
D )elŒ  Þ;src4 âd+0src@ 0
°  e 	]pCannot fÂ a directoryd²into itselfŸ ?  "0 .†z «/ ò if (_is_immutab†
# + @or (• ’os.accessT Àos.W_OK) andpDlist	oH    ,  UAplatŸË== 'darwin')B 0 ¡Permission(("' á—non-empty3# ]  "À`: LackVuwrite pr  ‡ " .P "%   
Qscopytreñö ,  P_func�= 
Ö± 3   ¿js=Truee $rmc  Jelsey	e ° � 7  o  ‚3

def _ì2src‘ -@.abs  s i 7¶  .E0if |Ôsrc.endswith(- 7sep3 h +ú a H.sepA ?dstA  Š A  ï  A Rstart„  Þú FkV_statí n `es = [" ñ .UF_IMMUTABLE,  S ]Ë Š òhasattr(st, 'st_flags'ˆ4st. L in p ð 

def _get_gid(ðname):
    """Returns a gid, given Proup + A."""- !if ‚ is NoneB  F rC  
* 6try ñ	from grp import getgrnam* �except I VError9 W …result =P (­ )V =KeyS 5  Á + 3if J ais notÆ „ # 1[2]4 	™ Âdef _get_uidƒ > [8n u\AuserK[27pwd[/pw[;P Ø ü ±[Wðmake_tarball(base_è!,  ñdir, compress="gzip", verbose=0, dry_run=0,¾  ® `owner=0, gð Clogg (õCreate a (possiblyy Ñed) tar file ïqall the qs under€ '¶ "'.*'½ ¢' must be Æ   (@ ñdefault), "bzip2", "xz", or©F Ê q' and 'Ê P' canN ñused to define an , + aö @ for® ¢ Àarchive thatêñ being built. If#�provided,6 ‡ currentX ‚ N Dwill† ¬ ¦The output4'  Ú"d %  Õ' +  ".tar", wAplus^  "€appropriœL ion extens
 @(".g3@".bzA“or ".xz")‘  N ™  É € .g  b   8ë RDtar_  v A= ''> ñelif _ZLIB_SUPPORTED~. P == 'º'N 
(gzP ?BZ2O 	-P 8bz2Q OLZMAR 	/xzO xŸ s¡aise ValueŠp("bad v vÿÓ Aaformatp f @"supV¢ed : {0}".8 (K "))i}0tarÝP  # l3  Pbreakíòcircular dependencyD T 0_exy '. ù%ifT elseY¾" =¿ d@ + 'â L a =5 ðdir = os.path.di@$e(  G ç $f   4   ÕÐos.path.existós(archive_dir):
  öif logger is not None  &   ø.info("creating %s", T S  I zdry_runL ªos.makedir‘ 
> %# _ ±the tarball ¨ ¤ $'C¤ 4tar£ "')c ñuid = _get_uid(owner)b g “gid(group5 bdef _s3 _ 0tar
H A E2 .% Q= gidt  _   qname = } " 0if · \  % =+ : \ u\ ó " `returnk Ñ $!if
Á O=+ •file.openU \  , 'w|%s' %$ Â_compressiona� *ry±tar.add(bas›˜, filter=p@ ofinallD  cclose(°Õ ž � !

Å }@_zipÂ t   &,  ³verbose=0,   `=õ1"""hpe a zip· °e from all ¿ d ”s under 'a "'.d¦The output> €will be “ d3   á' + ".zip".  R±sb Å ! 0 of Q .! 1""" Qimporn  ™ “  # late  �for breakÜòcircular dependency¶ @zip_> u =6 ¡ j xðdir = os.path.dir+ v­$if¤ ›A and~7 Zexist-B rº¾Q� ‰ '1 ô 0add{ qto it",M Ä  ƒ¸L{@withh ¼š.ZipFile(J /"wq } Ñ=Cö.ZIP_DEFLATED) as zfž :  û@norm  ‹	å 0if  ! !7jcurdirP  T �zf.write(, ,2 " !   Ž #  	šˆ"\  )2dir{ Ôs¶eß@s inóFwalkå Ä  G  0  / tsorted(M až   r J)@joinD  ( ,DÀ))
           ð zf.write(path,  &)
 
 ÿif logger is not None:+  5 , ÿ.info("adding '%s'"d ðfor name in file s`  ¥ ` = os.
 P.norm	 ( €join(dir ,U )Ô 4  isu )v  Ö . - 2 3 6p°return zip_µ  *ñ

_ARCHIVE_FORMATS = {. ñ'tar':   (_make_tarball, [('compress',Ït)], "un aed tarŽò
"),
}

if _ZLIB_SUPPORTED,} @['gzw ?] =w ‘'gzip')],¬   "* ” -ø "Õ|  R z 0zip/ 0, [ß 3ZIPÒ Ï ?BZ2Î bÎ _bzip2Ï + 
Ð aOLZMA“ x“ /xz� ;xz'� ó	def get_archive_formats(!A"""RŠós a list of supported .    B  eand un !.
ø±Each elemenF Qthe r\ °ed sequencey�a tuple (õÒ, description1"""Q } 3= [+ Áregistry[2])” B  1 in9 ~Y‘.items()]) b b.sort(} ²  ]  ' 

@` +erE• @func½ Ð, extra_args=Y	Û 8=''s È cers anXes M Ù  , E 0of  ² $. u $ ñcallable that will beä  us„o createn ès. If provided»  R a°!ofF ì bvalue)Àsl @ pasj pas arguAs toµ � .K ðu can beˆ  1  bÊ  , rÕ TM !byb â%x W'if© î  ¬ 9ÅB = [(!if.È (~Ò 7 ðraise TypeError('The %s objectg  pB 5' %ž xc ¶isinstance(‰ 1, (2Ð, list)):
     ð&raise TypeError('extra_args needs to be a sequence')
9 ö for element in 7 :  # óif not isinstance(1 ô, (tuple, list)) or len V) !=2G  K § 	U ñs are : (arg_name, value)')
“ ð_ARCHIVE_FORMATS[% ç] = (function,Ç �, descrip ð)

def unregister_archive_format(K )³ Odel k E Dmake? S(base­ J ñ, root_dir=None, "  ¡verbose=0,Ô   ô dry_run=0, owneB SgroupN Clogg ¯ Ó"""Create an Ö à file (eg. zipžRtar).G'’  ñ �' is the  1 of ; Ato cU Â, minus any á ‘-specificÀ Âextension; '  U Œ bP: oned °"zip", "tar !gz	 M ""b  ± !"x Q.  Or~ dother À#ed� Õ v ða directory that will í  *   ÷ € ² ð; ie. we typically chdir into '@  à‚' before*0ing?H 2.  l1dir—  ~ ™ Pwhereg Sstart» G Qfrom;I  ˆ C Æ Ðcommon prefixX1all÷ ¬d> k 0iesâ ~ â  š Ç 8and© Áboth defaultH  toÚ P curr-W ®y.  ReturnEh ‘ ¢Ó!' n Ó'ñ–used whenHSa tarTe. By� 42user ’ Z Y X .¶ 1""" øsys.audit("shutil.Á"¡ ,SÃ 2dir4òsave_cwd = os.getcwd( %ifù V 8  S â2if ½  #   Ð.debug("changwF%s'"š u  5 Î• €path.abs ž/ ÔkŸ  K 1os.é(y%ifÆ ½ 
Ø €  bcurdiri!kw†C= {'o 3': 
 2, 'î #':}5 6try• R~_info =• ]ç¡except KeyD zVJ ‡("unknow-¡  'b# % ) ‡ ì ™  d# = “ "[0{  J1arg¯ i— # &1]Š @[argµ2valY #ifU � != 'zip'3 'âð'] = owner
     ñ   kwargs['group'] = 
 ¡

    try:	   ðfilename = func(base_ !,  rdir, **Q )7 gfinallD öif root_dir is not Nonee  i �if logge#  ' $ ò.debug("changing back to '%s'", save_cwd‘  8   –os.chdir( ± treturn ë ò


def get_unpack_formats()³ A"""R3 ós a list of supported .    A Bing.\±Each elemen6 Qthe rL °ed sequence%qa tuple  (pòextensions, descriptionä 1""", } 3= [7 ‘info[0], 	 13])™ S   1 in:  " ñ	_UNPACK_FORMATS.items()]( b b.sort(} Â  X  '?d_checkBo« (s(Ä  P Á €, extra_“bC? `s what‹ós registered as an\4er.ü õ# first make sure no other,  [I €for this‚ \ã –existing_¯ Q = {}  4 	> /- S 3 bext in…&0]    p  @[ext˜ j ;E §  K � N &ifË $ Ê -  { Pmsg =7 xalreadyk v Q"%s"'ü  2   qraise R’€ryError(J &% â,2  6  þ é 2]))ÿ !if9”callable(>2 \ – BType’ !'T^73 ´ must be a O #')ö¹îKr,¾=×ø 
¸3=''¼ P¦ ÙO9`	`¥ 3   u  ¢ 6. `ž ( › “ correspond:7to F l`*I   (  t�bwill b�@usedzê° archives. }7 2 ureceive$ 7 .™  If it's unâ  `handleíX  , it needs ñaa ReadóG Aexceo;ÁIf provided,&lÝ av!of? ìbvalue)†s÷ @ pasõ  †0rguËŽ (Ñ î@ cansŠ  ¿  'be�a, and .%be˜ !by( —�w î Àgs is None:
  ðextra_args = []
 ð_check_unpack_options(extens `, func &, @ )< ðUNPACK_FORMATS[name] =( > 
�, descrim ô

def unregister‹ pformat(T !):o ð """Removes the ±  & Q from F ary."""5 _del _¨ x ö_ensure_directory(pathq E Q that` uparent / P of `3 …` existsx  ir» ` = os.! ".d a œ eif not! cisdir(' ƒ  £µos.makedirs ¾ ·€zipfile(  v « ctØ J A"""Uåd zip `+ a` to `Ú/ `› Ç `import3  1 “  # late  ñfor breaking circular dependency
L ç ¥ C.is_ ° £  í ñraise ReadError("%s is(a‡  ˆ 1" %  ì )e  Õ =!    g.ZipFi°2tryJ i  ¼ pinfo in7 . Wlist(�  (  d 0 =  .\   s     p# don't÷Àract absolut¢ðths or ones with ..p Athem ?    # ame.starts* P('/')< @'..'4  x ¾  5   Šcontinue’ `targetv€@joinÙ ¤  0, *T a.splito & W    ” 6ot L ~ TD c ‡ 6endù k #ñ	5 ¥  +¿Aopen-ý, 'r') as source, \6  :   5 � R, 'wb<  ‡  6 @copy
Dobj(d 0 Þ gfinallkºzip.close()¸0tarI ¸¡tar/tar.gz 1bz2 /xzÎw Î ý 	D€tarobj =% É .Q 
  ÓQexcepG  A.TarÙ[ò	®	ÿ compressed'un 1tar!
± .ï8all° ¾å ÁNA = {³ Ð'tar':   (['. 4], Ír, [], "º "),G 5zipG   G 8G 2ZIPô ð),
}

if _ZLIB_SUPPORTED:
    _Uÿ8NPACK_FORMATS['gztar'] = (['.tar.gz', '.tgz'], _unpack_tarfile, [],
    
Ð"gzip'ed tar-7 ñ")

if _BZ2_SUPPORTED:H +_U’ b’ 2bz2“  	 ” &_bzip2• OLZMA– x– x(x((,xz‘ ”def _findypformat(FRname)6@for  «, info in Hs.items(/  ® 3 �extension2  : 2[0]Q  "   4if k ¥.endswith(7 O  -   areturn� Ð `None

Î AuarchiveÉ à, extract_dir=/ ", ì  j A"""U�C an C !.
i `¨ �` is the„ 1 of , l / øtarget directory, whereK u 2is Ð ñed. If not provided,. ö current workingS  ¦ Eused¿ ÙŽ ± P: oneÌ °"zip", "tar ¯ 	 &!",• Aor " ó".  Or any other registeredX -. ¶ C Õ _… rwill us h ±> and see if˜= !erJ ;wasw V that=  �In case né ðis found, a ValueError21rai4 k1"""c òsys.audit("shutil.‚ ¿ %",Ä	fa)A if• ƒ m  †4Ó = os.getcwd(?  Bfspa-T )¯ @E &  M  w ‡  U
‹ 6try˜  *_Ã, =ü[ ]~  . ¡except KeyX
K bv“("Unknownê:‚ '{0}'".\ ( €)) from ® U o cfunc =8 ¤ &[1�   ƒ, **dict] : 22])GFelseº p# we ned‘o look at€óÐers supportedòÄsË  Gx	/ 	« ù •  ý OAReadlN\o O0ileÐ) J  ) – !@ ]S‘kwargs = >
ð [format][2])
    ðVfunc(filename, extract_dir, **kwargs)


if hasattr(os, 'statvfs'):

    __all__.append('disk_usage')
j Á_ntuple_disk ð  = collections.€ d# !('  ÿ', 'total used freK .( Ñ.__doc__ = 'T9 ò space in bytes'© ˆ ._ < Uo ;  • ; \Free ; w @def û _Ü q(path):   """Return $  $  cðistics about the given ? %.
? < áed value is a P Q` with ¼cibutesX a ü U' andL 'Ô Á', which arew ¡amount of k,”"an˜ó ,j.N 5""" €st = os.Ø 2vfs  w ò = st.f_bavail * efrsize) � * _locks*  Ý B = (T * -T bo )8 r‹²({ ü ,‘ÿ)

elif _WINDOWS\ZXs[…™ Õ  = nt._getKJj4 ! -ÈI ‰û
{Qchownb Ñr=None, group çð """Change ownerAry* Zß8use' Rcan b“¡uid/gid or¢ ) /v û!s,] Ñin that case,æ Athey×Àconverted toB pir resp�3ve ^ ÊÆñsys.audit('shutil.þ !',‘ û )ž"ifé 0is ” ¥  praise VÂpError("Ó  2 3/or&@must Cset"b _& =g á _` =3 ‡ ò# -1 means don't c‹!it3 ¦ ” ] !-1( #f  …`eitherŒ €an int (ž@uid)‘‚a string asystem<  –8°isinstance(Ç ,7 0 Ž  ÎA_uid% ?    y 7  – ^¸   PcLookupQÐno such user:ñ {!r}".format(user))

    if group is None:   _ A= -1 ñelif not isinstance(# o, int)9  ‚_get_gid' )F  Z 3if ] u   òraise LookupError("no such« :Î „ Ï ðos.chown(path, _ë ,n p)

def • óterminal_size(fallback=(80, 24)Í °"""Get the ( 1 of = ‚ window.I…For each& áwo dimensions,: ñenvironment variable, COLUMNSðand LINES respectively,ž¢checked. I‡ A   ±defined andG  ³ Pvalue `a posiJ  ©peger, iÇS used¿ DWhenŠ 3 or… !isò_ p, whichT  a Åcommon case,v ðconnected to sys.__stdout__A bquerie® ý by invoking os.¡£ ø b ”0can” be!£cessfully _ õ, either because§ ñsystem doesn't support7 Pying,4 ± we are not? 	Ù $a � âu”given in Z¡ parameterC "is{# Fz� defaults-†
n" @ ú  ½… by many† £ emulators5BThe • Pretur%€is a nam›Auple²0ype|Î .m 1""" p# columÌQlines 1wor»g s, 6try7   =C(os.#['ú"']±except (Keyø0, VÄ “  P 0{	n œ l Vj L h C# on\y9 neq1aryô $if!P <= 0B@   	­  Ï Í=}ù(8’.fileno()/ = 3‘Attribute-9A, OS B : "# � � ùð, closed, detach
  orö åoÂ B   #¸ )V #unWç 0   ñ 	n‡Þ SE G  Q . ‹  ?if    =Õ. H" Ò 
™ (\ ,R  l@
# C�‚ that a ò    can be acqed withþð
correct mode.
# Additiona±ÞN `G `B Ú@a di7 Áory, as on Wx5s
# �ies passh ðos.access check.
deò2f _access_check(fn, mode):
    return (os.path.exists(fn) and os.> 8 7  ;    $ 0not( ? Pisdir> ò)


def which(cmdv  =os.F_OK |3 `X_OK, 9 D=Non“ ó"""Given a comman< ,’ äa PATH string,À 1theH p £ Àconforms to  gT qmode on  I P, or } 0 if Ñre is no suchH afile.
 `> ‘` defaultZ oÐ 0. `Ñ 
&  € aresultH  ofþ Ðenviron.get("Œ !")Ž ðcan be overridden with£ustom searœ  j œ 1"""\ ²# If we're ò aD òdirectory part, look it up  “ly ratherN €than ref�  ngM « - ñories. This includes hÀing relative5 3theQ ucurrentB ò y, e.g. ./scrip"i"ß pdirnameD´ yiØc%  ) á1cmd€   öØñuse_bytes = isinstancr !,  )( "ifL!is3B R  © / =Õ,, )~ E  I 6tryV     ^  Ô€str("CS_‡"W  ) òexcept (AttributeError, Valu  5 #· Y )] 	¢t availablÁ 3  ™ 0def å ð# bpo-35755: Don't usej * oÍ
m@varim 7 isN 0setFƒan emptyÿ–#E €='' doesk ãmatch, whereas !:'í © é ˆo 0if Ð Í ‰D1 ifÏ 4'  5 �fsencode( ¤  ! =D`.splitw, ƒBsep)3 Oelse^ /de^  s  R +°if sys.plat¶ == "win32"h ^# Theñ takes precedencF�Windows.; bcurdir  45 > 	 %  if”  ]   !inF¶  #  ì £.insert(0,/ »   )1EXTÚe0aryX³ Ñ  T ¢ext_sourceÙ bgetenv´AEXT"5Á_WIN_DEFAULTœ5EXTü F À = [ext for  Æ `  2  ¸ (Bext]À Æ H 4  W Ð= [os.fsencodóe(ext) for ext in pathext]
  ò# See if the given file matches any o �expectedE  Q ‡ensions.M óThis will allow us to short circuit whenk È"python.exe"G ¢If it does‰ ð, only test that one, otherwise we havel 7try� # ¢  ifÒ ð(cmd.lower().endswith, 4%):X  < &†s = [cmdOOelse(   +7�
= B# Onã ó platforms you don'tð ñhings like PATHEXT0ell+ ± 0# w6 ´ p suffixÛ÷re executable, so just pass on cmd as-i? A õ _ Áseen = set()  n4dirn@norm P= os.‰. ‚case(dir=  Zpif not   / 0in d H  $   S.add(& >    ƒ 0the®  ‡   s@  & Vname � @join‰ , 3 
T  2 ðif _access_check(C k, mode .   preturn (  €None
impÓ_signal
from    * Denum @IntE Cas _ �

_global›
 D()

  ±._convert_(…  ™ !'Sv `s', __Ÿ 5__, alambda¶ 
7 ) `.isupp;0  Q Aand b.startSp'SIG')  Ó<ame :_')i!ory 	( ACTRL) Ô HandlerÕ b  (¢ q_DFL',  0IGN‘ À
if 'pthread”Pmask'1 jb	  f ; ’  " k– TBLOCK˜ )UN qSETMASK« Ð
def _int_to_+€(value,  c_klassžB"""C
± a numeric -  63an Qr member’Œ!'s”sa known  #, Ï <
O bitselfA 1"""*2try6 ø : £ µ €except VÇ ]Error8 µ "

û E  toF 0 ï Ü ñ 
® 	ï 6 ·  ñ ƒ  é 3intœ â (ã a, Typeî ®'l À


# Similar¿ ðfunctools.wraps(), but only assignñ __doc__.
# __module__ should be preserved," 0nam  ¤and __qual ò re already fine. ðannotations__ is not set.
def _wraps(  ped):
     “decorator r    . #r.¸ 2 =  d F  * creturn r  ` 3

@… ‚_signal. )   ( ´num, handle�  : = > Ö(_enum_to_int? 9),  ? ())›  3  :  B (" 2, Hx >s)
² 2get¢ µ  y ZN ¯ , � pif 'pthø òmask' in _globalsz e2  ù `(how, U ‡sigs_setÈ 7 Î Iset(cAx, Sú€s) for x¾ c  o â ¯sigpendingÝ - Ø  (Ê Ž{‘  \ž‰ c()}


� Owaitš  * 	—    *:setš 7sigb8sig* W	Â r‘X¨ SvalidÉ s® 	0 ´ 	 N+K  Q5del¼,¡ð&
This directory exists so that 3rd party packages can;ñinstalled
here.  Read the sourceqqsite.py ðmore details.
"""Apï! m—Ñ search paths0 kthird-} pto sys.& O.

* ,1
* ÿ ƒ ñis automatically imported during initializö?. *‚ /€bwill a 4“-specifict�e+ ð.  On
Unix (incluÈò
 Mac OSX), it starts with< refix and
Kbexec_p à(if different)# • ñs
lib/python<version>/ª ò.
On other platforms (such as Windows’ Ðtries each of3
€ e‰0ly,5  we»  � 	q › ðed.  The
resulting directoriòles, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg"p ñs one directory abovet Áexecutable,
„ Prefix…  #_p `re set® HthatO ‘nd
it is ¹ Scheck· ð site-packages (c EbaseT !ndw   Œ  àwill always be;‚ "real" Ž Aes oRñ  Python
installi). If Þ(a bootstrap G) ùtains
the key "include-system-Ê "
ñ anything other than "false"
(case-insensitive),É Q VlevelÏ ò "stø Ïso be
searchJ;p 1wisÔy won't.

All`resultœ »  MEific¸i—
—Þ—
—A´)±Bwhos·A hascform
<3¡>.pth; its¡Bents;˜dditionalÏ   (ç°per line)
tF; addq.  Non-Š i¢wor
non- )r ^neverL E; noƒ yÚ o Ø Ó@ mor¦ñ an once.  Blank¤ sj ®  ç@ginn‘ �with
'#'y ñskipped. Lines starÕ % ‚ 'import*  @ð	uted.

For example, suppg }>v    3 s “à±
/usr/local*  ÛeÜ ë $ a/lib/p‡A2.5/nÀ!s
§ —three subW¡, foo, bard AspamýA two:
§s5  4 0bar �.  AssumeR   , Í Qð
following:

  #%  Ÿ  ) fQ 
   
 ”    letch

and 	Y K  ½ K �bar

Then…  … B n sŸ0, i4 �is orderk m/t /  - �foo

Notœ1t bï  æ@omitwòbecause it doesn'tN; ¹Qcedes4+ ’P comeðphabetically bef
0fooL;Ã ÷O is
t   is not menê ed eiŒ
¼O.qP readSb modul¹ QdautomaŽ ^€ en0
co3 p uª ˜"atGðrt it.  This can�àoverridden in
ÿð customize, userñpcustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these oper ðs, an attempt is made to import am åule
named site· ð, which can perform arbitrary additional
6 ¤-specific @ € ¤.  If thiss ñ fails with an
Iˆ °Error excepT 1, i­ ósilently ignored.
"""

¼ 4sys o
 ubuiltin _�  ñio

# Prefixes forú  -packages;Þ   â $ p+ òlike /usr/local here
PREFIXES = [sys..  ,  Rexec_  ]
# EnableOK usew ð directory
# setqto Fals´± the featur[1Tru Xforce ð	
ENABLE_USER_SITE = Noneý  ô ðdistutils.commands.install
# ThI@valuñre initialized byh 0getÆ ³base() and   uM�()
# funcÚ¡s, throughA emain() T whens"=s.
¾  6BASÏ ñ
def _trace(message):
    if†Òflags.verbose   Tprint2 p, file=µ‘stderr)

Y  makepath(* sZ �dir = os. T.join  y 6tryh 
, 0abs4 Q(dir), ø1 OS7 Apass! µreturn dir,r PnormcyG ª @abs_[ #s(¥ £"""Set allè0 __æ !__®€__cached �ttributes 4€bsolute Q  w 1 6@m inž(*‚modules.(#()x  , rloader_" z    	  . Cm.__ 3_._F !__ 0 4A· ; # d   T –  h  »2__. m  9 q  ' ´  2if U À @ not>¢{'_frozen_Ënlib',  ¶_external'} Y ðcontinue   # don't øVõ PEP 302-suppliedö? Öª ± ƒ (‚,Æa, Type– 9 	"ˆ •Š  Œ 5<�removedupðA! R ð duplicate entri81rom_ 3 ð along with makingñ them
    absolute""" ð# This ensures that- ó
 initial path provided by óterpreter containsN Eonlye > ñnames, even if we're running fromS ñbuild directory.O aL = [] `known_Ž ‘s = set() 0for6 € in sys.! :  í P# Fil¥ Ñout duplicate– ðs (on case-insensitive fileI —tems alsoL  ifª !y ã `differw  D Á); turn relaH  ˆ es intoJ  ã  § @dir,Å  J p = make" B(dirå  % %if# 0noty ó  + ŠL.appendA   3 1.ad!  u f @q[:] = L° !reØ 8 €


def _!�binfo()‚ B"""R2 a¤ ê�all exist g! il	‚ .ždì .  ý + x  Ü 6try   Bif o.y  s(= ª  !  !_,…  
. )   d9   0 :  úexcept TypeErrorŒ  &AinueO UdKñ addpackage(site 5', w· ò"""Process a .pth²`withinŸ C -P s3Q� ÐFor each lineJ"th÷a, eithÒ!mb  t X R @dir Ì<Å  Lcnd add5o¯  , g �xecute itù’it startsV ’'import 'ò(ifG … is None¾ 	 =†š ³ reset = Trt7elsF  BFals”@fullu% =5Jjoin’î„_trace(fŠ Ñ‹4: {K B!r}"2 	›à# locale encod= 1is Óàdeal especialliõ Windows. But we have usedê #_ Àa long time.}puptools.  Øew 2too| ¿ð f = io.TextIOWrAô r(io.open_code(× %),º "="Ë ç +OSð² QfÏ ¹ %n,Œ³enumerate(fñ œ   !if% .C G K("#"%  ) 	j    > ¶rip() == ""†  #   < 	½ &   Q  Ò� #("Ò3",  O\t")£   A Pexec(ƒ"   Š  !  3 " =1rstÏ Z   CÀdircase = maûkepath(sitedir, line)
  ð	if not dircase in known_< �s and os. Ý.exists(dir):G  V #sy* aappend* ) b 1.ad)  } 
� �except E >iont ñprint("Error processingé ÿ {:d} of {}:\n".format(n+1, fullname),ž p  file=Î jstderr˜  ê ýimport tracebackH  for recordR( ‡ _Ü Pion(*g ¯exc_info()Z O  ¿ M W `.split /s(5  © #P'  '+, ,Û 2 À"\nRemainderF Ÿ ignored"F Bbrea†if reset¿þq = None?Yretur~£


def addÄÌD =B ƒ"""Add '0 à' argument to j Éb if mi+ à±handle .pthAs in’ G 1""" _É (fe  iÃdirectory: {s B!r}"0)ifJ!isë Q_initu	p  Â=b = Tru(FelseF  BFals  ‰ #, 	  ZZ = ma¥  þ+ 
j ?.Þ4 )¥    # {a•componentÆ °ò=  œ ‰ 6tryk  �0s =ztlistdirú- ?1 OSû8 Cu C [	  @	 0in  s 	 °.endswith(" 1")]> 0 psorted(. sg ï ¤addpackageœ ,[ ,ö¯ /ðcheck_enableuser?÷@"""C  Ó   ø Ð›� is safe¡inclusion
ç ñThe function tests& €the comm 6q flag (= døqenvironY3varH‚à uid/gid equaly”effective .  ¹P: Dis× d{ ñsecurity reasons§ Ü) 1by é (¥  opÇ r -0: S÷  Å 9dM Ì!if Û Ps.no_R _XO  ² ñ	if hasattr(os, "getuid")( e O !# Çª I == £  _ ifþ0getF A() !p ú (   ÷_À
    if hasaøttr(os, "getgid") and hasa e 3:
  ð# check process gid == effective - �if os.getF S() != Vgid()U  \ Áreturn None
A  ñ	True


# NOTE: sysconfig® ðit's dependencies are relaŒ ÷Tly large but site module
# needs very limited part of them.
# To speedup startup time, we have copy1 ð
# See https://bugs.python.org/issue29585Í "Co< Ï ú._getuserbase()
def  /@env_#  Kpenvironcñ("PYTHONUSERBASE",L)L4if 9 G r v�# VxWorks
ô no home directoriesP Àsys.platform@"vxw8 "a Ó Õ @joinè g(*argsráos.path.expand*   ; 7 )® aAnameƒ 'nt~ &ñAPPDATA") or "~"Ð  e v  @ A, "PÃ"q ù qdarwin"‘  `_frame] ð "~", "Library",×.8 ,•  ™  ‘"%d.%d" %2 óversion_info[:2]¥ Jm `.localÉ  ª 3 toF O C_y°('purelib',­ \0+'_'–*    &ÅŽ   =V . œ ­F'nt' “ver_nodot> òwinver.replace('.', ''Í ã 4f'{… 2}\\«{L 0}\\ö¥-packages'ˆ  §½'Ä'Ät R/lib/å/k §  3  ª  ÀU[0]}. =1]}L 	!;A"""R7s·  ` “`³ y Ö.û ?The% Àcan be used Átore data. Iq globalš°variable ``o_pñ'`` is not initialized yet, this function will also setO 1it. """Žj  [  &if  j  V , + =7= ˆ& (

R º$—Z Y‘-specificLVj	5 1OSITE1¸ 5 1	 [ ‘, ENABLE_ñ   N àuserbase = getò"userbase() # this will also set USER_BASE

    if ÑSITE is None:  P   ! qENABLE_U C ð= False # disable A ñ site and returng f 7elst  W P  _get_path(J  Û )» K , �

def add(  q ápackages(knownD "s)Ý Æ"""Add a per¢ -2 € to sys.v l BEach( ñhas its own python directory withì J �s in theì Fhome- . 1""" P# get* ’ ‹  ÕGcallÚ’make sureÎ ào@ are m ò_trace("ProcessingÜ  5º !"),  M_   =£     *#s(�=if  ðoFa.isdirÂM ‡ Ñ 0addQ 	 (, ³ˆ î ð0get? � �prefixes=Êg A"""Rxðs a list containú  Ikglobalº×Bies.PFor e
 �y presentç$``| a`` (orÎZ á``PREFIXES``),Ñ œ‚functionËAfind]`Ó ŠV` subs `depend» o\ñsystem environment,ý<ü €of full Ss† w JQ = []ª `seen =>îì  $= õ ?0for00fix/' ‘ 
dif not# 	-  ƒ )  -  Â2inuZ   # R.add(Y ˜   li>sÑ Ö2lat ß  # "ifñ š != "lib"v 8 @s.ap„(" j úif os.sep == '/'=   A   
 s#  Œ  ˜  =I  
 S.joinÔ ", 5 A ,  	"Ÿ�%d.%d" %á ÿversion_info[:2]J  �{    8 ½ C * ä4 ½Q ; 77  "u É 'H E î …Ä q,Ð’ € J � vª R; Às")
    for àsitedir in get ópackages(prefixes):
  ðif os.path.isdir(1 7dir#  * 3add ! €, known_; 1s)
Q hreturn ã

def setquit(U ð	"""Define new builtins '$ Ò' and 'exit'.V ðThese are objects which make the interpreter 9 Ñ when called.™ óThe repr of eachJ ` conta| óa hint at how it works� 1"""F ,¶sep == '\\'Gñeof = 'Ctrl-Z plus R': Oelse- ÒD (i.e. EOF)'ð .@ = _z ‚Quitter(.a, eof)d " 7   '7 žˆcopyrigh£USet ' ˜€credits'^q  .5 ½ 1_Pr­%("$ f", sys4 Í !if Áplatform[:4]uGjavaws ˜ q # Ê  "Ç *", ÑJython is maiQed bye ñdevelopers (www.j3 r.org)."¼ 
í£ – Q """\› ñ"Thanks to CWI, CNRI, BeOpen.com, Zope Corporation?`a castí‘thousandsN ñfor supporting P¼  Ó °ment.  See Ù p  Ù  7 0mori �h 3.""ï ñfiles, dirs = [], []n ñ# Not all modulesÄ€requiredÔ �have a __D Â__ attributeˆ F vPEP 420‡ rdetailsÛ`if has: d(os, 'M 'm ðehere =é´dirname(os.. º ,  ‹ ô
s.extend(["LICENSE.txt",  &"]1  ù 0 LPjoin(w ,v rS%,   cu F #`licens« 
ô7 ¦ "+ Â"ºŠhttps://ÂS/psf/2 /3 ì »%)
dhelper­�   `H- > Ðenablerlcompl�F A"""E à default readlsconfigu¿  Ïñactive prompts, byü €register¿a#!__R0 chook__·!If¹i †  can be im1ed,%  9 P will¬ bTab kev 3as Ò  b1keyfŒ B ~/..Ä_history as   dªDThis~  overriddenJ Å åöcustomize or user ½ °oÝð	a PYTHONSTARTUP file.
  ñ  """
    def register_readline():  ! Õimport atexit 6try# ' B )  ¥lcompleter �except Ie ZErrorW ureturn
0 ÷6# Reading the initialization (config) file may not be enough to set aN ’  > ¡key, so we& Ðone first andn  n Ý  
 ` .F    6ô _doc = getattr( @, '_ …__', '')8 izq   1 is° Nz  t ²'libedit' i| e #D ð.parse_and_bind(' s ^I rl_ç e~ OelseI Wtab: C Â ô .	 _Ÿ_Œ(õ ñ/OSí S# An  ð  here could havÏány causes, but‰õ most likely one™  v#Q1tha* 0re'^‘ .inputrcÃ` (or .c !inW {case ofO ³Mac OS X + š)š ‰Áexpected locŒ@.  IL 0at M <, w� @want’aignorew 6ion\ É Fpass6ú.get_current_history_length() == 0áƒ# If no + À was loaded,1aul’ t.pythonR 
� °# The guard`�necessaryË °avoid doubl¢g fsize a< Ô à# each interpr `F wheì¡  alL"y ÜKured—1thrÞû	a PYTHONSTARTUP hook, seæÓ# http://bugsë ù	.org/issue5845#msg198636j Ï ô = os.path.join( ùexpanduser('~'),<  ó   '€ kŸ . _    	c• f m 0 UW
   
^   Twrite—  !   œ     	C ¡  5 ¥  $ Á# bpo-19891, ð41193: Home direc @ doeêtPsu F   A# or½0ot ¦ Pable,  Ë °`system#  Î Z-only F   =(.S(` I)Çasys.__ü`active«N__ =Š 

Ž°venv(known_ysŸòglobal PREFIXES, ENABLE_USER_SITEo ðenv = os.environ
  ñ4  if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
    Áexecutable =P i_base_ ¿os.environ[U ]N Qelse:
  Y 	A  ¨  $ ôexe_dir, _ = os.path.split( 0abs (: !))< ·site_prefix= pdirname/  Z + pys._homÞ ANone@ Aconfç  0 ò  = 'pyvenv.cfg'! �andidate_+ Qs = [  Ù   •file for  Ein (#  ' Å Djoin“ ,0 z /),2 ã 6 	5 æ  q %ifG is¡ (� $ !]
= Jif câ ¸qvirtualù , =( "[0ì q psystem_ª ‘ = "true"_   ð# Issue 25185: Use UTF-8, as that's what the }° module use 'enK qwriting,  Ú . ¨with open(¸ ð, encoding='utf-8')w fæ  £  À@line   Qif '=0 % 
;      Àkey, _, valub * æ.partition('='| 0  ÿ	key = key.strip().lower(. ^  2 T    ifU 
‚include-¦-¦¯-packages'Î  B / Õr œ 	'elt  h\ ŒZ Žw .Ñ.ã ¾  4 B# Doò is here ensuresPðtakes precedence over_r@0add_ p(known_y@s, [Œ ™ (]){ 6 à will process P ¯ ` again¬0itsj†PREFIXESü@# buGok; ‚ X °event anythó  be ¢added twic× I˜™
ò… ¡.insert(0,ûé …
Ò _ 9  M $ ò	ENABLE_USER_SITE = False?hreturnä p


def æ 9²customize()µ r"""Run  \ð  specific code,^PavailÆ2.""†2try@  ” 	   aimportN Y &izE�except I$ PError?6excQ D  µ "c.E9= '¾  Ipass*` W BraisŒ ˆ E� ð ion as err:
     ðif sys.flags.verbose:
    Ãexcepthook(* …_info()), /el: Õstderr.write(, \ þ-"Error in sitecustomize; set PYTHONVERBOSE for traceback:\n"M ½%s: %s\n" % († ð__class__.__name__, err))


def ex„ %er‰ "()r"""Run  ò user specific code, if available.""ž 2try@  ð 	   aimportN Y 5ize¸ r! I$ &fas excQ D  µ  c.Í P == '› M ',  0 Epassd   ¶  BraisŒ ˆ E@ion † &rrZ Au	ú AeGmain4ÁAdd standardâ-6ñdirectories to the module search path.
¬ This funct�ðis called automati €y when t+ mI 2is c1ed,H aunlessl ðpython interpreter was­ ‘rted with( 0-S .@ ×òglobal ENABLE_USER_SITE­ Porig_½ ! =Z  1[:]A Qknown Ðs = removedup# "s(J6if B !C q#9 µ might makes ’ absolute»  Õõ# fix __file__ and __cached__ of already6’ ¡oG 2absÃ "()ò 
Ö Wvenv( × /w is Nonn"  = check_enW â '*d d = add  Žpackages† 3  O / ssetquitp €setcopyrl chelper aif not„ 6¦s.isolated¾Ë prlcomplx;  { Ž ½ -ifhM °ð

# Prevent extendingÝ · i( ô -S!
#® ¢B È =r.
ã 0no_¸ •  Mt_script )q = """\`%s [--´e-base]  N ]ZðWithout arguments print some8@ful ‡r!onX  4 1  _ðvalue of USER_BASñE and/or USER_SITE separated
    by '%s'.
 ôExit codes with --user-base or Qsite:0 `  0 - $   ó directory is enablg ?  1) 1dis*  �  L [ 22 Qsuper„ 8  × òor for security reasons" >Z Ánknown error 1""" ñargs = sys.argv[1:] pif not  þ  x _ P= get¿   !()3  ‹   _"   ‡packages* pprint("y –path = ["H  Ð adir in›  " ‡  i ?   Ö%r," % (dir,)C " ]V °def exists(R )S 0if   Î û @NoneQ@ os. o.isdir9  … ‚return "_ \    5elsC   2 rdoesn't™ 9 ¿ !f"ÌqBASE: {^ rb!r} ({l ( 7)})í 	A  A  ‘A   A qENABLE_‰ H  7!r}z  Ôrexit(0)j`bufferã]'n'ç
j2 �.append({  Þ4if ?  ¶ ?  º � 2if `  -ê’sep.join(& T<if û D  ×û     /el7   f-Fa@ 1ë @ 
 ¢ 2? ~e 3& 
 õ import textwrapÛ# À.dedent(help} T A40],2Gsep)= # 1ò
if __name__ == '__main__'Ò ò,_script()
#! /usr/bin/env python3
"""An RFC 5321 smtp proxyÎ�optional" A1870Ì / ò6531 extensions.

Usage: %(program)s [@ ás] [localhost:
 q[remote    Q]]

Ox "s:ú’--nosetui�%-nO@This°  p ò generally tries to 6 ð `nobody', unless t8 cflag iâ   - `.  The
 òuid call will fail if8 à  } ãærun as root (iœ °which case,ô<  t );P--ver>Ï !-V  ¬PÖS the ! q number} ýA aclass   B +-c  S UUse `( '±  ` ðconcrete SMTP proxyó class.  Uses `PureProxy' by
  ‘default.
 Â--size limit s  3 ñRestrict the total 3 !of ð incoming messag# ! "O ±" number ofZ  M ‘bytes via< òRFC 1870 SIZE extension.  D¥ ás to 33554432 = ¸ qmtputf8\ !-u  c aEnable` †SMTPUTF8[ ð and behave as an „ °6531 smtp p/c QdebugY !-d  ` �Turn on  gú eprints6 Ahelp. !-h  5 P# U this( Š 0exi‰0Verø r: %(__v ð__)s

If localhost is not givenà 5n ` ' Qused,ã i8 4por8 
8 D80251 Ï.  If remoteg 
À i9 h   ,¡ g ð
"""

# Overview:
#
# Tð file implements; � minimal Ä —Ptocol´’defined i¼@5321Ã Pt
# hÓÒ hierarchy of†es whichd c ð
backend functionality for !
#Vd.  AÉP 0are– RvidedÊ  « €Server -C R base2 V  t `.  Rai¦DNotIú ðedError
#   if you try@use + 3 0bug{n s>"y ŠU eachh°it receives·qstdout.}%  #0 - +ties all= €@a reõCmtpdH¡does final¬ ðdelivery.  One known’blem withúž w€that it G ¡n't handleK ïecs fromH©s] at¤ ". =PshoulÕa fixedF �(contribu× s ­”welcome!)û pMailmanö Ðy - An experiƒpal hackzBworkÄ CGNU 5 e á<www.list.org>v åª sÅrA* j!d, I 2maiáðwill automatically»0ogn£ ppaccept 1 Q dest	)to—  ’  ð$ osÜ"st`createÓE¯æVO    a F � @gets¾`wardedÊ&,šêR 9bgain, ÏN  Š Äòâd correctly ye•ð
# Author: Barry Warsaw <b q@pythonrÃBTODO€Q- supˆ Dbox —�
# - alia´1les Htr more Ev€! £ ½ @ codò‘ A

imx 4sys o
 Terrno dgetopt Dtime Usocke Qcolle”!s
€warningsÂ Ó   Àemail._headeòr_value_parser import get_addr_spec, Angle ò

__all__ = [
    "SMTPChannel", `Server –Debugging ²PureProxy",A tMailman �]

warn( ò2'The smtpd module is deprecated and unmaintained.  Please see aio< 'M £(https://a ò$.readthedocs.io/) for the recommended replacement.'µ Dƒ ¢ionWarning óstacklevel=2)


# These are` µ 2ftef `above ï ðing so that usersyŠ •correct
#ø 4ion4 #.
¶‰asyncore ñhat


program = sys.argv[0]
__versionÌ€'Python Í  pž  ñ 0.3'


class Devnull:Põdef write(self, msg): pass Qflush  ô 

DEBUGSTREAM =R ñ()
NEWLINE = '\n'
COMMASPAC ð, '
DATA_SIZE_DEFAULT = 33554432


� ¡usage(code� B='')¬ ðprint(__doc__ % globals(), file=qstderr)½  ifÏ <  ç@ ?msg0  @ Aexit|  ú0 P(£Ahat.	 S_chat� ë aND = 0}  é Q = 1
  ‰ÿand_size_limit = 512 þs = collections.defaultdict(lambda x=T B: x)p ‘@propertya  VNmax_2 ×&  #6try0  ¡return max+ .C !s.‚2s()v 6 €except V›_ErrorU  rQ  Â  ´ �__init__{ 1, s“€, conn, àg, dataV=w	`Ô •  ðmap=None, enable_âàUTF8=False, de~_\  ä B ù
.¨    f 6mapï  Ì_É  ÍÒ ~"  > ÿ*nn  ñ ! =ø 
  ¨ , =
/ õ , =
/ _ [ ( ,ifC Õ9  Gaise'("+ ; ¤ ucannot"r  Š 0" b4Át to True at~¦same time"�(ifæ
Ÿ ‡�_emptystrÖ2= 't # qlinesepîrð   # 3dot" .B 0newE 3 = :â Oelse— Àtystring = bG''
  ÿself._linesep = b'\r\n$ 2dot# Ÿord(b'.')I  0newL I G g Pset_r fstate(A  ÷seen_greeting = ª   Àextended_smt« UFalse„ # ü
command_size_limits.clearl ðfqdn = socket.get % Etry:[  /_ °peer = conn4   8namÉ úexcept OSError as errJ €# a raceG ùdition  may occur if the other end is closing� ñ# before we can get9 ” 	- ½  F «  Ö  if  �.errno != ºno.ENOTCONN¸  0 7rais Ueturnn ñprint('Peer:', repr(~  ˜ û), file=DEBUGSTREAMòpush('220 %s %s' % ?  Ÿñ, __version__))
u Pdef _S¢post_data_] v )Â ‘"""Reset  Ð variables to80ir A R-DATA# A."""b  æ  M .w]  : 8zCOMMAND' ëmailfrom = Non¡Êrcpttos = []7 ÿrequire_SMTPUTF8 = á €num_byteB 0A  ³terminator(É' Õ "2all&Ø ›¢!ˆâ�received«å    G æ 2[]
êñ# properties for backwards-compatibility@,  %b_serve�÷ ±warn("Acces_( à attribute on –pChannel’Ædeprecated, & *b"use '+p Ó' instead", D7 ÖionWarning, 2!rL ˜mB Ñ ˜ q.setter Ø }, valueß 1SetUE Ý % AÝ $Ö " =¬ Ý° þÏ ® & Ï %¬
r¯$
E �!@_W° ² Ø ® + Ý %¬˜ Àed_lines' inóstead", DeprecationWarning, 2)
  ñself.received_lines = value
% ‘@property Àdef __state(; !):  M ô warn("Access to' ó attribute on SMTPChannel is d� Ued, "J  N ¢"use 'smtpn O' inÓ preturn Ÿ .A ^ @¼ q.setter Ó ,þ Ú SettingØ -?setØ $Ñ §@gree³ ª* ­+Deen_J °%D Ÿ%@_T ¶n â ¹/ ç %¼£ ç ¿= Â�mailfromà ’l* Û %oE Ö m? ¸ ¸ Ø ¸/ Ý %¸E Ý ³8 ®qrcpttosÕ ­
) Ï %¬D Î «> ª © Ó ¨. Ø %§D Ø ¦7 ¥AdataÏ ¢
 & Ç %ŸS J Í 	¥D « P ¨  à(self, value):#
  ó0warn("Setting __data attribute on SMTPChannel is deprecated, "
F  á"set 'receivedJ Ó' instead", D9 åionWarning, 2)‰ Yself.= ‘ = value
$ ‘@property °def __fqdn(9 !):  ‡ Ñ “Access to& Ó %Puse 'g Ê preturn ˜ .; › @® q.setter Ä ,î Ë œ M É %œ A É Â ŠOpeerŠ & Á %Š A Á Š ; w0@__ Š  Ä Š + É %Š A É Š 4 Š?con & Á %Š A Á Š ; Š  Š  Š + É %Š A É Š 4 Š?add & Á %Š A Á Š ; Š  Š  Š + É %Š A É Š 4 
Šñ# Overrides base class for convenience.÷  ‚Cpushâ 7msg~‘asynchat.	 _ - abytes(G  w  ò	msg + '\r\n', 'utf-8' if€require_PpUTF8 el]‚ascii'))æø# Implementation ofÆ ñ abstract method~  Å ñcollect_incoming}Ö  Ò× À      limit ƒ= None
  òif self.smtp_state == …COMMAND:,  3 climit " ñmax_command_size_ 0 /el^ ODATA[ OdataT 1if e B and§ ²num_bytes > 
V jreturn” B 
' K p+= len(† )< Î €_decode_ F  ñ
received_lines.append(strO ¦, 'utf-8')Y OelseI  v !)
• ñ# Implementation of base class abstract method3 ðdef found_terminator(ý )�  ¸ ãñ_emptystring.join- .ä Ê ðprint('Data:', repr(O ö), file=DEBUGSTREAM5   R Q = []±  uy¥<sz,²â5, 0_ c @not ¬ 	    ¡ öpush('500 Error: bad syntax'Ì  /   w  0if c M C *  †  �t=3
³ ! =° ‹.find(' † Žif i < 0Ï ³? nupper(Ã Karg . � ­  
T _[:i].X  ä p[i+1:].^p�  [Rsz = p_ #s[ ' ˆ  7�extended_@ À A U 
 @ Bz > Œ HÊ Ù › too long” ž   ’ = getatt‘0, '° S_' + ª ,¼¥  VC ¤ P Q "%s"•Ôrecognized' %o 
i ¼ 
J(arg/ ç  v
ž  ^z!¦ } oÿ451 Internal confusionm 4 õ+ =ö W ©   ›  ktc * 
ê  S & ,$52CàToo much mail E Ä 6ð	# Remove extraneous carr÷iage returns and de-transparency according
  ù# to RFC 5321, Section 4.5.2.* ™data = [] ðfor text in line.split(self._ Ysep):3  ~ "if6  ©  ? r[0] == 7 ndotsep5  9  † �.append(9 M1:])_ Oelse@ 
< € �received_l  • 0newÏ `.join( 
: rargs = ù Rpeer,Í ƒmailfrom trcpttos j 
P #kwR ){}Þ bif not\ q_decode¨ î B 	A  E  'š 0_opï2s':R  ,7  Â 7  7 
Á Pstatu+lðsmtp_server.process_message(*B, **Ê 
 > ‘_set_post_[ *e(( 0v %G Úpush('250 OK'? I6  s Aus)
,a# SMTP}E
 �commands Adef ï AHELO(W, arg¬ :arg© o Ð'501 Syntax: H › hostname¸ 	x  íð# See issue #21783 ¹�a discussóöof this behaviorþ"ifÏseen_greetin£ 	±3 Duplicate¥ _/EHLO¡ ã ÏrÔ WÊ 	   ==á ! ÈR%s' %µ Cfqdn ‚ � ‚1 H ‚ú�extended_é = True¤-¤ ©  o e¿_size_limit—250-SIZE R < 
Õ-œa õ s['MAIL'] += 26¸ —6 s ‚—-8BITMIME÷Ø penable_"OUTF8Ø 0MTP% G  #m àcommand_size_lóimits['MAIL'] += 10
  ñself.push('250 HELP')
 àdef smtp_NOOP() q, arg):  @  if     ( Q À501 Syntax: D %'): Oelse8  ‰ -OK‡ OQUIT‡ #† Ås is ignoredg � w221 Bye„  ÷close_when_done(ü ó_strip_command_keyword‚  Ókeylen = len($ ö 0"[:& Ó].upper() == , 
`returnÞ [3 1:].• (T $ &''µƒ_getaddr« ´0notT l e'', ''A² #.lv ÷ .startswith('<' û t ðess, rest = get_angle_ (ˆ Y  $ > Šddr_spec= 1if Ä oddressÈ 	N v - . _ ³ 
BcparamsD ð 2# R� ô  as dictionary. TNone ® 1ll - Ueters“ ð# appear to be s0ð	ctically valid according$ •RFC 1869.B Presulp%{} 2form 2 in	 'Š P, eq,e Bue =' `.partiÈ 7('=- àÉ ; ñ.isalnum() or eq and•KvaluÛ < z ¥   ½ [T 3] =�  ifS  $U True2 F ò ¯¦ »® jÄ  w ñextended = ' [SP <mail-‡  &>] 1 €lc_arg =9¸—  ! 4if $ Š= 'EHLO's  % sn . ˆ hostnam¢ 3 *elZ /HEZ  . Z  ´  ms÷ °  * € FROM: <DJess>/ º 1if ð l_§`  +  d 4+= * 	Y   H 86msgü   ORCPTz  b )= Æ  * ? TOÄ €ODATAÄ  	È . Àif lc_arg ==« 'RSET':
  ñself.push('250 Syntax: . ). ÿelif lc_arg == 'NOOPQ . Q ?QUI¢ . Q OVRFY¢  . ¼ <address>'[ /se=
ù501 Supported commands: EHLO HELO MAIL RCPT 'X
‘Q'DATA 3 ç  › ‘ ,el� Æ‰ l Ž 2… ¼ �def smtp_š (~ f, arg)# if   æ \°, params = : P._get (B _  -    E �
I   ; ¹�2 Cannot*ÿ user, but will accept message~÷and attempt deliveryz y ~  � ¥502 Could ’ P%s' %VG 	C 1‹ c	˜#‚ W‚ € V Úseen_greetingL  Hò 503 Error: send·[firstareturnˆ  ü ±print('===>æ'ö, file=DEBUGSTREAMý sgqerr = '; :? g FROM:ó i "if2�extended_„Ï I  Z ñ += ' [SP <mail-tveters>]ó b›rg is Nonâ¯ Â  ø ¡ s_strip_¡_keyword('Ú K  ü?ess!ifV4 ü Ì± L è 	S 1sb .^  ‚OfromN '{0nesC ØHb p_optionY½ ö .upper().split(s � I.® L 4 $if¸.2}Ê_decode_data#cbody =y û.pop('BODY', '7BIT1if 1  øàin ['7BIT', '8ËBITMIME']:
  ô&self.push('501 Error: BODY can only be one of 7BIT, 8P )O ereturn 1if a ú enable_SMTPUTF8‡ ôsmtputf8 = params.pop('- Š', Falsem  Z 8 zis TrueV  è | frequir} ! =. ¤  ) +elP 2notv U 2® ú takes no arguments'º  p 'Lsizeþ —IZE', Nonù  ¥ +izé 0if ®  D ¯.isdigit()· 	Ÿsyntaxerr˜  «  &Pdata_g ð _limit and int( 2) >ê% ˆ 	D'552q€message L ø exceeds fixed maximum # Ssif len(Q`keys()¥ 0’ "ÍÂ55 MAIL FROMŠ@eterÌñ t recognized orpPimpleà+edŽ Ý <õmailfrom = address€ prE¢'sender:',H1 ö, file=DEBUGSTREAM¶½ ‘250 OK')
W @def V`_RCPT(' ,�5 œ ßseen_greeting$03­ « á HELO first');v  .   à P===> � 'Œ Ø 	� ˜ BneedÃocomman™1 = ýS :¦ c TO: <¬%>'á  ƒ 50ext± d_h� G àerr += ' [SP <Ç -�T)>]R aarg isíK  k Ÿµl I =As_strip_
À_keyword('TOd6argHæ ,õ$s B 0get (- �  ?ess¯ +L  ¡.Q\/b ,[ °rcpt_optionÝ X À.upper().spl2â  H.L B$if<Ç2ð
# XXX currently there areXÉ &we–.¾ øÀrams.keys())w > 0:
  ñ$self.push('555 RCPT TO parameters not recognized or Ùimplemented')R ereturn a örcpttos.append(address8 øprint('recips:', 6 ö, file=DEBUGSTREAM9 ( ¿ ‘250 OK')
{ àdef smtp_RSET(' f, arg)þ  if    ( °01 Syntax: D æ `_set_r ostate(§ ODATA§  ‚š ßseen_greetingº ñ3 Error: send HELO first'); ë   «!ifÛk ²e Bneed9ocommanx xès" =: 9 ê Ð  –ðterminator(b'\r\n. a * Nô354 End data with <CR><LF>.	 k2# Cø ±s that haveIWbeen )’ ™OEXPNò† @502 ( O J  { ó
class SMTPServer(asyncore.dispatcherð#' ‚Channel 9 ñto use for managing client connections´ c9 _9 =M nƒ__init__Ô Plocalé�, remote O  {  aÀ_size_limit=»þ	_SIZE_DEFAULT, map=None,> penable_ðUTF8=False, decode_\   v __Ÿ 5 =  ` $ ¸ ' =Å 
&  d À ! =3 
/ ± ; =  
/ _Ê  [ Ø ( ,ifC   a¹+ 
Å±raise Value&(("d  ; ’ … cannot"r  F ö" be set to True at the same time"© .? ô6map4 :tryÈ °gai_results÷�ocket.getheinfo(*Ø9 À  btype=sQ \SOCK_v , #rcreate_, (’ ‹[0][0],  &1]Ñ  E P# try20re-�1a sËù port if possible|{  Ñ`reuse_ñ l X " ðbind(localaddr)
     ô self.listen(5)
 uexcept:   + fclose()   Uraise+ Jelse9 óprint('%s started at %s\n\tLocal addr: bRemote u%s' % ([  m   Š ð__class__.__name__, time.c ( . M()),B lx  w 1, rq   ñ), file=DEBUGSTREAM)
; Ðdef handle_ac0ed(… q, conn,® )õ ñ �Incoming% Âection from Ø _repr(x  è    channel = q . ü „ ¢  +  
© +  ” 3^ ” ÿ data_size_limit; O_map0 ÿ enable_SMTPUTF8; €_decode_® ×Ð# API for "do©`someth
 ñ	useful with the message"B ƒprocess_ ‹° peer, mailé°, rcpttos, v §, **kwargs,ð"""Override this abstract ‹ Sod to{„ sE – rclient.¥ ¡ €  E ` tuplez@tainÒ 1(ipÙ‘ port) ofØ B � that ma„ Ë`socketE n¿±to our smtpH { õ    œ 1raw8essj Rclaim ; 1 )] Ç  =[ F )  a ­ ¾ ` eP Ì @wish �o deliver [ u 'toa  ž^ 0str-4con8 Ì ðentire full text€   M ‡õ0headers (if supplied) and all.  It has been `de-transparencied'¦ `accordŠ Óto RFC 821, S†P4.5.2N ð n other words, n¿Å óa `.' followed by9 Í  ’ 0had'A leaw 5dot�  "7ved0Æ2!diÚ0ary)6@addiñ al informa  ´ Et is[ —empty if �ð=True was given as init parametaö wvtit willƒ Ì ï  EFkeysŸ b'¯0_op– 5s':Ve syä aiW µmmand.  All¾  I  òelements are uppercase X«s.  Exampl#F ô['BODY=8BITMIME', 'ô9'].� 'Ê Qsame,Õ ¾   ð command.

        ò4This function should return None for a normal `250 Ok' response;
   Ûotherwise, itI  the desire\ : ò string in RFC 821
I  s Umat.
 5""" ò'raise NotImplementedError


class DebuggingServer(SMTP "):T õdef _print_message_content(self, peer, data):z Æinheaders = ­ @line  - a.split %()8  B   ë   sS  ò $# W Ufirst7   6if v €and not D 
C  +  ³ I ñ  = 'X-Peer: ' +Í 9[0]Y  2 !ifO °isinstance(Ä ,™ö  *   # decoded_* Ã=false; makeÄ q match Ú binary outpu× P 	´ Vrepr( 0.enk –('utf-8')P>  Á2 " <9= 0 ü ô# Avoid spurious 'str on bytes @©' warning.l  °  ´1 = ä   
¬ ‹( ;  ¡tprocess¢	šòmailfrom, rcpttos­§, **kwargsÁ] %'- õ MESSAGE FOLLOWS  &-'˜ 2if K 
k `.get('‰ 0_op='s'u  ô   }  '  ' s: %s' %^ [C ]�  ? n  í n  ' n (\np   E p  ú. —c  Û =e-- END^ %')žšPureProxy˜ î  öƒ__init__ï*Í×°if 'enable_áPUTF8'bµ - [' ]ÓRQValueI%("¤ Q does&„support l &."
esuper(5  , K%).Ë Å …ä e 1
{G('\nÄ`# LookP ƒClast©f t(i «6 x 
C J UbreakX   =i +*¦.insert(i,¥ d'[0‘ dñ  = NEWLINE.join$sz‘refused =s`._delió p  9 À   # TBD: whóat to do with refused addresses?
  òprint('we got some. bals:', ñed, file=DEBUGSTREAM)
C ñdef _deliver(self, mailfrom, rcpttos, data):1  w åimport smtplib ¦ E= {} 6try9  = 4s =: u.SMTP(),  �.connectŽ €._remoteù P[0], £ 	 *1]@ p  U š `s.sendã ( è 	� kfinallÃ  S gs.quit½ UexcepÛ ´RecipientsRÁ:s eÀ ½ 3 '» �  Ü 5e.rq Å — ™(OSError,|E´ oion) aš ï', e.__class__‘ f# All ‹ C wer•Âed.  If the ™ õion had an associated½  ä 0# e¹ ð code, use it.  Otherwise,fak *üa non-triggeringK ñ O . 0errd ð  = getattr(e, 'å_ Z', -1loerrmsg1 ³ º', 'ignore'8 „for r ina
 õ Õs[r] = (š ,
6msgM dreturnå1


£ñ MailmanProxy(Pure
 Áòq_init__dÐ, *args, **kw
 )  ˆ hwarn('P   is deprecªÐ and will be «Yved 'Wó  'in future', D; ÖionWarning, 2Ñ °if 'enable_PUTF8')™ n  [' ]F±raise Valueù)("Æ `does n2!upÍo &."Ž VsuperA~4)._>8Só process_messagehOpeer` –C io h StÊ%IOW  Ï % _Utils" 
MŒ $ uailList% #¯Ê  ÿDto ad.�ing list,Ùàn we'll invoke M µ ñscript directly,½`out goM pthrough= Q realµd¯#ÿn ‘forward i8 `plocal p q¶dispositionI  ¶ @name•%[]©  0  ý {  :tos^] =Áö.lower().split('@')[0L  G¡# We allowÓ  fo  é Pvaria“ ðs on the theme
   Ö#   listname
 (   o-admin _owner request! /jo^ 	Jleavœ ù	parts = local.split('-')b qif len(, i) > 2:  ì zcontinu] 1 = < 9[0]9 
X /==Y UmmandC 1C OelseŽ 5 ,''r  not Utils.Ÿ €_exists(  ¹r) or co?  + Iin (C  î   Q'', 'Î 	 ¸ 	 ¢   Œ  v/')§ 5õ s.append((rcpt,[,Ÿ )¥Á# Remove all) ð recipients from D @tos Köforward what we're noTð# going to take care of ourselves.  Linear rv öal should be finð# since we don't expect a large number\ ¯ .m1for· û  1 inç  ²sXé .› e<(�If there'`y non-û˜ destined9Uleft,� sprint('= !µ  s:ã0 '.îo ötos), file=DEBUGSTREAM… !if× ,toº Pefuseêðself._deliver(mailÄ,7 f, dataQ  Žb# TBD:ÓÃto do with rT ¥addresses?Ð  6 Ô bwe got- !alÒ 9 È 	c# Now ¦ ‘ directly7!heŸªsu mm p%{}   šStringIO(Ú ãmsg = Message. &(sû ð# These headers « ‚Pired Aðthe proper executionqÕMailman.  All‹ `# MTAs^e½@seemÕ 0add;Ase iD² original m  x doesn'I@have5 mÖ ifmp msg.geP<rom`msg['F D] =  ¦ C OdateC D  C `time.c ( . (@ * 9k>@send2to'«=	 ~ á  
  Õâ ) ñ   
î  G  ÓTList.	 Õ,ß:k=0V <  s[Y  w  ,O l % ð# dispatch on the type of cowmmand
  Qif co y == '':  ) m# post ðmsg.Enqueue(mlist, to 9=1)- +eld _admini  R - S _ownerS - S requestU / W 
ÿin ('join', 'leave')pùTBD: this is a hack!S —UW M  * ýmsg['Subject'] = 'subscribe'W OelseG /unI Î&ò 

class Optionst Ñsetuid = Trueœ % @name¸ ’PureProxy¸ òsize_limit = Non2 óenable_SMTPUTF8 = False


def parseargs({ñglobal DEBUGSTREAMx 2try“  B`opts, 6 ¢ = getopt. (-  $   ùsys.argv[1:], 'nVhc:s:du',' !['Ö ="noô   aversio@help  ã ( [debugH Â 'smtputf8']tdexcept£ —error as ÒÁusage(1, e)
• o€$ =Š(K qfor opt÷ 0 in ¥ ê  if   @('-hª !--´ V $   o 0S   3opt; V; ú > ƒprint(__ &__H  L  o_exit(` M%--fa ý .„+ ]   ­ c­ ½ºJ  °1argcK  dK Ö• ‹0 = å ostderrL uL O š e¡  sU -iz¥	 ;   @int_­0 = ´:arg¬ $ Š  ( ¸9 Þ  * È�    �'Invalid I P: ' +œv, file=0�   11ý#Á the rest of ‘arguments– pif len( V) < 1˜ �localspecž ’host:8025£ µ nremote& $ fa 2a  € 1[0]“ X Àn(args) < 3:#
  õlocalspec = args[0] hremote 1 Uelse:' ðusage(1, 'InvalidI ðuments: %s' % COMMASPACE.join(j 1))
C ñ# split into host/port pairs! Ei = § ¢.find(':') f i < 0Ž 2Bad8  Ã ‹ J A �options.  ~ m 2[:iñ 6tryb 	3 ¬ =½ (C  k b[i+1:]` öexcept ValueErrorH 8ª  O ª  ’9 		  ° ª ×    % (  ¾   9 !?  Q   R ° sreturn · ò


if __name__ == '__main__'s) € = parseƒ(J ñ # Become nobodyYPclassM $ =c . " ¥if "." in  i  Z–lastdot = !.r»2"."v  '  mod = __imê 5__(K #[:C Ò], globals(),Ð
 3[""c I 8 r [C  Ž³ 
¸u  'q as mod) O ö_ = getattr(mod,Ë Á Tproxyp 3_((aK,: ã !),`  ³  ; ä |<  = w ôsize_limit, enable_SMTPUTF8=$  È %if¨ fsetuidÇ	ø ± 4"pw(  âIÃã   ãprint('Cannot A ômodule "pwd"; try running with -Øò.', file=sys.stderrµ  Z     fexit(1 Ç éÒwd.getpwnam(' B')[2Õ ? á 2os.(/ V è ¯Permissionì I " "J è ;	¹ Óasyncore.loopÕ¯ öKeyboardInterruptÝðpass
#! /usr/bin/env python3

'''? /E r clientð.

This should follow RFC 821 (0 !), a1869 (B  B2554# °
Authentica‚Q) and5 Ð2487 (Secure M à over TLS).

N’ð:

Please remember, when doCq °, that the Çð s of the SMTP sñervice
extensions are NOT the same thing as ñoption keywords for ó(RCPT
and MAIL commands!

Example:

  >>> import smtplib #s= ó.SMTP("localhost")" àprint(s.help() ðThis is Sendmail verÂ ñ 8.8.4
  Topics:
  @HELO	 "EH ¨ 0   ¹   CDATA+ @RSET @NOOP 1QUI 1HEL CVRFY+ @EXPN# @VERB 1ETR ñ
DSN
  For more info use "D  <t› 1>".¦ 1 reqbugs inOi4Qmentaoasend eæ #to{     -8 @ @.orgW  { F| /rmH  ð	 Postmaster at your site? qEnd of ®  ½ †õs.putcmd("vrfy","someone@here¬°s.getreply(©ð(250, "Somebody OverHere <>   ? 0.my½ >G ñquit()
'''

# Author: The Dragon De Monsyne <d ±dm@integralN @
# ET@ supfÀ, test code ¯ðdoc fixes added by
#Éð Eric S. Raymond <esr@thyrsus.com>
# Bet=pRFC 821ö‘pliance (_ a  `,k @CRLFàSdata)f ðby Carey Evans <c.e	 ñ @clear.net.nz>,f`picky ò@ serí@.
# | ñ 2554 (authenticë)ñ ð by Gerhard HaerÌ"<g ñ@bigfoot.de>.
#
# Uñwas modified from“ðPython 1.5 library HTTP 4.

×Tocket $io
 $re
 Æj.utils kmessag( ”generator, dbase64 Dhmac Dcopy udatetimM Asys
É ~ E Dmime� †2_en"s 
 _( à

__all__ = ["MAExce"ØrMTPNotS`tedError SªÄDisconnected ‡ResponseL Ùh  ÛxerRefus9 ‹cipients CData} J C   ^ IHelo  aB 	K �quoteaddà   ÍÓ @"]

¢_PORT = 25 4SSL A465
£= "\r\n"
b b ò_MAXLINE = 8192 #Bpthan 8 Õps largex!an°821, 4.5.3
? €CHALLENGD ð5  # Maximum numberÙñAUTH challenges sent

OLDSTYLE_ @= reêppile(r"`p=(.*)",  I)”¾€ classesæ F 6FQule.
  1 1(OSb)¡r"""BaseG ðTall eias rais 	Z G"""
^ ˆ(t l À"""The commaô2nd or option is not supported by the SMTP server.

    This excep9 ðraised when an attemptS ñmade to run a commanv aK  @with: oŒ Pwhich? ’ �  Œ ¡"""

class© S¨ ÐDisconnected(À E­ !):w u"""Not %  ¢ 1anyC ì   Ž a unexpr Ely d� !s,q /or	6usekñ instance before? © aing it­ ¦  …Responseö RBase =vfor all×às that includeœ Iµ error code8ese7  are generaE„in some Ö s 9 P Þ Bpreturnsk f  oew  �stored in6C ``smtp_— '~�ribute of! =  , y x , c - G Qis sea ) # ‘ message.! o sñdef __init__(self,S, msge '   .œ ! =% J 
 k => 
 €args = (Û ] 
ï“nderRefusêü� P"""Se- ¢ address r6 Ç In iÑ!to72attHQby on$ ¹h · @s, t&qsets `sz '¹ X0strÊ`   P �  g", X â  8 o.R # =[ Õ Y Œ‚ ”¨Recipients˜Œ® „"""All r-  ~ —e™#Thþ s ¤Heach6 Àre accessiblEZrough¿Å 'j Es', `Pa dicõ0ary/bexactlùÁsame sort asD  ¨."smail() ±| þ S & =× o % x- 8,)
sPDataE™é›u 0"""M Æ >q didn'tB!pt6Qdata. . CLb % 1 duâ·üon establishmenta AHelo9 À .õü  our HELO replyZ  AuthenticaåðError(SMTPResponðseException):
    """Authentica � error.
 ðMost probably the server didn't acN  ñusername/passwordA bcombinY ‘provided. ð"""

def quoteaddr( fstring� Q Á a subset ofm `email 0 ó	esses defined by RFC 821Á ñShould be able to handle anything K ±.utils.pars‹ C can* ®  /pdisplayé ,€ / =B Í ð Mif (> Ã) == ('', ''ô  f '# Š  Á  l ñ it, use it as is and hope forBbestµ  K !if§ W. øp().startswith('<z  3 greturn7 À  Œ"<%s>" %# 9 	 ä_«X_only‚Sa)soV@Ô  À  =!ng ñ

# Legacy method keptŽöbackward compatibility.öPdata( ü2"""ð  C ž�0DouÄ@lead¹A'.',þðchange Unix newline '\\n', or Mac qr' into¾ ðinternet CRLF end-of-7 ÷  šîð re.sub(r'(?m)^\v Q'..',K ( ! `:\r\n| ¡r(?!\n))',f  , Ó #))ôÁ_periods(bin \w bx by  0 M ˆfix_eolsJE  F  E œ R

tryƒ Áimport ssl
e0! I E# þ_have_ssl = False
else òTrue


class SMTP# ‚"""This  ñmanages a connecˆQto an3  ÇE< ~§ rObjectsU  � o  ¤ `follow6—attribute4  8 •helo_resp×    ¨ !isH Ðmessage givenn0in @ 1onsh=theK mO°recent HELOCmand­ n   /ehŒ \'EHŒ  ñ Òusually multi	Ò Ÿdoes_esmt4 a  ñ value _after you dÜw A_, iÜ	c  r0sup•!s 
2 † š_featuresC À   This is aû$ dictionary, which, if the server supports ESMTP,
  ñwill _after you do an EHLO command_, containX qnames oe N  d z ñice extensions this ’ P, andS -irH ýparameters (if any).
& –Note, allk  Ÿ ò
are mapped to lower case Å J Gg ð'See each method's docstrings for details.  In general,Ò ure is ag A 5Q same¨  œ rperformi ?wc.  TheJ >lsoO ñcalled 'sendmail' that ÒÇAenti
‘il transa..™ 1""" âdebuglevel = 0j±sock = None$ Hfile ˜helo_resp Àehlo_msg = " _  
 + �does_esmtA BFalsg €default_¶0 = R_PORT• ðdef __init__(self, host='', 2  =0, local_  =Á ø� timeout=ç ÿet._GLOBAL_DEFAULT_TIMEOUT9  ásource_address_ !):" [÷"""Initialize a new instance\ð If specified, `­ `4 º ¶ ,aremoteä  .ã5 too pconnectƒ
R  `d  ‚e!F  Ø> O 3By € , šElib.‚   Busedm a•  ØÉ  ûK š = < °÷Ðif it returnsà°thing otherÇnïÀsuccess code� ‘ Cø PError\ 5raiš Y� `k Ë " aDFQDNs+ Ý nÓ ` HELO/P ¤O² Awiseù|= Æi)•und using? t getfqdn().ë* `Z%` ð takes a 2-tuple (1œ í)“ @^  é biboæ Bits `  ºb beforu º±aing. IßÈ  ^!''¬ g   0ì $OS-† behavioÉ…0be e÷p p  ¾.§! =j Celf. $ =ª
 9ê_features = {}! £`_encod\š= 'ascii'( Ï# =& 
- €_auth_chz–nge_count3 × !ifÍ   (¼`, msg)b  à oÊ›)l  3 "ifñg!= 220O À       self.›close()
  öraise SMTPConnectError(code, msg2 ùif local_hostname is not None:Y [self.- => 1 ;els? ñ# RFC 2821 says we should use the fqdn in õEHLO/HELO verb, and\  í ò# if that can't be calculated, 
b üa domain literalO ð
nstead (essentially an en6ùd IP address like [A.B.C.D]).J Å À= socket.get £`if '.'ë   
f Ý j , 	k d = 0# W @findÄ  :  áA, sos
 J  ð é = '127.0.0.1'  # >try¿   <    byb(  )’ >   eexceptI0aieÄn Mpassœ F�'[%s]' %Î
5 àdef __enter__(7 )g preturn  	. 3xit- w, *args4  C±, message =N Ú.docmd("QUIT"ÿ 0if 2 v != 221Œ    ß‘ResponseE-4ionäk W N ¢ServerDisc*edb 	M0fin

"  .|Cáset_debuglevelH&,   a"""Setè  � output 9 .g è ð
A non-false value results;: Tcs for Ñ 0ion0 &alé,  á1 to% Ñreceived from“ s ‡ 1"""å  “ û { ­ ' =â ¹ NCprin	$#if2; > ìF ¥(datetime.	 `now(). #()~÷, file=sys.stderrû‹X ’ 8  ì Æ Bget_­Å  Å€, port,  7out×ñ# This makes it simplerˆ y@_SSLwð  ´ñz  f#›¢just alter˜S1  å6bit} himeoutÃI  Ð¯ 
ÉIV["Ó'Non-blocking|# (< 4=0)[ 0sup6ed'hÒ0q ?_€,#('µ†: to', (c"),"psource_Rðess)
        retÿ&urn socket.create_connection((host, port), timeout,
  ñself.source_address)
> Cdef h (&  , j p='local 'v J=0, A q=None):F  ‡ B"""C± Q to aH ± on a given¼ .u  / aIf the& õ'name ends with a colon (`:') followed by a number, andy ±there is noe ð specified, that suffix will be stripped offI  ˆ M a ð  interpreted as" [  gto useÎ ðNote: This method� òautomatically invokÈ Ä__init__, if*%is„ À ð during instantiav 6"""Q+if¡› p Ý+ =2 	M 2notô Aand €p.find('–!==º%.r 
 o -i " à   Šf i >= 0¦    vuD B[:i]˜‰[i + 1:]K  4 >tryI    2  =Ð( ): ÿexcept ValueErrorH �raise OS# Á("nonnumeric$"X 4if :
J    r ‹€default_ ’ ósys.audit("smtplib.š0", ¿q   .9] P_get_ !et·1 C .;? pfile = Ò� ´(code, msg)Z –getreply(?  vÒ ¬buglevel >Õ¢ ã_print_debug('Ù �:', repr(f U 0ret‚ š ­Csendªst°"""Send `s' [pserver.% 
  ® $ t « &s)© P  n
îRif is¸Pce(s,v¯  �    # \  -"us º ñ'data' command, wâ •_encodingª I   �# should� be£sd, but Q PneedsqconvertØ _ng toP  �binary itÃp anywayX'rÍt a problem.A s9.° e´.Ä K Á   ÿs/ õ ª .; Kall(6 ñË
¶…  ÏWcloseç    QSMTPS^3DisËBed('    '´ Jelsep Àraise SMTPSeórverDisconnected('please run  ñ () first')

    def putcmd(self, cmd, args=""):$  ( ð"""Send a command to the sew E.""", !ifA f == ""C  G 0s =b + Nelse" �f'{cmd} {ˆ %}'. òif '\r' in s or '\n C  s.replace(% ‡, '\\n') !r' 5r')_  ¡ ùraise ValueError(  " $f' �argumentsa÷tain prohibited newline characters: {sÑ  P €  �ø.send(f'{s}{CRLF}©0getÖ y«
�aGet a  X fromœê l ð Returns a tuple´ ¶sisting of:( 3  -Ù€ respons, ð de (e.g. '250',‚`such, ñÆll goes wellÓ  u sNote: r{  -1/ Úit can't readd .‡ 0str¯ 2corš d *toD p (multi}	À3 `ses arÒ @nver©Õto a single, ;  l )’ Rqs SMTPSùp Ù àend-of-file isß Uched.† ( Ž U = [] 1if ? <NonAelf. =+ �sock.make G('rbÑ wh‡ 1:try  ¤ * R  I .˜  Ú(_MAXLINE + 1Ø‘except OS)K as ¬  Y Ï jclose(>   mM2("CÈ‘ion unexpÔ1ly N 6d: q L  +Ï:(e)‡ pif not ë ½ F"… k ïdebuglevel > 0� q_print_, !('ò0:',û r(Ç á 2len 4 > Ï] \ª
REþ°ion(500, "Lé›too long.á  ê@.appÜ ¤ P[4:].^�p(b' \t\rž
acode =š6[:3$ éÁ# Check thatêe¬ 3 àis syntactical0 +&ct„B  Do€pattemptÎ óàpntinuaty ­  × itÎjbrokenI O1errŒ `= int( 
Ü ;g�C %-1  º   Qbreak À        # Ch÷eck if multiline response.
  0if  é[3:4] != b"-":"  - ebreak
 perrmsg . �\n".join(_ )" úif self.debuglevel > 0Y ! q_print_( ð('reply: retcode (%s); Msg: %a' % (err ", ƒ )r `return ! ´  def docmd(t ö , cmd, args="")• ð"""Send a comman%  ndŽ  Z 5itsD d E."""ñ  Y @.pute _ ž & 1getè "()ž ¤# std smtpx sW  ¶ Cheloµ {name=''° PMTP '& '= à@Host6 P to sÙ „for this+ � defaults" Àthe FQDN of  Qlocal‰  FhostZ ú "Š 1", v "orI _A   (E‚, msg) =+  u   3 W _b  =0 – õJ S ;/eh;! S< ' <keûå_features = {}á þ W  ¯ O_msgd:°# According
öRFC1869 some (badly written¾ð# MTA's will disconnect on an § a. Toss µxception ifÛ õ# that happens -ddm !ifbò  == -1 and len(*=Hfclose(Ÿ  ;QraiseçuServerD¦ Bed(" S not ¼ 6ed"A nx   [!= 25×”  �   T Qdoes_ôu = Trueö a#parse} @n	ñassert isinstance .2 #ë, bytes), repr à Ö “ < 0.de•ö("latin-1").split('\n'< 1del� 5[0]½  \qeach in W ú À# To be ablec añunicate with as many®! s¯s •possible,i O awe havL 2tak5Àold-style auS ü
dvertisement into accountM |because³ ²1) Else our˜ ¤ ¨Pr getKfnfused¡ Â2) There areJÖ ÷donly a¢ ôµ –methods wP Ñ   support us©qhe old ò ~ À        authñ_match = OLDSTYLE_AUTH. ‡(each)
  rif auth6 :  & ý(# This doesn't remove duplicates, but that's no problemH ðself.esmtp_features["y _"] =   R.get(" }, "") \T      w+ " " +È Ý.groups(0)[0]8 ™continue
 ð2# RFC 1869 requires a space between ehlo keyword and parameters.
‹  0# Iñactually stricter, in.0 on  ^ Ôs are allowedk › h qòwere not going to check for_ »here.  NoteK  ¬C theÛ iØ present if  � ` à cm = reUcr'(?P<×Æ>[A-Za-z0-9] ¯\-]*) ?', ‚myO B = mÎ#(" 0").+*r(É {'s4  r‡ng[m.end; 0:]. p=  3if b B == {˜  g ¯ [; Î	# Ï b ÓÑ 	Â  Oelse› "P òreturn (code, msg)Ðdef has_extn(î f, opt)s p"""Does-ñ server support a given SMTP õice extension?"""Ï  4optÒ  p +– 3elp’ zargs=''– v æ'help' commandšRï  s  ¡ text from¥ 8er.š „ €putcmd("/ 0", p s¼ ) Ögetreply()[1]¬ Arset¬ £   £ @ -- ‚`ts ses(Ž Î `_encodõœ= 'ascii'P” !do¼  g "Ö_ •   Internal '! ™ ¡which igno!nyØSóòDisconnected error.ý  £cUsed iV  lyÙ uèlibrary, since@dN Ø Ðshould appearí J "ap„pion wheW„e *next*úå is issued, ifO !werd;%an¦ ’ "safety"Œ86try é n 5Soexcept+
? Bpass6 u2nooß3  š%--–Ðdo anything :c>"""
  ñreturn self.docmd("noop")
# �def mail(! ñ, sender, options=()):(  N �"""SMTP '1 ñ' command -- beginsI â xfer session.e  = òThis method may raise the following excey :9  t ôNotSupportedError  The§ ð parameter includes '7 UUTF8'À  ‡  1but‰ 2 ` extenÀ ” is not s| ? byO  Ô userver., ’\†list = 'Ÿ %ifÐ  W ‘¶.does_esmtp‡ Ã ðif any(x.lower()=='% äutf8' for x inO Ã <   "if–has_extn(? .   2 � ó`_encod²= 'utf-e Jelse´  F   ú mÖ(1 )  Ï� l)')< 
eâ ' + ' '.join( s1 Ü 1put Ýò", "FROM:%s%s" % (quoteaddr(#)$ È)K o—getreply(lCrcptlTrecipG k 0 	kÁindicates 1 B AientótbOail.n=1 ê  ²M ¿  M/TOKÀ J%CdataJ7msg¶§IDATA< » …`ssage A 3 to@«áAutomatically úrs linesénúÐwith a period v rfc821ôRâs¿BData· ifk reZáan unexpected + � 5theË Ã i;:  a²value from øZ!is% UfinalE Ðresponse code5¡eived when. 2all is¥t.  If msgB ð	is a string, lone '\\r' ¨ð'\\n' characters arj 0nve­5 toF  4 - k  �bytes, it €transmitVas isYß	» Ò"Œ(ð ,Y2) =ñ”_êdebuglevel > 0¼g q_print_(  ('m H:', f | "ifnj!= 354M E 0Cðif isinstance(msg,–ð):
             ÷   msg = _fix_eols(msg).encode('ascii')
  q/ Âquote_period4 	$ ùif q[-2:] != bCRLF:   O  H 2q + 	  ?"."! ºself.send(qœ (· ,Ô A) = ' šgetreply(* "if îdebuglevel > 0¦ D q_print_, §('data:', m 
\ hreturn  
à °def verify(W ¦, address)w ’"""SMTP '( ô' command -- checks for9 Ñ validity."""c  Y \ ð.putcmd("vrfy", _k `_only(
  u ´ ° 8 /�# a.k.a.]  L # =Ã Ó OexpnÑ  & 	Ï ÿexpands a mailing listÊ  A Ê $¾ ÷# some useful methodsÆ ñhlo_or_helo_if_neededØ 
 BCall<Òehlo() and/or  > b() if @ .a  —õIf there has been no previous EHLO or HELOõàthis session,  Ê  N À � tries E4C Wfirstv TC - �may raise‰ p followx¶exceptions:¯  T �HeloErrors  ñThe server didn't aÅ properly to§ 4  @the .’ greetingd ) Íi¨ + Ð_resp is Nonewt ‡	 O N  Œ“ot (200 < 3 P()[0] 7299â 3   Þ s L … H + b  „X  1 …	ao … .AauthƒÐ, mechanism,  ñobject, *, initialÇonse_ok=TrueÕ Ð"""Authenticaêc°- requires ë  @  Écu ”Ê'� €' specifzQwhich‘ \ *  ¬b~1d -€¼ Â`ues ar•1oseQed in% 'ì '… ÷element of 'esmtp_features'ô5 !ò' must be a callable  @ takþÐa single argu^  ®0   ó! =è = ²(challenge)® ) pIt willn  l @ed tâoMÎ 65's > u;! è   • 0 itNepassedg òa bytes.  It should ÎK Àan ASCII strï Ðthat will be óbase64 encoded and sent to the server.

  õKeyword arguments:  " ð- initial_response_ok: AllowY AdingY „RFC 49540 -0 	O  ˆ ñAUTH command, ifD õauthentication methods supports it.N 5""" %# ~ a™  s J @ Ôto provide an     §.  Not allP {  z �  By def$onµ °y return so5  WotherM ñthan None when challenge is ,ý n �y do.  Se ¦sue #15014ö Åmechanism =  ….upper()s £ ³@ = (€object()p$ �_ok else’ K f1 · 1not) 
-S# =€_Ž(m .Ÿö('ascii'), eol=''x  |(Ã,©ð) = self.docmd("?&",� + " " +-  ¦
J ; __~¥_count = 18  
Ò ƒ r 0r C# If”» –ds with a(,i  $ &se`while *z == 334Á ú +û  p2 = ¹0.deZ `bytes(Þ
å    mðà  W    {~f )- 
• SQkeeps> ˜z 's,®†is wrongS ± i—?lf.5ú > _MAXCHALLENGEs ? ð raise SMTPExcepÏ( ) !"S‘ ÑÏ!inhÅe loop. Lastü&: ú C   ý8pr(³
 )  "if6Úin (235, 503)Ê ÚR Å â A¶YError2 3 1def• _cram_md5(š,å=!€ @""" Z 6 72use�CRAM-MD5Q 0�. RequireòWlf.us†qlf.passñ@to b*t.K^ Pdoes é€	Ú2 LÖK å  Œ_ 	­ Åšhmac.HMAC4) À =Àii'), challeð4nge, 'md5').hexdigest()

    def auth_plain(self, challenge=None):
*   ñ""" Authobject to use with PLAINK ðentication. Requires Y ‘.user andz  P  €passwordO ¥be set."""$ Àreturn "\0%s A" % ¨ O ,Z D Ö ?logÖ *?LOGÖ C&iff@ is i2 orÎ _’†¦_count < 2Š >E [3Oelse+ ,& I $, $ û, *, initial_response_ok=TruôLog in on an SMTP server that r	 Û "…  Î ûThe arguments arÂ -k r:*   /  ¬ P name;Y “. 1 -Ô D  @ æ 0 fo§ e¿� 1Key£¡ 
_-$ô: Allow sending the RFC 49540 -T	¬  Ð  / ñAUTH command, ifD é ö	ion methods supports it.¹ I4 ðre has been no previous EHLOvDHELOh @ thi°assion, � l � tries EåC Hfirsv TC - Swill «�normallyË  waÇ ‡ccessfulÆ P ‘may raise fod _Pexcepv&s:ÿ ‰�HeloError   ¡Pdidn'£õ ply properly to÷ 4   ¥×helo greetingu  -î… {  ac¼ Ñ  Ô Ó/~ Àbcombint8  � BNotS#ed    � [ �4notCPed by� K ú  Cö E‹%  ¬No suitablhÃO wasr Vfoundq  +6 €ehlo_or_˜Å_if_needed()& 1if î àelf.has_extn("W*")ØhH(O Þ @   "(  XPexten@i � W1"ª = #T'sƒE`claimsè ¡advertised7ðlist = self.esmtp_ófeatures["auth"].split()

  ó0# Authentication methods we can handle in our preferred order:
F  _i ðs = ['CRAM-MD5', 'PLAIN	 xLOGIN']� ðWe try the supported G – s� G, ifË C TerverJ sW %m.$  W @list¡   A forl  a Þ Å 5 å   %if/ ¡advertised0  W ]4 aif not,   * E ð raise SMTPExcepxÑ("No suitable7 þ ”‰ found."¾aSome sô %s ’ A åy don't really° #2S, so æ ƒ afails,ðontinue until we'vÁ7iedM 3all¶ s}±self.user,  ²password =   I ž• ¤ µQ  �_name = '% A_' + ð.lower().replace('-�5_')m  š:try«  â(code, resp) =¼  c (;  *     t  , getattr(ï ,¦ /),< €initial_k �onse_ok=  
´  u «# 235 == 'Ï½successful'r Q# 5035 áError: already7ü.ed8 0if  �P(235,G )7 ˜ xreturn B	‡ e 
¹ ’ ^ as eY Rlast_:  ²;= eOQcould€flogin bly.  R•  result of Q † attempt¯¦  m i Ãdef starttlsÜøkeyfile=None, cert aontext )a"""Put–p connec
0 toµÚò  into TLS mode.…  _ If+ àre has been noŒñvious EHLO or HELO command this session, ‘¶€ tries EŸC ]firstv œ ´s  Q Ð will encrypt¡  ;i ¡ X s ‰ ñ. If you provide5 S ¶ Q¶ parametersB V  id± tyÏ   f ¢ A QlientÓ÷ be checked. ThiI PhowevŸñdepends on whether’ `socket…3uleBL ÅÖ  ®  ifR'es8 m R may a ® ¥following ×&s:çBHelo ú T5þA didØÀeply properloy to
  õthe helo greeting.5 5""" Ðself.ehlo_or_0 Å_if_needed()& qif not - õhas_extn("starttls"):*  ˜ ùraise SMTPNotSupportedError()  - ò"STARTTLS extensionl 8 Æ by server."’ ò (resp, reply) =› edocmd(R / 0if 1 z == 220¯ Ý š_have_ssl  ¤ Ñ rRuntimeÈ ’"No SSL s§ ÷	 included in this Pythonƒ  I Ñif context isç øNone and keyfile ‰ DValu‡ O C öarguments are mutually õ ‹  ¯"exclusive¹ Ocertº -D » C\ E or v Œt imÀ� warningsÁ .	 $("l  ‘a  ˆÿdeprecated, use a‘v"custom3£nstead", DL BionW˜ 6, 2 Ü
k gÛ =ó= ssl._create_stdlib_ (Å =	 , p  = 
® Zdsock =ï `.wrap_ 5et(  } 8¡_hostname=G    Å = +	â ª# RFC 3207Bû&# The client MUST discard any knowledge obtained fromZ  ¦¥  , such as  qlist ofEþ6ice!s¢# which waT	q O  _€negotiata!it
	�  *	" ," þsmtp_features = {}i `does_e* … = False$ Lelsej‚À501 Syntax e`ú (no parameters allowedîa# 454 ðot available due to teò¥ary reason™  ã ÜÐResponseExcepV	“5 zreturn   Ádef sendmailá,"‘_addr, to	 ðs, msg, mail_optioŒns=(),
  ¡rcpt_optio" %):# ð """This command performs an entire mail transacB %.
> öThe arguments areY  ƒ °- from_addr !: 0 ðddress sending t  d .W  - A- to: s Ð : A list of P �esses toG D É to.  A bareO E  0str~ òwill be treated as ai dwith 1m � 6msgN Ù tmessage• 2 4ail„C : LÍ cESMTP œ` (such… ÿ8bitmime) for thÎ  @Äy ýy 4DSNI s} G0allž  e 8 " (0mayc#a tpcontainÑcharacters inI öASCII range, or a bytþ C ä ° is encodedz - @s us] tžPscii  0c, á6lonN 1\\r G\\n ‹  are converjto \\r# â  If¸ ðre has been no previous EHLOÇ DHELO ¯�session, eÒmethod tries C ‚first.  n ¤ server do& $, 6sizá  ò @each7 •specifiedrBpassCih  x ˜ qfails, Ç 3  ¥ d@© Å@suppã'ed'fÞ A Pretur-�rmally iHn€is accep  …at least� Áone recipien¯ 1t rP  ¿!di¨Qary, Æ . QentryM I E ð that was refused.  E:9 ´ _ TtupleQ ¾M Qerrorm q�accompany‘  ©`ent by>Ð/ @Qraise+ afollowO x# Ô:“ ’ QHeloE� ¥ {6@idn'1õ ply properly toÈ 5 	  Ñ ×helo greetingk w R’"sRD òw PrejecÒ6ALL½sv 2(no �[sent)w eSenders  µ î PB•H OData6@repl9R�an unexpÑ Â ø …` (otheÑBan ak_al ofD  - ð
 ÀTPNotSupportÿ*edError  The mail_options parameter includes 'SMTPUTF8'
  „but the 2 ÿ extension is not supported byO  K …server.
- QNote:f `connec¸ ð will be open even afÅ qan exceÝ  ƒ graisedN †Example:` p >>> im¦ … smtplib|  #s= .ç Ú("localhost")) ôtolist=["one@one.org","two@two `hree@t  Pfour@  ]T ¶msg = '''\\ ð ... From: Me@my8 
 ùSubject: testin'...! 	 P This-a/  m    `s.send74("mq "",ï G,msg1{ "Ü â ü : ( 550 ,"User unknown" ) }i fquit()�!Inúrabove e¼, àmessage was acóñed for delivery to ‹ d !of:  kò addresses, and onJ  re8�ed, with/ e:EcodeI Æ550.  If allJ E are‹ ¥ ½ bmethod³•return anL �empty diØ7ary¬5"""' öself.ehlo_or_helo_if_needed(eª ÜVs = [Kõ	if isinstance(msg, str):_  èk�_fix_eols' @).enú †('ascii'j 1if “ Qdoes_w 
M   û has_extn('size's  w = ´ �.append("+ ¡=%d" % len‰ z  4  èoånÑ
†  , ` : R (ã ’, resp) =Ø îPfrom_*&, F 8 0if : z != 250z  j== 421  – =Wclose¿  Oelse/ @_rse '  á€×SenderRefusedÓ %, Ç »  Ñ0err'{…
'!toü s,  g o Ÿ„each in  
Ô   )sPrcpt(7  ,    £µ  ô 1if < u)¾ 1b í [] 2] =B ñ	¶& › ‹¤Recipients�ƒ Í !ifÜ 1 == 0È #Œ" råUour rp Î À  self._rsetG()
  öraise SMTPRecipientsRefused(senderrs2 ö(code, resp) = self.data(msg& 0if ( ‰ != 250:p  j== 421  — S [close© Oelse/ [_rset/ Ø ˜DataError½ ” ñ#if we got here then somebody …our mail3 treturn 
 1def �_message(É ñ
, msg, from_addr=None, to s ?  û 	  r ÷_options=(), rcpt )Ã"""Converts ~ ð to a bytestring and passes it  ¾  d .¿  | �The argum± are as forØ  , Ð, except thatÛ e is anÁ e% .ƒ ".M	Æ object.  If
 :  5 or5 isK   ,�s” QtakenI   ± headers of u aK ñdescribed in RFC 2822 (a Value Ž 11d iH  re !moâ pone setn ”'Resent-'ƒ Õ).  Regardles‘ ve   �é ó, any Bcc field (or a  0, w�Dthe ç  €K r‘ )� $ €ð	 won't be transmitted.  õN I 2  isS é°rialized usMè°generator.BhG 	ß g O`called}ƒ  ` ³! ¹  4  er %of˜   r¦ QeÒðcontain non-ASCIIƒ \ �server adiþ5theP  öñ UTF8 capabilitytq policy´ ñ loned with utf8þqto TrueP "se)a¶ ÒdYc  �ÓBODY=8BITMIMEa“serted on° 5nd.  IŒ Å õdoes not support\  j  BNotS @ed eóSá�.  Otherw÷ QÇï £ ï  out modifyóç 95"""´ $# PDate'U `a mand*yÞeÆ¼$ ( P 0SecPð	 3.6.6). In such a case,¾!us¹{ "*'i Çs.  However,R  ä Ü¼ p' block”0re'ww way toF ñunambiguously determine whichN AÀ most recentƒ1allº s“ Pso ra˜ \@n guC1we µ ¬ +!atD ,#š  TODO impleËð  heuristics to óguess the correct Resent-* block with an
  ñ# option allowing= áuser to enable ÷heuristics.  (It should beL Qpossi2 "o ‹ ‡ �ly almosth 1 ofS utime.)
@ õself.ehlo_or_helo_if_needed()& rÑ ó = msg.get_all('ç VDate', 3if / …is None:G   õheader_prefix = '' ’elif len(@ o) == 1> „ E sr ðraise ValueError("message has mormtan one Ô "' ¨ Â"Þ ¯from_addr á `# PrefÌõhe sender field per RFC 2822:3.6.2.ü  Y r= (msg[„ ,A+ 'SO )']7  ;  Oif (9 @) inÄ@ 	@else$ ~ fFrom'] u ´ °email.utils% #uesses([& v])[0][1Á Qif toNsO F _@Às = [f for fÈ #_To'],à 	 ¶  e?BccC -,Cc(r   ifÄ Qs not$ ! q= [a[1]ô aô c')M ð# Make a local copy so we can deletýSe bccòs”Amsg_3 =: .  u0del+& !['9{
 ¨
# pinterna–al = FalsÛ:tryýw''.joinO4, *,÷]).encode('ascii’ except Uni  E& 

_ !if�úhas_extn('smtputf8').  ¨ZñSMTPNotSupported[ ( )  r"One oruQsourc �delivery Æ3Ÿ require"G  :Qized " s… Q, butðoserverG 2doe„`advert( È}  d Û ÷ UTF8 capability Ö 	‰ f = TruÂùðio.BytesIO() as b :msgOiÓ
  j 2g =å ¢.generatorY G tp �, policy=Ä p.clone(ß=¹ )Ú r    Ó_¯ €"(* Àptions, 'SMT÷PUTF8', 'BODY=8BITMIME')
  Yelse:   ôg = email.generator.BytesG  (b :msgO ûg.flatten(msg_copy, linesep='\r\n  .  mso P ¦.getvalue(Z ðreturn self.sendš á(from_addr, to	 3s, P  , # �_options,à  ä  Drcpt+ !)
,  def close(t )!@"""C ° the connecc 1 to ñ SMTP server."""L  h 6tryD   bfile =Ò   *    t . y = None 0if  
O  6   .µ :kfinall} Dsock}   	` }   }   }   } P  COquitB ˜Terminate4Yssion54res¦ pdocmd("P "Ý ô# A new EHLO is required after re¡tng with±Zî ”ehlo_respo &he 	�/ ¢smtp_featu£ !{}ò  …! `does_e& v = FalsÂ  ¥ßòres

if _have_ssl:�`class [P_SSL(	 
’P ThisRa sub/ €derived &< T thatÕs over an SSL½  encrypted Ï�et (to us§2is X `you ned% Pmodul$ eat wasN ‚compiled{ðSSL support). If host´ ðnot specified, '' (\UlocalL  - ). Aused?  I   Pomitt9  5 �standardñ -ã -x  , K G(465K  i _a pname anþ AurceS@ess �ªs! umeaningP  as py do in } .`.  key™X Bcert ‚re also ¡Eal -P €they can«ð tain a PEM formY`d priv<5keyV @ific  ch2  d P 2for–  SLS ±. Jtextˆ ,z E `SSLCon0 ,t  is<°alternativeë ;ëiéL í_ both!qmust beþ. ^ SH €default_Þ! =v  V_PORT3  ‡�__init__‹,zP='', : ;=0,=ò3ã #  Ð ™  ª  ‚timeout=Rÿ	._GLOBAL_DEFAULT_TIMEOUTo (so‰g ¹  r àif context is ô	not None and keyfile is  ;:
  ù
raise ValueError("contextC ý	arguments are mutually "O ^ é  "exclusive"). 4if j ¡ v Ocertº -D » C\ E or v Ó tù import warnings A .	 $("l  Ôa  ˆÿdeprecated, use a‘v"customz£nstead", DL BionW˜ :, 2²Tself.� =_	¾ # ¤ =	% 
ú ¯#ó= ssl._create_stdlib_ (i =	 ,h  K Ô = ö  r $ =:	i àSMTP.__init__(€, host, è€, local_ ßname, timeout® 	õsource_address)
p ÿ def _get_socketn  ^ )U0if ™ ú .debuglevel > 0$  -% q_print_, à('connect:', (Å × )'3new“ ¸ = super().© : B 	 lvS.wrap] (h ?	 Ê  eserver‹=î  › 
Œ vreturn m �ð__all__.append("ùð_SSL")

#
# LMTP extension
#
 ñ_PORT = 2003

class) (> ¦0"""+ @ - L,ò Mail Transfer Protocol… 1The@ # p p, whichèðvery similar to Ed , Ñheavily basedNðon the standard + ð client. It's comm& o^RUnix vQs forE  ¶ €, so our )à() method must Ð that as well ‚a regulaI  „:( ¤+. 7
R haveÅ 1ame� 0meaT ` ’they do iè ß ÷ass.  To specify a Ù T2you» Uó n absolute path[ á°starting wi R '/'.§àAuthenticationƒ0supá ® 4  ~ñ mechanism. WhenÒ  us+ 
¦  ðgenerally don't supð:port or require any
    authentication, but your mileage might vary."""

5 òehlo_msg = "lhlo" ðdef __init__(self, host='', € ð=LMTP_PORT, local_ ¡name=None,‘  `  âsource_address& õ timeout=socket._GLOBAL_DEFAULT_TIMEOUT):O ñ"""Initialize a new instanceÕ p …super().Å    ¼ ² 
Á ¼  U 
Ä 
Ó ,Î Ö )KyconnectJv  – S:0, R %
ý CI € to the †P daemððon either a Unix$ca TCP _5"""I!ifÑ¦[0] != '/'d î treturn FÀ  ¯ E¬ 
 ü  K 0if A.€ is not 'A and ! ‰ óaise ValueError('Non-blockingÚ # (] 4=0)` 0sup©7ed'Œ �# Handle s-domainD %s.:try… Ÿ  E# =. . 2et( €.AF_UNIXÁÉÅSOCK_STREAM)W G  
�  G ‘ C.setü ]f
v / afile =x	“   � .æA ‘except OS€
Œ Üêdebuglevel > 0$ ° q_print_, #('m r fail:'_u  5 ]  œ S   z.close(< Õ ò rT°(code, msg)ßÇelf.getreplyU � ¾ ê u æ  á  a u `| ‘


# TestÙñsendmail method, which tests most of) oñðs.
# Note: This always E s+k0.
iØ ¨�__ == '__#__  ørprompt( ósys.stdout.write" v + ": "€( WflushF÷ " óin.readline().strip(­@from+2 = ˆ c("Fromf  to s âTo").split(','Œ oó("Enter message, end with ^D:O ÿ!''ž wh(1q Ÿ  þ 	´ 1 « Ô + 9   Ubreak' i    + ,  § M¡ p lengthÆP%d" % ð (msg))

    serû$ver = SMTP('localhost')
    server.set_debuglevel(1 ðndmail(fromaddr, to is, msg, õ8quit()
"""Routines to help recognizing sound files.

Function whathdr()- ÷es various types of= ð  headers.
It un ôtands almost all# ð, that SOX can decode.

The return tuple contains the follow± ñitems, in this order:
-Ã š A (as_ ‡ °it)
- samplE ðrate (0 if unknown or hard%”  1 `numberë �channels6 bframes­ e£ ?(-1w Qbits/·  e,£ Ò'U' for U-LAW A A B

If0õile doesn't have aÊAable*C, ittys None.?  ca= ðbe opened, OSError is raised·‘o computex òtotal time, divid H by/ 
Ú ‘!a  ûa³  sr each ˆ)­†() callsº@.  (�!seÕñ	also use some
heuristicsOÒraw data, butY=ðwork very well.)

Finally,Â $ f2`test()Pa simÂÂmain programö£ @
wha+  È }@ menzQed onZ @argu ô list.  For directory
 sÄW ú !()Ð W (&at: ¥.  DefaultD  µ P"." (Ä  Ž? ‡e currenF  ).  The
opµ ` -r te~ itA`recurs�%wnz  iel nùinside
explicitly give* .¹0

#e 8�structure® Ptop-d¶Pexcep²a  e Â sâand its
# subr ®ðe last.

__all__ = ['•1',  phdr']

fa colleás import named¥b

SndHû' = &(' !',á å 'ü Où—nã1s nsxwidth')q .= a.__docÈ @("""JBvalu6^ pindicat!heê
"Pwill æ neé nÐstrings 'aifcAaiff ðu','hcom',
'sndr @sndt !vo, 0wav @8svx  sb u Çor 'ul'.""")9.ç  ü É  "_   ¬ beither'bctual
ñ <or Õ�difficul™Ú� s�  »˜f  itÃð not be
determinÁrâ Ið value is difficñ4ult to decode.""")
SndHeaders.nframes.__doc__ = ("""The value for f# ô will be either the number
of$ ]or -1e ›sampwidthg EJ  # ñle size in bits or
'A'ƒ ²A-LAW or 'U u i ñ
def what(filename):
    """Guess« ðtype of a sound ,  @ * Qres =D 6hdrG  ¥turn res

k 	' n `RecognÃ d he1"""K •with openc Â, 'rb') as fG  ¹ ñ h = f.read(512)<   `for tf Vtests1   Ä vtf(h, f4    if¿ 
/   !reÛ V(*res<   ŸNone


#- ó#
# Subroutines perp ‡#L 
ç R = []{  R_aifcå Ò pimport  *ð if not h.startsuƒ(b'FORM'ü Ü   òif h[8:12] == b'AIFC'a   pfmt = 'e 'f /el2  F2 f2 &seQ \a r.seek(0~6try+ 1a =Þ .; 4'' òexcept (EOFError,(  ì | ±(fmt, a.getcrate() Ánchannels(),ñ  ¥   0 7 . 28 *D  ÃæB())
»….append(¸)D uÇf³H.snd³ñfunc = get_long_be™ Š0:4]ÿ(b'\0ds.', b'dns.B 	lB š
1ile·  uÌAhdr_¬ = – r(h[4:8]•Kdata X €encodingã³unc(h[12:16<  ƒ C6:20 � S20:24  }$lew ±1 # default#6if x 6= 1\8 p=^0 S2 22 80 30 !161  I{ G2 (elŠ" � ?|¬ê # E %* %M i—, ‘ ¼6 = ©/À) ; 
ˆ 2 !-1 @ C  , ·,~ ", 2 #, Ÿ  Â uLhcom�[65:69] !•PFSSD' 6S8:132 GHCOM|Àreturn None
ð    divisor = get_long_be(h[144:148])
& $if) :   ärate = 22050 /   Melse) 0 ð return 'hcom', E ð
, 1, -1, 8

tests.append( _) �)


def  ’voc(h, f)b óif not h.startswith(b'Creative Voice File\032'5 À Š ANoneš csbseek	pshort_l
S20:22 ¯ 2 = Ë ƒif 0 <= 9 Â< 500 and h[ b] == 1§ r aatecod6E56 -) 1+4]ƒ  % !if ( :   | aint(10 .x   - ©_?voc^9voc]9wav]’mport wav$ó# 'RIFF' <len> 'WAVE' 'fmt  È ”: ó) or h[8:12] != bD  S12:16 T Ù ® f.®"(0÷ 6try+ 1w =² Â.open(f, 'r'' òexcept (EOFError,(  | ð('wav', w.getframe|#() Ánchannels(), µ 7 n8  # 1 8* Ïsampwidth()) 9wav¢I8svx£ ^FORM'lV8SVX'*Ù U¢# Should d¨Pit to$ #Ý ñ -- assume always 1í K 'Ÿ A', 0Õ0Ô % 	Õ KsndtÕ ÑXSOUND¿n93les±º°[ð ~ ¤$ Õ& '‰ 9f É  / É rÉ H\0\0È   #:4s ž aif 400m/ †<= 25000Ê & ƒHsndrÄ [ )  ¾ /#- ð #
# Subroutines ÿextract numbers from bytes #
\ æ‰b—Ü ñ(b[0] << 24) | (b[1 #16 2 8 Bb[3]7Q >le(Q 33 Q B Q ` Q 0Q MbR £ 4 14 † h :Amall� programh#  7(IÀimport sys
 ÷   recursive = 0
    if sys.argv[1:] and ¡] == '-r':-  1 7del! 5:2] ] 1 6try9 j   V ˆtestall(Œ ,¯ A, 1)R  , Oelse> _['.']7 ö	except KeyboardInterruptG  y õstderr.write('\n[( fed]\n'ƒ  . Ôexit(1)

def À Ilist� ’toplevel)k `importAÏ  !os ðfor filename in M 7  ÷ ôif os.path.isdir(+ [  $   Uprint ÷  + '/:', end=' Ä  , &ifdD or ® v  &   V 'ä‹ng down:O  ) Ó AglobÕ     Ù @s =  . (Ò Pjoin( u.escapeÀ v), '*'){L rT 	s0- / C Ð ÷*** directory (use -r) ***Û B > � dc +Ústdout.flush(ž 	# ™   _ 6whaÈÑOSError¯ ß “not foundÖ `
if __7!__ßƒ__main__å Yð()
# Wrapper module žð,_socket, providing some additional facilities
# implementedÑôPython.

"""\
This] P 2es a ` operaR s’ e @relaI Afunc ð.
On Unix, it sup\as IP (ºÑnet Protocol)H  - 0 doð j sE Pother–AtemsN HonlyS 4. Fw ‘ specific#a
³ óare available as methods of thep ¥ object.

P #:
C ú() -- create a new5 ' Kpair+    h 3 Ës [*]
fromfd4 · �  # 0 anyn…± descriptorD ‚send_fdsF MSend' 'toé f.
recv2 |Recieve5 sz !.® Rsharek ±  @dataÂReivedJ & .A  ÿ g‰ stóS areturn­ ¢current ho! 
- &by/ Umap a" a to itgfnumber3 3addš3 n‹$  ]c  A €DNS info< Nservo   @ice ‡ ¼auÌ Pto a ò c  K pîL Àmap a protocðol name (e.g. 'tcp') to a number
ntohs(), 	 ðl() -- convert 16, 32 bit int from networkD ñhost byte order
htonK  	 K @ %toS K šinet_aton‘ ñIP addr string (123.45.67.89× 032-® ápacked format
M JntoaM , 0 IPÚ ` ò

socket.getdefaulttimeoutW ƒget the    d value< s< s< 
÷ create_connecti  s± !anð ess, with an op, %alŠ _and
  , dsourceM ð.

 [*] not available on all platbñs!

Special objects:

S-@TypeRt   – K/ `
error( Aexce· R raisÃQ I/O "  s
has_ipv6, rbooleana€ indicatðif IPv6 is supported

IntEnumÝAstan¥ ðAF_INET, AF_UNIXW › ðdomains (first argumentm" ñ() call)
SOCK_STREAM,  5DGR 7RAWV  •s (secondU )ž Iegerž ˆMany oth a may bfPined;s$se u3!in™  
‘0set²  op©Xand g ðmethods.
"""

im/  _1 1et
ò   *& òos, sys, io, selectors5 ek2 zñ , IntFlag

try:‹" berrno
ý! I„ E%  ð  = None
EBADF =Å Qattr( 1, ' Ï', 9)
EAGAIN$  ÿ', 11)
EWOULDBLOCK+  0 Ð
__all__ = ["Ðfd", "getfqdn ¨ �server",ö „"Î‘dualstackØ 2 ÐAddressFamily KdKind"]† ð.extend(os._get_ex¹‚s_list(_¿À))

# Set up(vT.AF_* °*w` as me@s of² 5sµu
# nice~ representahäs.
# Note thatBò only knows abou#1intíÐs. The publichðerface
# in this module under»!dsÎ  c s Ñ‘translate bm back®j ós
# where needed!.fd� propertyò aœ!).œ .‚ %_(Æ'­'ß __w&__ Ðlambda C: C.i˜Aer()¿ €C.starts¹`('AF_'º6v s À
        lamñ6bda C: C.isupper() and C.startswith('SOCK_'))

IntFlag._convert_(
    @'Msg %', †__name__ ?lamr ?MSGq ¿AddressInfou 2"AIt  _LOCALHOSTÙ æ= '127.0.0.1'
 ô_V6 = '::1'


def _intenum¡er(value,  qklass):B"""CBñ a numeric family 4 ñ to an IntEnum member.
= óIf it's not a known! Å, return theW P qitself.A 1""" 2try�  è : « ½ )* €except VÏ ]Error8 f  


# WSA e$ ð codes
if sys.platform.lowhbS"win"; ‚Tab = {}}  M ò$Tab[6] = "Specified event object handle is invalid.å P ![8> �Insuffici; ýmemory available3 74 ÿOne or more parameters arel 2995: ýverlapped operation aborte  "99à O4 :I/Oå  óýin signaled stat¶ #99· I } üwill complete laterö Q10004¿ 7The¸  wa\oterrupÀ   7 97 ¤A bad file– ; Npassö Q100136 pPermiss"Odeni+ ˜ àA fault occurr]ó±etwork??"  ‰jEFAULTFQ10022r $AnÀæ _attemä 2ƒ €Too many: nì sH 3 H`socket/ »would blockªB1003A  7ing9 ðis already in prog~ z7 *S± bon nonÈ n ýcDestinê¢ requirÒ!40‹ÿMessage too long`  !41* ÿ	Protocol wrong type for ˜ 4í0Bad,<  opŠe Œe  q ²Q10044• ,� 3 O–1 ù (7 þ&^ð not supported bÿ:y protocol family."
    errorTab[10048] = "The network address is in use.7  97 ôCannot assign requestedC p  !509 Nl is down) 1) ¯unreachabl’ )520 ðdropped connection o¢ ?setm 3= ÚSoftware caus= Oabor: 4:  @k has beeq 57 ÿNo buffer space availá 63 ôSocket is alreadyã /edÙ 75  ¯© 1 Í Oshut¯ÿToo many references–  6 5QoperaŸ�timed ouf6CÍ0ref£] 	›ßtranslate nam86û Œ  "  Y�too long] 4P . 1hos‡À6â* Á6à Directory «Oempt·6ØoprocessnÓÿUser quota exceed 6ÈODisk- 7ÈöStale file handleþC 7Ì@Itemm_remot™9( *csubsys5 /un*	9ñWinsock.dll vers¯ut of rangt 0SucNáful WSAStartup�¿yet perform?"10µ PGrace?  3 ! J@progY"10² `No mor? sults from‚ ÿLookupServiceNex# "10» UCall ²ocancelª ÊP9!duô@ll t} —oinvaliS "10ÙŽ  c_vider5 Ý5 ÿfailed to initializ˜ "10ïScä  : /ur- ðl  GOfounÌ î¡Class typeå. 1ï¦)1 ¦Owas ¡1ð Database query 5 üð1001] = "Host noÿ*t found."
    errorTab[11002] = "Nonauthoritative host no9 39 ò	This is a nonrecoverablee q 48 ðValid name, no data ? ÿrd requested typeC 5C 0QoS3 oeivers' 6' Osend% 7% 0No O ( 8(  % /now 9* Ê Ÿ confirme�%10/ Ÿadmission=%11- ßpolicy failur&1Ú ² �bad styl' È' oobjectN 1¸ ( ptraffic× Otrol® ¨generic+ ¬Qrviceý0 · Ž flowspe\ »1Invt 4 ÿ provider bufferï Æ5 ofilterI2É2 Î‘Incorrectƒf Ocoun‡2Öf ³ lengthË  2âg Olow e ìUÑagnizedœ j c ê–  3 ò3  Ê¯ descripto–2÷5 Ë-i— G   ¨ @ èB ÿshape discard mode ö 3% ? ing rat9 	,“Reserved _ Íqelement1ô ô__all__.append("òõ")


class _GiveupOnSendfile(Exception): pass+ ‚socket(_ . 1):
M‚"""A subV :of ' @ addÞ �the makej Â) method."""F ñ__slots__ = ["__weakref__", "_io_refs ‚closed"]8 ñdef __init__(self, family=-1,	 Qproto
  € ‘no=None):Á  À# For user cÀsaddressL 2 anŒ÷ values are IntEnum members, butP @for ô uy lyðthey're just integ¢G TheG Îconstructor \�convertsj ¢given arguÀo an
       ó # integer automatically.
  õif fileno is None:  "   ºamily == -1  ! f Œ AF_INET> Otype<  Ì SOCK_STREAM> _proto?  % 06 ƒ_socket. ò __init__(self, «  , w !, > ,ý )C  + ·._io_refs =]  ñ closed = False
8 ³def __enterm ))preturn > 	. xš W*args4 aif not4 "._r Q  v N . (()V ?repƒ  £"""Wrap __  ð) to reveal the r	 ò class name and Dà  r ¶address(es)=5"""! Ž  sgetattru'À "',2jô = "<%s.%s%s fd=%i¤2=%s§	 ªe=%i" \n  “ !% d 1.__» é__.__module__,* #  L* @qualí ,  2" [Î b]" if  � else ""Z D/() % Ž® ø 0Ž 
:try  l³" =ú 0getÑ ñ (S  '   1if . E   rs += ",# ±=%s" % str(3 
M Îexcept errorM Ipassê ¸ r¸ Opeer¸ . k ¸ # ¸  ¸ &5'>'É ráˆ oOtate  aise TypeE%`(f"caní�pickle {ÛÓ ü ×__!r} object"ò1dup<0""" C) ->Ä8    ‘Duplicateý Ret. RÈ Za new:   connected8 1Esameøsystem resource. TheE ÿis non-inheritableBf> ¼ R© © Ð!ÿ .Û: R÷Cå:=fdM ².settimeoutG g )+ á2ockD ð acê7 
} €(³ #et� , Úƒess infoÆ �ôWait for an incomingt_ion. œ ÔPesent6 ð the connection,ñ and the address of “client.
  ñ For IP sockets,$ 3 ðinfo is a pair (host v, port)E 5"""Q 1fd,t õ = self._accept()"  l   s (% rfamily,2 Ctype öproto, fileno=fdE ð# Issue #7995: if no default timeout¼ 5set•listening‹ #ù ô had a (non-zero)C q, force4new/ Šin blockL ômode to override platform-specific@ öflags inheritanceLcif getÊ É  ()Ë ANoneÌ 35get :Ñ  Ö `D.set¢ V(True:areturnŠ ª
> €def makel• , Ð ð="r", buffering=… A, *,4  n  Vencod# cerrors0 qnewline )® 5"""s ð...) -> an I/O stream connectedX Ï Ý "et³  { Tãð rguments are as´ñ io.open() afterÂ Ü €name, ex• EonlyÎ 0supÜ!edý b valueW S'r' (—a), 'w'Œ6'b'¼à# XXX refactor¿  shŸ Ucode?p ¸`t set(na) <= {s–"w", "b"}/ ð praise V˜ Ebƒ("invali± @%r (Ñ ñ r, w, b allowed)" % c &,)ñwriting = "w" inõ œ 0reaÐ  r ƒ or not ; - tassert 4 -or" `binaryN bN ? 0raw   K$ifP - Y+= "r/ – / w/ qraw = S†#IOóˆ #lÕ_io_refs += 1´ &if 
z 7O = -9 ?< 05 ÿio.DEFAULT_BUFFER_SIZE‚ ,==J ]y
e K"un² #ed€¢s must be E "B K8raw“  ‚‘e   =¤BZáedRWPair(raw,  % 6ings /el- R CeadeR   M *seÃ³ Ò  é @ 
` OWrit`  ò
e ~Q d <b Ttext_ (	    * ðTextIOWrapper(buffer, encoó	ding, errors, newline)
  Àtext.mode =   preturn   
 òif hasattr(os, 'sendfile'):!  R Tdef _ E_use p(self, 2 ñ	, offset=0, count=None):g  F    / u._checkD ˆ_params(E C Ò = �ockno = F  / :no(# :tryq  8 * ! =§ . 8 ðexcept (AttributeE[ð, io.UnsupportedOperation) as~l óraise _GiveupOnSOñ(err)  # not a regular‘ 	 À 0sizÊ�os.fstat*pno).st_ 	B Ê !OSÂ ¨ E!ifÊ f  f0ñ ^emptyé ð# Truncate to 1GiB áavoid OverflowÂ ù, see bpo-38319.í Pblock„  è1in(xA or ™ ›, 2 ** 30$dimeoutHBgett 3if  _ == 0ç  ìBValu/a("non-” ñ ing sockets are-G"� ò# poll/select have the advantage om`requirZ 9anyq# extraf° descriptorE€ntrarily^eh kkqueue@ `(also,x "y h úe a single syscall)|:» ‹a'PollSË  orE � , xectors.5 †Nelse{F w  +orH 2  .register(  no` y ‡ ÆEVENT_WRITE)þ ¾ Ptotal² 70=Plocal£ð variable accesstPminim ‰overhead< • _	 . 	.  os‚ Ÿd = os.“	& CPwhilesL  à ì2and¯Åœ (Ñ =  üTM½ ('6 jd out'õ4 "if-ã" Päà&- �	û 3   6if : <À '  _breakM P7 0senšWh,Ž 	¸BÒQingIOAÀ            ÿ  if not timeout:
  ÿ# Block until the socket is ready to send someK ÿdata; avoids hogging CPU resources.B 
’selector_	 /(). continu‘ ÿexcept OSError as errÿif total_sent == 0,  Jð# We can get here for differB �reasons,NOmainÆ N `one be+`'file'{ Àÿa regular mmap(2)-likò  I    # B ÿ, in which case we'll fall back on using˜ Qplainü/()¸ðraise _GiveupOnSendˆ O(errÃ5 Ïerr from NonÜ Oelse‘ if¢ ·Ïbreak  # EOFú ‘offset +=V ' 0+ greturnZ	M ~finallyØ 
�ð> 0 and hasattr(Vž, 'seek')=   # .! (Ì �
E@def î¦E_use c(self,FA  =0, count=£v Åú	í  — @"os.G Ÿ !() �available‘ñthis platform")
A ¨ ¤  Ï u._checkä s_paramsMå ã - ° Xclf.getH/()  QValuemp("non-bS ÑLQs areó ©supported"j „ 
Ð )È › ^ ±size = min(�p, 8192)ü  ò J 8 µ5= 0 p# localP Avari‘`accessûPminim …overhead8  ¡ _#! =0.   ú r K!lfý +trûŸwhile Truë "if€
  Ò   ' -y%, $ v ;  &if" / < 
EÇ A  ø �‘emoryview\(| } © ? Ý ´	4À
             Ttry:
  ÿsent = sock_send(data)/ ÿexcept BlockingIOError[ �continueM ?lse; Ptotal� Pt += ¤ E  Í !if  b < len¾ X  1  á 0 =  [Z /:]\ e¥ 
 M Ybreak@ vreturn Â  kfinallŒ'if+ þ > 0 and hasattr(file, 'seek')×   . —(offset +M !)
z ƒdef _cheà 3 à_params(self,  ", A w, countk øif 'b' not in get˜ `mode',! 2  ±raise Value% ("f ð should be openedS pbinary K "x!ifs  ¢ ú.type & SOCK_STREAM
m Honly0  C  äúets are supportedt þ 1 is} ;Non£– ±isinstance(1 9, i4   ™ 3Typ�   "C P must a positiveU òeger (got {!r})".formatw )/ Q "if½Z <= 0"  � “Ž ?R  p I ñb #=0d=_75"""7  < [”[1 a]]) ->íÚ Ö aSend aÄ  until EOFÁñ
reached by using high-perB&nc–5os.y )~Ã"heOñ number of bytes whichî  „  weQEent. *Â *Õrregular© oobjectD :If › —óavailable (e.g. Windows) o_ %isˆ  ·)a } ó p() willw!usŽVsteadƒ *ð * tells from whï Ðto start read_1theÝ = ñ If specified, *ç*› + Xµto transmitÃ pas oppo   u )eno õ„ CFileQ on| ³updated on æpor also‹@caseåeØ5 in„ ð   Ù.e() can<àto figure out ã 5G = 5 1Theˆ%et9-ofÇÝ SNon-b�9 Às are not su£pported.
  5""" Etry:    õ
return self._sendfile_use ( õ, offset, count)D óexcept _GiveupOnSC f b c ðdef _decref_socketios(® )b #ifÀ ¶io_refs > 0  æ  1 $._ A-= 1^   = oclosed8   1()
3 ‘ Rreal_  Z c, _ss=  .§ Ÿ ö4# This function should not reference any globals. See issue #808164ÍF_ss.z •  Ä { : ë .÷ �d = True	Fd/<=„;½ ldetachØ3""" P) -> ˆ² descriptor� } CºR the |ð object without 1ing" punderly P d4TheC 0can¨ð be used after tÏ‘call, butW L ‘can be re? ðfor other purposes.  n ? Q is r™ÈŒ	: ” super().C0‘@property£  Îofamily| ñRead-only access toì @addr 9  Õ }Gx” ô_intenum_converter(§ N 2, A^ F– #µ Otype³ ›  6   % < 1, S„CKind› öif os.name == 'nt'~ ^íget_inheritabl´  ¿0os.- mhandle4 .#Fno(){ _ s_  ', q ˆ l 0os.3 e 
C +OelseÛ ,— ¼Ô ;^ Í   i0 â.__doc__ = "GeÒ � flag ofþKR K( G SG 
Æ´fromfd(fd, osproto=0ÅO""" + Àe[, proto]) ú-> socket object

    Create a à from a duplic! ñof the given file> ñdescriptor.  The remaining arguments are< ³same as forn 1().G 1""" Pnfd =u A(fd) dreturn/ ðfamily, type, proto, n, Ò
if hasattr(_ç . Ñ, "sendmsg"):T Âimport array@def % P_fds(7 Ð, buffers, fd ólags=0, address=NoneO  F?"""A 	@[, fB [A â]]) -> integer†  I ASend-qlist ofk gs� ó over an AF_UNIXL F P  B.ä Emsg(Ý [-±SOL_SOCKET,% ;   M²SCM_RIGHTS,:.@A("i"$2))]²ñ __all__.append(} X?")
¥
Orecv¥ %  M ¥˜size, max¨š6 �’x(data, ‡a, msg_ÕÔ)ÇÓReceive up tož Ë› - [bmessagX z ‰ b and aŽ Ccont\ / � ù0# Aâ EEintsÆ \fds =Ä¼ w €msg, anc ·â ! =h.NE}Y  > /’CMSG_LEN(š  *¸P.item4 )o  cLqlevel,  à  ‡ 4 in’ Â j   Aif (& = D == € ÏC%  V 	$ Ó0 W   @fds.Rbytese  ‹ [�  *  6len( [) - ( %]0
 T{Y(fds)~f\ ‹ \Tshareÿ í Ú  W(infoÿ  É  ¨ 9 ÷ =	 ¤=o ä Qed byÍ  A X .‹ 3pid  Äbet(0,  ¼ L Ã  @pairE  ‘   (mêr= s_STREAM~*=0<? [@ [< [1 ]ùÁR,Z b “  Ëb Ts¨ k sfð  the platform
   òsocketpair() function.
 ò  The arguments are the same as for A ‘() except  õdefault family isP ñAF_UNIX if defined on4 ñplatform; otherwise, M ¦is AF_INETŸ 5"""[ &ifp e None:  Î :try   ¡ =Z  ˜ 	2 Ñ ŸNameError?  ™ ? ‚a, b = _. er æ, type, proto)7 $ =P(  Æ, a.detach()4  h ` (4 b4  preturn ¦ �

else:
„ ó:# Origin: https://gist.github.com/4325783, by Geert Jansen.  Public domaiB3defÐ ü =ÆÃ=SOCK_STREAM6=0)kÖ=¦ g  Ä@hostl‘LOCALHOSTË   /el> 6? 7_V6B   L  ¢raise Valu`("Only@ š D and 6û ‚ addressžFies ´V 	 "g¦supported"ë!if7G != 6
Ï   0 —  ‚O is j › k 0a / Œcol zeroW Pó# We create a connected TCP— R. Notf§trick with@ ñsetblocking(False) that prev¤öus from having top fthread>l8s
|?= p.bind((ƒ7, 0– Ñ" vlisten(J   ñ# On IPv6, ignore flow_infoC…scope_idù  5  H , 2 = ] 0getÄ ©name()[:2]1 c à  a ä   E .w	j  ) >   B í&((Ç 0 , t#(Bä!IO{Ñ, Interrupted # 8  6pasm � Ã JTrue’ , s05, __ acÓ¼£ 
 > f [close2   ˜4kfinall‘ÓA ¬(� f » ð__all__.append("¾ ËF")

 ð.__doc__ = """socketpaù"ir([family[, type[, proto]]]) -> (socket object,  ú)
Create a pair of  £s from the Ñs returned by ’platform
Y  G ñ() function.
The arguments are6 ³same as forZ ‘() except  ‚default Û ð is AF_UNIX
if defi‚ !on, ‚ Á; otherwise, E > ð0INET.
"""

_blocking_errnos = { EAGAIN, EWOULDBLOCK }

class SoEðIO(io.RawIOBase):

    """Raw I/O impleë aþ ß Streamæ "s.3 RThis [ �supports³ õmakefile() method on; @  ItÝQvidesz  ™r{ €nterface3 0topÍa< þ.5  ¸ ñ# One might wonder why not let FileIO doš ðjob instead.  TherØQe twoV á# main reasonsI A !isS ƒadapted:. 0- iv Puldn'	 Ark uƒ ¡Windows (wd `you ca$ @used` sd() andH `  writ15on ð shandle)$ l  Dwith£timeouts (² ¢would igno¯G #  *   ` consi4 …ýT non-\)êp# XXX MJ Bdocs òdef __init__(self˜P, modW ž  !if @°in ("r", "w r b w Rrwb")_ <   ñ
raise ValueError("invalidW q: %r" % + 4 â.¥ $  ³  ._õ ! =F"> Tf "b"±  Ï 
’   0 +=% 4 N  =�  ÿreading = "r" in$  $ w$ ¾ö_occurred = False”j #to”bO åòead up to len(b) bytes int$ … ñ able buffer *b*+4Ö  1QnumbeqD  z Q.  Ifm Z et÷RL "nov N  SPavailz `, None9 t #edq œ!If’ �Ãn-empty, a 0Ô  v(p indicaØ 2thaŽQconneÐv Ówas shutdown ' B endh s  l    çÌcheckClosed(Q @ReadË  2if = Â
\î#OSë0canË ZÇtimed ou"€ ªwhile TrueS :try  É [“  «`.recv_&(bT  + ÓbK × ! =‹ m J   á à
            eûxcept error as e:
  ñ	if e.errno in _blocking_ s0  ? ½return NoneP araise
 ödef write(self, b)O @"""W ñ the given bytes or	 ñarray object *b* to+ asocket_  Š Cand Ž  I ‘number ofD s~ õten.  This can be less thanG ðlen(b) if not all data could2  Æ H 'If‡ 5 isC Dnon-= — #no… F 83 is¹ 5ed.E 5"""  4ÿ ._checkClosed()  FGable 6tryi &"R  Bv.send(bQ e)õ# XXX what about EINTR?�  e I• EAAreadà  ¾ 
A@True´ úS IOX�open for < ?ing`0if S !.c]1 Åp ValueE<ò("I/O operation on 7  NFet."KØ \ _‚ 
Ï % †Ï k‚ Ï OseekÏ % < Ï fpuper().„ À )Ô afileno´
pR÷ o $ ¡ descriptor  ¤underlying#Û	? ^.l 3no(¢ 0@prˆ!tyZ  c2namb® Ê…ªáË   `  Æ  ;els)• "-1&„ =mod„ 5 d _! =  ³ “ b éaÐÂrdoesn't~) s À  6Cet, Õ!ifÒ referencesLÿit have disappear‡'
Fx Âio.RawIOBaseWã !  Ÿ �._decref_ WetiosÀ' ! =-0


6€getfqdn(ñ3=''ïð"""Get fully qualified domain¡ name from
 ó2.

    An empty argument is interpreted as meaning the local hostA QFirst   d ð returned by get €byaddr()^ €checked,5 n… àpossibly existk ð	aliases. In case no FQDN@ ð available and `s `G Áwas given, iÈ ‰ Óunchanged. If3  / ü aor '0. !',K  ´  Y 0Å   Ã Y .- 1"""    " =^qstrip() aif not 2 or &==s :&  ŽB 	p  6try& � #, '@, ip`;s =q Q … Æexcept errorK Apassa Felse X ¡.insert(0,òM  ¬ fË $inˆ A  ! ‘if '.' inò 
    Qbreak}   
�    o % =z * yQ ð.


_GLOBAL_DEFAULT_TIMEOUT = object()

def create_connection(.ßess, timeout=K  Ž 
 ssource_G b=None)â B"""Ch S to *" *¬¾  Hcsocket¨ Kñ Convenience funª ?.  O à(a 2-tuple ``(« �port)``)p `  Passi Œ  op!alb*ò* parameter will seç  0 onÁ É �instanceD  before att`g #o ~ . ƒ6no i “is suppliD äglobal default¨ † !Kd:-S:`get. £ Pis usú x *¹*P Ù Òit must be a W2of X T•  ô 2õ ato bin$"a Z  ñ 1mak $he2ion7AÛ` of '' g � 0 tells[ OSC1use Ü <  s’ ú¢ $ =|  `err = ™  º  reÛ " ¥ Ginfoá ó, 0, SOCK_STREAMÏ ÷1af,çðtype, proto, canon£’, sa = reI 1  }   	Â  %   ?et(d  ¸ +   %if!isP³‡ 3   c C.set( ` ÂÕH  ñ(* 
I n í:(sa 0# Böñ explicitly a referöBcyclC¼ Ç ÿ–È  ã ¸à_:
           § err = _
  ùif sock is not None:!  ,  " ‘.close()
 !ifN 6 :tryC Praise0 ;  Q kfinall' õ# Break explicitly a reference cycleB  F Ð  ³  7els¼ u ñ4or("getaddrinfo returns an empty list")


def has_dualstack_ipv6():_ A"""R; ñ& True if the platform supports creating a SOCK_STREAMf!etJ ôwhich can handle both AF_INET and ñ6 (IPv4 / IPv6) connections.J 1""" !if¾ ½  ³ ! \  $  $or `attr(_Ïÿet, 'IPPROTO_IPV6')6 £V6_V6ONLY' f XR Fals§	Cwith(ê (6,!A) as! 
< ¬ @.set Hopt(³  , ¹ ‹ I, 0)ö �  ­ `except‡&ord & ¶ Á�e_server(8ó ess, *, family=À  , backlog=ƒ€, reuse_=O ,w   
[( D¡"""Conveniï1funê . V+esUAtype5Z£bound to *· ð* (a 2-tuple (host, ¢ !))hþ  É aF robject.ê*õ ô* should be either¥% o 6–**V \ ñqueue size passe£ q .~Cen(); Eá* dictates wher ato usexÃSO_REUSEPORT0 opI 
j!*:± ¹ ` • º±it, it will»	 )ò6j @ableg!acTÀª!or«? ®p When fc è2disS 3hisÇ 1 onF § ‘s that en) óit by default (e.g. Linux)·A>>> tÅ Î�('', 8000"s ä1...¨Qwhileä
    � , \# == .(}E  - #ß7new»Ö ¹ò“ †:hasª"ï"1 d æ€ValueErrë* ÷™ped on taS"´ :if -ø  _ X
# („  ) ˆ 
0 Š  J #ifg4 !=c6’  # m ðrequires AF_INET6 famiñ ly")
    sock = òet(family, SOCK_STREAM' Atry:0  4 ø(# Note about Windows. We don't set SO_REUSEADDR becauseA ÷+1) It's unnecessary: bind() will succeed even in case of a† ó previous closedÅ ð on the same address and stY 'inB ÷TIME_WAIT state. P2) IfÌ ”, another` ¤is free to² r B | à, effectively ´ ðenting this one from accep B  coðtions. Also, it may˜ å 0pro? "aÄ g whereE ðit'll no longer respond¿ øany signals or graceful killsõ,See: msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspxŠ pif os.n–0not² ñ('nt', 'cygwin')¦\1  k  �hasattr(_¬Xet, '^&')X . 	ª     : @.set €opt(SOL_ä ETì«2, 1ð 5    ex–j errorh   À# Fail laterwÁñ, for platforms which¶=notÞ “# supportpï| g   Epass< �if reuse_8 
—  â ê IPORTê ±if has_ipv6„Ê == AF_INET6e Áif dualstack6 
  ° ˆ àIPPROTO_IPV6,  «_V6ONLY, 0sl� 
ô"3 "* y ."{ ". 2 « hG ù× F0 asO
2ñmsg = '%s (while attem ¨ V  `Y Ž %r)' % +�(err.str°,þ‰  ï Praiseƒ !or/ ²errno, msg)Š6Non@àif backlog is  
º ö vlisten(h (elï v ( Q / areturn`ä0o C ëj Î  


def get"°info(host,  ", Ï€=0, type Pproto	 sflags=0°"""Resolve @  C ` into æ ƒT h ¡ entries.
¹ PTrans� D /@ pargumenöÁto a sequencÒó5-tuples that conta¤1allH # H sc@crea2 Q Aocke> QnecteÞP aservicÚÀ  host is a ö@domain name, a string representation of an IPv4/v6 address or
    None. port isC qserviceZ ð  such as 'http'i rnumeric8 jnumberQ pBy passŽ @None> �the value‘ �host andB ‘, you can4 � NULL toŸ  5 punderlyL qC API.
 òThe family, typeO ároto argumentsU Pbe op
ôally specified in orderl pnarrow s @list§ -ães returned. PØ @zeroØ aÖ ±for each of  Wthese‹ qselects` ‘full rang�results.7 1""" ð# We override this funcÈ ð since we want to translat) $e žN  mbsocket.‹s= Äenum constan†  ù A= []B  ß 0res6_H @.get( Pinfo(Ñ,Îx –0, p“‘, flags):L €    af, H  »% RcanonÎ†sa = res1 0ddr“ Ð.append((_int¼ °_converter(U AáF%),@  u 	 @  ‘ S+OKindC 	Ü 	· !))s 1o ¶ q
"""Gen6 f 0et dàer classes.

Tå±module triežbcapturÙ�various aÅ ts¢PdefinaP a:

For[ƒet-based Qs:

-‘   ¥�ð- AF_INET{,6}: IP (Internet PÃCcol)W ¢s (defaultì  W@ ³UNIX: Unix ›ì Æà- others, e.g.t  DECNET are…ò ceivable (see <? S.h>
-| ¾· ñSOCK_STREAM (reli? cstreamf 8TCP© 2 0DGR1 „datagram‘ BUDP)BkrequesC€ (includrœ c)\eclientcrverific† before fur P lookE !atm : N( ’1ctu¸pa hook ‡0anyV"cea‘that need0 Y G  _  … Panyth~ Celse$Àlogging)
- hóo handle multiple ¤ s}€synchron–(é% 3 is@ d„ ha time„1for (36  „by a newê = Qthrea„? , )^el ÅRmmQfavorˆ” • X is simplesip
write:(ù cTCP/IPf4.  ¼2badr ð design, but
saves someËñing.  (There's also‰ @issuõ“at a deepJ àhierarchy
slowòzs down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

   '+- "+
    | BaseSe= % | . 6 '  v7 + )  L … € 4TCP  ä->| UnixStream d (‰ ¶ /(--¸ /UD¸ @Data¸º & h ¡
Note thatT Õderives from ‰ Q, not 
@ñ-- the only difference betweez�IP and ap !
s} V1 is> òaddress family, �ðis simply repeatedÌ”both
unixD è¡.

Forkingo `thread qversionÂPeach Â ö„ ‘can be crc 0
us5  Ô O @MixIÉ 4d TT  dmix-inh¡.  For
inseF, a „ 9UDP¯  ù q ¨ as followVÕ q ‹(„ ,¥q): pass' M› � must comprst, si£äit overrides aP¦defined
in[ d! Sett@varipmember  0ablD Àlso changes
A€behaviorm  punderlyI | me0 �ism.

To îqement a/‚ice, youÃ �" ar� eáRequestHandlerþ"reÈ a its h #()ã p.  You ÷�then run
Å  Ô , ²  § iÏyA0bin¼ 4oneÒ    "er‘ pes
with° 2r r” | "  å /he ã %beEst for dôB or ;
t ±ices.  ThisÉ Öbe hidden by Â† A
subY2es ;4or 
 ³.

Of cours’òstill have to useø Qhead!Š 
õit makes no sens3 aä ³ Õ Qer if  ðice
contains stateþbmemoryÀ Â°be modifiedû ñ 2s (äBthe
  1cat!inb  child procx would neveº$ho Ritial} P
kept‚  0par¥?  ß | edd` P).  Ip ¦@se,
Ì ·  0  ñ per, butH  w]ðprobably have to use
loò*cks to avoid two requests that come in nearly simultaneou7 ñpply
conflicting change ðthe server state.

On  ðother hand, if you are buildE Ãe.g. an HTTPC ñ, where all
data is stored externally (: if ñfile system), a synchronous
class will essenti@ arender¤  º Ðice "deaf" whN 4one!` is
be®  È `led --& ðch may be for a very long tiL¡f a clientÃ Plow
tv adÜ { à Tt hasn aed.  Ha threa( ore Pking
¯  erS ‚approprir@In sÄ”cases, itž '  àprocess part o¥ 	
7ply, but0 sfinish 7  Ain a� âed child depen©  n
øS  á °.  This can-ðimplemented by usS 
´ã aand do ¡n explicity  ©g ™!r í
 â() method.

An‰0achØ &  ] `multipBôÂ sk  an
environ¸ 0Ásupports neiå­3s n¬C (orËPtheseù@
tooÊ Áensive or in” Æ Ü  @ice)æ�to maintaw%n
PtableÁ ÉÕ«$edL s C@to u ó selector to
decideÇì  `work o$xtÂ ß oÇàle a new
incom?= )çi[AiculJ im(!anºq streamëRices
ìe”, '5potª�be connec1jeD(if
ycor sub¨ep0notsð used).

Future ä Â:
- Standard7!esàSun RPC (which:#s â0UDP³HTCP)> emix-inE 5to ãP variB@authÒ �cation
 ™`encryp ð schemes

XXX OpenpPblems© W¡ðto do with out-of-bÞ b�?

BaseSƒ 1 ó split generic "£`" funcp PalityG f into = Æ ð.
  Copyright (C) 2000  Luke Kenneth Casson Le% ðon <lkcl@samba.org>

  exaî : È` entrig‘rom a SQL `base (¤ °ires overriMp
  get_ Pest() Pretur€ÿ S 0y fQ    O )Â   �òp2a Rø€HandlerC ð.

"""

# AuthorW P opatch:
ò	

__version__ = "0.4"


u socket �s o
 %sy Ü ÷ä i\àort BufferedIO¤ 
 woð monotonic as time
ö
__all__ = ["BaseServer", "TCP %UD &
  §"Threading!   D 	7  j ÂRequestHandlr lStream 	9 nDatagr% t ñMixIn"]
if hasattr(os, "fork"):O ö ê.extend(["ForkÆ  Ã   c )d ÿsocket, "AF_UNIXk BUnixê _" Ú  ¨ j
 Z 3 
F 1 d ðT])

# poll/select have the advantage of not requiring any extra file descriptor,
# contrarily to ep\ Ðkqueue (also,^ yN ùe a single syscall).S• ³ors, 'PollS 'Æ, 2 = Ç Hors.0 S
elseù3 H  °or


class ¬6 !:
d!""*  Qfor s5 2es.' €Methods !  S à #erD ²- __init__(= ª_address,  C„ )x -h �_forever(¹Õ_interval=0.5' „hutdown( hd_Äñest()  # if you doß;use^ < ðfileno() -> int <  Ó k
í õthat may be overriddenõ ì Ebind�  …activate 7get² !->5´est, client2ä utimeoutF everifyI D í Œ Fclos‰ processD ~0 d ]   � @ice_5onsÇ Þ zerror()t Žtderivedƒqlfinishn ÿ El¿ variables ÍK by o 1 orA •instances€ � #- äs_family 9S_type µallow_reuseå I` ¤ i 6 3 "- ` 32"""	 ˜ r = None 8def–2lf,r… œY  ò"""Constructor.  M	f4ed,n e.�  :   Pself. eq Ò �‚ Ó - ô  / =@
7 À__is_shut_doó	wn = threading.Event()
  ñself.__shutdown_request = False
) ðdef server_activate(9 !):  K ô"""Called by constructor to 4 C theH .Y  : ÷May be overridden 5"""b Bpass6 � �_forever� ú, poll_interval=0.5  ´Handle one æ ôat a time until ƒ •Polls for  s yn õ seconds. Ignores·  (.c ðout. If you needðdo periodic tasks, do'Em inC sanotherÆ. g A__isË_Ìg.clearì6try± {ô# XXX: Consider using o Àfile descripÊ orÙ@nect& t¨ Œ O `socketÚ ñwake this up instead of6 ˆ X H »reduces ourM @respš `venessU a„Âànd wastes cpu Ñ1ll 0O  „s= ± qwith _SÚ@Sele±s() as s 
0 4  u.regist} Òs.EVENT_READ)° 7   whV0notc zr  ;  ¿0y =5 ¦ .o (óÖ 3  Å# bpo-35017:@B() c¯0dur‡P ú), exit immediately3V i;Á  8 Ybreak–    1if â < àhÃ¥Ÿ_noblock(h  V 4  ¸1ice¹7onskfinall4  X  , 	t se^å §X¢
�PStopsìÌW loop€Bâ s  A   ð has finished. Th@mustIØiˆ  ¯  ec  () is runnú%inò'Å, or it willA @deadŠ ~ ?¡u = TrueE 1:wai28erv° 4 
9C¹.by=,()?^  ða subclass / Mixin^Àimplement anÄdÁ%at¾  µ‡ be= :”¶ñ# The distinction between Ö€ing, get]ƒ, proces�dë ®a� #Âðis fairly arbitrary.  Remember:
 `   #
  ñ - handle_request() is the top-level call.  It
 ²s selector.	 3(),M V  getJ †, verify Æ and process > ->  ˆ õdifferent for stream or datagram socketsB \  F  Î àplace that mayO tk a new�  W ƒcreate aO    ñthread to finish.) - Ó Â instantiateO2 oÄr class; thi¾ �  constru\S will- r ñ  all by itself
� 3def* �   !):  èA"""HçS one ‹ ò, possibly blocking.Q  3 qRespectî¨f.timeout.R  ó
# Support people who usedŸC.setA  ()Igescape@ 
„p beforehz æ was availableˆ X " =. '.gq g 4if . vis None! ò  K  ? Belife   [?notJ 
Cmin(/ ,= )X 
— Q ¡deadline =Ã A() +	 6out²ä# Wait until aæ€ arrivesà 	Ž ¡ expires -^Sloop Š @# ne¥0ary±€accommodðearly wakeups du*f EINTR–Ówith _ServerS.A() aN<
{IÀor.register(Á2. Ös.EVENT_READ)ò  ª ›while TruÎ   ¹yG ±„ -   1if 4 
ž     breturnÇ_³1_noD(T ?els›   P ú (  · 5 = -v  4 d ?< 0Ø , à ß s (u jú  ²s ?outrsI assum¦	 r() has £ "edÊ Ðò¼ Â %G c‘ functionH Ñ`ed, soý jõhould be no risk of¡Ùjing in¢ð5"""/ :trygoâclient_address˜f¬·>ìexcept OSErrorQ  ˆq —mw À_address):
   Vtry:
 
 óself.process_request( ù, client_address)> �except E ?ion\ Ïhandle_errorY  ™ — Œshutdown˜ ˆ ~ C  r Uraiseá JelseS ’ : Cdef ð €timeout(7 )J ó"""Called if no new nð arrives within : .G !.
`  ¨ õOverridden by ForkingMixIn.$ 5""" Bpass>  ž everifyQ d ,� ï	· V: D the0 µ.  May be o” © °Return Trueí ¡we should n!edè U thisQ ¨  æ Â rI !  É E ³Ê  �t finish	· `¶ and Threadsh²  � .b û5 °i  ú Ïserver_close_±to clean-up´6 è »	Ì 
@Õ  ´ @FqD oneï Àò instantiating R€H3xrClass.Œ  o .%  ],E)6_ R Á ¨4to 6 xä an individualÑ ¬ - e¦ � 
  � Ö? upƒ 
»™‰	k ùŽ o ; ¿ gracefullyðThe default is to print a tC BbackRwontinue�õ5 ö	('-'*40, file=sys.stderr' �Ð occurred dur]2  $of³q from',] x  
õs fimportÎ F à .– ]_exc(ª Ñ F  éœ__enter__ær ÄÛa__exit- Àlf, *args):
  ñself.server_close()


class TCPS R(Base @):

; 0"""  * ò
for various socket-based Z & 2es.< ðDefaults to synchron: ðIP stream (i.e.,� )4 €Methods j £the caller� ²- __init__(q ð
_address, RequestHandlerCØ €, bind_a Ñctivate=True)Ù -´ õ_forever(poll_interval=0.5' „hutdown( hd "_rr û()  # if you don't use] ; ðfileno() -> int ;  ê ‚selector8õthat may be overridden å œ  að  7get± 3-> ¾ „, clientIã utimeoutF everifyI D í process/ sh0 O ¶ ± PerrorÚ »G atderived¡DlfinishV )˜V oables  K by o 1 orY•instances€ b #- Îs_family hS_type xñ_queue_size (only5Z6 s=µallow_reuseëN I“ × œ Lc. -h r *2"""	 
Ò # =6‚.AF_INET% : â " ²SOCK_STREAM& ö  2= 5 ß  ‚ = False! 8def<2lf,¢rB:ô  e """ConstruÀB.  M°ôextended, do notÁ e. :    [p.Úž Ü G Ý�AV( 
‡,¾  =  9 E ›o .ifZ P :try   Q i_µ   # Ä# oexcept^ +¶8   8raiáŒ  z )V  × zdÎcá Ë 0  œ¹ ` ü¬ ÷0if p .· ƒ  Q & g 0set
 @opt( pet.SOL_'4ET,XðSO_REUSEADDR, 1)
  òself.socket.bind( ó erver_address)
-    # = D 0getN qname()
9 Sdef sQ qctivatef !):  \ ó"""Called by constructor to a4 C theH .Y  : ÷May be overridden 5"""b º ¤ alisten„ þ.request_queue_size¶ Oclos³ ¿to clean-up¤ 7t Œ afilenoµ 
9pReturn v0et ' w number
 Interface ð "iri@selef) 3rY " ^ (noÙ@get_T ?estœ  1Get" Ã and client \Q from$ Á Œ Û¨  haccept¨ ‰shutdown­ ,:estR‹4to 6 ¹ ôose an individual@ .86tryÚ ¤µ#explicitlyR #. ².êõ merely releasesºB ü¾‹ Àwaits for GC$bperforH0actš W .F †.Ö (svSHUT_WRç ex?Š OSErrorÍ ð pass #some platw õ
s may raise ENOTCONN here~ ~’ €� â
   3  x? up–p oP


clË AUDPS�3(TC
 "):`c"""UDPt / é× ´allow_reuse(‚ = False> ]P_type$½².SOCK_DGRAM% `max_pa~|r = 8192  8_Sdata,N‚  f ¬@recv]—.i ì>(O  v)] “ Ë�# No need˜Scall o)°6UDP• LY £	c Í– anything_ Í 
Vv	s S p  Ï óif hasattr(os, "fork"aDÖ ForkingMixIn]’"""Mix-inj ?´handle eachjö in a new process’ )Ñtimeout = 300¨  Càe_children = NSone
  õmax_children = 40 ñ# If true, server_close() waits until all @ õ processes complete.L ‚block_onC … = True
 µdef collect� ¡(self, *, = µing=False):7  Ã ñ"""Internal routine to£ B forœ  Ü ùthat have exited."""J 0if s u.activeˆ Š is Nonew  { freturnÆ   5õwe're above the max number of’ ,¥ €and reap* mU	— ð# we go back below threshold. Notd  at& 1useT tpid(-1). 6o bð¥ 1abl'u” õ in size(<defunct û>) syscalls instead§ #of; `ren>):Õ � downsideJ†¢this mightú 1 Q PwhichØ âdidn't spawn,  `is why °only resortú] Qwhen ‡T •õ¥ ‘while lenB) >=%B >try  _ Àpid, _ = os.FªI, 0)¨  +   �Î.discard(pid6 €except CÒP‘_Error� \ do]5anyñ,@( d. •  � oclear(˜ /OSŽ \breakO2Now% i•
¼ ï1pidÄ<elf½k.copy(? Í ®Åflags = 0 if†P elseÀWNOHANG¹è S  ‡ #f  /@ has˜­` yet, Ý  will be 0 9¯ignored by‡ $# -& É9 f2rsomeone; í_ed it� ;[
FpassZ oáhandle_timeoutîq"""WaitFÒzombies after: € secondsÚ!in<Fity.m  Û0May´÷	extended, do not overrid) . ™ ª—&()c  Ð  £@ice_‚ =onsÑ À   """Collecñt the zombie child processes regularly in( ÷ForkingMixIn.

  ô
service_actions is called< ÐBaseServer's . ù e_forever loop.N 9""" Ñself.collect_§ Vren()ƒ 4def¹ �_request(5 #,  ù, client_address):a 0"""Ý £ a new sub4 toX N .¡ ù pid = os.fork()\ jif pidp  :„# Parenta 	5  ! 0if Ä .T%veø  \NNoneR  5 2 [= set— - Š.add(pidÅ . Uclosed, ireturnÓ ?els´  8# Cw
 v Ñ# This must n0\ p, henceu‰_exit()!o  < ­status = 1 ?tryAlfinishç EV 	u 0 �except E ?ion‚ Óhandle_error(g€ ofinallÚ ó ¶  cŒshutdownù à 3 m 
 ! 2os.›ˆ°!r_Q­”‰super().( 
Š í@bloc¨=  2_oni ó)


class _Threads(list{ ×�Joinable  ð of all non-daemo; ­5  „aappendÎ 1, ta [  � Greap‹#if( .\ 
ëHg a   qpop_all€ x 0[:]¡sult = [],\5[:]] l 0 re$ T LjoinQ 3for¶  ß× { w  ó £ .E   ©  8 /   r[:] = (6  g  /§is_alive()Ô#NoÖG›ðDegenerate versionÕÇOpass " i’ 8™ rMix-in �2to ñT eachµ ]’w°Ó# Decides how‹Ðs will act up¥`ermina� î 2the; À main procesñs
    daemon_threads = False ò# If true, server_close() waits until all non-I 4ic K ¡terminate.N ‚block_onE d = Truh T~ aobject/ œ# used by| !to A for| o ¢completionp Ó 3_Nob 1()
^ ódef process_request0 s(self,  ñ, client_address):?  9ñ"""Same as in BaseS%@ but "a š .r  3 pIn addi¤ p, excep ÷ handling is done here7 5"""v 6tryƒ  T  ¯ t.finishÊ (½ F | $ Eƒ S  • e_errorQ ofinall› Œshutdown� ‰‚£tart a newo4 toÚD theÉ.E1if 7
“
AvarsŠ ã).setdefault('&Us', _T)Y3t =ˆ Bing.! `(targe u w,C  Õ 0argœ‰‚ .‰" =ä  · f ‹  ˜.append(tG s[0	 @ `super(+(n @joinY ó
if hasattr(os, "fork"V òclass ForkingUDP]( uMixIn,  b): pasÒ	: /TC:  : 
7 ³	s  u : [ (:  u òsocket, 'AF_UNIX')::_ £UnixStream
M h¦p_familyU .S P eDatagrR NR !î « ß4ingBÌ  øï 	M ¨  O 
# Q M  �RæHl#er[0"""  '  R;”"er #esŽBThis  ¬Áinstantiated�Deachq ˆ#beH bd.  Thîñconstructor sets¦K Äce variablesH ‚š3and ,  ’then callN ¼�() metho} ðo implement a
    sñpecific service, all you need to do is	 ñ$erive a class which
    defines a handle() method.
  <The ó can find the request as self. , B åclient address(  _ 3, aP  Ì áer (in case itF  Ò Ps accD sto per-+ Åinformation)_  ¡.  Since aE àseparate insta ôis created for eachÒ Â ü G   8ö other arbitraryY “variablesH2"""QÐdef __init__(2,q Å !):v  ® 0 b$ =9 
 
E : =  
- b ! =C,er Utup() 6try‹ � 8' ofinall+ †finish()
 sec  × æ Fpass# ` $ 
Y $ 0
# ÅÒfollowing two`es makc� possible,0use½Q sameRice
#3 &ñstream or datagram' €ers.
# EDgpsets upN  Êuð :
# - rfile: a  Â object from§� receivesG ó ×AreadA w9 A #to? ¥0ply4 áwritten
# WhenR `ø¡ returns, W  5 òflushed properly


à S	RH@jr(Base "):ÎA"""Do* · ø ¸.o  †`…sockets.;ñ# Default buffer sizes“D³ .Š@# WeÞ0   Ü9 ped becaéÁ wiŸ`t coul A  reÈQ slowe QlargeôÀ (a getc() ctÑper byte); weUC Õ -unx Ð(a) often aftC › £we want toD  è'%weÙ“¿Òline; (b) bigE òt G  n s are typi· �y optimizày stdio even w P  | sA baren't^@rbuf~Q = -1  w 0ï # A timeouÍ 0 ap„!to¶ & äÒ, if not Nonea 9 = Q 0DisUñ nagle algorithmžHthisP 3TruL ¢# Use onlyÙ « P!= 0,�avoid smÌawÖ dq _q _q r= False˜  ÓÉØ`connecžg#a  G"ifô %ispÀ.connection.ósettimeout(self. 3)
  1if  õ	disable_nagle_algorithm:)  0 * ðconnection.setsockopt( ù et.IPPROTO_TCP,;  ?  ; öTCP_NODELAY, True¥ x rrfile =¯ … @make b('rb', wrbufsizC è w _ == 0Þ  wK ò = _SocketWriter<t š OelseF ¹ 8 .¬ w¬ ’ !)
1¡def finishv )^ bif notá § v.closed"  a:try   ˆ 4 fflush(Â   sexcept ‰^errorD 0# A™ #al(  ( ñ may have occurred here, such asÔ  d  ³# the localB ÝECONNABORTED.0 6pasE È ü È  $›()

classËãBufferedIOBase_à"""Simple writ	 (   Pmentaúc for a	¸ADoes ñhold data in a bp ó, avoiding any need to call ’B."""K  �__init__,j ¬  Ií _° 6ock9 Á 9 3 areturnY
- e* 7, b- ` ¦.sendall(b3ðwith memoryview(b) as  
6s   v.nbytesz  g!no{ x 2  ( ÍðDatagramRequestHandler(Ì
 "):m ’"""Define9"B and Î ² Y k:ets�\setup® pfrom ioPort Bâ %IOÂÆ  paG— ± et³ ŒrÃ 
0   =M s .E �Z » * @6 ƒ Öt.I ³.getvalue()­ ðclient_address)
#
# Secret Labs' Regular Exp" ¡ion Engine+ ðconvert templateï€internalq1mat( øCopyright (c) 1997-2001 byn ¡ AB.  All , ±s reserved.E 1SeeWpsre.py 5 d r inform³�on usageý redistribuÏ E T
"""I  @suppÓamoduleK 1sre¡!im S_sre
 ¡sre_parse
  ”constants`*

ass : `.MAGIC„	 ‚, "SRE mn ómismatch"

_LITERAL_CODES = { T, NOT ð}
_REPEATING_CODES = {REPEAÀT, MIN_REPEA #AX ó}
_SUCCESS_CODES = { ö, FAILURE}
_ASSERT#  ",  ¦_NOT}
_UNI# ƒ_LITERAL4 ò4| {ANY, IN}

# Sets of lowercase characters which have the same upp) ÿ .
_equivalences = (
    # LATIN SMALL LETTER I, ‘DOTLESS I9 ñ(0x69, 0x131), # iÄ± R SR aLONG S6 Q(0x73O !7fO 1sÅ¿ ú# MICRO SIGN, GREEK­ !MU( P(0xb5A 13bcA AÂµÎ¼ ³# COMBINING@ ßYPOGEGRAMMENIU DIOTA FPROS/ S S(0x34n 1fbev ±\u0345Î¹á¾¾* #s 
`ôOTA WITH DIALYTIKA AND TONOSw 2 AOXIAh  ’  90 A1fd3‹ QÎ�á¿“ … UPSILONˆ 5 	‹ b‹ e‹ O°á¿£‹ &BEn  q SYMBOL1  Ù  b2Ù 23d0Ø 1²Ï� × E× FsLUNATE  Y Ä"f5Y ?µÏµY 'TH¦  N 8§ OÎ¸Ï‘N EKAPPb N aN fõ ?ºÏ°N PÆ,PIH c‹13d6ä OÏ€Ï–H 4RHO9=RHOJ 1’ à 4Ï�Ïñ– PFINALµMæ 	ÑFSIGMºcác.OÏ‚Ïƒ¤ &PHí Hî 6¤ dÒCÏ†Ï•J ç Sü�OT ABOVE¤* T a(0x1e6A1e9b_aá¹¡áº› ‚IGATURE ô+ Tm  !ST= a(0xfb0ž2fb0»€ï¬…ï¬†
)	PMaps æ
hode to?ode`ignoreMA_fixñ{i: tuple(j for j in t if i != j)¤  ?	  + t+ 
k  i ñt}

def _combine_flags( R, add S, del i öTYPE_FLAGS=sre_parse. !):5 &ifR 6 &     ¹ y V &= ~ à
    return (fÀlags | add_f ‚) & ~del ò

def _compile(code, pattern, 1  :
    # in Cal: / ƒ a (sub)0 ' pemit = I q.append ¡_len = len ùLITERAL_CODES = _ # –REPEATING%  ' vSUCCESS% 	 # fASSERT"  ! áiscased = None xtolower Xfixes "if!þ & SRE_FLAG_IGNORECASE and not$ bLOCALEV ZH 0UNI% ) ¨ €_sre.unig_¿ ¸  '   À 	+  	+ Ø p_ignore_ & OelseŠ 
_asciiˆ ) † Ôfor op, av inzm Pif op 	!   ì /ifhŒ
0  4  §E(op)ä      *av /el¤È ?   C 2OP_  J[op]U + n  :ÙO(av)Â /Ã  Slo = Ž f [ û:Á'  L ö vï ( /lo  e!loÌ1in ƒ÷ C 3OP_%b
0 s 3  INc _ ±  ( @skipÀ1len=1); 	0/ ÏTs NOTôä  ] J oNEGATEO  =kr(lo,) +5O[lo]U NV { k  — oFAILUR˜  —[]0 -  ?W ßJs IN² ¶charset, haõ“optimize_ S(av, %,È,
» ¿©«ìË¿
—  INßÖ  ¿» C 
¤ 8 ún€/IN} ðse:
            ð	    emit(IN_UNI_IGNORE)
  òskip = _len(code);3 0' ó_compile_charset( ‘, flags, < 	Z   [_ ]` 0 -  + õ elif op is ANY:  ¡ "if_ ú & SRE_FLAG_DOTALL(  , é zANY_ALL¼ Oelse0 , Š ún REPEATING_CODES> – ŠTEMPLATE*  ˜ ü2raise error("internal: unsupported template operator %r" % (op,))î_simple(av[2])q OBMAX_É %  š 2! ;_ON! 9  V3MIN` ?  ç	û[P Vav[0]�    § Oav[1  —»!, “I ~SUCCESS ¯’ ¨ O^ }î  ò T yKUNTIˆ I Œ S: –Ês SUBPATTERNÑ³group, add_Ž4del  Þ,avE3 
F … >ARKÂß(8 Z-1)*2" $# ‹S_info�!p, Bbine� (  « êP K 01if ¸ ð *&+1ò ”#n P(2/op7 oASSERT6  ˜? if0] >= 0î ù 0) # look aheadž€lo, hi =\ Æ1].getwidth(Ù  £   ¾if lo != hi~  ! 	 … ñ-behind requires fixed-a @ pat/"i [%loË F ð
            _co÷mpile(code, av[1], flags)
  Êemit(SUCCESS  : Ñ[skip] = _lenL @) -  E õelif op is CALL:  e ^ *opY  ? 	S !; ( 0' :_coÃ À N/AT¾ "ifGú & SRE_FLAG_MULTILINE@  vav = AT# p.get(av”
ð Y _LOCALV   S œõ® oUNICODV ! W  4&av¿ h jBRANCHÞ™tail = []1  �append =  . 	% ’for av inØ
m  ub + $# hQ_infoä œm 1 / * ÷ FJUMP) A    Ú Ù (Z) 0 Œ + v °FAILURE) # K�of branchG ‰  I  Hw     M ÿŠCATEGORYL ” ð2CH_ð:[av6� è3CH_èO àŠGROUPREFá nif notŸIGNORECASn Ê ÷ 
s ì’  _q 
qT Ÿ åixes:  # asciiÀ K   ’ O K /se‡ ?UNI‡ V&-1ž š 8w jEXISTSe ™ @ Xav[0]S  È  ÿ?yesd!' ifl*2]˜  m ‡ æ ˆ /no‡  H l 2 =yeso M + 1¶‘Àe, av[2], flkags)
  ðcode[skipno] = _len( B) -  	3 Yelse:  P  1 E ?yesF uyes + 19 G óDraise error("internal: unsupported operand type %r" % (op,))

def _compile_charset( �, flags, ¦ )½ ## -  % ± subprogram¥ aemit =3 q.append Ôfor op, av in< S   6 6(opfö if op is NEGATE*  . ApassV   %el, zLITERAL- [ &av[ 1 aRANGE ›  l  «_UNI_IGNORv I 6[0]L � ‡mit(av[1 d zCHARSET•  R�.extend(œ ?BIG; %ŠCATEGORYt "ifÐû & SRE_FLAG_LOCALè Ô #CH  7[avÜ    uN oUNICODO ! P roþ"2set:torþÊ  ¾tFAILUREoptimiz öiscased=None, fixup !es *�Q ù‘acter setÃ ou/![] stail =   bòmap = bytearray(256"ha‹ � = False@ f›while TruŠ:try+ V "    U @     Blo =*	ê   í ![lNñ$   q 0es Ñ loN_fixes�  6  k,  e 0  4 ’ k™‘ 
Enot � ˜ ' ñ h 6 =—Å |  õ ¦ /av§ Šß� �r = rangeÉ 0]¨R[1]+1lp   „/upL " –i–Amap(M3, r? F  ô ió 7 1if f (; àfor k in fixeso[i]:
  ïcharmap[k] = 17 OelseU ÿfor i in map(fixup, r)4  ¤ � i� ÿ if not hascasedX & p = any(’ i8  ” )æ â Þ rz Î ÿelif op is NEGATEN þout.append((op, av)µ ± Otail@ ÿexcept IndexErroÖ  sif len(Ñ �) == 256°  # ' ÷acter set contains non-UCS1  _codes‚ D ÿmap += b'\0' * 0xff00. }ontinue o# Char� <BMPŒ .B 1if Áí ]/Tr€   Õñ# There are only two ranges of Ã	� sq ð# 10400-1044F (Deseret) and 118A0-118DF (Wac } Citi),Ö ˜  5  ÍDboth’ þRANGE_UNI_IGNORE works B À5 ±  ( Qop = $ Y ” ªabreak
9 §# compressÃ1map ‘runs = [] Bq = 7`while ©¬  › m¦.find(1, qa†if p < 01  Ñ ‰  
    v j) >= 2-   j = Non 
E  ¦ 	ˆ I0, pˆ qˆ  [ Ý)p,¥&
n 9 q. 0if   ” b ´ Í à# use literal/_Ñ  G@p, qõ B 6 "Pq - p91   ãpLITERALý þ  % ã; b1, (ˆ C- 1)Õ  > 0outL d  �# if theƒ1 waKànged or new reb€entationAmorez5actH %if‹ :  *eout) <�;setþµreturn out,= Q  # í — originalâ Qåis good enough5 R ð charset, hascasñed

    # use bitmap ñif len(charmap) == 256:  1 ²data = _mk_6 + # ðout.append((CHARSET, 8 ())$ … += tail öreturn out, hascas¦ ðTo represent a big £ ’set, firs  Æ q of all Ñacters in theh ó# set is constructed. Then, this " ðsliced into chunks[ 3256I  € a ´, duplicate* ò	are eliminated, and each  3 isE ñgiven a number. I« À compiled exõ 1sio   _ "arÂ A ñed by a 32-bit word sequence,ï `istingÅ 2one! 3forH 3the…  ! `differlú 5, aM    Ñ256 bytes (64K sÜ# 4 N  ~2dexž Ðtheir origina£‘unk positá  %a� »  P 1256Ô X Bs (8r Q$).É4Com, ¿ànormally good:qa typicy FÐ, large rangeÞ| ñUnicode will be either•óletely excluded (e.g. if only cyrillicH 1let€  toJ ¹matched), oP ,inP š H 5sub£ q Kanji I )ºsÁ ° 
E =0oneSsˆ  .Azero OM«  00can» `also d:Àefficiently:Yñ more significant3 ofz  [S5 £‚an indexd ' ¥ :5¹Nlessf !istJ ’ H  (just like Ž ’B4ingA š Qmap =¾ s×� # shouldrhashablL ¥as = {}[ @mapp0A ’array(256‘block = 0+  i ( % Pfor iªî (0, 65536,‚)ƒÝ =â map[i: i +% ]^  §$ifjn¸s?   ¬ Q[i //9 " =' [] H Oelse;  Ø  í ‹  p ÿ I+= 1 +Ê 1unk  	_   
 ‘[0:0] = [R Q] + _ˆ@_to_´#s(Û 3 ‹3BIGü	Ž9outŠ†�_CODEBITSü@sre. ÀSIZE * 8
MAX • = (1 << . p) - 1
_9 P_TRAN? øb'0' + b'1' * 255
defQVbits,D =N £, _int=int ~ . ·.translate(l b)[::-1Ìðreturn [_int(s[i÷ - _CODEBITS: i], 2)
  õfor i in range(len(s), 0, -9 ñ)]

def _bytes_to_codes(b):L ñ# Convert block indices to word array* òa = memoryview(b).cast('I'– 0assG ða.itemsize == _sre.Å BSIZEG '  ­ Za) * 0   bP óreturn a.tolist()É …simple(pÁ 0che¹ ò	f this subpattern is a "0 ¡" operator† 0if k rp) != 1 Zu QFalse) Ñop, av = p[0] Pif op\ ­SUBPATTERN@ Pav[0]$ ¢None and _‡ y(av[-1]â  N qn _UNIT·Sé 0gen² Ðe_overlap_tabù Srefixþ 1"""• G, C an /  /  %ñ the following pA .8 A/ 4: oRqe same Ð0as J @ a whichE Òinforms about# äotential self-’  Œ @eachf exºP D - _ð 0[i]C#0,² ¥[i:] can'tã ‹ b[0:...žA  ök with 0 < k <= iQ ”-k+1:i+1]R s, Ö  w 20:k\ m = ä*HSÖ å –(1," · kRidx =¥b[i - 1e   Twhile  i]¤ê Bidx]* (   1if J := 0   ª H# 0Õ    Ybreak I “ *dx• Jelseb ^  : 1+ 1N D Ëó t_iscased(flagsqif not  ö & SRE_FLAG_IGNORECASEr W  Rg Nelif: 0UNIo7 ‰0uniþ‹ G × e . Uascii, FÂget_literal_“(n,Œ Ù a# look}/ Ït : B = [ô `appendkN. 1 …_skip = S@ = _™  b9  �Ã3in « V.data" rÑvLITERAL  ( `ºÈd #avê  $  RÚ 2(av" / ¾ ú/s H # @grou~1dd_!T, del  !avä  ,   % 1rcombine, ?, aH  �  A P1‹ e ¬WLOCAL¨ J   1Ï 1, got_all¹ Ðget_literal_p÷refix(p, flags1)
  Aif p! é_skip is None:$  / qif grou" ?not&  * O b= len( 
x  * *el~ 1 ] $( +È 1À € s.extendŽ  y ~got_allÿ UbreakU ;els#  
 creturn› , ka, TrueS % 	ò	False

def _get_charset_Ô ƒ(patternÜ)¹ Qwhile_   l0if á 0 V.data  ! …  þ•   ˜op, av = 7 5[0]! Eif oªSUBPATTERNZ  T Fa, add_�T, del h U = ave ' ² = _combine- ( I k"iföþ & SRE_FLAG_IGNORECASE and  jLOCALEÄ ™ piscased—  — •  vLITERALQ 3if 0 �  3(avÀ '  u      "[(œ)ŒJŠfBRANCHm 1B = [,  F  PappenÄ  . á  ' æfor p in av[1]T   Q
   £ 	J  ²  NC  + ¯(   () D Ã Â (‹     
œ    °  U dIâ# 
³â
 Q3in ; 
#  ’ " & $  ( Ì �  Õ KRANGö "   "ifŸ > 0xffffm #K dny(mapÜÐ, range(av[0]p[1]+1))ä  A   Ò  T² ù Bôcompile_info(code,Û
B@# inXCal: 4 @ an 7 € block. ñthe current version,z ô# this contains min/maxm q width,Öóan optional literalC ãQ or a+‘acter map  `lo, hiNA.getW ð()
    if hi > MAƒXCODE:
  qhi = MA  ¦if lo == 0% ñcode.extend([INFO, 4, 0, lo, hi]):  R areturn ñ# look for a literal prefix   W = [] ‘_skip = 0 qcharset% ± # not used !if ý(flags & SRE_FLAG_IGNORECASE and   vLOCALE)ß ª ¨   × ¬ ,¿ ¤ ó, got_all = _get_; _, ’(pattern,€ "!# ¹ K  C%ì @ ã  { . t/ ´   2 �  �  ##4  ~ b #:
   ôprint("*** PREFIX"í  õ )4 3if o G ”CHARSET",) ñ# add an info blockë 0emiçjRappenå  (r> @len(* 1); ! 0 #g ôW EmaskN-ifG   < f _ý ;  2 þ � is NoneWþ
’O  |’V qLITERALW (el< e   2 !=  9 E9 @mit(! í bq length$ ½<Ñ� '"lo; Kelse    ‘ $# =2#[:" ¬O tmin(hi,m )= á> œ U {  Í H)) #Î  ˆ ‚C  $ > £ = B ( ’  # ±  (  j  Mš  !  Oã( = ÿ	# generate overlap table= _, _, _, ’ V R , hascased[“optimize_ ( I  » aassert9 š }_compil> — , ø K  
 [1] =D  @) -  ó

def isstring(obj@ñ° isinstance ò , (str, bytes))= _P #(pz 1):
¥  ªsgr.state. |6"  7 1 ## Ó Bë  Z%, n < Cthe @e = 8 T.data« =  ˆ .›’(SUCCESS)  ! ë 2hexï   
*ð
'[%s]' % ', '.join('%#0*x `(_sre.¢ÁSIZE*2+2, x)DCx in®Œ1dis­ ^ ¢import sys” PlabelYðset()
    level ð= 0
    offset_width = len(str( Ácode) - 1))
, ñdef dis_(start, end):  J   ÷print_(*args, to=None$  ( Ðif to is not   C     ålabels.add(to)b      ^ ú += ('(to %d)' % (to,),- � �('%*d%s % ï #, È b':' if B in  ½ else '.'),‚  ü Ð='  '*(level-% œ  { 	>  $2%6 Pend='[ ® Q + 2*l )å j ‘nonlocal 3 Á   <1 2i =û  �while i <æ 
ž2E = i-  × Pop = /9[i] ik , «OPCODES[op0 @f opƒñ(SUCCESS, FAILURE, ANY O_ALL’ ] äMAX_UNTIL, MIN kNEGATEk / oJ_(opR5eliˆ ÔLITERAL, NOT_ 	ä  I  ! P_IGNO´ 5  < 4UNI, u _ D ?LOCD   ?argÇ ß Ë   CÂ, '%#02x (%r‘Ûarg, chr(arg)µcJs ATc V ‹ "5  ¾"AT_Jarg]Û] ýssert arg[:3] == 'AT_'UÛ  , +3:L Ä �CATEGORYÊ >/CHÊ 9Ê Š Ð 9Ð •n (IN, INDL—?IN_J
?ski �Y * ) i+ ­p_i+1, " ™ = 	Á�¡n (RANGE,  G Plo, hÍZ: i+2¢ À r 2o   × -a 2lo)	 /hioCHARSE$ o P_hex_³ ( P[i: i/P56//_@ðBITS]))
             ði += 256//_CODEBITS
  ùelif op is BIGCHARSET:#  + Ýarg = code[i] e 1 `mappin9 ðlist(b''.join(x.to_bytes(_sre.™  SIZE, sys. morder)Q  Š  ƒfor x in¡ S: i +õ ` .])S óprint_(op, arg, ´ ) ä IT ¤ Plevelu § j§ ®range(arg)j à • p2(_hex_u( ([iÙ  5 ÎÕ  D ° + ¬ :-= ¬ ön (MARK, GROUPREF
 w_IGNORE 4UNI i  ‘   H C_LOC-  m"4É
ÀÑ ns JUMPuOskipà\  * p, to=i+ 
h  ã xP�s BRANCH� J`while � g  ¡ ¯dis_(i+1, Ã  & Ç  E ÌŸstart = i N_ f¢  ! s‘'branch',/ y
 6 Oelseö   T FAILURE»²n (REPEAT,  ¦_ONE, MIN_ Ì  CP, min[xd_: i+3I Âf max == MAXX Ï & % '& '‰í  Ù
„ E
3bänEXISTSÀ h ” 	2Ã 4 ¾ 
œ 2™ ²n (ASSERT,  O_NOT±ƒ ¬ž  Í @\2\(NINFOQ ðflags, min, max =û  code[i: i+4]
  ýif max == MAXREPEAT:%  4 & % '& '& ðprint_(op, skip, bin(flags), min,j p, to=i+! )B pstart =ª  1if L ÿ & SRE_INFO_PREFIX° Ãprefix_len,   u # = +46 í Ë H2(' < 'J ¿  : Ã M + 6Å  " � ˆ 0 !:  +  ´ — /',c  g   ð
'[%s]' % ', '.join('%#02x £x for x inä )M @(%r)9 'K tmap(chr/))	#+=f  Þ µ t’overlap',¬$ p 'MoCHARSEþ¯level += 1¼ ?in'– Qdis_(É /, ÿ ³i -i i€  Ä	ƒ Nelseõraise ValueError(op)
8 e  � p0, len(.ò))


def compile(p,}2=0)l ð# internal: convert pat … list to"  h2mat Óif isstring(pM  ø = 1= p“  Ñ = sre_parse. Š f
ý D BNonep  Ï @ = _ = d ¢FLAG_DEBUGä ƒ  Ô(m   2dis"^ P# mapBñeither direction` ñgroupindex = p.state. Adict#   @ = [· :] *, s)  ¬@k, im 0 : w.items(H ! r[i] = k© Äreturn _sre.ÕX  Õ 8ä% |€ q…	É 6s-1 w � �, tuple(  Cñ)
#
# Secret Labs' Regular Expression Engine+ óvarious symbols used by the r: e: e: ñ.
# run this scrip”aupdate;  ñ  include files!o ðCopyright (c) 1998-2001r µ ¡ AB.  All , ±s reserved.E "See  p!py_  € informa#ð on usage and redi bu  E S
"""Ieñ  support moduleK £sre"""

# Õ @when�ð stants are addeð,d or removed

MAGIC = 20171005

from _sre import MAXREPEAT, ðNGROUPS

# SRE standard exception (access as sre.error)
# should this really be here?

class e, $(EK ¥):
    """ ñ raised for invalid regular expressions.
: ²Attributes:  O òmsg: The unformattedz � message<  + p "rn/ g    0 "os, Äindex in the&   wì � compila+°failed (mayUNone)M blinenoP   ÿ corresponding to pos< 4col; ocolumn= 2"""*ò__module__ = 're' ôdef __init__(self, msg,ä =Ã ,™ 
 Á K , `.msg =1 å  G$ =G   os %os $if* € is not x @ and{  B �   € `'%s at* i†r%d' % (È &os‚ 3 pif isinè3ce(ª W, strÝ  )   1newªe= '\n'¯   Jelse�   1 b2  O  noÿ ‹s.count(8 1, 0mY) + 1o =  < Dos -2m.rfindB 	> 3if b  Äõ ¾ O(¨ S %d, o6%d)U�  " Ano,  š i& 3 ' =4 ! =ë® …super().”cmsg)

P±_NamedIntCoÂSt(int¸Êónew__(cls, value, name#  ¢ ‰  ‚ h P P, cls~ H Ü  A .U ! =\ » areturnÜ \Crepr\‡ - M  ¹–= = ˜ (´' A')

÷  makecodes(™ sh  ¦ òs.strip().split(Ð @itemŒ[q i:š  =“enumeratek ] Ðglobals().upd {[ Ú  :  G 0temD   "s}ƒ 	  … op^ `ors
# O�ure=0 su„ð&=1 (just because it looks better that way :-)
OPCODESP!  ò FAILURE SUCCESS²±ANY ANY_ALL× rASSERT  B_NOT  aBRANCH C1 ‚CATEGORY ²HARSET BIGC  qDREF 	 q_EXISTS #IN !FO	 AJUMP	 bLITERA— àMARK
    MAX_UåNTIL
    MIN_U ¢NOT_LITERA aNEGATE) CRANG
 REPEAT  2_ON ¡SUBPATTERN  \ R"  âGROUPREF_IGNOR7 (IN €  —  
M 4LOC  Õ ;IN_ U  Y  
] ;UNI]  ]  ]  M_ r 0R MAX_;ñ
""")
del OPCODES[-2:] # removeÁ* H and9 ñ 
# positions
AT= ñ = _makecodes("""y ØAT_BEGINNING  Z_LINE eSTRING7 pOUNDARY$ SNON_B   0END 5ENDK   E &  {:  /   	N )  2)   	) -ÿ
# categories
CHú õ CATEGORY_DIGIT   ¼ z  ZSPACE&  
& JWORD%   
$  YZBREAK)  
/ 0OC_E . $T -  ½ .   Ô   Å .  
‰  . 
‰    [   , Ñ ^  ã 

Ôñ placement opera½ó for "ignore case" mode
OP˜A = {{ Š#: 	   ,  ¥  ':  %  }
S cLOCALE Z  €Ä^ ) b 0UNI“c  Zc ) °}

AT_MULTIaÁ ×:eòšÅ aAT_END  § A 
Q 	N ë.  å ™K š&  \ ]  ß ]  & ]  CH	5ALE\ Ë!:– » $  % (  , ,(  $  <  (  ,  O'  a  &  >   *  	. ÀY_LINEBREAK:ö	 CATEGORY_LINEBREAK,
    6NOT : ú
}

CH_UNICODE = {E WDIGIT= AUNI_ m   ,  …  0 [SPACE,  (  @  ,  0 KWORD+   &  >   *  . a/  0  G  4 	  }ð	# flags
SRE_FLAG_TEMPLATŒö1 # template mode (disable backtracking)= �IGNORECAS? ö2 # case insensitive+ PLOCAL' ÷4 # honour system local+ PMULTIÒ @ = 8” öreat target as multiline stringe ¿DOTALL = 168  ~a singl7 �3Å €use unic"� "d QVERBOñ 6Ë ÷ignore whitespace and commenthPDEBUGš 2Ó idebugg¼  ASCII = 25¼  „ eascii ‚ 
¼æ for INFO primg  p_PREFIXh  g‘as prefix¿ ! `LITERA$ ë óentire pattern is literal (given byB öC  CHARSET = < òstarts with character from K ñset

if __name__ == "__main__":	ädef dump(f, d,{   nñitems = sorted(d)6      @ in  s5  À.write("#def;ò %s_%s %d\n" % (',;  )\ Ð ðopen("sre_constants.h", "w")’fm fi ñ#""\
/*
 * Secret Labs' Regular Expression Engine
 - r  e  ¨matching e) ð NOTE: This file¼�generated·
® ðpy.  If you need˜  to© ng³!ytb ìin here, edit C Û rua.¯ ðCopyright (c) 1997-2001� ÷ ¡ AB.  All , ¤s reservedG âSee the _sre.cÑ Òpnformat'aon usa® `d rediþ bu  G †/

""")
Šó ôUMAGIC÷ 3 { OPŸ@S, "4 2OP" I# 'AT#    *CH  — 
‹– } 	 ‡ gÝ , ”H  J ÀLOCALE %d\n"ó % SRE_FLAG_LOCALE)
  öf.write("#define* ø MULTILINE %d\n"E  H nDOTALLE  B oUNICODˆ   D oVERBOSD   D _DEBUGÉ    @ ^ASCII@  /)
“¹INFO_PREFIXB  ƒ * jLITERAŽ D ~CHARSET‡  Ë ñ)print("done")
#
# Secret Labs' Regular Expression Engine+ óconvert re-style r/ e/ áto sre pattern7 øCopyright (c) 1998-2001 by} ¡ AB.  All , ±s reserved.E pSee the] ð.py file for informat« ðon usage and redistribu  E `
"""In— ó al support moduK ðsre"""

# XXX: show B ‘ng offsetX ñoffending character‰ ðall errors

fromª Ñ_constants imo ±*

SPECIAL_™ö
 = ".\\[{()*+?^$|"
REPEAT ÿ*+?{"

DIGITS = frozenset("0123456789")

OCT% 	o")
HEX" 	ñ89abcdefABCDEF")
kLETTERz ) òghijklmnopqrstuvwxyz= ðGHIJKLMNOPQRSTUVWXYZ¤ ªWHITESPACEÊ ° \t\n\r\v\f' _ a
y C{MIN S, MAX �})
_UNIT1  óANY, RANGE, IN, me, NOT_ ðCATEGORY})

ESCAPEx {ÿ…r"\a": (- @ord( 4)),! b!  'b"! f!  f! n!  n! r!  r! t!  t! v!  v! \!  ƒ\"))
}

"IA2 óAT, AT_BEGINNING_STRING), # start ofJ	08 vOUNDARYNBV ]NON_B" d"  Ï#[(™ 4Y, 
 _å&)]Q D/ 
 
3 s3 
Ãb S/ 
 b ð SPACE)]),
    rô"\w": (IN, [(CATEGORY, 
 ÿ_WORD)]),
    r"\W. 
=NOT2 Z2 ñ!AT, AT_END_STRING), # end of string
}

FLAGS = {o ñ# standard flags �"i": SRE_, ²_IGNORECASE¢ ("L TLOCAL m „MULTILIN s cDOTALLQ x TVERBOl ³# extension› a, SASCIIE t tTEMPLAT{ u €UNICODE,2TYPæ  ò W & |å  E q
GLOBAL)	C XDEBUG1 ’ ñ

class Verbose(Exception):|Dpass$ RState Ò# keeps trackÑÀate for parsÜ >ódef __init__(selfV     .åA = 0m  �groupdict}  ñwidths = [None]  # 4 I ¡lookbehind  2  1 R ‘@property  « $ © ¡return len .& � ); Aopen $ p, name=k ò agid = ø + C
õ X �.append(A d  & (if= Â > MAXGROUPS• $   òraise error("too many "s"³  ' !if¦ € is not l 
H o±  ’P.get(Þ ,2 O S 5 S  % 	Ÿ Predef!0ionH˜ R%r as· e %d; "	 F  '"w- C" % ¥ `gid,  – )¬ ˆ × [Ó u] = gidh ú  #Qclose¥ é` pæX Ì@[gidY p: (‰ O KheckO L � ) <ü7and V si {
É g À gsourcey k4 s- N"ot• cÖ 7gidW µv .©@'can‡Àrefer to an U'3@  if¨# >N¦ 
Ç 5 q ‡ �ñed in the same 'I H  '† Õ subpattern')>2ubP Ÿ 7# a( ,q “intermediLmx  Á	E,%Œte, dataesª l  ð
        if data· is None:
  •data = [] Sself.   
 qwidth =J 
 �def dump(9 ¦, level=0)g ‘nl = True/  | õ	seqtypes = (tuple, list)! àfor op, av in Y ’ T  F aprint(p ö*"  " + str(op), end=''Q  0 Pif op*INI   ö# member sublanguag°  !   r 
V   ¯  ® .av^  % = ° =+1)³ aX %el° nBRANCHV R 
7  j  � @i, aŽ ÷ enumerate(av[1]— *  Nif i`  h 	iN"OR"y  1 !a.. *+1$ Ô þ GROUPREF_EXISTS} ócondgroup, item_yes
 uno = av- v   § E'', < 
  % L ¦ ' fv .noš    l å É_"ELSEv /nou �isinstanc®$, 'µ TNFals¥ þû‰ íi Ï, SubPatternj   î   Ÿif not nl #   x    	    á 	5   ;elsÈ   « ?' '/N   Ö a) · ˜– c 
9ç *  è"av0  ƒ�__repr__‡Èpreturn   I7 ?len6 ?len5 1delÔo w, indexv 6del·[ b« ?get? 

£? w, sliced  ™Þ Â¯ PstateAË‚ ÷ 8 Z! T£ s£  [d„ A b = cod• H ainsert• %C .- ï  H ±  I cappendI  ˆ… .&   ð
    def getwidt£h(self):
  õ%# determine the width (min, max) for this subpattern= 0if O .5 ¶is not None`  g greturn+ A µlo = hi = 0  q ƒop, av i5 JdataS ú if op is BRANCH  t  T ÕMAXREPEAT - 1`     jv      ~ z ^av[1]Y  % Ñl, h = av.getý -()`  )  † �min(i, l"  † Žmax(j, h"  mlo + i` 7ihi + j %elNCALLÂ 0i, v ¾ z ,¯SUBPATTERN€ O[-1]B	„ *2n _ý_CODES† 	2… ‰ * av[0]o ç‹$ 1$ “n _UNIT“ ð ®c 
 [ ¯s GROUPREFì ¬±state.groupºJs[av®  Ò ‹ y"‹ o_EXIST~
 ifs 2]ë] ®   ”[Ð , —-;elsã V    Z Ë    N,oSUCCESF UbreakŽßÔ0 = vIlo, !), 'hi u§ò
class TokenizerZÁdef __init__O‡, stringWŒ òistext = isinstance(* 2 z .  # =M × !ifW$ R ‡  Y  8 _ ‹'latin1'd ˆdecoded_4 5ingl e Index nÌ  ß
0  __   6 iW   . G :tryÔ @char
Jelf.´ [: ±€except I] CErro¤   ðself.next = None'
  ereturn õif char == "\\":  3 ©index += 1 :try(  , F ñ+= self.decoded_string[H ]D €except Ib ^ErrorR praise e ù("bad escape (end of pattern)",Z  �  ‘ ‰ g, len( õ) - 1) from NoneI $ · 2 =  + anext =?8 ‘def matchb , )× j?   ²   __X !()S     µF Tru£  BFals  € 1get~ x Sthis ˜ [ Y o W  6 * V Qwhile[ 2, nÜ 7setg Presul!''8  · ÷for _ in range(n/   c—    ,@ not<  Y:set+ % Ubreakl   „ I+= c ê 
5 0 ì Suntilì ÷terminator, nameÃ 9 7 = ò '¨
° ë œ  Î !is™
N   !…   # Aa F²missing " +Î ÷  ,  4 d%s, un!edA D" %  /or‰c  �´ )ãî '==N Õ !if@   a À ô :, 1z  7 L€ ;‘@property  @1pos;	) sL-‰ “b or ''–  D 2tel€E )AseekŠ ,ÁL Š Þ¿  	 „  ’ @  ÷ , msg, offset=0V + %  0 .{ Ú  v@ 0)

^ r_class_àƒ(source,ïa ƒ# handle  `q insideiaacter H µ    = ESCAPES._ f n6odeD½  7 @ �CATEGORIC A andŽ Ÿ[0] is INU 	9 “ F[1:2 › �xŽÔ# hexadecimalñ(exactly two digitsâ À         esc÷ape += source.getwhile(2, HEXDIGITS)
  ùif len(escape) != 4:!  , TraiseU òerror("incomplete = c %s" % ,V 
r óreturn LITERAL, int †[2:], 160 ôelif c == "u" and… jistextª …# unicod‘ ö(exactly four digits\  Ù º 2 426ˆ  Y 2qU2(_eight383/104L?c =Z
 ¥’chr(c) # ®`ValueEÞÐ for invalid R	Ác ¯N}dimport´EdataH  � t# named  Xù e.g. \N{EM DASH}4 dif not$¯match('{')lªmissing {"%@charŒ  XÀuntil('}', '! Qacter³ '> >try  žCord(± ý €.lookup(M  n )G ¡except Key¢S Äù¤ undefined V £ 0 %r«   k ,E }   &1 1) +à{r'\N{}'«  bin OCTŽ
É t# octalíÏ(up to three�&2,d 
J |t1t8# uz> 0o377¡  j '· vIÿ %s outside of 'd‘'range 0-z 'N!�?in jÅ óŸ J== 2ú in ASCIILETTERS" %4badÚ/%sÞ " 4´2[1]´àexcept ValueErcror:
  Apass óraise source.error("bad escape %s" % b, len( ’))

def _ (A ,* bstate)p ƒ# handle ñ code in expressionŠ  ô= CATEGORIES.geto " !if< V  É areturn ! C _ESCAP@ !6try] 3c =² Q[1:2]a  u  † v == "x"-   Ó# hexadecimal; 6  ! ,4 +=pùgetwhile(2, HEXDIGITS)4 (ifvZ != 4v  Y Å•incompletxÌ E  U´LITERAL, in††[2:], 16¢ %eldu" andÚ jistextª Q# uni£	ö(exactly four digits\  � ) 2 426ˆ  Y 2qU2(_eight383/104L ^Z	 ¥’chr(c) # ®`ValueE£Æ for invalidþ 3   ÁcQ¯N}dimport´EdataH  f t# named  ðù e.g. \N{EM DASH}4 dif not$“match('{'( V  ò V—ªmissing {"%@charŒ  XÀuntil('}', '! Qacter³ '> 	ô  žCord(± ý €.lookup(M  n )G ¡except Key¢> undefined V £ 0 %rw   k ,E¤   œ1 1) +6{r'\N{}'«  0Ý?oct× ?OCT×„ 1e8^µ2in I 
[(# ˜ d *or* ƒàgroup referenc§e (sigh)
  ù
if source.next in DIGITS:&  1 ”escape +=1 Jget(M  ' Bif (+ 0[1]P 2OCTS S and  2 q  N œ L )   / ó# got three octal digits; this is an ‰ u  ê  q uc = intò ^:], 8 + Ïif c > 0o377¾  & Traisebrerror('Ê – ÿvalue %s outside of 'Ç  O   ‘'range 0-Š 3' %”,E 3lenô )î ùreturn LITERAL, c^ \# notŒF, so¨ù group reference@  {
Š #ifC �< state.5 s{!ifŽ % Qcheck* ( i§ @"canÖ ² 1 toß 2pen† "_[
¥ ¡lookbehind© ¯  D Î
 ‘’GROUPREF,— 	VÕ rinvalid. Žb %d" % ', ³ F - 1} )if J== 2€ïin ASCIILETTER{ ™ $baM0 %sŒ  	� ‰ “3ordÄ2[1]+ €except VdE}® Apass.� 'ó
def _uniq(items\šólist(dict.fromkeys& ")
9 ¢parse_sub(,Øó, verbose, nestedW !# 1  ‡ñalternation: a|b|c
Ë † V = [] `append× £ .  v ematch   Ftart Ctell¦while TrueO{ ] !(_© Ö O + 1D
 |i  e ¡êñº C("|"0 #  Sbreak ¿G V == 1Á ¶ 2[0]1 `subpatmr = SubP (·)$ !# d� if all A ñ share a common prefixW= f = Non1forN  uV ð :
            iÛf not item:
  Ybreak þif prefix is None5   =T 9[0]@ Delif 3 !=M E 
z ;elsi �# all sub¹ òs start with a common "‰ )".� ù# move it out of the branch( 1for¨ 1 in s¤ 1del ä òsubpattern.append(Š )a õ
continue # check next one&  $ i° ð can be replaced byþ Áharacter set= rset = [‰Ø pif len(R)œ1ó � "~op, av æPif opzLITERALE 4set(C )= ð IN and av[0][0]P  §nNEGATES 0exth(avM 4Á 
PA# weLÜstore this asK€ instead4aX #<  (Hócompiler may optimizQ –even more¢ (÷ (IN, _uniq(set)`returnñ[
ƒ C  �BRANCH, (ž,¡sJ F  ðdef _parse(source,Mòte, verbose, nested, first=False)ƒ!# : ¤ a simple �  œ r = SubPr(state)À # 6ûute constants into local variablesð Z' =Y) Ì gúØ $.g Pmatch?  . : `_len =
 ’ord = ord² ²while True:  ë 3#= i  É<   ² isÁ ‘8    ’Q # enW>  < on "|)"< 
n{ � Cget(nT Ù
O ñ# skip whitespace€ K2ent} ?   — ›WHITESPAC” ' á�   < [== "#Ò    _   	jÛ #   g ¥2 or× w /\nx   5   ’	²   Ë  a  ›T \T Öcode = _escap[ ¿ a b ¿Ù(A · > ®ú n SPECIAL_CHARSËL (‹ð, _ord(this)))

     ÷   elif this == "[":
  ù	here = source.tell() - 1% ù # character set Œset = [] `append[ 2et. 6
##z #ifu ¹match(":"):!  + ×pass # handle… yclassest Q P.nextí :'['í  S êimport warningC     .	 (b     ð'Possible nestedó at position %d' %ß T,J rFutureWŒ Ó, stacklevel=Z =+ 69 ) VnegatÃN*^"&  Â�eck remaiù M
®while True;EØ Jget(d  kois NonD   % SraiseG ð.error("unterminaP	n"; I  Å Ü£  Q]" anÀî  ] Ybreako  R0[0]h;"\\V &   ‘code1 = _±‚_escape(¨ ,•  ?els8 â!et² ‹‘in '-&~|' V ý " Õ  ™  $     ' '    /%s O =  Ô'difference' Mp== '-' Œ9   'iI0sec‰
C &C ¯symmetric Ž ~K ounion'Â½€)4 9"$t  ¬àLITERAL, _ord(G0  Š2o-½ E  ÿ# potential rangeÁ0thaEY Y ?at ]
 ) aE \ ¥ Ö? - e * ¯ iŒ!f | N_is IN+  W , # =4 J1][0|Ð            sÿetappend(code1)
  s) ÿ(LITERAL, _ord("-"))8 _breakV ÿif that[0] == "\\":(  ‘  � ñ
2 = _class_escape(source,G ‚ OelseV ‚   ?'-'(  ‚ ÿ import warningsª  , % .	 (+ 
 / ÿ'Possible set difference at position %d' % M  Q ß.tell() - 2),… rFutureWß ÿ, stacklevel=nested + 6E 
� � ½
8 ü4 0if 3 13!= 7 1 or 2 ¶ðmsg = "bad character range %s-%s"POthisA	 À craise Uð error(msg, len(@ s) + 1 + /atAlo =Â O1[1]K#hi" 2" ¯if hi < loø —:ïRANGE, (lo, hi7±_is IN>K m/[0pš 2 ))
– �º= _uniq(set¬ò# XXX: <fl> should movÂ�optimiza¸Éto compiler!_ @if _B [  ‚P1 and0[0]ã$isúé (# d 	W  ±�if negatû£subpatternûS(NOT_g,ƒ /1]È ŸU  seÛ
6? ¯ ÿet.insert(0, (NEGATE, None¢  #í9map#ý can't be added here because?ý# global flags still are not known3 þ 1(INJ)U!elqúis in REPEAT_CHARSá`# repeüÉrevious items ¿ =“è	! i  Y?XÀ  min, max =w 0, 1
  ùelif this == "*":  )  min, max => ©MAXREPEAT
) 
G +G 61, G  c  
F {F  áif source.next´ }'   Q ðsubpatternappend((LITERAL, _ord(õ 9)))Ç  8   Šcontinueå      Ílo = hi = ""c YwhileÉ žin DIGITS€ V Slo +=1 Nget(¶ ¯match(",")K |  € /hi€ Oelseq -locif notÕ ¶ }¶ Í)1žseek(here= ã ó_if loÜ Ïmin = int(loW 0if % &>=óK  „ þ)raise OverflowError("the repetition number is too large"{ _if hii Ë ´ .hi9  ‡  ´ ?ax ´ ]{ <5¿  & (Øe' f 'ñ at greater thanº -",„ M  ^ žtell() - :óœ PAsser°Åûunsupported quantifier %r" % (char,‹ñ# figure out which item to)atÍ  ÿð9: &= FY[-1:]B Î 9 INone. ½ !orš `[0][0]™.AT‚ U³vnothingÓ ¢E 	šc + lenÔª  ¦ ž 2n _ÀOCODEn ¨ rmultipl‡/at¦ PÎs SUBPATTERNLôgroup, add_flags, del p‘0temñ ð1]
              õ  if group is None and not add_flags 2del ?:
   ‰item = p þif sourcematch("?")> ðsubpattern[-1] = (MIN_REPEAT, (min, max, c )))a OelseR /AXR S úelif this == "."[ © Áappend((ANY,8?))
E (E ctart =µ.tell() - 1@  ]•i= True aname =t 	 °9= 0 ¸  ž™# optionsU  ¤ EcharÉ Jget(› # 1if & ^
O !   Traiseó
error("unexpected end of #"e  ³Pn `   ÿ # python extensÐ  ( <± )    # ŽdBô: skip forward to¹  $ < ?     Dò.getuntil(">", " # ö   >   !if° & ï.isidentifier(j  0  ¡msg = "bad£‚acter inÍ Ù a %r" % À  N À �msg, len(— ^) + 1· ; p	"=qÊbackreferenc U   | \)\Ó 0gidQtate.N@dictg™× $id· `   Iounknow@\ € så Qcheckê O(gid¹ @"canÿ^ Åcan ope× /",2 Š    6 ½ ¥lookbehindÇ ,D@ Cš GROUPREF, : À            ï   continue

   _else:  - ÿchar = sourceget()+ 1if . ois NonT  X SraiseW ÿ.error("unexpected end of pattern"u H ñknown extension ?P" +ž ,¿  –  @len(Ó ^) + 2„ $eló o== ":"Fÿ# non-capturing group†  ! =>! 
m #m }comment@  Û Ÿwhile Tru�$if–_next Í&@missï À), unterminaÚ  "‰ ½ ƒþ .tell() - start• +   È µ ¢)5 /   _break9B—in "=!<d ÿ# lookahead assertionsm  dir1 qk  Ë  ¶·‰È Bnot 98 Í   è<è" a ì #   �2-1 Ñobehind« .  ô# Üs“\tate. B !if9	E ”sh � � w ò p = _parse_sub(x,pðte, verbose, nesÐ?+ 1…0if -?< 0  Þ ? zÖ 0if mÎ ¯match(")")œ rÕ4sub«ØŽ Ô2 É=-ðsubpatternappendÿ((ASSERT, (dir, p)))
   _else:  - ôsubpatternappendW ?_NO[ �continue
_ ÿelif char == "("� ý# conditional backreference groupX  ³  4 ñname = source.getuntil(")", ";  # " œ 0ond" ÿ .isidentifier()¨ v Y �= state. @dict€ (– r  B v 7  is Non™ 2 âmsg = "unknownØ a %r" %> Å ' A   Traise*æerror(msg, lenµ O + 1º ??try3 ~  ò V= intr ´ 
	+?< 0d  h æ `ValueEä _ vexcept * \ ƒ1badÏacter iŒOQ from#Ê aif notbÉ !1"Ö ; Ÿ number",m  d  E : 	ÔÏ>= MAXGROUPS¸ �sinvalid'$%d	É À 
 
öñ checklookbehindv Ö
 ,iLòitem_yes = _parse(�,Rÿ, verbose, nested–#ifi ¯.match("|"¼x /now /È¶ Q.nextà|à /   y "úÿ with more than two branchesÊžø  lEÒ M)M	Í ðmissing ), unterminaÀ^[� €tell() -ðrt)
              ó(subpatternappend((GROUPREF_EXISTS, (condgroup, item_yes
 cno)))
K 	 �continue
 òelif char in FLAGS or }== "-":3  Z # flags  ¡ = _parse_ ñ (source, state,a « "if[ ò is None:  # global t  ” Àif not firstÅ MÄ  4   ßimport warninÔ  (   % .	 (‹  +    'F&— `at the Qrt of ÿexpression %r%s' % T  X NÐ.string[:20],'ÿtruncate long regexe¤ E  4' (= £d)' if lenµg ÿ ) > 20 else '',ü )# ÂDeprecationW~!ÿcklevel=nested + 6m 
H Þ Aif (q.…p & SRE_æÑ_VERBOSE) and verbose+rraise V+ • n • 2addR, del / =Üí! =t  �´ ¬ *ñerror("unknown extenxA?" +Ž® ½ !   1j) + 1)R!# ô ³  :ent‚#if !isxä× ?tryÖ Z =Hqte.open ^(name	qexcept þ 0 as	 W - �err.msg,ñ _ ñ ^ fromŒCsub_CT = (( Eor (ò�‚ l   Ô(*Ä 
ø p{3subÄX y¨ %, a1C J<®match(")")<8 ð"missing ), unterminaÈ�"m €tell() -ó-rt© ÿ - (MQclose. ( :, pM   }ÄSUBPATTERN, 5 Í¿ K )UPthis D^Dh Àernappend((AóT, AT_BEGINNING))

  õelif this == "$":  ! òsubpatternappend((AL :ENDF *se: ð,raise AssertionError("unsupported special character %r" % ( ,^ ñ# unpack non-capturing groups¬ öfor i in range(len(· †))[::-1]� –op, av = % 1[i]J  ò öif op is SUBPATTERN<  ! z ô, add_flags, del ep = avM  0 "if­  T ÆNone and notB  I 
r  F ­ ¢: i+1] = pÇgreturnÐ Â

def _parseš ñ (source, state,t)f  0get& A.getÃ ä A = 0 ¢  !ifM g != "->›while Tru 4� = FLAGS[ê{ è 2if ‘ r.istext¤    q n== 'L'   ( ðmsg = "bad inline w `s: can{0use=  Ã with a str ì"ì  I  Òž eÐImsg), ,el B ³ u³ ))u'³ _bytesµ /ç!|=` 	Ó @if (>� & TYPE_º)´(: 
 !H �™ b ¡s 'a', 'u'^ þ'L' are incompatibleš– gÞJget(µŸ0is ¡¶ d  P"miss‰¯-, : or )"U gn ")-:   \breakk«  £"in$Ž Dqunknown±#" Ä °.isalpha() ‹ §  	r  ˆ Þ  Pmsg, I � )Ù b ')Ï R.À&|=Öh Ÿ [ &if% ’ & GLOBALWí •  Ïÿ’on global>, 1¸ ¡ Û ë š  H ÐÌ"f K ¿  ”  Ðmsg, len(charC))
  µwhile True:   ùflag = FLAGS[char] 1if " q& TYPE_' 
A  E  msD ±"bad inline5 òs: cannot turn ofL ùs 'a', 'u' and 'L'"s  Q öraise source.error(msgÎ  $ @del_œ As |=p 	F  Ë # =C Jget(= 1if " kis Non ^ ‚  ¿"missing :"M n== ":"Ybreakž   "in~8 Wqunknownä #" ; ÷.isalpha() else � 	j Ì �msg, len('bassertË J 6if kŒ& GLOBAL
/bglobalÙ 2, 1Vcif addÛ&|  m  zQed onlEoff"h !re—l ,k ’

def fix† Q(src,¦ "s)† q# CheckU 2fix p accord"õto the type of pattern (str or bytesî ¢isinstancei 3strg  ½‚bs & SR‚r_LOCALE‹  $   aValueE1"}Buse 1 § € with a ‹ ˜ Ï0if ” <	r ZASCIIq $ &|=— qUNICODE6 “ /el½ & 
M ¾ r a1 ¾ ós are incompatible½  S x (6y 7»Ñ|  ì r v æ-Ãß ±  C 	K G Ñ$ ÂPparseu¾ =0, state=õe!# ' T 're'Ù   into list¿ñ(opcode, argument) tuples
ë§À = Tokenizers ) "ifr  j‰ @ = S‘ Ÿ .Â  Õsc  $ .³=¹[ 6tryAQp = _É R_sub(” î þ B¢VERBOSE, 0‡×except Verbos#È. ‚² was switchYainside( P�.  to be»  Ú#� Psafe / s, we'll{  @wholF  ?…again...A , Y  
0À | SRE_FLAG_“VERBOSE
  ö state.str = str Õource.seek(0) ñp = _parse_sub(s& !, F ±, True, 0)
0 !p. Ñ.flags = fix_ i(str,  3 2if S ñ.next is not None:S  µ iassert( e== ")"" Traise! öerror("unbalanced parenthesis"x š ö & SRE_FLAG_DEBUGw sp.dump(1 Ðreturn p

defR ºse_template)C #% ð 're' replacementuñing into list of literals andÖ ñ# group references  V“Tokenizerw ¬@sgetÒA.get+ @  0 ![] c *=    „append =� . @  ÷ 1addW ³(index, posî  ¨1if  " >., s !   «.¦|invalidî b %d" %O g „  A i.
Y à ´ “(''.join( )' B   4delå "[:!  ² C 5(le@ 2s),� I [ s0  ·g H  f r Ë Qwhile@Ç 0thi± Ë(H  ” 1if  +is  €break # ·/ofh m  * G @[0] >6\\"y    r0   1c =| &[1#  Aif cF gE   †name = "Ÿ    !ifÞ·s.match("<"> !  %@miss3&<"+ n søÁuntil(">", "o  5   ‰ ÿame.isidentifier(Œ :try)z   ãn  [s 
. )   °except KeyE£V ÿ Id*  ÍSknown' c 0 %r"  7els@ |  Î Oint(Y G ë?< 0È  . Ì QValueÌ 	` !   & T P s@ÿ bad character i",v  z 
  ðù ¡ + 1) fromt? Ï>= MAXGROUPS¹ ùw 
²   
¶ ð
               ÷ addgroup(index, len(name) + 1)
  éelif c == "0":  & þif s.next in OCTDIGITS(  , Úthis += sget(f     O  0 S ðlappend(chr(int(/ ú[1:], 8) & 0xff)‰ ï ?in Ê ÿ isoctal = FalseE ¼  # Yif (cZQ and Ç -2] Œ  D   £ )¤ .  _ ¨ ' 	>Tru #   Lc = |© l> 0o377¡  W ò raise s.error('”ÿescape value %s outside of 't  N 
 ‘'range 0-ˆ 1' %r' 4= rc(  sif not <ã ž³) . -¦.seM >try  ®  Å 0 = €ESCAPES[ J][1] - °except KeyElR ¹ïin ASCIILETTER S ½Cbad »/%sog ¶ ² ,el( ¦if literalÉ  #s./ƒ''.join( Ç»÷instance(source, strOð6# The tokenizer implicitly decodes bytes objects as latin-1, we must
&  ð# therefore re-enA   õ final representation.å»  s = [None ZA is   ) <N #('~ €') for sX@ ]R qreturn 4$s,Aôs

def expand_template(	 s, match2g = .F W Uempty ’string[:0t ' m 4 = Z = ¢ % =� "[:; 	ø Ó çS  Þ 	 s jP [- a] = g(( Q) or « x I:×’‚"invalid5ñ reference %d" % e º]b 	x�s)
"""Coopts/funcæs§ðinterpreting resultsé‘os.stat()+Aos.l À).

Suggesteòd usage: from stat import *
"""

# Indices for! ðstruct members in the tuple returned by os.Q ð()

ST_MODE  = 0 @INO  1 1DEV 2 �NLINK = 3 1UID 4 G 5 1SIZN 6 �ATIME = 7 M 8 C 9É ÂExtract bitsð  ¸ Ðmode

def S_I¥ ( ±):
    """RÒ ã  aion of pfile's / ñ that can be set by@ ±os.chmod().  S X '; …& 0o7777… ?FMT„ '�describes£ t  § _ typeƒ `170000(ðConstants used as • )…various X ðs
# (not all areB±lemented on psystems`_IFDIRþ@0o04u ô  # directory
S_IFCH! 2! 0cha¾‘er device( 3BLKI 6( Xblock$ 2REG$ 1# 0m qregularÃ H 2IFO$ 0%  $ ñfifo (named pipe)) #LNq 1™ Ñsymbolic link% 0SOCÃ50o1ß bsocketq ¢# FallbackUôuncommon platform-specific c‹X BDOORBu_IFPORT "WH ñ
# Functions to testµAeach~ 
kOSDIRlrTrue if£i0a§.Ë ¶¸1 ==36DIRj /CHj ð#alÔÆ ~ 'CH~ ?BLKè Fz $6BLKø ?REGz œç 6REGm OFIFOn  1 	æs 6IFOs /LNZ	/n 'LNN [á yh  [ ×  li Ldoorg FFals]S³T €n event x[ /WH4È Àm a whiteoutð@."""
    return False

# Names for permission bits

S_ISUID = 0o4000  # set UID"   G  2    àbit
S_ENFMT = J   ð
# file locking enforcemen- QISVTXm 1M Ttickyl 2REAŒ 1040Œ ñ Unix V7 synonymÅ pS_IRUSRœ QWRITEP 0200 # 0 W0 BEXEC/ 1` 
X0 BRWXU0 70 Amask… HownePs�  — / ¿ �read by .  "  ‰ "  ° ‰ # write#  | # ¤ [execu% BRWXG% !07)™ Wgroupé™ 3GRP/ 4/ ™ . ™ " 2" ™ # X# 1# ™ % CRWXOj e07  # ™ ñ others (not in 2 )© 4OTH? 4? © > ª # 2# ª $ X$ 1$ « & 	³ðflags

UF_NODUMPKR= 0x0 H 0do À Adumpè . �IMMUTABL‰. š W 1may4  be changed5 kAPPENDc ò 5 ðonly be appended to: kOPAQUE: 8å ðdirectory is opaque when view@ °hrough a unPstackS �NOUNLINK {Â ã�  ö òbe renamed or deletÍ ‘COMPRESSE½A 2�QOS X:* ” Âhfs-compress: hHIDDENÍ 8: dshouldEõdisplayed
SF_ARCHIVEDº  X�º  BRrchiv2 ® ×
2 ì ® g ®4 tg ®SK
[  o [ ´SF_SNAPSHOTá ® @ Ñis a snapshoth@


_• ámode_table = ( ((S_IFLNK,q Q"l"),   6SOC P"s"),å AMust‡ðar before IFREG and IFDIR as IF> 3 == | ^ 7REG{ -{ &BLz : "b 7DIR: d (CH c 7IFO: ap")),
“  ² Cr"),  ¯ w  «|ùQUID, /[ L X< S—  :  x— 7GRP —  À    "w"),),
ð    ((S_IXGRP|S_ISGID, "s"),
     Y   "S  : , � "x")),
< Y GROTH Cr"),[  W w AXOTH— yVTX, "tz S { )"T  : x  — ð
)

def filemode( !):¬ Á"""Convert a! 0's  ò to a string of the form '-rwx Q'."""F ‘perm = [] äfor table in _v _ v  ¼  & �bit, char*    $ "if� €& bit == B  "    ~ €.append(M )†    Ubreak JelseF B 2"-"A ð return "".join($ ð)


# Windows FILE_ATTRIBUTE constants)¡ interpretAñs.stat()'s
# "stú_attributes" member

U Ü_ARCHIVE = 32 üCOMPRESSED = 2048! PDEVIC< -64 ÜIRECTORY = 16 qENCRYPTY M1638? `HIDDENw ; ñINTEGRITY_STREAMº -76œ `NORMAL~ 2  ñ T_CONTENT_INDEX‰ =819ÐNO_SCRUB_DATAM M3107& `OFFLIN	=409í qREADONL
Î ÐREPARSE_POINT` -02S#  ¹] = 51 PSYSTE	; qTEMPORA†-25š QVIRTU%Q65536}€If avail`ò, use C implementation
tryß`from _z # ò	ort *
except ImportError, Ppass
Ð`Basic 5 Qistic”ule.

Thi à provides funcv öqcalculaõC ðof data, including
averages, variance, andy ¡ndard deviÐ G.

CW 9 /
-  =

= -    #
F× B  pDescripî g 5@mean[  ±Arithmetic  (ò )ˆ G1.
f 5 ²  Fast, flo~zpoint aL Æ.
geometric_C G p ­‰.
harmon+ # H + LmediÊ M ×(middle valueÄ 3 F_lowÈ BLow  ì  U_high) H  ) rgrouped, „ ð, or 50th percentiûle, of grouped data.
mode  M ð(most common value)> 6 Kulti; @List"   .s ? s  ? Ç).
quantilesz aDivide— P into ýervals with equal probability.
= -    ñ

Calculate the arithmetic mean (" uverage"a:

>>># ü([-1.0, 2.5, 3.25, 5.75])
2.625
b ñ standard medianbiscret [   °([2, 3, 4, R .3.P G ñ , or 50th perceaò u÷[Vclassa
. ared on1 ôsq ˜ò d. E.g. if your§ðpoints are rounded to
.ùnearest whole numberÖ _‡Þ á 3ç ô])  #doctest: +ELLIPSIS
2.83 ò...

This should beÎ pD0d iÈ pis way:° ™ have two¸ & !e A
intnQ 1.5-ÉBthre� é 1 p 0valö -3ú anB Š X ' Ç3.5-4.5. TheùKthesf "s ì æ �ƒing variþ í�spread
- 
*/—
Function²€ Descrip b 0pÞ (nc�0Pop™ x  !ofÆ%.
 ” bSample) K - gpstdev* 7   ^ “PdeviaÒ –$:   h 7 	yž7	¤ sò  ´b° !([ÅŽQ5, 11š!11›eÑ4.38961843444€IñAÄpreviously c3d2 ),jQcan p^At as o"ñal
second argument to  fQ"Í3" fis „avoid reo  #itè  ó � = [1, 2 4& )B, 6]Ÿ2u =¤ . ) i( @, mu© WñStatistics for rel‘s betweenCoinputsv–€0M‡À===  ======== Å
covariance  wSample  �for two , õbles.
correlation9 ¨Pearson's  Ïcoefficient I  âlinear_regressO ñIntercept and slope; !siš 3  3 ..
õ .    ¨

Calculat/, Û ,Ÿ • 
í ñinputs:

>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]$ y$ - 	 $ ž±(x, y)
0.75> | ñ  #doctest: +ELLIPSIS
0.31622776601...< Z�B !
L°R¯(Ÿt=0.1, i¸ =1.5)


ExÆeions
- Ä

A single e  ð is defined: StatisticsError ña subclass of Value ð .

"""

__all__9
�Ò'NormalDist', V  / v Tfmean ¨geometric_ kharmon PD : Fmedi^  †_grouped0  $ [_high 5low 5ode Wultim dpstdev pâ ”quantiles" 	/ . ä]

import math tnumbers ðrandom

from frac(#s 9 F  tdecimal D  …itertool; ¢by, repeat& dbisectA  s_left,  Crigh-  ¶ + òhypot, sqrt, fabs, exp, erf, tau, log, fsumj `operat“¢itemgetter  Zcolleí 0Couð , namedtuple

#�   "

à¨(í!):ÊTpass
D @Priv­’utilitiesK Ódef _sum(data8 6""" ð -> (type, sum, c§ !)
a �Return a oa-preci™0sum~ðthe given numeric e U as aìtàtogether with 8  r P to b_pnverted  è   ‡  e  Z"s.� !Ex’s� G  SÕ ð[3, 2.25, 4.5, -0 a0.25])7 "(<^¤'float'>, †�(19, 2), ² <±Some sourcen±round-off e�@willÁ ‚avoided:Š  # Built-inQ! rDqs zero.‚ «  1e50, 1, -
 �] * 1000¨  007 A), 3/ V Æ Àions and Decð%imals are also supported:

    >>> from fractions im" # F U as F, ñ_sum([F(2, 3), F(7, 5	 A1, 4	 q5, 6)])3 •(<class '_ .X 5'>,d €(63, 20)C ˜ 0decÃ – D Aas Db  Á ñdata = [D("0.1375"),  E2108 E3061 u0419")]D Ù  I ¹ € .y 
¶ 9¸ H1000» ¢Mixed typexðcurrently treatedRñan error, except that int is” �allowed. 1""" ‘count = 0 PpartiÞI= {} 0_ge' ! A.get  0T =d  0for¥ ð, values in groupby(, 1e):,  * < ‘_coerce(T ð)  # or raise TypeEÓ 2  b @n, d[ ômap(_exact_ratiow a  e á E+= 1F   É d[d] =   æ ¡(d, 0) + n1 pif Noner & Â ð# The sum will be a NANÃ ñINF. We can igno/Ál the finite^  ‹ # ð, and just look aÅâis special one¾ 7 Wtotal¼ [§ ~  âassert not _iss (4 �HelseÉ bSum al¡ é  Ù ð s using builtin ƒ  Â…(  ) ªHd, n8‚.items()� qreturn ú Ë !, «w)


defµ xÒ6try± > Sx.is_Ý =“Likely a ^­ ‚AttributVM Umath.,xP CŸôs to float first.¥ ¾S¦ 2"""4 î1s TÔSA �a common ,%è.ª@ }ion rulò O€mplement÷Ñn detail. See_? BeTes¢Rtest 40in   _s: Rstics¨A s+#P òhttp://bugs.python.org/issue240685 mAT isrpbool, "è ¸ º    yA# If¯   × °same, no neó"o bÒ anything. Pu@#�B, soð D Óusual case (nB  O S °ed) happens52sooç# spossible"if´ CS:  oTu ‘ \t& other§ t‡ e  Ú  @if S 2 "or  Z s 6int Su  If G âa (strict) subÜoNŽ  K V u % �  À8 l(S, T)m 7if # ð T, S):  return ñT
    # Ints coerce to the other type.% ÿif issubclass(T, int):  return S%  S% o óMixed fraction & float� s‚  3(or y )� FL X) and© "S,B !):¡  ï ² T. G  c J × 3Any7qcombinaÞ Òis disallowed¿ ðmsg = "don't know how÷ ƒ!%s€ 1%s"µ ðraise TypeError(? õ% (T.__name__, S ð))


def _exact_r† #(x B"""R±ÐReal number x| / ð (numerator, denomÇ ¡or) pair.
� :>>>^ Q0.25) b(1, 4)' Ðx is expectedb Pbe an8$, M¤, Decimal ë""""û =tryoÃx.as_integerß } ò except Attribut.? Apass¥ ( ‘(OverflowVb, Valu4 - -#?@ NAN£ 2INF¡   òassert not _isfinite(xŒ    i‚(x, None 	Ò ‚# x may IÔ vral ABCf F .›(x.�Ö þ  5`= f"cau@conv¼  à0 '{ 5(x)E }'°p /m ˜ß —|`  (vT3, TRC"""Cz   f PgivenŠAericq4 T. !if H )QTÑP# Thi¸AversµÐcases where T. h#or y i È 7# aß, (’t + ŒC u½$ ¦V != 1½ 2T =[H ðFIXME: what do we   ð o·!s?; ˜ T( æ7{ µ ò ¥ Q   í U ~D) /  ß 9 Felsen   Â˜Ôfind_lteq(a, ™q'LocateÆ‘leftmost D ™€ly equal2!x'á °i = bisect_2 N  0f ioRlen(a–a[i] == x™ à i3 ¢ 	­ r­ l° Origh± 3 ² b, lo=l= ™ ¸ (¹ 5+ 1¾ O - 1Â   Æ ðail_neg(values, errmsg=ò'negative value'):
    """Iterate over ñs, failing if any are less than zero."""B ƒfor x in; W  [ †if x < 0   ñraise StatisticsError(errmsg)Q  & ð(yield x


# === Measures of central tendency (averages), ö 

def mean(dataè ñReturn the sample arithmetic0  ]  3 !.
ˆ 1>>> ò([1, 2, 3, 4, 4]¦ 62.8' ófrom fractions import F [ as FS °F(3, 7), F(^ 1
 A5, 3	 1	 i F ‹(13, 21)v tdecimalt D Kas Ds ¡D("0.5"), 
 7 &62 3 { M “('0.5625'| PIf ``)Ì`` is empty,Ó‘ will be ñ!d.� 4rif iter¡ D  N (  r = list# = n eÖ †if n < 1: m ‹  ('` requiDÑat least one l bpoint'Ù÷T, total, count = _sumˆ dassert 1= nŒ r^‘_convert(D ’ / n, T)
•fˆ J ³ B"""C0 ˆ ñto floats and compute²«£òThis runs fasterŸ âj Q) fun”P ¢it always ­ 2s ao �!Ifj Qinput� 0setœà"itË 6 ¿Ž  1ã ó [3.5, 4.0, 5.25OA4.25,2try óß±except Type&, �# HandleFAator™ò
t do not define __len__()à e 0„    )å(ŽCable.    ƒnonlocalä     ó"n,öAenum@D ›, start=1M  : Ø    &0= fc‹  ‘)‹Felseõ 	, & É 	EÙÁ }" HËZeroDivisionP7Í8  CNoneé¡geometric_ˆ­ É òD …cR>‚  ¨ ÷½u€ containD  Ç@, or= iÑ 
,| ðNo special effor¦òre made to achieve exact resultsz°(However, t± may change7 · sfuture.` Heround(Hò[54, 24, 36]), 9&236.ÓWÀ    return eñ!xp(fmean(map(log, data)))
    except ValueError:   ñraise Statistics À('geometric V ñ requires a non-emptyb Uset 'M  Q  ð)'containing positive numbers') from None


def harmonic_z (Ç  , weights=' )½ Õ"""Return the5 ¯ !of� !.
š T  !is5 Ñreciprocal of „arithmetø  F - s.  œ ð.  It can be used for averagñ ’ratios orE Qates,# ãexample speeds« ñSuppose a car travels 40 km/hr8 €5 km and° n> a-up tob 6, €another 4 s. What û ¡ ~ ?( º5>>>L�‚[40, 60]J $ B48.02 ¯ ,° @whenÓ Áffic clears,³ Ä  À  Ú3rem<3Û |rjourneyÖ G Ú &_X[5, 3ë $56ë PIf ``ñ ``D , ë‘ny elemen]0les]ran zeroá )``Ô‚`` will {+``}1``.Ð 1""" qif iter
)|  †  Ž  r = list# 5 ¤errmsg = '{  does not sjqrt nega‘vsÌnQ 'enP †if n < 1x ¾ ¼ (o =8±t least oneœr point'V!el` B== 1+ï í  òu 1x => 1[0]ç    ãsinstance(x, (\ó .Real, Decimal)8 3   †if x < 0]     Ú R°  &   r�xŒ JelseQ M 2TypyC('un{sed type$ifåö þæ = repeat(1, nŠ Fsum_# n� 
‰  # C& F 
®   ÿ P k tif len( Z != nB ð Nï ½<  ŠQmatchÖD siz _7_, Ü Á, _ = _sum(w
äw in _fail_neg• #, ª¶ 6try¡ ,4   1 9 x `T, tot<Vcountv @/ x © _" 0† , Vn zipƒ  X 
|ÁZeroDivisiond– F0€ "if| 8 <=œWÀr('Weighted ðXsum must be positive')
    return _convert(sum_weights / total, T)

# FIXME: investigate ways to calcul òmedians without sorting? Quickselect?
def * q(data):Œ B"""R� 3the  ð (middle value) of numeric : !.
: PWhen 5 `number&   ô  points is odd,í  ) V & .I Qeven,l Á  ] ñ interpolated byJ ataking) paverage–  { Ctwo  Õ "s:Å 3>>>õ ¢([1, 3, 5]¥3R    3, 7# 24.0F 1""". Ú =€"edf wn = len ’if n == 0†ó	aise StatisticsError("no¡ ¡ for empty†"§ I 0% 2M 1M Ô ‘ �[n // 2]Š Felse& Bi =   † 9 « ‘[i - 1] +q §[i]) / 2

KA_low, O4low½ D* Â¾  E'edD it -Rsmallš B  . G ðÚ 	$ 3«ô
øOhighù  ú ‡6 °ò Olargñ& µ _% ó5ón¶]²Sgroup—!, ?_val=1ºò50th percentile (yI ± continuous,áB) TA2, 2`84,  o,.7�? A52,   Ÿ4}352.uUThis sÿ¯ " a Î ñ , and should bex `used wÓAyourÑ  ä  4 “ 2. Iûðabove example,
    the valuðHes 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3 O T< ñdle value falls somewhere inH T ` 3.5-4< ñand interpolation is used to estimate it.
>  Op$ €al argum´ !``? Vval``Ë sÌ l   Q, andF €defaultsd ¿1. Changing4  a natur'`will c+ e) I [ º ôed 50th percenti:¸ ñ>>> median_grouped([1Œ’3, 5, 7],aval=1)] A3.25	 = 2= 5z �This func9ð does not check whetherÐ a data ûás are at leastƒ 	faapart. 1""" = �= sorted( ‡ wn = len ¡if n == 0:9  [ó
raise StatisticsError("no3¡ for empty¥ "[ $elK 1K Qeturn' 1[0]b a# Findã ™aé�. RemembÑis correspond 3theG  Ø re (
\2x ={ bn // 2€  ½ –obj in (xæ)µ ÷if isinstance(obj, (str, bytes)* .BType(Á'expected nuÆ òbut got %r' % obj06trys uL = x -t€ / 2  # Æ¡lower limi í ». î uexcept Š ^ P# MixÃðype. For now we just co$ |CfloaI Ú  •  b(x) -  c@val)£ Ó²# Uses biseÖ`searchR 
  txr Šó with log(n) time complexityÛ"Aposi)ñof leftmost occurrencýX < ñ l1 = _find_lteqé2, xs{Y OrighZ 
e[l1...8Hp# Assum¨ò always l1 <= l2‰ 2‰ r‰ %l1�  cfŒ1-  02 -C "+  r;5L +èP * (nxP - cf‚Áf


def modeì �B"""R@ / 6Rcommo‹Wñ  from discrete Qminal4á ``[ @`` aí &es0  ËÃ ª „s a singj!. ëiûæ  Q¡dard treat.!of	 d   aì ¤ �ly taught2sschools¸ — ð  ²D3¾"4]í + 3¡‰ ¢also works�"noí Ñ(non-numeric)û l È"red", "blue  Pgreen    ‰ ð'red'

    If therðBe are multiple modes with same frequency, return the first one
    encountered:

   1>>>N ”(['red',  Pgreen Eblue 0])
6   ) I ðIf *data* is empty, ``¥ ò``, raises StatisticsError.; 1"""R ¡pairs = Co¤ `(iter(T ò)).most_common(1� Atry:8  Š ó C a[0][0] Áexcept Indexs 2  “ ’ A('noB forÇ  ‚ �') from NJR

def‰ à £ Y B"""R}@a lizf‡ ¿ ¢ótly occurring values
DWill¾�more than¾‘ result iO rð Sor an¸ € i—k õ LÃ C'aab 2cc'`B['b'F, çccddddeeffffgg4 1, 'Ef> * [ ü˜ýœ 1max2 ,­P_item= Ñnext(groupby(! ps, key=! 0getQÂ1)), (0, [])M < 0@(mapxm- (0)b ñ))


# Notes on methods,`computÒßquantiles
# -  
#
# There?!noôò perfect way to b %e ` @.  H2 åwe offer
# two–  that serve; àmon needs.  Moš±ther packag¬ ‚surveyedM �ed at lea+ Áne or both o‚ sek P, makó òthem
# "standard" i@sensž à "widely-adopt\ ònd reproducible".yå�also easø …explain, 	ðmanually, and have
# straight-forward interpre{0onsSte ð n't surprising.Ù€The defajÜ Žðknown as "R6", "PERCENTILE.EXC",²"expected
#Ò (Àrank order s~ ù ".èÃ alternative±k  L+R7m $INm  ³a  Ë 0For ) À! w\ óbaa posi~ ±probabilityÉ‘‘
# beyond¿ArangÇ S P , šR6 exclusÆ ða
# reasonable choice.  Consi„a random¢ rof nine:sj E ¢populationèña uniform distribu š00.0%P1.0. b*
#% ¸` third 4ked PpointÁdescribed byñtavariate(alpha=3, beta=7) which has‚à=0.250, median !86—Q
# me  30š AOnly< laŽ" (H £correspondÓðR6) gives the
# desð:ired cut point with 30% of the population falling below that
# value, mak ð!it comparable to a result from an inv_cdf() funcX ø2.
# The R6 exclusive method is also idempotent.

# For describing¤ ¡data where¾ 2endØ ñs are known to
# be included in-  < ,
 "R7 ‹ p reasonÝ ô
# choice.  Instead3Ñmean, it usesP Dmode ð beta
# distribuA for( ƒinterior´ ð.  Per Hyndman & FY ð"One nice
# property) ‘F €verticesr ²Q7(p) divid@rangû ±to n - 1
# v õvals, and exactly 100p$ 1 liÙ ¢left of
# g  > ¯100(1 - p)< @righ= ;  ."×óIf needed, otherps could³ñadded.  However,:1now· 1osiRiy°at fewer op s¦e3 ceasierÂs÷  ?ð	
# external packages can{ Aused< Panythíòmore advanced.

def quantiles(Ns*, n=4,Ê %='âÂ'):
    """Dž*2 *Žðo *n* continuous  er¢Ÿ0equ¡ Árobability.
L ÑReturns a lis](ä)à@s seŸtÁ  ÄÙD 1Set~ Ato 4ï AquarÒ   (0 ·default).  + !10, 0decü .Ž 	   Rperce £ which giv$ 99¦ sû_ !° %e   XB100 Ãsized groupsÄ  N. ½rany ite— Y0ainbsample°  6 0‚linearly�`polateˆ`tween °¯ y BIf *º*’0set¬ *i L%*,Æ Qs treO aô e: Y !. �minimum g T 6  �F0th VÉeF ?max; 
*10= 1"""> ‚if n < 1¦ ‰ðraise StatisticsError('n must"Áat least 1')D  È ‘ = sorted ‡ld = len Ÿif ld < 2p n Uhave p 8two�~ #ifvU == '„'b m‡ d á   ®A= []Ã    ži%<S(1, n½     j, delta =k�mod(i * m) F  ( mG!=  a[j] * ©D 1) +Í `[j + 1  9/ nM « ˆ.append([ f q r„> Àthod == 'exc£lusive':
  ¥m = ld + 1 µresult = [] öfor i in range(1, n)E  L àj = i * m // n  õ# rescale i to m/nj  6  L ó1 if j < 1 else ld- >   j  # clampH A1 .. 	N Pdeltaž *m - j*� 
ù# exact integer mathN   ñrpolated = (data[j - 1] * (n - q B) +     */ é kˆ.append([ )u `return11ult òraise ValueError(f'Unknown method: {	 ð!r}')


# === Measures of spread   °See http://ñ ðworld.wolfram.com/Variance.html
#¥1 oSample7 ðen.wikipedia.org/ ó/Algorithms_for_calculating_vƒ ð
#
# Under no circumst� ðs use the so-called "computational formula 4
# S ð", as that is only suitable* e hand Œ ð ons with a smal`amountXÑlow-precision`. It h` @erriS ñnumeric properties.Õ  † a ± `arisonP Qthree Å må”s here:
#‰Ñwww.johndcook¶óblog/2008/09/26/[ 1ng-W -I @-of- uh-L‘dard-devi8¡/

def _ssîƒ, c=NoneB"""R£0sum³ usquare ? prequence
È€If ``c``u Q ,¼@mean p edx one pass, Œ ä` M Ffrom@  � 
A �a secondF È. Otherwise,© 1areM ; X § ´as given. UhS BcaseAcareMRit caíli£to garbageÊ!s.j 1""" @if cö @not ]±T, total, ceñ = _sum((x-c)**2¡x# n7(?   M ;  ~A_n,  á} " /~ P).as_¨Pger_r(Y Àpartials = C§ #er  :1n, Å`map(_e`< ,H T diff_n = nJPean_dP P)  Ÿ d dG  ‹ [N  ! 	 Q] +=   ^ 	 5 !ifs D< 0# TQðum will be a NAN or INF. Weé± ignore all…RfinitL “ $# Y Àòjust look at this special one 7 {== [•passert 32_iss (4 ” "ð :
        totalð\ = sum(Fraction(n, d) for d, n in partials.items())
    return (T, total)


def variance(data, xbar=None):
7 B"""R: ¥the sample4 @ of 7 !.
c   ð should be an iterable) ñReal-valued numbers, with at least twoI & �s. The opç Àal argument £ ·, if given,r  £ qmean ofH    • ð. If it is missing or None, $ 4 óis automatically calculatedà ÁUse this fun}¡ when your ` a$ from a popD bion. TÞ X | v€ 1  Ž gentire: ”, see ``p, #``’ !Ex‘"s:�2>>>‰ £= [2.75, 1 b25, 0.    A3.5]( 8 \ (13Â1.3720238095 g  Ifô È have alread-Ö Ro( ,3  caŸ ss�!as|  ò äfsecondë ``íä`` to avoid re? Æ'itú @m = x Â Ù ?, mÜ Tàõdoes not check that ”  11ctu, Æ  | z ``Gp``. Givª ¢arbitrary Ý²K 0maydè ¡invalid or pimpossiEsresultsüÔDecimals and ÷ s are supported_d4  U 3rt C Q as Dm 	0ð[D("27.5"), D("3@ 4# 4o2")]c^ Â('31.01875')@ f � fÅs‘ Ç  ’ F’  ‘F(1, 6), 	 2	 D5, 3s @ ƒ(67, 108q 1"""M i"er! ® ¥è ì  r = list# 5 n 'en †if n < 2: ôraise StatisticsError('T™ requiresë«rpoints'3±T, ss = _ssp � Áó
_convert(ss / (n - 1), T)Ð%A /muÏ�	Ó½¯×� sequenceEâ1oneUá/mußt&to×Ñ¿ õ­.à  To estimat329 %~$``W &``[iðusually a better òchoice.

    Examples: ô>>> data = [0.0, 0.25 1 Á1.5, 1.75, 2 Q3.25]M  >  pvariance(H )  9 ` ñIf you have already calculated the mean of  C ,2 ácan pass it asV  - ôoptional second argument to avoid re` ging ité Amu =o « Ã L, muÇ ðDecimals and Frac† ÷ s are supportedi bfrom d4 0 im   C Q as DÏ 
z ð[D("27.5"), D("3ˆ 4# 4”2")]¬ _ ¢('24.815')€ e Ž fµ � Æ  ‘ F‘ ÄF(1, 4), F(5	 D1, 2r A s(13, 72q 1"""M rif iterj1 isf:  ‡ ér = list#  n 'en †if n < 1: õraise StatisticsError('‡ñ requires at least one r point'1±T, ss = _ssp ÷óreturn _convert(ss / n, T)


def stdev5 ¢xbar=None)£ B"""R@  ¯0squ$Drootãs€ 6—dSee `` e`` forÝwÓother details7  ßŽ [§2¬  ± «c, 4.75'ò1.0810874155219827(·ñ# Fixme: Despite–�exact sumÄ Ó qd deviañ, some inaccuracyÌñ # remain becausJ !re3�two round¢ð steps.  The fir¯ G Cs inH  I� ) 1 .1(),§ o? Ñ math.sqrt().L Uvar ={Â2tryÅ ¢3varC B ñexcept Attribute~5 y 4var6p© ú l50pop25ion¾ 9þ:’ ;ÿ0.986893273527251:§/;9 Ç:MW# ===ïú2rel{� between S`inputs0 à

# See https:ð//en.wikipedia.org/ à/Covariance
#  ohttps:/ ñPearson_correlati ŸefficientD õSimple_linear_regression


def c’ °(x, y, /):
š 7"""®  ÐReturn the saV > ÷ of two inputs *x* and *y*. H  Z Áis a measure7 ‘he joint ability P !.
� õ>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]( y( 1 	 ( )A A0.75	  r zJ 9` 7l 5x 3„ 1J zJ 6-7.J l Gz, x" m 1""" ƒn = len(! !if ry) != nž Höraise StatisticsError('e ô requires that both 1havÅ€e numbero`data p‰"s'› �if n < 2t "�at least\ ñxbar = fsum(x) / nü y y  sxÐ- `(xi - ? `) * (y  6 ñ) for xi, yi in zipÓ)Ì r½ I ¤/ (n - 1)
_2 	„7's †6 co†¸ 2 © -%. 2 K h ñ *r* takes values between -1ld+1. ItZ õeP �strength% PdirecI ò Ê `àship, where +1M tns veryK ïong, positive > !-12 A str. Gnega. J 
p  +O0 noP ü%²	ùp11.0£  üŒL-# $ ³5ˆ ´Yu  µ| sxï÷Q* 2.0Gxìº&sy&*/ yÇ7tryÚ Psqrt(} C* sy. ð except ZeroDiviDrC À  raise StatüHisticsError('at least one of the inputs is constant')


LinearRegression = namedtuple(' ð
', ('slope', 'intercept')L Qdef lP %_rQ ð(x, y, /):
    """S? U and @ ³ for simpleB  B !.
: aReturnÌ � B /ofA ? óparameters estimated using ordinary5¨squares. S‘ E • ñ( describes relationship between an independent variableF 1*x*½ .a ! Ð *y* in terms¼QP funce : KBy = 
W* x +Nr+ noise+ qwhere ** x *xQ* areSÚ *@that# · 7,¾ c ± representsG è Pility½  yQdata I 1wasI ñnot explained by: è ˆ 0(it¯€equal to& ? ¥differencen`predicÒ W0act3 QvalueD‡ ŒD ¨ 3le)]GThe ø  rp�ed as a   t3 ñ>>> x = [1, 2, 3, 4, 5]_    ð= NormalDist().saäÕs(5, seed=42)1  Ðã[3 * x[i] + 2 È   !i†range(5)i :sñ)  #doctest: +ELLIPSISm Õ(ö=3.09078914170...,Rò=1.75684970486...)\1"""R  7Rlen(xÎ 0if  ry) != nù ²¸raise Stati¯Á ò€ requireTtat bothÀðhave same numberfbupoints'� _n < 2{ )ENtwo c ñxbar = fsum(x) / n
y y  sxÞ- `(xi - ? `) * (y  6 )Qxi, yé1zip<)Ó  sxmB S* 2.0;   ƒ6tryý à .Pxy / J @  # d0valŸqto:  co2ncex " /· …  exîÑ ZeroDivisionsk ãxÊy †0 = & -Ï1barO… ²Ø §S  �###| }@ribuA/ # !0


Þ!_nÍó_dist_inv_cdf(p, mu, sigmaæ1# Tvòis no closed-form sol‡ ÑÁ inverse CDFÅ «e   # k ¼ ð, so we use a rational appróNoximation instead:
    # Wichura, M.J. (1988). "Algorithm AS241: The Percentage Points of theK ð Normal Distribun ó!".  Applied Statistics. Blackwell Publishing. 37J ô(3): 477â€“484. doi:10.2307/2347330. JSTOR  : ±q = p - 0.5 òif fabs(q) <= 0.425ø  ü  r  á180625 - q * q6   õ# Hash sum: 55.88319_28806_14901_4439. rnum = ( õ2.50908_09287_30122_6727e+3 * r +7  i  ÿ3.34305_75583_58812_8105e+4)8 	ÿ	6.72657_70927_00870_08538 ÿ	4.59219_53931_54987_14578 ÿ1.37316_93765_50946_112¨ ð1.97159_09503_0655Eà 
ÿ1.33141_66789_17843_7745e+28 
ð3.38713_28727_96366_6080e+08 ë6den½ÿ	5.22649_52788_52854_5610½ÿ	2.87290_85735_72194_2674MÐ3.93078_958002A71_0o õð2.12137_94301_58659 ½ð5.39419_60214_24751_107œ �`6.8718_ï749_20579_0830…ÿ4.23133_30701_60091_1252e+1p 
E1.0)'@x = bU/ den òreturn mu + (x * sigma6  Ûbp if qøá0 else 1.0 - pC  # Âsqrt(-log(r)9 @if r3 :5.0)qr - 1.6;  ³ ö
49.33206_50330_16102_8903/  ¿ !ÿ7.74545_01427_83414_07640e-4ê	ÿ2.27238_44989_26918_45833e-ð2.41780_72517_745Æo1770e-‡ó27045_82524_52368_38258E0ÿ
3.64784_83247_63204_605049  5.76949_72¡¤60691_4055·r ð4.63033_78461_56aO29599 P1.423T€1107_496~1773« ð	%ÿ1.05075_00716_44416_84324e-9Á	ð	5.47593_80849_95344_9460ùÿ51986_66563_61645_71966ú
À   1.48103_9ÿ7642_74800_74590e-1) * r +
  ÿ	6.89767_33498_51000_04559 ÿ1.67638_48301_83803_84940e+0r 
ÿ
2.05319_16266_37758_821879 A1.0)Å Qelse:
  Ò µr = r - 5.0 õ# Hash sum: 47.52583_31754_92896_71629/ rnum = ( ÿ2.01033_43992_92288_13265e-7J	ÿ2.71155_55687_43487_57815e-5
@1.24ÿ09473_88078_43860e-39 
ÿ2.65321_89526_57612_30930e-29 ð96560_57182_85048_9129 .ÿ	1.78482_65399_17291_3358õP5.463Ø ÿ 9111_64114_36999 ñ	6.65790_46435_01103_77729 Á9denÁa4426_3Çÿ 89939_78564e-15Â	 1.42151_17/ï16445_88870e-7P
`1.8463ÿ 175_10054_68180û 7.86869_13ï56132_59100e-4r °48753_61290Â�61_48525ûp1.36929g�92_27358_�ð°5.99832_206å�8879_376b·@x = jQ/ den»¦if q < 0.0Ï & !-x ñ4return mu + (x * sigma)


# If available, use C implementation
try:H pfrom _s Pstics) òort _normal_dist_inv_cdf
except ImportErrorœ ápass


class N9 BDist "  J @ribu€ ð of a random vari« "‘ ð# https://en.wikipedia.org/ /N ˜ N 8 Vf ñ nce#Properties
9 Ñ__slots__ = {  :ò'_mu': 'Arithmetic mean¹ 	Ò '',; Œ > ÑStandard devizA }• òdef __init__(self, mu=0.0,é=:` ® d u` wherebis the· 2and9   sš .€ O #if- €  uraise S1!('ó ò must be non-negative'™ <  É ü ._mu = float(mu H    )@_amethodl $ ¿0_saÝÆs(cls, data)À"Make a normóal distribution instance from sample data."
  ”if not is- (! õ, (list, tuple)):0  7  " 0 = " . ) Ëxbar = fmean °return cls(& q, stdev%  ,  1))
H 3def¬ ÷s(self, n, *, seed=NoneŽ Ô"Generate *n*6 Ð for a given Š P and  dard devia ò gauss = random. !ift @ is w T else" R) (” )/ ¼  Àmu, sigma = À !._ Qelf._ * [o (&  8 )Á @i inn fge(n)]3pdfx	ðProbability dens Afuncé ö  P(x <= X < x+dx) / dxAvari*³ © u ** 2.0° ,- 
ðraise StatisticsError('¯ )cÃdefined when!†is zero'A…exp((x -Aô )**2.0 / (-2.0*ƒ )É †sqrt(tau .c.ªCumulative2	2X2&x)& Õ" „ û0.5 * (1.0 + erf ‰ 1 * X2.0))J@inv_�  , 8, p3¿""Inverse ccx : P(B = pd ññFinds the value of L «Ñble such that p°%ofcF 0ria2 �being les^ âan or equal toI p   # eôM d .¯ TThis é Ý²also called› Æercent point* µor quantileb G . )""0pD00.0¼ �p >= 1.05�p must be `range K P< p <I 8¬bu i  ž at¹ _belowª€_normal_y_mp® Ž ÔúâKä*=4œPDividþ !toÝó
continuous intervals withíRv1s a® ›£(n - 1) cuâ�s separatm j_ 51Set† Ato 4Ÿ@quar0s (4 ·default).  + !10, vdeciles%	# $ pu ( a whichÌÖ 99® s‘  %atpÀseparate theó% normal distribution in to 100 equal sized groups.
  5""" ðreturn [self.inv_cdf(i / n) for iT Ñrange(1, n)]
; Àdef overlap(; ‘, other):  h ä"""Compute the- ÿping coefficient (OVL) between twoØ "s.v  X �MeasuresV `agreemH B  ¹probability&
Rþ •s a valueˆ ð 0.0 and 1.0 givµ Å uarea inð     ¿ punderly3 	� 0ens‰ @func«Ó  × ¡>>> N1 = N×åDist(2.4, 1.6)e * 2* �3.2, 2.0*  $1.¨*N2 õ0.8035050657330205h "Ÿ# See: "TÆaCmšM of ˜Z )# ½srÀpoint estima( N  [Å  'woO `ñies" -- Henry F. InmanY ÷Edwin L. Bradley JrF õhttp://dx.doi.org/10.1080/036109289088301276 ñif not isinstance(,Ã »ñraise TypeError('Expected an< ;  V '¶wX, Y = q� õ(Y._sigma, Y._mu) < (X X �:  # sort) asKå commutativityR  ± q EY, X €X_var, Y � = X.variÿ  w  . %5 1 or2; * i S… Sstics ö!()8 Ñdefined when ê ‡ is zero$Cdv =� !- w Œ �dm = fabs*Rmu - ! ­ +dv� &ð- erf(dm / (2.0 *C ‹ P* sqrµ60))³a#U_mu *– ž ;  C} b* M Í X @dm**r ±+ dv * log(H" /æ t xHÅ(a + b) / dvd x8M(a -  ñ3- (% 1x1)) 4) +C 2 2ù l  czscorex
 Standard S0 À.  (x - mean½ VstdevþÐDescribes *x*›Qterms�he number  ‘U AdeviIs™  lPaboveŒQbelowH n  7  jQ›; # 6•s://www.s¼§howto.com/ëV-and-$ 1/z-/– | Ü³…ð aise Statisticsó#Error('zscore() not defined when sigma is zero')
  óreturn (x - self._mu) / 6 
- ‘@property �def mean(4 !):  R ±"Arithmetic  õ of the normal distribution."6 …  L  € q /dis  RÃ  g  me" u t =odeå (""t ?oder Í  PThe m- !ispvalue x �re which óprobability densit D @func=ñ
 (pdf) takes its maximum U .Z/""ò ]stdevó áStandard deviaƒ ÛO
~variancnUSquarcs‰ In r ** 2.0† ¶è__add__(x1, x2»°""Add a cone át or another NÀaDist i 2ce.T  –AIf *( *bB ñ, translate mu byà` ,¦sleaving¥Ÿunchangedb � ’, add bot= •Qs andk TsòMathematically, this works only i±9two®Us are± ¡independen&4 y# ƒ jointlyò&lyF  Ñ  .  ˜Tif isVG(x2,n  7 )þ 0(x12P + x2	 q, hypot  ,  )öH  , U 3 ä8?sub8�Subtract=F:? mu=5s» ?"an= T  AÖ-(/muA- H A?mulA‚MultiplyÈ!muÁ‚ 5QàUsed for rescaóling, perhaps to change measurement units.
  ñSigma is scaled with the absolute value of †constantA 5"""M ðreturn NormalDist(x1._mu * x2,  sp Á* fabs(x2))
> ñ	def __truediv__(x1, x2):  « ò"""Divide both mu and N Vby a š 4 °Used for reÞ …//1posRq þ $py¤i£?ce.™”	‰=negl pNegates{Ówhile keeping… 4?samv -.muw Ñ__radd__ = __
 Arsub� §Subtract auW from· or another& `-(x1 -w| c__rmul” 
  ¬/eq’ 7Twoe ñ objects are equal iI irHÃ   Ù% œ ”if not isÖ(Jb '‚QtImplò%ed …a == x2Ÿ ˆ   O  ò ·hash__(selfv "Œ î  * ï #¢  A (j     , t !._’ 
2Nrepr” F qf'{typeH ò).__name__}(mu={R bmu!r},Â f ð!r})'
"""A collectiona0strônðs.

Public modul/öriables:

whitespace -- a = @tainH ¦all ASCII , ÿ 
ascii_lowercas< + slettersC ?uppC + 
C  À ) 
digits0 ‚decimal 0 B
hex
 : Khexa> ?oct> 6octv qpunctuaÝ¢- 0chax kPprintòº 6 ¯uidered A 
qb

__alw#["Ö4",  à", "ascii_uppeörcase", "capwords",
  p"digits! 6hex 6oct �printablH »punctuationK ‘whitespac( �Formatter\ òTemplate"]

import _string

# Some  ñs for ctype-style character classific} 
o ñ = ' \t\n\r\v\f'
ascii_loweÿ    ôabcdefghijklmnopqrstuvwxyz/ 6upp/ ôABCDEFGHIJKLMNOPQRSTUVWXYZ/  leÝ Ls = n + Q 
K ‡ Å0123456789'
q3 = " 2+ '© R' + '… %'
�B ''
Šõ = r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
Ív Ã Ó (+ [ &+ j ®F@ions ð ch aren't avail%3 asÍ� methods.7 ñ Capitalize the ŒS in a- ô, e.g. " aBc  dEf " -> "Abc Def".
def Æá(s, sep=None):Ò%""ä (s [,sep])C Z
% QSplit� Óargument into� pusing s$ ,k ± Aeach?  ¶  & cÐ ¡, and joinY  dW @  % Q.  If*  opF¥al second “  sep is abs¡ 0or ç ¸pruns of|m"sŒÀ replaced by]aingle —ƒ  ¬ @leadê   Ptrail æG ñmoved, otherwise? › rused to,
  $ ó e q  €return (> €or ' ').6(x./!()ýx!s.† 1 o))


# 0z re£ð _re
from collecŠ#s œ�ChainMap(  0

_�ñinel_dict = {}

– á‹A×¶Ù 0supú l¡$-substitux .(_`delimiîQ= '$' ð# r'[a-z]' matchesz¤non-ASCII ŠQwhen ™ówith IGNORECASE, butK   "ou? Áflag.  We caÉbdd re. 0to   Ãs because ofI ðbackward compatibility.  So weˆ ä�?a localG )Ë ! p#n.N ñSee https://bugs.python.org/issue31672- #id<  õp'(?a:[_ b0-9]*)8Xbrace.  FC Ó f= _re.'" f¡__init_subÞc__(clsg ÏŽsuper().( )`  $ Cif '© 'ÒQcls._9"__& &   & 0 = $  H Jelse0 $ ¾ `escapeŸ .  ;Ð)
           ÷ id = cls.idpattern
  b  Ubrace% ? or6 J ‰ = fr"""R ©{delim}(?: ã  (?P<escaped>% ¡)  |   # E ñ sequence of two K _itersL  0namJ Cid})Ñ L 5 û	 and a Python identifierL  {{š ÿ @d>{bP #}}˜ L & L  J „invalid>– � ö# Other ill-formedÞ K expã )¥ d Ì€Ã_re.compile( ,¹€flags | ! ‘VERBOSE)
U ödef __init__(self, template)´  . % =# D ö# Search for $$, $_F, ${ "},‡²ny bare $'sC ‡ ,‡ 'mo� ãi = mo.start(') '‰lines = © ¡[:i].split æ(keepends=True< qif not $ ó  ©‘colno = 1+     )  Oelse; ði - len(''.join(= vs[:-1])‚ 	V  . &   òraise ValueError('IW  placeholdM‘n string:Ì é %d, col %d' %Â  p  “ !no, 7no)¤substitute“�apping=_s>ønel_dict, /, **kws±2f m. J is 1 
*' F= kwÚ@elif , ä_ChainMap(kws,l 3ñ# Helper function�V.sub(%  v‰convert(o ù# Check the most common path first.U‚§qgroup('  ')>3mo. 5» l  ƒ Á , Œ;NonP & Qreturå(5[c ]Ò  '  if+o d/')[ Eelf.ç	ß 	V �V Ž_-  b	R ÖÑUnrecognized Û  Ç ! iw °)',D  ð 	 s ü: ß  ý,8Oafe_ªÀ Helper funcótion for .sub()
  õdef convert(mo):    ñnamed = mo.group(' W') or vbraced'U  < 1if - Ê is not None^  & >try   ñreturn str(mapping[O ]f  + ÿ except KeyErrorP 
Ê 
G 'ifÏ PescapÐ » ¢ Ùelf.delimiter?	V Ÿinvalid')V ¨ ±raise Valueì ã('Unrecognizedq«Ù in pattern',–  3	 sÂ , ß  ;-!, 7 ó
template)

# Initialize T .; ñ  __init_subclass__(àautomatically  ‘ed
# only°0 1es,H Ä&thb  N 1 it� 
y o  O


# 40
# … AForme† ñ 
# see PEP 3101À ódetails and purpose of this5 ñ
# The hard parts are reused fromk ÀC implementaÍ . 6 py're exV ðd as "_"
# prefixed methodsq @str.¥ k poveralln 0ser‘\  ed:”_string.fà ƒ_parser.¬ BfieloD 6 _Ç‚_split

¼F» “y (Ô,G3mat” ð, /, *args, **kw
 ·r8 ÔvF  @  2 #, : 
 s . t 	4 §  D £_ g = setX‘result, _ Dlf._` Ž %, Q 6, 2Œ “ •.check_un# (
  , „ Ô  ›   Œ ê ‹  X _K 	‘ ÿ recursion_depthV  Ì ‡_index=0˜;if @ F < 0J¯ Þ0Max6ing>  ð ed¡¼: nU = []  )l”–al_text, €õ Cpec, Û  ý\C  [    (.(¾"):U $   �# output±|  | 	R 3if  ˜ 
 G °ˆ.append(, )p iJrere's aà ,„ àit
           û if field_name is not None:
  `# this$ ÿsome markup, find the object and do>  % ¿formatting
#  ÷handle arg indexing when emptyª Ís are given.H 
Ô ^== ''Î  Ý Áif auto_arg_p  Ý OFalsþ   0   ðraise ValueError('can5òswitch from manual° - '¡  H  ñ'specification to  _maticM  ¿numbering')ƒ ùj= str(5 
$ ] += 1] )elƒ¯.isdigit()‡'  2~¸p# disabïuéô`cremen,›}it getsa ð# used later on,_¡n an excep@�will be 6dF Ï!= ÿœm e Š1þÎit reference¸ !#  .@arguë P it c| 9£ @obj,_ì ±= self.get_¼( Š €args, kw » @  è`s.add(ñ  )é àdo any conversˆ ‹€he resulœë®  ¤ > ¨ Ç   Q w 0exp; % ^needeÀ' _' É+"_v% (¬  C A @,/  2Da, recu�_depth-12 
• = “ gP@appefo ˆ£  ., (ÿ N -…  4)� ò return ''.join(K !), ó 
/0def— _vi Q, key©ƒÅáif isinstance(* ;int‚  ¾U[key]ß e�+ ë- ™ …check_un­¡  Ð, args, kwargSs):
  apass

 ôdef format_field(self, value, Gspec? creturn (+  \ oconver]  Gsion\ –# do any  ñ	 on the resulting objectÀ  Ò (if. vis Noneî  # r³ ¬ 8 *el: o== 's'9 2stré )> 
r> ?rep? a? \ascii praise V¨èError("Unknown ¹Òifier {0!s}".ë(]#))­"# $ðs an iterable thatQ ñ tains tuples of� L -A# (l3 �l_text, KJ_namD,K 1verôI(# 9 ó can be zero length& Q $  äà, in which cas® ƒere's no7 *3 to®¢ and outpu?G# if®   i= tA@, it ”looked up4ted_ CwithZ _l_ ] sthen us5  pSparsei E—at_string�  ¸Ater_= *r(8 Äwgiven aÓ  �!nd±7 × ´references.Ë b1:  /  0 ber€e.g. "0.Þ">  d @or "3 Uup[3]%  P_argsb ` a setLÁ  ˆ have be10#   @, kw P: as À edýBto vŠ  ^*genÇ Œ B J m`first,a?t =t C v_split( )G ü `obj = @.„ l([ 	y 3 á# loop throughv1res òg q, doingå  l Ð#  getattr or @itemCneedk ( pfor is_) 0, i2 ` ¶     $if# 
   Ô k v(obj, i " ;elsl  8 fobj[i]ï ÕG À
# This filelò generated by mkòprep.py. DO NOT EDIT.
"""Library¥ðexposes various tÀbs foun*Ahe SfòPrep RFC 3454.

There are two kindãA :¦sûj a member tªÐis provided,
]|mapping3  � functioní 8 Ì ð

from unicodedata import ucd_3_2_0ß  `

asse! 4 @.uni< _eÀn == '3.2.0'ð

def in_table_a1(code):
    if uni Òdata.category# ñ != 'Cn': return False8 rc = ord(  ñif 0xFDD0 <= c < /F0<  M @(c &% ôFFF) not in (0xFFFE, ñ


b1_set = set([173, 847, 6150 5 6 `7, 820# 1204 5 ú88, 65279] + list(range(65024,65040)))(b(´ ó  ­ š  £ ð3_exceptions = {
0xb5:'\u03bc'Î adf:'ss `130:'i "07 !49, °2bcn',
0x17.  Qf0:'j- I $34Y 9! `37a:' ! !b9= 1390N 03b9 !08 1- b !c5 	 "c28 "c3, d, "b2X "d1  #b8  0 5 3  #cd 4 b@ ¹ #c6  6  0  ê  – #ba p "c1@ fp   fP b€ 1587P  56Ü 1582F p1e96:'hX 3H p1e97:'t 0Ê q1e98:'w | z1e99:'y ¡a:'a\u02be� @1e9bq 21e6]31f52^1¨ 41f5¹  ™ 1313W õ 41f5& ª $f5# 4Ù !f8n @1f00Q  þa 0x1f87J1f01 … D1f02  i!f8µ11f0– E – D1f04. \ s11f0� . § D1f06. \ ‘D1f07 E 87¸ ¸ a. ¸ |¸ c. ¸ d ¸ e ¸ f 
¸ X:1f2p9p2p9p2¸ 9p2p9p2¸ 9p2¸  ÓZ\u1f2¸  Ø ¸ p¸ p¸ p¸ p¸ p¸ p¸ p¸ p2¸ aà6pap6pap6pap6pap6papC3àaà6paà6¸ p¸ p¸ p¸ p¸ p¸ p¸ À, 0x1fae:'\uô1f66\u03b9',
0x1faf:'\u1f67   "b2 *70 3 J03b1 4 $ac \ "b6 . B42',\ 7 4  c  §  e ¸ c¡ 4? c¡ 
Ï c¡ e. ¡ .  ¡ ¸ c¡  
4 ¡  ¡ d�  Y . !08 0ò d– 9  1‚d…   … ò d…  Q  en 'c5Q n en 	 n e
cÂ#13¢ e… 4 h …  … f… :1f7öf ¹ !fy 
ƒfy . y fy   ç  K  fƒc   ± 0x20a8:'rsÑ t2102:'c  ’ Axb0cr2210] 425b! „9:'\xb0f Db:'h c q
0x210d  n c110:'i$ '11 C2:'li T15:'n$ T6:'no D9:'p Da:'q1 Db:'r c d c20:'sm1 s21:'tel3 d22:'tm D4:'z 8 Å D2c:'ù &2d&S30:'e0 S31:'fc D33:'T 3‡81213?203c}q2145:'d: ‘3371:'hpaT „3373:'au S5:'ov @80:'' ¤
0x3381:'n4 8cE03bc  Ž  S4:'kan R85:'kÙ u3386:'m E7:'g Ba:'pÜ r338b:'nö3338W$bc R90:'hDp3391:'k § P92:'m  µ V93:'g E4:'t aì¥ Paa:'kì 7 Vab:'m Ec:'g cb4:'pvÜ bI/Wc E7:'m E8:'k9 9  û wubû  û wr Ed:'m Ee:'k f Pc0:'k�c™t33c1:'m æ  ”#bqw Ôc6:'c\u2215kg c7:'co.z Tc8:'d®dc9:'gy(  —7„33cd:'kk4  ¡ ¥ 33:p¿033d~p  r5 Tdc:'s6Rdd:'wv rfb00:'f0fb0i4  fbWfo@fb03' @fb04  T5:'st6 6 ` 0xfb1Ž@u057º1576Ý 2fb1  $65 5ù bR 17 57NE Ú. dE À1d400:'a', 0Ñx1d401:'b',
0 r2:'c',  E3:'d E4:'e E5:'f4 E6:'g E7:'h E8:'i E9:'j4 Ea:'k Eb:'l Ec:'m Ed:'n4 Ee:'o Df:'p U10:'q D1:'r4 U12:'s E3:'t E4:'u E5:'v4 E6:'w E7:'x E8:'y D9:'z4 T34:'a !35RE'36R!37Rl'38R!39R4 aR!3bR4 cR!3dR4 eR!3fR4 '40R!41R4 '42R!43R4 4R!45R4 6R!47R4 8R!49R4 aR!4bR4 cR!4dR4 '68R!69R4 '6aR!6bR4 cR!6dR4 eR!6fR4 '70R!71R4 '72R!73R4 4R!75R4 6R!77R4 8R!79R4 aR!7bR4 cR!7dR4 eR!7fR4 '80R!81R4 '9cR'9eE'9fE!a2+4 !a5[ 'a6!a9÷  a÷ 4 b÷ 'ac÷ 'aeê !afê 4 'b0ê !b1ê [ 'b2ê !b3ê 4 4ê !b5ê 4 'd0ê dàdàdàdàdàdàdàdàdàdàdàdàdàdàdàeàeàeàeàeàeàeàeàeàeà'50à'50à"50Óy"50Ó '50Ó'50Ó'50¹"50¹4 ¹N  ×'51¹5×o|"51¹4 ¹'51¬'51¬'51¬'51¬'51¬'51¬'51¬5½ñ5½bþ5°dœ 3’5°f' ’5£i4  £j'  £)5£)"54…84x'54Q5oõð54c:'u',
0x1d54d:õ 'v', 0x1d54e:'w Df:'x �50:'y',
' T6c:'a U6d:'b Ee:'c Df:'d4 T70:'e U71:'f E2:'g E3:'h4 E4:'i E5:'j E6:'k E7:'l4 E8:'m E9:'n Ea:'o Eb:'p4 Ec:'q Ed:'r Ee:'s Df:'t4 T80:'u 681:E'82E!83E8!84ElT85:'zA 'a0R!a1R4 'a2R!a3RA 'a4R!a5R4 6R!a7R4 8R!a9R4 aR!abR4 cR!adR4 eR!afR4 'b0R!b1R4 'b2R!b3R4 4R!b5R4 6R!b7R4 8R!b9R4 'd4R!d5R4 'd6R!d7R4 8R!d9R4 aR!dbR4 cR!ddR4 eR!dfR4 'e0R!e1R4 'e2R!e3R4 4R!e5R4 6R!e7R4 8R!e9R4 aR!ebR4 cR!edR4 6608R1609R4 660aR160bR4 cR160dR4 eR160fR4 &10R1611R4 &12R1613R4 4R1615R4 6R1617R4 8R1619R4 aR161bR4 cR161dR4 ;'61;"62;A !21R4 3H'63H'63H163fR4 4H'64H'64H'64H'64H'64H'64H'64H'64H'64H'64H'64H'64H'64H6YH'64H6YH'65H'65H'65H'65H'65H6fš6fb°'67H'67H'67H'67H'67H'67H'67H'67H'67H'67H'67H'67H'67H'67H6fš6frÐ  fR ftL6fR fv4 HÀd687:'x', 0xÐ1d688:'y', 0x q9:'z',
 ¤a8:'\u03b1 #a9 2 a 3 b 4H c 5$ d 6 e 7 f 8H #b0 9$ #b1 a 2 b 3 cH 4 d$ 5 e 6 f 7 %c0H  c b 86  c b c b c b c b c b c c c dü ~ e ´ e$ $b2Ø e ´ e 4Ø e ´ e %b6H  b´ e e b´ e %baH  bÔe %bc�  bÔe $beH f bÔf@ Ôf Ôf hf Vf  ÔH  Ôf  Ô`f Ôf  ÔH  Ô#70ü  ~ H $71 Ô#71$  ÔH $71 Ô$71 ˆ$72 Ô#72  ÔH 2 Ô,72 #72 Ô#72  ÔH  Ô#72  ÔØ 2 bÔ#72  ÔH  Ô#72@ ÔH  Ô$72 ¨#72  VZ   ÔH 3 Ô#73  Ô6 3 Ô#73  ÔH  Ô4ü ~ 5 Ô5$  ÔH 5 Ô5 ¨$75 Ô5  ÔH  Ô5 5 Ô5  ÔH 6 Ô6  Ô 6 Ô6  ÔH  Ô6@ ÔH  Ô6 ¨#76 V6  ÔH  Ô6  Ô�  Ô6  ÔH  Ô8ü  ~ H 9 Ô9$  ÔH 9 Ô9 ¨9 Ô9  ÔH  Ô9 À8',
0x1d798:ò'\u03b9', 0x1d799: a a b b Bc',
6 c d$ d e e f f $c0H #a0 1$ "a1 %b8 2 %c3 3 4H 4 5$ 5 6 6 7 7 8H 8  bü ~ ò)}

def map_table_b3(code):
    r = b3_exceptions.get(ord% )% ñif r is not None: return r   V �.lower()
v 32(as Jal =� ag pb = uniH ó
data.normalize("NFKC", al*  C š"".join([Ü ò h) for ch in b]1 c[ b[ ’if b != c $í cí Melse #alñ #inf2c11B, #~ == " "1 21  ‚category' G €Zs" and 3 µ X  ïˆ ?_c1[ #£ 2Ô ,a < 128� · ñ Cc"

c22_specials = set([1757, 1807, 6158, 8204 5 !32 ü3, 65279] + list(range(8288,8292)) |98,8304 ¼65529,65533 p119155, Q63)))FW2S _'Bif c-TFalse "8 2Tru7 E Ù>lœ :1_c  : u Q or \¤  ù5   Ö u 
W3q o4ß7Xe0xFDD0#	[ x   F  Cá  & 0xFFFF)á ( Eh 5ž Vså cc6_setè¯}4_6h  
‹P ]


c7Y ®12272,1228Y 7Y P  Y 8Y ![8{ 33€!06 7|34,8239K%82G8� Àde) in c8_seðt


c9_set = set([917505] + list(range( ò#36,917632)))
def in_table_c9(code):
    return ord B in c *

8 "d1" 	8 0uniM òdata.bidirectional,  N ­("R","AL")R 2& R ñ== "L"
__all__ = [È Q# Fun| s ô'calcsize', 'pack P_into $un 
 r_from',> Riter_ 1',
 ƒ# Classe` fStruct PExcepü   aerror': 0]

\ 1 _s4 Ÿ import * ¿_clearcache  õ_doc__
# subprocess - S  es with ac ðible I/O streams
#
# For more informa· ñ about this module, see PEP 324.9 òCopyright (c) 2003-2005 by Peter Astrand <a	 ñ@lysator.liu.se>F ÿ%Licensed to PSF under a Contributor Agreement.

r"""à &
TÂ ° allows youl cspawn 4°es, connect ð their
input/out Â@ pip+  Õ qobtain + 9 þ@s.

Sña complete descri8 ofVUð the Python docuè …@.

Mc SAPI
= ñ
run(...): Runs f ñmand, waits for iÅ  ,¤ n£ 1s a† î3  C¢ #dP;äinstance.
Popej 0A cí\ öflexibly executing„  áTa newWA

CoR Dts
- ò
DEVNULL: Special value that indicates ðos.devnull should be used
PIPE:Æ E 
a²< ÿcreated
STDOUT: „ dstderrD  go!Pstdou� Ol®¢o=
call¤*¢ � W‡.
check_] �Same as  ô) but raises CalleÕE|!()U #if T “ is not 0\ ë» ^ w d % ¡e4�tents of`  G0eadíaq I
gete 
Ä @ ÷ _shellÑk 6theÕ 6 Y  c bstatus Î i 5pa (exit>", b Ó) tuple
"""

Î„builtins Terrno i
 o! Dtime  esignal y% Ðhreading
impoórt warnings
import contextlib
from time  àmonotonic as _ 6 ô types

try:
   1 áfcntl
except Ia RError%  ð = None


__all__ = ["Popen", "PIPE `STDOUT
 Acall Theck_ ñgetstatusoutput",‡  ‹ t   "get 1 "c9  !ruj ÑCalledProcess¦  f {DEVNULLP KSubp) àTimeoutExpired; uCompletT ("]” ð# NOTE: We intentionally exclude list2cmdlinepZit isB Ñconsidered anG @rnal}plementaU þ detail.  issue10838.«amsvcrt` îq_winapi ô_mswindows = TrueÕáModuleNotFound7Ý	2 QFalseI \ eposixsG YselecŠ  ‚ors
else` �£  ò  ¼÷(CREATE_NEW_CONSOLE,  ÙPROCESS_GROUP") àSTD_INPUT_HANDE   7OUT ² 0 
  , VERROR> oW_HIDEr 
²ARTF_USESTDu US, ST ŸHOWWINDOWE ÿABOVE_NORMAL_PRIORITY_CLASS, BELOW Ì MHIGHK LIDLE C � REALTIMI É#O_
£ DETACHED_Ù= ‚DEFAULT_ 6MOD!ñBREAKAWAY_FROM_JOB)
Ö ˜£.extend(["L fï|� h
;+"'e D   	g= 	Ä -= f3 Mc7 e D 
oUPINFO# … n ‡R „  J † B ƒ D …H ù‚ C „< � E Y ƒ‘"])


# ECñion classes used by this m†!.
  ž(= ð): pass


class C÷alledProcessError(Subp ñ):
    """Raised when run() is cA ó
 with check=True and the J C ñreturns a non-zero exit status.
% ¢Attributesx r  cmd, < Ácode, stdout ±err, output> 1""" údef __init__(selfB S 7 B=NonT 1err ñ  õ  : .{ ' =ˆ h % Pcmd =« 
 d ( =¤ 4 €stderr =Ñ 2err º 3str¹ Ž <if ‘  g 4< 0; k Z  try   Ö ` "CommF p'%s' dià Ë…%r." % (Ï  4  v H�signal.S 1s(- _  °)))D Áexcept Valuep› ‚unknown x ? %dª › š Jelse‰ Á   /edÁŠ 07elfU)ø‘@property”  ç¾Ã"""Alias forV$ a4£, to matchT º½ C˜z i .setter 0, v¯† ð# There's no obvious reasonƒ ñset this, but allow it anyway soe  ” 2# .~  KÀa transparen6 æ .®  1   K " =› ÿ


class TimeoutExpiredÌRThis Œ0ion~ rÞ ºtJ ! eK ñ s while waiting~aÇ TchildèÅÇ¶ »	Ãm Q ´ Ä@, ø´R ÁœH 3 = 
 ~ a´ 
 »|(o x dÅõ after %s seconds" %q  ’   
. > Oout)A‹ C Û k @‰­Ãif _mswindowCðSTARTUPINFO:
        deòf __init__(self, *, dwFlags=0, hStdInput=None 5Out /
   6 SError6 °wShowWindowU âlpAttributeLis[ )):K  Œ .ˆ $ =’ #  j   & =¬ ' · (  ) º (  ' Ñ 7 =  + í < =  õor {"handle_list": []}
K �def copy¡(Aattr5 1 = 4] .9 )L  ®Gif 'o U' in H 
‡ /  [6 ]Ê Oist(  )Â  G óreturn STARTUPINFO(à=¹  ,«  9  ò7  9 ÷:  ; 
:  9 ;  = Ë=i")
[qclass H:G(intâclosed = False/  I LC M!,  B —=_winapi. R  > bif notib /Í } = TrueÒa ‡ *   bDetach 
` € 4‹2inte 	¡ ±raise Valueä¢("already Õ "® c__repr?0i ±"%s(%d)" % q 1.__»Õ__.__name__, Ž ` ’__del__ =¨R
else`# WhenŠò$ect or poll has indicated that the file is writablez�# we can ñ"e up to _PIPE_BUF bytes without risk of blocking.4õ# POSIX defines = ’as >= 512( V P= getÉ 	dect, '5  ',1 þ #Ñ @/selà AhaveÊ �advantageŒ  ‹ñrequiring any extraï Ÿ ðdescriptor, contrarilyé e1à/kqueue (also,b "y R ’e a singl¾¢# syscall)Ñ  iflÈ 0orsË AollS³ 7or'd_Popen «‡ectors.P3 µ ä r: O  Áor


if _mswgs'2On ysïðjust need to closeýB `Popen._handle` when we no longer need
    # it, so that the kernel can free it.Q –gets closF ’mplicitlyn  J ‡ ñ` instance is finalized (see `H£ £.__del__`,• Pwhich0  calling `Cn . ó` as requested in [1])Æ !erh snothingO òfor `_cleanup` to do.   B ó. https://docs.microsoft.com/en-us/windows/desktop/ProcThread/G ñcreating-processes ñ _active = None
 Ddef “ 1():  ’’pass
else ñ# This lists holds ÞV s Þ 1 vpunderly5… � had notc P# exi7ï“time its ƒÀ method got }£ed: those N ces areL �wait()ed„ ÷synchronously fromá Sa newÁ ‚object i#!# <0ed,Ÿ·avoid zombiy ³M/[]K4if - !is{T g  areturnË    H ¬ R8 <[:]3 1s =|õ._internal_poll(_deadstate=sys.maxsize)^  b `if resØ?not‘   $ :trys     “ €.remove(ª 
^  % ÿexcept ValueErrorL V åÀhappen if tw Ïs� ° q  Ç† m  ò # It's harmlessP�it was alU "y º dªoignoreL ð
PIPE = -1
STDOUT �2
DEVNULL ’3


# XXX#€function_óonly used by multi¾ 1andêñtest suite,
# but iÃ 5erei n be impor9NBPythk ñcompiled without
# tAs.

å°optim_args_8Äpreter_flagsÿA"""R“! añð
 of command-line argumentÿ`producÐ  öbcurrenãp 1iza0set‘sÕ ˜q A."""™ • Q = [] v66 = ( K ï2if " 6> 0W C .DÒd('-' + 'O' *+ ¡h ¾ #s
 6 S,ä @warnâ @ons  ø #_x $ 2Á_opt_map = {+ ûÂ'debug': 'd'¹   # 'inspect i 2ter ð'dont_write_bytecode$ BB q'no_sit S Ðverbose': 'v'3,
  ÷'bytes_warning': 'b' Pquiet q ñ(# -O is handled in _optim_args_from_interpreter_flags()t }  ( / =6 @for F P, optp    t Ñ_map.items():[  Ø ðv = getattr(sys.. !s,B †  % †if v > 07    š Ñ.append('-' +r Q* v)
_ 5if R –.isolatedC 
? "I'o Felse$ 
C ögnore_environment) � EQ   	G ·no_user_sitj  ' 
’ #s'È @# -WÛ AionsÙ  aopts =á    1[:]" 	*' Z. , x onN ‰D, '_ R', {}ðdev_mode = ('dev'â( ° 9if f F > 1*® ðs.remove("error::BÝWÜ"m ,elK G defaultI 4if ¹ B 'B ¸ ÈÂ³ < 
ªW| I# -X° C 0ext¾q('-X', Q)ü  !('Ú Ãr( °tracemalloc §importtimeú Q  Ð'showrefcount. Wutf8'‚ if­ Èè  A @valuðæB[optf     Ÿ% kis TruÖ " Parg =g r    
l    , ñ'%s=%s' % (opt, †  %   B Carg)†preturn % ð


def call(*popen  , 2àout=None, **kw ð"""Run command withM uø�s.  Wait ¦"  to- �plete oré a s, then ’ 3the cI úbibute.¶6Theh @ are= � same asq  A PÆ ò constructor.  Example:H 1ret` =ø Â["ls", "-l"]G1"""¥ Ú P 	 w p6try  ‡risp.wait(ó = k  ' ðexcept:  # Including KeyboardIƒ rué F ¯Qthat.¦  C   cp.kill¢    ¡# We don'tí  Œ q) againÁ ð .__exit__ does Y M*us` Traise1]heck_7))Q.  Ifà  Õ ¡ ð code was zero thÿ(en return, otherwise raise
    CalledProcessError.  The  ò object will have thE a € code in t  ±attribute.
s  ^ Áarguments arH Á same as forA ò	call function.  Example:D `check_$ á(["ls", "-l"])a 1""" 1ret� != ) ð*popenargs, **kw
 1  if°  , :9  bcmd = & `.get("0 "1  ! 0if $ vis None9     %= p 5[0]X {^ (® ,V f W‚0


def ô xoutput(Í €timeout=ˆ Û “ ÷r"""Run command with  ndü ‚urn its ^ ©!IfŠBexitÜò was non-zero itG?s aÏ  Fö CcJ‡  ‡FJ J Ê ¬ +  # Ä mP¡ construct
q:>>>�wµ, "/dev/nul„bb'crw- r 1 root õ1, 3 Oct 18  2007 < 2\n'Þ µ estdoutª  i{�t allowed* it ñused internally.)ðTo capture standard eÝ. result, us" ³derr=STDOUT7ï  q/bin/shk1c",h 0...ï `"ls -l&ñ_existent_file ; H?0"]; 'st‡ ^b'ls:L ¡: No such Z por dire·yC re pan addiFSal op	 ¢, "input",[¡ing you toá 0pasà0str !toBsubp1p's stdi !If8  Q0thiØâG  R `may noÂ!soxMthe yA's "S "ûA, asF bit too€ beD 	ú$Ä 1sedÀe ¯s/foo/bar/”t=b"when;ðcourse of fooman evÉ#\n/b'. 8bar. ëqBy defa� ò §Punica¨ À‘in bytes,ô Â”efore any»›should be/ WUvalue<S Q.  If× ‚ext mode›[  W "a ‰ Z ' •  deÎƒd accordC°locale enco ”, or by " ´" if set. T˜ M Àis triggered1 @settS  ¯ ‚of text,V Àing, errors ñor universal_newlines.
    """ ñif 'stdout' in kwargs:  ' óraise ValueError(- ñ! argument not allowed, it will be overridden.')
Q  l 9inpk C andv "[' –] is None‡ ñ# Explicitly passing . =) ð was previously equivalŸ %to0 !an†  × ð# empty string. Thatv ðmaintained here for bacòds compatibilityG M #ifÁ n.get('rY') or$ ftext')à  G ’ E= ''§ 7els% b&  ž &gs>!= K tðreturn run(*popenà", óó =PIPE, timeout= Õ, check=True,Œ  ~ R   **o ").C ó


class CompletedProcess(objectå b"""A p   tnÀhas finishedŸ n‰´ @ThisŽ¼ Ped by" 2().  •Attribute© Õ  : The listn0str¤sþTed toC É \ Bcode8 Pexit  t of the­ ’, negativcsignalD GB ñstandard output (š!if"”captured)7kstderr: ec9 
·ñdef __init__(self,î &, Ø å ˆ  1err/” 	 ; .>! =A ï M ' =Z 
% # = 2err 2errÀ½ Crepr½ ‘ Œ  ['	 Ñ={!r}'.formatç ¬ )–& '« 5   %)]  1if å À !is© -
˜ ‰ t.appendþc  F /))_  _  ¥÷ /_ Ó ” "{}({})"$Atype)ð).__name__, ', '.join(Ì )Ž!__¹Ñ_getitem__ =  pmethod(K ös.GenericAlias)
À#_†  7u :A"""R<ECallD" ibstn-zero.â ž£g a    žb � .6 ,ê þ  ¯H V  '0err ¿Pö ße#, ô_f=Falsem ij \æ  C unvm%@with¤ws8â ( a}Àocess instanó*ce.

    The returned instance will have attributes args,- ñcode, stdout andL østderr. By default#  . ðerr are not captured,@ X thosn Q ‡ Ðbe None. PassE €out=PIPE8 0/or 2err ´in order toa S themî ðIf check is TrueC    ` exit Õ ð was non-zero, it raisþ ’ ñCalledProcessError.C w objectKtkj P !in ‚€ qƒoutput &æ �#if6qstreamsQ Dwereú dö @time«‚is given]  ’ pÌ ò takes too long, a T4 bExpireâ’exception× "bei  Th~ qis an o(  al7ñument "input", allowing you to¸ pÝ byh€or a str" !to 3sub¨ 'qin.  IfA `use thu !rgi P  [ 1mayjRalso ' õe Popen constructor's "stdin"« 2, aNiÀ be@  !ƒternally[ëÑall communica%ais in Ö qPreforyyb shoula+be/  ø ¹0and  AX . FQext m–1anyp_ 5 beW� ¾Z }@s de“š caccord”°locale enco ”, or by " ´" if set. T˜ " iS�triggered1 @settS Çany of text,V eas] óuniversal_newlines� À@otheXÿ © Ñe same as forFû.(!"" 1if ¢  ¡ v:  )Pif kwa.get('2/'),  0 7a Value(3 rg a°$s ©@both¨uused.')| y [u @] =  Á$ifï_,³ 	:out´  \^ × :err$ Q Ø ¢Ú  A'Ô  L  ['withÐ 	 Ë 
I Ë ) Ç   v \ 0(*p ÎB, **6 )+fó 6try  g 6Ù �#= 3 .û!e(á#, v= ÑHb € :exco ^ Vkill(A  Š Úif _mswindows6   2# W ð accumulates the outûput in a single blocking
  ð# read() call run on child th ÿs, with the timeoutE  ¢being donew `join()L TthoseL ÿ.  communicate()J  ÿ%_after_ kill() is required to collect that and add i’ !to³ ­exception.l Ãexc.stdout,  ïerr = process.« ]else:Q —# POSIX _9 0 alF�y populatÇ `he out£/soE  cfar inÀ Ts1ExpÏ ¶ KwaitZUraisej D °:  # Includ»øKeyboardInterrupt,ªa handl¼ *atJw °e  g@# We"'t^+ ¢ ò as .__exit__ doesÖjfor use 
Á wretcodeª po-} �if check". 
¯Q ‚ CalledPïcError(. ,Uargs,Z  ×  Õ=T`stderr 2errëåreturn Complet{ (m  „ 
J ò
)


def list2cmdline(seq)Û 1"""§ PTransj þòequence of arguments]aà C H : �string, u5> same rules® @MS C' !:
7 E1) A\  are delimiëð by white space,  chÔ�either aA "    ¢ or a tab.Y R2) A • ð surrounded by double quotaÝ” marks isP iÇ prd º À, regardless¦ C ‘contained ain.  Ar $ed• Àcan be embedš  rn@ k Í 3Í ¸ ` prece@ Ðby a backslas(L Ï literal	r D4) BL  Árœ3terC aly, unEtheyr ¤mmediately  / ao 
V5) If¾ Oes iD b every pair— N ¹¿ Sas a Ä µ /  . Œ  °_numbeL Aodd,ä5las@A a escap“oe nextû % ar�described 3" 3Ä ˜¡ B# Se†ð# http://msdn.microsoftqó/en-us/library/17w5ykft.aspxF ›or searchF Àcrosoft.com ñfor
    # "Parsing C++ Command-Line Arguments"+ ±result = [] ñneedquote = False ñfor arg in map(os.fsdecode, seq):&  { bbs_bufP  ð# Add a space to separate thisZ “ õ from the others@ Aif r¨ h  l  Õ.append(' ')
3 È @(" "» Éarg) or ("\t 0not… = 5if @ s 
"s  %ch 
6 Êif c == '\\'  Ç ñ# Don't know if we~  (µdouble yet.�  3   jþ )c)! %elt "s Z ¾backslashesb `¢\\' * len({ :)*2u –     P  ?! Oelse ¢Normal chaà4 2if � 9  ' t 0ext$* ¶  *  º chÛ`remainpQ,Í6anyY¬ ¤ ÐŽÝ [ # qX ò return ''.join(' ð)


# Various tools Õ`executÞ cJ s and look  at´‘ir output òstatus.
#

def get # C(cmd4B"""RŒ R(exitS& W) of | !md]r shell.ëE›  HPe str� W'cmd'* Ò with 'check_Z '¤ ²a 2-tuple (¨ ,Í ð). The locale encodd qis usedC 2to  7  ` ð  process newlina0 pA trailG  1 is½ GppedN= „   ž – (�ó can be interpret› Qaccor± !tož BruleÔ > ò
function 'wait'. Example:\ã>>> import subÎ Ã    .ÞÂ'ls /bin/ls'lZ(0, ' D 2catE DjunkG †1, 'cat: à: No such fileÞ“directory5 i — 	e y27, 'shf  #_foundV skill $$3 s(-15, ' """�6tryºxdata = ¬ ,,ô³=True, text ð stderr=STDOUT)
  Ðexitcode = 0
 ñexcept CalledProcessError as ex:%  ) õdata = ex.output S �ex.returnc ! 0if 9 Ý[-1:] == '\n'T " A:-1]3 B  W ,A ’

def get} R(cmd)H A"""Rt   ñ" (stdout or stderr) of executing cmd in a shell.
u @Like_ bstatusJ C(), 1the‘    ð is ignored and  · M Pvalue$ Qa strt `ontain  , “command's´ ².  Example:� ò >>> import subp—\    .Ñ'ls /bin/ls')+ '  1""" ¨ ì  QB[1]
iö_use_posix_spawn(m™Check if  à can be used f{· bµ » requires aE iðmentation that properly resÅ e¢As to{Qparen*  ¾ñ , & sets errno H €e follow�ƒfailuresk#* öÐ attribute ac€  s + 1ed.s _* Fil  ^%()0 1 �Prefer anÊ&le× Qwhich1°use vfork()“¡some casesC2besf²performanceŒ ÌÐif _mswindowsñpnot hasÊ g(os, '¥'Ä ÍW# os.  €  s > ‘availableÄ  , 1RFalsež°if sys.plat˜  » ú('darwin', 'sunos5o l aC @call¡¡both macOSO…Solaris,ƒ # 
 á"or© 3Tru¨ "# ­‘libc nameG �runtime  qversionj 2tryS M Pver =&óconfstr('CS_GNU_LIBC_VERSIONi 0 ¡# parse 'gX P2.28'C( ¢', (2, 28)œ 3 ñparts = ver.split(max	 &=1& qif len(- f) != 2¥  F ð# reject unknown;"ma9     praise V—Üï   ¬ =» Bts[0€  ó = tuple(map(int,* #1]± b'.'))) 8  òalinux'{o =% k ">="4§ S %# R4Ü€ a new LV ?f usí^ï P €NTw ?   i    Ð# Note: Don'tšÑ£in earlierÕ @beca–it doesn'¸#E À ` (eventP6 add~P pipeµ Ð ð  errors
       ô, # to the parent process).
    except (AttributeError, Valu !OS !):2  6 ð# os.confstr() or CS_GNU_LIBC_VERSION vD å not availableB Qpass
 ñ# By default, assume that posix_spawn() doesM ðproperly report e² sÏ ùreturn False


_USE_POSIX_SPAWN = _use_Z â


class Popenå ð""" Execute a child9Ðgram in a new  J.È 0For+ ñomplete description of�Àarguments seã Áe Python doc a. O A- ‘ ð  args: A string,u a sequencec 1pro  g J ñ  bufsize: supplied as’ PbuffeO  ^ ƒ - p() func• Q when¯ ÿ¡  creatingF Àstdin/stdout óerr pipe file objectí q V  Í preplace OÀ Bto e{Á b ", c @ and ñerr: These specifyŽ < °·s' standardÁ PinputR  s output[  YÅ °handles, rel etivelyŸ 0prev a_fn: (o“ only) Anÿ  W�be calledB ‘W Fœ ¢just befor&( $isdy ðclose_fds: Controls   š‘or inheri¨"ofÉ —5orsF ñ shell: If true,F@commhuwill be{ � through% 9 G ‚cwd: Set[1curoŸdirectoryÒ ²env: DefineH qenviron"@vari:Qs for‚ ‡g  textÎ `decode1 inñ ¦èdª us. �çgiven encoding‘q(if seté ) dsystemµ¥ otherwiseàuniversal_newlÌ p: Alias¨   ,îQvidedË öbackwards compatibilita±startupinfo» òonflags (WindowsuŽ ªÉtore_signals™$ X  ¤ P_sess«¿& _group@ aextra_  a Ouser: _umask   Ó � �s: Text må  ºâPo useoÚ¢#×#s“ 3 ^€err, pid+ Œ }q 1""" _Ï_ÃBed =­0  #<€ here siÓò__del__ checks it�ðdef __init__(self,½$s,æð =-1, executableŒ=None,
  Rstdin v stdout 2err 7 ”preexec_f< ßclose_fds=Trui ò hell=False, cwdZ C env
 òuniversal_newlines } ²startupinfo# ÿ creationflags=0è  ãrestore_signal¦  J  p ƒ_session¡ t Apassß £(), *, usec group‰ aextra_ ¿ „encoding3 Crror- D tex�õumask=-1, pipesize=-1):› @"""C÷ õ	e new Popen instance.""") ¥_cleanup() ð# Held while anything is call ðwaitpid before retur· §e has beenL ðupdated to prevent clobberK < 0if Y ÷() or poll() areK  € ðed from multiple threads at oÝ Ñ  After acquid †the lockù÷# code must re-check self.� óto see if anotherk W just– ¡finished aÀ Qpid()+.% [ _Þ @pid_Œ # =N »ing.Lock()
/ €input = œ �communic×_¨Qed = A, `if buf ½ G   ê ’= -1  # Rv defaulã ”if not isA(: W, intu U °raise TypeE»#(", mbQ 6 Weger"ó %ifÉ­ ç ® ; ¯ - ° ª_mswindowsW Ë  Í  =~-DValu.;: `supporBBon Wq  À G  ¶"platforms"ÛJelse® u# POSIX5 L  Â ÒA andþÃ
?  / �warnings.	 $("p overriÍ òÂ.", RuntimeW7 �  L   k 0 = 0œ ðâ%_; _only a: À *ifs^ != 07*ý	© Û   7D‹ðargs = args
    ð    self.stdin = None
    ?out ?err ?pid ¯returncode e ding =  
Ž `errors 	 
 ppipesiz[  
" õ+# Validate the combinations of text and universal_newlinesC Aif (( ais not-4  # @  T c ^bool(h Q) !=   e 9)):9 ðraise SubprocessEP('Can‹ �disambiguà ’when bothÖ 'H  …  '˜ “ ÿ are supplied but M ñdifferent. Pass one orxˆother.')™BInpu}0out ðobjects. The general principle\6lik¨f# this/#ñ @# Paˆ ñ g Child) - )   ) áp2cwrite   ---9È--->  p2creaT 0c2p  U <+ ±out---  c2pD W :err, 1err, ;err, 6 ‘On POSIX,]cÔ  >¼÷file descriptors.  On@ qWindows? !se3   ; `handle7  ‹pMa G  '0 k # o…�platformF 1-1 ¿ Õ usCPIPEà '-1† 9 Æredirecting.i(¡,ªS,=  ’ ,	  ›$, ‹2) =7S_get_$(�, stdout 9erré³We wrap OS 5 ð *before* launchñ Ÿ Ê!, .wùa« á# quickly termÄ2ng ðcould make our fds uns Hpabl1·(see #8458)"rif _mswP À%if6 §*-1  # ò= msvcrt.open_osfí  €[Õ.Detach(), 0)Ø  C  if€ ‰e Sd   c 
Ðc  c   
c Ç 5 Á"_mæÉ ¿  p/oroK Â# PEP 597: W‡AressêE)@Warn4Ein sY moduïð	for now (at Python 3.10)ó, because we focus on files for now.
  ô# This will be changed to encoding = io.text_ (	 )H Öin the futurea rif selfA †mode and] …is None:I  ˜ 1 d & =. µ= "locale"
1  # How long¶ °resume wait¼ òon a child after£ virst ^C¥  ðere is no right valu@ 4 ñ is.  The purpos)  to1gpolite� ñ yet remain goodrðinteractive users tryŸ  g¦xit a tool� €_sigint_Ì ö_secs = 0.25  # 1/xkcd221.getRandomNumber()F qclosed_€_pipe_fdK VFalse- ¨
“ú if bufsize == 1  ´°line_bufferÚ V= Tru "   Q# Use…pdefaultV Afer Z  ž Daunderl"åbinary streamsh L   a# sincR ðy don't support ‘ ^ 6ing\ 7   Ï 9 -1X ;els� /  O 	à @Qgid =ÌM ‚if groupWt 
9úif not hasattr(os, 'setregid'),  … praise VšpError("•'f €' parameæÈ ed Y"œ  N  ÷"current platform"R 2 ñelif isinstance(} ,¢±  >tryÆ  F !im¥=grp“ �except I" ç C � 0canc@be a¤  œ £  "on system Qthoutº¬grp module 6 0grpšRgrnam"‰).gr_gidï L?intL Z *ou4°ATypeC1("G‹@must¸`or an ¢Ager,�/{}".cat(typ+))) ÿnid < 0Àž É"f"  6ID ²@nega5¸, got {gid}s!giÉ @V‘if extra_s{7 |n ƒ J# "²§ƒàextra_groups, {str):
  ù)raise ValueError("Groups must be a list, not a string")
I ™gids = [] °for extra_gS 8 in sŒ çif isinstance(; ,x ½   Ì >tryJ     ©import grpš     �except I& ÿ K )\ItemsÖ @ can+Obe "t  x  "X�s on sysY ¯without thK ¬grp module§w  ¯ø.append(grp.getgrnams�).gr_gid)Å /el¨?int¨u Û` /se‡ƒ4Typ«‚ºV‰²"or integerî/{}Â¹.format(typ¶+))'ò # make sure thaÛ ð are all positive here so weQ‰ do lessŒ # checking„ &iC code%  „Agid_+  (  o ^6if & >< 0"  <€,f-0 ID¦ ÷@negaÄ u, got {X }�–uid = Non¯ ¡if user isl  
‡ !if ÿhasattr(os, 'setreuid'v ¯ `"The 'e –' parametp 0sup, ed„ù"rÀcurrent platã  2, | ÍÉÅ9pwdÛ` Á Ž 	ºè:/ "·6pwd‹ °  0pwd€ pw€ ‘ z).pw_uiì HmX  K 	//elWSUƒBTor anå ¹?id 7` 	3b 2	9uid,úif p2cwrite != -1( eðself.stdin = io.opeûn(p2cwrite, 'wb', bufsize)
  ýif self.text_mode:#  2 $ ö
stdin = io.TextIOWrapper( !, w ï_through=True,R  V   ú line_buffering= ; Pencod5 	 ’, errors= 
î þif c2pread != -1é Ç 2outæ Sopen(5 O, 'rJ9e K?outý <?errý 7errý 5 ý =e ý ?errý -	tÙò_execute_child(args,  �able, pre ï_fn, close_fdsˆ  ÁApass* Ÿ cwd, env4 ð	startupinfo, creationfla“ _shellC  p28 5d, ë	ó  š  Ê1c2p§f  ?err3 ïrestore_signalAÀgid, gids, u _umask› DÆ_new_sessionïjexceptáñ# Cleanup if the � failed M Iing.Eùfor f in filter(None, ï[0std°JŠstderr))  Œ>try   !f.p(Â     Ê @ OSEÙ>  �ó
  # Ignore EBADF or other).
Ù bif not° _| dA_pipøk "to* Y = []N  ©  Hn= PIPE@  & D .8 nd§ ”ø O $P ÙQ xQ ÷Q bhasattÿÏ, '_devnull'û ý ;5 a }d~6TVÀ              õif _mswindows and isinstance(fd, Handle):
3 	  ¯fd.Close()' OelseE Aos.cE /fdG ïexcept OSErrorM Ypass
‰ Rraise ÷def __repr__(selfÛ 1obj I = (@ @f"<{, û.__class__.__name__}: ", Âreturncode: 7  d} args   F!r}>B ú tif len(” j) > 80õ  4 =  Ç[:76] + "...W � & Í Ágetitem__ = ß òmethod(types.GenericAlias)9 ‘@propertyù  Rüuniversal_newlines\.# $ À as retained @an ag ñ of text_mode for APIl  |õ# compatibility. bpo-31756# ï ³I ¼ ‡ q.setter> Í ,Â  =
m Ž = bool(n D i ª_translate7�, data, eE`ing, eòsn  ! ! =( 0.del(. Ñ  2 4 ø.replace("\r\n", "\n")  /§ __ente0 X  ú 	. 3xit]`, exc_I÷, value, tracebackÎ 0if E z.stdoutå  	$ +er 8 ñtry:  # Flushing a BufferedWriter may 62 an~N R± *in°   | -in{ zfinally4 %if(Ð == KeyboardIw;rup b ù# https://bugs.python.org/issue25942² 5 °In the caseeak ¡ we assume* oSIGINTJ  ð!was also already sent to our child processes.  Wu ?n'tJ  ðblock indefinitelyÿthat is not user friendly.C   If· Ahave0 “ @waitZÐ brief amountø time inJ  Dan iv@ed .C ÿ() or .communicate() call, do so hereL   ¹¯consistenc¹  F€_sigint_m ‹_secs > ë ¿   ºk     wF (â Bout= ðsigint_wait_secs?)
   ÿexcept TimeoutExpired:+  > Mpass ý,self._sigint_wait_secs = 0  # Note that this has been done.L `return8 Presum: ùe KeyboardInterrupt
8 ð# Wait for the process to terminate, Úavoid zombies{ Ã  » "()\ Àdef __del__( ó , _maxsize=sys. €, _warn= Pings.	 )?pif not A Ü._child_creatcð # We didn't get­ 0sucÆ bfully 5 1 a D â 
Ã :"ifw  Æcode is NoneŸ  Ò¡Ä reading sub?³exit status€ 3s a>‚ e whicht P ñis only destroyed üõ e parent pythonC  h 	B S'("‹  %s¼ òstill running" %à Ipid,?  … Ð  ResourceWar/ ",  =‹
‚# In casg]0has‡¤ ûed on, check if it's½ U 0._ižànal_poll(_dead?$e=:x �± and _activ± ?µCMÀ, keep us alA Ðuntil we can Í j on it9n q.appendî²get_devnull @ßqhasattr 4, '. '	 •&K ã = os.open(os. , fO_RDWR,Áí[ ¤³stdin_write� Winput|  ´  ¸  Ž :try   £ R .R L 	`2þ BrokenPipeErrorL  + Èñcommunicate() must ignore bC p pipe eE •j !OSb ~ as exci  if �.errno ==K žno.EINVAL.  ç Á# bpo-19612, ø30418: On Windows, n) failùL Rwith o    ƒJJ Fr 	U J   #9is ñ² but closedæ/ip?  D  y] ;elsù +   RraiseQ   (›¡
 Ž 'b 	ÿ	À:
            Qpass

  Yelse:   araise
 ódef communicate(self, input=None, timeo )L ñ+"""Interact with process: Send data to stdin and close it.x  ‡ 3Rea) @from+ 1out, östderr, until end-of-file ià ôreached.  Wait for„  y ¢terminate.é  q áThe optional "å õ" argument should be½ @be s eto the¸ Tchildl R, or *Rif no= L A  9  xð) returns a tuple (stdout,Gerr)È ÷ By default, allÁñion is in bytes,NÕtherefore anyÆ  « 
3 � P will( Ç  Ifp átext mode (indMPd by Q. _ )’ y|| “ °be a string( dƒ % •s decodedB �according°locale enco ªDby " ´" if set. T½ I ³is triggereÇ  ttW pany of Ñ ,Z •errors orA öuniversal_newlines26"""•„ Flf._±ion_startedÁª{ ËÃp ValueE| €("Cannot±dÀq after I  » 	` &")‚  # OptimizaÀ: If we are Q Pworri‰ bž s,# uhaven'tô #m (ed’Ì0we 0 @ one3€zero pip¥ us  ‡select()O  or threadsÖ@unnec6aryLCif (•  $  Š4 » |Xi  Q[- ¯,µ€Belf.’€].count(f g) >= 2 F 4 ! =	` A  | 
æS   _ q_write(' % 'elF ?outG  N( =Ü .[q J   Aout.·$ 	n ?errn 7errn ?errn  # n Ž 8waiØ$ifª  þ ¥š 0end/@ = _ D() +9 	°b  >  ^ C  >tryo Å”Ï M™ qááxcept Keyboard{Àrupt:
        õ# https://bugs.python.org/issue25942
. 	 ý# See the detailed comment in .wait().7 ýif timeout is not None:(  f tsigint_0 Ã= min(self._  f o_secs,A  E  A ‘remaining_ @(endg -))H ?elsŸ Z › R ' p = 0  #Phing x € should ç K?try8# 5 (Õ Cout=•  æ  rxcept T›Expired^ MpassÔ Praise¿ RresumùKeyboardInterrupt
7 ofinallÃ    Mú	unication_started = TrueI asts = 6 
ô é� ò	return (stdout, stderr)
f �def polly)ó#"""Check if child process has terminated. Set and h  Ecode‚ Õattribute.""" ) Ù  _iEAnal_Œ � _â  	$, Ñ
± öonvenience for _e`e whenÃ0put€+s“ $ifY  ¾º³   Ç  É†  �& £ 2 - „	Õ c\ 1out|Ô R, ori¸°tout_seq¼ �  s  Rskip__ Aand_ºk=FalseÞ-3  Eif aÅ íe/* ¤ ?if ˜  ¥ ŠD() >{Mz
¹(X ø IKargsA- Ðoutput=b''.jow Y)ò,  © ò„N	I 0err: I  I 	ÒÓ  Ì l 
«AWaitÑ
‰&toˆ;sƒ …¶f  àž·=·$ +J›p | _Ô h = “e‹>
÷´ð# The first keybo÷ard interrupt waits briefly for the child to
  ³# exit unde& ñommon assumption that it also receivedR +^CL ò
generated SIGINT and willf ‰rapidly.6 ùif timeout is not None:$  ± tsigint_, Ã= min(self._  ÷ m_secs,=  A  = ‘remaining[ @(endc )))D ?els“ R � 	J # p = 0  #ÿ Phing p q shouldÎ
3?try   (Á Cout=‰  Ò rxcept T{~ExpiredV IpassÀ Praise« aresume”KeyboardI‚
3 ñdef _close_pipe_fds±Ÿÿp2cread, p2cwrite+ 2c2p+ ?c2p+ 2err+ 1err+ )è "# ‘tdevnullƒæalways defined~' Ò_fd = getattrÔ 3 '_ !',Â) vðwith contextlib.ExitStack() as s “  2 Úif _mswindows  +n != -1"  & X `.callbl 2  .C’
 . 4if KU 3 V vV 3 V  ð  if4 çg zF
 % ¯/_f÷  ?1os.Ì� D C† ª… 5  † &E ‡ A b !-1‡ 
   ‡ &j ï =6if S VÙ ÿ§hA ] ñ# Prevent a double —0 ofŒöse handles/fds from __init__ on errorÐýA !d_!«r = TrueÆ�#è ð 2# W­v method5$ Cget_¢ 9Ñstdin, stdout 7err£ _ Á"""ConstructÎð return tuple wi÷th IO objects:
  òp2cread, p2cwrite, c2p 3c2p 2err 1err 	D 9""" ðif stdin is None and <out 4err 
˜  £ Îreturn (-1,  ))
u É # =5 	' Ý ' ñ ' 	O ë Å ˜ ô	 = _winapi.GetStdHandle( ùSTD_INPUT_HANDLE)g   if¤ ‡2 ( q 7, _t °CreatePipe(’>, 0a = 3 =   N . ½ SClose1 _+ %el#== PIPE#„¹ ¤ 	@ Ž  '),Ð Á¦ 	DEVNULL© ò = msvcrt.get_osfhÌ`self._ Ÿdevnull()g  ±isinstance(&o, int)m  b_ .seH ó# Assuming file-liked/á  t .F ,noÜ ; ómake_inheritable(! ·Á ‡C?OUTDN �p  _*w Fd G 
± j   H *IÝ\ @ I IÒ ï§ J> jK ?outLo Ztdout�/elN-v P= Q" RÐerr is None:
  ôerrwrite = _winapi.GetStdHandle( ûSTD_ERROR_HANDLE)
I E if M �is None:%  5 &_,) v °CreatePipe(; >, 0c  > d #= £  0 Á SClose2 _+ þelif stderr == PIPEº errread¼ &@ �  /),Ò § oSTDOUT© Ò1c2p 	‡G DEVNULLH 
ò msvcrt.get_osfh`self._ Ÿdevnull()W ²isinstance(bo, int)o   b sd ù# Assuming file-like object	Nå v .H -noá <ömake_inheritable(›	z ²return (p2cT1p2c©,'  ¡   2c2p' Ð' G¢5)

P ]def _   · ", Ñ”B"""R§ ãa duplicate of. ·, which is ñ 5"""r  º hWDE ö	)  - ªôGetCurrentProcess()¤ ù 5 
O0, 13 úDUPLICATE_SAME_ACCESSa©² hQrfilter_Ah_list(S XF6 Ã out consoleUùs that can't be used'÷in lpAttributeList["} p"] and ç  sure the – 
E s_ ÷	empty. This also removesíZ ,s.ÖC# An² ñ with it's lowest two bits set mighÊ ”a specialò 	’ #N ÿ ¯if passed ï k, willL ùcause it to fail.  Ó "({â D for‚ iÚ ¼	:  ¤ i	� & 0x3 != 0 (or`’FileType(� O) !=; %  ; ý FILE_TYPE_CHAR}�Óexecute_child‹àargs, executabÿle, preexec_fn, close_fds,
  Apass% Ÿ cwd, env/ 
ÿstartupinfo, creationflags, shell> 
 p23 ¿d, p2cwrite. 
Ïc2pread, c2p. 2err. ?err. ÿunused_restore_signal*3 Vgid,  s ?uidÏ 
4 _umask) ké_new_session):Éñ"""Execute program (MS Windows ver5 I"""
8 ¶assert not ý"  Äsupported onQ .G ñif isinstance(ar+tr¥  y [ 	‚ /el= _bytes?  "ifZ
þ  Y   ñraise TypeError('G  � 1 isÎ YallowÌ )')�  H 1 ð= list2cmdline([ ], ¼ ¿os.PathLikeÂ /Ÿpath-likeÆ mwhen 'À  Ä  '’ Otrueõ *.se  3  )p0if ”`utable�  z?NonR  ( æ= os.fsdecode( ] ¡# Process /©up details! C¹ „ € D  Þü  = STARTUPINFO(ø# bpo-34044: CopyB � since it~ ßmodified abov ñ	# so the caller can reus@ ù multiple times.é  
Å  k.copy(Añuse_std_handles = -16Ein (°‚ ^
;if I /Š 0dwF4Á |= _winapi.nÿ F_USESTDHANDLESÜ 	À.hStdInput =P ý0 2Out1 Ñ 2 V% =ø 
Ü attribute_9$ =† BD.lpA IListk Chavet; [bool(Q 9and7  à À        "hanòdle_list" in attribut o and
  
7 U["hanW 9])
D ÷# If we were given an 2 ù or need to create oneD ‹if have_6 ƒ(use_std sÀ É close_fds):D  × ,ifò ~is None+  / 
ç ô = startupinfo.lpA=�List = {}q ± =| 7M = \@  †  ­(‹ Y.get(v[, [])z = ;if %ë ©  += [int(p2�@d),  ƒc2pwrite 2err ]ï u M 0[:]8³elf._filter­„(* ½ ! ¹ fif notö&  – �warnings.	 /("Ì'['w O'] "˜ T 
 ¶"overriding‘ ²", RuntimeW� é   G �# When us> 9the#ðwe always request-inherit� #? `s but O Eonly Óthat will be H Zed arx ˜   #B  es5 N !€ †Š = False&Žif shell®—ýdwFlags |= _winapi.STARTF_USESHOWWINDOW� D ÇwShowWindow G mW_HIDE: òcomspec = os.environmýCOMSPEC", "cmd.exe")? óargs = '{} /c "{}"'.format ([  , % ‘if cwd isÌ‘ ! — Ëfsdecode(cwdH òsys.audit("subprocess.Popen", executable… ,u [, envG 0# SéõE 	ë >try¹÷hp, ht, pid, tidnCÖP� (‡ 	\  o P# no ¡Ïial security?  Y,ð,5  ü	b)=  APtionfÈ8 ?env. ?cwd. À            ÷  startupinfo)
  ‰finally:    ð## Child is launched. Close the parent's copy of th OpipeK  ñhandles that onlyD ca ÿshould have open.  You needJ  °to make sur‰ eat no _ oX ’write end˜ ‘ poutput ¯ ò are maintained in this process or elö �  B ¡will not c 0wheD "e á I �exits and¥ K  ‘ReadFile O ]hang.& aself._g _{ ñ_fds(p2cread, p2cü ,8  Ò 2c2p8 ?c2p8 2err8 1err8 ))
q @# ReM è G¤D, bu' G thJ Á	E ê  #_ß šted = TruÏ' ] A = Hi:(hpæ&  piB *piW�_winapi.Û? tÒ ðdef _internal_poll(O þ, _deadstate=Noneuô_WaitForSingleObject=p   B ÆAIT_OBJECT_0<  6  ÂGetExitCodePÆ;  )ü»"""Check ifÀÀhas terminat æêurns returncod›ªattribute.T^Qmetho^òcalled by __del__, so it can,¡refer to oCs(0in W¬local scopo :"""1  f À.¶  ä Â
	 /?if Å"._v¨, 0) == _W–L  P y >= _‘	^ 
È´ À 
`­AwaitE ž, timeoutäIÑð  implementation2? ß) on Windows.C Y ;! ¤_millis = ù‰INFINITE• b3D Cint( z * 1000 iÜP# API¶%e:Ê°immediately k Ä >= 0“gresultá Ú Ž1	ú   
� 
ø  A 4if ‹ mÀnapi.WAIT_TI�MEOUT:
   òraise TimeoutExpired(self.args, t )= $ òreturncode = _winapi.GetExitCodeProcessQ z_handleK B  N %

p Ðdef _readerth M Ú, fh, buffer)Ú  ±.append(fh.5 )w ¬fh.close()k ³communicatej  input, endp, orig_ ;out| €# Start s 2er ± ðs feeding into a list hang µoff of thisô  ¨ð# object, unless they've al^ €y been so 9ed.; "ifPÐstdout and nor SsattrÖ ""_ _0"È  � “% Y = []i ' K ð M = \'  +   # Ring.TÎrtarget=n  Ú è,D  H 	  «=Ø .Š ,¾  @ t 1 _˜ í.daemon = True� 1  �(]€?err€	?err€% € & Å €m7err€ ˜  c€ # » €1 €	¬�*inø ‘in_write(ã)u & �# Wait foÈeÓ Å out.  If we ,­	’ #aremainO  ÿ �ð
the fds left open in caseG [ userL gcalls ªo again
!isONone

BjoinS_³ "inö(	Ñ x4outTŸis_alive(e  iƒ	p	
p  iã <ã ,J ã ;	ä ‘# Collect±output fromXÅð both pipes, now that we know
     ô# both have been read successfully.
,   Üstdout = None ?err ‚if self.< :6 	T & _' ^_buff+ H ‰.close()$ k ?errk ¥ k ?errk 5errk 	l ÿ$# All data exchanged.  Translate lists into stringsLò @[0] À bOelseefstderr3  Ö 3 	¨ ‚return (f ", ; %)
%  de¡ nd_signal(j, sig)A�"""Send a ànal to the pro.E."""T  Øt# Don't. a) ð that we know has alwjy died$  ôÅ ±code is not
   t ( 	‡  C Sig ==‰ Ž.SIGTERM=  ù œ.terminat[-elI ÎCTRL_C_EVENTN bos.kilOA.pidSHnal.7 
¿d _BREAKh #; l .seµ óraise ValueError("UnsupportedAÐ: {}".format('LB QETbs?O  Be>try*…_winapi.Î P?»._handle, 1vpxcept PQssionf^ ð# ERROR_ACCESS_DENIED (wine—0 5)Ðreceived whenM	ù #ud ( Trc = Ó ¿GetExitCodeÕ 
Ò  > 0if A B ÎSTILL_ACTIVEÝ  3 i¯  1.ÄìF= rc© O5 =   ÷d #T ö # POSIX methods 
  ùC_get­s»!!in 1out >errÇâConstruct and µ ö tuple with IO objectsž  ú 0p2cîò , p2cwrite, c2p 3c2p 2err 1err ¶  D kT – = -1, -17 À   c2pread, ÷c2pwrite = -1, -1
  Ëerrread, err' 	( ùif stdin is None:  Q Ipass %el5 == PIPE5  "2c 4p2c ™os.pipe()N  c  P 1elf ðsize > 0 and hasattr(fcntl, "F_SETr ^_SZ")w  M , . (~ !,  .@ 8, st 
– 
ä ~DEVNULLp pç " =L Ë_get_devnullç Q ±isinstance(u_, intÇ  W  œ	0?els¥ ù# Assuming file-like object>  !^ .1 Yno()
*  ”_tdout  6 2c2pÁ`~ &å a #?outY ¢	¸ /` "
?err"  6 "e¼ "`:"&å nSTDOUT=5if k!Å#  ¯‡ % =/ 	ñ$    # child'sÓ Ÿõis not set, use parent  G K 0qsys.__sd&__ '  Ø3stdì Æ w+?errY ‡ 	Ö /` 	j preturn sß|	' 8,' Àte)


      ÿ4  def _posix_spawn(self, args, executable, env, restore_signals,
   ÿp2cread, p2cwrite, 2c2p, ?c2p, 2err, 1err, 8):
ƒ A"""E¶ øe program using os.ç Y).""":  ifä Š is NoneV  b Penv =G ‰environ
>  kw3Y = {} ,if5Z ²# See _Py_R`S_ù() in Python/pylifecycle.cc  � ½sigset = [] Afor ± meP À('SIGPIPE',  5XFZ
 ;SZ'P ]    A Ðum = getattr( 4al,Z ,6)}  < !if&  um]1not+  +   Ì q.appendh .umY qð ['setsigdef'] =h :set›Îfile_actions" !fd« ’o ¿if fd != -1Ë w Í ú(os.POSIX_SPAWN_CLOSE, fd)á •   2š W(`.0)Z(I/ 1 <;, 2 é E@DUP2Ï   2í  J£NëRî 
ô ÆB.pid²ùÔ ³Ú"**f 
ˆG p_child_Ð teR OTrueo  ö _close_pipe_fds£XÇ ï	 yÂ4 ¤$, ×)� ßó eÈ á0pre) R_fn, Ê >fds\¯ @passê R, cwdH® 	Ñstartupinfo, N`ionflaj_shellm Q ÁHBŠ 
`  gid, @s, u _umask^ 
&Ë_new_session“á (SA ver0  Ù	ˆðif isinstance(args, (str, «bytes)):
  €args = [ ] ðelif isinstance(" ß, os.PathLikeN  Žif shellh  w ðraise TypeError('path-like ] ù is not allowed when '”  F  'v  A mtrue')5 ` ç .se¯ 0 Alistù ))
S è ò	# On Android the default ¢ ùat '/system/bin/sh'.]  á Runix_Õ <= (0 = if2  6  òhasattr(sys, 'geta� ôapilevel') else ' /‡ ‘, "-c"] +«~ Ïif executablO  ™  SW[0] =* VE  +?NonM  $ =Ž :[0]I ÷sys.audit("subprocess.Popen", ,? ®, cwd, envæý(_USE_POSIX_SPAWNú Û  nd Ï–.dirname(¦ _4 0pre' 4_fnî _  Ÿclose_fds& 
Opass% 
?cwdo ô(p2cread == -1 or  ?> 2Ñ –(c2pwrite8  9 ;err9  9 
 ÿstart_new_session /giû Ogids uI Ÿumask < 0) �self._posçApawnf
œÿenv, restore_signals,Û  P ª,³T5 0c2pð$, °5 2err5 ¬jreturnŸPorig_ù/ñ# For transferring possibleÇú failure from child to parentVð# Data format: "exception ¯ñ:hex errno:descri "n€# Pickle w€used; it ñcomplex and involves memoryÐ cak 
’ …errpipe_C ²! =PJipe(S#¥ ( Amust5Qbe inq ¯ðdard io 0, 1, or ×2 fd range.
  ùlow_fds_to_close = []" ù	while errpipe_write < 3:%  R K ‰.append(; )7 	 Ÿ = os.dup6 	Bfor m 3 in
 Â ™ 1os.Ü (5 
ƒ >try2   ä ý # We must avoid complex work that could involveí D àmalloc or freeÅ òthe child process toc C ûpotential deadlocks, thus we do all this heró „   Ð# and pass itp Ïfork_exec()
w þif env is not None; Z   Ženv_listQ    Ë@k, v¿env.items()W  9 k&ªfsencode(kÒ #  pif b'='c kY  6 ð
raise ValueError("illegalû ÿironment variable name"€ 
2k +‘ +ìÆ /v)G ?elsg �€  # Use Æ U‚stead of 	 - !utÏ “  ›  ifÂ €path.dir(3 l% #8 ,l 0# Tí€matches O€behaviorþ 1os.ÙZvpe() ô ˜ otuple(5 1os.…join(os.>Qdir),y]Ø G  
0dir¦aos.get± _[ ?(en»°keep = set(Ð Òn 0 ?.adœ � óself.pid = _posixsub¥.2#
Hargs
ö,3 
± È ", „÷sorted(map(int, Ê ?)))M 0wd,¿x Áp2cread, p2cìR, c2p 2c2p º 
2err/ ?err/ Y4  9 ðrestore_signals, start_new_session,
            Àgid, gids, u }umask,
(  ¿preexec_fn)( ýself._child_created = True/ �finally:  o ÿ# be sure the FD is closed no matter what> 1os.- ý(errpipe_write)
- ¯  Y _) `fds(p2º ad, p2c9  ¯  Ïc2pread, c2p8 2err8 1err8 ©  °# Wait for €ý to fail or succeed; possibly raising anñ ð# exception (limi¡~in sizeÒ?þdata = bytearray(+ QwhileéÑ part = os.ì ™  ~, 50000T  V	ƒ 0+= H Ö  ) aif not   5lene  ¿ 2) >g Ÿ  B Ybreak\ £Ÿ'› ñ8if ÷ ² /tr7pÇ2stsj�waitpid(æ e¤if pid == + t  "  " ÿ_handle_exitstatus(stsÂ?lseO ðreturncode = sys.max’	� } ½  C`ÏProcessError` Npassô=] ðion_name, hex_errno,��_msg = (”  ˜  ·ÿ .split(b':', 2)p# The eü  ²°here shouldå!chÿ {  # 4‘ten in by1 Bsubp° implementaôsC ¶like _posix< , 3err

 0.de¹ Po Value¦' w g%'SÀ 8 'Š Ÿ3 0% ¥ w = 'Badý a from ­ï: {!r}'.formatåí scã\ _â 0typãgetattrg –builtins,² •m�'ascii')šCÀcessError)
   ú-if issubclass(child_exception_type, OSError) and hex_errno:
J   µ_num = int(/ _, 16)3 u ÿec_never_called = (err_msg == "noexec"D ?if G §  ­ ] ? ""™  % p# The e ÿ
 must be from chdir(cwd).=  b ïfilename = cwd+ Oelse§ E Porig_
outableQ  if² !noˆO!= 0^ bq os.strê  x> nUraiseq-: ,ƒ  ½	 Â Q M  B 5)

ç õdef _handle_exitstatus(self, sts,*  ¾  $wa5 1_toC �code=os. Q °_WIFSTOPPEDF  :  8 1SIG8  )¬q"""All ð rs to this func¢° MUST hold  ._Å «pid_lock."Ù ÍÂis method isW ùd (indirectly) by __del__, so it cannotYp# refer� úanything outside of its local scope"7if 4K(stsô  ¶Î `return c = -_W#3 	� BD  2ýP Q cÓinternal_poll_P_dead? „e=None, n À [ >pidõr_WNOHANå ¡, _ECHILD=/. ”"""Check Üñ process has terminated.  R(&s 0Í  L¦attribute.H  TJ òTence ó	f ÿ8theÿP (norF 9 ~sYKlls)– µ"ifÛÝ  º �
* Ò bif not0 �Ûacquire(Falsej :   @# So Í R h Abusy'  äù.  Don't allow two	 K   ð# at once.  We knowž ,:yet 1   æ  ß U >tryó  5 # 
 H à:
              Âreturn self. ÷code  # Another thread waited.
<  Àpid, sts = _( Apid(R  Ÿ_WNOHANG)< ’if pid ==„ Opid:(  m T þ_handle_exitstatus(sts] ÿexcept OSError as eZ €if _deadM Ïe is not Non/ ‰ /=B ¾ Àelif e.errnoì _ECHILD‘  b ð	# This happens if SIGCLD  ÿset to be ignored orv I  ’ðing for child processe` !s çŸwise beenI �disabledJ 4ourH ". ­ ] 0is NO, weL pcan't gÊ 0he {/us]Å ÿhttp://bugs.python.org/issue15756l 5	¬0, finally�A Øê_lock.release(ve È  L%

o �def _tryM ",Xz_flags) à"""All callersñtòfunction MUST holdq T 2pid¡ 5"""v  A/trÝ  (Ÿ =` = os.)
»  � 	O \CNPMf
Â  y È9ingo I À ¦J   ¸ ž¸~=pidh 
m z r~timeoutñInternal implementa!of>Ì() on POSIX."if° ˆ  Ÿ Qñ( 4 Ò š3if « L 0end(  %  D() +9 <0# Eå À a busy loop”we have a9 Ã& ?wasN  Pcribbº‚rom Lib/Ö±ing.py in TæÎ() at r71065“òdelay = 0.0005 # 500 us -> initial # nof 1 m� Ÿwhile Tru`£
ÑÛacquire(False … éð             if ÿself.returncode is not None:
  ÿbreak  # Another thread waited.@ 
Ñ(pid, sts) = † P_try_; Ï(os.WNOHANG)D 
Ãassert pid =E   $or 0? 
$if( € ?pidó * ð_handle_exitstatus(É m 
 K0& finally„ €  &ÿpid_lock.release(,•remainingg �_time(end > 5if / _ <= 0ž ñraise TimeoutExpired(¯ `args, e ?outh Âdelay = min( F* 2,| _, .05;  X b.sleep: 
& ?elsÉ Rwhilev
üøBwith2 ¤~"if/ 
a ])Y U	0 � ±# Check the±and loop asÌ Uÿhas been known toÈ"# ó € 0 even :Cout Óÿ in odd situations)ÿ# http://bugs.python.org/issue14396= ß¬Ûß 0   ;%

ñdef _communicate“, input, qa, orig„ 
I=`stdin � 9r Y ¯ion_starteº €# Flush C ðo buffer.  This might b?A, ifù…user hasÆ ø@writG@to .T nÉþan uncontrolled fashion•/trÙÔ P  .f° Ç úexcept BrokenPipeError1­ @pass9~Ü) must ignoreG « !if®e Í  † Ñ ?clo˜Õ  W Ù  	Ê0std…ð= None
         ÷   stderr = None

  ù"# Only create this mapping if we haven't already.> ùif not self._communication_started:0  y - ýfileobj2output = {}* "ifZ nstdoutJ N [c 6 o] = [][ 	?err[  3err[ 	\ ³ • " =Ù _	¸ W ¯ áú W  ´ 
þ/ ±save_input( )% Ô # ,4 à_view = memory (]  R ð	with _PopenSelector() as e  qin and Y ) G ’.registerŒ estdin,e és.EVENT_WRITE)p E ÷ ³ s ì _.closã ? sÙ „ >out… OREAD„ 
 Á„ ?err„ $?err„ 	Uwhile6¯.get_map()|QtimeoÒ  remaining_ @(end ë  40if   ? !isZ ±î ?< 0x  @ r Qcheckn 4outq R, ori„  €å  ?  î,G,< Bkip_’ ïand_raise=True ƒ $ @ Runô ÿError(  # Impossible :=  A 'q  @  o..., s‰ / 'Ò 
²'failed to š Tâ›Expired.'Ý ‚   /ê�(– Ã Â Ž Ê  ?err… ±# XXX Rewriß0eseÉ Ðuse non-blockì°I/O on the ” # objects;( @y arE   longer usH C� :io!B   ñfor key, events in &Ò if1 .” Qobj i#!f.Ê6 Ð    chunk = iñnput_view[self._i ¯offset :
  D  Ï+ _PIPE_BUF]O 
?tryp a ÿ
= os.write(key.fd, chunk)o 
ÿexcept BrokenPipeError‚ òector.unregisterw oileobju  N¤ - .close(4 Oelse— ?if  w>= len( )K  ¥ ?selæ + E ê Welif 1 B in ¸ rstdout,ß ostderrÅ Qdata Breadž�d, 32768lpif not A ($.ï 
Çf<‡2output[E �].append(À ))
ÿ< Ñwait(timeout= °_remaining_ @(end )> Q# Allù exchanged.  Translate lists into strings.  ŸÈ1 isc?NonÖ ìÂ = b''.join( 
¶M ?errM  $ 
M  >
#Ç únewlines, if requestedË ÿ# This also turns byteý  ]�text_modù  Ó ?outÓ  V" =$_t„_½ 4,� :  e Ÿ.encodingL 2 `sÊ ’ û  ª
 + þû ?err¯ -?errû 6L û 	’ re> ® Ý &)
ž’def _save–!, ¢”`methodCðcalled from the _communicate_with_*() metghods
  ð# so that if we time out while communicating,! Ìcan continueJ ´ending inpuP iretry.) òif self.stdin and _7 ys None:3  ± 4 % ¿_offset = 0' 	" =‹ $ "if q is notq ‰ �text_mod„  ˆ ( =» �.encode(© Ý   :ƒ  J  J …rrors)

J  deH‘nd_signalw j, sig)<�"""Send a Pnal tñÕe process."""T  ’ ð# bpo-38630: PollÓòreduces the risk o}   Y M Twrongm  e C |  _qpleted,Z ±Popen.returKK �attribute¸Qstillº,»W ðid has been reas+edG  (recycled)ô a new differentª  . This rac»ndition canM úhappens in two casesï#2 `Case 1` Òread A calls ü `poll() B B + &seü�). In th5 ñA, waitpid() succeed#Y  9µexit status™ | 0 ki“ ’ because ¢ ð o ž 1didU ¡r  ‚ yet. CaOE ŸB preventž …`thanks¼	_î __lock|%2. vpid, 0)5 Œûed directly, withoutä  usù @ metV': í 6is   ®tM   L .wÛ@ûto a default value,• UsinceÛ q) failsÁ " PìpLookupEK
ˆ i} 	U «
Û 3
h<CSkipi9aQeqwe knowq al¯jy died�  K s ï  0# T€”mŒd
6	× �# describRbove ;  : tw= ‚ ½<tes ¸ &  9
Å >try!1os.1 q ~ ±	� oexcept³ N ƒ# Supres˜
eçð; bpo-40550.
     dpass

 õdef terminate(self):  % D"""T  ü
 the process with SIGTERM2 	  U Ò.send_signal( .< )� Okillˆ OKillƒ IKILLs 9""" ƒ  < ÷")
"""Stuff to parse Sun and NeXT audio files.

An ñ consists of a header followed by² ñdata.  The structure
of 3 Sis as9  f  }  *+- +Ú À| magic word* | 4 	o size   4  ¿  2 4 €encodingš 4 ¯sample ratœ #y�channelsÐ Binfo˜   |   R
Í� (ð4 characters '.snd'.  Apart fromü
‰ ¥field, all?  ñs are 4 bytes in�Ey Ðall
32-bit unU€ed integr  ± big-endianL � order.
Á Àreally givesž 0 st­ § .4  
 � " i( ‚physical 0 3  Fë Ñ other
parame %`numberÂf 0s c¥ Âe calculateds Î  M� 0waySwhich�?82  ? âPossible value @list�Belowa ‰ª currentlyÛpn ASCIIÀ‰   Ða
human-readaf °description×  å >¾ m ’is
paddedP1NUL¤s‰ <  á.

Usage.

Rea[Z s¶ð f = sunau.open(¶Á, 'r')
whereÇ º ei’é@name® a `or an >   poWr* ð must have methods €(), seek  IÑclose().
Whenv �setpos()h…rewind()D  ý“not used,0  N 
e  Â   0 ne�1aryÒi} PturnsÃ sinstancÜ 4cla¸ [¤ Ådpublicz JDgetnZ’()  -- re] ¹„' u (1 forŠM pmono, 2' … stereo)/ 0getÅ[widthr   1le   ù9 B ;9 À- returns saómpling frequency
  Àgetnframes() ò-- returns number of audio ' : �comptype; :   €ression   ü ('NONE' or 'ULAW')G =namG ñhuman-readable verR %of=  ²  |  Dnot  Âed' matches • 	‹ Sparam Ò  a ¡ àdtuple consistQ  ll$?the— 	Òabove in the  Uorder4 “getmarker~ } ‘None (forÆ àatibility withP D   ¹aifc moduleé  l 1(idôé ðaises an error since]  * Ÿ does notk 	_exist¨ 	 �  à[ (n� ù “at most n| hŒ‡ arewind€ î Ê  1 to¾ cbeginn«|ÌestreamG  setpos(pos‚  G DseekE õspecified position: Ftell : @~ ~current7 Bclosð·  q  6 PinstaÐ(make it unusU)
TheN ªced by ‰ 1andD © ` givenÉ ä @)
arÃ mpI0le 2 @haveßh)Uto do]v actualu Äa
file.� ¹ ð() method is called automati @y whˆ ”he class å ñ
is destroyed.

WriZè f %s:nð f = sunau.open( Á, 'w')
where/  � aeither	 ¸8  orä >  rpointerÊ  a must Þ £s write(),q , )  Cand
s.

This Vï ‹ Àp follow|cpublicKù Àsetnchannels'b-- setá §! /Ësetsampwidth6   1le  0 ŠKrate0    . ;¹” 8 s4  Š ( ,Xš è  8 	U ¹vBC — úâ)w Aall  Æeters at oncçs® º ø ùaoutputvx M#�raw(data
0 	�¨qout pat¾ upð
                 Äfile header
 õwriteframes(data) "  1-- - r audio 4 ÿ and patch up the e tclose()J ? --4 Q 0  N � ‘   outputp ð 
You should set: 0 paÕ ±ters before RfirstÈ Á qraw or
Ú  ô.  The total number ofð ðdoes not need to bes ð,
but when it is    ácorrect value,‡ … M 0havr 2
be�ed up.
IK @bestL ¼  à 7allà ð, perhaps possiblyd ñ
compression type,[t£ î 
È[using0.
W.  n  ¨ Abeen* Ðten, either c& X + P(b'')ZÌ ()Á 	(€sizes in¬ • .
y1 `methodL \ °ed automati yl_0lasI ð8stance
is destroyed.
"""

from collections import namedtuple


_sunau_p77s = )(' /',–	ò'nchannels sampwidth<brate n � •	  ˆ a')

# ª Á<multimedia/l_Tøhdr.h>
AUDIO_FILE_MAGIC = 0x2e736e64 ÿENCODING_MULAW_8 = 1  aLINEAR! 2! 	o16 = 3" 	_24 = … e o32 = 5D ŸFLOAT = 6 ¯DOUBLE = 7 ïADPCM_G721 = 2¥ $  „ 2§ $ 03_3J « & 5& ³ Aw/27Û	×°UNKNOWN_SIZì 30xF :ð# ((unsigned)(~0))¹àimple_encoding½['E	¿2 ¶83 /164 /244 /324 ’A]

c3°Error(Excep!):Øðpass

def _read_u32(€ xq) Pfor iÁsrange(4!  «abyte =›.E &(1W!if? # q  1   ‘raise EOF˜ c    q Àx*256 + ord(9 N ƒreturn x® }¯ Àfile, x):
  ñ  data = []
    for i in range(4):   öd, m = divmod(x, 256) öata.insert(0, int(m) x: - ðfile.write(bytes(� ñ))

class Au_read:
- ÷def __init__(self, f“ Òif type(f) == '''   · ñ import builtinsW     5f = Ö.open(f, 'rb'¹  '  y  ._  •ed = TrueG Felse$.  FFals/ K  Ð Xfp(f)å 3delä Á 1if 2 _6g  iclose(H ^enterJ areturnN v 'ex[W*args~ { c ¾    , ˜ 2 ­ ! = ( / å._soundpos = 0 qmagic =4ýQ_u32(Z ˆ2if ( ú!= AUDIO_FILE_MAGICóraise Error('bad8 gnumberÚ’ �hdr_size€ 1 O< 24z qheader \ —too small Û‚ _> 100R ÷ridiculously large[ ©  XÛ W{… - `ÊUNKNOWN_SIZE– `  ï » �encodingi1 0not’„_simple_ s• 	÷$  < �(yet) sup	'ed)ÿ 0 Gin (_õENCODING_MULAW_8,: ê / A.  + Ùsampwidth = 2O   Qframe65= 1  .el¬ =
« ŠLINEAR_8]  � o )/16p ÿ ß |Î = à 3O(/32à 4p &	¯„unknown ‡£Æ Ø ?rat§/ €nchannelh ›
ÿÀ))
        i÷	f not self._nchannels:
  ôraise Error('bad # of , %')- F ³framesize =X  * j < #if Ahdr_> J> 24‰ ` òinfo = file.read( 8 F- 24”  È !  8 e, _, _™   ÷ .partition(b'\0Ï Oelse� 5b''¾ ?try* „data_pos¯ Vtell(œ ñexcept (AttributedA, OS	 )S QNone
ƒ ‘def getfp8 creturnZ 2	0 †7 
& 	< Ÿsampwidth< 
& 	< Orate< 
& 	< n s: ?s@ú== AUDIO_UNKNOWN_SIZES' V ;X ôencoding in _simple_ 0u� $//ˆ!f ˆ 0r  ú# XXX--must do some arithmetic her}comptypXÆ ÿFILE_ENCODING_MULAW_8&' ó/elV AU   U si'NONE'
 í ?namí DøCCITT G.711 u-law¥ ú 2b Ab  ­ ù jressed]paramAw_sunau_$ E.getÜ2(),ž5getµ5(),£—N n ÇÆ< Ÿ: 
 Á §9   Î)))æomarkerÖ  / H, id	Ä0no ( 's'k  J[#, Ê D ö$ifI  sU� e 1¡ ³å6 % ›  ; Ê  }Ðframesize)
    òself._soundpos += len(data) //  ¥framesize
8 S   if ùencoding == AUDIO_FILE_ENCODING_MULAW_8:>  J íimport audioop  † $ = ‚.ulaw2liž ,| ©sampwidth)? preturn B   @None}  ñ# XXX--not implemented yet
< °def rewind()È  h _@0is ` #  f ðraise OSError('canl Vseek'¶  [ p._file. k $._Y ( ±6= 0¦ Atell9 ¤ ö _ 7 3 asetpos5 W, pos:  if q < 0 or >uBgetn(/ ê è �position î ‡in rangeò >W! +¿ *¿ _¼ ?izeV6pos%Qclose$ð  «$ =S &il0if  
�  ! =$\ 5  jopened;  !  9 .ˆ ö)

class Au_write:ª �__init__­ 7, f°  if type(f)¨ '''   f ‘‰builtins£ Df =  .§ w(f, 'wbÒ C è    †ed = TruJelseÛ . FFals/   Ð Xfp(f)å 3delä Á D ,g  > ¦   _ r’ð  ï __rd N� 'exuH*argHh } c Ø   ,/Ê   ! = 6 ´  �Prate ÿ    6 Ÿnchannels  -    î ßËUNKNOWN_SIZE› + writtenL   Ò olength;  @info…+''u @compÑ@ = 'lö' # default is U-law¯5set%( …O
Ó 
YÛñÙ �Pge pa¦ðters after start'0to „ 0‡(1, 2, 4”  ç	s Ronly ( Por 4 | ý0sup\%edŸÀ  self._nchaÁnnels = ncha Õ

    def get q(self):    pif not  %._&    $ ôraise Error('number of i A 5t')V lreturnV ’ Ásetsampwidth’ %,  
� ™ ßframeswrittenž 0canÏ  › Pge pa7 ðters after starting to M e´ &if„ Ó çin (1, 2, 3, 4— 1bad< 1le Ó V À Ý ! =) & gm 	¡Orate l ‰ È —specified— 	¡ 2 ’ 5setl ¡ 
� á n ¡Kj i  5 =  	K ¹ 
®  H KJ  m 9 ä*  ) Š 3setˆ #,  
‘ �   “àIg O < 0ö #ÝÑ #s P¨be negativ2	¼  {5  y ú 	€— þ ? ±setcomptype@  ,  g, nameL !if  °ç'NONE', 'ULAW'%  ´° S ! =7 ´?elsW	€unknown ? qression@ &')± g± € 	ñ  D  Ë :  Ú ë :  ˜Telf._6 3 ==à Åu÷'CCITT G.711 u-law'ä N A.N AN 2ƒ  . ¯  )6ed'è 1set•sæ ,¢sî n» Ë,é,F,‰ E
  :# =P ð ò ‰V $(n
 ­% (
 % Ï é(
 % Ñ( !   ¼ (	 Å 
O-%MÐ_sunau_paramsô(self.getnchannels(),  ísampwidth(),
  ' ˜framerate< n  O : ycomptyp9   �name())
; �def tell¬ !):  Œ breturn­ _o vwritten9   e‹ 1rawC g, dataI ðif not isinstance(!  , (bytes,  garray)5  ‚  ' Ñ = memoryview9 µ).cast('B')¬ +ð _ensure_header_› Ften(& #ifÎ   ¦ == 'ULAW'÷  y åimport audioopf   ”  ‚.lin2ulaš Ú_Ø{ @b = lenÇ 3 //� @5izej Ð Pfile.Ç 2N  T  ! Sten =N  #+  ]  É ;  +ª ïìš  W  V ¼ …—  -  ¿ !À U or \´  { b _T ulength 9   N 
Ï3 Rpatch(ûQcloseÍ ~¥  ƒ
M :try  — b € *   ^ $ D  î õ 	9 ; 
  Ó   g.flushH # ofinall  2 Œ  ÄZ f = Non÷ Y   !nopenedp %  \ .¾Ï#k ò# private methods Å( — 
 ¶  .ÿ
� ß) è
$  ° ôraise Error('# of , —specified× 7 	_ Z_  ( 1le ]^ ˆ i^ (  ) \ 
 ’”x   , 
}  )._ªLNONEªÓ ò ï N== 1Á ñencoding = AUDIO_FILE_ENCODING_LINEAR_8, w ‡ ò ‰size = 1$ %el­ƒ Àth == 2:
     øencoding = AUDIO_FILE_ENCODING_LINEAR_16
5   ùself._framesize = 2$ Relif % ù sampwidth == 3:'  K „ -249 _ „ 3$ „ 4„ %3ä  ½ „ 
¨ Nelseo ðraise Error('internal e %')Ä À €comptypeCj'ULAW'U DM3 %_8Z º 1  ¶ ²  *•nchannelst ³_write_u32(5 Hile,—VMAGICtheader_s5 + len= Oinfo+ (: Ÿ+ 7) & ~7‰ 5 Y ån‡  IÊUNKNOWN_SIZE¬@lengÛ ) „ �6 p P 5izeC :tryx 9 Rform_M c_pos =‘¦file.tell(Þ ñexcept (Attribute²A, OS	 )` 6Non– æ‘ z ¬ Bdata   =Ü5gthß I 	K ) b 7Orate0 ·0 I  ?Â�% ib'\0'*Š-ã > � - 24))
ô ¢def _patch‰) ‚Šá0is ‚
¬ÏÈ×('cannot seek€µ   r +._` 	i
 Ë 6ten2 a   æ . ý ° hŽ p0, 2)

Ðopen(f, mode=í !if   if hasattr7 '8 '4  k     P = f.	 … ˜  q = 'rb'& t qn ('r', \ òreturn Au_read(fëK i8 w8 (wb” 8  e9 `×�!("O ðmust be 'r', 'rb',ð! 'w', or 'wb'")
"""Interface to the compiler's i ñnal symbol tables"""

import _sym V
from    ò(USE, DEF_GLOBAL dNONLOC  €PARAM,
   5 bIMPORT5 RBOUND ôANNOT, SCOPE_OFF £MASK, FREED [ | ³_IMPLICIT,  $EX UCELL)Ö ôweakref

__all__ = ["ê Q", "ST  PClass	 €Function $ p"]

defB(ô(code, filename,oq_type):û ¡""" Return‘¢toplevel *S w Q* for Psourc·Ade.
@ *^ A* is$  k 1 of   Q with  � 5 Sand *ü� =  ñ()* mode argument.9   °Vtop =.0ò C rí G_newã F(top*@)

cg " rFactory6 fÓ__init__(selfN œ   £.__memo = ßÁ.WeakValueDi¶Rary()C M 1newH ,ø‹ q  Y "if .¿( = ÖTYPE_FUNCTION2  6 ð .(`  ) _ _CLASS\ “Y ‚ L, †  	1__cRkey =Î G  Í gobj = ‹õ .get(key, None)) 0if , !is 
ß   	E T[key]X  ³Mô [obj

k/ =W  t:!	nl, raw_} ½ ø   & =, õ    �­=#" ‹hs = {}‹ Nreprù$ifq= Ë	ë    ¢•kind = ""t Oelse$ k%s " %^ 0.__¾ "__š  T ‚ û .  (Z"top"Z  W"<{0}™éðmodule {1}>".format(® ,� 8Eº ` 	œ{1} in {2` 
 Ì  Ôù –G 0 N ê ›   1get² öð"""Return the typeó	 of the symbol table.

  õThe values retuned are 'class', 'module' and5 µ'function'. 5""" ’if self._n Âtype == _sym ÅTYPE_MODULE:6  ’  „ Brn "v R �FUNCTIONT µ V _CLASSS &P nassertü ù in (1, 2, 3), \ò ð    "unexpected ,ì: {0}".format(J)½¡def get_id" )¡ ñ"""Return an identifier for
ƒ… ¹s *idp Onamer  j` 0's * 	jñis corresponds to�  ' ¥P$, ª¤ ¢or 'top' iÍc 1 isÔ +a 7 5 or: pglobal u �ectively´û   š 
ý olinenoÿ dnumberÒ `first 8 0 inð š QblockÁ 5š  P &noœ ¿is_optimized*True*Dclocals– œ  Q 0 œ  - Aboolï�Àis_nest´ 4Ris a 9 û¸ %or<.« E ’ Áhas_childrenÕ X
I• 4has”  8ospacesÑ
9y � âÃs“ `a listv~  	 ò
â‘ 
÷= g.keys(‘ alookupˆ ,â
!L @ a *‡ *^  Ç!*S˜ * ostance¢ Ssym =Y› @get(f )ÿ x ymFNone ºUflagsD A.J [F ]F  .   Ã3 f_check # {  5 µ@_scoð % .  Z"top"7 Ü  ’ 2 = ç !, Ã vœ ,´  ƒ  À              Ømodule_scope= $)
' ±return sym
 ñdef get_symbols(self):  3 B"""R2 Áa list of *S, õ * instances for3 õnames in the table. 5""" Š [r à.lookup(ident)O    G    £  –ifiers()]¿ ñ__check_childrenÄ  , ˆ Ê o B_newÁ Tœ Q(st, c Q_file5 £    efor st� _Ö p / `if st.K 1 ==ˆ ®  Ê : ª ¤ n F`nestedµ2bolTsUæ ?÷]


class Function(G"):�â# Default valu(P varius3ó __params = None [local Kfree Mglob( :non? T  ã!__>¡s_matching{·, test_func†*Rtuple’‘k  -	 &ifc s .=p[— 2]))? «  ! etê œ� #¢  ’/ 1 tox Ó  ¤& ¡Eelf.‚!isƒø Å  z # =&Iþlambda x:x & DEF_PARAMrq 
î ´ê +  Š æ 6 æ 0loc[Æ(LOCAL, CELL¼   #5 = ç ó ((x >> SCOPE_OFF) & PMASK)�  U 	L‰ L l ~ ‰	< 
:;,  Ÿ <7 =  ó = (GLOBAL_IMPLICIT,  "EX Ô RQ i Q  &PçR	= 
SDU. W9 YÎ & 3Ànts_matchingó(lambda x:x & DEF_NONLOCAL)
  ñ	return self.__nonlocals
! àdef get_frees($ !):  = B"""R= °a tuple of * ø variables in the function.=  $if  > –s is Nonej  n !is† 5 = Õ ó((x >> SCOPE_OFF) & ÕMASK) == FREEh  G  Ä !._K 4s =x óidents_matching(m &§  


class C €(SymbolT÷ "):>€__methodi  Ñ  T V, ” declaredX� U= Wid = {}#`for stc -tÔ š.children– Séd[st.name] = 1K A (/(dY« [UO 9�__init__6 , v r, flags pspaces=n÷, *, module_scope=FalseÁž  E ! =L ½  Z " =b  U B = (& Šð # like PyST_GetSŽ (m  ˆ À Ž  >or - Ù ) =è gc__repr.ù ô1"<sµñ  {0!r}>".format\ Fame)M   £  M     "a Z › ÷ f ßis_referencedk ‘*True* if_m  8!us«Ÿits blockŠ 
Abooll   Mr & _symú7USEÁis_parameter4   %a = ’  ÀZPARAMŽ Rgloba¿ ‹ s¨ ,9 ‡ ïóin (GLOBAL_IMPLICIT,  "EX Ú   Çó	½4and‡IªjBOUND)ë žx: E."""ˆþD,2  4is_ƒ_?‹ A  A \  $cwith a ¯ statement² —$==…ÀEXPLICIT)

 ó	   def is_local(self):
  ñ"""Return *True* if the symbol is 7 .1  r: 2booX õ
.__scope in (LOCAL, CELL)2 v  1or Ž “.__module= @and ¦ ñ.__flags & DEF_BOUND))
L Ó ‘annotatedI × ; Û � ZANNOTŒ Ofree‡ Æa referencedgÖ  ÿ not assigned tož yz== FREEš _impor%"0cre^U from¢ 2an R   s|Oment¦ D[IMPOREú I¥8  25"""¬ ¢ ƒ ¤
-�namespacÌs+ . ð	 binding introduces new  J .´ ÞI^   \qused asrõtarget of a function or classÑ s÷, this will be trueh ñNote that a single� @ can. @boun^õ multiple objects.  Ifm 0is_ª Å  ()±  g  z O ‰may alsoT UotherD Y p, like < nt× @listJ Pat do2&otA  aBD … h2 sÞ6getÐ sc a �  ŠG  3w  h ·  5sú ®	} | |±F |  ëôRaises ValueErrorÃ †  ´º í  Z sQaif len¥ '._3f) != 1= Òr ~  ("^ x "£;‚[0]

if � ò__ == "__main__"… ˆbos, sy%pwith op¿ °ys.argv[0])ef4  µ Òsrc = f.read(‹ Pmod =�÷table(src, os.path.split(sP £[1], "execÊ fx0denÅP mod.ði wifiers(�ainfo =& qlookup() ˆ  Ÿ `print('  ,  .¾)  gÅð())
"""Access to Python's confñiguration inform ô ."""

import os
 ósys
from os.path " Àpardir, real ý

__all__ = [
    'get_config_h_filename', ?var s @makeE J  ‚ -   _o 	C   
 0lat	; Øython_version jschemeW Uparseæ ÷',
]

# Keys for ñvar() that are never converted to Pz ò integers.
_ALWAYS_STR = {9öMACOSX_DEPLOYMENT_TARGET',
}

_INSTALL_SCHEMES8 ãposix_prefix':N ¨ñstdlib': '{installed_base}/{platlibdir}/p  4{pys_short}$L  0 P   J %4ure— C ?lib„ Ô/site-packageä’ H � U ‘include':” h   @( · �{abiflagsE: b Í , f qscriptsøa$biðÎ Fdata æ}ÄSOhomeQÄP 'Ë 6Ž + S ÷P 	<è þ X^  : v//ntn<Lib¶ g$ `?Lib	 º
g/ 
4	IT]‚ ^ 3 `SèX Ú }
Æ`NOTE: Yð
.py has copy of this funcEü.
# Sync it when modify% Àdef _getuser‘"()=1envm  =cñenviron.get("PYTHONUSERBASE", None)s4if 9 G  0ereturn 
* ð# VxWorks has no hoñ!me directories
    if sys.platform == "vxworks":"  & Áreturn None
 ýdef joinuser(*args). áos.path.expand*   ; 7 )Q ¡if os.nameƒ 'nt~ `base =  ñenviron.get("APPDATA") or "~"™ ®  e v  @ ¦, "Python"q ù ±darwin" and`_frameÝ ] û "~", "Library",8 ,•  ™  0f"{€ þversion_info[0]}. 41]}µ ˆ} `.local$ ð_HAS_USER_BASE = (_get ‘() is notÉj)

if 2 ç õ_INSTALL_SCHEMES |= {É ð&# NOTE: When modifying "purelib" scheme, update site.‡ _u() too.N @'nt_  '':c  (À'stdlib': '{!  Á "}/ÄD{py_9`nodot_À*}'n' F 0Ø ‰ /ô Ÿ-packages— Ú Q include¢ I4 3scriptsK S4 K JdataH 	}1 o'posix	{Ý‘libdir}/pÚ_shortN #?lib� ÇÒ 
4/P ' ¤ ¥'<bin) ð6osx]ø€  ?î3 Â°+> ˆî ž8À      'data'÷: '{userbase}',
  } ÷}

_SCHEME_KEYS = ('stdlib', 'plat 7ure  {include_  j €'scriptsJ ødata')

_PY_VERSION = sys.version.split()[0]% Ç_SHORT = f'{. ®_info[0]}. N1]}'C o_NO_DOJ I ðREFIX = os.path.norm	 (� ÿ prefix)
_BASE_P, 
 ‡_1 OEXEC1 Fexec1 b 6 g 
;  CONFIG_VARâ¡None
_USER¶ 1 =  ðF
# Regexes needed for parsing Makefile (and similar syntaxes,
# like old-style Setup 3 ós).
_variable_rx = r"([a-zA-Z] ô0-9_]+)\s*=\s*(.*)"
_findvar15 Ó\$\(([A-Za-z] 9 7*)\0 20 {/ ñ}"


def _safe_realÔ  !):*2try	  Ìzreturn ( ' íexcept OSError2  Q A

ifì – ut( „_PROJECTˆc‹dirname(�  qC r))
elseJ #` ð can be empty if argv[0] has been changed Ï‘Python isÒ @# un¤ ñ to retrieve theþ � program ¡ / _Å µ Áos.getcwd())	ð(os.name == 'nt'‚ I ð.lower().endswith(('\\pcbuild\\win32Y ƒamd64'))À_˜  œi.join(, ,õ4dir  ¸ Q# setacross ‡ sØ‰"_PYTHONC @" in1renviron¤	" , ={3os./ [T #])³Ais_p²Ó_source_dir(d÷  µ fn€ !("„2", 	 s.local"(  Ö if¥  is« œ ôd, "Modules", fnZ ;   rATrueÁ àFalse

_sys_hoé€ getattr31, ' !',w0ŸCfix_öã  | 2if ¼4 —Òcase(d).start6™  1  0  ó ’Q, "PCä"PA æ * `  d ëÇ 	 )0 ,_,  üûž a(checkP=wÐ):
    if cheñck_home and _sys 3:
  õreturn _is_python_source_dir(0 )0 , öPROJECT_BASE)

_PYTHON_BUILD = a ùbuild(True)

if * š ófor scheme in ('posix_prefix',   Ø "')2  Ï ñ
# On POSIX-y platforms, PÙ X will- 0- BŠ à from .h filesp ñ'headers' (which is only added to thev  ¬ Qwhen ß Ring Cx <* –- Installp Åto 'include'T ü ò= _INSTALL_SCHEMES[ ]* [³ 3] =Ž [W . q  . ¿'{srcdir}/I‡  ['L
3 ñprojectbase}/.'


def _subst_vars(s, local ¥6try�N s.¦Wat(**0 à öexcept KeyError as varB 	O  aS ¦os.environ‡W P C áaise Attributey ¢(f'{var}'),CNoneñ ñextend_dict(target q, other ü  wkeys = , . (Ÿ  ø‘key, valuüH s.items(O  ¬ `if key²O  J 
Ï vcontinu®*  ± @[keyl Âaexpandµ(l � #rsw  re¾ !{}  if�s z  3 = ' _%   , (bconfigj 1))
R  Yos.na4 -(nt% 9ò ² = os.path.õ Quser( � * 4res'- @norm6 (î7 *> Œ4res[ õ  Ãberred_]Ð ifŽ ¾ v== 'nt'OK {# –   'K Aix':- , :("  í < _  Ü@sys.ú   • qdarwin'K  ¯_framework¬ 
Ê¶ %6osx} Á 51… '7
'(U 6}âáC(key<òO = _) 1s()j#ifÅ@ notáq±V0­ð 
            f"ò#{key!r} returned {scheme!r}, which is not a valid   G "
  öf"on this platform  )* a > ò


def get_default_W 8():.  ! ”preferred# ' Cix')F ð_parse_makefile( óname, vars=None, keep_unresolved=Truel @"""PB C a MD p-style J !.
‘ ð	A dictionary containing i À/value pairs.ë ¡ed.  If anA !op> lH  /ñassed in as the second argument, it isC u* çstead of a newP .& """{’import reÁ !if    g Â %Q = {}> Fdone 6not   —with opengðencoding=sys.get7dsystem 1(),>  p  ð
errors="surrogateescape")fž álines = f.read "()Ò @for   =  s6 !if p.starts´ c('#') 2 æ.strip() == ''7  ›  ÜEinue° ñm = re.match(_variable_rx,d Þ : Jif mL ön, v = m.group(1, 2/  3   vŽ r   `# `$$'®°a literal `  n é	, 2tmpI ð replace('$$', '" L  `if "$"/ 2 
«  $ îy[n] = vc Nelse1 >try  J @if nh ¿_ALWAYS_STR)  - praise VDEÞ    â Zint(vB # gexceptB l ˆ# insertP	å  L    ó.S/$'  I Õ @# do‡C  interpolaB heruc ÷Slist(˜s.keys()þ3# V‹ s á’ a 'PY_'  ~ O - �ñ . These need toø ð # be made avail×K „out thatK òthrough sysconfigià# Special care« ] _ r ensureF Ð ò expansion works, eveA# ifþ# 2use b— a” ‚  re d• 2€('CFLAGS%LD 2CPP ?¤while len(Ÿ fs) > 0; _ _ JGuple* &  çÿ=&;Aame]b    1m1 E@searF�findvar1F? 
W/m20 20  {Š1 and m2œ ~  „1cðm1.start() < m2.st÷ art() else m2
    :   �m = m1 if  # 7   Î is not NoneC nC �.group(1)b Ífound = True Ÿif n in dZ  ¡ 0ite¤ @str(% >[n]c $elH 0not& ¥  K ð# get it on a subsequent r£ œ  3 ½ NFals¾ x ¯os.environ{  doz ó	like make: fall back to = Omentˆ g M[n]
* � ÿrenamed_variables— @if () ý.startswith('PY_') and`     3 @[3:]ºj )k  8 Æ .""»   ¿  " +Ï
 3 
 ±  Õ“ _ .])¥ K  uo[n] = ä 1if ° Ž ÿafter = value[m.end():]Ô $ , ":mÀR()] +� !+ O = `if "$"¼$ Ž  ]~[ï Û v S  H ?trye  !  ¾0ame“ ¿_ALWAYS_STR4  8 praise V1_Errorœ  )   ¾  ¡1nt( H '   gexceptY ‹ ý5ame%.strip(b /lsJ  |  U Þ åq.removeÓ¿ [ o5	õ\d @and ÷:/p    < % =C h  ,   s
 -  0 	e £õ# Adds unresolved M —1the›i dict.P  x `# This0disgýd when called from distutils.sysconfigH †if keep_‡ qä  ð                û+# bogus variable reference (e.g. "prefix=$/opt/python");
  ð# just drop it siC Ýwe can't deal3 t ñ s.remove(name)
( ñ# strip spurious spaces ñ
for k, v in done.items():  ˜ ðif isinstance(v,M   #  9 �[k] = v.k (z `ave thPsultsh   ñglobal dictionaryp Àvars.update(U ) `returnWðs


def get_makefile_  î µ B"""R2  i qpath of„ M3 A."""Z öif _PYTHON_BUILDö t 0os.A ô.join(_sys_home or _PROJECT_BASE, "\ "´ ÷if hasattr(sys, 'abiflags'<òconfig_dir_name = f' ô
-{_PY_VERSION_SHORT}{sys.G !}'Á Felseµ < P O - 
” °.implementaƒß, '_multiarch¥ 	+¦ -� 
B .@ ž E » SË('stdlib'), ¸ 4, 'N#')ò_8 2sys+ Adata3ôº   =xä 
B, ''­¨ Áenviron.get(a ß'$õSYSCONFIGDATA_NAME',&  f'   #°_ µplatform}_{³ }E ë Ðnerate_posix_è R"""Ge ÒPDp moduleHðtaining build-time8�s÷Ámport pprintÁ  d Q = {} a# loada ùTlled “o~p�J 2try0  He_parse, (D ,£ s‹÷except OSError as à0msg$“"invalid þ ¤ ÇA: un|”to open {f }ó ‰ 	€e, "stren "› ' o �{msg} ({eÝ* &})M Traise± B(msgÉ D"py ".h #_hF ÓF wiÑDpen(/ ð, encoding="utf-8")9fd  Ê   }4 /(fvKh v^pOn AIX,½Ðre are wrong t@s to Ö linker scrip”ât@# --, #se;  K „relativeH àPython source,ñ0 but when installed
    # the scripts are in another directory., ñif _PYTHON_BUILD:  F òvars['BLDSHARED'] =   
. ð.# There's a chicken-and-egg situation on OS X with regards to¬ F ð_sysconfigdata module after& ò changes introduced by #15298¸ b# get_D _­ q() is c -   ðplatform() as part ofa ‡ ð`make pybuilddir.txt` target -- whichW ¿a precursorÉ 	4.pyÌ óbeing constructed.  Unfortunately,„  ¨ 
Ç ¡eventuallyÏ ós _init_posix(),– ƒattemptsG ªto import \/ àwe won't have ñ ót yet.  In orderI :forq  ñ àwork, if we'reá÷Darwin, just mock upZ
… 2manØ ò and populate it* Ë ™ d}.� @Thisƒðmore than sufficient ­ Pensurm @ psubsequ  3 toG  g‚succeedsf €name = _% 	š_ !()D Qif 'dö 'fDsys.Q “ K„Btypeš  mß!=  !.M PType(_ ^ ( .Q_timeÙ�„  &  y R  s[@  ® ¤ÏQ = f'N `/lib.{ß ³ ñ	()}-{_PY_VERSION_SHORT}'g öif hasattr(sys, "gettotalrefcount")ó p Â+= '-pydebugJ 0os.dVdirs() ò , exist_ok=Truepdestfil‰Éos.path.join7  ð ’ + '.py')ï eTopen(A ñ, 'w', encoding='utf8'f· ðf.write('# system­RfigurÅ generated ­!usƒÕ  † 'õ B Äê2\n'Õ  ' j ‹	Ù& rpprint. (Ò£, stream=fë P# Cre2'“    /` fixup¸Bsee fPs/get !.cÚ.'� ÷'6= i)

def3 ½ !À"""Initializ¿e! ��appropriÒ €or POSIXK�tems."""² #Ñ œtÌ d / , ù _ 2DÃ?è_X _Í!__§�, globalsƒ3loc
 [aÖR'], 0ýð\ áç  4‚.update(8 Àtime_vars)

ðBdef _init_non_posix(vars):
    """Initialize the module as appropriate for NT"""
6 ñ# set basic install directoriesZ ±import _imp  u ÷['LIBDEST'] = get_path('stdlib')) ?BIN, Oplat0  ›INCLUDEPY[ yinclude\ ¡EXT_SUFFIX-  £ ÷	.extension_suffixes()[0]’ 1EXE/ g'.exe' qVERSION C_PY_ ×_SHORT_NO_DOT/ aBINDIR. 0os.ð.dirname(_safe_real @(sysl ˆcutable)aTZPATHE ð	''

#
# public APIs
#


úðparse_config_h(fp, ˆV=NoneP& 2 a ( ñ .h-style file.
º ÀA dictionary' €taining ¶ ñ/value pairs is returned.  If anA !op>  'H Àis passed inp ~òsecond argument, it iQu* çstead of a new˜ .i £!ifê  ‘  í î ¼  Q = {}/ ¦!re ò
define_rx = re.compile("# p ([A-Z] òa-z0-9_]+) (.*)\n"ž^undefA a/[*] # E A[*]/E ˆ ¦while True¸ àline = fp.read (s  Õ pif not  2   QbreakT   Bm = Ë  _rx.match(4 	I mB ön, v = m.group(1, 2/  U :try2    ‘  ×¾_ALWAYS_STR%  ) praise VCUError¬      } Zint(vv gexcept9 _  ]	O  û [n{v 7else q  %ª$ % ;if (  a *)j 0j ’š ýp0_h_j K(”RF’  ñ"py1 7.h.æÖ_PYTHON_BUILD`if os.U † == "nt"  « �inc_dir ='  b ó.join(_sys_home or _PROJECT_BASE, "PCæ A 9S F 
; 7   ‹  ('å
ºB2­ : 6, ''')a scheme_namÏ3"""\xa tupleÐƒ5 sÜsj€ 2 ø
(sorted(_INSTALL_SCHEMES)|  É z  3 x c W_KEYSá 2 (ç =?ðdefault_scheme(),ð* vars=None, expand=True):
    """Return a mapping contain ñan install scheme.
7 "`` ›`` is the' ñ name. If not provided, it willD rx  = sdefaultd A forT ñcurrent platform.8 1""" #ifÐ Ê  Î S _è _ú (© ,)9 Nelse4 òINSTALL_SCHEMES[8 ð]


def get_path(Ù ,© = ¼ _0 "()j q Q ° correspondq!toú M mÛ 	    e s )[Í â bconfig8V*args&óWith no arguments, e ða dictionary of -I 0ura š ÿvariables relevantç2 ð
On Unix, this means everyËL ô defined in Python's‰Äed Makefile;O ÀWindows it'sðó uch smaller setoê ç @listá Pvalueö`at res¹�from lookÄ!upq Eeach/ £  ê	É B
äñglobal _CONFIG_VARS\ )if  … âÖ2 Q = {}7  $ð# Normalized versions× ôprefix and exec_ ó re handy to havOK pin fact¤rese are¿gtandar` �used mosÍ ce§ * – ’Distutils ` Å "['� Å'] = _PREFIX> 
) ¾ . OEXEC3 3py_2 ¯PY_VERSIONd 1 l_short7 o_SHORT= Onodo= o_NO_DOD —red_base OBASEè , B
]  {5 a N6lat5 0 Wrojec3 €PROJECT_p D‘latlibdirü @sys.¬  4 6tryS…abiflagsC  A úexcept AttributeErrorS  # } : A mayõ%beŸ!on    Çâ“ %''‰ Ê �ð nodot_plat'] = ósys.winver.replace('.', '')
  õexcept AttributeError:  & õ_CONFIG_VARS['py_version_nodot_plat'] = ''
8 ûif os.name == 'nt'T ø init_non_posix(d � F + I  E õ# For backward compatibility, see issue19555À XSO = • ÷.get('EXT_SUFFIXCûif SO is not Noneë 	?!SO,%SOk úif _HAS_USER_BASE? ð# Setting 'userbase'm ðdone below the call to Z  ½ # j� function# ‘enable usU ûget_config_var' in@  ^  D -D .! %[£  D_get´ &()°# Always co�€t srcdirœ õan absolute pathk # • ±', _PROJECTFF „ÊPYTHON_BUILDƒH$If¨ Âis a relativ§ ` (typi„Çy '.' or '..$ C   #¡ön it should be interpretedV Ë¥ directory	 F   #>@tainÆŠMakefile› '  0  =� O�.dirname(öm5 _:  )5 <   ]B Pjoin(V ,
4 ;els  F #,  ¹ &0mea¸ �ful sincep instalV_on isò  Áspread about3  º ñsystem.  We choosN >  L: Þ>Œ ¯we know itE  nexistsh(j
AH $ _safe_real»( 	GPOS X €ôforms require special customizaúehandleÖ ó# multi-architecture, 3os-ç˜&er“0if ]{ äkdarwinŸð import _osx_sup    .° e‘sÖ> vif args¦‘vals = []  Y @for Ô; in,    0 y.append` æ 7 
preturn 3 ^ 
â Åp


def cY(V ² B"""RU  ~ value of a€‡gle vari£ % !di¿Bary r Bed b'i Àrs()'.

    ñ"Equivalent to get_config_vars().get(name)
    """ 0if  ‘ == 'SO':  ! õ import warnings  .	 ó('SO is deprecated, use EXT_SUFFIX', D BionWN 2, 2† oreturn­ 
Q

def" ¢platform()¦ B"""R@ ða string that identifies the curr? !.
Ì @This» °used mainly8Ädistinguish 2 ð	-specific build directorb 1andO ,  t P óributions.  Typically includ¥ "OS‡O ±version andÅ ðarchitecture (as supplied by 'os.uÆà()'), although9 œ €exact in=a‰ | d¹pends on. @ OS; aLinux, skernel � O ðisn't particularÌ -3ant]ÂExamples of ä’ed values¼@   le Q-i586V  ‚alpha (?"ò   solaris-2.6-sun4uÁÃWindows wille u one ofc ôwin-amd64 (64bit 4 `on AMD ðaka x86_64, Intel	 ¥EM64T, etc… ôwin32 (all others -  Ïd, sys. Yø )¯ 2For: ¥ non-POSIXa$s,¦sly justÐ 8s 'V '^¼0os.ù¿(nt¿1f 'û A' inœ Ãd.lowerD ê  ­ % '2'•¯ if '(arm)J  Nrm32J /64L #&64L ± h4if ñ!= "posix" or not hasattr(os, '3'M p# XXX wDQaboutz@? NTÛ) T A¬*” ò # Set for crossGÁs explicitlyC ðif "_PYTHON_HOST_PLATFORM"Ã¥os.environß& ð  [A ]M# Træñ various flavour´AUnix”  os_ó, host, release, L°, machine =… Q(ð‚# ConverFà1to €cG òremove '/' characters,õ�ranslate‡  # spaces (E "PÃ² Macintosh"¦¬ ‹  µ éò.replace('/', ''- ¹ 
 '  ' _( O #-'ð x x @[:5]�"á"®P# At Atd/J3, '… '^ µÁprocessor -- Ai386˜. À   # XXX whaót about Alpha, SPARC, etc?
  ñreturn  f"{osname}-{machine}"& Relif  ñ[:5] == "sunos":   I ðif release[0] >= "5":  �# SunOS 5> •Solaris 2?  & b  ]   ~     _   =ª Cint( ´[0]) - 3}.{ 32:]»  9   ð!# We can't use "platform.architecture()[0]" beca% až ð# bootstrap problem.U * û dict to get an error? ùif some suspicious happens.* ð'bitness = {2147483647:"32bit", 9223372036854775807:"64 }H Ä  +1#.{W È[sys.maxsize%à# fall throughË ƒstandardú-]-X árepresentation{ 	)3)7aix'ñfrom _aix_support im   •L  ¶› !() 	j 6j gcygwinm Q ;  Y u %re òrel_re = re.compile(r'[\d.]+'t  9 m"  + d.match…" Fif m 4 9¯ = m.groupÄ :darÄ ª 5_os3´ à ,y$, ›(= 0 T.get_\  (B  Ÿ   > ïconfig_vars(),? ¥ !)
G ã}0	‡P

def^ò_python_version()lG ò_PY_VERSION_SHORT
9 ò expand_makefileÉ 0s, Ñ B A"""E& # M& `-style$ ðiables -- "${foo}" or "$(foo)" ið'string' accordingJ'g A' (a'°ionary mapp  1var_  {As to³values).  V  cs not sC in V Òare silently è  edv "thÞbempty ™ V.  ThÓ  g N ashouldk âcontain furtheÎ­ i  �Ts; ifŒ õis the output of 'parsex2()'=ñ you're fine.  R‚5s al-` Cded èM "s'*""""reKò# This algorithm does multiple ³ @, soµ  –ƒ['foo'] í s}#çâbar}", it will> "d ÿ _ ${" P, andõ n" A  1...  �so forthQis isû € as long Î`comes &I B à which takes c rof suchƒ Ðsions eagerlyñ+,
    # according to make's variable expansion semantics.
9 ±while True:  M ÿm = re.search(_findvar1_rx, s) or  2 E Fif mS  W õ(beg, end) = m.span()0  " às = s[0:beg] +¿ õs.get(m.group(1)) + s[end:]: 7els½  H Qbreak  òreturn s


def _print_dict(title, data)© ðfor index, (key, value) in enumerate(sorted(7 “.items())@  { "ifC R == 0W     | A(f'{z F}: 'þ  Á\t{key} = "{~ D}"')½ Smain(l ñ"""Display all informatãñysconfig detains."""‘if '--genË À-posix-vars'ä †sys.argv¶ _+ _+ _+ ³]Z À @PlatŠ “: "{get_p !()É  Python ver™1  _ 7  ó Current installó TchemeD ‘default_s D v‘'Paths', ³   "()& Ø  	2 V[6 r" ²°if __name__0'__¿2__'_ ñ()
#! /usr/bin/env p ñ3

"""The Tab Nanny despises ambiguousj!ntñ.  She knows no mercy.

tabn? �-- Detec#/ofF ñ

For the time bePÀhis module iu `tendedhðbe called as a script.
However it1 Ppossi†‘to import ñnto an IDE and usey 1fun¤ €
check()ø ð	cribed below.

Warning: !�API provi“ Jby t® `likely¬ `changeéòfuture
releases; such   ðs may not be backward compatÅ .™R

# R>  1�public doçð, by Tim Peters, 15 April 1998.@ ’XXX Note:² i¶wD@tandt slibraryz@.
# 3 ó Pneeds× uundergo¿ h|;Mc-1cod¼3tooH «-@.  T5@willö ôaddressed later.

_� Ìc "6"

É$os
 %sy ±tokenize
ifJ„hasattr( c, 'NL'Épraise VjtError("' ô.NL doesn't exist --    too old")¦ 1all¢ !["=A", "<0Nag �process_D ñs"]

verbose = 0
file°Aonly 32errS*argsµ 0sep£V 70argZ # à ê Q stderr.wri< epÀctr(argb) O  P 7 0"\nà  Á ]à():
    importñ getopt

    global verbose, filename_only" Atry:	  / Ãopts, args =H .O ñ(sys.argv[1:], "qv")7 dexcept- Æerror as msgW Âerrprint(msg6  m areturnE Àfor o, a in „ ; Æif o == '-q'  ? 	Ë * =Û A + 1Z  * D vD $ ="8 aif notw È ¥"Usage:", 0A[-v]‰ ó_or_directory .... � ø 0arg÷  uj ñcheck(arg)

class NannyNag(EqBion)/ 1"""ê ñ-Raised by process_tokens() if detecting an ambiguous indent.A ðCaptured and handledš Œ )% n ðdef __init__(self, lineno,û ¡  ô  " .!  Qmsg, 
   . =? •  h @get_% !noj W KG )no5 ?msg2 	9msg/  d 0 	    

’  ‚� 6""" ý)ƒ(Iff is a  li� symbolic	ók, then recursive­pdescend D Ptree Öþ – ‚ !, • öall .py‹ sö QalongJ _way. §  ñ	n ordinary Python sourceE b, it iK f 0ed Çðwhitespace related�ð
blems. The diagnostic mesHQs are” ðwritten to standard output usÇ Athe K   5tem½ ˜C  íÐs.path.isdir()Ô ho Blink H §$if	   s ‘("%r: lisGÃA" % H &,)Ü Ž D0os.1 ˆ £  R  + %  a  sq @full 4 = ² Bjoinh ìl  O Dif () ÷ B û w  ,   1 -or0 \ �normcase(� `[-3:])žS".py" _  (Í ³ rûg 	�Af = ·rize.opeò 9 j?OSEe§AI/O ( F: %s£ �§ˆ üF > 1�üË  ƒ!%rÐ! %å	Å €Ð „generate™`f.readV)G ã 2 TÂÇ Tð"%r: Token Erroró: %s" % (file, msg))
  qreturn
 ðexcept IndentationError as5 :$  7 Øerrprint("%r:/  0 p €NannyNagh 6nagh ðbadline = nag.get_ 6no(¿      ¦if verboseU  Á ¾ P*** Le ÷%d: trouble in tab city! ***>” BQ  offending ˜ A: %r:   ,2 Ø Gmsg(! ,el² `if ' '™  Å :  ‚ = '"' + + £ • !if ²name_only: ø  < B * p  #, ç p, repr(Á Ÿ 4vfinally`’f.close()Tƒ‡ =ñClean bill of health.5 ¦  5ó
class WhitespacËñ# the characters used for % @ andÄ@S, T-B \t'– ’# members¸ q#   raw-     _ @origà u string  n
 *  nuO  Ä 1leaw± ¦ )ini /ntJ @tabsòuraw[:n]* Enorm � PormalmHõa pair (count, trailing), wherD > !  % 	R   ða tuple such thatº  ‰ ’ contains9 &[i›  8   �instances™S * i + Tc “ 	  <  yO' × 5 âIt's A Theorem¯ 1m.iÊÉ_level(t) ==n n!  @ðall t >= 1 iff m.pQ == n
 .C •is_simple  Š Atrue9 ·! i Ö Ãform (T*)(S*òdef __init__(self, ws)– N   ¡.raw  = wsi   Ò7.S,#.k * ÜB = [¥  b1  Ut = 0T  ü  chqu ‡  7 Pif chS   nO E + 1N      m b %elN TN n³ -ntP  j @if b·2len÷G     Ö+ [0] * (b - ;  b 
$ ? 3 S[b] =û b]) õ Y : b( Ereak wn. "= b    t /  Q=¨ô ð, b
        self.isð_simple = len(count) <= 1

    # return ðgth of longest contiguous run óspaces (whether or notH ñpreceding a tab) %deP ‚_run_of_E q(self):%  ˆ ™ p, trailD  = ! U.norm$ ª Fmax(Ì &-16 )Ô  u Áindent_levell ,• Gsizeu ## w ?il q ÷# for i in rangew 	F R   ifL 6[i]Õ #Ú   ` Àil + (i//tab‰ d + 1)* *@ ð œ"ilÙ  K ˜# quickerg ` <R+ sumj se !s*ê W[i] =` 3 Mts *8 5  Ö d +Í o 
 [(© 
< )%  | )³ D @num_\]ï 0and±ze that x ö is 0 when i < tssŠ f+‚0l 8 ‰ @ize,f„A ×@ " — ! ¹- (@ 8tD‚true iffX	pt) == oÓ. Ñ pall t >: ±  eDequa^? Õ © Ž 6ormc ÔY & `a listc@tuplcñts, i1, i2) such³5  i1M Z 
¯ Os) !É sã 3i2.C ñ	Intended to be used afteÑ#Ý ×  `known,SwhichI Äcase it willK`at leaÐ  ne witnessÔ@tab ù…  AAnot_h _' «v â@n = ÷ô  P!),’  › F ./  h13 Va = [+ ¿ tsì øg1, n+1Þ c iL„	Ñ  @   Þa.append( (tsÂ  #  û ï2 
ÿ 3 ") š W ~ë2# RT+
<*êð # The algorithmM0due{äVincent Broman. @Easy @prov]¤'s correct" qXXXpost ðTrivial to prove n is sð harp (consider T vs ST).
    # Unknown whether  óe's a faster general way.  I suspected so atG ôfirst, but no longerc !FoW  8 Pial (& Ðcommon!) case~ ðre M and N are both of� c ñorm (T*)(S*), M.less(N) iff  n() < N.le
 3and9  M.num_tabs! 7= N ñ . Proof is easyÁ QkindaÄ t-windedÉ ôXXXwrite that up $No MI ¶ ( f° ¥  ™ ò M.norm[0]) <= 1C Adef Î pself, o…!):¿  ¦0if  R.n >= &.n  " Íreturn False7 ‘is_simple_] . H n t¢ / nè k �n = max($ éõst_run_of_spaces(),„  2   G / U) + 13 #ôñ ð test already did itdF ts== fl÷s in range(2, n+1L � P ÝÆnt_level(ts)_ 
& D r QTrue
Ð ##  aa listÑñuples (ts, i1, i2) suchU5 Ri1 ==Š ¤  3 "i2Q`# Inte¼à to be used afÑ2not[ r™)·,;Swhich‹ Ÿuit willÍ Pt leaÏ òne witnessing tab size„  Õ no_3ss_& 6áTNaa = []Ó  ½&1&E‘a.append(ð€  „  OíH6 º.3 5) )g | 

Œ �$atŠCes(w¼Ás = (str(tupž$!upS Åprefix = "atì"n iÀ†n(w) > 1-2 	 B+ "s1 ›  ò  " + ', '.join(” )º ò process_tokens( ½ ‘INDENT =   } — ,DE   xNEWLINE;   HJUNK †COMMENT,i !NL) ‚ @a[WhiteB("")pò check_equal = 0 ]S(typeO ð, start, end, line)yÔ sP0if 5  ê«   ð# a program statemen÷t, or ENDMARKER, will eventually follow,
  ñ# after some (possibly empty) run of tokens
 {he formD  Q ð(NL | COMMENT)* (INDENT | DE	 ;+)?6 cIf an ' ñappears, setting check_equal is wrong, andØ K ó
be undone when we see the_ .0 [ E= 1
 Ãelif type ==: :  å 
: 0 ñthisguy = Whitespace(;)( ó	if not indents[-1].less(@ )r  v ™witness =5 @not_9 _ A 	n  @ rmsg = "r } @grea÷�e.g. " +Õ$atK 3es(U 
»  M úraise NannyNag(start[0], msg, line4 v  s.á&nd¥ ¦ 	u,
#É@re's» h¢we need to'õ here!  what's important isg  ¼  J "at$ àu ps ends,m hBatio+heH øprogram statement (}à) that triggerª !heN‘ á$to¼ Pleft ; dhe topuF p &ck±Õ õOuch!  This asserz  s Ñqhe last�Q \sourcÖ #isú ðed *and* lacks a newÛ0 -- nÔ0s p£ +ut 4zhin airz#  Iñ # else no earlier NEWLINEÒ%an ,	m I 	Ì 3delÑ h8t;  Xù›^ JUNK†  sÂ first "real"_ ŸaÀ Lso ibmust bŸH &š]next `	ü #î;– "¤a" argu”bexpose² @lead� w�L @for „ dÔA; inX @caseŸ ] j  ˜ ž -M @stri°!so¯ Ð ±perly matchU d ) ’ with whi M º s"› `ck wasà9ded) Ð/= � Ä ­œ¡·
 d)� : SB 	³  A ž9  œÀ            ÿZ   raise NannyNag(start[0], msg, line)


if __name__ == '__main__':
    main()
#!/usr/bin/env python3
#-- .ß
# tarfile.pyR 5ôCopyright (C) 2002 Lars Gustaebel <lars@g ±.de>
# All 8 ðVs reserved.
#
# Permission  is  hereby granted,  free  of charge,  to  any person
# obtaining a  copy/ à this software2 ñ	d associated documentatiD  (³s  (the  "S7 2"),p ± deal  in  " ! À   without
#Ú @tricR ,, ucluding# R limir G  Ò puse,
# ¿ Á, modify, meó ðpublish, distribute, s òcense, and/or sellD 1ies5
® , o px2t  Esæ @whom2 6
# á  –’furnished( €do  so, „ Bject ‘followingˆ 0ndi!s:ì‘The aboveæ ü €  noticeÂ ² ’  àshall  be
# inV ed‹  0copì  ý áubstantial porx  	 — Î tðhTHE SOFTWARE IS PROVIDED "AS  IS", WITHOUT WARRANTY OF ANY  KIND,
# EXPRESS OR IMPLIED, INCLUDING  BUT NOT LIMITED TO  w P PIES
#T ðf MERCHANTABILITY,  FITNESS   FOR  A  PARTICULAR   PURPOSE  AND
# NONINFRINGEMENT.  IN  NO  EVENT SHALL  THE  AUTHORS µ òCOPYRIGHT
# HOLDERS  BE LIABLE| ñ ÒCLAIM, DAMAGE< aOTHER + µ b
# WHE ÑIN AN  ACTIONã ð CONTRACT, TORT ~ B ðWISE,  ARISING
# FROM, w OF& ‚IN CONNEK  “È »!OR `USE ORP‚ ±DEALINGS IN /  üÁ"""Read froms€write to+ò format archives.
"""

verŸñ   = "0.9.0"
__author__ `\u00e4	(	)7 pcredits! "7Àvo Niemeyer,
 lOJ @, Riý×d Townsend."
ÑP
# Imòs ã ¡builtins i! à open as bltn_ 
 4sys o
 $io eshutil 4tat Dtime Ustruc  Ê �re

try:ûs £pwd
except¿ RError# ­pwd = None7 ?grp7 4grp7  ðs.symlink on Windows priorò26.0Ë s NotImple!edˆ 
; ð_exception = (AtñtributeError, NotImplemented ñ )
try:
    # OS ` (wine3 ð"=1314) will be raised if the caller does not hold M ôSeCreateSymbolicLinkPrivilege p
 . ósymlink_exception += (� 2,)
 B NamË ± ð%pass

# from tarfile import *
__all__ = ["TarFile",  @Info 3is_6   1Tarþ   2Rea!",   õ    "Compression, eStream uExtract THeadeZ 	M €ENCODINGq ÀUSTAR_FORMAT 7GNU 5PAX 	C uDEFAULT Ï "open"]

#- % 
#L¯ constantsK )³NUL = b"\0"C
 #0� null cha8úer
BLOCKSIZE = 5122 ¨àlength of proc�óng blocks
RECORD? K A* 20J &# > €records
nQMAGIC­ wustar  ´ ±# magic gnuÛstring
POSIX_9 R\x000ï 7 Xposix9 °
LENGTH_NAMå "10›     : Wximum­  a àDname? LINK = ?  b? `PREFIXA !55v  ~  ñðprefix field

REGTYPÀ "b"ð @  ‘# regular¸ (
A0 \-  ~	/ 5LNK^ 1=  # Ï € (inside] U)
SYM8 28 s�A E
CHR0 30 ™ö special device
BL£ 4; “7 &DIr 57 ådirectory
FIFOŸ 6- l# fifob ECONT6 76 ¢contiguous�  2 S_LONG–6b"L; P# GNUfQ longF5GNU3 Š?b"K3  ®f RSPARS:S1  f csparse� 0XHDj �x0 <!# Šñ.1-2001 extended h{E
XGL? g? dglobal= ˆSOLARIS_„ XE �# Solarisw 
Ô< = ä · a1988 (x€) format,× ¢ê  ’1 %ÀT = 2         ó!# POSIX.1-2001 (pax) format
DEFAULT_FORMAT = PAX O

#- %ÿ
# tarfile constantsO +FL ¥types that_ ðsupports:
SUPPORTED_TYPES = (REG 5, A
 1LNK 
 
 1SYM B DIR	 AFIFO
 / ACONT 3 CH0 /BL^ 0GNU. ¸_LONGNAME,  _LINK,f % ¼SPARSE)

# ðwill be treated as a regular …Ÿ.
REGULAR	} á … ð are part of theÝ  ¥iV.
GNU~ P 1 	òelds from a pax header ñoverride a TarInfo attribute.
æAIELD'Ô"path", "link @size lmtime"›@"uid g 0una% 1 "g	 ¦  	 /Paffec±Òby hdrcharsetž  "$_F£ {£ v }v /in  t ðnumbers, all othe" 3 0
#   Dsstrings� WUMBER’ /!"ar: float%/"c  F
(  CD: in8  L ‚ 
Û Œ%ÿ-
# initializationŠ)`if os.æ‘ == "nt":
ýENCODING = "utf-8"
else psys.get–ð systemencoding(5ä )ðSome useful funcê u*ô
def stn(s, length, ® ’, errors)á Ò"""Convert a 8ñ to a null-termin›Ñbytes object.91""" as = s.` !e( 5ingg # ¢return s[:� R] + (   -£ ±(s)) * NUL
½ 0nts½ N µ  © 	Ë × 
µ pµ ±find(b"\0")¨ ¢if p != -1i  aß A[:p]" Ê o.decodð À /i(cÆb fieldž ðpython number.
 ó6   """
    # There are two possible encodings for a number field, see? Áitn() below. ñif s[0] in (0o200, 0o377):  u Un = 0  ` i/ ÷range(len(s) - 12 6 U<<= 88  µ+= s[i + 1] ƒ "=={ z 4 ¸= -(256 ** o Q - n)E Felse5 6try  B òs = nts(s, "ascii", "strict"A  &    ê `int(s. Öp() or "0", 8) úexcept ValueErrorn ñraise InvalidHeader& 2("i ! h { àreturn n

def ŸÀn, digits=8,Îómat=DEFAULT_FORMATjô"""Convert a pythonø+toíGóPOSIX 1003.1-1988 requiresC cs to bY€ed as a Qng ofws# octal® Á followed by} ð ll-byte, this a 0s v6ss up toE R(8**(ò ô -1))-1. GNU tar5 ustoringš Ãgreater thanE ð	that if necessary. A lea Ø ËÚ – ‘ indicatež E ¥particularP ¾ eÛ  ƒ ¨ E sˆ¥a big-endiŽ Pbase-³ÿrepresentation. T á– AÀ 	·  Žƒpositive2, a@œ  ƒ0ega  H 	�original_òD 
  üTÑif 0 <= n < 8{û ê \ ™ ³s("%0*o" % Ì ) E, n)uq) + NULŽ CelifÜ0 ==ðÛQ and ; îs Œ  V € V >= 0  ×¥ qarray([]Ñ	?1 73771  #  /Œ ¦ +Å    &# &ò s.insert(1, n &Á›  K Dn >>I
êk‰ ("overflow ð1")
xnsn÷calc_chksums(bufX al`e chec%  ²P a me\#'sÉ ð@summ up´k ã   characters 5  thR P  Ÿ± which is tØlicñ   it was filled with spaces. Accorâ0to W 8„sources,‰ @someQas (Sund`NeXT)  ul` Qigned¿ C ¥ @will�differentt“ ñ s| �  bu$ R ˆ   ÷high bit set. So we‡  Õðchecksums, unsig’ned and
  qsigned. 1""" "un ñ+_chksum = 256 + sum(struct.unpack_from("148B8x356B", buf))G E bE bE {return “ ), ] ñ+

def copyfileobj(src, dst, length=None, exception=OSError° Asize! !):¹ s"""Copy; p bytes ë  _ u src to 2dstBT   If8 2is v  ™ ó the entire conten3 u0bufˆ   =B
 Áor 16 * 1024˜ i[ B== 0¬  Æ$# ~ & pshutil.� Ç &~ ¹T U òblocks, remainder = divmod(^F@ ò for b in range(? \ \ Pbuf =Dm.read(| è   4) <É  C VraiseÏò
("unexpected end of data"‘  2  ¤QwriteX 
Ù 'ifÔ !T¤ û Q 
¦ ! ¨ < » àåÓ_safe_print(sTôencoding = getattr(sys.stdout, '  !',‘Ã 4if  q is not ¿ s¤.$ !e( öing, 'backslashreplace').decod% a ¤ ,�ñ=' ')


class Tar}$(E�É X"""BaØ.Cpass> rExtractB K A vGeneral �e5   eõsW OReadT ¨ L  un·ÿable tar archiveU ¿Compression\ Qavail] c=  methodd oStream_ `suppor'Poperaas on sF P-like ?FilÒ SHeade¿}
¾.h1 yXEmptyW  ×
ƒe4  [ —TruncatedM ( Y t8 ] 	7EOFK W “ xY 	oInvali´ i6 Y À SubsequentHÆeaderError(H ñ'):
    """Exception for missing and invalid extended h@ Qs."""> �pass

#- ò
# internal stream Oface9 õclass _LowLevelFile³ PLow-l ô file object. Supports readÅ �writing.± À   It is useà østead of a regularR ¶ 4ingA baccessP  	 ódef __init__(self, name, model p  A = {5     ú"r": os.O_RDONLY, w  WR " |, TCREAT VTRUNC8  }[i ]H ÷
if hasattr(os, "O_BINARY"›  Š  6 2 |=a # D  Ö A.fd  Vopen(â ‘, 0o666)
.  Qclose
c 6os. 7.fd0  ³/ X, siz3`return“ $ 3.fd' q  èq :, st  9 3)

^S“XCtðthat serves as an adapter between Tar� %ñ C   aßF-lik’O The  T only: Ñneeds to have‰‚ad() or ¸ €) methodn  »€$ed@ ð blockwise.  UseÎ@gzipA àbzip2 compressã²is possibleÂO   A¢ �could beõexample: sys.stdink @out,Aocke
 òtape device etc.©B   _t Ê  X toj ” #Rnally¥ g,ê Qtype,Æšobj, bufsPå"""Construct a� EV  û@_exto¥obj = True  $ifq  × 3Non« S  7 	ÐA)L  0 p  UFalseE5 ifí r == '*'Å >   ñ# Enable transparent2 	Udetecö&thÍ ? ÷Š­   Ð ÎcProxy( 
Ì  ~ ”$ =$D.get ( Z ö  T  ! =A Æm  # ¥  =^: Y ! =ï  z 
! ¥  � 
  1       |   š 4pos 06 ÷ d 6 Ê:try»ÛJ"gz"!  c 6     ðimport zlib
        õexcept ImportError:
 	 ñraise Compression, ý("zlib module is not available") from NoneU Qself.>  =  ! Bcrc   ½.crc32(b"")+  ifƒ �e == "r"Á p î_init_read_gz(I  ñ ) 4ion~ ey Oelseo Rwritep 	A Âelif comptyp¼ ?bz2¾  ?tryd iµI bz2X  Å À ×'0bz2SÖŠ­dbuf = b""¼  À …0cmp# €z2.BZ2De+ }/orº!OS¦b ·	x óv 	J À/xz¿ IlzmaX   À- U Áu Œ _.LZMAÃ!= Ê(D Ìo!= "taJqunknownÏ ¤ :×Q%r" %   %)
êâ
Ù!ifAýº_extfileobj%  "  k.close!  zd = Tru�Ç Œ Àdef __del__(6 )n ¡if hasattr 2, "R f") and«  8 ¢  (õ i €p ð"""Initialize for * Ñing with gzipJa.L"F T .Â  \.;fbj(9,  •DEFLATED,L  ½  -A ŸMAX_WBITSB A ßDEF_MEM_LEVELE 0Áqtimesta1ðstruct.pack("<L", int(time.time()))#
  ðself.__write(b"\037\213\010 ð" + timestamp + " …02\377")D 1if G õname.endswith(".gz"):&  q ' & =3 U[:-3]' õ$# Honor "directory components removed" from RFC1952< _ Àos.path.base™ ( ¹ #B ú" says we must use ISO-8859-1 for the FNAME field.s @c Ã.encode("isoG ñ", "replace") + NUL)
G Bdef € @ 7, s5@"""W›Á string s to� fstreamˆ 1"""M  f� 8Ïtype == "gz"Œ 4crc‹Òzlib.crc32(s,ž6crc- � Ö.pos += len(s q |!= "tarr k @cmp.� HressH c M ?elf!õ if a whole new block)@   iT0adyX!beˆ?tenXŸ 0bufsE Rwhile Lbbuf) >@bufsizex †fileobj.ød.buf[:c  7 ]a Ö E 0   / &:]OQcloseò
LC @!_SAõ object. No operation should beå ÿ	   done on it afterwards) o dÿ breturn« × ° vd = Truu :try< X 2modÕbw" andm Qî}l Á ­ ‰cflush(m &   j 
:buf˜  2 ‹×
È-  ‰ 7= b¹    ~ Ó Á *   z ÷ truct.pack("<L"Ð� D  Ö& 0xffffFFFF)Q nfinall´2not£C_ext#A• !ß_init_read_gzÚ ¡Initialize° )  0aa gzipB m3ed € ¹K4cmpd deˆ ? Qobj(-$  –MAX_WBITS dÚAr# taken¸ ” `.GzipF; .“ some altƒ__ý P(2) !5©cðraise ReadError("|Àfile")
     ÷   if self.__read(1) != b"\010":
  öraise CompressionError("unsupported c ¥ method")
F ºflag = ord(t )#  6; 1if > :& 4– OxlenT � + 256 *p 
 à t þ  M Œ t 8t ªwhile True M + =QÜ     þif not s or s == NULI  * Ubreak@ � *160 ‘ n2� RR2Æ�def tellû)0 ð	"""Return the stream's fcõpointer position.5""" r? u 2posp o Aseeko ,B *=0v ?Sets  to4 °. Negative M 5ingv  <¯s forbidde›  ifF " -†pos >= 0ý åðlocks, remainder = divmod(1 < ,F vbufsize¨ E ñfor i in range(bT ð  $   %ì
 L  $ “ m ;elsöS¹,Ñ backwards isô`allowe �   ½�  ‹ !, ï 5
2Anext" ÷ number of bytes fromâ.4Sasser8 œ ENoneÞ5bufÉŠ 	s ˜ .ž¦+= len(buf#Ó 6buf‹^ 7 Ï  è ¼ ™ Å ¼ v@typeLL"tar¹ • j ˜ …"c Ç    ).dÍ Ut = [ ]ˆ s1c <|� O €# Skip uÍólying buffer to avoid unaligned double! 6ingã J â :bufc   ¤ l   µ $ b. # Å  , 7  ~Bobj.û  * 6 Î¢    
Ä  ?tryÍ 
`cmp.deÕ i
\ @ bexcept {ion as ™ , �CRead›Ðinvalid compr÷essed data") from e
  Ùt.append(buf) Šc += len æt = b"".join(t2 õself.dbuf = t[size:]O  return t[: !]
 °def __read(=  ,  !):  ¡ B"""R8   b bytesÂ õstream. If internal buffer is empty,G 0   d â another blockH Cthe L / 5""" "c  Ÿ .  [ è ‘while c <Ì Ë  Ï 4 €fileobj.˜ ü  ]  å O 2 `if notÚ 
J   Ubreak©   É:­ È¡# class _S’)

 ÃProxy(objectØ """Small p > ôthat enables transparent compressionë àdetection for Á{ 	ñface (mode 'r|*').8  Ô	 sainit__y#, Œ   I£$ =! @   * Í¦BLOCKSIZE)äæâ@   1 =  � L q =! 6bufY 0get"AtypeÍ Ä "ifQ ÷buf.startswith(b"\x1f\x8b\x08"1  Ú i 6"gz'elK p[0:3] =…BZh" andg S[4:10 z1AY&SY"¶^ ?bz2_ ª « b5d\x00 P80", À �fd7zXZ")½ x½ /se… Ftar"IMclosCp‘" $)
ñuáO

#- ƒ
# Extra± 3 B`FileIn A�A thin wr¹ñr around an existing³ j  ]Kñprovides a part of its0 asC ¡individualE 9 L M‚, offsetñ,s—info=None¹dkK # =T “ y@size=&izÖU Aposi':= 03 0nam3 ƒgetattr(â0, " 1", £ 
3 þ’d = False8 1&ifÛ  z ; 
pm ú b = [(0) C ð# Construct a map ©“rnd zeroe s 5 â ­map_index ã Àmap = []
     Àlastpos = 0
   Breal µself.offset Bfor  õ, size in blockinfo:'  I #if* 3 > i 
!  % d ômap.append((False,1 ,C ‰, None))a < FTrue2 § ! +¨ #, Ø D  1 +=' 	` µ # =… K $ $if§ 1 < �  
ä  à 	!  8 ã `  def flush(! )U Upass
# Œreadable& preturn - Owrit- z. Oseek.  — •.fileobj., )@ Ltell— B"""Rš Àthe current F ¡ position.Ü  5""" Ð u * k   k ,G ÷, whence=io.SEEK_SETFÅ"""Seek to a4  Ì ˜  � ‡ #ifW G == Z Ÿ ¹ 	¦ ´ = min(max(¹ V, 0),1Õ/ela :CURa &if´ :< 0 ‚ !ax .ƒ % +B  Ž h = OelseS /inS  ÖÝ :ENDm ; ¨  = : B  S 	¼  )È Ä öraise ValueError("Invalid argument"¬ o uü =›Å åßad data from U× !isåI  � =-" - !ºò ; <7izerE ¶ p wbuf = b{Qwhile, >l  f
¶  J  ÿ p, start $opš Ï Amap[¿¥map_index]Î  A   "ifB # <5 ø  r>topw  6 ]breakL " ,   
†  1>  (  Ž  ±  #le	7mapb 0  d r ' clength- º4ª -  !ifem  Ç�(Àt + (self.poûsition - start))
  þb = self.fileobj.read(length. Àif len(b) !=
 Mgth:S  b þraise ReadError("unexpected end of data"c ‰buf += bW Nelsei + SNUL *Ž 	6 dsize -© 
  ó #po+$ ±return buf
8 @def Pinto(0F, b)’  Š H &  @'(bn1b[:8auf)] =W  &  j  o Qclosel i  { . ðd = True
#class _FileIn "

  Ex ðObject(io.Buffered—Fer):l �__init__o P, tar	 Ginfo�   Xobj =q (1 E9 €.offset_ì,I ó  0tar^ .¨3 fsparse…super().¤ ƒ )ú ç M

#- €
# Expor}C-/es' 6‘TarInfo(o8û 0""" 0rmaP2al , ôwhich holds the details about anó ð
archive member given by akä header block.3 ‡  ‡ qs are r– ed; 0TarÞB.getV %()b ‡s() and  } 4arey Àusually crea2`intern œ 2"""9ô__slots__ = dict(B   name = 'N !of
%.'­ A mod. pPermiss°Hbits#  uiï€'User ID> nu ‘who origi£ Ã stored thisnH gH _GroupI *s[@= 'S iÌ)te² 2mtiT pof lastë AificE˜ `chksum3H@chec % 0typ( ('ø  . D is µ3oneõ se constants: 'œ}µ'REGTYPE, A
 2LNK 2SYM	 2DIR	 BFIFO
 K  BCONT #CH0 #BLK 0GNU –_SPARSE.'¦S link+(,ptarget éL", iÿ is only presentÖ   Þ 0'iné °> … ?â å 	“ u� k  ‚g  ¦A   €devmajor" rDevice   nu÷+ *in+  + C T 8The0Óhs here[ Ðoffset_data =ó "The file's data starts here.",
  õ0pax_headers = ('A dictionary containing key-value pairs of an 'H O  ò
'associated pax extended l 6.')ƒ ²sparse = 'S
 àmember informa� &.'/ 0tarØ v = None _H p_structÎ   ½link_target= !)
Ê ñdef __init__(self, name=""):!  à b"""Cong ñ a TarInfo object.1   is the op¾ !al A    ?   ê . 5"""   .~ ! =?  {   "# 6  
. 0modHP0o644+ A   #Ê permissions3 suid = 0.  @# usd* g* {group i+ 1sizˆ O  ˆ   
W Kmtim- ‘# modificü ! 
4 ichksum¸ #ZP chec 
2 0type qREGTYPE“ H  
.  *z!""- 0 #  t u) tA  
X g 4 = U , C  
- ‡devmajorç ’# device   nu(6 /in6  6 
7 Aoffs
#Â4tarZB= _gL=  ¨€ l Xä¸“   ¶ ë
{ 
¿!{}R qhDv ‘@propertyH  ðApathìã1'In·F @s, " "×€called "7 1".'G  µ qreturn Ò  - o ¡ath.setter+ 	r ^x > ôE ´  Œ � ¸  *  � 	¼    ? À     5     / È  † ,! 6 Ð  '   % =# Y  c__reprn: Oñ"<%s %r at %#x>" % n Ð.__class__.__] 5__,=1,id% )Ö@get_F 	ÍRº �Ì÷'s attributes as a® \ A = {å   6: ²  "´"#   › & 0o7777, 3uid+ O 7uid" À   "gid":   ç   self.gid,
  q"size": "   # Cmtim$ #  $ achksumI $  % 3typH Ž   # alinknao H  ' u$ Ø  $ g$  $ ¢devmajor":’  '  *in'   K%}
 �if info["Þ ó"] == DIRTYPE and not  Ÿ õ].endswith("/"):G  ’H ( v += "/"h areturnL   def tobuf(:ø4, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape� B"""Rq õa tar header as a string of 512 byte blocks.Î 5"""  Ö " =p@get_ "()Ä ö f»  ;SUSTAR¼ 
  ì â.create_ustar_› (W î å )‡ 8elii ?GNUg ?gnue $?PAXe ?paxe Â +se°aise ValueEÔ“("invalidR"g +4 M,S: k ¢the object‚p["magic#É POSIX_MAGIC	1lenÉ$["	"2Tcode(ÉÛö ) > LENGTH_LINK°  VrR Ä is too long! 2 6if  ….t { JNAME{  Š¢["prefix"]`"["R 	Ð_posix_split_ ÷    4 y 5ingí '	_Ö	DØ J à.9GNUŸ sequence –xbuf = bQ©Ö(% _ +žN  ‘’P, GNUâP_LONG|gY:¬ Àeader(info["óname"], GNUTYPE_LONGNAME, encoding, errors)

  ñreturn buf + self._create_header(infoT _FORMATN Cdef ; 4pax?  S ", E ‡ %): B"""R‚ òthe object as a ustar … õ block. If it cannot beF ô    represented this way, prepend a pax extendedV ysequencH ñ with supplementº …rmation.p 5"""  Û õ["magic"] = POSIX_MAGIC$ 2s =f g.copy(”ñ# Test string fields for values that exceì e" £ length or!~ I# be …in ASCIIÚ  f  H2, h V Ein (Q ;0 ("$ ð", "path", LENGTH_u”), ("link#   
' oLINK),V  u4 	 !32O g 	 V32)):Ì ˜ "ifº 0 inô‡sr %   P# The# Æhas priority +   Šcontinuen ‚# Try toJ e Å·"ase
K >try‹ C Ü !].#€e("asciiZ N Ict")' ü°pt UnicodeEÞ eEÚ\ h[Ó ¤q 	W è  if_[© 0) > ?gths t èbnumberÆè@imitçN @like’�be storedOVfloatŠæ`digits-¢(("uid", 8l ‚size", 1†Cmtim É <0if  N w!{ö  Avoid overflow¶  c   ¾E = 0     ªQval =ÎÁ	7  ¹ pot 0 <=d“ < 8 ** (@- 1)qñisinstance(val, V ‚ ý m  õ tr5 
È - Î ˜ 1# Cˆ¼ ³ wecessar® ifÒõ ã}ã © sgeneric4 ( u`s, XHDJó¿ JelseÚ` 6b""#rÛ  ]	UUSTAR_üƒreplace"Á@classmethod'ð def create_pax_óglobal_header(cls, pax Ss):
  ð
"""Return the object as a0  G  G ø block sequence.D  rM Àcls._create_y sgeneric� ( U ñs, XGLTYPE, "utf-8")
N ðdef _posix_split_name(self,  û, encoding, error× S5 ! a, ð longer than 100 chars intoê Qrefixu 4and: Opartë Ácomponents =f .¨ U("/")M öfor i in range(1, len(; )Œ } pŒ ¨ = "/".joi, F[:i]Z  .  , +i:, !if{ a .<!e( Cð) <= LENGTH_PREFIX \Ñ  w   Ë  ƒ N FNAMExC Ubreak] Jelse$ Àraise ValueEå ("q q is too×0 R ~ä 'MÑ@staticmethodo _¢‹ß(info, format^5a . C  � ña dictionary with filey  ¨ !  *  i 4iont ñ  must be one of’ÿ*_FORMAT constants�ðhas_device_field” � À.get("type")‡B(CHRn0BLK	 Q=if F 
�ádevmajor = itn0`  „", 0), 8Ò ]  ö  & /in?   ?  M Œ astn(""w Ðs 4  h ? = 4 
5  ý J[  È  < \ �p", ""),[9 ,> 
:Amode÷ ‘ & 0o7777È …): 	1uid9 0 g0 2sizš E, 12Ñ’ 	Omtim3  b"C  á", # checksum ¶
)2nfo_¿Q, REG²
„ 
ŽOlink’i ûmagic", POSIX_MAGIC„
n uk /32ü
> g>  ¿ ó
    ÕÐ,
           ó& stn(info.get("prefix", ""), 155, encoding, errors)
  %]
 ö%buf = struct.pack("%ds" % BLOCKSIZE, b"".join(parts)I âchksum = calc_ us(buf[-? k:])[0]q  # ð:-364] + bytes("%06o\0{ I  , "ascii")$  T F357:J ¢return bufÏ Ñ@staticmethodp ódef _create_payload( !):"  B"""RK 0theCing ' ò filled with zero­ < �   up to ; �next 512$ … border.+ 5""" ðblocks, remainder = divmod(leg¬ &),…t'if7 6> 0É  Í ¸ E+= (ƒ& -3 u) * NUL‹ F8 J_classIÿgnu_long_header(cls, name, typex ¢ kùa GNUTYPE_LONGNAME or ÕLINK sequence¯ a   forp [ Š " =! !e( 	! +U  GY = {}  ["L ö"] = "././@LongLinkÈ 9  ["÷ '  	 C Asize  Ø P É¡nfo["magic" ’GNU_MAGIC… Î"# ¾¢ extended u! +á  H	ÍDcls.ø1 *ï, USTAR_FORMAT© E + \À  €   M &(É + @,	¹pax_generic/  ™ s6™æa POSIX.1-2008”or global0ò"that contains a list of keyword, value pairs. The sß  ”   must bsrÖà# Check if onec  ffields� ð	surrogate characters andCErebyw #êpces hdr+ ðset=BINARY, see _proc_pax()* ` more ’vrmation¥ Öbinary = FalsL I7in œw.items(“ 6tryÒ    D.j€e("utf-8�vstrict"õ , ð except UnicodeE§ eE£W º 6Tru¹  E   Vbreak.�records =±G2if F 
^ P# Putt_ ¬" a `beginn"of) ñW ƒ t +u '21M ¬6\n"¢ r$¥Ð = keyword.en÷ code("utf-8")
  ©if binary:  " ÿ.# Try to restore the original byte representation of `value'.N  €NeedlessS ‘say, thatU ñencoding must match nstringL d 1 =  .> !e( ûing, "surrogateescapeó Nelseî L T 3	Ï ñl = len(keyword) + B   á3   # ' ' + '= 9\n'C ™n = p = 0 Ÿwhile Tru    2 lj jstr(p)É ²žif n == pß   Ybreakq    ‡ n ¡records +=æ"s(p �, "ascii"ä sb" " + ` + b"=  E\n"
W ð # We use a hard�÷d "././@PaxHeader" name like star doesB pinsteadfŠn’�at POSIX µ fmmends0•info = {}F    ["h M"] =‚ ( Atype(  	  2siz  
 } 6rds’h QmagicA ¤ h_MAGICÁCreate pax h! +É ‡rd blockÌ Ñreturn cls._c7 _3 (l å, USTAR_FORMATª¡, "replaceµ\Ä  ù  O …payload(Í . Á@classmethod ödef frombuf(cls, buf, ~verrors)ƒð"""Construct a TarI˜aobjectK a a 512m "s  Ê1"""}  ´ !ifo@buf)í0j   ²raise EmptyWE� 0("e fM Ï!= BLOCKSIZEU ™TruncatedY t ] Ñbuf.count(NUL° c 
9EOF] !enðfï&")A÷
chksum = nti(buf[148:156]‰#f & Ânot in calc_ s4 ©?jInvaliè €bad checs … Pobj =˜(v @obj.e› g [0:100]) Ø 5 Amode5 Ð 07 8Ð  % 9uid$ H8:11ô  $ g$ k16:124H  ÃI \24:13I Imtim“ \36:14“ Q “	Ô  =  ='™[156:157]  Klink-157:257/u8 b265:298 Àcoding, erroSrs)
  üobj.gname = nts(buf[297:329], encoding, erro8 �devmajor; i; Š329:337]a  ) *in) g37:345) aprefixL ‡ 345:500‡ À ð# Old V7 tar format represents a directory a wregular@ õfile with a trailing slash.& 0if )ñtype == AREGTYPE and  AP.endsH e("/"):<  i= @ DIR; 
  ô# The old GNU sparseÊ ÷occupies some of the unused@ �space in Qbuffe„ up to 4T ¦structuresÙ `# Save9 mt à later process	@in _ _™ &()< 0GNUÙ z_SPARSE •pos = 386¶  ‘   )[] Pfor iÑ {range(4N < :tryc     aoffsetG“@pos:€ G+ 12o ,  pnumbyteŠ %nt6  2 ; /24;  Ðexcept ValueE ’ Ybreakà  x ý ’.append((¸ $, Œ )C /   Æ I= 24M ñisextended = bool‰,48í rorigsizéå h483:49… g  ­ï_¦ C = ( &, q $, U )ÐòRemove redundantNues from‘iˆLkisdir(ï �  a& =larstripj
z 2con© P a us1loná	¹mÀÙ0nott@GNU_ÉSÎ† = u+ "/" +• –`return œ ²@classmetho·1def0tar~P(cls,Á  ý B"""RK  ÷Ànext TarInfo\ 1ectE   FÄeobject† $  S ú 5"""  Ubuf =#  {  ã æread(BLOCKSIZE„ obj = cls.Å0buffµ .)Ô .1äv  •tell() - z § M.‰smember(h y/#- 6z •`followBare Áps that  �called deÂ & oƒNCof aK ² .èãentry point is\! ð() which can be overridden—M 1subO Û£add customI 4*()§ 8. A Àethod MUST
 ñ   # implement the following
  ³operations: ñ1. Set self.offset_data toA @posi0 a where  Óblocks begin,K P   if# are is ( Cthat† #s.( 2s starfilev q ó
next member's header willP "  ˆ ` ‘3. ReturnÖ ò or another valid TarInfo object6 ¢def _proc_i (#, ¤ ). D‚"""Choos`right 8 ðessing method depend !on¦  ;    ó type and call i�  ! 5"""- !if¾ .. øin (GNUTYPE_LONGNAME,  GLINK¦  N r.Û „gnulong(Ö m )elo %==\ fSPARSEÿ Y osparseX  Ç 0XHDÇ R, XGL	 ƒSOLARIS_ Æ ?paxj /se¦ vbuiltin=  ú  û£Process a - Îc‚ unknown Qwhicha  3!  ±Ð be treated aF �regular 	.  � #™=•.5 ¥obj.tell()> Æ" =@ ; " ípisreg()"g lðnot in SUPPORTED_¦S\a# SkipÎbðTù  ƒ # +’ _$ aV.sizeº ˜ï # =: 
¹ q# Patchy 
Æò with saved globa ƒ #3ainformÿ¡ ù °_apply_pax_% ". psP.encoÛ frrors)¨ { e„ x B ô4"""e Á,!s G`hold a› ÇEname   Æ  Clink.æ RNbuf EBread” Ù D# Fe�—Ï	Ò:try:5 	Cfromór�except HîEa 2eN ÷raise Subsequent. �(str(e)) f R NoneŠG.  y© Þ  \j#~ j � 0U = Æ ë F ƒspLÞ
è P o “= nts(buf<Àle.encoding,ó tarfile.errors)
  õelif self.type == GNUTYPE_LONGLINK:,  3 ö	next.linkname = nts(buf,a wncoding s H preturn K 
 ðdef _proc_sparse(‘ A )‚ À"""Process a©  0 ó header plus extra !s.`  ¹ 5""" ô# We already collected someR östructures in frombuf()P ! ðs, isextended, origsiz Ã .Ð _- � 2delu! " 2# C˜ ‘   Ž  ç u ê g blockð Wwhile� E Ubuf =´ @obj.¦(BLOCKSIZE% 2 upos = 0¡   Pfor i ‡range(21«     :try{     aoffsetCiCP[pos:f Z+ 12]}  0   pnumbyteŠ %nt6  2 ; /24;  Ðexcept ValueEŽ’ Ybreaká  t 3if « Dand ‚ B è’.append((9 ,6 )× ò I= 24y Uq = bool"(50Þ b#= { Q ¸  � __datað Vtell(“ $5 " =£ C + _m¦.ïC u   % =Ù ø $ § ø1paxO õnø”or globalõ as described inw ö    POSIX.1-2008Ã
„Read theO ¶information3 8 × .)ê  ‘t# A pax` 0sto^×supplemental t  ]eeitherÊ #   following ¸$ (š) or all ! s? (2Çþ0XGLþ
ßBpax_c z' c Oelse< i.copy((�Check ifï 3pcontainýPhdrch,àt field. This Ò8s uô  Óe•$ oT @th, Ç pa
 uÎ àg
 S @s. NElly,á ƒ"seu Ás are UTF-8 c Éed but sinceu kD $imô _G aÖaed to  ý ð m as raw binaryåwings ifM  á atransl­ A “ À fails.
    ð+    match = re.search(br"\d+ hdrcharset=([^\n]+)\n", buf)
:   #ifA Åis not None:  " Öpax_headers["T B"] =; õ.group(1).decode("utf-8")
H ð(# For the time being, we don't care about anything othe3 Çan "BINARY".P ƒThe only( ñvalue that is currently allowed by~ ·standard isL ó"ISO-IR 10646 2000 UTF-8" in` Rwords † 7 = 'X.get(+	o6 =Ü 
tPencod¤= tarfile. ¸ ;elsª# 3 = ƒ‚P §  Îò information. A record looks likO˜ ð# "%d %s=%s\n" % (length, key !, †2).   Š óEsize¶ A# of‹„completex Qincluô  4 B ÷field itself andG  & „newline.‚  # …  RBboth´ ¦ed stringsÄRregex> ’ 0ile?ö (\d+) ([^=]+)="Àupos = 0ˆ ›while Tru‹•Agex. –(buf, posN  _!ifx# m    VbreakÆ  v
†*s(^ - c = int°
! $if®N== 0� áraise InvalidH‚Error("i N$ ¥ 
  =l[Û Â.end(2) + 1: pstart(1 ¦ J- 1]ì 0# N£1lly.äcould just useå1 asRä 5Pand "ê5ct"ª – #+  Ã € handlert�abetter�!ta pe risk.¾I 0exaÀP, GNU¤€ <= 1.23õð known to store ¿pnames iëKnnotM �translate5 { © 4raw°0 (u­Ñtunately with.I \=4ž)ñW— drst trUrict !M,Ti´¦at fails wÏN Áfall back on‹buser'sv’et
� A0 = é"._H_S(! ,ó	 	 Ž   4 s pN  Þþ PAX_NAME_FIELDS É™  ,é , ð¯,¡ ¥ Ü 2 m Ð = self._decoöde_pax_field(value, "utf-8"	 /
  ùtarfile.errors)
)  X ñheaders[keyword] = e 
) Æos += lengthD ò# Fetch the next M .< Etry:  ¢ & ³= self.fromŸ ( )- �except Hž E½ Z as eN ÷raise Subsequent. �(str(e)) f X None· öProcess GNU sparse informationÀ ‚if "GNU.$ —.map" in 8
‘ #R „extended[ Y Æ version 0.1b  ’_proc_gnul @_01(-,m ¿+elœ Osize� 20� 0� \, buf¢ *Z.get(Nøjor") == "1" andì / %in/ /0"x /1.Û 1Û  ¡"ifÆ0typ=ó (XHDTYPE, SOLARIS_ )« $Pa4òTarInfo object witLAPœ
– q._apply ¾(m#, ² —.encoding  Nsk ƒP soffset Ÿ 6 '  ti * A# IfÌ �replaces  L  Ú,Y >   0# wVñed to recalculate9 � R wher  Á C  AjstartsC d G =¾. ]_dataK "if$ ¢isreg() or ÿ0not SUPPORTED_	Sø o   e  N ³ q._blockN.
— 1 É9 "= 	 ™areturn�  Mdef O 0(g,' 	U¸­ 4"""aÏEtar Æžé,Ô\5"""@­ es = [] Qfor mðin re.finditer(br"\d+v .i ”œ=(\d+)\n"­  !c Á.append(int(] ¦.group(1))Unumbyte� 'A ’ 
% “ 3extî ð = list(zip(offsets, ð2numbytes))

    def _proc_gnusparse_01(self, next, pax_headers):
5   ò"""Process a GNU tar extended J  7 á, version 0.1.w B  0 ø= [int(x) for x in~ b["GNU.+ õ.map"].split(",")]L  ¶ & Â = list(zip(8 c[::2],   [1 	/10,ñ _file),?1.0Õfields = NoneÞ Ç F = [ò Tbuf =� .• õobj.read(BLOCKSIZE)B X ", 6 3bufFŒb"\n", 1* 0 = •7  “while lenZB) < $ F * 2 ë1if ^ @ notÕ:buf!  %  � +Ç  3  Î/erË  . ;€.append(Ô @ )Õ <¿offset_dataW [tell(2 Z n`apply_aCinfok  9üs, encoding, erro‚tReplacexðwith supplemental W @rmat}õ from a previous   e¼“or global¿žðor keyword, valueÙ¼ w.items( „$if6 H == Ñ^name"ssetattrc"path"q … Z /el\ ?siz\ & ,íÑ a Areal? Á & e Þin PAX_FIELDSZ ð * oNUMBER1  Æ >tryJ     ÷ ! =v 	L [ë!](# 
z :   €except VE®i 0† D  Õ  !ðH Š " =}¾.rstrip("/"� 
DË Eƒ  õ.Â  =üh.copy(7adecode¿ù¤˜ º–fallback_Í  (XDX ƒ a singlÞ ¿Ÿax record˜ààreturn value.dóecode(encoding, "strict")
   except Uni+ D1 eError:#  * áreturn value.d& ¦(fallback_`   C 1s)
E ödef _block(self, count)b ò"""Round up a byte# ó by BLOCKSIZE and ˆ 1it,Z  › t   e.g.b Õ834) => 1024.% 5""" Š ñs, remainder = divmod(™ ,t (&if0 ¹  € O U += 1c §  *Q Qisreg	"'RhüTrue if the Tarinfo object is a regular file.'w  eø.type in REGULAR_TYPES  < € Hà _isdirq iá ŸdirectoryÞ 	`== DIRÙ Ø ?symf ßsymbolic linkj <SYMj "lnÑÁÐ Ohardf <LNKf /ch6ÿ character devic
]== CH=/blÓ Ýi -BLÖ Ofifo§OFIFOž # 9lsparsee ›$"  Sˆnot NoneI<dev=  ß|one of ~(, #@ or ¦ É 	Cin (• …5,6  Ü �)
# classeInfo

 RFile("ŽB"""T>  ! C9 òprovides an interface to tar archives6 2Y�debug = 0í ð# May be set from 0 (no msgs)X b3 (all \õreference = FalseU ð# If true, add content\ ¡!edð W 1theœ : 	  #Õ  æ0, ef  M H .‰ Ìignore_zerosŠ ‰ °skips emptyÃrinvalidÛ Hd‰  É óinues processing† e)šlevel = 1Ç † ‘0, fatal * Ðs only appearßž	ƒ À              ó# messages (if debug >= 0). If > 0, errors
2  ñ# are passed to the caller as exceptions.
K ñformat = DEFAULT_FORMAT_ c# The " óto use when creating an archiveO Pencod ¡= ENCODINGK   4# E ôfor 8-bit character string˜ î p = None>  0# EP handØ  N óunicode conversion’ àtarinfo = TarI
 J á udefault  Pclass;$us× �fileobjec*rExFileO "  E  " -#  � 0extØ   #()‹ ð	def __init__(self, name=ã À, mode="r", 5 3obj € ³À Ú  ´ dereferencQ Ãignore_zeros% Ÿ 	N qô="surrogateescape", pax_headerG  D Rlevel ² copybufsiz• %):t p"""OpenC�(uncompre´T) tarV  `!@'. `õ' is either 'r' toN À   read fromS Bexis¢Ÿ@, 'a1 À append dataã4an + L  ‚a or 'w5 ðqe a newž‚ overwric D D one­ P cVH'r'. @If `p 1objá �given, itî uÆ P Þ  X4or x  Ä (itP ÷can be determined,> ¸ –ridden byx s~	— 	” €not closM 0Tar £  < 5"""� ñmodes = {"r": "rb", "a + w w x Exb"}> !if—  ~ !in sA ±raise Value ("r P must1'r'ù,É ÐEx'")`  ƒ.1 =] 
 _  s[ ]3 y !if– ¸
• 7if Z =ñ A and1 �os.path.u s(Þ Z   0# CbQe non* 1entxDs inÃ ’ v 7   z 6 "wŠ      Û :"wb" Ð Á = bltn_open¤ ,Ò 8 @P 6ext; UFalseLMelse U  = ûƒhasattr(G 0, " ") L  q   ¤isinstance0 .. ÿ , (str, bytes))Y  & ! =K1obj5 	] >if ‰  i"M  	K¸ O	S & !À= True
     ð   self.name = os.path.abs ( P) if 	 Ã else None
  < £fileobj = 
 
  õ# Init attributes. ñif format is notY :  a ^ % =. ! ¯if tarinfoA & =0 C ¿dereferenceG * '=  O Ïignore_zerosP 	+ (=  R �encodingN ' $=  F G’errors = 	 £Ùif pax_headerµ B and©ß== PAX_FORMAT« H =V ‹  B9 ){}ž Odebuÿ $  —5bugn "ifî _levelA  ) $ Š ËÈdatastructurÏe copybufsizM “ ' Ëlosed = FalsM@membˆ@= []Ô   # list of  pas TarIüzobjectsa V_loadb  H `# flagË5allI êhave been readE ƒoffset =åu.tell()*  [  ñ# current position in the archive,G Pinode£${}S P# dic> €ary cach
 F , %ofC 3  #r >lí vy addedá:try›"ifû ºmode == "r"!  k º Rfirst_ ! =É— (   fnext()†  T y ay  ‘# Move toV0end! a,ƒ �# before1 ³ Æ empty blockš ƒ   ®while True÷    À óa.seek( 8#d H  ©H  €.fromtari a Z  E 7 ‡“s.append(F 5 ±except EOFHÿEí `  ˆ ?objñ  7 ]breakŽ  € } O as o 1 ¡raise Read« �(str(e)) $x	h 	Iðin ("a", "w", "x"):
   úself._loaded = True

# Q  if ( Ípax_headers:%  5 Rbuf =, ð tarinfo.create_; cglobalB (R �.copy())Y - ÿfileobj.write(buf, Úoffset += len, jexceptÁ bif notº C_extk 
%  â 	‰ jclose(† !  P 8  Craisb/#- 64ð4# Below are the classmethods which act as alternate constructors to8 L cTarFilF Ò. The open() S 0 is. € only ons  at 0neeL3forJ Ñpublic use; i#  ž ‡"super"-‚ @ andB pable toŽe± nI Padequ¶ J"sub: ñfor a particular compression using­ smappingP ò from OPEN_METH.  P This +r allowsæ Qo sub[ #¥without loi £comfort ofP  ó ò ñ 0. AN    ¡registered made availP `by addØ  it, ` Þ 8 inÖ 1 @² º 2defÐócls, name=None, mode="r",  öbufsize=RECORDSIZE, **kwargs)(ð"""Open a tar archive Ÿ0rea°  , ¿ ¹  ³@ppen r. Returê,°an appropriõnÊ .¥ ´ ƒ ñ    'r' or 'r:*'ç ‚  °È transparent-� C'r:'  F äexclusively unp+edB $gzD  ?ˆ Ogzip� 3bz2@ ? _bzip2@ x Olzma? aFa a´!, Ü Ë ~ / *™necessary	wK wK 
 ‘ AE)io	?'w:F =  F
/w:F 	? F/w:F 	@ F	ü xü xü 3e2G ", 2ˆ	 2an Ð é!ifæX iç tð y created
       a'x:gz' ó(  create a gzip compressed tarfile, raise an exception
<  pif the 8 ³ is alreadyd d7 c'x:bz2… „ _bzip2… Zx	on lzma… L	3r|*	ð  open a stream of‡õ	 blocks with transparent¤ “5'r|P Q Gn unÜ_ @for °;ingŸ .Ÿ ,P D îD ìE ®E ¬E w Lwrit/w|B C 
C E"""
Ÿ if not namåd  ÁEobj:%  êñValueError("nothing tog)")V úmode in ("r", "r:*")R ð# Find out which *×!()<pppropri� Ä   l `.œ !deÆ _ä( Ktypet Ê ôeturn cls.OPEN_METH[0 �] == 'tarr 'f e÷ ©_msgs = []  ¤ C  ö ysorted(d —, key=not¨ Ÿ  àfunc = getattrC ,¬ )„  Ü !if0objF ÚJNonex (   €saved_poÏ ón.tell(W ?tryD rL ´ (D ê$",„ ®, **kwargsS Oa (ReadQ3, C1ion _) as ½ �ô.append(f'- method {‹ž}: {e!r}'€  . 0 &Useek(?\ ‰continue£¶ ö_summary = '\n'.join( 
T |*0(f"Š R coul²!beƒðed successfully:\n{error_msgs_sÃummary}")

  õelif ":" in mode:  ! @file Á, comptype =' ï.split(":", 1)4 4 = ? y or "r"' Q   ' Ftar"Ÿ  … ù# Select the *open() function according toa q# givenº ‰ression.! !if Ö úin cls.OPEN_METH †  q ú  = getattr(cls,3 [Ç ];elsV O £raise Compœ ÙError("unknow¶  ¢ U%r" %± 
c areturne(name,z
 Ýobj, **kwargsý|ý%|ýP%ifÌ @ not§®("r", "w")¦WSValueQ ¿À must be 'r'Œ8'w' �±stream = _S
 HÞRzbufsizeŒ>try— 0t =-U v œ Œ  nexceptN 6 z.close(~  ; 	ê`t._extŽ¹obj = False" Btz=bin ("asL, "xx<  @1tar … > /� «  ¯ÑundiscerniblekªÁ@classmethod¼ Ddef q �v =#ñ W=NonedQ """Open unÞ ‰ edS � archive R � for read¦or writingL&""Ú!if´ «=	 6±’, 'a', 'w»x» ç  {[ = sC!gz³B%level=9S
Agzip®V%�   Appenw!isRallowed{w¸³vqq rßQfrom î æimport GzipFil`Ç! I –‚ S U tmodule ±vailable") y  Û´� àileobj = GzipFó ile(name, mode + "b", compresslevel, fileobj)
  õexcept OSError as e:  $ $if5 ò is not None andh j== 'r'4  8 ¡raise ReadZ  ("; aa gzipQ ™") from en 6 
 :tryZ ÷ t = cls.taropenñ Ü ¯, **kwargsæ v.close(9  Ê /ifê G `   ‡
ì ” 	( :   ct._ext0 v = FalsX‚return tWÁ@classmethodhqdef bz2OVcls, EE="r"X=øQ'=9n¾ Õ"""Open bzip2ƒáed tar archiveg ñ	 for reading or writing.™  Ú �   Appen! €vallowed% 5"""1 ­ nAin (Â –"w", "x")£  ] Ec Value¤:pmust be×P, 'w'™ R'x'")A : ˜Ëöbz2 import BZ2Fil„à! I m ‹ C­1ion$  ("S dmodule~”availableA —š ƒ ( !orsÈ	'é 	�+(hQ, EOFã )s ² �9Š Y 7œ ÑE®
¢ < ?obj• 
> Ž./xz� Û#etš÷¹ ‰Olzmaˆ×î ‰@LZMAŠ , 
 sç•` m–# †  � —Ò ‰Àls.taropen(nóame, mode, fileobj, **kwargs)
  ñexcept (LZMAError, EOF
 u) as e:+  2 J v.close(G   !ifo z == 'r'8    ¡raise Read_ Ñ("not an lzma£ ™") from es 7  ° 
] • 	
> ct._ext0 v = Falsn ‘return t
n ñ# All *open() methods are registered here./ ÑOPEN_METH = {  ô p"tar":   I ö",   # uncompressed tar/ •gz":  "gz. � # gzip 2 0bz2a 5bz23 # bzip23 xe xe  § " #†e  }- 6î Å# The public]òwhich TarFile provides:‚ Bdef wVself)@"""C�D the= ². In write-ñ	two finishing zero blockÒ’ €  append˜oQ carchivå $ 5"""0 0if � d“  ( rN¼   ) f = Truy:try< X  ¼ À in ("a", "w 'x"ü  Y   ] Ø.ø ú(NUL * (BLOCKSIZE * 2)²: œoffset +=0 ê  +   #ªAl up�end withQ-Q3  ð(like option -b20 forùG doe� a   I ñ, remainder = divmod(é ¯ €, RECORDÝ Ø 'if? :> 0a f   O 8\ & -J Anfinall¹ ÖW k} " y ×), è‘getmemberð g, nameöA"""R^  añ±Info objectY;   `6 S'. If P can Ÿ b{€   foundf @ïQ, Key§A is EdJ #a ^ ©occurs morM �than onceQ ‘its last : !re$ rs assumo beU@òmost up-to-date versionr À�@tari
=”_E 	" if{+ zis NoneŸî   ("¦ B 1 %r>02" %–¯ ð[ Ì sÍÇ zX@s of ‰€ as a li8fí s.E� ð    list has theñ same order as the members in £archive.
  5""" Õself._check() rif not  ploaded:= õ# if we want to obtain a list ofA  - >  ()   T# all¡ ,K Ùfirst have to@  0  R# sca× mwhole Ý breturn» 	
W Ðdef getnames(œ !):  c B"""R8 @(of@ ^é   1ir M 0. IÁ sN     ™ &¡ Ped by� ¤ /() .   [tarinfo.r S for   å Í E.getK ]ò * ô ,³ `=None,< O  qfileobj 
ð Create a TarInf÷‘ject fromê Presul ø os.stat or equivalentð on an existing u Q. The
 ’ is eitheZ#`£ X', orG ’specified– G 1 ob– ` ²obj' with aZ Ùdescriptor. I¨±given, `arck  \ sª ±alternative;|° ‹™ �0, oÇ Qwise,# [  ß Vtaken:' »' attributeD'Ì   H 1 rrgument< E � should b©9texvostringb>b"awx")> @# Wh¯  À .creplac%by#n ~as real4x $if   L  c Šˆ t Í =( ñ‘ PBuild; ª, §þ   ˆ{ ð# Backward slashes are convertedÏ8for! ,× PAbsol¡Bpath;  h8 2rel" t $ifd ï ë s! ='n 5drv�  =T X Ã.splitdrive(9 ± $ =q .¢(’ep, "/"/ 	l#!p(& ‰ `# Now,‹l}  `,   trmationDc/“" =¨ � @.tar)    ’ ˆt needed0Use(|@os.l q, depen0 on½°symlinks shŠ¶be resolvedž 
¦·ºdereferenceÇ Ë ƒ 2resÄ‘ (²ˆ % ?els;  H : À   else:
     àstatres = os.f �(fileobj. dno())
- ålinkname = ""
 pstmd = = µres.st_mode !if �.S_ISREG(/ %):  ] @inodV (D Aino,9 T 6devŠ 5 øf not self.dereference and8 n¶ A > 1 \x  G   € "inM  s/ 1arcñ (!= [" ]Ä  H á# Is it a hardy Ýto an already} °# archived o?! 0typ}LNKTYPE  c ¡   	. Oelse± AThe Ï ù is added only if its valid.J é �For win32ð  ; ~lways 0, Ã ?REGÃ  i  ÿ/[0Q  l á£ sy  =7 ø ™ (elg?DIRgŠ 9DIRŠ 
< OFIFO=   > ?LNK= 9SYM<  ß Ã0os.'  (Þ ð
£ /CHß 	/CHß 	/BL¡ 	*BLh6¶return Noneõ# Fill the TarInfo object with all©ö	# information we can get80tar# .ê   dv%md]  +ui‘.ui% g% g% 2if .#= ¹
=j 0siz ¸  ‘ @9 0+  1mtibS  )   §   C@ $ kif pwdÏ *ry  š’ uJ Õpwd.getpwuid( eid)[0]^  9 þ except KeyErrorZ Epass2 jif grp% t� 	g� 0grp� 7grg� g� &‘ \Cin (M#, ¹ñf hasattr(os, "major")<
  in 
æ  ,H1dev= Š rÿ=  a =   = À        retuð0rn tarinfo

    def list(self, verbose=True, *, members=None):
3   ó!"""Print a table of contents to sys.stdout. If `X ñ' is False, onlyƒ  P À   the namesL   { ` are pm !edM  itF ¢ ø an `ls -l'-likeP Qoutpu+ `produc> `T ˆ óoptional and must be a subset… Q  'ó returned by getP 5().* 5"""  U’._check()q î $ifX Ê  [Z   V 0 = A N 4for½4 inC 
; $ifÄ
  W a_safe_Kó (stat.filemode(. %))q  5   9 ¥"%s/%s" % 6 u· � ].uid,E  I   { gE ?gid‹  $ifˆ.ischr()y gisblk(¨q 
Æ  10Å ¦ 
y("%d,%dì •devmajor,‡   _inor)®  Nelseˆ • � f Osize†Rd-%02  
 : ?" \× 
À% time.local
 Èm W)[:6]¬­ ¤ ¯y+ ("/" • di• ú K "")J Ÿ		F ?symÈe-> " +�@linkš >	^ /ln& O  Ïc Vî sdef addT � P, arc	 I§, recursivjafilter  Áa"""Add ®  `E '”  #„archive. 1mayÅany typ– 6 ð(directory, fifo, symbolic î q, etc.)iƒgiven, `» 'G àspecifies an aº RnativÃ ª0he }  «¬ F DŒ H  re5&ed lygñdefault. This canã Avoid‡P •setting ``+r2. `cý`a func@ ðthat expects a TarInfo object argumeõn¥  	sšxchangedJ 
; ,##it> s ó: 
' y will bÇPexcluê Afrom4 õo rð"awx")

        if a÷rcname is None:
  a  = $ 
 ô# Skip if somebody tries to archive the 5...;  4 @elf.Q  u 1noty ð and os.path.abs (% d) == s3 
   ñ_dbg(2, "tarfile:� ‘ped %r" %» )€  Þ freturnÏ G #1,/ 0 ñ# Create a TarInfo object fromæ  u á @tari& µ 3get Î ,×  3if #  †	Ÿ æ ÿUnsupported typeï ò# Change or exclud®
à Ò �if filterŸ °
‰À =* ( 
xé  œí 	ÓE¨ Ô < Ø�# Append¦¡tar headerk@data¯§õ© Š.isreg()ï ãwith bltn_openÙª"rb") as f-  š Ö 0add+F, f))elu <diru D `‹recursivÉ „ ¡for f in s4€(os.listj ‘ä  3   w  0  •D.joió 5f),´ 1 Û ,N F  ¨ ,2=c	sÆ ‹ F1 Ddef ` ' ,S` Peobj=Yä R"""Ad
ù# `½' P If `} xobj' isâ ðgiven, it should b3`binaryã !e,w[ ø.size bytes are readN \!it3 0addâoÆ^². You can cž
Ã 	š �directly,ð—by using ˜)ë5"""‡  GÓ._check("awx"k ËÇ € = copy. ×& Tbuf =‰q.tobuf(V rformat,×„encoding VrrorsÙ1  ilÄ«.write(buf  Úoffset += len  0bufm=H  ©  è #×„there's ’follow, aA&it$ �  h )( ß  C
#, • = ß  nàblocks, remainÂ„= divmoduF šBLOCKSIZE@ 'if; ð> 0:
             ð#self.fileobj.write(NUL * (BLOCKSIZE - remainder))
6  ¹blocks += 1 Z `offset ' %* X 
/ + òmembers.append(tarinfo)& ð def extractall(1 Ã, path=".", < õ=None, *, numeric_owner=False):p B"""EM D all> ñ from the archive to õ current workingG ð   directory and ë r ñ, modification time! ïpermissions onI ðies afterwards. `å �' specif a diffe‘ ~ J $to*c to. `p' is op� !al� Ñmust be a sub» fï L ólist returned by getP ‰(). If `j`e ¨True, onlyK  X!nuãð for user/group namö  re dœ 0notŒ  .H 5""" ý  B= []) š%ifÓ0is û   Â 0 = H8  — w4 inD 
< 3if # w.isdir(W \   $# ^¤ @withl0afeeÖ  4   .     … € = copy. 3)   - Õ.mode = 0o700H ! P# Do t•set_attrsÚðies, as we will déat further dowÉT.¬“ ¬,!_ =m — I,“  —  	e= ! + è# Reverse sortÂ ld & ð(key=lambda a: a.�å/ r] (r pSet cor ûï Xt/onŽ rn 
v0dir` = os.
 `.join(
 ,�
º  :tryH    ôf.chownž` 8i >  J uî J B1 - EchmoÛ, Ã 
- dexceptCPError€eÊ #ifm $ žlevel > 1(  ƒ ]raisea?elsX   0 ¯ À_dbg(1, "tarÌ“: %s" % e–“[ï8=""òœƒ™ PŽ	Kð	using its full name. Itsö file information is extracted as accurately
  ñas possible. `member' may be aV øname or a TarInfo object. You canP ðspecify a different directory using `path'. F³ øattributes (owner,O ðmtime, mode) are set unless `set_?  s'í ñFalse. If `numeric_P `P ðis True, only the nuó ðs for user/group õ sr  us@hnd notK = Uames. 5""" õself._check("r")
 âif isinstance(su, str):$  ¡0tarÐ1 = L 2get, 3 )- Oelse; 3 } `# PrepJ À ±link target@make &()Õ  if"  Š .islnk(§  ._9 _M P= os.ç`.join(
 ,G  )  `:tryÂ ó _Á_Æ (,] 	Y 	D L ==
 6 	Z= �°xcept OSErr8+s Ÿ"ifÓe  šlevel > 0 ² Uraiseç  ë  Pif e. ý  ;Nons  '   X°dbg(1, "tar7 Ñ: %s" % e.str• Í  5   z   S 0 %rV (W ,¨ )d e1E¯616'¸  µ e�4defG *(5 ", �	3"""¾ # a Q fromcqarchive…RAqë| è‡ þ“a regulara rL  s¡, an io.Bu™sdReaderŒ  6°returned. F·yll otheJ PexistÄ{ 0s, k
= š @does9i appeaK (inR, Keyú1is ùd„Y�	'Preg()4²Q.typeúin SUPPORTED_TYPESÁ1# M„ð s with unknown @ �CtreaÒÀregular fileGs.
  ðreturn self.fileobject( µ, tarinfo)
3 Delif ·.islnk() or esym():1  k Ñif isinstance[ k ›, _Stream2  6 ð# A small but ugly workaround fu ùhe case that someone tries€ N ðto extract a (sym)link as a ú -û ÿ from a non-seekableN  s· ! ok blockZ v braise ã ÕError("cannot‹ 	‰  ‡  ‡ )")u JelseU _  #A !'sÇ @ p is its™:get 
 I % Œ ¬`_find_-„_target(¤   ð# If there's no data associated with  ù member (directory, chrdev,P# blk ƒ etc.), ´ Nô ]0ead�Í
ê 2 ÒSdef _ð _ˆ ó ú	 úgetpath, set_attrs=TrueŸ  F ÷numeric_owner=FalseàC"""Eˆ³the TarInfo±  ° sè to a physical	 ˜p called- � é 5"""/ b# Fetcgh @–given namå±# and build¡Àdestination 	 -  wplacingn ð forward slashesÅ ÷platform specific separator0X ] ( =Ö —rstrip("/, e‘ e- ‡, os.sep¹�# Create Qdupper q'ieŠ  `dirs =E  “ @.dirô  ÷où6if 3  8 Ý1os.9 uexists(! )Ã” Š Ì@are I @partÕ )qarchive9t s÷# default permissionÒ  # pos.makeØ Ž    Õ  "ð._dbg(1, "%s -> %s" % ( Ä.5B  A  )=6	V gH Ë	­ <regoD  ï  +� ˆ ¾Ï?dirM   ‘ L OfifoM  N <chri?blk` 8devù Àrgetpath)
    ÷elif tarinfo.islnk() or qsym():
.  ãself.makelink(> ,4 …getpath)/ 	` ÿtype not in SUPPORTED_TYPESa unknownd /se@ Ofile= ¢ Ïif set_attrsF  /ch€ ö , numeric_owneró  %!ifè ?.isF  ( J_chmod¦  $  0 OutimÖ 	/#- 6&ð# Below are the different _á methods. They% £called via@ ó_extract_member() when  b() is 5 F ð can be replaced1L ðsubclass to implemŠ ñother functionality.
~ @def ¬@dir(?¨ ï	 ±úó"""Make a directoryœ á.[  š5""" 6tryH   @# UsJ °safe mode f\D\ ,SBreal!  is�S F PlaterI‰  * Pos.mké 3tarÚ v, 0o700Ÿúexcept FileExistsError¸ Jpass> ê? 3 :�source = ¢.: 5obj E.seen@.off·FdataÜ ebufsizH Ccopy L Ñwith bltn_opeY)ƒ"wb") asè
'`sparse´ Ì;Non~ Š è£ !, “  inW  x.@ 
_  4   ¹ë @ Þ      Û '(Ïp a, ReadÛ#, J n ¬ ® * štruncate(" ,el‚ ¨ ¤ 	n ¬ ²½ é  I	 ¾¢Á !ñ from a TarInfo object 3an Y  ›r  ¹ P   at¯] eî Œ  g ¿+ À_dbg(1, "tar3 2: UÞG ‚ ˆ %r, " \Š ‘ C   "0 ed¥qregular= @." %°  .I )¾ðfo(self, tarinfo, ãtargetpath):
  ö"""Make a fifo called + .*  ðif hasattr(os, "mk> "X  _ 2os. (P )D Felseˆ  0 ðraise ExtractError("X ñ not supported by system")
N ðdef makedev(self,À Ainfo	 ô 	0chal ÿer or block device	 � Pnod")S  § *ú sspecial‘ s Admode =þ . !  %if kisblk(­ - õ |= stat.S_IFBLK= ¬/ 2CHRŽ m ú7nodù , 3 ,S  '   ,  .  ·‘.devmajorÀ [inor)óOlinkô°(symbolic) > ê   If it canÀ§be created¼ ñ(platform limitation), we try to�÷ a copy of the referenced fileN pinstead) a• v:try1S# ForUs tha' å ‘ and hardX sY  |	<sym$ 0os.6€.lexists§U ,  Ñ# Avoid FileE4 Îð on following os.symƒ
• E Pos.un p 5( F  ' , 4 Aname>© 	9 Ï M r# See e.()–  ifµ 
s _t _æX Z   0os.% ¦ 3 ª  : ®    í#._² q_memberh._findc x )‚  K  Ð  ð ¶Pxcept_ Î !_e :ion™ª _ ® Hª  s Ÿ A Key�
¥  ! y`unableÅqresolve;ò inside archive") from Noneø †Qchown‚Ó 	 †÷ , numeric_owner*q"""Set   Ñ p accord2%toÃ £	L àðis True, use .gid/.uid ðinstead of .gname/.u ö. If numeric_owner
  ð+is False, fall back to .gid/.uid when the search based on \ J efails. 5""" óif hasattr(os, "geteuid") and os. …() == 0:9  ¨ �# We have˜ pbe root Vdo sop  + °g = tarinfoÁ 	G u 9uid jif not%
…  ^ >try   oif grp     — 0grpæ egrnam(¤  DI)[2]Ž  3 ÿ except KeyError\ Mpass: ¦ 	?pwdJ  s  !0pwd¦ (pw¦ F¦ 8¢ %ifºbissym(	7�lchown")Ä 2os.!  _ígetpath, u, g)%OelseF f E  !OSŸO as P  Ñraise Extract) q("couldnqchange ’¡") from e
« ô def chmod(self,	 Ú ð"""Set file permissions	3tar0   according<�n  ý® 2os.Ž O ‹ hFmodea T  _utimeÐmodification = &"�'� '‰ IereturnXL8 	`  M ¥ \  )^@
k/#- 6 ÎAnextº/A"""R._ " q member¦0he p0ive^ña TarInfo object,˜_  v     Fðis opened for reaô#. j PNone lø here is no moreJ –available] “Æ._check("ra"Ÿ1if  SfirstË c  t x 
q=m =. †  ! =F 	$ Àreturn m

    ñ# Advance the file pointer.
! ò   if self.offset !=  - µobj.tell():/  7 0 ! Qseek( B I- 1)/ jif notW kread(1X  \ õraise ReadError("unexpected end of data")
d #/ ã ¦next blocká åtarinfo = None6  whJTrueÝ :try  – D ê  €.fromtar
ø ñexcept EOFHeaderÑ K as r  a †Îignore_zeros‡  * � ñ_dbg(2, "0x%X: %s" % ƒ ÈJ, e)Ž  <   @ «Å+= BLOCKSIZE %  vcontinu6  Ø InvalidÜ »à lŽ'O== 0�®€str(e)) 
oY Gmpty7[ € & "e\ ê"† �TruncateÁC§Subsequent 'p#w?ionU ò °¿import zlib�if isinstc1(e,*  .e¸Ú  R   Ä  f'a  7 o: {e}'º >   ?elsC     ` 
³  ·Õ Œy ( @ Vbreakr3if 1 isÝ [
O hó members.append(5 ™Ê 7  _loaded =  x dreturn|  /#- 6åò	# Little helper methods:n ‚def _getÙ rt, name,– =÷, normalize=Falseò"""Find an archive N 1 byK >Öbottom to topÎI   I~ðgiven, it is used as tóhe starting point.
  5""" ö# Ensure that all members have been loaded@ " £= self.get 7()
Y “Limit theS ö search list up to tarinfo[ $if Õ is not None:V  Â m # =X 3s[: s.index(V &)]Ž »if normalizN ð name = os.path.&  	 ( Ï 3foro Ó in reversed(y )¢ n À _a y S . )ø ;els¼ N = ý  '  “ ê 6€ 
·  ( creturnë C Pdef _(ïë ñ """Read throughëpentire éðive file and look EˆreadableÛ ¶ s¢ whD ;Truý æ †Znext(1
MI ð UbreakŒ  á .ì Ped = u Qcheckp, mode=S 
C# € if TarF¸ áis still open, —  he �ration'sN … à   corresponds'M ) '"ifŽjclosedÙðraise OSError("%s]) 2" %8 ±__class__._&__M!if¢  6 “Ê / 
ª!in& { 
6badù ? %%rˆ   xyófind_link_target€þ
~0FinŽeD3getÆ� of a symF � or hard x Ñ)th‘¿j~ w.issym(…  S„# Alwaysð 
X  0  ‹  îð = "/".join(filter(a4, (�0dir) á$,î FI &))»a  ‰=KfN2# S¡ ± Q befo e _ ±, because aG 5 isW  p ð# just a referenceÅPan alþyde x  ÷ 	d l]=ü ¦ } Ô_�(G 0=D ,=ð; ö ø ŠÚ3KeyV` 1 %rPfound× Z eq_iter__ãU�"""ProvidK $ ©ator objec×À"
        if÷ self._loaded:
  ¢yield from% ymembers$ ureturn
 1# Y6 ÷items using TarFile's next() method.5 “When all d ô have been read, setH C as ° C —index = 0U ÷%Fix for SF #1100429: Under rare circumstances it can? ó happen that getš ð() is called durá §iteration,? ¢which willÍ  alÊ ÿ y exhausted the"ifsCfirsz  w Šnot None¨’tarinfo =4 eŠ  ÑI+= 1 á? Ä›while Truh 2if I a< len(9)’  t W – ) [B ]‡ Pelif Û R ÛQ ç   w K ~ F  $ h ! =ê 	‘  $   Ý   ;els  )  è  s�def _dbgQÇ, level, msgUð """Write debugguöoutput to sys.stderr5"""Ó "ifU # <"E 
öprint(msg, file=T )¦ �_enter__« Ÿ Qucheck()x •	D 3xitC ÷	, type, value, traceback[ !if$  þúx Wclosew £ # An excep¥ñ occurred. We must} Ó L … becauseË  å##�would tryyw“Àend-of-archiµölocks and padding– G ¡» @_exto:obj� ) "  .™ 	‘ !  dÆ?
#-  €
# exporu@funcs+  è`is_tar{ S(nameŽA"""Rî1 È  ame pointsda tar 8wC q@able) €handle, ª &bFalse.(@   'y A' shppbe a stm A, or©Â-like objecthú6tryT¡if hasattrÒ 0, "�"Ú  n  �t = open(û @obj=… Ð ¯ S 	1 
) t¯å  TÃ� ÒVErrorV )  

�  ÛA. 0


£Smain(¿  imÜ’ argparseDbdescriñð= 'A simple command-line intñerface for tarfile module.'
    parser = arg ¡.ArgumentP ×(description= )> c.add_a7 ñ('-v', '--verbose', ac?  'store_tru ádefault=False,O  ‘  rhelp='VL ‚ output'~ sgroup =Ä † ñmutually_exclusive_& ç(required=True? 6 ¼ l¼ ólist', metavar='<=/>'ª © PShow > „ing of aw´ u  �'--extracx �nargs='+n š (› 2 '<!_dir>')¬ Ep ¢ P into get dir² 	c'Pcreat¾ ± Pname>A <�¨ Cf  š  0 ß from sources¤ 	 I_'--teË$gTest iÃ“ is validv  ¥> As()
Ï < @rgs.‚  < ‘not None:  é2src{%  cif is_tV(src)4  8 �with open �, 'r') as"
(  , Ðtar.getmemberœ    lprint('  , m²=sys.stderr59 Ü åw V P'{!r}ü ð archive.'.format¿ )Y 7els k U¥r.exit(1, O  K
S +\nU M$el©  ” ‰  : … % 8  | …ˆTarFile.�#:*�f0tf.e (8=D. 	Sfqif len(– ) j) == 1Ê ¸& 5[0]9 =PcurdiX2os.  ”f 2f ", = &n L 2Ao_¤#()Ÿ § äE¨ ’all(path=Æ á| hþ
ü ! 8  ‚>'.'"  & Smsg = ³à is extracted.û '.format(src)
  ]else:  % ÿmsg = ('{!r} file is extracted '5  9 ‘   'into : Çdirectory.')Š Ž, curdir’ –print(msg ¥ ò parser.exit(1, ¥ ùis not a tar archive.\n!)
¸ ñ elif args.creatÜ  < 7Non¨tar_name =, f.pop(0ž  _,ô = os.path.splitext(@ , ñcompressions = {� 5Y # gz Ë'.gz': 'gz', t <# xD xD xD   [# bz2p 0bz2Š   ‹ ba  7   }w  <0mod|x'w:' + <�[ext] ifz)in  /6 'w¢ L  Â sõ ~õwith TarFile.open»,M_‰ z) as tf-1for'!in. k 
(  e ptf.add( / ‹  �\verbo‘ã =  ³%d.Ù à  ¨�))

if __ ò__ == '__main__'‘   ó ()
r"""TELNET client class.

Based on RFC 854: ( óZProtocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = ð('www.python.org', 79)   # connect to finger H b ñtn.write(b'guido\r\n') Hðtn.read_all())
Loginƒ@   Në  3TTY
 `  Idle 1Whe2 aWhere
f   Go ° van Rossum r  pts/2 ð  <Dec  2 11:10> snag.cnri.reston..
© Æ

Note that « R won' ò until eof -- it jus ðs some data
-- but  guarantees2 S ð at least one byte unless EOFè€hit.

It €possible= cpass a¢C obj‡Qa selè� in order/ Bwait® B
mor™  S Æavailable.  í  ?’his case,û ðeager() may return b''
evenþtƒA wasó  ¶ðthe socket, becausJ4e p¾anegoti¼V Phave
 n <  ;@.  Tˆ `is whyPError¹ `neededä i ª Uñdistinguish
between "no— "# "µòion closed" (sinc  ´ Ñ also appears y
c ´Ping w{i–D ð ).

To do:
- op’ð negotiation
- tñ8imeout should be intrinsic to the connection object instead of an
  opt Pn one  7 r" ñcalls only

"""


# Imported modules
i 6 sy Uocket óelectors
from time 4 àmonotonic as _ ð

__all__ = ["Telnet"]x ñTunable parameters
DEBUGLEVEL = 0% 1 ÿ protocol defaults
TELNET_PORT = 23- `characZ ø2 (don't change)
IAC  = bytes([255]) # "Interpret As Command"
DONT- y4])
DO A j3])
WO( 2  ILÌ i ˜1])
theNU x0])

SEQ ñ40])  # SubnegotiañwEnd
NOPŽ "41) qNo Oper' 9
DML 2# ØData Mark
BRKC 3  ‰Break
IP< 4 @rupt‹ycess
AO(  Bð # Abort output
AYœü "46K ù Are You There
E‰"47$ tErase CÀ9
ELm 8& yLine
GA! 9! æGo Ahead
SB = ï]QBegin§ ë voQls codeK#É  sek±s all come aarpa/tÂ–.h
BINARYx … �# 8-bit d›–path
ECHO$  Ý˜# echo
RC÷°pprepare#reF
SGA@  Úñ # suppress go aFNAMS&  ä÷# approximate message size
STATU/  ëö# give status
TMM  æ#Ping mnFRCTE   âq# remotÌðtrolled transmiss»2andö 7NAO@ ø$# @e ab,nè line width
NA$ 6 pç fNAOCRD© 1¡n  CR disposi’ k 'HT1³6 òhorizontal tabstops; q  ¨© 
; } (FFB ð} Œformfeed< V¹ < bvertic·  ¸ (VTv : 
3L¶ 3@ ×)LF· gXASCII¦Pàextended asciièú§ set
LOGOU‹1Hçforce logout
BÃ12 ¹— macro
DE? 2´øentry terminal
SUPDU¨esupdupP' AOUTP— Àbytes([22]) ÷+# supdup output
SNDLOC = bytes([23]) # send location
TTYPE$ 4$ ÷terminal type
EOR" 5"  E çor record
TUID# 6# óTACACS user identifiv gOUTMRK2 72 ¹ € markingœ 
Á 8& � Å ø number
VT3270REGIMÓ 96   Ç regime
X3PA° !30" ÆX.3 PAD
NAWS› !31 øwindow size
TSPEE@ 2# ˜ ·speed
LFLOWH ~÷remote flow control
LINEMOD´ 3‡±Linemode op­YXDISP3Ž´X Display LÙ·OLD_ENVIRON… šùOld - Environment variables
AUTHENTICATI; £@AuthËÇcate
ENCRYPT` ¢QEncry³ º ?NEWŽ  š?NewŽ ñ+# the following ones come from
# http://www.iana.org/assigØ ’s/telnet-Añs
# Unfortunately, that docu’does not C · er; �to all of• ð m, so we are ma± ` up
TNnÐ4b  
Xe64c w
CHARSET4^ G
RSP: UTå " R\úSerial Port
COM_PORT_OPÏ4b1Com) " CŒ! O·÷
SUPPRESS_LOCAL_ECHOv uv �Suppress{—l Echo
TLB4u/ ètart TLS
KERMIé b —
SEND_URLw ]  ç-URL
FORWARD_X# R ¸
PRAGMA_LOGÌ"13K rTELOPT %  % ^
SSPI0 X 0  # . ; —_HEARTBEAÎ 1ô	d ) W
EXOPÝ "25U’Extended-‰�s-List
NO¨ Êð	0])


# poll/select have�  advantage© Ì`requir>òany extra file descriptor,
#Ž¡arily to e\ Àkqueue (also,2ey N òe a single syscall).
if hasattr(• ±ors, 'PollS¥ ²or'):
    _ 5 = 2 .0 _
else3 H  ²or


class e !:
s 2""" ± interface ' .  ¡An instanc:Bthis  0 reá`ents a'0nec� '1a t|b Æserver.  TheL Áis initially\0conB 1ed;°aopen()A àmethod must be:de ™establish ð.  Alternatively,õ- the
    host name and optional port number can be passed to< ñconstructor, too.
S �Don't try, óreopen an already connected instance8 ðThis class has many 3 ð_*() methods.  Note that some of� mz ðraise EOFError when C end( ~ aion is_ ‚, becausAtheyò Qretur¹ ðempty string for other< 0son’  Se‘ @ ãindividual doc6 sâ Î ‘until(expÁ, [timeout])Ä  •QRead ( ¿ , N óbeen seen, or a E 5 isF Àhit (defaultí $no& È); may block› Kall(† ƒall data� ?EOF<  �= ðt least one byte¬ C ­very_eagerI † •availableO`queuedY oíusocket,rwithoutî 8ingñ m !eiàö µf  è Œ z r ‚  z 	Olazyæ iÊ Araw y � (process‚¤it first),a y  do!  8ƒ H I/Oï az  %s ç{ bcooked~ h  ` y h 0sb_>à &s 2  P betwÇð SB ... SE seque E¢Qset_o €_negotia¬¤_callback(	 ÁAEachó  Selnetá  Œ ¹á input flow, t†U á €(if set):  i !ed}Ÿ`followzÅparameters :;  / ¡ tƒ ›£, command,” ·  é P will|echr(0)Ñ reˆ #no; .l #No� ac & d|âafterwards by ‰ 3lib2"""ºñdef __init__(self, a=None,&=0Y ¨  |=Ú ö
._GLOBAL_DEFAULT_TIMEOUT)F"""C<†  K W² 1` ¸ðarguments, creatª? unG C   aWith a¼ ÛC D, its¼ƒ;Þ òO Ý C areo&alq ; r    1õ	.debuglevel = DEBUGLEVELS % u=  
 w=Œ 
 † =Ð:out  z0 = ¨
 ð	rawq = b''
        self.³irawq = 0
  °self.cooked :b'' >eof0 Siacse/ ú # Buffer for IAC sequence.J  sbI q # flag- ŸSB and SE3 Cdatai 
N õoption_callback = None$ áif host is not :  û ø Popen(( ñ, port, timeout)
, Adef #  - ,Q ) %=0+ ö=socket._GLOBAL_DEFAULT_TIMEOUT)v ñ """Connect to aO .i  ‘ BThe Õ ñal second argumenÇ 1the¥ á number, which¨  ? €defaults\  + ò standard telnet; G(23)s �Don't try5  reë Ò an already c® Ped inO Ò5"""{  .(!ify W ©   ê = TELNET_PORTI  �! =
 9   
 µ$ =¿ ¢ys.audit("Qlib.T.î 0", ½ Û)=   Þ0 =  £et.create_Gion(>)?€__del__(g 
ðDestructor -- close ¹] .e& (_ 1msg[ Ê, msg, *argsg ðPrint a debug message=!eno  Plevel-7> 0!…If extra‰Às are presen/1hey ‘substitut- Y Gs ` using  L›0str pformatt ‡operator„ !if°.µ ´ ;> 0` ñ "('æÁ(%s,%s):' % )._ö.J¦), end=' 'ù ¦ ifô s[   p_ Qmsg %" 
7 Oelse4 ºFset_Ç œ ,¥Ø 
Å1Set:1  ! " :€higher i+,, BmoreQ ð output you get (on sys.stdìJ l ²i=M } ¶ ’ , 
² CÐoµ : .^0 Ó g6Truë ’K w  C:ock¥ � .Ë £@get_ !etŸ
á RReturC$ @ objÜ!us‰ternallyÅr5 ²  6 Hofilenoh $ A) ofâ B /etx À   return señlf.sock.fileno()

    def write(self, buffer):  ! @"""W  ð a string to the M �et, doubl òany IAC characters.d  G ÁCan block if? Òconnection is åed.  May raise‚ OSError9 gclosedi 5""": !if‘ #in× Ö  “ ë # = Ð.replace(IAC,8 U+IAC)L ñsys.audit("telnetlib.T
 .A9", C: õelf.msg("send %r"g
$  R.$ Ball(ž ¦£read_until«úmatch, timeout=None¸QRead 2 „ a givenÃóis encountered or' L O�When no m  ªðfound, return whatever õavailable instead,ß �possiblyúSemptyŠ @.  RíO EOFæE 2is î@ and” ¹cooked data€ ¿ �n = len(Ë Ù ŸÖprocess_rawq( 1i =Õ.k lq.findA šif i >= 0_ < 5i+n¿ sR I[:i]#  Do , *i:, …5bufC  ^ @not 
š Àdeadline = _òD() +GI bwith _áÐSelector() as 
U s$ “.register¦ Æs.EVENT_READa `while « ü :eofZ  $ %ifw .R (º 7outó )   ~amax(0,ôZ Å:)-n� 4 % Lfill!   % /     � , v ;?, i� JS    W V   <buf6b+   ¢ 8 n 0  z  ‚, Ä5 = ”-”Š-   ] <q    UbreakB ® í G˜very_lazy  { ( W1"""J2alllSBEOF;¸=Ò¨.~ U .8< ™ Y Àbuf = self.cƒookedq
  bself.c e = b'' ±return buf
 àdef read_some(9 !):  K ò"""Read at least one byte of ` ò	 data unless EOF is hit.^  E Rr X'' if# p  Block "noH åis immediatelyˆ —availableW 5"""   · õ .process_rawq() ¡while not & ¶ Vq and 6eofõ  ´ + LfillN  n Ybuf =j ‰ T  •¯very_eager›e# ðthing that's possible without bf ! �in I/O (Q )LPRaise›PError‘óconnection closed1öÚ Ÿ*  î(no1  ) µ otherwise.F CDon'­ P in the mid|ÿf an IAC sequenc0 eoU d±Qsock_£ (ò!nûf ®r_lazy()"€•æ < 7ilyA wÂñQÐ°x×kì ˆ SB"""P­¦ % ÒÄ alò#y €queues (M ¸$^ ÝH ×  °'  ©½° ±8 B._B  . 
pç 2anyi
cH j  (K  n~ðð """
        bufó = self.cookedq
   e = b'' âif not buf and? "eo   ; Urawq:3  U õraise EOFError('telnet connection closed')7 `returnj 
 ðdef read_sb_data(k )g B"""R3 @any " ò available in the SB ... SE queue.Z  ¡ ; Ab'' ã + F ñ. Should only be calledž  D àafter seeing aB  orl ðcommand. When a new  5 isB Ðfound, old uní  ( Ë @wills ÷discarded. Don't blockÉ 5"""O  ¦ã sbG ã ãy`set_op©�_negotia  AbackŒ,  
–•Provide a  C funöB :Ðeach receipt T 'z .Û  ý. _† % =b Ù 3€process_”§ 
� òTransfer from rawB to  a6Set÷wÒÆ#isÉ(.  ¥ unless inœ �Bmidsê Øn IAC sequenc˜ô ÏP[b'',”]L &ry ŠRwhile¦  ø 
  ! cû  –_getchar(} $   ð [iacseØ $   pif c ==eNNULLq  %   …continue¼    F b"\021"F ) !=RB Abuf[D0sb]  ?+ cŸ  § À 
Oelses o E? +=d  �elif len§.* )V1U p# 'IAC:é Â CMD [OPTIONŸöfor WILL/WONT/DO/DONT]É Í  x€in (DO, ( ,;  , < 00  Ò ) 6XG 
n@   ¥ =×@¶w PSB: #�Aostart.Ð  ®   Ø osb = 1( ¡ Œo G  #j/SE. } 0} À            ú    self.sbdataq = �+ buf[1]
)  # o = b'') "ifZ ÿoption_callback:1  n 3# C( ÿ
 is supposed to look into@ Cthe Ü * 
œ ( ÿ sock, c, NOOPT)F OelseÎ ÿWe can't offer automatic processing ofc 2sub© ÿs. Alas, we should not get anyF `unless; ÿdid a WILL/DO before.> 
¢msg('IAC %w þrecognized' % ord(c).‚elif len\Ïiacseq) == 2<4cmd”- O[1:2�– % Œopt = cà 0if p ßin (DO, DONT)—  Šp os %d',X  .    ] ð== DO and 'DO' or ANT',3?opt5  <   D"§ 1v~Ú@md, x » Úd  O �.sendall(�+ WONT +^   s ‚,3 uA ^ w 
 y Ÿ yÃ »yðexcept EOFError: # raiP"byœÚrawq_getchar(¼â]° # Reset onS 	=- isb = 0 Epass % ecookedw w0è- È - 11]
[ Idef È  ; QÀ"""Get next è P from2 r queue.F  nÀBlock if no  ƒð
immediately available.  RI [‰  C °when connecö B  clÃg 5"""0 m t�
} Ê `.fill_á ¡:eof6  ˆ èŸ Àr
        c Á= self.rawq[
 i : S+1]
    8 . E + 1$ "ifR  q>= len(9  Y %):)  T  n = b'' F 5= 0 ‘return c
 �def fill_] g b ò'"""Fill raw queue from exactly one recv() system call.Y  ž ò Block if no data is immediately available.  Setø �eof whenŸ  F  connection@ gclosede 5"""+ <Mõ2# The buffer size should be fairly small so as to avoid quadraticª ò# behavior in process…u) above+ 4buf.Qsock.s550)! Pmsg(" P %r",¤ !  Xo= (not   þe  +% Ê # y _¯$ @Test³Etherè-  Ü€ on the C 8et.¯ðwith _TelnetSelector():s î$ ‘.register� ,8 Æs.EVENT_READþ  Drõ@bool4 . .e F(0))é €interact& fI  ‰1fun’ñ	, emulates a very dumb tÓ j clienó  ¢ýys.platform == "win32"ë Uf.mt_� Ð IW4'orƒ�ys.stdinˆ¦  ‰ªwhile Trueð   ð for key, eventso 	 (’ 2   if9 €.fileobj' b 0 ?try  % Etextªead_eager(… )  ÿ except EOFError^ Æprint('*** CÝÚÿ by remote host ***'w   Ü	f   0if Î ’ sÅ out.write(3 ÿ.decode('ascii')‡ C _flush-/el­ ~ /in¥ @line‘* P.read Y().en§ 
	 þ 6 i  7RÐself.write(liñne)

    def mt_interact(self):   õ"""Multithreaded version of 4 U)."""3 ‚import _3   £.start_new r å.listener, ())4 vwhile 1�  “ ðline = sys.stdin.š   (9  ( pif not  
A   Ubreakh    ù p.write(3 ÷.encode('ascii')/¬ º 
,©Helper forUò) -- this executes in the other +	Fû >tryË @data1elfk_eagerþ except EOFErrorF ðprint('*** Connectæúclosed by remote host ***'l AireturnT0if ž n ½3outs ' ;.des W  OelseI 
gflush(¨CexpeÒ , µê, timeout=NoneºñRead until one from a6  ëða regular expres¢s matches.J © ÷The first argument isH F  @, ei9öcompiled (re.Pattern instances) or un% •strings).A  …  opÀ›al second� ,†!  s;
EaultG Tis no2ä Rè€ a tuple ¿�e items:ÖPindex]  ã z& e\ $T thatX;L @re.Mhf objecŸ oqed; and* Ptext � up till ‘including$ ³Í  If ¥9  K  õ  J 1wasN p, raise( <iO¸ wise, whenohi e Bes, ¤ ` (-1, s , ¤ ). r   ‚  - ñreceived so far (may beÁ bempty õU if aTÕª happened)ç Ãò ends with a greedy}˜ (e.g. '.é orq 0morŠ !an(C can=  É °same input,¸ ¦ ñresults are undeterministic,° ì ‚depend o$0I/O‡7ingÒ rr `f t=¿5[:] ðindices = range(len(+ s »i», 
sTqhasattr< ×[i], "search"T   3 Cre: û !    … 0[i]™ #e.Ü^ j if Á / Ý õ 
¢ @deadÀ@ = _C() +6 Àt
        wió
th _TelnetSelector() as s 7:
   õ .register(self,. Ùs.EVENT_READ): �while not, Zf.eofZ  e  L ê.process_rawq(D  $ þfor i in indicesF  & ñm = list[i].search© Ž.cookedqW  5 Oif mO   Ÿe = m.end•       btext =â k I[:e]	 (  ñ ) 8 /e:8 àreturn (i, m, v Ò Ñif timeout isyONoneà Rready� .è(A ]  Á  ð  = deadline - _ "!if‡ m ˆ  W ¸ ?< 0(  , _break^?elsð  <   �continueC ™Lfill‡ l) f.É §_very_lazyõ é , 2andòåraise EOFErrorƒ Ü@-1, ²à! Ñdef __enter__Ó)":  ¼ 
. 3xit- ÷	, type, value, tracebackE  > °.close()


q Stest(# ð"""Test program �t?Blib.w æUsage: python  ò
py [-d] ... [host [port]]7 �Default  €is local 3; d  /  Î#23k 3"""ê Ábuglevel = 0 qÑsys.argv[1:] Œ –] == '-d'B'deG  !+1R  2Fdel T ¢ ¤ E = '± '/ 'if* &:]f 0 G Ý ¾ = 2=  & 0str„Ê 2‡  Ÿ 6tryh    / p = int( 6strÍ€except V„; ôsocket.getservbynameL r, 'tcp'S Rwith KC&tnQ vtn.set_T( ?  ® €tn.open(" , ± ,ÅI=0.5) i0act§i ™ !__Õƒ__main__ÛÁ
¼ðmporary files.

This moduleÕñvides generic, low-7Rhigh-ay PfacesþÉ
creating te\ 7 1dirQðies.  All of the‘!erE @
prov gd by tŽ Àcan be used \ Ê@fearC  ¹Ã conditions
Ë Ž0'mkŠ D'.    3ð	subject to race conditioòŒns and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all 4 À values willœ 1in - ð.  Ex:

    >>> tempfile.mks !() �(4, '/tmp ’tpu9nin8' 7 d7 “suffix=b'% b> ôpbi8f0hy'

This module also&ñs some data items to thRr­ òTMP_MAX  - maximum number of 0Ethatï Átried beforeÑ  ð  Ágiving up.
 þ 0dirW @If tŸ `is set� Pa str, G ‘ Pfirsté: ofX òany routine fromN mí ,Š�considerÖD ð	other candidate location� Qstore³ `orary ·ñs.
"""

__all__ = [S ¡"NamedTemp, ŒFile", " ò# high level safe interfacesH _SpoolJ 	²Directory",2 I o !mk!",z	 _# lowy 	 mkX; H ú # deprecated unÃ � ; � 0getU jprefix[  # ˜Ctantù  ) 7dir7  T 	I b$ b	p]


# I�ats.

i
 � functool¶% _  rwarning    io4_io o( $os ashutil&   Berrn> 
 
¢srandom š R Bas _ < "syg %syh Btype 
 * qweakref€   €_thread
¨ Ô“e_lock =  1.alì ð

_text_openflags) Ños.O_RDWR | _ UCREAT ñEXCL
if hasattr(_os, 'O_NOFOLLOW'):¾[ #|=O ) j

_bin} 
� g eBINARYe 
B d & 
A §@  ø  R
elseÅ  € = 10000l^ðvariable _was_ un•…ðlegacy reasons, see issue 10354.
# But¼ñof 3.5 we actuallyòðit at runtime so chang!@it w	ñ	
# have a possibly desir‘  õ± effect... m Qwe do?1wanu¡support
# Ðah� API.  IY�undocumenòâon purpose.  DJ pdepend 4Phis.
ÉlLp= "tmp"+Iæ4nal² ¡B_onc~ u	�ð()


def _exists(f²n):
    try	   Ñ_os.lstat(fn) æexcept OSError* Âreturn False) =lse òTrue


def _infer_8 ³_type(*args‡ ð """Look at the   € of all & ° and divine  ²ir implied Q 1 A."""Œ  e b = Non£ 0forM 0 in s®  if 1 is,   `continÇ     ðif isinstance(arg, 8ƒPathLikeÑ  *   Qarg =! `fspath1 !)
§   M  Dbyte #   #ifé Õ Wis stŽ #   ¡raise Type¯Á("Can't mix V GBnon- 2in 1 <  "¶ Ò components."0 
mY Þ e 2 É 2 
t ) Ë o1strÉ ³  R² €if tempd•B8 or# ,´=  1  #G “file APIsñ! a ±by default.•  #^ð# we could check óaõ but it'll fail later on anywayT  X • 8    ‚Õñsanitize_params(prefix, suf 3dirò ¡"""Common + e ¡processing© Bmostû åin this moduleØaoutput�  TR Â #if“ å« 7 = ^ (ã2if R 6 (if0    ‘; =× pŠ  a¹,  J�fsencode(9 9 Ž d	€» ‹  8 P= getR 3dirà Œ - b. ÿ	ã,ó


class _RandomNameSequenc!d"""An B ç+  ñ generates an endlessBsM  9 Ðunpredictable)ðings which can safely be incorpoR dG Qinto nÃnames.  EachD  Fòeight characters long.  MultiplTxthreadsm !us¤@ samw (Ù Rtime.ú ió  itÿ !orþ² ‹ ò= "abcdefghijklmnopqrstuvwxyz0123456789_"f ð@property
    def r³ng(self):
  õcur_pid = _os.getpid() 4if " ¡!= getattrD p, '_rng= w', NoneV  ]  i .#  \ gRandomY 	"  E $ =j } ureturn I 
 Ádef __iter__Š x 2 - Onext- q''.joinK Â.rng.choices ñcharacters, k=8))

� ócandidate_tempdir_list(Œ à"""Generate a  E of 4  4 ñorary directories whichä Ä_get_defaulta Ó will try."""Þ !ir\ B= [] €# First,( ñ the environment.[ 0for ñname in 'TMPDIR', 'TEMP 6MP'!1dir, !penv(env 	() :Ó  – ƒ.append( )¡ £ailing tha¨ òOS-specific locations® !if˜ m z == 'nt› i 0exti [+ ñpath.expanduser(r'~\AppData\Local\Temp'), ‡  
G ÿvars(r'%SYSTEMROOT%D Pr'c:\ç2',  !mp  r\tmp' ]EIelseu
Ú  '/- u, '/var "us  E Ï @# Asq�ast resorb heZ@rent›ny^>tryt · ƒgetcwd()£ ñ
xcept (AttributeError, OS	 û Nd˜ K ccurdir§' Ró O`CalculP ÖÐ € to use Þ v]CfileIòThis routine should be called exactly once.©�We determ1 ûwhether or not aË ˆ Ñ is usable by�1tryèPo creº �and write®  a ž  ƒ 	 B š‘  If thisE áis successful,ÓCtest= ñs deleted.  To prevç�enial ofC rservice= Joa &e I @mustr§Fizede 2 rÄÃNameSequenceÐÈ $ ã¶T ž0dirõ 4  if" !h/ V c 1os.�0abs  `  $ @# TrÇ�ly a few ¾ Ps per^ b .  � 0seq� —range(100Ç #  @ 0 = B( rl    Ä  ™ NAdir,} 
0 	r A   fTopen(S p, _bin_ Êflags, 0o600P  ? T  À              öwith _io.open(fd, 'wb', closefd=False) as fp:
8 
 ÿfp.write(b'blat'). finallyK A_os.} >(fdC ? 
 ; þ unlink(filenameB ©return dir  þexcept FileExistsError§ Opass9 ¯Permission9 r# This h ðion is thrown when a“ qectory •°the chosen Ê 	u  ~±# already e± Í on windows.- @if ( J Ð == 'nt' and  ð path.isdir(dir) A  r  , `access( ,< nW_OK))( 0 �continueM ñbreak   # no point trying moreï `s in t22dir	G H? OSoc (Qraise
�NotFoundd ù (_errno.ENOENT,Ž  î  ÷"No usable temporaryàfU  á _%s" %J 
°dirlist)

_¼ñ_sequence = None

def _get_candidate) #s(•õ"""Common setup A ñfor all user-call¯ ñ interfaces."""
œ qglobal X �  +if  Ö ˜ ö_once_lock.acquire(•+tr
Q h
� ó  = _RandomNameS&k :� dreleas� &
d 
n0mksÖQ_inne3ø, pre, suf, flags, output_type‰Bde cŽ3to H 4, T$ ,€ Æ d � 	sñ ÷™‚  –Vbytes—D 1map’fsencode,~)ú $0seq«Órange(TMP_MAXÓ  ‹ I € = next( sÞ … § 1os.cBjoin:Qpre +j   +74 À_sys.audit("e D .)0",  - ?#fdp Î5ile‘V0o600; @ qðÀ ç #¢a againa  D û
÷:óï À' and _os.paûth.isdir(dir) and
   _os.access$  ,  }W_OK)):, ‰continue Nelse+ Frais( ¢return (fda €path.abs �(file))
U 7 ñ FileExistsError(_errno.EEXIST,) Æ  ð"No usable temporary ` ð name found")


# User visi- ðinterfaces.

def getA sprefix(ò """The default  G form ñ
directories as string."""¶  d�fsdecode(h _late)z  b{ (_bytesz ,enz  … ¢dir = NoneŠ _ ?‚Private 4%or  g.H w aglobal 1dir$if 1 iso >ñ_once_lock.acquire()5  à6try*   J 	     ‘ 0 = Ï _¼_ ^ kfinallb � dreleas� ÉG 0/Rúsó ")Q 	 ² b (!™8dirf 	h 0mks{ €(suffix=,ò 3dir
 ¦text=False' _Q-call�ñ function to cre@3nd õ wa uniqu´ô/   s) Pvalue6ba pairP Ú ) where fd "thz A ³ descriptoro àed by os.open,ais the. S .‘BIf ''[ 1not³,, = òwill end with that 6 ®�otherwise7 1re / Sbe no' n Wn Wbeginp 8 p a¯wis usedq ?dirn ¨ ´Bd inÜ æyo #  7r  1s ‘specified‡GtrueY0is £ew 1extÐmode.  Else (±Ó)[¾ q 9 0bin7 ÓVany oÚ2, '>'ˆ ' ar ï�y must bÅŒ sU0typ‘  If�  y 7 sÊ º'ed'1be ! ;H – ó½qis readDa^1rit @onlyÇ �0ingØðr ID.
    If theþJ operating system uses permission bits to indicate whether a
    file is executable, the  â by no one. Th" C  descriptorI Ðnot inherited4 ñchildren of this process.
> QCalle: ñresponsible for deleÚ � ñwhen done with it.C 2"""L ±prefix, suf ÿdir, output_type = _sanitize_params(4  )N �if text:d ,@lagsD   `_openf   Oelse*  7bin) *  return _mk°�p_inner(« Œ _ 	Â ò)


def mkdtemp(ê r=None, ?  1dir
 )– À"""User-callæ` funct!`to creCand ž �a unique f Qorary¼ ±directory. . Pvalueý ª‚pathnameð&e 4 WñArguments are asìÀ, except tha 0e 'l3' a5 1 is‰  f ac+ #edI ”l  � @readë b, writ
  ã `search P only¤1theW 	 MCuserX ¡{ ¦[ k•áget_candidate_ !()Ö )if‚is bytes Ù- ñ = map(_os.fsencode,   ”óseq in range(TMP_MAXbI ƒ = next(;     Q = _  "X.joinö! +m # +¾»  : À_sys.audit("� J .0",  - 6tryØ >  os- 0ir() v, 0o7000 pú FileExistsErrorC €continueO ±# try again\  D PuD  0# Tü+  w�is thrown‘6n a(Ý Kachosenm  q @# alÞ1y e´ ² on windows %   @if (r Œ� == 'nt'   ‡Aisdi~) 	f  A  (  h"ss¬  WW_OK)õ (   '	E 
 '   Braisr   #  ”ù (_errno.EEXIST,f  F  a"No usá 0¿_tfound")N ( M%""K  Plate,? OD¬Ï@Ä  ÷  ¯ Ó€Ò
*ðsimilar to mkstemp, e�xcept tha ðe 'text' argument is
    not ac+ ô	ed, and suffix=None, pre  ðbytes file names areD L ±supported.
 ö%THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The\ A mayG ¢refer to a Ó 0didx ñ exist at some point, but by the timeF àyou get aroundO Ácreating it,? €one elsez Ð have beaten < !toG  T apunch. p"""

##Jðfrom warnings im P as _ )  ð("mktemp is a potential security risk¦ ãyour program",C  p P  Runß Wt ò , stacklevel=2)ƒ`if dire  Ð:´  =   = „ Cdir(0 Õñ= _get_candidate_ !()? ö
for seq in range(TMP_MAX)^  / € = next( s:  y ;ô= _os.path.join(dirk! +Y# +ˆ: !ifñ_ò s(I s  \ areturn%þ °raise FileE'ñsError(_errno.EEXIST,Ô  >  °"No usable 'Qorary^  Ô   fHà")


class _Teô0aryq bCloserð"""A separate object allow~°proper clos Kof ao '«punderly%  ý I Ð, without add ñ a __del__ methoë"th
Ç .¾ ø P  = $õ  # Set here sinceP ‘checks it4 ± òe_called = Falsewñdef __init__(self,6,Ú×, delete=TrueÁ ( .ˆ   d  œ  r=A 
 M # =V � @# NT4Svides A-on-³  �°a primitiveûá we don't needa #>@wrap�°to do anythcð	special.  We still use i†rC  È .»  is" ‘ful (i.e.Ê±"(fdopen)")Äi NamedFe!if0I r!= 'nt'Y P# Cacéæhe unlinker soÓ  õ spurious e2s aÃ@ Ñshutdown when÷ qmodule-KT "os"AÂ'd out.  NotRC “Ñthis must be µPencedpÄž `, beca/•C Þ 	ý W}€may also¯£† h befor† ø2is —ˆ a  ”ÿ‘� =ˆ ‹ 0 n¹ 8 ê#2elf¬!isË 9“ @   =  = ö !  >try>   B F„ ‚   dfinall? À            ÿ   if self.delete:
  qunlink(, ename)
+ ò# Need to ensure the file is X Åd on __del__8 4def X )~ k cclose(m 7els¢  ?   * = bif notÛ % z_calledc  ì  = .# u = True§  %   )  × .  • ò
class _TemporaryFileWrapperj 5""" w ?RThis E ³provides a # q around7 Ás opened forš ts ð use.  In particular, iü 0eks–€automatiy= Wremov¨@when3 ñis no longer needed.1 2"""±  u�__init__µ,Ÿ  , ,î=@‘:! =. S S : ! =A 
 ;# =V 
 _³;r =~C1 r(¨
• DÁ ugetattrÄ  „ ± ñ# Attribute lookups are‰ 2gatí æªunderlyingÙ ¢# and cach³õ non-numeric resultsÐ â# (i.e. methodj ; !, æ dN Sfrien Enot)@  ì " =ì __dict__[' %']% Ca = ö E `if hasa(a, '_07__' ²…func = aX    @_ `tools.¼ s( \  $  x  _! ð per(*args, **kw
 h  3 preturn 6 . 	€ q# Avoid- ‹ š ÿ 1 asÍ    {  —kalive,F  se³¢sue #18879ü ‹    ˆ ¾ .Ý 	P  r4  œ isinstancer;ints¤f ¢6, aUa˜g# The �“__enter__W 0 s�Áwrong object— !# g .6Ð) so override#to= < ß7  Õi B Ä  Q .# ¿  % Â F�trap __exe ¼@wellÉ_#geF#š ˜Êpused inJÂith statemenë ´ ] ³ ÷, exc, value, tbÃ ª\Ì ; 5  ' Ò "    }úð  ˆ Þ… u  l 4   Îwð ‡ ¢, possiblyú  ö&it°D ‘ ¡ð .close()

    #ð iter() doesn't use __getattr__ to find th  - ò__ method
    def __ q(self):   @# DoT breturnj  # ð
.file), but yield from itn ×avoid closingK  4 € as long  it's being´ d ÷erator (see issue #23700).  WeN  ca™  í '‚ °' here beca  Õ (w ") Â s  J �object itÚ Ñ, which has aÅ e-1, aFuE § would getO  ù qed whenn 3genÕ  isŠ°alized, due.õPEP380 semantics.K Àfor line in › uœ  ú  % 0


ÉðNamedTemporaryFile(mode='w+b'°ðffering=-1, encod UNone,x  Y  0newa =% s suffix 5pre ? 3dir. ñdelete=True, *, errors s‘"""Createk³D a tÐ  º!’Arguments'‹ B', '¢  
 pdir' --Y L0mksJ @ '    # aS  –óio.open (default "w+b")< #buGA  _ sizeH $-1E ~D  A  ‡)m'šA  @ ‘? qwhether± eB is  Cd on ÃÇ ÆE  JÕƒ 1TheÔ o cúª#()aqdo it.
ö R‹Ss an ¹awith aH @-lik0�terface;Ð qname of  Ü G Ðis accessible"Pits '+  ' 9…ibute.  ¢ ñwill be automaticallyK (ò!itÌ ²losed unles/'& 'Qis se1RFalse[2"""ç Ð,pÿ, dir, output_type = _sanitize_params(4  )N Pflags3 @bin_Ù  `# Sett†°O_TEMPORARYt Ï(  NÈ  OSÍ þ #Xó@ isó	only supported by Windowðpif _os.€� == 'nt'i ä ”� !|=. ° Ë  if "b" notÀ  Õ: ^´= _io.text_ (	 /P(fd, Œ )4Žq_inner(‰j— 	 £6try‚  | P \e  ¤ —H?ing�ð newline=newline,¤ encoding=	 ’, errors= C)

  ñ!return _TemporaryFileWrapper(file, name, delete)9 Áexcept BaseE Aion:  V °_os.unlink(; 3  †close(fd  raise

if 9  2 ò != 'posix' or _sys.platform == 'cygwin's ñ# On non-POSIX and C  ò systems, assume that we cannot ¤ 0 a ç ¾ ñ# while it is open. 	‰ = Named d

else‘ ñIs the O_TMPFILE flag available¤ @doesi Qwork?f R# The+ ðis set to False if os.‘ P(dir, ] !) BCs anG ÐIsADirectoryEø ±"io" _< õ_WORKS = hasattr(_os, '  '*Idef ð ð(mode='w+b', bufferp6-1,}QNone,“  ý
 �newline=$ s suffix 5pre > 3dir- *Ú J )� k ‚"""Creatmæ4a tçõÞ / –ArgumentsB '‰ B', '   
 ðdir' -- as for mkbpH '"    # a[  Î!ioÅ÷ (default "w+b")@ LE  _ sizeL (-1I ûH  E Gw'¨E  D tC  B ˜1s cÕd�}ö () would do it.ÛRÛ Ã object withðò-like interface. } f ehas no ’,³ will ceaseÌ exist whenÇ1is ÛdÌ5"""E |global z­ pif "b" ˜0in 9Š ¡¾´= _io.text_ (	 ® 0 ½,[", 7ÿutput_type = _sanitize_params(4  R  Äs7 @bin_‹ â  À8X
Â :try  § D Q2 = (
 ! |H P) & ~uO_CREATn  <    fd’ 	I †2, 0o600g .   ˜ ð# Linux kernel older@ßn 3.11 ignoreæK Ï  V1rea¾ðO_DIRECTORY. TryingV Y  a¯Àò #ÆuO_RDWR|F ÀRY fails witû	h IsADirectoryError, a
  4# d$ ð cannot be open to write. Set flag PFalse	 ?notN  ­try again. ñ_O_TMPFILE_WORKS = M 	) ‘except OS² :  » ÷# The filesystem of theÆ Pdoes È …support w “ ä# For example,v ø (95, 'OperationM Oed')G  §  ñOn Linux kernel older than 3.11, tryinSnŸa regularL   ï ð (or a symbolic link‡8 f) withó M Bails' =Not#vbecauseC ¿ is read asN  ¾O_DIRECTORY:pas4 NelseÔ>try  í°return _io.$õ(fd, mode, buffering=
 ,ž  C  ƒnewline= p, encodI 	 H eQ"s= ){ ÇÖ Î_os.close(fd:  ± YraiseT #+Albacô0_mküµp_inner().
- $‹name) = ( ñdir, prefix, suf  Øæs, output_type” ™ »  un{(d w ¶ ®7ž¦	 {‚z · rjó
class SpooledTemporaryFil®5""" hð wrapper, specialized�ñswitch from BytesIO%Por St± IO'  ¶#alK phen it º òeds a certain size ow& a2  no”bneededu1"""f u_rolledZ ðdef __init__(self, max_] "=0Qh='w+b'W/-1 #t=None, ¦ k   b, w 3dir
 $*,È E )1‘if 'b' inñ  ^  Ä !._=i(ºi¼  „io.text_ (	 A h rTextIOWû(—z .  C  ` =	 ÷ Æ> h ¥ 	Íà = max_size
    ñself._rolled = False
 2    ðTemporaryFileArgs = {'mode':  õ , 'buffering':  ,I Q   ¢'suffix': 	 b, 'pre 	 G Rencod�  �, 'newlin© 
 M òdir': dir, 'errors': 	 !}
Ö ñ__class_getitem__ =  òmethod(_types.GenericAlias): °def _check(`�, file):V   #ifx•…: return  £max_size =(  " 4if  A anda •.tell() > r  v  ‹ .r Wover(«   " §  Ö £   Ÿ 0new 	 9 = g0(**p )._  })H 3del% j Ø  po¯ p ? ³if hasattr(’ È'è  E   .Úq.write(T ödetach().getvalue()¡ JelsefI B 9 ' ³seek(pos, 0’ Ž  ˜³BTrueð b# The �ù
 caching trick from Named,ð# won't work here, because _å ² may changeH a7  BytesIO/StúòIO instance to a real|³ So we list; Uall t­ skdectly.Ê ñContext management protocolC F�_enter__I´C ¿ z.closed‰praise V²Eà‘("Cannot R # c~ Rwith @ Ê "Ý– �´ ’ 3xit‘ q, exc, G, tb¡  6 .]ž q#f ê ié … O #__* 1 – Á $ƒ •@propertyg? d@ { ( F •H * J  ±sH ( F   ,no8  Mù b  à @ Y_flushQ Ü  1 ipy2 k ( : M vF ;tryä8¢Ðmode
        ÷	except AttributeError:
  ñreturn self._TemporaryFileArgs['mode']
4 ‘@property �def name(< )V 6try  j 	c Pfile.7 D   ¥ ONoneŠ |ewlinesŽ }  * J  Æ Aread8 w, *argsÍ ? - ' 
B   F 1 J É ‘  K ,s(L Oseek’ - B AtellB 
& )rtruncatp, size=¼E !if @ is  
1 Q!._*K )0:lse0 M >Ç@max_u 
&  lZ –rollover(T  v  F Ù 6wriÖ Î  « # =~   ­ Prv =  .< t Œ p_check("  u&rvS> æ 8 ¯, iterable† !H B ­  Z .’ u
class +tDirectoõã"""Create and Ê 4a tZ$ d0 ñ.  This has the same‹ ð behavior as mkd; ð but can be used ña context manager.  ForC ‚example:A ÞOwithµ   ()K [tmpdi2...> ÁUpon exiting© w , Ï ð peveryth*  & Qained‘ ñin it are removed. 2"""e  ‡�__init__q�, suffix9V, pre 2dir D  Þ  ðignore_cleanup_eñhs=Fals*é …$ =b(o j ,¨’1 _] ? =  œ < ôfinalizer = _weakref. (-  É  1 ,MÉ   ³ ,, ñ
warn_message="Implicitly 9  ˆñ up {!r}".format])E À -  .ì @RmethoÞ¾±rmtree(cls,,X … 5 !on ÷(func, path, exc_infoÚ �if issub| (% ð[0], PermissionError):
         ôdef resetperms(path):
  ?try  % ¢_os.chflagD O, 0)F ÿexcept AttributeErrorX OpassH q 1mod³ �, 0o700)
, ¶ 0if í � != nameƒ  u  5 @.dir5 | )é 7  3 ›   8Ÿ    o bunlinki Ý  % Á# PermissionMÿ is raised on FreeBSD for directorieTœS(IsAD+ yS ,d # � ±cls._rmtree¶  , ignore_eê)s= ;„ ÁFileNotFoundƒ  ýelif issubclass(exc_info[0], U Ç  R  s jif notÛ £ ‹˜ƒ_shutil." FA, on= ,@Ã amethodû ¬Ñ_cleanup(cls,ºì, warn_messageoWFalseè Ÿ} 	‘Ÿ_d Pings.	 ( r ó ResourceWarning¿ ® Ç_repr__(self† ñ
return "<{} {!r}>".format) 1.__û P__.__¥ @__, B . 	_ Oente` 4 €’ Cexit’ ÷, exc, value, tb¢ ; ls     / "if¡ ð_finalizer.detach() or Ê r.existsæ Í 
5 V >  % Ô _¸‘ _ª AÁgetitem__ = SNð$(_types.GenericAlias)
"""Text wrapping and filling. ý

# Copyright (C) 1999-2001 Gregory P. Ward.+ ñ2002, 2003 Python Software æPation7 ¡Written byU O ‘ <gward@p: ñ.net>

import re

__allæ  ['Ä WÃ `er', 'Î    É   `dedent
 $in
 �shorten']â ñ!Hardcode the recognized whitespace characters to( ¯US-ASCII
#( ò.  The main reason’oh@this¶ñ that
# some Uni… q ðs (like \u00a0) 5�non-breakB œ Fs.
_ ð
 = '\t\n\x0b\x0c\r '

clañss TextWrapper:
    """ ÀObject for w  ñ$ing/filling text.  The public interface consists ofH 1theA p() and C À() methods;  Tother � are just  re� H ðsubclasses to override in order Ptweak7 ñ default behaviour.D °If you want0 ð completely repl¾  � Amain³ pì ¡algorithm,C ðyou'll probably haveL ‘ _.±_chunks().
6 ðSeveral instance attributes1ñtrol various aspec@… š“  width (Þ Q: 70)_  ¸º Sximum( "ofA õed lines (unless break_long_wordsD „is falseV çinitial_indenty $""# P  str(ðthat will be prepended š Qfirst‡  — x PoutpuRPCountáQwardsË » "'sÓ ÆÏ  subsequent› ,1all• 1s sÈ1he ª š D¥ Š; also c© AeachI ª ·expand_tabs?5trud1  E$  $ �in inputc =°spaces befo!ur,¤processing0  E„ 4tab…°come 0 .. '[ Rize' N 1, dŸ ·õ on its positionù  ‰ !tsÔ R.  If!, ê  f ðis treated as a � ³le character × 7izeþ 8<Eû 	¼ Å© 'c$' ÂØa_whiteþ ‰ 
‡R / Ñ sl Ì¡#byS� 0aft�1ab ˜ Ásion.  Note ""if °  D µ  n@ue, IyUç @0verˆEto aE �ô ! øfix_sentence_ending—	üs  Ensur· 6 -6 € punctua3 tó always followedo ƒ  by two$`.  Off Áp becausc %e h& i‘€(unavoidk´) imperfectÞÉÜBò í ø £Qhan 'R'âSthose, Ð6notÑ �e broken,²  sd ¢`s mighq` @ ° ˜on_hyphen|
ŒAH¨ ¥/ lÄ .‘ 2 ,â $ « Soccurm  †0fer<C on ÔÀaces and rigóht after hyphens part of
  ó compound words. ódrop_whitespace (default: true)& ð	  Drop leading and trail = •from line_ Amax_ Y 7NonY úTruncate wrapped@ ·placeholderB †' [...]'Ÿ @Appe• ¡o the lastH 0 ofÈ a bd textø A"""
Û wunicode²_trans = {}" ƒ= ord(' t —for x in : :0  nV [D qx)] = uW … ñ# This funky little regex is justÕ `trick y  sp% 1ingq #Ø � up intoÞ-Lòable chunks.  E.gü ‘#   "Hell,ñ	re -- you goof-ball, uses ³-b option!"k { sj  !  L ñ/ /there/ /--/ /you/ /T /U P/ /us  th S-b/ /] J (À`strippZ out empty  Bngs)Â  Áñ	_punct = r'[\w!"\'&.,?]'L 0let
 S^\d\W « ÷%s]' % re.escape(Î\)no4 v'[^' +  A[1:]s  ” `sep_re”  e.nrile(r''”  w( # any@ <   •  %(ws)s+ ñ| # em-dash betweenÝs" ò
  (?<=%(wp)s) -{2,} (?=\w¼  W  E  › £, possibly GatedI 1%(n~ F? (?È B #1 € 6    C-(?:ˆ ·lt)s{2}-) | 0-%( &-)–  8  ½ "=  3 -?
 
$  ¾  ×/ofz  (?ü os)s|\Z8  ;® 11(?=40 š L 0)'' a{'wp':ƒ w‚, 'lt': h,d P  'ws0 VA, 'n O}8 ¢re.VERBOSE| 9deln h  ? 	;?les@=´ñ  on recognized ~/s.h/V ¼ Wosimple^ P(%s+)¥”D‚.PXXX tmòis not locale- or charset-awau¡.lowercase‘ #”ñ US-ASCII only ( ýÐfore English- ‹ Ïsentence_endÃ  `[a-z]'z %# v e}   	 À            Õ r'[\.\!\?]'  õ
# sentence-ending punct.
" 	  O W"\']?N ÿ	 # optional end-of-quoteN K\Z')l #E ¡ of chunk
F ñdef __init__(self, 	: �width=70   9 ßial_indent=""$  ¯subsequent' 
ÿexpand_tabs=TrueJ  ÿreplace_whitespace* Dfix_Š_Šos=FalsW ÿ break_long_word Odrop| O Ÿon_hyphenO  ê _ize=8ê  *  ßmax_lines=NonÈ õholder=' [...]'):Ð Þ.Ì1 =  
 
Ì: =  
- Õ= =  
3 á7 =  
' å> =  
5 ð? =  
9 ­ü< =  
1 ; =  
/ M `  
1 3 = 
 
 5 =  
# 7 =  
óÿ# -- Private methods - r ð# (possibly useful foròclasses to override)} pHmungÆyW text°M"""_*  $ Ó : string) -> ^  ·M]  #1 inZ :sXñ and convert all otherÖ  D > ‘characterÎ uõs.  Eg. " foo\\tbar\\n\\nbaz"D rbecomes&  U Pbar  # &""0 1if ¢¼ @ û =Ì .%  "<.
 Eize)~ N 9U ’translateT hunicod¨_" e Rretur^\ßQsplitD ,® Ô Î 	É[Õ]ËSI A theG  Nðwrap into indivi}eÐ –CÙFs ar#‘not quiteH �same as èp; see _T _1s()ÂEfullJ`detail^ ÐAs an exampleÅ, the text
  ñLook, goof-ball -- use* ¥-b option!0 ±breaks into# õfollowing chunks:* 1  '[ P', '  c  	  g    #-- 9 3use F 'th %-b ™ '7 1if � ÿ_on_hyphens is True, or inœ ˜ 1— ¥otherwise.ª 5""" �if self.» ´  d" =4 ðwordsep_re.split(Ú)[ Oelse? osimpleF ×ä = [c for c inˆ Uif c]p Tretur 
 ðdef _fix_sentence_endings(õ ,H )¦ ?"""0 ‡ ²: [string])b  ÇqCorrectŸ i  i p buriedµ 'D À'.  Eg. whenÃ©  G �original!ö" contains "... foo.\\nBar ...", munge_whitespace(xBand �`) willK ðvert that to [..., "T P", "  PBar",\ Pñwhich has one too few n ñ s; this method Â�y changesÕ  3 Ù 3  y ?two†E = 00 ”patsearchiU ¾( 0 âwhile i < len(f6)-1Ö ^ ,"€[i+1] ==ù  ,o ; 7[i] <   W = F "  D    ei += 2—     ) 1A£Àhandle_long_VŸ’reversed_} £, cur_line
 —en, width°  ÂO @  ¾,¦  ” 	 h 2 @en :›–  )Hç " ax2 ofëð (most likely a f, not ß)½µ !is� 0 X0fita@any d°# Figure ouZ �en indent¥`largerd “p specif¸_,(Emake‚ 0# sL €at leastð  `racterS  'Àpped off on Ëey passD "if¾; < ­2•_left = 11 N	) ¬ " -&"en` ØÀ# If we're a/ ed6ó D ssžõn do so: put as much€ #³the nextÅŠ@currO ‚ : {àfit.
        i÷f self.break_long_words:
  ùend = space_left ñchunk = reversed_ Ys[-1]( ik ñon_hyphens and len(8 7) >i 
‡  ’ !# « Â after last H ù, but only if there areƒ A Bnon-4 ªs before iÓ  ( " 1 = — ç.rfind('-', 0,¢ )a #if’ A > 0Ý òany(c != '-' for c inX "[:h .])ë  † z$ I + 1n ò cur_line.appendAj[:end]— › Ù u[end:]
X 0# O<ðwise, we have to preser 0he ( (° intact.  Oy7addI  it9 Àthe current ­ žó's nothing already¶'--E ðthat minimizes how much› pviolate6 õ width constraint.C @elifi  … .
iD+x.pop()) �If we'reU pallowedé ˜!s,ü M4e'sã — P# tex°¿ !@, do\  @.  N' 0timè Prough1 G ómain loop of _wrap� ()ÁÂ'll wind up Again-E ðen will be zero, sol   n‚ » ‡entirelyB Rdevot	 ò Áòwe can't handle right now.Z+de¼  •,#s9"""ã œõs : [string]) -> \  Gð Wrap a sequence+@  ‚Ðreturn a list!  ò Es ofå €length 'œ .qñ' or less.  (If 'Gµ' is false,G Asome
Ps mayn - er*°n this.)  CVÑs correspond ýt!toƒ@ tQwhite¥p betweeN ‚em: eachL5 isˆ ÿindivisible (moduloÁ  )+#ne|5canF cÎ o rany twol  Æ `shouldÕP…internalF » r; ie. aC  > eiC  aÈá `or a "ƒ"ëW  Ù±Áremoved fromÔabeginn|0nd féCinesø Dpart7 6at ©  œ d„ 5"""Ö B6= [	?Z <= 0�ó
raise ValueError("invalidâ€%r (must7r> 0)" %ÁQ öh 1maxõs¯ ðnot None:
          û  if self.max_lines > 1:
  ‚indent =- ²subsequent_ 	0 OelseB initial? rif len(Y 1) + ¤ òplaceholder.lstrip()) >” ^widthw ÷raise ValueError("F ñ too large for max G 5")
Ò ÷.# Arrange in reverse order so items can be efficiently poppedF õfrom a stack of chucks." schunks.b (‚ Pwhile0 Fnks:™  ¢ó# Start the listY ñnks that will make up% @currÉ ë| K ãcur_len is jusU PengthW 2allB ¨  0 :ineH  U = []Þ  b  len = 0Æ ðFigure out which'@tic å"ngÇ Îprefix this ¿  6 ¿I»F	ã ’# MaximumHV± i–  -ë°   <r# First1 on ªðwhitespace -- drop it, unles+is¡ i ðe very beginningá DÁtext (ie. noc sŠšrted yet)ê; u _ˆ 2and¨ `s[-1].Ä p() == ''   ¾s©7del8 
#
  1l =;D v ? - ò# Can at least squeezeP9 R ontoä& I 4if Ëb+ l <=íÑ  - *  %qappend(j @s.po¼	› .   2 zen += l  r# Nope,·  I Jfullœ + ˆ  Zbreak\ P# TheØ Y ,´ nÁ    <ibig toÇ P# fit¢Q*any*ET (notTnis oneKX sl  ÿ Ë/ >aô_handle_long_word,Î Ô
 2en,I )±  t°= sum(map(l.  Kine)OA# If)lJ«  ò ê  0,›
§C
 �1ineŠ  
Rw, Cen -H  ; ð)
              ÷  del cur_line[-1]

  %if :  $ Áif (self.max@ Ís is None or.  2 @len(i ›s) + 1 < ? 7 ¿(not chunksZ J ÿdrop_whitespace andˆ  ‰ Q o) == 1* { À[0].strip())0 Îen <= width)# õ �# Convert1 Prent ° back to a U !ngS ¿store it in¹ Ñ# list of allH ÿs (return value).8  r Às.append(ind† ¤+ ''.join( -))= Oelse× PwhileÓ û$  ÿ  &a  aD ð o  1  5 Aen +®*Ïplaceholder)w	G 4ineþ I … 
9&   _breakg è !-=é  �� O   ·   ½ * "ifA» & Aprevâ" =/ Är´/p(   ;  ú iC  ö  ƒ? <= J  9 l	)   » ® 5 = ƒ " +*Jz ¿g ][ª e #.l23c Š Ò[ ‘²def _split_¸zg, textx  " =ã g_munge( € e ª [ ! ‡ ð# -- Public interfQ- » Owrap² 1"""  œ # :`) -> [2'ng’ðReformat the single paragraph in 'F @' soC@fits F1 of×  @no mgathan ' T ' columns,œ  as ¨ &peRY a.  Tabi ~ óare expanded withÕ . utabs(),Ž 1andÍgother ½ð
characters (including newx U) areD ca edQû6"""( ðhunks = self._spólit_chunks(text)
  õif self.fix_sentence_endings:&  - ' _( (Z U breturnY T_wrap| ) Y �def fill(Z !, ˜ s 1"""   Ó : string) -> 
D  ™ ðReformat the single paragraph in 'D €' to fit µlines of noF °more than '� ó.width' columns, and Ø Ta new‡  ‚   ¡containingˆ pentire ý 6ped� .q 5""" Y ‘"\n".join.= ¯ð)


# -- Conveni¦Ï interface -  

y\ !, ê â=70, **kwargs)‡ž"""Wrap aV!of°, ö `a listV \  õ g.©¥Pso it¨s©¥¶  Š A  BysÁdefault, tabh "óare expanded withå.  . !()G ðall other whitespŒðcharacters (incluK 1  ) c cÅbrted t€: °.  See Textvðper class for available keyword ¨ Ó‘customize“ { Ž’behaviourqm8w =b (F= ÿK ”w‡;—;OFill;Q0Õ (Å Ñà ,{  ÄH X	ÈB  As$    à.!ed4!D % 	I y	<ù)	qshorten£ED�Collapseptruncatkqe givenI Ê� Æ ·2The) Ùfirst has itsyg `d.  IfFDthenK9 [ *V  *,! #isÀ ¬€s is.  OÑàwise, as many psA €as possi‰ Ê ¬ <  ndõn ð placeholder is appeP"::	 ,1>>>Í  :.Fp"Hello n Cld!"Q6=12X'# qworld!'’ O Àello  world!ã", width=11)
  Ñ'Hello [...]' 1""" òw = TextWrapper(<  ò, max_lines=1, **kwargsV ÿFreturn w.fill(' '.join(text.strip().split()))


# -- Loosely related functionality -- ð

_whitespace_only_re = re.compile('^[ \t]+$', øMULTILINE)
_leadingC > (? í*)(?:[^ \t\n])K ±
def dedentõ !):Oó"""Remove any common v  ¹ À from every aP in `<1`.
H ð
This can be used to make [`le-quoA j2ngsD ñup with the leftI qedge of €display,‰ ðle still presenting$ mŠ  A ±source codeH Pin inî sed form¨ ñNote that tabs and š€s are bo� 0rea¬  asx ºP, butq y^  -  not equal: Ó `s "  h»"[ D"\\t r˜ ‚consider#have noy· PEntirŠSblankl … brmalizO Qa new ¡character.° >#Ók´ eongestñŸ "nd)!toO R# all† ` Âmargin = Nonè  8 = ºý�.sub('', # �ªs0 |8 ¢re.findallºƒ 3forá A Ô D3if ” !is•     =C Ä  ‘# CurrentÞ Ã more deeply+  i0han‡Ævious winner_ #Ð¨hange (pre& 3 isÆron top)> y Celifc p.starts(© ­ (   Opass³ a stÃ  B ˆ!noÅ  erû¼ 
Ait's3newÛ ¤ ’ ¤ }¤ '  b FiV õ!ar]o˜between c� ­Q #¦  &se� $ ,€, (x, y)/Óenumerate(zipd,~)É  A šif x != yX     ì 	 E[:i]      Rbreak¹P# sanE check (tesÓp/debuggÝ .1f 0Ç_ „  Ø î!inMÁK"\n"Å passert ³1 !oràÆ] O), \¼ "7 @= %rfíp%r" % (  )ß ­  îøàsub(r'(?m)^' +ñ margin, '', text)
    return à


def indent(# �, prefix Ñdicate=None):< ’"""Adds '& ð' to the beginning of selected lines in '[ 1'.
D !If? ] á' is provided, ôfix' will only be addedk U I Qwhere3 L ( )R nTrue. j 6notn E "itl pdefaultf 0addÊ ä Óall non-emptyØ ±that do notJ àconsist solely	ñwhitespace characters.- 1"""  ifqÀ   lk « �2pre ß   ! Ì ù ‚.strip()e: `fixed_ #s(Ã 7 1forÅ  œ ›b.split'  ;+  / ryield (ô# +; º › Q else 	is''.join? � ò)


if __name__ == "__main__"ç ‘#print de â"\tfoo\n\tbar"d " �  \thell–@re\n ã  how are you?9 Z (Z H4 .5 @This�üHed."))
s = """Gur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg "vz 0.
F r  ¢pbzcyrk.
P	   Ìvpngrq.
Syng! 1arf ]Fcnef_ ó"qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g f ñrabhtu gb oernx gur ehyrf.
Nygu �cenpgvpnV ðorngf chevgl.
Reebef fubhyq arire cnff fvyrag1’Hayrff rk "yl pè !Vaq @snpr’ñnzovthvgl, ershfr  grzcgngvba§ Äthrff.
Gurerx ñor bar-- naq cersrenoyl ba ð r --boivbhf jnlF Wqb vgã Agung €znl abg S 3 ¢ng svefg hÊ þlbh'er Qhgpu.
Abjª7ire] ‰vf bsgraTñ *evtug* abj.
Vsð ?3zraô pvf uneq¶  Dÿnva, vg'f n onq vqrn; 1rnfñ ;  ä „or n tbbA ‚Anzrfcnp" OÀ ubaxvat terŽ�qrn -- yr| aqb zbeµ`gubfr!€
d = {}
¡Ãc in (65, 97‘  i ƒrange(26  ¥àd[chr(i+c)] =  ò(i+13) % 26 + c)

õ"""‘Ð[d.get(c, c) [ r ðs]))
"""Thread module emulat€a subsetá�Java's t+   amodel.Ê óimport os as _os
 "sy %sy _A " ófunctools

from time > ‘monotonicV   $ ð_weakrefset import WòeakSet
from itertools import islice as _ q, count 
 ¡
try:
    B µ_collectionE BdequD 
 ‘
except Ic WErrorA @ ñ&
# Note regarding PEP 8 compliant names
#  This threa( ð2model was originally inspired by Java, and inherited
# the convenØ ñ of camelCase funî 5 bmethod õthat
# language. Those + ðare not in any imminent danger of
# beê ðdeprecated (even for Py3k),so tï àmodule provideÿ  em°¡an
# alias5  Õ 8_ » 0 usv  , ?newhð facilitates substitu)q
# with?±multiprocesR m¥ ô , which doesn't´ 2  ol{ ‘¢Øñ.

__all__ = ['get_ident', 'active_š  PCondiŒ   ‚current_!',¶ ºÐ   'enumerate* Emain' Û 'TIMEOUT_MAX6 #Evy @Lock: R	 �SemaphorP yBounded T–P pBarrierJ cBroken &  2Tim ?  	Ê ‘setprofil{ qsettrac PlocalF «stack_size€ ›1hooÍ E©€HookArgs9 gN gh p]

# ReŸñ some stuff so "r JXó*" is safe
_start_newr3 = 
 . 
øoÿW_lock*  alÝ !te p
_set_s¯7nel& 	 
:"  Ø  !naX+id+  ‚ò_HAVE_THREAD_NATIVE_ID = True"  Á ¡__.append(½D $')‘Attributeà] gFalse
¤ e^Ë !_C !  w 
3 WNone
F  
bÀ
1SupK ©˜,– kCs

_ _ 1 = l _# 	 V
def á(~) €"""Set aE ýš z 3all!s V$ed¡e  Ÿ—!.
­"Thß÷ will be passed to sys.‡ )R0eací mÁ, before itsL rrun() m “is calledi 1"""% yglobal  	 ! =Û 
…(1GetCUr0   ðset by threadingó.setprofile()."""
    return _ ñ_hook

def settrace(func):. ‘"""Set a    ótion for all threads started from the Áing module.
P 1TheE ð will be passed to sys² i !()b CeachJ ñ, before its run()P ómethod is calledg í �global _U ë   ! =� gþ 2GetÐ  +   as/3 byŸ 7ing½ m€ á
# SynchronizaM  clós

Lock = _allocate_loc�R À(*args, **kw
 § vFactory¡ Cthatìðs a new reentrant W *A P must™Prelea›ä Ñ X ñacquired it. Once aŽU has # aa ,O5samS 4may/ ‘ it againO �without b° Aing;; e ¨ ¥  7 o‡  —5 im+ ‹ K � #itù #Qif _C^ FBNoneú (,!Py! [ % E $ 
ß! _C \ P"""Th´ ù� implemenÙ	£ƒ objects² «~ÿ ¯ «/M 	:	«  ¦Ó__init__(self ¬  !._+C-' €owner = ïZ  ’count = 0±s Nreprs F {  M 2tryì Z    š active[ e].name5 ú except KeyErrorA  ** u£"<%s %s.%s, W A=%r È õ =%d at %s>" % (?  ‘ "VPed" iû#lf=. ²() else "un )",> ô _ÜR__.__ç/__' @qualô ) ¸ < È 
 bhex(id Ð )± at_fork_re-* N¼ ++._+ P & ˜ *gq ,¸÷=True, timeout=-1·B"""AN! a˜7 � or non-©  aá  ì ÅWhen invoked|ðarguments: if thÀis thread al Py own “e lock,
  ÷8increment the recursion level by one, and return immediately. OtherwiseQ Pf ano ‚ 
z   b� a untilt  Pis un
 …ed. Once¡  —    # P (notÒ  ed£ 3anyl  ),S an grab  ©rship, setQ è ,toè à. If more than c 5 isK Ë ¯ed waitingÕ Q, onlMö at a time will bë {able to¾ 0 ofÕ ¸p. There$no’·value in thœ ecase.
«  When invok° 1ithT Á  º Aargu0setƒ �true, do& 0sam5ingO @as wR CcallQ Dout G s3 M ‹ 'BfalsŒ  õ² �a�  … Q withƒ n† b wouldq,.O Æ;H ¶Îú  ò K -ú @floa?@-poiˆ1imeÉ “–a positiv1ú,á @ for\2mosÌ`number>ò seconds specifi5 ‚&ou ãpas longì w1canx€e acquir¡" R ß & iŸ7 ha5een4 #, x- }  0 ‡ elapsed!5"""Iõme = get_ident() õif self._owner == me:  Þ ©count += 1 ¡ Crc =R dï ( Aing,µ9out„ /rcu ” & m¬’ ‘ � "rc°´__enter__ =A Àdef release(Þ )| B"""R ! a+C, deÛ á Ðör�If afterï8 0 itj@zero?hA $±Žc9by – ^i!y fMRs areÀ FG Ê&th;ÿ•to become)Ó, allow exact],mŸ Pproce®Ý �  å    ö  stž2nonÿ  & ˆ fremainç  !ed" ö‘ -  •y €lO	  °r methodN8  Å·5. AÅ RBpmeError° àraised if thisó method is called when the lock is
   un Eed.
 PThere< ÷ no return value# 5"""/ õif self._owner != get_ident():'  p ñraise RuntimeError("cannot release un-acquired¬ %")B f „count =   5- 1. 0if X ' 
† 2 ® e= None5  ¥  b.– "()Ðdef __exit__(( §, t, v, tbê   : £# Internalœðs used by conditiofwriablesn ƒ_restorev \states _´ 2 (9,¬!= I o ñ B_savl e éTZ == 0Yß+V ¡  ˜S_ E = 0 Å      ç /ò /ô(o !, V !isëdŒ 8 ] 6  $p

_PyRL‚1= _	 ¤


class CSA"""C ÿthat implements a0 ™A  ð allows one or more threads to wait �lBy arbnotifi sanother7 l  If1 ¢P argu�  3‘given and} \ñ , it must be a þ 2or þ  pqobject,5  itE !asb ¡underlyingm 0. O� ²wise, a newJ  F ý öareatedT N 	ú Î: à'inà =È é!ifŒ  «   ² Ë    1 " =– U   q  1 �# Exportï   5's ÄÂ £<< V - ! =– . 
$ C $  $ 7# IÑ“defines _' )Œ S/or _b ”'),I Ðthese overridm–e defaultÇaï s (which j ¨F z (u oÆ°).  Ditto f• i–%).H :try�0	× 	 A ò except Attribut´
S 6pasNq 1t  w *À
           ö self._is_owned = lock #
  õexcept AttributeError:  & Epass X ñwaiters = _deque()
" ðdef _at_fork_reinit(2 )R   "._Ž * )D  s % f i.clearc Œ_enter__] creturný d + £ S_exit? w, *args£ F 1 + í O_rep‰ ñ	"<Condition(%s, %d)>" % ¸ S, len ñ )« Árelease_save' © 'è '  ()? à# No state to A ¹ âacquire_restor[ ?, x^ - ^ aIgnoreY dh ` i{´ 2# R¥qTrue if™B is ©õby current_thread.Ð# This method2 °called onlyI Uå doesn't have &()H (if!Û WFalseþ  D`�  ! *<  Felseð'  ò " íØ, timeout=Nonƒ ð"""Wait until notifið r a9 ‚ occurs.]  r pIf the "Bing K@ hasG  ô d$  ?y when t_Ð  E ped, a RŠ m$ �graisedw ¡’se punderlyŒ  p A, an~ 0n b sÒ Fit ilPawake¾@by a¹ ƒify() or a_all()å A fori dsame cuÄ ðvariable in anothe/  `,P  Ø l@  op­,al[U OnceO š  v  im•£ut, it re-^ù  Þ í +¤Wtek pargumenP pres  (@not a µshould be a� Pfloat\ñpoint number specift*(Poperaë   se2y€(or frac  Ç Wreof)è» Ø �an RLock® iq@d us§ &itl  #()Ùs, since� ayìÁ actually unQ Ü	 ¸%it
6wasÞrmultipla@s re%Ðively. InsteaÖ0n iM2nal	 'faéoHÑ ` classã  us‡which re™ sBevenQi‡ë Hbeen† ª SseveruCs. A¢™ t@ ‹  Þð restore the recóursion level when the lock is reacquired.

  5""" õ	if not self._is_owned():!  4 ðraise RuntimeError("can9 ´wait on un-j } %")B  # ð er = _allocate_Ÿ (" .A  — A ’s.append( > Ósaved_state =Ê €release_ P Õgotit = False¡ @try:ç ¢# restore M öno matter what (e.g., KeyboardInterruptŠ  E 0if &0out€JNoneL $ Â ð      ¨ 6Tru§   ?elsP  t >> 0p  : S |  b ,² 
Ê  6 p   P Z
H qreturn 1 tzfinally¬ ï_�(Äà
Y ¼Y 
I  ¡  Öo    f �s.removeU- ²except Valuúi  + Bpassa@def \ P_for(k p, prediøi=e@"""WI b l a conditØÐevaluates to ­ÈX   should be< Ðallable whichÓ€ult will  i¶µpreted as a"€boolean p Te.  A@ may: ñ provided givinggqmaximum+ 5 toM  © q0end 0 = 	2    5out 0resÂ =HÒQwhileÃ' 
ŸiŒ R  Ž ± v 
%  À4if ™ !isš $  ( % 0= _U A() +î  ±  )   =   3 % =w -R G  K É /<=ä * YbreakD  ….r å w 
G9 `½$ âcnotifyà<n=1Ìàke up one or mSqthreads. ?o©&isë‡, if any8!Iff@call3 C A hasñ(d$  RÿÅis method is
 E Yed, aÈ Þ &ThB PwakesÌ ²at most n o– Ž Ñ 1forŠ ¼{ @vari’1; ipa no-opð 4no H 4are;ðàself._is_ownedW():
  õ(raise RuntimeError("cannot notify on un-acquired lock")D ôall_waiters = self. $   C_to_T ÷= _deque(_islice(G F, n)`  ifˆ  C Æ Ueturnq 3for2 3 in
 s 
< [ –.release({  &:try.   ­ ‚.remove(E 
< ²except ValuZJ Qpass
· !deé €ify_all(Iªñ"""Wake up all threadsÚ 0ing£ò this condition.U  ­ °If the call+ ; A hasX× $  Ûa when N amethodž  I  ` ‰alled, a1A is Gdw 5""":  Í .úA(lenÝ &"))¬ A :TË  © €deprecatÇ 0uset�) insteaÇ õ import warningsß  .	 "('é  Å )q %',M  j D® BionWw æ, stacklevel=2qdAò)


class Semaphore1""" Äimplements s( ƒ objectsÎ@ ðs manage a counter r  Bsent[Åe number of P{bs minu4 k( ‚"()( ð, plus an initial v@f. The , Ñ6b· s )�ecessary Ï¡l it can rÄ without mak® Ç G ±negative. IŠr given, ã defaults to 1 ã; @# Af`Tim Pe'NiA, buRa quite“÷same (no maximum	 __þ !__+„ '=1#if™ 2< 0Ø5Šu&("Ù U S× must be >= 0ÒJ_KD = CRg(Lock(™' �" =� É© % !, ¢ ing=True, j‡out=NoneÓ B"""Ae& a?a, decr£¶i{5nal†b¥e– WÄuinvokedøAarguê:, …I Öis larger thaO@zerodWentry‘  a| D andh±immediatelyL it D -   3on L ,É¸�some othˆ  ê¯ Âef ¨5 toQ m(it¾  r  7àis is done witóh proper interlocking so that
  ðif multiple acquire() calls are b9  ed, releas õwill wake exactly oneQ ðof them up. The implementation may pick4 ² at random,˜ Qe ord² O Twhich† r threadš aƒ ðned should not be¨ aied on …re is noP õreturn value in this case.
$ óWhen invoked wit€ ?Ðet to true, dL`e sameH png as w=  @%edQ  D €out arguss, and Œ  M ~ Bfals ô  ¢a. If a¸² &ouã%any ! w+Õ ÓO ó immediately; otherwif &thßí w l å `a time&}  ¦±n None, it t· W for ÁEmost; ‘seconds. cÏ@ doe@t coŒõte successfully in¨ /:val B.  R; ¯!¹5"""J "if� œ 8 ïà ‘tÜ :1  �praise V›õError("can't specifyæ  Anon-^ ê %")O `rc = F( 0end‚ ! =z   œp self._<
’ Swhile 3J== 0$  º ï !  % Ubreakx     %ifØ  (   4if Æ !isÇ j  , ) 0= _÷ D() +i „ 0 ?lseN  C  œ=� -X N  R Ú <6 %  ˜c.wait(‡ è ? eº ; µM-= 1§ #6TruÜ�"rc0__e:D__ = 0defg g f, n=1)=B"""R.° a semaphorÈ1ncr ´t ` pnal cou ! bL} or mor“ 3 * ñis zero on entryQ$an< ' ú 6 n  3iòto become largernQ bagain,à up twëF < 1  •Ìa'n mus£ onéã 'Ë‰
 g"._Î6+= ³ l Ý  ÍÐrange(n):
     ðself._cond.notify()

! Ðdef __exit__(& Á, t, v, tb):"  &   €.release: õ	
class BoundedSemaphore(
 < ò"""Implements a b1 $ s2 .† A ð& checks to make sure its current value doesn't exceed! µ rinitial% q. If it, 0, V8 ñError is raised. In most situationsH ©  s are used’ óguard resources with limited capacityÜ fIf theó v K L  ß Àny times it''psign of1!ug¾ 1not� bgiven,× � default$1n ÆLike regulart .s,añs manage a counter representingo  ¹ `number� Á calls minusÝ $ ’acquire()$ ‘, plus anO –FThe 0  method blo÷ðif necessary untilÂ’can returP  w0out!1ingŠ Ë „negative> :2"""� ¬ l#=1Ö ê>.__+ )ï  ( :" Aial_H " =Àn Y - 9, ni B"""R.& aÑa, incrXú iÃ5nalÎãby one or more  ” IWhen-ðis zero on entry and another thread¶0wai  f;� O áto become larg2 "anQ €again, wÁsup thatP � !DsÕc%s,eÅ' aÛ_  Ø §    VF < 1Ú  ? ¸('n must beB'Ö y ®T
O #if îS+ n >  *i
6 ‰ "g 3"•  B ” y "= '    ¸· in range(nÏ    @ (îREventµ A"""CiÞ †e! ƒ objects‚5 k0fla©0at ÌbtRBtrueG tcset()  � —rwto fals- Uclear/  . W « TG ` † iã z !. 6   §"lyk Ë  Is@# Af/ÂTim Peters' ü ( ˜¹is_posted()o ` \„|€ = CondiˆP(Lock@  Ÿ  ' « 0= FIÀ_at_fork_reiÃnit(self):
  õ*# Private method called by Thread._reset_internal_locks()B  Q ð._cond._at_fork_reil !)
& �def is_se~ ð"""Return true if and only Dthe w � flag is) A."""Z  Å rA ‡  & u St 7W  r DThis/ðis deprecated, use notify_all() instF> ¼ õ import warningsÔ  .	 @('isÈ )ÿ m Xi %',E  «  D¦ BionWo æ, stacklevel=2ÑQ_ ¿  ÉÆNSet ¯"to¯>  Œ QAll tXñs waiting for it to become4 ã are awakened.Œ!Athat«F q() once‚   )Q@will�  b¶† at all.� ŒRwith F Í# ¸  \ i= Truef  6 .ýh  5\clear{ýs9Wfalse« ÕSubsequently,D ® D L1() ð ì `until ®8 ) Ued to¹ z :Wagain *#FÅ ¦  -ç, timeout=None�A"""B«¿ SU  ›!Ifø)³ on entry, Ööimmediately. Otherwise5=0ano! mosR to	 y êQ, or » g Ã „optionalö w occurs_AWhenN � argumentËp‚!nt@not 4,3µshould be ap AfloaWðpoint number specify+a†  yŸ 0era¢ ` in seÈj€(or frac  s£ Wreof)» e' º ‰pxit, soº ©calwaysšÁ  ^p except¯ �is given
¸  6Ws out˜ ²@ignaô=ÿ Ò�  c!ifEs) 
 !   C  D.ï › 6out_ 0 ( 7 ð


# A barrier class.  Inspired—@part• ø pB_0 `_* api 
#¡‚ CyclicBN À class from ô)Java.  See
# http://sourceware.org/pthreads-win32/manual ö_barrier_init.html andL j` ðsun.com/j2se/1.5.0/docs/api/! ó/util/concurrent/
#  rCyclicBe ` ñ
# for information.
# We maintain two ð states, 'filling'œ q 'drain @enab S the Ê ¡
# to be c{ B.  T ð are not allowed into it until	 ¡has fully c eQsince` �previousY °e.  In addiÃ ±, a 'resett™ º ð exists which is
# similar¢ Ç �xcept tha ­ó leave with a BrokenF�Error,
#Aa 'b '.3 inp Call ú0 geY 1e ei scclass S  :
¯Ð"""Implementsv ¶
 aUseful¼õsynchronizing a fixed number ofw –at known 1 ñP gpointsŸòblock on 'wait()î µðsimultaneously aw# o™yO h/ ô 0mad°‚at call.½ 2"""	 Qdef _íà__(self, partig acËá=None, timeout ) $„Create aq , <qialisedÚR '	…  @ 'e 0' ib ¢ Bable³ñ, when supplied, willÊñ alled by one ofñ  N  ÷äPafter©%y Penter• 6�just prioŠN `releasÓ@them'@. IfÚ¶ `providŸ  itÆ uö  asz J qdefault- ”¦subsequentÝ ü s £ Ô    ™Â._cond = Cone…(Lock())g ' R2 = 	  » $ =Ò  ¬$ =  Ê“= 0  # 0 Š2, 1$…ing, -1 üR, -2 “J –count = 0Šé Æ p	2WaiJ îå8W4  specifiŠ€started v ¸ Athey6all­ m	%n ¿Dwas 
ç ‚ � ,§P  ’ØÔ� Pexecu� ø Eback—µ returning.L R ð s an individual $exhfrom 0‡7-1'/g$if É øé ‡< ¤#._ � ž  ¬
=  ‚a() # Bß@whil¯Gsä  y ‚index = D 9u à    self._coun‡t += 1
  Itry:   þif index + 1 == self._parties/  3 ý	# We release the barrier\  - P . -()$ Oelseg õwait until someonz Ms usN r  9 Ž(timeoutv breturnú 	E ofinall( È |count -Z w ð# Wake up any threads ‡ ting for'© to drain.z  D e qexit()
 s# Blockm@ is c y[ ó
us, or raise an exceptionE  æt3 Sbrokez °def _enter(y )‡Swhile÷ state in (-1, 1&  ² 1# IX Ñ  é  † ‘esetting,ÿ ¼ AdoneŽ  7    t p._cond.&x#see if\ ¼ Rin a Á  – O )if­ 6< 0Ì  k Bü B­FErro²iassertE D== 0„OL A run˜ 0'ac`Y' andú¤ #@½ú€ \¬ã x 
à  ä  A "._ L  !# æv ¥
> # >   Þ ©§notify_allc m
’ #…@ durw  ¢ ó handler.  BreakG©3 •   } b$ s   , -  |+itexdwe are£_d.  R& £ b" srË Zw¸³ � $, fTif noO9 / Ù_for(lambda :lO!= 0H  ç #_ Ud out,¥ ÿ  '    � /._, _B51B3If ‰ ½ Clast#  ñUzˆ, signalJé #Q K P J 2  F ƒ¢ V Ùç É ä¶ C! i÷ + # è !~ 1ing¨    •O  S    %	^I  #g É A"""RœÀto the initiÃal state.

  ó4Any threads currently waiting will get the BrokenBarrier exception
J w raised\ 5"""h õwith self._cond:  > %if zunt > 0  	$ Â ? ==%  ) C#res² b¬ P, wakÏ $upì 	  6   Ÿ ` = -1% %elª & N= -2¬  M a#was b3 , ‘ bit to � > _ 7 ñhich clears when|0las… ¨o exits= Á 
Nelse« 
3 0W   ¯Ò.notify_all()= def abort(' )Z �"""Place¸ ‚’ into a ''‡ðUseful in case of error.  ¡™³=andÓaattempÀ@to 'Ì2()'Ì;havÉEh ¼( þ x._break   @# AnRernalã  (õ detected.  The 6s:%to—3# aUCð all parties awakenƒ J    !._n «H  Û‘@property/  éb ë RRetur¤`number¼ž€requiredù0tri~Ý .rF – m gŒ  n_Ò?ingŽ FaT’ ñ# We don't need synchronization here sinèðis is an ephemeralè1ultA ‰â# anyway.  It ï s"Ðcorrect value kbsteadyã.E }(X L<  0V™S Trž f³ Ÿ+in‘×†‡&
#@|  b‰$e `aclass
 
z±�(Runtime ap1  

# HelperuÃgenerate new(ò names
_counter =  Ð(1).__next__
ô@_new, ( _SClatel O	 # %K  er
p# Activ·‘administrAð.
#
# bpo-44422: Use a reentrant lockÃ Wallow Pcalls @func‹ƒs like
#à ping.enu†ðte().
_active_limò(bo_lock = RLock()
_active = {}    # maps thread id to T Ñobject
_limbo1 ó
_dangling = WeakSet()

# Set of: ‚._tstate|  � s £non-daemono ðs used by _shutdown()
#ƒ õwait until all Pyth7  ] õs get deleted:
# see€ 8set„ E().
c – s ” = _alloc­  !‹ " Rs = så Ûdef _maintainN @():
N1""" ”Drop any M  ñthat don't correspons@runnWˆs< amore.
O 1Caluàthis from time( Pavoid4   ever-growL ¤ J ƒset when* äós are not joined explicitly. See bpo-37788‘ T‰ ömust be called withÉ> ¡ acquired.ƒ $a# If a÷ was released, the Ë ± has exitedJ qto_remoÎ[aB forQ ,in‹ 1 ifâ  ( . Qed()]H )õ.difference_update(j  )
î¡Main classr ž 2s

 ?A* üÃrepresents a xcontrol^L 0canc¡safely sub Ped in< imñ  fashion. ThereÍ�two waysá ¡to specify\@ity:{@passcaÈCable_ŠÑnstructor, orQ  by overrid;  °³run() metho� ­ Õ  ÷< ò_initialized = Falseçb ó__(self, group=None, target Bname U  } ±args=(), kw ? 2*, ~7 ± 4 1"""Ð%coé   should alD ‚åÐkeyword argumÌ4. A  }:Ï  \ *Á *P 0be �  ; Arved@òfuture extension¢a¤Gå  � is imple~  X *%*"  — · Ô‚be invokz % ¼C Ä . Defaults µ Q, mea¥@nothø!is4
�  ™   b. By dT ¡, a unique  ­ }Ued of�  Ÿ bform "V0-N"@re N6 @a sm ãdecimal numberr€ � ±a tuple| a 41catIý  >‘ *TS Pa dic0 0aryÆb E  €j '{}» Eoe« «Q, it ‹ðmake sure to invoke#
  ó6the base class constructor (Thread.__init__()) before doing anything
L � else to U t= 
j 5""" òassert group is None, " ñargument must be † for nowD ”if kwargsA :_  �  E= {} zif name)   p = str( ).  Î + @_new+ "(""F-%d"7  } �if targetœ 1notÃ 
L  ' >try  = _e # =K !._ %__¡  *  + ‚+= f" ({| / &})2, ÿexcept AttributeError‰ FpassÃbself._^ ˜ �  ‰ =h ¬ =   ¬	  Ÿif daemonGu & Cic =1 C Å2 ‚current_²2().N C 1  id“=Ê ú
if _HAVE_THREAD_NATIVE_IDNB «native_id F  ¿tstate_lock! `starte> fEvent(sA �is_stopp# UFalse¨ ! �nitializ" 6Tru! ô# Copy of sys.stderr used by > Rvoke_=Mhook� 7 6= _E ƒ E » = _make_in _ Â# For debuggyÈd _after_for‰ à_dangling.add(¹ )¿ñdef _reset_internalks% ¶, is_alive)ºò# private!  Call	x  íU T our Y  ÄEs asý #Py mayÐáin an invalid ÷P leadÛ �to a deadD ¥ or crash.J  Ó #._A._at0_re¤3%ifÓ Ò  ð # bpo-42350: If™  \ák happens when  { al	#y _� P Q(ex: Ž 3  ñ_shutdown() has been cFG), _íN q. Do no`  i‘ vis case ~ #ifžQ  ² tA/ E b   4 wacquireqiS# Theq isn't c, º�: it doe rhave a › kanymorý — 	÷	Õ» Àe_lock = Nonñe

    def __repr__(self):   passert  ñ	._initialized, "Thread._ õ__() was not called"E £status = "B  #if\ ÷ started.is_set(ƒ  ‡ B ( B › ðis_alive() # easy way to get ._U õtopped set when appropriate© Ž 1 ˆ P ˆ < �daemonic: R+= " " ;  rident iFONoneD S%s" %<7 Å ðreturn "<%s(%s, %s)>, Ûó.__class__.__name__,F   ", j)q< ”@"""S±a the t	Â's activity.>  1£It must beó at most once per? ð object. It arranges fo  $ ð 's run() methodçôbe invoked in a separatœ · of controlœ DThisD ôwill raise a RuntimeError ifº 0morQ "an¼  onþ w0sam  Ì )""î %¸<S
ìŒ Š "("ir I n³ u‹¼Uc 1s cæ  ly¹F ö "g awith _õÊe_limbo_lockÈ  [î 1] =k3;try- k R_new_ì xõ._bootstrap, ())@ �except E :ionM Ÿ  /Hdel § `   %  Ç !._¦ ƒed.wait( E – " 
)M¦ `€esenting9ø7ð You may overridY¬â!ubÉP. The¶Yndard¶ sv  .Cable¤  pâD ËaÑconstructor a: N 0tarV�argument,"Qany, q@sequå ô al and keyword . us takenM Afrom˜ Bargs2 w _ €s, respe[(el[TJ® T ä ´"._* "(*  … 3, * k• zkfinall¾ð# Avoid a refcycle WÍ Ù@runn¡a function7 � E# an1ñ that has a memb1�at pointsüa .G  ×Ì Ú èÀ._args, selfñ._kwargs

    def _bootstrap(self):   õ# Wrapper around the real 3 ÷ code that ignores> ÷(exceptions during interpreter cleanup.  Those typicallyB h ÷"n when a daemon thread wakes up at an unfortunateA Ñmoment, findsÀ TworldÑ øit destroyed, and raises somG urandom Ñ à *** while tryÚ ‘to reporte ) 'inŽ kà_inner() belowO l Ròdon't help anybody¶ øthey confuse users, so we suppresE †them.  W  ´ bm onlyk0it y ar3aÓ 8Ì Ðindeed has al‘hy beenP"so/s (@normgù	usiness hours are proper%x ed.  Also,÷ Ì ü ß 3forB#icD(s;Ñ ‚f a non-g€ic encou² iS@methïåelse is wrong.F 6try? C R.÷1 
4 2if 7 ‰  ™@_sysr JNone0  h Vreturk  Êçœset_identçm  E = g' )= ö
if _HAVE_THREAD_NATIVE_ID† G ` œnative_idd  ‘ h # l  (p M ¼tstate_lockO 5"""C`Set a & p object™ðch will be released by		„ YI  Þ0und^ ãg… � (see py 0.h)&–s deletedÿ— î Ä @ = _$¥sentinel()z , „.acquire ?bif not�   áwith _shutdown7s 
'  + ›_maintain/ “  '   " 2.adÜ'._Û ºã Ü T" ‚ƒ  > .7o $ ¡ Ê   O w   " 0tarÚ;setm f!acè_limbod$ [Q Ü 1] =¿øu Qdel _M / ]y  à ¯trace_hookÎ qsys.set$ !(_ + aÀ      if _prÛofile_hook:
  ¡_sys.setpr& #(_	 / ))
0 >tryA ©self.run(), oexcept/ ‚_invoke_%  ™ (G B kfinalln ÿwith _active_limbo_locÔ  ¨  ø ð# We don't call u ù._delete() because it alsoÐ  ?   # grabsˆ  .0 4del, Ý[get_ident()]- 1 u Bpass‹’def _stop1/ q# AfterØ Ring .& °), .is_alivâ óreturns False and .join()  — ñ	# immediately.  ._tstatesý	 must be released before~ #Z ñNormal case:  C code at the end of ×thread's life? (v â_sentinel in _. €module.cÑ › sº ,õ L Ðthat's detectÈ øy our ._wait_for÷ 1(),â ( :M PnÒ.  Any numberÕ  Ñ qs _may_J §F ðsimultaneously (for example, if  Riple ò ps are b
Wed inJ ¢ j !s)û  Yòy're not serialized.  T
§harmless -I �they'll j÷0makùðdundant rebindingsã A._isz;pedk	B�.  ObscurwP  F 
¬� last so ¥ ¹ ’ `"asserÃ (lft "¾× always worksM (yQ €is execu@onlyr	º Ÿ is None)ÜVSpeciÝS_mainœ.“ˆ via thi’ Ç°'s _shutdow£†functiony  õ# =Ç Ü 1if $ !isñ ¸ 3 Zö   ) . 'edÌ#ÕV= Tru�  | ! =ƒ  ^ ( jdaemon‚ Öç _s 
'  ­ �# Remove£ ª  bd other\dð fs from=P ` L   �t¡
 (øm À )“ "Š `curren» Ûw  N@dict  ply runn™¶%.""ØHð# There must not be any÷ python code between the previous line
  ±# and after* û lock is released.  Otherwise a tracing functionL öcould try to acquireW ragain i“ 0sam �read, (iJ �urrent_th" A()),© wa b¦ !.
} ñdef join(self, timeout=None):"  î Ñ"""Wait until’ Y ³ terminatesP  . QThis e s, @callö 4 E Rwhose† µ) method is}  ? 'edk ` -- eiW° normally o€ø
rough an unhandled exceptk'orÇ o $alù h occurÍ #Wh� argumentç@pres  @not 7r, it shj5e aÈ Pfloatðpoint number specify a† fÏ pe opera¾  ÷fsecondq(or fraIi”reof). AsLPalway�Sturnsž �you must X� £is_alive()Î)‰¡decide whes¦ €happened� ifëO ë‘is still \ ,# œ  ~ ð Wd out>q
 eu#orÒ  £*Ewillˆ †ð˜ ·#A  Tcan b‘qed many«   raises a R× meError if†aattemp)@madeL 6 c¡© { aÉ2at ©1cau7Adead´! IN @alsoa em $toTlO `before‘Phas bÐqstarted¡ sš cdo so Ï  R bŸ G©5"""  0if › EÖ._initializedC ^ 	*1("T¢!._6 A__()I  Oed")a Ä ‡.is_set(©f 0can    ¦
q  Î  æ¬MÕ o > ]"")x ©  4p f  <
Z  € ð._wait_for_tstate_	(Jelse7 #añbehavior of a negativeÇ ouFqn't docÌued, butn ž �# historiŒ0y .<(@=x) ¤@x<0 Z!acSsù# 0N Ì 1 4max` C, 0)) ¡ S ,hV=True¾'-1ð# Issue #18808: P½  åÐthread state Óto be gone.
  ñ # At the end of úthread's life, after all knowledge* M ø4is removed from C data structures, C code releases our _tstate_lockœ ð This method pas/ úits arguments to< ˜acquire()F I×  ] C is $ !d,í � `is donî ÷nd self._stop() isà ñcalled.  That sets ._is, 0ped� 3TruG .×   N{� =m o 1if $ 0is : :  ¼@# al§ y determin  –  Î
Ö 	9  Gr¼  ä » 	$ ureturn
 :try~ › .L (b© ª, timeout)-  ¯    .ô%()Y     r jexceptL y  P ?ed(j  Á# bpo-45274:@¥ )ûú C B, bu …function~  —   ò# was interrupted with an   ðion before reaching_ H   q ð. It can happen if a signal handler raiôa– ~ ô, like CTRL+C which9 ”KeyboardI¾  Û   
• ¶ ™ 8 › "‘@property> �def name(;  @"""A	   us!Ðor identifica|` purpoò Ronly.^  m òIt has no semantics. Multiple °Qs mayá@ivenƒQ sameŒ Q. Thež  N qinitial  aset by2 2con¬'or 5"""= 
?J �ized, "T80.__a p__() noã 3A r\÷ )ç @ q.setterm 	H,­ N‡ . ž ._u   =—( )Œ Ñ¨Ò ó Ç"er#is•1 or¼ ÞiÅçt been startedhï ¢� nonzerowpger. Seèbe get_� $) ³ Þ 7áV%er`recycl½Then aŸ !exP¤nd another ö@crea¨  Dê  ©  vailable et* €“µ c 	æ NGÃðif _HAVE_THREAD_NATIƒVE_ID:
  •@property ödef native_id(self)/  6 A"""N  ó integral thread ID of this õ, or None if it has not been started.
{  ^ T> Çis a non-negk öer. See the get_§ ¾) function.N �represent— 5e T­ pas repo† 1 byW kkernel” 9"""V passert ò._initialized, "] !._ A__()ð jcalledE creturnE Ê  „Œis_aliveƒB"""R; qwhether¸ ‚ 9 5 Á Qrmethod t  s True jusŠ2forRcrun() * �qs until* 3aftt 	1 ¢terminates¤Aalsoš emodule H ·enumerate()® kg.#if_ is_stopped‘ ‚¼æ 0ed.  ;et(é.e False· 9 ñwait_for_tstate_lock() )* ? n  f † æ
| ôodaemonò öA boolean value indicating w  M Šcýq set be ()= °0, o``wise R
¦meError iså ³aised. Its 
£   Áherited from2cre· ±; M Cmain°  †  :aÇ @ and3 r³ $al|!s Z Ued inP  (T ¤default toV =Þ	ðe entire Python program exitsodn onlyC É §s are leftL Í:O€Ü#icI q.setterÿ N,® 'icä!if�R ½ Ç
ïrâ	 (æ€[hb  0canÿ ŸÝ  /0tusa acž)"o É / Eic =ô & ?isDcUOÞHY@is df0cat"usSŒ � attribut¸Hsteaô$ im�† warninge .	 %('Å ¬x 0getù x Àe instead',
  ôDeprecationWarning, stacklevel=2)
7 ñreturn self.daemon
 �def setD ( ",   Aic):#  C ó"""Set whether this thread is a3 .T  1 T" Qmetho" d© Ãed, use the ˆ ÷ property insteadF 5"""ƒ ‚import wè s  .	 &('Í )› y 1sety à ¤ attributey %',U  Ã  g AØ ="ic kqgetNamei
_R¡€a string&âd for identifiçç purposes only+qNnameö D o Ñ mgmu k0Ò e ese ,  
k Ê �  o jÖYdÅ YÆ¾ ÄF^ ==b


trydfrom _ú’ö(_excepthook as  PQ   _E4 €HookArgs8 
 ")
H ! If RError„ ñ# Simple Python  Ament4 if¡ .™ (HÑnot availableíÑ �tracebackL  eSprint> 0ionž _ > `collec„s@  >bdtuple–î Y" (J  m'$�'exc_type]R_valu
 ¹ “"')p  k
M W(args>™ !(*' E „ ÚA 7, /D /ñHandle uncaught T`.run()µ  ep!.ì < 0if w .å Ò== SystemExitõ    ÷# silently ignore* ]  ) á Ê    0sys øNone and _sys.stderr 
v   =. n $elÁ …G ï . "._] O ­ ð stderr is None:+
  ø# do nothing if sys.stderr is None and "wa K  ðwhen the thread + }created. ereturn Uelse:  ¥ š Sargs.p ² 	G h  ;if 3 1noté 
 hname =, . H ±   å = get_ident()- ðprint(f"Exception i)%{8 E}:",.  þ r  file=‹Æ, flush=TrueU _V $_eT (Ø ’exc_type,»   Hvalu œtracebacks y  ~ r Ž .� ñ()


# Original e 3 ofüBing.š chook
_§   W__ =  ÷

def _make_invoke- "()—1# CI� a local 6àspace to ensurwñ
at variables remain alive]!# ¢f  îÀcalled, even&it Ã late duringL ñPython shutdown. I0 ômostly needed for daemoð1s.
@ 7oldç 
 ‚   :sys$ _Ÿ; ) 0if ,   µ  ¹9 # òraise RuntimeError("3
§: "óZ † e^ 
¨ X ü R „_info = Ö  ! ãà1 = è 3sys6 K ?9á ? hglobalz    6tryÏ    §“    1if ! 
     =—¬      ¬2 = ¸HookArgs([*3(),N*])>  a ï© Q  Q  b asë 
Ø ñexc.__suppress_context‘ \d M   !de,
y "if ³ Ö<%¶ û)! 
ˆ  ` $ =Q y	† g	< å"._M 
¬ � =(z
ü� i  
‹	« © Â ýÐ  _C 	� ,Àys_excepthoo÷
k = old_sys_excepthook

  
 #(* …_info()), …finally:  D ò
# Break reference cycle (n ö	ion stored in a variableV  E ²args = None› Ùreturn invoke¹ ñ0
# The timer class was contributed by Itamar Shtull-Trauring

c1 T= ‚(Thread)Ï ð """Call a funct· òafter a specified number of seconds:®  Ã   Bt = \ �30.0, f, Ú =Ø E, kw 
þ Œt.start( €cancel()[   #G4p tü B's a¨ ñif it's still waitë  6 2"""¢ õdef __init__(self, interval,ò ® # Q 4.K ·  Y .X % =c 1! a=z 
!  '! =;3 if Qs not"Š else []5 ^# =g 9  i; *{}; ð finished = Even‰!  5„ ¹ * g"""StoŽ o ¥it hasn't Q @yet.„ 4    G . 9.sek 1run›h 
0  Û" d{!if 
1 1is_d À… æ!(*3  s2, * 8\ " ¶ @
# SAal tI�Áto represent®Cmain# €R_MainK†s
]¼ 1 
|†, name="Q ç", daemon=FalshÆ  Ç_tstate_lockt   Š#edœ /   Ret_id!    ö
if _HAVE_THREAD_NATIVE_ID¸  ' A —native_id{ `with _Ï�ve_limbo� 
C   [K ˆ @] =  £


# DummyiŒ ïp‚ed here.R`se are¾àgarbage collecQ0wheÃãey die, nor ca !bes`ed forL  If÷y¼� anythingÿ)Ping.pª òat calls current_  1(),B ð
# leave an entrS   *P dictv  ev¨ ® € ñTheir purpose is ’OQ*someŽ m* fromy @ y£ marked asQ\ s so we wo- ” „  ™ Am
# +õwe exit (conform previous semantics).¹Ý3À_newname("Duó
mmy-%d"), daemon=True)

  üself._started.set() xet_iden õif _HAVE_THREAD_NATIVE_ID:=  ` ] Çet_native_id_ �with _ac ªlimbo_lockC   [K ˆ @] =  Å  def _stop( )> Fpass# Œis_alive& ¡assert notT A._isN sped and    	#preturn Ul Ajoinh ç, timeout=Noneœ v °False, "can�  8 ð a dummy thread"


# Global API functions

ú ‚current_. (c B"""R™ Cthe $ ! TR ñ object, corresponding to , saller's Â of control.à /If( A wasOpcreatedJ Aough7 § 1ing'{module,ó ¡  @limiE ÷ ’ality is y#ed— 1"""S 6try$ c&[gÉ]- þ except KeyError9 DŠ7)()q 4 pHEThisõ ù `deprecZE, usÞ| insteañ import warnings  .	 #('(Û m !',Q  ô Dª BionWw â, stacklevel=2i¥} Ç n0coum`number¨¸ >sö1ly ø(5The; W  ç Tequal`lengthR  Flist2 !byè ³enumerate()X €µ´_Ôr˜Clen(' A) +  / gù Cø 8Gq _/()E'H ¹  \°! i A/
X ?_©=§# Same as  Q, butp1out¨ ˆ¡. InternalhQonly.þÃ4istÄ‘.values()Í Î ‘ u � :!a kjof all¬Í	5 ƒincludesäÀic threads, òdummy thread objects created by
    current_& ó(), and the main= ñ. It excludes terminE 6 s4 N  ñthat have not yet been started.
- 1""" ñ	with _active_limbo_lock:  ¤ Ãreturn list(( Ã.values()) + :  3


Õ ó'ing_atexits = []
_SHUTTING_DOWN = False

def _register3 ò(func, *arg, **kwargs)œ ô"""CPython internal: @   *: À* to be calluÓefore joining^s5The> $ed@ $is= ( Å Ðarguments jus[U 1all2”non-daemo¾3s at ñed in `_shutdown()`ÛPproviÛ‘a similarJ ppurposeÃ `A.Þ �()`, but �  é Btioni ë �prior toJ  ó { Q inst˜f=tpreter   4For“ 0ityŠ ‰ ,£Ž ?ed „ ±in reverse.‡ r:if Ðlõ	aise RuntimeError("can't› ‚ 8 af° "")Õ þ " =� Ïools.partialH– §€.append(M “)


from ' p importLÁck_size

# CÖ¸õ0,
#¢ð make it available f£(he‚ó 
# (Py_Main) as¤Eing.7@.

_f ’ != / Ti#()IÊ(.ï PWait `l¯ A" Ö ¯te of all Ê �get deleF °Óó# Obscure:  other¹ Ps may‚@wait�!to Â ‘.  That's¡ ’# dubiousâðsome code does it.  WÒ  V FC# £to releaseK J‘'s tstateã1 - * woL höUN ðis nearly dead.  So w6s  Ü²here.  Note\ # I ý u_stop()N  w oenough7 al;	?Gon _Â X PA._isj 6pedZ%# At() was _  ž !ed•  ÓrïOkglobal®* 
Ár = True5 0# C?^ ½/!be>" Â Ÿ ¦ � ¤# Order isK$d,’� N` _Ó  l#d(,Œ e 5  ?   # ‚Åñ eÑident == get_ ð():
        tlocók = _main_thread._tstate_lock
  `# The '  ' ô isn't finished yet, so its" G  G g can'tM õhave been released. �assert t9 ¿is not None! .& Eed() 8 .W  
ä Cstop Uelse:? ú# bpo-1596321: _shutdown() must be called in tÄ A# If -Òing module waÒ ±imported by) [,� ¶   i[e_ewhich H  Œ n 	‘  ¯ ù is case, ignoreùñ
, similar behavior than f	  s™ Rspawn¿ ðC libraries or usï N“start_new &()• Qpass
T ð# Join all non-deamo° v —while Tru¬Fwith¢±s Ï ¿ #•s = list(Ñ) s8 *  ‚.clear()¤  ! !if�R 
e Vbreak)  5 &  &  s. ’# mimic TsCjoinŽ f    5 �.acquire áA 3 S# new èn­¨@`we wer† it¦ §  9WotherI Iñs to complete


defËÕ €"""Retur±
$robject.üIn normal conditions,üäRfrom é"thñPython interpreterThG1"""Í r— Es

# get'`-localEplementa– @, ei ~  #
#Å,ç p‘ Òfallback

try# - d @ort wPal as±al
except I^Error< 3ing7 î; ‘Ò_after_fork()< ÿ sCleanupì  ðm…š±that shouldÖaexist O   a÷k«O ð# Reset _active_limbo™  k,ç Y1 we9  ed¶l¬e® k¤Aheld˜#ö!anv  (ò ¿ 3ed)« ò .  http://bugs.bñ.org/issue874900J oglobal“ 	ö  , Ó» 1,G] é „ = RLock#î á() only copiedÓdcurreng!; J¡ referenceZÿ sd !WR = {}2I ¾ R =í Ñ[get_ident()]° L7KeyI < §  ~ð called in a thróead which was not spawned
  ñ# by threading.T
 ó. For example, a! = 	².start_new_N 5().e ò current = _Maine 1()
! S_main5 3 = ,  ó# reset _shutdown() locks:“ ðs re-register their _tstate_) b belowh D  s  ’ Talloc0 /(), d = set± ñwith _active_limboL ::  W£# Dangling¦ ó instances must still have³  «  Ë Gset,G ðbecause someone may joiFthemass¨ Â_enumerate()Ð  – $ @.upd #_d¤ "  foC 3 in» s×  E Q# Anyƒò/condition variabl  $beÃl) Ped orQ %anÛ K �invalid ¯ñ, so we reinitializæ  6 #if™ 4 isi 
£  & p# There$ Ponly =±> 0. Wk  \`the idŸ)to¡ I òits new value since it canÁvchangedŒ 7   p!._Â‘_internal+fs(Truey /   ‡ a= get_ �   W   " =» ¸  ˆñ [) 3] =ú 	+ Oelse>0Allšà others are aly stoppð OFalsñ  Í  U _ é Wg.clearu uÛý c³assert len(F ô) == 1


if hasattr(_os, "P¢_at_fork")$L_os. ò(after_in_child=_  7 ð)
#! /usr/bin/env python3

"""Tool r`measur-QexecuRð*time of small code snippets.

This module avoids a number5 Ïcommon trapsb 
b `s.  SeÛòso Tim Peters' introducŒ oð Algorithms chapo0in
=PÖ ð Cookbook, published\ñO'Reilly.

Library usage: seá z per clasÝ ÃCommand line* ³< ¸ òit.py [-n N] [-r 0s S p h A-] [[�ment]

OpÐ ÑS-n/--2±N: how many^ Rs to ‹5e 'A ¢' (defaultº Y `Ï-r/--repeat L   + ¾ rI ! 5@ Âs/--setup S: ±  † $be‰ 1d oy&lyD g'pass'mÀ        Execñution time of this setup statement is NOT$ ñd.
  -p/--process: use . _L ¡() (defaul?   ð.perf_counter())I ðv/--verbose: print rawO ðing results; repeat for more digits precisionK �u/--unit:¿ ° the outputM  e  p (nsec,± Ac, m aor secŒ „h/--help‰ ‘usage mes €and exitp -i �parate opEfs from8j V when  
 Àrts with -
  f: R to bUdG÷'pass')

A multi-line5 0may6 ðgiven by specifyIQeach / sas a
se¸ @arguâ¡; indented& às are possibleL `enclosK 4an
6 ° in quotes u  @lead(  spaces.  M¬ eple -s(€are
treaq ðsimilarly.

If -noAnot É �, a suita‰ `number§Ploops) acalculI Pby trï q
increa� 3 š ðsequence 1, 2, 5, 10, 20, 50, ... untilAb
total@ð is at least 0.25Àonds.

Note:/  re‘ áa certain basetñ overhead associ­  `execut. a
ÝÍð
.  It differs between verî VðThe code here doesn't ð
to hide it, but you should awÛ€of it.  F § ð can be
measured Pinvok©  CqprogramÄDout  ñ
Classes:

    Timer

Func!  ²it(string,  �) -> floa^ ó$ 2lis# `p'r(@ ô 
"""

import gc
 4sys  ‚  ñitertools

__all__ = ["¼ @", ",  it
 ‡ 
 	{ ò"]

dummy_src_name = "<8 t-src>"
1 �Q = 10  \ E = 5  A 1r =�	=Ó

_globals = 
 `

# Do`change’Öa| 6 ½@temp0;! "reù () calls
#Õû ð.__init__() depend on\Pup be; Red 4 îlstmt
## 8# $.
�  $"€ inner(_²Í{z 1}):E{�} b_t0 = % (¶  _i· 2_it2  {{ˆ 5    _B 1B òreturn _t1 - _t0?Edef Csrc,N– �"""Helper­( / a›.� † j ð src.replace("\nQ¢\n" + " "*V@)

cKC× 1"""_ó 0tim„C š@peedæRsmall“snippets.�5ð nstructor takes÷ a statement to be timed, an additional
   ) àused for setup, 1d a9 `r func5 v.  Both6 sE adefaull ¢'pass'; thu < ð is platform-depend  A(seeE ðmodule doc string).  If 'globals'A pspecifiÌ  b ²code will bE ðexecuted within that namespace (as oppoë ‚to insid¨ 2it'Ì - 1).
˜ ¡To measureÕ b 1ion1 of VfirstA, us/ B  }öit() method.  The repea  Þ Ða convenienceº2cal§C bultiplµ ðs and return a list‘ tresultsÀ &he™ Ps mayf ðtain newlines, as long ¤they don't( Å my -/ Ÿ¡ literals.  2"""0ð
def __init__(self, stmt=""",_  Ù #r=A_ ,P  � u=None):  ÷"""Constructor.  See classG.š J  � .f ! =ÁrM Õlocal_ns = {} z  _ ss() if   ¸ — T else ?  V = '' Óf isinstance(l7str×  ­ r# CheckÁë0canÎÁcompiled outÂa¢h  E ( f  dummy_src_å0, "Ì)")3  «‚prefix =«f + '\nÁ  Y · a = reiÆb 4M Pelif À3ablè ã q1['_P $']s 	’ Cb+= ', ( = ’ 5tmt¸ o® h &();  µP - ñraise ValueError("�  çqneither_ ¡E norã Hiã0tmtâKÿ +o/, î	Ç¬ 8Æ?tmtÅ2tmtÄ?tmtÃ _g† x   * £?tmt¢0src  em‘ e.“0at(ƒ = ¥ú , ‚= HF   q # Save?õtraceback display®%= –/rc¦ £(9 ,\T_ns, ;‘ Àself.inner =ñ( local_ns["inner"]

    def print_exc(self, file=None):$  ( Â"""Helper to1 ò a traceback from the timed code.a  = ÆTypical use:   àt = Timer(...) Â   # outsideR •ry/except�  ( 6tryž      t.€ %itN Â# or t.repea 	E X H )² ðThe advantage ov·he standardõis that source linesz !inÙ øcompiled template will be displayedD±he optional¢ô argument directs wher4™iw €sent; itôPaultsËµsys.stderr.  5""" aimportÁ fcache,å $  f 9À.src is not >
W B . ñ[dummy_src_name] = (len‚ I %),_  Ù  s 5 ¸ ¿.split("\n"z 
Ë )¹ R# els‘òis already stored some¸ , k[.Š˜  “ ¼ð È À, number=defà_ 
Å m" ' p' execuTAs of•@mainÑ te[€oš`precis3his? eìve setup; ¥ once, and²then return3  ½  ‘0takE oQ Š  E aæ ± ðimes, as a float measuX Æ Æeconds.  The@ 6£eN � throughƒ Tloop,/5ingE âto one millionb  ;,B /`r func† ‘ be' d are pass oL ¯constructo¬ N”itertoolsõç œøgcold = gc.isenabled( @.dis  s‚timing =ÿXB(it,  ÝrR kfinall´1if ‰ 
+ í2gc.– € ; 4 Œ� Ý  @Call\ Peit()Q!ew s ö ÅÇ convenience¿ óFcallß M ª  Õ Ž Sedly, ?`a listÐ0res˜PUfirstæE òspecifies how many§  = |   w Ð, defaulting sto 5;
  ðthe second argument specifies  Utimer Æ, defaultingE õ o one million.
 ð Note: it's temp5 õ to calculate mean and standard deviationE AfromŠ Ñresult vector6 `report õ
se.  However, this is notG ðvery useful.  In a typical case5 õe lowest value gives aB   ðr bound for how fast your machine can run• B en codeE ò snippet; higherk 2s i1 ã $re¤ )lyÍ ðcaused by variabilityE €Python'sÅped, but& Uother„ €processew âterfering withË 0tim Ñaccuracy.  SoÐ Umin()G !of ´ ±is probably  on´ PumberV – should bøinterested in.  After that,2 alook aæf entirB ðapply common sense raö  Q n`…tistics.À 5""" er = []  ßiPårange(repeat):   >�t = self."Ait(nì  $ ¦r.append(t ‚return r'‚def autoi  P , §lback=Nonev B"""R=  ™p ‘ of loops ‹ € taken s³ 7Qotal  g>= 0.2 FCallæ’it methodpincreas
k %s ‹vsequencŠñ1, 2, 5, 10, 20, 50, ... untilƒ œ  isÑ le=50.2WŠ2.  ç #s U,À _= )À qIf *cal-*ñ ³Qþ B°, it will bŸ`lled alx ¢each trialû 5twoòTs: ``e � /``SUi = 1c ªwhile TrueF jjjB
  D}… = i * jQ      W� 1 %ifam  ! í 	 'ifœ bW øC	V �i *= 10

 Þ õit(stmt="pass", setup  " #r=–_ ,P ?!  ˜, globalsc """ConveniÛP func‰² re¯Taobjectp + <.Vï 3 À ¹ Ìr‚ )@ø r8 ê ø B ø Àlt_repeat, nñ umber=default_n ðP, globals=None):
    """Convenience function to create Timer object and call repeat method."""
N breturn3 ð (stmt, setup, tF ‚ ").@ ( ", ¢ ò )

def main(arg© ±, *, _wrap_E ¾ ñMain program, used when run as a script.
ï `The opâ @al 'd ð' argument specifies the command line¡be parsed,J \0ing Çsys.argv[1:]k övalue is an exit codT s´ 0to D   a(); ite pmay be ° f Pindic”ssuccessj Wð [ !ceÜ Á happens dur¡ ðiming, a tracebackŽ ¡printed tom astderrã  ¼ c1.  Exb ¡s at otherÚsA q(includr €he templ® pcompilavô ) are not caugh—'à'› 0an œ Brnal	 BfaceÞôfor unit testing.  If1!is]  1�, it mustBa¶Àable that acÉ  TøÈ  öþ  ²æ r' ! (i‹ !).@  if\sÐ  ‘ q ' x! =ñ59 Âimport getop6try7 Ropts,S =% ., .ò, "n:u:s:r:tcpvh"© q  "["|Q=", "­
 ™=D   "F A Pclock	 0pro¢@ pverbose:  Üƒ qhelp"])eyõ PerrorÞ6errÏB(err3  ô   "use -h/--S  ¶	Ý  "5 û" 22 Ú Cr = ð„”  à£ = "\n".jo³¢) or "pass]ò = 0 # auto-determineE  Q = [] wo   $ L   š _.! ="   ðs = {"nsec": 1e-9,  U6, "m 3ö 1.0}C `precis1= 3  2o? in>stÀif o in ("-n½"--ñ "_ …     =Í&(al@ s@ ƒ?  .Õd? u?   >  ˆ ¥   ¼  ˜   Hað     Felseì     UÁUnrecognized‘ð. Please select �’0c, q,Osec.Pfile=‰% u   ™    >ð r", "--repeat")7:
  ù repeat = int(a) 3if  J<= 08  C  5= 17 úif o in ("-p", "--process")@ €timer =  .$ _ K vK |verboseK 3if  
c  £ ¸precision +§   4 
 À hu Lhelpr  pr.ú__doc__, end=' '=�return 0Ð ñsetup = "\n".join( Á) or "pass"
( ó6# Include the current directory, so that local imports work (sys.pathJ �containsK C ð of this script, ratherV n* u E 8 Ý q 1 os q ó.insert(0, os.curdir0 qf _wrapÚÖr is not None« õ 
) ( ) �T.q(stmt, :,9f @numbP	¨Ã# determine ! @Á0.2 <= totalK R < 2.­ ¡callback =® ï   lDdef 4 (l £ k_takený J 0msgð
{num} loop{s} -> {secs:.{º@}g}  "€  :   “plural = m R != 1t   © msg.format. =Ÿ “s='s' if M �else '',m N   • =¥ß  , ® = m)Š 6tryë A ~ _ý´.autorange(>; jexcept> !t.Ó V_exc(*  X p15  ¬B (^  0rawªAingsž á( ,Dw � ™ 
•  %ˆ f Ge(dt0uniêU  	È   > é €scale = &  s[ ]Ä Õ
C.  à ![( ,8 Q) for
 !,   Æ K –s.items()T t òs.sort(reverse=True "    T N e  T  s“  + ‚if dt >=~    $ Vbreak^Õ"%.*g %s" % („,O /N ~ òA"raw#s:O  °Gmap(¼ 8,)ðJ 3timKS[dt /@i dtp]× 0bes0min > K W 1"%d+A%s, * Pof %d­ A per +%Ð, 's' if numbøer != 1 else '',
  ñrepeat, format_time(best)))
*   ñ  = min(timings) Pworst *ax 2if  1>= = A* 4:3  x °import warnL   .	 õ%_explicit("The test results are likely unreliable. "J  f   J ™  å ð
 (%s) was more than four  sO bslower9 2theë  = Z .� 8% (tš )ˆ±Û RUserWP,á" 0¢òreturn None

if __name__ == "__main__"›�sys.exit( ô.())
"""Token constants."""
# Auto-generated by Tools/scripts/  _t?  .py

__allx a ['tok‡ â', 'ISTERMINAL :NON ñEOF']

ENDMARKER = 0
NAME = 1
NUMB ð2
STRING = 3
NEWLIN" ó 4
INDENT = 5
DE P6
LPAJ 27
R	 Â8
LSQB = 9
R	 €10
COLONg p1
COMMA `2
SEMI
 `3
PLUS
 R4
MIN A5
STZ €16
SLASH  B7
VB Q8
AMP° `19
LES? �20
GREAT ð21
EQUAL = 22
DO¹ r23
PERCÆ €24
LBRACÝ E25
R E6
EQ; U7
NOT 8k  9p  p30
TILDS Ð31
CIRCUMFLEXL 2
LEFTSHIF‹ v33
RIGH ƒ4
DOUBLEö !35Y 6 7 8" 9ç  "40/ 1I 2¬  3±  4¶  5»  6 ¼(47 ' 08
AE49
Ag�50
RARROWl�1
ELLIPSIâ"52K? P53
OP& `4
AWAIJ €55
ASYNC À6
TYPE_IGNOR”"57  „ð 58
SOFT_KEYWORD5 �9
# Thesebn't usš ˜!C ‰€izer but# p neededô  ©�ERRORTOKEù6"MMu @61
N˜‚62
ENCODmQ63
N_0  ê ñ	64
# Special definitionsg @coop2ð	ion with parser
NT_OFFSET256

 ° = {value: ¶	Þ1for !, " ò in globals().items(,aif isiÈ1ce(5 á, int) and notO p.startsŸ d('_')}¹„.extend(œ .B s'b
EXACT_» 
{® d'!=': ŒÆS'%': Ñ  &  % A&': 1  (  & @(': Ð% ð)': RPAR,
    '*': SøTAR,
    '**': DOUBLES = TEQUAL2    ,  ƒ+': PLUS$ +$   $ “,': COMMA% u-': MIN5 -5 8MIN4 ³->': RARROW6 .™ T . tELLIPSI~ “/': SLASH% / ä 	  q  y / E  :Ã 3LONZ :& ICOLOµ ;€ 3EMI% t<': LESž < dFTSHIFÈ  <<J #LE t  (SS  . 	    :dGREATEì>%  	*  + IRIGH“ >/  2 T@': A¼ @W (AT  [ó 3SQB]Å ^F“IRCUMFLEX$ ^F C N {N SBRACE, e|': VBÄ|;   5 }t 5 ñ~': TILDE,
}

def ISTERMINAL(x):ôreturn x < NT_OFFSET- ?NON0 .>=1 >EOFY ò*== ENDMARKER
"""Tokenization help for Python programs.

t( ðe(readline) is a generator that break óstream of bytes into
W L ós.  It decodes the* ðaccording to PEP-0263– �
determin ðsource file enco1 À.

It accept„ « ð-like method which¼ ðcalled repeatedlyp 0get‹ `
next ç  Â Ðinput (or b""Š R EOF)À  ðes 5-tuples withE Áse
members:
Þ ä ü ± type (see  K.py)" –(a string Pstartü ð(row, column) indices© a B(a 2�   FintsH  en- F ,‚original&(­  ‚°is designedTAmatc€ working“  « ðizer exactly, exÄ
S€it produä  À2ENT6s‹`commenð`nd givL ^!OP ball
op£ s@Addiì alh 2allL q lists cÁ²an ENCODING# 
:“tells youJ}r was usó Ö Õ.rð

__author__ = 'Ka-PñYee <ping@lfw.org>'
__credits+ ð('GvR, ESR, Tim Pñs, Thomas Wouters, Fred Drake, 'X l ð'Skip Montanaro, Raymond Het^ÿer, Trent NelsonC òMichael Foord')
from builtins import open as _ Àn_open
from ócodecs import lookup, BOM_UTF8
 ´collections ôfunctools
from ioD ÔTextIOWrapper. Aiter. U as _  $re
 #syQ TtokenT *e 	 ð4EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=] Ð]*([-\w.]+)',6 ÍASCII)
blankK bL Ê(?:[#\r\n]|$< Í ° ±
__all__ =  . A+ [" ñize", "generate_ s ’detect_en´ O",
  1"un: O TA¢Info"]
del} …

class  (ÛÕ.namedtuple('" ñ', 'type string start end line')):• ódef __repr__(self  ° ¡annotated_I á= '%d (%s)' % - . ,¤ _… [A  !])^  F wreturn › (6 C=%s,œ 0=%r 1art
 1end  ¨ 0=%rn M  Q   i  · BlaceP 
® 1))
5 ‘@property  î QexactÒ Ã ð 1if X  Ÿ ¢ == OP and F=in ÁI –   ï & G ]�  . Oelse@ ‰  

µ ógroup(*choices): g ô '(' + '|'.join(    !)': ?any8  P  0 *0 _maybe2 ð?'

# Note: we use uni›` matchw@for ùs ("\w") but ascii$ °
# number lfáals.
Whitespacð'[ \f\t]*'
Comment.A'#[^Ìq*'
IgnoD9  +  �r'\\\r?\n- B) + ï R R)
Namn “\w+'

Hex— ù= r'0[xX](?:_?[0-9a-fA-F])+'
Bin' $bB' 1  9Oct  $oO  !-7! 7Dec! A(?:0g …0)*|[1-9. –9])*)'
InP Ê© %, � %, x %, b t)
Expon@�[eE][-+]Ó 	h °'
Pointfloakh  r'û 	(  \.R0¦ /?'öMr'\.C 'Š� § | v   Ê,  
F¤ Aª ½ Q, ExpK k)
Imag) ]  x[jJ]', W A+ r' 2)
N©"= i S 	2 %, ¦)'R“the emptyüà, plus all of  Svalid ð
 prefixes.
def _all_strinôg_prefixes():
    # The valid string # ó. Only contain the lower case versions,G ¥ and don't2 Àany permutat+ ô (include 'fr', but notA c'rf').� Zrious> ñwill be generated.: _½ _½ à   = ['b', 'j  'u
 f b Afr']> ò# if we add binary f-L  s, Q: ['fI $fb5 Ñresult = {''}G 3for8O in “ q u . t) ¨itertools.)(ƒ£ 2   ñ# create a list with upper|œ—� of eachž  >   É#  character  ‘ u‘ ñ roduct(*[(c, c.j @()) - c- +t]¢  d ñ.add(''.join(u))n rreturn " r

@funcý ólru_cache
def _compile(exprc < . ý, re.UNICODE)

# Note that since _all†sÓSemptyûa,
#  SP(@ cans ü) P (mak,Pit opÝYal).
; Ÿ= group(*„ !()¯ €Tail end®'… ó.
Single = r"[^'\\]*(?:\\. x)*'"
# < "< BDoub< H'[^"<  K)*"'< ,''z 3{ ~ –|'(?!''))‡ '‰ "‹ M Œ M `"(?!""M ˜ �""'
Trip¾ ;	PŠ+ "'''",¡²+ '"""')
# 7¶-line ' or ‹ I  “ ã™+ r"'[^\nj  lâ Ü ?  '"? È Þ   oéASort0 ÿ ¤²e order putˆplong opÚ�ors beforË$eiZð es.
# Otherwise¹d= came- ð==, == would get recognized as two instances
#t¥=.
Specialð*map(re.escape, sorted(EXACT_TOKEN_TYPES{É å=True)))
FunnyH £r'\r?\n', b Õ)

PlainToken' �Number, = Ü„, Name)
+ 0Ign&+ A ñ

# First (or only) ú,ofýuContStrs ¿þ	1" +»ú œ"‹Br'\\ç )&¨r'	'h W'"', h å)
PseudoExtrasÕ " ð|\Z', Comment, Triple)
PseudoóžToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)

# For a given string prefix plus quotes, endpats maps it to a regex
#  to match the remainder of thatX 3. _Z ðcan be empty, forD ña normal single or triple „ dF ¢ (with no M 4).
œ …= {}
forh ‘in _all_sØ ~ £es():
    8 [ ± + "'"] = S‚ $ 0'"'$ oDouble$ 8"''J 3' 8'""M  3

# A set:0all 4the?and
0es,H`includÈ ; @open D2s.
]_ 0d =m 2()
i  K/t E % u%  (t + '"', 	 3"'"f j	v q.add(u)> "@ 'B 	¢ B ñ
tabsize = 8

class ôError(Exception): pass# AStop' _izing'  K 0Untgaizer:
¯ ødef __init__(selfä Aelf.1 as = []1 ý   Ïprev_row = 1  zcol = 0 AencoÉf= Noneƒ Uadd_wú‰ w, start� Rrow, X  \ 0if ‰  < Á .™ !or =&lf  v G 0 2colC à   ²raise Value|"t € ({},{})¬Pcedes	 Pvious} "›  K   .f$t(Ñ ,¹  Bcol)Y F prow_offP=Ü -: w , 
Ù $Öð.append("\\\n" *S 4 t  x 4 X 8×3col2 ! =œ’ 8col’ , ’  � 1 !)
I  ®uÄ'‡iterable*Pit =  (  @  Ì lindentÒ k0linyBFals /  Ð3*it¶ êif len(t) == 2  9 4Êcompat(t, itS # Ubreak™   °tok_type, t©­#,   t2  if+ 5  ‰ �ENCODING� �a 	K  � vcontinu   d ~DMARKERe Ò < cINDENT9 À           iûndents.append(token)
  ‰continue ù	elif tok_type == DEDENT:%  I id Npop(\ ö self.prev_row,  �col = endQ � þin (NEWLINE, NL)– ïstartline = TrÜ " Cand Æ I  $ =" M[-1]³ 1if O ²[1] >= len(8 š   4Žœ0 [ / E6` 0 ˆ ù JFalsÖy ñ add_whitespace(2 
º' 
   &  — ÜPÁ9^ += 1ë # 0" ÷ return "".join(Ï !)
% ¡def compat ,êÇen, iterable¸™Vs = [ùRtoks_V" =Ö!Ïe »ˆ" L[0] þ .  M’string = ¾ 0for¦  = _§ Ñtools.chain([[ ]À  † atoknumæ  vaxftok[:2Ð  %  0numîŽENCODINGMRencod§ etokval§  J   Æ	 d  AMÀWUMBERr ?   Z  ü2' '¸    ±# Insert a Åò
 between two consecutive Ns… o== STRç 6if Ž …   p= ' ' +�	F ‹.se^ 	4  z G_== IN™§ ý:valÂ L ©   þü#Z ÇS±›sÊ@G ÿ@)


N!un„@ize(žEÀ"""Transform%ñens back into Python source code.­2It Æñs a bytes object, }Ped us‚Dthe ®: Àtoken, whichò is the first token sequence output by ñize.

    Each element returned( òhe iterable must be a? X C °with at leay $woP %s,1 £number andB ¡value.  IfD ‚only two Ñs are passed,Õ ”resultingÊ sis poorÆ ñRound-trip invariant for full input:h  ó !Unòized source will match-  rexactly+e rlimited; h 4# Ov2tesd z � back toÝ   Ÿ Ñt1 = [tok[:2]Å btok inõize(f.readline)]7 µnewcode = uà E(t1)! 4 ³ = BytesIO(4 )P - /t2… O ƒ  °0rt Á A= t2M 1""" Vut = z"r(™ o 7ut.µ v" °if ut.encodÿ¶is not NonejF o( $e(
 2ingF Ú =ò


def _get_normal_name(orig_enc)W €"""Imitaº+ ŒDr.c.ã 0# OÆc¼ ab” �á12 characters.denc = w À[:12].lower(�âplace("_", "-"Å 1if 5 À= "utf-8" or p.startsˆ( #-"Ç  ðü  ŽJ Àin ("latin-1i †iso-8859  )k \¸ ,  t D -E  F ?-")—  u ` ¯ ¯`detect (~®< LThe +  ) function"0useƒ& \±that shouldN 6be / ]„a Python 1filÅ ;ð quires one arguQ$, ¨ ,Q  ÅÒhe same way a²¥() generatÙ"It8EcallM ñ a maximum of twice,[; wÕ  Â } �(as a str/ `a listD @any Pps (left™ b$�) it has{ 3 ino#It@À l AfromSBpresxAf a ­@ bomE an?Æ— `cookier qspecifiI‘ pep-0263#0 bocC  C$a 6  'l tb°but disagreÂ SyntaxErrorI’be raisedY 	+U Qis anœ  L1lid»Bset,; ( aW �.  Note =iï @is fšœ 'P-sig'Š­$edTEf no ! nYadefaul´ð'utf-8' will be ñreturned.
    """ Atry:	   ðfilename = readline.__self__. * ÿexcept AttributeErrorE ANone3 òbom_found = Fals µencoding = * ñdefault = 'utf-8'@ 1def’ ¦_or_stop()p 	Â  Æ é 0  Â !()C   º ÖStopIterationI  " < Ab''
6  y Àfind_cookie(Q | 	ð# Decode as UTF-8. Either the > u is an ü Rdecla‹ ,s  ‡   ð# in which case it should be pure ASCII, or @must v I Dper Yy  i    š B_strŽ  !.dÉ (‡E0Unié ï  R  msØ€"invalid¥ @miss` ‚  û � 8   5if ‹ais not!
« ) e õ
'{} for {!r}'.format(msg,F ¾  6 Áraise Syntaxº  - )ñ   ‚match = ôA_re. ý%Q !if  " 
¡ LÛ [ ü €= _get_n­  l_\(C –.group(1)b á x´c = lookup(T 2 èL  â 
š ñ# This behaviour mimics¤ùPython interpreterM› Ý 
\  æ —v"unknowìU: " +ú	W OelseH íT: {}"ñ2
F �  )  5if ¿
£ %ifÍ % !±
$  b o( ? s ) w'ç § problem: J (  u  J yS |ƒ F   ^   ° ‚+= '-sigô  C" £@firs! £O+÷rst.startswith(BOM_UTF8·Ðb = TruŽ p [  A[3:]V   ?ç¨ 3 üº 7 B, []½ Ë 8 = X> >VO > 1, [2   ‚ Vblank®ðfirst):
        ñ%return default, [first]

    second = read_or_stop() cif not# :  3 P 
òencoding = find_cookie(g W & U  ¦ ,~ ® { % ò
def open(filename)d  """Open a  1 inñ Ð only mode us¶ Dthe „ Á detected byý  _  1(). 1""" ùbuffer = _builtin_‰ b, 'rb'2try—  PP “, lines =y i Z .£ # D  ;  fseek(0 òtext = TextIOWrapper(, ,ß o _ Šing=TrueD .Q= 'r'â  s ƒ c  fexceptÎ P c.closeH7 aaise

 •tokenize(Ñ ? IEThe $ ñ) generator requires one argument,Ê q, which— ò
must be a callable object$   provides òñsame interface a G ¢ Ñ() method of ß2-inKW �s.  Eacho 1 toX �functionK sshould @ Â  ´  P Pinputv @byteI ÖAlternativelyà G ;canØ f ` termi7 àng with StopIt=2iondŒ1ead| =+ my ð.__next__  # Examp;3f a” eoA ­¢òproduces 5-tuples‰ áthese members:á` type; Ü  ²string; a 2E Ò (srow, scol)1¤ts specify¶qrow andH Àcolumn where] Np beginsüõYourceg eg eg K /ink  g <ende K 1and� {oŸ 1ich ø Àwas found.  V( †passed i“�physical..…Öê ñsequence will always6¢n ENCODING* ™ 6£ tells you"— ˜ u… `to dec- @­z stream	: �, consume`=ZrPempty;òitertools.repeat(b""# jrl_gen$ dchain(f  , > V , < !, \ D _q‚U ô)¬+ 6$ Sðlnum = parenlev =÷ Atinuø 0cpnumcharÝ²'0123456789VÐcontstr, need r = '', :   
a= NoneN @inde˜C= [0%ifÙð is not None:
    ñif encoding == "utf-8-sig":
!  ù# BOM will already have been stripped.3 X W " õ
yield TokenInfo(ENCODING,� †, (0, 0) 1'')@ ò last_line = b'' 
 ³while True:¿  À# loop over U 1s iÐ 1eamZ  9 <tryñWe capture the value of  G Ð variable her&UcauseR  V  # G- Auses; QemptyOðng '' to signal end` kinput,H phence `K „` itselfªqways beà ¢written atl +ndH À !is
Ët g 	9   % =Î (§ ã úexcept StopIterationJ<  ÈT “¿is not None9  @ „.decode(p€ •lnum += 1\ ðpos, max = 0, len(B %)
! ¯if contstr;
#& Sinued¯B  ù !if·  \ 
·   Rraiseý Error("EOFw`multi-5 T  ",	 VstartÕ  C  endmatch =Qprog. Î  #  N. ‹ 2posC  D j.end(0p  M ´1STR²/! +@j[:end]¢ >  1strÏ 0, (� ð1d),Mø E } e `, need ‰ = '', 0w e   K =6	   el™B 2and³ ö -2:] != '\\\n'  3 Nr\n'@¢ERRORTOKENÔ 3str ´ ™	è  T 	   À	9 ;elsh+  Ê =¨ 
 §	; ) | +  E �€parenlevŒ0Š ÿ M  - õd:  # new statement?  €  Þ!otÕy: break `columnû	 . <ø`# measî1lea,šwhitespacÕ†  P[pos]È /' :  ) � 	¡    
G /\tH 2= (R ó //tabsize + 1)* ð
               ÿ elif line[pos] == '\f':
   ­column = 0 Oelse5 ]break0 ‰pos += 1 0if  n== maxN J 2 ¼ ·in '#\r\n':½ ñ	# skip comments or blankõ sN  6 #Q P_tokeˆ ±:].rstrip('Œ )c  g pyield T< ÔInfo(COMMENT,¨ W ,<  @ �   (lnum,2'), s + len(ð H 1)),ï Œ  t/+=6  
 · "NLY  =/:]¯  ©  8  Šcontinue‹ 3if ŒP> indØJ[-1]÷Tcount  ÷!de* Õ B ‚.append(Z +ü 1IND² Á  [:>‡0’}TwhileÆ <§ Æ ¡ ï  noÒ . # qraise I½ationError(V  ,   2"un` does c ó match any outerp M  level"ë1("<uize>", ¥))X} 3s =g js[:-1]ñ ¨ €"DE€%''x?poszý ¨ N  $# ypd state<E  < !if* ý‡ƒÞ}à"EOF in multi-5 W "¿ 0„  s ; ¶<)bpseudoÁÁ= _compile(P ’ !). († ?Z Ù D S   ±# scan for ÷R×start, end = [ ~.span(1qspos, e  æ =ÞJ áAend)X 	À  ¢  if_ rtÏ>end¡ % ^> È ±, initial =;[} R:end]Ê ¨ Dif (< ¡in numchary w   # ordinary' =berŒ  . N  �b.' andl^ != ' _..'))ô DÀ TokenInfo(NñUMBER, token, spos, e {line)
  ýelif initial in '\r\n':(  7 ÿ if parenlev > 0%  ) pyield T„ Info(NL’  A Oelse_ oEWLINEd Ï 	÷ _== '#ô ¢assert notTî.endswith("\n"P ¾ ÿ COMMENT  Å •ßtriple_quotedðendprog = _compile( Aats[G ]« °endmatch = / Arog. (._, pos8  if0 + :ó  Ð# all on one S ‰9 2pos„ T  f/(0{  2 Ó ! =S ¿[start:pos]^ ’kSTRING‘R(lnumô ,Z € œ1str� 3 = P  )¶  `# multÒf s¶ zcontstrè å  /  d0 W mbreak
 ñ# Check up to the first 3 chars of {Ÿto see ifG   ' Ay'reºuhe sing¾Á set. If so,)   G Ÿa string.   Wea u[  F « ±, because w! ¿looking forE  ñ "rb'" (for example) atQ – 	ô  ¶ E 0we  ch7ð longer prefixesã €is needs /beB �adjustedé •Note that¥"==ŠO[:1]2 @Also°7  #1le <  câ ïmust come afteu9 ~(above)y R(Jy µ � P@[:2]/4 34 )#if4@-1] ï ä€   # DSinued|¯/ è1 �# Again, µ	`@ Ã ¥. This is ÝÀor the matchŸing end
  ÿ#  regex for the correct type of quote? 	ðcharacter. So it's really look€ ?forA 	ð endpats["'"] or¯  À'"'], by tryG /toF 	€skip str* uprefix š ¯s, if any.B  … ð rog = _compile( ÿats.get(initial) Ë b C �token[1]D /O2]))É Ðcontstr, need ÿ = line[start:], 1< 
 , 3 ( _break _else:	  £# ordinary³M  5 pyield T<ÑInfo(STRING, N‘, spos, e  º -)
J Selif Àü .isidentifier()ª — ?namö‘ ONAME�  Ä  Ž Œ == '\\'‡ 0  # ¿­inued stmtÚ  ( # =Ù �8 ¯ in '([{':)  e ¯parenlev +e  " 	×  Q ?)]}Q -Q g/OPeó O ²ERRORTOKEN,_pos],÷    (lnum, pos), 2+1)B ’2pos1W ð
# Add an implicit NEWLINE› yÐinput doesn't ™"on†€if last_äF and €[-1] not. a'\r\n'    2 .Ap().¦swith("#")ò œ C, ''î ¥ - 1, len(W )
 0 + "'' _ in| © 
 ^s[1:]ýÀ# pop remainÎ- q levelsL r² gDEDENT± 4, 0   ‹ : ŸENDMARKER= ñ 

def generate_ƒ`s(read—N1"""®Àize a sourcedË ñPython code as uni  ŸBngs.½�This has�€same API/ q òize(), except that it expect3 Ð*readline*
  ñ+  callable to return str objects instead of bytes.
    """ 1 ñ_tokenize(readline, None)

def main():2 ñimport argparse
 ð# Helper error hanE ¡g routines%  J p! ƒ(messageS  ‘ õsys.stderr.write# ; " R'\n')€  [ 	Z °, filename=È ¡, location x %if à  k   „args = (H E,) ++ 4 + ¡ %,)¢  7 á `"%s:%d p: %s" %7s1 Eelif© 
 H 
B ‘  FQ /seH † 9 º  ~cexit(1Q0# PÞ@ the´ Ðuments and opGÒ0r =#  A.Arg, > ôr(prog='python -m g'³ 4 sr.add_a9 t(dest='v@', nŠU='?',¯  i vmetavar7 ?.py/ `help='Û  g  8˜  ; defaults @stdic k « ò'-e', '--exact', ¼   ac*Ï='store_true” rdisplay( ¿qs using‰Y S type@ 3 = œ   I#s(Æ6try3# TåM UinputR ifÄ s. w 7  ý  ê& ?  % ÷with _builtin_open«ª'rb') as fZ  9 } lQlist(  Š$f.Œ). , ,eláœ !"<²>Û /   Q  _ å ï+ c ï 2   �# Output,C !izAô 3for¨"in	 sÜ 6 _¯" =! . A  g xÛ
?   C  * V 	I * ñ range = "%d,%d- :xWƒ.start +Ž 6endZ o ñprint("%-20s%-15 Ir" %k  * "  R _r ,Q _8[ˆ  è ] “en.stringÅÑexcept IndentQE3 asç„€column = .î…[1][1:3]‘ Ø(7 &0]ú8, (F 
� { v .oSyntaxw Ê Â ž3$OS8 À err:
      ñ  error(err)
    except KeyboardInterrupt:  " „print("i Yed\n"= ED `ion as` < n °"unexpected  �or: %s" % J  i òraise

if __name__ == "__main__"W   ñN()
#!/usr/bin/env python3

# portions copyright 2001, Autonomous Zones Industries, Inc., all 3 `s...
#  ñ...  reserved and offered to the public under €terms of A
# P› À 2.2 licenseZ @AuthðZooko O'Whielacronx
# http://z ñ .com/
# mailto: @   h
#
# Cê î0, Mojam MediaÚ Í ‡ ëSkip MontanaroU ÿ 1999, BioreasonS ÎAndrew DalkeQ b5-1997•omatrixW ª 1Y ø5, Stichting Mathematisch Centrumë© pPermissÑqto use,L‘, modify, di;”bute thisç€software$ à
# its associaý�documenta¢ð) for any purpose without fee is hereby
# granted, provid{0hat_a abovež ·ð notice appears in Ó�copies,
#–   t= Bboth
 '= "ndÓ p X ‘ in
# supk9ng × e   Ê qneither†ñ&
#U8 or·0 beydÂ pdvertisÌ#orp°ity pertain Uto
# “ º€ �]ðspecific, written priW í ñ.
#
"""program/moduleîDraceé  ¸ AfuncÑPexecu
 q

SamplÄ  = mm9@lineÅtH ð.py -c -f counts --ignore-dir '$prefix' spam, veggs
  < t2 -= jkcallsW 	® Ù  1 + `y
  imêð sys

  # create a TÊ Ð object, tell�@it wd2to Ó 1whe!toE !doÍ  1 0or -
  ¡.ñ 1r =- !e.r (W ò dirs=[sys.base_2,§   � %],Ñ l  0e=0§Punt=1‘Q# runabnew coÀuƒ ÕRgiven’ r¤ b.run(' 'F 0mak' re@a, placß PutputÜu/tmp
  à  r.results(A  r.¤$e_ Qshow_›ang=Tru™€verdir="K  ")º`
__all?ð ['Trace', 'CoverôageResults']

import linecache $os
 (sy dconfig Ytoken %izC tinspect $gc
 %diR ópickle
from time � àmonotonic as _ « ñthreading

PRAGMA_NOCOVER = "#pragma NO  ò+"

class _Ignore:
    def __init__(self, modules=None, dir )1  5  ( ô._mods = set() if not< Q else M )m <  V T = []9  6 Ð[os.path.norm	 &(d>  B  �for d in¹ ]w iú ñ = { '<string>': 1 }
*  Snames@file   #ifñ    t f / ± xreturn ! [ < ]  ) ð# haven't seen this one before, so  73the  D 1 isÄ E o; "e ‹ e list. ·  Ðá:  # IdenticalX st I C  e Ì I = 1) ü 1å [checkÆ ò is a proper subõ of something onZ  # ˜ á   !mo¤ Ú   ¼ á# Need to takea £ care sinc7 X ,  À# "cmp" must Bmeana š   7U" but v R"SpamC k also E   f.Eggs"¯ € 	³À.startswith(è W+ '.'— 1   ý "m¡ - ¥BNow ©Tthat 0 is !in™!of‰¦directorie‡(if4  Q
#Má be a built-ino"we ½ 	EÖ Ò û! a˜ ò when it containiÐ z Pable „Ô  ][ ¸Ô ðThe '+ os.sep' ishqensure Id €a parent©:)y,è #ð0com& ª“cases lik» ¶  @#  dñ»/usr/local"I î $6= "' <.py* ,or; [ 4  ^ Â$d +ÃA0Trièðhe different ways, so ówe don't ignore this module
  bself._! [ •name] = 0% ðreturn 0

def _mod$ q(path):& B"""R% ³a plausiblel  - � for the 5 Q."""
8 ¡base = os.    . [ " @file W, ext+ �splitext(4 )+ § 2 ® Ofull² 8A# IfÉ  g   '· ð' is part of a package,& n  +  Ä a isn't¬ ð# enough to uniquely identify it.  Try !doD PrightÃSng byD Òlooking in syDiÐlongest match% ãprefix.  We'llB Passuma] 0e r3 !iss É À.°pcompareö Œ‡normcase·~ A= ""k   8dir« ; ‰  O 2dirÚ $ 7if ~ À.startswith(' H and  A[len 1] =Z 6sepp P $ 0 >  ´ Ó $   b = dir
3if  W  ‹! =ã€ ! q) + 1:]Oelse1  #xÀdrive letter[Unevera E©™8 2 #, € N# %$   ò.replace(os.sep, "."p if“9alt6 4 ! =f ; ' > ï³�.lstrip(‰ ò
class CoverageResults=ˆ€_init__(Äô
, counts=None, calledfunc  in—  4Ü 0 r, 5out-  h .g # =p K 8if   0is Š ® c )  ! E= {}= : Her =( ð .copy() # map (—  J�, lineno)"“ L   «  ' °   lµ & º  	 Í  Ã z   $rs� %rs 	™ /rs• D K ~  m ‰ 2 = 	 ‡ 9 	 ë ¦ 6 
ç#»°merge exist�¨s.I  :tryB    ÛQ openà.i Î, 'rb') as f3 ð     counts, calûledfuncs, callers = pickle.load(f)
  Áself.update( ô __class__(countL Y )J óexcept (OSError, EOF
 QValue �) as err:… òprint(("Skipping { Ý file %r: %s"5 É  "% Ç  in= ,p 1)),J Ñ=sys.stderr)
O ð def is_ignored_2 2nam	4   )± ñ"""Return True if the]  ) ñ does not refer to a m  ¡ pwe want åhave reported." &""ê rk — ñ.startswith('<') and_  | C.end '>'ß Ûz, otherÏ �Merge inÉ Ádata from an, ø CoverageResultsž ¤!= 7 Ç €4 "  “ 
' §E  # %rs „ _[ " =¿ . $  : ] )  . w b .® "rs ¨pfor key" „ 	 % ‰ s[key] =³â.get(key, 0) +² = ) c 	¯ h  D O = 1H /rsD  +rs@   rwrite_rà<ð , show_missing=êð, summary=False, cŠdir=NoneRlWZ X. Cage g .¿ i:paramr ö: Show lines that had no hits*: ™ ’: Include›  m ³ ½ per module= ™ €dir: If Ë ,° § ƒ of each> ° are placed&it© 	 “directoryuÂwise it is i¨ D  >+ 9	J   specifi(#if„)
þ`
³ "0Rtions3:d:"'   G f	­  /¦,. • , _  
  1së(R 3 á   ‘ $("I  öM  Q   * @  4% (F B � #))# 5 	?9– 
 "É  ­ArelaCLhips@@lastŒ 0 =  c æ ƒ  A0((p �, pmod, pê A), (3 1, c c 5) \€À            ûin sorted(self.callers):
  ðif pfile != last &  5 }print()B  b"***",P !,  / i " =- T  % c� ] = ""# 2if  !E A andÃ  	 Í 	‚"  -->",J ¬ I " =' Š "‘%s.%s -> 	 �" % (pmodaunc, c …cfunc))
J ð# turn the counts data ("( Ðname, lineno)†  # ÷") into somethingM ðaccessible on a per-I e basis) Aper_ E= {} @for  v  OH { sS ™ Ps_hitÎS [B ] G.getÑ *{}qH [
  no; ½u [; ! ()]Bõaccumulate summary info, if neededã Qsums õ  
ö … õ #{.items(@1if ¡ ¡is_ignoredP :­ 3  %†continue¾   %ifwÿ.endswith(".pyc"D  `% =6 G[:-1T úcoverdir is None¼ %   Ñ= os.path.dirÀ  0abs Ð 
µ A `module6 p = _mod 1 d , ?elsƒ « 	1  5  Â%ot£ ¯exists(dir  0 ¢os.makedir& Q m² Nfull¶ 	5 ñ# If desired, get a list of¶ ‘û	 numbers which representI pexecuta� 	pent (re Ðed as a dict ‘úbetter lookup speed~ �¾how_missingÜ`lnotab—Vfind_| _² ?nos§N / p�source =¤Pcacheë b ` ë X z@joinÕ', ŸA+ ".- "ú  U openÁ p, 'rb')C.fp
ôencoding, _ = tokenize.detect_ €(fp.read¼ 
q nâAs, n: ?ûÑwrite_resultsþ(¯  Ü ", , 1 o,$, ¤ 
˜  ïÀand n_lines:+
  ýpercent = int(100 * n_hits / n_lines)6 ôsums[modulename] =, #, R &,   B, fi* %

L àif summary and %s:  ¦  pr“ "ƒ “   cov%  V ª   (path)"� ðfor m in sorted(© )W  [ Ù ­ ! =– 9[m]˜  A œ  %5d   %3d%›  %s— d%s)" %: )ñ pelf.out
– 4# t	±tore countsHP info¥7o sF 	š :tryV  « ¨with open(8 Î, 'wb') as f4  8 Âpickle.dump(; ” ,€ ¸calledfuncs Irs),”  K  Jf, 1¸àexcept OSError– >err˜ w•Can't sav( QÀs because %s‚2erry³=sys.stderr�ðdef write_results_A æ  , X!, wƒ, lnotab  ÷ , encoding=None]°"""Return a­cerage `  ˜ ] E."""$B# ``e ô`` is a dict of executable�   ‘ number " "dm" =  W, "w"Ç Ð ’ŽŠñ("trace: Could notg @ %r Š c†ing: %s ò  °"- skippingÁâ , ·)Ê 8 2  ryF0, 0æE = 0onÄs !• Ä  "no Á enumerate( sÊ¨ð# do the blank/comme�match toì�to mark mïL ¥ Ú q# (helpJ �reader fi,Ðtuff that hasBbeenu&edÈH !if6n@
 s·  0 1.¼€e("%5d: �¢  7 [
 >no]g  ? `M+= 1Ï    ? /s ! *elª | ZàPRAGMA_NOCOVERŒ K Æ ò# Highlight never-N"ed �, unless[ G Ÿ contains¶ á# #pragma: NO € ( =>  ¤   Ÿ/seÛ d  J /  d ) Àwrite(line.eóxpandtabs(8))

  òreturn n_hits, n_lines

def _find °_from_code( �, strs):G B"""RF ñdict where keys are P b in th ñ number table."""E  ' ‚nos = {}ž afor _,@  noA @dis.’  + astartsŒ †  Ð $if/ 0not3  ¦ ¥      = Bnos[ R] = 1o 	 k ÷ 4  þ  ¶ @all &à objects reachï  G ù `# get 3 %of$ñ ’formation6  @V  ( ëis scope levelC¹ó ±# and checkz  constants Æ ñreferences to otherº Ö t  ) cj š A.co_D stÐif inspect.is% '(c± ’ # Õ= anc ñ, so recurse into itv  7   y—s.update(÷ #(c¬)1 Ýóstrings(filename, encoding=None¬ ãaçò of possible docF   i±"s.a2The/ Amaps›ýS5 Qs.  T3°is an entry�¹  â ð that contains only a�ñing or a part of a triple-quotedB f . mdg C0# IOàe first token Š a ,`n it's
 X moduô Y €# Add th–°pecial caseÀ½  ¼1tes”  ²loop passesA Âprev_ttype =… q.INDENT¸ Ÿwith open§°f) as fz4tokL Ñize.generate_ã €s(f.read`#  Î… `, tstrC0artd‰ ê6toke  6 1if 5 $ =» jSTRING& * é / ê /  3 s¢ ,ìAl = ÷   e( 0eco( "ený"    á iÅ crange(] < C + 1î *  2d[i- Í œ ndFQexecuóQ&nosv dIG =N6tryO>ö 	G4 Ý rprog =  (  l   ô Àexcept OSErr”Vs err„ Áprint(("Not   ¼Ðcoverage dataór %r: %s p  (% `rr)), À²=sys.stderr· À    return {ñ}
    code = compile(prog, filename, "exec")+ östrs = _find_strings(+ ‚encoding- creturn- `lines(k  , F ñ )

class Trace:^ ðdef __init__(self, count=1, t'  	  sfuncs=0  `caller G  Ô  ò ignoremods=(),  3dir n½ ¦=None, out J Òtiming=False)±  f 5""", b@paramµ ó true iff it should õnumber of times eachC  S   5@ is ‚Euted& i i PprintÑ ]  H uthat isD f  	 Rbeing  g sl 1jusk €put a li ff +Dmodub Îl`) for  Otion« È Qwere ø€d at leaw ÿnce;  This overrideE `Ô q' and `G'³ ]+ :× P the « s¿Ä Cs toXC  nC ¯directorieG  š 0allu  ‚ ð(recursive) content‘  ÞË° from which¯ £read store•~ %beB v  	 ¡added into fresultY0?o &inm _write: 	Z\ pinforma· be displayŸ{ /".iñ "= 	 Î    = é
 ï ÝI3(   7Û U G ÷{}   # keys are ë ~ô= ‘pathtobasjq = {} #`memoiz“0os.' .& 
µ `donoth( := 0 Õ" =9
 _9 h»  é{"ï : `r_cach4  `start_×0 = VZ iî6ing:V 	6 > (*"if—´ /rs?  dglobalð — _ k> � $elX V ù< 
T  n eW" Y %ltQ !;locá  à ae_and_r > ã � 	… À self.globalñtrace = self.global W_lt
    3loc 2  _7 4 µelif count:  O H h I  { h g Jelseu õ# Ahem -- do nothing?  Okay.7 ž #do# Q = 1
  €def run(¾ f, cmd)a ñ import __main__0  L edict = 0.__ !  M Ð.runctx(cmd,    )w  !  - z ", +�s=None, ‚ • f' @ is * : E= {}¦ #ifB ( R  ' 2not&  ð Ñthreading.set/U)w  1 ?sys+ :tryi Bexec1
_ kfinall8  ifüÄ 
—  :W     ë  ) à -Afunc ,  ÷, /, *args, **kw­Presul, E C  e ¯ B%q  ™ (• ~ BDrreturn � åÀfile_module_” ttion_of?Grame00cod³f 0.f_ ¸ Plenam    @.co_]   $ 4if  
Z‚  ,  ¹0mod (, b	: Çn  Ð  H 4 = ’     0cls ! =§ ?Rde in²Ë_caller_cachß/if#  [m ]Ö ¹ “ 
ì  c{  _.c @ � ó 3 É  i õ-## use of gc.get_referrers() was suggested by Michael Hudsonƒ I A allP #�s which N � to thisfj objecÃ ‰Às = [f for f[�  6é s 	 i6 €spect.isQ  ‡ K(f)]¦ Àrequire len(' `) == 1£ òavoid ambiguity caus÷  áKs toK @new.C j À): "In the f¹&ofK , g;theD `temptaB ð to guess."
      óif len(funcs) == 1:
  òdicts = [d for d in gc.get_referrersB M[0])? H  	 ðif isinstance(d, ] -)]5 ˜   ˜  P aclassež cž cž H ž  R ÿ  if hasattr(c, "__bases__"¨   2 ¬ ‹ F *   q# ditto­ Anew.7 Oobj(:¡clsname = - €es[0].__ -__; e   ð# cache the result - assumption is that … O* isI ðnot called later to disturb this relaU OshipH _E "r_™ ðcould be flushedy ‰I ? inI  Ô Ônew module ge  .5 Yself.� a[code]V`; 4if s0is ý JNone ©  �ã = "%s.%s" % (7 $,  %)
V °return file9 ,½  0 / ðdef globaltrace_ k< s(É ö, frame, why, arg)ž ¡"""Handlerd 7 ‚ events.^  ±Adds inform¹¤ about whoé  !to> r ;s²g5"""â  if�  F'v '”  s �# XXX Shö€do a betMú
job of identifying method“ i_(1 = ’  J!_m  8A_of(
Naparent& > z.f_backE u B7s[(T ,_ )Q1iÇPcountÂ Å9(E  g  
 )¬ /¾ d É'‰)† [N 9/ltö3!IfÐ ø� block beoPenter�s.Âbe ignored, µ0s `%',ëEelse Õ 3loc¯!“ =Ö0.f_ l  =å $ !sˆ@('__" P__', ª 
¹!ifvÀname:
        õ&# XXX _modname() doesn't work right for packages, so
> 	 ð# the ignore supporA G C `module„ & =� "fi )0 7if 3 Íis not None:+  ¥ œ ²_it = self. .q $s(g ,T s H fi > ?_itn * i Otrac•  '   Çprint((" ---‚  : %s, func¦   "Ü  C  6% ( , code.co_D /))Ö  > breturnQlocal¹ 	q ?elsÊ  9  |
/ Fdef B _H °_and_count(ö, frame, why, arg)I if ¦ == "line"  § �# recordr ¸ Ù P and . ñ number of every ~ —  >    5 4 =… 4.f_$ 	0  W 6no .  	$ 0key! ®,‹ n( ÷ .ds[key]‰ ò.get(key, 0) + 1J ¯   "if˜Ÿstart_tim‡ E¡'%.2f' % (' L() -; ª), end=' 'b±os.path.bas�
/ p q"%s(%d)� v E  ,$ É   MPcache  o F )± ° tTk5u¶	Rÿ*w,/ û ÏJƒtÀreturn self.ñlocaltrace

    def results(self):   ÷return CoverageR& ð.counts, infile=: . ,@  D   6out4  5 ²calledfuncsm _ > r: Prs)

ý Smain(ö ãimport argpars" 5r =  .ArgumentP% 1r()ò ' c.add_a  ö('--version', action=' 
 !='�b 2.0')–ogrp = S  ð _group('Main opR *s' ð'One of these (or --reÙ ÷ ) must be givenm · qc', '--æ» «store_truet phelp='C x q number† ñimes each line is executed and write 'C	-Q'the � ð s to <module>.c�B forU  T  ’N , ð	\'s directory. See also ï  verdir, --£,J C--noQ‚ below.'<grpHtHàHRPrintß 4Àto sys.stdou¿xfore itLƒ lƒ Alist?‡ PKeep » kÉ`which C uE arevß at least oncÎì Ør ÙÚ Qafter@ïprogram exits.‡PCanno€ specifiQ°longside --¹ !e þF¦T# 2 kWs$% = 1er/ wd pairsåù ô¶# od$rs2 _V§ómutually_exclusive]Î . Ïr)N%²Generate a ; t from aß lp; does Ó O anyúScode.£Òy;[ U  `bread, ¾sàhave been creaœñin a previous run with%?unt˜ 5S=FILE�DRDDG!DogN P5ageY=ile1À     'UsefulñF if you want to accumulate over several runs.')

    grp.add_argument('-f', '--file',%  )   «help='File` ncountsg !')@ e  Ce cš ?diri ðDirectory where the report � ¡s go. The F %ag 'v  ²  ð'for <package>.<module> will be writtenØ  \  C e<dir>/E /E .€ ì mì ÿmissing', action='store_true PAnnot¿ðexecutable lines that wBnot  ed withº !"> / "¥ s¥ summary¥ ãWrite a brief ?  nAeach© U¿sys.stdout.¢ €Can onlyŒ$usÌ !--Zb or --ûÂ  Zo'--timfqPrefix ®  ^F l’time sinc{ÿ program startedÈ OÄ Á h(0rac� o™ = parserxp_group(]Kters'ðbe specified multip‰Oimes‚-ignore-ð×ùappend', default=[],7íI? {bgiven I ò (s) and its sub sÚÃ(if it is a €ÿ). Accepts comma separated list ofJ f Q nameÁ Ý[ ó Wlð  Gs inù dŽ(‘( pies canÑõjoined by os.pathsep)ƒ >('-².¶ZFalse¹  Å@Trac¤A#. /y  æ b»', nargs='?�T  " ÙÀrun as main < ?ram_ 	h o` 1arg‰ ª.REMAINDERÏ o 8  t  �l ¶oMZQ  Ô#s(y0if # .Q_dir:8  )"_pð= sysconfig.get_ª’("stdlib"Ê/  p4 Eplat8 h 2def÷_‚ 6(s)… 4s =Ã.expanduser(1 vvars(s)Œ Às = s.replacâe('$prefix', _
 €).replac Cexec  !  3)
  ðreturn os.path.norm	 A(s)
$ öopts.ignore_module = [mod.strip(J Q  Ÿfor i in E    0mod Ýi.split(',')]u 0dirr cparse_‰ 0dir¡ k   [ w  G   sr ö Rsep)]ï "if­ qreport:Ž  \ bif not Ffile   � âr.error('-r/--A ð  requires -f/--: '2òresults = CoverageR 0(in+ =8 
 P, out	  G ÃN s.write_ (C ‚missing,À ssummary c{ 3dirðé Qany([< Utrace, 3unt “listfuncs  ( †kcalls])
ðmust specify one of --: qe, --co_ =5, '€ f 8'--~ rD ~ 'É À * R and i 2 or€ ´ 0canú¶ Wboth € V Å  S Ç )ˆ v0  Q � ‰ .$--4 ñcan only be used wi† ? u pu ÷ progname is Non·
™( -:¼n bthe maÍDionsk Pt = T$[1e, ¦ +¾’,ß)  C2ers+  ›×", ü3mod  •K  $diI  m_dir, ]‡ kƒ, timing”  6try¾<m'  ¸ imPi runpyo - _¥=��( % `, mod_Ž YdŽU S._get—_details(] °  ‹   €sys.argvZ€code.co__ ‡ 1, *œ’arguments” 7   @glob³{Ÿ   !'_¢ €__': '__-<__'š   l ( } V qpackage1 þ .parent^ jloader/  /  M	- & acached(  J
$ }· 7elsf lYài 8  ‹U[0] =¡Àdirname(opts×.progname)

  åwith open(opts& é, 'rb') as fp:2  = ücode = compile(fp.read(), F iexec')A ð# try to emulate __main__   Pspacex @much ‰possibleD ™globs = {  › »'__file__':� +  r + '… /',( bpackagV ONone% acachedO $ }W �t.runctx(F!, Ë  )àexcept OSError6err…ðsys.exit("Cannot run ô ð %r because: %s" % (- Ùargv[0], err)c ¦SystemExit_ Bpass$`resultg#t. (?0if z î‡no_reporD . s.write_ bsmissing*ssummary òcoverdir)

if __ž&==�§  /ò()
"""Extract, format and print in ðion about Python stack 7  es."""

im¾ Ä collections …itertool Alineç" òsys

__all__ = ['e’ _g 5',   tb • _ã:iono' W_only8 Glist e [4   C o  n 5 0exc   epô ‰  "lao  n " ' b Ëclear_framesD F Sâ r Sz ¡TracebackEñFwalkI ±tb']

#
# FòFtingö   #Bs ofã _  ¶’s.
#

def _' (­!ed ,F=¼)iA"""PN@the 2 X Puples—Ãreturned by K �_tb() or“ 9(Naª8tedŠ  d BgiveÍ› Ñ!if— @ is š ™   ó = âRstdert Èfor item in qQ.fromç ö ").u(ô  [ á(G  l ’, end="")G6 R ¤ 2"""¤, a<8or € objectsŸBing.…GB 7as –	†šª–,1 ¦ `stringJ 1adyD  V™ REach *  l ¾é…Ä correspondsà S t"thÒ¤same indexF �argument58.  i eL €in a new×;Ÿ  } ‹ ð	s may contain internal nñewlines as well, for those items
    w Àsource text 5 Ñ is not None.( 1""" ñreturn StackSummary.from_list(extracted ò).format()

#
# Printing and E+   ðTracebacks.
#

def p+ à_tb(tb, limit=Œ a, file !):� 1"""W � up to ', 0' s   �  e entries § B the  p q 'tb'.
I %If= Ñis omitted orU, allI 2are¡ Ped.  9  – 'G <  t °output goes¨ ñsys.stderr; otherwiseA 'L ñ should be an openú  �    ñ-like object with a write()E jmethodºS§
`:)b e )‹Ä
,  Œ�A® 0rth× d'3 l K))'.Q:
g “ F * 
‘ Rªa¬4sreprese� ª 1 of8 Õpre-processedô=©4@This+auseful`�alternate 1matð(of‘s5l ¯6rø tA> 
ª óyš sa Frameªþ = pcontain€€attribut$pilenameubneno,   Û ; 	= Ý"inò€ion thatz tusually) " aE œe.  Thes   r’ Ó@lead  | �trailing; ñwhitespace stripped; ifÜÊÀ€availablò •  '
ÐjR(walk‘) …’Ï`Exceptô þ ë ­ ìÌñ_cause_message = (Â 0"\nø uabove eH 1wasÅ 0dirÙ<  x""oà `follow7  :\n\n")

_Ô?exto !DuY ¤ H O ‚ ,n !an–œ …occurredn ‘
class _SF"el� ¢ __"s__(self' llò "<implicit>"

_†Fel =L  2J °parse_valueŠQexc,  C, tb[ Aif (  âO Š) != (tb ¥ � `aise VZ °Error("Botha0nei’ #W  Ôptb must‘@givep F "if�  f l k  ifH # T  E Ý aexc.__ ¢!__0 & Oelse8  Õ,§à
    return vað&lue, tb


def print_exception(exc, /, value=_sentinel2  ÿ limit=None, \
   Cfile! Áchain=True):, @"""Px  x � up to 'X ñ' stack trace entries from 'tb')  _ 1'.
O ³This differ' Ö ñtb() in the following ways: (1) if? g bq ris not × "itÐs a header "T’ + Á(most recentF öcall last):"; (2) A  � ë ‚type andd` after¤ G ú @; (3¥  1 çis SyntaxError@ 5has>  appropriatò [rmat,‡  line where5 ! sS   eT € òoccurred with a caret oEQnext B pindicatP Ý x aximateF @posiO1 ofg ` . 1""" a W¡ = _parse_ 2_tb…  ! )0 0if ô1 is I x Á= sys.stderr/ Ute = ¯Eà L([ )å c !, y= ’, compact³O 4forù ` te.fo\(Ù Ú ‘ }(',³ =¢ “, end="")xB yA � ¼ &A"""F± ) aZ „ ¾›"in˜ 5ion\ó e arguments hav8€ame mean�± correspond 5 @"toMñ ã).  The returnin@list:Ñstrings, eachG e\ €in a newd
±some contai’ „internal% �s.  WhenE QtheseÎAs ar8 ‘catenatedN Á±ed, exactlyÃsò t!isG & � as doesà  ' ð%Á<f [(ÁšR_only“÷b
P1parÊaÌ :X” Ž Ø a Ÿ ú : RöF N×Ally,£>  Hrsingle GÒ; however, fo$Ps2F s3 #al/tthat (wJ÷) display detailed Im aboutt tÕ  ‡message hWwhich26 :lÖ"as‘÷  Àe list.

   ñ """
    if value is _sentinel:    Q= exc ñte = TracebackException(type(- "),Q ñ, None, compact=True)D ôreturn list(te.format_eL ð+_only())


# -- not official API but folk probably use the pwo func• “s.

def _b Pfinalh p_line(e´ ­ )ò Á ó str = _some_strÖ º - Þ 1 orŸ 8 F  8 b Á = "%s\n" % m D Oelse( $: , 	š ;str6#ne× ¢ U 2try	  † jÆ j& ð'<unprintable %s object>' % +	’.__name__ŸŒ 8  [p(limit=c, file Rchainy õ"""Shorthand for 'D Sñ*sys.exc_info(), [ V 4)'.Á7 == =˜ ", “  )Æ (9excÇ # ¼ ULike { !()•o…a string£  †"".join(g ê 
³     Òy Ilast©  Ø p@Thisç?a sz y ] _÷,¶ ë%,  t !if#åhasattr(sys, "^ "z®`aise VŽ Error("no *  ~+" È ~Ž 7ype� ­ Õ  u  $€)

#
# P@ing ­ Exô t ’Stacks.
#@— s #(f‰T   õ 1"""Z  2@ack Y ðe from its invocaË� point.
· QThe owðal 'f' argument can beñ
d to specify an alternateB £ ñ  frame at which1 jtart. a Â 'û 'Â 'C t Qs hav~  sO @mean!asÖª!).> ½@if f“ 0 �1f =aA_get¥ P().f_q= T ?eŒ_Ñ #(f„:)+î M 9{/ —á  ˜œ8 t )“Ö "%j Þ Ó È  WÔ ÀExtract the òraw traceback from the current st ñame.

    The return value has3 àsame format as
 0 ex[ qt_tb().; C öoptional 'f' and 'limit' arguments haveV smeaningW D aprint_Ÿ \ ÁEach item in9 ñlist is a quadruple (filename,D ðline number, func—    q text),ž  °entries area QorderD 2Ðoldest to new
 ˜ 1 fr7 61"""/ @if f– QNone:   Áf = sys._get5 P().f_’# N 0= S�ƒSummary.\S(walkAf), J= )= ’.reverse( ÀX Ñ


def clear_} Rs(tb)�  "C ð  all referencesè ð local variables '@ V of aV.û €while tbÿ Jnot 2trys    Rtb.tb‘ .� ¼   úexcept RuntimeError= r# IgnorC. Ñion raised if"­  Ž ñstill executing.8 h   Epass Rtb = š ànext


class FêšŠ ²"""A single\P”- :attr:`œ`c H[› 3  Á"no1   � within = „ that waÏ ·active whenËwas capturedo  m  
  æ™ 9•or methodi TBl  Ï l  Š= n    cache modu] or¾ a `of codøë A run;z  Û‘s` Either§ 2òps were ¿ósupplied, or a dict„ @mapp® ¯ ) to¢ t repr()7<d  ? ä__slots__ = ('É ',$@neno
  U   _ 	 œ "')R Ïå__init__(self,   F ,æ‘*, lookupK C=Tru ú  Z =¬<   ! é"""Construct a	1 & h:paraml Q: If p   `Ç Ô`Ž²consulted fÛq source M   å 8 0. O§Qwise,f    wÑ!beq Red upæ¤first needÜ L � Acals˜ ÜQ '	u, which` ) U Q �  objectò`esentaZsë " s 1ineq `providM us½iRPstead/ £ Q!up‘ â )in l  Gh  W p    
.QÀame = filenaCme
  âself.lineno = 	 
 pname =  
 _. 5  ‘if lookup :  o l   ñocals = {k: repr(v) for k, v in l! ¡.items()} d 4 ¡else None
S °def __eq__(Z †, other)† áif isinstance( ç, FrameSummary,  ² qreturn N P.file2 ==Y  1and�  4   † ^6  7?no 4 

h  0 
#š  )• ù _tupleò ', É   ”   Ñ )| t =èNotImplemented©0getÔ®7posŽ ? 
|r #no Š X[pos]h Citere `   !([à áX  × e (])a  µa ("<a e   {  ¸ !},t" {m }ï{ ¥>".format(Q Z9 =² @   ,³  R 	² ?len± 4Û ‘@property€  [ X �F"ifï1 isŽq ³ #  ? /no$  ( ñÏ   ê ` ¢�cache.getR ‘ Š	»ÿ[ J  .strip()

Ù Ãwalk_stack(fÜ ¡"""Walk a  ð  yielding the f2 Á½anumber³Beach .FñThis will follow f.f_back fromN Sgiven5 b If no  * ,' †scurrent” ñis used. Usually p with SÍ Ô‘.extract.C 1""" 0if °Áf = sys._getæ #()°  < Rwhile? ;notC *1 f,ê  ¢!no5  Ï _ 
|]tb(tbz ¶ e,T ~1ðtb.tb_next (and thush indò opposite order tº )l#0 tbj 1š t",  =Ctb =  Á ð


_RECURSIVE_CUTOFF = 3 # Also hardcodedTàtraceback.c.

ðclass StackSummary(list):
    """A s ñ  of frames."""
 @= amethod Ðdef extract(kY ,4 ñ_gen, *, limit=None, lookup_lines=True,D  w   ócapture_locals=False–   ¹"""Create a¾ € from a … „eback orÂ bbject.¼  D f:param£ ñ: A generator that yields (û  À ù neno) tuples to³ âinclude in thev ." n  : D to 4 2all‰ s±  ? fnumberxn a XQ: If \o o’ for eachs Ê immediately…”otherwise? ñis deferred untilê Í is rendered• 
Î—  ê ãp variabWÃŸ EwillG ¹3be Q ad as oÙñ representations intoŸ F¸Þš  Ç M   "if› Ä  šþ    ³õ = getattr(sys, 'b !',Ó)¨ W 1not" C andm :< 0i m 0J F 
8 " />=S Ÿ „ò = itertools.isliceÚ   Þ:mitÂ Jelsel  ¤ Q acollecrY.dequR �maxlen=-#)z‘result = &(t  fnch = set @or f¡   `‚ 
� Õco = f.f_codeA³ 0ile\ £ = co.co_f 	& 	"   ³ E   ds.add(? »  !  ^¡cache.lazy
 * ,™ zglobals7 b# MustZ¢osd`we havõ¡lled check] Î ~ $if6
 # f 'zsò8   	2 Íˆ.append(m(( € vÌ , S	ë  ù² )3 ¾€ D sí Š.‹K #!ÿw0 waçãsired, trigger Vs noww zp	ñ ¨  ¡ "
¡ .§ 4 rreturn . zc  _¦ea 
V 'Àary object fó	rom a supplied list of
  ôFrameSummary objects or old-style2 … tuples.: 5""" ð"# While doing a fast-path check for isinstance(a_‡ s, Stack} G) isP ÷4appealing, idlelib.run.cleanup_traceback and other similar code mayN ñbreak this by mak§ Prbitrø fss plainè ÷ , so we need toL Ò  onç  8  R A W basi!‰result =ç %()K  9 2in :  Ÿ(if5+ (, ±)0  4 u .?1nd(4 r  ! Nelse7 öfilename, lineno,  1 = H 	œ  K 
l ™ (P 	=c )– rreturn N 
f 0def4‡mat(selfè ð """Format the sA` ready0 ¢ printing.G  ¥ R^ 5s aÉstrings7 r  Each "  !he‘  J ¡  : ¾ð  corresponds todRingle,  fx£ 6` e;  ü@ new;Õ   €may cont•…internal� 2 ¡s as well, ñthose items with source textÚsòFor long sequences of‚ $amÈ  _ › , •first fewˆ ðrepetitions are shown� `llowed ~` I  ´ £P UexactL `number… 1furÓ^ Cy”U = []G Plast_�f = NonÁ „   ñ2 @counÂ0] 	µ œ
LAif (g € !is�  P !O.# u %or_  h  / « D  D   ?no B _ B  B   ` }   2if ý ú> _RECURSIVE_CUTOFFó  .   / .-=0 Þ  / º©#  ' Ñf'  [PreviousÃ aated {s �} more 'C —time{"s" Ö  1 
 ""}]\n= £ Š   — ¸Å~ +  Ÿ+   nJ P   )  †)   P ì 6 = ‹ =  H+= 11 À if count > û_RECURSIVE_CUTOFF:
  ‰continue Œrow = [] ù .append('  File "{}", line {}, in {}\n'.format(?  x òframe.filename,   @ $no   ))); 'if* Ã 7row™  „ c �.strip()] ^ocals_ @for • p, valueæ ssorted(\ 8 ž.items())A  ú ¤  R Q} = {U 6  = q =" ¶ eresult÷ §'.join(row( ¿if count > 	' .-=( 	ˆ
u 	  ä Òf'  [Previous¡repeated {c �} more ';  —time{"s" ¶ Ú1 else ""}]\n5 !rreturn œ ò


class TracebackException˜t"""An e p ready ã±rendering.
Ÿ TThe tF ö% module captures enough attributes from the originalf P ñto this intermediary òm to ensure that no references are held, whil§ðstill being ableB àfully print orÒ cmat itÎ PUse `£ _ü `7  cr / a instaƒ  7 Í €objects,k  ô ¿constructorV óindividual components· 0- :cï:`__cause__` A® *of|*1 !*.f J oontextL 3 N �suppress_JW  <>*__ *DS"thÏ 3 µ Pstackû  `S
 °Summary` re| eÃg²A  exc_type` œ $4< °ñ` For syntax errors -v " A wheÇe  z«  occurred” øV   _umberX Aend_< o\ 1end¢n` à Can be `None`£Cnot {Ö  [x   Î ooffsetR    W aàe text where tAhe
  ñ error occurred. ñ- :attr:`end_offset` For syntax 4 ‚s - the   Q into  text where P  2 f û Can be `None` if not present„ ?msg} ƒcompilera rmessageB A"""
 òdef __init__(self, exc_type
 Cvalu ðtraceback, *, limit=¥ ,J 2ð   lookup_lines=Tr= ðcapture_locals=False,   3act 	D Q_seen\ %): ò# NB: we need to accept° ›  ¿ µ 7 toK ppermit Î RwardsŽ `t withœô existing API, otherwise w2  #Š ðstub thunk objects just¢ `glue i  geB } *€# Handle/ðps in __cause__ or  on.&__4 ñis_recursive_call = *1 is% �ä &if   I € 8 u= set()4  ….add(id(I")), 8 ‚# TODO: Ëœ  ; .stack = S  Summary.ex8%t(e  G qwalk_tbd   W)U[,JW
q^
 Ü ¢  Ô  Ü" =7(ypÏC¨@ now¾$@free	ñ resources: only2€lication‚ in9ç À# unofficialEð  _format_final_Š  $0   A_strÖ0ome !ÎÉ %if¼ ñ  and issubclass.  ß 1, SŽEÁC {z# `'s speª %ly‘  - • ƒfilename5� . 	/ 9lno%  á nwR  ° = str(lno)ç = É` else º	c  w * ÁŒ  ?inek  o  s   ¾ e m w 	 ‘	à   	ž ' ö¢  +  �  	X  3 9msg, 5msg% )if5
óœ R_load�ø @_suph4s_c}E = \^  ¿ ·u_/ œ" VùLpConvertïü Ñ_€ Tto `TÝ ExñÕions`s, use a� p# queue¸cavoid +Aon (¯ �¡top-level ?Cgets%À== None)
     ðif not is_recursive_call:
  ùqueue = [(self, exc_value)]( awhile . 
A  I @te, E  i.pop()=  $ ñ	if (e and e.__cause__ is¥ MNone2  6  0 7id(3 )1 žin _seen)�  7 _ ÿ = TracebackException(g  4 Itypei ,+ � % D.__tŠ /__3 alimit= % ×ookup_lines=l 3 ú capture_locals= 7 b= ÐOelse}ÕD¯if compact> òneed_context = (Ë0is O  @R  ½ eZ6  0 Ü„suppressˆ /__ Â >TruÜï 	` !F #. %&? ?__)@ KÊö		' +ÜF! =ÞÚt+!= % I S__ = s)  z L x¼ˆappend((z ,²)
 X  Z 0 #__\  1))
· Á@classmethod ¥def from_eÉ1cls¯Ð, *args, **kw
 ¿"""Create a R 0 anõA."""p  P²return cls(3xc)r ;exc©… É  ¸ R_load°e
  @Priv¡ ñ API. force all ßð in the stack to be M )ed© ðfor frame in self—.stack:
  ±frame.line
 ödef __eq__(self, other)5 áif isinstance( ÷, TracebackException2  n preturn S Â.__dict__ ==^  ‚ / èNotImplemented¡ 3str¢ i 	e 6str1 „format_ež Q_onlyá ? A"""F( U the , � part of té .]  ­ RThe rà ðvalue is a generator; ðstrings, each ending in a new}O N„ Ally,q G @emitY rsingle S å; however, for@¶SyntaxErrorÉ bs, it G s4 0al | Ås that (whenB 0pritò) display detailed inNñ ion about where® sx E e� ‡occurredä  3ð message indicat0whi¦ : R@lway« ee lastd  M ¶uoutput. 5""" "if€qexc_typ¨FNoneÜ Îryield _ä `_final8_*(/ ,F U_str)\  : se =/ u Õ.__qualname__? ^smod * Xmodul(  Ã  + 0notò ÷("__main__", "builtins"Ô ˜ 1if 0 ¶ o ,B*  .   Ö = "<unknown>A Õ  ‡ �+ '.' + ê ù q �subclassj.', Ÿ‚ ~
g ?elsÇBfrom€Ñ¢_š(Q )¹ ùö
% + +-Í l  (@Ørnal helper).Œç# Show exactlyBöproblem was foundÌAfile8µsuffix = ''B 1elfÊ no1 ô °´  ÀaÑ'  File "{}",r {}\n'.(W  3   ¹� b or "<y#>"‘  &no$el“ 7 !is‰• " _Ú U ({})� 	 ± — Dtext8  ¸ 0if  #   êŠ   foo\né1# rB 2= "!  l z   "foo <  $  .r+fp('\n'  ¿ C . #.l' [ \n\f* Ñspaces = len(/ 1) - D 
W äð   {}\n'.format(—ltext)

  ùif self.offset is not None:(  3 $ =2 % Jend_)  n   o @in {s ¢, 0} else B ] #if G == E (or ^== -1¿  Ã 4 =K :+ 1 ) ô	# Convert 1-based column5 Cto 0 ðindex into stripped j¾ ecolno x Í- 1 - spaces,  © 0    4 
 if¥ no >= 0 a# non-t b white ý(likes tabs) must be kept for alignment¦  *RcaretG `= ((c ‡ 1.is "()ÐA' ')L Qc in ‰![:à /])V pyield 'a ö{}{}'.format("".join(v °), ('^' * ()U " -
–) + "\n")e Cmsg Â  õor "<no detail available>"— ‹ P"{}: ‹ 4\n"� óstype, msg, filename_suffixg0def÷  º  gö, *, chain=True)¥A"""Fâ ö  the exception.š"If: ¤*B ñ*, *__cause__* and  on�  AwillÓ#be‰ 7tedV ðThe return value^ áa generator ofÕ�ngs, eachh0ingÆ�a newlinew .Âsome contain) dternal- ¥s. `print_å `u åwrapper aroundQ °this method³@ch j¡D s. „ as to a†Þ ð message indicat” 0whiÊ e‘ occurredˆ ClwayX &asó Ûø  ¡uoutput.¥ 6"""ª U = []! 3excw Awhilë ï ? "
  Eexc.ð ¯  ? ;.  2 k0ed_ê#= (ˆ  )  1 ¯ 	n 0 celif ($ r • 	c   ¸ ; �suppress_5Wext__-  œ Í s Ï 8 _Ñ  sö  } 
{  p= ' >' ( .ëGnd((Z ,÷ª R   N ) 9excT  /ýf Àpend((None, {exc))
  µexc = None
 �for msg,  õin reversed(output):*  M  if- q is notJ 
   $ Pyield' : Ÿexc.stack4 ù'Traceback (most recent call last):\n'W q @fromÅ c Š.format(› * $ ñ_exception_only()
! `collec òs.abc import Sequence, Iterable/ ”functools) ó total_ordering
? tfnmatch ”linecache eos.pat  ²pickle

# I ¡types and q 1ionq Òlemented in C‘  _tMUmallo½ * ²_get_object:  ‡!,  J “s


def _6Psize( c, sign) O@unit‰ ‘('B', 'Ki M G CTiB'3  Ãaif absO q) < 100ä J j!= 'B'4ú# 3 digits (xx.x UNITì!if˜ 
8  l ñreturn "%+.1f %s" % z  , p 
F OelseC B × ¡ * 1024 orl P == '
c !# " 5ã xã %0ã .B  1 /=× ò


class StatisticØ 1"""µ p differH± on memory «arð between two SnapshoTqstance.N  V 	 á__slots__ = ('­ ½ | ž   rcount')÷Æå_init__(self, 5  ÍAze, 1 ¡ ' .& & =2 ƒ  X#  q 0 =  
 Q " =Y ˆ Chashˆ p ¥  (¤ } %, j  \ )Þ #eqT w, other[ !if½BisinO(" ,¶-  Ù Œ dNotImpjÞ  ¥  ÚW ¸ 2  T    ÆË 1 	< (   , ì -  	ú 3strû Ç @textA"%s:�3=%så2=%iž g   6elf¾ ,¿  , 
 1  ¾ �, False)4 ó ¸ l ® ?  6 `   paverageV "  a " /. ™ À     text +=ó ", average=%s" % _format_size( £, False)
  Áreturn text
 ñdef __repr__(self):  0 - ð('<Statistic traceback=%r k å=%i count=%i>'<  @   !% V .8  , f .;  > '))� �sort_key; ‘  B N i ¥)


class ¾ BDiffß 1"""«  ò+ difference on memory allocations between an old and a newH ñnapshot instance. g å__slots__ = ('£ @', '	 _…   	  !S_init±,”,’ 5 ,›  OG� & =I ½  ¿#  £ ! =\  U   
# Ê " =ˆ   3    S_hashç ¸ ˜  (#^	 ½ X ,~  Ù  â ¦ A 2 	”3_eqŠ w, other‘ @if nüsþ(" ,z1  ~ Æ åNotImplemented¤  ß 2 ==} ò 2  T    ™Õ  ú 1   , ô 
1  6 +2  . R 3  	ß/st�  µ @A"%s:�ƒ=%s (%s)ß ŠR(%+i)Û  †§ *  BCD@	u3 Ñ , True)7 * / J )À"if?< Ëä ó ‹1elfa' /. 	ò L/+=Fd ˆmJÀ-ÏV# ð>böŠ2abs£o )Q   { 0 Á  1  2 +¥Àack)


def _ò
compare_grouped_stats(old R, new p):
    ! ±istics = [] áfor traceback,# 6 in; s.items(B  F ppreviouD l W.pop(G QNone)`  2 5if 5 pis not ! •  !    � q = Stat¤ GDiffS M  ,   A R.sizeÆ  % -z  ,G ScountH  I  Þ OelseË P» &ª  "\�s.append( !)
	ã	 = ²P 0, -$ z @ # –  åareturn–# ó


@total_ordering
class Fram‡1"""Ò  V of aâ. " ð__slots__ = ("_fD #",ñdef __init__(self, ! # 0 isd Àuple: (filen� ÷ str, lineno: intŠBelf.p " =E †‘@property¨  ƒ O ƒ | J ?[0]E … C 1C  z E__eqû Wother !ifÈ±isinstance(" ,‰) ÇáNotImplementedâ  ž != P  	“l‘$ m – L<• Chash-� ¥  ß 	Ï ?str9 ¢"%s:%s" % ?  , ‘.×	N ?repO <G 3=%r O=%r>g |T@“(Sequenceh  �‚ 6ó	s sorted from the oldest !to £most recen Ëbs", '_/n¼',Ü8s, / =§Ì  ‹ È .×s ó {   t bs: see%Ñ constructor %he# 0mat@ að tuple; it is reóversed, because _tracemalloc
  ÷,# returns frames sorted from most recent to oldest, but theD óPython API expects-  7 F 3 cself._s ¢= tuple(re³ ( +))/ qtotal_n 8 =  
+ ‘@property 9def$ (u !):  þ ù   .._M  ? __len__: 1len É )† 9 sgetitem= w, index~ áif isinstance( w, slice% § #F¥(Éa) for  3 inÇ !s[O ]@Felseù V P < (Ì …containsÍ + ¨ K ” ChashL E   W#eq9 w, other@ hif notV" 0, TøGback- áNotImplemented÷  	‹ 2 ==w å só/ltœ j<› 3strœ ¶1strå 9[0]Ï ?rep5  us = f"<T" {š D5)}"?#if“Z{ is NonŒvs += ">< ¯# )f"Ð ={t .` }E Þ yaformatì €, limit=� ,è_è¸_first=Fals‰@lineú ([]á D  Ô  x K 
d"iff J > 0  `-_ò! =,![-Q :d  (   >  :> = 9 5  Q .if
µ 
> 
­È q ›0  	 " 
R Vð.append('  File "%s"Ÿene %s'o ¤ 	 "% (¢.filename,Ã.V 'no> 7   0 =  �cache.get D v.strip(Ø  K ×Ä   P sÏ  Á ! %u C ˜- 0


b¢get_object¤ ¬C(obj¬"""!Gexô $ ` whereŒ ‚Àobject *obj*ø" was allocated.
    Return a Traceback instance.
" ÐNone if the t, mJ á module is not ¤ing memorym qions orO 5did* eN H ration o` bobject¡ 1"""8 âframes = _get_" _‰  µ Q(obj)( 3if + “  ¹ :  ð rð î (- < Melse+  @ ‚


class&# ™ K  º aö Zblock¾ â__slots__ = ("¸ 2",)bñdef __init__(self,H"e)i  · #  góa tuple: (domain: int, size :+ )Œ H 2SeeÆ  7ñ constructor for�`formatÒ ì, w K  © .Ê " =Ÿ Ï ‘@propertyu Ý © Û Ô ‹H ?[0]C  ß A 1A F Ç è ((*’ 92:]¦%eq¤WotherÐ !ifÙ$isA(" ,o)  ‰ý áNotImplemented1 « d!= P  	– Chash˜ h d   J 	: ?str9 ²"%s: %s" % @ D2, _&_˜.
 ‰, False)c ?repd 1("<z $1=%sÊ3=%s “B=%r>  – : “ !, ×Ã  ¤ Õ_‚ ”s(Sequencx º—sc3 .) N ¨ ¸s¹Y A�Ds: s“�· h ÿÁ s'¢ ?lenÃ2len»A 	™sgetitem= w, indexÝ 7if Í U, sli" â   i!(M(§ )Tí "in�‰ [O ]*
|V P < $…containsÍ � B¤  � C ” Uè!HBÇ ê:s =ës¶O
Nðs len=%s>" % len(self)ô


def _normalize_filename(	 t):
     ° = os.path.5 7cas+ * %if- ó.endswith('.pyc'L P [ Q[:-1]C ereturnG ò


class BaseFilter• ¼ ÷_init__(self, inclusivel   . & =% 
o G SmatchE HtracA õ
raise NotImplementedErrorš – (¡  [ ¢ ,á ‘_pattern,�   ñlineno=None, all_frames=False, domain r  : ”super()._z ý )b  C   # ¥ / =0
' j È 2 = 	 
‡ Ø ' =å 
% ë # =ô »‘@property,  nNˆ Ó\Ü U  G _nQ_implH ³,É Z z !‘if not fnl . z/, ¥ s  ¦Ñ   "if= n@ is B6     9 ETrue8 Oelse& (J (==Y )1,| á ÿ kJe@ ^ (+0 Í¸ ¯¹Cback‚  4u
ñ aif anyA .› ƒ  O 5forÜÄ O in � 7 â 	] œ < 8      : Ç & =� "[0† :   b |©E,Z ‚Êc, size  ´‘, total_nã’ Cres }† O(
 	]² m   At
 � Sand (S  z  3 r  J I %orH !Ö H . gDïm#_ Ð:
        supóer().__init__(inclusive)
  ò self._domain = 	 
 ‘@property 3def (4 !):  F preturn  J A  3 a_match3 w, trace: n c, size òback, total_nframe =8 p (> 2 =={  ‚) ^ (not ñ ò

class SnapshotÀ 1"""X  2 ofn s
 ñmemory blocks allocated by Python.=  E 	 ñ m Õ s  Ý g_limit#q  is a tuple| , �s: see _T?ñs constructor forz  ˆ°# the exact 5mat  Œ .R 4s =I (  © ~ ÜCdumpÚxfilenamÝ  —   QWriteŸ s€ into a 9 F ( 4  with open($  ] Ò, "wb") as fpÀ 5   xpickle.’ 3p,  òHIGHEST_PROTOCOL)Ã Ñ@staticmethod+ ÀEloadr §› uLoad a Ì OfromÌ rÌ P½ � p´  ¢ �_filter_ª€é#de ˆs, exclu . Ð ;if 5 
R0if G2any([ .ÑO 6 € 2forÖ6 < inn ‹ = ù UFalseZ ,ifÌ ¨  ¤  ¬ ” r ¨ ¤ 6¤ ¹ BTrue[ §¦s§ sX WÅCreate a new¨¡ instance 2Rtereda°s sequence,LFters; Q@listPF5Q or Dí ^ ds.  IfC  ŒSn empþ £ J #, ì ¥ @copyv  ’—såf$isˆ  { Å ˜, IterablS † óraise TypeError("Tp must b? ©  }  ,É"%sê D  d% type  5fname__i‚ VkU = []„ k V! ‹½ 
k  N i¢éÆ Õ+ À            ô  include_filters.append(trac ;)
  ]else:  % /exO Anew_m Qs = [
 R for 
 �in self. #s.* z  ~ B  if1 Ð 1 (å ,A G  × A Á %)]y B		õ  f.copy(Œöreturn Snapshot(@ ,s Áback_limit)
} àdef _group_by(h ö, key_type, cumulative)à%if" ¥ not in ('^ À', 'filename wlineno'@  Mõ
raise ValueError("unknown[ •: %r" % (Ž )í 'if› E and7 ’ y � … ð � mode canâ ‘by used "3 À  P"withŠ  >À ¿ p 9 @statß%{}P ? !ifÑ ˜ ‡ J 
.  2 Òdomain, size,V ò, total_nframe =  ¥  @   >tryY  0aceI ;   sÆf ö 4   ¡except Key] w7== r0  Y È  S`ƒ Ó  - ,elc C` >[:1æ d Pse: #%c Ê /i (‹Ñ  _¶[0][0], 0),  k  * @ = TÇ 6 (2 »ÙE ñ0 =  S  „ " % .ž1 +=¦g  Ù & Pcount' 1$ R E � Â = Statisticg § ,1-®#� X E s˜ ­c v í ¨pÀ              Ptry:
	  Åtraceback =  �s[frame]6 ÿ except KeyError[ ÿif key_type == 'lineno'1    y Qs = (
 /,)„  * zelse: #d �filenamef g [0], 0)n D = T4= s¤ 6 RfÚ ­
pstat =  %s[\ § # ) �.size +=  s * Pcount+ 1( ù w   Õ = Statistic(· ,’ 6, 1?breturnà 
„ 1def < us(self,òö, cumulative=False)]1"""B  Þ WGroupH 5 byE 2. Rv öa sorted list of´ H ¥instances. g gg  ed¢Qelf._ D_by(± ö  /à ! =} (9 ¿ed.values(), .® Ñ(reverse=True=j ._" F_key? ar f£compare_tofÁold_snapshot[ ÊÃ t
ðCompute the differe:Ô with an old _   l U. Get`?as ¤UDiff  #, C5 byK  ?_by½2new±¿ ([ * =È O  _ˆS 0ed_%s(e %, © × $ Ð (
}Etake›(`õ@Take”& 5ßs
 ðmemory blocks alloca_’by PythonˆL  if not is_C 4ingm  ÁÑraise Runtimew ("Y + !em\ ñ  module must beÍCing ‡  P  "B  ations to õ Ø "jm  ›A_get¦  œ_  FP_limi¤#  (G „S5!s,± ŠD ð	)
"""Terminal utilities.0ð
# Author: Steen Lumholt.

from termios iðmport *

__all__ = ["setraw", 
 ó"cbreak"]

# Indexes for termios list.
IFLAG = 0
O
 31
C
 32
L
 ä3
ISPEED = 4
O â5
CC = 6

def } ò(fd, when=TCSAFLUSH):
    """Put ñnal into a raw mode."""(   õ = tcgetattr(fd) [° 1] =4  ð& ~(BRKINT | ICRNL @NPCK PSTRIP	 7XONJ ð J   J WOPOST) )   ) ïCSIZE | PARENB2 V| CS8É [V   V @ECHO® PCANON	 AEXTE	 8SIGe pC][VMIND 1X C @TIME 0 5tcsK�,?)¹,¼7 L ¿è ¿ ö æ < Z£Define namñ%built-in types that aren't directly accessible as a 4 @in.
R iƒ1sysbôterators in PythonO ±a matter ofm @ but òprotocol.  A large
# and changing numb8 z @ ð	s implement *some* flavoa C
# iŠ P.  DoÏ ‘check the>  !  Use has]B to     both
# "__E 1__"� q"__next €ttributeç bstead.Dð_f(): pass
FunctionTypeÈèype(_f)
Lambda l p: None)# Q# SamqJ X
Code= ø
_f.__code__)
MappingProxy%  Üp.__dict' S9N5pacž Asys.  Sa¼ ã_cell_factory(ÈBa = p ö ø e ¼ ¡nonlocal a qreturn © ølosure__[0]
Cell¦ g } gr ²yield 1
Gene	= Àg())

async ’ %_c‹P_c =  š
CoroutinCðc)
_c.close()  # PrevWù ResourceWarning_ a˜ @
_agf    
A† § Òag)

class _C® dm(self=iMethodà  C()._m)

B²(in`Dlen)  C ’[].appendeaR  @

Wr- ¸rDescriptorŽ Áobject.__iniSn 4 *  ¼ @_str~+ X °str.join)
C#+ À type(dict._ð._dict__['fromkeys'])

ModuleType = type(sys)

try:
    raise ! ÆError
except & ñtb = sys.exc_info()[2]A �TracebackD e 1tb) IFram~ ptb.tb_f " Z ñNone; del tb

# For Jython, the following twoÇ øs are identical
GetSetDescriptor� €Function ÿ.__code__)
Member3 pglobals6 
¦ ðsys, _f, _g, _C, _c, _ag  # Not for export
Ï ñProvide a PEP 3115 compliant mechanism6  class crea² ‘
def new_ ð(name, bases=(), kwds=<±, exec_body )¶@"""CJ  z B Ð object dynam8Qly usXñhe appropriate meta3 A."""Ë‘resolved_€ 3 =   ( Ó < B, ns¡ © = prepareÆ > O + ? &ifÎ € is not å Ô  ´í 5(ns4 
Q 9 — : ¢ns['__orig· b__'] =Sæ Aturnÿ o
X Ø  **{!)
 ! Q r B"""R6É MRO entries~ñ as specified by!5560v ýÄ s = list` ¬ ñ updated = False ‘shift = 0  ˆi2Ó in enumerateF ¦  RÂif isinstanc ,gQ) and‚ ÃGenericAliasp J   rcontinu’   !ifD qhasattr~ “, "__mro_?__"F ±.@ W  u .TrŒ Ð X {, tuple‡ !(· � must re8aC "– † Felseh  o As[i+¯:  +1Œ Á 0   ( „ += len(" Q) - 1' `ò o – A)  è H   i§; 
m  ]1all $__< _;ahod of T
� R40s (1m , ãSspace� as a 3-² 7 */ *æ  f d *Q - « !d s r 0  Ù+ 3an PT copyÑ `passedN * ñ argument with anyF '£ 'öÀy removed. Iº< 5is W  ñqis willK Àbe an empty â. •À if kwds is sNone:
  ‘kwds = {} >els Pdict(( ñ) # Don't alter the provided mappingG ðif 'metaclass' in ? u   ! = W.pop(- )A 
ˆ †if basesA  ½ E Qtype( 2[0]>   
B   0 d àif isinstance(  , M )g p# when  Q is a  ñ, we first determine most-derivÿ l  €  # m ñ ead of invoking9 õinitial candidate directly= ƒ Ð= _calculate_ ¶ þ û £if hasattr ×'__prepare__'Û nö D .! b(name,m@, **¶X 
O= 3Rretur$Q, ns,Ö_

def® 
eD"""CÒ  D DA."""�winner =“ 1for°  eY  q  '! =¹&Ï    1sub¥(Z ü 5 , . �continueu   
? l ", J ?  ! =¬ ` I  M ^ *# rðraise TypeError("»º ² conflict: $ P  "«3 Eof afF < ômust be a (non-strict) ;w 	"ofÖ esýqall its"s"’G("

• €DynamicCGƒAttribut �"""Route ì Ò access on a @ €to __get$ A__.
tBThisÎðdescriptor, used to defÐ 2 V ñs that act differentlyN u  < ‘hrough anè Ud and t ” C.  It± qremainsO  normal, but Ð  toT ‘ Q P willŸrÄ "th§('s 9chod; t€done by a �gh3Pallow_e(1havýpperties!1ive},+ qvirtualå Ì  N !ª Q with Psame Œƒ.  (EnumŸ ´ ábetween PythonP òversions 3.4 - 3.9 .)íSàR fromõ  toN  Ð›D 	± # aw  Ò#strptreatedPperlyH iö inspect module.Ã  Mris sinc¢Å U 3.10³ ìB_à__(self, fget=ÀF, fs 3del 1doc
 ~ : Ð.fget = fget
  Àself.fset =  
   0del 5del ù6# next two lines make DynamicClassAttribute act the same as property
f ó__doc__ = doc or fget. x ‘ �overwrite3 1 uis None) ð# support for abstrˆ umethods' P D__is" ! ˆ Ðbool(getattr(Ž ?, '+ ±', False))
X Àdef __get__(` ð, instance, ownerc =¯ !):2  	%if'  Í  !  N .ƒ 
*  . areturnÁc  Uaise �uError()# Aelif5 .ñ ‰ rC À"unreadable 1û"Y � [ (	5s5Zvalue+
 «£ `can't ç¢ S › ", z ×mdeleteÚž  7ÊAž ` C¡ 5del¡ <cgetterp ¼’ fR=Q ç
LJelseHPresulAtype_ )� Cset,1Qdel, l "or ¾ N .u =- 	 ‘8‡ ‰sï 7setï , 7 = ³ ­ g­  6	³  « GÒ›?del¬ › ± f_ ¬ ?
“ò _GeneratorWrapperXð# TODO: ImplemenÏ�is in C.©ò6inió7genç · wV qd = gen:  “ Risgen 1.__‘  __ß• 6Typá6 Aname®©1gen¨ !',Ï‚7 Bqual" r ä;  	?  æ Asendâ ¨_ é ./ 2val€  A SthrowB Štp, *res½¸4.__H 6 0 < O Cclos—¬ QŒ + Ð)
    @properñ
ty
    def gi_code(self):   preturn  ³.__wrapped.- & z@properK OframL . M running› 0 Q ŸyieldfromS 2 U !cr,$ =6 É    ’    Rawait 
f  –�__next__©    œ)X < Niter< $ifÏVisgenìðS   !__¾ r__ = __o  

} ãcoroutine(funcQð"""Convert regular generator ( ¥tion to a @ Q."""
m éif not callablY œ õaise TypeError('types.I  () expects_ E %')\ © ð.__class__ is Func“  U A and‡  l qgetattr3 A, '_ª__', None)F @CodeB "):l  A ¡co_flags =ø  1 dode__. + À# Check if '$'š !A  ¦ .Ÿ ð# (0x180 == CO_COROUTINE | †ITERABLE 4 ˜ 4if ‚ 1 & E   ‰ £ Ü£ 2¢ ŸGENERATORŠ *20‰ ö# TODO: Implement this in Cf  Ó ,coe(  #æ 0‰ 	-  ÷ ¬ä = co.replace(75=coÅ" |] Ö  r S L Cð# The following ˆ å�primarilyusupportîas thatž ## S q‘-like objïÖ(for instancers= ôcompiled with Cython).› RDelayv @oolsq _colle‚s_abc imœ €or speedÆ 1up ‚ •)  Y O ƒ  V  @'t+ .}ssP g  ð ped(*args, **kw
 p n  & b  % @if ()  ÜÿCÄ ¾5 or/  3 / GË/ 1andÅ,X'00¤  P 0# 'S ÞanativeA FÌp or an i   	›  O   â ðisinstance(coro, _÷collections_abc.Generator) and
  ünot isinstance(coro, _A ÉCoroutine)):? 0# '3 ô' is either a pure Python g{ 2 it„ {, or itG ·implements } .¾ ± (and does · 3 K @ ½ .* …return _qWrapper)+ ã $n 2= of± q 7 orG asome o$ö
object -- pass it through¢ ž  ^
E  w¥ 1d

· ôicAlias = type(list[int])
UnionType øint | str)

Ellipsis   h)
None     $tIr*ed   ð)

__all__ = [n for 0ð globals() if n[:1] != '_']
"""
TheÅ ñing module: SupportC tgradual# ðas defined by PEP 484.

At large scale, theô 0uct•!of `  ´ð following:
* Imn s$1 ex ð, all public names should be$ ólicitly added to û .O ònternal helper fun”:… $seJ PneverP ó
used in code outside this U Á_SpecialForm© 5its�Bs (s  3!ms­�Any, NoRîÁ, ClassVar, "@, Op)òal, Concatenate
*) ‡es whosec 0can­  pR arguµ iniK    s+ÀForwardRef, 41Var· PParamÌ 0
* ú@coreLi59ƒics API:¥î ˜_Variadicððlatter is
  curren£Qonly c�by Tuple‰ ðCallable. All subscriptÎ±ypes like XU3  ,UØ],
  etc., ar#$ofq@se cw esÃ ï R0couð @partý  ­ø ‘ consists $woF #: õ Â €Protocol\ Pªr@get_•ò_hints, overload, cast, no PcheckØ 	 Q_decoB e }  { eslB ABCI5fewCal p­ 
  iÔpes: New#q, Named£5PdDictz ¢ §Ä} rËuio rela¼.X±
from abc iàð abstractmethod,« SMeta
 ?   ’ „ntextlib ãDools "opõ  ª ðs stdlib_re  # Avoidê°fusion with!Q re weDort.A %sy\  ÏsÞ ð types import WrñapperDescriptorType, MethodWr  ) ô8GenericAlias

# Please keep __all__ alphabetized within each category.
+ ñ= [
    # Super-special typing primitives.' Ä'Annotated', y …Callable ulassVar  on� 5nat# TFinal  ¤ForwardRef í  VLiter0 WOptio@ ”ParamSpec0 uProtocoa 6Tupž  e)   © �Union',
â ð# ABCs (from collecw ds.abc)ÀbstractSet',M( C.Set+ ¤ByteString} ˆContaine(–textManag HHash^”ItemsViewH I %toW 9Key0 0Mapä?  R 0Mutr  )  uSequencË- 9'" S�F YValue� AAwaip # \AsyncÆ  ë …Coroutin� C¨	M PaN  �	p¿ ó# Structural checks, a.k.a. pYwReversi’ ´SupportsAbs‚    |Complex, \Float >Ind* -In( @Roun¨Ï ‡ConcreteÅ çÛ„ChainMapo VCount€Dð 5Dico xDefault 5Lis xOrdered $gFrozen SNamed© JÁNot really a¯ H ³U ' 	òtOther c5typ„BinaryIOç 
 TMatch `Patter" ;Q'Text* a pne-off xg#UAnyStŒ&ca!fuget_arg   Uorigin    ´ U_hint( 0is_ 'dd™0New&¶ !no# _Ì h_decor fNoRetuë poverloaVû sA´  (KwË rruntime€  X„  @ ÅYPE_CHECKING 1ypeñ @Guarˆ ]ðThe pseudo-submodules 're' and 'io' are part o›ñe public
# namespace, but excluded ò)ñbecause they might stomp on
# legitimate imùf ðose modules.


def _ótype_convert(arg, module=None):
    """For & @ing  @ to > ( à), and strings áForwardRef."""H ‘if arg is@ \  ` greturnM . ¢isinstance› 3str“ 7 i % À  )K a °arg


def _¹ c_check5 ùsg, is_argument=True1, *" §class=FalsCJ � that theæ F  ë aØ ˆ ñit (internal helper).
ª ñ
As a special case, accept3dE  Â { %äead. Also wrap‰T Vinto &/  Tðs. Consider severs Qornerz ñs, for example plainP Ÿ óforms like Union are not valid, whil P[int,• ]�OK, etc.N {The msg4òhuman-readable error message, e.g::1 	" [¾P...]:M ² should be ƒ"."2 ‘We append«‘repr() of `actualÁ Ðue (truncatedÐ¢100 chars)¸ Õnï ’_generic_B= (G ¢, ProtocolŒ!if$1is_JiI P+= (CsBVar,B  ó (if®E  I rFinal,) ‹=
 ALif (�_á `Alias)›Ð ‚   ÿarg.__origin__ in á Ð aise TypeEï€(f"{arg}2V1 asP âc"[±n (Any, NoRU!, ô f   @ ¯ I A "_S€€Form) or,  À Ò yr½ P1 Ã c(å, ÿÅ,!s.ú 3p, Param» )î 
 K@callX ð - Ä ‘{msg} GotÈ “!r:.100}.uŠW@is_p‡ W_expr^ *  Î0...Wî � :  Ç(tuple, listÛ Q, _Co”Inate�)Û×3objÞ 2"""æ ô€an objec�õ@-casâ zs§ If8  Ì \c, we rZ z�rter versAthany qdefaultê  a 0.__Œ ²__, based o( { Sñ  qualified nameUTch isD iÌ€y enough¨ôuniquely identifyÿ ?ð everything
    eñlse, we fall back on repr(obj).
    """ Ðif isinstance  ñ, types.GenericAlias):,  8 WreturN  E 7 öif obj.__module__ == 'builtins'` d 1 ¡qualname__k   2f'{# T #}. 4 !}'6  v is ...m Í t('...')) ÇFunctionTypeØ B Ü §  uð


def _collect_d`_vars(
 "s_v1var Ts=Nong B"""C6  Ð 0 ò variable contained¾ n½ð
 in order of first appearåò  (lexicographic) ñ). For example::
P  m³  ð(T, List[S, T]))Ì  SD[ ­ Õ   Ø €
  = ]1Var| tQ = [] Pfor tØ  4 &s_D 
|tI¢) and t no=  U <  à h .Bnd(tÂ   X ((_*,  — 4.Un#$ N f ¦extend([t Ï û.__parameters__ if¯ ]” Ratuple(O )Ubheck_g±f(cls, S c, elen�  L - Ò correct counŽ 2  5#a O ó cls (internal helperDðThis gives a nice error message®@caseP h �mismatchƒ Ÿ § ›QraiseET €(f"{cls}D -   Bass"$¶alen = len(Ï  1if  !!=i 	°Too {'many'Ž7 >6 ñ else 'few'} argumentsÍž ;T ñ °f" actual {Q Ð}, expected {ú 3}")#rprepareCspec
 Ù‘B"""P. Ws theö” a¤'Ping PmASpecWIäÍ # 4 Aial Óð
where Z[[int, str, bool]]Z  
rPEP 612û if†nÓ  M1œ C ÂÏsÍ ÿ2_isR_expríSs[0])è ; hassertÞ;clsn F[0],* < mY ,  ý8 _cIv !s,�m )G  ` ½ sß  `# Conv´ ‘lists to î
  yñ other libraries cacheúÐresults.
    ñ    for p, tvar in zip(params, cls.__  eters__):
4  àif isinstance(C 0, P= ˜Spec) and  {p, listD  L Ép = tuple(p)a } ˆs.append creturn6 ' ó)

def _deduplicateÌ t õ# Weed out strict ) ñs, preserving the first of each occurrence.¢ 3allv d = seti  vif len($ 1) < LsŽ  ú 6newG ![]>    –t�2 w ` 
   A Y =t[ % A ‡.remove(% z 6 = K Ÿ ¶assert not D , * ¤I 
�i Ò_dups_flatten<cñ"""An internal helper«°Union creat	  c€substitu #: T  ) sˆ aamong ‡ e ,à"n Š Ú1"""6 2# FŸ 0O [ `...],  2 Z Cs = Á ½p½s ¡
4Qp, (_V ñGenericAlias, types. SType) µ  r A.ext`.__arg º  " -eli b– žap) > 0¥rp[0] is4«  H j F[1:]HOelse/ °‘ 	� (Ÿ)¾t_literac!L: # ,s òì È%_` É· R –	Q·  Cƒ_cleanupŒrò	tp_cache(func=None, /, *fsd=Falseª D"""Iv wrÇ r =  °__getitem__g±«ñ with a fallback toúPorigiÃ |  ¡Åònon-hashable argumentsM� Ê‘decorator» £    “ Qed = W ƒools.lruç  <!d= )9 ‹  8 !I .  5r)
. @^  sM  ¢ pinner(*~x, **kwdÞ s :try#  Àw d?   ) pexcept ^ErrorK ðpass  # All real e( 0s (�(ungðs) are raised belWow.
  õreturn func(*args, **kwds)' # ainner
 !if1 Ñ is not None:  Y /  decorator(\ )9  ò

def _eval_type(t, globalns, loc	 òrecursive_guard=frozenset())y ð!"""Evaluate all forward references in the given m " t¥For use of| D and A see: �docstring^ A get³ ‚_hints()L ª  "õ used to prevent “infinite 4 !onCDwith Bve FÉ 2Refa 1"""' Áif isinstanc7) Œ!t.c (_úa ú(_GenericAlias,   Q´s.UnionType˜ … 0ev_Y‘ = tuple(Œ </(aï)paÁ!._L "__¥  _ 5if b 5= t"  "   rèt=  à Ð C , = " (i ”origin__,‚ 	– 
 !Ÿ  +ñtools.reduce(opeE?.orf 7elsz« pt.copy_M(œ Ë òt


class _FinalŽ `"""Mix) ¯¡ohibit sub* 0ing}Aó__slots__ = ('__weakref__',êØ_á_A Ê__(self, /, k~  ¿ ¡if '_root'Z0in Œ   $ ðraise TypeError("Can‡h € specialå ®¾ Ees")ó ƒImmutabl<÷ PindicFñthat object should’  be copied. � 		þ ƒõ Q‚ +Gdeep1 o, memo7 Ã
# Internal ²  orÁû ô
onstructs.
# See __doc__ ;¡ attributef@ @fic í.#SQRForm(0!, ¦S=True¥ 	£'_name', 'q  ‰getitem'&$&,V " S  _ (#._: $ =" ‡   n  !._ +__& ü E .� ˆ0get­�  70tem�${'g Ý P_qualˆ K__'}²}Ë  # q  ¿ ÍA…Òt $ µmro_entries™ Wbases)J fÀubclass {selñf!r}")

    def __repr__(self):   ðreturn 'typing.' + " j._name? OduceA 5 Ccall3 ø , *args, **kwdsƒ ðaise TypeError(f"Cannot instantiate {a Ô oÒ x, otherV Ù `Union[= # ]Õ A ^ ,	A £ ucecheckê 8objŠ à Í 2} cç ô be used with isS *()ÀŠsubclassk /clKk 
S k ¡@_tp_cache":ugetitemß ™parameter{ p j#._2 m', 0 1


Å ÷ _LiteralSpecialForm(_ Ã, _root=TrueL� 1if AM„ d, tuplU      F = ( !,)	 # +â *1 X)


@Ê 
¸ >Any†3"""ø ñ type indicating an unconstrained! .Áò- Any is compatibleBSevery*  · ) PassumB ño have all methods.â ×- All values . b’  ˆ`ces ofv ‚ ‘Note thatM ðthe above statements are true from # PpointH qview of|  2 !ic´  ßðers. At runtime,v q shouldÙ
3'c²2or aH Ü 1"""h rŠ!isW Ðsubscriptable~É1NoRéÎ ’functions5n© Uƒ’Example::â 6š„ import € #  ]•stop() -> Z þ"  õ PExcep~ “('no way'BThiszÒis invalid inPP posi6 ôs, e.g., ``List[‡ 1]``Z�will fail; Ï' ‰8C?Var‰G³uct to mark(@variïsÖ1An —a÷ q wrappeq ¡eÈqa givenà �attribute™bintendt±Kas ay A and= 
àcset on|mßg. Usag+ðclass Starship:
  ðstats: ClassVar[Dict[str, int]] = {} # c  ¥ variable
? € damage:. V = 10 
 ¦# instanceC D w ñ' accepts only types and cannot be further subscribed.
C •Note thatÄ @ is 6 a¶ qitself,Q `should = ô be used with is¦ ±() or issubù 1()./ 1""" €item = _© ð_check(parameters, f'{r }Ö asingleÝ 1.')H ðreturn _GenericAlias(; 0, (d ó,))

@_SpecialForm
def Final( x !):T 3"""0  k ðing construct to indicate fE ` names  Ë  Ë 3ers[A% ‹°re-assigned'ð overridden in a¢53ÂFor example:±²  MAX_SIZE:Ê q = 9000¾  ò
 += 1  # Error reported b ¬ T s ² Connection„sTIMEOUTo [Ù¬
< CFast@ 3or(
 3ionX	K  ? œ RThere”‚ runtime½  œòof these properties8kt_Unionk   i1e;  ñ [X, Y] means ei´X'YUÐTo define a u^ ,ƒS e.g.B òint, str].  DetailsÎñ- The arguments mus ¼0 o e Âat least oneV@- Noz  . I  œ2a seQ case+ isu1lacuž k (D -´ Bs ofÎ ñs are flattened,Ù :û 0 [,ê ³, float] ==!   ¬o #a R vanishs ÷=ª! #KÂor actually •s( u •Redundant4ç _skippå Ä | ÷ ` °When compar s,q P orde”o ignoru LÏp 4YouÐã £ÿ ti�72 « Opa€al[X] asòPhorth°3forÀ!X,k]A Î&f ± í(^¡raise Typeó2("Cþ0tak-< h!noq2s."F ifÐ¿d ð, tuple):
        paramáeters = (param ñ),)
    msg = "Union[arg, ...]: each arg must be a type."6 G   = tuple(_ �_check(p,X ¶) for p in 0 v  ÷ = _remove_dups_flatten© 2 Jif l a == 1:�  É Xreturj 1[0] : Q2 andÓ j(None)¦ W _!÷GenericAlias(self,Ú ò, name="Optional"¹ ˜ A ô)

@_SpecialForm
def N o )¤ %""q Î !.
õ 7 ñ[X] is equivalent to Ì @[X, ú !].1 """Ú ó)= Í3@ f"{÷ 0} rR Âres a single} 
ô h U i]æ xLiteralí °@_tp_cache(- qd=True). *=J  † 0ingymê ‚define lo   ò es (a.k.a. valu¸ #s)7BThis= 0canö@usedI €indicate  Ÿ  é Uñthat the correspondingTðvariable or func10 ha?†  O¡ O �providedJ Á à(or one of sevCÜ 2s):ú   7Àvalidate_simžãdata: Any) -> Q[cÒ]:  # always ­ s  y  Z ] eMODE =B €'r', 'rb w "b'wˆ ðopen_helper(file: str, mode: L � 2strÎo @ °'/some/pathj 0r')º aPassesÛ•¸ 
: Uother; Btypo> PErrorüÕì % a cannoPsubclt òd. At runtime, an arbitrary[‰ Ãis allowed a¦ Sargum‹e W, butÉ  ^2mayG Ámpose restriIs¸p# ThereíGno 'Áà' call becauseÔ~ sË A arel #¿ 0s, ó  l y ¶ª_œ_ s¹O 6tryÝ% €9pqP p, _ˆq_deduplmq(list(_"B_andÕ  Ìf "))i±except TypeÖØaunhash…{ —  kBpassír>_é
 )
Ãr© x ¦PmarkewU ±F CQssignRshoulÿ²be recognizH‚a proper.a� ÷1inidðby type
    checkòers.

    For example::   òPredicate: TypeAlias = Callable[..., bool]4 ðIt's invalid when used anywhere except a% 0 th t q above.‹ 1""" Qraisew ðError(f"{self} is not subscriptŠ ð")


@_SpecialForm
def Con¾ Pnate(= á, parameters):g @"""U¤ ðin conjunction with ``P/  V ”`` and ``ü ñ`` to represent aN åhigher order fM ÷hich adds, removes or transforms— 3 ofL cf£
� [ë Ó[int, P], intšðSee PEP 612 for detailed in‚ aõ 
€(if– C== (2 �@"Can•htake ax Ð ±no types.")&!ifÂ¶isinstance(—w, tuplel  8 = * M e[-1], ÅU Á †The lastõ  àV� should bá £ 
 "n P vari�÷ wmsg = "T à[arg, ...]: ea$rrg mustf  5.k 	" (_ á_check(p, msg)ÛFp inÆ s&‡return _} qGenericÕP ^Guard0 N .0ialò0ing’ m1to %1ateü“  Æ  %a& ‘r-defined( gp LU.  ``‡  `` only acX s a single} ¢e argumentØµAt runtime,N ôs marked this wayåœ aÝ3ean„
{ @aims%‘benefit *° ð
narrowing* -- a techniqueà ¶d by staticâ Ã!erL dœ0mine�more prec	\  @n exus§#in1òprogram's code flow.  Usually�  F@done� ‘analyzing“ Pcondi&alH ýPapplyÔ ºJ  Ø` blockÇ { m.  TheN ¸ pis some“€s referr‹o 1a "ò þ"S. Dit wŽpconveni… toe KÄö™ a.c P.  Su�& 8uses ô]Qs itsK -M  ClertåvájPintendÙ U· Ú!->òd bAells-4	O P that`� a given� uÆ 1.‹ £ ð value is a boolñean.
    2. If the return value is ``True``, ñtype of its argumentA    -  A # `inside= ÄypeGuard``.
* ÕFor example:: ô   def is_str(val: Union[str, float]):D  ¶ ñ   # "isinstance" } gp ( iY (  ] ], strO  V 3# Tæ p``val``Ú ûnarrowed to ``str``b  ; "..O   Lelse´   r# Else,± ?of k ø  = 6 
  n … bStrictL © 1ing¶ ãot enforced --�òB`` need not be a 5 !erN @formä ``òA`` (it can even1 `wider * ð) and this may lea$I  �ð-unsafe results.  The main reason§ €to allowQ  K �ngs likeF œ  Ñ ò``List[object]``Œ 0str ¡ athough¯`latterc "no¨Pa sub™  â  ¯ Ä €er, sinc± O ó“invariantµ ñresponsibility ofŸ @writ�  T -ë  
  „sz @leftª  m Cuser^ò also works withË 0ble6 3`more iÏ¢mation, se$òPEP 647 (User-DefinedÇb "s)˜1"""µ €item = _« ð_check(parameters, f'{self} accepts only"1gle› 1.')H r-à_GenericAlias(; ,4ðem,))


class ForwardRef(_Final, _root=`‰ð"""Internal wrapper;`hold a B ° reference.Ð ‰ ò__slots__ = ('__fm —_arg__',  @code 8 	Q% e @ated* >   ?  isz A 1is_  ƒ 
Pmodulk )" ƒ__init__d@arg,0ŠK", : �=None, *" s c=Falsek ú !ifA(R QraisePƒError(f"ÎŒC musN0strò -- got {arg!r}"2 w :try “¢ = compile… "'<G >¾ �s A  ex—q Syntax’ 
P ¯  ± Àn expression&¶  ×.Z  =Ç#  × ’ 	 %  Û uj1 = ¢+ |0 = Û& 	|( = 3 À    self.__fôorward_is_class__ =  #
  ƒself.__f- amodule+  
* àdef _evaluate(4 ò , globalns, loc	 ñrecursive_guard):=  j 0if 6 j ›arg__ in 5 4  8 areturn< L 1not P ž dd__ or” @ is - ­ 
^ %ifÆ  ) ˆNone and=   
5  — O % =, E= {}£  $ /el_  K F a¤ E ! =Ð 	E ~Ý � ç ‰getattr(X  ç   Bsys.R Qs.get!› @__, g Ö), '__dict__'GY ) @typeÁ_	 ^checkŒ  } @code{ ³¯)),a  È ""Fð references must Y  û@ to � >s."> Ëis_argument=í /__: £7   4 
l  ¦Â²1+ Æ _~,�K | {b »
í’ 
> ›e= Truezà1Ã |Q_eq__Ûz, other\ ã±isinstance(" #, Î7Ref.  èv €NotImple²%ed” .Á   ` °   
œi ¹ 0 A2 ==Ë  &an�  ¯  ‡&H  –‰ B ˆ Chash�LV   ã )C OreprC &f'­(pq!r})'

Ò _TypeVarLikerÓ"""Mixin for  R-like°# ( àáParamSpec)."""ùâS_init¤ ð, bound, covariant Cntra p"""UsedTsetup� sn -'sT  ! €  ä'co_  ouibutes." ®  . &if›  G ð contravariant:
   ô(raise ValueError("Bivariant types are not supported.")
A “self.__co4 ¥__ = bool( -  Ontra1   5 •if bound:t  | x  t _­ q_check( @, "B8 ¡ must be aÐ ½ OelseW QNone
z °def __or__(} †, right)@ ×return Union[# ]@ rA ?lef@    , F 
? $ep� z !if* 
ˆ™  0Áprefix = '+'Ï   (el: ~/__> -> >e ~'  +ª iname__Seduce_Þ A  4.__8 ó
class TypeVar( _Final, _Immutable, _ 0Lik “root=True] 0"""!  ŠBble.Ž rUsage:: U  T =f ±'T')  # CanRsnythingQA* áA', str, bytes6 M‰bstr or f 	‡ ñs exist primarily for the benefit of staticÒ~ ùñers.  They serve as8 ¡parametersK Sgener= s$ AwellF a! ð function defini  a BSee ~GJ  ¡ AmoreE pinforma. I on n 5.  4 ] `s work‡ ufollowsz rørepeat(x: T, n: int) -> List[T]§B'''Rƒ0a lAöcontaining n references to x.''£#  dR[x]*n“ õ q longes€ qA, y: A~ Ax  ¤2  ¤0twoOingso áx if len(x) >=
 0y) –" y† ñThe latter example's signature is essentiallyì„overload—Aof (ˆ1str¼  ~Qand (™ "->‘p.  AlsoòÏ@that¨  Ý ‚argumentQinstaR ‘rome sub  1tr, 9 ` ¤ µ °still plain"yäAt runtime, is^ p(x, T) ³ $isa !(C wG Â CÁM   ÚsÍ¥ined with › Œ +“ » cè@used6@decl@ ; îE  /qPEP 484 )À details. Byœ Jault< w!inœ!ntI ain allôÚ ï ¹ ð	introspected. e.g.:

   ñ   T.__name__ == 'T'
    ²constraints )() rvariant YFalse Gntra#  " NA.___ Ástr, bytes)
K ñNote that only type S ñbles defined in global scope can be pickled.J 2"""S R__sloÑ 4 ('ý Ò', '__bound__ 	Ÿ !',F  'Ã Ž  5 ö  sdict__'Ô ðdef __init__(self, �7, *r !, Œ _=None{  #cox =UG, con %):³  f èp  uuper().” z  S d   ^ @  ifx #B and¶ € is not ½ …  7öraise TypeError("Cc · 6 qbe combÚBwithT _=..."{ 
Glen(B)Ð1 pA singlr ë½ wallowedt pmsg = "¾ BVar(µr y, ...):@must‹ ¹6s."t>elf€ tuple(_. ð_check(t, msg) for tép s:tryé òdef_mod = sys._getframe(1).f_,\s.get@mainª1  #s C5ing¹ òexcept (AttributÈb, Valu w òŠ  H  if¾¤ º!= 'typing'Å ¶Qmodul 3 ó&


class ParamSpecArgs(_Final, _Immutable, _root=True˜ ±"""The argsâ aE ‚ object.(nGiven  a P, P.@ öis an instance ofL  ‘ I 	¥ d ð s have a refere> Öback to theirI :Ž #  u p.__orig§ ªP BThis�is meantÝ ñruntime introspection¨ ha£  1ial3 aing to¢bstaticQ ˆ6ersG×Å— g $ À  %  ³ Crepr: «return f"{D Å}‚"
 Kw›k3 1ïÅB — M  *{ Àr runtime inðtrospection and has no  ñial meaning to
    static type checkers. 1""" ñdef __init__(self, origin):  F belf.__ C__ =# 
" B CreprB :  return f"{[ D óB.__name__}.kwargs"


class ParamSpec(_Final, _Immutable, _TypeVarLike, _root=Trueu 1"""@ BeterAfica.@variD .· rUsage:: g   P ={ B'P') O ós exist primarily for the benefit ofˆ/
Œð  They are used to? AwardC pÌ  7 sK 1oneH @callÏ  3 „another  ñ, a pattern common—  und in hig- QorderK 1funQsR·decorators.ž C ¢valid when® ñin ``Concatenate``,Q Aor sÀ àfirst argument« 3``C¹  ``kE as æ sý  [ ‘r-definedO pGeneric� BSee ' 2 ²more informìBon g5 ü : !AnL qexample7 @anno!Ung a ÷ CT = pQ('T')B ,0   ô add_logging(f: ñ «[P, T]) -> jq   '''Aµ V-safe—  =Cadd Y   ºD.'''�  ² † pinner(*]@: P. B, **o  
 � Tƒ  B g .V@(f'{²A wask&ed 4   òy q <% ¢ fG   @7Ì  È   ó two(x: float, y
 »  	¿  Bðdd two numbers toge"(® Rx + y‰ ïš� with coWn…" oQicontra Vcan bå@declõ@ I or 7 ÅÕThese keywordXs@�P, but{ñir actual semanticsR  u !ye‹b^pided.  YqPEP 612sdetails-à $in¡ V Ge.g.bõe == 'T²�P.__bound\4= Nã j5.__$ BFals  n$ ñ ¡Note that ÃlsÂ z *@globB co@aB¦be pickledJj p__slots‚ 4 ('áE', 'ß  Ñ  	Â 'F * À    '__dict_ñ_')

    @property ñ def args(self):  & õreturn ParamSpecA$ F /kwH K& J  ‚ �__init__† ñ, name, *, bound=None, covariant=Fals Intra Á  Ð 0.__K A__ =T Þ …super().x i d   ^ ): 6try% )ôdef_mod = sys._getframe(1).f_globals.get('� °', '__main_• E   òexcept (AttributeError, Valu Þ  1 z  !¢ 4if  º!= 'typing'µ amodule3 1


�ãis_dunder(attry   °.startswithÙ q') and  7end ó

class _BaseGenericAlias(_Final, _root=Trueg �"""The ce�òl part of internal API.;òThis represents a gb € version8 àtype 'origin' ²   Qargum7  'pæ1s'.DñThere are two kindF `hese aº €es: usergAinedû �special. »  Q onesT  N °wrappers arÖñ builtin collectionsJ ZABCs  A.abcZ qse mustT `have 'àó' always set. If 'inst' is +sthen thÁ   can't be ( ‘antiated,V tS isá �d by e.g.0�ing.List£ TR.Dict41"""> <
ÌyÎ n éâØô Ð• % ! =š S   ë Ébelf.__e É ; a_slots   ,A  # <¡is not doc#edYÈ Ecall”*ÞB, **è¸ !ifE ¿ 
l’raise TypÅ0(f" " {0  Õ }‘ ˆ ’"; V  Tf"useI õ1}()GFead"Á`result¯
;(á CóC w_à[ Ò 6 Ï
Î
2pas Ý ]\ ß†@mro_5ies�Wbasesƒ…res = []~ 0if Ž ¤  j¤1in ; 
ˆ @res.œ!nd€5 72i =; a.index)  Pfor bµ^ j[i+1:]d Pif isÜ~ance(b,¡) or issubR $ 0é  *  Ubreakî Jelseo Ó Àpend(Generic3)
  ñreturn tuple(res)
 ðdef __getattr__(self,  !):!  ? !if ó	 in {'__name__', '__qual }1  5 q  Q .3 B or  ¤_origin__.M �  7 õ# We are careful for copy and pickle.š a# Also$ ðsimplicity we just don't relay all dunder ° sC  ifÈ ’ 'å ¦ adict__x ‚not _is_B (  ¸ ï JH%._é Su òraise AttributeErrorV 
—s— Z, valœ™  i ¢  Ë !{'|­Ainst	 •nparams',�  Â  	‘'_typevar sF E «pec_tvars' ¦super().__Ç  – Á z Jelse9/ C> ? % Ö •ancecheckÂ7obj%�Ø„subclass2  Û (1 	&  = X, clsX Ç3TypÂð
"Subscripted generics can@Ñbe used with"Á r!" œ vÛ  ª )s"  $di°‘ æ–list(set(…/ | 0+ [–C	 lin dir~P) if Æ mò$]))

# Special typing constructs Union, Optional, G¡, Callableì T™ 
##ƒ three sS  – &s¥ ñinternal bookkeep $ofo ‚ ¡es:
# * __¤Âeters__ is aÀ of unique fk   ,   aQ A
#  U , ûexample, Dict[T, T].h ƒ== (T,);„ [ ­  ƒ Àreference to’ æype that was sB,{ Re.g.,F o 0intq U "== ,öƒthe non-{± version ofK    ë .š >arg )�arguments�dH— 8ing˜ — R ’ int).


Ò_ù¸Alias(_Base Ã, _root=TrueÒá&itØ:,­`s, *, &6 ,Ú_=NoneÚ ºÂ=µ?Var) 	 ~ÙT=Fals“  7U!in› �Š  � Š  irA is"  ²(i ,”ô  a    4 = & I  Š4.__l? @(...¤àa is _TypingElßlipsis else
  
ÿ() if a is _TypingEmpty; Pa for; •n params)l qself.__ ñeters__ = _collect_type_vars(" 0s,  1var !s=  W 	,  W 	 „ a Ppec_tq  /  1 Åif not name:  =Î amoduleÊ ”origin.__ 
1 °def __eq__(4 †, other)N c ±isinstance(" ÷ , _GenericAlias1   ñreturn NotImplementedp  q 2.__š  ¥ =~  4  8   @and © a.__arg¥6  )Ú ChashÜ ¤     (‡ ,` )O #orM ~, rightT `Union[£ # ]� rA ?lef@   ‰ ? ’@_tp_cach·ugetitem“ '” $ifÍ eCin (º§, Protocol3  eó# Can't subscript 2 …[...] or9  .¦ðraise TypeError(f"Can¦N …already- @ed {3&}":yß {, tuple³  4 =  I  8 (ª±_convert(p)>p i3if C “	ð  1 –Gany(&@t, PcBSpecd td  æ g)Ë ‚_prepare•s ‰ – ,Ã <¹ ˜ ‚_check_gª	7 Q, len � ± @  ¡Ït = dict(zip0 ˆ r1newžU = []-{'rg°
³ 7if F2arg.·a
5  ¬ 9  �/  3 Qarg =æVt[arg«    ˆ2_isˆ›_expr(arg·0   ñExpected a list ofA‚s, an elþ5, ". G  	%f"Þ ,’øConcatenate. Got {argPM & 
/ela (,'"!s. èà    subparams û= arg.__parameters__
  aif sub# -s:  - ösubargs = tuple(subst[x] for x inA )A Aarg Œ [K ]' ð# Required to flatten out theÃ sj ùCallableGenericAliasH  Ê ôelf.__origin__ == collections.abc.G ò and isinstance(arg,á )@new_p.extend- 
ë Oelse7 =app7 €return s³ ¢copy_with(cp 1))
ã Fdef $  3 ", ³­ Q  __class__(- 8 r, name=    ,    { c__reprM r r A 
ÿ   â = 'typing.' +ê _ Ô  [7  � = _typev Á x ‘ç = ", ".join([6 !a)5aŸ c_Á6__]A 10f'{v 0}[{R 6}]'t ù Oduceû ~Ö = globals()[gûü 9 / Ç/   ‡Ö Õ `if len¢ s) 1é;notíOs[0]ñ f ,±a,òoperator.getitem, (¶ ,©	4¤mro_entrieˆz, basesB„ø ç, _SpecialForm6  ;ðraise TypeError(f"Canç 1subü  {O C!r}"–  6 
²R  # gOñ version of an ABC or built-in R ˆ J ªsuper().__ï é 2 x ÕC is Ë
:°if Protocol½I 
"  (ù  2i =ca.index<
"  ´bX n[i+1:]^ (if.yb, _Basz)WbÆ u>elfG  “ (©   Ÿš‚)


# _nÙ Z   anumber—rcceptedúÐ�, e.g. 0ì@Hash!Q,
# 1 AList¨ 2 ðDict.  It may be -1 if vari8  k '
#d d are a| ó(needs custom __a__).

&µÞ©(AÃ, _root=TrueÛ æc__initp$, ]3, *¨ 7 Ä4NonB à    if name is‡ None:
  ðname = origin.__ %__# òsuper().__init__() p, inst=  , 3 = )7 ó elf._nparams = 
   &ifr úmodule__ == 'builtins'¦ sP @_doc( ò
 f'A generic version of {� p.__qual’ U__}.'v ;elsþ X ¬ /}.l m ¡@_tp_cache ðdef __getitem__(v ", )é �if not isWRance(# w, tuple*  À 4 = & ~€msg = "P~…eters to0átypes must be  !."§ 	V s  (_  ô_check(p, msg) for p inÁ < ( _™	æ  , ô « breturn “copy_withÒ !)
[  >  H < H "_GQAlias‚ 2.__$__7 ,W  î   8=g .ë  š— c__reprÒ Ž ²'typing.' +â Q Ö ¡__subclassbH W, clsM (ifØcls, _Specialî 2  × ƒ $isc I(clsÒ ”ˆu n õc  ž ^¦ 	 )creduce"ë I   º5 o›~, right8 `Union[
# ]@ rA ?lef@   í 1]

Ð¨ _Callable5(Ÿ´, _root=TruÜ ëTgassertH0g å0argr Ô 0.__ Ïpif len( )@ ¡2 and _is_OQ_expr 7[0].Q³û8Œ$(fø�  I   òf'[[{", ".join([h R "(abab ¨ ¶[:-1]])}], å  D   8f'{; `rgs[-1- '¦> ` # =T,  �(12^ BlistT:œ  ,   § ‡9“operator.*4, (B5 -)
__Type(^Àrue):
    deóf copy_with(self, params):
  ñreturn _CallableGenericAlias4 ´.__origin__? ,> E  Pname=w  ._ c, inst   G �_typevar Ðs=(TypeVar, PÌ _Spec)J þ ñpec_tvars=True)
Î ñ def __getitem__û ð /�if not isÁ Rance(T ó , tuple) or len f) != 2m (`raise Å tError("zñ must be used as "™  4  8 õ[[arg, ...], result].")= Dargs # = ð# This relaxes what 2 @ can� ÷on purpose to allow things likeH vPEP 612—ð.  Responsibility for whether aè §r is usingI [Ó � properly* €deferred‹ pstatic ¥ checkers.F (if¤ Ñ g, listË U½A = (¿() )-CJelseÆ9  3 2 WþWtinner__z’@_tp_cachM
‰2  I � } Üfmsg = ). #]:,waL.vL1 = z_e( V, msg "if4ºis Ellipsis/“„(_Typing4 G	Z pÅ ¯Í   Ë  ,C   " = (Ë `onvertï)•aarg inÅ 9 äB $+ ü " × 8 À)


class _T ò (_¯8ialfr, _root�7
œ	{ [ == (« ‚fmpty,)Ú è¨  C  w  Ú~)ifƒ== 2 and‡0[1]Ø:...Q º9"[tÝ?: t¬† «– ;[0]® , ;p, ”
• T0, t1š OeachŸ 	‹ † ¶"(pž ‡p…, ‹« & eðUnionGenericAlias(_Gó)enericAlias, _root=True):
    def copy_with(self, params!  % Òreturn Union[ %]
? c__eq__< Wother; ñif not isinstance(" A, (_O GŸ atypes. WType)I ˆ áNotImplementedˆ  1setŒ à.__args__) ==  z  Â ChashÄ t ø   p(frozenG  %F )G NreprG  ‡  ƒ %lf8 ¶ pif len($ © 2˜ Ñ   0if  p[0] is  D(Non¾ "  ­ ðf'typing.Optional[{_7 _œ g u[1])}]'‚  A $eli 1i 80i ¢ ‘super()._“ 9__(C(ScheckL^, obj˜‰„subclass2  î (1 	X &  = H, clè0forn@ in  ­“$isO P(cls,5 Ÿ  Q  ð  n
%CduceÛ 7 Ñfunc, (originT  s)7/9 )¼c ; 9: 0


Ü¢_value_andQiter(ÃDeterý G B((p,d@p)) p/ 1


l0 _LJ (alÀ((_ m³ ’ /"p <ox   Â	ò)Œ, J	i .Ýb  K‰ )t¸Concatenatejx
 û wCinit™ 0, *V`, **kw
 KŸ1 + ,R [ 	 c1var 0s=(Ä`Var, PR_Spec)> 	h¢spec_tvars§þ ò Œò"""Abstract base – ³gRÈ"s.y(A  Jñically declared by inheriting fromê Cthis_ ¡  8Pized 2Á one or morer ± variables.> pFor exa¯5, a‡ 0map¥3 €might be�’ined as::¹  z M0 (‡[KT, VT]·Ëð__getitem__(self, kùey: KT) -> VT:
  7... q# Etc.
 òThis class can then be used as follows::. ò  def lookup_name(mapping: M	 ²[KT, VT], k’ ,3 ault: VŸ <try® sreturn [ Q[key]¬ Ó ÿ except KeyError= 0defu 8 1""" â__slots__ = () òis_protocol = Falseë ¡@_tp_cache)  ø !__)ö_getitem__(cls, params)‰ òif not isinstance(# w, tuple*  Ò   “ 
 ,š   I  ± and cls is_ TL u  0 ¡raise Type(º    0f"P­ ð	eter list to {cls.__qualÒ€__}[...] Æ –be empty"— � =Ï ô(_type_convert(p) for p in‡ "ifÁ Ón (Generic, P~## " ÷ %  • P only¤ð	subscripted with unique � ¨ variablesù#  RHall(Ÿ0, (6QVar, "^Spec)Ê 
o Vs % wss	o€must allÚ 
Â  ¾ I   f"gÏ×specificationÿ ¸ > £if len(set•Q)) != ×ˆ 4 ä B­ž Jelse`4# SãÕing a regular1sub’ä8anyàtÖŸtŸù÷  ?s__ý   Òs = _prepare_ 3pec
 	ì 9Ó   ‚_check_g> ,ˆ—  |_YAliasC 	�  o 	 ¬1var /s=ö,B ÿ ²tvars=True)4%Tinit_›_%°*args, **kw
 i¬super().__9 4 ™ y F = [öif '__orig_bases__'ãjdict__]e=% =L inœ.D r Ê@  ¸Ëè g'É'Z 1if K 
ž s@"CanŽðinherit from plain GenericC")
  õif '__orig_bases__' in cls.__dict__:-  4 ðtvars = _collect_type_ (5 L ö, (TypeVar, ParamSpec)~  Q ù# Look for Generic[T1, ..., Tn].~ Â# If found, Š ÿmust be a subset of it6  :not: /is)  ’Also chec’ ôand reject plain£ ,– ( „multiple+ K[...Æ g/y = NoneI   ‡ƒN
‰ <ð if (isinstance(; 3, _G©Alias) andd  8   1 .ÿtin__ is¶ )m  5 2if ½ 0is Q Â *  . ÿraise TypeError(ˆ  - @"CanS Äinherit fromŽ D Z s's.Æ @    #= Ü pwyeters__€ Ë e‘et = set( 
¿ w s %  % !if2C Ret <=J/et@sTñ = ', '.join(str(t)*t"K Q if tZ $inR }  ¦ Ps_arg»
R gR gR »  > Ìpf"Some ‹Ò variables ({¸ y}) are"q F  !f"¿ `listed† À"[{² /}]ê ü Dg ‚ó„ = tuple»ò

class _TypingEmpty�°"""Internalì�ceholderoð() or []. Used by TU @Meta`P Call  �  to allow ea  Ü /ˆ  à ‚specificg ¢s, without3 „ing themH Psneak7 òwhere prohibitedäL"""
Õ llipsisØ c... (e/ ").L ø	_TYPING_INTERNALS = ['__W C87%, Jc:__'&üÑ'_is_protocolJ ¦is_runtime ô]

_SPECIAL_NAME‡ àabstractmethod±,y =Uation ¿a O_doc‘ p'__init  H dmodule 4new Aslot[ ™Í 	 a'__sub÷ Dhook3 tweakref   ñ_getitem__']

# These ðal attributes willÙ lPed as:ñ members.
EXCLUDED_ATTRIBUT-
ÈÀALS + _SPECIóHAL_NAMES + ['_MutableMapping__marker']


def _get_protocol_attrs(cls):
    """Collect p$ ö  members from a ðclass objects.

@ òThis includes names actually defined in the @ ñdictionary, as wellJ a? °that appear: `annota3 £s. Speciali ñ(above) are skipped.L 1""" î � = set() €for baseZ ócls.__mro__[:-1]:  # withoutç 4  è !if7 0.__ä  __@ 3('P3Ò', 'Generic')Y 5   …continueJ Ð ` = get¥ (” W, '__ r__', {}¹  L  ½  .  } Alist6 0.__SÑ__.keys()) +  J  
› pif not R p.startsý Ñ('_abc_') and & úin EXCLUDED_ATTRIBUTESQ  ¤  N `s.add(
 ¼ areturnL s–pis_callº_qf_only(œ�# PEP 544ƒñhibits using issubO!()² " á!s ?ô have non-methodÓ� 4ll(ƒ (ˆAcls,© ˜, None)) uL)Ö ñno_init_or_replace ð(self, *args, **kw
 *¡cls = type' )Y1if  %is½mö raise TypeError‰1s c÷  bâ³stantiated'V “# AlreadyI±a custom `_© ñ__`. No need to calculate correctÇ#/ & 1l. qcan lea= ‘Recursion¥ ò . See bpo-45121‹æ } 1 ism_HS+p# Initis,š (of¾2 d 0set¸ `h `ž ä# The first inNaion ofÒT @will-/l T c whichA‚searches_ ¿xper newÁ 80MRO^e J h ù$e ‘ X' oldK ?(ie› Ä). Subsequenãñ Hi  ú 0thu›e3new› ULŸno longer*~ y  î« j$ =˜Tget('Í?', ãš ²1if J | 5 ‘  8 A__ =A õ     Qbreak Felse´ �# shouldçhæn&  4 T i.Ì À_

    cls._ð
_init__(self, *args, **kw
 ò&)


def _caller(depth=1, default='__main__'):
    try	   òreturn sys._getframeD õ + 1).f_globals.get('__name__'` )T òexcept (AttributeError, Valu ö):  # For platforms without z N ™ DNoneâ ðallow_reckless_cla Rhecks³ #=3ã @"""A- á instance and 1 ! c1 ñ for special stdlib modules.
Ó qThe abc: ”functools$ ð indiscriminately 4 isq  ()9 I Qissub| ò() on the whole MRO of a userŸ ñ, which may contain protocols.P 1""" ÈÄ[Àå] in ['abc', 'à !'][ Ï6² Ð0TruÐñ_PROTO_ALLOWLIST = {z Ð'collections.ž 1: [  D �'Callable´ TAwait IIter 1tor% Fsync J DHash1 PSized. Cqe; C‰   qReversi| F !], '¥ðextlib': ['AbstractK ‚extManagP  A“  q],
}


%3 _Pð€Meta(ABC Ù²# This meta- ðis really unfortu� {ñ exists only because ofµ #„@lack$__µbhook__´T 5u__(cls,U”  š³# We need t  2hoddAituaÏ„ where a#Qs are� B €assignedš ”  ôŒ    Eif (-   0getK “ T'_is_(†', Falseƒ 0   Nnot 8 runtime@ _‡2Ç$ � ’raise Typ?("I¡4can½  d.ú J  4" @Ì ± á>"")Ù :  N(F)ory @  o ò b �_members_k �)y 4 q#._Æ|_, cls).�4 B    if* .� ª Î! qall(hask ,yš  7 ð# All *methods* ðbe blocked by setting<Pm to ›  D  Z(q ” ,; ?)) Y C ð getattr(instancÿe, attr) is not None)
   1for+ ð in _get_protocol_A �s(cls)):; µreturn True  ôsuper().__instancecheck__( ³)


class Pm á(Generic, meta $=_ CMetaƒ �"""Base "  ¼ ¯  Aes.
� <  ò are defined as::'  L 1 ( 3colo     0def™ îh(self) -> int#..~ ISuchz ñprimarily used with static type "òers that recogniz[óstructural subtyping (> Rduck- !),~exampleâ C± Ô Õ00 9 rfunc(x:À9 †x.meth()@ < îC())  # Passes/ ±See PEP 544Ü ‚details.x 5colesdecorat\@‘.runtime_dàable act as si)ƒ-minded '  QŒ6 P ñonly the presence of givenAÐibutes, ignor£Rtheirß€signaturŸ Pg¿ „can be gOthey³1GenI ¶?[T]¹T Ž  ·  1"""é Ò__slots__ = (65_is& =÷  9  RFalseÃ . 
ait_subl __VÐ, *args, **kw
 » C
9 4 e  ¾ ð# Determine if thisþaÑ ê� concreteLŽ .ô  B !if,ðcls.__dict__.get('æ 1', Þ ®  < 5 
%Pany(bƒ ¥ ­ °bi. ‡_bases__ó# Set (or override)r”µ V hookº e¢ _ k(other¢ Þ ) â Ð@NotI7fmented # ò# First, perform various sanityæs·  4 — 0getpqWyD ñ_allow_reckless_Ûó+s(
 3   Ò    óraise TypeError("IÖB andÁÙ  Æ&&beèTR  4" @í n¤ÎRcols"‚5 0 “@call, ð_members_only(cls):+
  ðif _allow_reckless_cla �hecks():3  B ýreturn NotImplemented* ý$raise TypeError("Protocols with non-method members"D  n  ñ" don't support issub³ I()")? Pif no" ÿinstance(other, typeÙ  €# Same e¬ ø  message as forg ‰1, int).l  £ ï 'œ ñ arg 1 must be a ´ 9')
G ð(# Second, perform the actual structural compatibility c¬
�  ´ ãattr in _get_p{_ _s(cls  6 @base6 ,�.__mro__0# Cz 1 if§ Ä€ appearsE  ¾ é Ú dictionary..«  ;  0if œ  7  „ 0.__4 | 2 	* [@ Ÿ] is None´  8   Â *   Zbreak«    P# ..."€n annotaç  s,i}t a sub-€ü : ` = getÊ (Ý W, '__ z__', {}ê ˆ   eif (isï7 q, colle„þs.abc.Mapping) anº M   ‹  •N 4 úH‘, Generico   E._is—� € |  ?elsâÚ" FTrueÔ ifjMrhook__'A_n cls� 
7 2 = Ù _G c �# We haveW ñ hing more to dof )s(Ëm 6
ã× o 2...lw‰'ð consistency of d s,Ñp prohibµ0!tiË±Š _= ¢¬ ¾ 8w(object)orõÓ N  qpodule__< ð_PROTO_ALLOWLIST¨ < 	?nam: [^ /] † » 3 · 1and/¹÷òcan only inherit from£'Ø   '¢@±, got %r' %“ ™`init__ˆàno_init_or_repñlace_init


class _AnnotatedAlias(_Generic ô%, _root=True):
    """Runtime representation of an aO q type.
5 ÕAt its core 'q �[t, dec1 ±2, ...]' isG  � � for theK A 't'M ¤with extram ±ions. The a7 ðbehaves like a normalE 2ing# ,J  instantiat !isl Šsame as   † punderly,  Ü ’, bindingL @t tod !esÃ 5lsoO ." 1""" Qdef _…ó
__(self, origin, metadatal pRif isŒ 4ce() ¶0  4 G # =Z 4.__ E__ +h �  2   \ 4  %__' …super().¿ " Á )) :elfu =u &  Pcopy_ÏgparamsÍ ³assert len( Q == 1A  ³ @new_‹2 =   5[0] mreturná4  , |	¥ )® ›  __Þ¡’ U †"typing.Ì {}, {}]".fn%t(‡  ¨ ¥ R ê 2.__92__)Š %    ", ".join( 1(a)Oa in®  2   ¸ Oduceº úoperator.getitem, « Ò ,, ¬ N,) +‡ é 	† #eq‚ w, otherCiif notÖ " ,ª3  å zåNotImplemented}  ³  /€ s4  V   >and× : <	ä Chashæ ¬ Š   (� t	S sgetattrV  ,  \ !if  ó{'__name__', '__qual }ª Û   ‘ xG ×€ z &[ õ"""Add context specificã a0Exaµ%: I r[int, rKð_check.Unsigned] YPcatesJ 1the´0hypÌZtical: ð  module that thÊ1ypeˆ3n uV B intŠREvery˜ Ä Psumer¿: pcan ign°  ,Qtreat’  �1tî  Š first arguª Ç û p must b›Xvalid)‚Details:ŠQ- It'0err…o call `L  ` @@ les¾ean twov sï À - Nested Anónotated are flattened::

  #An# [
 qT, Ann1 !2] P3] == P [# " U ô- Instantiating an ad ù	 type is equivalent to i1 1thež punderlyD  7 µ C| P1](5)¡ DC(5)‡ Ð   can be us	²s a generic� Xalias^ «Optimized ò „runtime.! 1()]ª  K [d[int-_int, = > IListw   ?[T]@  y   } . �  G 2"""9Ó__slots__ = (Mðdef __new__(cls, *arg 0*kw
 %):Ê ðraise TypeError(" 9 Œ0not�öCed."j ƒ@_tp_cacy Ôclass_getitemƒ gparamsz 0if Z "isY 2ce(# ó , tuple) or len V) < 2·  F» BÀ[...] should» J"ô  =  ó"with at least two arguments (a{ nd J ?@ion)(j vmsg = "¥ 0t, ¨ q: t musdh .a  origin = _Tc_check•[0], msg)Ø ¢metadata =C) 61:]% …return _ˆ AP(i $, D àÑ‚init_subÙT¡  !"C  O E {}.Œ €".format¶¶.__module__¾ @)


” ž@able2 ]ñ"""Mark a protocol ¹   aL:  .GESuch  ö8¦„) and isÁ 1().á RJ° if applied4ja non-‘ 8  This allowŸ ñ
simple-minded structural ûñ very similar toy ðone trick ponies in collections.abc sß pas Iter/{ pFor exar Q@$^h  ¾I@ClosF #(Paz "    ¢Àclose(self):èg  wassert Sôopen('/some/file'), d ‰ Warning: t/4wilñonly the presence of rµ0redÓQhods,Å  sRtheirÒ±signatures!  W ¤ �æHG‰œ J „cls._is_Ø¡�'UfÀonly appliedÿ	 to protocol classes,'
  ñ' got %r' % cls)) õcls._is_runtime_P a= True$ `return4 ñ


def cast(typ, val):% �"""Cast a  ueœ �a type.
  RThis J Ss the' áunchanged.  To  5 Ñ checker this@ `signal; !at' L G  ha Ae de( 1ted| �, but atB ã ò we intentionally don'tr ð anything (we wanl ‚ ¡to be as fè Ás possible).` 1""" ™ /ö_get_defaults(func4ÐInternal helpð €o extracy  Ð 6 ô arguments, by name.o 2try‚ ÷pcode = d 0.__ !__• öexcept AttributeError8 ñ # Some built-inA   sThave Q 5, _Ï r__, etc ‚ þ !{}w Àpos_count = Ž q.co_arg ! @arg_Ï s! 1var ! - %[:Y ]& ^ü  r__ or (î$kw )  + re� Vdict( V) if  g else å Poffseæ ™ t - len(q � 1for¾:u‰V zip(Ù  ? L E:], = ª æ!rtE ¢ not in re# s[=2] =• ) °

_allowed_i ë  Ëpes.FuncôQType,?0s.B)in R  l  J x.Method? aModule 6  ñWrapperDescriptor)  G   
) )^ ] € ÷_hints(obj, globalns=None, loc �include_hvs=False‘Rí R  R  ´˜an objectÎ�is often�1samÀobj.__annotaNs" †ƒit handl­ðforward references encodedc0str…ðliterals, adds OpR Pal[t]�aT$î` equal} ú @ is – anh ð cursively replar 1allD "'A° ûed[T, ...]' with 'T' (unless '9  %')e¥A may+! m ,�1, m!,‘ ¢ Í g. The /� 3are, a � °rry. ForR eº Sions ¡ Q alsoH `inheritmembers® "yp "`raisedQ —j   `2of Èñ that can containb º  , h‡an empty²  K rWg (noñ 2 argdpresenb‘BEWARE --^ðbehavior of globalns ð>and localns is counterintuitive
    (unless you are familiar with how eval() M òexec() work).  ThD Àsearch orderi t ñs first, then globals.
u ñ- If no dict arguments€ ðpassed, an attemptR °made to useP E  U Ð from obj (or p respecä – module's- Por clf 3s),I  Ü Qtheseƒ 1alsj Ad asO Ð  . ¶ 0thek óect does not appearL tto havep Ê  Ç yî `ionaryÓ †used.  F� + MM S@ T • nÚ	R1onee S h QiI v ” for both¤ C andq ë §/tw¨
Pthey n?ifyP ,’1ly.l 2"""f ñif getattr(obj, '__no_type_check__', None):9  ¶‘return {} 2# CÑ¢ require a“ €al treat_v Òif isinstancep  j [  hi‹=\  n 0ð ase in reversed< ‡.__mro__>  /  Ñ ïw » º  !   Tbase_Ö=Bsys.³`s.get('  g Æ#__	% =1{}) W   Oelseq ¢ 	: cann = t ` † ï'__annotationsu 
YPann, Yøs.GetSetDescriptorTypÊ ±   { Ñ     Š _“! =ÛQ(varsR)) ifh ü  	Û ,   ö‚A 8Q# Thi@Psurpr>dg, butm ÆôBefore Python 3.10[ Ç  #åØdAonly^PuatedÕAYns of¾  B 2# a¹ zðo maintain backwardáô mpatibility, we®L   Èý  
g z Æqso thatŸ ß() looks intoK  *§M #s*£PratheŽ2an ! a "s*ˆ Ñ  bpaffects Ô NRefs1 p ,¯% k  ™ 	¹  Ò¡name, valuÙ«ann.items(Ï § $if) s‹' & L =ù(÷
˜ # 
'1 _, strt   / ! ' =( T, is_9a=False àclass=True)
    ñvalue = _eval_type( ã, base_globals ‰locals)
B ñ   hints[name] = @ $ breturn# ó- if include_extras else {k: _strip_annotations(t) for k, t iC ¡.items()}
b 2if £ ±ns is None:  £  n ð sinstance(obj, á Ös.ModuleType).  2 L å= obj.__dict__R  ® 
2 ansobj / &  J f# Find�  É Ðthe unwrappeda Iect.6 áwhile hasattr(\ S, '__4 ;__'±  k ' 1 =  .- 	[ Û ;get`  †s__', {}á1if ô^ {  =é t /el9 	5 E4 = ž °('_   ä¢ $ifWú2# Rwgempty URösomething that _could_ have them•C �_allowed-s�î!{} #3`raise ~°Error('{!r}¾qnot a m��, class, ª Uod, 'R  V  €'or func9�.'.formató)+€defaultsêDget_ # Z  ò( :  ¹ Ú,Ø‰$if# � ® ! =‚(Ä  
e) [, str\#`-levelÈÐward refs wer7ñndled above, this must be eitheré  r   #lR &U or aP— argumentH	J ² ` = For“ IRef(   n $ , 4is_^ =ÿi°C +j=False  Ã€  þèü4ns,ë5 0if û ô1T and  óyq  Op”1al[]cA 4B 0;O
defgÄ@"""S„sìás from a givenÁ!1"""Ï 
ÀRt, _AÆhedAlia$Þ í².__origin__‚W |GenericU :0pedK âhtuple(d Àations(a) foór a in t.__args__)
  ±if stripped 7 ==( :(  / …return t  ¹.copy_with(M g öif isinstance(t, GenericAlias)c 	; ¡ = tuple(_ ÿ_annotations(a) foÔ L¤ (9šorigin__,0ã ÿ types.UnionTypeæ …þfunctools.reduce(operator.orê øô²


def get_3(tpç ð"""Get the unsubscripted version of a #!.
T ò This supports g! às, Callable, T!, Và, Literal, Fin �ClassVarR Rand A3Red. RºANone; — n "edg Â. Examples::”  ñÝ n „[42]) is~ m + 1int#  n   © B[intM  . ‰R  ' "[TR * ?E[T,   U QList[v 0 3T]]³ f== lis( P.b® PS 1""" Ep, _¡
d  A c(_Baseë D 
\,8  ž õ ParamSpecArgs,  !Kw½ Ç 5 Š Ctp._ç!__V Pif tp	 Ç3  - #p,uy ?  AG  X~ ³ |àype arguments ›P all ŽAtituI£ performedˆPFor u´òs, basic simplific{‚ used by„  constructŽ(reP  =S     *± „Dict[str‡0== < T	/ T $   F š ¬ Üª³A(int D ð D ]¤  ])?  ¹ ™	« °h[[], T€    É 4 ((�Q,) +  �metadata£À  if isinstaø	nce(tp, (_GenericAlias,  S)):
  õres = tp.__args__ Aif ( õorigin__ is collections.abc.Callable6 W ñ and not (len(res) == 2 à_is_param_expr H[0])•  E ™ Q(list# °:-1]), res[
 q `return  ¤if isinsta
ù types.UnionTypeü ; å ý R p()


deP _D ƒddict(tpA ð"""Check if an annota ' a k ÁdDict class
� ÆFor example:ƒ! e Film(6 e  	  ¡title: strH     ’year: int_   'is­  T ¶)  # => Tru¦	& [i,b ]2 BFals3 1"""x a_¶ DMeta6!no‰  _c%C(argÓ ÷"""Decorator to indicate thatGQs areC }r hints.è òThe argument must be aiq or fun£;œ"it‘fA, itÊ ðapplies recursively� ±all methods«5 Òes defined in§  I B(but¦ o: . ‘its super2  esŸ 3sub )Ñ åis mutates theÂ 0(s)2 / (E‘in place.} ˜
õParg, 5r €arg_attrí`arg.__Î‘__.copy()N  ( @for ( P, valï 	- gitems(W  3 *if,  bases__ + ö,.  2 � P.pop(o 
� 3obj{ ´ o.valuey Š2objö 3s.F  ˜  iobj.__ J__ =" ¨ 
Wa S  	M B(objÑ 6tryçJ	* 
w aexcept:`Error:º‚built-inÞ%esªpV ¦ •3arg°
c dm(
 Á ŠÕgive another - �@T x effect½Bwrap»9 pwith soP2ing9( !edÒ ³ ø
m ê) @* Qools.L Ö    ±  Eped_‹  (*ßƒ, **kwdsÿ  < M & =í ) R ( 	(= è # ‡  ¦ � ¦û _overload_dummyz 7 """Helper ˜@2  ªð	raise when called."""
  ó  raise NotImplementedError(
  ö"You should not call an overloaded function. "7 ÔA series of @- ‡-decorat5 s5 ôoutside a stub module~ øalways be followed;  by– iÈ a‘ � that is¹ … µed.")


defÇ (Å !):À B"""D¨ eor for% · ¡/methods.
4 $Inµ òfile, place two or moreÒ `definiœ sZ �the sameD  ƒ     iM ¦row, each 5FwithN .  For exaö :‰    U    ç ñutf8(value: None) ->	 S: ...) " 9 Qbytes: 
 ; <str9 e 7Anon-ð ;ð (i.e. a regular .py  d), do 1A butB A it :an k.  The SQ*not*G /begÄÇ
Ëè #‚goes her•"""Õ„return _Ëc_dummyFsfinal(fX D"""ANñ or to indicate )  ;C and dclasseM�Use thisE òto type checkersç *Ôg @ can¹!beÈqridden,| /  € * 1sub "edh! R Base7O@ã €   {‘done(self �3  ( †W @Sub([ S # ÊK  A  # ¶` repor^)by#� J  o  	± } HLeaf¡  . 8   `Other(& /):}  I w T`šs runtimÏ0ing2àthese properti € Œò	f


# Some unconstrainedû ’variablesÀse are used phe cont1 r1 qs.
# (Ty  *  4 ý exTð.)
T = TypeVar('T')ú "Ani9.
K K  $Ke  V  V  V“ i.
T_coc �_co', coÊ ynt=Truev  Ì Ks.
VI   I Àiant=True)  ñ## Any type covariant containers.
VT_co = TypeVar(' &',/ ÿ =True)  # ValueM 	 L HntraP  S   † W QDitto• #ra Â.
# Internalq  Áble used for² P[].
Cb r  o 5 !ntk €, bound=`)

# AK ,fu` @with� ñstraints.  This represents string˜ sª (! �one *is*� ø export!)
AnyStrŸ  �', bytes,N  )
‘ ñVarious ABCs mimickg ð#hose in collections.abc.
_alias = _SpecialGenericA p

Hasha3"= * (B " 1, 0áRNot gD .
Await@ # à, 1)
Coroutine’ › q # ï, 3)
AsyncIterf ' j 9  to\ß 	' 9 m " / c 
/ 1tor/ Reversis
$ 3 _Sized0 žCÄ= # j C>2 	b3 4all›C  (× T, 2)
* ô.__doc__ = \
    """ <$;  a[[int]¡] is a funêÀ of (int) ->*!.
K ÀThe subscripó syntax must always b,Ñ±exactly twoA vËðs: the argument li> !nd areturn© ( F o Bbe a; !of/ ìs or ellipsis;M ¤ 5 RsinglQØ  re$noÓ Ñto indicate oí  ala ukeyword¾ !s,“ Fsuch> íÀs are rarelyóÒd as callback± .; `"""
Abø_ctSet'çSet, 1, name='3 Q')
Mu4@ 
$ gÀ# NOTE: Mappñvis only‚ ý ©µ² $.
- Ü! “q  Ù 
( ; SequencÔ" Ì B  k ) = RByteS\× $  ð
# Tuple accepts vñariable number of parameters.
Tuple = _	 `Type(t ñ	, -1, inst=False, name='' "')8 ñ.__doc__ = \
    """! q type;  ñ[X, Y] is the cross-product'  ’ ‘X and Y.
F ƒExample:@ aT1, T2B !a �  3 ñtwo elements correspondingD "to] vÿ As T1e CT2. Y ø int, float, strb D aof an & a( B a- 3ing® ÔTo specify a o v-length¯ ±homogeneous™ S, useˆ �T, ...].u €"""
List”Ïalias(list, Ž ) q')
DequÅ1 Ðcollections.d > À+ W')
Seb /sea ÉSet')
Frozen3 f 9 3 æ')
MappingViewÖ ¥ Gabc.% Ÿ, 1)
Keys2 " / OItem0 # ¯, 2)
Value2 $ d èContextManagerË  Êlib.Abstract+ €
 Š')
Async Z 
0  _     'icîdict, 2Þ0DicðpDefault Œ V! J \  7  ')
Ordered E ! ’ZCountXr  ˆhainMapW C T ‰Generato®V  y# 3, 3� b  6 i( l  =1  ™D 0ypeC?ypeBAP�al constr)!usÄó
to annotate class objectsŒRFor e>ñ, suppose we have’following? Bes::t  ` User:�D  # Î‘ base for * !es¯8 PBasic= ( )C 	! 0Pro  LTeam  @ ‘And a funÑÒ that takes a‰ P argu ' 3subfD  Y »rreturns×astanceL ™CZ @U = ßð Var('U', bound=X )b ð   def new_user( _ƒ :8 £[U]) -> U:.  - %   =r, (L   a# (Her¾¢could writÅ9 ù P data£@ À   return usQer

  ò
joe = new_user(BasicUser)! ÀAt this poin ðe type checker knows that I 2has  G .g ñ """


@runtime_> ôable
class SupportsInt(Protocol):: ðAn ABC with one abstract method __int__.e  Ó Ó__slots__ = (Ç @5 4 [ 4def< Ò(self) -> inty  J Opass¸ OFloaº #f: ¼ &> ¾  À Complex|"c< Ä &@ Æ  È _BytesÆ "b: Ä &> Â  À ?Ind†$i: À &> À "&Ab|o[T_co]Ä ab²Jñis covariant in its return]é$a ã  ¡ ¢URoundbæ r@ "__2è Cc ê  , ndigits:ÙA = 0åü ñmake_nmtuple(name,sñs, module, defaults]áPfield ¡[n for n, ¹ +!s]m € = {n: _ a(t, f"@ ñ
 {n} annotation must be a‚ !")G  – g }  ð nm_tpl = collecI  s.È dÓ p !s,2 N  ð =	 =˜ x 6.__Á  Ï%=   b_!   sŠ ã2 ñ


# attributes prohibited to se``NamedT¬ I‡syntax
_. ð= frozenset({'__new__'Á, '__init__' Tslots ‘getnewarg /
  �'_fieldsC  ¿_defaults',7 	Amake5 breplac aasdict ôsource'})

_special = frozenset({'__module³ 5nam  annotationÀ  E ñ
class NamedTupleMeta(type):
© ðdef __new__(cls,   U Ñ, bases, ns):+  bassert †[0] is _^ '  E ês = ns.get('__œ U, {}). <_w  6 %[] Bfor a  1 in  s‘  • +if$ n!  % 	e †.append([ Ž  - Yelif 2 
r  $ óraise TypeError(f"Non-5  ¯  dtsœ & {l 5} "á  J  1f"c3t follow� M ? Ã{'s' if len(• aß) > 1 else ''‹ {�L.joiK &}"8Pnm_tp¯_æ1_nmþ m ZŸs.items()'´ �s=[ns[n] 
n Í ]H /H=ns[<]¸ €# updategam user½ô
space without overriding ˜ Õ â¥attributesØ ¯ 0key± Ž3if  ¿_prohibited`A[ e""C � WwriteÜ ‡ @ " +d å  TÕ z 0not˜ b0and.   É.ä™ 0setj (( ,;  &G[keyWrreturn % 0


i*ás=None, /, **kƒv0"""dÁd version of {.ÆPUsageÔ dPython, “s >= 3.6:í –Employee(“ p  $    ßU: strÓ  rid: intv @ThisØequivalent tol f ‘ = collecœ.[ ¿ $('# P', ['  kTid'])d €e result|½ Ûhas an extra [P, giv5 aÂ  d¢ that mapsHIBs toVy.  (The ±are also inG Cthe k Pwhich@part£ (  Ï è R API.ŽÇAlternative 9àkeyword syntaxJ v PaccepÂ3' =ý	J y ð=str, id=int)

    In óPython versions <= 3.5 use::

  ôEmployee = NamedTuple(' ñ', [('name', str), ('id', int)])H 1""" ñif fields is None:  j  ò = kwargs.items(? Celif 1 õraise TypeError("Either list oi ²or keywords„  m  ÷" can be provided toî ², not both"‘ 6try‰ Pmodulðsys._getframe(1).f_globals.get('__'ò __', '__main__'Q òexcept (AttributÔ b, Valu )q   BAñreturn _make_nmt£@typeq ,t1, mª = F)

_Ñ0 = 0 –.__new__( vMeta, ' ñ', (), {})

def Ö dt ó_mro_entries(bases· cif len F > 1Î È÷
Multiple inheritance with’ @ ”“supported™qassert { 0[0]' ¹ +(ü F,)

& (._Æ O__ =â  


class _†PdDict-(Iø  SRcls, ‘  ó, ns, total=True3  œÑ"""Create new™rd dict p vobject.¤°This methodó ±called when!›   1subB 1ed, l /or)  áinstantiated. _ 5way4 ð  �õ%s all three syntax forms described in its docstring.N S– @s an)  | 0cesÆj äaactual@ionajJ h Ø 1for y ps  !ifX“) O
É
1  5 ¬@'can8 ªQ from(' ay % 'ï  I  'ý fa non-ö  º ö* : 1tp_´
¾ l(+  ,)n)2¸ !atøE= {}ž Jown_ n¿ Æ  �   
8 Ê_keys = set(  s. "()ø : umsg = "ô (lð', {f0: t0, f1: t1, ...}); each t must´aÉÝp E = {Þ  p @n: _“å_check(tp, msg] /&__«  ?  XPn, tpYl 	¶ - XˆrequiredY  op‹*al ·  t 
!inÔs›˜q.update×!._'$__ð annotations__',w {}))
  ùrequired_keys.update(base.__dict__.get('__* {__', ()M �optionalM 	* M › `annotaN • Gown_ Ç •if total:>  à 	¯ Ù 
D § H JelseD 	¦ D 
{ !tp7(._¬ W__ = ¼ .  	¯ 0 ©frozenset( ° k 	¨ = 	 = ó if not hasattr(L Q, '__MJ__')# .! " =xÎ sreturn ) 
 a__call”  OP  # sÙ‚c method& ÷def __subclasscheck__(cls, other‹ €# Typed N äs are only forY ñstructural subtyping.� AaiseD qError('O ‘Dict doesñsupport instance and ›  œ 2s')¸ $__#  ç È 0


à h ò(typename, fields=None, /, *,Só =True, **kwargsÿ À"""A simple D  d F ð	space. At runtime it is Ùñvalent to a plain7.½ ‘ ¡ creates a  Ã!ryb ñ	 that expects all of itsNû s` °have a certg 0set+  Uò, where each key i? ðassociated with a value7 ‘a consist½ pype. ThÓ ‰ ‚ ¯|Fed a0but£enforced bÕ 0 "rsrUsage:: "é…Point2D(&… "   ax: int‡     y ¦label: str` 3a: ] ñ = {'x': 1, 'y': 2, '3  ': 'good'}2%OKh b= Xz': 35 !ba4  �  r# FailsÎù ‰ Tssert� ±(x=1, y=2, ƒ Á='first') ==! R "Th–ô info can be accessed via them   Ï,hê 
* 	  __& H 	á5__ 8àÁ × s two addi`(al*XformsªH #(' €', x=int6 86strh+ ! =sdh@ ÿ= 
 H '7}j±By default,ˆ ZP mustf@pres+Fin ah ð. It is possible
  ñ(  to override this by specifying totality.
    Usage::
   ò	class point2D(TypedDict,8 …=False):/  3 ix: int y  T„ Ämeans that a^  ^ ñ can have any of the keys omitted.A typeP ð	checker is only expectedù `suppord �literal ±   or True a„ ¡e value ofP  l ¢ argument.- i- ðdefault, and makes all items defined in´ P Bòbody be required.cBThe ! esyntaxÆ º K ñPython 3.6+, while two otherd = ó forms work for 7 12.7¬ A3.2+. 1""" �if fieldsv FNoneÈ �= kwargs/ Celif ) QraiseºvError("Åt ei¦ p a dictyukeyword^"s,Ž  ; ò" but not both")5ñ	ns = {'__annotations__':c (» !)}´ 6try¬ `# Settõàcorrect moduleÿ �necessary7 ÖadS ¢Òes pickleable. ¯ qns['__mI ð#__'] = sys._getframe(1).f_globals.get('__name__', ; qain__')° ñexcept (AttributeV0, V¢ mBpass…return _}PMeta(# j „, (), nsµÞ6)

/ ! =ï –.__new__(  I 5, 'Y 'M E{})
 ÷.__mro_entries__ = lambda bases: P R,)


ò0NewC  3""" ñ creates simple unique  ñs with almost zero5qruntimeçchead. K (þ 0tp)ãðconsidered a sub]pF   Mck  Wcs. At b ,Y  {"Àa dummy call&áÈ #y ) E itsü.q…UserId =k '  ',V y@def à ò_by_id(user_id: / ‚) -> str^ 0   #..x  )  (':  ')  w# Failse  q /424  /   3 r §42))  # OKY Cum =¼ p(5) + 1= ! #‡ ?   ¼¯ ÿ á__init__(self,G, tp#  q.__qualˆ  œ 	 C  P `if '.'°  
.  ! =W p.rpartik•('.')[-1]D e  / ý 	  Psuperr" ts � 0def>@ = _72er(
   ifQ º!= 'typing'¥ } �ð = def_mod

    ódef __repr__(self):
   return f'{ Ô.__module__}. pqualnam !'
9 Q CcallQ >, xT x- creduce/ , } k < o¸ ~, other? `Union[E # ]@ rA ^  , H ò]


# Python-version-specific alias ( Ã 2: unicode;2 ð  3: str)
Text = P ñ:Constant that's True when type checking, but False here.
TYPE_CHECKING =  ó


class IO(Generic[AnyStr]#3""" b base / @for ™ òIO and BinaryIO.4òThis is an abstract, g_  
’ of the r>“of open()C aNOTE: I ðdoes not distinguish betweõ ñhe different possiblecª Pes (tBQvs. b§ p, read  Qwrite
   / ,= ñappend-only, unbuc �d).  Theü C subs B Ñbelow captureë À fctionsÁ � �which isE Ápervasive inD ð
interface; however we cur Qly do+o¯ ! aD pway to ‡kD ¤NŽ ^ Cqsystem.< 2"""Óâ__slots__ = () ‘@property+ @ëamethod  æBmode30 ->Ç:OpassK  CK ˆ Gclos‰ ONoneŠ 'M dŒ OboolN � ffileno@ ?int? Flush> Ì ~ fisatty@ ¾  -> p, n: in 0-1)à=Ì  M 7abl›� !2linB , limit— 2 U sé h£
ì DList.ò CseekV Roffse­ ,Æ$ceº 0P v K m0Ú [ M+Atell� Ð) -> int:
     `pass


 ñ @abstractmethod ðdef truncate(self, size: int = None) -> :1  I S rwritablS A OboolB ? ±, s: AnyStrJ ?intI Slinesà  r: List[W ]X  ì Y ‘__enter__X C 4'IOS 'K 3xitJ ð , type, value, ²Qebackb ¥ ò
class BinaryIO(IO[bytes])„ ñ"""Typed version of the retur ±open() in bE ’ mode."""9â__slots__ = () M6wriJr: Union�  , – RarrayqÉ_p ô nBText?str!Otext�property$fbuffer/¾ §ZR †encodingT ?strO (Brror(n�Optional[>W ' r_ý 	¬ ü 0newY ¯ ?Any¥ øQ1O"io` ñ"""Wrapper namespace for IO generic •(esF1allDƒ['IO', 'm 4, '
!']AqIO = IO % 2 = 	  / % =ö€


io.__� e  ÷+ '.io'
sys.modules[+ ó] = io

Pattern = _alias(stdlib_re. ¯, 1)
Match%  # |/re-!reê o *|  /b " 3 = 
 " 1 =  _


re*re+  0re
ÿð)Python unit testing framework, based on Erich Gamma's JU0 þ
and Kent Beck's
SmalltalkJ 0 (uI °with permis¨€).

This€Áule contains½Fcore‹ nà that form theð% basis of
specific test cases and suites (TestCase, 
 S q etc.),' ñ also a
text-based utility class for running thef a dreport €results
q  xtk ðRunner).

Simple usage:

    im= P unit¸  r ðIntegerArithmeticM  Â (. . !):M  Q 1defœ ÑAdd(self):  # ð method names begin with 'z 'B  F  : ÿ	.assertEqual((1 + 2), 3)) †0 + 1, 1' ’ ƒMultiply— G ¶(0 * 10), 0J š ²5 * 8), 40)?Pif __æ ö__ == '__main__'&B  ñ()

Further information is available in÷ñbundled document* B@from� õhttp://docs.python.org/library/{ ûhtml

Copyright (c) 1999-2003 Steve Purcell&  ! q-2010 P` ñ  Software Found”  
This modu½ ƒs free s( ± ðyou may redistribute it0/or< Áify
it underÿ 0samûdrms as~  it/�, so long t} cÛ 0mesô
�°disclaimer ² ƒretaineda°ir originalsò8m.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, IND
 ð
SPECIAL, INCIDENT ñOR CONSEQUENTIAL DAMAGES ARISING OUT OFu ñUSE OF
THIS CODE,— " I “ ôHAS BEEN ADVISED= °POSSIBILITY RSUCH
l 7.

Ó ¦ ñFICALLY DISCLAIMSÝ ¡WARRANTIESÄ ñLUDING, BUT NOT
LIMITED TO,¯ †IMPLIED 7  y “MERCHANTAŒ ±AND FITNESS8 A
DñICULAR PURPOSE. Q  ô ð PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
[ T'  " ð	NO OBLIGATION WHATSOEVERºT ð MAINTENANCE,
SUPPORT, UPDATô 0ENH àMENTS, OR MODI+ S ÐS.
"""

__allû0 ['!R’1',   A  ð IsolatedAsyncio)     (',¥8'TeÑ E  * `Loader @Func9  L  `G adefaul< @Skip8  H Dskip $If
 kUnlessL ð expectedFailure, ¦ ÷ �installHa»rB †register&lremove > AaddMcóCleanup']

# Expose obsolete fFñbackwards compatibh¸Á.extend(['ge% KN´ Þ ðmakeSuite', 'finð'dTestCases'])

__unittest = True

from .result import 5 R  Dcase ñ(addModuleCleanup,0  e  , FunctionB  @Skip ž, skip,
    "If! ó	Unless, expectedFailure)‰ EsuitŠ @Base[ S †  , eloader·  * L ˜, default Amake> A, ge  À _Namesµ V  fin_¡ Dmains  _ �Program,  ™ Frunn™ 1Texo R  Ç  �tsignalsZ ò	installHandler, registerµ  Jmove - ð
# IsolatedAsyncio§  ì t will b_ðed lazily.

# deprec6 %
_² ¢  JÃ   / ÐThere are no p s  ð, so don't try to run anything discovered —�
# intros   ýthe symbols (e.g.pó). Instead, all our
#� AcomeX 0 wip  .¡ `.
def 4_  s(  \ ±, pattern):Â)qos.path ñ# top level directory cached on[  ö »1nce4 ³this_dir = K ñ.dirname(__file__)) TreturD .(`(startA =J © =± 
�DLazy=/of v0 .a_ô -!s  òio, which is relatively heavy, but mostt 9ñ o not need it.
g_´ 3__(NÞ ÿglobals().keys() | {'­$'}J  getattr__(8R 0if  O == B Ê �y � ' Q£ 8 ß ' 	ñ	raise AttributeError(f"mh@ {__Î �__!r} hasU ô ,   {  !r}")
"""M� en_£point"""

¯ðsys
if sys.argv[0].ends@("__£d__.py"F›Ð  # We chang‹H  Ë Bó
 help message more useful= áuse executable‰0out]³h, unquoted, ð(it's just a hint)2wayð	# (if you have spaces in rd  # €get what ’ deserve!H Ž …@baseV(+" 2   ?( =j e+ " -mW"È odel os{ vJ   

 (ûd=None)Àtlogging QcolleosÈðcase import _Basû.eTestCaseContext


_LoggingWatcher = collections.namedtuple("* O",
  ò"["records", "output"])

class _CapturingHandler(l” . !):k 1""" #A   " h0 $ cA õ	 all (raw and formatted)2 } .H  P 	 ódef __init__(selfq  ß k ‹ .( ?  '  6 %.wD,`([], [ò  ,  o \flushl Qpass
S  # Aemit" ", >– o . ’s.append( )H  o amsg = 2 "  ½ ."M Umsg)
©£AssertLogsA\(_BasV¨ b"""A ci€ manager“% aF !()¨  NoY 5() ˜ð
LOGGING_FORMAT = "%(level—U)s:%(	 ¦message)s"A	«Á, test_case,0er_> !, R “, no_logs½  9Ü 
 U pN 7b ( =p —"ifz Ü p   =  ä 7 Aing.© 0ToL B.getº y OelseN EINFO† p "JNone $ =\^enter0Ñif isinstance¿.{ Ô  w'ern þ * ® ¦ ò 4 J ge¾=gerš G%t O  ® FJ8 
™; �=Ô & A.setÓŒ  Þ% } › ( Á¼$ =‹*' Cold_£ s4er. >[:]/ ,  & –propagate*  .  Lo C = [{ x $ 
$ a v = Fals¼"ifî¿
ereturn•  7   …E__ex¢, exc_type
 —value, tbÇi£ ß  l €b  ô 1 Ô   2  3 
+ 0 ¤)«ð     if exc_type÷  is not None:
  ù# let unexpected exceptions pass through5 Õreturn False
 ü if self.no_logsh ÅassertNoLogs4  Š qif len(< úwatcher.records) > 0I  2 + é_raiseFailure(R  $   &"UØ  “ ÿ found: {!r}".format:  > f ‘ ooutputf ) )=elsr
/==	*1no olývel {} or higher triggered on {}"Ñ  0òlogging.getLevelName½l "), ' ô	er.name))
import asyncio 0insvÓ

from .case * `TestCa_0
clˆ’IsolatedAC   (	 )' # � ps intenÇñally have a long prefixã  # to reduc  chance of r òhing with user-defined attributeÄ!# » `inheri?Ptest É a  A TheU €s doesn'# ó
ll loop.run_until_completNósetUp()) and familyN 0but• ôs a different approach€1. creatÚ  ø P-runnÔ ò task that reads®m a Â   awaitableá pqueue aI ƒa future2 "2.2 B the
 < aobjectI { !inÍ 1set( RresulT#bAinto [  > b ð3. Outer code put›l  ' ~ 	=  Ao a À J "  Ã  â  – 7forv %  ²Qtrick;ÿecessary because every » c) callE � ¨Anew yRðembedded ContextVa×  .; ¢To share c# Óvars between ®!, nù ðearDown() we needÛdexecut¤±them insideð Asame• .¯q# Note: Y  Ç� modifiesó !nt³¡ policy if,  "wad€instanti­Í 4yetØ  >p_event__D #()´ 3tdefaultm `on demì  ÿn�^ ŽsÝ €I believé !isÃàot an issue in@!r ±E s V �python itû cestingW �should reÂaš  in!ryI  0$uls!by fù ?setù   ™)˜ tÉsModule(JÁdef __init__l€, methodíP='run' Làsuper().__initó__(methodName)
  ÿself._asyncioTestLoop = None% ¤CallsQueue' ( C Q def 
 `SetUp(^ !):   p Qpass
 $ . �TearDown1 Y 0ddA© bCleanu^ ð, func, /, *args, **kw
 x ô# A trivial trampoline to addN Q# theX ñ!tion exists because it has a different semanticsÜ  ê ö # and signature#s õ accepts regularu J 0but5 	û ): —coroutine3 ‡ €We intenÊ ‘ally don'P µ inspect.isD  L * ‡() checkI "fož ` argumö ÷ there is no way4 "toG  = ób ˜ reliablyâ1. It can be "1  ù 5 `()" itQa �2. Class4 Qimpleš ; €__call__?  ? C3. Ry"h õthat returns awaitable object@  Œ .A *(¨ ˆ)‰ó a � M s5‰ 4 ý.D )Y  ¿Mä* ", ñ 	Q RMaybeV & M “C >  ” ÅÀ tÜ¯ y B Ç {@?" * .¿  u9 Ò ° n 5PasserÜ!ît&1, 'ÿ �io test lA  Åinitialized'8Qret =ê(³$ } £† (ret), f'{ù 3!r}©ued non-( p  fup <ª  * é .create_fu¦(ºòp.put_no`((fut,} )7 4 l Àrun_until_co« teC Ú G «�'ifJ§º ˆ! 8  £Œð     return selfó._asyncioTestLoop.run_until_complete(fut)
  Uelse:   ±return ret
 R T def ]  Y ÐRunner(self, R E   ‰ ãCallsQueue = q S 1io. (� öfut.set_result(None ›while Tru° Òquery = awaitc G.getW  Ö { «.task_done  if9 `ry is v Í  <       Bfut,v 3ablß )ry# ?tryK ¯ µ  ? 	7  ^ `if not[Î.cancelled()N  , 8'reá   ÿexcept (SystemExit, KeyboardInterrupt\  Yraiseš J QBaseEV Tion, ÑCª ÎError) as ex´ Ü !z rion(ex)š”bsetupAö ™“Ì yassert •ï3, 'Â õ test loop already initialized'" =ø  new_event_ ]W Ö!  & Ú  " `debug(ã ¹ =¤ � Bfut  Ø.create_futurç	H –KTask6   AÀ Sì æ˜ µ ^™ Ÿ�tearDown¢(  •¦!is'¥		ú û¢   ! =% =»p.put_noy­	n I cjoin()Ø — :"# P all ¨sž 0 #o_  –Aall_* (� » 0 ƒt7 ¥ò	f 1for| O in ;  u ¶(Ô  x  Š •	g  ) :…gather(*o ,›Eurn_!s=3j ¬ !ifÒ ¯ ezcontinu ª B �  ()Y·Z 5 c¢7 ­_handler({ 2   â'message': 'un0 Àd exception ÿ	during test shutdown',
  õ'exception': task. /()7  + 2 & )})t #� © asyncgens! ñ	loop.run_until_complete( É _< &()` ‰finally:P * Ðio.set_event_J V(None:    ‘.close()
C ñdef run(self, result=9 c   €._setupAÐ vioLoop([ +tr‘ àreturn super()ë ([ 4 É j ŠtearDownm ¯ Qdebug± )¤ Œ > ˆ s |__del__u 2if ? �@Test€ is not H£  �/ á 0"""A p case iPmenta°ô """

import sys …functool tdifflib  dpprint $re
 uwarning7 `colleci  WntextM ”tracebackF Ðtypes

from .±  ž ç Dutil ð(strclass, safe_repr, _count_¸ Ï_all_purposeg, �hashableB Ámmon_shortenX ‘)

__unitÀ= True

_sub ð_msg_sentinel = objectðDIFF_OMITTED = ('\nDiffÏñ%s characters long. '“ × B'Set1max< !toñ  to see it.')


P Skipó$(E™Ò ð T µRaise this «R in aô T 0kipU Î0UsuÐ you can use a dCase.sn ð) or one of the  pI’decorator¯pinstead' @rais" ‹ ‘directly.  ¬ Ð ¿_ShouldStopÓ 2The½ s, ^ stopI ÿUnexpectedSuccessP 0wasq ?dnöfail, but it didn't!± ² ‚Outcome( c__initô
ª @ing_s ±ure = Falsen  Çö# =e @_supäs«³s = hasattrA�, "addSub×"Çs, ò {    åzed = []| À bedFail¾  ¸$ @rrorŽ "[]j4@co!. qmanager9  B lÁPartExecutor>,ý_ä@, isÆ =-{ ° Fold_Ë ¾ Ú ð 
        self.só uccess = True
  Etry:   Uyield ú	except KeyboardInterrupt4 FraisS 4 ÚSkipTest as e0 eself.s‘ 7Fal?  … ! ükipped.append((test_case, str(e)))¨ º_ShouldStopr Kpass- 
! ô exc_info = sys. (c  ˜ 1if › ûexpecting_failurà  + ( 2edF& 4 = Y �  , ?elsB &	 ; g _rrors)o + 6 û# explicitly break a reference cycl‘  2 "¿-> frame ->Ï L7Nonç Pðresult_supports_subîRs andr
µ Ë  � ý kfinallóC a   ž � Cold_ ò 


def _id(obj)� ðreturn obj


_module_cleanupq![]5 AaddM C ð
(function, /, *args, **kw
 [ @"""Skcas add9 ,w —Cthe h ñ
 items are called even ifiRsetUp}  ²òs (unlike tearDown Q)."""2 Ç ]µ  § #, ¯ )"doJ « &s(É ÂExecute all %½ U ps. Norm£Ç Ñfor you after› 
³ ² w3ions lwhile Ì ¶   x (, Í - =3 G.pop6I (Ç²  k Ÿ ! EQ1ion&xcŒ %  Ä p2excƒ#ifö  6 ¡# SwallowsX–but first- Ò. If a multi-†   ShandlR { ñ# gets written we sLõ use that here instead.Ø ün Cs[0]¶skip(reason8 pUncondiüë * 0 a óY † l’decorator èO  · �if not is™ Fance& g, type,  0 @ª¦ools.wraps/ g $    z  — _& =perÙƒ /   
÷ú ñ      â _Â  g4kip^ 
& " P.__unŒ1st_‰ _»  M + @why_/ Ðreason
      ñ2  return test_item
    if isinstance(reason, types.FunctionType):/  3 A 2 = 1   W = '' w ¥decorator(@ )$ —   ð

def skipIf(condi„ ,k ˆ 1"""= aSkip aÔ  Ë Ethe 3 ‘ is true.* 2 &if" :  Ô …  v 	� 6_id— oUnless› u3  Ÿ ?not£ )÷ expectedFailureoï q.__unit 5 Ring_f7 ‘__ = True#+ ;¤p_is_sub-(A €ed, base ª
a' Stuple$ ‚Iall(X Q ¤ for e in G 	¥È  Êÿ) and issubclass­ !

 ñ _BaseTestCaseContext:
 —á__init__(self,xH_casÉ   .*  & =% G Traise¢ 2  , ƒwdardMsg`msg = " T ñ ._formatMessageŒ J.msgD ´ Z l C çPExcep`U(msg)pAssertR9 s	()‡ u ,¼¨_regex=Non>b .vä !o % =e 
! – $  %if7 œ  A � £ < '   j (  ….compile] ¢ 4 	£  ©  
¯ °obj_name = ƒ 
    žRhandl , :  , args, kw W ™ !If&  î ‡empty, aÿ`/Warns ñ being used as av  @ c&ñ manager, so check°ra 'msg'ƒ ‰ME …  s‰ pcall a  �able pass… 1pos!alR ukeywordM ’argumentsû ¥ ñ :tryÏ0if u xž ç,>_Û_Ü Y  Ò +°Error('%s()Yõ 1 must be %s' %¦ :  (º‚ s V_str)N 5 ·  Û
Ð   ðself.msg = kwargûs.pop('msg', None)
  ­if kwargs:  * ÿ)raise TypeError('%r is an invalid keyword argument for 'M  Q  ò'this function' % (next(iter(– N)),)µ Éreturn self
j ð callable_obj, *Ø   =› s' >tryï  N È.obj_name = L !._ )__G ò except Attribut#Y Hstr(] 
à AwithÚ I 5 (Ý C, **)š kfinallá ð# bpo-23890: manu# õ	 break a reference cycleK  ­ ! =>ð


class _AssertRPsCont¶	 CBase )É b"""A c,  ‚ ñager used to imple>§TestCase.ac Ò* methods."""ò�_base_typ« n E�1ion¾  ²_str = 'an °Aion 8 »or tuple of "s'e àdef __enter__(
Í  …. 3xit- ,W ¤ 
 —value, tbF i| %  Y ¥0 c   ¬1exc‘! =+Ÿ.expected¨*U !trï Y 
¤"ifw .
²  ¶  ,!._>ñFailure("{} not  ôd by {}".format(| ,¾ B  %z ™ <Oelse¬  ¦ W S ö
traceback.clear_frames(tbD!if
QissubR  •,YÐ) „# let un  ` ep=0s p™ythroughE¨FFalsÚv# storeA  , yEout À ,Ëõ later retrieval[ hR=K _â.J _G (Ô	ü ; ³o_regexü» BTrue‘ ý 9  ¦ j
4 €.search(‰ y¶ )l¥ _­Â¡'"{}" does¿`match  'Çx  ©  ~ ›pattern, € $ø !__' _getitem__  ‹(;ðs.GenericAlias)


có
lass _AssertWarnsContext( £RaisesBase Ò):
    """A c, ö manager used to implement TestCase.ab á* methods."""
N Ð_base_type = ‡ ;ing ñ_str = 'a warning / ¹or tuple of "s'Z ódef __enter__(selfÁ  Å ƒ# The __R ò registry__'s neÌ ð	be in a pristine state fy Aests§ M õto work properly.  . vH ÷
list(sys.modules.values()–  M ÿ if getattr(v, '£ k, None8  < /v./  U = {}�  .ö $s_¿=Bts.catchïs(record=True)E ? = U .}: z !.s*òfilter("always",J †expected7 areturn 	Ý3xitÜQ, excH
 ^G, tb'§ G A ÷ %ife q is not‰ €  „# let unÅ  3 �eptions psuthroughV  5 à  :tryU  › 0nam$Å ] 0.__ %__; ÿexcept AttributeErrorM !tr.Q spfirst_m s=ë g  ×m×� Ö
h Õw = m.message:  ï !if=Ìisinstance(wû
K  5  s=inuJ © !isª @ ( <= w” 
h_regexéI and4  —  C8 ì.search(str(w)å 9 Ð t# store�mù later retrieval‚ z  Ó  @file$� D alineno%  	#  ‘# Now we ÆPy tryýü
choose a helpful failure ;if ŽOÄ  _rŒFN ¢('"{}" doeƒ£  ™'.format(¼  l K ¦�pattern, ¨
” &))!if|A.objq
^Y 
¤ 1"{}ãôtriggered by {}"¢ Ñ,« °  | — ² Nelse¦ À._raiseFailuð%re("{} not triggered".format(exc_name))


class _Ord$ ôChainMap(collections. ó	):
    def __iter__(self   Áseen = set()-   ð for mapping in 3 R.mapsO  "    & k  + 
  " Aif kÓ E .en"  &  ƒ f.add(k‚    uyield kû ó TestCase(objectÍ R"""A ñwhose instances are single test cases.
ï  By„ault, th! `ode itø ð should be placedñ �a method •dH @'run™ 'X !IfO °fixture mayC Pused 8Gmany� ±, create asN  i 2s aÇ Ãneeded. Whenâ @tiat©psuch a …  H 1sub�, specify¾  ç ñconstructor arguments²  Ó " o¾ .‚ O Athat% \ã is to executeû  ‚ „ authors?‰ Ÿ ‘their ownDs. C— 1ionr eand de® 8ionœ  's environÀ 3 ('o‘') can beD Pimple! Ðed by overrid3 
€'setUp' j £'tearDown'á@s re:ctivelyà PIf itú �necessaryW e ƒ__init__G [Bbase¢— $ À must always+@callêIk €importan4at Oe/¤ =Rchang… Qsigna~Ï ir
˜ Gsinc+™ . ª >ð j edÛPomati¢ yRTparts˜‘frameworkL @in o© "cbe runEÁÇ  Œ 6 ¸Q, you¿ seî Óese attribute‚à* failureExcepôô: determines which e P willS0rai€2whe] a Þ 0ce'g0serQ ºsj ;   H  ³ 2thi€ I o `deemedú `have '´ ñed' rather than 'errored'./p* longMV+geÔ e6    " m! �s (incluÌqrepr ofG  � !s sPin asÚ Ä )¡printed onë  ­€in *addi*Q 0to µ„explicit…   pZ dÀ €maxDiff:RQàmaximum length'`a diff‹  r Ñ m +by±   uÂ9 Rlib. ‘looked up cø :1 soU²be configur¡individualåÃs if requireÕ 2""",® uA = AV@ionEÈ'  £Ãr = True ð = 80*8

    # If a stð<ring is longer than _diffThreshold, use normal comparison instead
    # of 6 ñlib.  See #11763. 
Q ‘ = 2**16
 °# Attributei òd by TestSuite for classSetUp2 _ øupFailed = False â_cleanups = [] ðdef __init__(self, methodName='runy 1'):™ ò     """Create añ @anceì 2the˜  2`t will¾   ¥named testH #  j ñ when executed. Raises a ValueError ifG  `o HdoesJ ¥not have aU 1ith4  specified … }È B  ù  ._Ÿ Mý # =K  
* ëoutcome = None G ‘Doc = 'Noú '( 6tryP Œ 3 ­ = getattrŽ)@ fexcept%$
R 'if¾ E != Ë
(  ~ ¡# we allowÁ°antiation wD³no explicitS I�  B   `# but ‰ðan *incorrect* or missU[@ r÷ô‘("no such={ Íin %s: %s" %ƒ  ‡ !  9"._(__Ñ)D:lse¾›….__doc__w 1 
Uƒ "   0sub@ (: ð# Map types to custom assertEqual func„sMio#¯0ces€AsaidT ð  in more detailb Qgener´ guseful� egvmessage%Ç  ©  _e˜ @ity_›  C%{}@ ' qaddTypeÀ ò ityFunc(dict, 'Ú 2DicÞ '‡: 6lis: ?Lis: Utupleu T ” v &seu /Set ofrozen> %5str° ‚MultiLinH&')§` ?,õEobj,6
¯QAdd a%  clUstyle<  /j6 .„  ÛEThis‹s‹ 
 �Case sub� Û`hat neú¥o register5’their own› `‰ éprovide nicer ¦s˜ JArgsÎ ´Ãobj: The dat nPall tÉ  Ê eð  on when both values
   ùare of the same type in assertEqual().; ð&function: The callable taking two arguments and an op1 )alH Ž Emsg=3 ñ that raises self.failureExceF  with aK ñ
useful error message whená › €re not eä â 5"""[ € __& @ity_þ  s[ pobj] =   Þ 
7 ð def addCleanup(B ,# ð, /, *args, **kw
 !):8  ‡"""Add a0 ì Ob, to bt'edÙ Vest iáÃcompleted. F­s– 0ed ð ³óed on a LIFO basi¬%re� ' àafter tearDown6 to —Â or success. Ê ÿ h itemst àeven if setUp D •s (unlikec .).„cP¤s.append((v,:3s, M)„ Á@classmethodÐ —3ass� O(cls›SaHB 1, e•]¢ ó ‡  û C    
Qcls._Ô _h 
 ù r ‹mRHook #  fÆ0ettÁ!upÐ åðixture before exercis& 6it.(Bpassy o +r ¡deconstrucy  „	v zs r ëò H æö `* fó @runnð  ™ s ¦ * "."ó � „  b Œ 	‹ Oall �  ‚ìcountTestCasesˆ‚return 1¿  0 adefaul2 oResult3 r .Z ( p E ±shortDescri¨D A"""Rz æs a one-line d1 ˆ Ü ,X@None-%no=/ ÷has been provided� šÖ   i �a§f $isûsôafirst ˜ %oft  ò‘specifiedz< Ï's docstringARdoc =Ç_× M’5Doc]   H .I ôp().split("\n")[0]  	 O Pelse 
À,idmð return "%s.%s" ñ% (strclass(self.__ R__),  ñtestMethodName)

    def __eq__7 ‘, other):  ! qif type ‚) is not *  . òreturn NotImplementedj  � 2 ==| *._© > ¨ Chashª £ u   &((­ ø 	ù ?strP  "%s (%s)" ]T
š /, s	d ?repe F<%s W @=%s>p \€ 7/  Þ)qaddSkipÂ‘, result,t P_case GasonQ2 ´ = getattr(6 ' …', None)§ 3if  $   G Ç ! (ï 
{ G Jelse5 �warnings.	 q("TestRÃ 0 ha�w mÛ`, skip Åt reported",`  ‡ 
 ‚RuntimeWg 6, 2Ô  ) ù .» fuccess¾ åÃ@contextlib. qmanagerv  ¹0sub¸ ‚�msg=_sub÷msg_sentinel, **paramsŒB"""RU#a _  ` ³ that will ñthe enclosed block„  É Óof code in a ~ 0 id{  fi.  y > õoptional message andD �keyword ¥ ñeters.  A failur[  C ] QmarksU  ê E  t1 as6  x u©°sumes execu€ 1 at9 cend of × H ß à, allowing fur»Ùë Sto beU 5ed.: 5""" #ifpoutcome¾ º1 orê« .@_supZsÆs³Fyiel5 }Ÿu ƒparent ={ 1  ifb " !isg
_ ~ò
s_map = _OrderedChainMap( ÅR" @ ‹ . ­.new_childG ª  x SÔ,µ !am™  :try¾ Cwithø V QPartEÿ!or(.]@, is>W=True X  n/if» s¿
�  @ Ô�•  ” *   #ifB ) -3and .Nfasti  ? ùraise _ShouldStopa ,el�¢.expectedFd	V À     # If thû#e test is expecting a failure, we really want to
  ó# stop now and register theS $edP .> õraise _ShouldStop" 0finx :  x ‘self._subµ ‘= parent
$ ð	def _feedErrorsToResult(4 1, r 1, e )W 1forÓ, exc_info in' &  } àif isinstance(‚ §, _SubTestQ  +   r C.add$ 3 .8 k_case,w )Æ  :   Gelif’ ªs not None”  + ˜ ”subclass(Æ P[0], ü .ÍŸException¬   G ° Fþ° 
   2 ?els�    L �J ë ±AaddEy$edw  µ ±–¶ :tryE # =ò €a }  ¦ e¡ Attribute¬ 
Z �warnings.	  ("ëW0 ha” {  `methodÂ 2porQ¥s passes",}  � 
 ‚RuntimeWs 
oQqSuccess×$ ‹™ 3 ÐŒ †"Un(edb  Æ  F~= 	€ y  ý ‚4a  „	…&Á# We need toÑ  an actual«^�traceback* $adÛ
þ€# otherw .clegacy¸ª can choke5ü GFAfrom6r / v_0 
ü + x
žDsys.j/()ˆh Š)·’callSetUp ˆ  !.s 0  ŒMk5 ,ôª(9 aarDown7 / l #te 6 bCleanu¡ `, funcLð, /, *args, **kw
 S ' (# ü "ru‰ j=åC $if!isË¡" =ëpdefault§(› . ðstartTestRun = get÷attr(result, 'startTestRun', None)
  Cstop  l = get@  ? 8if c q is noth :h  s * (‡ Jelse- 
•  µ 
M Û .L V(selfM :tryL §testMethodà  4  ,  &._! ;NamDif (. ð_class__, "__unit? õ_skip__", False) or°  ù   G  0 � C 
)Æ  B ‘# If the ƒ R or mØ @was ‚ Mped.x   o_why =Ë 'Ë ¦why__', ''Z ƒ  %or3Ø P 	Q YuaddSkip»  ,×  ¾ 6 rreturn  ¢ ðexpecting_failureü ‘i Î@ Û,P 		— 
æ `outcom½ "_O 
' ò  Õ &._B 
 
( ) Swith  .ÄÂPartExecutor\Š 9 b —callSetUpÐ    %ifY successJ ~ '= =  	0 f   Å @, isç_=True\  F   Ö  . ¨( 
z 1   Á 	µ $¨ ŽarDown()ÝÎ ¯doCleanups¤ @for ß ¶, reason inµokippedµ[ _µK ,4 ÑfeedErrorsToR¨(Å,z e A R.if9Ç  ¿V o2edF84  8 Ï AaddEp6 Ï 
  Ø  N   
   t $Un¬ ð Success(result)/
   _else:  - ýresult.addSuccess(self)0 rreturn / 	 ~finallyc ÿ# explicitly break reference cycles5 ðoutcome.errors -> frame	   & 	‘  × ## , ñ .expectedFailurG P 

/ Y W ž ~.clear(/' 
O � = None
W !# J D theº ý, no more needed4  ©#._j Z —¿Ÿ.stopTestì 4if  ¡Run is notµ ¬) "()Ô Ódef doCleanupL9 á"""Execute alló ðnup functions. NormNõ called for you afterÅtearDown.""" 	
Ror _OT©bwhile *  { ¯ ©  C–  , args, kw + =5 G.popX  : DwithÆ’.testPartù "ort
k  5 ‹ 3all>(� *z B, **„ l 6 ## ™Athis.0bac& õds compatibility'ð# even though wefñlonger use it interÔ5 e c".s+ó²@classmetho¤3assË fs(cls)ô ?ass/Cˆ 	Dcls.,a_excepgU = []Ü 
 + _Ê _:   /tr" â(á Ü ¹ $ EÀ H"  ƒ è  ó.append(sys.exc_info()> ¦ __g!__”', † d¯þ¢8run® 'dsO QdebugL 
ì I Ù  ó out collecting êPin a —R”Ü : Mb’ = getattI,Ž! FName�Hif (0 #._å _, "__unit; ö_skip__", False) om eC  , ˆ ? 
ÿ  > A# IfÚ`B or .P was z Eped.� 2   o_why =¿ '¿ Àtest_skip_wh¿y__', '')
  ðor getattr(testMethod, '__unit …_skip_whL 
M ô raise SkipTest(- %)
s öself._callSetUp(@   < | ‡ ) garDownF cwhile L …leanups:~  ø ðfunction, args, kw + =5 8.pož  : V BallCZ (L *E B, **O ò @def  Ò (? –, reason)” 0"""1` this dE."""² R> P ^ CfailZ Šmsg=None\ ÿFail immediately, with the given messagev   ± .a €ureExcep7G(msgÞ ³assertFalse‡ oexpr, � ¡Check that�  + °ession is fE 	‡ 0if # , †5msg­rformatMÂ  š P, "%sM 2notQ à" % safe_repr(O )K P bì ?Truë .:truq0if ²  Ÿ î % T í 8_\  ÖÚ, standardMsgkaHonourÚClong— Póibute when generating \ƒ%s.÷8If C 1is c%GmeanÕÐ* Use only an1TlicitU ` if it…providede €* Otherw´1use¹ Ý ? "foÒ éy 7¢  ½–  gS € /If³ $s ­ ñ, plus ' : ' and¥ 9expä R :S ¹.L¢  Æ `return®8 orÚS !if 0is \> á 5Msg7 :try, ò# don't switch to '{}' fÕin Python 2.XI  ¦ #Âqchangesñway unicode inpuàWhandlß : à ×'%s : %s' % (¯ Òeå" UZ  De` ZErrorË U  V d` '),| 9:R2s;bected_‰ ¥Y‹ 1"""ÝbunlessI¥ð of class expected_exöception is raised
  ð!by the callable when invoked with specified posiJ Yal anF ökeyword arguments. If a different type of ex� ˆ š ð , it will not b˜ Pught,p ¨ ’test case& (beD ñdeemed to have su} ød an error, exactly as for an? ¦unexpected¦ (.
" !If)	9'anÿ ’ omitted,§ ˆreturn aL ùcontext object used like this::x ¯�°elf.assertRÌts(SomeEU():c 7   édo_something()[ AAn o<al Æ  'msg' can‹`providü  #„ t "isË Zas a ä 
LTvÀmanager keep8 !re6 ceÌ f6(asn   ' ð' attribute. This allows youJ  inÌtIE @ ` after  ß ?ionŠ ‰ c/cm�Ž ¡ Fthe_’ U= cm. ¶  3 siEqual(= .õ•_code, 3)= 5""" ¢G= _AVC™(’  , u M :tryå ìY ’.handle('Q´ ',)–s, kwargsM kfinallQ ð# bpo-23890: manu# – break a +Icyclb= None÷3defÝ`Warns(Î  ù°_warning, *š C, **¤ å Ð"""Fail unles®4  Þ`class  C
 ¯is triggervTw “ Zing i?œ x·�d: depend; !onUother@!  î    `filter
 ñ rules in effect] AmighÒ`silencZprintsout, or¨ D ¼Þ
A�zM Œ 
 ?ingŠ] w ÜÀ  is used asö a context object.

  5The  ø manager keeps a reference to the first matchingG ¡warning as) ' ò' attribute; similarly,$ ˜filename'I ·and 'lineno= ñs give you information aboutM  2 G ñ
of Python code from which. ž   w¯ ˜riggered.@ ±This allowsv ’to inspeco A QafterS Passer• )::` j¢with self.&  Warns(Some
 @ing)88cm:‚  9   €do_sometr,()" Dthe_� S= cm. ( ~ gEqual(9 .` _©V, 147i 5"""M IA= _Að  À "sC_0(ex $ed‘ ,ô J Pretur‘Ž—.handle('°', args, kw )JBdef % PLogs(Ë @, lo¶Á=None, level )DÐ"""Fail unlesÏâlog message of5 ! *< õ* or higher is emittedø Bon *q _±. òits children.  If o6 ,T µdefaults toK PINFO åQ '* & JCrootß «‘ ð od must be used:âÂ,b –will yielÉ  Ô@cord« �6twoª±s: `output`H 0`re4 &s`"A0endJ ‚   G  • ”be a listF [ ä0ted
¶s� 5theA › ¾ b  
Z ‘corresponü ALogRÕ J sr|ExampleÐ0 „Í”T'foo'ˆ'ä'Ô I�ing.getLÅ(>  ).Ú#('d¨'>   ? ô.bar').error('second7E ¼ 2cm.ï1, [¼ Z:foo:ˆ ,) „  
`'ERRORD  • :Œ ]Ò ZÐ# Lazy importoSavoid  ®÷ ` if it¤ˆnot need¹ç ._éJ ¨ ¥§É �" 	bÕ@, noX }s=Falseš Noc 	: �?  
œ �*noèŸ?are À or its chilƒdren.

  õThis method must be used as a context manager.7 5""" òfrom ._log import _AssertLogsCB - oreturn"  ð	(self, logger, level, noX rs=True)¶ ‚def _getd ÃEqualityFuncC õ first, second):{ ð"""Get a detailed comparison functi	 ò or the types of wwo args9RÉ ù
s: A callable accepting (… õ, msg=None) that will˜ ñraise a failure exF aon if H 3 !=Ï p with a£–ful humanI 1eadˆ ñ error message fÒ #osÔ Å#F ð# NOTE(gregory.p.smith): Iôsidered isinstanceë  1(u)N ó	and vice versa.  I opted˜ eV ÷
ervative approach in caseI ðsubclasses are not intended to¹Ð ž nå  ·their superN K  Å @s us¸aø# eV3.  &pans tesâJ 0subü ðs won't automagiy©Bt ¨.  CallersM Thould7 "ir� �specific ÿ artSpamùº#toÌ0iÇ…  € is desiÔ ª€fpriate)R# SeeÇ `iscuss)÷in http://bugs.python.org/issue2578B ã  ‹ #yp6)  =9®  î 0er ÿ@lf._+ _�_´`s.get( ˆ){ B #if3 erk  4 ‡
g ) Óy W, strC *  $ £ = getattr€ 
Š  7 ý! Ð  g._baseÝ& ö p #ðkå ã"""The defaultA implementaþ qts.ë!ifwr   =– di  Ì  ÐdardMsg = '%s¾ò%s' % _common_shorten_repr·¿ 
4mC rformatMÔ@(msgœ#anj 
8 R8 UET : I‹N@Failž)’wo object˜!un¡ AÑdetermined by@E'=='¯   operatoZž 1ionëý•Hðassertion_func(fþ'irst, second, msg=msg)

    def assertNotEqual(self, f6 aNone):7  ; ð"""Fail if the two objects are eM ñ as determined by+ E'!='G Å   operator. 5""" bif not‘ 3 !=É ˆ  Œ @msg  ñ lf._formatMessage(msg, '%s == %s' % (safe_repr(å %),k  K  L `9)))N `raise Sð.failureException› †_Almos‰	pplaces=ŒÌ
 	t 
Â Qdelta0 ¼/un¾(irm ñdifference rounded toåò	given number of decimal Á D ð
(default 7) and comparingK €zero, or< 0hatf G ‹ pbetween" 	˜²is more tha ¥ 	E  ..H1Not2 tÃ p (from ¡ )òqusually® Hsame\ ñas significant digits (measured O  9  + )— Iw {"thðy will automatic¤ — 6 a{¸Š2 Lï
†¨# shortcut` u return ialta is+ Áø 
_ LñTypeError("specify ã $B  /Sboth"_ É b = absö# -I°™ 
‚  " biff <=t 
  g ì í   ‘standardM¥ Œ!Œ� within %# (
 P)¬	I M ½“à# ; " 7iffÕJelse÷ #ifÔ º Í
  µ ˜9= 7Z ;6(ž,G )_0E [!rT  \Wì t

R¼>«WÀ
    def assò(ertNotAlmostEqual(self, first, second, places=None, msg
 /
  	Qdelta) %):* ð"""Fail if the two objects are eƒ ð as determined by+ %irD ð	   difference rounded to' ó	 given number of decimalÂ D ð
(default 7) and comparingK €zero, or~  0hatf G ‹ pbetween" 	Ú ²is less tha ¥ !(.
M @Note' t¸ p (from – ))¡usually no‘ X sameI ñas significant digits (measured O  ‚ ù+ )— O£t ¨�utomatic‹ Ufail.„ 5""" i‡alta is±  GsW * [ñ
raise TypeError("specify ; ŸB  eboth")u  ˜q = abs(Í# -Î# ˜ 
� !if± B $==C ¾ b >Œ 
7 ¼ Ueturn�   ðstandardMsg = '%s == %s within
 Ø 7(%sâi)' % (I M ‚afe_repr� /)," Ç# 
z " Fiff)=Jelseö #iff Ñ ä
  µ ¯9= 7® g
á(mˆn) != 0^ rsr³ dsS Ä  K |H  % 5))m@ ©÷._formatMessage(msg, g¯K4  ©ÀureException6 ^ àdef assertSequ`@seq1'q2Ÿ seq_typeë "AnÒ3ityW Àion for ordeˆsg °s (like lis˜nd tuples‰1For[€purposesß�this funcÉ �, a valid_  ¡  —&on'ñwhich can be indexed, has a length,è Ê ‡operator$JArgs� ,R: TheK &P ]Qe- æBseq21 22 y6 Ñexpected dataï odcÐð None if no
      ødatatype should be enforced.
, ù-msg: Optional message to use on failure instead of a list ofI U ¶differencesj 5"""- qif seq_ž Åis not None:!  J " u_name =2 !._ )__. !ifG  is¦ ¥ance(seq1,6 )]  a ³raise self.ã AExcep('First> uÈ  ¦ ™a %s: %s'|  M   % ‰ ë · °, safe_repr I1)))L È 2È 'oSecondÉ O2É ?elsÍA"seqZ%"
ÿ 7Qing = :try¾¢len1 = lenD* eÁñ (TypeError, NotImplemented x øP%s ha™ d @gth.ßDNon-· e?' % (x    	¸)ß 6if j !isã 
× è  S Flen2ì 2.ð " V Š 3= '$õ ) T ù '11 =æ2 [ freturnL  	Ã 3%ss^ Ÿ� != %s\n¥ 8•ÿ.capitalize(),) +Ùö _common_shortenÄž'2)ì   ðfor i in range(min(¸,S+2)„ 1 ÿ  @itemð Ò=[i]�  QIndexí e   SÁ+= ('\nUnabliQ " eH! %f$i–  Q 	 !(i)wû- Zbreakì  
 #Oseq2ys{ IÀ            ±if item1 !=	 O2:
   ödiffering += ('\nFirst  ò element %d:\n%s ?' %N 	a ñ((i,) + _common_shorten_repr(œ ,š ?)))N Ybreak NelseÈ ðif (len1 == len2 and seq_type is None 	L ¬  % `(seq1)+ >2))i  3 P# The^ Àuences are t ×ame, but haveA R /s.{ yreturn
  ifÄ 01 > µ š	±ù%s contains %d additional '_  Ã 	 'á€s.\n' % 9!_nÒ Y-� § ?try'§ Vcextra q RNãr2, safeC ´[ð]Aó	except (TypeError, Index bNotImpÜ!ed ñÊ °Unable to iO Î jwQ'of fc Lq Ã ,Rwj$el<‰s¥ Ÿ\nSecond I!2 1­  ç \121�s³‰ zÖstandardMsg =oí  'P  +  e.join($  « ( Plib.n	 ð (pprint.pformatù1).splitlines(),=  A  = 2= &))ì
À ÷self._truncateMessage($ ,ã 6Msg+mú : ° 8 Wmsg, = 4 . `fail(mK Í Ndef { belf, m‰ }  @max_01 = R qmaxDiffO  5if # € or¼(7 E) <=! 
Íy ! +÷ X  ð(DIFF_OMITTED % len(diff))ò

    def assertListEqual(self, list1 Ñ2, msg=None):7  ; A"""A& °-specific e@ 3ityS Bion.g  0 FArgs>   c ±: The firstN Å to compare.l . 2. osecond/ ðmsg: Optional message] òuse on failure instead of aR )ofx  |   ·differencesÖ 5""".  9.N@Sequ+ Ré L°, seq_type= )&�RTuple<  U 0, t 1 �( ‘&> 1d’  6“ 
” 1 •K ¦  ”© 
R– —)Se# se"?set‘?set�& ` �?setZ † , - 	‡K5ð uses ducktypingË „support \ t s�•sets, andO ðis optimized for #  }ôally (parameters must a aF k ¦ce method)g9:try®9 01 =| &1. (€)e úexcept TypeError as eO  Ø.…‘('invalidü Ð when attempt& Èh �: %s' % el �Attributq Üöargument does no.t á 221² …A)!ifP(¹E1 orç7ce2I ³breturn  ¥lines = []s'if@ 1M/ õ.append('Items in tZ Òàbut not the se—cond:')
  ù	for item in difference1:%  0 ðlines.append(repr(7 )N 'ifA 2A 	= `'Itemsq `the se— Ð set but not  _first­ l ­ 
× ñ	standardMsg = '\n'.join(ª Õ ¡self.fail(
 ÷_formatMessage(msg, J 1))
a Ádef assertIn9 ð, member, contain –msg=None),°"""Just lik2lf.G `True(a31b),(òwith a nicer default m˜ A."""ˆ  #if| [&in‚ w  ( Ç  !%s0 Pfoundx Á%s' % (safe_þÑ %),i  E  E H D mw(/Noz< —?in ~(zßunexpectedly ƒB e/  ‰O#Is pexpr1,  ?2, û s}" p 21 iÍ  2ö, ð = 1ïa ? 2æ<_IsNot`7 äá! Û d 	 `	Ù¿identical: n‰ ±-‚DictEquaÍ, d1, dŽk |@IsIn1ce(1 pict, 'F ” argumentbÇa dictionaryiN !2,/ B, 'SO k ko1 != doð %s != %s' % _co÷mmon_shorten_repr(d1, d2)
  ð diff = ('\n' +  `.join( Plib.n	 (4 ?   ÿpprint.pformat(d1).splitlines(),< 2< *))® ÷standardMsg = self._truncateMessage($  , ½ C  5 Rfail(? ¶ = Wmsg, B 1))
¿ ñdef assertDictContainsSubsetI 1, s  s ñctionary, msg=None):F  .ô"""Checks whether di1 ó is a superset ofU E."""A �warnings.	 /('–  L Pdepre/d'†D# BionWY * ·stacklevel=D`missinŽ%[]£ ×mismatched =  ôfor key, value inà gitems(& * if- @ not* &L &   … º.append(keyôCelift '!=p_[key]O ¿ R ð '%s, expected:  `actual 5' %ú  Ž  R(safeˆ   &,  (T 5 Æ  *† !if6(F or “fbreturnæ f ýX = ''U P 
21 MB ','Pº 0m) 	Em in]  z  † ã'ifß 
� (ifÎ
  p ½ f+= '; ñ   MÚ¶sè iUuv’CountEqua·ÿ , first, secondiA²ös that two iterables have the same elements, ‘number ofŠ  ötimes, without regard to order.î  - ]œ· Â �er(list(¾ )ó	3 ê 	çŠ Example×ð- [0, 1, 1] and [1,  °] compare eH.Ø  ¯ 5 ' 5  2 #un4 5 ’Î D_seq�  7 = ë , Å F :try½ K � = colle$s.  [ ú » T 4 Àlections.Couónter(second_seq)
  õexcept TypeError:  ! ù# Handle case with unhashable elements3 ðdifferences = _count_ ð_all_purpose(firstŠ /, – :lseŠ 1if 4 3 ==2 
   ® oreturnŽ Æ ‹ G 0if ¿ Ô 
v òstandardMsg = 'E õ õs were not equal:\n'U  ¯ 1lin$0['F¡ has %d, S§ �:  %r' %„ B for	 !in • ]X  ® ‘ ‘\n'.join(l ö  
¼ ÷self._truncateMessage($ ,q :MsgF mú > dformat< Wmsg, A 
8 2 `fail(mS Á ðdef assertMultiLineE:(- , 0¶, msg=None)“A"""A@ ° that two mJ -ÿ Â strings are’A."""y  ~ @IsIn¹ c¨ Ç 3r, §@argu÷1 isÝaY 'á  ° .L éM æN › ü!ü±# don't use¥£lib if the› ô …too longX  ÷ rif (lenA) > ¼ ±ÉThreshold or4  8  4 Ñ 5 — 0   [ Bbase¦Ý×	×I 6    Á P a.split ê(keepends=True9 Ÿ '  9; 0if á n A )xR1 and‡.M�p('\r\n' , ‹ º    C A = [ z + '\n'µ , 
± [ .  žx€%s != %s(ò_common_shorten_reprÞd
& . ¼0\n'k 0  Plib.n	 ? Å D  )J 
• íQC  …? R!)
˜8CLess.Oa, b%’Just likeîª AÂ(a < b), butïòa nicer default m	;#if	:< b
"'%2@less¢n³R(safe©Fa),  bbÀ))

    def óassertLessEqual(self, a, b, msg=None):
  Ð"""Just like , .A õ#True(a <= b), but with a nicer default message."""S rif not = j  q ñstandardMsg = '%s* àless than or e¶ ö
 to %s' % (safe_repr(a),  5b))r [ relf.faiò ’._formatM  g(msg, ~ 1))
> Bdef ñ Greater0,>/(?> b.g© 1%cZ1>Z) = ,]h Isw\?obj‹}Same as‰pobj is E /),Š:  ‘ > 5i’ + ~_obj),s; tk óIncluded for symmetry	ñ L nˆþ  d ú 
Áunexpectedlyf' X  \(@IsIn}(ceê ?cls4isiI FKcls)¹ £O (
 %s‡ M4an ‹ o of %r/   ‘ J1?NotM<ŸÈ!$]À assertRaise÷sRegex(self, expected_exception r) ?,
  °*args, **kw
 %):, õ"""Asserts that the message in a raised w € matches  w %.
L FArgsZ  � ¶ 4: EÁ e classÚ c to bep .U 	G é !: õ (re.Pattern object or string)W 	I  M   k Pfoundæ Terror÷ 
{  /`: Funct¤ �called an€tra posi  0al 1 
C t ù  +  
" amsg: OÖ$alˆ   uxðin case of failure. Can only/ % ã awhen aÛRÃN2 isX aÁö context manager• 5"""U % 2= _*O C< (ã+, ³¶)Q sreturn X �.handle('¬ !',M", 3)i3def× BWarnÖ $warning"!(£triggered w "pXsBasic fN0ing�psimilar\Ù q() with‘1add_C«t es whos»bs also‰ B @regud ¥expressionL 0areŒ1sidÅ ¢successful? /esâ‰  : ¾  Ú Þ- �E+áÿ s
 P  à(N ßàÝ*Z ½Ü% × £Ëš msg=NoneÌAFailñ test unlesÙ e E Ñ! .öÖif isinstanceå ç, (str, bytes)�  ËÃ_2 "ã� must notÄaempty.rÀ         exp÷ected_regex = re.compile(exp 3)
  zif not  å.search(text):,  3 ñstandardMsg = "Rj ñdidn't match: %rS ùfound in %r" % (G  K t ‘pattern, v 	. ô# _formatMessage ensures the long Òoption is resñ 	I m¶ Zself.R g(msg, Ý " « araise 8 ±failureExcem  : !)
f Ñdef assertNot(3 Ò J, unò §, msg=Nonedq"""FailÚ stest if xa÷ pregularº±ression."""ˆ  ² pif isinÒ >ce({ Ç(str, bytes)  ; - 
I )ÿ- =è 	N¡ 1 _	'EX!edZ4  ese['[ C[+ ¢.start() :G ….end()],ˆ  ò   Ø .�*  ] ö  <  �Æ  ¡÷	_deprecate(original_func ' & d À(*args, **kw
 .  �warnings.	 êð'Please use {0} ˜bead.'.×
Š ®.__name__)¦D½ BionWt :, 2�yreturn Ý ¿  º . ï Ð±# see #94240  ûÓUnlessEqual =î Gs = \ Ÿ  = !If 9 1Not <  ? | RAlmos8 I  L   O 'If K 7Not N 
# Q   J _LTrue2 R^j  0 /IfT CFalsU w7 =p1   \ 7  Í pMÆe�  ! 2 è5 	$ ð )



class Func©”TestCase(	 WQ"""A þc7Âthat wraps a  ± A ð.

    This is usðeful for slipping pre-exist òtest functions into the
    unit  Àramework. Op) ðally, set-up and tidy J Rcan bH ðsupplied. As with TestCase,l = Å('tearDown')” Q will� ñalways be called if? ‡ x('setUp; ñran successfully.H A"""
	 ðdef __init__(self, ï AFuncÝ `Up=Non¥ —  adescri	 !):O  3`super(B  'ç  ^ %).m )1 Qelf._º  6   =V+Up  #  & %st"  " º 7 =  ‹ × 0if Â © pis not !ÿ 
Ò &()\ ¸ _ ! Æ b , e 0runxd À à1 ,id, creturnó 3 –.__name__Ð E__eq;Zother4 !±isinstance("  Z ó‡_class__2  >{ âNotImplementedr  Í «+1== ] ¡ —\  = %  Ó g< RÖ? ] w %7 	o:  ç –Chash["  b((typeºT Ò ,KÀ 9 – )Á___str— ñ"%s (%s)" % (strâ¢ %._ï‡ �  as	ƒ ?rep„ ¿<%s tec=%s>ˆ (� 1‘ ˆ fshortD
è «3K ÓÙ�2 ´1doc ;­….__doc__% F  ,  þñdoc.split("\n")[0].strip() orº1


¥Q _Sub6   š():Ž$!_c¾÷ message, paramsÿ 	ó; 3 = 
 Æ  ä e ! =• 
# t # =}  Àlf.failureExóception = test_case.failureEx ñ	

    def runTest(self):   ðraise NotImplementedError("subY °s cannot beE ¶ directly")] ¡_subDescri“ e ¥parts = []x 0if Š Ð._message is e  J  v Ö_msg_sentinel¯  ³ N ò.append("[{}]".formaÝ S -))n mparamsO õams_desc = ', '.join(=  t   …"{}={!r}n Fk, vd  #   Qfor ( 2 inå w w.items(—  / 
Î E({})` 7 š 5 ¢return " "¨ A ƒ) or '(<´6>)'�,id�C F{} {Ï �|KRid(),À  •ß)ûXshort  G aA"""R² Ðs a one-line n-ƒ of the » ,Ê ¥None if no†2 õhas been provided.' 5""" ç  ‘ .Ø ± Í __str__0!+ð """Loading unitŠ  s.¨ ¤
import os
 $re
 %sy ”traceback Etype …functool ówarnings

from fnmatch l  ,  ë* .$   ô, suite, util

__» ð = True

# what about .pyc (etc) óe would need to avoid lí1ame·ñs multiple times
# · Ð'.py', *and*  ð%c'
VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', ñIGNORECASE)


class _Failed í .
 CCase¸_¤pMethodN©  = ‘Rc__init(1, m* „_name, e{L  ä‚_ & =& ­gsuper(š Q%).m g 	³Ugetat· , ˆ }  G Å #!=Í
Ý 
3� n h À  d Z  [Gure(‚  h	= w @ 0


R `_make_Ö2ed_Ã�(} ¤CÔo N0= '‰ 8 oö module: %s\n%s' % éT oU ¸µ¨ 	–  µ � IÐ?Š  C I¥  +î)Þ   Ü sN 0è Às):
    messñFage = 'Failed to call load_tests:\n%s' % (traceback.format_exc(),)
    return _make_fM @  (
   ÿname, exception, suiteClass, message)

defF  omethodC :r  ¼ B = _Ø _Test(D 	¾ ’  ((A 5,))› š bskippe!W Þ )’ `@case.; U(str(	)ƒ  ø  t S\ S(self:  >ApassÙ –attrs = {Ï ': 9 }&  ñ [ó  = type("Module^ A", (� ( qase,), Z � Î*  ­ñ 4),)²ójython_aware_splitext(pathÅ 0if  ð	.lower().endswith('$py.cZ '+  ð ‚  3 Q[:-9]Ö  0os. .g a[0]


I  ­ ÓLoader(objectZ 1"""I RThis + ñis responsible forý1ingV�s accord ño various criteriaN Band › & phem wra"Q in aŽ Sí. „  ´M×`Prefix†  '& @sortÆ " 0sUs[ ‚= staticûò(util.three_way_cmp¾ F °NamePattern.BNoneX  ˆ à.g Ÿ ñ_top_level_dir = ; <  £Œ__init__ `super(K x!, Á.0 ›  Û  Q.erroÈ[Û  ñ# Tracks packages which we haveš±ed into via¨eQs, to£ G @avoi( f¬ åe re-entrancy.& † _èEing_r �= set()
(  ñ  "  × PsFrom	 ACaseþ ,!  Pc ‚ Q"""Reaæ@ of W š y‘s containÐ 
I ! J �if issub¬”p c¿�  ; °raise TypeEl ("½ } òshould not be derived from ! A  E -ð. Maybe you meant<J I  Ì &?"    ½ ¶¤!ge	 
= !ifÐ 
D  ›0hasÛ
8 `, 'runv ó 
A 5= [) ª 1ed_@ 31lf. 
L(mapn 	V ó n r(Q |Ñ# XXX After P]Ð 3.5, remove ˆñward compatibility h@1forÀQ# useä'ð deprecation via *arñ4gs and **kws.  See issue 16662.
    def loadTestsFromModule(self, m ò, *args, pattern=None,X !):G  K ó+"""Return a suite of all test cases contained in the givenh 5"""M ñ# This method used to take an undocumentedä §unofficialB @use_Ü _� Qs arg3 ø.  For backward compatibility, we stilI aaccept° E ñ (which can also be  ÷first position) but we• ‘ignore it¸ ��a depreca4 ò	 warning if it's present° ipif len(”ª) > 0 or 'í '`6kwsž 9 Z  s.	 (3 5 is‡ V¬ 5d',À  F 
 Dº W¹ ).  |<popn 0', F, Õ 1º ò # Complain abouŒanumberfÛ!s,q±don't forge* 	‘ Ñ# required `mà`	*   s 7t =q9+ 1& ðraise TypeError('sO)»5s 1%alv ´ c{} wer•'.format(ƒ )*œkws) != 0*BSinc�ukeywordi  pe unsor9ù(see PEP 468), justÚ a# pick×ó alphabetically A í!toL 3¦
8#Ò‡multipleí ¡.  At leas­  eGö  message will bB ~#†dictable  1# =¦ ()9[0]Û µ"µ go§€ unexpec4So '{}'"¯	}6= [‚ €for name¥Bdir(‡K Ê Äobj = getatt# ,7  (  'õsinstance(obj, type)`bbclass  †.�KCaseq  M ­ q.append.:  M 5))
S % f³  öp  «Aelf.5C­  è  2oadE  ©1not@
ü:try  Ó r”£ Ø ,–Ôl  4 !exñE Žion as e[ ª_T,¶_¶ç= _make_failed†(4 h  0.__p__, e, ‚
¡  9 ! ƒ s²àerror_message)+
  õreturn error_case"  atests
 �def loadT ñFromName(self, name, module=None):4  o B"""Rg ð a suite of all \  u òs given a string specifier.{  G 1Theg ó	 may resolve either to a~ 6, aY • class, a� t Àmethod withiv   ‰ 0 õor a callable object whichI  @s a qCase or Sä ‹instanceÂ { •optionallË 3s tá ¢s relativeØ \.€ 5""" qparts =µ.split('.')  ß,ë message = ­, / #ifL1 is Ì ‰n �_copy =  5[:]=  " Rwhile ( 
@  " >try   ç _PÁ = '.'.join(g L Ö  /  7 â = __import__( K 5 Ybreak¹  O �except IG Eª Ðnext_attributJ¤ _.pop(t b# Last†¡ so we can 0 itñ æuser if neededõ    Õ	Ä_make_failed å(î N 
Î  , ×.®CCÍ  ¢ /oté
` 0# Eâ Ý ¢top level « ¨ @: reºC tha!ù  S Ÿ ‘s.append( _Ù°  : ¸�
ò  Ä×1ØSobj =F1forþ 1 in s+æpparent,V  = P, getIQ(obj,H 
¿ ’Al•Z as eo  Á 1# WRò 't traverse somŽ y ‚ ^\Iif (Š ¢'__path__'!)1not v  7andZ/ -   `# This) `a pack”D(no z   p	‹°lib docs), g w« I  ó # encountered aÛj[oƒCing.* Ñ OtellÑ #–ðdifference betweeî­ `.Wrong	 + ž L â  .w5 _ 
Fjustá š  -5áis more inform:ÞÀ           sñelf.errors.append( ¿_message)
   rreturn * Mcase& ]else:  K ð# Otherwise, we signal that an AttributeE• ï has occurred.P … ,‘ » ÿ = _make_failed_test(C  —  part, e, s¿suiteClass,2 !'FX Ä to access a¼ Ÿ:\n%s' % p  t ÿ	traceback.format_exc(),)u™ î «+Ñ úif isinstance(obj, types.ModuleType)ÄøŠ ÒloadTestsFrom2  D ¼ /ela À) and issubcc 7  , G.Q ?Casx 0  C z (Ü �FunctionÞ  ‰  ’ bparent´ + Â + 
Å >pname = jYs[-1]O  ˆ @ent(+ Ð  š ð# static methods follow a diffeª Z pathU Xf notÔ 0get¦(o !, g á )s.
ø � ü ([J ]¬ ö0 ÝSYZ 5obj½ ¡if callabl™1  Êv = obj(y  ¤ 
q ' /, |  6 €  / �   Ë  ! ¨ 6 N $| G ([> ( + %`raise   ("
ring %s ] aed %s,Û a X 9" %º  ]   #,. `‚ ~ àdon't know howî UI À from: %s" %Ž!)
† Idef `Names(sAs, mcH=NonìB"""R[a¸r of alln  ] ø`und usöthe given sequenc‰`of str% ýspecifiers. See 'œ 6()'\1"""Æ  @ÀPs = [½ .9  AÍ Q) forS1 in sã¹](a 84getÔ6 å L	1Uorted
 ;,Œ 0 fo9ðwithin testCaseCclass
  5""" õdef shouldIncludeMethod(attrname):+  > tif not  ò.startswith(self.testB kPrefix?  C Éreturn False\  <  Func = getc ( PCaseCÀ ,w )8 ” �callable5  H | ñfullName = f'%s. Y' % (k  À 	” Ü.__module__,  @qualD   Ï   	O 
È H � ùPatterns is None or \D  “ ôany(fnmatchcase(Î 2, p@ T) for O in e �  Ê  Fn� ÿs = list(filter(, Q, dirv«&))L "ifn UsortTjsUsing]v .. ò
(key=functools.cmp_to_keyl # Q x OU 
9 ò`discovÏ Qelf, ÆE_dir1 ='8 ð*.py', top_level# =‡[Ã"""Find and s 1all òs from the specifieds �  Áðdirectory, recur” into sub €ies to fn Kthems M  º €s found š in| rm. Only™ 0filM Ahat 6 ! EwillM Ábe loaded. (³Å shell style3 E Ring.)d Ô Aàmust be import«Atop c2 of� uroject.‰ I « q0  ‘ ]D 2yK þ  ÄK i % ™ ž¦eparately.Ñ BIf a?€package Ñ& (I  n  '__init__=)`mî–ž Q  { #qchecked¶0a '‚_×!' uion. IfÒ ²this existsU 5it L Balle
  (J "er«sîg) unle" O” ñ has already had�  s ¦ ß B\yž °invocation,|`which © ¬  h mH0 obøØPscannc %orO 	2 - õ Ansur_•at when aR Tuses � ;VurtheJ  QchildÜ @`at infÅe�qon doesýjhappen Xe‡a y> S*not*S eàj,â N áis responsible  Ding gsUH š À   The patteó.rn is deliberately not stored as a loader attribute so that
  ð*packages can continue discovery themselves. top_level_dir{ j %soO  p ±_tests does� ðneed to pass this argument in  5 4er.u E().
Q @Path1  º ñrted before being impo õto ensure reproducible executionP  orñeven on filesystems with non-alphabetical 0  k 0likP Ut3/4.N 5""" õ	set_implicit_top = False! .ifBàNone and self.7 
b Ð $ :F  ¸k# makeN  opé ñal if called from“Sin a ò	Q 
Ú=Ž 0 /elÉ 
¥  6Tru É x @tart^# °os.path.abs (  )8 !if}	  p"syA 
­ `# all ¹ó modules must bedaOP!thz 
¥ directory  Ø ò# should we *uncondižply* putX  sî B  ž Ffirs�K 4in µ  .�minimise ’�lihood of¼ñflicts between inst› á  wdÏ!op�™versions?0 { ª.insert(0,x). Ã=- ŸAs_no11ort]/½s_namespaceL ªes = [] 4if disdir( *o ]*))ý % =C 5 i  –"if¾ O + !æ 
^ / î   Û£  isŠ² Ujoin(– ö, '__init__.py')rJelsem P# supG forÇº0dotB  ]	Õ :tryN  » _ÕVort__’ ‚  " �except IŒ^ErrorF i Ï  _ Cthe_³ =	 %s[! 0    öfpart =§ß.split('.')[03  ý  L g  	? -  Ø0dirg&((Å 0.__ì7__)É7  KA¯NÀ         # lÿook for namespace packages
   Otry:  , ðspec = the_module.__ /__3 ÿexcept AttributeError^ _None
P 0if n A and	 °.loader is 5 Z 9 B.sub¸ ð_search_locationsD ?notH  6is_K_= Tru®  -    }zpath in:  /__¶  =   @if (œ ðset_implicit_top( 5   =  m ÿ.startswith(top_level_dir))†  Q �continuev Pself.¤ d O = \8  e (« Yplit(j wj 8  ò.replace(".", os.Y �ep))[0])� Òtests.extend(Ò Qfind_ ¦ ,D • 	 patternG - Û=Ž)Ú Jelif€ 7  __—³sys.builtinÙä## 0  Q	’raise Typþ`('Can ‘;useD ?s 'G 	7Ó   'as dotted� àq') fromÇL OelseÖ ­ C ‹ ò'don\'t know how to discover† O{!r}Ó h.formaè)Â €  ÉÎ !ife­)  Î Ü	®3 0get?pectory_cainingEeOpart’{ y—aremove2 —  3 Ã ËèQ R 0if oSkortablaImportº0('S@B dirò 5i$ B q %r' % i )Ê“X~ = listpS #, 7éqreturn –ð suiteClass(testò$s)

    def _get_directory_containing_module(self,  q_name):=  A  r = sys. "s[ + ]* ð full_path = os.
 @.abs (1 “.__file__�  ` %if- @base~ (J ÷).lower().startswith('__init__.py'ª  N ereturnR 1dirQ �  a )¿ Felse÷  M ó# here we have been given a-° rather tha Åpackage - soX J 0allI õcan do is search the *same* ¢ 2 * +inL ùshould an exception be raised instead4 - 5Q_fromÐ  Éo0if  @ == @°._top_levell
J€ 5'.'— < ô	 _jython_aware_splitext(±@norm* ( )7@_rel l + ,” ì¥assert not+disabs(W P), "PË@must] z!inš…project"Ë N @ 	°?..'P Q  5 = M ureplace†sep, '.'Ñ a 9 ËHÍ  Í  Í±__import__( ‹ Y ý ! ]f \match)%, ],(Gternp ð# override this method to use al/ aative ^ Ìing strategy› !fn# ÷0pat< *þ£find_testsü L ¥š  , Õ ¨space=Fals@"""UXpby disc¸  y. Yields W ö suites it loads.""p# Handlç $e ¹ J3is 1Ó  †  kAelf.¶  ¼ í(º ú#»  (•'.' when &  œ	–@ (anf© : bUP# def_ U  a¥ %).§ "ifu  !=† T  © P#in{  dä s· 1 V whilAcallßt\ j TàQFromMÓ °¥ ¶  ‰ °2s, B…_recurser*Îð  :   Y9“ + !ifs_ G;Non^ & yF) 	m  a+ot§ 
A ? A# Ei€ àrror occurred,û or load_tests was used by the
  ­# package. ereturn €# HandleG – contents6 õpaths = sorted(os.listdir(start_dir))M @for 2 1 in %s:  ¡ Qfull_  P= os.
 V.joinL ,7 Q  6 ò ð, should_recurse“ ‚elf._finY (p  > t [ ú tern, namespacei 1if l Ê is not NoneÁ  Q Ryield) 	m +if£ ; Ä# we found a¡À that didn'tÓæ† x    ¹ ú @get_ R_fromþ í 
Ù  ; s. CCing_`s.add(E 1 >tryÂ  J  u  U ƒ%s(� n K ofinallh ] ² ddiscar¶ ƒLdef 	 > /, � 
v=False)æ C"""UU f qovery.
c  ® RLoadsú ÿ àa single file,£öa directories' __init__.py whev0pasi 5the1 j R¤°s a tuple (‹2_orþñt 
)35"""¹ @baseå w ²%ifž isg % - !if)ô	VALID_MODULE_NAME.match(e c 6   õ# valid Python identifiers only»  ,   ¶“!, ¸	# ‰  õ!._} ‚ 
–  f  # #!heõ l 1es,·9 it– t– ¯zVmodul÷ N m  k É ÿ	except case.SkipTest as Ø ü Â_make_skippeYW B, e,ï¿suiteClass)Šr 
' Á`error_‰ ",  `messagÓ \6 .   Š Ñfailed_import � V� D ! k ‘s.append( _y ñ n   & « k?els> @mod_+c0absâ“ k ‚getattr(ÄA, '_? 6__'«Àh))
          órealpath = _jython_aware_splitext(
* 	 0os.6 .? ½(mod_file))0 1fulc o_noexti - N _| j  4if ‘ À.lower() != 3  2 �  :©  â Ômodule_dir = æ „dirname(] ä ; _' â  ; i @baseC (³ æ  1 �expected© ? å ¢sg = ("%r ð ó incorrectly imported from %r. En / "O  ‘ @   "+ tIs thisX `globalU ¯nstalled?">qraise I| _Errory l amsg % s -,m  (, # ñreturn self.loadTestsFromMù U Óule, pattern= …), False Eelif Wisdir´
[€if (not ¬ •space andI  Ñ    "  isK( Fjoin^ ú, '__init__.py')))o  M æ DNone¹ 	q  ú  _tû 0 = & 	   Â " ==A_getï_'¬¤ 
ã>try£ ypackageO �Q  l ( 
L ðexcept case.SkipÀ^ as eb Ñ_make_skippedõ W B, e,Ê ­suiteClassæ Lr _ e¥_‰ ",  BmessÓ \P F   Š rfailed_f� ”� D ! k ‘s.append( _y 
* r & « 
Ç % ?els> 	#ƒgetattr(µ6, ' !',B} b# Mark9  ª–being in C Ï (possibly ;´ ø _/ Cing_K Qs.addÊz q ë ÚR  Q  ?ÿ]  � O (ifÅ 0is Å O. /   #2 w Q) has! 2ed ¬ for us.  P â- ë   ðreturn tests, TrKue
  �finally:  ( õself._loading_packages.discard(name)9 JelseG öreturn None, False


defaultTestLoader =  "()# b _make! ò(prefix, sortUsing, suiteClass=_ ò testNamePattern )�  Á h  á  .Y  „ qMethodsd & =p ä ,  i ( P— 2 =   % Ž 0 = 8  / 'ifÊ ­ — å  �  : \• V1 geV@Casei  s(s   (,§ Gý=util.three_way_cmp,¨ `Iu œ w  � ‹ /).« )Ð  Sö É  ='X 'Ð - T 8 .÷e ã < W ).ƒ F PsFrom	  s(x  ¥   . Ú Dfind* „s(module × " Ý ” = Û =M§ %(\Ú ¸ �)
"""Unité ô main program"""

import sys „argparse ³os

from . -  R£er, runner tsignals$ ôinstallHandler

__u„ ð= True

MAIN_EXAMPLES = """\
Examplesm %(ª !)sô_Ï  J -…   !s ¥  æ + 5
  B = séC B + G  C .k “"  G ‘specified“ ! m A �path/to/< rfile.pyŒ A   Ê #  Ä�

MODULE3U  i çq set of¯ s©  MyzE @ Ã' '' '?  X' So4ing)8   D ‚ mAall d!*'À o Ç 1  6in ‡ bÐdef _convert_?D �ó  # on Linux / Mac OS X 'foo.PY' is not  ab2abut on‘ð# Windows it is. Sièàr to do a caseó$ insensitive match
    # a better check would be to óthat the name is a: òvalid Python modul$ .  ðif os.path.isfile(@ Q) andJ ñ
.lower().endswith('.py'):>  œ 	B 2absA    $ @rel_d % =n 0rel . , •getcwd())Z  : ^ K T) or  b.start  Ï Grdir¤  J   areturnÙ 	f  ô % =O  ñ# on Windows both '\'ð'/' are used as Ì 7 Òseparators. B¹¢to replaceJ @thanr yd µ eth.sepF ­ c[:-3].? ¶('\\', '.') / > : ð 

def _convert_é ¢s, [# –Q) for," i4;s]
P `selectÜptern(pa¤n[  if not '*'A   ° = '*%s*' %F H Å & ó


class TestProgram(objectn ò"""A command-line p'  ð
runs a set of tests; this,‘primarilyz !  ú amaking+ 8!s Hòniently executableL1"""@ ¡# defaultsH  l 1ing m€Q=None Ñverbosity = 1 Àfailfast = c ñbreak = buffer =Ö NäÁ= warnings =¦   P‚  e ñ _discovery_parsF  q  Ó_init__(self,î Ä='__main__',Ò  ~¾ b, argv G  _  ö bRunner% ¢ �Loader=l .& T  ,J µexit=True, /D=1, *` . L F! ? ó*, tb_locals=FalseZ × âif isinstance(ÇL, stf A.   = __imporZ 
Ý `@part  p.split(ÜF[1:]- „   
` qgetattr·v  , R h JelseG 
C x -!ifÙ  #
:  óp = sys. 
6 S  ¨0 =  
 ©% =´
! »	ö
% ü& =
# Þ-
 Ü .è# %ifü è Á ð  kzoptionsð# even if Depreca$ W™ #¤ignored byFv  ÒÐ# print them ñanyway unless other warnings sett	 Ware
  ö# specified by the5 aarg or é-W python flagB Uself.i µ= 'default'& Uelse:  } z# here ; i§ 1 ei» !toy Ëvalue passedC " { Aargs° {o None./ !IfQ ±user didn'tW 2 a d 
� KwillA "beX ñ This means thatW ýbehavior is unchang± áand depends on7 { s‰ Šed to -W¸ 
– =�œ ! swTest =  
' ÖtestRunner =  % ELoad%  
% ûprogName = os.path.basename(argv[0])2 �arseArgs   0run¼ As()
6 àdef usageExit(ã `, msg=Ø)K if   [–print(msgc "ifjÀ_discovery_pŽ ­ S 
B  o ¡._initArgP)  ™  ]    g f_help(i Psys.e² 2È _+  < 0, *ª`, **kw
 
Ñ  # p.moduleLŸ O c._mainÌ s.format“ ”  ³ 3 ðMAIN_EXAMPLES % {'Æ"':   Ò}; � 9.R l ² g è' ¬ "_ODULE®   1Ôb µ  , ˆ\  ×%m{bif lenÁP > 1 Ò g Ð[1].lower() =i'Z %‡ &doTP 7[2:2 )   areturnâ     @ ùø _JJ A1:],Ô
Êaif not .üsœ 0# tÛƒallows "òp-m unit4 @ -v"¦éstill work for   ¤ #] o
Ó " Æ 	[ aH ¨ ì Ó Q    Ðs = _convert_ÜsÌ   s^_# !___œ_ #BdupportVd/..0›=‡Í À    elif sel÷	f.defaultTest is None:
  €# create" ùs will load tests from self.module;   ( qNames =^ " ñelif isinstance(. � j, str)� $ R 6 )a sÌ ? MlistC B 0 ÿ 1()
^ 8defB ,ð
_discovery=False, Loader=YÍ "if6Ì �Patternsï E .. / =F ¥  Ä+if– 
`  É(erF i 3 if¸ S else (! d % š ! =4er.r.start,ª pè  6topL M 3’$  ÿ ¹ .Ò ªQFromM“… Ÿn W › V  ÷  ,s  Ñ ¡ I  añ _initArgParsersq B�parent_p ³ Q_getP 9 ®h __main7  FMain5 	^ 6B ßyG  D L á ­   a 
å s¡1argê €.Argumenæ Âser(add_helpnŸ .  r.  a3 ò('-v', '--verbose', dest=' Oity'Èñaction='store_const',  /=2; ¥ "'Vy † output'Y¯ q¯ @quiei ­ 70­ Qw « u-localsS4tb_ ñ ” 
SOtrue„IQShow a ÷	 variables in tracebacks]mofailfaéƒfƒ; à  ß 
 ó ã  5 ç Ðtop on first t — or errorà  0  9.! á != ~› ðcatchbreak is NoWne:
  ñparser.add_argument('-c', '--catch', dest=' ybreak',D O  ÿaction='store_true5 phelp='Cv ù Ctrl-C and display results so far')… Vself.£ … = False$ 1if # Ïbuffer is Nob9  a û 	 
(B¬ astdoutÿstderr during tests�  8 ÏNamePatternskF áòappend', type=_convert_select_p— e0‚Only run� which mEð the given subst5/Ê e = []
Úrreturn + ñdef _getMainArgPF(a,( Fent)h9 a = arg #.Ak8 ’parents=[	 ]Ú/ ‚r.prog =Á   ½Ÿ $ @int_* 4_pr ¶  š. 
ñ Ïs', nargs='*Ë e ð='a list of any number  M µ modules, '¨  ~  �'classesÝ9 –ethods.')´ �ŸDiscovery†W0'%s“w ?' %–Aepil¼Q('For£= Ry all /� must be6	ð'importable from åñtop level directory‹hK yprojectm!-•'--start-d  6%"D  1to 7 í('.' default)"
µ"-p™/Œ  z
Ä"4 to2 S0 ('ŒO*.py� t� Atop-‹' ?top%/'TÏ¯# (#s¸ að     'start dire£ctory)')
  ðfor arg in ('start', 'pattern etop'):0  7 ùparser.add_argument(arg, nargs='?',0  4  ±default=argO Ÿ.SUPPRESS; Nhelp8 %)
t qreturn X r ðdef _do_discovery(self,û çv, Loader=Noneë  " .e = '.'`  #  ‹test*.py" `top = U : !ifr q is not 
[ð# handle command line4  s ª j  Ä W  ]1if ˜ ã _ m  … 
i  3 #T 9ingM   N �initArgPó&s(9# � q .x  s!v,™  Z öcreateTests(from¸ U=True•œ>  Ç2run6  G ¯ªcatchbreakò �installH`rÊ 9  ]oRunner3 p .% 1= r. P.Text“ = IQif isv 1ncep> X, typn P:try´   2ests ! =c_ ±(verbosity=·  _ [ 	 ‚failfastJ  I  bbufferG  E  ‚warningsG  I  ƒtb_localJ  
ã 
þexcept TypeError¤ & ±# didn't ac/ Ethe U  Ã) 3  	U° ÊÝ
{wî hD or ¹‹sŒvR ™ Jelse@# it5öassumed to be a  		u q 	) –result = 3 F.runWŸ Ððexit:
            syñ8s.exit(not self.result.wasSuccessful())

main = TestProgram
# mock.py
# ¡ tools for ñ+ing and patching.
# Maintained by Michael Foord
# BackportC ðother versions of Python available fro† ó'https://pypi.org/project/mock

__all__ = (
    'Mock', Hagic ®  „sentinel tDEFAULT 4ANY 5cal& ô create_autospec# IAsynk ¤FILTER_DIR# aNonCalÝ ”  °  ä T_openD ˆPropertyA 0seaž a)


imba� $io ¤contextlib   inÆ t Upprin 4sys �builtins
— a  p piscorouN‚function( Ttypes& ô CodeType, Modul Pethod 3 Ôunittest.util; ’safe_repr$ e �� ðwraps, partial


class InvalidSpecError(ExcepŸ !):"ò"""Indicates that an i6 ñ value was used as aû 2„."""


_� = {nameÞ	 tin dir(! P) if Š  ö.startswith('_')}

0 ‰ñrue

# WorkaroundX Àissue #12370 ñithout this, the __ù B__ p)ñies wouldn't be set correctly
_X�super =  ¡

def _is_äƒ_obj(obj0i �instance_   Þ $is   %, B  ¤Áreturn False‡¢if hasattr5 0'__ã7__'6 Ÿobj = get( H Y �  X S) or ð€.isawaitj 
ù  � ( ƒ %if|   ó, '__code__', None( á ˆ  < )­ Belse†3 Œ Mj3 @# caÓFuse s@ on 0 ob#`s beca# Çthey overrid&ˆ ±# The base =j1allì@s isÞ ¹6 k1sub7 (ìK1  šVe‚+ Í L Á Ò  & f, Base»1 orƒ *  … )� ,š <objD A ˜ ~extracteAæ@ced º ;ss will µ 3a Fò Ã Ò  " " ¨Bibutäp# whichP ªRactuad®€€needs to­ w.ª 'ifæw só DÀtr(obj, 'mocck'):
  ñ return obj.mock Oelse" ó)


def _get_signature_object(func, as_instance, eat_selfo 1"""_ ðGiven an arbitrary, possibly callable’ ð
ect, try to create a suit! K † / . RÔ ²a (reduced � . ò) tuple, or None7   Tif isÆ Ø Øtype) and notæ (À# If it's a / . ôshould be modelled a! â, use __init__„  – ­ ! =´ . Ø   À# Skip the `\Õ` argument inM / ƒq = True AelifÇ æ ÓFunctionTypes¶u ðIf we really want”Ó  É-1 ofš apassed,s E  __Þ6__ ¡looked up,’ ï 6tryc G 
Q d úexcept AttributeError@ r ÷7 %if¨) Csig_i spartial 7 )8 
%1  8 " 	» w   ¥, inspect.‘(@ \ Ç LValuÃ –# Certain* mQs areCÏsupported byi  a  I’  Ò ÙVcheckÛô  ±, skipfirst¿ âc=False(_sig =
&L Ž 0if > !is�†¢ L8 & =,   Œ² @sig(ð, /, *args, **kw
 ž  ñ œsig.bind(# N Q_copyõƒ_detailsÿ c ¬  m(0)._ _  41 =  1sigQ *    /"_ Â Lv  ñ 3opy¿ #~ðexplicitly don't < 'òdict__ into this pas it w„” ô# expose original a+gs that› Þ !ed7 6for)  h(  Uô'__name__', '__doc 8tex'&_'†'__modul7 tefaults< 7kwd m 
 t 	Y  0setÈ ±Fopy,­ 7, g  )Ï > 5 Ñ%¢C(obj• 
2Aobj,ü  d Ë„2  ô(staticmethod, class M  —)U V  ’ "._Ä_à "ifÀtr(obj, '__cñall__', None) is not 3:
  ±return True  ò
False


def _is_list(obj): Ð# checks for  ¡ or tuplesF ñ# XXXX badly named! ^ AtypeN P in (@ ,> )s ò nstance_callabl/ } ó"""Given an object, Y  Ç s if the  ö D .„ ½For classes8 iw µs would be = 1"""@ !ifG$is-  Ê  , Ô  [�# already¦ * @   ¯ rgetattrA !'_í ±
; @# *c˜ *™ ²broken by aÐ ð overriding __mro__—Ã__dict__ viaF aa meta  ÆAbase�pobj,) +@.G x ¹ 0if ) .U V.get(º e : ó  ¢t  	iôset_signature(mock, original, F=4 lõ# creates a function with I Ð (*args, **kw
 Á) that deleg; 4to  u ÷ . It still doesJ ö `!by  ‚a lambdav  z2samM#; "as–Ï .ÒÈskipfirst = R& W10sul( (_g'_((%, ^ )B Qif reE /is þ +  K,¾ # =4   =sigV&�sig.bind# E `_copy_b �_details( ,T2ig) 8% =0.__ !__E †  ã.isidentifier( s  @ = '^ Aopy'9 `contexH4{'_Ì 5_':~ 0, '0':  }5 �src = """-%sØ û O ! F ó W ! Q""" %++ ³exec (src, ± ÃË $ = [å ]4 a_setupYQAopy,Ä É@ ƒ G n9 Ý 3 .¾ ! =X §  N!rtÀ0ed_á F  —„  I .9 Ü e ` !4 [ $noÄ + ¿ 
8 c  Oed_onced 9 	e Àert_called_oðnce_with(*args, **kw
 C):
  ÿreturn mock.assert_called_o> = Cdef 1 1has5 sh 7 a 1anya ` 6 _ `reset_ü (áfuncopy.methody ñ s = _CallList()A  A+ ?ock) 
 d .o C dret = I �e_value# Àif _is_insta• M à(ret) and not E !isÆÛ ¡ :retw U n êr = Falsp  P_counž 06 _Go = Non8    @_lis< 7a ^' Z	“ 7! =. 	-  side_effec   M. 	+ ”_childrenZ 
 
2 Z}$ =( 4 x9  > N7  0 /  	. ´6 =  	$ 	ô P ï * $nof.  2 L ”3  	4 ò__signature__ = sig¥ì¾†delegate|0


ÔÁ_setup_async+ (6   .Œ€coroutin@ + 5io. s# œ : [awaitV  7T R\ ‘# Mock isóconfigured yet so the attributes are set; Ato aAtionQAthen4 ÑcorrespondingUu helper0 D 2is Œ$ w< ) óis accessed similar to e å.D  z€wrapper(« _, /, ¶0get- ¢..,è )(ÿ1for  c in ('»™Aed',�  9
 ( ˆ-  ‚- ä2 1ny_¸ 
* À           'ÿassert_has_awaits',
  '+ 2not+ eed'):
. ð# setattr(mock,  ÷ibute, wrapper) causes late binding@ Vhence8 ò will always be the last value in 7oopD ÃUse partial(w ‹ ¢) to ensurO ¤ — is boundK ¥correctly. â s ñ	)


def _is_magic(name):U ðreturn '__%s__' %  ‘[2:-2] == ñ


class _SentinelObject(o J ¡"A unique,5 Cd, s.  ( !."r ‹ Â_init__(self0 F  ú  .‡  €   8 Crepr8 2 Æ r 0.%sË I %B OduceD ! †""AccessAsîœ aÕ, usable as a)?.""$ì Õ _ê hs = {}à gá ]!if‰  Üp'__baseø g  ð# Without this help(unittest.]P) raiIÁan exceptionÞ ?     Q AttrƒUError! Ê ±.setdefault¢,p ())í /reÍD'


3& =Y Ö()

DEFAULT =ˆ ˜
_missing øMISSING
_deleted ðDELETED


_allowed_´ ¥þ 'û _BP', '_O_ ³side_effect) 	 > fparentN Dnew_ v f  ‹ 
&  $
}! Ò ñ gating_propertyŠ~
Ô B.add d A_theí $ =˜ 1' +l  }7getó= %, : =
 q  I"si~2lf.Æ ¥ eV  " 0if % zis NoneÊY | g D ( #ig9" ¼ s¼ ½  Ã P&…_dict__[¼ 2] =ˆ¢  ;elsþ .sÏ ,3 Cõ ë _get, _set3îÔCallList(listp•_containsl½ máot isinstance(" À, list):
     ôreturn list.__contains__(self, value)
. Alen_ q = len( 
  8      if3 ? >  ! :]  e � eFalse
 õfor i in range(0,> ! - ˆ Z + 1)O @sub_Û 0 = l U[i:i+Ä ]`  z 6if . =ù 
M  &   ETrue>  ´ £def __reprI— . ð pprint.pformat(¥ sQ))


@ òcheck_and_set_parent( ˜À, name, new_
 f ô = _extract_mock«¶ øif not _is_instance% ÷ ­ Û   Bif (K .2 x 2 or0 � 1 orp  : 	6 Ç 1 isˆ _None),  Þ 0  í  [ 	¦ q /2 = :  dwhile  | ð À# setting a 6 ¶ À) as a childí q iPof it^e  � �# shouldÝ ¡modify theR % (if‹ K ˆ  F e |  ¾ == së b  â†V e 1 
% e (  \% =ga ?ame] Š Y 0ameU "amJï Zð
# Internal class to identKðif we wrapped an iterator object¢Rnot.
; ¢_MockIter( 9dS_init¤,?    Óa.obj =a  > Í: 4nex: 5 Æ   Ï A #)
Š @BaseG 3ect3 D5 ‘= DEFAULTg! €side_effÝ  = / ‰ 	Ã à/, *args, **kw
 j  Ò dpass

Ž °NonCallable"(ž - £"""A non-c! Ð version of `. B`""" …  ¥z_(cls, ƒ R   „# every s@ has;B ownçÖ +  soåðcan create magic methods onR0 ìÐwithout stompÇ ³ Ather|s0 �bases = ² Ö w  6�ot issubQ   ` Asyncö WMixinÒ  4 0# C© @0pecÔ@an a3  Q ³µor function‚  ; `bound_¥ð = _MOCK_SIG.bindèBtial� Ó¦).argumentÎ  L @specK 6 = W a.get(' ð set', bound_arg÷s.get('spec'))
  0if  ô_arg is not None and _is_async_obj(' )):A  L  bases = (A. æMockMixin, clso ñ
new = type(cls.__name__, ? Ð, {'__doc__':9 . }B ðinstance = _safe_super(NonCallable| w  ` †ew__(newB treturn I !

Ì Ñdef __init__(  Ö   Qself,"=s, wraps  À  2set 	C Sparen " _) Btate+ Q _new
B='', 2 	K > 4as_À Ð=False, _eat_¬ U  un …**kwargsL Ã(ift   è 
ã£ • 2 = 	 9 #°__dict__ = ‚  · n ! ‚['_mock_A &']L  G   *  a(  	 P A* ¬ / ƒ 1  b asealed` qý ?0set<?
@ ô upec_setg  ó     u = True  ˜Õ Z –  ” ( ‚ £ •z1addCÌ× | ,—YS)K  �children%{}½ ( 5% 
 ( �delegate+  ò { *al“ M  | @callÞsU  '   + Qcount, 0¨ T B_lis- _‚VList(m` „ < Œ 3 k  method_0  ¿   c ù¿  B2if �Ñelf.configure¢(1û Qp c/).B3pec7 , ™xx,þ Ó  # )©battach©  y  , X·, attributeÞ5"""D A8 ! a/ f as an4 ñ of this one, replacing itsµ  J ¶  . ó€s to theK Rached_ ðwill be recorded in& C `Þ`^   `Ç ï`N Í sš .Ð Qinner qextract ð(mock)

        i¡nner_mock. ó_parent = None
  i' ?new+ �ame = ''N n' w * àsetattr(self,  pibute, ² 1)

) 1def “_add_spec/    ,  Á_set=False):3  × �"""Add a" Q to aF 0. `3 õ` can either be an object or aE ölist of strings. Only© ˆs on theT Õbe fetched asI Ü as from5  å .ä  ± "IfG  Î �` is True) ?n ov  É È ¥be set."""q  Sô86pec2`) � _ / !, }Â_as_instancet,t  Æ  P_eat_ˆ ( œJ \class‹ €signaturZ3W  Pasync; &[]@fº°ttr in dir(¿ t  B ô	if iscoroutinefunction(g‡  «, )?  C � €.append(2 )‰ "iftais notJ A and @_is_Už \! X, typÕ ‚   † A ê 	…Felse
 1   
5  Z e );  reXU_get_…_. î b 	 o /%, 
t * o 0 = †  3Wres[1ä a  î & =ãy°__dict__ = w. á  "['s AC'] =Ü . 1set,  �  ¥) ¾/ k Þ 6  
�_methods4  c )   _þ( \   ._¿Áreturn_value3Î re%} - y  É3elfG€delegate›Ø
eV 3 ._ `  3 ¯is DEFAULTO  �Qchildª(C    _²=× !,   vF='()� - 
~ / 	¡ €tc ¼ G ret‘__ c!, ojDŽ å _>" =c Ÿ ìÀself._mock_ráeturn_value =  '
  ò_check_and_set_parent(self,. á, None, '()')
< 7__rW ²_doc = "The2 � to be r$ ñed when the mock is called."M ' ¢ éproperty(__geti 1, _¤ 2 ,D Ð 	 © ")
Ã @h @ Ñdef __class__ý !):  N 0if b._spec%  Å  %  ) ˜ R typeD C  G ‹ ô  = _delegating_Ÿ "(' !')M   o_count0 
# 4 Oargs3  " 2 O_lisj  7 ' <  ä_§ o #  QØ � ñ¢side_effec†‰Ced =’J  I  ˆ4if  dª
�E w H Fsf =J .# `if (sfe 1not)P and   rable(sf¼ ›  % �isinstanc' Å, _MockIter)G Ð_is_exceptionL  N ¥ 8  ! À   	¿  @f' �f�‹ ñ Ð� O W‘try_iter( ð   s Qelf._n „ ³¬ÓJelse–l dª ó é 5 = {‚ � P 6 re6 á /� visited=,3,*,ì‡=False, M  `†"Restore>`objectbóits initial stateP ö$if{  › ~ 
˜ X = []„!idº D) inA 
9 ,3 H „.append(? ' Š · ¶ó >  _E! =@  ð0  ij–CallList(}
` ¥ ¬* omethodR y )ifÄ
p á(é¨ = DEFAULTG ÷F $ C �for child¬z ðchildren.values(G):
  ñif isinstance(child, _SpecState) or  Ê is _deletedC  N ‰continue\ 8 ø.reset_mock(visited, return_value= ç, side_effect= %)
[ ±ret = self.W _A & tif _is_Û * �(ret) and�  Ñ 1notI 
Ñ ?ret¶  ")
ƒ Òdef configureW  Œ ×, /, **kwargseð
"""Set attributes on the ò through keyword arguments.m  \A; @plus¼ Aurn =sÎ  ( 4Às can be setj „ t €s using óñdard dot notationO `unpack$ Pa dic Qary i¸ L ¶ethod call:­ 1>>>ì qs = {'m$ .¡Ð': 3, 'other.¹ íÅ': KeyError}d  N  ´ .q **PUs)""", 0for?, ¬ rsorted(‘•.items(),/  Z  P# we ;  = §�number of(Ÿs so thatG  ¡ ñ"ar�abeforea P , òkey=lambda entry: ç[0].count('.')¢  µ  =@R.spli$ 	i Rfinal# ys.pop() 3obj•	  •…  ’ e 
j { : 0get2R(obj,° 
` s  Œ é•#__E 2__(’Gnameé 0if   ‹ !{'º_¡Cs',  Šunsafe'}¨ eraise ‰¦(L ¥ AelifL•Z fJNoneT Ž  „/in; %or° º_all_magicsF  Bž ñ"Mock object has no™”a %r" %^ Â  4h ß 
m i 
 Ö U	R
I  & ðame.startswith(('assert‹Sassre
  e
 =srtÁ	� &   0f"{· 4!r} a72id … öion. Use a spec f >   f"ß % ¤H if V €meant to�&an|)."Ì;sulÏ³rren.get†Ä Qif re2 Ž¤À(name)
     ÷
   elif result is None:
  qwraps = 	 âif self._mock_' ais not, 
F  Q ù+# XXXX should we get the attribute without triggering codex K ­execution? ‹ =_  Z (¦ ‰, name)
9 =Ô ‘get_childÞ (+  � pparent=[ O =T !, | = p, _new_  E   J 	! )  i j— @ren[Z C]  =¿Ð Ô²isinstance(Ü Ú, _SpecState)ž:try  ã 6 þ = create_autospec. .! ,‘  E_set ’ ,Ü  ?   q .4  æ / 
àexcept Invalidå ^ErrorÓ 0tarÙ S  ê‘_dict__['ê¯Q'] or	y ]raisej Pf'Can:é  { ’!r} from “ - 'j  2f'{  —  4 ðas it has already been ƒed out.K [K  ={LA!r},� #={w ºZ!r}]'\ - ycreturnÿ
‘Ædef _extractc•†á —_list = [u C]!_!Á ü J( !laM  L Š  R doa &'.p8if } Š= ['()']=7 'I dwhile Œ ø… ( ?  Œ w ƒ.append(' pû j + dot—‘ È  R  Ì C 0== × 
Ö  3 I Ú   ‰ $ =â P a Ë Ç 0 = Â¦(reversed( )¿ A_firš X 0amet'Í	œ8lenG J > 1Å  ô  R=1[1]�@in (ð ,ö '.'i Þ   † 8+= ± 0[0]þ ¬ Sài''.joi˜ ì|_repr__â ¤ ´� * 1_stþ9= '  â .!, 6æ  + G õð =%r' % name

    ñspec_string = ''
 Á   if self._" õclass is not None:)  1 $ F   6=%rN  % 
R :setD  #  8 Ž H M_setL 
)  %· •.__name__³ °return "<%s å id='%s'>" % (&  ‘ Ptype()F ,! Z ú 
 ” 
 "idQ G 1)

 ²def __dir__"  ð0"""Filter the output of `dir(mock)` to only useful members."""
Ê   !ifÀ¦FILTER_DIRb   yobject.‹ ¢  % ƒextras =g } á_methods or []Ì  * Pfrom_A0 = ¨   Ù )$ ±dict = list  { Kct__( `child_r  € [E  m mäR for  È, m_value in¬ E ¦ren.items(c  F &if6 ì–_deleted]Ø ![es e  hûe.startswith('_')ø D  D 9 orù  ·  ·_is_magic(ei ÔPsortey#t(Á&+ °  x  'l)¡dsetatt¥ , !, k)P ¿ !am�_allowed¢s#  ¶ ù# property setters go through hereí Î ¢Œ 	9 Selif Y–het andÂâ # D  ¬  é @
Q; ?and/ _a'__& W òraise AttributeError("Mock è 0 haŒ v#  ­ ¬ ’ Áè    òq_unsupp÷z0msgñpAttemptÿ to„ 9  P â q %r.' %ð	é Á ?msgš ?all’   âT’ †
^_2	ì  ×0ot l�instance%(  {   ¢(ý2C_getæ (¶D7 @   ¢original =g	’  ! }  Bôambda *args, **kw: = À, *args, **kGw)
  Yelse:   ñ# only set _new_name and not  ÿso that mock_calls is trackedP  1but= qmethod 2 ' ñ_check_and_set_parent(self, value, None,ƒ 
È  ¶ Ásetattr(type6 )* = 1 Blf._Ã €hildren[Þ 2] =p ¢ Aelifv ú  == '__class__'; ª b._spec! G  ¦ greturnZ �?if 	 ¨ ß )…  d ‰ Ù 	€ 7if . esealedë1hasR " m c  ‹ ` = f'{( @._extY  P()}.{	 %}'x  § ðraise AttributeError(f'Canh ~{a E}')
= D� object._. ¨ !__÷ª ö7 �def __del) @åâin _all_magics 6in ]š.__dict__€c †
j  é #inƒP  )a# for Ž  Bs°are still M« SProxy· 2 F   #† [ðon the instance it¾1 kD A Sobj =° �c:P.get(å¦, _missingó ï ë ñ_safe_super(NonCallableMock,s )tÃ m c £ ž 0is èJetedšo
E  if> Ë ™È 
G 1del� :@ M" % =Ÿ 
W›Sforma4 ’_signaturË , args, kw ³ À 
‘ @or 'ŸqÉ# _i d  5 d ž ïfailure_messagŸ  , action='f '® 4 ñ  = 'expected %s”“found.\nE À: %s\nActual Ê : u_stringþ Ú  ÷ “C 5=¤ ž _ C  # a€ j *D ›{ý 2% ( +, Ë 93ualp )ƒ;getÖ Q_fromœ÷m2"""È À   * If callð% objects are asserted against a method/function like4 . 31
  ðthen there could be no name for P call; õ
ect to lookup. Hence justN QreturP ñ spec_signature ofK  } – ]being¿ .Q 2* I9 ‘ Àis not emptyO ðn remove () and split by '.'ª &ge› @list†  I s ð iterate throughP õ children until a potential’ òmatch is found. A5 P mock @creaŠ�only durà õ ttribute accessM °so if we ge´r_SpecSt–  en‰a; s½ 1theY  w±M %edO  0canÄÖsafely exitedP5""". !ifN :  Æjself._È
) ¥sig = None  J 1s ==ñ.replace('()', '').žU('.')2 p"= n  F_ m  Š ^ 1 in^ s± 1 " =Š€ren.get(0 j  Ø "if"  § ¹ ` or is0Qance(F &, …)f  C Ubreak¿   Nelse( #¸pan autoB4cedBãis attached us@ach_ü  †	_  c #· w¡%a ×Bwith|! a_ oOfromO  fwhich �!haˆbe deriv1 €   ± = _extract® 3
e-  G“.. Ø $  Lc q–2ig
Pdef _œ_”0er(D, ¼ôrGiven aÓð(or simply an (args, kw £) tuple), w aGòcomparison key suitabl.‰  Ó—oXk s‚@This�Óa best effort® ™†relies oI&'s®,Š €if avail ,Í¤falls back= �argumentsYgmselveŒ  N Y,]Alen( Z) > 2óÁ Q._get' ý_‡_�A 6[0]4@M  <I ø : if H  Í
‘ 7if ° ,==±  D  ‘ U = ''     
 ô e	% µ  7  Q /, = :try­  < bN8  =Û r.bind(*M "**–À)
            ð	return call(name, bound_ Y.args  kw !)
;  ùexcept TypeError as e:#  * i öe.with_traceback(NoneQ ;els< 8 ‘ 
V ádef assert_not †ed(self)w 2"""$ ñ	 that the mock was neveró 1ed.S  ¡ 5""" 0if P .¶_count != 0_  1 òmsg = ("Expected '%s' to not have bee[öed. Called %s times.%sp  O  !% Ë  ._¯ _“P or ' %',¡ -  ¬ ' 
0–s_repr())z K qraise A\1ionÏ](msg)y u2 å at least onceÏ |=|x5" %g  ä  e,_Ù ^ ŽAonly’ Wê_ == 1–m —Á_cƒ`, /, *´C, **¾0% lœ “*Pmade N Aòspecified arguments. UR=Ks anA1 if>  † ± and keyworE 0s p¦vd in ar�differentO ¼— !toN  .7l 0is ]ï  ¦ e­=âr_formatn ø °_signature(F #, 6	E actual = '• 7 Ied.'# e€_message('{  0 %fk4.\nBq: %s\nA]   
R  ¿   4% (K ", Š ´	‘ Ò O  O_ (º " é{	/tfailureå 0Å5msg$Ã  ‰  _matcher(_.(R §, two=Trueï  E ² W  Êð)
        if act÷ual != expected:
  fcause  ô  if isinstance(5 ù, Exception) else NoneJ °raise Asser' €Error(_e ñ_message()) from v !

@ Qdef a6 ð_called_once_with(self, /, *args, **kw
 )Å 2"""> ò that the mock was P � exactly X D and* !at"  + Š   w E õspecified arguments.""") pif not ¢ .h ¶_count == 1�  R “msg = ("E€± '%s' to be !ed™ 1. Cþ Æ %s times.%sn  I  !%  ._ç  _name or ' %',Ÿ -  ¦ ' 
†©s_repr()))R ä6msg& breturn˜P "edÑÈ1has2 sæ ,#ÿs, any_order=Falseü�has been= ?ed Õ  ³%s.Ý PThe `C| ñ` list is checked for8 9 EIf `œ `2     (‰€default): n ‘ †s must b?ðsequential. Thern Sextra5 QbeforìAafteŽ † ­  @TrueŒ ‘ !cao  inh hU, buta Bthey· Ùall appear in4	9A = [~Y±_matcher(c)RcD ³ ]k ¡ = next((e( e( S £œ!),™�1allz Ps = _bAList[. ’ ± N õñ
ê%ife O 
*  —"if 4 M"  & °problem = '¾ sY ufound.'3 )    ™G !('š¶ processingµ Š>.\nZ  ^  D ý s: {}').format(� 1  ?[e ¾Z=   ”	]ª, ²ª 3f'{m}$f'Å6: {N7/)}61f'{OnWÿprefix="Actual").rstrip("."G 	5Ù   mG  íÀ= list(all_cƒalls)

  ånot_found = [] õfor kall in expected:  < :try   Pall_cb €.remove(D )8 þexcept ValueErrorF ” {.appendF 5if " 
= ñ raise Assertion_ (~  ¥ €'%r doesF � contain ì Pof %rò @its Ç Ž list, 'C 3. ðstead' % (self._mock_name or ' -',A  ˆ  etuple(Ý  ),— Q
EÒ) from cause
ÍQdef aú A_any5 ‘ ð, /, *args, **kw
 )72"""6 P the ® ‘ has beenqed with òspecified arguments.}  Ë 3The�   pS As if7 U h*ever*\ …, unlike `: !rt¿ 0ed_{ k` and  Conce ‘that onlyw 5 ifM  Ò Ç#is‰ €st recen1 Ue.""", å2 = Ç 9 ð_matcher(_Call((<#, D¶, two=True)�’% =4 ´isinstance(f 1, EÖion) else Non`actual’Œ  0c) žc© ª  › _¯Ä"if! ˆy ôòin _AnyComparer(o  Ï2 u_stringbformatæz šsignatureZ M ™wAnot b W‰ 	X ¡_get_child¨ 7*kwè ‘"""Create1 sb¡attributes‚€return v¹.† ¸By default @ bwill bX s0typi  v&ntD PSubclùðs of Mock may want to overridM  É o customiz Ue wayŽ ƒ ‡are made£€For non-¸2ablð @variy Â õused (rather thanm 3any‹ # sÂ )TB_new
¥= kw.get(" "55if  Ö°__dict__['_x–_asyncs']»Y•A  9(ãß#ifÏ …\_sealÈæ° = f".{kw['¾@']}"¾" "— "kw«6"()8 … \  ' %cextrac&  U() + k C > mµS Ì _D =  Ó	B$is…() p, MagicÐ) and _new_na÷me in _async_method_magics:
  a# Any ' �hronous ' Ð becomes an AE IMock: klass =  °elif issubc$ v(_type,) jMixin)ˆ ´if (_new_na» 0ll_y · 9 or Ä £self._mockç  ³ )d L $ ~  M 
 r 	7' o  MN J " Jelseü 4 lN?notR �CallableQƒ5Non4 ¿  Á ß\ ?ockW 	K~ 7µ.__mro__[1]ÿqreturn ( �(**kw)

 ðdef _calls_repr(ø , prefix="ú 's"˜ °"""Renders * .E? Ò as a string.\  ¥±Example: "\H@s: [0 Q(1), 	 V2)]."1 -IfZ �is empty,Z
 h B is Ú qed. TheÓ  w ðoutput will be truncated if very lo§  +   5"""; 0if ;ß 
u  6  Rf"\n{>†}: {safeX. )}ô û
_MOCK_SIG = inspect.signature(�.__init__¼'ó _AnyComparer(list«P"""A  Ð which checksý  it contain¯ �# ±may have anðargument of ANY, flipping the components  �item andºQ fromC ðtheir traditional loca �s so that[  ÆÐguaranteed to²o†  l Tleft.¢°_Ã #__± ‚ ü  Ð2forÖ Ò Ê
¿±assert len(9 1 == 	)¼  F   ‰if all([    ex® ed< mactual#  † ' ", %  ‘ 1zipx ,¤ 
q ]Ç  h   ]6Truâ �False


Ãtry_iter(objG `if objcFNone? 1obj· Àif _is_excep¡B � .  ; I* =tryt ¢ z s ¦ TypeError/ ñ# XXXX backwardsu‘atibility=  œ £# but thisï`low up„Qfirstf  -rðmaybe we should fail early?
    ðreturn obj


class CallableMixin(Base):

. ódef __init__(self, spec=None, side_effect ] ñ _value=DEFAULT,J  N  Swraps3 Cname  [ 4_seM Sparen D _. 4tat? Q_new_O A'',  C µ **kwargs):N  Ó ø.__dict__['_mock_Å X'] =  ; É_safe_super(A , V %).83    ¶ !,  , ­ R ÷ ", ¯ 
1è Õ 6 à ,Û k )Àr Gelf.«( =¹
) éþ “check_sigð@/, *6e @ò# stub method that can be replaced with one	 a@åific signatureµ Hpass� U_cally‰ ‘can't useô in-case a function /¨ pwe are ï 0ing4 s5 ‰ �# in the¤   Ü.(*!I . “increment8 Oall(3 r :  £ 0 ¸ V  6 /, *
	` execute˜ 	Ì Ç q  # .Ê†ed = Truñ ²_count += 1Ø  ¹�# handle = _„Œ  €needs tolðset here so asserïAs on: P argu~ s aW befou"#  "ö9¡of awaitedF s| �@ = _ö ((˜ #, Z`, two=ä )0 å  +  9  Ð  Ñ_list.append(j Ê —Pitialvcff forÓ* sØ2do_”  ó èf€ is not Ë� 5 J
9  yŸ Ž  @ ß Œ ÄR ²� Ais_a´ ! =  9 e= '()'+ X] s5—  p›)I‘follow upç�chain ofs » d
2ew_G� XwhilevaO »  Úpw  # ;if ÅÞ     Ÿ .J Àll((method_cðall_name, args, kw [)))
  ódo_method_calls = _new_parent._mock Í is not NoneG ;if J :$  z l ¡ p  º œ + '.' + 2 
X ‘# handle © Ã 
y BthisÆ    o eCall((0 ‡ (	d 7 šs.append(a )Ÿ /ifO  ` ã 
©  qif is_a‹  " ‰dot = ''¡   Oelse3 
.4 l   – 	ö   § ~ == '()? CD  + º +§4 
-Ò# follow the ‹ Šal chainÚ ‘v @ a Ædef _execute°(self, /, *C, **'n ö# separate from _incrementH ö so that awaited functions ar*## ‚ dT "lyV `their  ð, also AsyncMock overrides hÖ ö@ffec Ì q.side_e  2if  ¿á  E  ¥€is_excep¸ (1 )&  * SraiseP b   Aelif»OableE @esul´ Dnext' 	N  R • r7 •   . ™ # 	K ) # =Ë (a ] 3if 1 DEFAULT  Seturn. E 1if  4r% d_value•R ) ;  5 Y TwrapsR  ¦
¡ C O Š 1 ý 2  � €

class ¤(Q ó`Mixin,  3ock²1"""™0CreNpa new `@ ”` object. ñ takes several o” alÊuzsH rqspecify1Ábehaviour of  \ [ :30* `2 ð`: This can be either a list= óstrings or an existingK 1 (a€ "  Ãor instance)Pcts a± e o PificaXA forš  9O C. IfP Pyou pU inx  0 nœ   isN amed by:àing dir on
   öH   the object (excluding unsupported magic attributes and methods). Accessing
      any- ô not in this list will raise an `AW ƒError`.
F °If `spec` iq £ Òrather than aR °of strings)Î nB ð	`mock.__class__` returns$   1 of  h a 0. Tª pallows B sO óto pass `isinstance` tests´ *± �_set`: A” Àcter variantn Ó  . If used,)@emptsƒto *set*p `or get$z  oIe—  tt isn't Æ ¦ Ded a¹ t – | È ’ide_effecË `functi~ ño be called whenev�`e Mock« S. SeeÉ  a'`sR  õ KÁ. Useful for Pexcepn Cs orD `dynami\ py chang) Ðp values¹%e © %is¦ 2ithæ$am“ ²arguments a é,Ø•unless it/¡`DEFAULT`,G v ˜ |  Ùt6~  ß^ 3 © - 
è€iterablel an eachÉ 0 to ûCÎˆ  dBnextd Q from/ N r2any« ”e members ' N Gare †Bthey;!be¦0ed 0eadA Þ #edÚ 2* ` _c`: The˜  ;¡  y7£By defaultŒ Y B newfP(crea™¡on first aƒ)v W < 
‰ weñ * `wraps`: Item… I” M0to $ @.  ¯  Ö2Non¦n  ž — C § Ž “ ÆdhroughÎ [ 3ped|H (&K °real resultm/ô ü´ q > # aN Š Í 1hatÏ õ‘corresponòf�  soH´|
¨ti @doesž-ex÷œ ý)C GÖ !ha‹explicit_@ set`na s ¼ ž x#edi =
Ò ï f '#isûç˜ p* `name0#    ˆ iä!beäþ`e repr/$th† >  ·¬nYuPdebugç " e_ ‘is propagþtto chilä  N ‹ õ Yn als³ð ith arbitrary kñLeyword arguments. These will be
    used to set attributes on the mock after it is created.< ñ!"""


def _dot_lookup(thing, comp, import_path):5 2try	  ~  return get| ; )- „except A™ VError? #__` #_(	 i ; _ ¹ 8 “er(target¥  ½  on42 =  ¢.split('.'› 9 Ú ! =î 1 b.pop(0$ ? = ¨ © 1for? 1 in G å i ¡+= ".%s" %+ @  é i ˆ6 z9 ð


# _check_spec_arg_typos takes kwargs fromx ñmands like patch and ? €s that
#=Òy don't contaÜ ömon misspellings ofžb relatŽ@autoŠ Rcing.b` Ÿ (™ 2_to¾ ¾» D= ("H At",  A   2set ª … 7  …  s€ f    o $  „Ñraise Runtime©(j   0f"{L á!r} might be a_ ;Šð unsafe=True if thisv™intended"Q  )


class †€ch(objecÃ'  RÎ²_name = Nonôr_active6 �es = []
4 Ìz_init__¾ Pself,©Fter,*p, new, ¬", ,J ò   d_set, Œ3 £_callable,]D, *,ÿ BFalsª  F Õ   ifo <  1notÙ 
Œ)   zDEFAULT#  P ³OValu± & @"Cang ‘use 'new'ð 
 Š ª' together£ ? a 
   %if	Ÿ  ˜œ 2b¡ & 7#ot‡
“ a3€â ðif _is_instance_mock(Å y¿InvalidSpec0'| D v% {Ø Fare€) 'y g ñf'has already beenÒ�ed out. [V  ={ C!r}]Ù 9 È  ËÌ P g Ð Œ × Àt. [spec_setó={spec_set!r}]')

  âself.getter = 	 
 Åattribute =  
# �new = new €_callabl= 5new 
)  � 0 =  
 Acreay 	 
 úhas_local = False  N  ò Y   
! @auto%  Ø  
! ’kwargs = 	 
 ðadditional_patcher* 2[]
\�def copy(a%):< , 2 = 7 (  ‘ - Ž!,  r 3new
  » ,> *$  ù (  þ * � ö )l Ä .œ @_namâ
²  5 8(  !p.;£) for p in; 7 ]
 sreturn ¥ �_~!__“g, func™àif isinstance( g, type#  › ^ ê ádecorate_class4 % P n¤Ðt.iscoroutineX  6- [ Qasync¹  F7 ë � r, �¯  6 0, k» ä  r Ø uLdir(   © aif notÁ.startswith(rÇ.TEST_PREFIXW  7   ‚continue–      q P_valuE0get z ,f V .  1has(   = 4, "ä"| ¶ ý yb p s‘ ,_(~ )¦ %<�@ú sextlib. qmanagerl  / £ion_helper©¢ 0d, ŽQ, key˜â `extra_ F = [ — n  y ðExitStack() as exit_s 
‰ u 0ing 1ed. Jings/  $Warg =Q s.enter_| 6ing# 5   "ifK<ingP!isgNNoneq  < 
¯.update(ara  (elc  ª¯is DEFAULTW Nr.appendY ¨ w   l–+= tuple(2 
á `yield ? s¸óeá …œð# NB. Keep the methodš  æ=%e_1Àlable()
    ð    if hasattr(func, 'patchings'):
#     . Ù.append(self)( preturn / 
 a@wrapsd . Adef Q ðed(*args, **keyw ~ Pwith m ó.decoration_helper(D ,n ³   ` . ’ q as (neŸ U, new 
* w %(*4 * 6 Â _@ = [î ]Ô Q * 
<  Bñe_async_callableš,‡Kð
# NB. Keep the method in <  eP J ²/jà  ó 5ÅQawaitº;LÁget_original0*‚target =uvgetter(
Dname  ?Ribute• ÿV ¥ = DEFAULTÉÇlocal = Fals2 :tryFC Œ  .__dict__[} Áexcept (Attr‡ ¡Error, Key
 Õ › 0get¼ (`  , X ,± ì Jelseœ Ä 7TruÃ !ifB  Oõ	_builtins and isinstancek «ModuleTypeŸ  ö`.creat`a "ot’#  _ *$is½ 
¯ jraise  (‘   ñ"%s does not have# !Vu %r" % Â  -$ A  ­™ !, 1µœ__enter__w¡"""Perform~ êE."""® ’new, spec &_s¥ Celf.    % A Bauto  kÊÆ ƒ 6 5new[2  ) = Q( =% €# normal—… to None" !ifå 2 is)
Ñ À / =2  ì 6 Àc_set = None#
  õif autospec is False:  %  u= None
 4if 7 1not I andP  
S ñraise TypeError("Can'tN 1ify 	J (")u -((w /orv )F ;  Í  : P_set ™ ‘in (True,¼ /))¥ ò provide explici¶ S R*and*½ � &")2ôoriginal, local = self.get_ (/ `if new—pDEFAULTÏ 	é  ‘
¶ ’inherit =Ë	ý ± ÷ 
9   #  $ù to the object we are replacingW  : 4 $= Æ   { (?is  I & M (  ’   #elk  7 å# + % j �  ä Ù  M   Œ 
g  ? " ó 	h ­ Ò 1 orj8 !isÏê – A Jü É ˜Puse '¦ à' with create=Åš A   äif isinstance(| k, typec /   ñ# If we're patching out a class÷PthereÂ aù 	! D   ý œ 	# D (S Õ_is_async_objª ¤  K† 0= A- IMock[ e3 Œ 4 ]Magic4 É_kwargs = {}M ô�_callablñ Æd 5new2 	N <Pthis_ù ª9pec\  å V† - N  6 R  —Ulist(1 “  Q 5not÷ Q = '_ 1__'5in A g ´U   }�‘ Q 0if ¸ O| ½ ¼T Š ½ä µI CNonC6t¨ À if spec is »not None:
  ð_kwargs['spec'] = 	 	' !if �_set is L  / P   
U ù# add a name to mocks" ùif (isinstance(Klass, type) and,  Õ `issubc& , ñ NonCallableMock7 ÿ self.attribute) › Â 	3 
È @‚.update(N)� anew = À 3(**1 )G  if inheritÜ T _is_ú _O(new¬  ô# we can only tell if the > � should b( # 	¤  A#çãma list% Pthis_#* F . - N (    	 u  ” (6 Ò.no§  @ Bc: M  4 ¦  =-;@agic@
² . Ìa.pop('/
ú $ õnew.return_valueñ_new_parent=new,   F m='()',{ N  U  ‘elif auto«¶ó�ignored, ®`*must*4�default, ž jtreate‚ò# as a boolean. Sw ŸAheck@  <  É ŠçAthat  Z 	ð #, O ? !if¢ Ò ~DEFAULTÅùraise TypeError(D %"!cÒ s: oâ for you. Can'¤ _ify "H 0andŸ .( 
°if originalé Ç "� Tuse '½ r' with Ã j=True"m   a! =Ÿ( 
& 0 H Wt % =À 
/if¼ sotargetw «¿InvalidSpec²Pf'CanC‰  Ê! {b   Õ0!r}Ž patch '·"f'”   h»±lready been�ed out.< [= =|  P!r}, ‡ $={¡ ]!r}]'j Ë¢à0 ! \ _` = getb (ó  A, '_ B__',áð target)
         ô	raise InvalidSpecError(
   ðf'Cannot autospec attr {self. ÿibute!r} from target 'L {  A_nam4 ÿas it has already been mocked out.K [K =Š  A!r},  $={¯ y!r}]')
� Ônew = create_) (	  , ç T_set=	 ,?  Ô =µ, **kwargs)B Relif  :  G ð# can't set keyword ; À when we are  ¸ qing the*F €XXXX If æ �is a Mock@  could call °.configure_o(ª  • +BType$!"C¤ CpassÅ Q to aˆ  d ¤ "z@new_1  = ’3ôtemp_original =  Ü & ais_loc!  
 °_exit_stackßð ontextlib.ExitS (‡:try0setž (i O!,    æ,¹ Ä H  %+if) @ is 9JNonek  4 aextra_àE= {}Ê     T Æ~DEFAULTH  , L [± ˆ @] = ¹ c �for patchM#inÄ ¡dditional_ ?ersu Rarg =4 y‚.enter_c}(C :ing0 ´   %if€ .è  4 ì ¯.update(ar_  vreturn . p F  5newjexceptì !ifÂU_æ ú_(*sys.exc_info())3 ^  `q Edef :  H 4, *< : q"""UndoÓ4E."""› ÿ2andz
7q,ß ¡ .T ¹;elsÇ0del2	?  OÆ e Ê (&?hasM 5 or P  »  B ªð
 in ('__doc__', '__module D P   D pefaults;  I a$ N 6kwdP =‘# needed Ÿð	roxy objects like django&]tings 
éÀarget, self.óattribute, self.temp_original)

  ?del!   Žis_local etarget Âexit_stack =Z _ & w  vreturn 7 "._' Ò_(*exc_info)
Ä  def start(ç %):b ò"""Activate a patch, Z õ	ing any created mock."""< eresultÀ ¥_enter__()"  m 0._aa !e_] ’es.append‰ * s  S 	µ "op+ 	´ ‚Stop an [ ¸ 	œ 6try1  Å‹ bremove` ‹ úexcept ValueErrorI ‚# If theu Â hasn't beenböed this will fai ‡ è BNoneš £ Ä # &,   Ë
ÈR_get_O( Ð	ô  %, â2 =  â.rsplit('.', 1­ô B(Typô , _ ª Uaise & ã("Need a valid` 2 toõ. You supplied: %r" %g O  Ì ",)’ ógetter = lambda: _importer) ' P. î "

,u…_object(| 	/ ñ, new=DEFAULT, spec={3 P=Fals-rpec_set% _ auto4  Ãnew_callable* ”*, unsafeJ �**kwargsi je½ l0nam‚…ember (`ÕP`) on	â 2 (`Û ‘`) with a¶\ " .v`[ . °` can be usÍös a decorator, class Â or a contexÏðmanager. Arguments `new`, `  = 
    9!`,• `:Q` and8 2a` haveÿ ‘same mean”bs for Ã r`. LikeM Õ  f 	 Þ õ
takes arbitrary keyword a°  P ±configuringN  ã ó %3 it
sDGWhen3(  … shonours· Ñ.TEST_PREFIX`o ƒ @hoosã Ðwhich methodsPQwrap.( tif typeg is st«rª= p2f"{(p!r} musÀidactualó  toM�ed, not af …~¬] s ¡þ‚3 ‚z,i# ´ 6,j±+", E]d�  87È ð _multiple(targeòt, spec=None, create=False B_set /
   Gauto@ Ânew_callable6 ± **kwargs):A ð"""Perform multiple patches in a single F ñ. It takes the object to beL 8 ô d (either as an'  orM Ptring3 XfetchG Ñby importing)O ñ
and keyword arguments for7 m As::
-  Bwith½ .Ì @(setR ôs, FIRST_PATCH='one', SECOND Ctwo' N   2..._ ÐUse `DEFAULT`Ù  ñvalue if you want `– ~ `ê Ä¥ BmockÂ ñyou. In this caseÔ + "d (  ar‹ñssed into a decoratedN ´function by( , 5Aa di þary is returned when¤ !isO ui  ³ó context managerÜ vcan be 8 Ÿ ”or, class° 1or þX n \ G TheÞ`½1`,   ì  !`,9 `ã`ì `ãR` havK�same meanpauÂ  `.t s³X@willÏ pappliedºR*all*Qpes donekF äW\6 „ honours� TE�aREFIX`è  è@choo€à which methods› Qwrap.( 1""" ð if type(target)ø2strå Ëògetter = lambda: _o$er3 G Oelse5 ^ rif not O4 praise VaError(X  ƒ   ð'Must supply at least [ë Ï 'L #B# ne¬ ±Alist&�python 3,ø€re itemsaa viewK   = 5 (Ê . "()b òattribute, new =F 1[0]? ïV_ ì o*, @ ÄØ  æÛ  Þo ¼A, {}q • l 5er.]  _nï=n -  C# Q  "ß F[1:]³ †Á Ì  ˜ Ð % < Ô  # Ø  
 Œ á  0 0ddi$alÊ ˜s.append(S i Ûrr


def Âë7=ú±I–œp �  À Ò% û  ­ ð *, unsafe=Falseñ, **kwargs
    ): 1""" ö`patch` acts as a function decorator, class Ñ or a contextG ñmanager. Inside the body of U ñor with statement,  �`target`M 1is – "ed, ña `new` object. When6 V /S R exitî  ˆ L Á is undone.
e #IfV ¡is omitted‹ Z �  5 ereplac‹ n= Â`AsyncMock iá e #ed¤  9 @an a& Q 6? AMagi? Ð` otherwise. “ H `@ Bused’‰E and¶ J º ¡ created m˜  EsD i‰ à an extra arguy0 toEG b %ed­ Ž ÷ ó D z L ~ ²returned by$ /8 ‡ùò should be a string iŒðform `'package.module.C“±Name'`. The| N €is impor 5 vspecifi¥
Û # hJ l1, s% Y @must¥ ^ ‘able fromâ qenviron]byou ar– @callÐ l 1 ´  gP  gÝ”™ �is execu°dnot at™ µ4timâPThe `õ `8  Õ_set` keywords« 1 pa/& `¤x f• ›i Ò ³one for youÐqIn addiA 1canY Š `=True`?™  Ž  Ò, which cause»
 ¥ ˜ —0 be~  j$ ¼ ß /  V ˆ•  ×_† °€` allowsµ  _  3 ò ify a differentð,¨ 6 Q ,�that will
 "  edJ ü r ±¶By default : åN é F
/s¶‡j ê CrestÚ ð A more powerful# mt_ b ` `autoä `Ó ”6set €‰ t{ Yà Vd a K ó	�P.N àAll attributes•  ¼ [ ‚also hav1W -ÑcorrespondingL H G x r Method:s.H  ~  d »{ 'irPcheckTn|pll rais“á`TypeError` ifM Athey9! ä ñwrong signature. For•"s # ½aeK 2ir 2€ value (J ²'instance')�µ R sameŒ!as}£ÐInstead of `aôutospec=True` you can pass `a òsome_object` to use an
    arbitrary   € as the U ± instead of ñone being replaced.
E ðBy default `patch` will failp /   attributed ñat don't exist. IfL  Ã ¿ ¢in `createÝ Q, andˆ G U doesC !, | { K > 3 1for'Awhen 5 ñed function is calledr J ðdelete it again afterwards. This4 puseful ` @writ'Rtests3 !stI » ¢your produ| Rcode ¸ ðs at runtime. Itd aoff byJ q@becaÐ!itúðbe dangerous. With¶ ±switched oný  $ ¥ eK  o¯ C API¥ §‚actually°!úPîy @used@ð a `TestCase` clŒ‘decoratorÊ VworksÉ   � Peach 5’ method i£D jQreducAÂe boilerplatÉ >ÙXJ ð s share a commo"Åtchings set.·Qfinds =  ¤ P look�  Ù— 1nam‚  at start whûá.TEST_PREFIX`.K t-`_  `, which mFR ±e way `unit"  ‘ sM Yã ¡ðify an alternative prefix byØ …— ˜ ½òcontext manager,Þ  ç ð statement. HereDN H )PappliÎ o ò  indented block; N  IfœL  Ñ@"as"( ^  ÁÆä  buj  —` I  E `; veryõ  %ifí é aµ   mž  ì3youß(Ò0rai<2 `R™‘Error` ifs0ed kd�misspellgoß G@arguA$s ¢Û Ò_ŽP3*  @safeX thÞ `value û f`disabl‘ƒat checkÀ w` takesò…keyword �  c5ese^ Qed ton ¡`AsyncMockñ    –@is a$ €hronous,– R`Magi6 F `otherwF!or  @new_p ¼ Y  5ifi^¿ Ã.dict(...)`,Â’.multiple E- È rPavailg ¥6eS-caseb1"""ª vgetter,¶ò  = _get_target( ), �return _(  ^C a, new,^,è,.  ù  ,/ ð, kwargs, unsafe=unsñafe
    )


class _patch_dict(object):# 1""" P  0 a " §ionary, or b like < ÷, and restore the( N ñto its original state after/ atest.
+ 1`in— ‰` can be„  ƒ ’a mapping‚ ñcontainer. If it is aJ ' @then òmust at least support getting, s	 Ë @dele a itemsN @plus !ra Ÿover keys· Balso¼ 0str« pspecify  qname ofü bQwhicho @will Ðfetched by im¶  H i2ovalues1"f  0 toã 0 inW ¡2. `" `y  v¿  8Qerabl® b`(key,P t)` pairÿ  If `clear`€1Truk  Ö 1be +  Ñ $ef21new€ Œ @ are¯ ^¯.+ç ¢ ðcalled with arbitrary˜ãword argumentsý a "::� )P t ò('sys.modules', my ù =Mock(), other_ P N   /..Ë Ðbe used as a Îðext manager, decoratorû¼Å  0. WßB à  & `Ç ‚` honourÑ ðTEST_PREFIX` for choosa�q methodBQwrap.  &	 ódef __init__(self, À( s= ð÷=False, **kwargs" : .9 $ =C b  =#®5anyÖ  HyÑP(...)D…structorB a [=,  )# ƒ.update(¨ 
# Ì " =Ä
 _ár= None
R% «%fý ÷if isinstance(f, type   qreturn Ç Ü!e_&(fÃ @¢s { pinner(*t~] V R  | 2try   ‘ fW  & fêl;  o !un™ì"()) 7 Y _µ Aö  E h, klasH À@attræLdir(   a    _ý  =þ  )  ,  
ý @if ( p.starts(¹ .9)5	ý  i @ has; @ r R, "__	+")† 3 å Ior =£ î   ª1lf.Â s ”
¹ À    decorateûd = decorator(attr_value)
  0set €(klass,  ,; &ed0 qreturn ' !

G ñdef __enter__(self):  c õ"""Patch the dict."""  - 0._p! _ (i " !in p 4  # r á @s =  . q Ñif isinstance¬ .] W, strG  ½ B   É = _importer9 ³ * 9 | Tclear˜  @ j 6try4  ³original = W W.copy!úexcept AttributeErrorE #rð like object with no M u method¡  x  # must supë ù iteration over keys/ § ){} !fo/ 4 inÁ 
œ  m > V[key]ê  M L_+ 4 =  >1if P
b _ :(D)4 r# ‚.update(9Ýo+U q(s 
Å  'š 2 = '  /unB } cR  n/M+a O@ ) S_exitŸw, *argsíB"""U?¨"ifNÊ is not None• ¯	�ö >WFalse¼QstartU
” ±Activate a Ü", A ùing any created mockXeresultÏ�Š u0._ac e ’es.append‹ u  U 	· "op+ ²"""Stop an [ º 	ž { � Rremov¦¹ ˆVÇó!IfÄ1Ñ hasn't been fõed this will failæ  jê  Öû ÙH # ,ÿ A)


	u 	ö ‚.. ÕÚ Ñ |v = listÏ µ   ,Àkeys:
        ðdel in_dict[key]


def _patch_stopall():
. ñ"""Stop all active ( õ
es. LIFO to unroll nested 1"""B 2for Ò in reversed(n "._T  #esu  y f .Ž R()


 „object =­    Ñ     †multiple  !  f  á X   ñTEST_PREFIX = 'test'

magic_methods = (î ò"lt le gt ge eq ne £"getitem s 1del  ôlen contains iter8 ô hash str sizeof  en$ Cexit ó# we added divmod and r ñ	here instead of numericsµ ²# because t( bs no i; " " O ôneg pos abs inver† ó	"complex int float index¥ À"round trunc tor ceil 0booHxN dfspath a4)

À yð add sub mul mat 2dive  	  ‚lshift r   @xor ¡ ow• àediv"
)
inplac1ð' '.join('i%s' % n ÑnÍ„ à.split())
righŸ6 r6 P
# no(ðcluding __prepare__, __·’ancecheck ƒsubclass `
# (as¾¡y are meta   
   Ð)
# __del__ iÞ€t suppor²"atß x ðs problems if it exists

_non_defaultõ{ö '__get__', '__s ddelete ý pmissing G Wreduc1   ex#  [  Dwnitargs 4new H fgetsta{ s ˆgetformaµ  F Dreprh %di }e… ; 4get— ¿ $
}h +7³(name, funcúò"Turns a callable ãà (like a mock)]�o a real> BtionH Ê]  self, /, *c, **kwg  aareturn? (+ ( I 0.__¨ P__ = 	  > " A


_	%# %ƒ7/ 1 inD &[= L,�#, ‰!, Z$])k N0# Mƒ` as usedf Ñasync `with` qments
_ g ± A"__aOQ__",  5xit 0nex ,}
q  th:rre only  t  g ÂQs but’ “ qhronouss ²±�mselves
_" ¢  Ø L �  õE__"}À  . ƒÐ *| J Àgics

_all_sÔync_magics = 
 ô| _non_defaults
_all !=  s9 G| _a æ

_unsupported8 ð{
    '__getattr__', s " Dinit 4new pprepare * °stancecheck R uubclass . õdel__'
}

_calculate_return_value = § òhash__': lambda self: object.__ ( $),a s× 3  2 _izeofh s! 8 _fspat   rf"{type. À.__name__}/{© á._extract_mock r()}/{id0 1}", l—õ: NotImplementedþ g 
l¹<  
"in[ 1l �contains:UFalse 1len 0 !exP*: )  coÅ x- %1j. Cfloao .D 0boo=V: Trul CindeA @ ao €}


def ú2_eql:4 Â_eq__(other)  *0ret•! =z!._& .º¡H  1 4if 4 æis not DEFAULTT  ' < + >  #A is Š 5  ü 2 I 
  ³ ü n˜\ ü /neü  $ifõ   õ   § â þ ’  ù U  ; â "3 É ã 	 ¡ ã Niterá  ?__(Þ	# ë  � 
àÞ K ß   °  L E([]); '# = ð was already an - ñator, then calling   o w shouldM g 1the'  > – unchange( &  ` (™’   __ '__>H  Da E$ F3 _AÖ@Iterá (  UÄ n( ð - ñ   À

_side_effe�Yethodi $':2[ m n† teO0  © 2 r 5 ðasync_iter
}



ù(def _set_return_value(mock, method, name):
    fixed = / `s.get(& ¡, DEFAULT). #if1 dis not K  O b .| " =4 A  $  
  °_calculator‹  e• ” ‹ = — FNone” ' 	3 =  e !orU  Ÿ Ã 6 E º  +  Ê £side_effecÆ  _T Wn 7if % ?or ¿ < .* * =8 Á ô


class MagicMixin(Basêó_init__(self, /, *args, **kw Ù    ._5KmQ Ás()  # make  À work for kwF @ in _ Æ_safe_super(”  , ^ 4)._Œ ƒ <  $ ‚ 3fix� òbroken by upper level„ •ô Ç  [ ì Qorig_Ñ s}
 ƒ| _async»! Ÿ Sthese 7 = D y  E£if getattro"RÑ@s", ¨)ö A e Ñ.intersection^ ,\ )†  I Wremov¯ Bset(ƒ    " Ñ 8 - ‰ 
Z  þPentryý	E € `   5if + Atype¸  ndict__1  5 "# V “ unneededûé ‘ ,  7delvt ð# don't overwrite existing 6 õibutes if called a second timep ) ="0 - aã  † _  9 	[ 	Th 
"s\J ,[,üaProxy(ù n%)
²NonCallable•9ockŸ! 3ock+õ"""A version of `= �` that isV 5 [ A."""Ò  ƒ‚�add_spec÷ ,    cE=Falª È o d}�pec to a F 0. `9 ñ` can either be an object or ax  E @list¬ Østrings. Onlyæ onºT €be fetchùsI Afrom5 � "IfG  Î `Ô@True) ?n ov  É È  be12 º  ¤Ó86pec2Ààself._mock_setð	_magics()


class AsyncM fMixin( ó):
    def __init__(self, /, *args, **kw(  ,   ¥._mock_setm ‘  # make ~ À work for kwF @ in _ n  F Ë_safe_super(Ÿ  , c %).‘ ˆ A  $ ‡ 3fix† òbroken by upper level‰ 7ockc, Mockó 1"""t ) ’ is a sub\!of. P withHñault implementationsA Ôof most of th'ömethods. You can use k  U Ñout having toJ žconfigureI Q your
+  If V  u ¡`spec` or 
  Á`` argu¬ sO ‚n *only*AD ¤ ° that existÎ O  N ò will be created.y àAttributes andZ Ð return value5a `ê `G @alsoL  1s`.… ‡ ª|@add_€ ¯   ,   Õ c=FalseÂ o`"""Add¸�pec to a F .`{`either �an object*a€  E lû öof strings. Only aê !oné \T Âbe fetched a I 3 Afrom5 � < # "If›  Î `s1Truð n  v   ü È tbe set.2 N ´86pec2)æ , à
Nµ…Proxy(Baf ™² D ç, name, parentŒ  . ! =# 
z / # =8  ] `Å ôR qentry =8Z S N u   mf ²._get_childa  Ÿ =W w, _new_ @  Z 4 o = at( #, g m"  õ_/_/, m/ , ' & m)_Í Èèobj, _type=Non: ]82ock7î÷await_count = _delegating_property('$ '°  5  # 4 _€9 ( (') {Ú k K’}+ þð# iscoroutinefuncëå() checks _is_   {—say if anK o[6 `. With BthisY ‘ it looksJ  eeJ ð it is a
       ô' # function/method, which in this case it is not (sinc Can
  ×# AsyncMock). I: ðset through __dict__ because when spec_' �is True,~ I �attributeŠ ölikely undefinedr Tself.c ð['_is_coroutine'] = a§ 5io. )s.% s J ñmock_await_countN 0/ Aargs. ONone1 B_lisd µ_CallList()= Pcode_’ ` = Non" @able(KŸ=CodeType7  à.co_flags = in2 åt.CO_COROUTINEi _z _Ï   … 
/ ZÂ def _execut¢ `_call(H `, /, *`, **kw
 !):<  F0# Tq i°early just ëñ super(), except for2Çial handlingH 6of ß�  a Š 1 = Q (( #, ‡ `, two=z. ´ .òU += 1g   J  X  ê   Ð�.append(Š )š ‘effect = U Rside_ N 2if   ÿ ‰ L< ß 0if Ê#Bion(1 b &   SraiseP b   Aelifç¡  RE :try€  A   PresulÍ Dnext@ 	g  & §   StopIteraƒP "# Eú
impossible to propogate aE j  n #�¯of PEP 479< . © ã® - �
�  “ W # 	K …%is© ¡K&E  Ý ŸÙ(je /seI ;C 	D 3if z  ´¯ot DEFAULTX Cturn. ÷"ifñÊ0_re% Q_valuå æR ) ;  5 Y _wraps8
n‹š A Ç }  #� 0 = ö ; e 5 r2  ö  wbassert¤!edsµ 2"""L À   Assert thóat the mock was awaited at least once.
  5""" �if self.3 Å_count == 0:"  5 Ðmsg = f"ExpecZ {5 _r  _name or ' ô '} to have been‹ .r  P ñraise AssertionError(msg)
w Qdef a _˜ 0ed_Â (u )š È L ? thexactly?not1u  ¿ ((‡ 
 Z s   f" AÀf›¡} times.")(2  OAwithOð, /, *args, **kw
 clZ� u S ‡pspecifi€�rguments| z Š is Noneoev=�r_format~ð call_signature(F #, È %%f'ÓÊ 4: {n d}\nNotÁ'› s Ÿ _e´—_message(3 " ! ¯.­ ufailure7 ® @, ac!='Š 'ã’eturn msg# f ª  êmatcher(_Call(¶, two=True)_ oactualE Ã � _¬ 5  if¯  8 4!= ‰ 
·fcause  ô  if isinstance(5 p, Excepû a) else»‚q) from v $ ¨G _ªý- ì÷8ed `P and f 
Ô a‰¾ °  rÈX
ã 1(‹Ê"nyÂ&)‰has ever¨¶  ®ÈA†¸.Àon) else Non3e
  ñactual = [self._call_matcher(c) for c in  õawait_args_list]G ð	if cause or expected not: Ò_AnyComparer(p %)::  ˆ 2 ’_string =n Â_format_mock™  signature(„ @, kw )M ùraise AssertionError("  s A'%s Î ¦ …found' %¼ Š 	7 b) fromè 
 Qdef ai Q_has_P  s(* , I÷s, any_order=Falseù 1"""E  Ž ® P the í ’ has been£ qed with ’specifieda .C ±The :attr:`ˆ ¦ ` ¬± is checkedÕ l ) "s.Í  ˆ EIf `² `3 ¶   (. €default)ˆ n ž †s must bTòsequential. There can be extra¹ a befor0PafterP Ì å ¢ @True> 	“ q  in� �U, butc Bthey¹  all appear­Ch·¸?0-‘= next((e’e€ S ðif isinstance(e, ExcepÒ†)), None÷ ´*Á = _CallList‰ÒT !if
²%if+'  i#ll
+  X!is» "  & Àproblem = 'Ais[ œ%.'º *   OelseH !('ÿ€ process\a1>.\n[  _  E ‚s: {}').•R1  ?[e Ç Â Ü A   Š	#]­( ü . 3f'{o}3f'EÊ6: {VÊ)6 AS0: {	.g�}n	X œ  freturnž	ç Ô( )' Anot_5 —s @kí%in¼
@:try  ‰ c €.remove(E 
{e›a ValueqG • .l+ndF n· 
= Ó1'%r- à ü  ’ Eýð' % (tuple(not_f—ound),)
  Ñ) from cause
 ñdef assert_not_awaited(self):"  ? 5""" A. ó
 that the mock was never B .0 < 0if Z .% ¶_count != 0j  n ñmsg = (f"Expected {6 _k  _name or ' õ'} to not have been‚ ³  U  Bf" Aä U ‹ š} times."5braise ÷ ÖionError(msg)BQresetŸ :ð, /, *args, **kw
 N÷See :func:`.Mock.K /)`Exsuper()* l 8 8ã O = 0  ¢  = None ð_list = _CallList()


class Async¿ (
 cMixin, Cagic  & ‘Enhance :M  :`# ð	` with features allowingï ù¦ @an az  ARtion.“&ThM ‘ ñ` object will be1!soÄ !isW írecognized as e Q, and7 òresult of a call i/  aRable:� 2>>>&=Bock(d  ´iscoroutineÈ (ã " 2Tru“+  ns1.isÔ d + '()- u     ``R D()``¤ 	8b which Ùboutcom} ðof ``side_effect``ƒó``return_value``ð >- i/  ¨,?
¼~ Q   ‹&  Ä r", j pn excepl Ù"thã  3 ] @iter}\ È Qnext ( 0 `E 0how<,8  Pseque$of › ¥ ðhausted, ``StopIŒ  é Ü®ßd immediately+ <PdefinR  } –É 8 L by 0, hÂ , default-i å Gus a new»ß IfX   Oœø ö  MP obtaQ whens & -ô"ed¹Sbe th¦C it‡  (7 oR ö ß í)ù  ÔÐtest author c. @lso ðify a wrapped obñ,ject with ``wraps``. In this
    case, the :class:`Mock` ob; ±behavior is% rsame asS !anC 9 .: :/  s 4pedN ò may have method‚ pdefinedV åasync function	 1s.
i 0BasL ñn Martin Richard's 9 €test pro¹ .1 a"""


Ø b _ANY(Ö "): „A helperŸ òthat compares equal to everything."‰ ódef __eq__(self, otherW  V¸return True2 /ne2 IFals3 Crepr5 ` â'<ANY>'

ANY =ã Q)



¡ ðformat_call_signature(name, args, kw X ðmessage = '%s(%%s)' % / .N @ted_4  & '   p_string  , '.join([º �(arg) forq 0 in 1s])9 } ;    H`'%s=%rˆ ²(key, valueQ   X M r.items(` g !ifu h ú [ Ð É € #if ;  ifÓ 4matV Z  b+= ', - ½ g 0A”%q  ä×£Call(tupleÈ õ h !A   : P hold¡ èÐresults of a  ä a mock, eiÊ R +  $`É1o` or `K`«Iv ( Þ   are emptyn{  ¹ T willyxy aÅ  Ã’out thoseÓs. This makes> òisons less verbose::Q _, ('Ôô ', (), {})) ==  ;- /1,/  ] (1,)4 Y „'a': 'b'a { ",)“ QThe `” oñprovides a useful shortcutÇœ É ½à  P(1, 2­ r 3�  ê ], a=3´ @'foo< H.foo@ Ÿ IfÎ Å q has no2  0n i{Áll match any › gª£_new__(clsã=C §P='', �`nt=Non«1wo=&,‚  D   from_kall=y   Û3 =   •E= {}G ²_len = len(h 2if  := 3ì ¤ 
N" =Ÿ= 'el? 2? Ýfirst, second:  © äif isinstance(0 tm '    Œ ð = first
         ôif isinstance(second, tuple):
&  rargs = + " Oelse8 /kw: 6  0 %, 8 lfirst,y êelif _len == 1{ ‘value, = 	 	¬ 
ø   _, strõ  OnameD { >F = Ï H 4ø W 
¾ jif twoé breturn·ð .__new__(cls, (v E&))G 3  ñ ,, 9 � òdef __init__(self,\P=(), 8 Ó=None, parent ¡two=False,D Mè from_kall=Trus ] p._mock_X ! =_ A  l # =u # f & =r 
Ó %eqÑ Hothe:trynAlen_% q = len( )x úexcept TypeError= xâNotImplementedŠ   Ø ñ %''T !ifj   )é2U   _± <  E f  n  W/lfC D ³if (getattr '¥†0', d) and (  /, ) Y  ý    9  — üW A != F 	 ¬ZjQ7 ä = = RÈ:= 0R7 S T ë%{}¹ ?= 3K  Å,Å gW  V Ü
8  CÜ–? ’ œ P #  ü    LK  n z~ <g  D F = (› 2     Ò b    Ñ 	ÑnÀ# could be (Ë ,D) or Z   † �à i 	Ñ â	" 
Ê0 ¦Ó  �  ä +	J ð     if isinstanÿce(second, tuple):
   Âother_args,   kw 4 = ? -{}: OelseP 3(),T 	P L Œ  Š ˜ ]firstK G Õreturn False
s óif self_name andö  !õ  
ß L õ# this order is important for ANY to work! I (à a) == (¢ ý  ”")
Ç ò__ne__ = object.  Ádef __call__H b, /, *M #**J Þ b._mockkis Noná¹ ²_Call(('', S Q  , Bb='()')¦  m  J(lfa  + ( [  ñ - h  Y �, parent=2 ÿ ugetattr  ô " s =I Á, from_kall=])Ê  $ Â = '%s.%s' %Ê
Î 6ttr1 	V > = 	Ú o  a	ë _ibuteð  ¹ 2 in–.__dict__ ®¡raise AttrN UErrorÛ ª L3.__b) 
w ˆ2get‹‘arguments“
‹2len  û2“ dI’ ò<4 5 Ç $ N‘@property+  \ $ ™ ” ?  r.Þ O)[0]P *R 1R  ” T__repØ
G1notÚn¤½  ä #I)  @or '4'þ  )   !ifÖÀ.startswith(¹x  &   E =D ú  	M ;  ?if ÿ	 -  P›  �", SÐ U  ½   ï !otó 
5 ! ‹ 'el9 ,' ] ¿  n Ã    ' f Ðreturn _formaðt_call_signature(name, args, kw Á)


    def - ±list(self):   �"""For a" ñ object that represents multiple% Es, `O `I  returns a g ó of all the intermediatB € as well 5theD Qfinale E.""" •vals = [] €thing = Í  bwhile  ¶is not Noneì  ð "if" ú._mock_from_kall&  *  v �.append(U )j    ) =N eparent' p _CallL|�reversed(\ )  I" =# (� `=False  ¼ð reate_autospec(  ,  B_set, ¤, instance _� =,“  º  _3  • *, unsaf? #**EA"""C‡ 0 a 9* us‰tanother a   ð . Attributes onŠ B pwill us²Áe correspondP 6 5   `N `` QtheirL   .éðFunctions or methods beR  r 1ed t 1havu  ir/!umãqcheckedS 1to  rthey ar»D  thÊ ´ 5ct „‡ "If°  ž�` is Truq �n attempt’ `to set !v¢don't exisH6îÿ Å ¥raise an `cfError`… pa class‚ @usedmaI 1the� ¢Pvalue³ ¯ +$ (—W S )IQ sameZ ‘. You canÙ�  as0[ ®  fqn²Ø aby pasQ`w =<c`. The­ !ed�N 
bonly bŸuable if[ s· Õ Å & '!`cÖ]`Ú ^’ `Runtime[ Z  ¢ `ed somµAmmonŠ µmisspellingt 3arg]»A and( 0. Pž s* K `‰ Š iŸ 
p to disÁ �¨Ì ÷also takes arbitrary keywordüy Ý !to‰  š ´constructorK2†.§pif _is_û b#!'tÜß Ð  g Ÿl Ras itŒb #LDpretÐ r  š 0str|¹  áib= type‘ #0is_ T = is…   ,+ ãÍ   *% Ö "±InvalidSpec#`(f'CanzóS Mockä5. '¢  ¦   2f'[† ={Ä S!r}]'— Às_async_funcð = _is_async_func(spec)
    _kwargs = {' 0':  } !if Q_set: 2   	6 #el8 † is None< # ö we mock with a normal Qout az u › » ·and instanck  0['_Ð D_as_$ ‘'] = True^ Èif not unsaf? Scheck< ’rg_typos(-!)
: b z.update @KlasU‘MagicMock2  if© òpect.isdatadescriptor“* Ìs don't have�# becauseU' ñknow what type they return… ÄO´	$‹ ¶ _ F óraise RuntimeError("I‰A canY!belð when create_auto–% "’  P   1"isqing an Ã ÃRtion"Ã 7 pAäpÖ  Þœ_callableg8 CNonC# 
³C  is (e j \ Xe #P_name§a`.pop(' 1',  s1new  ,    > ¯if _parentrõfor a top level object no _N Ñshould be setT  U  B= ''õ¸!= 8(u =}  « #ew   ¬ =P ,c  g  ! same, **[ö  �sfÂ`, FuncfTypes)­## Ì Àonly happen 'he4�  # recurse 7is  ÿ  ô°_signature( ,±’µ t£  ð  A #up  ? D > ?els‰ m  9,#, ™,W¡2ˆ  ¦ ˆ³L” .  ._Œ ¡_children[l /  Ø Z  \ O ` 'kq_value'2in Øp  P .* , =é ï  .ä =¼C  X È @='()P¶ ƒ / ì½entry in di� a@is_mÍ() r s %# 6Ð already does}� useful > � methods_uX E ‚continueh  �# XXXX doÝñ
need a better way of gett‘ttributesUàout
        # ñ4triggering code execution (?) Probably not - we need the actual
    ð# object to mock it so2 Ówould rather o ñ a property than3 L  a ! ñdescriptor. LikewiseY &ano ÷ out dynamicallyL ÷provided attributes. ÀXXXX what abE &  š @t rao Pexcep2s oÉ 7hanF A\ °Error on beT‡fetched?+ Awe cñbe resilient against it, or catch and(PagatevG ’ P when á C is z Q from  –@ Etry:  Áàoriginal = getÕ(spec, entry), w  ð 
K •continue
5 °kwargs = {'U 4': o }$ 0if  J_setO =  ! 	A B  § isITance(f `, Func¿jTypes)a ø new = _SpecStat7 ’ ,¡$, a  C a ._ ¡_children[>u] = new© Jelseƒ 0par=g (  U 7if Ñ  � Í  4 	N .‘ ‹   �skipfirst÷ Pmust_ ðš, is_typeâ ‹À['_eat_self'Û  = O ¹ £coroutinef€“„ — 5P_klas+™AsyncMockV ;: NMagi: æd ('= q, name=°w, _new_ 	„  r 
 / H O 2 "**L
` «B  ø _check_signatur·Unew, —=
 )#ž–ð s created with cX u becomeõg%s,æ €# *plus*j ir underly Ô º exists in  0 of2  <N  6 P. AddC ,to7 ðmay be unnecessaryr‡are alsoN @settI _as anÉ  Ÿ
oH;	s+ ¯ 3newiSreturÝ

def _o1"""¾ R@ 1whetQwe sh; Ò9x` argumA!onEA's `Ê`G  ÎùøÐ"""
    if noót isinstance(spec, type):
  óif entry in getattr) ç'__dict__', {}3  : $# W  3 õibute - shouldn't skipe  2 Åreturn False  “ 0 =  ±.__class__
 Pfor k  š ! Vmro__¼ ‚result =( .° Q.get(Õ ¡, DEFAULT)S  ‡ 3if 7 $is R  " vcontinu¥ (ifF> ñ, (staticmethod, ¼  ),ú /elW ÛFunctionTypesI ’# Normal h 1 =>gñ if looked up onãñ  Ó <# ($ ¿P, selá � alreadyS 6ped3 B Ä 0is_@] Jelse>) ç( 3# fÔ ö is a dynamically providedE3 E n !

^ò _SpecState(object):,Ðdef __init__(Ð ,S Q_set=� á, parent=None,j  Ü  Bname D ids
 ?C ’ h .™ÁP  Pids =G 
  0  ‘ 4   
! ¢ # =« 
 µ Z — 
!  Â 0 =  9


LA = (- …# python—  ×À(create_auto© )$ìy1 ðANY.__eq__),
)


file_< 0 = f1


� to_stream(eS_dataK!ad Y, byt0o.B 'IOK ’ 
�/ jString0 —  mock_open(
 ñ¡ 3=''¤ 1"""b …A helper;B to 50 a D   ðreplace the use of `e ±`. It worksN  â  àed directly or: 0d a1 ‘Âext manager.ôPThe `s  ` argument` u    " � ð configure. If `—R` (thâ€default)¯ ón a `MagicMock` will beã  d ² �you, with1 Á API limitedÔ #to�sÄ °s available¡ ‘Pdard /ƒ handlesØ `€`Ð 1a s¿|  Ý   1`,  –line` and  s`qÞ a  q.  This_ tn emptyf 3by .Ð ú_– O = _Î/ _Ve = [1 ,	]¶ L  º ð
s_side_effect(*args, **kw
 { �#if$.: .Ê `_valueÉ 1noth à:
            ò	return handle.readlines. ƒ_value
   ¦ _state[0]0 À(*args, **kw
 !)
5 Pdef _U Í_side_effect, :,  d (ifŠ 	… Æ is not None1  5 – Ã 	9 ] ( 
¾ � ¹  ½ ùyield from _iter7 )‡ ›while TruÇ ? 
ž  ~ ¢ 	g 
L J 	P¡  l¥ kX è @for  6 in2Ÿ N  % vJnext;5 Ô &ü¹ ,  ˆ (�Ññglobal file_specî &if  W
£¡import _io-  ø ? ù = list(set(dir(_io.TextIOWrapper)).union" £BytesIO)))– ~if mock|  ð
= MagicMock(name='open', Á = G  0 # ¯ Å' P.__enæ_W=ÂÒ, @writ^ lT! =Ê%  (L  K$  0( 
Éu R .ž. =²0 $1]"  ˆ 
©( Î  " \ </1], s-   E sh : _j_9 
4  Û_4  
Â Ã­reset_data�œ 0  to_stream(Ã ; = ÿÆ w 4 ==0&1]_  9 q# Only � P the 7  V1 if ñuser hasn't overridden it. G   ® Î ,   Ö 0 ErDEFAULTK Ž©Ë ž " ; 'z   ìñ


class Propertyß  )41"""4 A/ ð
 intended to be used as aó# property, or other descriptor, on a class.
    `P0 PMock`> ðvides `__get__` and s ñmethods so you can specifyO ña return value when it is fetched.
( F \ing a‚ ñinstance from an object calls the mock, withK Ðno args. SettS i- , ; –  be' 2set1"""I Adef õ `child_g à(self, /, **kwg !):,  ;ê PMagic>($ ä P Q _H @obj,Ð ®_type=NoneO  r !()e A yA 7val7 0   0


1 Pseal(¼ $ ¡"""Disableñ	automatic generation of ô [s£PGiven�`input â  , ^ sÒñto ensure no furi w ”s will bea !edÍ `access~°an attribut™ õ	at was not already defin1@The Ù± ³recursively“ ð passed in, meanl Athat„ %  it7R, anyô ­ F by § 0one6its¯ !s,M  Ãall assignedI  ˜ out a name…   A Õ  Ay 7.p_ q = Trueg 1for{ x in dirÛ D 6try’  pm = get], ,> Q   „except A}ZErrorC ccontin€  4 !ifš$is�°(m, NonCallZ o /   D @ ð w€ren.get(´ È), _SpecStatT mI ‘new_parenm R
Ô  Ya(m)


ý� _AsyncIt �QWrapsú  | ± 3 `hronou; D d_init_õiE ! }. 4 =  ñê !de, =h(OÖ_set=CodeTypeÜ#co7 �.co_flags] n2 õt.CO_ITERABLE_COROUTINEr “ Á__dict__['__L a_'] =   SØa Ÿt __anexë á –, . Ëþ ½ ™BStop—:ionÄ Û± `raise . Êðion
"""Test resulto0ectÛ¤
import io
 4sys ±traceback

y#. . Butil ”functools w(�

__unittt ¸‰’failfast(3@5  Î  ¶Qinner0, *hr5  %if× ¬4, 'a Ð', False):
    Äself.stop()
 àreturn method(" Ò, *args, **kw) % ðinner

STDOUT_LINE = '\nStdout:\n%s' :ERR 3err ñ

class TestResult(object):“ ñ"""Holder for test r' á information.
,  D   s are auto" ñcally managed by ther �Case and QSuiteI “ 1es, òdo not need to be explicitT bipulatX ¡writers of« s™ ñEach instance holdsƒ Åtotal number4 B runz `collecá  R š �failuresš PerrorJ ñat occurred among those„  O ws. The P M Ðcontain tuplec   (a°case, excep|  hp), wherû    i} 3Œ ‘tracebackÒ 1he § 7 th¦ .€ 1""" �_previousÁCR= NonZ _” pRunEnteá c= Fals ømoduleSetUpFailed  Ãdef __init__Ëpstream=^ �, descriæ s ‘verbosity …  
.Ifastf 	 �A= []Ú  .s   Ý ŠsRun = 03 QskippÑ M pxpectedò p 3une% �Successe} ¯shouldStopÑ obuffer €tb_localX ‘ñ !_s_C  r
á  # ?err# 
€original,  ouxBsys.\ N +  er¶ + ;err+  mi:AOutpS ¿ $  2`printE" s5@"Cale!by2 RuT afteœ2un"� J PstartÕH ,�N  Awhen0giv
  åPis abò srX  ]  ‹9A+= 1¼  _à     > b_setup¨&()² 	  * ¯ 0if  .ÓŸ Q     ¨Ô!isÈ
,  0 I - ×= io.StringIO’ 0   4 6out54 ÿ E=º  q = 5] We9  - Ë #Õ1RunØ#$"""oê@befo‡!nyû•ƒexecuted } ESee W éa� » \J eI úA <  EÊ q/oppÀ     """Callð ed when the giv
 óest has been run"""
  ûself._restoreStdout() ñmirrorOutput = False
$ Kdef =  Q !):  c 0if  v.buffer  _a 
#  ' oy Qsys.s£ —.getvalue¬  +   e­ 3 = . ?err. 	2if ` x  M cif not# ç.endswith('\n'å  *  R @ += ) # £_original_× ówrite(STDOUT_LINE %| ”F 1if ë ¹ 
" ¸ . ·  `· 4ERR· L )'³ “oG	,/ 0errÏ©1:err/ " J_pz.seek(0=y 
( |truncatP+ ?errS ( S §  ,ÀstopTestRun(\ Dö"""Called once after all tests are executed.VDSee U ò  for a method cM H AeachI .‹  �  ‘@failfast  ¦ @addEE£ ,8 ,l® m an  !orgñoccurred. 'err' is a tuple of ·As aso  Š ±returned byµªexc_info()®  ,    9._ s.append((%,j_@ â_to_string(errÈ &))H 	|c = TruÜFailureo ¿   É  Æ?ureJ0SubÅ	2sub„?err(!at“0end#a 1 ã-qNone if/ & õ ended successfully, otherwise it's aQl dð# By default, we don't do anything 	’ Ñ Rs, buL œð # more sophistiddRð results might want to recordü më I �  
õÀif getattr(sûelf, 'failfast', False):
  ¹self.stop() ðif issubclass(err[0], test.V ÏureExceptionV  ‘errors = _ 1 sa Nelse� 
9  
7 Z À.append((sub” ,i ð_exc_info_to_string» ¸ *))â › 0_miQ áOutput = True
q ð def addSuccess(. H ¶ á"Called when aò has completed s? afully"X  €Jpassf 7kipc i, reasZ/""m Öis skipped.""`  ­ . +(Y ) ù ExpectedFailureŠ 7errá‡ 3n e<  æ/µ occurr˜ 1 m sÌ "(® É Ö: @€  í ¾$Unn È]6wasÞ !toá R, butÖÜ up eß  Ñ v3was“ 1fulq
fPTellsYð	ther or not this result ž aŠ )ssþP# Theˆñattr check is for¢_A r's OldRM  � q.  That? ƒR# ways ðmethod works on objects that lack the o gibute.D ±(where woulhÀ �instance.�e from? o% ætored pickles?µÁreturn ((len2Šes) ==  � e0) and�  ×   (M0has² J ?, '» ]') or= i 3  Š '0)é\ È
àƒIndicateE @ …As sh+�be abortf# MStop², } ^, errÀô""Converts a sys.Að()-style tuple of values into, ]	w‚exctype,* `, tb =v Aa# Skip„à runner tracebAVlevel"0whi} b¿Üñ is_relevant_tb_1 7(tbW Ûv ¢tb.tb_nextç  3if ¢   l?ÉÙ 1 ¯ Ÿassert*()­  . dlengthòn_count° s± F ENone( ftb_e =€ $.T7» ð(
            ex÷ctype, value, tb,
  ólimit=length, capture_locals=self.tb õ , compact=True)G õmsgLines = list(tb_e.format())
( 1if Q ubuffer:  Ž ñoutput = sys.stdout.getµ (k  + Verror* ?err* 2if X 
l  E cif not þ .endswith('\n').  2 J @ += % 	½   ó.append(STDOUT_LINE %h 
È 1if Ë o �  œ * › 4ERR› < š ô return ''.join(× ")
Èðdef _is_relevant_Pevel(Û _?L ð__unittest' in tbT÷ frame.f_globals_ ^countb sc ¹E = 0’Áwhile tb andå š .µ 'tb¯  ÇP E+= 1Q   Ctb =¹ Enext ã 7 Ä q_repr__³ c / Â("<%s run=%is
 pfailure E>" %e  � ò   (util.strclas1.__ B__),] f‘sRun, len .â*s)ø T " y ñ )))
"""Running L °"""

import� Dtime 0war0 £s

from . / cresult vsignals rgisterR$ 
$0 = `1


Û ó
 _WritelnDecorator(objectWÂ"""Used to d" Âe file-like +  s Þ² a handy 'wR €' methodã  ÝS_initºs,streamj  # L  ƒ ÷dgetattú ,  ? !if  "('G ü', '__getstate__€ðraise AttributeEþ(W  V| õ] ,) *  Þ ù # «, arg=None¡ *rg“ô : F(arg+  â) # text-mode € °s translate¡P\r\n ÞUeededâ‚TextTest(7.   A"""A” "   ò that can print yt3ext+ s~ a• .±65by ~ aunner.,Asepat²1 = '=' * 7j 2 - =  i_Gy ó
, descriptions, verbosityá aUuper(” Û&).U xO Ð
        self¢.stream = 	 #
  úself.showAll = verbosity > 1% Idots" -==#  escription+ d 
M †def getD (� �, test):$  ™ ñdoc_first_line =   § r< )1 0if I .s Z and J b  f ñreturn '\n'.join((str(‹ ,9 )k OelseH = ì ŸstartTestç ‘super(Tex$ qResult,É &).; ‘ ê ´
Š âa.writex .sQ Ñ  9 " ... "' vflush()í ¡addSuccessv Õî 	< ž ï $oln("okµ  ô   %el:?otsM?'.'WErrorW, errè?  9 (_ERRORGEbFailurŸ)â ‚A 2OFAILGFISkip4oreason7A ; 9(óskipped {0!r}".format(X  e  i/"s�Õ  R´addExpected ÐX"I G ¶o  Ë 2‚ “ež " f÷Ý  i   8x[ À    self.strñ'eam.flush()

    def addUnexpectedSuccess(self, test):*  . ðsuper(TextTestResult, + /).F @ ? !if, †.showAllX \ pelf.str£ ¥writeln("u˜ " s™ %")O 6 Ù     $elq Odotsn ?("u[ |  4¢printError+%u ? oró ß  w.ˆ ÂList('ERROR'”!.e  R 2 DFAIL1 ‡failuresa  C ³, flavour, b \1for5 3 in" !  ™ E ë –eparator1µ 1 Ä"%s: %s" % (� E ñ getDescription(ƒ)P < s� 21 "} ?err, “…

class ;´unner(objecaA"""A<! r  3 ñ that displays rtsZÒtextual form.Î1It °ñs out the names ofY @s as Py aref ¦%or ß0occÛÑand a summaryB %he a^ 4end  g S .D 1""" ¯ É =þ Å ³  Mƒ__init__u†=None, dËñs=True, verbosity=1,f  #  Äôfast=False, buffer ‘ a ‚warnings P Â*, tb_localsF ìæ"""Construct aá Á• š 1Subó"es should accept **kwargs to ensure compatibility²— òinterface changesp d t   „K@ is I� Å= sys.stderrb ! "_W‹ADecoš(žó0 ¦) =µ
Y ¼& =È
# Á4 =  
! Ò# =Û
 ¬& =¸
# ò4 =  ! #ifä¯ >?notB ®M( =8 ÛBmake)Þ<breturnJ ' È^ H«1run= ·À  "Run the gòiven test case or “suite."
  ñresult = self._makeR '()$ cgister 3   C ….failfasL  G ( dbufferr  $ ”tb_locals'  * ôwith warnings.catch_ 5():(  è "ifß   
  " ,# $ õ is set, use it to filter all the} 	k  M g r.simple7 (a > 1   ‚  W /   �'default'¾ñ'always', special-Ø=the€ #› Q from­ ñ deprecated unitpmethodsÛ @show( mM  ðno more than once per module, beca#ÿthey can be fairlyK ôisy.  The -Wd and -Wa flags> @used” ¿bypass thisK  šonly whenÛ 8]None.3 á5n [c$, a]  º.  "('	-',q  6   zcgory=DˆBionW½9 Ðmessage=r'PleÉ lúassert\w+ instead.'Q÷startTime = time.perf_counterÚ Ÿ , òestRun = getattr(æ8, '  0', ]
m  Yp D ais not) KN ‰ >try0  ©Œ 
v ofinall2  SstopT‹ Ï  Î  Ò '  SÑ  0 s Ô  ˆ ¤@Take�3 "- -&imã–Ç.printErrorsq kif has¾«eparator2'�ãstream.writelni%.s5 tr€  –EsRunôM q"Ran %dxå%s in %.3fs" %7  = `(run, o A!= 1#0"s"1"",Î*)› } %)
e ±expectedFaiQ$un �Successeg¥kipped = 0: ’ÿ  / ”map(len, 4T  f Oures× õ M .�  < sµ À   except At÷ tributeError:
  Epass Jelse ôexpectedFails, un õSuccesses, skipped = results
Q ¦infos = [] Sf not+ C.wasJ Zful()} õself.stream.write("FAILED")O  Ë �failed, eß ‰ Blen(� . wures),  + sG 0if - *ed†  b È �.append("&  S c=%d" %5 L c M ' sK  &edL ’ 'OK$if‘
Ç 
Ã ´w  w 4if éúK 	)  A 	[ F a 	/ $ sv¹  FeÔ1if õ 
\ @�ln(" (%s)Ì±(", ".join(< 6),)» �'\n�m fflush(N creturn	ä
import signal ó	weakref

from functools - ó*wraps

__unittest = True


class _InterruptHandler(objecthÐdef __init__(« ², default_h0 )     Q.callaUFalse… „original< , =N 0  š«sinstance(t D, in¢  y   ,ifL 3 ==-Š.SIG_DFLç 6 ä# Pretend it's/ o %inç  Œ Eead.¢  ?   -  u  F 	= /el´ ?IGN´ ðNot quite the sam	 ping as ë �IGN, but @closùw� ·   ð# can make it: doxOhingæ `€(unused_‘ umú Wframe i  	K  0  ’raise Typ�$(") Þ 3INT¨ syto be "^ H  "« !al$ ŸDFL, or aH  åRable -Ïú  ç« ] L ] ‘  LE ~Y; , bal.get
 (  Þ 6INTF K I ˜? ðis not self:
      ð# if we aren't the installed handler, ón delegate immediately
G  @# to+ „ default@ 	% Sself.! _a õ(signum, frame)
1 1if 0 c� :  o  I  (   , E u = TrueK pfor res¯ Bin _ Šs.keys()r  ”.stop()

, ñ = weakref.WeakKeyDictionary()
def registerRi (I ^ G [ c] = 1
6 Omove4 Äreturn bool(@ C.popZ p, None)¤ ”interruptl! = a êHçï �global _; 4/if  1 isV 0™0 = äbal.get
 õ¡al.SIGINT)]  ¬x T = _IÈ ­ a @ ^ . 
e ,»  ()
m^ qmethod=GÕ 2if   ì ;notð r@wraps(# �  ýðinner(*args, **kw
 ý ñ   initial' 6  re!´ v   2try¹    8¦ “ ƒ / ofinallD  Y`È ‹ r Ø_$s‰ 
FP.origÕ 
ó)
"""TestSuite"""

import sys

from .  Kcase ôutil

__unittestZP_oÀ_if_exists(pbst, attrý func = get 	" ‘, lambda:gO /  xµ
class Base¾ s(objectY Á"""A simple š sâ   that doesê‚provide M ñor module shared fixtures.  …_cleanupë    ä __ú0__(j,u Cs=()�  &    ._Ž as = []X  Ëd! 0  0addì !s(A "y Crepry o xC"<%sŽ €%s>" % (·A.strù ° 1.__ ‘__), list  ?   f #eqd d, otheÃ ! 0if �!isOAnce(" ,»\ 
�¡ @NotI¨ementedõ  � 2 ==› \ 	?ite  Ï ð ._tests)

    dóef countTestCases(self):
  c 0 =  õ ._removed_tests$ @for  1 in( >  E !if 
   [ !+= .‡ )^ qreturn . 
 pdef add´ ¯ ,B µ æ# sanity check© ðif not callable(µ 7  • ùraise TypeError("{} is7 Ò".format(reprD )¯ Âif isinstancb ñ, type) and issubclass9 ,Ð  x  (	.ü  ° , 
 oSuite)Ê  *  4 sŠ   8 ¢s must be ¶ �tiated "› 
õ"before passing them to—&)"; l�s.appendü )Í}ÎsÎ Sgs, str#  ?»s Þ pan iterù" o”!s,ÙaM 7ing´ ÓG 
¿Ó ƒ   Í 3run–gresult¦  V Rindexä  0‘enumerate4 ,  Ò 2if D º.shouldStop‰  & Ybreak® ’ (: ‡ + !if¡�._cleanuM  Ú è #0AtI± (· M •d É9   Q ", ? ¼ 0"""Í P hold@°a referenceG1theÙ ¯2 at? 6.""•6tryN  Û  ô ¨  !s[u ]fexceptÜ
@  # support ¦sRò implementations that have overriddeò. ‘  | <lsep �Some unit® Ãs@E noný /„§µ objects toV  g #| ° . ’if hasatt¤:, 'c'm M  ­æ ¡9  É ww = None_x!__éè, *args, **kwdíZŠ  K
( O QdebugL È a"""RunŒ ð without collectkeØs|agR¦\  ?  $  ˆ 
¹  .~ A)


ÍI §U(Baseµ› A"""Aá¨ Q²a composite aconsis¢ °of a numberª N  	"s.þ ðFor use, create Ùp/ ‹ ,nS ´ Bð instances.
    ðWhen all tests have be ñdded, the suite can be passed to a4 ñ
    runner, such as TextTestR �. It will( R ’individuax a casesJ !in! àorder in which ‚y were a— °aggregating   results. Ð I ðsubclassing, do not forget¼ có �he base ) Ñ constructor.C A"""
	 0def» c(self,l ñ , debug=False):(  ±topLevel =   ²if getattr(® @, '_vÂRunEntered',4 B) is
 X  \ 8 .6 7 = u BTrue¶  2  foFAdex,­ R‘enumerateÏ º  0 #ifß º.shouldStop„  & Vbreake   ‘if _isnot-(Ø [  &  A ¿ ð arDownPreviousC¨3 ])6 6   : ÿhandleModuleFixture8 h _SetUp5 hp¡  Ë=  kaest.__3*__ © Dif (è ,  ð7 ˜SetupFailò-orô  O K “  C mþ Ç D q  C hcontin  !ifÅâ º §
ŒOelse/ .K *()2if »ocleanuM  `removei�AtIndex(i N %ifç
� A /teUONoneU6 QTB ø € ¼Ö±åcreturnD
 = s ¤R"""Ruï oñs without collecÜ`errors· a Rè ™ Ä  [ P = _D�  (´ t Q.run((  , U# ¿ _'y;S^•70 / =÷ "  Ó & 0', «¸ qcurrent v ù   :if ) $= [ : ”  . �gì_T9 —~ �, "__unitÎ„_skip__"ÒQ ‹ fN:try8 o .„M@ Àexcept TypeEIM À       # tes÷t may actually be a function
  ò# so its class will. Ébuiltin-type2 Upass
 asetUpC< ñ= getattr(current 6, '$ …', None)? !do% ŸCleanups D ) I 6if g q is notl :l  ö ö_call_if_exists(result, '_setupStdout'   4 :tryE    † (G   �except E Žion as e]  + Õif isinstance¨ q_DebugR¶ )9  = Jrais¶    Ïfailed = Tru" ï  ;   Ú!._4S9FW û ŸTypeError½ a m  o ñ Name = util.str 	qv H Áself._createsÕOrModuleLevel‘i)e,8 C  	ôJ *á  õ Ø 3if ÏKand "È 1 ¯  * ùfor exc_info in ’tearDown_ÞOionsØƒ/µ— <[1]f6Ç Ù =K 
e0fin?Ó GurestoreIÍ ñdef _get_previous_m|(", Ð Ï' ¢! =ÉJ  ’ Ç2G  Ì" 2Tes…/% G 2' Œ  8 #._Ë %__  treturn ( 9 
3
bhandle sFixture
Otest 8.RÇ¯m 0 = b "._º/__¿ $ifä5 =Ì 
ï ß  Ÿœ ä T&]) - ¯ .ESMK7FalÅ—Cð = sys.modules[currentMƒodule]
  õexcept KeyError:    ereturn asetUpMA Á = getattr(m 7, ' …', None); 7if  q is not$ 
r ö_call_if_exists(result, '_setupStdout'X  ¦ :tryE    ‡ (H   EŽion as e^  + Õif isinstance© q_DebugR· )9  = Uraise   ò 1._mWSsÏFailed = Tru5 òself._createClassOr¨ULevelÎ ¦ /e,| „  
ëK *rcurrent® �?if ^Ñ rcase.don �Cleanups  0  / ƒ\ s ‡8 O ‹ofinallg °urestore²&Odef § L,ùÿ, exc, method_nam¼ pa_q, info=”7eò§Name = f'{c B} ({: 1})'º  ! — _._addc ¶ b � !)
L G  l 	†eption, S L  ˜  ü A = _÷uHolder(\ ‰waddSkipð�3, ' ì èH and1_Ó c– f KTest5J › e, str(: )§ ;els§!ifc ü ò*Ä A.addÿ ^ pys.exc_5 (^  7 b   I  A íbhandlew˜TearDown(ãö ‚previous. 0 = ( d._get_ Ï4if # > ðis None:
         ³   return
  õif result._moduleSetUpFailed:&  - 9  :try! @ r = sys. ±s[previousM] ]> ú except KeyErrorJ k ò_call_if_exists(² õ, '_setupStdout')] › ‚tearDown† Á = getattr(m— :, '" v', NoneR  :if & q is not+ 
Á  / …     
E (e  ! E#Žion as ea  + Õif isinstanceq_DebugRØ)9  = Uraise5   òself._createClassOr;ULevel™ q /e,G O  ~N *
s
_•rcase.doâ ‹Cleanups˜”�&ŒˆX„7€kfinall5ÛurestoreÝTdef _AP\¢(,s, test,Óû” +  J" ATest& bcurren ! =j @.__c!__ž  è:if ) $= [ W ; or /isB  R   %if³	N  ‚ S	·‡', Falseÿ  C R L ž p"__unit–�_skip__"ž 
Gä4±` ¶( ³!do ÔùH * J ýS  ü #[ and =  
z€â úÕ“ � À       try:
   ütearDownClass()
# �except E �ion as e:'  7 ñif isinstance(result, _DebugR )9  = _raiseW cš ñ Name = util.str ‘(previous¼ »  W Áself._create' ÕOrModuleLevelÖ ® /e,„  K  'O'M +å  ù 
Û Qif doÌ ÿCleanups is not Non› - ä ùfor exc_info in X.Ó _OionsÇ /† ?[1]ˆR?[1]É+C” + ì=õazfinallyáõ _call_if_exists-ñ'_restoreStdout')


¢ó _ErrorHolder(objectü1"""ÚaPlaceh!  €òa TestCase inside a C€. As farz& MG ðis concerned, this looks exactly likK ðunit test. Used téAsertF °arbitrary e¸ �s into a1 ± suite run., Á ÷# Inspired by the ô Ò from TwistedM¢# http://t ômatrix.com/trac/browser/trunk% ñ/trial/runner.py
ƒ Ð# attribute uÎ !by>.©Ì¡_to_string7 ufailureõ! =2T Ðdef __init__(6Ó, description½   . ( =) M !idG : |return A 3 fshortDv A  ç5 c__reprµ n ("<—¸ �=%r>" % e Ñ (,)] /st\ Ê 7id(1 1runQ ,½‘ €# could M A.addŸ ²(...) - butÅ «-¼>Á @# shG Qn't b—u anyway" FpassÂ À__call__(selÓf, result):
  óreturn self.run(! 
! ðdef countTestCases() ? 00

, ô _isnotsuite(tesh ð"A crude way to tell apart & cY Q and : ñs with duck-typing"� 6try· Biterc  öexcept TypeError) à ATrue*  ñFalse


class _DebugRe(objec» ÀUsed by the SÝ  Å âhold previous H ðwhen running in dW .¿ _,  F Cw R= Non— ò_moduleSetUpFailed = ¥  ©¥shouldStop a"""Var} òutility functions."""

from colle ð import namedtuple, CÞ"er, tos.path( ðcommonprefix

__unit°1 = Oð
_MAX_LENGTH = 80
_PLACEHOLDER ó = 12
_MIN_BEGIN 5 :END [COMMO% CDIFF& o 1- \Ï  (h -+ � !+ $ h +F 5 ® ‚)
assertJ ž 4>=  shorten(s,²fixlen, suf =0skiÌl) 6) -+ & -, � 1if - >› æòs = '%s[%d chars]%s' % (s[:ÀQlen],H E, s[v – 1:])m sÐ_Ó ³_repr(*argsÆ   1 = M‘(map(safe'  ,  )V  maa = max' !  if wlen <= èâ ™  4 œØ 2 = ¤  (  t   S  = ð  )= 4 _ p  X 3  (À ¦K×oˆ iC In >8‚â XW 	 { D / + ´ 8) <\ð <4 = è( ,¬ Œ ,k É Ü  > ™9 R + s[ °len:] for sŸz   v ´{ w Â 	€ É ­ Ñ Æ 	 ¯  ÛÙ  !, =¡	ŸF1 = 22objµ §E®6ioný1 ~!._E __n < bif noty 1 orÔ6 ØU àturn result
  ô:  return result[:_MAX_LENGTH] + ' [truncated]...'

def strclass(cls):
   H  "%s.%s" %  ó.__module__, cls.__qualname__)L óorted_list_difference(expected, actualg ñ%"""Finds elements in only one or the other of two, sa p input g 1s.
³ Rû 0s a( -Q ` tuple= + Â    The firs? ñ  contains thoseK = Ž  ‚ "¿ "r € but not­  Ô  P, and¸ J ksecondd 	î A ^ G � .Ç PDupliË	O !ei.Ò are ignored.M !"" ‘i = j = 0 Ámissing = [] $unö  ±while True:$  ˆ 6try   De = ; "[iM     3a =*[j Šif e < aL  4 š ¥.append(e){     mi += 1 ® ‹ G == º  ;  C  !el” >” — a— j— 	40[j]• ö   ™ A  ?elsÂ  ¾   @ ›     0 ` kfinallÿ 0   ½        . I úexcept IndexError2.1ext.yJ[i:]¢Ã, ‘ * Qbreak^_d &, D 
ÿ¿unorderableóSame behavior asåB  ‡ 1for‰sÙs ó items (like dicts)�As it doe ñlinear search per8 Á (remove) itf  has O(n*n)$ £formance."?o– • V.pop(‹¤†.� (= - ü_Valueü*< Ì p# anythá1lefºh 8 isÆ på) àöthree_way_cmp(x, yÊ�ò  -1 if x < y, 0 A== y 4> yGn ±(x > y) - (; ð )

_Mismatch = ddÌ$(' ð', 'actual expecteðld value')

def _count_diff_all_purpose(actual, expected):
    'Returns list of (cnt_act, cnt_exp, elem) triples where the cj  s k 1er'O #- ñ
ents need not be hashable$ ps, t = q – "), œ ( @m, n( @en(s" Qen(t) âNULL = object( PresulX ![]$ afor i,� ó  in enumerate(sú  þ #if!  s T     rcontinuµ  pnt_s =  j 0i    m jg §range(i, mf  " ¡if s[j] ==r 
j  !  U es += 1V     9 ¢  r À, other_elem~ å t + … 
t… t¾ 
… !if3s !
×  Á = _Mismatch[sYt›¼ å   Ä€.append(? !)
ò  î Íè ÍÅnFÅ	@ â 	!01 ½   wgýX?musùC7#er• 4),  
ÿÕ 7 = Ñ é#sð‡s.items(§ G ×bt.get(0 0f²Q ™ ±} ‘ Nin t­ ² &Oin s? q .
; "ú#"""Exception classes raised by urllib.

The base e. ñ is URLError, which inherits from OS ð.  It
doesn't define any behaviork 5 €own, butZ tv š  DEall
„ sI düñthis package.

HTTPz  I -an¹ 1thad `also a30id 5  =áponse
instance¼ © 1es h  waº Rcause5  protocol eRs areT A
resO ðs, with a status code, headers, and a bodyp pn some sñexts,
an applica¬ðmay want to handle an excepô"tion like a regular
response.
"""

import urllib. õ

__all__ = ['URLError', 'HTTP ò ContentTooShort ¤]


class 8 1(OS …):
    # ó is a sub-type of * ó, but it doesn't share any ofE àthe implementaë ó.  need to override __init__ and __str__.B ôIt sets self.args for compatibility with otherœ = 1subæ "es­ @ ¯ Phave ¡ ptypicalY 2matN „errno inI Qlot 0  @streiP in s ò1.  This may be better than nothingÍ 5defë (Ð ó, reason, filename=Noneƒ ‡ & ö =, ’  A    %ifT  Á@not [ Ý >   ^ { % =2 
G ¯ �® — òreturn '<urlopen b%s>' %«™ g“(q,Ð³.addinfourlk ð """Raised when D j ToccurÕ‚lso actsFBnon-� ¦  B í q__superk/ =} .�¡¹ ð , code, msg, hdŒ #fp·  n [ # ! =* R Pmsg =< 
  H ! =O 
  fpžp 4Í  f# The L ñ depend on fp being a validùA ðobject.  In some casC - …)ï XHJ E  X J 0f t$�happens,ysÐst workaround­'toG  b  }Rializ°DbaseÖ Z Y òp?  2 ì4(fpº2urlÐ)óú
  `%s: %sù.ö,9msgS arepr__' ,¨0 '<U T rN. U v# since«€specifie².‚± attribute,A` ¢should alslp#  prov�§5 ð. See issue13211%² discussion‘@property¸ 8| » é 2msgm= headers> 	 *? . !.sw‚  E #,  Œ …  G  qq ­3¸D €"""ExcepÔ' r¦Àdownloaded s² o ð	 match content-length.""ñ"
    def __init__(self, message, content):*  . ŸURLError.3 ))  J .@ $ =J ñ
"""Parse (absolute and relative) URLs.

urlp( ð%module is based upon the following RFC specificationA   ð^3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

q ð2732 : "Format for Literal IPv6 Addresses inê  'sw óR.Hinden, B.Carpenterq Mo ãDecember 1999.p _396: Ú ð (URI)": Generic Syntaxy ?T.
ð ,—'L.ð `August 8 ð 68: "The mailtoÔ � scheme",b ×P.Hoffman , LL øJ. Zawinski, JulyW 0180W R ¸‚Locatorsd R¦°, UC IrvineW dne
199�0173W N  )/L)		ØM.
McCahill, –4•v isóqsidered°ñcurrent standardaýany future changes toý`shouldQ À with it.  z*
k ply not äñ rely compliant B Athis<`due to	áacto
scenariosÀ †2ing ÑPbackwÀ  O ó
atibility purposes, some
7 ð quirks from olderr ðs are retained. Ç btestca
 _Ù ð.py provides a good indìdor of l �behavior.f´

import re
 4sys Etype acollec9  ôwarnings

__all__ = ["’ 0",   unz  ê  Cjoin …defrag",!  1 Ssplit$ (un QencodJ S ;_qs>  l? Aquot- 	 @_plu"  k\_byteC !un!  A  :  /to: DÐ QResul¿ Â S×  	ô 9 B“   /  C  Å]

# A classØ í^As.
#7�empty str	.  es‰sç#no’$€ed,
# be2  IÁdefault valu–Purned¾aâ€œurl¨1â€�± Ž0â€�©Dses_¿ &€'', 'ftp "ht `gopher "nn Yimap'! ^p  'wais) @file  C  s
   ?mms: €prospero$ 1rts�   u s’ à
             ¡    'svn', @+ssh "ws ðs']

uses_netloc = [' 0ftp "ht `gopher "nn �telnet',
b  A'ima; 1waie @file9 !mm  R 	 s
 @  2snež €prospero= 1rtsU   u Osync> ë sË !nfw 0git@ 2gitÀ } &wsmparams dlI ¦ Ò  Z   „ û   'Ï  E   × !siç OsipsÝ  CÒ 0tel¿ðN# These are not actually used anymore, but should stay for backwards
# compatibility.  (They U ÂundocumentedH ñhave a public-looking name.)

non_hierarchical:Bh9QmailtÝñ/T'g$ 'P`(4ÎQqueryx  _ y  C   
‘bŠ '»  ¨ I   °| @frag- �ø  u  D V  'l¸  ; 
° ²  ôw ñ]

# Characters valid in scheme¾"s
 P_charòý('abcdefghijklmnopqrstuvwxyz'v ÿ'ABCDEFGHIJKLMNOPQRSTUVWXYZ-  ¯0123456789  P+-.')² ð8Unsafe bytes to be removed per WHATWG spec
_UNSAFE_URL_BYTES_TO_REMOVE Ø\ú\Ç"\n;ðXXX: Consider replacÌðwith functools.lru_cache
MAX_CACHE_SIZX ’20
_parse! ò = {}

def clear 1():.@"""C Q the 6  W A and 1quož A."""7 a .W "()  _5   8@Helpçç=ð2handling
# For 3.2, we deliberately require applications that
# h@ Ñe improperly x Qd URL› doÃ àir own
# decodL Ü "en C. If{�use casesºs
# presdPwe maŽ  lax this bÏ M xlatin-1` ainternó î p3.3
_imÁ 4it_y ¨ = 'ascii' 1rroè‚'strict'¹“_noop(obj¶£return obj  U €e_result) !,  Ning={ $Û  e€ 3  w .^ !e( Ring, : )� kðe_args(args, encodingÿ=_implicit_encoding,
  herrors2  !):1 õreturn tuple(x.decode(U  > ð) if x else '' for x in args)

def _coerce_  (* b ¢# Invokes ]  K ñnecessary to create strP — b# and � bs the _ õd inputs along with0 � appropriN bresult6 Ãion function. �  - noopË  z W  : ¡ otherwise& Astr_5 à = isinstance(ù @[0],Ï ))  -4arg/B[1:]{ ¯ñ# We special-caseì PemptyB 0ing"psupport S : ð"scheme=''" defað �argument6 5ome¾ s9  ifg`
¸ ´ 0 !=z Ü ©  s °raise TypeECÀ("Cannot mix3 S @non-P‰ "s" if# V á � `s + (_“,1  _5W ])) ž"e_ær,)

# RòPobjec!ðre more helpful than s8eï’s
class _: ’MixinStr(B ¾²"""Standard`0ach]�  ŸPparse« p`s fromê  $ �bytes"""{ñ __slots__ = ()
  8I �e(self,  Ãing='ascii',€“='strict'– Žº 9 .ñed_counterpart(*(x.Q Ð –Ã @ O))

 BÀ ¦ ?strI .F  ß gNetloc"NBaseÑhared methodsU ´	 X�s contain.1a n` @ ele·	@ÝEerty;rusernam. % rinfo[0]uH �password…H 1H Ohost�  0 = n ._ ”  Ë  0if L   D zì2Non} 1 ð# Scoped IPv6 address may have zone e Á, which mustc €be lowerodMO ö&like http://[fe80::822a:a8ff:fe49:470c%tESt]:1234/keyXð separator = '%'ç`Ø eJEb'%'€ ! pH2nt,Ã #=  Àe.partition(Ãseparator)
  ñreturn hostname.lower() + percent + zone
2 ‘@property ñ def port(self):  W   0 =   ._Z uinfo[1]! i8 Æ is not None>  B :try   W @int( F, 10È  ! þexcept ValueErrorD ñmessage = f'Port could† ðbe cast to integer vJ P as {q E!r}'Ã  p   Wraises (b a) fromÛ 	4 !ifm a( 0 <=>  W65535B Z   ^ "µ ñ out of range 0-> "Ô ´ ·ñ__class_getitem__ =  ñmethod(types.GenericAlias)


" þ _NetlocResultMixinStr( zBase, _( Ó q__slotsx "()” KP_user+Pn‚ R U5 p, have_@ ,Ï 
 2 = / ö .rpartition('@',&if8 
/ Y  Y ¤password, 
 0 = $  h .^ :^  Äòž ; 
j  &  * =4;els t  ˜ ( =Š  D* ³ {¦{O_, _l -  ¤õopen_br, bracketed =³K[K©= 
B ¿  ‘  ø& =] R ]R  wÃ 2   - Êˆt   	 i 
Á   ûÆ T Ü  % ˜_Bytesš* œ‚b�K(b'Ô ’žÇÀostinfo = neótloc.rpartition(b'@')
  ø_, have_open_br, bracketed = hostinfo.> [> )if> :W  ^  > ö name, _, port =^ 	S ]S  : _3  : 	. :. Oelsev  Š È G aif not¥ 
N  } u = NoneÜ areturnß  % à


from colleci@s im  % ÷dtuple

_DefragResultBase =  ((' €', 'url 1 ßment')
_Split> ¢ '#  B �scheme ne¹ path queryW _ParseW # W nparams^ õ ø .__doc__ = """
õ U(url,œ q)

A 2-=ð that contains the uwithout3 ñ  identifier and( B
 `s a seµ pte argud .
‘ ²  :url¶ €The URL € ? no€ .L � 
Q P
Frag„ Â ¡ !d ^BURL,õ allows indirect4  ca|ð of a
secondary resource b ùference to a prim#  51add-$alY Pying
D!rmb )n ÏÓ  (‰,Š,‹,.ñ5ñ1dif½  �mponentsì  ‹×. Similar to
¯¡, but doesåsC ø/msÆ ¬ 
Í @SpecWsl  " A forbsrequestò÷ }
O ³
Network lo´XwhereN p is mad©©  ÐX  ™Ãhierarchicalibsuch a8 6 þ0fil_ Ÿ downloadh 3i   3 co��¥Inon-Œ Cdata% Ralong?  1
inª M ¯ ¬Ä!in%PscopeýTURI's‘[and
nZÕ ˆ³ u u
u* u Ý`
Oð ParseResult(schðeme, netloc, path ðDrams, query, fragment)

A 6-tuple that contains components of a parsed URL.
"""

_P ÿResultBase.scheme.__doc__ = _Split" 
B ´ B 	
" B  î @ 	  >  &@ ñ"""
Parameters for lastU@ eleD  uÐto dereferencLñe URI in order to provide
access ÿerform some operation on the resource.pÌ­ o	! î C 	$ ò


# For backward)ñatibility, alias _Nü²MixinStr
#   /Ð is no longer^th ø @docuYðed API, but it is
# režPed sig²deprecating# ‘n't worthBwhassle
u =š Ð
# Structuredz¢ult object÷0stre Ðdata
class De\ ((_  ß 2, _ ý á):
    __slots !() ó def geturl(self)  - 0if  .i  C     r4 n" ²url + '#' + 3 b  . Oelse@ 

Ø µ(S,?³ Ü ¾ `urluns(ý † P]((† Dps † obytes B % :!b=º * ä !c #* � -%Qet upm�encode/de C`pairs
âa_fix_r.Ô_transcoding(‘  1 E = (¹([,wÒ ð,
        (SplitRÑesult, SplitR “Bytes),
  b(Parse ',  ) )/ ñfor _decoded, _en
 a in _r\ q_pairs:-  _ - ., å_counterpart =C 1 T .: 1 ~ d

_fixv ÿtranscoding()
del   

def urlpô ò(url, scheme='', allow_fragments=True)Î 1"""ð a URL into 6 compon, & <M ô>://<netloc>/<path>;<params>?<query>#<h !>
ÿ BThe Fð is a named 6-tuple with fields corresponñ q to theC �above. ItB ˆeither aÓ8 or âr objectBdepeW  onW � type of Aurl Æ Veter.¶ @user® ò, password, host Öand port sub-1 U #» ðcan also be accessed as attributes1 t$cturned¸ ˆ }P arguÀ‘ provides½ Ådefault valuÒ 2 � Ëƒ when no KPfoundç3urlp ,If. ) `False,= aattemp‰@made¦ se= te� s GP from  € previouíc€, which *2be ßH  a ÚY  !Noi ñat % escapes are not expanded.> 1""" “, _coercea ª Hargs8s_½=` ( ]9 }", 
,; !, È %, != O ` ¬ %ifžpn uses_[0ms m3';'¬• ‰Ý $ 1= _P   ¥ Œ Felse2  Q = ''s ~ ( =@(@¿ : Ç e  re¾`(] )Ÿž • }if '/' Û !i r‘.find(';'E".r 2/')x  ‚if i < 0P     ’ "ì 

a Q 7 A[:i]u h[i+1:]Å × c“, start=0P°delim = len à)   # positionë0end `domainwt ¦ Ëais endž šc`'/?#':Ø p# look  m aiters;]Porder°`NOT imž1antI  : w0 Wc¿  §  " 0 # `Q firs˜ Qthis 7 F 3if I A>= 0“ ;  Q# if ]6   H q = min( ,J  #ò’ earliestv ;ð
    return url[ñstart:delim], url[ ò :]   # return (domain, rest)

def _checknetloc( â):
    if not  3 or
 “.isascii('  + ` 6 ó*# looking for characters like \u2100 that expand to 'a/c'> ñIDNA uses NFKC equivalence, so normalize_ Qthis Á > ñimport unicodedata 4n =¼ ñreplace('@', '')hignore¬ öalready includedG .B :B  a # but1Àthe surroundOtextA #A  ? ›82 =Ø . ('(Q', n)J  ¶$ =ñ 2Ë ¢ ¤š¶ in '/?#@:'% @if c õ> B òaise ValueError("' S '" +bñ + "' contains invalid " +ž  G  "*Runderÿç cation"³óurlsplit(url, scheme='', allow_fragments=True¦ð"""Parse a URL into 5 compon, <M R>://<Ü ô>/<path>?<query>#<_ !>
Ò 0TheOóult is a named 5-tuple with fields correspoQo theC �above. IB  either a Sã 0ResZ (or ÑBytes object,B BdepeW  onW � type of æurl parameter.¶ @user® ò, password, host  ›NFsub-( U y ñcan also be accessed as attribu¨ † rƒ#ed¸ ˆ tP argu·‘ provides½ @defavv } ^ó� Âƒ when no �f‚ Î3urlp ,If% ) `False,= aattemp‰@made� se= te� s >P from  € previouíZ€, which *2be ßH  X WY  !Noi ñat % escapes areX01ed.> 2"""Ë², _coerce_r8= Hargs0)=  
b#ò_UNSAFE_URL_BYTES_TO_REMOVE ¶ J=]Rb, ""y ! Ë=…' ¹ ¥‹ = bool( T 0keyøçä,ë Ú ) „ @ °cached = _pý_ â.get(key, None)  ø, í ±AR(B d5 Hlen(\ ñ) >= MAX_CACHE_SIZE: # avoid runaway growth 5Rclear› (Y a1 = 5 = s2= ')ði = url.find(':'ñ )
    if i > 0:   öfor c in url[:i]   €if c not! Êscheme_chars&  * UbreakV Jelse$ > ,g   =  m �.lower() q[i+1:]
D "if# ¦2] == '//'N anetloc3 ’ = _split r(url, 2ë  • €if (('['¿ # „ and ']'Õ  A) orx  5  (' 2in # 9 [9 )˜  8 òraise ValueError("Invalid IPv6 URL"ž òif allow_fragmentsa #¬ 6urlX Õ ' <.õ u('#', 1Q /'?= Zquery: ?: b_checkæ ( S Pv = S^tResult(Ã$ �!, \ $,   : ñ_parse_cache[key] = vaòreturn _coerce_rZ av)

deô!un< p(componc‘"""Put a   dLò back together again.  This may ^  ýa} ðslightly different, but equivalentV ,&0the “ that wasv G ò,originally had redundant delimiters, e.g. a ? with an empty/F (c Âdraft statesl —these are– Q)."""5 ƒmparams‹,fA = (E  © «gargs(*—ë if'amòurl = "%s;%s" % —¦ 5 RurlunÚl)79   B°"""Combine q2elenâof a tuple as ‘ Ped byyL r) into < Y 2letðas a string. The data argu] ð can be any five-item Qable.„¤  $Q ¤  ·unnecessary¢  (úˆexample,ªO ®;9?RFC¨-+ ,˜¨C or OcC Suses_%  B2] !rx *�? % 1%  ':. 0 0' + = 3  º3 + W ‹ 7'')* 2if � ­9  X + ':Z "ifB/  n  + +! ˆ Àif fragment:#
  `url =  ñ+ '#' + fragment# ðreturn _coerce_result(url)

def9  join(base, „, allow_F �s=True):N  """Join a 0 ñ URL and a possibly relative ñto form an absoluteG òinterpretation of the latter."""% Qf noti }  ñ Ï 8url$ =url#  ¡ 
%  
 Û 
% =Fargs)8 ñscheme, bnetloc, bpath ô rams, bquery, b-A = \<  ¬   ƒurlparse\ -''_l k j i "pah g f durl, bM É)2if ! 4 !=, 4 or  t„in uses_Í]
HO ï \ C Ñ A <if   9 ØX "un@(´ ,> !, "	l H  P"))… = � $ =õ4  t ñ  �Ú  =$˜ r  O 
   1ot ÚD  ‚   2 	 1 "O¢ ,” ,G †  H`_partsž  ï ¢.split('/'A!if¯% @[-1]c&''à #é¡st item isä�a directoMqso will óbe taken into accouØ *á# in resolving[ ²¶  ) ;del™ ×#Ÿð rfc3986, ignore . D q should] ñ	first character be root.h !if0 §[:1] == '/÷ !se‘ 87Felse$- r+^ q Ý P# fil� pout eleû�s that w» ð
cause redundant slashes o=-þ1ingÄ O  ŒV0ed_°  › 0[1:Ý=z z(None,  n	I R = []{fr egÂ8  G!egG'..H   6try)     	f R.pop(‘    þexcept IndexErrorC #ÿUny ..Î J¢otherwise T'anS & q   ó# when popped from­W3 if  ¾ ŠJ ðpass
        elif sÇeg == '.':
  …continue Jelse# ñresolved_path.append(seg)
5 öif segments[-1] in ('.', '..')K ô# do some post-processing here. if the lastQ ñ was a relative dir,t  Á #/ Òn we need to ›   ` trail\ 5'/'2 É #''È ÿ,return _coerce_result(urlunparse((scheme, netloc, '/'.join(b @) or$ ñ, params, query, fra0ð )))


def urlde  p 4ð"""Removes any existÒ  '  n¢ from URL.ˆRÀ  0rtuple oPX  1  ed. A and#H Q.  IfÂ  @URL …ained no­ !s,6  second eleS 0 is > Ñempty string. 1""" Kurl,X% = Aargs÷ , `if '#'E6url=Òs, n, p, a, qB  =7›Aurl)?  ò  ¼
A 2'')1 
ï F = '4M b 'D¾R44 ¦  ãp_hexdigY ð	0123456789ABCDEFabcdef'
# Ótobyte = None nquote_to_ "s(_"u! p'abc%20U `) -> b   .�s# Note:«ðs are encoded as UTF-8. ThisßÐonly an issue¥$it!s‘# unescap0ðn-ASCII characters, which URIs shoulXt#cif not‹ ï“# Is it a Ñ-like object?v  ée.split  bÄÓif isinstance?,V DH   =  ½‚('utf-8'(Fbits" s C(b'% pif len(% )g1Ë � ¬ ¦  reJ [- A[0]] »S= resc p# Delayeô  initializationàPtableþ HÃwaste memory@ WAfunc7 ñ is never called& vglobal … 'if   ˜Ù . Ã = {(a + b).<1): ±.¥3hex X  s
 Pfor aô T  *  b }9   @item >61:]� 6try  ` T(T [[= R[:2]]Ô %   )  '2: ÿ except KeyError_  K   O h #b'/Ðres)

_asciirñðre.compile('([\x00-\x7f]+)�!èÁgCing=¥0, e¢ ¡s='replacezÀ   """Replacõ–e %xx escapes by their single-character equivalent. The optional
    encoding and errors parameters specify how to decode percent-encoded
    sequences into Unicode ‡ ãs, as accepted¯ r bytes.W !()I qmethod. ¼By default,u q Bare C Ñd with UTF-8,Ó qinvalidN s£  2 breplac‹ !a  uholder ´ !.
8 ð	unquote('abc%20def') ->     '­ 1"""/ òif isinstance(string,ê !):"  ysreturn \ A_to_0 ) ,�$âif '%' not in c [  l.splitp   4if ^ † is NoneD  •= 'utf-8'4 %2  3= 'Z2 ò bits = _asciire– æ T  re! [) A[0]] Òappend = res.  Pfor iô Ðrange(1, len(; G), 2_4 (_ + ?[i]`a ¢C 2 R + 1] ºñ)''.join(res)


def parse_qs(qs, keep_blank_values=False,¯0ct_- 3ing Þ  v  ~=|þ=\ð, max_num_fields=¿@, se½stor='&'@"""P™ á a query givenŽŒ  ý@rgum!ñ „ A &s: =qs:‡S W #"bed7 
ñ: flag indicating whether 0 09 inpvÍ ðies should be trea]#asI — s  Ö   bA truee „ res that7 S ¹retained as� © `    Y«  fè` C  ì  ’ toÅ Pignorq (ndÑ  ifàiy wereG ccluded± æ  › fr at°"do4�g
2#IfÔ 0(thk’)• ¼  sia3ly ¿ A  t2 �raise a VE90 ex7ionÄ Êe' /s:“	,i›& —P 
€:÷�. If set,«Šn throwsç ÇÃ A@more„Bn n ÓA rea) › Wð l().

        sòeparator: str. The symbol to use for s& ÷ing the query arguments.
  €Defaults@ 5&.
 òReturns a dictionary: 1"""& óparsed_result = {} airs =  ð_qsl(qs, keep_blank_values,Á @ict_( Aing,= ™  ”encoding=	 ’, errors= 8 ú max_num_fields= ,#3or=-1or)‚  @aname, ¨ ¡ in pairs:  • 0if !  "  &  × [1 ‘].append(Y n  * Oelse< A = [8 ]ˆ rždƒb


def xl=False~ \  ”  s…='utf-8'{º'replace', Y@=Non] �ror='&')Ý @"""P2# a‘pgiven ac0str­£‡A¶:›Áqs: percent-£ #edS H Rto be	d7 ƒà: flag indicat� �whether ©Is inz  ies shouldy ptreatedÛ I — ybA truee „ res that€ S gretainT 	“ `  dÒ  fé`  sJ 0are	€be ignorq 7nd Ñ  ifS÷y were  not includedµ � Úg atg qdo withª ÒI. If• É (ËÜ )Š ± „silently´  A ]
^   raise a V‡EK` excepäÄ Y • 3andrÑ: specify howÀ ]ecodeŒŠsequence[�into Uni3 °characters,' ac� Ped by_� bytes.d_ ˆ() methoa
uQ: intõ @set,A pn throw[ç 	TÈ!reA mo÷bhan n 0A reaŽ ÇN)4‡XAlist-0G-dñ !enu ª’ i0_co— rargs(qsxÁ i, _ = $  )< ð&ot2Q or (ú¥sinstance(4 r, (str,Â#))ü ¥ x�4("S&P must:qof type ngi ðbytes.")

    # ðIf max_num_fields is defined then check that ² number of 0 `
    #6 @less( nR ó. This prevents a memory exhaustion DOSI óattack via post bodies with manyw ./ i¾ ‘not None:#  Ÿ Þ õ
= 1 + qs.count(separator)- T <õ U  Y ðraise ValueError('Max. 	#Á exceeded')
g ar = []  for name_vE 0 inœ Hspliœ u 0if ß 2 1and æstrict_parsing2  § �continuer   Gnv =w .q i'=', 1
Êlen(nv) != 2T ?if s 	 f “"bad querÆ–: %r" % (Ð &,)€  D Ð# Handle casev a Î @rol-5 Õno equal signå  ? Òif keep_blankdsÈ  & Ênv.append('' 7elsH ,    ‚ 	P2if *[1]) oru » û= nv[0].replace('+', ' ‚ + qunquote*´, encoding=	 0, e€"s= 
Å C á_coerce_resultJ 
( ƒ— 1— , ˜  ™ 5 ; = š  
› r¡· ", # $ ãreturn r

def ‘ `_plus(¢'ng— u'utf-8'/'}"')t"""LikeF Ó(), but also +  Z jñs by spaces, as required for†Œ €ing HTML mº "s.	! e­ ð'%7e/abc+def') -> '~  �'P 1""" × ! =‚/ngBd ò))

_ALWAYS_SAFE = frozenset(b'ABCDEFGHIJKLMNOPQRSTUVWXYZ“   ÿb'abcdefghijklmnopqrstuvwxyz7 
¯0123456789' 
i_.-~')· ø _BYTES = bytes(Ò �)
_safe_Aðrs = {}

class QU€r(collecŠÖs.defaultdict`A mappÊBfrome ó (in range(0,256)) to“á0Str5 ¯ps are p„1nt-º!edK C, unEñe key < 128, and÷!in‚"Î Ñ" set (either  specified     ,ŠÏ   )5Ð"""
    # Keeñ<ps a cache internally, using defaultdict, for efficiency (lookups
    # of F ñd keys don't call Python code at all).5 ñ
def __init__(self, safe): p    """ õ: bytes object.""""  7 .$ ð = _ALWAYS_SAFE.union( !)
. n Creprn h ð# Without this, will just display a'S  £ ñreturn "<%s %r>" % Ì ð.__class__.__name__, I )• 0miso˜ 9, b› eHandle¦ - ð. Store quoted str®#inÉBand ˜ i¨ ös = chr(b) if b in >õ	else '%{:02X}'.format(b)è  + •[b] = res f  
a‘ (� Îñ='/', encoding=None, errors ë 2"""< @'abcx`') ->  r%20def'Æ�Each partqña URL, e.g. the path info, àquery, etc., hÂ¸ Ádifferent seG ðreserved characters that mbgQ. TheB ª ° function oP   òcautious (not minimal) way to­! aB "S1mos† @thesÃ Brts.ì ÀRFC 3986 Uni‘ò  Resource Identifier (URI): Generic Syntax list¦ `follow#O(un)ï  q %un ð	   = ALPHA / DIGIT / "-" . _ ~‹8  : ógen-delims / sub ü  f !":J / ? # [ ] @h K  ÔA= "! $ & ' ( )6  ,  A/ "* + , ; "="zf!ofFÛ  isó5 G ome componW2of šï @but °necessarily{ b m~#ThjZ�%-escapes6Ÿ°are neitherR tžÆ ³ ¡s ("always^a") norÚ @addiÁ!al[ s0via »  >G arg¡ º [# q is '/'$N H  @ , 
!inZ Ðtypical usagep TPis be² Cred on aàAwher3 I Pexist( Vslashz  s tto be pƒ È ‘€3.7 updaZRfrom ô v@2396³  ‚¿3URLos\€Now, "~"ë ƒincludedŽP;of ‘ä	 ²K0may³ Öistr orþ%s.M 6 K¯ kpbe spec!dìe i¤ðbytes object.

 ñj   The optional encoding and errors parameters specify how to deal with
    non-ASCII characters, as accepted by the str.i ‘e method.@ µBy default,ˆ µ='utf-8' (cT B are! 0ed ~ € UTF-8),µ J ¹ ÷='strict' (unsupported� ð raise a UnicodeEý  eEö )“ 1"""Q àif isinstance(W ‘ng, str):       if not 6ing   creturn 1  ozis None7  #= 	<  ¨ /s :  $= 9 ¼ # =� .d !e( iÕ <)1 7els“ "ifv°  í ´ S2TypHó("quote() doesn't ‰$ 's Â' for bytes"w  3 m Å !isXk *J i ˜£ a_from_‡ á¢afe)

def $ Iplus 7=''­ ¤ ,7= r"""LikeE ò	(), but also replace ' 'Ë@'+',4�required } 1ing”@HTML ð	m values. Plus signs in aPorigiÏî1Ñscaped unlessK AtheyM€included@ ssafe. I   ¶Phave  ¤  :'/'(p# Check Ò iôa, wherú >Àmay either b€Dstr Q.  IfŸ #Ì !re¢  no spaces, ‚ regularQÒ will produce ²ight answer¡ _if ((Ã 7� Ò³ A) or‡  Ž; +)= bí 
> ú = f	=:5 n<afel  =¶ ¤ 
©  —  =0	„ " +YŒ ½ B .¯™(' ', '+'A1bs,-C='/'
c2s a ¡ object ra`than aªÛCÐ  kpperform qing-to-‘£ H ÅRways Æ as an A¢Ð N  ^eÿPb'abcè \x3f') ->  ¡%20def%3f'7  � ] þ (Ž ,Ø carray)x%ƒ p) expec°I d&bs)Û " '• ;à# Normalize 'sðafe' by converting to bytes and remov ónon-ASCII chars
  psafe =  ñ.encode('ascii', 'ignore'). Qelse:
  ;  1 " =j Á([c for c inJ Â if c < 128]= ñif not bs.rstrip(_ALWAYS_SAFE_BYTES +< )d `return5 !deš L 6try$  quoter = _’ _  s[ ]­ ö except KeyError: 1  2 = A A = QY (I Ñ).__getitem__U š ’''.join([6 ([)0harÓbs])

def url`ñquery, doseq=False,ú Q='', $ °ing=None, e´ s z  | t R_via=
 Cplus=A"""EÌñ& a dict or sequence of two-element tuples into a URL    §Ang.
v ±If any valu, C the( uarg are` xÝ p is truÇ 1achI †  $is¼ ed»°a separate  Vmeter… 
w 0is / Ø 	,ª Qorderù !he‡ [  ù # òutput will match 9 1 G Sinputž àThe componentsm a"ðmay each be either»  tr›o ³GtypeP  },Òs~°passed downF (�functionª �specified-0Tvia (o[ @onlyÂaÐ  Êa!).O 2"""±if hasattr(70, "'#s"Š « [Aery. (Ê
SP# It'Ó"bo!Àt times that} 2ing^œÁ-like object›  r #Ž°   	7   # ’™ q should­Ówork with len²  8   < Uemptyš <†fail thib / !ifD 
)l ¢isinstance=B[0],�> ?   ¡raise TypeÈì   Ö# Zero-lengthü …0ll VsÛ�get here„ ‹succeed,L 1butsŒàminor nit.  Si@ \Âoriginal impHak ‘   ¢# allowed ' ‰Ì ‘  � ôbehavior probablyb§ G   ²# preserved^¥onsistency¼ è!é B  ty, va, tbí»ys.exc_infoØf ("¨aùi"n-{d% "�  g  �"or mappç©0").Sâ_traceback(tb)LRl = [µ/FÉ  dð k, v in query:
  ÷
if isinstance(k, bytes):
$  Ðk = quote_via) Ysafe)' Oelse9 €str(k), > ù, encoding, errors)
Q 
� v� v� v_ � 
9  � v� 	 òl.append(k + '=' + vr 
úfor k, v in query"
ã €È 74    *el Ë/tr� 
¹ ' ?afeQ V  „ ÇtºU ð# Is this a sufficient test ýésequence-ness?àC ƒx = len(A   Àexcept TypeE#
> "   P# not€ l f 
3ì c   < & 
    ô# loop over the ¯  <0elt8vö  W 
/?elt% /   Y Ð9  ”Ã'  × & U  c?eltQF   i  I (ñreturn '&'.join(l)


def to_½C(url2�warnings.	 õ ("urllib.parse./ ñ) is deprecated as of 3.8",q  ‘  D) BionW^ â, stacklevel=2A¥ _e  ” ¨ 
 Û6"""+ ñ"URL") --> 'URL'."""Š ñ## Most URL schemes require ASCII. If that changes,g£conversionF ó can be relaxed. °XXX get rid� Ò 
i0url÷ š!¡url = url.ç1e("¥ ¢").decode(Y  [æ0Uni é hraise   (&‘ " + reprô! +Ê  Q  À      " contñ.ains non-ASCII characters")
    return url


def unwrap(url):" þ-"""Transform a string like '<URL:scheme://host/path>' into ' 1'.
V 4TheK #is† ðed unchanged if it'¼ @t a ” �ped URL.@ 1""" Purl =J ² .ž "p(Û  if× ñ [:1] == '<' and 2-1: ">'ä  
J Ÿurl[1:-1]K 47  ö : *4:8 ^‘splittype¯ } �warnings.	 ö ("urllib.parse.0 ò) is deprecated as of 3.8, 
 Ä  @"useì K 1urlT Á() instead",C5  
 Dc BionW™ â, stacklevel=2\Ù _   1@


_Ý ±prog = NoneT' ÷ 6"""> '7 p:opaqueÄ‘ng') -->  I', ' .ÿuglobal v Ñ &if  6 ˆ t  á , ð = re.compile('([^/:]+):(.*)', rDOTALL)²vmatch =[ . Éw  k ÿ‘, data =  s.groups¤ ‘ L- ‚.lower()5 X    Æ ,Ó©= s‚ u  BiK	0 Kˆ  K  K  ÷ K '‰q[:port]�L     S L &  w } L L  
L //N_#?]*)NB N * _Õ  , eQ"if!  ï * —[0] != '/´ y    ! +2 ò   sr   ŽPuser(5 ;�1 �ˆ  Ñ uÊ w€ '  [:passwd]@> tÓ	!  ‰$ � & �, delim, " ! = ù .rpartition('@'�(5 Ð if delim elsð%e None), host


def splitpasswd(user):
    warnings.	 ø ("urllib.parse.3 ñ) is deprecated as of 3.8, "I  M  Y"use M 1urlV Ï() instead",9  Dc BionW› ñ , stacklevel=2)4 ˆreturn _¢ Õ í  î 8"""3 '4 :a') ->  C', ' 2.""ß  * ’, delim,  0 =   -©tition(':'    3, (/ "if@ C els¢¯ ” @ort(±š 1 ˜‰   Ñ B


#�àtag('/path#tagt u  v  Á
_portprog =È¿ÒS Ð  'l := X    W  Ëuglobal g R&if  ë Ad  Õ, ð = re.compile('(.*):([0-9]*)', �DOTALL)
V vmatch =[ Q.full ë& 1if  p  ¹  , · " = ‚.groups(` ” !if! 5   @ a 	  Ú xng Ž  àf ?=-1…> †ˆ¡ !deß )ÿ T!   @"""S9JA andt é �±ing numeric .nR�Ñgiven default ô if no ':' found; ys to -1? X %al; pa validr rber areG ` afterW 	A  è r  o Šbut not C ÝQort =ñ \.rparÜÅ tË} C ! =¬ -el 6try0  ­zp = int(wÜÿexcept ValueError9  ã n  N 	å[  	  wŸquery(urlò1 ò~Àurn _splitquôery(url)


def _splitqu —:
    """ q'/path?% r') -->  B', ' A.""":  * ‘, delim,  ñ = url.rpartition('?')- "if* u  y rreturn F ? )  “url, None½ ¤ 1tagÑ E �warnings.	 õ ("urllib.parse./ ò) is deprecated as of 3.8, Æ  ‹  @"useÄ J 1urlS Á() instead",© 5  
 Dc BionW˜ â, stacklevel=2Ý ŠÎ â 
 ã � + ˆM#tag™  —?tag• #•1tagê ¶ “Oattr”0 •ˆ  5 
— ˜; �1=value1 2 P2;...²>L ,2 X', ['6  c  9 u', ...]ÙSwordsÎà3(';É¢" R[0], 
 31:]]0 � (c )È  9iB	2 ¯.AO_qslE?¢ Ô ë H ì K y¡ œ ç D  ƒ! 'v  æ 0 =   jæ=ˆ  2, (. úQ elseÓð)
"""An extensible library for opeØð URLs using a variety½ðprotocols

The simplest way to Â°this module ¡to call thÝ a P func£ð,
which accepts a strt acontaiŠ aŒ   or a Requm ñobject (described
below).  ItÃ so ‚URL and ¢ Presulk Âs file-like
Q ;5 - 2ed  � has some2�ra method×|  | .ðOpenerDirector manageØ Qcolleô  FsHandlerc  ™ dat do
(`actualI”k.  Each 3 q0menÃ  ìdcular ™` or
op]0.  £“ iŽ smposite‚ À that invokeŽ #e
o €s neededÜº Ær‡ edšð	.  For example, the
HTTPñHandler performs HTTP GET and POST requests ñdeals with
non-error returns.  TheB „Redirect_ çautomatically E o €301, 302 3g S307 rD  e !s, ta £DigestAuthc 
U ! d p authenu ð"tion.

urlopen(url, data=None) -- Basic usage is g ðsame as original? ’lib.  pas# 1url–  opb Ü °ata to post !anA URLÂ ó
get a file-like object back.  One differenc‹ ñ at you can also B
a R˜a insta- �nstead ofn °.  Raises a Eª`(subcl¿ Qof
OS b); for¦ kr: ½ ' v, which‡  be
treated&ð
a valid response.

build_r erd@Func(q that c<  ž ±new OpenerD5%orÔ b.
Will !ll—’default hº vóAccepts one or more ös as
arguments, eithe`  Þ+  eÚ²at it will
^¢tiate.  Ife f‹ X  2'a [ © 
© , 3  ] 4 beÛ !ed
 ¿ ? ".
ƒ 'llJIó$ll=ca» #e 9   2.

bs»interest:

r¡-- Sets up¨  User AgentÝ � ñPython-urllib cli °nd manages
% vK4l“ Qaling8
P/Ds.

ÑT-- An,¡encapsulatŸpe stateÑ aO }
  +b½Qsimpl
  Ÿ 0URLÅtÅàinclude extra Žp
header,0.g.=Aser-t.

Baseå  --œ‰ternals:  =€parent
_ô°_chain conv’�ons

Exaœ u¢:

import a.vp

# set—
Ï` info
  	 + =8 .Ë Õ$%()1 P.add_Èðword(realm='PDQ Applica¨O',
  ðuri='https://mahler:8092/site-upd¨?.pyA Ÿser='klem# œ ñd='geheim$parole')

proxy_sup.ø P ¢0({"¦ A" : 	 ð://ahad-haam:3128"})a©0 a ‰6£KaddsFï@cachÏ5FTP‡
9 ‘ ] ¼(½ ,\  ¿i~
“.CacheFTPî Ë ¯ 2t¯I. ð _opener(opener)ó±

f = urllib.request.urlopen('https://www.python.org/')
"""

# XXX issues:
# If an authentication error handler that tries to perform
# authentication for some reason but fails, how should the_ ñbe
# signalled?  The client needn Pknow 4 CHTTP9 ñ code.  But if
# h¬  0 s² òhe problem was, e.g.,  it didn't 1 D Âat hash algo% [Qed ine  ch«  nge, it woÐ óbe good to
# pas}  in%palong tV á Â, too.
# ftpÖ Ps are‘ Ê ð6d cleanly
# check digest against correct (i.e. non-apache) implementaÌ òðPossible extensionsû co* x%xÝ  not sure wöpexactly@à meant by thisÿ`bstracå`ctory  „õer

import base64 Tisect Temail  {5lib Bttp. $io
 $os
 ”posixpath $re
 Usockel estring yB 5tim3 utempfil wcontext— ô warnings


from„e/ó @URLE  , ³ CK ¡ntTooShort 	C Pparse» 6P(
   ]  ,
 Qsplit
 ðjoin, unwrap, quote 	 9 _- btype,  Dhost  ˜ Duser  ¼7wd,B 5att Tquery+ Evalu\ âtag, _to_bytes@ !un�   Ã !unÏ )ø fresponû 0add;ðurl, addclosehookÇ f�SSL
try:­ xÁssl
except I}e# þ_have_ssl = False
else ñTrue

__all__ = [a ‘# Classes "'RrÀ', 'OpenerDiŠ or RBaseHŒ   bDefaulô K   1Red@    ' ÒCookieProcess\ UProxy' B ¡PasswordMgƒ  >  CWithƒ bRealm'£e ' �PriorAuth» AßPBasic z   ! '¦  Q DÉR   S   ì ˜ 8Fil‚5FTP! 0 'C#
 EData" U Unn ’P‘, `# Funciˆ B ¨ J  dbuild_ A '¿€name2url$ Durl2   ðgetproxies',
    #ñ Legacy interface
    'urlretrieve', pcleanup �URLopener WFancy ô2
]

# used in User-Agent header sent
__version__ = '%d.%d' % sys. ²info[:2]

_n ð  = None
def url °(url, data= ñ, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,å  é   “*, cafileD ecapath ñdefault=False, context !):I ð '''Open the URL� ð, which can be either a string o ñRequest object.
L *Í `* must9 #an € specify> ¡additionalû 0 to+  Y1 toF  Š pserver,l  ² if no such6 ôis needed.  See � 1forD sdetails˜ ƒurllib.r´ `moduleçÐs HTTP/1.1 anôðcludes a "Connecª q:close"X Rin it=  V l `The op8 Cal *Ó�* parametDif   m„seconds Â Pblock1PoperaP as like©c� ¡ attempt (#tk@ied,* µ @globogP setta @will„ ÷ñ). This only work‘ &x 0S-0FTPP%ÿ CIf *fH* is� &it’ ssl.SSLC‘ñ instance describing»  ³various SSLZ!s.õŒ ¨ ;j more þ
’.*Ã *.ž± yïñet of trusted CA’ ¶certificateS�Ð should pointå�a single ­J `ontainƒ€a bundlep 8CA d  �bereas ­ Y M �directoryC hhashedG v @s. M �!rmTä1fou L 
œP.loadóqify_loc8 3s()\ ^3*caiK þ’ignored.
 [1funWö always returns .~ ‚Q as a˜ X` manag’`nd hasè0 pr(tWW©!s,èqstatus.E  .psponse.”lnfourlD! o'sea ù 1Forb ‹ @sw5is æ ß Ð http.client.0 "Re — Hð slightly modifià0In     H ðthree new methods above{ 0msg`ribute¦ i)Xsame Agreason6 1---š  q  cphrase²Qed by|­A ---È0ead…8 ã “ Ð itim / �documentc‹(xÀ For FTP, fiñle, and data URLs ðrequests explicitly handled by legacy
   3 aopener8 ƒFancyURL ñclasses, this function returns aB ñurllib.response.addinfourl object.
( óNote that None may beL ƒed if no¥ r @s th# Í � (thoughM   àdefault instalÛ �global OÑ ñDirector uses UnknownH³r to ensureN pis nevey cppens)µ 0In Ð  ÷ ,£ ðproxy settings are detected (for examp•‘when a *_3 g òenvironment variable like http) 0 is_ @), Pk ° 3is ï J ó  ü`makes Î 0ž ö0thr=! ’ á 1'''R ;_ú òif cafile or capath
 Š :&  E°import warn  .	 "("N ,L  » #caM K�precated,¶E a "L  h  â"custom contex’ead.", DeE BionW‘ E, 2)H  Ö 5 Bs no�Ì  d õraise ValueError(>     õ"You can't pass both�  Ù Tany oAó «Ô "
 	¶  « Ÿ_have_ssl° �'SSL sup— 9 Pavailp'T <Ó= ssl.create_�_ ( ýPurpose.SERVER_AUTH,  ú= <  z=�¾ ð# send ALPN extens›pto indiDõ HTTP/1.1 protocol´ Ý �.set_alpn{" @s(['Œ 7 &']m   "s_L1r =[ Sœ(N = 6 Lƒ = build[(L - &el–Ú	) u D•  v –}  /= Æ ¹ &se4 * = pr-F .# Q(url,±ô , timeout)

defÊ? (- 2er)a ¡ (  ¤ °

_url_temp·as = []Y ²urlretrieve~    Pname=ö @, re*Chook  O ~ """šRF  m€ into a r  orary loca-ƒ on diskfƒRequires7 @argut. If a �  † N ÿ it qused asI ói Àary file locñZation. The reporthook argument should be
    a callable that accepts a block number, a read size, and theA ¡total file 0 of ² URL targetŠ Odata„ Qvalid2 €encoded . !.
` AIf a_ äname is passed„ 7 ñpoints to a local resource,D t@sultA ³a copy from. ¾ ato newk { `Returnñtuple containingã @patht  ^ Ñnewly createdt  Ã M € as well  +  re‰  E ñHTTPMessage object.; 1""" ¡url_type, k €= _split R(url)!Awith› àextlib.closing" @open ,Q ))ƒ 1fp:]  ýóheaders = fp.info(T   �# Just rñ [Œ a# "C Q" forï 5://` #žðs. No sense in perform ‰òunless requested ƒ 4if P == "¨"ú1notn  Ð  4 ° 0os.© P.norm	 ( 3), ° ; 0 `# Handÿ�emporaryY i setup‹  ~ p atfp = j! u, 'wb')Jelse¥ 5 @temp4 t.NamedT€ öFile(delete=FalseJ  ±  2  ‡ p = tfp. j    _3[ ”s.append(6 á9t ? Ÿ 0ile] 4   b6i1024*8~ ™size = -1 <9= 0 aLnum  @if "l°ent-length":»
J � t Cint($ `["Cont@ L@ ]ø  3 'ifR 8(¦ Q, bs,ãK  whü;Truä g =  L p.:(bsÌ $ 0if Î+ Š  " Ybreak;   Q r += len¥ [   _write! u  ƒ:+= ² b % # )!if7Q >= 0½º < ñ craise ·éTooShortError(û ð"retrieval incomp(ð: got only %i out‡‚%i bytesM ®   0% (€ Ë,*3ultÔ=A

de�’cleanup()® @"""C @ up Ã5sU3url¥ e^$s.Ò % 3 _� Ô
­`  ¦ 6try   ¥os.unlink(@ ðàexcept OSError7:
  Qpass
 ñdel _url_tempfiles[:] áglobal _opener $if O   ð8 = None

# copied from cookielib.py
_cut_port_re = re.compile(r":\d+$", ó	ASCII)
def request_host( )| ”"""Return% -% ò
, as defined by RFC 2965.î ’Variationž aRFC: rF ñed value is lowercased, for convenient µ carisonV 1""" 1url× ´ P.fullZ  œ ò = urlparse(url)[1i2if  B= ""Ý  « Þ ò.get_header("Host", "")× �# remove ]”, if pres° I ~�.sub("",y A, 1)¥ 
 .²()

class R‰:p  ›à__init__(self,Ú p, data=", « Qs={},\  Ò  ¡origin_reqÚ3 ÿunverifiable=False;  amethod2 	 V  „ qhv  � Z = {} ÿunredirected_hdrs$  _Ù â p   X    
W q_tunnelà :  TDkey,rn.w.items(Ù i 4addÿ; · $ ;if U É ‹Q ( %  †¯© ÌU â 2  
ø Å ‰Ô) 2if Ç
œ o  # =" p‘@propertyC  ~]² H 1if G †fragment  þ áá'{}#{}'.formatC $._R ,A = _ .   = S.sett-§ %Üð# unwrap('<URL:type://®ì/path>') --> ' ' Ð 
Œ oQ  ^% ß Ë = _splittag	ú g ¹r@ò Odeleó î E 7  µ Óselector = ''w ˆÇ y 	¸ ! =   °  @ ÌF !ifÞ2 != 
^Ä  ! =- ƒ ¬Ü# issue 16464 ±f we change:   tneed toÛãcontent-length2H ð(cause it's most probably c÷alculated for previous value)
  ùif self.has_header("Content-length"):2  = 3 oremove6 
6 Ñ@data.deleter @def  (E \   . r = None@  . o_parse0 ðtype, rest = _split , ¦._full_urló ï  % 1 isi 
ß praise V*ðError("unknown url 8 r: %r" %8c È Rhost," …selector¡   (³ —   
� N ’ = unquot	.+ )$¡get_methodü Xð"""Return a string indicat Ðthe HTTP requGE A."""® îddefaul` ¤ = "POST" Mµais notQ¦ else "GETD rƒ qgetattr¤ 2, 'm :', c Ø d6 Ú T #$ ‘set_proxy7  , 1,ÁC Ã  Øñ  == 'https' andÏ \ €_tunnel_B ž  " =õ + @ 8  Qtype=‘ *  ns 5 ß  "     f ! =Ú ø  Êø ì /` ± a Œ  v4addÜ m `, key,CS �# usefulg soÏ UÐlike authentii!onW ¹ jðs[key.capitalize()] =b Í  … ¿unredirecte’ Awill¼æbe added to a D ë
“ 
f /dr�  j4" W_name%x( 3 in(	" o ! / ¥ *4 ñ\ Ž a=Zœ  ¿ .= es.get( Ž  I 	 7 ” A 4 Þ)® 
= I ', 4 £   œ 8popH,pH, ‘ 6 Ì  ëy Qitems= ¯hdrs = {**] #,  E !s}V  7øPlist(F .`  Ñclass OpenerDÛ"or" � Œ__init__‹ áclient_versionˆðython-urllib/%s" % __ve“rsion__
  ñself.addheaders = [('User-agent', client_ve; %)]; !# = Phandl; õis retained only for backward compatibilityD 
B 8= [_ ômanage the individual p D ¯_open = {} _error  ÿprocess_response# 
Rquest" e ƒdef add_˜ (Ó ,¦ !):$  mó if not hasattr(/ 0, "= wparent"/  3 °raise TypeEº ò("expected BaseHyõ instance, got %r" %u  F  Dtype 5))
, Õadded = False  Å¥meth in di¸ ª 4if % Ñ["redirect_re-a", "doœ  Rproxy ]¦ õ# oops, coincidental match“ + †continueÃ   1i =Œ ©.find("_")9 ƒprotocol& 6[:is ? €conditioG Ó k[i+1:]c %f ' Ñ.startswith("aÆ V 7j =3 š ‰ + i + 1¢  0 0kin‹� j�    >try= ! ; @int( 
þ  ! ²except ValuXH Mpass˜ ˆlookup =û_ö T.get(]N, {}y  .ø4 [0 B] = [ 	r 7elijP == "á"±  ê 4 = P 	F  ô ] ¸  L 	* p  t .dy <ì -x P w .se` W¸"M¢.setdefauliJ, []ô$ifsf Ôbisect.insort�s9© “ t.appendE 
… Ö(Tr) if´*ed˜ 
” ¯r™ ƒ  B_Ä V Rclose m 0# O!iexists(s).�  V ±_call_chain\ !,   , 	, ð_name, *args):
       ñ. # Handlers raise an exception if no one else should try to h9 #
  ð# the request, or return N@  if óy can't but anotherG rH cf @.  O  Rwise,< P g usponse.7 Ž õ	rs = chain.get(kind, ())' %for 4 in} %s:!  Î ó func = getattr([ ¶, meth_nameP  / �result = 8 j(*args! 3if $ ais not
s H 0+ 
’ ðdef open(self, fullurl, data=Yö, timeout=socket._GLOBAL_DEFAULT_TIMEOUT)o @# acá` a URL©2a R·q object{  ’ åif isinstance(~ 7strP  ) Treq =F )  §  D‡ 7 X v   !ifä  1 q.c ! =- 3 > Creq.$ ="`  protocol =¯V.type; Ð# pre-process   Ï; 4 = G 3+"_ö"(  gD  ori À. / £F K, []U m ‡> /or‰ † 7 V(req)Õ ósys.audit('urllib.ñ ',ã .‚_Y : S rheaders @get_\ (odQ"reŠ1 = ä _¯2req¥… g# post[9 4 \ ^\( ]0 ^@Y ! =	 c  è §† É & 8 !ÆùþNQcall_Ñ.ŒJ Å, 'default',E þ - < ø›¢ ’ ] ´A    À H ,L/ +Ê Ã 0¥ �/._eunknowne'+ 	  Ñ  ÿQerrorÆð ", ,t"if
 2‘('http',  's'$ h`# XXX # 2[s]6 ñcols are special-cased€  2   ðdict = self.handðle_error['http'] # 	 ñs is not different than '
  ù	proto = args[2]  # YUCK!% Ámeth_name = h t q_%s' % C 	0  ‚  # I = 1 Porig_k r  Uelse:    ôdict = self.handé 	% ™ ‡ @ + 'z 9or') ’ 0 ‰ (k ,Ç %, S 1) +/ Uresul” Ð_call_chain(*J )) 2if , 
Ò creturn 
. ž 
0  U 3 = Ÿ ©'default',ƒ  ® ^\  Iw Iµ  `
# XXXþ ðbably also want an abstract factoryEð0t knows when it makes
# sense to skip a superclass in favor of  b 6andF aight
#N K òinclude both

def build_opener(*2rs):�"""Create¼ $ P objeÁ  rom a list† 9 .ˆCThe 0 ówill use several b 3 ", – 0ingä Aportpåfor HTTP, FTP Ü ¡applicable Sr `If any‹ 5the\   passed as{Pument
 Be su4#es3 s ›  M   Ó   beÚ !d.= 1""" ø 1= OU@Direì(ÐM _²Áes = [ProxyH“Pr, Unn   `  „  $ DÏE½0 "1Redƒ  E 4FTP# U File  ^ W ¯Processor,D CData8 ]$ °if hasattr(• .client, "U ÃSConnection"r Ù #�.append(2 ] L Ót] 3k"G Ò `  & PcheckH†  # áif isinstance(- g, type§  (   , P, † -   1  · R.add(% (    !elO { * 
¤  / K  ß 0  ß  ! 7 t.removeˆ ‰ 	> 0 I ä Å _AE 2()) G h�  s< 
á hXSh = hÕ è p  hŽ! !

WD Bas¿x † Â_order = 500¨  Ðadd_parent(seãlf, parent):
  Rself. # = 
  def close($ 3 ñ# Only exists for backwards compatibilityG  h FpassU a__lt__V w, other] ñ if not hasattr( ÷, "handler_order"0  _ ð# Try to preserve the old behavior of 
 õng custom classes£ H ðinserted after default ones (works oü  õ I KuserF \ ¡ which areÓ  aw
 ‰ Ì )).= µreturn True   †." <?
 1


� ò
 HTTPErrorProcessor(BaseHKD3""" 0   e1 á responses."""‰ 
y “= 1000  #)2all‹ " pl 6ingñThttp_S ø…request,k �  ˆõcode, msg, hdrs =% . L .$  binfo()x  H °# AccordingðRFC 2616, "2xx" L ñ  indicates that9vclient'## ® € was sucNöfully received, understood, and acceptedàÛr(200 <= W< 300û  · Ð 1 = ôž.š(� &  '^'HQ,b HSj 3 I s¨0 =   VD]O[  AC º _M N, fp¥ ›Qraise–i P(req.vM_url8  M )¤ �Redirect  ñ # maximum numbe%r6 @ions4áany single URL}ð # this is needeePcaused x@stat‚òat cookies introducÔ max_repeatÛ4U Œ _total’ °(regardlesso ¢URL) beforZ p# assumðñ we're in a loope y á  Çü ¬ü _îª	 eaî‡, newurlÁB"""RÄ2a Räq or NonŽ r\ r .…  ÓT\@call\y“Gñ30x methods when aÜ  < O 5ion2 ¨¥u.  If aw  ( eshouldC  take placeRŒaå Ì ‚to allowÚ “ %toD qperform¹ “ @.  Oê0wisZ 
Ú 2-onÆ Ë Relse œ " tÝ‚}curl.  i\µf you can'tŠ àbut another Haãndler might.
  5""" õm = req.get_method() ðif (not (code in (301, 302 3 �7) and m Ö"GET", "HEAD"G  w ?or E @ Å== "POST")):�  : ðraise HTTPError(® ‘full_url,U õ, msg, headers, fp)
C ð# Strictly (according to RFC 2616)Ç @1 orØ  Ç ·response toF  a ž ð MUST NOT cause a redirection without confirma C ðfrom the user (of urllib.request,~ ÷
this case).  In practice,I õessentially all clients do� 	K ˜, so we dÑ  ‰ Xsame., Be½ qciliantÐ P URIs @tain;°a space.  T« —is mainly  eredundB  j 0mor[ ±mplete encoˆ1donY`http_eàh_302()î ñbut it is kept fK²mpatibility§ Öother callersì’newurl = 	 ÷.replace(' ', '%20',€CONTENT_ÀðERS = ("content-lengthÞ Gtypeæ3new‚� = {k: v« @k, v� ·  g.itemsh ç Ðif k.lower() ;in š }m‚return RB(æ >V 
 � =¬ + ðorigin_req_host=À  < óunverifiable=Trued0# IAment Þ ±e: To avoid¡server sen!¡us into anó ñ# infinite loop,3 ?Ð object needsâótrack what URLs weD ñhave already seen.  Do {Qby ad{ Aa ha@“-specific? €attribut"� ~� }Kdef ÖPself,nO, fp»úr# Some €s (incorhCly) õÂmultiple LocPà¨  ñð # (so probably ïQ goesš0URId“Use firstA¿  > Sif "l[ "Ä_ 
 s# =? &s[4 ]‰  elM ?uriH  / C *sez ¿ð	fix a possible malformed Œ  urlparts =€Sparse8§ ü @# Fo†0curc`reasonC` don'tw%own ý¥0yth$�q a# than, sn7ftp{i˜ p.scheme u ('G ®  s	 0ftp '0 ´ *ÀTTPError(
    énewurl, code,
 ò*   "%s - Redirection to url '%s' is not allowed" % (msg, T )O Õheaders, fp)
m !ifG ðurlparts.path andi  unetloc:2  § / „ = list( )& •[2] = "/" ¥   =f wunparseD ' á# http.client.' _Ç P() de8÷s as ISO-8859-1.  Recover theJ áoriginal bytesã  percent-enI ¢ non-ASCII# ,$ ·any specialM ð characters suchƒ ¥the space.( æ equote(  B !, | ƒing="isoÄ ð", safe=string.punctua`@ Bájoin(req.full_R èð# XXX Probably wantOÀforget about1‘ state of ucurrent¹ ð# request, although that might inteP poore —ith otherB Phandl99 “also use  -l4ficj µ attributesE Ãnew = self.r_™   âT 3I  ý ewKJNoneãfreturn)¢# loop det�E &# † àdict has a keyÞ1 if öwas previously visited, if8  í Ã 'Ú  T *')� ?   =ï =;
 ¬  zCif (@ R.get(+c, 0) >VÖmax_repeats o½ >   4lenB 4 ¬s²  8 ð raise HTTPErroré ³ „¶ 8  ö›inf_msg +à Ú- ;elsÒõ 5U = {}:= [. Ð D8+ 15±Don't closeSðfp until we are sur  at w-  iuwH74†fp.read(f-Gose(úÉ/ paÐP.openø , timeout=> ;  z _e¨a_301 =‹ 3 7 2«R= "Thý@ ser ™ Ted a í q T•would " \„ÛP"lead¼±an infiniteœ?.\n.   v ƒlast 30x_ òmessage was:\n"


def _`aproxy( ÃA"""R� (scheme,²ð'r, password, host/port) given a URL or an authority.

ð<    If a URL is supplied, it must have an authority (host:port) component.
K ðAccording to RFC 3986,D   	F c: ¡ means the…  u 
L y ñtwo slashes after( bschemes 1"""/  B, r_
 ñ = _splittype(proxy)) eif not( ñ.startswith("/"):%  � #ô  \ ENone != j  HelseN 1URL  \ … 
	†  . ñraise ValueError("f 0 ¹ 6 no¬ r: %r" %‰ ó  D @# We‰
Í…, so for­-˜Pliant^ ¢s (by ss 3mI ð and 3.3.), path8’empty or N – 8'/'ñ e'@' iny V  TÅ_separator =' –.find('@'Ë  0 =end% Z"/", I 5 
ŽC 
26 1if j J= -1±   ‡q[2:end]‚userinfo¥  A¥  (G€ 0if   2  c µ o ‡    ƒPssworñppasswd(  < M 
ÿ   1 = * ;  Z ¥ rreturn é,‚ d º �

class PYÃHandler(Base H#! 2iesM beQfrontm h9 P_ordeõA100
 ñdef __init__(self,Ð@ies=ª ^  Æ$if  %  !    * € S= get (  PasseræQsattr(áies, 'keys'), k A  ™Ò be a mappingx E  ¡ .\  WaroxiesÉ    ` †P, url+ w.items(Í  .  * 0 =  g.lower®    1set«  u Ñ, '%s_open' %3 ,v  ,  ‚lambda rFay=url,/ =g p, meth=Q Æ yR 
GJ    . (L H &))¸ Þ C º3reqy - [ Porig_„  Í0eq. Â I   ˆ Baparse_. Áé « yd !is±  # 8   %= � Ï    pif req.X ú0  by=( ÄE Ž	I xE  ¤:ord‹   _X   =Ù0:%s×�(unquoteÒ)á ©  2  L  )ñà    creds = baó
se64.b64encode(user_pass. Q)).de §"ascii")
  ö'req.add_header('Proxy-authorization', 'Basic ' + credsD ôhostport = unquote( %  e Pset_p]   !,  V_type, qif orig 7 ==$ : or ‰'https':Ñ ù# let other handlers take care of it1 µreturn None LelseW üneed to start over, because thes Jdon'i a# grok, ù ¦'s URL typy  šñ# e.g. if we have a constructor arg¼ies like so¬  {'¡': 'ftp://p ð .example.com'},^ °may end up 5ingŠ àa request for U x://acmeM °/a into one' C ‚ )/a( †ðself.parent.open(req, timeout=H ñ)

class HTTPPasswordMgr:
W Ðdef __init__(U )#  .#vwd = {}2  	 1ord6 à, realm, uri, \!, ! dP # € could b­ single URI³0a sC&ncæáif isinstance(\ 7strS  }±uri = [uri]Ó   "if‘ ‡ not in Ë à  )  [Ã ]ë      Î�default_¿½in True, Faü‚reduced_’ etuple(“  N   r *  ) H(u, a )  uµ 6uriï; W­ [I s  º ×{±Pfind_—ó 
· È o ˜domains =<Q.get('F, {}� &"t b Ê  	J r `uris, - @info2µ {.items(( B7  ,  > ï    "ifô ’is_suburiz¡  d_q 
,9  ¤ )  š ¹   B,H  „] þ  !I=wÓ ‘"""AcceptPorityF Mñand extract onlyK Ž &   �path."""�  ¸ #+e& n@s do X < Ì – componen³@part(€urlsplit.1if ! :[1]n#ø  ƒ ƒscheme =1 0Ï  À ! 1!  Ó = ð2] or '/'
        welse:
  ‘# host or Y:port  Ùscheme = None ù authority = uri ¥path = '/'  g  , ` � = _split (G )+ °if default_# B and9 !is‡  ™ ais not 
Ù d; å= {"http": 80,b !  ! s": 443# b}.get(s ¨  F  ¬ j ‰  & å â = "%s:%d" % (ª V ureturn 3  , N
¼ ödef is_suburi(self, base, test)±"""Check if ‘ is below/ â in a URI tree[  § ðBoth args must be$ s. Ñreduced form.‹  0 5""" "if[ !==q ‹  ) Ô 6TruD1 R[0] !4 ?[0]7 FFals8 àcommon = posix. €prefix((2[1]F[1])\rif len(0 A) == 1 ?´ È ‘ ò

class HTTPPasswordMgrWithD¿kRealm(  "):q Ì³find_user_pA Õr: ,7uriš  -  o , =~ .S ° ã   ” � E 0if ‘  ^†1 % ¶ ?  !Ã  „
�œPriorAuth~žŽƒ__init__„*
`, **kw
 … y.åenticated = {}Ø …super().Q K ?addüAuri,^9 d,û	v =‰™ yupdate_* (N *is t# Add ax è  pDƒ• requestsâ 1if £ú	á ÁŒ dˆ 6 j ,e
)Gô  §7 ú :#_ ` couldøqa singl 0a s&ncˆi‹‚instance`7str� ^²uri = [uri]­   4foriá0in !, Ð
 - uƒ:uri  K ˜_h  ñ .   ð(u, default_port)
  ùself.authenticated[reduced_uri] = is_   

C =def (M  , . Quri):)  - öfor default_port in True, False)  -  G 0 = W .  • ( ,T )n  E  r 0urii >  3 â 
p  / "ife ò is_suburi(uri, t d 
Ò  5  breturnA 	h [Bò


class AbstractBasicAuthHandler:Qð# XXX this allows Ä �multipleUñ-schemes, but will stupidly pickô# the last one with a realm specified.t k j ó
double- and single-quoted< cvaluesc ("  " ñs are a violation of… 2RFC« `appear� œ Bwild®ôrx = re.compile('(?:^|,)'   # startL Ñstring or ','†  p'[ \t]*< P # opŠ Ãal whitespac½ /  À'([^ \t,]+)'u cq like "«"n +n Ÿmandatoryo #OO=xxxX   O'xxxè " O"xxxœ îÀ=(["\']?)([^	 *)\\2',v Tre.I) ˆñ	could pre-emptively sendˆð info already accep(’(RFC 2617d  # 0 oZcŒ2 2,]e À1.2 immediat_ °after "credª2alsÞ q# produ5 )¹ ~ƒ__init__v÷password_mgr=None€8if  @ is " 
	" s= HTTPPT BMgr(² 6Q. 9d =Y \# Aadd_'  or)   (d. wÒ aparse_¾Ö gheaderË !# % P WWW-E + · * :� 9ãchallenges per' © efound_$ " =’  @r moº¿Ò.rx.finditer(… ¯ 0S,- U ‹·= mo.groups[ / "if* 1 no)ª['"', "'"]° , �warnings.	 (° ! Rñawas un¦"d"— 7  RUserWQ 3, 3+ ryield (‚Å # L äß G !ifÓ ' 
Õ #if¢
  ? { # =! µ.split()[0]® ' eQÐ    scheme = G''
  ñyield (scheme, None)
" ðdef http_error_auth_reqed(self,  ²req, host,  �eaders):B  g # ¡ may be an7 ðority (without userinfo) or a URL  7 anG  o 8  hm 3 = 
 �.get_all(, Ereq)+ dif not( ž ¢ #no e found6   breturn  Ñunsupported =// 4forH #in
 sl  # k�realm in O�._parse_ (Ð F z   2if ? ú.lower() != 'basic'j  .   
° = ²  !  †continueë  1if — 1 isF $m ð# Use the first matching B¢ ¿ challenge.‚ ð # Ignore follow8 2 �s even if^ y2 	 X M ì k Özaretry_êIê(Õý  8if VÀraise ValueEC¡("Abstractò AuthHandler doe\"Í  v  "}ý 'ë O: %r@ %ê)Ñ  æ —	Ýú ·b, pw =IÀpasswd.find_ _ Aord(: L 	”/pwT raY °"%s:%s" % (S  o B   ëA = "Só " + base64.b64encode(raw. Q)).de z"ascii"M êqGƒë.d _ "1 ==É Œ   Z $	Ëóreq.add_unredirectedT e   r 
› X  •Ñ.parent.open(w€timeout=e  > Jelse¨ L ¤ ¥  qrequest’ Ó„Aif (Eaasattr$ .ãad, 'is8 enticated'Í]  !  :¾ '1  Ê §.full_url)x  @ ² 6reqŸÔ ô 4hasL'W«orization'H D©· !˜ Ò P credñ ôals = '{0}:{1}'.format±m )‚	B  èd_str =·–standard_Àg ¿ß]ð'Authorization',/
  õ'Basic {}'.format(auth_str.strip()))M ±return req
 ðdef http_response(self,!    !):,  � ¡if hasattr) Ð.passwd, 'is_w §enticated'5 9 t200 <= j ¶.code < 300`  +    † ] z.update_ ö(req.full_url, Trueå  A OelseW .GFalsX =B >´s_request =N 7! 5 "  á



class HTTPËüAuthHandler(Abstract c, Base& "):‹  �°_header = 'H ¢orization'# ð‘error_401È ìpq, fp, –r, msg, K sÊ@url Â|ã  q×1 = ½ ÷ _f ˜ °reqed('www- )%',B  F  ì6req› = œV\Proxy>W*R Ä ]7]#<4 Œõuires that there is no userinfo component in # iåority.  Assume? ôn't one, since urllib.Ç0doea gt (andQ ñshould not, RFC 3986 s. 3.2.1) support² ÷	ests for URLs containingN ¿ . ± fEhost bpò d"ƒ ‡ CÁ2# RWòn random bytes.
_  r = os.u õà`Digest²Ô¼"#  ÊÏ 0ionÿÁspecified inŒR2617.æÐ# XXX The cliÐ in8 F n T  -IIî ì #Y Æa successfulºf 3It ðbe possible to táthis implementŠc againØò # a mock serverãðjust generates a s: ðc set of challengbª  ï Pqop="¾T-int"Œs,Bhakyµ  ƒ__init__žÄW=Noneë2if   A   ’¡ =·PvordMgr(‡( 	 °  D  Aadd_ ðord = self.passwd.aÓdd_password
  úself.retried = 0 ¾nonce_count Qlast_" � = None
=  def reset_W y> (h !):!  z   	w   ; ñhttp_error_auth_reqed? !,  òheader, host, req,  s`  * Treq = P.get( _- ,² )w  ‘ 9if ” 6> 5®  ! ñ# Don't fail endlessly - if we 0ed 0õ, we'll probablyd G A ða second time. Hm. UnS c the P¦» Manager isE Ñprompting for4 ðinformation. Crap. This is¶ [greatD àbut it's betteF !anK ûcurrent 'repeat until recursionG ùdepth exceeded' approach <wink>. °raise HTTPEâñ(req.full_url, 401, "digestìV)",E  G ÑsÒJelseÃ	áE+= 1W !ifp ;req2 tcheme = µ.split()[0]<  ‹  >+ Ò.lower() == 'Ê 'S  / freturnq!y_ö0 ÷ ð6req¦ = .eln Ÿ!= 'basicm tRValueu¡"AbstractDj`AuthHaÑùr does not support"æ  ~  "3`follow�s¢: '%s'" %  )/trñ   �Ï §Ìô token, challeng�Œf' ', 1# ' ð = parse_keqv_list(filter(§, t  4 [ &))I  † " =¥1get—Aorizc  8 1 E
ï F ‚_val = 'pa %s' %R	^i7#q.Î° .B  ã ] :valn  ž] ê 	`  lóadd_unredirected_
i ` ß \ $sp pa%R.open Ë@out=i  > ÷Fresp [cF† !,  ÿb# The #  -vÇÕ is an opaqueä À# quoted str‰+ ±provided by©0cliÛband us Rboth  M  " @servðo avoid chosen plaintext attacks, toï j x mutualJ �uthentic: , Z 0 Ðsome message X PgrityO 1tecÏL Óõa fabulous effort, Ò{à Good Enough.
  ‚s = "%s: ñ" % (self.nonce_count,  €, time.c C())
A ö b = s.encode("ascii") + _randombytes(80 ödig = hashlib.sha1(b).hexdigest(* ñreturn dig[:16]
s ñdef get_authorization´ Ñ, req, chal):,  £ 6try   qrealm =( ![' %']/  " ï "  " 3qop  ¦.get('qop'¸  D „algorithj (  {', 'MD55 b# mod_ð doesn't send an opaque, even though it i% 	¿ ð# supposed to be op$)al& O 	Æ  v', NoneÏ ü except KeyErrorN¤ 2   ý PH, KD J­u_impls(f qif H is| c „user, pwf Àpasswd.find_ _ Aord(â™.full_urlv  . y  # XXX not Ë µemented yet^ if‰P.dataX  +  
Õ 2ent	n $centityþA(reqB Ð] OelseJ  e „(A1ÚÙ ê  	0alm;%A2, )  }  “ •method(),  Þ ðselector: what about proxies and y_ urlsI  s G ™ ñ# NOTE: As per  RFC 2617, when server"0s ", ð-int", the client could use either `( `Ž #Ô o  @ `< B ñresponse back. weG @  $ Ÿ) [ 0if .Ú"sp“KD(H(A1),�‡zw, H(A2)q`elif 'Á @' in^ §.split(','ù Ó "if¼A == iQlast_X 
E - !  øU += 1È  " }  8 7 % ~ " =™ 	_ òncvalue = '%08x' %µ ” 	0 c  ± ( F €  5bitéò(%sk‚ ", I ,g„	~  ½f | 33phandle Æ o.[ �aise URLq ("AD'%s'OàPrted.½ Fqop)ø_ !shò ˜ðpartial digests be encÃoded too?

  óbase = 'username="%s", realm Dnonc 3uri 5' \E L ‚'respons- P' % (W N !, I   ¼q.selector,D K   V Edig)+ ¥if opaque:  0 Ë S+= ', ª  ‡ . - Ÿif entdig@ edigest@ . @ i ‚algorith, l  / oif qopl ñqop=auth, nc=%s, c(} „(ncvalue preturn � Ñ…def get_„ Õ_impls(self,  )Œ ò# lambdas assume ú ø modules are imported at the top levelâ ] – == 'MD5'e  �3H =k ò x: hashlib.md5(x.encode("ascii")).hexˆ (í FelifÃ f ?SHAf Osha1g å# XXX MD5-sessâ ;elsnpraise VšÃError("Unsup+¿  ØÅentication "P   "EV%r" %ï &KDIàs, d: H("%s:%s1 ( ). "ZH, KD# – 2ty_¨ !©data, chal" 0notPlemen5yetÌ e ñNone


class HTTPDEóAuthHandler(Base ­, Abstract' } \"""AnBòprotocol defined by RFC 2069á O 8 ¡improves o0,ic! ’because iØ Pdoes õ ñtransmit passwords inaclear.2"""}  ðp_headerU ü Aorizþ'+ h2_or$ ó490  # before Bas› P  Ñ`http_ecC_401«�req, fp, :r, msg, x s? ^ñhost = urlparse(req.full_url)[1]’  ) €retry = ).q Ð °reqed('www-  :_cate'¼ ]   ‹ û¨ ~ v areset_‰ g_countüb cRProxyî hXd  Ñ ±T -O ·;7·! ® 7©  E ¦p¨Àe',
          ôhost, req, headers)
6 öself.reset_retry_count(! qreturn  ó

class AbstractHTTPHandler(Base 1):
` Ðdef __init__(i ñ, debuglevel=0):&  Š   &._ ' =* M  ¦ Ghttp* X S Q # L ó_get_content_lengthL wrequestN  { €.client.û ¿Connection.N Þ  â U o.data,  � –method())¨ 3do_< D    á  =â ¹ . c pif not  p’ ñaise URLError('no% s given'‚  ) %ifZ  ¾ 1 isR ÕNone:  # POSTo  1 & �   	  àif isinstance( W, strÑ  F   pmsg = "b  ( ô should be bytes, an iterable of 9" \r  L  €"or a fi/ Ðbject. It can%bD @type� -."D r4BType56msg* a n£R.has_s2('Cl-_ 'ì  4 ôadd_unredirectedA �  p 
V 
Y     €'applica©ý/x-www-form-urlencoded'Å (’ Æ 29  n   1and#A ‘Transfer-| _ing') 
™2 = " $
 (d 
Â  … :if + 	¹NL .ƒ l   ‹Ô(ƒ )§ Jelse™ M   Ž +h�, 'chunkð @sel_! =ÿ ö  kproxy(ªpscheme,�� = _splitß•š.selector÷ s 9 U_path>  Š  ‡1 RLHostJ5'5 z  m i `for naÏ €value inØ Pf.parñ2addÊs® 3 ! =: ·.capitalizeA ËÅ  ? V 1 Ç Àr(name, valuSe)

  âreturn request ðdef do_open(self, http_class,+ B, ** ¥onn_args):R B"""RU ðan HTTPResponse object for theI  t w, usingd .‡  ¢ f  y ñ  must implementB  ^ ñConnection API fromK ˆ.client.˜  `host =‚ .  pif not  Ñ  ˆ ñraise URLError('no% w given'PÁ# will parse# U:porta 1h =ž M(i ã, timeout=req. b D ñ .set_debuglevel¤. � ð headers = dict(b öunredirected_hdrs)Z . Ñ.update({k: v¯ak, v i'.S v.items(=  ' Aif kN3in 4 }š ð# TODO(jhylton): Should this bõdesigned to handle© �# persist
c&s?:p# We wa*so make �@/1.1ú|"buK§addinfourle òÒ isn't preparŽ ¿deal with a‰ vB# It0tryÊ ð read all remainúBdata¹ wsocket,‡ RwhichE ±block whileÁserver waitsª B Dnextâ Š S	2sur> :ò gets closed afte£V(onlyã#V Ú&["ˆa"] = "L "Æ ( ñ = {name.title(): val¹   , 0d}× if„ �._tunnel_A
ª Ë p }…  Ÿ proxy_authý ª P  -AuthorizaK¸  3 ;if 6 £ 
}  . 
� [:   	¦  I /# š  " s' §@be sŸto originC  ! Y   4del–‰ 
hmÔ ?z,C =! _Û ç:try#  Ž #h.�c Áget_method()p’.selector  0{ ) I 
 áencode_chunked`3has¦ ±('Transfer-( Ving')ì J ‘except OSö¤ as err: #²  -orv-:errW rS.getrFs 
3!h.M&  � f H# IfAdoesðsend us a 'Connectóion: close' header,
  ÷2# HTTPConnection assumes the socket should be left open. ManuallyJ Hmark8  to4 y õd when this response object goes away.L Pif h.~ :  °  .R /()  … = None
 ÷	r.url = req.get_full_url> 0# T– ³line replacþ ñ.msg attribute ofÜ  /RÂ g ‚# with .^ðs, because urllib clients expò  \'toG Ahaveg  reason in ‡ t.  It w‡ƒgood to q'isB ± ðis deprecated and get] n<  ž —info() or@ Ä �r‚  D.• - ñreturn r


classKðHandler(Abstract0 "):™�def http_J`(self,¡)íZ   2.do(  2 .I.U ´> \  & ¿_request = †   Q ! 0_

j as5(; a 0, 'c Sd '½ ê S× ë 	 ¶ ï ƒ__init__î ðdebuglevel=0, context=»ñ, check_hostname  Q Õ a 
'R_q $ ={ Ó _ $ 	‡  + 	 n /  ß  ;s§ > ‘Ï ' ÓpC § B   º =f .È 4 	± )² ® % z ò __all__.append( (')óCookieProcessor(Base) É 3±c5 <jarñaimport0.% °5if  1 isþ
x =E .© 7Jar;4  @ »  @dÑMà  0
I R.add_K _%(3 Ì " o 5
p  & z !exˆ~ $s(y < '"‚ T ƒ  î sï  E ¼ ! 5 "  sUnknown	u% J@type‹0eq. €  nðraise URLError('unknown url tð#ype: %s' % type)

def parse_keqv_list(l):
    """P   ð of key=value strings where ñ	s are not duplicated."""I a ad = {} Âfor elt in lk  o `k, v = á.split('=', 1)3  ! ôif v[0] == '"' and v[-1 J  -  K uv[1:-1]A ˆ q[k] = v breturndBhttpsñs as described by RFC 2068 Section 2.
c I_ ‚ticular,k À comma-separ*bNñ the elements ofE   †ómay include quoted-ŒJ.  A a could@ ’contain az , Bnon-C Ï0 C hav\ s¢1theC òmiddle.  NeitherJ Rs norw s@ ¡nt if they�escaped.B ²Only doubley 2 ,8Esing 1 @rres = [É’part = ''_b " =„ r = Fals²  g0curÅ s2if 4   0W a+= cur­     , 	X      U2inum   "if† 
Z  ifU ¶:\\'  6 b 'TrL     e   'elU "T  Øµ è h þ c ,c °res.append(P £ �   ¡   ` 
Ã ¿ ‘ Y £ "# … P lastZt iÓtj¯ ' ü[W .E@p() 4   5ôres]

class FileHandler(Bas ð# Use local file or FTP de$`ing on[ mF1URL€  { - ó _open(self, reqS  8Purl = †.selecto›’if url[:2þ"//  “2:3] != ' �(req.host2z  \    2 Â  + '†  * !if¤- 0in ± ».get_names(1  5 ðraise URLError("í ð
:// scheme is supported o"onD ‚ "UFelseÍZ ·ƒ  >_¹ _a  î )!# ›  y ’\  R= NonÂ �Ð  \ Ô (if.= !is> 
œ :try  ± ?< �= tuple(Œ  #  `socket^  byo Q_ex('è   ')[2] +> Àbyname_ex(so÷
cket.gethostname())[2])
  ’except so- ‰aierror:$  / ÀFileHandler.L Ts = (6 c  by p('localt 6'),m }return H 
k ñ# not entirely sure what the rules are here0 ‘def open_m ö_file(self, req)¿ ñimport email.utils?  Ò  †mimetype  »   =I . 1  e  â  …selector  ‹  % ° = url2path0 (  	 6try¤  � @statS0os. (L 4 ' `ize = #  ) B_siz    ¨modified =ô Å.formatdate(< úmtime, usegmt=Truel m5 = !p.guess_ Ó 5[0] � `headerË tùmessage_from_string(1  5 �'Content-\ d: %s\n ôlength: %d\nLast-â ' =' %N (º ðor 'text/plain', -$, @ )î 0if í
– œ   !, F€= _split ( C  Å  ^ or \™    = ³ and _safe_Ÿ< < P) in Ì »_87s()Ó •   ²   °origurl = '~a://' +â 0 +   X ¡ NelseP I í°addinfourl(­Ö“, 'rb'), /#, ± R™0OSE‘z as exp� ‘raise URL# F(exp?  d1on ]@')

KŒq 	¯Ü üÀW¿ & XF ó None

class FTPbD(Basnú ¦ Aftp_H êaftplibƒ  ¸å!if& É ü  F   Q2tp ,1 noMv given'„ E ;"if^0is 
v ."= Ö •.FTP_PORTß ±1 @int( )_ Á #ërø°/password hÒ5ingQ Ruser,Î î  î!ifL 
«  ( !, [  + j  d( ¶  ' ! =�  @ Lknquote„  S   0sern"''7 À   passwd = ó passwd or ''

  Etry:   ðhost = socket.get pbyname( ). úexcept OSError as msgM ‘raise URL# F(msg? ðpath, attrs = _split Ö(req.selector/ !di(  6 ., M('/' ðlist(map(unquote, 8 )( �, file = R[:-1]' E[-1]Þ !if � and not :[0]à  ] H &1:= V fwTòelf.connect_ftp(user, ™ , ^b, port�  , 
vtimeoutÂ  ¥0typÀ Ç  ¡ 1'I'Ù%D'À  ' f—bttr ini
¾  #  r`, valuQ † ( 
v  0 !ifJ Ð.lower() == 'Ž ')\  0 #  ] °in ('a', 'A i I d >D')œ  @  \ " =D @.uppu 	e  fp(ð trlen = fw.retr(  , A 
Ç QheadeM)""K m, p = mime €s.guess_ –¶full_url)[0ì ¦ 1if = Ä m À+= "Content-P ’: %s\n" %9 	ˆ 0if Å  Ò !is}ANonea O>= 0m ¢length: %do B 	q ¥ ó= email.message_from_string($ 
Kðreturn addinfourl(�+  ˜%q.4r 8Àftplib.all_eAsB:exp× Vexc =BQ'ftp / »: %r' % exp” tðexc.with_traceback(sys.exc_« b()[2])Hdef –oself, œ˜¯ aftpwraªD , L
 `persis7ö=False)

class CacheFTPHandler( Jð# XXX would be nice to have pluggable cG ± strategies‹ ; ñ	this stuff is definitely’±thread safe3  E __" 0__(B†  Î   .i A= {}0  H  Qsoone�03 ›delay = 6 @max_É P&16ÝBsetTFš <, t� R t5 ƒMaxConns6 m6 p m:  ƒ â û L! keá @�'/'.join(z3), > 0if ; 0in z Ð.cache:
       ðself.timeout[key] =   Q() + " bdelay
3 u  else:   % TcacheE ùftpwrapper(user, passwd, host, port,C  G  Qdirs,™ Iout)8 {  ³ Â 5 acheck_¶ (T breturn÷  Ò 
t Hdef 6  G )
r# first# Ñ for old ones>  Þ t` "ifr  so/ ft <= tY  :  O Ðk, v in list(} §·out.items()�  4   lif v <N     E ç w].close "  2del£ . ¼ "   & ’]( l á n= min(É PvalueÊ )s U c# thenW…the sizeW bif lenœ B) ==« Ÿmax_connsK8\ É 
Z  ®   ‘ &[k   & - $   Ubreakð   K"¾Clearô E 1 a - a  .¼ .‘
é  ) /6 ch J ç . ó
class DataHandler(Base ›  ¶ sdata_opæS, req   #   ð URLs as specifiedÉ •RFC 2397.?#
 ñ  ignores POSTedG  
 v syntaxr  url   := "€ û:" [ mediatype ] [ ";base64" ] ","` - Q:= [ 7 q"/" sub ö] *( ";" parameter §ƒ  ÿ ƒ ‡*urlcharµ 6 ñ:= attribute "=" Ô+  È =T–.full_url{qscheme,» ö = url.split(":",1� ù +  , ,, q r# even c encod~Åñmight be quoted so un  Óhany ca‚ k  � $  _to_bytes( £ &ifr¥.endswith(¤Q V < # =¤ 0.de¤ V  , ý & =c V[:-7]Ifif not MB À"text/plain;ÓÖset=US-ASCII"Q ðheaders = email.message_from_string("Content-Pà: %s\nContent-÷length: %d\n" %
  õ	(mediatype, len(data)))
% òreturn addinfourl(io.BytesIO. ð, headers, url)


# Code move from the old  ôlib module

MAXFTPCACHE = 10˜ R# Tri6 ðftp cache beyond this sizeg ñ Helper for non-unix systems
if os.name == 'nt':Õ ‘ ðnturl2path import›   1  ,   
 ’2url
else< 9def) (( )   Á ò
"""OS-specific conversionña relative URL ofÑ'file' scheme§  K Pto a  Õ — ñ; not recommendedÿ õ general use."""C ¿vunquote° á Ð Ã  ë   Ð ¡  · æ Ž î Ð "Î B
ftp(À= {}


classc opÐ A"""C 0to     !s.Ÿ TXRis a : ðrather than just a subroutin�ñcause we may needF Bmore4 pone setáö global protocolcoption� rNote --á‰ CbaseŽ  â0thor Ðho don't want=y ðautomatic handlingz perrors ßñ	 302 (relocated) and 401>  (authoriza‘ Ï 1ed)I  `__tempé‚s = None@Úp= "Pythƒãrllib/%s" % __! "__0  ‘nstructorZ  ‚à__init__(self,(Pxies=g ‡, **x509`‘msg = "%(¨€)s styleî Pinvokú ñrequests is depreó Q. " \u  \  "Use newerØ@func�s/methodÊ !{'n 0': ¤ 1.__ P__.__'5__}Y �warnings.	 s(msg, D„ BionW õ , stacklevel=3)= $ifÿ  ¼  ¹®   €= getpro)(? ó assert hasattr(! Ã, 'keys'), "   mÓÆbe a mapping3â ( =s £  @key_0 = ŸP.get(e  '‘ - Acert 	.  / 3addQò = [('User-Agent',V ), ('Accep z'*/*')]¨ 
¹[ €unlink =+ @# SewWeanup\Ë  g žn À# Undocument“ð	eature: if you assign {}E ,?  itò@used# d  b÷s retrieved with3 ’  T().  Åànot enabled by£ default
  ÷'# since it does not work for changing documents (and I? ÷"haven't got the logic to check expiration headers< Uyet). ôself.ftpcache =  ! D# UnŠ øed feature: you can use a differenä Bftp W �by assign× !to³ u wmember;r qin cased Bwantà ú
ally independent URL openà ¢XXX This iYñthreadsafe.  Bah.
j Àdef __del__(!):  ¢  †.close()-    + Zeanup-  / #š ñ	code sometimes runs when�rest of tÄ emoduleš €# has alÒ ðy been deleted, soP ca•˜ny globalþöor import anything0if ° Æ.__tempfiles  Ÿ  ? in*  . :try?     e punlink(Q )â      ïexcept OSErrorH 6pasÛ  5 =del˜ 5[:]] á  ß š
X ˜  h.clearÕ2addO1w, *argsƒ"""Add au � be!Ad byÜõHTTP interface only� ve.g. u.e 0'Acõ', 'sound/basic')"""5 ³ 3 @s.ap(™ »¦# Externaly ?   >Í úfullurl, data=NoneÚ 0Useq 2 Per().	 ¼€ insteadµ x, 'r').¬ b ó = unwrap(_to_bytes( ) „ = quote"  , Éö	="%/:=&?~#+!$,;'@()*[]|"? ê CU ¿ì
 ’Sname,É2s =W0 [J [ Afp =‘B F'rb'—  & õreturn addinfourl(fpj #, Z 4 ðurltype, url = _split + !ifK2 
Õ  @ = 'à ' �  ifZ  Q ×\proxiý  y
  Cies[V 
  , & Zyhost¸  ¶  …  % ,eUector/   (/  
 
3 ( 6` # SigírspecialI!to˜6_*(D Jelse#i 0 = ý Ç 5 ÚD_' +-! ƒ?= À      name =ó
 name.replace('-', '_')
  ñif not hasattr(self,4 A) or	 õ == 'open_local_file':A  H Šif proxy   preturn W .D �unknown_0 ( ö , fullurl, dataœ  A OelseW (J +trœ !ifl  is Nonb <getO(url¤ B ì ñexcept (HTTPError, URL
 ) Uraise8 !OS+  as msg1   "  ('socket ee  ',/ ñ).with_traceback(sys.exc_info()[2])
q Hdef Æ/	u=P³ ñ"""Overridable interface toL   ï ‘ type."""n  ÿ  à, url = _split ç‡ä  1 á 'a    > !',h Ô š ²,Ö á rinvalid® ¡ for %s' %æ Ä í ¦# External‰l ÚƒretrieveÖ‘ í Bõ Ã, reporthook  ± 
òK  , 4s (N ¡, headers)® !a Zq object�  ü�or (temp6 cremote7 	7 ëñ= unwrap(_to_bytesº4"if˜ d ‘cache andli² QÕ# U[url]¼  h¸1¹ % 4if Ü ‰ƒ (’ B  ƒ  ƒ + 'g #Ø  Bfp =Ú ¬\¶  1  ,   ¢hdrs = fp.ð      žfp.close(< Û 5P2path+(¨Bhostq `[1]), f 	Z 
º
b v Epass1 
Ô  X AcÚ ~} tq  @µ7'wb: ¤ ž�garbage,   B   0 AB ^or ""|  #, = g ð query(path or "K")
  ðpath, garbage = _splitattr( _ or "7  Àsuffix = os.( .7 1ext6 M)[1]j ð(fd, filename) = temp @.mks (U ¤ pself.__$  0 �s.append( M l 2tfpœ afdopen{ J'wb'\ Mtry:; …result =« �, headers+ 1if ›  ™ þcache is not NoneZ  z
0 ‚[url] = t ` ½bs = 1024*8 0siz¯--1 �read = 0 �blocknum ôif "content-length" inû Í „ Cint(#3["CD LD ]r ßif reporthookY   (µ `, bs, ö R while 1L A  Ï p.>(bsA —  »/ J  & ]breakZ   ] r += lenµ g Ÿtfp.write% 	…  ª>+= á n E ' Iofinall  ² fclose(Ò - 4fp.( "ñ# raise exception if actualÍB doe4jmatch ƒN  q t‘>= 0 and u<J 
´v �åTooShortError(N  !  ð"retrieval incomplete: got only %i out of
 mbytes"D 0% (Œ ¢,Ò%)
) creturn  à# Each method É d ®ñ_<type> knows how to ` that   � 2URLH Qdef _9 Ðgeneric_http(k,Q0neczö_factory, url, data)5÷ """Make an HTTP8 g using r_class.}  A@Thisû´an internalÖ ² õshould be called fromº ² )n 7s()d –Arguments³ -” Ý  l tÌ Q hostZ.„%an|  í 3Con$¥ instance.# -/ Þ 1the 6to 1Aor af  óplative-X pairE  o F ‘payload f: ÀPOST requestý  96 6"""e user_passwÞ ) £ Sproxy =} àif isinstance(Çurl, str):
  ðhost, selector = _split Y(url)- 0if  
B  M Áuser_passwd,# I   (5 
J  5   ¯ = unquote%  Creal%   ‹ Jelse„   	Æ 5url/  l ñ(# check whether the proxy contains authorization inform 	I 5 ë q# now wp ‘ceed with� 0url  want to ob‰ 	n Õurltype, restT  (³
X S =. 
H  y = None 3if j ú.lower() != 'http'i L—J ›2 È  ¶(Ú 
Ä  2 4if g �  !  X‡+ "  ( ^  " @ a `ð = "%s://%s%s" % t• × g / by‘ r   ½V 
£aif notXð: raise OSError('¤  e a', 'no& ‰ given')C ‹  ‰ *wd�  ‘ 
Ý   1ò = base64.b64encode( i . Q)).de v'ascii'Q 3A _ cº Æ  t  B` ¿ 1 ¾ "X ¸  h    ¦p_conn =q0nece0_fauyûÈheaders = {}ù 
¿0 0["PÑ(-AÈ "]ÀbBasic ¿F \  µ V P ( "Q  ; K wO AHost– ( ¥“# Add Con �:close as&÷	don't support persistentPes yet.Œ ð# This helps in N 1ing{ðsocket and avoid ö ResourceWarning˜ a› Â "R &e") Bfor - p, valuew ‚self.add s  ­8 S ¡if data is VB @"ConR-TypeŸ Ðapplication/x÷-www-form-urlencoded"
  õ#http_conn.request("POST", selector, data, headers)? Uelse:  T M  *GEL F = %)
A :tryN ¶response = Y 4get (‹ Qxcept' û.client.BadStatusLin§ ð# something went wro áith the HTTP s= U line£  ä ðraise URLError("› ° protocol e X: badA "ç €# Accord} ðto RFC 2616, "2xx" £ñ  indicates that” Ö %'sŒ ## ±ð was successfully received, un³Àtood, and ac(5ed.G ¤if 200 <= W.ú \< 300’ôturn addinfourl(5 ,? Qmsg, •:" + url,n  A E z ×b!re‚ Pself.z_q(a  v “ .fpƒ u Á greason Ò  Ç�def open_‚ (Œ ,ç )f=None)8b"""UseT'6.""†Ó _W rgeneric_  d Ô ™€Connecti¢ æ ™  0 š 0fp,œ ^	 Ó „á¸  aHandleV = Fors.¯0Derdð class can override this, orv ¡specific hR rÆQnamedb ´ °_DDD where 
 i’e 3-digit… #	Bð# First check if1|re's a z A for  L 8 ˆ F = '>`_%d' %'  5) £if hasattrù : ï Þ \Œod = get* I  ) !if3@ is 65    ’result = S (ñÌ	< ? ¢  U !
[  if_Sult: ÁW à   „ª�_defaultÊ K  l•?  W u
SB"""D|  Ô$orŒ`: closµ e \.ë!OSê	r1fp.6 ƒ-  ¢/ á 0err>s  ðOÆif _have_ssl°  ù sŸ— tKhosttoð http.client.HTTÿPSConnection(host,
  äkey_file=self. C GcertD  %)
‰ ð def open_https(l õ, url, data=None):.  ¾ ù
"""Use HTTPS protocol."""& preturn P !._a qgenerici h . 5s_c%z £ Ÿ  
6 $ “ � `local & ù or FTP depending on form of URL« ñif not isinstance(ü 7strc  ö Praise? qError('j e : xy supportk ˆ ¢ currentlyl Åmplemented')4 ifvñ[:2] == '//' and `2:3] !  ±12].lower()  e*/'°º RValue¼ "¼ Ô:// scheme is¼ ped only1O "¤ Kelse\ æå7 s IÅ  Ë
«m_¶email.utils= †mimetype  ,Ž€= _split œ  ×  – `name =pP2path ((þ :tryý °stats = os. (H 4 ‘except OSzL as A
WQe.strV@, e.€  ‰ P 0siz¦  o  u _ ·modified = %.ûuatdate(8 ömtime, usegmt=Trued mC5 = Np.guess_ 95[0]t `headers õmessage_from_string(-  mô'Content-Type: %s\n ôLength: %d\nLast-Ñ ' 9' %J (© ðor 'text/plain', $, < )Ù ì 
É0urlk! =*	e !if 3[:1˜] Ó ? :¼+7 	K °addinfourl(26“, 'rb'), T ˜ Â  » !, Ï  \& @if (Õ  ‚  P‘socket.ge by_? R in (Ž  g ²(),) + this )ö  ¤ h  58%elM .à ƒä�… Ôð may start with /% ¸ ¡:. Unknown' 0of ç q0" % Wh ðÄÀ'rb'), headeãrs, urlfile)
  ðraise URLError('local $   e ’: not on  qhost')
? ñdef open_ftp(self_ !):  _ õ"""Use FTP protocol."""  !if] ÷isinstance(url, strE  I ¥ 4ftpž ðproxy support for  o ¢ currentlyj ¶mplemented'!im< •mimetypes   í ð , path = _split  ¦ > Å   /: © 0no $ g given~   !, ‚ e   ( f Ruser,A &   & 0if  :  º Esswd¼  pa (" Y belse:  y = None « = unquotel  G   Gor 'Û V B  '  ê Á = socket.gee\bynamt 1  f !ÃeftplibÀ    ,   =Ålib.FTP_PORT# ÿ  1 @int(< * u, attrsS  ( 
' 
 !di=   .P7('/1  ,} =  b[:-1], 5-1]© !if A andÙ, 20]: < /1:1 •[0] = '/'` 0keyÄ u¡,$ `.join(q ô õ# XXX thread unsafe!L aif len!ú	.ftpcache) > MAXFTPCACHEÍÁ# Prune the . õ, rather arbitrarily_  ´ ÷›k in listj 
\  . ¾if k != key  ! vŽ5elf¯ &[kJ !  @del ù) †v.close(3+tr}  – e§nV ¦ u  eyÁ\¤ ¡ftpwrapperúMØ
Ï ; k 	 :  "D" $ = I  ”  —  sÆ   u, valueR ( , l   !ifÐ.lower() == '› 'ÿ O  ƒ €('a', 'A i I d +D'o l    \ " =¡ !.uC
• Þ(fp, retrlen)5@ey].  E( ,-
D mf p.guess_ �("ftp:" +¸:)[0†QheadePT ¸ 1if V ð :
             ÷   headers += "Content-Type: %s\n" % mtype
  õif retrlen is not None and Y>= 0:5  @ m ¢Length: %do Z 	< 8 ó= email.message_from_string($ )9 ôreturn addinfourl(fp,ô æ, "ftp:" + url9 ú
except ftperrors() as expÑ  raise URLE& a('ftp 1 ` %r' %1 ð
).with_traceback(sys.exc_Ž q()[2])
° ðdef open_data(self,”  ,  =^)} €"""Use " "� A."""G  d!if’÷isinstance(url, strC  ) À  O Á ñ: proxy support for‰   ò tocol currentlyl ¶mplemented'Gñ # ignore POSTedB ¦ #
 ¡ syntax of#  Ñ sí # ‚url   :=õ  :" [ media›ñ ] [ ";base64" ] ","5 c - Q:= [ 7 q"/" sub ø] *( ";" parameter É  4 ƒ ‡*urlchar_ 6 ö:= attribute "=" valu>6tryÛ  Q [ ç0] =ôÖ.split(',', 1… •VO q
H Í!OS !('± �b', 'ba~ [¡* ‚ 
M   ð  = 'text/plain;ñ Õset=US-ASCII'þ asemi =Sš.rfind(';e "  "2'='5n4 [ *:]� ƒencodingX $ E+1:]u  ;¦    [:F  OelseR '¼  msc [9 €msg.appeÆ 1Dat°'%time.strf	 ù('%a, %d %b %Y %H:%M:%S GMT',¡  ¥  	 N 0.gm ( . F()))ö� ž ñ  ž d  . 6if :=ø '
P# XXX¸Ethis0 3/des9ok?Æ K"= _.' pebytes( .q ³e('ascii'))" —('latin-1– B  öanquoteQ Î ü - þ 2len4 5 { L  t 	0  êÆ\n'.join(msg S w		1 �f = io.S’*ION ²#f.fileno =0 �# neededd§‚Á À·ð

class FancyURLH5er(
 ÷ð"""Derived class witóh handlers for errors we can ð# (perhaps)."""

    def __init__(self, *args, **kw
 !):)  - ¯URLopener.3 2  R ú.auth_cache = {} štries = 0 4max &10« Qhttp_Ü ƒ_defaultµ €url, fp,ù Acode	 Çmsg, headersÇ B"""D=  . "orñing -- don't raise an exception3   ðreturn addinfourl({ j 0, "§ Q:" + — 0err“ )Ç ?302Ã º, data=NoneÎ Eí@ 302Á òrelocated (temporarilyó ¼   —`E+= 1{6tryî ) 1if , �2and > ">=   
> B shasattrç ÄG500"Ë  0  Smeth ^  O2 ® + Nelsey   E ;I × 6 (º ÖM500,*  ]  ñ"Internal Server �ÿ: Redirect Recursion"I @)n dresult
rT #_it ¨ fù	F ¬  { b� ìˆ U kfinall.+ Ñ-  a¶  * , d¼ µ� ÝAif 'ßtion' in) "  â „newurl = [4 ]•  %  elM ?uriH  / C yBd “fp.close(ü x ò # In case the s3ðsent a relative URL, join with origqç ã 0url( ]–.type + "|(  purlparts =se(% p# For s¸Àity reasons,O dallow ØÀion to anythGUother@# th„Pttp, Ë s FBftp.�We are usB ¡newer HTTPMElderu  °'odp aThis o.  ò  will get deprefin 3.3ƒ  if‘°.scheme note ('· 1',  s	 0ftp '¾8¸ Z”  …errmsg +Ê   "Xàion to url '%sÿ' is not allowed." % newurl,
  Õheaders, fp)
* òreturn self.open(K " ðdef http_error_301(*  , n Á fp, errcode	 Umsg, g µdata=None):n @"""EJ õ 301 -- also relocated (permanently)."""9 § 	‘ /2(‹ Ò 3Ò 63Ò àessentially id ¯cal to 302ã U7ã 67ã °a, but @�POST into)or¼0if  ¸  ­Ù1 H   Oelse^ default;54"
ž¯retry=Fals 4 2uth4åtion required.‘This func  úsupports Basic a> Lonly™W'www-( !e'\$inÈ
P0URL%7er.…N
£  š 
C)C tstuff =” [¶ ], ±match = re. °('[ \t]*([^ !+) ñ+realm="([^"]*)"', e t !if
D sqcheme, º 1 = š ‰.groups(¸ s* .�r() != 'b'È rY‘ & g	x kŒ�name = '} B_' +ù‘type + '_'_'Q ¿rgetattrh e )\¬ ¡@ 
à, data)

    dñef http_error_407(self, url, fp, errcode	 ÷msg, headers, data=None,
  Õretry=False): @"""Ec õ 407 -- proxy authentication required.7 ‘This func  ìsupports Basic> …only."""= Aif 'h -h ”e' not inÉ ¤  Å §URLopener.{defaulth  8  
D)C tstuff =” [¸ ]. ±match = re. °('[ \t]*([^ !+) ñ+realm="([^"]*)"', g v !ifD sqcheme, º 1 = š ‰.groups(¸ s* à.lower() != 'b'È rY‘ &{ m��name = '} _ P_' + Ø¡.type + '_-_'W !ifÔ@ is ×
¹ âreturn getattr k !)(+²… Oelse@ T!)
’ Hdef Ä �· ‚ ¨} = ‘xPhost,ü àector = _split  ¹ ² `newurl9 i 0://4 ' ;? ˜  }V  =X  f. Pies['9 '¦‚urltype,ìK    (8 y�   & 1 1selu 
´ & 9 6i =c ê.find('@') + 1±  ] , 7[i:® ´ser, passwdÚ ’get_user_ ²  F ¢7, i‡ M(1 3 orK  ):Å : S� ñ"%s:%s@%s" % (quoteE ª, safe='')a � 8 © : ª 
 I¶ù  yê " +B ŽÂ -i  O(^ƒ  3 ÖsËÀhost, selectóor = _splithost(url)
  ðnewurl = 'https://' + ( µ + selector. pproxy =  f. Bies[: %']& �urltype, " yL �   ( ƒ   & 1 v 
¶ & 9 6i =c å.find('@') + 1Œ 7 , 7[i:® ´ser, passwdÛ ’get_user_ ² £ ‡realm, i‡ pf not (1 3 orK ï): return None� ñ"%s:%s@%s" % (quoteE µ, safe=''),8 ¯  8 © : ª >sel·ü2+D �Œ ¡if data isÜ :  ž õ k Ropen(b… Oelse3 ,f !)
_ 0defP0ry_¨À_basic_auth(j s, url, œ � =v)h ½Ë 
[	 U - P  ! =!F < ¥ A% E ? = <.7 ` ­½#osÿe8eÈ, ãˆ×clear_cache=01 keéRT + '@v.lower(#0if , "in ”O } 7if k 
    <delA F[key¨ % <  s Àche[key]
     ðuser, passwd = self.prompt_ _ à(host, realm)
8   0if $ 3 orA :@ ðauth_cache[key] = (( g A areturnE  
^ Odef †   ž (, Œ :/  � õ"""Override this in a GUI environment!"""2  import getå  6tryV  Z  ¼ ñ  = input("Enter³ ñ	name for %s at %s: " % (&§ )ì  J  h gt . V   4ordV *in\ ¤  M   Xr b 9   ðexcept KeyboardIÙ Jruptþ jprint(È V `None,  ð


# Utility functions

_local±" =)  Ú "()l B"""Rðthe IP address of  Qmagicøt'A $'.Ñvglobal q ,'if 1 is„ t  .  ûPocket“ °  byk (k û : 0

_o 4 ä  ã eå qcurrentç × O Ö  Õ À  tuple(së  ;_ex R))[2]û  24A vaierrorR $ p ^g bâ a

_ftph sb c0set?8 ‘raised byP�FTP classhU i jAaftplib1 ÿ 2 "=  R.all_Š ' ã * ¹

_noheaderä  ä ýan empty email Message objectØ I €   Ø 	Œ _ ".m_ ò _from_string(""Î R 	hAes

	  cwrappe5@"""CŠ R @openñ!()G É   ¹Bonneaç Ò  W’__init__(' ·VŽ , ñð, dirs, timeout=NÆE  ¾ ó persistent=Trueª   _ .^   =¶ r<  Ä K	 
 &  
  ™ ! =  
  ¬ ! =³ 
 ¿ $ =É 
 Çrefcount = 0 Àlf.keepaliveó  = persistent
  Etry:   µself.init() oexcept(  Wclose)  A araise
< Adef K  U )@ Ñimport ftplib*  9  % š.busy = 0 Sftp =0 G.FTPs 6 Áftp.connect( ahost,   k  vtimeoutÙ !  = Rlogin; Cuser0 fpasswd/ ô_target = '/'.jo3 Fdirs& U Ccwd(3 )�retrfilen  ,  o, type!·endtransfer!ifC ð in ('d', 'D'): cmd­ õTYPE A'; isdir = 1_Jelse( 1' +L . �. A§voidcmd(cm08¸¦all_errors
ø'D \  ïu = NoneÍ !ifO‚ and notï 
m �# Try to ‡‘ieve as a7 G  } ê   OPRETR ' ¼	6 % Aonn,_ Rlen =… Ç n¸( 7 
,(P_perm  jreasonÉ  4 rif str( î)[:3] != '550'-  1 œP URLEˆ ('Xk ƒ: %r' % K ý.with_traceback(å  M   ösys.exc_info()[2]Ã!if„ ¨
� d# Set P mode‘iASCII!j J^'Êf  … Ô÷a directory listing. Verify that yexists.l <
«  ^  pwD‹ 7pwdx !   / 
  U  * M
Ø  #   ! 8   òS fromÿ	 E kfinall)    	Å p/    7OLIST7…v 7 '  Sb¥ \1Œ š Áftpobj = addÌPhook(` P.make“c('rb')  _) ª[ ¨refcount +]I / 3p# Pass Xñ both a suitably decorated objectÊaMÅieval length‚return (È nÀf endtransfe£r(self):
    ¡.busy = 0
 Ÿdef close, ñkeepalive = False4  N 1if N Örefcount <= 0j  #   2al_a )r Cfile  & £ Õendtransfer()s  * .p E-= 1 Ž ‚ and not© Ë ¥ %re»  { ¥ ?trya  Dftp.   ÷except ftperrors(a    ðpass

# Proxy handling
±ôgetproxies_environmentA ð"""Return a dictionary of scheme -> ? òy server URL mappings.¥—Scan the ` ò for variables named <T !>_R ;’ñthis seems to beI ð standard conven– ñ.  If you need a= ádifferent way,  Œ  ! a¸ 8iesØ  to` < ð[Fancy]URLopenerl ƒstructorÙ 1"""+  ¯  I A= {}  # in orderµ öprefer lowercaseø ,„ Icess#inE @two ¬ ñes: first matches any, second"  e AonlyH  j `q, value› #s.ŒY.item/ + ! =’.N 6#ifD Òame[-6:] == '´'°[T ‚[:-6]] =B š ð# CVE-2016-1000110 -Æðwe are running as CGI script,:ãget HTTP_PROXYL ‘(non-all-¶  i); i6y:€set fromãD web³aby a ":ÑP# hea¾/ cclientj @If "Û Vy" isØÀ, it will st Ñbe used thank¿ ¡next blockN úif 'REQUEST_METHOD'¢R s òies.pop('http', NoneÖç!ifãÁ0nam¯   X¥     ­ û #   Oelse= ê  | <í r”e 
É  @y_by2	ËAhostj å=2s  """Test ifˆ  b shoulê¿ YÐa particular P @ChecÛ!heB yL ¢dpRof nos, whichf  �be a listTñcomma separated DNS suffixes, or '*'^ 1all‡ cŠÊ !isê  k  ¦ó‘ ð# don't bypass, if no_pñroxy isn't specified
    try:	   Ano_p*  =  ‘ies['no']! ö except KeyError6 Áreturn False* ‚# '*' isk ñ
al case for always bypass, 6if v =9 Y 2TruX phost =  �.lower()D ñ# strip port off"   + Ronly, €= _split) ( @ Ácheck if the> ò ends with any o ²DNS suffixe¾  Ô uname inÇ .c V(',')Ë %  =  .­ »  v 6ame-    *  1 l2 ò'.')  # ignore leading dot�  7   	; '    i! " =c 2 or÷  
Œ  5 åŒ    m Q'.' +ß x    k .R Q(3 )r  y ð # otherwise, doÒO§ Œò

# This code tests an OSXš€fic data? ucture but¹ , òable on all
# platforms
def '_y ñ _macosx_sysconfY,A£y_settings1""" R3 N0 if]"is�ashouldÖ Ðe accessed usêaU 
C Ù Ñfunction uses½0Macà ð
framework SystemConfigura. @ �to fetch6  î@y inâ # .e  Å á come from _sc S._getì  ÛÃget mocked iÚñ
{ 'exclude_simple': bool,�    ep  ðs': ['foo.bar', '*	 @.com ‘127.0.0.1  C0/16«}S m± @fnmaî  imý  æ  
 &P  ùÓip2num(ipAddrÕ é‚parts =  ".'a" álist(map(int, 8 )& rif len( Z != 4 2 = " s + [0,  R])[:4¬ q * Ã[0] << 24) |= ![1 '16 2 8 j 2[3]#1# C# ñ¾¯ Ìs£ 0if 0not T  Œ "if»K[]-  1 ½  !�  P ’IP = None  Œ Avalu~Ž_ P.get(c QG, ()¯p# Items©  ò ”@ are	 ®P likeñse: *.local, 169.254/16 §  »1ot † “: continuŸ    qm = re.{ð(r"(\d+(?:\.\d+)*)(/ 2?",A 	m‡ L ð 
U IP#   x ÖÀ              ðhostIP = socket.get pbyname( conly)
/ 	   < aip2num. .IP, ÿ except OSError:L ™continue
 sbase = ` ªm.group(1)d tmask =  2 1if ! ~is None  t= 8 * (D ú1).count('.') + 1T ?elsI @int(T Z[1:])Ð Œ b< 0 or˜ N> 32• ù!# System libraries ignore invalid prefix lengths7 ¦Q ˜ q = 32 -~ Ÿ Å1 >>  a) == (‡ ¬ ˜return Tr¿Áelif fnmatchU Š, value)@ <  ðFalse


if sys.platform� ‚'darwin'I ñfrom _scproxy import _get_ ¦_settings, 2iesø Bdef & ñbypass_macosx_sysconf· ° + Q & =R yg ()Ê ˆ b ,„ Y 4 � 0getu -ie› — B"""R‚ò
a dictionary of scheme ->b ð server URL mapp.
 2�This funB ó uses the MacOSX framework™�Configurap ~�to fetch:  » @y in¹' .( 5""" (´ries()

™  H _A”ý  P, if —² should be 8 'edê eChecks!¡ gathered S û ±environmentZ ¥specified,½ &or/ *†  ã  ä'= ó Wi´2ies »  G J y-_B  k6ies¦ËI ¡´ (˜H  	� ) b  C0os.‹ù#ntõ < ˆregistry~ +VWin32k ` to st� q?iesÙ%{}5:try¼·ewinreg' 8IÔ< ÷# Std module, soõðaround - but you never know!
      ó return proxies
 U try:   óinternetSettings = winreg.OpenKey( ùHKEY_CURRENT_USER,H  L ór'Software\Microsoft\Windows\CurrentVersion\Ix  y )')P  ¹ vyEnable“ ÜQueryValueEx(º �  ”  S'Proxd Y')[0]� !if=  
5 U 1# Rcðed as Unicode but7 ùblems if not converted to ASCIIi  M î ÄServer = strvò ; k   ú p ú 
| # ‚if '=' iCy,  + ó# Per-protocol sJå  , [for pV ¿.split(';')a  9 _ €, addres©p: ^=', 1Ä  8   P# SeeŽ; ÿhas a type:// prefix¯  > Æõ	re.match('(?:[^/:]+)://'‘ ½  G | ý = '%s://%s' % (Ø Ç  %Dies[3 4] =½ OelseM”# Use one© ”0all¸Â. ¸  
ÿ [:5] == 'http:'k  ; µ ) '³   P·  2 »    >  P 
 Q   ^ 	D s• E —F 2ftpD ?ftpˆ ¶v.Close(öòexcept (OSError, ð AType mñ# Either registry key}ðfound etc, or the v@ ƒ)an€�# unexpecª{format.!  °ies alreadyB0 up×°be empty sow @hing )doB 6pas]¢) sdef geth (æ 2"""pð a dictionary of scheme ->Áx• G€URL mappÕ!.
^  üE s» ð ga9qed from!Àenvironment,6–specifiedbKn` 5"""l â Ñ _[  ()‘ M "()®   	@y_by9_! GhostÐtry:
        ð    import winreg
   �except I eError:    ù)# Std modules, so should be around - but you never know!E …return 0 :tryg óinternetSettings =© ’.OpenKey(¸ õ.HKEY_CURRENT_USER,U  ¯   ór'Software\Microsoft\Windows\CurrentVersion\Ix  y )')P ¶proxyEnable“ ÜQueryValueEx(º �  ”  &'Pd ^')[0]� pOverridƒ 4str‡ ;¢ � p � 
�# ^^^^ RÒÑed as Unicodeõproblems if not converted to ASCIIÞ z/OSv 1O �!orb  ± 
UF P# tryŠ õmake a host list from name and IP address.¯ ‘rawHost, F€= _split (G &  C = [1 Ïõ d Ð = socket.get;  by‡ (> W   !if˜ C !=   
ñ  $  D €.append(a B q	Epassë © Ifqdn©   £   £  - £  ## Ãpcheck v�Ê�the regisð enÑ Å replace theê ð# '<local>' string by"    L ?  V ÆcorrespondinF²# canonical0 8	 9 =  .E7(';wb# now Ø ñif we match one of� Û ø ¥ºfor test ini 
("if& &== 
"  Jaif '.'e/inq + r% 1Y  ‰ =j .}À(".", r"\.")#  Èfsk dot  < *< %.*< öchange glob sequencÜG ?G F 8 # G IcharÆ  S0valR '1re.¤(· ,Ž~, re.I).  – . !0
z 2def½0_by˜`K 2"""` True,k š ™8 Àsed.

      ò8  Checks proxy settings gathered from the environment, if specified,
   !or* ²registry.

 U  """  j “ies = get _^ %()+ !if˜ Eies:  S areturn ‰y_bypassB Qhost, 6iesO OelseI ¿ (F 6)

6 ù # By default us¡ variablesª Û è (   Ã ! =³  Ò ð
"""Response classes‚ ôd by urllib.

The ba" P, add ,´ ñ)ines a minimal file-like interface,
including read() and �line().  b ”typical r� öobject is an
addinfourl instance, which†  n # ò () method that Ô€s
headerL 0d a#?url+ m@url.Ð

import tempÞ ã

__all__ = ['0',  “closehook  �  �url']


iF(Y @._Tek ò aryFileWrapper)YE"""B‚@ for?  _ L5add{ 0. I‘‘good idea- ðgarbage collection.;+€# XXX Ad9�o expose¡timeout on punderlyÏrsocket?�ódef __init__(self, fp¿  ]csuper(10,  # %).2 bfp, '<t >'e¦lete=Falsetñ# Keep reference around as this was part of¶ Ñoriginal API.ø ” ¸elf.fp = fpÆ CreprÆ Â Kà '<%s at %r wh%A q%r>' % ú 1.__ä¶__.__name__Î x  !idI !),'.y)¡ e^¢  @Ó .d>o ðraise ValueError("I/O opera â7 È"nú  ³	† xíptype, v] ·, traceback? > — (()s  64 @"""C“0 toî1 a *  +  n» n¬ Ï‡,;  : 0, * Cargsh  �c  ! z	¡Ë  + & =_ 
[   j ! =¶   @k ç§6try  š &  H " = k  '  "  _ &  	% &if© 
f  C Õ INone@ & ^ 6 = % À           c losehook(* sargs)
  …finally:   ¤super(addc; �, self). ð()


class addinfo, Rbase)H 2"""  to" A an & �) method  ñn open file."""
‚ Ðdef __init__(s Ó, fp, headers_ 	£  Y ž : &fpâ  F .A $ =K o  A k ^ areturnô ; ó 0urlö  > 9 ö   €() and gP $l( s%ô , url, code=Nonp&  ù ').Hl6 �elf.url =Z 
  f ! =m .‘@property(  «ostatus>	 E >  0 0get 1  iË \ ¶ Ÿòurl
""" robotparser.pys òCopyright (C) 2000  Bastian Kleineidam, ò,You can choose between two licenses when using this package™ Á1) GNU GPLv2!d2) PSF> ò  for Python 2.2u 2The¹ ñ(s.txt Exclusion Protocol is implemented as specified inh ±http://www.²stxt.org/no @-rfc`  (ô

import collections qurllib.E ðrequest

__all__ = ["RsQFilePwR"]

R( ARate;d ×.namedtuple("& C", "] ¦s seconds"`c j ïT€eóprovides a set offfaread, Ó Šaanswer8Ò   ` about? Iingl’ž¬¤	curl='' ¢ ±€.entries,]r  sitemap €default_= @y = ç
= €disallowŠŠ = False"  @set_V;url'òlast_checked = 0ú  º\mtime¸@"""RÚpns the # 	 w sßP was [ ’ fetched.X  È‘is useful%�long-runnhpweb spiþ� that nee@ñ ® 8 8newM » s periodicåw  Í    N ¦ ¥ ý !odr  ?Setý  ü&th²qcurrent>¢ ³ `ø b¯ " =C  & à()

    def seót_url(self, url):
  õ#"""Sets the URL referring to a robots.txt file.""";  O `.url =T 
 ahost, " Bpath# �lib.parse6 	 (� a[1:3]
@ �def read« 
¦ BRead§ ”  ² Àand feeds itµ  Ê ] r® 6tryö  ý f• prequest— Aopen~   )•  - `exceptè  Å °error.HTTPE
 z as err_  if ÷.code in (401, 403Ö  Y   '°disallow_alRETrue~  % (elR p>= 400 ü 2errf Z< 500…  9 ^ [ Jelse4 �raw = f.ˆK \p(raw.deÞ ö("utf-8").splitlines())Ñ¡_add_entryY!,  `if "*"& º.useragentsš #¦rdefaultF ù is considered last6"if…5 ‡  5 ;Nonø  á b cfirst 3 h IwinsZ  / [( [ =0 + `5  é °ies.append( y3d * !, Q.@"""PERinput# _ from³ ‰ ¯ 1We € that a h-i:C  õ not preceded byÈ ñone or more blank2 %s.! w# state¿`#   0:  rt tÝ  g1: saw‘ ^ \  # 2# #anÄ 4or 3
- { E = 0? ^A = E„g  a¦.modified(ì1forT  “
ˆ0if '  
  T  r ý ^ == 1  # �    Æ " 	 ?= 2c Ú ys á L       o T " ñ
# remove optional comment˜QstripG‰ 5 1i = š.find('#'– �if i >= É  p= I[:i]V  .y Îv ³	kcontinp	R  Ù}(':', 1¯ @len(- )ò�   4[0]º $0]¡ k.lower©  ­ 2 12 0urlp�.unquotem %[1G 
‘  @ ðif line[0] == "use¿r-agent":
   ßif state == 2#  6 ñself._add_entry( )R  /  A = E- ( $ Q.user  ÿs.append(line[1]5 ¬ - 1{ Qelif <  0]Í Ÿ"disallowù O!= 0ù ¦ @rule\ ¥ „RuleLine® �, False)¶  º 2º · Y?Tru¶ 4¿crawl-delays+ð# before trying to convert °int we need MmakeR p  @# suH ÿhat robots.txt has valid syntax otherwisJ 	ßit will crashr „ÿ1].strip().isdigit()e ¬ i?d = int[S2Ïrequest-ratež+’numbers =m é �plit('/'ª à# check if all}¿ues are sanvƒif (len(t )Øc2 and  /[0h � g=  ¼ ¥¦@req_JB = RYPRate(µ™ !),Æ /1]3sitemapÅƒ# Accord8³http://www.8 ÿs.org/protocol.html0ð
# "This directive is inde¤°ent of the Àa,M ð so it doesn't matter where you place"  in �r file."N T8 #ñwe do not change” k¡ parser.J Ö€#A m àdef can_fetch(* ,.îW, urllQ"""usµ1he ³ d²`decide? pB  \  \  K &"",ð if self.disallo‡w_all:
  Åreturn False Ïif self.allo4 6Tru3 õ'# Until the robots.txt file has been read or found notr ñ# to exist, we must assume that no url is ” Wable.= ð This prevents fÍ ÷ positives when a user erroneously@ ð
calls can_fetch() before  1ingº &()s  if¿ &Ïlast_checked]ò# search for givenš ×agent matchesœ  RCfirs f count! pparsed_=$Alib. A.url	 G(url `nquote %))g ? "unA q('','', k e.path,>  P	 Hrams/ wquery, $ �fragment„ « l z+urÉÂ 5"/"*  `‚entry inª  :ies¥0if  Ðy.applies_to(+�),  é 24  "2ancP{  # w  ºrdefaultc  +% f# _R 
p l �	' ›y · �fõ==> access granted� ^ È ðdef crawl_delay(x ,žV † ! w.mtime( &6Non$‘Q¹ Í  † c*
K -Ñ `  -Ïrequest_rate.¡1req¼ Ñ 1.N 4‘site_maps17T %  $ „ ®   d Š6 
Ð  ¡|__str__k  kYies =6  T 7 }@not ~ 
— N 
 1+ [‘ 	´]` ´ ñ'\n\n'.join(map(str,)òies))


class RuleLineu à"""A rule line• °a single "AŽB:" (%ðnce==True) or "Di¢sallow:"
  ( ð ance==False) fo# ò ed by a path.""1 ñdef __init__(self,  %, F $):Z 1 if æ == '' and not* )  Š ò# an empty value means.   V  - n u = True  ­ ñ = urllib.parse.urlun (   5 %))D  × . I `quote( - �  
Q  1£applies_to3‡filename,wreturn | ”= "*" or . ±.startswithH ¤ )g S__str—Z 0("AÖ"–f © ’ else "Di¶") + ": " +� â


class Entryºp"""An e € has one¯ ñmore user-agentsùEzero ŸrulelinesV¿ ¬  O N A= []Z  O   ¶delay = Non%6 teq_rate T  ®G
` Afor ” # i¸¦ ! ¢   året.append(f"U1: {@ &}"O"ift¸ !is2 ½ R aCrawl-2 1: {Ý  X rö [ G .  Ê   	Î €Request-J0: { ".r 2s}/ xseconds�  D 0ext‚map(str,ø Ì�×'\n'.join(ret÷^‡F€"""checkþCthis·< ò to the specifiedÙŸ ö q# split'  »a tokenÜömake it lower casj‹  K1serð.J ‘("/")[0].7 (X"if¨ a**'#µ qwe have· ’catch-all6 	Õ . hTP  µ " =6 ¯  " ‰ !inú2 � a  zËœé,
Ò!PrZfitionso D- ou›	á÷ú -Y ø  is URL decodedú � ®ç¤s  '  êîº·  *   ø 2  ™ ‚™  ‹ð#! /usr/bin/env python3

# Copyright 1994¯LG À Ellinghouse& Ðathedral Cityÿ$, California Republic, United States of America.
#  ñDAll Rights Reserved
# Permission to use, copy, modify, and distribute this software ðits
# documentatK ñ for any purpose( ñ)without fee is hereby granted,
# provided that the above� r¹ ð notice appear in all 1iesc  9 r
# bothE  Ë 
; n_ Fis pø V Ú
# supportingÙ  g   @name}ðLance Ellinghouse
#¬ 0 beRdª pdvertisS 2or È0ity‰ @tain &tojPion
#\  pD`specif	°written priW Ö  	ðFLANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING 9 xIMPLIEDA ðOF MERCHANTABILITY AND
# FITNESSC À NO EVENT SHG   ðCENTRUM BE LIABLEA àOR ANY SPECIALI ðDIRECT OR CONSEQUENTIAL DAMAGES  2  ð
# WHATSOEVER RESULTÊ ðFROM LOSS OF USE, DATA= ðPROFITS, WHETHER IN AN
# ACTION0 ðCONTRACT, NEGLIGEkAOR O0 ƒTORTIOUS1 `, ARISt POUT
#@ OU RCONNET ‚0THEŠ „ aERFORMÃ*OF�p.
#
# M¢ð%ied by Jack Jansen, CWI, July 1995:
# - Use binasciiÜ0uleñ!doÉð actual line-by- p converT‚between B   O Pry. Tqresultsëð 1000-fold speedup% 1e CI U  ðstill 5 times faster, ' ghÁQ- ArgWPs mor€mpliant 
ö python standard

"""ImpleŠ!ofá rUUencodŠAUUde @func°Bs.

  Ñ(in_file, out
 0 [,çòe], *, backtick=False)
N ; & [= 6 �, quiet])  @

im\Ž $os
 òsys

__all__ = ["Error", "¥  
 t ¡"]

class # `(ExcepÒ 0):
¢pass

def : ¤ ¢  Þ R=None­  ç R R"""UuM  )1"""j # C If C á`a pathb � open it¨°change defa5;   & !edysû ] 2try~  Ô ib f== '-'  Áñ = sys.stdin.bufferK  #  elD 0sin9&ce3str9 '   1if ¾ 0is #
k  !  P= os.ê P.base T )u  -  if{ÿN é À              ðmode = os.stat(in_file).st_ 
&  ýexcept AttributeError:'  1 Ipass ]  o 4penl y, 'rb')* aopened‹ „s.append/ ) #3 ¡# Open out3 ö if it is a pathname, 
 &if2 j== '-'È O @= sy µdout.bufferE  elm ¤sinstance(5 o, str)Q  á , /'w\ ðSet defaults for ÷ Y and É6"if# zis None¬ = ë !ifJ  X0  d • = 0o666
3 m ñ# Remove newline chars from† 3  ƒ   ÷.replace('\n','\\n1 ! ! =F ( r( ?r')Ž ïWrite the data~  m .w* ñ(('begin %o %s\n' % ((õ ‘& 0o777),‚ ö)).encode("ascii")® j 3 = †.read(45   while len(* Z) > 0•” 1bind q.b2a_uu6 ´, backtick=	 ‚  — \ † 	%ifC ~ y'`\nendŒ;elsI´ *' 6 vfinallyk  »Pf in $  Ã ñf.close()


def derY,×=¨,¶ ³quiet=False�A"""D? 2 uuº d 1"""Ãb 0Qinput# ,iwneeded., ¸ Q = []  '] m¸  h(ingc/ b ^� Z© 'tr�þ  t Á²ad until a 0is 4ñuntered or we've exhaustedb O[ H 
 ï;Tru2;hdr  1(( G  ½_ot hd} araise š£('No valid²  K ` foundcÌP
_  ’rtswith(b'; )  vcontinuh  °hdrfields =ª í.split(b' ', 2Ð  ù2 )&3¿ 0[0] † 
 p 	»   ðint(hdrfields[1], 8?)
   ]break ýexcept ValueError:#  L Epass úif out_file is None6 �# If the # 0nam' õn't ASCII, what's up with that?!?_  p ` ú#= hdrfields[2].rstrip(b' \t\r\n\f').decode("ascii"þ  ¬ äs.path.exists([ )´  v araise ñ('Cannot overwrite @ 1ingÖ u: %s' %	v `if modó   f= int(Ø V1], 8A #
a# OpenJaoutput{  
  æ ’j== '-'Ý ô õ = sys.stdout.bufferE õ elif isinstance)[, str.—fp = open& F'wb'Æ  P‡os.chmod%  % ¹ 5 fp� ? Qpenedhvs.appenJ D /QMain  ¨6looQ '  s �W ¦.readline(P  whØ`s and +p› != b'ende:tryv Ä ¡data = binž–.a2b_uu(sp  & †& ƒ^ as vR ð# Workaround for broken uuenùrs by /Fredrik LundhW q Pnbyte	ý(((s[0]-32) & 63) * 4 + 5) // 39 Ð "[:S ]Ù  l 0if I^quietÏ  " ”Aerr.k�("Warningfz\n" % vX Ñ0  – 
!  Ü /inå” s� 	 ÄTruncated in{àgfinallî ‡Af in³
\ `f.closi£
def test(U4"""½1/uu¿0e mË±program"""
Šñ import optparse 
 r� €.OptionP" ‘r(usage=' 0: %R Â [-d] [-t] [Ü [_#]]á T a.add_oM ¢('-d', '--Ÿ •', dest=' qhelp='D‹  (Eread of –!)?3 ð fault=False, ac¨ Ï='store_true t 0tex
 }  {   �  ,v !ðmat unix-compatible % ’ f(³s, args) = $ _ Dpif len( V) > 2+ 0r.egð('incorrect number,“arguments	rexit(1)Q# Use 0 ryŸÐeams underlyiñng stdin/stdout
    input = sys. q.buffer 9out 8out ñif len(args) > 0:5 V   1[0] . 1. g / 41]
0 æoptions.decode1 4if  Ftext | Òf isinstance(\ j, str)(  ,  u = open, Q'wb')„  $   7els     `print(:ðargv[0], ': cannot do -t tos;outQ  ?  9 fexit(1m ê (–", Ÿ  
ƒ L    O, 'rÿ 6@from/in  enê ò
if __name__ == '__main__'Óùbtest()
r"""UUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable Ue Qclass á) and the func¼ 
uuid1(), 	 3	 4	 ð 5() for generat‹  ² Áion 1, 3, 4,U  5
Ú �s as specÁ Hd inµ ôIf all you want is aö 1ID, ðshould probably c2  š a1() or¥ á4().
Note that   Ðmay compromisðivacy since it createt  ª À containing
 : ñ	uter's network address. c 74()C arandomUò.

Typical usage:’>>> impor¢  �# make a9 ‘ based on’qhost IDMÁcurrent timeè M  .  í €   # docZq: +SKIP)  Û ÿ('a8098c1a-f86e-11da-bd1a-00112444be1e')“  usâðan MD5 hash of a ÛRspace¹  F u 	ž  3(¤ ó.NAMESPACE_DNS, 'python.orgjª þ6fa459ea-ee8a-3ca4-894e-db77e160355ª }€  ¨ÿ16fd2706-8baf-433b-82eb-8c7fada847da
o SHA-1#5ÿ886313e1-3b8a-5372-9b90-0c9aee199e5d« ÚaW Ñ°of hex digiw@brac
ònd hyphens ignoredÌ Ñ1x =ø.©ö{00010203-0405-0607-0809-0a0b0c0d0e0f}Œ tconvertë?to � À in standardñ form
    >>> str(x) ñ'00010203-0405-0607-0809-0a0b0c0d0e0f'
, ñ
# get the raw 16 bytes of AUUID'  b !x.  ÷+b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\xz pmake a e ° from a 16-e  Î 1ingk  { Puuid.( ( #s=‹ ï  ô ô)
"""

import os
 Qsys

ƒ Senum   ð'Enum


__author__ = 'Ka-Ping Yee <ping@zesty.ca>'

# TKàecognized plat¨ôs - known behaviors
if sys.# ñ	 in ('win32', 'darwin'):À_AIX = _LINU	 ¢False
else  ³ L 4  •_system =� . (B]  I== _4 r= 'AIX'R   Š ) ò
Linux'

_MAC_DELIM = b':' òOMITS_LEADING_ZEROES = Ì 0if ˆ Ï A .  W E õTrue

RESERVED_NCS, RFC_4122,  —MICROSOFT ¡FUTURE = [å �'reservedað NCS compatibilityœ�specified´@RFC f /',?  žMicrosoftE 	g ð	future definition']

intt0int�"  ^�built-in  Qtype
 * 	 (  * Á

class Safe8 äc�safe = 0Æ #un #-1 ¾t= None
H  D ²ª"""Instanc? q 0repð !ntï_s as E.n  W ò objects are immutable, hash
 `and us  O 0dic8‚ary keysI pConvert±iCto a_P with ð() yields someth/ !in ¼“  '12345678-	    q9abc'. À ñconstructor acceptsJ Ðfive possibled0ms:” `imilar�  € ðof hexadecimal digits, L a tupleL `of six
beger fÆ (Ù q32-bit,T 8  1andJ 4   values režptively)^òan argument named 'm '” 4str²&ofI‹ 1allN8int¨ óin big-endian orderm “ q È
p  ©µl  Ì¢first thre'«  ­olittles à o 3_ler “ ’single 12.Ð ?as ! Rint'.g `s haveò	se read-only attributes:,  ì|  	    1 5ð as a 16-byte stÐring (contain Ÿthe six
   õinteger fields in big-endian byte order)
>   @s_leM  Z ÐUUID as a 16- 2 stƒ âwith time_low,
 Emid,K  C  2and"  hi_versionŽ olittle‘ 
» I °a tuple of œ Ksix â   ¶ ‰ ð	which are also availableä P ÿdividual attributesÓ §wo derived/ :O · $    Ã Ôfirst 32 bitsØ  ¾ 	s B 8mid>    B next 16A { =   A  clock_seq_F iariantA 8� @ 0low9  � @ 1nod“7   @ olast 4A  D7 	  B a60-bit¡Ystamp9 » 5    9 !149 ö sequence numberÿ0hex+   0  Ú jóa 32-character hexadecimal_C iiC  1128~ 3 1urn/   
v 0URN �specified„†RFC 4122@ vàh¶  5(on�ÿconstants RESERVED_NCSy@RFC_g ,, ÖMICROSOFT, or gFUTURE”1	Ð  sð (1 through 5, mea‰ful onlyÐ F   Awhenß Ú 4is ¥ } bis_saf}ð An enum indicat~qwhetherI (ñhas been generate� áa way that is e ðfor multiprocessb Aappln �ons, viaM Tuuid_s _1 R A(3).0 2"""áó__slots__ = ('int', 'å   Ã__weakref__'ðdef __init__(self,²a=None,Fs 3_le » …  w 2int!  Ñ / 3*, ¬ P=Safer¥.unknown):5 Ðr"""Create a $ � from ei«ad o 32Ë }fdigitsÁ+  d@ytesA V'ßs' argument, . ” :in îz
M :_leP ïÀf six
      ö  integers (32-bit time_low, 16 :mid Óhi_version,
  80  clock_seq_$ Œariant,  b 4 …node) asI ðthe 'fields' argumeD âor a single 12< À A as 6 Eint'H ; p.  When> ötring of hex digits is given, curly bracesØ ð*hyphens, and a URN prefix are all optional.  For example,“ %se� `expres4s6 yâ  $ Å same UUID:
.   À('{12345678-	 -
     ;}')7   1 ”urn:uuid:2 p 	> ûbytes='\x12\x34\x56\x78'*4˜ ) 0_le, "78(  0 8    5' +Ó _ g w u ID=(0xÜ ",     @   12  34   , )N Bint=> & .  )È°Exactly onex�'hex', '	 0_le « p', or 'ËU must	"be©@.  T#‚$ ËŒB; if/ ˆ¥ resultingO  b° will have v°ê^ ° set accord;¶to RFC 4122"boverri  h¥  ê .2pis_safeÍ ð an enum exposedçñ an attribute on@Æinstance.  I/ñindicates whether, ö ðhas been generated i €way that|  „ ,Pfor m@@procÅpng appla  io@via B_S _K F E(3).J 7"""ë �f [hex,  _;,¡õ].count(None) != 4:N  óraise TypeError('k ] + H  0'or ‚sŽ †iPpis not ¨ 
¢  m=s .replace('q ó'')  � 	á ? ˜strip('{}7 -3  ¡if len(hex2*32‘  ë 7DValu8Àbadly formed® �adecimal› | 'ngö  E Pint =&_l  $0"if×!_lÌ©  "_là/16®  v\ a²Ocharª b ð  = (bytes_le[4-ò
1::-1] + bytes_le[6-1:4-1 /
  , @8-1:0 C E8:]): "if\ Õ is not None:  _ qif len(V z) != 16!  % ñraise ValueError('0 V öa 16-char string'�  > òassert isinstancen ,› ‚_), repr 
: ñint = int_.from_v ) > ˜order='bit ”if fields  ö ' ÷ ö 0 W ›a 6-tupleð ±(time_low, 
 3mid
 ¹hi_version,…° clock_seq_# wariant, M snode) =Ý 	A !ifßB0 <=t ¿low < 1<<32ÏÙ ð 1 out of range (need a 32-bit vÿ)ì y 2midy Hy 2y /16y  9\€ 3€ +¾… 8}4„ ?n 8„ û} 5} + šñ 4u 6u / 4ò æ E = ( 5Š << 8) |<
,U(¦ 3  964  Ây< 80) |9  Ì2   & oA< 64@ ’  T 4ˆ  Õ ifÎA˜ §È ýÃ/12U 0 /isT/12U3if ’• 1]- O<= 5Üuillegale knumberE²# Set the vûÙ to RFC 4122.„ å ³&= ~(0xc000h# e|= 0x8! 	  n 0• i fH &64É  Œ %|=Û U<< 76j ðobject.__setattr__(self, 'int', int)#
  óobject.__setattr__(self, 'is_safe', 
 !)
6 ãdef __getstate0 !):  U Àd = {'int': K U.int} #if ^ ö != SafeUUID.unknownK  O # U is a- õ instance.  Return just its value, so that{ N õ%t can be un-pickled in older Python versions withoutw .N %d[&9] =Ù .… . r£ dCsC!, QJœ3nt'0 [k%])k 1rwas addà q3.7; itFólso omitted when "�"L ‚ À%',,  _ Ú(Ú -® 2   &if} š= V else‡ª 	“#eq�w, otherJTif is2(  , t$  { §·2 ==K  Äé % ÓNotImplementeÙò # Q. What's theŠñ of being able to sort !s?V €# A. Use4 �m as keysû øa B-Tree or similar mapping.K/ltû ><ú ˆ ?>ˆ !l˜7<‰ ?>‰ "Chash$ôË  ÷ è	T$inÒ6 &‰4repC1 ²'%s(%r)' % n ð__class__.__name__Õr )ˆ ž . ,_h ðaise TypeError('ã Å°s are immut‡'_ ùN Àhex = '%032x´ ð  *  >G'%s-  + (× $   �hex[:8], 	 C8:12 T12:16 C6:20 C20:]Ÿ ‘@propertyQ  TRbytes")Š ¢ B.to_( ð	16, 'big')

    @propertñ
y
    def bytes_le(self):    0 =  .  �return ( ²[4-1::-1] +L P[6-1:  @8-1:  I  h   I Q8:])
 †@propert¦ lfields¤ ‰ ¤ ’time_low,³  8mid ±hi_version,h  |  D  clock_seq_+ cariantA  d Onode³ � ?lowµ p Ÿint >> 96ø E ?midE  .F Ï80) & 0xffffP 
 Ü @ õ	QW /64W  \ 8\ $56\ ± Z Kj /48S  T3 ù  ( .# 'W�0fff) << b |@9 0mid( W32) |�?low-ç G ™ ( ž iž 3œ >8) › k: ˆ 	 Òƒ F  d h  »?hexK ’'%032x' %?intD ?urnD òurn:uuid:' + str( I v,% æeif not‡   & (0x8000Á'48‰ (ÅRESERVED_NCS/elL 4L FC_4122H 2H ” —MICROSOFTR &seò È oFUTURE;;c# The Pð bits are only meaningful for RFC å u UUIDs.š "ifz�0 ==+ ± 3int¡ ˆD>> 7@@)


Îó_get_command_stdout( s, *argsÓòimport io, os, shutil, subprocess6tryŠ ðpath_dirs = os.environ.get('PATH'L @.def) °).split(os. Esep)ø   I ò.extend(['/sbin', '/usr ]1  executable’¬ f.whichÝ  T =m `.join( i ð))
        if ex÷ecutable is None:
  areturn  ð$# LC_ALL=C to ensure English output, stderr=DEVNULL) sprevent" N #on. ð! (Note: we don't have an example where the words) gsearchN ðfor are actually localized, but inA õory some system could do so.)N ùenv = dict(os.environ "['…'] = 'C';  proc = sub
 Ôess.Popen((exr¥,) + args,6 z	 xstdout=N ?IPE8  †8 ‘; venv=envî pif not Ï $± ! =7 Ö.communicate(Y d²io.BytesIO(> " øexcept (OSError,SS^ )˜ T  Ñð%


# For MAC (a.k.a. IEEE 802, or EUI-48) addresses,#ñ second least significant
# bit of& ¥first octe%  esªAther"  x [  equniversœP(0)
#ƒ ¥Ply (1‡ ðministered.  Network caó from hardwåPmanufêørers will
# always be k &adV  �ðguarantee global- tquenessÛ 0MACO >òany particular machine may­oö �interfac	0ich‘"
#Š8ly ‹ F.  AáT`latter- ìubridge U Q to
#ZñTouch Bar on MacBook Pros.
#
# This« @sy ù bBA42nd ‘counting [@1 be  y ú(
#ü0ð1<<41.  We'll prefer?×á wÿ esî?ver¢ ones sinc¢ RformeÍ£ lyf 1queŒA
# w� ì ² �šFpfound i �at's all=¼#ha/ðSee https://en.wikipedia.org/ S/MAC_Ë $#UÇQ_vs._À¥

def _is_yC(mac—§  D  ã & (1 << 41))
; ðfind_mac_near_keyè(7Band,-  ps, get_" c_indexh A"""SSes a < 'ÿAput  • l $ aW !.
Ž`Each lÜ#ofn: G H òis case-insensitively � edg H  1ÖTgiveng üs.  Upon a matchÍ  ýqinvokedH ‘to pick a� ¬ ò £ ", [   
ÁZ  . þE HÐ, lambda i: 0ñ would get the first word on ûline, while
    lambda i: i - 1@ : ‘precedingA 0key .> 1""" òstdout = _get_command_ ( q, args)0 2if  ‘ is None:  ‘ areturn 
 Ä Â_local_mac =  , @for Ñ 3 inP H  ¥ 1s =  ò	.lower().rstrip().split(� J iG ¡range(len(A &))R  ( !ifN@s[i]. s%  ) >try    W # =F  .  ¡_index(i)]ó  (  ÷ 1int• ö.replace(_MAC_DELIM, b''), 16Ó A ðexcept (ValueError, Io  à 5 ÿ # Virtual interfaces, such as those provided by¶ ÿ"# VPNs, do not have a colon-delimited MAC addressF ðas expected, but a 16-byte HWAddr separaN ‹ ñdashes. These sh' be ignoredÍ¯favor of a‰ Oreal° /paÉ  7elsãe  ÿif _is_universal(mac” / ?mac¤ , 4or = L "   ’Ð


def _parsey|› A# AcVJ'HH: '"ñ (ex: '52:54:00:9d:0e:67'),À #Ð´reject IPv69 òfe80::5054:ff:fe9' or '123:2:3:4:5:6:7:8')�#V ½§H ­ —N ?by ‡ q@partÙ 8È	ÿ0if Â* f) != 6Œö’  | CöOMITS_LEADING_ZEROES1 €# (Only)B1AIX0mac´  vT` givenÊ çaprefixr 0, e.g› ¾Ð# en0   1500 š0k#2 ñ  fa.bc.de.f7.62.4 110854824  ³0 160133733   0Æ  
 #b g 0h  ifi • all(1 <=f)  2 � u N  s/ £   |  €hexstr =½`.join(5 €.rjust(2Ô?0')U  é SÀ    if not aðll(len(part) == 2 for  1 in Ws):
  ereturn òhexstr = b''.joiL !s)! 6try= 9 R int(5 B, 16( üexcept ValueError6 ó


def _find_mac_under_heading(command, args,  ¹ �"""LooksÚ áa MAC address F $ a1  ó #a M ±'s output.
Ì ðThe first line of words4 3the, Á is searchedp   Bgive1™ 1. W; 0at   AsameM ‘ index as -  a ¡subsequent‹  � Ps are( ðn examined to see if ¸y look likeô 1es.D 1""" ãstdout = _get_ü _ 
X«2if   ë LNone«  32key$=4 P.read¾ ò().rstrip().split(^ 	1rcolumn_$= N . (8 A– Å`_localK" =  ã ü Ÿ tÞ Ê    ½  B 	Á    7 ! =ß(s[Ò ] # ½ Iýþ  ‚continueT  0mac±PparseÃ (e 	  0if " !isÙ Â   M     óif _is_universal(mac9    ¹5mac³ "ifGo l F G V " Q


# kðollowing functions call external programs÷p'get' aø  Ü  vJÐ to
# be usedVCbasibn uuidU€ifconfigSnode( R"""Ge£Phardwq ^  :ð on Unix by runn¨ G .[ É  isûðks on Linux ('' or '-a'), Tru64 ('-av €but not é  ` ®ü€ = (b'hw‡ ¡', b'ether
   Aess:  ll ' Ö  ÖA('',|  #v'ë  ç 4=cSnear_y $('Þ 'e òs, lambda i: i+1s  P ‡
õ  #    6å/ipŠ-p„Òwith iproute2þ p7 link', [b'
 /|]ý æ ù  õ /arö -&ar÷ òimport os, socke8�À      ip_addú
r = socket.gethostbyname(  ñ))
    except OSError:   Áreturn None
 ñ$# Try getting the MAC addr from arp based on our IP áess (Solaris).K ð,mac = _find_mac_near_keyword('arp', '-an', [os.fsencode(ip_p ò)], lambda i: -1É mif macÁ 5macÀ �his works£ OpenBSD‘ ?/i+’ $ÿLinux, FreeBSD and Net¤ -–'(%s)' % >ô  å R2i+2S6# RÒ instead of 0Ès Z 	Cðdef _lanscan_getnÑ)¯a"""GetT…hardware;ð on Unix by runn|F A."""Ê 0# TÚQmightà ßRHP-UX§ ˆ pO tityb'lan0'gA0)

Ä netstatÄ ,F Ä ž1AIX
Õ ŸTru64 UNIÚ ó under_heading('f Û iP¤b'Address'Ð �ipconfigÑ  ß[DEPRECATED] ¢	wWindowsÎ ñbpo-40501: UuidCreateSequential() is nowõñonly supported approachÝ½fwindll¥ ŽFbios R½ ‹P
# Imð ð" optional C extension at toplevel, to help disabl°it when tesŽB
tryø iT Q_uuid?ð_generate_time_safe =ÆQattr(( >, "% !",û_Ã=   
5 1has` ƒ  .$ 
š'ž: ! =  ä º ‡
¾  | ^ eðload_system_func±&s(½	kõPlatform-specific 3  I  á#t © • Çi OunixË {	ÐUnix using thñ)e _uuid extension module."""
    if _generate_time_safe:     >  _, _ =, %()- õreturn UUID(bytes=? ð).node

def _windll_get "()o ñ"""Get the hardware address on Windows using& Û œUuidCreatÓ Ÿ  Ñ " É 	2_leÌ 8 	Í orandomÍ "a   é 5 IDxô"# RFC 4122, $4.1.6 says "For systems with no IEEE$, T Qly or|’# pseudo-m 4ly Óðd value may be used; see Sect“4.5.  TheI ðmulticast bit mu	 Ôe set in suchˆ 0es, ‘order tha¹cy willK ânever conflictÍ Ðòes obtained from network cards.›#H YThe "˜ ¤" of a MACŽ q is defQ  toë "HSleastG ¢significanÜ !ofEÁfirst octet"
0is ‹ bs out L  K  41iN Pcount‰¿ @1 be  ) t  n ², or 1<<40.�  ð See https://en.wikipedia.org/ S/MAC_61#Un›U_vs._J cimportm Œ@.get
 ð#bits(48) | (1 << 40)


# _OS_GETTERS, when known, …`target«�or a specI0 OSÖ °platform.
#H ðis by 'common practice'É %D 8ed ? ðNote: 'posix' and '+Hows'¢ • €prefixedg óa dll/dlload() method
# whichÐ ðsuccessful, means noneIpthese "#Srnal"@ sg `calledÜ   ka(also)O € Atest�0.py3ðSkipUnless(), e.g.,
#N` @unit/ &.s$ ; 0_if,$igK _ ›P...)
´RLINUX8¼t = [_ipB -, U `]
elifb.zÏ == 'darwin'R š X, _arf tnetstatx e Swin32d Ì# bpo-40201:F@ alw¹`ed, so±!se˜¡not neededî� ?_AI$±  s#K B Uü 
Œ é _l ¦, _lanscan/¡if os.name�ŒüÛEunix6 ( +Øðos.name == 'nt':ô
    _GETTERS = [_windll_getnode] + _OS" l
else:5 !  
_7 Ó = None

def K "()9 ñ+"""Get the hardware address as a 48-bit positive integer.
x ñ8The first time this runs, it may launch a separate program, which couldL ÿbe quite slow.  If all attempts to obtain® �fail, weL ô choose a randomÆ ðnumber with its eighth á s0o 1ö ±recommendedN Áin RFC 4122. 1""" qglobal f "if q is notxi Ûbreturn" @0for’fter inûB+ [_º ûF 6try  W  # =I !()Š   jexcept- rcontinu' % Bif (B ´ ²) and (0 <=¯ Ã < (1 << 48); =   	Ö   û assert False, 'Ê 2() 2 òed invalid value: {}'.format’  )


_last_^YstampÌ`uuid1(ã=á±, clock_seq ¨ ã!ne}òa UUID from a host ID, sequence !,þ  bcurrenÞû@If 'r 'ã`given,}   () Oused°�bå'¶ T P %itI !asò¥ ;J xotherwiì!14²/  N pchosen.¾= R# WheO`system�@videù’version-13!geCpor, useß£(but don'tM   pUuidCreé�here beca  n {s2 @ conê %[)a Cm eøP_safe¿ Qž m  =   ï B  , C 4ly_X Ed =  # e ;e!is# p = SafeË (U y  V×VError•  !L �.unknownJ # #{w(bytes=Î @ = )L�
1R RimporÆ Ñnanoseconds =».b3_nsð# 0x01b21dd213814000a $¡ of 100-ns²rvals betweRh #Á ñ epoch 1582-10-15 00: Ê T DUnix' •970-01-01'  ¢ Á  //‰ / +³  …  Q
 Ê 	M[  ð
- »& ,= —1+ 1m  ^·   &if¥ ‡ ÐNone:
       ó import random
  ³clock_seq = @.get% ñbits(14) # instead of stable storageG °time_low =  ³stamp & 0xf & vmid = (' e>> 32). * ­hi_version1 "481 A0fff1 Ä †  X %  [ `ariant[ - 3>> Z 3X ñif node is None:H  8 P= get
 !() ñreturn UUID(fields=é  • ,C_mid
  „ ß ,=  V  š _. ² &,  Alow,¡ 3), ,ð=1)

def uuid3(namespace,  )Â Ñ"""Generate a° ð from the MD5 hashëa5 @ & Band  A."""¸ 9  1 4libb1md5 PdigesdAmd5(  â  ‰ T ‘.bytes +  ¬ ¦, "utf-8")òusedforsecurity=Falsx").b € S = V[:16]"3"/4( þ!omô é Þ^ Bos.u* 7(16ƒ4a 5× ï ƒ_SHA-1….Asha1t �0 =  � |
X S Vð5)

# The following+QndardI@s ar £r use with¤A) or ñ5().

NAMESPACE_DNS =< ÷('6ba7b810-9dad-11d1-80b4-00c04fd430c8')= <URL= 1= <OID= 2= LX500> 4> à"""Python part| Œñwarnings subsystemŽ
Éðsys


__all__ = ["1 1",  �_explicit @show Fing"Z¥   "format ƒ "filter s= Rimple > Drese= , ecatch_> ]� ð	(message, category, file‚, lineno =s  ª±Hook to wriÂo   aM ñ; replace if you like< �rmsg = W]M� — ’ ò_Ù @msg_&C(msgþ	Y_  þ ë PFunct2to R 5 a ð hˆad>wayâ ÀningMessage(ómessage, category, filename, lineno, Non ý!)
    return _formatwarnmsg_impl(msg)

def _show :A  c p = msg.  !ifz 1 isp )  n  " Ñ = sys.stderr/   3   #2 U ö when run with pythonw.exeo <  ¹ Õings get lostu     ktext = * 6try[  Ê p.write(7 Mæexcept OSError- R# the¢(probably )Ð ó invalid - this ±  ° s± .Ÿ  „ Cpass”²v š 0.__!__Q „s =  f"{¼  !}: /D}: {;    ) fQ}\n"
F !ifý 2  Ì  a„  ° 	4  aimport�QcacheC     D = @.get  „^ ¢ ,o "now ; {E‚6ionƒ   0# W.a[iYÑgged during P@’ shutdown1¢ Q# andÎÉ ÿmachinery don't work anymorÜ  ô h ! =- 7elsÇ É  " !if'ç    <v.strip(ñ s += "  %s\n" %: 	½`source¿1not‡ Y Ã±tracemalloc’ h@LoggPkpshould Y Âraise a new ±	ª#º5ch Å,6 aonly I8Xƒ‘Recursion !W C È   ¦÷suggest to enable Î � if it's} Pavail" ä  H  .  æ Z= Truè(tbÉ - 
Í  ?  
 E@.is_ 7ing»/ y    h  0 ? ¡get_objectG Qeback9Ý > ' " 3 Ž 	.O 9% > í ;Y _if tb² 2 ó!'O ¥õated at (most recent call last):\n']  B ú for frame in tbI ! c Ò('  File "%s"6!noi
N  1  1% (W Ñ  ÂBno))š-  ƒ ð   if linecache ïis not None:
  pline =  �cache.get ò(frame.filename,    ?no)O ?elsi  Ž > �except E ?ion¯  | ! =Ð B !ifÃ 9 
 @ .strip(Á `s += ')q%s\n' %T l AelifRztracingm = ð(f'{category}: Enable 0 õemalloc to get the object 'a  z  !f'. Ration? rback\n'¹ ðreturn s

# Keep a referenceb �check ifg AfuncH ÷was replaced
_showwarning_orig =  e

def % ‚msg(msg)ó p"""Hookj ƒwrite a J    a 5;k  ‡ Áyou like."""î 2tryK  ï +sw|   –NameError/ ApassE 
pcif sw ô¹ Þ ?  ] #° 's.ô 9() # *  ú@callÓ3(sw!   ’raise Typ³ #("f �must be s	Bo a  C  "ÆÁor method")
3  sw£ä.message, msg.Œ  ˜Í   9no,D !  7  ) 3  % tg |6 f€msg_impl� )•)cformat7—	 ™ ›Fð2to '  ÿ he standard way’f’< Œ ð ”!f”	Q Ý –	+ ˜	Ž/ fü	¼ ¿   éùc _” ï *cfilter-1s(ar#, �T="", Œ"=Wv�, module  o Mno=0� ° Ãappend=Falsewñ"""Insert an entry intoñulist ofä �rters (ayrfront).?'¬ €' -- one9  "er ", "ignore
 `always
 pdefault Á "µ ‚or "onceÙ'd  «cgex thŽ 5, Qmatch¹'8> _class>  TÀ a subclass òof
    'module' -- a regex that the  ò name must match8 blineno8  n integer  ¢ number, 00 ò es all warnings? aappend? ’if true,  1 to} âlist of filter7 1"""? Àassert actio} ð ("error", "ignore
 `always
 pdefault Ô !",H  
 p"once")H cnvalide ’: %r" % (t !,)@ ˆ ðisinstance(message, strF  ?@be a 9ingÈ @ àcategory, typeB  C [classB 1sub (0 2, WrE   9 P Ò !Ñ  � ?strÐ  0no,!Q) and"¡no >= 0, \F‚", [  Út* !"
) 4if P#orž:  C œimport re- # > ·= re.compil³Bre.IØOelse6 ANonep  Š 	&   [  T  1 = S T R_add_îfï &, ÖÁ,I6==Û)

def simpleL C =úC %=0E bFalse)Ô R"""IngP ` entryË
¢Ú«# (@rfront).�AF — 	Ô s!¤!s.'p)0oneë/2or èc e !a GÞ —2 D¹? µóü/ Ý ; v 
F T*itemúôð# Remove possible dupli!Ý�, so new Žáwill be placedNÂ# in correct C. IfÜQ=TrueæX òexists, do nothingú if 9 “ 	6try   O1s.rº (Ö q  ðexcept ValueError:
         Ppass
	   ñfilters.insert(0, item)  Qelse:
  * !if ƒ not in 9    $  †.append(K _ ò_mutated()

def resetwarnings()N ó"""Clear the list of % x Ä, so that no ñ  are active."""º x �[:] = [] � ñclass _OptionError(Exce —  ¡ used by o" ð processing helpR‚ oA
# H 4 to- 3 -W?  s % °ed via sys.í Z s'_`  S(args– pfor arg“  B Œ6try   B_setA  @ ã  eè 	ü z as msg@ æprint("Invalid¾ ° ignored:",5 ,� e=Ç †stderr)
þ  ® Í )ã 
ž { pparts =á ¢.split(':'º qif len(" R) > 52  Ñ YraiseÐ ð("too many fields (max 5): %r" % ",)Z Xwhile] <] q á'�  uðon, message, category, module, lineno…‚s.strip(n  ±   ?së† Î| r = _get ( a ‹ "  (	 & $if½ 3 orµ R‘import re@, " ú Ó = re.escape( a 4  
3  ”) + r'\Z'o =: Ü! 0 = £ w [ /‚6< 0I  3QValueýy   ( ¡, Overflow* ‡ ,   I 	H#"i2˜ r Â,)) from Non^
v& A = 0“ Ï 1èx„n=%!ifñi  ç âeturn "defaultl!if~ãon == "all": r) âalways" # Alia€ ÎaÎ#('H B', '*  
 X 
 E 
 @once e£'} } 0.st1Dwith³ · aL«	ð ¬  !ËGYb… K  – Wœ aif '.'{%inN3 ‘�builtins°9  P kÌ=7 Àry
    else:#
  õmodule, _, klass = category.rpartition('.')4 Etry:  H ô m = __import__(T bNone,  [^ ]E �except I5 ZErrorT �raise _Op€   ¢("invalid a Ô name: %r" % u q)) fromv ¤ 	­ ó cat = getattr(mô • ‘ ‘Attributet ” � õ unknown warning:• K,— Ðif not issubcyr(cat, WJ )x x `return  ñ


def _is_internal_frame( y ñ"""Signal whether the " t is an = ð CPython implementa±± detail."""� @file¯" =F ´.f_code.co_ ( © 'L„lib' in # ù and '_bootstrap Ú next_exÜ 	AFindÒ  , ‘ ö that doesn't involveÝ +sÑ  4Î AbackÂ Gwhil+ å » v Kd&X   ó


# Code typically replaced by _sì  �(message,Þ=– ñ, stacklevel=1, source 
tIssue aæð, or maybe ignore it !2an I5ion-³# Check if ˆ F„lready aöq objectGÖif isinstance¾  c$ =\ 1.__R!__J } ) @argu© %if ”  |3 c= User} 8  Û(¥ . ,–!e)ò
àyåc ÷=2Typw$("M p must b€  2", \ @  "� ð'{:s}'".format(typef† @).__‘2__)ÿÀ# Get contex5 1ionï 	F'if7P <= 1 Ý �sys._getµ7(1)ñ  ± C# If~ðis too small to careU !if¨ Ã aÂoriginated i™  H   #’ Y,7 An dof0tryU ‚hide anyt !s.Ú  =   ¤ : = ´ & * Felse$  < 13  % Ô# Look for on" less since± ° above lineb«rts us off« @or xfrange(¤ +-1b x � Ð_next_externa�l_frame( ;)
  1if  � is None:"  1 ñraise ValueError% gexcept < ñglobals = sys.__dict__6  O õfilename = "sys" ¡lineno = 1 7els‘ U ² 3.f_ , X # „code.co_s , k *    `if '__¢ s__' in i á PmodulÀ  [0 ]C 
» m/ ’"<string>ô ¤registry =c ô.setdefault("__warning( r__", {}Ç  ô_explicit(message, category, ô ", Ü ", ˆ $, P ,¬  ; Ò ÿ , source)

def m [   =h„   Ó C  •  )�Ü r = int(  #ifð Üm % =#Ó or "<unknown� D ò[-3:].lower() == ".py"‚  )   V 	 ð[:-3] # XXX What about leading pathc?æ %if•¯ ¯\ = {}/ ð.get('version', 0) != ñSters_ ª M r.clear(, ¿  [M .] I  ¦isinstance{W®™ T @text$tr& p ©3 = ½ƒ.__class+
DK + ‡  b  % =ù
j  ke^(> )ñ# Quick test for common caseh �n7keyä areturn) À# Search the\ ‚  V @itemM0fil ’±action, msg£ ¨@, lnÕ1temB  ì „if ((msg" ¶‘msg.matchã e)) and1 5 AssubW(rf * I(mod[ #od[ Ñ]  (¥ 0= 0Š S 7ln)  … Qbreak— 
Õû 3 = ô ) Ò# Early exit  s #if  k w"ignoreŠ�+ q# Prime� Ÿ 0cac™ orç€matting,” ë & 6 ";"€actually% Pa zip  î ¡something.4 aimportie  s  6   s(?  öä4uleñ!)
2 
Ü elÛ ‡ò0 s# Other À action == "ƒonce":
  õregistry[key] = 1  ) õkey = (text, category)# 0if & D P.get( Fkey)c  j ereturn9  % 6 [ 	~ ÷elif action == "alwaysµ ApassL * _modulß ?altÞ 9, 0á § Ý 5 Ü 1 [- U­ wdefaultØ ; &seNã# Unrecognized'²s are errortÐaise RuntimeE (5   "K  û (%r) in warnings.filters:\n %s" %E (ªr, item)<ð# Print message and conH> rmsg = Wb M% (- iò, filename, lineno, sourcef P_show§ ümsg(msg)


classZ ‘object):
} ð_WARNING_DETAILSâ"} D", "è  �   ƒ  
   !",M I
 "*  ( ­ "")x ôdef __init__(self, ó  n _=Noner   j   ¡ h .Ý $ =q »  ñ % =ä
!  ‚  ‡% =’
!  ‡ Cno =§
  > : 
  6 4 
 8# =Ô 
 _¯ _“  !._ U__ ifÉ ` else >…3str„+¤D ("{0F: %rœ   Ï z   Å  no Es, "«  " ar}" % ü”!, ƒ
Õ é P  9 Ž H Ž  )`catch_0Zings(D"""A£ñ manager that copiesÃÅrestores the  rter upoáqexiting% õ.}PThe '½ðrd' argument specifd vwhether[ ñshould be captured by afÀcustom impleH a0%of> .Qing()Á ñbe appended to a listN ý`  Þ ¹ 0. Oš wR MO is 3 O B . ó js{  d  } ¹òs whose attributeÍ mi½P* 9to à ccÀ is to speciôfy an alternative module to th ñ
    named 'warnings' and imported under that) ñ. This argument is only usefulP Áwhen testingl Z ƒ �itself.
. 2"""	 Ðdef __init__(! ó, *, record=False,A q=None):?  Á ð"""Specify wheth° o:  } Ö fK �should beÑ 2d oM ‘han sys.mC&s[,]Æ  ‡ ð For compatibility with Python 3.0, please consiW5allKs›%be‹ €keyword-_f  0 n    &"._## =ò A  ´ / =Á 3 ifW Ì ZI els!k ¡entered = ‘¹Crepr¹›•args = []– 2if ™ · Æ f  / ’.append("! ~=True")@ Ù ois notÞ _ @ c=%r" %“  l  q = type’@).__ %__� àreturn "%s(%s)K (" À, ", ".join(Õ ()),G-  *ed½ ðraise RuntimeError("Caný 0 � %r twice…  cÈ   !._& ½ SÂ   fi+ ¬ . - 
  \ Ð_- &[:î	M ! œ_mutated(¢ Cshow°U l  �  Œmsg_impl: _! @ pj
o:log¹  
Ï Y c = logÀf  8 „# Reset 2 Ping()ð ‹pdefaults leUPation †make surM ŽØ ˜() calls  d < 	Á Ž 5‰ing_origÏ õ&lo  4
A%  R	üxá‡exc_info3"ifÑS´Z 
0xit	 zAout @  ˆ_firstdÀ û 	=ÍU e ] " Õ ð	


# Private utility funô*ction called by _PyErr_WarnUnawaitedCoroutine
def _warn_u $_c (
 ñ):
    msg_lines = [    f"# K 0 '{ ó.__qualname__}' was never | 1\n"? ] 1if 6 òcr_origin is not Nonez  h pimport � ñcache, tracebackG  $  Ë  ex #t(µ     €for file– ,F €no, func P in r£ 1sedó .Ž H  L  „ ! =E ‹ @.get (a )š  7   myield ) Š œ 9 u•.append("ºñ	 created at (most recentúŸ last)\n"K  6 +==Ñ.format_list( B)< åmsg = "".join(‘ ¥).rstrip("f ñ # Passing source= here means that if the user hÒ ’s to have“ amalloc8`# enabÄ1and k[ wT  F  7y c,a  Ð- 3illM rcontainˆ  $<±. This does¨  § y˜ e*both*F 8 ­ J ˜ Q*and*§ eÅ ¿ ’ Ãy'll get twoK òpartially-redundant?  ÔÀs. If we wanä€to be cl¥  TcouldI ðrobably detect tÒ Pcase 9àavoid it, but 0nowC `don't Ý 1er.K  6 áð, category=Runtime< ing, stack† Dl=2,ç ‰P)


#cSters mó s a sequence of ð 5-tuples
# The components$  Ú! á are:
# - an a×ò": error, ignore, always, default, module, or once? d iLRregexæ©must match4emessag9 àlass representU ¢  +  )g   ‚ Pis beG  O #edE  Lq number° p  , Œ@or 0> `A any’ 
#9deithero aý sW^,þ Òanything.
trysBfromSings ~ ¹ à3, _p–0, _l‘registry,N ð   ë  ,  p_explic›@_filY @_mutÔz	d + =u e w  "  ! Û Ä ²  ¿ÑTrue
except IYEVû ‹  æ¢‡ " Ær b = {}
x Ò @vers�2= 1  ¦ð ¯uglobal # A V  P  ÏÐ1

    _warnið*ngs_defaults = False


# Module initialization
_processop £s(sys.warn  )
if not _ i] ó:
    # Several ! ó categories are ignored by — ñ in regular buildsJ i phasattr‰ ò, 'gettotalrefcount')w  { cfilterw 3s("_ $",ƒ �y=Deprecê �Warning,l  ?  mõ="__main__", append=1)4 bsimpley "("Û p F  Pending½  M  dImportþ A  �ResourceC  O
del ð
"""Stuff to parse WAVE files.

Usage.

Reaè  Ýàf = wave.open(8 Á, 'r')
whereI ò	 is either the name of a `or an >  Îpointer.
The ð must have methods read(), seek ñand close().
Whenv �setpos()  …rewind()D  ÿ <Sused,0  N 
e  Â   0 ne‚�ary.

Thi} PturnsÃ sinstancÜ ¡class withO ôfollowing publicz G°getnchannel¥ b -- re[ anumber2Tudio ' u (1 forò&�  mono, 2% t stereoø getsampwidth() n   1le   ÿBbyteöï  getframerate7  ß “frequency˜  Ù 5 × 	k Ù ' 8 qcomptypk £   €ression   � ('NONE'é rlinear Ç sñ  6  { ¹ N `human-E�able verY #of‰ W   K �   Oed' ‡ Sparam‡ aàdtuple consistP ) llþ?the“ @abov2m Dorde“getmarkerz _‘None (for× •atibility»t Bifc �h h A(id)8 h 0aisa n error si$ 	 * P does·g _exist¢ 	. a‰  ÐP (n‹  ‰ P¢at most n !  \aZƒ Â ² 0 $ ¸ Pbegin¢ :   > s streamE o0pos~ E   Ð to the speciñ fied position
  atell()  ü-- return the current5 Wclose6 1--  4 õinstance (make it unusable)
TheL h ced by ‡ 1andD ¥ ð given to setpos()
are compatible 2 Àhave nothing, qdo withJ factualu iÙ a
file.� ¹ ð() method is called automati @y whˆ  Tlass å ð
is destroyed.

Writ† PWAVE e #s:iàf = wave.open( Á, 'w')
where,  } aeither» ’name of a `or an >  rpointerÆ  a must Ú £s write(),m`, seek Cand
s.

Thisœsr ë ‹ cÿ _`followò cpublicGö ðsetnchannels(n) --Êß PumberV ! *Ësetsampwidth4   1le  . ›framerate.    , n Œ  Ž ! 2  mPtype(  , –) 2 Þ  6 €ression 9 ©?the: Ð   human-read,äA 9  �arams(tupS  Š Pall p/ Äeters at onc„ t6 û÷¡ in output{‹ P.�raw(data. r audio 5 ¥�out patc¼ up_ ˜ 	  6s header% V O �   =}  z Þ 
a „ "--¯ 2  ã0 Æ J¥You should°`beforeN b firstÃï wraw or
0.  `utotal n^/ P does%P need& bes R,
butÞ it�0set þÑorrect value,‡ }M aRto
be�ed up.
IK 1besL ¼  Y 
��, perhapsŸPsiblyd 
;,Yt�î 
E us~ ê `raw.
W.  n  	AbeenCSten, j ß e+ P(b'')ZÊ ()	$@size ¬ ,„1 p L \ J$ð	"""

from chunk import C  PollecËs  œd
0 Ðaudioop
imporõ	t builtins
import struct ðys


__all__ = ["open", "Error	 •Wave_read ñ write"]

class * ó@(Exception):
    pass

WAVE_FORMAT_PCM = 0x0001

_array_fmts = None, 'b', 'h',  `i'

_w� Pparam* Ènamedtuple(' !',w  { 	 ñ'nchannels sampwidth framerate n ¡s comptype	  d $')à Ù ñ"""Variables used in this !:
ˆ uThese v) �are avail8 p to the> ñr though appropriateA ©methods of]  Ü �_file --D  °  Twith 7  ±�(), close	 ¡and seek()_  H  qset thr…  • £__init__()M 0 _Gy `number  daudio g/ [   õ e 5getQ i ’g  e / c 	e ¢bytes per Ö  + l’ Î  Ô  . bq † pq  ) ïling frequencyÒ K c Áb aAIFF-CÏ�ression à°('NONE' if # Û ` w   /�`human-~é c †  í u „soundposu @posi{Še»_treamk EtellÙ +, C esetpos/ ðÒternally onlyD ÷a_chunkZ È @1 ifëae FMT    has been P† `_data_Èv_needed; Àed correctlyÈ= ½  01forY Rsa  Á-- instantia_Cof a› ì C  4BDATA i _S !iz¦s bof oney –  6  † 0 2"""F@def ~�fp(self,ÙQ ¸   “._convert7B  ;= 0  p @ = Cx( °, bigendianš2if k  & .­òame() != b'RIFF'È w   Sraise	'4 € does nopAart œ 9 O id'h  æ#(4f  :f 	 \  a & %U Àself._fmt_chãunk_read = 0
  õself._data_chunk = None  …while 1:  8 5  seek_needeX 1' :try8  < f Cn (J ð file, bigendian¡ )J þ except EOFErrorV Ybreak3 h qname =  @.get ([ "if   ¾ == b'fmt 'c «  AB_fmt.(Z 
Q  å , ' w
.el|  ‰|  if not W ©  � araise - ('U å € before ã » '¼  4 ä @	^ d Ž tnframes& .W tsize //± " &izV ?   C l 
I¡ '   âW.skipÓ*7 orFu ­ 
B	:(€ and/or 6 K¡missing')
Ádef __init__×F, f)[ ê Ði_opened_the_öo÷if isinstance(f, strF  	Ðf = builtins.O  ' ;'rbËq f°  K ð	# else, assume it is an V  Ÿ �object aløy9 Ún  ý Ffp(fT¸ u #if
(  , wf.closeà  £v3delu,“ ? º £^enter/ areturn› [ 'exÑ_*argsc 
#i ò# User visible methods.   ‹ Qgetfp+S ‡ ."� lrewind1 ç Á
Cm# psoundpoª0U ! " …   ~  =&-._ÁÛ  ¢!if?
ÑV 5 c  @  g ûV  1Ltellÿ 	0ã ß  ô�channels; 
n& 
< Ý: $ 	8 Ÿsampwidth: 
& 	< O Orate< 
& 	< vcomptyp; À       returðn self._comptype

    def get Pname($ !):   Xretur:  % 	: oparams8 g_wave_# ò.getnchannels(),” õ getsampwidth(),~  ‚   œ  A ˜framerateA n  T ?  ì  >    Û 9())Þ omarkerß :NonG / H, idGð aise Error('no ( 's'k Rsetpog W, pos<  if q < 0 or >6_ó ® ,rk õposition not in range')"R°_soundpos =_  ödata_seek_needed = 1#Cready L #, ” 
À   ,._J 
¸ $ `chunk.t V(0, 0¯  à ¨ . ¹ *‹ 5izeÅ  3 B
o   E — s =posu *  — 0i $ifü Z == 0n G5b''0  w # =¸   _„  R(F Ø #if< :ð != 1 and sys.byteorder� Z'big'“  s ¡ = audioop/ Pswap( —_[ w  qconvertp  4 ^ 8+ [ J  Ã R+ len4 A // W4._n=¥  o — «#wò# Internal methods. %  _B_fmtŽu !, š)â 6try  J¤wFormatTag;¨  › µð, dwAvgBytesPerSec, wBlockAlignótruct.unpack_from('<HHLLH'Œ .§ F(14)O‚except s< ek
¤ !OF‡ W  Á Á   6if È  6ú WAVE_FORMAT_PCMO  C ŒÆ 
Â a2))[0]… ?   È  % Ì  % aYF = (  @+ 7)W8}  Å,otY
ù  [ €  e`('bad Y 1le Â`Jelse> 	: ‘unknown f>–: %r' % (†,á	œ _^ ð bad # of channecls')
  òself._framesize =  ³nchannels * ›sampwidth< pcomptyp; o'NONE'   1nam  @not 0 ñressed'

class Wave_write:= ñ"""Variables used in this 0 !:
& uThese v) 0are- `r sett< ñ through appropriate methodsB )ofV  ñ_file -- the open  Dwith;  ª �(), close	 @tell Vseek(] Q  � Š  V £__init__()R Œ _H} eAIFF-C/Aion  (f  # n 4setZ A() ooparams€  ¨€ ¡human-readL l �  ¼ è   9setì ~ p ônumber of audio �q K ð Ðîr “bytes per|  + /lez  ( #z nr�ì  8 ïling frequencyl E l n( sä V  Òaten toøoheader„ ] ‚ B § ÔÒternally onlyû´_datalength´ ˜«e�s‰· _› Ù iãù Aactu‚ ) ² „  … C 2"""¥Edef ñ [B, f)ë 0  i_jbed_the�V= Nonr÷if isinstance(f, strF  J Ðf = builtins.O  ' 7'wbì '  ƒ /._q fü  $ #tr�    5  µFfp(fqfexceptÍ  + #if/c 
(  , #f.Az   Vraise=w  ƒ ,Œø   .1 ¨I  ‹convert N 'K = 09  ‘É  :¾8 v6   V;  ø ; ¯= 8FalBð__del__(self):
   àself.close()

 àdef __enter__(  !):   preturn  	. 3xit- w, *args4  - 
c #P ò# User visible methods.   ‹ ÁsetnchannelsŽ %,  e !if• Ö._datawritten· » ðaise Error('cannot Y ðge parameters after starting to M 1e')‘  H &if� O < 1f �bad # ofh  Á G _Ë & =V Zgý 
ò  Ã H Ž hnumber�  A t— á.ž ’ Ãsetsampwidth� 
� ™ �Q�  �F or  ?> 4   , 1le Ñ ¾    & =U g
^Elf._H �  $ ‰ ™ , ˜ Œ @setfÆCrate™ 
— Û ™Q� _ <= 0ü  ‰-  ¿ ‡   Õ = int(round( )ºg
ü “> — $ “ ‘*  ¢ 	‘n · 
‘ �Tg �  lŒ ®  j =¥ 
$  6ten? ¤setcomptyp}  , 
 GnameT ®Z €  ™ Ä·in ('NONE',�  Ør ±unsupportedÀ €ression H Ÿa =,  $ .y "   "   <g<˜ 	| E \ ]  :  O ¶
 : ðname

    def seâtparams(self,  C):
  ñnchannels, sampwidth, framerate, n ²s, comptype
 cname =P N 0if h Ö._datawrittenl  s ðraise Error('cannot ƒ "geL ð	eters after starting to M 5e')j g @setn=  À (
 % Ú (
 % è  ô (
 % ( ! &(	 /!)
¾ hdef ge—�0if Þ _Ò 7 or Ä 
 ¶ q \ 8allk7setWÒreturn _wave_-:.� ,ã‡  � ,è  î Î    hVelf._     U&qsetmark� ±, id, pos, & å 	R3 )0—upported'V gV ~	K 0no ~ s<  "erP; 9FNoneçAtell¾ ) õ G Ý6ten9   e01rawC  , TI +°isinstance(!  , (bytes,  garray)5  ‘ ' Ñ = memoryview9 —).cast('B¥ àensure_header_› rten(len8 Î 5 =  A // ¿ %._0# *BàC Avconvertçº — " … rA o Ð!= 1 and sys.ïorder == 'big'c qaudioop/ Pswap(5é[ ¸ “ Pfile.!Œ  D   Wten +%½ F G* =. +š6t3`  A \ • © ?  „length !‚    > ÕX b_patch&(pQclose� ˆ:tryxy  D
  úb Š0¿  +   N  ³ Ç  :   m 
Ï    $  ­ v.flush(… kfinallà 0 1 = &N  H  gÐi_opened_the_   3 0if  #= Àned_the_file› = None
  Ñfile.close()
 # ò Internal methods. % ñdef _ensure_header_written(self, datasize):7  v pif not   .5 4 $ ( šnchannels$  ( ô raise Error('# ) e ¥pecified')€  4 	„ Ÿsampwidth\  ( 1le + ^ Ÿframerate^ @ing , _ 
: 4u(g—	!  4 Ç, initlength�bassertr ;elf”7 B !._(Z w(b'RIFFY	Unø ¯D  ' =� A // 3%._ë# *% yvÅJ  ÷ Ð # =, ] < N Û :try�^ Rform__ E_posc Vtell(� ñexcept (Attribute�A, OS	 o ` 	›%  ™qõstruct.pack('<L4s4sLHHLLHH4s',Î  a C36 +$�, b'WAVE'	 šfmt ', 169    Ã_FORMAT_PCM,E F Þ ª
? ´ . Â/  ÔA / 
 @ * 8Ý  ô &')ž#ifÈ Ó!isø x H û ¯'; U V¢ > C ? §ten = TrueÒRpatch$ ,VÅG   � d 8  – 
	ereturnE ?cur„ 	Aseekª +._z6, 0Ÿ2  ˜ +e(ê;', Ñ ' =tenAv  Ö Áv ™  E q b   ? ZB  R  

DÐopen(f, mode=ŽÛ!if 1 is·› if hasattr7 '8 '4       ð = f.mode
       ‡ else:
  ±mode = 'rb' 1if  �in ('r', )4 ñreturn Wave_read(f)8 )el: w: ?wb': Vwrite; • Ñraise Error("‹ …must be � 0, '` ð&or 'wb'")
"""Weak reference support for Python.

ThisÞ ò$ule is an implementation of PEP 205:

https://www.pC Àorg/dev/peps `-0205/ ð

# Naming convenP ú: Variables named "wr" are w¯ ñ objects;
# they# €called tµ pinstead¡ á"ref" to avoidX ò collisions withF ê p-globalp() func›  ú Àorted from _� iref.

 ' ! (äC get) lcount, s 3ref
 Sproxy @CallP CType  RÆ$ Ä_remove_dead­ )­ 4set°  ¡Set, _IterÝ‘Guard

im_3e¢s_abc  # I Uafterjƒcirculard .K 4sys µitertools

Õ Us = ( -, á)

__all__ = [ß1, "9K", "t
 #s"DÒQKeyDiÚ 0ary/ 	P  Ž > › 	- s  YXValuec ƒ 4Set- `Method Üfinalize"]


€à.Set.register(f NSet)' 0MutC. p
class > w C(ref‚1"""§ £A custom `Ê’.ref` sub= üwhich simulates a«!toH ‘a bound mà `, workþ!ar ðthe lifetime problem¾5 !s.J  š 	 q__slots "_ª_ì@, "_f P_typeIR_aliv
 A__"
D ñdef __new__(cls,   , L“back=None °6tryÛ  Qobj =5 ‘.__self__X      – !   ! ñexcept AttributeÅ
` Þ Ù `("argu�p shouldè[bnot {}¿ „  €.format($(.2)))Û ò Ã gcb(arg Q `# The ò -` trick)@needŠtQcreatí Vrc M Rcycleà     \ ! =c B_wr(7    !if .Ü
4    =  ‰ = Falser  $ %ifè¶ ðot None:
           ô callback(self)
   ú = ref.__new__(cls, obj, _cb* ¢._func_ref4 ( ( Àmeth_type =  ( M @aliv! ITrue’ 3_wra    7 preturn  
1 `def __Ü "__Ú :  ß åobj = super().& N  ½  " 6elfÙ (   ifÁ is None or 2  i  m š  ) �   ®  ._ 4Hobj)Ä #eqÂ †, other)` áif isinstance( Ç, WeakMethod*  Š aif not$"._b!or :  ^  4   ®  ó - Ë ! +¯ C andu  &$=Ì ^Q n èNotImplemented/ne{ T³  3þ!"‚__hash__. �


classñValueDictionary(_colle ós_abc.MutableMapping63"""  K @that�erences vW ’s weakly.¢õEntries in the du p will b ñscarded when no strong 2ref^ 1 toA d â exists anymor1"""2 Á# We inherit2 ðconstructor without worrying ab  š SinputB ¦ ð; since it uses our .update() ©’od, we gen DrighG ¡checks (if‰ Ois a�,‡ Pobjecç âre unwrapped oJ�way out,M we always & # F  ) 3in)�Jinit4Ã=(), /, **kwð É / ¡remove(wr,µrref=refC€, _atomiérmoval=_/ `_dead_7refQ  U  èM I F  !iff  X H &�% ¾._iterating$  M  j ’._pendingš @als.Išnd(wr.key  6 OelseP 1# Aî  å !al¦ ƒecessary+Athisþ ^„ T  P# canû �ñed asynchronously by//GC= p‡|.data, Ð þ «  ;	 U ð # A list of keyós to be removed
  áself._pending_ ‹als = []$ úiterating = set()  šdata = {} ñupdate(other, **kw)
" µdef _commitw (Ž ”, _atomic =	 ñe_dead_weakref):F  Æ 1pop“ É E.pop) d'  ¬  ó+# We shouldn't encounter any KeyError, because this method6 J `alwayshòcalled *before* mut=•the dict.7 ¦while TrueÔ  Ø :try   —key = pop€  Áexcept Index² ; ereturnw  6 jx(d, key¢£_getitem__�   \ 0if ´B#  h $ îBošW[key]ß »if o is Non"Uraise¤(› ß <els.  ' o€O_delÞ O2del& xÞ ƒ 3len]ÔX4óA len¾.� 	Þƒcontains‚ ÿ¼‡ 4Êð
Ë{Ž  JÒ UFalseì &1not*cCreprâ d6 ò"<%s at %#x>" % *ñ__class__.__name__, id )Bs w, valuek H4G ÄE  =ûaedRef(q ,f/ÌBcopyÀ R˜ 4°new = WeakVù §DictionaryÆrwith _IEconGuarO�  á0for„r, wr inÒ  ó .¨'s(U .    M'wrk     9
i  "   4newOoR2newA __?P__ = 	  ÃP_deep ag, memo§ Afrom5 „ import 1 m †:$¾Às__()
      ÷  with _IterationGuard(self):
  ð for key, wr in " Ë.data.items(.  9 ‰o = wr()G   úif o is not Nonei  "   Ñnew[deepcopy(z ¥memo)] = oS ±return new
 qdef getÁ ,° €default=j ¦ "ifÄ ú_pending_removalsŽ è u_commit# Ô :try1 Bwr =Z  Q[key]š  Ó ú except KeyError9 Ë ¯ 4 +ls!XT æ 
X  y õ
# This should only happeng  &   †   eŠ   1 o€ 9o?®¬v¬v¬¦yield k, vAkeysˆ—!if±ð í  __iter__ =qs  ‰  �valuerefB"""R½0an * ¡ator that Nñ	s the weak references to V "s.k  †8The' 1are^ guaranteed: Ábe 'live' atG EtimePthey 9 rused, sj ñresult of calling9 ’ VneedsE ðo be checked before be8  W ". ‰0can(    ™ UavoidD Pcreat2 f ¡will cause… ágarbage collec>Akeep& +Ñ around longeg 5GededE5"""… 4°óV from<.» "()ç R \o™ ë –  ?obj\  
6obj	0popg`"À  self._commó it_removals()
  µwhile True:   ÷key, wr = self.data.popitem>  * ko = wr û if o is not Non]  7 qreturn h !o
| €def pop(r , f*args)› "if� …_pendingÓ #  ]  B o._commö :try1  Å 5 é W(key)Õ þ except KeyError>  æ Æ  € ÿ   
+ 0if Ó 
  3   5[0]J   ?elsAEaise‘ ° 6 2 _ j¨setdefaultq =º x1_[key]-C•î $( ò$  á°   ==cedRef(ö ,](eƒ* B F/ ocupdatekQotherd�, /, **kwùqé4dÁ°  Ÿ ‚ ¢!if»�hasattr(° 0, "ÿ's"§    ! r = dict. 
92forÑQo in . .M (M  d oš

] K^ Z * �‘valuerefs¹¬ B"""RÂña list of weak references to the D "s.ä -8The' 1arem guaranteed: Ábe 'live' atG Atime˜  C Pthey 9 rused, sj Qresul‹ qcalling9 ’ VneedsE ðo be checked before be8  W °.  This can(    ™ UavoidD Pcreat2 f ñ that will cause… õgarbage collector toE Akeep& +ð around longer than º 'edE5"""@ -4rÑ Ïïö” 2())Á q__ior__% ,Î‹ïêb  " N M Òif isinstanceZ3, _F÷ions_abc.Mapping…  %àc = self.copy(7)
  êc.update(other …return c1  ñ NotImplemented
 òdef __ror__(self, Q :  q Ãif isinstanco ö, _collections_abc.Mapping)8  < @c = V º.__class__(« Ç 	  B 
7 Ñ â 
v Ó KeyedRef(ref¢ ñ:"""Specialized reference that includes a key corresponding to the value.
(ñ This is used in  PWeakV$ !Di(0ary; “avoid havK acreateF Qa fun, ñ object for each† Fstor_ mq±.  A sharedD „callbackB 0can– ’ õ'key' attribute of a ã"eaF pof gett£ aú  àfrom an enclos) Sscope2"""_ò__slots__ = "key", wônew__(type, ob, ½ ,ð © G   =‰ ?.__5 " / .¥ =H  F 5  … Finitý† 	“uper().__3 ³ 3)

m ø6Keyö(-jutable4C"""   ·‹šsÍ ƒs weaklyhtEntriessdjñwill be discarded whe™ reª!noð longer a strongcì!. ß J beM2d t> àassociate addiÀal data withÈ‚owned by]‘ parts ofƒ  an applicaA : 1outR &ng®s=SthoseÛs˜ D œ "esÓ ly§ 1fulN 0 Û†overrideZ B ‘accesses. À¨ð : , e[=None¡.ù A= {}C  r > ‘remove(k,	qref=refk)A  .  _ 0 # Ð  !if@ » t € 
k% p._itera¿$  (  j A._peÐ_¢ `als.ap *(kz  1 OelseK ?try  7 1del¶ 5[k]   `exceptˆ_ErrorN EpassB Ã » e f €# A listãAdead6‘refs (keyK2be > dï U  5ingF = [» $ a±tÖ  òdirty_len = Falsá ó !ifBÉA ÝÀdict)

    dóef _commit_removals(self):
  ÷4# NOTE: We don't need to call this method before mutating the dict,L ðbecause a dead weakref never compares equald da live' ,I peven ife ‚y happen— Prefer< E ‡objects.; 0Howo ð, it means keys may alreadQ �ve been &ed@ `pop = %•._pending<E.popi d' Edata ¦while Truec j:try   µkey = pop()A   þexcept IndexError; yreturn
7 d ©del d[key], c ?Keya Bpass_ dFUscrub	EEï = [k for k inj û d· O ÷dirty_len = False¥ ¡_delitem__¡ ,ùëA  ¨ *#  Ñ¨[ref(key)]` ?get` ”Ò D 3len  › "if7 _ß 3and ‡
#& ñÐstill containÅs which wereú  tÄ# explicitly�, we havep �öm (see issue #21173)@ L F_1 3ã(1len§.,E) -  y)…NreprBU ð "<%s at %#x>" %« ñ
lf.__class__.__name__, id~ )\ sáw, value­ß  µ %,ƒMB)] =4 ¶ Bcopyo ½÷new = WeakKeyDictionary°with _Itera CGuarµ F  pM#eyª V £ .°'s(¾  1   0o =o     û if o is not NonÊ "   Vnew[oë     ˆ2newþ  __ü P__ = 	  SP_deep Íg, memoª Afrom5 „ import 1 ¹C�ãÑ @“Ö (hã P ;1getMá , default=¬à):
        retð+urn self.data.get(ref(key),default)

    def __contains__(6  , * :!  % 6try   Twr = R ' úexcept TypeError4 0ret– UFalse3  Gwr i± › Qitems” )N üwith _IterationGuard$  ¦ Ùfor wr, valuea .X T  0   ¥key = wr()¤      ifÆ is not None“     Pyield+ z Î ?keyÍ ,	Æ  ?obj¾   ¾ 2obj·  __iter__ =Ò s  5UÎ ,!	Õ ›!if˜�¡ ° mkeyref± B"""R™àa list of weakÞáerences to the .Q  ë8The% 1are guaranteed8 Ábe 'live' atE 6timþPthey 9 rused, sh Qresul‰ qcalling9 4ref� UneedsŸðto be checked before be8  W °.  This can(    ™ UavoidD Pcreat2 f ñ that will cause… õgarbage collector toE Akeep&  çð around longer than ¸ 'edC5"""> r† „Ìº¥0popµ ¸ ¯ö._dirty_len = TrubQwhile 
-4key}=)e 
ýoýOif oŒÓ oj ; <1popÈ h, *argsÔ W ú ß O �N m 3setót  =Ç{ \ > c ,0_removePcupdaten Adictf ›, /, **kwî 'd ‚0if : a!ifo€hasattr(- 0, "#'s"Ñ  ª     ± = type({})0 
æ .!in� �/d[2] =rÌ Mlen(ú  ˜ Æ1! »U__ior”WotherÛ ; ðother)
        rðeturn self

    def __or__( ‘, other):  ! áif isinstance( ÷, _collections_abc.Mapping8  < 1c =k u.copy()T  c.updatS 
 r¦ c1  èNotImplementedÁ rÂ MŸ__class__Ç cã  Zâ #
v ’ finalize—@"""C� D for aŒò of weakrefable objects)D ð(obj, func, *args, **kw
 ") i�s a callE 8 rŽS á which will be, ped whent Ã is garbage )qed. TheC äfirst time theÁ  er7  v ñ ed it evaluates« (ª © I 5and±  J þresult. After thisa ‘dead, andB  o 0ingp EjustN RNone.7WÕ  ^ ð	program exits any remain@ $s”tð  at3   attributeè Etrue?ðrun in reverse orderË1cre×.¬  By­Sault R  à 2rue 2"""± 3# F.r� ± don't have¹ Pstateb °their own. ŸBy ar¤!# õused as keys to lookup _Info] !ing�registryK !is´ €# ensure‰ at' €y cannot7@part† ¤a ref-cycluÃ__slots__ = q_` Q = {}^ ò_shutdown = Fals» €_index_i =  ´tools.countM Zdirty7 ` £ered_with_e[ r Žÿ ‹ Ê	­ "€@", "d   [  e 
 \  
 ­ "")»�Finit�­/°… 0if V j.+Ë -  ¶ p# We maÆ ¸1eÝqO0mor¤Óan once becauf C   #Áð thread race, buë atérharmles 1   TimporÇY    .Œ” ._@ M
Duð b = Tru \ iµ‘Ã .»  =�' Pv  B .‰ ! =%»   ç0 =  
 ø3 = 	 0or a
% ú ´ .$s = next äž  ¬ 0ry[ ð] = info
        fñ'inalize._dirty = True

    def __call__(self, _=None):   $ ð*"""If alive then mark as dead and return func(*args, **kw
 %);H ”otherwise0  h 5"""! pinfo = ‡ ã._registry.popš  0 ). !f 1  � 3not7 †shutdown¿  Ã r¡  0 .¦   ¡  « ( ± † or {})) adetach„ !Q(obj,", q i /2get– Vobj =× ‰weakref(: ) 0is 8 VÆxQÜ g  W,{ .æ  ë TSBpeek» W gµd _ Z U @yÆ n¹ ¾  Ã  È 	‘@propertyÓ žx, 0WheP# fÞBr is¥SD Û3 in$[�s  Ctexi[Ú >"""t  should be D`ed at = „  ì ×½¬ Abool‘)– > !.a’ °  v.setter(# )h, valuÃ E ƒ iTõ  Ï = ‚ 1 = Ÿ ` �  ¥c__reprC% ; x  �¸ ´
¥ =°'<%s object‹A%#x;§¡>' % (type"â).__name__, id  Oelse^ cfor %rm g \” : y !, ˜ ;obj—   ˆÁ@classmethod_ v°select_for_uG(cls}2# R÷º(sÀ0ed º  7 á, oldest first^  ¹ ¡L = [(f,i)* 
 gin clsž€items() :%]C ð.sort(key=lambda / : –[1].indexwÃ*[fp "L]h Á  ^ü À At shutdownó invoke finalizers for which atexit is true.
  `# This ÷%called once all other non-daemonic threads have beenG fjoinedY õreenable_gc = False. Etry:  ‰ Ýif cls._regis " ‰mport gc8  rf gc.iso :d()[  #   
� 6Tru�    `gc.dis¹ -()k Þpending = Non@ `while [ ƒ 4if B !isC 5 or¯k._dirt—   < =,°select_for_Û¯   5   b � $  dif not¨ È  , ]break!  4f =? O.pop˜ å ?   @# gc“ŠÀd, so (assum4no “‚ C ­À) the follow=  æhe only line iÆ 9  0# tƒfunctionKðmight trigger crea Š …of a newër- f/�except E ?ion™Bsys.. chook(* ~_info()Ô ð rassert û"in`Œ¬ Gl¡ú# prevent any mor€ rom execut|0dur zshutdowx^ Tize._ ! =L€  ª 7if É2gc.ñ()
#! /usr/bin/env python3

"""
An implementÀ1 of*ðstandard library webbrowser module to open �pages.
Si6@we'r< %`y runnî a( B ñ , it's really s‚ 1...’ Q

defY  (url: str,6ó: int = 0, autoraise: bool!A) ->Nft jsß  2qwindow
F .½  d Æ, "_blank")
~ @_new ‚ \ ereturn¥ <, 1: O_tab>  2)ú ðwsgiref -- a WSGI (PEP 3333) Refere^L�`

CurrqðContents:

* utilB óMiscellaneous useful fÁàs and wrappers7 @head)ó-- Manage response  & Candl' pbase cl3`àserver/gatewaywVe è_)  ¥ aû¡ BaseHTTPSD � that supës ~ €validate:  �ðrapper that sitsô| between an app and a server
  to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard)J ƒwrapper J )CGI @WSGI* Brout% ð-a simple middleware component that handles URL traversal
""" óBase classes forþ /Ò ]  « `ations6 ò	
from .util import FileWº ð
, guess_scheme, is_hop_by ; PheadeP> H #

N ðsys, os, time

__all__ = [
    '´ HÕ ar', 'S¤     7CGI  D 8IIS ñ 'read_environ'
]

# Weekday“month nam' HTTP date/¥  :òmatting; always English!
_wH  =  Å °"Mon", "Tue 0Wed 0Thu 0Fri 1Sat aun"]
_} ? ñNone, # Dummy so we can use 1-based 1 � numbersñ  9 1"Ja 0Febc 0Mar !Ap 0May ]Jun",8  ul 0Aug 0Sep !Oc© 0Nov £Dec"]

def_#_#( qstamp):Z Ryear,ª ñ, day, hh, mm, ss, wd, y, z =0.gm@ E D ñ	return "%s, %02d %3s %4d :  ‘ GMT" % (5  ”C[wd]‚ j[C2], § › C ñ)

_is_request = { À'SCRIPT_NAMEš�PATH_INFO ÀQUERY_STRING àREQUEST_METHOD ¢AUTH_TYPE'|ƒ'CONTENT   `LENGTH3  ‡S	 ·REMOTE_USER òIDENT',
}.__contains__¡ó_needs_transcode(k™Uá ð(k) or k.startswith('{ /_'  0SSL \ mJor (< €REDIRECT(  uŒ b[9:]))ª ›(¥ ƒ"""Read ² ¢P, fixb š ‘ variable³ † ñenc = sys.getfilesystemencoding()°  es& `'surroqescape' 2try» O 1''.; ãe('utf-8', escE Ðxcept LookupE<8 a creplacY Å  H!}
k ø# Take the basicè  € native-uni½C os.F Ã. Attempt toL afix upN BcomeP  k 9Õ!toI`ensateÏM  ) tbytes->} "deD@ steg  at will al»Ñy have taken ö .K  n@k, vW¿ Titemsç j>if  "):) !   ±# On win32,è Q B is -ðly Unicode. Diffeçrent servers
  ñ# decode the request bytes using diffe? ©encodings.B ùif sys.platform == 'win32':(  u ý*software = os.environ.get('SERVER_SOFTWARE', '').lower()
J ‘# On IIS,¹ EHTTP¾ swill beÙ  d as UTF-8	 OlongL  !asG óinput is a valid8 sðnce. Otherwise i( J  Nd= Uqsystem eÿpage (mbcs), with no way toL Àtect this ha ó ppened. Because  i¾ ¿more likelyM  ¾`, and ƒ  é 1inhÝòly unreliable (an" Ostri1pthat ha� @s too2ƒ0not !asT )œ  âalways recreatŒƒoriginal�Å
| T €Wp.startsYp('microq~-iis/')Ž > av = v.²e('utf-8').´ ß('iso-8859-1'„ðApache mod_cgi wri9?q-as-uni÷£(as if ISON �) direct !to‹U; $0 Nog þification needed/ela­ 
OpasshòPython 3's http.F@.CGIvR“stHandlert
c g#Ðurllib.unquot§‚fault ofÏ°, amongst on# [issue† e û (1     y	"`simpleÕ ./'— 7  +!'pt/3' in I f `B2For¼`, guesðaqey havey3ten,M ‹MŒQstdio3 ð	-oriented interfaces, enî= upì #¼ S Þ‘/se|ßenc, 'replaceƒ‘# RecoverÄ ts from së ,ì Purrog\jescape¢0# wb availöJ.1+)Ô /elÐ 	HÌ ?escI¥ 0[k]†gsreturn  Ó


class BasedL`"""ManO †Cinvoðof a WSGI application"ð2""

    # Configuration parameters; can override per-subclass or  �instanceJ �wsgi_versG v= (1,0) ÷multithread = Tru5  }process òrun_once = False· Óorigin_server4 Ï ñWe are transmitting direct to client— Ehttp° � = "1.0"VÅ òthat should be used for responsÂ ƒ `_softwy `= NoneY0Str} ‚name of )  ) ‚, if anyÐ ò # os_environ isl ¹to supply c¤Ãfrom the OS 4 Qment:× ð	# by default it's a copyƒ C'os.1 @' as ðimport time, but youùL ÿÀthis in e.g.$ ñr __init__ method.2 Æ  = ìÔ $()è ÑCollaborator N!es; @¡file_wrapp×SFileW ß!seÈd’to disablŠ�headers_U B = H  8  `# mustÎa  R-likeŠ ¤ °Error handlÂ_(also
éötraceback_limit ¢Print enti›'  ‘òself.get_stderr(J e� `_statuò "500 Internal Sõ¥ ";/  ÷ = [('Content-Type','text/plain')]4 ¤body = b"A L ð occurred.  Pleaseƒ taE±he administÅ.J State vari” s (don't m×@with´"seâ Ü 0resª,š È @_senDö Â X, Tbytes* 0À€def run([�, applicÝ)" K �"""Invoke” $ """S % d# Note¦#: Ï "ov6 óclose()!  AsynchronousHs9"n'nP Scall 8  ÇfI$h_S`(), soˆb  'Pwhere¡÷ N  rdouble-¶pbranch + ,¥¿'ll break a¢ 'byM �prematureoslosing.Ú Ó <breturn¾ 'h0)' Þ)ouê C  Ê t�   might sti” qe outpuË@iter8 kE Þ 6try®   Îg.setupT   ! N÷	ø!, ( Ustartv“	I ˜+àexcept (Connec5qAborted‘Ã, BrokenPipe ) QReset ‹ w �# We exp¦hŽ § z-¥cp ’ abruptly… ¼ž N !toÒO  Ðreturn
      ·  except:
  :try   ùself.handle_error()5 I  8 ñ # If we get an ;  H 5ing ù, just give up already!b  N † [close   ñ(raise   # ...and let the actual server figure it out.

e ðdef setup_environ(k )`"""Set�  R % òment for one request"""S  “ `env = K .3  $osj W.copyÏ . éadd_cgi_vars()Q à['wsgi.input']f   f —get_stdinQ 3env4 ~s5 
4 (erÔ5 tversion6 5  „ _ B … 5 ƒrun_once6 5  6  ’url_schem8 6 Ô  Õ ämultithread'] `   n   `procesn 9  }i$1lf.# ö	file_wrapper is not None3
0 )']§  n sorigin_¾ Ø" Ž_softwarw ÿ.setdefault('SERVER_SOFTWARE',C )ÿ finish_responseðnd any iterable data,q!n £ø ±  3' á ñSubclasses intendedMóuse in asynchronous¼es willËðwant to redefine this method, such thatë@sets½•callbacksE  in³ 0 evÌ@loopR ­ @te o1 ¾ Ü Ì  o E @ 'Kñ @()' õQ ; N5ed.6  &    p!ifNY  result_is_&V() or Bsend 
v V  — ¶  KJ )  - ! `write(4 
Û! Ç 0_co®t�F b# Call
 · gY -±returned by/õWSGI application* ~ #Å qcase of4p 6ionQ ' ¡if hasattr°.<1, 'ž'Î .   ø ' .% Õ    S‹ ;elsh‘# We onlyí ‚when no 0ionL qd, becaãtY  k #Ü …’ status, ™ ¡, headers,LH`fields­ v
	ñ # See bpo-29183Vðmore details.
        ð self.close()


 ð def get_scheme(" !):   ò"""Return the URL ( å being used"""/ r, XguessR ˆ.environu ÿset_content_length}  ’Compute C) !-L) ð or switch to chunked encod– ¸if possible� 6tryÙ  Ý Áblocks = len| ….result)Ð óexcept (TypeError,Attribut áNotImplemented# > e FpassP :lse„ 2if ‡ :==1  =  Žª.headers['‚'] = strº —bytes_sen¾  B   –… ß# XXX Try for>÷origin server and client is 1.1:ƒcleanup_¤ Œ ò"""Make any necessary - € changesÍ‚defaults“ ´ ðSubclasses can extend thisó¤add other : .ß ó<if 6Q not Ý $lf[
yuž )ž  1Òstart_respons5“, status,ß ú s,exc_info=None'A ð)' callable as specified by PEP 3333Ø å 4if _ 
½ å M1if Õ y'
7  &   ²# Re-raise  ali ”eption ifÝ  jŽ  :  = � E[0]( ö1]).with_traceback &2]v K kfinall±  N 0 = X    Ð# avoid danglÅcircular ref© +el Ò  K 
È PAsserü Û2("HŒã already set!" ‡ g	ž ~  „   � _í( K  -  0òvert_string_type(# A, "S€"=  ?"rtÞ S)>=4,(   must be a" Past 4’vractersÓE f å[:3].isdigit()t   mÚ$geT  =Aw/3-( _ codeP 3]==" "J óhave a space afterM SÊif __debug__À Ü�name, valñ\
&  ´ & �b ! #, ü  e B    f =gE 6valD _valueE  m ’�is_hop_by (u 5),\ø  r  Ãf"Hop-by-hop£ð , '{name}: {való}', not allowed"

  òreturn self.write ð
def _convert_string_type() õ, value, title):M B"""C4 b/check(  9 E."""( !if (G †) is strG  › ˜ " 8 õraise AssertionError(  7 â"{0} must be og  ] ñ (got {1})".format(½ c, repr‰ )K )Âsend_preamblÿ 
ñ òTransmit version/status/date/server, viac_d+() V‚.origin_4 
"if? ÷client_is_modern(Œ  ÿ   L h ñ('HTTP/%s %s\r\n' % Ãc.http_³ ,3 ¸ ö)).encode('iso-8859-1') c   ‘if 'Date'YiCzheaders¾  /   g š k   (V :± °_Q`_time( . /()¯ ^ Ä ” sñ_software and 'S¼ß $(? È k nJelseMF E1('Smf  ]  â� R g, dataNB"""' ð)' callable as specified by PEP 3333ÏV  Êa âV  á…bytes, \&  * "b • argument»!a 1 — instance²!ifr ¶ .´
!%j ó	before start_response()"ò – (elc ÒZ_senti 2# BM ðthe first output, 5  sstored E 	ý Á æ \ r = len(1þ   # make sure we know content-lengthN  w _l (ïE| +} û 	b# XXX ÊC{ L{ "�truncate Ïsoo many· ØEten?£ í ¶ã  ‚flush()
}  œ Ì /fis@Plat-Œ c ) " tŠs†H  Å ðOverride this method ¯@ubcl«ìs to support p[ ¨ c P.  ItÛAonly#!ed he applica¥%'sC ÔAiterN!('qresult'%anó5 of: ) Pwsgi_ˆ ¦_wrapper'.è Tß ðshould return a tórue value if it was able to actually
  õ0transmit the wrapped file-like object using a platform-specificH ÷approach.  It should return a fals• õnormal iterationF 8 ðbe used instead.  An excep. ° can be rai% µto indicateH Sthat Û Rssionõttempted, but failed.
6 ôNOTE: this methodÈ õcall 'self.send_headers()' if? !  “_sent' isü 0andŒPis goL Œ� u directG 	· !of™ ‘." 5""" cFan  # No¦
²by default
ü ðdef finish_content(ì %):f £"""Ensure ß  Ð - ð have both been ú £ pif not S .? _  ŒÒ# Only zero C† p-LengthÇA At by@applò Ú5(so¨ I þÔHEAD requests3ùsatisfied properly, see #3839)G ¯ C.set3*('� o', "0";  
)[ Jelseù ðpass # XXX checkï Z"-l Â0too�6rt?µ_close¬ C )c ü(†aeeded)¼`reset Ø e0ancŸ"rs\  GñSubclasses may wantA�lso drop_ Ðclient connecœ¥:tryô ¡if hasattr¾ ‘.result,'Ñ 'y Š   Ž& .% (s0finÓ
b 1 ) =| dstatus Öenviron = NonI| Qbytes·Y = 0;R  …T	 ‘ Ù D"""T{ _ †UR, viag ˆ_write()U O †.cleanup�g X Ÿ 6TruÙ  •òorigin_server orv ‡ ·_is_modern(¾ ã ‡preamble”! ¼ ?ì– '))*Ú l  ê( n ,uÏd/ ^!an&Á#of¥Pwsgi_J _Ò(r'; ú- E\0 !isÈ  C$is;± Å/ ß K Ÿá + ° acñ ¨ q;Í ¤ Àself.environñB['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'


    def log_exception(self,exc_info):&  * Ä"""Log the ' ¡' tuple in `serverP ]  7 ñSubclasses may override to retarget< øoutput or change its format.„  Etry:  j öfrom traceback import printß 	2 òstderr = self.get_ )()' C (  z U[0],  1 =2],7 v ± ‚_limit, ƒ 	- 
� ! g.flushª kfinall� r = None— ôÁhandle_erroróê�current $ ¢, and send  °`to cli' åif possible"""À å b4ys.™ &()Ý bif not�Êheaders_sentçQ dresultº¢ _’ Í ’.environ,M æstart_responseq  ¼O efinish" Vð# XXX else: attempt advanced recÐ±y technique³P HTMLÊVtext?t§ &, ¨ 
£ ó ð"""WSGI mini-app9icreate‰f  Ñ  ByÕðault, this just u�¼ ó²_status', '– p'¦ ð Pbody'ÿ pributes„ Pgener† $anÕpage.  It can$beõ0den*3a s H pdynamic» T ¶diagnostics‘ ðchoose an appropri pmessage+Höuser's preferred language, etc.(ÐNote, however+qat it's„ Ú�mmended Xða security perspectivÆè @spit
 ½  á pany old‚`r; ideë ñ , you should haJ 6 doM �omething k 0ialJ genable`  o õput, which is why we don'tM `includ:uy here! 	©	‚G,,*	._[:],sÍ‡return [6  G]x # Pure abs t ï Íods; *must* 64"esÃ Åa_write« Z,dataÄOk)inrpbuffer 1 6ÕÈ^  IIrokay ifJ¥ P actuÅ m0nsm© Z Q q; BaseH]rg‚@sepa1!s ¶ PÄ0 opJ2ion>gÞÅr efficiencyI 2whejqunderly!Ðystem actuallóy has such a distinction.
  5""" ñraise NotImplementedError
# ñdef _flush(self):  H ò4"""Override in subclass to force sending of recent '_write()' callsc  M ðIt's okay if this method is a no-op (i.e.,! H …actually—  v ¯s the dataô &Ÿget_stdin÷ Pretur
ÿitable 'wsgi.input's ?err€ .eÍs� Ïadd_cgi_varsƒ ð insert CGI varis'=�.environŒ 
Q SišÃHandler(Base �3""" @ thaIójust initialized with streams, ‡  ìb, etc.ˆTwhg ÏiÀ `tendedØð synchronous HTTP/1.0 origqervers,�Band N s —ñentire response output, given¹`correcÂ Cputsž rUsage::«  3\ Jr = !}  !   óinp,out,err,env, multithread=False Åprocess=TrueB )
 m �.run(app)Ï  _l!__(,6   x 3std{  ù ˜ ‡  s † š ` ä 4 C^ 1 =  "  2out =out  er-’ 
 ¤base_env =
   È_³ ( =H, S-  Á 7äcrHBelf.è c 4  5 'erÁÍ	Vq.updateÈ.)² ¿ 3 ,^�Qresul}¶ Bout.î* Â  «i,  is None or> a= len(1 i 6 Þ E ñfrom warnings import "   )(" L– ð) should not do par/ ´ &s"«  pDeprecaFWv `while Å
³  Æ ! =†[%:]Ÿ  U "if| :ata:   Ybreak/ D  ßb Àta)

    defó _flush(self):
    ‚.stdout.! ) 7 = = * ó


class BaseCGIHandler(Simple 1):
P ð"""CGI-like systems using input/out òerror streams and environ mappingN cUsage:[  Ê h| , =� ö inp,out,err,envÝ 2 ’.run(app)Y SThis   Þ i© ñeful for gateway protocols Ó �ReadyExec´ ñ ÿ
FastCGI, that have usableñ $anô AmentL ü ó.  It's also the base¦  œ „ñ, which just usesG 0sysësin, os.Y,² t so on.Óe constructoro ðakes keyword arguž ð s 'multithread'K j  àprocess' (defa( ±ng to 'True- ð 'False' respectively)$ qcontrolN  ë ðconfiguration sent&   aapplic !ñ	 sets 'origin_server' toK o q (to en�•�)rassumes¼P'wsgi(‚_once' iNK .V 2""";	u 1 = $ ( (3% ×bd invo× @ via5½/®  0errsÎ‡ z )Ê 	òðe difference between t	 †
° # i‚it alway i .#ofð, 	1  %'yNB ' B ( 6ãñdoes not take any initializ	H äparameters, buª % 'F', '‡ ƒ friends°If you needuroverridx  ofŠ8se n ;useˆ‘ {instead4 ^A_run^0 = ç / A# Doå Wallowå … Eleak­órequests in Google App EngineL  Æaother Z€-run CGI‘ cases.  þiZ°easily test)µ ñ# See http://bugs.python.org/issue7250r 3os_bR = {}™`def __¬,__Š
c.' N  ä   …,0.buº  Æ  ù	C  ª› 2(),Á=‹ |=� € )Í7IISV
½ `ôÏñ with workaroundX³IIS path buä�‹€should bEeD pre´ toÊqð	 when deploying on
    MùJicrosoft IIS without having set the config allowPathInfo option (IIS>=7)
    or metabase . ñForScriptMappings8 P<7).
8 1""" ñwsgi_run_once = True ños_environ = {}
 Ñ# By default,À ñgives a PATH_INFO that duplicatesÏ ãSCRIPT_NAME atK  è °front, causÿ òproblems for WSGI apI 0ionK ôat wish to implemenO örouting. This handler strips any such™ td path.Ø  ŒTcan b|@uredg 0pasy   Vrrectê @, bu®!isÀ #esØ òanother bug where3 ðTRANSLATED is wro¬ �Luckily t´ ¤variable iK ð rarely used and9 ñnot guaranteed by(@. On�@<7, Q gh Ê#V  á @onlyæ ñmade on a vhost level, affec- Ball É sHÞ mO0, mUàof which breakð `n expo² !toýþ 2bug„R# Forû SreasoÂ  æ 0alm• ánever deployed-S ‘fix. (Eve3 7› .ps it beWe1 rTÁ still no UIaDit.) T© is 1way  €CGI code@tellÞ Ú º�0was_c, so aˆ …separate… clE²is provided ñdef __init__(self):B   |d= readŠ(ô    ½3 = ' a.get('i „V', '', À. ”0 @if (` À+'/').starts¨(I  ª  Ž ‡ [ƒ 1] =bC[len9 5):]à ‚BaseCGIH§.!  W  õ, sys.stdin.buffer <out Ierr,C š �, multithOc=False …process=ù y ð)
"""Manage HTTP Response Headers

MN"of¿Amodu¸P red-| edly pilfeHð from email.messW  in™ð  stdlib,
so poràðs are Copyright (C) 2001,2002 Python Softw( `Founda8 ,"Àwere
writtenÐBarry Warsaw.Ö °

# Regular©@ressU¶ðmatches `special' characters in × me ^€# existe;	‘force quoF"e:   value.
imï S re
tm  s íñ.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')

;aformat• ( ,^ a=None,ƒ 3e=1U¡"""Conveni¯ @func6 ÜH ?PreturAkey=« S pair'ZwE ß Zr Ð if needed or   Pis trî Ð    """
    iñf value is not None and len( ƒ) > 0:
  óif quote or tspecials.search1 -  4 E " =g ö.replace('\\', '\\\\') ¥"', r'\"')q  D òreturn '%s="%s"' % (param,W . Jelse€ < /%s: 
6 2 a ò


class Headers\ ò"""Manage a collection of HTTP response h5 A"""
Ð ôdef __init__(self,# =y)^  ò : $ =! 6 if ¬ » 1 []_  9 ƒif type(A )ÙFlist_  * óraise TypeError("ã p must bÜ  5  Ö Rname/Évtuples"r Ç #._o ° ‘ š__debug__� ´for k, v inÛ 
!  ¦ _ ñ convert_string_â k„  )   - 'v)‚N  ; N† B"""C{ b/checkob.Ö u   v$t6strG  # V" „PAsserB	‰ vsws•";  T "� ó str (got {0})".format(repr•)C_len‚tB"""Riðthe total numberg âù, including duplicatesê  B V	‚ ssetitem† ,í €
‘ @Set Ž 7 ‡ a+	r @del k [3  ~ ‰.append(A…/._ K !),W ! Jval)V8delÔ B ø
"""Delete all occurrences× ,è‚present.³ é²Does *not* 3€an excep6 3  $¢ ñ…missing.ì ¬ — / =Ù  ! †.lower()d	M¡[:] = [kv ÅÃ	!  ” Tkv[0]I 1 !=ä]Õ 
g y 
ÿGÿSfirstú„ y '2 'R  '¿ L � € insteadv L ÉNvNèKthatM  Jñared multiple times,ª« Õexactly which‡õb gets * ed´ð undefined.  Use! €all() to  5H  Ù qs matchÄ Qfieldl àreturn self.geñt(name)

    def __contains__(self, " :"  & ô"""Return true if the message >  ¥header."""> r;  Z 3.ge Ö is not None
Œ get_all‡ Ña list of allx ¡values for  Á ‚d field.^  È ñThese will be sorted in2 Aorde< ˆy appear riginal Ý Ù „ ôr were added to this instance, and may&õ duplicates.  AnyN ­ `s dele—  8 qre-inse§ ad Qlways  nn e— .O RIf no@s ex/Awithì Qgivenå", ž«s an emptyG É U1 = É 4ñvert_string_typeY•.lower())Š b q [kv[1]¢ kvvH TsUTkv[0]@  ==o ]  �,default=A)«1Getæ Tfirst } '? S', orü # 'L 'í 0 �.k,à ¢  ‰Jif ké 
   $ 7vH­ Akeys
³,ss$Kl%%ÿ 2Any³ $(M  »,øw![k->k, Ì]R <W}y5 tÿvtOitems øjT Lu%¸$	åŠÀ    """
    ð    return self._headers[:]

 Ðdef __repr__(# !):   9 ±"%s(%r)" % " ú.__class__.__name__,^ )\ /st[  ƒ"""str()� ós the formatted ¦ õ
, complete with end line,£ qsuitabl< õ direct HTTP transmission."""2 Õ ð'\r\n'.join(["%s: %sâ  kv‡ [ kv i3™]+['','']Þ _bytes; ä U÷.encode('iso-8859-1'H ¡setdefaultb,Vg,value�B"""RËãfirst matching. 0 ¾ '@ q', or ' '‘ Õ Ifl„re is no<  1 $d 8 ”add a new ~ $ # N3andx i lbsult =@get(D )> Qif re# vis None| «  :²�.append(!ò._convert_string_type]  C   G 1 &))‘  / ! ª ;els� ' À _ L3addd© !, "1, _P º, **_paramsÙeExtendú’ setting.Y  — H  µ * ñ field to add.  keyword arguments can be use' 5setÒ ±additional ‘ Qeters>a ,} un9ccores M%edO Ðto dashes.  NÈ0llyi] P willŽ  adé  as° !="…" unlessO   î  ,ŒÓwhich case on\ :keyV 00Exa;:B'h.�ñ 'content-dispos ', 'attach>p', file²”='bud.gif´ ‘�Note that¼  ik Àe correspond™ö'email.message' method, this doeð ò*not* handle '(charset, language,fâ)' tuples: all •s must be=sÿ ?. ¥parts = [] #if§ y?not“ ÇÒ†# 
Tm Â! qfor k, rw.items($ rkx 
ks  ifR W K 	‘ Àk.replace('_+-'þ D v� 
v�  1 	u _î|(‚  7, v† Ä÷sIbÀype(_name), ð^"; ".join(parts)))
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)

This is both an exaB r of how9 fcan be[ ñed, and a basis for running
s� ð$ web applications on a local machine, such as mightb àdone when testO ø or debugging anT À.  It has no> ±en reviewed’ ò	security issues,
however¼ òwe strongly recommendCñyou use a "real"Í sd for
produc×  ' e.

For8@usagÛ !ee€ñ'if __name__=="__main__"' block at'  |  of ð
module.  See also  ë% B doc~ñother API informu.$Ã

from http.Ä eimportS ÀRequestHandlR
* 4sys Âurllib.parseZ ’wsgiref.h@ s' _ S	V + @platž # p�_)  ³¶ ñ

__version__ = "0.2"
__all b['WSGIó1',  
Ã   €demo_app Rmake_ü R']


 e  c R W/" + � G
sys* ² a() + ": Csys.½ ÷.split()[0]
softwareJ … ‡+ ' ' + o ’


class ì J(Xƒ):

    N h 4 =  s ( ñdef close(self):=  A 6try      ".r_ÜS.log_ (;  .   2 cstatusü P' ',1!,  ©bytes_sent= ) kfinallŠ 	ñ .¾ 
"À(¾)'2"""7Êr = None  O{LbindU´"""Override¢ ' ‚ to stor"@  #.q  K  É ¸_< c 1Wø setup_environ()›   , ò€# Set upÄ#e >  †] 0envI„elf.baseb X = {}% ô ['SERVER_NAME']4 Ù ü
. òGATEWAY_INTERFAC4 š'CGI/1.1'- [ BPORT[ !tr ËAûenv['REMOTE_HOST']='Q ïCONTENT_LENGTH!  fSCRIPTÍ &''R0getV‚ Lbreturnå,8 s8 ," D  Ÿ. Ð = applicatioún



class WSGIRequestHandler(BaseHTTP ð):

    server_version = "C S d/" + _ "__2 ñdef get_environ(self):M  Q `env =  .\ T.base. x.copy(). ô['SERVER_PROTOCOL']A rÊ ‚ 6 †SOFTWARE6 w 5 æREQUEST_METHOD4 ucommandb ’if '?' inÊ Fpathã  ç   d,query­   Ç.split('?',1å ?lse> 2,''c a áenv['PATH_INFOª ðurllib.parse.unquote(w ç, 'iso-8859-1'y  D ÁQUERY_STRINGG ¶ i DhostÄ çaddress_string¨1if ( !Ûsclient_0 :[0]à ½ ±REMOTE_HOSTx  A a" AADDR" 6[ « "if�ûheaders.get('content-type') is Nonpn ·CONTENT_TYP.L _K _K ý eÀP [˜ ]Å dlengthr Ë # É2if  g × aLENGTHH, s …for k, vÐv gitems(¾ zðk=k.replace('-','_').upper(); v=v.p! 6 @if k` :env¥    Y@inue  p# skip # 3entè  , „U,etc.3 9  ˜ Í?_'+n ž&  ] += ','+v@ 1 # ëó-separate multiple 	o ú E ` 5= v5 ¢return env~-lstderr,. Bsys.! 5 h¾1 2"""×  a single è  )2"""B  ¦ MCraw_ Dlinev rfile.read f(655377n| .A @) > . 6äl ® R U = ''Ž " ›& ¡/nd æsend_error(414µ  e Pbif not46‘(): # An I Ð code has beeòÙnt, just exitÇ b §Br = 3ž)r(5  s,Œ w  Ký#()   ^)),K ®ðthread=False,
    !)
 ó   handler.request_ r = self& þ
# backpointer for loggingF 0un(8 ñ.server.get_app())



def demo ñ	environ,start_response):T ñfrom io import StringIO …stdout = (Î òprint("Hello world!", file=3 '  hò corted(š `.items»   ö ‚k,v in h¤   t ßk,'=',repr(v)s  
ã ò*("200 OK", [('Content-Type','text/plain; charset=utf-8')]À ‚return [Ô  bñvalue().encode("0 3")]rRmake_�(A`host, Yr, app,  Á_class=WSGIS¾, R'H6
¯ð"""Create a new D V ð  listening on `| p` and `� `N�`app`"""ž �  Ž… |  ((9 µ )˜ 7 #.sq2app / ò


if __name__ == '__main__'ÕXwith 2•'', 8000,º¢) as httpd3  Bsa = p.socket˜ 
  j   ( 0"` ðHTTP on", sa[0], " 1 B..."È  > ¡webbrowser1   p.open('  €://local;:Ä –/xyz?abc'S  ( "d.õ_R()  #¿S one  ñ, then exit
"""Miscellaneousòð-related UtilitiesÔ
¶ ðposixpath

__all€! [Â ð'FileWrapper', 'guess_scheme ð application_uri ”  E `shift_b P_info& ð
setup_testing_defaults',
ï { Ï3"""‹ ± to convertGÐ-like objects siterablè  ˆ â�__init__	 9 ã, blksize=81929 4 0 � & ! =k   Ö ! = $ =G  ´if hasattr(F ‡,'close'f I  g . 
O ¿ 0getûÂ 7keyH Î0warÔs7  \  .	 h    "dU's __a ò method ignores 'key' parameter.  E   Q"Use uõtor protocol instead.",Ž  . RDepre6W® 
  Åstacklevel=29 0datÕ	žQ.readØ.�0 0if 3 E €   r­  c øraise IndexError{ Ý xtF  ‹ - 4nexg-  l >3lf.Àe.read(self.£blksize)
  …if data:   areturn  òraise StopIteration

def guess_scheme(environ)P B"""RK a' ó for whether 'wsgi.url= ò' should be 'http' or
 !s'ˆ 1""" 3if i ó.get("HTTPS") in ('yes','on','1'‰ Õ Z P Belseª ! 'Ü aapplicí O_uriß Gthe , ð
's base URI (no PATH_INFOÑ ÔQUERY_STRING)Ò Turl =Õ [b]+'://ÿfrom urllib.parse import quote
!'!X_HOST t +u % ]E 
. ÒSERVER_NAME']v  E›Æ  4 ==Ðw6 Y ú PORT'] != '443'0  4 ‘ V':' +:	> Ç  , 
Ë   ¨ 	4 r /80q $r š �3©r'SCRIPT5)ò'/', encoding='latin1'Ÿ†2url�xrequest‰ó, include_query=Trueó| �Sfull A  —@, opÃCallyD @ing + J z stringŸâ… ® — t²path_info =­
&ÿ',''), safe='/;=,$dif notÿe 8–… ?[1:è' Ò#if%iJ andu Öe )'?¦	. † îeshift_‡ +ÞS! � a name ~AG to k", ]  â"it¬ Ifíðre are no remain"  s � segmentsSW H a None.sNote: 'Žð' is modified in-place; use a copy if you need¦ AkeepI  zŠoriginal0É .¼ u Gwhen* ¡is just a TCthis÷ As ''±ñappends a trailing{ 0'/'‹ h ú, even though empty 6"rm@qgnored,N  K ³ doesn't no.  en¨ @.  T© ii2ten“H �behavior,œ èensure that ank� can tellÏð difference between
    '/x' and 'ñ/x/' when traversing to objects.
    """ ñpath_info = environ.get('PATH_INFO',''), uif not 3 :  N Áreturn None
 $ vparts =1 “.split('/Q & ò[1:-1] = [p for p in8 E  ñif p and p != '.']m Dnameg /  9delE ]� sscript_7 	ö ¶SCRIPT_NAMEø 
0 Pposixº P.norm	 (! P+'/'+Z 3 ‘.endswith?# 7 =  [ä | Z  ‰) Z b+= '/'õ (['ñ  €T x ) A]   K `.join(_w)\ õ	# Special case: '/.' on B ñ doesn't get stripped,o ð # because we do% ! ö the last element ofQ ;  if' Ñre's only oneÿ ž ð  left.  Instead@ 1fix3hisB `above,| öfix it here so thatp  ¹  s ÿ”alized toA qn empty×  ngÆ º F{ Ë†ame=='.'Ú=CS  ó

def setup_testing_defaults([ )J ³"""Update '  ' qP triv“8 fM ’ purposesÀðThis adds various@ñameters required@ ÀWSGI, includJ’HTTP_HOSTÍaSERVERM#,  ÷PORT, REQUEST_METHOD, †,gF  ð0all± Kawsgi.*› PablesÓtð“supplies å v valuesG  xÃñ replace any exiS a [sÛ Wthesef ñroutine is intendP make3aeasierE Punit es¾  .'0ser—Èa³ pcations¥Äset up dummy‘ ðè Áshould *not*L ðbe used by actual g  c 8or b p, since'P dataÄ Qfake!L  	 ;C.setK#('À“127.0.0.1Ê2 °PROTOCOL',' S/1.0'*6  $ D#', [| ]Y 	£ 
Vd','GETk 9if ì A$incŒô ] —x ¾5- !',qé (¿ion', (1,0)ü À'wsgi.run_onÿ!ce', 0)
    environ.setdefault('wsgi.multithread. rprocess/ ^ ñfrom io import StringIO, BytesIO% ƒ einput'- /()³ Perror h 2 óurl_scheme',guess (” 1))
£ $if)[9 ¡]=='http':+ UóSERVER_PORT', '80'Î l] s^ ñ443')



_hoppish = {Ÿ °'connection‡ �keep-alivò'proxy-authenticate',6  Toriza?  ! � 'trailez  änsfer-encodingB ðupgrade'
}.__contains__

def is© 0_by Ò(header_name)U÷"""Return true if '% ò' is an HTTP/1.1 "Hop-by-Hop" ) 1"""Ê rG  h  l `.lower4ð# (c) 2005 Ian Bicking and º ðributors; written for Paste ( ://pythonp ò.org)
# Licensed under the MIT l #: : àwww.opensource= /# cs/mit- ².php
# AlsoC cZ dApachet U, 2.0b ^ a4 32.0\ ± cto PSF¸ ca Cont° Agreement
bñMiddleware to check�obedienc  ù °WSGI specifhÑion.

Some of²things thisH ås:

* Signatur( CapplB  ðstart_response (incluˆð that
  keyword argu¸  s ®  not used).f E  } H  -   t1 diK�ary (and H  a subclassN  7 �That allÚ €requiredŠ } !in t v ò: REQUEST_METHOD†CcNAME,   P!, ²sversion = E + Ý#  Á €run_once!- Ä  bÑ_CONTENT_TYPEt	 eLENGTHUÜ {à s (theseœôs should appear as d N !ndC   { ]PWarnsÀQUERY_STRING€missing,P  tñ cgi module actsQ PunpreÅQably ­ ‡at case.÷ ðCGI-style variablesÂ �at don'tÑain a .) have\ ñ (non-unicode) süw values\ �» ¶ ha tuplu" q % qA or 
 ps' (@@: 11too‚  rev ðctive?)

  - Warnöxs if the REQUEST_METHOD is not known (@@: probably too
    restrictive).

  - That SCRIPT_NAME and PATH_INFO are empty or start with /
> øat least one of N :or M 8setz àCONTENT_LENGTHÄ øa positive integer0 \ ñ ú'/' (it should be '', Ç     8/')U áwsgi.input has\Ñmethods read, Fline
 sb Q –__iter__
Q merrorsR Ãflush, write  [ €s

* Thee2tus
 ®ðng, contains a space,& 2rtsŒ$an*1,
 ù tÕ> J ð in range (> 100ý  m !atì cheaders `list (I±a subclass,Yñ
another kind of
  sequencLP Pitems	 ¥]  IQtuple Ù "s.õ ˆ  re« Âno 'status' < " (Ï ñs used in CGI, but— Ÿin
  WSGIÖ Tdon'tBA newná or colons, enV _ u-, or
 0 pcharactö codes below 037¼ ±Content-TypÃ Sgiven¥Õ  Àáent (CGI often¢a
  defaul¡  # BtypeÝ  Ô A doe×Ý ?no r @whenÑt !noÅ  T iÙ@is
 
(?)†ð  exc_info argum? "too�_responså !a Î 4FNoneÀall calls toŽ ê r w;üAB no VqA
  oÅ 7 †accessede a²i’properly:ˆ.º ()S Ž "ed,qexactly«á 1 T4rt returkWtring  S  > =  ã ; b.close�  ]” ! N+…providedœó Tô U!().  ¯ sw s a£ � û ¢ ¦	¢ –eTsterator‹_  it‹ û | µ!a { ofå@ingl � ; ( ² ¢ will work&ðperform horribly) Ø³.__next__()›CØ ¨ Ä ´ ¦  Üed over until haNa  beenó#ed¬Ñcan signal ei5Pa serJ Ðor applicatio»!  Õ
¸ .·Àd (doesn't rò*aise exception, only prints to
    sys.stderr, because we* ñknow it isn't called when the objectE ó0is garbage collected).
"""
__all__ = ['validator']


import re

 4sys ówarnings

header_re = re.compile(r'^[a-zA-Z] ó0-9\-_]*$')
bad_9 _value?  ò[\000-\037]')

class WSGIW{ ( !):â  Ë  /RSñd in response to8 °-spec-relat&F s= ó	
def assert_(cond, *args` pif not  q  m rm ! A5 ’ionError(6 
P ñcheck_string_type(ï v, title[     ‡) is strf aeturn : ¯ w   • ñ"{0} must be of \ ñstr (got {1})".format(† c, repr} "))¹ 
€(applica 1):
f lWj  Áed between am´ server and ) I R, thi{ñmiddleware will 2B forG  OPliancò� a number× qlevels.‘ WThis J Adoes¯amodify¦request orain anyC ‚way, but† b+anÜ0 if1 ñ thing seems off@ (Æº �a failur{0clo„7he P iteriq, whichC  "be  ed¸ù0 --Ã 0re'Ö @ way ¤ z 1ionF âat that point)  ±  ä‚lint_app©c, **kwŠ ?Alen( ð == 2, "Two argumež Oaired")Y :  (÷ kw, "No keyword9 Yallow8 Penvirþestart_¸=6 ss ` _. ( )  P# We  ] "1  ´ ~rR‚s withou# b #DÝ	‹ Œ
£ _  ed=]‰  f Ì s_wrappet | x ¯	ŠE3, (r 8   1"In±ª�: %s" % Í6,))° : v ´ < rstatus §9[0]— Þ 1 :if Ö b Z   „exc_info` 2B Oelse5 
FNone“ R  ³Btus(½ 
! º ( # rcontentÒJ /, 0 Ì  %Ð_info)

       ñ start_response_ òed.append(None)
*  àreturn WriteWr' !r(5 D •(*args))
8 ð
environ['wsgi.input'] = I
 E % | 
 aerrorsE E E & ‹ óiterator = application(^ *, Ë "_wâ ‡ …assert_(H pis not )U and  •!= False, AH"Thez c must U%an? ÷	, if only an empty list"Ë dcheck_p ’ " W Iô %3 î ý #edB > ù lint_app

classµ:äðdef __init__(self, ê_ê%):  ÿ' =" E CreadA E< yAlen(`V == 1™Fv = ` .J D  C ötype(v) is bytesE ó v’ Oline– <– N š 8s› $ ˆ s5 Ã:" > ’=@for  1 in s½ ú	~ ( C �  s…_æ\Pzwhile 1h  < ×    (¦  ‹ !if´  
<   û   QyieldÔ ” Bclos‘ ä A0, "ý.' )ç )�be calledËRÂRÒr ó T ª w«%s; ­ sŽ6str*[ .D  ðQflushV S 3 ! 2 D  t²7seq< ?:seq™Y A (B V a   L Û  ˆ‰Õ‰Œ rs  ‚ ' \ÿ$ ‰ __úÇ/, Œ` 4(s)�{Partialâ¼ À wsgi_iteratcor):
  ôself.iterator = wsgi_ 
' Qdef _ 0__(0 ? õ# We want to make sure/ ¡ is calledJ  t ƒreturn Is qWrapperX ˆ ì, None)

class, :— 3nit— ,½ ÷, check_start_response¼  Ë ‘.originalà  µ   / 0 =  (/)å , ëclosed = False ›  / =² 	î 3terî É S u - 4nex- Àassert_(not 2 .§ ,   ì "ŸÂ read after ) "æ @v = e 
½   if type(v) q Vbytes} k � %&, z Áyielded non-8 ùtring (%r)" % (v,)k Í X0is }  T| ; 
 ¯ ò"The application }‘s and we n!ed at± òover its body, but% “2 ha¡ ƒyet been3j z ¥ ! =/Á’ & vº¦	P ¤6Tru£ if” 3att˜%1, 'T 'P ¤ . c&()‘ ^__delÉ!if©š 
°õsys.stderr.write(ô  }   ?ð	garbage collected withouc —À dd‰~ 
ÿ\  
<‡ƒenviron( 9u (  .Fdict ""E> @ment  ÏÁof the righthT: %r `  *   %)"$9% (g $, q š÷for key in ['REQUEST_METHOD', 'SERVER_NAME VPORT'ª  …  '€.version/  Uinput oerrors= pmultith‚3  oproces9 ¦run_once']?ià ú 
¸ 	f@miss(€required Q|0key~[	6ñHTTP_CONTENT_TYP*	 oLENGTH›  Ù$in™Ÿ Pshoulat have†key: %s ó Šð"(use %s instead)ñ+" % (key, key[5:]))

    if 'QUERY_STRING' not in environ:&  * �warnings.	 (   	B 4 isD „the WSGIM `ment;  Zcgi 'D ðmodule will use sys.argv when this variablec Œmissing,G ùso application errors are more likely',|  ¤ Wß 0for*	v.keys() : .'" 6key  ð# Extension, we don't c… éabout its type† vcontinu €assert_(* (�`[key]):strÆ ""E³ f&al- %s/  ×ða string: %r (value ))"ˆ *w ,É† ,§ �'wsgi.ver'² Vtuple´ "# Ñ should be a ) Q (%r)¸û T 1,))¸ € 
' Àurl_scheme']¥‘('http',  <s')‰ 1 € unknown � Y µcheck_input¨­  "']© ' ’(   ) Ó P# @@:)òse need filling outk%ifŒô'REQUEST_METHOD']¥@'GETû @HEAD 1POS qOPTIONS AATCH	 U `DELETE gTRACE'ú 
""U; ” J
 &']� @�ä Æ�ò.get('SCRIPT_NAME'f A   &or"& ù ].startswith('/	( P does·.  . - /È 1  ½ x « ŸPATH_INFO© $ § 	& ¥ / £ =EèCONTENT_LENGTHëÍ 'inÚ/ z]) >= 0Ãš"Invalid - A
  ¡ !ifÅëp'ç  ð; – wOne of ·E or : (¦required ( 
""­€at least¶0'/'MZ ¢is empty)"šM› |1 ‡') != '/ž" @ can  be$ D; it5ainstea=ð'', and "
        "PATHò_INFO should be '/'")

def check_input(wsgi ñ):
    for attr in ['read',  Hline s ¢__iter__']?  C °assert_(hasJ d ,[ !),j  +   "„ .� ñ (%r) doesn't have the5 ™ibute %s"< .% ^ 	æ berrors%  è PflushÐ Awritæ 	  ó sÛ X Ü ! Ý &? ` 	Þ rstatus( Ù  # =ç³string_type( A, "S8 !")LÂ# Implicitly5 ð that we can turn it into an Begerïm ‚_code =  ñ.split(None, 1)[0]g 3len‰ 7 f) == 3œ  S `s must¾óthree characters: %r" %r I f ƒ `_int =« 	k " ˆ * e>= 100| » is invalidm 2int96if Í ƒ) < 4 or“ ¢[3] != ' ') é�warnings.	 (�     C"The:  ².À!a B-dig� … ð"followed by a single space and ùÊ explanationB Rr, WSGIW± 	sƒheaders( uUg  CGlistÝH> Ý Ý0of 8  , l$% h ,#  "))‚ ­@item­v o	”  & )‘ Vtuple’ }³Individual F ¡ < 
¢  @ 0% (_ £       ‡  +  ñ2À     name, valuC " ÿ   É  2, "N  Ì Q K çN  8  9 ª  P .H1r()Å+'6 ³I6 /!no°Pused;6üconflicts with CGI´qscript,¡DHTTP0is M PgivenüCoughi sD (Ë  š ). cÙ A'\n'U !in5t )': å cQs may? €contain ; €or '\\n'}  {  =z W±_re.search(' c, "BadÕ ’ F   9 P.endsPQ('-')Æ  Àame.endswith‡('_'),
  õ"Names may not end in '-' or '_': %r" % name): ñif bad_header_value_re.search( %):.  o òassert_(0, "Bad ;  +  d   (bad char ))"= "% T ,v ó.group(0)))

def check_content_type(status,„ sª  # =2 jstring1 !"S: "	£code = intR ò.split(None, 1)[0]) ð# @@: need one more person to verify thisL ñerpretation of RFC 2616#Jð http://www.w3.org/Protocols/rfc.  ±-sec10.htmlA òNO_MESSAGE_BODY = (204, 304« 1forë,š ªsÏ '  A, "HG * · !if Ó.lower() == '–-–'a / ` •;in ¹ 
,  0 areturnå     s2("CS-TypeùB fouïú a %s response, } K  ±"which must/v  È `.") % · M!if * Ä 	© O"No « 
ŽP (%s)˜ 	í”exc_info(	 âh  @ is ­ ë ƒ0   Vtuple-"6 @(%r)!  ›!a '  ´ Ž B *, Q )0# MýK �(s?ª”iterator(	 ½ ò# Technically a byte¤ Œ rlegal, Ÿñis why it's a re2 1badñ# idea, because itý 5the œb  Ye=  ¢•acter-by- Z _ ¥isinstanceÈ r, (str,¹ )‡±"You should+rË3 a ß âas your applic­"s Fead A ñ ingle-item list©iainingBò2.")
"""Implements (a subset of) Sun XDR -- eXternal Data Represen°€.

See: ´P1014
U €

importÎ Ãuct
from io  BÇ"IO ”functools ñwraps

__all__ = ["Error", "Packe
 5Unp ¢Conversion)  ]

# excepR�s
class  $(E c5"""  )  šÑmodule. Use:
ïU � xdrlib.R v as varž# P has Z$  ¦  \ ež X ·Public ivaru0msg j2ainP rmessage7 """· ôð	__init__(self, msg):
     ð self.msg = msg
 Ðdef __repr__(  !):   preturn    ; ) 6 /st5 7str4 ñ	

class ConversionError( r `pass

Z uraise_c, !_e- ƒfunction0 Ñ""" Wrap any 3 ‘d struct.0 ls in as a. """
Å u@wraps(W  € Qesult¿ s, values  6try"  &G 	7 S  % iexcept  [ as eK  ù ² ñ(e.args[0]) from NoneY z r¯ 
dbPackerY 0""" Ñ various dataÐ`esentaN 'Åto a buffer. 
n__init )‚.reset()M .    0  ø.__buf = BytesIO5 0get "fe0: ß A A.get�(†ñ
# backwards compatibilityY 3 = 
 2fer¬ @.a6  È „pack_uinx• Ž cwrite(s 4 “('>L', x)h g "lg  { �_enum =  2inté Í Cbool™Í mif x: Ó Ab'\0 "1'iÂ?lse, 	#0'ö u CuhypÖ ’ K C‚ » v³x>>32 & 0xf ‡ IQ(Type>,U)V/¢ ž b¡'ZïhòsOfloaÜ fui odoubley ñ.Fdj PsfstringO Gn, s˜†if n < 0f Èé  VÃ-#('E ÷
 size must be nonnegativeò-q= s[:n]{ R õn = ((n+3)//4)*4 .  °+ (n - len( P)) * U'. ( Äâtfopaqueä· ! 	 ¦ àlen(s)
       ó self.pack_uint(n)
   áfstring(n, s)
! 2 ‘opaque =  %  [bytes  2def2 Plist(g  ,  , aitem):*  Š @for  1 in&     > ¿ 1¿   ˜  = (  6 0Õ ™ cfarray› nž 	pif len(¿ j) != nŸ ñ	raise ValueError('wrong ` f size'– ê Ì !² Q ±  � L6n =¯ A  &a  À



class Un¤ "er2""" ò)s various data representations from the given buffer."""i â ƒ__init__à  G !¿  S !t( 8     ,| 5 q__buf = 
@__po¼0M 0get i¶ ‰ N breturnL; 7 s7 Q, posF A  ¤ .:  1  E  | z 6buf5 Ldone/ 'if¥ ! <| 7buf‘  ½¸±unextracted0— remains'<uI V P 7i =z muj = i+4  Î7 …buf[i:j] { & R) < 4w ¹   ½ !OFÀ 5 ªbtruct.± S('>L'"6[0]B _Ï ›lÏ Ë senum =  =intí Lbool65 8)  \hyperE h~ pþ$loì  …  �Íhi)<<32 | loÁ } x\ & ~ Êif x >= 0x80 
W I zx - 0x1' ,00dx› BfloañjÀaise EOFErro3r
  ñreturn struct.unpack('>f', data)[0]
- Bdef  á_double(self):  M @i =  e.__pos  ¥ = j = i+8  c 7 …buf[i:j] pif len(& V) < 8m  q ßraise EOFErroÒ dÒ 	qfstringÓ 8, nÖ f n < 0{ QValue} #('B ö size must be nonnegative')Ö ò )Ö + (n+3)//4*42 Qf j >O(bu{0 0posR ÷belf.__y3i+nìè”fopaque =ùå >;nè O Vuint(ƒ " ` 2(n)c  ‡ o Ì " @byteá  ! " ¸Clistã) Gitem²  ! F = [‚zwhile 1þxÙ  Žñif x == 0: break‹      ,!=W   Ô£Conversion^ö0 or 1 expected, got %r' % (x,)U D  Õ ´  v !  ç €.append( ? ” ! ‚>cfarray@$n,A   ; 
Cø for i in range(]� –(Õ – 	• ? Õ‡ U ä ð
"""Core XML support Ý àPython.

This Aóage contains four sub- ñs:

dom -- The W3C Document Object Model.  Q k ô s DOM Level 1 +QðNamespaces.

parsers[ • 0 wrèr† r¹ # ô (currently onlyÑ às Expat).

saxI  ¤ ¡Simple APIñ `XML, dŠ poped byZ r-Dev, l TDavid£ àMegginson and 7ced to £ ôby Lars Marius Garshoþ D �the SAX 2Ž „.

etree¨ 0EleGT  ¦tlibraryJ@is aŠpset of K Dfulld > �release.
ú 


__all__Þƒ"dom", "N  0sax � B"]
#½!isg ë qmappingEðinterface NodeFilter from
#êP2-Tra@al-R9F. ItU´€constantûWclassK ’1"""Þ ðThis is the DOM2ð NodeFilter interface. It contains only ñ stants.
    """ øFILTER_ACCEPT = 1 PREJEC 2 ±SKIP   = 3
 €SHOW_ALLW  S= 0xF - ELEMENT- 0 ‡ Z ŠTTRIBUTE/  Z , 0ž - =TEXW ¬ #0x- 4‡ ÖCDATA_SECTION^ Z 8- ô ENTITY_REFERENCŽ - ,10- S 
 - 2- òPROCESSING_INSTRU� - 4- ?COM;8- ODOCU.  Z /10-  D_TYPÞ ;2- FFRAGc Z 4- JNOTAc- 2800J def acceptÕÑ(self, node):\ 7 ðraise NotImplementedError
"""W3C Docu ô  Object Model i. óation for Python.

The ÿ  mapping of theL 3s de Ped in+ 
N ó Library Reference  A secz o/ ñ xml.dom package† $is  ®¼ † `follow— àmodules:

mini@ a-- A sÞ ä Ä õLevel 1 DOM with namespaceTó	   support added (based ¬ B ¡2 specificC¸) and otherH dminor 2 1funö Ãality.

pull¶  � tbuilder}  â `on-dem[ Qtree-"    ±ˆselectedp 0sub) s²™ .
�


class%DA"""C 0givY  a n@Typew% â__slots__ = ()§#Lt iðs may use this as a E €  ¿ ‘their ownÀ #” ´`s.  IfP€y don't, — Â defined her¿ð# should still be„ d€  Ù ’canonical9 i‚� £they match�  . Ävalues given· R‘recommendê €.  ClienaTde caÐ €safely rú0 toº 3se U ±in all test¬ s.Û4TypÊ + .e$G_NODŽ  { A&  "=    I  Ã 	 		- "= 2 ' 1= 5G$ ³ A = 6$ îN 1= 7$ å  ¡  ð= 8
    DOCUMENTj_NODE  @= 9
 ÛDOCUMENT_TYPE) J= 10% AFRAG. R A= 11% ‹NOTATIONE  e ñ = 12


#ExceptionCode
INDEX_SIZE_ERR)  ß= 1
DOMSTRING' ú= 2
HIERARCHY_REQUESTM ¥= 3
WRONG_ë m ü= 4
INVALID_CHARACTERF ú5
NO_DATA_ALLOWED! P  = 6# rMODIFIC+ Í= 7
NOT_FOUN@ û 1= 8# ~SUPPORTg  i ý9
INUSE_ATTRIBUT@ºÓ >STA"  G œ11
SYNTAXË ‹  $ 2	Ú DÝ= 13
NAMESPACŠ K 6= 1cmACCESSt Q= 15
…<b D   õ= 16


class DOMP(
 !):Žò"""Abstract base 4 0for8 $ e‰!s./ ? ò
s with specific codes are PalizaÁ’s of thisY Q."""
J ódef __init__(self, *args, **kwž  Ì 0if  1.__› J__ iÔ É  +   ñraise RuntimeError(p    "õ should not be instantiated directly")D .¾ ã @get_ä × breturnÛ    ¯€IndexSiz½ (© =  - : = ì�omstringA 3E ÿHierarchyRequestErr‰ XK ÏWrongDocumenH }E  InvalidCha§/er� Ï	¢K ßNoDataAllowedH Ç F 0Mod÷ãN 	òV _tFoun— ; SupportÖ )T_4C ßInuseAttribut|VG ¬?StaE Å_wC oSyntax��6 %™C (ÀD_MODIFICATI÷0ON_ERR

class NamespaceErr(DOMException):
    code = NAMESPACE_< ßInvalidAccess@ èINVALID_ACCESS� VC ar B @ :ATI¿ ò UserDataHandler´ A"""CÝ ñ giving the operf û  constants for A !.hI q()."""
ò# Based on DOM Level 3 (WD 9 April 2002). ñNODE_CLONED   = 1D  ÆIMPORTED = 2 @DELE F = 3  RErDB p4

XML_ ‚ô = "http://www.w3.org/XML/1998/nÑ"7 /NS9 ÿ2000/xmlns/"
XHTk ù1999/xhtml"
EMPTYc CNone `PREFIX>  ñ
from .domreg import getDOMImplement¢­, register Q
"""R Í’facilitieÎñ'DOM. This module should not be used
directly. Instead,!@func†s” _ and
— g #beØ 1ed î 0xmlñ M#š ðis a list of well-known: Vs.  W Ö'
#i ñpublished by postêðo xml-sig@python,½ @ are@ ð
ubsequently recorded in t5sfile.

œPsys

¡ _¡ )_i¦Qs = {±´'minidom':'ð  ,! u4DOM':  Ø') A}

#ek  À�official¹  $ed› 
#ÍÀmselves with 5ir
½ ed¹ o}

defi(q“, factory4"""h Â 1 « er„ L  iž  l  ·e$ ?Äöreturn an object which7sf ™ C Ÿinterfaceg Ã can either g  4Csamem  öor a new one (e.g. if that‡ Ã@ supàas someƒ �customiz  _R0ed[4] =£ô_good_enough(dom, features–" R -> R81« ²e dom offer1N "¦  0f,v T !ifI‚dom.hasF‡ C(f,vŠ  $   C0R  1Î ð;=8Ü 3=()U ?"""5 [7 ` = ())ö  «FÀtion.

    RóBeturn a suitable DOM implementation. The name is either
    well-known, the modul* Oof aL  Ñ, or None. IfE  itV 1not ,| AortsQ Ôcorresponding_ Qand r· sA IDOMI° ¡ object ifE ñimport succeeds.
6 %IfÒ  | ñ given, consider9 Qavail
As toD Ñfind one with3 ðrequired feature setê 0 noÙ UA canE ñbe found, raise an I² RError|N às list must beµqequenceI Cof () ò, version) pairs which are passed to hasF¦ B.""",oZ‘creator =›e Qmod =ù_ù_P.get(+)/  if¶:  2? _6 Òort__(mod, {} ]['getÏ"']L  @ ø T  i + (* 2eliÞy 9 °registered[¥ ]1 ðot sys.flags.ignore_environ yó"PYTHON_DOM" in os.# l Ì ' =7 [R "])‡°# User did �‘specify a³[, tryNsŒ ‘arbitraryoƒ# order,, A1the¯@thatÿ³ûÔif isinstanceWvs, str)ê o³s = _parse_ u_string9 ˜Dfor T6in �‡.values([ Tdom =. § ôif _good_enough(dom,ns@  , õ2domW€  ¿Æ9keyŽ 6tryö  [ Ÿ ã	é ú  3 �except E øion: # typicallyô$‘AttributeÒ E   rcontinuö  )urO("no	®")

def÷‰  ![]Ä  paÜ“= s.splitÙQi = 0  Ñlength = len(- A�while i < 6gthŽd 1 = / "[ii  0[0]"Æ"0123456789"B  + V‡qF("baÆ ,v: %r" %d)š  >  À Qi + 1Ä   €;   WÄ    vÂ   Oif vÀ ) : = †     Ž ðv
        featureôs.append((feature, version))
    return tuple$ ðs)
"""Facility to use the Expat parser ñ0load a minidom instance
from a string or file.

This avoids allT ð	overhead of SAX and pullQ ð to gain perform\ .œ ñ

# Warning!
#
# Y ðmodule is tightly bound©  ½ ðimplementation detailsw Uthe
#Æ 1DOM… €can't beþ Ðd with other ! 
M 1s. ƒ  
#~ Pdue, ¶ @art,~ `a lackj ðappropriate methods*  Ÿ  V (`  Â �
# no wa~0cre0 0Ent�  #NoÅ ‘nodes viaK C pLevel 2Š ¡nterface),Ð 9forI ³ €e latter·  …  caëñof some fairly
# cryptic code.qP’q hacks: ð!  -  .character_data_handler() has an extra caseý ðwhich continuing
#™   <  ˜ ÂeÈ= 0istWPText 0; tX0can®a@ ñspeedup since pye½& …reak up © m °nto multiplˆ Pcallbâ ñ even though we setv€buffer_t� °attribute o+ E 3&á also gives usD €advantagg at^  do~Vneed Ò @eparn2lizÊBpass–PDeter“‘ng that a&p existsR0donÖ Eban ideZ¤comparisonCõN.  ra› P ãn a truth test|Ô`searchX  m4andI  E  5anyø"œ Ãobject if it© b.  (A x G Tnice Ø KPchiev  /¢as well!)
…@xml.Jôimport xmlbuilder,ðS, Nod³. òEMPTY_NAMESPACE,  ÖPREFIX, XMLNS q î#s u ey @dom.Ÿ— _äÕ_child, _set_K_ä
?  ² 1Fil¹Ù  Ñ

TEXT_NODE =Ü . é
CDATA_SECTION$  Š
DOCUMENL 	 ÷

FILTER_ACCEPT =aR.DOMBl« ., : _REJEC: , : OSKIPr  * 6 INTERRU­ / š

theDOMIF=GM.get  ()ª6ðtypename -> TypeInfo
_ Áinfo_map = {•"� ":€*.3 (�@, "c2"),1 BENUM0 à minidom.TypeIù(nfo(None, "enumeration"),
    "ENTITY":   minidom.TypeI7 Jtity2 _IES":2 5ies4 !IDb  r f 'id. 2REF1 . :ref1  ‘ Å Vidref‘ pNMTOKENe c fnmtoke*3  g 3 g ñ}

class ElementV�object):€ð__slots__ = '_attr_info', '_model
 ‘tagName'
3 ódef __init__(self, ! !, 3 =ï`  r $ .# $ =- L  { [ = [] W " =_ † ƒgetstateŠ u qreturn | ] , Q  š W sW !, e ^ W " == _ ÀgetAttributeëDWanamec @for ‹- iÆ » <  !if( q[1] == G 
!  % 2t =& &-2]    aif t[0? >"("=  $ PP_type— ¾_map["ENUM"Q OelseG  P F[-2]I n è1_noy E#NSG Fð spaceURI, local¼Y\ #is/qContentZ A (ifF
è   óBelf.A&[0× I) 0notßq(expat.•â.XML_CTYPE_ANY% 7  ; eMIXED)F�VFalseVisEmptyñ I Â J™ _EMPTY˜  !Id• ,à�';Î ‘ QE"ID"±   7%Id�peuri, eˆ1, a ”´  # ùüsure this is meaningfull ZhisId((N 1)

‰óintern(builder, sh ª  "._( Ð_setdefault(s- F �parse_ns_· M   P  assert ' '²  © €parts =  ð.split(' ')
    internñ& = builder._intern_setdefault
    if len(parts) == 3:   ñ
uri, localname, prefix = . '  b ( / )( qF Õ = "%s:%s" % + e . U = !,  % 8 3 = )  » 1 -elí 2í å ÍEMPTY_PREFIXÛ } � &se€ õ*raise ValueError("Unsupported syntax: spaces in URIs not % @: %rV gò dreturnÏGuri)¦Zò 


class ExpatB;¤ ´"""DocumentT“ that use0 2 to ó a ParsedXML.DOM d: 1Ñinstance."""
 òdef __init__(self, options=None)‚  “$if @ is      7 d = xmlûOL ( '  d &._- 
 �    9if # p.filtert  sx . & 1= F/ ñVisibilityControllerß { X ™ (el ‹ Z  { §    ð# This *really* doesn't do anything/t% ‹case, soA òoverride it with some: ù fast & minimal.9 š ánish_start_ele!E= id, ( p1r =µ
 vreset()acreateC1A"""C ` a newŒ¡ser objectS   þeË.M : k 2get ™
h R?:thef !, ¡  Z„ 0oneIineeded„ "if¤Relf._
± ^ ÿ  Ô   Ë# =°c ..ì A   E + õbuffer_text = True�, ÿordered_attributes3 specifi5 !ll‹/ Ð¾ 3D  
Äð	Free all data structures·Pd durÆ £2con 9ionÃ T .ÁÂ = theDOMImpìa¨.³!(C2¡NAMESPACE, Ý f tcurNodeÎu N % e\_info( . À_info
      ð  self._cdata = False

    def install(% ¡, parser):  # B"""I" ñ the callbacks needed to build �DOM into K E."""M õ# This creates circular references!, ? ò
StartDoctypeDeclHandler =Ö s "_d  r_decl_h" I {ElementE rfirst_e @ ?End> ?end<  ProcessingL{ruction… -piz "ifå 0_op1 ¦s.entitiesŸ £*E y$ 6 y
@Notac >  n @ £ 0comb£ C ú 3 ÿ Â1_se?b /CêS' l 0	I x 	TdM  úK ÛCharacterData– c _º ‘ ²ÈOelseùZ T ;rxternalC;Ref  e  _K4ref¥ K ?XmlE ?xml@� |:  –Û	Attlist>  a 
| ³  û} CFileýJfileûPp a docu×€ from a * ñ object, returning÷+ f  KInodew Â1getf 5r()3 ‘AbuffêETrue :tryzwhile 1  y @  ® Ö.read(16*1024j  (   rif not 3 K  # Ubreak‡     Í .Ã (? ,ce 	Ú 2andá4.	 j‰  ªã._setup_subsety r 	o û ·  
¿ @"", mI qexcept ß ]Escapƒ%ss4doc˜É  µ  re­ ^  _„ f = NonèV z¬* cString³s µÀse a documenó#t from a string, returning the document node."""
  ñparser = self.getP %()" Etry:  6 3 .) (p FTrue4  ' Q Ó_setup_subset- ' qexcept J lEscapej %ss{ 4doc§ Ï  l  red ^  _® u = None1  
 Kdef ¬ Æelf, buffer)— q"""LoadV’internal ß 0 if êre might be onn"ifhÁ l.docty÷ €extracto—Id SBE   l2 .ï S(½ á  &   « &= 3 2get^ U @ª .õ 3  ’š Gcstart_Ù à_decl_handler(R ,u ô ù
Name, systemId, publicId,°  ´   Dhas_Š ^¥}  �  ÖÄ PimpleÓation.createDYType(| G © Ÿ ³ j) d.ownerP ~ [ Ñ_append_child  \  4   	  <$ =FV [²_filter andl 0.acmSNode(° ö) == FILTER_REJECTè t{ 	J ) 2dell jÜ  l Us[-1]¥ - ó’  q ²Â.EntityDeclH?2 1NotÙ4 ?if ; 
÷ $if]q is not;
$  ® F .e© Êies._seq = [ð + n¢ , 	0Com¬þ ðProcessingInstrucä= BEndD˜
=‘  ­í 	Ðô" Þ™¥ opž 2s.cä s^v  9 [b ; , -piD !ifö½ â._elem_info oræRØ  äN €_finish_ 9  tF= id+p ` ç, target, dataS  ªC²× ÀingInstructióon(target, data)
  ö_append_child(self.curNode, node* 1if  ¹_filter and p.accept; (: õ == FILTER_REJECT:v  } M l �.removeC… = 
, àdef character_º  _handler_c ± Ó ^ Ì  ˆ 2s =£ g  _  ‡ × Q E  "( B p •_continue?  '   ` P[-1].Ê @Type
úCDATA_SECTION_NODE)m  F @ œPData(î Œ ,   ireturn�  t ÷ ñ document.createƒ SectionQ  ‘è W = Trï 0eli’2ild`õ ATEXTì 
ë ¤ 
î 	Æ qvalue =ƒ.ü ! +¹	%  G  != 1 	 Oelse† Úminidom.Text(ca  … 	`  cownerDgw/ e+ îè3p½ ­¸& +¼ž 8 ? = Œ  é  �>´entity_decl{� ð Name, is_parame§ ,“,Ú ¬ ðbase, systemId, public
 @nota¨ ` )/ifl 
Øõ# we don't care about      ù ies for the DOM¦ œcif not op– $s.E 
{ :  “"._�_B "y(  ç ÿ 	� 9 ?	5D "if‹1 isÉ ;Non
¢# internaly<  h #†ù *should* be readonly, but we'll cheat9 a ÿ  n C(¹w =  " "s.( * ¯âudoctype˜ð ._seq.append(noSde)
  ùif self._filter and õ.acceptNode(node) == FILTER_REJECT:L  S 2del@ ñdocument.doctype.entities._seq[-1]
9 ðdef notation_decl_handler(˜ , öName, base, systemId, publicId)†  ¦ + =… „_create_j (	 W G [ " ‡  Å 
Î @ Ï r.append"×  \)_ACCEP\
Ž 
]0comˆWOdata54C@ (2 Ü _ò a_child«@.cur' ³bI�l �.removeC…  ù)Upstart_c· A_sec`[þ S + u = Trueè  ö_continue = Falsel 2end? j F  +  k �xternal_P[y_refÛ § ?ext-†return 1Ë Ÿfirst_ele5 n„§attributesCìqis NoneP2not�W V_info¯ú pfinish_L Z = id‹ÐgetParser().SâEª H5ùýG  
J # (ã 1  ¶-, 7 á  —— [¼ u q[ | w0 = j ¯  U6if ª�   öfor i in range(0, len(. G), 2Ü 3   ÷a = minidom.Attr2 õ[i], EMPTY_NAMESPACE,p =   #8 fPREFIX1 1valsŸ ][i+1]] $a.*     cownerD˜“0 U_set_u _]à3, af ¢ i¾Pde isªçæ	 è
…½_õ	\g d  %  @ lY ‡ À    # To be ÷$general, we'd have to call isSameNode(), but this
  ù# is sufficient for minidom:) qif node/ Åelf.document	 0Ele 
6  j ireturnM €filt = sI _ ðer.startContainer(m )5 0if + þ == FILTER_REJECTr �# ignoreï ·  & ªdescendent § �Rejecter(– 
z .el| OSKIPz xù
make it's children becomeâ  ‡ #"  of the parš . _Skipp´ .se  Œ  ï @.cur'! =..s   	r  ƒ  €.removeCÒ ° . ‘unlink()
I 0# IÔ òis ever changes, Namespaces.end_eKó_handler() needs toF #be< dìbmatch.  Odef H  ë v, name)û   
H  � 3 = . 
* ‡_finish_ (4  � &  i ,`   Einfo, _ D.getY @.tagBµ0if % å Ê TÀ_white_text_¨sL ,9 	J  ™ .¦
R $if° 3*if`accept‡Ÿ )þ° t	£ Ý     .­©ƒ/ e ,-21if D¡._options.mà5_inÞucontent@ Š aor not„3.isS Went() - ÍA B# We ' 4AtypeM 0rma‹ Â and should ½*6ablŠ&# ° 0; i.1ify 0õ s$ 0ch Ä ‡ain onlyˆ A — ® eL = []%  i1 inS .  ísL 9  f c.©TÒ Á== TEXT_NODEÓ  4? Ë.data.strip(. K ‘L.append(- ‘  1# RÌ á t•Q from‹FtreeÒ 	Ã Lµ  ¬ 
} Ã r  Z£S_decl•{¡w, modelÄ  ÑÀ_elem_info.g£et(name)
  õif info is None:    °self._elem_% [; ñ ] = ElementInfoO v, modelV ;elsK aassertl !._. s 	r  g   =V 
! ð
def attlist_decl_handler(¤  , ¤  ,   ö, type, default, required)Ü  f 0 = ; ß P.get(I È 
F 
> C "  C = Ù  %   a._attrh….append(   $ [Ÿã   é 0û ò &])<?xml8÷version, encoding, standalone2+@docuø.6 3 = 
 ª 
( U % =` * `# Thisö#still a little ugly, thanks to the pyexpat API. ;-'if° V >= 0æ 6	  
   
¯ ú u = True­  , Ô  B àFalse


# Don'üðclude FILTER_INTERRUPT, sinceó ó"t's checked separately
# where allowed.
_ALLOWED_L ³RETURNS = ( @ACCE[  tREJECT,| ðSKIP)

class FilterVisibilityControl]cobjectP"""Wr›òr around a DOMBuilderF ¢ which imp#s¿Ó sN`to makí áe whatToShow f„  âò ribute work."""ÂÒ__slots__ = ', "',  ƒ__init__! ¶ ¥ # =l > Pstartõ 5ainQ8nod Emask2   e_ [ . QType]å  t  z ?w .ì  & 8 
�4val_ 1 –  a ˜a 6 =ÕQ
[  , úraise ParseEscapÚ0if J  no¤ \U ¦ValueError– s  "Ë ð) returned illegal úue: " + repr(val)î 3  ) b‘% ôè£acceptNode(TØ  –…_ äN’  p 
ò –=à.À if val == FÛILTER_SKIP:
  ñ# move all child nodes to the parent, and re* Athis% K - ! = . MNode) 3form "in- {  , Ns[:]¥  ´ P €.appendC« (6 )_ #T á is handled byÎ mcaller0 ‚return F'iREJECT% õif val not in _ALLOWED_1 ^TURNS¶ ùraise ValueError(U  Ô  p"acceptÿ 2() Ž  ed illegal{ úue: " + repr(val)õ 3  ) b Jelse’ % µ qACCEPT
0 _óÑtype_mask = {  �  ” à.ELEMENT_NODE:   " ÃFilter.SHOW_- ,C ŸATTRIBUTEE C - E ?TEX… <   E  - @ ÜCDATA_SECTION‰ @ 	- I ú ENTITY_REFERENCÕ I - L \Õ L B øPROCESSING_INSTRUà Ž - R ?COMñ- C ODOCUD • - D :TYPdð D _- I LFRAG– � _- M ONOTAAM - D ¢}


class 6âCrutch(object)³ñ__slots__ = '_builder', '_level
 •old_start Bend'Ñódef __init__(self, E a  ¬   .Q E = 0° 0 $ =:   fparser "._ ! A     =Fs  ¯ �ElementHšŒ5 6end3 ?End1 u ..ST 1 = N "_ep _q @ a > =end< ¹ Re¬8er(ÂZ»/()�L .½c½ „àfor name in ("ÿProcessingInstructionHandler",
  �"Comment' ÏharacterData- ÏStartCdataSe… ?End/ ÿxternalEntityRef‘ )):ý ñsetattr(parser, name, None)
) Pdef sÄ @_ele"_hFÇ(self, *argsU   ¨._level =  6+ 1S ?endQ )ifF J== 0Ã ó# restore the old ¢ sÁ êâ ” ’builder._ 	+ ¶ " sinstall#)* = .åE €i Aold_A9 ?End7 5end5 Jelseø ¦ j-jóclass Skipper(FilterCrutch®ß__slots__ = (î$Enodeê 1ucurNode» © (3 á@ € is not d ú dGñ
We're popping back out ofv ¤ ! w# sr–ing, so w ˆñ# shouldn't need to do anythW  utÍ!etU Ç.+ D N,¿‚ H ‘Œ ! =8­ ² Q  �  34end1ð

# framework docu�� used by3Afrag  à
# Takes a strd1for+ ó doctype, subset Q, and`space s ñ.

_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID = \ð	"http://xml.python.org/eªDies/­ -­ 2/inÌ"i €TEMPLATE®_ ð'''\
<!DOCTYPE wraêð
  %%s [
  <!ENTITY5i -i H ¹ ó  "%s">
%%s
]>
<N  L <
>&ª A 3;</* A>'''O /% %B)


¢F³B‘c(Expat ª3""" “ which coÕsàfragments giveñn XML source
    text and a con anode.
 9The ò is expected to provide information about th` ñnamespace declar$  s which ar; � scope a5 • start ofB ‘fragment.’ 2"""› ôdef __init__(self,ª @, opŠ �s=None):8  ì $if# .ä öType == DOCUMENT_NODE.  2  X Ð.originalDocu‰ $ =G Z , D# Oelse] d.owneru k ÛExpatBuilder.$)EQresetB+	C " ‡ ›0 = kT ‘parseFileX X, fil‰@"""P" D a dUL afrom a3 õ object, returning r3  Î.    0  ¥ Œ pString(ˆ w.read()"  3 1, s/ ² 5 ­  s "._”# =| i� r qelf.get:5r()" AdoctËð ¯.  0 ¦ident = "" f‰ F £@ubse, D ¢.internalS "ort W_getDàž  �i_ š.publicIdh % — Ñ('PUBLIC "%s" '¨  ( 	 4% (› Z ,Ë ¦.systemId), = 'el� $ � r'SYSTEMŠ - %^ � â &	ktnsattrsÑ :!NS ±() # get ns-!s  ÝÅ's ancestorsp ;q= _FRAGÄñBUILDER_TEMPLATE % (ñ1, sŽ #, ‚ :tryÿ t.j `÷f, True6 jexcept9 Ë/)  tBrais  ¹=? Û 	H  ##4   _Ÿ u #  $ L M &� F 
Ü�Re-create` å2‡Dthe �: ˜' ƒ @Thisðonly needed if we don't alxQy havf Ÿ  9 n SCas aò $ ÜðAr
.	ôÀ    s = ""
   Âif doctype:
  ó for i in range($ ú.notations.length)6  < # $ =Z 6 yitem(i)k  5 Nif sK   ís = s + "\n  "9   ô	"%s<!NOTATION %s" % (s, Š Ÿ.nodeNamex & �publicIdˆ á'%s PUBLIC "%s’  £    M>' \¤   – p © ŽsystemId© ;els¢V   ™ aSYSTEM™ ,>'l Y åentitieä" yâ  3 áGgENTITYßt yÝ$ kÛ)Úm #,  } ÀLelif& ¤ æåf < »O þ firstChild.data’º B c¾ O"%s ¥ ¾ D l  ä>‘return s
p÷def _getNSattrs(self�- &"". ’external_‚ Á_ref_handler> ô, context, base, Ç$, Oa  Á½ò == _FRAGMENT_BUILDER_INTERNAL_Â:_ID+`# thisñref is the one that we made to put qsubtreeþ  L  ð
# in; all of our given in5 �is parsed×Yhere.< Àold_documenttDelf. ) @cur_V) jcurNod� m r" _ #.EwEe yP‘ ƒrCreate(p
ÿ#ñ @realS¢ Rback,Ñ Q intoAfragÀ 2to ó	º  Ô ™ “originalDü 2 V )= B !.c¸ 9 F} (Á 3  t R 	l :try Ò6(—Û._source, TruÒfÈ lF  „ ÀrNode = old_«cur_node
  ôself.document = old_ - Ú_source = NonQ •return -1: Uelse:  | $ ùExpatBuilder.external_entity_ref_handler(=  A  ² ò(, context, base, systemId, publicId)


class NamespacesŠ ¢"""Mix-in   Rfor bŠ ðs; adds support  n? Q."""
� –def _init\ (˜ )b  § ö# list of (prefix, uri) ns declarations.   – attrs arV#é ðstructed from this andª Ðed to the eleÂ"'sE .§  ˆ  — Ò._ns_ordered_Ž ves = []Ï ÌcreateParserÌ A"""C u a new -¦Qing p9 " v    @ = eì.[ H (B @_sepuor=" ")· = .( · 6Tru"P0 Ï qinstallÊ ,ž ž‘"""Insert=f Ð cers onYY 	Ù 	¼i Ç 2if �"opïk _79V.StaraRDeclH? =  .s3 _d J)' 	2´ž r"""Push„g Ñù  on our storage8
‹ ‰.append(*° ãÐ ©  † ,õgibuteså‘if ' ' in±Æ  d¢uri, localA _0, q A = _ø 8  l £Üõuri = EMPTY_NAMESPACE w _  U 	 ‹ X� [ ePREFIX?  ØÂ = minidom.E
(k u", A ñ Æ  > v.ownerDª_§a_child .curNode, G U @  ! = ~ 
 
¥ »  \#inN: h = 
U     a4€Attr(_in‡Ù Ã, 'xmlns:' +>%),r ?  VXMLNSÿ}"R äC I ¤ D ,, f œ  À              ò"xmlns", EMPTY_PREFIX)
  ßa.value = uri  óownerDocument = self.d 0 ð_set_attribute_node( :, a{ 2delK õ	_ns_ordered_prefixes[:]
[ 5if Q %s:  Â  Z †._ensurev *s(k  Bs = /  M sG ! *NS# )NS% ðfor i in range(0, len(M ë js), 2)Ÿ  £ @anam]) 9[i]Y  & ƒ& .+1( `if ' '† X o  M  uri, local| ", V0, q � = _parsex  (Ñ!, P 
8 L   ña = minidom.Attr(I ,0h  D c[: ]] = a j & JNS[(Ä )3 Oelse³ ß ¯NAMESPACE,†  Š 	 	= H 2 À [0 ³ &  æ š� †; /a.‹Ù^ë P 3EleÚ wÆif __debug__aõ# This only adds some asserts to the originalo r# end_ef ò_handler(), so weN €define t_ çwhen -O is notG ðused.  If changing one, be   � Rcheck‡ @ther gsee ifG qit need± "beL ¶ed as well.* 
 ?defÄ 9 Dø`curNodö # . P  É @ d    
 Ä K ¡# (‡ .& ¯spaceURI =÷ ƒ   Dand 8 RNÎ=_	Ö  3  ; ‚ m 
 O), \9 ",õ stack messed up! (» ))"? 	ù À  ß¿  I „ ƒ a - badH J 
…  ù s 8amekð‚ Y † À         selÃf.curNode = 
 p.parent '
  ó
self._finish_end_element(8 ù)


class ExpatBuilderNS(Namespaces, !):` p"""DocuK " b5 õ that supports nA Q."""
6  def reset(˜ K  ® } ." 6  !  0 f._init™ (½ @FragŒ À  x 4""" Ã 1L ƒ Æ  â  ¼_getNSattrs"ö"""Return string ofc 3 óibutes from this ëE andH‘ancestors• x   p# XXX T5 ðneeds to be re-written •walk the D  „ 5the] �# context/ 1 up3 Á information« = adeclar $s,¾  s,À 	á tound inm .C ðOtherwise we haveŠ  ð ñe a bunch more data onœ 7DOMB r(thoughÍp*might*7 öreliable -- not clear)�  ‡es = ""R != Ã  eL = [] TwhileÙ j    `if hasb (E ó, '_ns_prefix_uri'Ú /  Bfor " X, uri8
= .items(C   K ð# add every new NS ¯Ã° U to L®s©Ü  G  #if•  � Lé $    ê 6inuc   ’L.append(à )j e  É  ¡ ¹“xmlns:" +  T OelseO º   !ifÕsI  ìN@%s\n3 Á%s='%s'" % ( ,… ¼ Ý® H  ú  ^ W   “ ã=÷{r«] bðParseEscape(Excepp5""" p raisedOðshort-circuit parsûõin InternalSubsetExtractorÖDpassÚ, (u‡ ñXML processor which can rip out3i~ $ datype s� „ 8 v = None2get· ä ge G Àt as a strinsg."""
  ñreturn self.subset
 àdef parseFile( �, file):  > 6try   ßExpatBuilder.= < €except Pb jEscapeK Kpass‰ cString‹ s � A ‘ $sinstall� ë r�  ó.StartDoctypeDeclHandler =o  "_d  r_decl_h" – I ElementE e @ A  Ãsd ¼ ñ
name, publicId, systemId,C  Ö Òhas_internal_>?if !  è&rs1get9r()  žY = [] $mDefaulÓ.append7 ?End¢?end ;els¹XraiseØ&()ÈP Œ:±s = ''.join ü ù).replace('\r\n', '\n'  ë 
;s ¨ 
6UŠ ", 1Wattrs² O 
‚Ÿ(;< ¤spaces=TruL1"""öp a docuå", ˜àing the result D" b node.['^ ñ' may be either a¯¯ ² or an open qobject.!if, sŸ ¥bÏ8 = Þ#NS¢
- Qif is:3nce(st8Awith§  ¶'rb') as fp’  �r3 = r n"fp<
š 1 	 Ör, &

¿:uÇ‚ from a ®Õ} Ù æ ›R i ù 	M	ô )@Frag¥¥contextf9 9 ofìQgivenèL 8�which itôwas originally extracted.  5 `should 3`parentk ð the
    node(s)ð) which are in the fragment.

    'file' may be either a  ò name or an open qobject.= 1""" !if, qspaces:  \ ³builder = Fu B ±NS(context)- Oelse7 5 6 àif isinstance(² f, str)J Awith»  ¶'rb') as fp%  ª “result = ³ ß.parseFile(fp¤ 1 	2ile3 rreturn , r


def Y �String(s #, ,MS=TrueÒ @"""P—  ŸA   of a docuÓp from a’ing, giveõZ 7% ôit was originally extracted. � p should1theC `parent}  Rnode(s)k	 d-f } ‹	ß	~) Cmake¦†(options„Create a'� based on#O.  !ï H .Ps$™ SExpatx %NSz n
1  /  #ñ.ython version compatibility support for minidom.

This moduleõðains internal imple_aÓ details and
0not im\ Àed; use xml._ g  ©Pead.
8
# u H 1onl†I ‚ using " a *".
#: €e follow Uá�defined:%    NodeListÿö  -- lightest possible# 
ä A UEmptyF A òthat is guaranteed to
#| 
 €remain e^ � (immutab3 Ü "  –aTypes · Ptuplelà ß  t# « ²defproperty5 Afunc¯u¡i$nj ßGetattrMagic;ª ¡these togeqis needá  . Vom workF àas efficiently~€’in both P´O2.2+D And oLØ°s.  For exaŸô
j �class MyC (ø /):o 9  ±p_get_my,_(self4  < ¤“something¦   »(¤ 2, "q /",  M "q à value")
#
#    ý"For Python 2.2 and newer, this will construct a
#B ÿ   property object on the class, which avoids@ òneeding to override __getattr__().  It� OonlyF àwork for read-(  @ Ÿibutes.
#6  óolder versions of�, inherit� OfromC G© RMagic¥ 1use¿traditional; 	æ € hackerybachievF Ïsame effect,G €but less& �icientlyò 4def±ñ() should be used@Deach? ofs  á�relevant ¬$_<V €>() funcù ø.

__all__ = ["NodeList", "Empty °StringTypes  ¨ ÷"]

import xml.dom

. Á = (str,)


u W €(list):
¶q__slotsŠ 1()
 Ðdef item(selfï3dex/  3 ñif 0 <= index < len* #  ' preturn D [+ ]^ llength; 7 U 5 Gset_5 w, valuew Traise°.NoModificat±AllowedErr(å  £   €"attempt`m0 y+" 'y #'"$ % =ç(Ô 6, _¬ ,o  s  ð doc="The numberarnodes i)®.s  # —ñbackward compatibilityd  ¸_z qstate__[!,  &"if ‚ is None	•   A= []T   ÃB:] = P	¬T(tupl�VU__add™ Wother™ FNL =¥)€ ¢NL.extend(2  ,'NL%/_rc M‘ 7one“ g¸ò 0 0- 9¿å×
Áá"(k,“name, doc:cget = 
% !("�@" + 0 )? R 8setKð, name=name):
     ðraise xml.dom.NoModificationAllowedErr(
,  Ð"attempt to m0 ñy read-only attribute " + repr(name))C àassert not has, à(klass, "_set_4 / 1, \1 t ‘"expected; ‰to find 3 / pprop =  °erty(get, s rdoc=doc‡ 8set|  r ,5 Á)
"""Simple  Amentó! of the Level 1 DOM.

Namespaces and other minor) €2 featur! óre also supported.

parse("foo.xml") ðString("<foo><bar/></  " pTodo:
= ð
 * convenience methods for getting eleÆ ¢ Ptext.6 €more tes#   bq T someê awriterØ ðlinearizer code intox Pformax ‘with this† µ�interface] `SAX 2 g- f@

im4 io
 ‡d

from• ˆóort EMPTY_NAMESPACE, ØPREFIX, XMLNS idomregK ´.minicompatV *! ¤xmlbuilder! @DOMI C	€LS, Docu ñLS

# This is used by'pID-cach+Qvalid; � checks;" ð	list isn't
# actually com `te, siY s€nodes beÍB ðed will never beP ö
# DOCUMENT_NODE or EFRAG €.  (The W V @is
#M  PaddedN ‚removed,ƒ
A m�ied.)
#
_Z `Types_Ó_children = (ã•.Node.ELE– ,: > 
7 ñ NTITY_REFERENCEð P)


cK [ 	h !):\ °URI = None î ½‘non-null Æ @	8 /×â`parentj J b Towner €nextSiblÂz 0 ‹previous  Yfix =ç> # ¨ *NSã« J ódef __bool__(self dÅreturn True
- Qtoxml* °, encoding=/Á, standalone J  ` �.toprettyG @"",  I D )t 3  D ü	, indent="\t", newl="\n"’ µ  Ê  ¦ %ifÒ  ² Õ ? õR= io.…2IO(5 # Oelse1 ðTextIOWrapper(io.BytesA Þ Z  &=	 9 ù
rrors="xmlcharrefreplace"B À              änewline='\n')
 õif self.nodeType == Node.DOCUMENT_NODE:0  8 ð# Can pass encoding only to document, ùput it into XML headerL } ‘writexml(	 ¡r, "", indH  ¸ ,i Æ, standaloneÆ Jelse¤ X B %ifc { is NonQ rreturn ¢ ¦.getvalue(B „ 
3 ˆdetach()< Àdef hasChild{ s(½ )Ð H Abool %.c+ %)
C V_get_ * E  [ @ ? Qfirst‰ ? (a    ¤ _ ;[0]b /laa ;'-1b ÁinsertBeforeÁ Q, newÐ Q, ref
 %if  	Æ OFRAG
ô for c in tuple(m an  '  ^ 	« cž Ð '   ð### The DOM does not clearly specify whatnƒ Ž ‰his caseM   ¥   i "inV_#k_typesûõaise xml.dom.HierarchyRequestErr(k  Ô    "%  ne 1be Tõ  of %s" % (reprL)!prÏ&))o¶ `parent< ¼ V À÷ .- q.removep ­ %if4 W S ÉoappendD :try?  ì2x =o Í !s. (º›  4 €except V‡^ErrorW rš€NotFound’H K L æ	1in ó  bs_with>renj _•‚_id_cach}
d -	Û  ¬(â §
4 ´€nextSiblj=–	%–.previous0 G 	0 !ifbxÌ  Œ[ª  o 2  0 .¢ r  4  ¦ *od°<B ð None
          ó  newChild.parentNode = self
  ereturn* 
 ¡def append? (2 �, node):!  = !if . bType =[ á.DOCUMENT_FRAG	 FNODE9  = ð for c in tuple(D  .c«  ¤ sf  -    ƒ .” %c)Š    ó### The DOM does not clearly specify what to õ   ‰his caseM    –  ï  a !inN!._¼ _1 j_typesî õraise xml.dom.HierarchyRequestErr(g  Ì    "%˜ ne 1be _ ñ  of %s" % (repr51),   &))-el° 1in ¡  ¬bs_with¶ :ren® _7‘_id_cacheþZ X SinJNoneJ  |r.removeT  V _Û’ r p 0 ð .nextSibling = q   ´  Åcreplacr  $,êB, olßn Ý 4 q  ,Ø1refß % =_ µ ™  ß   � 	‘ 	' Ù . ÔinsertBefore(Þ v PÉ  M²k\¶¶ 5 isB
U#4 k ?  ï  #
? 6- 	…  L:tryC SindexI¶. (Æúexcept ValueErrorO 
€NotFound„ þ![k 5] =ÏÀ à « # ¢ 
#  +# 5if `âC:  Ú%or¼= ‚ ? �á 
Õ  • 4 †previousE8  < ! Y }$ E ( 	­
‹ 
± MþÀif newChild.çnextSibling:
  —newChild." “.previous2 4 = ' < ¡return old? 
 ¡def remove e(self,$ )z 6try  Ž  *  .c‰ bNodes.F (_ )_  ) úexcept ValueErrorH öraise xml.dom.NotFoundErr(C %if“ ö Ê is not NoneU † . $ ' ?¼ y $ } 2 � / =Ò y š å4 [ ! =? ¸ ÔnodeType in _ qs_with_À:ren>ñ _clear_id_cache)0 Ñœ `parentÿ€ lƒnormalizU x eL = []Á Afor �  ¶ k5  Ž "if) .Û   =Êde.TEXT_NODE1 5  9b ^.data#  ' Ð# empty text ` •; discard©  '  Oif LI  " [L[-1]� äX ) h + ù $ E| * gunlink’ Ñ    elõ S and à n+==˜² ¦# collapsef‰  " =f ! Ì ý2ode +†  å7 ‚ ¸ �9 y) ä  )Hh –  ã k = …s  r   ‘L.append(B Q  /el6 2 	 6 ö é .ELEMENr < … .� â0[:]ës £Pclonef Œg, deep�o_' ä( !, ^ ñownerDocument or Ö c ³isSupported= þfeature, versionq Y `.implec ¢ation.hasFG (O ß ð_get_localName(self)3:
  ó2# Overridden in Element and Attr where localName can be Non-Null
H p return !e
^ ò!# Node interfaces from Level 3 (WD 9 April 2002)6  def isSame> Ö(self, other)µ l   2 is ? DgetIu A wfeatureC 0if ? Ó.isSupported(& ,Å ,  ã s Þ   Felse•   & 5NonñThe "user data" functions use a di �ary thatÐ ±nly presentm  # ¯ 0ome4 I ð has been set, so•ôcareful not to assume iE yexists.*ƒUserData)7keyù ?tryà :_Õ _Õ �[key][0]¬  €except (Añ ibuteError, Key
 c  / 6 >setœ ,Ey, handlQold =¹† ¾  " » - ³ 
² 
ý  ? %{}2  º N E = d  `if keyTdH « d6!ifÞ   A
5 „# ignoreû Ês passed for÷  ˜    0if � !is&i  $ Bdel   Î ì! @ = (”3 ×6oldrV_call:_© ~Popera§, src, dst+ ifõCattr/ "I "(  Â  Lkey,�  �AlistB .@ ‹.items()G  K w o š [5 , Ï . (Ð � )Û ò# minidom-specific API:  
aunlink² Ÿ {`parent*" =Ð‘ownerDocuÆ F�elf.child6 se 6  'a  *   í  .ž )÷  < ˆ0deLy) % ñ previousSibling* %neM $ Knext  ! 3# Adðs its own context manager,bensure_4an ²  Œƒ occurs.Q @Thisçpsimilar> óhow a file object work2   0__eo,__£ Ä Îc__exit-  , ½lev, tbÜ§ p

defprL0ty(Œ�, "firstCÇ�", doc="F  ”s node, 1.")B Àroperty(Nodeð, "lastChild",  doc="Last c ñ node, or None.")
defproperty(N ¥"localNameA   aspace- Ñ name of thisS  J 
L ‘ _append_o a(self,"  ):
    # f� ñ)path with less checks; usable by DOM builders if carefulD [  ¬ @s = b . !  0  î $ x  |  " =	 A[-1]1    ð.previousSibling = 5 $   V.next   7   „ .( )  
 p.parenty · 1²in_document3 ² ñ# return True iffG€ is part~aÞ8 Q treej Uwhile* 1notéR  æ iG .’ €Type == “ æ.DOCUMENT_NODE0  4 ˆ d    @ ! =i Ù  / SFalseã ±write_data( 0r,   "W s ’chars to ( !."S !if —  > ! = ö.replace("&", "&amp;") <  lt ! \O  Á  B !\"- 1quo/  > g A ¡  (� )í pget_eleÐ€s_by_tag@‚_helper(,DC, rc1forN0 iná7entÖù À5ELE¿K andë (³`== "*"ÿ À.š    Š .rcÉ  _á  [ ß 1/rc$-ns'asURI, x G3Db ã Uif ((s   7	  )ví  B   (nÀ B  nP0URI % )€ C „  ˆE‹ ƒ Cª —sclass D‰@FragÁ˜  M 32EFRAG|X  +  ­T = "#Ý#-fU Ô $ `Value ‚n¿�attributeÛ £O 3 §, c_H A_typ3 ° .,B  0  Q B.TEXô) ÑCDATA_SECTION&2 ÿENTITY_REFERENCE5 ÿPROCESSING_INSTRUp À   Node.COMM¿ENT_NODE,
  ÑNode.NOTATION- !)
. ñdef __init__(self):  I   `.child? @s =  ðList()


class Attr( 9 ñ__slots__=('_name', '_valu
   �spaceURI'± €'_prefix4 y   s_localNP ÐownerDocument  1Ele )Â ƒnodeType· ¡.ATTRIBUTEÿ # ’attributeÜ !ne òspecified = Fals V_is_i * _¤ _j A_typG C.TEX”4ò.ENTITY_REFERENC„ ƒ0, qé (, -õ=EMPTY_NAMESPACE, ]=NoneL"  L �Ö0!ü ! »" =Š í  – ) =¥ 
) Í# =Š 
 < 9}$deY i   ñ# Add the single 2  nñ that represents& d1 of  Ûp ã.append(Text()†r  ] V¬R and R ÷are set elsewhere:6getš@6tryM ` qreturn X7 § aexceptR–_ErrorB  ¬  (û.split(":", 1)[-1]¡ Ñ¡ � % =  î8 	)4 1set 4 ,C~! " = ÿ "if	œpis not â

ñ _clear_id_cacheo .; Ø&ª�€operty(_¾ à 4, _· 6   ] Å 8Û6 " ç�[0].data( +> ž  � ­ S%ÃUÞ V W›X
# Y 8 ,V˜rnsuri =G Ùj·  à #if6 º == "xmlns"X2if G  
 †!= XMLNS}
3  Y àraise xml.dom.—| EErr(}  (  À"illegal use´'Œ 'ž 1forÇVwrongc"Ûð     self._prefiÃx = prefix
  #if • is None:  " ðnewName = self.local % ?els3 ²"%s:%s" % (v ,F )G "if ÊownerElementŠ ñ_clear_id_cache(� / M  n· Á 
j † Âoperty(_get_ E, _s )1 ¡def unlinkp )“ ¢# This imp­ ûation does not call the base& ‹  ]ð# since most of that‡ A ±needed, andH rexpense' eC bmethodq i} ñ	warranted.  We duplicateI §removal ofE Ñchildren, butˆ 0's Ã 2we Š Q fromA Ò eclass.B Delem$”! 1if $ ¢ i1del" ‚._attrs[Ä0oden]H  7+ 1NS[�.ò�spaceURIj
C of_is_idÖ _   ~  v = Falss      Ð p._magic–©nodes -= 1­  * N @DocuÛ8 Zcount8 Afor ’2 in Nb 
¬  .¢ "u   8 6[:]ÓöAisId9Ö	¦return Tru9doc÷à  %	" Ü! 0if E }1 or $‚ �B Pnfo =F .Ø  s `_info(
 0if  [  ´  Y
€’  X .P!NSR‹º <P N •ê ’schemaTypÈ S³	x{ ± E ˜‚_no_typehA›8^  Y   žÀgetAttribute2ª9\ ¶Sdefprr † 0, ". ",È    ¼ ="Y  i0is ¬  ¯Ÿan ID.")
H  ’ M Pdoc="1- À name of thiñ&s attribute.")
defproperty(Attr, "schemaType", doc="S Û type for thiG ö

class NamedNodeMap(object):
    """The} ` list H ñ transient interface to the underlyingE ðdictionaries.  Muta ûs here will change= ª element'sG 1y.
 €Ordering� ñimposed artificially and does not reflectd o: 1 ofG Zðs as found in an inputMu‡ .. 2"""~ ð __slots__ = ('_F Cs', 
 !NS cownerEÇ )9 ñdef __init__(self,`s HNS, 7 Š Ž - .j " =5 ”  $NS +NS  Y ) =h � ¡get_length  ‚ ¡return len � Ù Aitem w, index< 2tryU ¯   M  Ö [X8 S ‘.keys())[F %]]È €except I] _ErrorT FNoneÑ  • s^ � VL = [X  "@nodeû ’ ˆ wvalues(9  »  L.append((4 .  E , 
 .4 %))´ é L’ /NS” D• ³amespaceURI™ Plocal© ) ª ¥__contains®7key÷if isinstance(key, str!  0;key`$OelseË4 &NSI' °q m   Æ' §  9 #NS‰r 3N; 's(v 1getò�, name, K =¬¾  8 2 R _¤_±¨ C_cmpn Hothe’7if  ?0getÁ(* 2, "e;", � Ì0»1(id‚ b) > id] V)) -  < ¼ 5_eqo” ! å ! X == 0C /geC >C £e ¢	ñ† >… l… <… À  def __lt__ó(self, other):
  preturn  b._cmp(! Q < 0
% ó def __getitem__G ÷attname_or_tupleR ìif isinstance() ,, 0  ‰ 	† ŒattrsNS[; ]�  / FelseÃ   A ?  @ Ñ# same as set â sâ o, valuà  H, stU ’ :try£   cnode =nè § Ý  ( ÿ except KeyErrorI DAttrc)Í  >   n å.ownerDocument|  0Ele 
# F ÐsetNamedItem(X 
n   ." =1G ¬hif not%:  , Î IÇ ¡raise Type!("/   must be a}aing orB Ž object"¢ œ  b ß Á  gû  .  , û© ëŽ  3 äà
> FNoneƒ† #NS† U ð spaceURI, local¦› ONS[(I ² )`remove� 6;n’à � ¿ 01 is5 
ñ _clear_id_cache(._àJ  ð9del€ n.½ § í (  &.(&n.s
= `if hasáX(n, 'Ž 'ž h   nƒ�0 = ç �    n W'öxml.dom.NotFoundErr()G•Jª!NS¬„ª ¿J—ü¿†	‡Q+odž]Àance(node, Awttr):
  ùraise xml.dom.HierarchyRequestErr(/  : ñ"%s cannot be child of %s" % (repr(node),  uself)))G `old =  ±._attrs.get2 V.name) jif old¯ ¶old.unlink() L [z H @] =  x & 6NS[q ‘spaceURI,/ p.localN‰ B  O Õ.ownerElementÈ  q ò _clear_id_cacher * Â `returnï 
? pdef set‡ €dItemNS(¿ £ Â8   .0 l )L ³__delitem__I 0attn—_or_tupleU  ç Ú [' ]Ÿ  Þ  Q ¶B  á £__getstate– „ Ù &,3$NS Pð s[ !, i b 4[   ª á

defproperty( ñNodeMap, "length",â  $  °doc="Number& ˜s in the @ ð.")

AttributeLis^! ó	


class TypeInfo(objectÔ Ð__slots__ = 'ÛØ"', 'Cinits%, +  N  º "  O1ameV á #  f  ýf U iÙ!lf£L 
àøñ"<%s %r (from %r)>\o !__P__.__ž #__  
| Æ  N  5 ˆ �Oelse– 	Œ €1get­ ~ð ‹ A3 ž 8 % Æ

_no_type =&`None,  )B¿(»� ?1=('T@Docuä B`parent.   0tag˜   Î }prefix'‚�0URI5 _c  @ [ s ‘
 /NSQ  extSibling* „previous Ê ›  *0 = ^ Ñ.ELEMENT_NODEÀ ! @Valu-  cschema8 N•`_magicÏ : Ss = 0 Ã _ }  [	t ™  ñPROCESSING_INSTRUCTION¯ ; 5COMÛ , À         Nodïe.TEXT_NODE,
  ÿNode.CDATA_SECTION2 ñENTITY_REFERENCE5 !)
h ÿ6def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None³  PlocalG =! !):m  Ø  d p.parentÏ 0 = ! 
 ‚ 1 = . @nodeK $ =œ 
/ Š # =“ 
 Å ) =Ô 
) Pchild“ s” ŠdeList()% ´nextSiblingž †previous Ñ 8 ÷# Attribute dictionaries are lazily created4 a4 ( ædouble-indexedN#S/&->k K u   URI,’ ( ðin the future: consider¤ €y genera½ Z 5of ¨ ÷ objects this is too tricky2 ÷for now because of headaches with, º%s. _u ¦/ne !NSÃ'neäaensure; Œsî™"ifn# Â  Èk j
 %{}}  � '{} Eget_‚{ :tryh creturn� 7 n fexceptí_ErrorB  û.split(":", 1)[-1]  ( ž � # 9 lunlink3 L1noté
¦   ÍP in loa—.values()¤ g   4 .{ ¢¿W œ ÛO õN  � 5get¾å ,ò š– A"""R± ý!e ¸  Ú N�specified8 .> È 7 –element's7 »G   5 asÀ óa string. An empty  ‡¾Qed ifßZ • does notF Æhave such anv °. Note that 	^ ¦may also b†o !as0 çxplicitly giveY ' , &thA 5hasrð method to distinguishÇ ·se two case5"""Ï ƒ ô
­  6 Š wPs[att‚]¡q •?Key�"""ü vÐgetAttributeNóS(self, namespaceURI, localName):
  0if + ö._attrsNS is None"  ) •return ""8 ?try# 	M /[(� u].valueO ÿ except KeyError[ 1""
0  de´ £tAttributeì 0attn !, Z ã  Ú " =ç &ge8 SNode(6 )Z  ë 1if 1   = { :  >  ! Û " =‰ ù # also sets nodeVù 5 ÔownerDocument¯ 	 £  4 hsÎ  rË Celif… !!=Ö › 
^³ 	i Z.isId9  ‡ â_clear_id_cach‹)§N•�qualified™½cprefix¼ àÉ = _nssplit(< ø  Ò Bñ/NS” Y @ ó ] 	€ n Y ", Å a  : H �*	w 	ÿÒ 	 	4 sÜ$±  # 9, " 0   D 43 !=>|#' & 	 S %  w _9 = ³©'TrÃN
1$/ H‘  ¤m@.getFb Œ 9Î.Ÿ !NS¡ / L)ç V æ ,r
:ŽÁ1Eleé€not in (� ,¤2  Áðraise xml.dom.Inuse|úPErr("T  ^� already f &d"t “ �._ensure€4 &s(" Dold1e" s ` .,0 1if 3 iØt 
¥s Vremov³ u 7 H Jold2x {{ Ä û” À     if old2ô is not None and old2 wold1:
  ð
self.removeAttributeNode(7 )+ d_set_a!  _n"  ;  ,  %)
)  ifq 1q   
q ñ# It might have already been part of thÆ õde, in which caseg  Â ñ# it doesn't represent a change,þ ashouldÉbe returned.I  ¸  È 9È 5 2þ 9setB\NS =  + Kdef t(NVname)10if  .{0sNSW Ù"  	öraise xml.dom.NotFoundErr(Á:try5  Ò ¡ #lf_ [} ]ú except KeyError> s º ç [ { 3
 'NSÿspaceURI, localNh@NS[("“ 6p’ �
D  ;8Ù“[[ .8ñ _clear_id_cacheÊr gunlinkà’# Restore<@sinc  e /  ü Ástill usefulwotherwiU"# W %ed > °.ownerDocum` Õ*lf 0  7 ë    1  5hasKþ  , cÕÐ"""Checks wheÉ � the ele£ ahas an›ÑQ with" ‘specifiedQ .s  DR€s True i‚O ! J   O“  \,svs Falsex5"""5
æ ­ä   F 9 n0ame(˜Ù L[?– -« &NS­ BgetEÄ`sByTagð³àall descendantó elements with the given tag name.

  qReturns% ölist of all descendantN õ(not direct childrenI Vonly)q —specifiedu s E """7 r€ d _get_· ñ	_by_tagName_helper(self,¼ Ò, NodeList())È ƒdef getEö 2ByT= 'NS8 ð spaceURI, local] /):‡ $nsŠ 3  Î — _  ª �__repr__œ ƒ c"<DOM Ì ñ: %s at %#x>" % 4 .A, id �writexml !,  ÷r, indent="", add wnewl=""ˆ @"""WE t an XMLÿò to a file-like object� 4  lÇ 1   ƒ 0 õ that must providePa­ Ó method (e.g.r Ã or StringIOI %).9 O#ê £ = current Fatio­#( ="  µ 0add Õhigher levelsm  # 2! = Qine s˜   î . (hp+"<" + ,»¹ 8rattrs =   wibutes(( `for a_¾@ in $ ws.keys(» P z r� p" %s=\";< )©  , _- a_data( "r,Z [. z].value5 ) a 6\"" "ifÇ  §sb p 
; >:   qif (lenº.C ©) == 1 and¼  2 S* À[0].nodeType%(1  5    œ ¢.TEXT_NODE©á.CDATA_SECTION )\ ; t  ×  t	 Tr, ''  < Jelse  6 Q ^
5  #  ý Ú  Ö � P  1  - R ˜ �,Ñz 	� @ 
% 	! €"</%s>%sqÈ¬Ù ; 
I /F #%(6 É ç! ¥  �._ensure_$H   p ÿd2Map© / "s,Á "NS † € shasAttrW  o ~ ÿ> 
™x 6Truò& RFalse[ # L…! 3�| °, based on eÐ22 Oct 2002 dñraft

    def setIdAttribute(self, name):$  ( i! 0 =  E.get0 QNode(. - $ 
V & E )z 'NS| ÿspaceURI, localN� !NS‘ C ¤ . î  à #, Î $f ò  is None or not4gisSame×.ownerElementk oõraise xml.dom.NotFoundErr()Â ñ
if _get_containing_entrefF)…  }  ‰ ¤ ] þModificationAllowej  J ñ z._is_idS 	 u = True©  t  3þ._magic_id_nodes += 1& @Docu4 ^count4 `_clearU Bcach¿ó )

defproperty(dD, "aæ9s",z Pdoc="ed¢vMap of . ’ on the e®?.")a ­` •-' d h Hthis[ ¾ e _set_ƒ 3(€ ,› 4$ ) †._ensureP sJ!  j  s[ .Î1] =e &
% ENS[(( Ð ¨ Ù  H)A B 0# Tå ócreates a circular reference, but ¬s.unlink¥ �# breaks„±cycle since A As to  Š Ì{ 0dicÜ0ari{ ¡re tossed.  - 	‹$ =Œò

class Childlessõp"""Mixi¤at makes c#  -ness easyŽ 2imp2± and avoidsv  M co Bxity e |p methodì Âat deal withb 2ren¶ 1"""H Ó__slots__ = (Z Ò ÿ 1s =ˆ* ¢  a   PEmpty CListeQfirstë 7 +la M  7}5 v" òbreturn€ 
4 S 3 aappend˜ 0  , =üi 	,ðHierarchyRequest4  +   Š C  ¦A + "P Ps canåEhavel"R ï 1has…  6sŠ „ í VFalseß²insertBefor˜Q, newF ,ø
 F Ê 3!dovÊ À

    def reñmoveChild(self, old C):
  õraise xml.dom.NotFoundErr(#  *  @ à.nodeName + "  ð s do not have cj aren")
< Ñdef normalize‚ x R# For3 BlessO ,0 @) ha Áthing to do.W  � Fpasse ireplacê 1newê ô ÿHierarchyRequestü .ñ
class ProcessingInstruction(–  ò c, Node MaType = ñ.PROCESSING_INSTRUCTION_NODE÷__slots__ = ('target', 'data'�__init__~", )  , ' z  NÝ # =% g   1 ! =8 w#±òValue is an alias for&  ;  P_get_ß , ˆ z qreturn �  d v 7 s7 0, vo > 7 " = ? m Ê = property(‡ 9, _` 2Õ âÔ ` Ÿ Ö  - Õ 	8 w 8 Ö 8 Ø  7 ×   Ö   Õ  ¯ �writexmlª !,  ÷r, indent="", add wnewl=""k3 . ò("%s<?%s %s?>%s" % (= ,’¼ ,Ö , Q C))

ßCharacterDataã@=('_ àðownerDocument','parentI  ð previousSibling Dnext 	ç À 	e " =È j ¤!ne æ4 { 6  7 Ù U = ''O  Í .  s ÉÇalengthÌ» K1len .3)V Q__len+? T  . 8 R à © N ‡  Ç3 P2 	4 1 ' =9  ! Å  	°CreprÈ£  ' l  ¢  •0if 
  f) > 10ò  2dot … = "..."9 Oelse, ) pp'<DOM %ª°de "%r%s">'S  q E_²__.__name__;‚[0:10], “ 7dotú ‘substring+ G ÷ , offset, countðif offset < 0:
    ô)raise xml.dom.IndexSizeErr("offset cannot be negative")
A 3if ' õ>= len(self.data):%  - i àbeyond end of N 
s Ÿcount < 0d 3 Ì 
ureturn Â [Ú : +B !]
Ö ádef appendDataõ W, argõ G & =S   +& D ginsertD l L fô M Á�:arg».0"%s Q" % (n @ ) [˜]-,d·&])hodeleteh Õ¶j¾á +>1if Y Å¨- +¤T:Uoreplacªì¯ÿBt3Ðð	)

defproperty(Character�ñ, "length", doc="L  é¡the stringôú.")


class TextH Ó__slots__ = (òñ
nodeType = Node.TEXT_NODEN  0Nam q"#text" ¡attributes7 &ne>Qsplit‚  Ö,ò�  ™	63 or" / >&tillegalI Hvaluw0new� [!__&6__(š# Œð = self.data[offsset:]
  únewText.ownerDocument = self 3 x" µnextSibling  "if> áparentNode and 1 in . `.child& %s:C  � 0if ^ Š is None  ! £ I pappendCO (× )R ?elsG ÄinsertBeforeH ,‹ N { Ddata*  †[:offset]sreturn � 
� Ðdef writexml(H , ÷r, indent="", add †newl="")_C _w ( `r, "%s R" % (= ,m &  Â Bwl))… ó# DOM Level 3 (WD 9 April 2002%  ª  _get_whole&° † PL = [Ä .c ø nŒprevious#pwhile nÜ?notà  ý�.nodeType6("Á.TEXT_NODE,  ÑCDATA_SECTION ž  $  "L.ÓQ(0, nª É      ² /n.¯  " =QbreakØ $  F  ¹ô l(ñ ¨  É í Ý—''.join(L6‰replaceW8—, content£ð# XXX This needs to be ser6õly changed if minidom everrð# supports EntityReference >%s.* )™œ! ½µZ š? = ” «Ø s.removeýà5extî  ; æ ‘ Ó ¦$otØž ] ˜   › OcÇ  ¯   ³  n°  "     F K/if* —$ =! 	\ i '  »&  +ä¿ð isWhitespaceInEólementContent(self):
  0if  Ç.data.strip(  % Åreturn False7 ðelem = _get_containing_ e - 0if  † is None} _ binfo =š �ownerDocuÆ .r  N _$ (
 )i   i ?els�  H J.isE=ú)

defproperty(Text, "isWhitespaceIn3 %",ž  î ódoc="True iff this text node I…s only wT "C  G P" andç !in[1ent> oent.")¤ Pwhole° ‘ "he‡ ðof all logically-adjac^ ¦ sa þ Í E@c =  ¢.parentNodDpwhile cÃ ;notPif c.6 €Type == 7 ß.ELEMENT_NODECc' v cs È ‚¿ `ntref(y ¾ @ÿ NTITY_REFERENCEÇ 3 
class Comã(CharacterDataÄ  Ï HG5COMG1 ! ¢Name = "#cJ !"
 Ádef __init__9 , (Z  ‰	r ., —a_: ! =A ^ ƒwritexml^  ÷r, indent="", add wnewl=""‚ ¢if "--" in/ g ôaise ValueError("'--'{pallowed@ #a ÿ ³"Á — . ò("%s<!--%s-->%s" % (¡ ,�  , © D))

¢±DATASection7Â â__slots__ = () ‘	² < �_SECTION8� ' ¸ ÷ "-sa ¾³ `-À a ÿ.find("]]>") >= 0iP]]>' â	gCÒ  ® h1<![) 0[%sr & %`YðReadOnlySequentiald2¯Map(objectm r'_seq',rè cseq=()9  êò# seq should be a list or tuplÖ ( - ] Àqa 3lenHX —1len.; 	—  balength  : Àef getNamedIótem(self, name):
  �for n in  V._seq  # ñif n.nodeName ==@ 
#  ' ‘return n
Y pdef get3 wdItemNS} ð spaceURI, local% � 4ameG ”  eand n.\     ¹ ·__getitem__¶ ˆ_or_tupl<àif isinstance(Y& ,, -  & H" =k *? )G 3 Jelse¶ E 
� B  Â«ode is NonM ïraise KeyErrorC Þ6odeá #!WindexÅ   J < 0½ J  ‰ ã ?try% ’[` ]1 €except Ic ¸ ? d 4  �QremovÅ’¹  u¸ ñxml.dom.NoModificationAllowedErr(U  �  "Á”dNodeMap  n¶read-only")6ˆ � Ps´"(odó… \‡ ^Sstate(î[¢]áX__set8 !,  ? 7   b ò[0]

defproperty(ReadOnlySequenti'f¹, "length",‹ðdoc="Number of entriesÝHthe ¨.“�
class Idb BfiedG¢"""Mix-in   àthat supports J �publicId k`system Òttributes."""Ô__slots__ = '7 D', '6 '(  ¢%_i‰ ³_mixin_init‡< $, : P" 4 =  q9  u´ } Dget_8 t ` µF $ ; ] ; 	$ 
yÖDocumentType(†Ð, Childless, XŠ  ø + ! = ñ.DOCUMENT_TYPE_NODEð  ' ðValue = None
    nøame = None
    publicId jsystem äinternalSubset. C ñdef __init__(self, qualifiedName):'  n   ð	.entities = ReadOnlySequ  al1 ªdNodeMap()9 �notation: *ifŽ �  ‘ âprefix, localnš_nssplit(Æ Œ  8 É 0 < "  0odeÎ 2 =  Aame
# 1Jget_U<-breturn= 
* G Pclone/= g, deepC "if? ñownerDocument is 

‘# it's ok£  ä   ` 4 = < PType(=›' .î    J /.n#   Aoperåù = xml.dom.UserDataHandler.NODE_CLONED­ !if 
Ø  U |  a x©._seq = []> ) h* sfor n iŸ
2 �  \ $ <É%(nD, n.Œ  „
h H   Ñ R s¨ „.append( : òn._call_user_data_hV(z_, n, F  ú eú 	Uù # Py = Eù7y(eõ eõ $e.õ ,™ õ   H H gï | û.actualEncoding = e q = e7  1 	qversiong  / Æf *ieÅ yÔ Ã?e, D œ ( !, ¡ 
… • Õ Jelseü'  *­ƒwritexml¬ ÷r, indent="", add wnewl=""Ð3 . Ö("<!DOCTYPE "¥  r#  Ç —  m
¸ 	> ð"%s  PUBLIC '%s'   "ù “@ % (¶ ,wd ',  å)” $el–  – aSYSTEM– "u C ` Àif self.inte÷
rnalSubset is not None:
  qwriter. o(" [") –self.inteY . '"]L ` g ò>"+newl)

class Entity(Identified, Node)« Áattributes =Â ¢ �nodeType åde.ENTITY_NODE  BValu! 1ne
 áactualEncoding< !ne e  tversion' ( Ðdef __init__(ð	, name, publicId, system
 ƒnotationÊ  x 3 .½ 0Namœ  = Y  5 ! D 
% Pchild%vdeList(�g %_iRa_mixin¸ (ª )Ü Jget_'ç Ã qreturn c 
* G TA 	$ ; {: 	# 9 pappendC8 Q, new ½ õaise xml.dom.HierarchyRequestErr(i ’@"can:\  w ren to an °0ty Ï"DËinsertBeforeŠ _, ref” 4g ” _below— aremove} – "ol/ /\ Œ Ofrom‹ 
IplacŒ ¬/, – 9g — /of•  …Nh	‡-Iless’ ð|�NOTATION~`„<’h s "am³   ès²DOMImplemenn( #LS… q_featur€ù[("core", "1.0"),. ’  " 2"  �C ?xmld ! c ! b pls-loadf 3¨ % I ]€BhasF*_8#, «P &$if b == ""ë    0 y    y(X †.lower()` à in self._featñ:ures

    def createDocument(self, namespaceURI, qualifiedName, doctype):D  H $if D and õ	.parentNode is not None:7  ; ôraise xml.dom.WrongŒ IErr(,  0 ""d~ õ object owned by another DOM tree")< `doc = Ú "._ï $_dð )
 [ Àadd_root_ele! =´ ( É  Å \  9   	8: å !is3¥ !if• 
[  m ¾ 
g # The specˆ òunclear what to …ù here; SyntaxErrã ò # would be the kòobvious candidate. Since XercesW sH ñInvalidCharacterErr,6s;   ¨  3klistedE ;for¹0, tÍ PseemsÓ © ëbetter choice.F �XXX: need1 `check Y ”illegal c£  s ¥ +inD PE2.M #�¡Level III uñs this up when talking about\Ëreturn valuem "of= Üfunction.  If­ ¥¬ ¬DocType arH ANulll  mx ped with� aÉ � OqwÀ)or‘  ~ ²6“Àn we go back† ]Ùabove problems ¨-J #("ŠÅ 1 noŒ "@*Ðprefix, localûÉ = _nssplit(wa í2if ; ¹ == "xml" \½ !  – S [õ != "http://www.w3.org/XML/1998/, "Î p 
 õV  5"ÂÃuse of 'xml'ž  F ¶  D pt ?URIv í  _  ‹ #cm s˜ q  =„.e)NS’Ÿ•KË ódoc.appendChild() 
A % ˜ 
Q: 
c  Í  ;.¶rèå ; t >   3 ^  2impqaÜ" É 9T ðdef createDocumeó#ntType(self, qualifiedName, publicId, systemId):
  ódoctype = DocumeI 	C ). .S % =^ $ m % =x $ sreturn } 
 ò# DOM Level 3 (WD 9 April 2002)% ô def getInterfacò wfeatureØ 0if R.hasF (% X, Non+  
‘  3 �   Felse)  &  @ � 0# iŠ 1nal6  ž “_create_dO”™ D nÐ()

class Ele³Info(object6 A"""O ò$ that represents content-model information for an eT .® ‚This imp ) ðis not expected to be used in practice;œã ûbuilders should provideW ñs which do the right thingE Yusing° �available� #it± 2"""º ð__slots__ = 'tagÙ"', uq_init__mX, namá Ö.6 ! = ; ÇgetAttributeDaD ·@_no_0@ 'NS… ð spaceURI, local· ÕOT #isCáR 9 VFalseŠ |isEmpty- A"""Ro s true iff‹s¢ is declarÿ@have<QEMPTY¯ ¬ k k.™    � !IdŠ ,, K‘ e˜4d a� ˜ ïa DTD-style IDw ‚‹ QidentC� ,p__getst�ÆžÍ:__s9 !, G @ 9  e f !

ôclear_id_cache(nod0if  .  ïö == Node.DOCUMENT_NODE÷ ( .J .Y ( Ðsearch_stack S !ne<†elif _in 3 Æ   d.ownero - } | UT (ä ,ä#LS‚ Y0('_0_HC', 'ž!',É  ë 'v  0 Pchildh s  " ~'._ _ï BAs = – E.ELEy �ñ
de.PROCESSING_INSTRUCTION›Ž À              ñNode.COMMENT_NODE,  ADOCU ATYPE 0)

1 ùimplementation = DOMI !()) «nodeType =R  f " 0Nam" `"#docuW " @Valu ANone ¡attributesT  `parentµ 	 öreviousSibling = next U Ò 3# D|  b ófrom Level 3 (WD 9 April 2002²actualEncodd V  &e  ™standalonÕ BversI= òstrictErrorCheck\ BFalse xHandlerô C4URI 8ò_magic_id_count = 0ú ñdef __init__(self):1  Â   T.doctÃo PchildwŽcdeListü % `# mapp¼ ðof (namespaceURI, localûb) -> EQEInfo #C   pand tag- , « õ _elem_info = {}I   ü 0achz Ésearch_stack;"6get^ ( , n 7ent1$if .í R Î _key =( S .Ä OelseH 	 0 rreturn û  ª ƒ.get(key½Û 
Æà × L 
* D ",@ 	# 9 ú?URI= ' A m> 	$ ; K? 
( C ×A 	& ? íH / Q QE 	# 9 pappendCÒ8  , ¾!if . ÕTnot ic_ _/s¬ðraise xml.dom.HiermpyRequesç(¹ #  p"%s cane 1be _ ð of %s" % (repr(n 1),   é"))w ? ® 0is N  d
ž @# Th Àeeds to be d£¡before the:  test sinc )is³  ëay *be*0 ˆè,*ûwhich case it shouldE ðend up re-ordered�  � Iend.,  ý .Þ r.removeÀ  ã  àType == Node.Eö LEMENT_NODE \
  ð
and self._get_documentEle 8():, ù raise xml.dom.HierarchyRequestErr(/  f T"two W " eX ås disallowed")4 ð	return Node.appendChild(  �, node)
- ¨def remove! "ol0 µ :tryÂ  K  .cV  f "s.F (; _  ¸ úexcept ValueErrorH 

€NotFoundÏ U õ .nextSibling =  †previous ENone‚ ( Parent° 9 = # "if¼`·5 isf 
· ÿ . U y ‡€ s# S r1forª2 inœ m
‹ !if( .×`Type =ˆ Gde.E¬
3  ˜�  6 ™ aunlink(‹ ta ais notB
X  Ã @.doc& .L Ç v " … ™6  ( ¤Pclone  › j, deep¡  ‘   
‘ å 	ìL " =U2impJÓation.createD½(8 ,è  Ì E b.encod� ±  ' `standaÃ w  + tversion(  % *{ A = _	 _è"(n:!,  Î  švassert < d.ownerb.isSam„>   w(O 
n (ifj  � 	»EDOCUh
Ó¬  S pk ´ ¸4 1 /elq ATYPEÞv  æn  r ' =î 	™  (.pž? * ]ô	_call_user_data_handler(F’UserDataH .£…_CLONED,J  ›   g C‘ H  5
)AFragç B ˜Dd = A$ 	dcõd  ¤ z dŸv �wtagNamev De = $  U et et ÀateTextNode(ãself, data):
  ðif not isinstance(! W, str&  - ðraise TypeError("node contents must be a; Uing")d —t = Text( .g ! =� ) Ð.ownerDocumen7  ´  ‘return t
 ðdef createCDATASection(2 æ bIc = Š î cî cî cî  omé … !  b„ \n øProcessingInstruemtargetmOp = 7 	1 Å Ypp“Attribute
WqName´@a = $ ( o ao Åa.value = ""4 za„ 0EleŒ#NS„ ûnamespaceURI, qualifiedš Ðprefix, local Ê = _nssplit(5 ‚  ‘ n 
# *, u ] øeï Ú eÚ  :^Ü Pª1Ù .,, ä Ó/ò# A couple of impÙaSó-specific helpers toz Qtypesª#Mð
supported by the W3C DOM I &s:k_Àw_entityDð, publicId, system
 1not‘  3éB  < ¬  {² ‹ ´ ¦ Sn = NÁ (¨ ·n·nL3get CById˜ 'id‚ �if id in #¦._id_cache 
# E[id]42b ã._elem_info orY Qmagic_ Gount� ` 3Nons  sstack =@ ¡id_search_ y  @ is @ 
¹ �# we neve‡  >  Ðefore, or the÷
 cache has been cleared
  ð
stack = [self.documentEle ]+  " ´_id_search_;  * ‘elif not  :  t ²# Previous D ó was completed and´ û is still valid;F ùno matching node.  Åreturn None
 ‚result =  �   _whileª  V " = e.pop()J  8 Ò# add child e,Bs to0 ã for continuedê 9ingB ’.extend([J 8 T "inØ  YNodes=  ƒ  "ifŠ .µ ”Type in _ qs_with_J Lren]É ¡check thiss 	h @infoù@get_ì _ (_ 
K 0if  
ò ¦ 0# W… ve"ð	process all ID attribute£Ifore€ > Ð ì€in orderI 1getE 8theF oset toF  �be IDs usI àt.setIdA„ :*()J €  • ¦  U õ . ³ ž.values()ô  : !if™ ß.namespaceURI* .  ?€.isIdNS(f 	: ,M ŸlocalNameu  K   Ï ­[O ¯ >] =é 2  » 2 o == idº 9 rc '‚&   $ * p._magic¬   si _breaka Y GE-)'%!Ä  A O_is_Î	…,de ˜1.^N I ú/l`À              çresult = node
 C if  Éis not None:#  / Ubreak creturn9 
 ödef getElementsByTagName(self, name)W A c_get_e3 R_by_t5 w_helper< ß, NodeList())r 'NS8 ð spaceURI, local’ ‡ $nsŠ ä  	  Ó _  ª ³isSupportedŸ þfeature, version˜  h B.imp!¢ation.hasF9 (A  imk  3m  øg, deepg !if. qType ==gæ.DOCUMENT_NODE¶ ü õraise xml.dom.Not× €Err("canE€ P docug 5s")F/el| OTYPE� 6tß  è † †`clone_ ( ( , lƒwritexmlR ÷r, indent="", add Anewl �encoding=[, N `standa„ " ¡adeclarùbs = []â 6 4if X 
¡4 ¤.append(f', 4="{ 6}"'‘6if ‡  ] : €="{"yes"W ¡ else "no"t C. „(f'<?xmlø="1.0" {" ".join({ P)}?>{`#}'¡ 1fori1 in¼`.childs# åv  Ï ÉÆ , c a ó# DOM Level 3 (WD 9 April 2002%   reì v )nþ+   å 
t.ownerD/€ �
º 
~TWrong5  Z   �• Ås from other¡^s;\n"> ðexpected %s,\nfoun D" % Ü 
¹ )QnY0n (E.ELE].’.ATTRIBUTñ Å 
õ s¶ í  k ó() only applies to nâ and attribute  ”4ame´û != EMPTY_NAMESPAC`if ':'y Ý
´ Ã gprefix… ‹öame.split(':', 1= 3   bif (  =  �n"xmlns© , ð  and namespaceURÿI != xml.dom.XMLNS_NAMESPACE):
   Uraise4 ßNamespaceErr(0  C ù"illegal use of 'xmlns' prefix")9 Nelse{ ñ if (  name == "A "8  i  1and* ™ /URå 	B 	�.nodeTypr ÿNode.ATTRIBUTE_NOD!I5the%›attribute( ì A} = NoneÌ Plocal¢! =! cI E 	f Oif n#
ÈpelementŽ r.ownerE ˜  Ó 4if ( ais notÜ 
I ( As_idK  _i 	E  ! F „.removeAF É&(ns9 V%n.%	 r 8n._& !  ¹�Ž & ?ode°kqELEMENTŒ
 _n.tagI í %# ` ðŽ  C n.¸  e*am_¦LO.set‚ j   1if Ê
Ì     J /IdL R# It'7õ$clear from a semantic perspective whether we shouldý p# call ‡ñuser data handlers for  0_RE2@D evÛFsinc*ñ# we're re-using6 Pexist  oÐ.  The draft ™ — has beenŒ ðinterpreted as mean@ ¦"no, don't® ¤ — unless aF 1newâÆ is created.Bðreturn n

defproperty(Docu³C, "d ´%",[  žådoc="Top-levelÂ„of this = A.")
b € _clone_( À, deep, newOz †"""« C6 " aÉ  ègÉ!itZ â Xp ¥  Called by ý.z  
  A i p.import 5 r  | üY - PsSame- (²   Ffation f’UserDataHN.EaCLONEDx 
£B cIMPORTD ´  Y	ÁðELEMENT_NODE:
    ðclone = newOwnerDocument.createEle ñNS(node.namespaceURI,
A  D …odeName)@ Áfor attr in #   õibutes.values():.  q ¶ �.setAttr* 0NS(6 
¢ V .S  q , R }  O Ba = S gS  © W PlocalX L Â.specified =r  
Å zif deepÖ  Uchild	 ZNodes*  µ Qc = _¶ _â (, ,W ,Ï
¤ ?  ù€.appendCu 2(c)  Belifˆ X €Type == † á.DOCUMENT_FRAG	 FNODEœ � N]@FragW(— ¤_TEXT_@TextLQBdatavßCDATA_SECTIONn ; Sectionr ÿPROCESSING_INSTRU{  ÷ProcessingInstru„ otargetA  ¹  �.@/OM¬1Com£g ŸATTRIBUTE£Ãm e, ¼
ž�	žETrue“  Â ï ! ž<TYPû bassert‘ o_} is not¨m  âPopera¶ð = xml.dom.UserDataHandler.x•_IMPORTED: È  Â Ò2impÎX á“ ç(D  ‚ Œ,À ƒpublicId ‚systemId¾ 1 y .ç Yd òD õentities._seq = []6 i 1notÉ &  NnJ. Àons._seq:
    Ãnotation = N ð(n.nodeName, n.publicId ©systemId)
E 4   H ø.ownerDocument = newO : dclone.@ äs._seq.append( p ýif hasattr(n, '_call_user_data_handler'):p  º /n.1 Q(operE, n,Ö 
€ �for e in '‚.entitie¹ o  Py = E(  y(ë ]e]$e.],³  ·   D · ¥
�  $ t û.actualEncoding = e i 9 e3  - BversA#e. + $– b yü ee8e, ~ Felseø#H`e the Ú y5of 5and ATypeDEs is4p# imple?‰ò specific.  minidom ßÈs those case@ €directly£ˆ õeNode() methods.o ñraise xml.dom.NotSupportedErr("CannotË ¬ À %s" % repr( 1))
L €# Check ]`) sincóis could conceivablyG ûused with other DOM‘s (one off³FourThoughtB ò DOMs, perhaps?)ì  ·  *  ( ,%’breturn ñ



def _nssplit(qualified½:™fields =  .1 b':', 1Y rif len(0 b) == 2B  øv  
œ  r(None, ' D[0])¢ ðdo_pulldom_parse(func, args, kw QPevent°  "  (* C, **$ { Ðtoktype, root~ �7 P.getE
 (Ô M p.expand* (3 	  Sclear3 Ê ( b´ Qile,  "r=ê qbufsize Á @"""Pã ` a filÎAto am!by qname or ± object."""Ü #ifa @ is d  Ø )k ”Dfrom_ È@ort ê �tbuilderP ½ .Æ (¡ 
	k[ ÀV À _do_pulldomñ _parse(pulldom. Ç, (file,),
  !{' Br': 	 Ó, 'bufsize': 
 r})

def" �String(s , �r=None):[ @"""P€ 0 a r ò into a DOM from a < A."""1 iZ Pr is I H  ¦ 1 ñxml.dom import expatbuilder@  ) ireturn ø 	¯ )0 Oelsec :. ^ C_do_ ck $, k I  €løgetDOMImplementation(featureso4if  Õ Õif isinstance7 ,z¦Š < ¢ = domreg.Û _ _­D C > ¿for f, v in‚   " °if not DocuÄ ).iÎ R.hasFÑ (H ™  A Ö Œ Q 
! 0;sax ù.handler

START_ELEMENT = " X"
END  T"
COM6  "P DDOCU Q  R   q  S  ð	"
PROCESSING_INSTRUCTION(  ð"
IGNORABLE_WHITESPACE0  À"
CHARACTERS$  ó"

class PullDOM(9’.ContentH1˜¡_locator =¤�dÚ  ôef __init__(self, ( xFactory¿ çærXML_NAMÜ X  *  O .N ºb` 
/ àfirstEvent = [L,Â ]' &la& g 8 
) e’PStackR H qpush = C + u.appendL 6try°Ü ?pop= 5pop: úexcept AttributeErrorL a# use Þ ' T  &ea~  q EpassU ° P_ns_cý0xtsÛ {†°:'xml'}] # % üains uri -> prefix dictS tcurrentX Þ k <[-1E€ending_e·‹ !]
« ‡!opX™ Ë PresulàÇ w	\ >del™	" bP s 4setuL‚ #, ‹ ‚ -" L QtartP1AMappM&E,TP Eshasattrw €'_xmlns_ ðs'):
            sóelf._xmlns_attrs = []
  s ñ.append((prefix or '> ‹', uri)); ´ns_contexts; T tcurrent m.copy(? & †[uri] = } QNone
t �def endP˜ €Mapping(l ,/ !):(  Ú   +._] 2 =  ´ Vpop()a ãstartElementNS_ ñname, tagName , Hn ð # Retrieve xml / ñspace declaration5 uibutes.§ Yñ_uri = 'http://www.w3.org/2000/$ +/'4 ƒ ` = get © 'é0', =± ifŸ ais not$ 9 =Pfor aÅ ¨, value in9 
-  1  ‚ "s._![(±  Õ ,F )ÑI Ä  5 ‹- A 
™ uri, localŠ ! =VA  if�
Š Á# When using. „ðs, the reader mayÒ  5notO  � ñ# provide us with8 roriginaÕ@. If4‹, create@ 0*a*1%id+AfromG Š + z %if1 /is�  $ ÂP ]7	Ž  4 #if
(    Ðnv+ ":" +vR OelseM ´	> "if|@docu\F Dnode¢& .h�¹ Ù Î › U cbuildD€ (J F V D1tagŒ9“Àed, it just ;iars asü #R1(o+ *p YÄ ¯w.items( . aù_˜ " =	1if * 3 ==[>uri' J =Œ+  } qŸ6= a~ 	v  $ â    > ïO:' +I 
 °AAttrë1NS(ç !, ] 
£ t   F.set2 0ode6 :ttr. !el'Š� ð _current_contex«t[a_uri]
  ­if prefix:  * sqname =$ ð + ":" + a_local 7 OelseM > 	ñattr = self.document.createAttributeNS(Î !, Ÿ )ƒ †node.set2 !od6 :ttr. ­ … (Æ 
T  8‚ (X 
,   P.value 
Î ðlastEvent[1] = [(START_ELEMENT, i v), NoneÝ
: OK 
e Qpush(J ~  def endEle0NS(Q  , ï¦, tagName)ä  .^ © 6END§ # _pop()­ !®  • Sstart— 	•  Hs“ *ifC­ že]  ì «' .C cbuildD­(‹,)N r Pfor aT ,åA in ³ w.items(º  .   ]   Ó(O £ 8 N    ´ •c ) ªÍv_ßž kA0comý‡ \2CS 
¶Ô ?COMâª0»ÕÀeT¨i s›f �pending_6 @s.ap ( å žóprocessingInstructionAÇtarget, dataÐ¨&Pl 	f þ Ç ü ÿPROCESSING_INSTRUCTIONVG t&x 	À Ö€  }ŽÐignorableWhitóespace(self, chars):
  pnode =  ò
.document.createTextNode(4 3 , ðlastEvent[1] = [(IGNORABLE_WHITESPACE, _ �), None]A ~ R 
, 1def° oactersÁ M¯CHARACTERS· 0cstartDPº t*ifp¡Factory is)� ¤ñimport xml.dom.minidom     ‘½M =3 .� `.impleéVationlTbuild& µ ç, uri, tagnameÃ ù# Can't do that in ó ô, since we need theF » ä# XXX: obtain x EType#  ? á ¥7 (© q)G 	!! =–
 }ÏïSTART_DOCUMENT'    ƒ Ppush(Ô › ð# Put everything2ðhave seen so far inth$e ½ Qfor e~Ðelf.pending_e™sHúf e[0][0] == PROCESSING_INSTRUCTION2  · ñ _,target,data =C }  !   n£œðProcessingInstruco(Q  R  H    ¤ O = (¡ :, n3 9eliØ 0COM°É ¤ 0Com
(x :[1]^ ‘ Z ‚  .seo °raise Asserõ ó Error("Unknown ¨ ÷Qnt ",} 0} 2˜ › 
"  ž› g ! =^# areturn¶.firstChild*enþ^ › W[(END1$ °Vpop()q Qclearwk " ð
): Explicitly release par^ ]Uures"ß 	€ ü q
class �rHandler¼ kqwarning‚ p, excep¼� fprint( m  ; eà s 9 9 8 QfatalŽ v = Å 1DOM�fStreamÇ ð__init__(self, stó
ream, parser, bufsize):
  pself.st' 2 = 	 
 < # =E 
 Q $ =[  ñ if not hasattr(h K ‡, 'feed'†  � " €getEventŒ  š e_slurpU $ �reset()
 Bdef    S   ñ.pulldom = PullDOM()6  p °# This contq õhandler relies on namespace support; \ Tó.setFeature(xml.sax.K ".f _I Fs, 1� F C‰ Hˆ 1À ì ±__getitem__# W, pos÷  imª • warnings³  .	 (  	A"DOMuS7's e ð method ignores 'pos'šameter. "L ùUse iterator protocol instead.",. ÂDeprecationW± 
  Åstacklevel=29 A$rc'7ßVif rcè é •return rcL öraise IndexErrorTc__nexte`t 5QStopI(8ionw  =w  »  3- £expandNode8nodÜeJ# °parents = [: ]awhile ? 
B°token, cur_2 " =% 9  f&if  0is ( 
E  % ‹8 _ þ  != END_ELEMENT< · ô[-1].appendChild(– ! j 2if W �== STARTY U P (elR © 
0del* d ­ 	î ]¿ %  Õ° ô�1# u³¡crementalPˆñ interface, so we get the desiredY   # f effecÓ¯ m 6R.firs�:[1]ˆ	( #la' Ð  a 7domA ~ [ 	C k 4bufX ŸQ.readò.ò ` :buf´  ý u 2g.close2     œU None·   <  ÁF(bufz þ V[1][0_I Û$4[1]é C 1C ¤ &rc+ð(self):
        ÷$""" Fallback replacement for getEvent() using the
  ýstandard SAX2 interface, which means we slurp> PSAX e` s; ùo memory (no performance gain, but{ ð	we are compatible to all‹ ¥ parsers).3 5""" Rself.#  ( zstream)' 1 = % F_emi‰ greturn 1()
@ Adef + [ !):  9pPthat l s;  ? 4the3" _Zÿ() read previouslyù $rcÇ Âpulldom.firsäe[1][0]m í & C 1C &rc_clear  ñ): Explicitly releaseÌ |~objectsÉË D Â 2del™Æ  Û "f = NonÔ  `
classVæ2DOM(PullDOM):Õ qstartEl7!NSÞ ÷, name, tagName , attrsH .= < À tcurNodeˆez wStack[-€oparent+ 2«+ Ó.appendChild(j Ô¯ 	ê à 1  Õ r`procesá³Instruction­ Ïtarget, data¿ ; é n»$la}?0][º+ 	º f ·óignorableWhitespaceà ?cha˜2 Ð k ¶ oactersÇ ) ¾ cð 
default_bufsizÂð (2 ** 14) - 20
" ñ"e(†²_or_string,  r=± C  ˜4if Y !isØw ð= default_bufsizeñ
    if isinstance(stream_or_string, str):*  .    = open.  Q'rb'). Oelse8  A a , Öif not parser5  ò = xml.sax.make_ (f ñreturn DOMEventS¿ ˜ ,Q ò , bufsize)

def Sß  * æ U S=Noneî ò from io import 0 1IO
± Q B = l2ing‘ Ubuf =. `  æ =?bufã  ð	"""Implementation of the$ó Level 3 'LS-Load' feature."""

ì Dcopy  {Qdom

 ´.NodeFilter  ð


__all__ = ["DOMBuilder",  ÅEntityResolv ð	InputSource"]


class OpÁ sB"""F­ ðs object that has variables set for eachó | è ÀT n „uses an 92is  @to p• ±settings to \YExpatN . V 8b# Note±  1 ^ 0in ‘òSave constrains which‰ 1eseT ñ # values can beò ]usingæQ åý ánamespaces = 1T  q_declar9  2Truv Qvalid c = Fal� €external–€ameter_eài] > ' general% pdtd_subË%= D ‚ ¹e_if_schemaŠ  	 þdatatype_normalizÂ bcreate‘ ›y_ref_nod¾ Ò  BwhitFR_in_ep—_content · c„ A_secË	  om¥	g chàt_overrides_xm.0codâX Binfo"Ž0sup­qed_mediú es_onlyîð errorHandler = õ fÒ …«ˆàÀ@ X  åACTION_REPLACEˆ ñAPPEND_AS_CHILDREN = 2¤ " ÿINSERT_AFTER = 3  PBEFOR[ 4÷…_legal_a‰(L … #,  ~ ,_  ¸ 
 1 � F  † )ƒ  ~Ó__init__(selfl V   2._oò$ =ü(; 3get©?F M 
©Ã àdef _set_entitõyResolver(self, entit C):
    . + =/ 
. ódef _get_errorHandl_ O rreturn V ( B sB (, U P I  � X Y  › Ofilt• " 6  �  * ƒ  2 = 	 £setFeature@ ·name, stateE "if„supports4  . '  •; " =C ± and 1 or 0´  !   6tryÄ    €settings= Telf._ 0[(_i p_xform( )£ ]W °except KeyEec òraise xml.dom.NotSÑ iedErr(L  ’   3"unö Bed f,�: %r" % Œ Ù,)) from NoneC Nelse„ @for Ä �, value ipú -  ‚ bsetatt¨._options,D )w s ó AFounï †"unknownÖ �" + reprØ '))''ø Ø‚ þ=?has¯ Ã_ OcanS‰okey = p˜  ; l[ã  # This dic\‚ary mapsÖ(ô,®á) to a list ofw2# (”" òpairs that should be set on the OÂƒ object.E \If a m p is not+t© s, it isD  $ ­!byo £DOMBuilderk - ]A = {  k ("šÐspace_declara•s", 0): [) - %],, U 1U )1)U QvalidŸ ž ! 	= ñexternal_general_D/ieê 0 [ ð [ 	ó + Ÿparameter¸ 2 º - ¼ 
2 	_ �¹e_if_schema¹À        ("vaó
lidate_if_schema", 0)],
  P("cre" ñentity_ref_nodes) 5: [*  1 . W /1)W 1® § iŸ "õ Ë 	K 	¼  ­ 	 	9 ÿwhitespace_in_element_contentR4 c ± c dßcdata_section	% 	¨ E ™ %  
E  omB„  9 x 9 ü ÿharset_overrides_xml_encodingÃc5 
ž 0 ´ 5 	e einfosev j 3namÅvdeclaraD/vaa' d	, ^,0) 1#  ˜Ñtype_normaliz¿ M", 1N € 9 ¢ð supported_mediaµ os_onlyg0 	áÃ;! = !
 ^ A!}
,ðdef getFeature(self, o !):   }x @ = _ p_xform( )" 6try/  3 `returnZ AattrW A._op›!, Q > úexcept AttributeErrorP !if• T == "+
"  v a 0 = È q §  $   ž (0 .…7  ;   Rand oÌ .•
B Àcomments
     ÿand options.charset_overrides_xml_encoding
?    C Tnot (H ñnamespace_declara_ @  D  %or‹ ÿvalidate_if_schema? 0cre= ÿentity_ref_nodesD = i5 ‘cdata_secó )))r ðraise xml.dom.NotFoundErr("feature %s Kàknown" % repr(P1))
L Pdef p§ñ URI(self, uri):  F0if  .¿ –yResolver  $ onput =) ".r2 E;R(Noneb a OelseO 2DOM7 v /()O breturn‹ Ù  (iž ï ì   s€ = copy. * #._ ‚ t.filterþ  Ý % ¦errorHandl+  1 Qfp = – µ.byteStream �if fp is H )a †systemIdË ™õmport urllib.requestN  " p 
  ‚.urlopen9.Z ú c_d_¬ s¬ D(fp,wu±WithContextV,ê 0, cO1, aç
} Æi×r_legal_ sò `ValueEt (" !a 3 a "Ë CÐNotImplementeA÷or("Haven't written this yet..."Ù  /", § i•x¸Åexpatbuilder› % =ß' b.makeB3 &Ô C .¡RFile(“ @)


ö_b_xform¢ Ý  a.loweruàplace('-', '_'C nclass £cobjectÄà__slots__ = '_UFer',z
9¥publicId, zš  ¯eassert   à <€source =� IüS ("" .j 4 =  E ý ßb#  û§ % `elf._gõ1pen= ö (Ë ü  Ë ô# determine the 1 if Qtrans¿¦provided i¼Ã 5 }Å_guess_mediaj(- µ| €base URIPewe canæ ®ðposixpath, urllib.pcarse
  ðparts = urllib.p A.url	 ¥(systemId)0 ðscheme, netloc, path ñ	rams, query, fragment = ` > ò# XXX should we check the X å here as well?7 !ifh � and not õ .endswith("/"):,  Ø  •  | @osix �.dirname( {) + "/"1 † Þ 	B ïsource.baseURIQ "unS%)
= rreturn @  ÷def _get_opener(selfâ :tryï C Celf.4 _ úexcept AttributeError?  _ 8 2 =  ccreateN (  _p q ¹ 
:  N ¼ dimportnqrequest< Y Œ f.buildŠ . j ñguess_media_encoding-,Oy 0nfoÝ §çyteStream.infoà ðif "Content-Type" in $ 
40forÛ$am §.getplist(u  Ô   À`ram.sto¶ chl,t=½ 1   f!pa9 ñplit("=", 1)[1].lower()


class DOMInputSá s(object‹ õ __slots__ = ('bü @', '† Racter  ÁstringData',m Ž  'j + €publicId ,  'è®q_init__¡™  U  !.” f = Non  ¥ $ ¶  ¶  Ç  Ø  é  /î  ¿Ö õ ÜÝ & > Fset_ > &,  ?
' NFV J ” + 
™  H +,  Y æ  , =1 ­ Ï` O ¨ & 
£  > g, dataD “ % ! =! ƒ 3C = � $ 
  : $,  D �  % =# ƒ ™I ? ƒ $ 
ƒ  : à, publicId):
   ôself.publicId =   

  ðdef _get_systemId(0 !):  ! preturn  .$  : s: $, % D 	= % =# ƒ baseURI‚ 	# 
�  8 \, uri{ !   = ò



class DOMBuilderFilterô Á"""Element f ñ which can be used to tailor construction of˜ aZ ¡ instance. 2"""í ñ# There's really no need for this � ;Z ’crete imp� ae sO Ö# should just" ƒ the endÁ Å() and start @ òmethods as appropriate.  UsingŠ Ðmakes it easyõ Conly@ – p one of{ "m.ä ñFILTER_ACCEPT = 14  PREJEC 2 ˆSKIP = 3 qINTERRUC 4Z òwhatToShow = Nodeº’.SHOW_ALL& š Ô/ Ö& ? `acceptb : 2, e„C Ü ò F zŸContainerJ !7delè »0ocu£%LSµPMixin¥ƒcreate d# `s thatO@form!  %õ load/save spec.Ÿæasync_ = FalseÊ # Æ 0  0 g, flag6 !if ¾  g  ñraise xml.dom.NotSupportedErr( '  "` uhronousð  Û  Ã„is not sD &")Ï \abortÊ 0# W*"doõ1meaP•"clear" ac @?  D% 5the• # jµ disappear?% á DNotIÔÛ oÝ p"haven'� gured out ¦—ˆeans yetÒ  ö Ñ t g rwritten^ X  3XML[ gsourceÈ^ , ‚^ 8nod] @if s Š is None. =šb$el5 s.ownerD C :elfG Â uTWrong5  v)[ 3 ’ †.toxml()‘%OMÔ¨šõMODE_SYNCHRONOUS A 2¢Æ£�ü mode, schemaTyp.ÐchemaType is ·not None:
  ùraise xml.dom.NotSupportedErr(+  6 À"schemaType Q Tyet s2 %")0 ûif mode == self.MODE_SYNCHRONOUS… ÿeturn DOMBuilder(J AK Ð âasynchronous b~ Bs arß Û 2ðValueError("unknown v A forü 1")
ðdef createDOMWriter()S ²NotImplemeno�a"the wB ñ interface hasn't been �ten yet!€ ½InputSource… …% r)
#
# E– ´Tree
# $Id: ñInclude.py 3375 2008-02-13 08:05:08Z fredrik $M ¢limited xi< A:ej a trees/  history:
#] Ã3-08-15 fl  Wd R11-14 ñfixed default loaderN ÒCopyright (c)Q “2004 by F¦ ÁLundh.  All + ±s reserved.D Ï ü@pythonware.com
# http://www. O
# - 0d
# The} �¢ toolkit i/
á P1999-”á Ê ñBy obtaining, us ð	and/or copying this softé   Ðits
# associaÍ@docu¹ñation, you agree that ðhave read, understood,F ðnd will comply with ëafollow„ @erms| ` condid !s:Â ñPermission to use,¹ ,ƒAify,5 �distribut� Î o
# itsË •±any purposeP  ¢ qout feew° hereby gra»¢, providedþ  Ì Qabove› S =àice appears in	Bpies· ;!bo/at=  na Eis p*
#Z 4 in_ H¦aA !atnñname of
# Secret Labs AB or  `author_ 0 bejd] padverti: ) °publicity
#– [ ›„ «!ofS VQ”specific,Ê G @riorM è„°SECRET LABS¤ ð$AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARDKñO THIS SOFTWARE, INCLUDING9 xIMPLIEDA ðOF MERCHANT-
# ABILITY € ð	FITNESS.  IN NO EVENT SHƒ ¯ 'OR® ð
# BE LIABLE FOR ANY SPECIAL’ ðDIRECT OR CONSEQUENTIAL DAMAGES UANY
# ðWHATSOEVER RESULTING Fð)ROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION0 ðCONTRACT, NEGLIGENCE; O. £TORTIOUS
#3 Ð, ARISING OUT@ OS RCONNET €WITH THEŠ  I ÐPERFORMANCE
#2 ÿTHIS SOFTWARE.
# - 0ð"

# Licensed to PSF under a Contributor Agreementy òSee https://www.python.org/psf/lP R for  ñing details.

##u ñmited XInclude support6 athe Elp ÐTree package.; 1
im( Ãcopy
from .  3  Äurllib.parse% ðurljoin

XINCLUDE = "{Ï Î !w3Ê T2001/ž &}"0 _8 C B+ "iÈ "X È_FALLBACK = ) �fallback"|ðFor security reasons,  P òsion depth is li4pto this0 òd-only value by default.
DEFAULT_MAX± ó SION_DEPTH = 6
‡aFatal l ñde error.

class  ŸE q(Syntax Ä):
    pass
1 L  RÐ Isive< N 
B D¾ ° loader.  Tç  î Ds an® ±d resource `disk.
\Ô@param href R$ €referencF " Pðmode.  Either "xml" or "text"ö4 PencodÑ�Optional "   g(UTF-8ŒÒG )H öreturn The expandeË Q.  If œ  –  û�  @is
#yiò` instaà C  ¨ "D ` Unico€Vtring€ vfµ“, it can » BNone‡ €or raise˜!OSQ exceî tthrows  Þ ^  x  ÷ Ôd.

defÐ_  0er(Ó!, ,s=� N"if 2 ==Ä§ 2“with openF Ö'rb') as file'  + hdata =ƒD(+ ±).getroot()7els? eif notœ 
X %1= '''B  s ž 'â 9 °  ž S.readš ® Î ïEpu©directives:pelem RoÈ †ÊVŠ þ±µ¡If omitted8“¸ ík{@linkÜ}{Qgiven8 óshould be a callabluP thatÐ� s9àsame interfaceØ3<b>| ?ð</b>.
# @param bð)ase_url The base URL of the original file, to resolve
#  ñrelative include( ñ references.
# @param max_depthi àmaximum numbero erecursL Asion?  g rLimited€ Aduce� @risk: ðmalicious content exploB  €  A ¢Pass a neg¯ PvalueO bdisablP lf Pation7 ƒ@throws | RŸ Iê rError I'f{@linkã è} was exceededN _FatalC @func{ ` fails› Sua givenrÂsource, or i Atreeü óains malformed Xi � elementPØ )IOÃ € Sload } ÷ w Ì qreturns…0nod'± its replack  › !it&an‰  . T

def1(›  , l �er=None,… ’ 
À Eñ=DEFAULT_MAX_INCLUSION_DEPTH):4 &if‘@ is ]   N J Q = -11 )el3 6< 0/ praise V77p("expec•Enon-Yâ!orn e for 'j Æ', got %r" %› !)
} £if hasattr“'getroot'Ï  µ  -! =Ï. $()? Dê  ¢= default_ w _fu  ƒ,¨ ’, set())
À9 Ó_parent_hrefsÏ a# look"x„ Ø  §Ò A = 0
 Ñwhile i < len© D 1[i]-   Ñif e.tag == X"DE%&DEÓ * ¥# process … PdirecÔO  )  »  j  w (" "y    %if¸
c    0 ° = urljoin(f á ,  
H Vparsej  ~", "xmlr   æ  x  Urm „*  ¦ ä¢+("› ñ@f %sÇÁ  J 	H(==I   q a	(…8   "B¹]Ãreached whene2ing˜³ 		 _.add(Û  Â# =±$ !, ‡
Ç £ 1if . |   uù acannot‚ c %r asR� p § À            Ànode = copy. ( û.)  # FIXME: this makes little sense with recursive includes
  _ Y ð, loader, href, max_depth - 1, _parent_ .s)K  €.remove(, + ­if e.tail:F     å  1 = ™  ƒor "") +< ;  elem[i] = A 	 þelif parse == "text"|   # =» ,5 ÿ, e.get("encoding")Õ A ~is None_  Û Âraise FatalI”iError(®  )  q"cannot• Ø %r as %r" %   � ?  |Ã /+=dOif iÚ  t2 = …?-1]Ò  % ÍÚ ~ 9 ?elsN m .4  ) )  O 3del¦ ¤ ‰continue5 € Ê‚"unknownO@ typ”C xi:€� tag (%r)Û©	ƒ  ÏËÎ AgÎúXINCLUDE_FALLBACK ¨ Á"xi:fallback� ømust be child of¯ « † « 
¼reo‡base_urlsoôi += 1
#
# ElementTree
# $Id: ñPath.py 3375 2008-02-13 08:05:08Z fredrik $J ñ
limited xpath support for*‘ent trees,  history:
#Z ø3-05-23 fl   created 8 YaddedY e// etc+ B8-27+ Qfixed)0ingw¥periods inŽ 0namŽ  � r7-09-10< ðnew selection engin2200' 2' c  Ú 0 "or‹ ( Ð ¶ ðiterfind; changed  ôall to return a listC C11-3’ C ° Tpaces+  º + n Í � Ávalue filter~ÐCopyright (c) ³3-2009 by FÓÁLundh.  All + ±s reserved.D üü@pythonware.com
# http://www. O
# - 0d
# The§ º¢ toolkit i_ÐCopyright (c)ñ! 1999-2009 by Fredrik Lundh
#
# By obtaining, us óand/or copying this software  ñits
# associated documentation, you agree that ðhave read, understood,F ñnd will comply with the follow„ @erms| ` condid !s:Â ñPermission to use,¹ ‘, modify,5 �distribut� Î o
# itsË ñ  for any purpos¢ �out fee i	ò	hereby granted, providedþ  Ì Qabove› ðright notice appears in	Bpies· ;!bo/at=  na Eis p*
#Z ° in supportH¦aA !atnñname of
# Secret Labs AB or  `author_ 0 bejd] padverti: ) °publicity
#– [ ›„ «!ofS V ó Qðspecific, writtePpriorM è.ø°SECRET LABS¤ ñBAND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING9 xIMPLIEDA ðOF MERCHANT-
# ABILITY € ð	FITNESS.  IN NO EVENT SHƒ ¯ 'OR®  ˆð,E LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES UANY
# ðWHATSOEVER RESULTING FROM LOSS OF USE, DATA= pPROFITS‹pWHETHERÁ �AN ACTION0 ðCONTRACT, NEGLIGENCE; O. €TORTIOUS3 `, ARISv 0OUT@ OS QCONNE! ˆ ±!USI ÐPERFORMANCE
#2 	˜_.
# - 0 

# Licens›Ro PSFŒb a Con$@or Aº Î y òSee https://www.python.org/psf/lP ( i etails.

#hPImpleQ  œ ulàtr XPath£@.  TKÐ's usually no4 so
Pto imË”ñmodule directly;SB<b>Ek ÒTree</b> does2 Pfor
#�À, if needed.¢ 
X ðre

xpath_tokenizer_re = re.žÓile(
    r"("	 ô'[^']*'|\"[^\"]*\"| %:: 5//? F\.\. 5(\) %!= ö[/.*:\[\]\(\)@=]% õ((?:\{[^}]+\})?[^/' f!=\s]++ 2\s+Œ {)

def Ü  (pattern, ýÑspaces=None):Ý …default_ ' =* �.get('')L2ame@ ` else E C 0par2_at^ MQFalse  ]j K� ´_re.findall¨ —  �Ñttype, tag = C Q ð     if tag and ÷tag[0] != "{":
  Úif ":" in tag  & Ðprefix, uri =# é.split(":", 1)K  0 >tryE   ÿif not namespaces'  + íraise KeyErrorc  # ö
yield ttype, "{%s}%s" % (` [» ]¼ © eexceptf Ž Š aSyntax� "("V 1 %rÏ Pfound= 0map‡  ¹) from NoneÅ Õelif default_± A andT þparsing_attributeœ ÿ V ,´
þ ?elsS Ioken­ Ž v = FalsÓ P Ÿ L Äò == '@'


def get_parent_map(context) 3 =  . ¼ 6if  1 isƒ?  =6 ( =1 A= {}H  - Pfor pâ6 £root.iter(’  &    * e* pk     � 0[e]n ` greturn{ ó_is_wildcard_tag(tagm 3  Ñ1:3]8p{*}' oréB[-2: $}*N@_pre I ø_isinstance, _str =  "stz ifY i &*'Ü ð# Same as '*', but no comments’ `procesÍ l ‘ructions.ý  ð# It can be a surprû@thatU ò  includes thosed PthereÕ'noH �justificab  ‹ö'{*}*' doing the same{  idselectat, resuli      L @elemÚ!      7if P(/ B.tagYº (  % + Ç 2tagj}i1Any†!is'Fin aOÙ D el70 = ¨  Ó ¬ Ç û  1 ù ÓC ''{AG [åxQ# The Pny (o�)bsuffix½[P # '}w'Í òno_ns = slice(-len(7 !),<A¢ z E[3:]@ M:1t% ” l
€ð _tag, _str) andÿ el_tag[no_ns] == suffix:
   ¡yield elem Pelif > 1-2:< F'}*': P# Any  ñ	 in the given namespace.E  g @ns =) W[:-1] õ_only = slice(None, len(ns))' ödef select(context, result)Œ  f 1for¼  � ! 
   $ ! =) E.tagg     ò if _isinstance(1  , _str) anRs¾ .nsj  L P&se) ðraise RuntimeError(f"internal parser e Â, got {tag}"creturn0


$ñ prepare_child(n(Stoken'0tag†  [†ì �_wildcardØ C(tag1  Â y  D = _c 1tag( = € + ¤) ¨ ©r  v   Î ( dAfromÔ“   	' Å ž ® 
… \(el¦!:2é7'{} c V0ag[$  # '{}tag'k'	 ‘ û † þ ú $  é ­T ’  @if eâ Š ?tag%  - Be© 	2
XOstarW × ¯ 0lem² ô 
� ƒ 
Å‹ 	?elf‹ %k Š ø ¯descendants  6tryÊ n0 = |(Möxcept StopIteration1 ã �  h›0i6"*"' d1"*"* –Anot o <[0])  ã
ÎtbSyntaxs–"invalid ç 1")
i ±y v (o.iter(l     3@ is ^ 1 Z   J8 Ò™rdÀ
        def÷ select(context, result):
  ³for elem in! 
   + $  !  ) ›.iter(tagI  )   ±if e is notY O  &   qyield e� creturn³ à

def prepare_ Ant(nÄ Stokenz  % ä ð# FIXME: raise error if ..¥ ñapplied at toplevel?�    y £_map = getŠ   U)- ]  U = {} <` / p 4 2 = 	  h [Ž]i  ²   #if$ ‚Ö 2 W  1 º [] r] = Non™ "  µ) | º	�redicate½ ˜ðeplace with real¿ ²ser!!! refsµ ð# http://effbot.org/zone/simple-•ñ ator-parser.htmž 8 ñjavascript.crockford.com/tdop  4 l5 Òsignature = [bpË  rwhile 1   #6try   ­0 = »(+úexcept StopIteration9 TŒ  H 1if øª[0] == "]"/ ]break.  + s('', ''1 L   ú# ignore whitespacì 26inu � 5andŽ @[:1]K"'\"” ± v = "'",0 B1:-1Q ˆ h�.append(5  æ for "-"3
* "1]# I  q u".join( # e# use  Ð to determinek©B typ÷ 'if-  u'@-â æ# [@attribute]@ …0key­6[ö · ; $ ?�.get(key)Õ z À
% .   Á <­ o} % þ  m='" or?!='�='value']8 0! ‚ /D 	LCMK1==  J� „_negated*(@if (m_Œ 1 :=XóôÀe and attr_v�alue != v	 ?:
   ¥yield elem ó return select_negated if '!=' in signature else) ? 'if ö"== "-" and not re.match(r"\-?\d+$", predicate[0])¢ q# [tag]T  µ Ytag =-  3def‚ ÷(context, resultP  D 1forè  Â ! p      !if# Ñ.find(tag) is½ NNone/  3 A© {.='" or.#.! (6  _   (qT%   < )8 z+a# [.='2 ']£  Š
  § ! !" ‚ ´= 	Ñ&-1íjif tagnæ 0ê(   ÿô1all÷
}  ,  ðif "".join(e.iterr_()) =g
? .   UbreakJ  ’ï 5 	# Ö 
 q ˜   
" p
’ 8å?lemèÚ ª Â@² 	�²  <ë?-() V-()-"á‚# [indexˆhlast() - )gM  uQ 3   F y = int(‘J - 1* "f - 6< 0§  D   ö!raise SyntaxError("XPath position >= 1 expected"®Ø)ifï Æ" s   
w Àror("unsuppo÷rted function")
  ùif signature == "-()-":$  / >try   ýindex = int(predicate[2]) - 1G ÿexcept ValueErrorU Áraise Syntax' ‘("unsuppoÌ ~expressÎ ‘ "f ” O> -2_ ûXPath offset from last() must be negative@Nelsee � 6= -údef select(context, result)@ öparent_map = get_ : 
Ã³for elem inR 
Q  ¿] 2 = 	  w [M ]» G ó# FIXME: what if theÖ ¿or is "*" ?;  U ’s = list(m �.findall( Z.tag)Ù  r   !ifà !s[W]h  2 æ  -   Qyield4 ‹ � (I·[Q, Key
 ‰ J   EpassH creturnô  ¬ …invalid `")

opÿ {4 0"":  r_child, * Cstar . 4elf   L #nt '//2 …descenda [ £ : ñ	}

_cache = {}

class _S¹2orCºzr  2q = NoneÄ  è __init__(s­ H rooå  . ! = _

# - 0ð

##
# Generate all matching objects.

¡ @iter}zð, path, namespaces=Î ‡# compilèqpatternï !if> Q[-1:]@/= X [Ath +¡# implicitŸ (OÁkeep this?)
W „€_key = (G ,'if§ ‡ £/ ¡+= tuple(s+(Õ “.items())c 	šRor =  [S 
8+{ rif len(6 v) > 100  �  r.clear(Ç   :.:19   X ñcannot use absolute~1 onî7entŸ@next™Pter(xD¢_tokenizerSKP)).__1 !__€ � 	!  ? 0 = ( É `StopIt{:ion5Y m[^ ^  whe1: „  * @ Á.append(ops[Û P[0]](ž à, token))
      óexcept StopIteration:
  ùraise SyntaxError("invalid path") from None< >tryM étoken = next()0  q 1if " ®[0] == "/"C  ( % G Õ Ubreak q_cache[ ñ_key] = selector% •# execute  ü Atern ñ result = [elem] `contex #_SK C (% ü 3forR 3 in
 &orô Y Ž (U ",  E creturn ñ

##
# Find first matching object.

def find‰ ,Ê àh, namespaces=Ë)… \ ¯Oiter7 !),)‚ <all€ s� ?all„ _list(„ 	~ € c	 ) 	‰ qdefault
	à Ó�¤  Ã  ^ = .„ a or ""?Ç9 § °
"""Lightwe Ð XML support ÿ ‘Python.

 ðis an inherently hierarchical data5 ðLmat, and the most natural way to
 represent it is with a tree.  This module has two classes_   t  ‘purpose:
ó æ1. ElementTree` s„ QwholeÁ @docu& 3 asp  © D 2D @ Ða single nodej~ ª P

 InýcþÆ  ô wp l P(readF @writ 1to/üñfiles) are
 usually done on¼ × level. v  ¦  À @ent
Û “ its sub- sj a  ] $

I ˜°a flexible ?Sainerþ designed to storeÀ
 structures;ðmemory. It can beE bcribed‘ðcross between a ¸Æ Qa
 digaA U Each© hÍ@numbž òf properties associatedd#it1�'tag' - a£  �à    Ã/!'sÝ  â   'attributes< › 
D 8 J  ³D 0str1 €  * ~ en� üQ'tail> @n op}/alÈ  DQafterJÓ eœ#agŒ fAnd a ?cchild . ðs stored in a Pyó*thon sequence.

 To create an element instance, use the E ñconstructor,
 or 4Sub   fa  y functionc ÌYou can alsoQ øTree class to wrapˆ k ðure
 and convert it-   ÿfrom XML.

"""

#- 1°
# Licensedi ñPSF under a Contributor Agre0ð.
# See https://www.pyk¢.org/psf/lP R for  ôing details.
#
#c ñ#
# Copyright (c) 1999-2008 by Fredrik Lundh.  All + ¢s reservedR f) @Œ ¡ware.com
#© 	¨  A4T5 Ò ± toolkit isí ß - ÀBy obtaining“ °and/or copyK�this softË  .  ðits
# associated docuâaœp, you aÆQ that ¢have read,ô`stood,F ñnd will comply withþafollow„ @erms|  ª did !s:Â  PermissionQAuse,¹ ‘, modify,5 2dis\ sÎ o
# itsË X any purposÍ ® ‘thout feewð hereby granted, providå þ  çQabove› Qð notice appears in	Bpies· ;!bo/at=  1nd žp*
#Z ° in supportH¦ ée  ¢ qname ofrÄcret Labs ABŒ`author_ 0 bend]  ad9 is^ óor publicity
# per[ ›„ «!ofáV ó Qðspecific, writte0priY ã ‚°SECRET LABS¤ ñBAND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING9 xIMPLIEDA ðOF MERCHANT-
# ABILITY € ð	FITNESS.  IN NO EVENT SHƒ ¯ 'OR® ð0
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES UANY
# ðWHATSOEVER RESULTING FROM LOSS OF USE, DATA= pPROFITS‹pWHETHERÁ �AN ACTION0 ðCONTRACT, NEGLIGENCE; O. €TORTIOUS3 `, ARISv 0OUT@ OS QCONNE! ˆ ±!USI ÐPERFORMANCE
#2 	˜ >2ó
__all__ = [
    #²� symbols @"ComÌ"", Ddump �ð", "ElementTree",
ø    "fromstring", qlist",
$ `indent  diselem „terparse(  0 "P TError  PI? ôProcessingInstruction# EQNamK DSubEj … &to§  ¥ ¥TreeBuildeu tVERSIONa 0XML… WXMLID ­ r DPull x õregister_namespac¤ Àcanonicalize? ô C14NWriterTarge?3]

‰ ô = "1.3.0"

import sys $re
 uwarning $io Qcolle6  F.abc*  ntextlib

ä3 . s XÑPath


class ó ±q(Syntax "):`""An eÏ` when èð ing an XML docu!.
/ pIn addiÛÑ to its excep ‡value, ar ‘ contains> òtwo extra attributes‡  ‹`'code'
 ÷  - the specificc  # K  ' A'pos‹ '1 ñline and column ofH Þ À 1"""? Ÿpass

# - 0u


def ?(GbóReturn True if *! �* appearsKbº  À.¨ r: 0has2Z …, 'tag')ã7 L"Ó ½h ¼RThis !is�reference?’aÊ9W £ interfaceJ  2/ Á's length is`numberz3sub€ às.  That means1you‡@wantý Pcheck 3an 5  Q ò	truly empty, you should / ABOTHF  †† 1AND‡  e· 5The^ Ftag,!   ,< i› Ðñ s can be eitherq ’bytes or ¶s` Q*tag*¸ i  Z B.  *W  Aan o2Qal diò4ary+1inge 9  +1. *>U* areˆ%alÕ + ‚ given ax±keyword argÍ± ÂExample form< WC<tag>Hö<child/>...</tag>tailO­  3 a= None 7"""m!'s`Õ ¨  1 D
#'sŽ  E  › C  öText before first Š!. #isÎ# aÃ Í sóÈ .M `Note t¼iL reà0no ~ 0, tSÎ {ute may* \ Èp €, dependj!on� y#erKæ ?ailæ Rafter… ðelement's end tað>g, but before the next sibling element's
    start tag.  This is either a str2 !orF ðvalue None.  Not\ Pat if !reO àwas no text, tP óattribute may be ^  H Ã or an emptym ,G adepend| n^ ‘ parser.
 2"""	 ðdef __init__(self,Ê ", t á={}, **extra)::  ò òif not isinstance(/ g, dict)  - òraise TypeError(", @ musb3 ,P u%s" % (g  >   1 õ.__class__.__name__,))-  ¼ `.tag =Á 
 A b = {** Ö }* è_children = []#Crepr#á ñreturn "<%s %r at %#x>Ç ‘ ´    qtag, ids&))i Cmake_ 	�y ô """Create a new“Q withï“same typeò IP*tag*Ÿa+€ contain' æz  _.4:  ãoionary> cGutes| !DoäBcallÖ method, usbe SubEXð factory function h7eadO  Á Ó   …Xq(b‹ `AcopyY
LRÈ  ´ of currentVx áczsßphallow 9 .Ã B`s will¬eshared˜UÈoriginal tre¤Ù 0war› s.	 
"i .w  ()Òò deprecated. Use‘   ) )B" 7  D7 BionWm ¡   _dgopy__(X __m ! ~ " =ôÜ ¯, ¨ u    7 .<   ›  5ail 9ail 3[:]  Â  < o^__len¶ , 1len,.	ò Nbool<  ¬?ingµÀThe behaviorhß	1õchange in future versions.  "Ë  ""æ specific '«  Û  )''   § 'o' testFl ,Ñ™cklevel=2t  v w8Ð) != 0 # emulŸ4oldó ¸ur, for now‚sgetitemJw, indexŸ�
h [& 	¢sH ,ÄQ (if»I ð , slice):
       òfor elt in element:
  óself._assert_is_) U(elt)- Jelse; 7 h ; ) ôchildren[index] =‘ 
d ðdef __delitem__(5 !, , )x @del  +._O E cappend@ 3subÎ E †"""Add * ô* to the end of thisŸ .[  /tThe new ` will p  ara@docubÁ order afterV Ñlast existingî  N  × (or directly8 Ñtext, if it'sJ ffirst : %),O ¡but before*  Ê @tag Ï 5"""> Uk , �. qk2 Ò6ext�Šs‹°Ô ÷s from a sequence‚*D G* is# ð  with zero or m* > ñ  #  ¼ sk£ã- Y ) ini¡á,þ 
I, 
«Ñat position *@ (*.Ú Ë(› U 	• ¾ (  q 7, eº `# NeedU0ref^òactual Python imp’aË P, notºgÛ# shadowing C. .& !if9 òisinstance(e, _EZ 7_Py–  ¥óraise TypeError('expected an 6 ‹ ÷%s' % type(e).__name__ÈcremoveÈ(CA"""R% ` matchÉ ( ˜RUnlik·Òfind methods,ˆ … compare˜¦s based onðdentity, NOT ON Pvalueâcontents.  To ¾ yEs byJ ¡other mean† Ðe easiest wayzÑto use a list› `rehens”%toG ´select what5s�keep, andñnK Áslice assignE c UpdateN  ¡ nM DVç Ô   çd;a|‹a could6‡be foundH J#� Pert iÉ  – (D Ý.W(ç1 Ü/`path, S¨spaces=NonA@"""F
ð>~ 1 byÛ @  Ú N ð.

        *pathð* is a string hav ñeither an element tag o ƒXPath,
  ²*namespacesK ð n optional mappO Ufrom ( ñ  prefix to full %.
Q ðReturn the first matchG Œ ,‰ ¥None if no£ —was foundM 5"""Y rY EÒ  Æ Ð.find(self, pÖ Œ Í )’ @def & Itext* €default=‰ ,8  %):v €"""Find A O forÕ 1 byd & à  � È * `«(´ H  `Pvalueˆ!ifwh Q2notUòP€ext contpowþÉ  Á %ifnn ¸ 	°  Note that-Ði,ò!no¢I ˆ ,Dmptyx2is /ei C>v9all2  Ÿg alw13subÌs`RŸ ca3Rs lis0ain		å â qin docu¯Worder@l•@iter–ï  ¯able yieldšB c q›Qclear˜
~TReset% Th0unc­� removes [7!, W  õattributes, and sets1 P â Vtail /  c (~ ‘ �.. .o %()W  ê_children = [] t != ( w  = k ¾$ge¹ðkey, default=None):
   ò"""Get element attribute.

! �  Equival #to" ò.get, but some impA õ	ations may handle this aM ÷bit more efficiently.  *key* is wha† õ to look for, andH †*default5 óto return if theª ÷ute was not foundÚ R0 ðs a string contain 
B ‘value, orZ | 5 if� 9m 5""". © Rself.:  Qc(key, ] )�€def set(+ !, ! Œ %):M O"""SÃ �[key] = O Ìr Ô Ìs6	Ç~ Åq  ÿ—set it to¸K D	Ò ?Akeys@
4 ÷wlist of+Wnamesk N C are]ðed in an arbitrary order, just like …ordinary3ÏPython dict.S¨ ÷ |æ rª í ./  &Oitemè ß1s a÷hequencîT:sú 
÷ Ì ð Ö• )Qt4 a |(s,‡i) tupl�a îAiterîª, tag=NoneøÀCreate tree - Gator      |bps oveøG£nd all sub s@docuF½ U 5 2 Àwith a match 7tagˆ IÅ§ �structure"±modified du´­ €ion, new£fremove,r  —!orž ñbe included.  To get@ablev@, usÂeÒ  µp() funcê1 on„ ¤65`resultá  = â A*tagúô@tagsðï# (	 ô ÜB,VnÓÌ 5  _kŽ h A–ag == "*"i •t  V. !is  �§* =…
B QyieldÊB @for Œ ¯._children8 pfrom e.qC(tag Brtex+óÀext iteratorC.

  ó The iterator loops over the element and all sub �s in docu  L ñorder, returning5 0innO 7extv 5"""6 åtag = self.tag ñif not isinstance(tag, str)‘  7 !is$ UNone:9  Ù ƒ  ta 5ext Jif t7 fyield " Pfor eë  ž + pfrom e.Aetext()]  †  w ie.tail x  - | ¢

def SubE~‘(parent, ÿ òattrib={}, **extra)˜ E"""SŸõ
 factory which creates anÓU,L’appends iû !to+ @xistÆ� ¾ 0’ “ute namesQ §   ñvalues can be either by“  or UnicodeÚCingsh *v A* isŒ À e, *tag ™ † 2, *) " n òan optional direacontai«Ô 8  utÊ aR* areE 3ddiD ' ñ given as keyword argË í4 S = {*Ÿ Å}` „ "= î S.make þC f$ ¼('  ÿ-
S0Com®(©=3: 1 ?‹�This funcü M… special6 m 9 ±Ódard serializô s0‚an XML c˜ m *Ÿ  ·# a ¦ ] 0  7 d4 = ?Ü  .e 0 =  z1ñProcessingInstru `(targe�;extG1  2  •² V\¶ X
pï  ð ', ’,0str–> ¼Ãents, if anyý ¯DC½Ó “  R'exÍè	 + " " +ý_PI = ˆ Ó


class QNamsÁ"""Qualified0 wr”rë è6 qused to( " aL  Ú2 uO ) "ge˜apropere  space handŒ„on outpuc³t_or_uriôÀtring contaiñning the QName value either in ñform
    {uri}local, or if ñtag argument is given, ÒURI part of ab !.
K P*tag*. ¶an optionalF Pwhich` L ‘will makeV QfirstF w ö (text_or_uri) be interpreted as a URI, and thisj Q(tag)L 5 ì S name· 1"""- ÷def __init__(self, ‚ Á, tag=None):/  = .&ag   4 è = "{%s}%s" % Ð N ¤  4  n .9 ( =t h — 3str–  ureturn > 0 ?rep1 �'<%s %r>'– > À__class__.__6__,W ¨ ˆ Ohash‰   :Ì 7 #le5 0, o‡Å áif isinstance( ,W%  %î 2 <=M n ü ' 
" Æ lãq j � (Ž & � gA>' � A>ö ª& � /eq8@=' _

# - 01


e@ EleXBTree;²"""An XML e £ hierarchy¤Tá> ðalso provides support for serializa{1 to2froé a@dardh V *o µErootŒ Qnode,”]*file-   p handleB  D!×  QwhoseH ‘contents pbe used±  }Ã “tree with° ªÊ ¡ , p  Ùv# asserØ 0is Ï ´ #is@ ( ¼ O=!# ° Ò  * !ifx Ó    ? `parse(• )* †0getV 0§ B"""R×  r o˜0is . a Àelf._root

 ó   def _setroot(self, element):
  °"""Replace ( " õ  of this tree.
/ T òwill discard the current contents> e= c and rc %itJ Awith= Tgivenx q.  Use  Vcare!{ 5"""= ³# assert isÓ ( )$  ò !._Õ =_ N  Sparse�source,  jr=None"ðLoad external XML docuJT into^ ð -*Y ò* is a file name or ’object, *y ( pn optioi  Ñ Ðinstance thatÞ€aults to’ PÐ r}  PError €raised iÖeé Q fail@ i �Ø I qReturns NjåÀë @ ¸cclose_, v= Falseà âf not hasattr(& ‡, "read"‘ º w = open+ &b" ( q 6Trup 6try - $if0is 
  # 0# I¦ ( ôwas specified, create a�™å  E   s6r =# (º  % %if0 A, '_
 {_whole' 4   ^# The… €, when i©ý	mes from an accelerator,© P 0canP 0ine1 #in� ÿ API for efficiency.N 0It Q @be u–"toPcÙ  à ¿out feedingO #it1_hunksu 	C(r.¾ D„  r D 	‰  whÚ [0cdata =Ï .Ên(65536h iX t 1 G  … Ybreaky   Ë  !(< 
Y ² " =d!r.má nfinall)F Ê° ¿k ¶  vCiteru?tagj CB4 xT 8  Ÿ` r‰l ÷, äloops over all¥Fs inÛ, õX ordeDB*tag–r stringh � 2tagÍ#tož ek ë  ™@(def¡ ~3to b‰ )¹ %Ý¾!is •b S & À.iter(tag)

ð    def find(self, path, namespaces=None):
+   ñ"""Find first matching element by tag@ 1 orN %.
= ñSame as getroot().z  t Ò), which is EM  )? *) *" Pa strx 0hav •either an‰  † o  XPÓ „ *Ü K ð n optional mappO AfromÄ ñ  prefix to full Õ ¯Return the,
 Ge if no£ —was foundM 5"""ª �# assert š ._2 ü @not N ( !ifh¶[:1] == "/"¯ ³ 6� = "." +* :   �warnings.	 (   ¢"This searœñbroken in 1.3 and earlier, †will be Æ  E   `"fixed9 òa future version.  If you rely oL@currRJ   be÷àour, change itžQ%r" %â ,È Fs Wí í, stacklevel=2, ) rÜ�” R%¤KItextOqdefaultL8  ]KŒ  ° ?), b" Â  ©fÿÿw˜ º,¤ @;±s9allråd alð¿3subÂsÃ"   « )Æ   )çdhÀfix to full ƒname.

  ðReturn list containing all match ðelements in docu g orderI 5"""U õ# assert self._root is not None( õif path[:1] == "/":      � = "." +* 	 0war¬  s.	 (  = À"This search~ `brokenÄ ñ1.3 and earlier, †will be Æ  E   `"fixed9 ÿa future version.  If you rely on the currentJ ñbehaviour, change it to %r" %â ,È Fs Wí í, stacklevel=2, ) rØ��.findall(U , rspaces)€def iter' (7 ,� * =½)£z"""Find-5sub0aby tagB 1 orP 2°Same as get"5().€  ¤ b), whi¼R ! µ  Ÿ*- *âPa str± eÓng either an @ Ž o VXPathm*K �n optiona ppV AfromÌ 8p prefix¾Afull Ý X!anU able yieldI ]ÿÁ	º^Swrite[€file_or_  {Š Ó`  enco,s °xml_declara£$ €default_] °& bmethod , *h Ãshort_empty_Bjs=TrueWØ c0ree a Ü  à7XML1ArgAsH0  *, B* --A  Á  =P ðobject opened for W2ingÆ>*?G  ”eoutputW# ( §: US-ASCIIR;  *cH Àbool indicatÇ if[GXML �– should bæ”  Padded*  .O e “ Z ÛJ  2is S &ifè ðIS NOT either of:
  öUS-ASCII, UTF-8, or Unicode

; ó*default_namespace* -- sets the  U XML # é (for "xmlns")O amethodD Reithe' 3" (I ñ), "html, "text"˜ i"c14n"H ñshort_empty_elementsV rcontrolž äformatting of ( ß é 
 Pthat M aain no Æent. If True² O ÿey are emitted as a single self-closedM Pag, o>@wiseˆ\  OpairN öof start/end tagsi5"""C rif not Á:  8 ! =ó2 Celif0 ; Úin _serializeB  raÉ ôValueError("unknown@ S%r" % )} ” ŠencodingT } 2== C
!  » ;  ½ Vutf-8¿  +lsª  p 5 vs-ascii8 Äenc_lower = _ . (º ð
with _get_writer(file_or_  I,< H )-' 
À 
á ÿxml" and (xml_declaration o( pis NoneE b ï  Ú  
Rin ("4D, "u  HJ")))²  J š 4ed_'w &if Çu[ X  \ ‘# Retriev�j  — ¶Bxml ˆ "w  L ßimport locale" B 
Ê / Ô.getpreferred~ þ `   Õ@("<?‘ Ðversion='1.0'÷ Ô�='%s'?>\n (ˆ &,)i g 
)X@›_" (œ ,œj._rootT eq»&s,Fs = < s(ëO ,Ÿ 
b  º / G  [q]" ¾ ., œ ,A  t  a= àAdef 3_­è  , Íô# lxml.etree compatibility.  use outpudv insteabreturn’k 5,ð="c14n")

# ----- ,ó
# serialization support

@contextlib. ðmanager
def _get_writer(file_or_ ðname, encoding):
    # returns R  7 ñ method and release all resources after usingF 2tryO  S D  = t | . 0 öexcept AttributeErrorB #< Q is a  Ç E  l %ifÑ Ö == "unicode"L  &  Š  = open E"w")Q Oelse= T=],P    eê ÷s="xmlcharrefreplace„ Awithì 
‰ Qyield J	° 9	Å-like objectŸ #?òdetermines if its’or binary r? 0# uBbur as isH  "ß $  ŽŠ# wrap a‘  3ÆTextIOWrappe¤  H  + 6°ExitStack()Š s 
m 6  Ÿsinstance9 óio.BufferedIOBaseT <    	þ  0 /elr ?Rawm œ Wô |  ñ# Keep the originals=Q when ø \ ËM �destroyedí  $ x`.callbŒ !~.detach�  B   P# ThiOó to handle passedîñ s that aren't iÂ � "# [ò hierarchy, but just have a"E  Æ 7 = �U (Ô  ¾  / Ðÿable = lambda: True` 1  . 
/ P  	“  )# ,   %#isÙ sK‡  K #*ÿBOM (for UTF-16, etc) should be addÿ C ÿ Cseekÿ   %. …  2 o.tell s   : ‚ ›   PH  z êNÀapper(file,
  ”encoding=	 /,
: ÿ errors="xmlcharrefreplace"D Ýnewline="\n")z ñ# Keep the original file open when ÿTextIOWrapper isH  �destroyed ð stack.callback(_ ~.detach� Qyield‚ ö.write

def _namespaces(elem, default q=None):} ¶# identify 9 p used iÐ ƒis tree
- amaps q* Q to *¨òed* prefix:localJ 2 + 0= {t  :  }M Puri:sL B e0b Å Q = {}L .ifË Å  $2 [ñ b] = ""w  $Aadd_š (  F ò# calculate serializedò ñ  representation”  4 6try‡   "if1 º[:1] == "{"!  % £uri, tag =- þ1:].rsplit("}", 1ò#" =aŽ.get(uri- #if•1 isx„  ˆ T  O_mapX  5 \  + ` Ö"ns%d" % len(®¹  6 a 0!= ÔB  (   L @[uriìt ¡ %   U 
qI [  F `"%s:%s² (Q °° OelseR  ï#Å ž9ent§ L ú Û  ³# FIXME: ca¾‚be handlÑ‰XML 1.0?u = Àraise ValueEN(&  . p"cannot(â non-qualifiedš with "? ¢0 opT3 w¨s¯ s ¢except TypÌ 
¡_ë _âÐ_B,R# pop^ 3 anâ |a tables 1forÐ 5 Øg.iter(Y û=# A.tag4  Iôif isinstance(tag, QNamž #    if+`.text x"in5s×  + Ü1tag2 ;/elp  7str¨  C n i d ðtag is not None ûand tag is not Comment  WPI:
  õ_raise_serialization_error(tag), úfor key, value in elem.items()T áif isinstance(6 [QName'  † Pkey =Y U.textn    if Ì šin qnamesh  & Aadd_  h ¯   
‡ ¸ ", ‰  x e 4 l  º " =  Æ 
�   	€    à / z Tretur!, µpaces

def ÒÁe_xml(write,¤ ,L4 ,´  9 Àshort_empty_íãents, **kwargsÍ rü !agG  © $if�™Ëœ ð ("<!--%s-->" % D è &el; ðProcessingInstruc®I M?%s?F &se) µ 7as[tag]¸  ÷ l 7Non2  6extG     Á á_escape_cdata(Á Â  #    C:F ²¯ ’ © ]  µ= œ (el I Ñ P"<" +¶+   ó€ = list(' "f * 'or�÷ /if 
 r  9@v, kvvsorted(ï~  J   ð	key=lambda x: x[1]):  # Z ¥ on prefix 3   —Æ " `k = ":<kF bð  xmlns%s=\"%s\"ú(4  d kç „Šattrib(v“ A  )  k@k, vk¿ë 
Úk×-  s  kíß 
P vP 3v =Ç![vW Ã o  Û    E 2¯
ªA[k], vL H¡ext or len')  šŽ:s .>"¥] ð :
               òwrite(_escape_cdata(text))
!  ífor e in elem:  ) ñ _serialize_xml(] ÿ, e, qnames, None,;  ?  Àshort_empty_p _ents= ¨ v ú("</" + tag + ">"( NelseÃ : $ // !ifí V.tail/ ' 
4 ¤ ' ô))

HTML_EMPTY = ("area", "base Afont r 0col Afram" <hr"&@"img$ Ainpu: pisindex @link 1meti Âparam")

try· 	’ Fset( ò)
except NameError3 §pass

def Ö'ht×6lemÚá0pacæ’**kwargs)J  „=Igþ c  1ext !if¯¢is Comment?  sê"<!--%s-->" % � R µ&elJ þProcessingInstructionX O?%s?U 2Ó ÖQ[tag]Á  ª {  ìj  'ex×     ß Ñ  #   ‚¨¥ “ 	ˆ #"<:+  ~ Ñitems = list(ð (v #   1if  F or 
	(  	 #  ð @v, kuvsorted(3 .f ,()) 9  ð	key=lambda x: x[1]):  # Z ¥ on prefixÉD Nif kÆ & `k = ":<kF bð  xmlns%s=\"%s\"Ï(4  d kç ;Šattrib(vº A  ²   k@k, vkYë  Ýàsinstance(k, Q6è H    k.�ß 
P vP 3v =M![vW z{ Û  E 
2_Ù7ò	# FIXME: handle boolean mOutesÜ ë
æ4[k], vˆ1 }² lmªtag.lower(Ý qU2if ; ð= "script" or ltag ==¿ "style":
   ½write(text)  Oelse6 	Ò_escape_cdataD 
E Þfor e in elemJ ñ_serialize_html(Œ ú, e, qnames, NoneS °if ltag notY ®HTML_EMPTY_ O €("</" + 4 R+ ">"O !if” V.tail: 2 
×  » ' ‡))

def ¶  7¶ Blem)K  ÷ 1par¡ ? Aiter, !  ˆl  ' ’ E  « 6)

 A = {´h"xml":™ Bxml,  Y
     ” 
   ñ#,
# this optional method is imported at the end of úmodule
#   "c14nY   B,
}
D‘register_èópace(prefix, uri&C"""R( 5 a *  * !.
á BThe N  ry¡ ðglobal, and any existing mapp  �`either¶ D SgivenW ! o o  URI will bj Smoved| *Š *x  £ a, *uri À �uri. Tags¥ �  attributesÔ|L | -dd with° ³if possible—  ValueError™ praised ' b peservedí  ÕTnvaliÖ 1"""• óif re.match(r"ns\d+$",w £ Éa  u 2("Pi „format rm  zPinterS3use‹  @k, vû Vlist(Ç_map.items()r pif k ==+ Â v ‹€ –   Jdel M 1[k]Ü  curi] =Û *

 gç# "well-known""| !es[ õ"http://www.w3.org/XML/1998/Õ1": µˆ3 `1999/x« +  , ð02/22-rdf-syntax-ns#; Jrdf": ñ schemas.xmlsoap¢ Pwsdl//  	 0 b# xml . Ú @2001ß ST  A #xs?  
. ’-instance7 i8 Ù# dublin corex Apurl® 0dc/�ents/1.1¹ 0dc"_0# FÁ1est^À troubleshoo
+y.î
 ±_æ|a _edøy% B Typ(¿  Š@"can²Äñ %r (type %s)" % G  ,   1)._ˆ "__ F �w "#  à character dat¡a
    try:	   ð# it's worth avoiding do-noth ÷calls for strings that areD pshorter ðn 500 characters, ;  o.  assume$ Çt's, by far,F òthe most common case in Õapplications.5 `if "&"% Ftext×  Û   0 =  ù.replace("&", "&amp;")F <F <F ,ltE >E >E gE areturn´ ž òexcept (TypeError, Attribut )ô ñ _raise_serializ+ _e5 (ñ)

def _escape_aG  D "#    ‚ute valuè	5v½ Ð /\"¼!\"½9quo¿à# Although sec¬� 2.11 of Ý£XML specifÊc stateSQCR orö ¾ó# CR LN should be Äñd with just LN, it ÷es only to EOLNsJ ð which take part� porganizâ0filgÀto lines. Wiûs¥ weü�  ? Rthese” ±entity numbú so÷ py do no×6unt¼ð# http://www.w3.org/TR/REC-xml/#sec-’ H-endÎ ðThe current solug°, contained`followž 2six× H, waF rdiscuss0 öissue 17582 and 39011ª  r r <#13#/\nH nH 0H tH tH (09H rn\__htmlsm¤..1Kð# ------------------ ó

def tostring(element, encoding=None, method H*,
  ó xml_declaration& òdefault_namespace 
; Ãshort_empty_| �s=True):) Â"""Generate £ ¡ representm ƒ of XML = !.
7 sAll sub õs are included.  Ifà ó is "unicode", af F �is return5 óOtherwise a byteŽ $ | *v *[ Ban ESÄ instance, *]#  op8‘al output} $  Hòing to US-ASCII, *”D ¡ which canN `be one-s"xml" (V ó), "html", "text" or "c14n", *% Ã*M „sets the› �ç0 (fD sxmlns")‘RHds an (î 2ly)‡#edv� containì !heX CdataE 2"""€ Átream = io.S¸gIO() iÖC== 'Ö`' else, B· + F ˜DTree÷‘).write(sa ðü  @ i= D = . y )- §ñeam.getvalue()

class _ListDataS;÷(io.BufferedIOBasÐÃAn auxiliaryQ   accumulatúàinto a list reD Dnce.ý ¯ó__init__(self, lst/ Ž  `.lst = ” 5  ÛAable5 0 Û  u- Oseek-  Z W 7, bZ Š ¦.append(b)a OtellŠ 1len  Å )  ­ŸY¤ –7 j ÷ 6  ¬t![]: C- = ­" €ÿ"Blst
Adump
À):
    """Wrõite element tree or ó>structure to sys.stdout.

    This function should be used for debugging only6 *m ò* is either an E€ PTree,€ „a single .m áe exact output‚ `formatL 2impD a� ðdependent.  In tª ñversion, it's written as anM óordinary XML file± 1"""  %# Ð  Pif no} �instance(Ú ,´  Í !):*  -  ( = / )!   .’ &e(fò, encoding="unicode"/ atail =¦°.getroot(). N ™    M  Æ[-1] != "\n"” l }   ‘)


def i@(ó, space="  ", level=0Ü A"""I*  È :AdocuM�by insertpnewlinemd[ ªZ · Eafte{s}*€ .%th [ Ú 7 �cmodify(() "en*±itself will¶ðbe changed, but ^  )Ä text of allA �s in its¦ 0sub“ J ¤be adapted¯ Ï ° Qwhite  ¤ IeachUR, twof  p ¢ ôracters by defaul}*2 j ~initialT Q. Setƒ±to a higheri ùvalue than 0 canÀ ¿ö s* ñt are more deeplyI PnesteÛAsideA 
.! GUif is3 L3  ! =•çL "if†F < 0Ïpraise VÒ ŸError(f"IP mustí ±>= 0, got {R}dE1lenî Êbreturnp# ReducBñe memory consumpˆ`by reuÍ	šrstringsfPs = […# +á *{]o  ˜_0 ‘_childrenG–¦ Ù# Start a new} ç † õafirst M �  ã  _) =Š 1+ 1|   6tryw  1 š Ê ( =t "s[! R ]G pexcept @x²U O " +$W  ‘ ‹ @s.ap(„  )V0 Í‰r( .´'p(b 7  " =Dž^  ~  J 4 
é Ïn  a  e T òK ,q  -   ¼'  - ¬ Àil.strip():
  Ñchild.tail =  ä_indentation

/ @# De ò  after the last3 ñ  by overwriting —previous O .O Sif no> ~ •.strip():#  z ‘   ( =I ‚s[level]  ² _. ÿren(tree, 0)


# - 0ñ
# parsing


def ’e(source, cr=NoneÁ ñ"""Parse XML document into ele  ¥ .Á *I ñ* is a filename or ð  object containaV Aata,.*œ "er? @n op»#al— ò instance defaul¢oš £ r… ²Return an E¢ ETree= % 1"""s  ½ ( =* %() .�  re  ? JJiter0 aeventsN[AIncrEBallyç  Ï iÇ ¾ ðThis class also reports what's go\Qon toÃ°user based  !heâ *  @* it°ðinitialized with.  The sup\ 2ed / A areU  è1ngsK Ð"start", "end  �-ns" and  (o" M u˜ ato getM  deÆ0ed <@spac½AformÊv).  If ½ ñ s omitted, onlyC ‡ ± !#ed@¨'y k ”a list ofo t� back, Õš ½s¾ Q°ator providÓ(7,{s) pairs8 ÐB# Us Äinternal, un¹Aed _¤Rr argÌÐfor now; WhenÚ× (e( 0of ’ ?  0Premovvt� an be killf ôApull. 0r =ÖBPull©Ç !s=Î $s,” =. a � p  N:try[ªwhile True  ƒ ¶yield from Ž b.read_| í ,  S# loaîq buffer    rdata = îP ¢(16 * 1024¿  &  $ 5 £  % ]breake ² Pfeed(@ 
] hroot =Û ²_close_and_¢_$ æ 0it.F 0 =  ¨ 0fin·
Ó 2if ƒ 
  ì  .% "()7ÊAIter  	 ÷`collecðs.abc.Iterator):
   ô__next__ = iterator(). 
% àit = IterParse	 &  @.roo" ANone 5delL ,9 
% òclose_source = Fals> ò if not hasattr(" ¡, "read"):=  –  w = open' 5b")$ e BTrue~ ñ
return it


class XMLPullã "r:& ðdef __init__(self, events=ì p, *, _pr � T# The ñ argument is for internal use only and mustû •be reliedÈ �# upon in2 ñr code. It will / Pmoved! qa futurC Wease.E ñSee https://bugs.python.org/issue17741£ Òmore details.uRelf._P_queu¼öcollections.deque(‚ 6.%% =0or q<ö(target=TreeBuilder()B â# wire up the o£ † ¥ reportingè #if¦ o ©4 Ã 7 ¶s = ("end",j ¬ R._set+ ú
õ ) (Afeed* g, data """Feed en¸d 3 toË H."""» … Á ñraise ValueError("| ÷) called after end of stream!if� 
:try  )Š .c Ù ­  $ Ñexcept SyntaxŽ  as excO S;·.append(excI_µQand_r¦_`[U#b° needs thisW€set its 6  Cõibute properly :(Â # )= é ~ Á P@   j 	A  T ¯  `inish I1ing… ¯ Ã rcfUnlikea, does» 0eleW3. U< “ (¢ ()b ƒconsume . as from` ð%Ž Ä .�±q  3 
÷ R$am_Ð over currentü¡vailable (,ª h) pair|E{S are Ó dË  SC  ›a ey3 ´0rie-< øQ  0 Ü 
U Swhilev
ú> # = ‡.popleft` ³Ôif isinstanceE[7ionP -   \ „   Jelse€   Qyield‚ Àt


def XML(ðtext, parser=None):
    """P ñ XML document from string constant.
1 ðThis function can be used to embed "L ðLiterals" in Pyth. 3odeG *‘ g* is ai @taint  A rdata, *³ * n‚  op{ #alÎ ! i  °ce, defaultB pto the º @dardß è r€ áReturns an Eleõ H " 1"""o cif notm 5 9˜ & =Z ñ(target=TreeBuilder())D - `.feed(ù  r„ Z à.close()


defV !ID, ¶+Ã for its IDsÙ {x(|à, dict) tuple,2PwhichÃ@  t maps e­1d:sr Ü µOltree =µ �ids = {}²  w ¬  Ì  3 .(u. ! =Î ’.get("id" Ff idk cds[id]4 c ? ^ ‘, ids

# ä =Ìq  AliaspXML().
ôóÕˆ °list(sequenlÓK7 4 ofî@fragwº*[ ë o  / dother   Éˆ  	 Ü ñ\/?# - 0—


class ¾‘ ¡"""Generic¯ ²structure bèZ  8Avertá	ÿRart, Þáand end method½AcallÚÞa well-formed{ s 1You…Puse t›Æ "to›  à ‡
¶  us#€a custom/{ wc, or aá!Rsome ˆ€XML-like $ma*c ‚_factoryÃn�      Þ0is î eù Ýto create new•ó s, as necessaryþ @*comE
y g À to create có6omments to be used instead of
    the standard factory.  If *insert_cE À* is false (6 ‘default),H c& � will notq B u !tok atree.
2 C*pi_q [ a  ® ñcreate processing¸ xructionÐ K Ô e Ð 1pisp Ë u Ú  S1"""– ðdef __init__(self, ele‘ø ‚=None, *C <  P* 3; h 4  	 sµ =F±,>rert_pis %):;  š á._data = [] #  Pcolle)  Ã )   0entA+ck( plast = â 1 #  / ) 7roo)  ) FtailR õtrue if we're after an end tagd ;if K Ç –  8% 2= CÒJ ((  
0 �$ =Š6 s/ 6if Þ¤   5= PCInstN ­ 	1  
& £ 6pisž )pi™ ��ž % 2= Eî
o E = 6Qclose3¨ð""""Flush builder buffers and return toplevel docuj„ .• ì asÙA lend  ._» ²) == 0, "miqJsÍ8 \©!isë O: †  X 6entB § B ô  _fÝ ‘ õ 2if -  ”
² \Š 
'  ¹ 0texcd"".joiõ  R )œ '   V  nJ  # ?˜  } ., ð, "internal error ( ) D  E  = ¬ – Oelse�  í !isz� ?ext�  E �  °  ;¿  ½,?Ãa"""AddØ Ú0urr4	™^ €.append(W )f Sstartg ªtag, attrsm ÀOpen new eleóment and return it.

  ñ*tag* is the ele- Áname, *attrs ôa dict containing+ H  , gibutes] 5"""! Ûself._flush() alast =T 3 = * Àactory(tag, ^ s6 #if%  ± :M  Ó =   À[-1].append( ? %elA @rootþ ONoneI   š g c _   …tail = 07 ~ ‹ @def �  0 f, tag)‚ ˆ"""Close¸@currËE¦hÅ$ Œ •  ._­ G.pop²cassert€ ¹p.tag ==Á %,\î  Œp   "end ü mismatch (expected %s, got %s)" % (<  C ‡ g &(  i1 i  ; o0comá( k, texttƒreate a ) 0 usí  "_f˜Z*H ' (   1 ofP4 .› …	§ phandle_n *le
 ¬ #._K  ,� in� sÓ ð $pië Rarget  =íø `proces‡ Ç instruction$piƒ 	_   GY 
EOdata: v, or ''A ['Ó 
V piQË 9)Y_± ¤#, ,;0ertB7rgsj O$ =( 0(*a #if9 9  â=K   ä v 
S    ³ á)( e \ ã


# also see ž2Tre½ 	 òBuilder
class XMLParser• 3"""4  qRure b2 @ for0 � source �based oncqexpat pP ’!*t´ŽPan opÃ2al  ð object which defaults to an€Stance|P—standard Ê  Ê ¢, *encodinCm   Ô 1ingJ s óif given, override}K Â specified iä sXML fil¡ðhttp://www.iana.org/assignÛðs/character-sets

 ñ(   """

    def __init__(self, *, target=None, encoding !):7  ; 6try   õfrom xml.parsers import expat7 �except I ZErrorF W  [ J !pyL ; asU  $ Y  $ Xraise| (˜    ò"No module namedn ÿ; use SimpleXMLTreeBuilder instead"N ) " =P !.P(tCreate(gV, "}"3 #ifŽ@ is ‘.ª7 = Ž (> Ñ# underscoredÌ õs are provided for compatibility only±  Ï1 =  _Å 	 
, :,  	 
,  _eþ "  ~�s = {} #¿ µ memo cache+ õ# main callbacks ¡ õ.DefaultHandlerExpand¢ d 4 ²if hasattr(´ —, 'start'û (] S dElemenb \ 8 Z 
?endX ?EndV ?endT 
v ?_nsY ± ÓNamespaceDecl
· &_nH?endd ?Endb 
= Æ 
OdataÂ ÖCharacterData½ ¯.9 Z ÿ # miscellaneous$ Ü 0comÏ  y 6 | Z /piU ýProcessingInstructionc %pi^ �# ConfiguÎð: buffering, new-style Ìpibute hEing.F Å8 œ_text = 1 …ordered_J  “& ‘doctype =¦C  0ent[ È è* °version = "©Qt %d. 3" %6# U_infoN ýAAttrì Y Ppass Wknownÿ“setevents P_queuÿ `_to_reÏá# Internal APILrXMLPullÚž ## T F ³: a list of B to b 0 duÄ �¶ing (same a�r# the *T *C 	w S's coF"oríÀ    # eventsò2_queue: a list of actual parsing events that will be populated
   ð# by the underly:  B Ber.
" 5  #
  ’ = self._  ƒappend ={ ¢ . % 2for  ‚_name in Ås_to_report:,  � "if! / ª== "start"&  * Ž ù.ordered_attributes = 1T  . òdef handler(tag, 0 B_in,q =Aw ", Å = ,M  Q  Ÿ =! )«  , L !((g !, + Š =)))k æ S‚ElementHÇ $ =Ñ 	5 .elC?endA › %3end?end0end÷ ?Endõ &b?-nsú  ò# TreeBuilder does not impb! .= N_ns(’iIs?(östarget,©O_ns"þ p¿prefix, uri€, \® � ˆ  2 Ž ï ˜ —OelseßÝ %¤ (œ a or '': ¨ 6ßNamespaceDecl<"E%0endTC2 A´* 
s : ”0 š‰1Í ˜ ONoneM?End+@'comŠ'OtextÞ]€à À       appenûd((event, self.target.comment(text)))
  ‚parser.C' ²Handler = h
 	0 Qelif d é_name == 'pi':%  ` 4defA B(pi_‹ r, data,A =G ’, append= ,N  R   Û = )v  $ D 
,piŒ ÿProcessingInstruction.se• ò
raise ValueError("unknownb %r" % U!)
  B_< e6  ó 0, vG ú  er«PÃ] ! B  ¢err.code =;  	 @posiÛ " clinenok u.offset2 ‘ G err¥ 0fix(¢ 7key   # expand q#  ,  €convert  õ string to ascii, if possiblev :tryX; =ç5es[key]1 ¡except Key= 5key0  +‘if "}" in™ 
3    t Q"{" +# 	>  ý .‹ * =$ Rretur[ ;ƒstart_ns<·prefix, uriD; b I.8 2 a or ''8  D<endb ] 1 [ P | ± çtag, attr_listW $# +1forPt's Sï 0Ele�  ð. Since ordered_M eibutes_Ñ# is set, then ! ð are reported as a † ÷  of alternatingG \ ›,+.  Ç W   ctag =  F(tagKY U = {}/ !if« 
M ihÐrange(0, len(D - G), 2J {     4ib[€   / v[i])] =m F[i+1
rx= Á »(ibÞ6endÜ‡ H  + $._•  M tdefaultQ  �` = ™'[:´  
 `6"&"4  	÷# deal with undefined entiti6 + 8   „_ÝíW  Á , HAAttrtN  ' 	: { .· !y[f1:-1]]V Z � Éð    from xml.parûsers import expat
  Rerr = }.error(#  2 ÿ"undefined entity %s: line %d, column %d" %@ ð(text, self.parser.En ¿LineNumber,8 1 Cj 3 )3  ýerr.code = 11 # XML_ERROR_UNDEFINED_ENTITYQ  ;  æ Ono =¾ 	9 ooffset9 Æ ; •raise err ðelif prefix == "<" and TB[:9] ¥!DOCTYPE":8  ºBp_doctypä[] # inside a  µdeclaration> v 
? ºis not Nonef !# ÖP …contentsM  ‹ 
Å >©  " 
n =i 	C  % Vretur§    
! =z.strip(!if¸  ' 
¸  = P  	ˆ q.appendÃ
W ‰n = len(/ 
#  z N > 2w �	< =[1]ï 2if + ’= "PUBLICþn÷4X  Ó Qname,7 ô , pubid, system�n  >  ¨ 5 \  " T " =\ O[1:-¸  ?º gSYSTEMº 3^ º ³ ‘  šÔ ;els¯ Ä   û   ¢if hasattrÛ“target, "//")½ Ì- .+ (Ñ   …1
( w 2y r �warnings.	 » Z D"TheœÀ() method ofP�ý  is ignored.  "D F   !"DM  ón the TreeBuilder 
"Û N ‚RuntimeWÆ -)
w R­ & �def feed¢g, data–Q"""Fe­ ùd A to ¦Fr.""â :tryÎt ) (] v, False¶bexcept_;_ as vL  _Ò# #(vå  ¿ QcloseÀ º QinishÞ ;ing¼ ú¸ð element structure."""
        try7:
  Ðself.parser.P õ
(b"", True) # end of data7 qexcept : ¿_error as vX  a_raise# 5(v)A :try- ò close_handler =[ qtarget. ; |  AttributeE 
M Fpass0 :lse qreturn W s (œ kfinall  �# get riöcircular referenceo  Y2delÁ V, _ ™ 	* ë *  o


# - 0ð
# C14N 2.0

def canonicalize(xml_ÞÓ=None, *, out “from_file ¢**options)Sõ"""Convert XML to itsm ñ serialised form.
ý ðIf *out* is provided, it must be a s 1 or ó	-like object that receivu8theh Û ‘ ñoutput (text, not bytes) through¯ Á``.write()``¡ Ámethod.  To   Ù • `, open­ 0in V ñ mode with encoding "utf-8".M î  � ò �this funcR – s Ð · "asc cstring>„Either *·Q* (aní ' )8*¹  G� path or•  `X)|Ÿ  ÑSinputw ÑThe configura± 
A areµ @same6 1for  ``uWZ!rTÊ"``1"""† 4if Æ   €U and ½  m 1OR Valuù#("'J ' 'C 'Ú "ô`sio = } • >outz '   a= io.S”BIO()ÕÝ  =ŠF"r(Æ=B(outq&, PG  1 š h U.feedºÈ   ÛÓJelifRU (4", H = › ¡� sio.getvƒP() if  /W R elseP�

_looks_Ã�_prefix_n(ð= re.compile(r'^\w+:\w+$', òUNICODE).match


clasXPNCÕ¡»"r ‡ �—2XML ÙS¤sö p eventsó Ó ¾ 9.  *Y *»Cis uä0  ) Ë`result  dq streamiÞ(9—s&Q wC 	ÝÀ`` method.

ð    Configuration op @s:

 ð- *with_comments*: set to true „include " 7 ®strip_text4  ð whitespace before and after 8 „ contentR ÿ rewrite_prefixeŒ  @replO 3namY , ô  by "n{number}"S q*  _aware_tagS aá 1of    P tag + @s in¸ 4ch Z K  + £should be ™ d? Û l ˆ Oattr‰   _ibute�   � !exÕ_o 	Œ   € DthatX 0notì ¡serialised4- *N bVG """µñdef __init__(self, A, *,p 	‡	¼�=False, ~š Z P ¨ Î b=None,+¿ @ 
 Gs%   P %):9  á !._á " =é  ›data = [] 	ú  < Æ, ' =& ¨ ¼  ) 9et( E) ifÎ & Pelse $L  ô K   	J    I J »< =  2 iÕª Y k 8oå¡  )X  � I 	� 3H Xfind_ * —    ).intersecÉ¥ ] « ? €# Stack X‘ globally±ânewly declared˜ Õ£s as (uri,,…) pairs.T o: Q_ns_sd E= [[%  ˜ñ("http://www.w3.org/XML/1998/˜ q –", "xml")	]	Á Ouser³  © e» ² j 0if ‡ÚA å.append(list(_Ò Ö_map.items())p8< ,[]" £ E T = {}SÀ self._preseórve_space = [False]
  ûself._pending_start = None# Ároot_seen = D   0done   ñignored_depth = 0
A ádef _iter_name¦  s(• @, ns� äck, _reversed=	 !):>  Å Ffor < 6 in/ (C /  3 'if2 ÷:  # almost no element declares new. w  H   ¨yield from& ' Ü áresolve_prefixæ à  !ed ¢  ,O 2 =  ' á.split(':', 1)f  …  `uri, p  ?.U/._4p =m ] ]   ðreturn f'{{{uri}}}{t%}'ƒ ñraise ValueError(f'Pó " {Â Ã} of QName " Õ …}" is noudÆ gcope')'qs = `, uri=­? if  R   
Ë $atag = A c[1:].rT}T3 if 0:1]Ò'{' else ('', y  
c ^ »  ?$esAFset(E ¾,éû •#._˜dÊu· turi andV  ^#in ‰ 
¹  ¨ ç² €}:{tag}' Qtag,  5uri B & a R.add( È # 8# Në¡yet => addkà eation.Z 2if ÕdrewritN*esÃ ûn. { J_map(  †  - =+ F[uri  + å  A ¡ = f'n{len±. Vmap)}6 I Ú ø  ÷p[-1].ap›!((¹r )9 > ³ G !''u ®� default“¤d»#noXv needed¸¡ .  3“ ü½óè^+Á #f'¶â  m ot”
� ï# As soon as ac  is Uined,M  � ð# anything that ha=œð(and thus, no pr÷efix) goes there.
  ²return tag, Euri
" ò0raise ValueError(f'Namespace "{uri}" is not declared in scope')I ádef data(self, %):c !if>   ö ._ignored_depth$  ° !  H €.append( )c c_flushe à_join_text=''. s  9 6 = $ 5  ._ )™ Fdel u 5[:] #if Qstripf G andÈ ‘preserve_*J[-1]Í  j ! =.E (x ^  å ”ing_startfJNoneL Sargs,‘ 
3 =  , C Ì  [RqnameÇ ” " i²Ö à_looks_like_prN_0 ^ elseR 8¹ "(*¡ e ë  } 6if  æ  + ¬» ¥ q šroot_seen" ð write(_escape_cƒR_c14nÉ I· 1_ns", ô W, uriD¦³° ò	# we may have to resolve s8 ±ˆ contentè Â  ³ Ú ùW.  ns: ck~3D(uriÒ )ó ð _attrsï Èexclude_tags®+(´  ¯  ‹ 	$0 orj ï  S s ? I+= 1h gš/E 1newÓ­Vs = [ì£ Ü_UQ
; R º † ÝOawar56tag. 
ï`# Need;aparse /Pfirst 0see¹Óit requires a¾�Zation à 8(,, ä  ß  |N AC 
{  £-rtzu ,$¤=À(jH¼œ 
O ð = {k: v for k, v� €.items()UkÝ ÚYelf._k }„ ¿ B{A*H }î   ñdn z < 3# Rre B Qibutea , õÄ?Àone:
         ðqname = resolved_ !s[ ó _text] = self._# q_prefix) ((  )
O   Rs.add#  #ifO Qfind_( ñ_aware_attrs is not None and  :]  ˜ I (% x  š Aif q 
P   1fork × ? in)  - @valu5L [ 7 ]¦  )   éif _looks_like>H )�  7   �7 ˜# 
ý  Q  Y Ÿ " Nelse• :! =›ê , 
( ) ’# Assign ? eseõlexicographical order of used URIs.A Rparse1ûÈ 
" T‡s = {n: 6 @(n) çnz usorted(<  ø N õs, key=lambda n: n.split('}', 1))}
5 �# Write 4ñpace declarationá í Ø &..Î aif new7s: sqT…list = [p  ¥   ³('xmlns:' +O4 if
  ’ ! n', uri Duri,3 +in� 	r 
×š .C(]  x 
Å ù# almost always empty[ M  ç ]Yñ ... followed byœBibut8@URI+uYS !if( L î Gk, v÷ x Ÿs.items()� )�kF ã ŸV =
 °  2v =�¡[6 j[v]][0l 8  « ö,Ý 3ØQ k> D# Noæ  N GÆdefault ('')Å¥ €    6 _Ž�.append(]–  z@uri ÿ¡ 8v))Ð±Honour xml:ð+ Š p  p_behavi. =& ðs.get('{http://www.w3.org/XML/1998/= } '–»‘preserve_ Æ 8 ä  | 4= '7 'å ! 	= ý k I[-1]1vthe tagú wHj a  1('<î B0tag4î ¬
‡E À'.join([f' {ðk}="{_escape_attrib_c14n(v)}"' for k, v in  £_list]))
  µwrite('>')
 0# W õ the resolved qname text content.1 "if _ Åis not None:#  o l ­ Rcdata¬ qparsed_c $s[s _r !s[ Z @]][0¼ U ûself._root_seen = True óns_stack.append([]ë @def   F f, tag)¯ 0if  ö ._ignored_depth   Ï !  U -= 1€  % ereturn X  ý O fflush( e :Rf'</{ (´ @[0]}¾ m     ýpreserve_space.popT 7¿done = len(9 8) =Ñ # PdeclaZ_   rqcommento ,P
w ;h Swith_/ s,V®3 
b ƒ  V('\n'’%elÅ< z3and1Ù$5!--Ç QH)}--â!if`¢ ƒ ¿ �$pi|parget, ² 
„[ M¤é  
  af'<?{té /} aý q}?>' if
h else 8 ?}0
ûú à»"# Æ¡ character� Ï 2try%  Ô ð# it's worth avoiding do-noth Qcallsûö strings that ar`# shord †than 500w à, or so.  assuõáhat's, by far,’ ‰  "0mos�mmon casek Éapplications,0'&'%  ü Ö  Q   ! =÷.replace('&', '&amp;…_if '<F <F ,ltE  ùnr ‹ >E gE /\r‹ !\rG 8#xD�  Š añexcept (TypeError, AßàuteError):
     ò+_raise_serialization_error(text)


def _escape_attrib_c14n   :
F "#      ‘ute value 2try&  *  if '&' in _      ! = ñ.replace('&', '&amp;')O  *  F <F <F ,ltE "E "E =quoG /\tH !\tI <#x9� /\nH nH AH rH rH DH Rretur§xÐexcept (TypeE!1, A"ut )ÎV?# - 0õ

# Import the C accelerators
zó# Element is going to be shadowed byA 2imp+ �. We need0 Akeep#, ñPython version of it€ ðssible for some "creative"g Âexternal cod!Â# (see testsä_¯ T_Py =¼ 
|  U, Sub BPars‡ñ, TreeBuilder, XML ñr, _set_factoriesN rfrom _eò btree iN* K Š’pass
else 
6 @(Com”ð, ProcessingInstruc†ø,)
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# Ð ppackage)p0t-
# The“ jp toolki[ð	
#
# Copyright (c) 1999-±  ûF¤ QLundh- ð By obtaining, uÑ, and/or copyªÄhis software ðits
# associated docuN·€, you agÑAthat ðhave read, understood,F `nd wil’‘mply withâafollow„ @erms| ` condi !s:Â aPermisqto use,¹ �, modifyÎ @ dis8 tÎ o
# itsË G¡any purpos¢ Pout f± 	ðhereby granted, provid· þ  Qabove› �ðnotice appears in	Bpies· ;!bo/at=  1nd Ð p9
# Z  ê0sup¢ H¦aA a½ñname of
# Secret Labs AB orŽ`author_  º@used] padverti: ) ó publicity
# per[ ¾„Àibution of tøáhe software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SEC¯ 6OR ® ð
# BE LIABLE FOR ANY SPECIAL’ ðDIRECT OR CONSEQUENTIAL DAMAG“ 2 %
# ðWHATSOEVER RESULTÐ �FROM LOSSÃ �USE, DATAV ðPROFITS,
# WHETHER IN AN ACTION0 ðCONTRACT, NEGLIGENCE; O. £TORTIOUS
#3 `, ARISv 0OUT@ OS RCONNET ˆ !USI ÐPERFORMANCE
#2 T˜_.
# - 0ð"

# Licensed to PSF under a Contributor Agreementy òSee https://www.python.org/psf/lP R for  °ing details@ ñDeprecated alias* Áxml.etree.Elj ¿Tree

from  á import *
"""Pƒ ° interfacesÍ ó+XML parsers.

This package contains one module:

expat -- O qwrapper  ñ James Clark's E* ] ,­  n! dpace
  0sup£  .
£   I   Ÿ 3theH °non-validat+¸ S."""
è 3sys"py©  *Å„provide  2sub× As asA­ "s.<   S
sys.,  ['k	*   `el'] =(/el/ aerrors0   ø ¡Simple APIL á P(SAX)ÄîQation |±™  ß Ls an4 0of JVSAX 2‚;
informX  abL ' €Java ver8 ; 6ð can be found at
æåô	megginson.com/SAX/.  The,T pis
docu= ñtt <...>à ‘ ¥ `followÿ °s:

handlerž°Base classedÎ÷stants which defineyš  Ð'client-side' E ·„€saxutilsw IÄ Ç T=¦convenienc” ¢commonly uWx R work2ÀSAX.

xmlreas?-- Û 2Ý Æ„  O Þ } ÐDriver that a‚s=   •óÀ  ¢¦.Ê š³InputSource# Æ! àContentHandlerô, ErrorHandler
from ._exceptions import SAXE , ×NotRecognized ?\
  ‡SAXParse- �SAXNotSupd G ðReaderNotAvailable


def p` ¢(source, hÕ 7, eã =ð A()):° 9 ’r = make_ '() ³.setContent,(_ & 	` z 	) c ª )½ �String(s Ã ©!io¶ )ifö ‚ is Noneî  ¡š ) =	ù M® ánpsrc = InputSÀ† Õif isinstance3strº Ì i? £òharacterStream(io.R#IO< )‡7elsA FByte<   s; »!r. (: �)

# thish2the‰ð r list used by  _P funcdð if no
# alternatives are given asO ¡ameters toI = ;Caultµ_s ð= ["xml.sax.expaQder"]¨ óell modulefinder thaté ing sax poëSially 's J ò 
_false = 0
if  ]ˆ  #

 pos, sys: 0not ó%.flags.ignore_environment and "PY_SAX_PARSER" in os.& v ?def & [D ô].split(",")
del os

_key = "python.Ã ê r"¯ ñsys.platform[:4] == "java"©   ðregistry.containsKey(Z ±ª 	: £getPropert: ­ ò	¨  ú=Ò€"""CreatKÀnd returns a¼ PQser.
}'   Sfirst 0 itÏ _ v„�tiate of…AonesC ©!in Aiter5 c€ üPchain\¬  2>  t.  The K ss must Rf Pnames‰ P­I Õs(  p Ibothõ  v 2 a œ 5‹B."""3for_j  s Z(À O) + »  � —6try   …) _} S  g œ + ‚! I~S
K J F /  ir¶  YB À          # û The parser module was found, but importing it
  ý## failed unexpectedly, pass this exception throughC Uraise 0 õ SAXReaderNotAvailable:&  † .# » 1det„ Ð that it won' Ërk properly,F öso try the next onŽ  h  Ì 
4 ª › C("NoG=ò'", None)

# --- Internal utility methods used by make_Šò

if sys.platform[ : 4] == "java"
¤def _creat9 (@ b_name)%  Ã ófrom org.python.coreØ  Ý  ( Rdrv_m= .üHNameZ õ , 0, globals())? vreturn F .� c)

elsÇ½ O R = __“ )__‘ ‰{},{},['p /']› 0deltð
"""Different kinds ofö$ EÌRs"""
‰ 3 ®:¬ƒ ¼0.laKUR 
~ @
# =  q ’EXCEPTION @

clX5SAXŠ (
 ïð"""Encapsulate an XML error or warning. T�P ±can containË]basic3 0 inŠaÌÎ aeither9 d {1 orE  Oaapplic2 `: you j 2subw Pit to–�vide addi[ !al? Bfunc @ity,º  to$ � localizU b. Noteì@alth_h 2wilG ‘receive aO¿  a�pe argumæ!toÆ  handlers i®E:H   iÄQface,g ð
are not actually requiredÙ -Ì  ×Âion; insteadC 1imp= !ad‡ i“0it.sO 9ö_init__(self, msg,j =NxþA"""C%sŠ  Åe message is¾ ÷	¶ y  "Ais oÏ!al’      ˆ p._msg =Ž 0  t & =§ $ Ã-._× !)
'  ô BgetM­ ö ð } ""RyaÎ  fo˜!."I  / §› 9msgc � e vmbeddedÍ £ x0 ifÅrGOnonez € S__strÖà ¿` a str‰‘represent Ÿ– àr ì Àdef __getiteóm__(self, ix):
  õ0"""Avoids weird error messages if someone does exception[ix] byH ômistake, since E( õ has __getitem__ defined."""= ðraise AttributeE„ '("6 €")


# = ò SAXPARSEEXCEPTION q

class Earseƒ E(SAX û ð"""Encapsulate an XML p8 Áor warning.
© 7Thi ð will include informaó for locating theP !inF   �originalt ñdocument. Note that although? PappliO !onu G žreceive aï 2 as8 !rgY 1 to °handlers in G jH ° interface,   x ñ	is not actually requiredE 2to Á Ü !ñ; instead, it can simp<  ada < 9 in* @and J± a differeny 3ion‰Sbt�‚is a sub ofõƒ �inheritsx  « pability Æwrap anotherä¤/ ¥def __initFFmsg,+ ,ó#or` ^r"CreateŽ0. T  parameter Ã `llowed“ †be None.&Ç.Ž 
)µ  „  ò!._�Dor =¦ Ò ! r# We net @cachƒñis stuff at construcÜUtime.] ^# If ˆdE`objectrÑ×which we mustI €traverseú 2getV ðmay be deleted byC � F æit gets caught© ²systemId =  S.getS (;ocolnum3 ÍColumnNumber7 Oline8 ELine6 ½  ^9getQ  ¢ L ""7ct ! nu   o~Te end �text wherÆeŸg  ïloccurrSeturnñ !™ ² —  •  ì “  ‹ ž r‰  W 9numŠ �PublicIdÊG41e p! ´ identifier  /ty‰  Í or'€ )— >— {— ;T &IdŠ S__str¡À      "Creatðe a string representation of the excep C."
  õsysid = self.getSystemId()# 2if & …is None:  D  Æ= "<unknown>] wlinenum_ ªLineNumbera * c  F= "?] :col\ oColumn^ + ]  
\ ²return "%s: � %s" % (î #, ’ ", > ,?°_msg)


# = ò SAXNOTRECOGNIZEDEXCEPTION  q

class' ÔotRecognizedE§E(SAX )w5"""  @ ¥for an unrC Ñ identifier.
¯öAn XMLReader will raise thisñ when it is confronted with anI 	g ðfeature or property.Ð q applic~òs and extensions mayJ  Ç ýsimilar purposes."""QSUPPORTPSupportO(sB  Ú Ì M �a serviceWacannotþ pperformj`requesið(specifically settÎ ×!atfavalue)dF h/ ud? 
h
¸gOÀNotAvailable³>Not}¿P missì Odrivµ‚module (" �) shouldÇ
ä ²is first imb, e.g.ë#a æ" m_ ¢5 be/ .F pIt also½  =Ad duo0par½ Y ‚if execu¼nûArnalH aprogra÷Ñnot permittedê îBSAX ã  Ù ¸“pyexpat C¥ @.  T·' Qworks¤
* `.__vernà__ == '2.22'.
` 
 õ
 = "0.20"

from xml.sax._&s* *" thandler a_valid&$,  ¯namespacesC / _prefix7  \ aF_ges|  pG <¯_interning³ 
ïR_xml_: ,D P_dict _ 'Bers.ÎPdoes L! IžòError in Jython
´ €
‡P.plat9ð[:4] == "java":
  ô  raise SAXReaderNotAvailable("expat not a ñ, in Java", None)
del sys

try:
    from xml.parsers import N ‘
except I RError6 ‰ 0supM %ed� BelseC !if¬ �hasattr(p A, "P‡ ‚Create")+  ¨ r &á 4saxÝ AxmlrBð, saxutils, handler

AttributesImpl =/ . * /NS,  òf

# If we're using a sufficiently recent version of Python, we can use
# weak references to avoid cycles between the Öä and content
#ê €, otherwTöwe'll just have to pretend.,_� ?refèdef _mkproxy(oÅ‡eturn o
[ S  ë; $ = .K ° Â- %, Š â
class _ClosedD<@passzP--- E"ƒLocator
3  (.& ¼ 3""" à for use with bA r  † !.
© @This* 1s aÇ ² ] : œ`object aÆ ü1ingF §a circular@ á T åã.E 1""" ˜â_init__(self, „ ç  }  v._ref =Ä& Ù  F ñ getColumnNumberM E 0 5 = N €  ` #ift #._& !is�¯ #   r* ¶;  7 ? .–� 	¦ OLine¤ L1¡ ˆ 	Ÿ �PublicIdA! 9%¥source.get )– oSystem– f ))
ºe	¹ ¸²Incremental ,¾Ä©Ñ"""SAX driverØ A!pyŠ  C module.=â ø_> namespaceH<óing=0, bufsize=2**16-20o  Ö`¨ .[ F À)
        señlf._source = xmlreader.InputS C()
   se/ Ûparser = None Õnamespaces =  ‹Handling- Plex_h er_propS  o ¬ing = Falsq ûentity_stack = []d ¡external_g“ 0  in _ Ï   a# XMLR
‘ methods
 @def �  e(", :!):  % "P0 anB ð document from a URL or `%."> O ð = saxutils.prepare_i�©(' )“  v  � Ç  V 6try¡ / WresetÜ T_cont˜S.setDÆ ÔLocator(Expat  { )" F F0cre!al/r.= ¨ jexcept« ó# bpo-30264: Close thexò	 on error to not leak re sJ sxml.sax„ ð) doesn't give accessI  ` punderly² r¥  á #' Zcalle  0._cª ¯
Rraise»NáV#ifò ñ.getSystemId() is÷  ¹
í † » ƒ.SetBase7
C Eñ# Redefined setContent·e^°allow chang¶Ps dur  j  à' × E Û 9 2.	F o  ’ !œ?ingñ	Ý(þ  ± ”getFeaturÛ ½§ !ifÏR == f( _" ì
o rreturn „% ­ /elM   stI_�S $  ^  Din (¬ µvalidation,À Epes,@  O @ Ç —_prefixes / õ `æ s +geŸ@ 5' ™ 9ñ SAXNotRecognizedE5Sion("ÀQ '%s'r& 1" %¿ñsñw, stateÜ Z” ySupport“ 0Can˜4setvqs whileFCing"’  C w.'  3 ¹ -~
À_ges:
        ñself._external_ges = state
  ð   elif name == feature_string_in9 Eing:/  7 "ifD 
  s : Ž is None,  0   - I= {}k ?els;  7  c 9 Ó ªvalidation‹ Í ðraise SAXNotSupportedExcepF (o  É  ò"expat does not s8  ~ %")9 ¨ ­?pesª YTread } ÿ parameter entities¸  CÏspace_prefix¾ ] ŸÈ…  … 	· Lâ�Recognizã
""F!Q '%s'ár7 1" %€ !)
áðdef getProperty(´,! ×{“handler.p1 “_lexical_ 5  lpreturn U .* & _? €  & 	a   Š Ö__dictX ˜Q 3xml2
M  [jparser    ¡if hasattr"._) þ, "GetInputContext")=  A 	= .; (p 2   U   5   ÿ"This version of …getting"R =  ¢" the XML „À ' » · ªd @ can­Abe rXqed whená V ² Gn 6"ô&s&,4'ueù-&&" =b 	‹	³ù ‚M ]resetyl{Y tŸ R |À            ÿ2raise SAXNotSupportedException("Property '%s' cannot be set" %
   dname)
/ Uelse:   Š �Recogniz‹  ˆ r' Œ  � € ñ# IncrementalParser methods
! ödef feed(self, data, isFinal=False)Ê 0if š  + –._parsing  è  freset( 4 q = True�     : ð_cont_handler.startDocu¿ "()±  , :tryw T# The· ù parameter is internal to the expat reader.‚ p# If it5 1set0 Crue,2 òwill check validity ofS JntirÎ 3# d¸ a. Whend°ing chunks,8 Qy areQ normally fw+ -— e²  wH úinvoked from closeÅ G œ1er.ñ(Ô–V «.error as ¸Pexc =BK ;6 E6 ðString(e.code), e, … i  ²‚# FIXME:Å 2to È  x 9()?ò  ? U._err
Qfataln C(exc
 »_q_sourceÄ¯ ! =� .% j E@file- L û.getCharacterStreamÒ1if 2 !isÄ;Non< ø  " .¤ > ælÃ * 	~ OBytey 4ô  /Š  `'1if :ó._entity_stack or8M  ä 1 orO  Þ   ƒisinstan`er, _Cžd9'r)p  6 l!wepcompletSan ex°� @, do`h +hegereturn� Ó ê .ß6b""Ø }
 ) 
~7end| µ  -   • != '…  & ó	# break cycle created byLáas poinù Vto ou› D  n Per = „l J1 Ÿ -ifÛ Ø [ 
X „ q# Keep ~òColumnNumber and DLine fw g:ingš L  4Æ 	 %   ) .u Í! Ð
            ÿ    parser.ErrorLineNumber = self._ 
:  - # =U 	& " ñ close_source()
" ð	def _reset_cont_handler(2 !):#  k   � òProcessingInstructionH9 E = \6  :  R t /.pX M 1 ÖCharacterData{ $ 	U c* sñ 4lexð \_propõ 5lex‹, — ‘ (   0if F vis NoneP + †.CommentÅ  * A ) ËStartCdataSes3 ?End1 d ¿DoctypeDecl– ?End0 ?elsý Rlex.c : s#ODATA=  ; OendC9 qv "_d6__decl~ )} 6DTD¡‘�#ifªnamespacesQ� 5¡ = expat.PcaCreateR .ù.getEncoding(), " ",¸  { rintern=x  Iing)F  ìº ß_prefixes = 10 y:Ele!S ue ?_nsE ?EndC Oend_A  ­q Y%	™ P  GP V&	Š Ô .#ž £ ; ¤
5ú# ö!Un	 zdEntityW) u! !_e" 
C" }P.NotanE  n > )N>D  U¦	Ì	‰ ?EndI 	 [G ð
        self._dó
ecl_handler_prop = None
  Éif self._lex) :#  * $ ]reset* @()
#$  ) ò parser.DefaultH€ / =( oExpand. ÖNotStandalone\  #  Ï ‚ õExternalEntityRef0 ( e  !_e! E_refø ?tryZ rSkippedY V s U €Y úexcept AttributeErrork ù# This pyexpat does not support ~ Y  Epass 	Ž‚SetParam³ …Parsing(,  = n ð.XML_PARAM_ENTITY õ	SING_UNLESS_STANDALONE)
? k ¦ing = Falsg e¢stack = []? ò# Locator methods ðdef getColumnNumber(H )+¾•1 isÞ!  Õ areturn ®   O "._= .‡n 	‡ OLine… /1‚ i 	€ ŒPublicId	Ê ¥source.get/ £MoSystemF / F ƒ# event Òi [ Ñstart_element£ ×, name, attrs³sDconto.= E< 6 bsImpl(E …  p ?endn  g 8ende N � P ?_nsÁ 
apair =Þ ….split()Õpif len(# j) == 1ŠA# no9 Fspac ¥ 3 @ = (�;V ,elX 3X =   Q[0], 	 %1]— Jelse2 2# dœ� RtupleÏ � « 1new�U = {}d q¹s `for (a ², value) inw.items(² [ @partD 4 ^ " ƒlength =h6rts(   *#    ƒ  Æ 1 = � Ü     aY¦% 
 «� ¨ D b ±"%s:%s" % (ö ![2¹jrts[1]U  7 { , å, 	¦ êÀ
             ð# default namespace
  q ½ = parts[1]! áapair = tuple(' ))
& ‘newattrs[+ Š] = valuk g "  G ðself._cont_handler.startElementNS(† y, None,} Ì  ôAttributesNSImpl(¬ !, ‚ #s)Ì ’def end_eq @_ns(” ,:%):s  ‡ ! = ….split() aif lenª f) == 17  š ; (Ä B ; ,el= 3=  D Q[0], 	 ®Oelse2 ·#irê  ‹  Û o?endm5 ò# this is not used (call directly to ContentHÁÝ  Xóprocessing_instruction`Çtarget, datah¢  G IF 	@ Q­ * character_’ ¥   � 7 !s(- Š  þ È_f�S_declW ¿prefix, uri^ D P. ˆMapping(< m  Ãk f ?endd Ì xdoctypeÊ  t À, sysid, pub ýhas_internal_subset€ 4lexñR_propöBDTD(R K Y ˆ þ unparsed_entityŠ Lbase� @notayŒŠ 4dtdŠ ._ E^ D±� ,Q …i ë@ — ˆ 
I ‚ #exh3refd T_ext, | 
 ifÎ  vM :gesT‚return 1ì Jtource =; ÁrresolveE(Ê ;   s? òaxutils.prepare_input_  ( ù ] ” = õ.getSystemId() or·+  #""p + ) á_stack.append(w!._ )r,ƒ )@ % = #.EÌ9PéƒrCreate(ÍH â Ð = source

    Qtry:

  ðxmlreader.IncrementalParser.p å(self, source)< jexceptL õreturn 0  # FIXME: save error info here?
F ] !._i 0r, k #._k # = õentity_stack[-1]> ?del# “ 1s Ãdef skipped_V qhandler‰ æ, name, is_pe)Ü "if   =ô# The SAX spec requires to reportk õ  PEs with a '%'¿  E  q   = +  
Scont_¢ .¹ E(.  )

# ---

Ù ccreateLÀ(*args, **kw
 Î RExpatå) T Pif __g ò__ == "__main__"!imä pxml.sax QutilsÂ Jp = � 9Óp.setContentHyA ÷ .XMLGenerator()9 EG7 	 . Qð@("http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml")
"""
This module �pains th ð
re classes of version 2.0  Áfor Python.
H °file provid5 µnly defaultJ &ð bsolutely minimum
functionality, from which dri| À and applica) Âs can be sub§ €d.

ManyŸ Fthes¿ ’are emptyE ñ	re included only as docu \ 1
ofðinterfaces.

$Id$
3
�  ÿ = '2.0beta'

#= 8ð
#
# HANDLER INTERFACES f 8=
P d ERRORq  !

V •"""Basic  
 Ð 5 cIf you/ð an object that i¤ y v&isT ,‚nm€register = H‘your XMLRà2  °r will call5 F `methodb  � rI Í - �warnings)Î  s.!reD  I±three level& Ä available: E ², (possiblyåprecover& 3!s,i .un d. All µ atake a„ 1SAXÙE  ˆa<eË¡parameter.« € ;¥ Ù3ion3 $ "v= a Š !."w  & eraise @ sQfatal*d Onon-h "Ze Àeption):
     ð"Handle a warning."
   ðprint(exception)


# = ò  CONTENTHANDLER ò 

class ContentY !r:O ò"""Interface for receiving logical document c@ ‘ events.
A õThis is the main callback iX ±in SAX, and( �one mostA ðimportant to applicaÖ ó s. The order ofv Q in ts ^ E bmirror† 2  “ ainformQ ; eÐ B."""Ä òdef __init__(self) l  ö._locator = None6 CsetDL# @ #, 1 I Á"""Called by`parserö Agive ÿ $ aD  —å  � X  ž Ý `origin¤	œ 1 BSAX j õ!s are strongly encouraged (though not absolutelyt �required)¬ fsupplyž ð: if it does so, Rmust ) E  ° ½ oó   î ‚by invokÛ õis method beforeF $ 0anyø  G Sother0 så–íA í¿ # g› RallowHŸ ²to determinª5endT @posi² ‘  ˜ �‚-related»,  . µ “5 isF  } re @an eÓP. Typ‡=ly,#vwill usóÒU cits owZ –s (such aƒ •characterë3thaÛ Ÿ 0mat1 n§'? ò business rules)À�freturnu�probablyŒpsuffici| É ÷	use with a search engineË0Not !at,` (} ˜ correct ˜ 'onî0dur� ¥ n� Û  _e ø…ì Ë:ashouldÏ aattempè Ë `it at 1ÂAtime” ”  {Ï ~5tar€y
pRÌe} #ifWÊ PbeginX  a^    > E kb¢ =c once,­ Ó Û Í�80 orM3DTD© ×	õf))f  ½4endñ?end8 á!it+œ  Gb/ce last¥ê7ed kÀparse. The pÓarser shall
  õ-not invoke this method until it has either abandoned parsingE õ*(because of an unrecoverable error) or reached the end ofB ¡input."""
 ñdef startPrefixMapping(self, p q, uri):/  Ì �"""Begin^ BscopŽ . ò-URI Namespace mQ .n  ? òThe information from�event is +ð necessary for n/ L` 0pro( Aing:� pSAX XMLÐder will autom UcallyÇ @repl¢ å !esh @elem… ð and attribute nÏ A wheô B ñhttp://xml.org/sax/features/3  #s   Ù •true (theD Šdefault)!òre are cases, however,‚ aapplic<@s neæFo usS Ñ ðin character data'inÙ @valub @wher—e0can‡úsafely be expandedO;vÎ JI/endN Ù suº  es2 	 to E á 3 tox ^1es yò ose contexts it¯iæ>X0Notä "atñ§ sz û rguarantbž ñbe properly nested relative® Pach-oÆ(: þ s£¢occur befoˆ¸ correspondÿF E¤V!, « llè` Ä  af 	g  C ] 0butœPir orP%isE 
#
R	P
K"En§I?2SeeÀ
í  % details. T`^Valwayº m  of0
† t sê Vwise K
(Ð$ 9,£s)bSignal>8 ³pin non-@ {7odeÿ x   T0ame B2ainT 1raw:11.0ñ _ ªh ñtype as a string� L 0s^ …holds an2qinstanc/ 1 Aaqs classÒ0ainU     Q �sÁ  Œ 
M3end¾KD FN  ZB(Àe name of thóe element type, just
  óas with the startE, ¡event."""
, 9def  òNS(self, name, q qattrs):2  a ¦"""Signalsa e of an” !inC ²space mode.q  ? 1The ò parameter containP  u  O  ½ ä U as a… °(uri, local1 �) tuple,’ ¸ _  J µraw XML 1.0D  9 � used in9 °source docu[Q, and R B Pholdsù „instance¹ ôAttributes classã 0ingQ A  Y (  of C10uri t` » ó Ä is None for= Ås which havek !now”
3end!ú0end� øLÜ?NS Þ £charactersÚ k:entÕ ðReceive notificationÚ > [ data“õ%Parser will call this method to report each chunk of�Z @ SAXàðsers may return W  ² oiguous>  ¾‚a singlej @, orMyL `split  5ntoD rseveral1 `s; how ,t Œ¦ sd #nyf E rð  must come fromy ð same external entity so that! B ðLocator provides�¡ful informŠ
­áignorableWhiteÎÛw ÞJ  .K  è u y /»pValidatÅþsü ?useþò ?of z 0(seF Te W3C«� recommenv 5on,E 1sec¥Æ2.10): non-v� p›J@alsoU¡ G it�y are capW ø @  å  ÿuY¿ m Ì'ls
¹a­‡ µ ­	F µ±­F µ,¶ ®= ¶`procesKaInstru¾¸qtarget,dº
Àation of a pó
rocessing instruction.

  õ#The Parser will invoke this method once for each pR D Z ° found: notE 'at0 ‚ µs may occurG ðbefore or after the main document ele ¿ rA SAX pÁ ðshould never report an XML declaraý   ( E1.0,z !seQ 2.8)€ _ text5  - e4.3.1)D ue8B."""hõdef skippedEntity(self, name):B  """Receive?Bific° Dof a@ ! eA ÁB v ™ Ð. Non-validat/è"or« ' } `ies ifžyE "haµ P seen <²s (because,Gpxample,( B – C was; Ped in¿ô
external DTD subset). All[5orsG  V« 6 Y °ies, dependÜ o¤ �values oÍ C ôhttp://xml.org/sax/features/Œ ”-general-^ I andÐ F •parameterH † ¢propertiesH@
# =  rHandler w

class R2"""(   s events7TÝðinterface specif×§only those5 ‘ required½Qbasic¦  u M0(un &ed ²attributes)Â  q 
1notØGDecl	ø, publicId, systemIdÍ a@ ( à .p• ql , ndatas $n N ã y{ £êENTITYRESOLVER§� …Resolver«BW ” or%  cfð . If you createaobject‘iV   3 ‰P ltn regis[: P withT ˆ/ V@callà!in4  E !to‚ ²  e - +3 È% NrDefaultÔ%r º É
¼ ¢  d6 ª behaviourY~ bZT q‰Û v0 ido@fier"anÁ yâÂreturn eithe1 Ö œ = ð to read from asÄatring,bÑn InputSource=J 4 Ý     y f `Id


# À============= ð
#
# CORE FEATURES ; % ó

feature_namespaces = "http://xml.org/sax/) &s/* ô"
# true: Perform NF ÿ$ processing (default).
# false: Optionally do not pC 3
#  •(implies † ‘-prefixes_  acv `: (par} á) read-only; (h  o/write _V ˆ óReport the original X dÁ ö	 and attributes used forIû pdeclara7sID>rk K 
 C ,{ ] - o�R ¹ 	Õv,Ðstring_intern2‚0 -0 r²All elementa,q&s,h ®0URI! %ndRlocal) R are m @ed uWÔƒbuilt-in P funcŸžb @  { ne�Sarily4 Àed, althoughT Šy may be4_,Qvalid9Í* SÅFall  … errors � ex¼ðal-general-entit©aU& •parameter( ¾
Ôv  `,‰ /_gð, Û $€Include %/  
„ (text)  ¾ 
è i> : 3 ñ 5pñ ¦ó 1 î ", Þ  Ö ä h¯DTD subsetDany 9  d @even?& _  ` F$Dall_ C = [ 5#,
¡ $ À_prefixes,
   úfeature_string_interning,
( $  * ¯validation$  exG oal_ges& Ÿpes]


#= 8ð
#
# CORE PROPERTIES c 8ó#=

property_lexical_handler = "http://xml.org/sax// Cies/1 -1 ð "
# data type: 5 Òsax.sax2lib.L_ H^  , `escrip‡a: An o 0al {cnsion Z S for n ð events like comm ÷.
# access: read/writeÜ adeclaróà 5 ä ODeclá &´DTD-relatedå zother
#È�than notÎ Às and unpars8 ntitiesom_nodeæ@dom-* ßüorg.w3c.dom.NodeÑPWhen –  Šð the current DOM Q ° being visió ¬if this isñ a3 °iterator; w[ :not_ 7roo\ -fo8A 8ion(£ )8‡-only; (]  Q3xmlqBBxml-�DS²:QThe l­ "l 7 ð of characters that wa	 €e source"7t5ø  &î %Pencod“ú¯www.python1 × @nameÍ  › = ‘ to assumÅ a inputH¯ ÐQ: setK< ü, e.g. established by a higher-levelð   protocol. MayY`nge du>S! (Y >aft€A  l +·a META tag)i  ^‘:  return² ýº © (possibly¾ wthroughK ü auto-detec0 ÷initial value: UTF-8
#Ï	W_dict§Õ7 -7 Û!Di€ ?ary¶ 1 €ionary uŽ2to N ©#onÏ2s i@docuÀ¾é`Requesía àe parser uses ûa specific dictionary, to
#  ÷allow interning across different documents< ñread:  return the cur. I y óor None
#

all_properties = [ ûy_lexical_handler,
« 5   , �dom_node% `eclara U ¯xml_stringW 
_encod% 	_	²]


class Lå Hä :ä P"""Op¦ ƒal SAX2 S for 0 ev…!.
2 EThis& õis used to obtain4 ainformÑ about an XMLD Ù¾, that is, 0 1howà- Q was !edF ƒ(as oppo� wK Pt conŠ òs, which is report¨ 1the> sContentá), such as comuñ and CDATA marked seÑ? ¤boundariesQo set² 
i3 ofü pReader,3( BsetP�yT ±method with  s± identifier( ó'http://xml.org/sax/, Cies/·-ËR'."""¼4defß a(self,-Bent) öA"""R/4s a- ² anywhere it”`(inclu“ ² ž  E 1DTD?poutside Î@ elea)9 0  ´ òiu Qholds? # sO÷§
Ý ƒstartDTDÞ ÿname, public_id, system_idñ g B d  Ç dÊ §f&  ñ 0hasåpassociak7DTDá !A Y bEntityQ† will bežwbefore r * sg Afrom�  ex60al £ 0sub{&arL ,t¬Rcan bô k°ainfer Q (F  Q ‚ ‡s deriveÌ  V V † oáH typ ¹ Ê •Út(¶  if none w|•supplied)E  ¢Ó _ áW  0V 0æ "(oK   j 
^4end\
@bSignal¨0endu G
J \ª
N  `Qbegin F�šTØ(f Â{Rbthroug¢characters‡
Ã 1end[ ð (self):
       ðN """Reports the end of a CDATA marked section."""
"""\
A library of useful helper classes to Q 4SAX P, forf Á
conveniencen `pplicac ð and driver writers.s @

im¦ õ os, urllib.parse trequest( $io
 ãcodecs
from . G {handler óxmlreader

def __dict_replace(s, d):
   6  ± substringsË   � using a B aionary> =  ókey, value in d.items(^  % ds = s.{ / )€ ‚return s¨ ó	escape(data, entities={}O A"""E" a &, <,c>w a­ 0of = !.
] ‚You can W c other* ä  + } by paså 1 asD  û opÒ%al“ ñ parameter.  The keys� 
Ñs must all beF Lps; each. 1 wi  ðd with its correspondyQ .E  µ	 #` �do amperskQfirst Ö =^ Ò("&", "&amp;"y& >& /gt% 
<% l% %ifT ö_ y  Ù‰   "un°	U$  Ó b, &lt;O&gt;e ²q Gm" ®<õ	 2 % >% Ð,�#laœí¦ —  "")Ÿquoteattr	 ý0 @ an 4 Ribute“* 5,Ò"n L !itä4use	^  ü \" charactë×ÃÑd as well, if�`necessE£Æ Ž¼d = {** ð , '\n': '&#10;' r 3 ¡t':'&#9;'}. Î# =Àð )
    if '"' inƒ data:
  ›if "'" in    * ± = '"%s"' %" õ.replace('"', "&quot;")P Felse^ F c"'%s'"F / 
+ m ' RreturŸ ò


def _gettextwriter(out, encoding)} ×if out is Non‘ ¡import sys\    ` ±sys.stdout
 Òif isinstanced Óio.TextIOBasei  B €# use a ”  • ] as id ] 	ñ (codecs.StreamWÛ ),  bReader )€  - ! sB ‰ ô # wrap a binary5 Rwith ì Wrapper?Raw ñKeep the original file open when 	c 1±# destroyedz  gpclass _± 2perè    !__ @__ =ù. >  & = >øattr__(self, namÎ )   0get. + S …buffer =” ( ñ.close = lambda:Ž@ 
ýP# Thi2ð to handle passed objects that aren't®1theH  ª "# €ð	 hierarchy, but just havœ—f methoR¥ q = io.BÍ "edK Ê  A 8ablÍ 6Tru… L .'  $ 2out ¦ :try´#b E ç #is§ s†determini ò ÷if BOM (for UTF-16, etc) should be add> 7 ¤ CseekË  §  ª + CtellS  # ûexcept AttributeErro“ À0 I>R(Ž »=Ä,7  †  ek Ós='xmlcharref“'8 ¿newline='\n* Ä�_through=æ1)

`â XMLGenerator(©¡r.ContentH¸2r):AmEinitj@out=�ô Ð"iso-8859-1",½ùrt_empty_elements=Falow 7.__l ‰ =3o !._ÿ õ   Sflush     @ns_cÐxts = [{}] #  öains uri -> prefix dict'€ tcurrentE 2 =  X K[-1]v ñundeclared_ns_map} & À    self._en²coding = en #
  ÿself._short_empty_elements =  : 0pen[ @_staB < ‘ = False
- °def _qname(n  ,  !):  † ñ"""Builds a qualified% ñ from a (ns_url, local? … pair"""F !if3 6[0]Z  ^ ð# Per http://www.w3.org/XML/1998/O õspace, The 'xml' prefix is` L ÿbound by definition to_ [.  ItO Ðdoes not needI ñbe declared and will! Áusually be f„ +inL  \ù._current_context.% Oif '
O' ==N areturn)B:' +) )1]j #L [Ñ is in a non-b1 r	3 s/= É [L :[0]g #ifª
ô ¦ p# If it  a thZVfault€ ,>  Â  � 	”  I ï  o + ":"õ  2# R J *unÈT L Ì '1] M0sh_Œ :ingN6BendE^=\A#if4? 
]¥write('>')›  ë  F 
Ó0# C`öntHandler methodsÒ @DocuLÂ ± h … õ<?xml version="1.0"§É="%s"?>\n' %ª  ®  N Ú)„ ?end‚ gflush(2 ¶ PüqMapping» (�fix, uriÈ $nsn@s.ap>5 Œfcopy()s¹ ²p[uri] =š5fixõ , $unu_ns_mapr ( ¢ Ò ?endÐ Ë Œ   ã '[-ë3del{" ¹  úSº }, attrs‚ 	
;B†  Pfor (g�, value)„ r w.items(y  H_P ” %s=%s' %C Pquote° (M Ä|,{  ãq = True5 � Oelse= ¡ :">"â_ð ):
        if s÷elf._pending_start_element:
  s) ¿write('/>')  G … = False0 Oelse\ ñ </%s>' % name)
7 Adef œ E› 0NS(� ,$ 0, q+ †, attrs)[  # �._finishã (Æ - à R<' +  \ (a )�  ófor prefix, uri in/ öundeclared_ns_maps�  9 #if8 
   p ‚ à xmlns:%s="%s"(p )¸  : R  P  M 6uriC ) º R = []� P  ô 	€, value)ö tw.items({ 0 W Ð Q%s=%sÈ  Xp, quoteK (Z à #ifZ0shoœDmpty¢\Y …?Tru„3">"ì y?endwõ « ƒ 
ñ¬ ORr wã £charactersXzcontentÝ  É e óif not isinstance(X W, strr  -      =  - ‘@enco»Î 3 ì ^Uescape Å ÙÿignorableWhitespaceÿ ¿>íóprocessingInstructionù Çtarget, data‹På- }‘'<?%s %s?Ò(_ ñ)


class XMLFilterBase(xmlreader.XMLR
 ‹ ‚"""This 6 ðis designed to sit between anT < r and thüàclient applicaù P's ev ðhandlers.  By default, it does´Ahing�Pbut p¹ °requests upƒ Bthe » u X Ds on c E Àunmodified, Q 1subØ ðes can override specific methodsM : yG  t i  `eam orî ‘ configurå  © ðas they pass
    ñ$through."""

    def __init__(self, parent = None):'  + âxmlreader.XMLR
 	; )+  I %._I 	 q ò# ErrorHandler methods  � e Š —exception† [ Rerr_hC .2 , L Qfatalo Q 7 V warningS 4 P Ÿ# ContentósetDocumentLocatory l Econt>  8 'Estare ^ U 	0 )I 4end¬ G . E Ž ¦PrefixMappjp _, uri  
B < 	° 
'  ]", - d :end; 5 ] È 0Eleºß, name, attrs^ 	< 6 _ >end] V 3  T tO )NS® q+ µ 2NS(8 	? ¾ o Ç 
f Ð £charactersÌ  ?entY 6 0 ² ôignorableWhitespace\ /haÐ=  n s´ ðprocessingInstrucùc Ïtarget, dataÄ F 	@ Ô ÓskippedEntityk  ·c 
6 0 S _# DTDÉ@notaÓ GDecll ý, publicId, systemId€ 5dtdÓ	H  ~ B ’  Qdunparsæ ~ ?, nh… U  ‹ O ’ "# noResolvr ' )#
preturn ¼7._eýJ ÀEntity(publiòcId, systemId)

    # XMLReader methods ñ	def parse(self, source):6  :   ñ._parent.setContentHandler6 )- _Error+ ¿ntityResolvX ?DTDV Ø Ò ï „setLocaló l ó . ( I ”getFeaturJ 8nam;yreturn B4 . N sN h, statU 	N 4  N . U ±getProperty« , ( ì ¤ 5 / P sP o, valu¦ 		P / W ›OFilt› À {¾ ¸ O  Ñ ¦ 6 ,á7ent> E# =  ð

# --- Utility functions

U 0prer_input_(( “, base=""c u"""ThisB ° takes an I= S’@ and  ope !alD @ URL Rœ²s a fully rdF ñobject ready for
 ring."""Õif isinstance² ©os.PathLik¸› ³= os.fspath1 äK 3strù 1C 0xml– 7er.ö 	O Ãelif hasattr 0, "5 J Q 3f =—  w? = d ­  ) 
±  f.\ 0(0))´  + T ãöharacterStream(fP Felse
7 NByte2 â @f, "P ")ã• f. – SÒ(- Ù#if[.getC¹ ‘) is Nonep á 7getª # Ö Usysidt X { 	 ñ0hea( 0os.)@.dirÆ ( @norm (, ); ` @file.  k ' Q.join,  X Â&id6  if”)  is> (H �
–¼ 
/ K .  bJopenS  ‹&b"‚ ü	f qurllib.{E.urlÕ Ñ P z 3 prequest5 Œ H
õ : ÎsÎÀStream(f)

 ò*   return source
"""An XML Reader is the SAX 2 name for a$ qparser.0 P ô+s
should be based on this code. """

from . import handler ´_exceptions" �SAXNotSup0 4edE! ,— ·NotRecogniz `


# =  � bREADER q

class ã P:
   ™ ‚Interfacã treadingë °document us ±callbacks.
? :XML1iM DthatF 1 's¹ Ñ2 driver mustE Pimplee 0. T3D `allowsF papplica ` to se\ qd queryE pfeature- àd properties iˆ"e ‚ ,< °register evÙ ˆsF 5or ó `procesø P, and< §initiate a'  0Allä  Ã Ás are assumeB ñ be synchronous:f� € qmethodsD not§QuntilÅ  †W 5"teš  µ"erÃ  WT wait²ç -ç  Â Î �before reh1ingŠ  þBnext& ."Á 1`def __‚__(self)I    t._cont_o =è’.ContentH÷!()f 6 ?dtd5  ?DTD1 ef íEntityResolverf ?errf  VErrorh š  è ˜å ,)í "ú œ 75åòa system identifier ?aInputSu!."i   raise NotIÖ !ed• !(" be 1Red!")Š ° ;getf ’´ RöÜ@curr
3 – -  D 
Ör sr ,õ
{ wâs a new object‡VceiveR B š ºs’ ‹  a• 7get8 4 
ˆ  ù
4DTD³ n r  j sj û 
 -÷ òbasic DTD-relatedsø ƒ ÷ þû 
3 þ m	þ 
> +r~
vþ¨  external . ·ˆ  Å '._� 4 = b Œ 1get1Æ 6 
€ Àturns the cuórrent ErrorHandler."
  òreturn self._err_h# 
" xdef set< (+ #, ' !):(  M ð"Register an object to receive e€ ÷ -message eventsˆ  V 	� $ =d 	‹ cLocale… l „ p""Allowƒ °applicationˆ ‚set the 4 B for“ ò s and warnings.m  Ð ðSAX parsers are not requiredQ cprovidQ "izi W _ @; if† Py canQ bsupporš  ] Sested¤ ,C ‚however,; Ðmust raise a ¦ Pexcepè 6. Aõ Us mayC ] # a]   change inU Â middle of aõ 7.""%m rSAXNotS² 4edEv "("• Í  Ù Òimplemented")U M”getFeaturÃHnameÁ�Looks up–�s¢ Cstat¡ bSAX2 fG C¦ ‰Recogniz§ z S '%s'Ï& A" % ‹ « s« !, ˆ ² ?Set¢ d³getPropertyÃ “NHvaluNpH O| P2 ® !, ‹ Q ”ó¥ H¡class Incrµ1alPú£(XMLReader¡ ð"""This interface addÿð ree extra metho o¸B ‹8 athat a­2XMLu rsYGiŽ <  �Sing. ƒÄtŽ Ais o‚al, sinc¸1allC ¸underlying u r M @funcMSality2Whe( „ 1er pstantia± it PreadyÂ �begin ac—!ng{ ‘data fromCfeed*` immedH `ly. AfB g  ¥ �has beenB ðfinished with a calln QcloseV  reæ� '!be' ²E 2mak,  c 5er ´ ® P new « ‚, either³ ¯ !orB  usš  KC Æ )0Not_ aÒ#se s� f_not_ “ 0durK  G 0ingÞ!atc Uis, a	$e Ì  S€before i• Ã»ðBy default, the clñass also implements the parse method of ñXMLReader
    interface using" ófeed, close and resetF sG = AIncrn 0alPj rO óas a convenience to SAX 2.0 driv€ Áwriters."""
T ñdef __init__(self, bufsize=2**16):'  ¼   #._ $ =(   ê .Q )i  f gsource_ `from .SÅort saxutils^ 0 % = ò .prepare_input_  ( t ¶ + 6$     @fileY ’ õ.getCharacterStream()† 1if . vis NoneH MByteC �buffer =I Q.readZm  wh™ 0 
j ‹ 8( 4  ˆ  b H z(3 Y   g, data¤s"""This�R giveúqraw XML0 1 inØ <  •ameter toF,rñ€makes it- %se< s, emitt'=  correspond  ev~`. It i•‘lowed for� €construc Eo beE ðsplit across several calls9 .· P    may raiseW‘ExceptionI $    DNotI‰edError(6pmust beê=Ged!"­”×Š!is¾ Qed byAkc a­  Û Uallow ‰
& $ � 0 itM O ?ingï B p ñ ©overriddenð € k jà 2whe_aentireç@docu†• has beená `passedÕ  ë  Æ  Šahrough(Ü²,' QnotifCD !rs6  at3 áre are no moreò!. \j ô do= @ finjrhecks oÊ ¿  þAempt€ Ý5nal‰ QÝžTy‘r will no^ YyÒ ‹ • another l Funti[  xJWp ¯X— # afl¤ Ä  M Q ö 0r sŸ at†;is =ðnew documents. TChe
  ô%results of calling parse or feed after close without* E öet are undefined."""  ö aise NotImplementedError("This method must be i& €!")

# = ‚ LOCATOR ñ

class Locator:m ð
"""Interface for associatØ ±a SAX eventÊ p a docu� = lJ qion. A  €or objec/ õll return valid 8¡nly duringE  Ecs to D[ sHandlerä ós; at any other time, t‘U J±predictableN` ò
def getColumnNumber(self) Ö""R© Qthe c( ! n) ` wheren P currWends.¯@ 8-1
s OLineq Olineo 2�PublicIdÞ 	p$ ± identifierôø à Û INoneÝ oSystemn s$ n &ÆºINPUTSOURCEÊ²InputSourceÍð"""Encapsulation¥ Ý binform ‘needed by×pXMLReadYo¼Pread Rties.ó s=Èmay include V  abç l c,X ò, byte stream (possiblyi`characHTencod,r �) and/orÆ / O Rof anÇ yÅ aApplicÓs will create²Ñt\é   uså  b Ã ,.ñ…1andFî 8Afrom2 òEntityResolver.r	  — 'n Çq belong Maµ õ „ q is notg pallowedEimodifyS ’bs pass% 0it £ Ù 	f  al³`gh it î0mak@piess b Kthosf�__init__�", ò`_id = ?q €8.__"  Ò  –% PG   ! g    fOfile   <	  A  69setT%, Œ Ì P"SetsK ï1of Sâ[á  a y † g† { ¸~ #¯ … y ÀsetSystemId(óself, system_id):
  “"Sets the õ identifier of this InputSource.":  T 5.__U # =C A_id
& �def getSw 0Id(2 { oReturn~ #r<  S … y ±setEncodingy 3, e ƒ " •character) b  >6The+ õmust be a string acceptable for an XML0   E ñdeclaration (see sec R4.3.3‚ e; ‘recommend- /).‰ ”attribute< ¾Ð is ignored iÝeˆ & öalso contains a �stream.""]& =ä ] 	Œ‚1Gete K €
5  u �setByteS³ ˆbytefile� ƒ    ¿àeam (a Python 0 ñ-like object which doesá  ÆÀnot perform F F-to-Ñ ±conversion)UiUA s^¾  R  ]ó SAX parser will»”¿ reÓ°§V ü P specÒ’d, but itO  us¯ ¯ õ Æin preferencqto openÕ@ URIn¦!it‚¸ IWq applicªR knowå¯¥ † · ,© “should se· !thªÝ method” U  ¾! =•  ©  g
˜ E   É½ µgx› n¯ j 5forÿ b w �, or None´ unOnï [ Š __: 
ë DsetCÝ	 ‰  + 
ú S’÷¼ÿ   (¬# Ä F÷2.0 Unicode-wrappedZ5thaAV84 to>  Œbings.)Ì -u¯  W´ A any/ i  
2andÂ åpattempt�    aB 4con"to©üU	¹²‡! =¼  ’Ü ¨½³« H Âðstream for this óinput source."
  ðreturn self.__charfile

# = ò  ATTRIBUTESIMPL ñ	

class AttributesImpl:
U Ðdef __init__(W ‘, attrs):  w ò"""Non-NS-aware implementation.H  ) 9 ö should be of the form {name : value}.""Ô  v "._= =~ T  œ ‘getLength� – 
1len A ): AType  ,  > y"CDATA"5 V¢ 6 
± [X ]@ oByQNam} G  ? F 
!ifÕ d not iF» –ð raise KeyError(± )ÜF  	Å ¾  By… ~ J w sx ³Alist òz.keys()ù¿ B 'S__len‚  s“__getitem< wúÎ    x  ú ¯__contains�  ð5	ÿa¾ þ, alternative=Noneš  ° �1getd	8 žAcopy_ G _®Á V @  _Ú- €@ .  A bNd
 NSf(u)v0, q›~z+ (ns_uri, l\ )„u, ...}.
y 
´: % : Ã |  : 3s =á 	nrì
pfor (nsÀ #)¿[ .ì
ý"ifq 1 ==.
  Ÿ ¦ ?[i Ö$ C:£ ±Á /Àtems():
      Àif qname ==  #:
  �return ns 
 ð raise KeyError( ) àdef getQNameBy a(self,` )a Y   !._…  s[G ]G sB < Alist A —.values()Œ Acopy% @ | �_class__% ’._attrs,  ˜ @)


× c_test(H ±XMLReader()õ IncrementalPars `Locato& `
if __ä  __q¢"__main__"_ ð:
# This directory is a Python package.
#
# XML-RPC CLIENT LIBRARY
# $Id$
" %an% óclient interface forV N ñthe marshalling and response pÔ ñ code can also be used to
# implr rservers^  Notes:
# tÝ   0ionÛ adesignF £ work with™ Ò 2.1 or newerH 0His J õ
1999-01-14 fl  Created
#  5 ðhanged dateTime to¸ ¨ localtime3 63 òAdded Binary/base64 eß �, defaultG PRPC2 è )icF 9F °Fixed array} aC ÷ (from Skip Montanaro)† '21@ · pconstrue, etc.2 A2-022 ¸ Ÿ @handÉ!, 
 ýe empty sequencesD !10D ¶ rproblemŽ: sÀ 26-2J PSpeed1rov´s, pluggablSðs/transports (0.9.8
¡2000-11-28” CÃpboolean{`check µatruth üÀ of its argu�Â
# 2001-02-2&"Àencoding/UniÔd/SafeT‰ ˆ patches> °compare sup¸  Ž swrapperÃ s9/1.0b1É D1-03É 0Mak8 &re[Ptuple
µa singletonz 23-2LÄDon't requirËkparamsVæNicholas Rileyƒ $6-à olÝðin _xmlrpclib acceler«× (Å 2B 8ØUBase < .ð on built-in ExceptáêÆPaul PrescodP A9-03ÞfAllow 1sub• Y€overrideU…9Ò @Lazyg0ortÀurllib, cgi,§  à D(20x# s—%up‰ B10-0q€Remove c” inÏ©òmemo cache when doneDthem� G ÿUse faster escape method (80% dumps … ÄCMore% ¸microtuningf ÊK!im‡Pexpat( 0,ªðGuido van Rossumò#)
# 2001-10-10 sm  Allow long ints to be passed as øif they don't overflowM 7M €Test for6 B andX 0 0 (am ös use on 64-bit systemsœ ð1-12 fl  Use repr()— ómarshal doubles (from Paul FelixA q2-03-17A óAvoid buffered read when possibleE ÆJames RuckerG 34-0G òdded pythondoc commentsr2-04-16q * á__str__ methodTödatetime/binary wrapperC G5-15C Àerror consta—í ö Andrew Kuchling« 26-2« ÑMerged with P± Ä CVS version± B10-2cA± ð	basic authentication (ba‚on code n£hillip Eby} @3-01M L’dd supporÒthe bool type| @3-02¬ ógvr Remove apply call3Q!24R öcStringIO if availablP «4-25 ak  A 5nilu 6_.gn%  •€.struct_ 2 7†Ãgp  Correct € y„ of Faul3Qa31 mvl† 0mulG$llV q4-08-20' ÄBump minimum& $ed´° ÷12.1> ò14-12-02 ch/dokoË ¡workaroundxÿ8gzip bomb vulnerability
#
# Copyright (c) 1999-2002 by Secret Labs AB.
- 
áFredrik Lundh.[ Rinfo@ üware.com
# http://www. O
# - 0ð
# The XML-RPC client}‘erface isŸ ú &	ù Y ñBy obtaining, us Aand/¼ð pying this soft   i:ð associated docuT{ñ, you agree that 0havðad, understood,
#S P will— Jü { foo„ Aerms) Pcondiß!s:Â `Permis lñuse, copy, modify,5 �distribut� Î 
# its Ë –±any purposeP  ¢ bout fe£ð hereby granted, provitþ  Ì  ab+ › ÃQnotic<0ear¦ 	Bpies· = BbothE= "ndžp9
# Z 4 in� H¦ âe  ¢ ›name of
#N0 or=^ or_  au[ in adverti: ) apublic²C per[ ›„ ›!ofS VQðspecific, written
# prior permisð\sion.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING 9 xIMPLIEDA ñOF MERCHANT-
# ABILITY€ ð	FITNESS.  IN NO EVENT SHJ ¯ 'OR® ð
# BE LIABLE FOR ANY SPECIAL’ ðDIRECT OR CONSEQUENTIAL DAMAGES UANY
# ðWHATSOEVER RESULTÐ ðFROM LOSS OF USE, DATA= ðPROFITS,
# WHETHERÁ �AN ACTION0 ðCONTRACT, NEGLIGENCE; O. €TORTIOUS3 `, ARISv 0OUT@ OS QCONNE!  ˆ ±!USI ÐPERFORMANCE
#2 T˜_.
# - 0ð

"""
An XML-RPC client interface for Pythgõ8
The marshalling and response parser code can also be used to
implementm õservers.

Exported exceptions:

  Error  ¡Base class˜ ­ e% Ãs
  Protocol6 óIndicates an HTTP p!  3 C
  R½ 2 x brokenß Õckage
  Fault”  g Hf$ "pa4 à ½ eÝ Sÿ PProxyN ðRepresents a logical connec0 toÈ a < $�MultiCallE ð  Executor of boxcared xmlrpc request,‚DateTime5 $ d qwrapper`ð an ISO 8601 strò@or t6 “tuple or
@  Qlocal$  E�ger value¿ Ägenerate a "q @.isoa "J ë @ �
  Binar+n b Sdata ¶  e8Gt åóparams chunk from aä aì Pucturí8UnmQ  ŒL Pincom,`XML evOBmess<PTransìÃ g Handl¡t aðg  SafeF B /S C �ronstant�g(none)Œ1funŠ  3getâ» 0CreÊiB  cenõthe fastest availablŽ& attachçØuh ;áobject
  dumpsq  pConvert}AarguN‹# aš” Z Gy E (orçP, if É emethodÚo•1 isÏŸ).
  load› r  ÿ etúÞ "edd0pluèg œ  name (None‘ Cnot ð ).
"""

import ôbase64
import sys àtime
from date  %   decimal D F ´http.client ³urllib.parsa 2xml $rsG Eexpa2 Rerrnon $io" ôBytesIO
try:
    Ñgzip
except IÖ RError$   ñ = None #python can be built without zlib/. 0sup_

# - 0ò
# Internal stuff

def escape(s)¨ ñs = s.replace("&", "&amp;")ì   <  $lt hreturnB >" `gt;",)Ë ðused in User-Agent header s«ð__version__ = '%d.%d' % . €info[:2]O òxmlrpc integer limits
MAXINT =  2**31-1
MIN -  ; T0A-
# åÁ constants (»ðDan Libby's specification at
# ž2://¾ ð-epi.sourceforge.net/5 ñs/rfc.fault_codes.phpF°Ranges of edÐs
PARSE_ERROR“ø   = -32700
SERVER  ó 600
APPLICATION   56 SYSTEM S  Õ400
TRANSPORT  ƒ300

# Sî š äNOT_WELLFORMED3 2  ž PUNSUPM   uNCODING½ ³1
INVALID_E T_CHARÜ 2 aXMLRPC§ û  à pMETHOD_ƒ RFOUND! | &60] ' bPARAMS]  60] dTERNAL´ 	> 3ì C55ñions

##
# Base class for all kindñÔS-sidec2.

, ‹$(EN Ó;"""P C > 1"""ÛQ__strwsobject. ” 0IndÃò
es an HTTP-level protocolO à.  This is raiìaby the2 €
# trans×¡ layer, if rserver @c Ù ÷ð	 other than 200
# (OK).
*ó@param url The target URL.
#  1errG  !  ¹ ª [ 
& 1msgF % wmessage( ®s)  @ dicà5ary�P˜ ª”PJ˜ ¦à__init__(self,ï ,Æ  × 	 Cmsg,HÊ ®y .= Ç   K .9=P  3=f   , :msg  )
  Æ À_repr__(selfC):
  …return (   ù"<%s for %s: %s %s>" %# ñ(self.__class__.__name__,  3url
 verrcode Imsg)K ñ`)

##
# Indicates a broken XML-RPC response package.  This exception is
# raised by the unmarshalling layer, if Y @ Ámalformed.

Ù # Ry aError( =?"""±  © 1"""í Npassè â _faultè PÒcontains
# a u nstringSÐcan also be uXašõ , to
# generateK W@mess§
Øb@paramm …Code TheÚƒ  "H.
# + S— -  ° £F:›dCšÁdef __init__Ö,«  ‹ “, **extra *.? Ý
á ÷ =X  @ # d  %  '   Crepr   ¾°¬r© Ç �Q  x  �  ³ µÃ ’  ¬/ - 0ô
# Special valueõBackwards compatibility

boolean = B
   UqWrapper¶†ƒDateTimeb âpconvertÍt Ñ0theB 2matò$by© žQ<p>
#‘³  !‘be given AdateT robject, ±0 in{$
#b ó"yyyymmddThh:mm:ss"1 q9-item J ¢tuple (as íeà!
# `.local' ò()), or an integerõ 9 7 2  Ô  Œw<Buses! X C to 2^ Ato a,  ‹  £ .ì  \  k ,#²n ISO 8601 *:,
# j  ç  a ì 0.

Fôssue #13305: differentu jÐs across platñ¤s
_day0 = Á@(1,  !)
stry(fmtz=tryAA P.strf‘ - ¡ == '0001'w¬  Vî7D  False
if _p b'%Y'):	¡# Mac OS XK ” 0iso4_Á 1at(s¡  5 .ð strftime("%Y%m%ð:dT%H:%M:%S")
elif _try('%4Y'):   # Linux
    def _iso8601_format(value):
    qreturn  û.strftime("%4Y%m%n "se8 X )W ò.zfill(17)
del _day0
 atry


l ˜ § )† áif isinstance( `, dateÂ $ â 	
)oif notO  €(tuple, S  @uct_ )` "if>R == 0›  w   • " =?  8 !()p  Qlocal! 3 )— œ�"%04d%02 T	 : 2" %~ ó[:6]

class DateTim®4""" ð wrapper for an ISO ¡ string or«  ö 1 or­ œ ‚ integerq à to generate 'x s .o‘' XML-RPCC Õ . 2"""Ý ÙÒ_init__(self,X *=0\ä7str#  L ? .e " =F l   $el¶    	- _[œ ó make_comparable£ Hothe~ 
… ,€¦ 6 = } ¢  ” Ao = = Æ  â$ æ F sa M ‘l n g W 
Â �hasattr( 0, "êd"#" 2 ã )" í ¬ � E åNotImplemented sFs, o6__l¥Ä ·  + e .4, ] Šif o is | 
3� 
# B  ;s <  eEt U   d=¡ gA}>  A}>AÀef __eq__(seÓlf, other):
  òs, o = self.make_comparable(, + öif o is NotImplementedK  R kreturn# B  qs == o
 àdef timetuple(‡ � 0    P.strp	 $ ò.value, "%Y%m%dT%H:%M:%S")V !##] °# Get date/;  6 .  # @d D% ò	, as an ISO 8601 string._  µ q__str__� ³  É ¥ 2 ?rep3 ñ"<%s %r at %#x>" % ] ò.__class__.__name__,°Ï A, id( )ü  � RdecodO, a¢ ›  ø€tr(data)`7ip(D 'enD 7outC Áout.write("<…  ><e€Time.iso11>")b / |  ="</G "</a  \nÜ Ü _$  Ï¹ €"# ó b xml eœð contents into a ä ¤  Íbuctureb % =  (�  .X l Ò 1 )

’ R_type+ — , ²  eÅ t¿ñ##
# Wrapper for binaryÆø.  This can be used to transport any kind
# of: ñ over XML-RPC, using BASE64 éÝ { @þmo � An 8-bit1 1  Q0ain earbitr™ !

¤! B­ ý ?"""È 8"""CinitK¯W=Noneq"if‘ ~"ne`  [   La = b""   ;els% òif not isinstanc§ , (bytes,  garray)w  K   ñ
raise TypeError("expected7  s ¦1yte@ ,h U%s" %�  D   º ß 1  %  ß  ¨ \ð   # Make a copyë2theŒ !u l=   q	ebuffer(;B% !tr¬.‘ À, "latin-1")Ó 5XXXŒ"?!¯ _5_eq”(ifÔ ,†É " =� +§2' …  # £^   Q  §Sase646 Us´J oœXbP >ÿB dn  n � FÀ    out.writÀe(encoded.de Ã('ascii'))
  ñ%out.write("</base64></value>\n")

def _binary(data):= "# T ñ xml element contents into a B7 ¡ structure: ] # = (Œ  § g , qreturn  ó

WRAPPERS = (DateTime,H o)

# - 0ñ
# XML parsers

class ExpatP  `fast e - ñ for Python 2.0 and later.Ì Ió_init__(self, targetR ’  "._| $ =X =g .€ ÐCreate(None,  B? V # =_ }   W r.StartE²uHandler,  .s 2 ?End0 <end. ÝCharacterDataa  Ü2 ŸQing =É  Â B.xmlÂ4ingë $  KCfeedG T E4¹•, False)
C QcloseD > 2tryâ 3  78 = �D   üexcept AttributeErrorA &ss0 :lse 3del[ ÷ , x ö# get rid of circular referenceZ  Ž 4 õ ñ b"", True) # enA  +*;Ð-RPC marshallÌ ÷(un  |B

##[	1    u@param vDefault  \P8-bitNÂings.  The d)  
#ÿ )1 isOõ (interpreted as UTF-8).
# @see dumpáMÂ e½à"""Generate an¸ § äs chunk from aó [ � ë.g­6 a ` ‘ instance0€each setÞ] aeters,="us2Qthe "® °" method tom¡vert your } “(represenð ra tuple  ‘È  J!o 2 a x°response, pÿaÀF“¿  	 ñ ead.  You may p— � Iuse · BodulÎ �functionÿ Âthis purpose'2""";A# byD pway, ifé À don't underE°d what's go{±on in here,± 2# t Ãperfectly okš D_�~=VÒ, allow_none=:¸‘memo = {}l  € ‹Ñ _ % =×
: q ' =~ ‚dispatchr 9  Ã Ä,þÀes):
       ³ out = []
  pwrite = u.append àdump = self.__  õif isinstance(values, Fault):&  c 0# f  - 	 } 1("<# Y>\n")  s 1({' rCode': k . ,1  q "  1 kString3  }6  ‹ 
  A("</n 
Ÿ Lelseé ù parameter blockš ð&# FIXME: the xml-rpc specification allows us to leave•F  ? �entire <p "s>n 0 if\ ¡re are no   Ž +s.D û'however, changing this may break older code (includingE ð old versions ofÔ ârpclib.py), soU `is bet{left asG ñ
is for now.  See @XMLRPC3 ±more inform$I. /FA £í s£  \ Cv in8
² ! 	A @  # †1v, + 
"    &„ C 
  ¤ Presul’¶"".join(outc rreturn % 
ù Bdef Œ(˜,Ù � à 6try  § fÊÃdispatch[typ»)ú except KeyErrorD r# checkkñis object can be marshalled as a structure¹  „   âif not hasattr;Ë, '__dict__'? 3 ¡raise Type” P("canD q $ %Š Ws" % × J G ¾ qclass i« 2ub- ¡of a basicI 
)ð# because we don't know how´� Qthese? îR(e.g. wsw 
©  µ Æ _¹ 	 &š).__mro__• Û  ü1ype1  .åo.keys(T  6 X6ðXXX(twouters): usÝ Ä"_arbitrary_ý"0key ¹a quick-fix!#ú è²p3yk merge,Mð should probablyuafixed (jneatlyíö—  fW{ __nil ' ˜å‹×K_non0~²None unlessD  °wenabled-d’><nil/></ Ð")
    dispatòch[type(None)] = dump_nil

    def ñ
bool(self, value, write):'  +  1("<  ><1 kean>")"   í and "1" or "0$ 4"</@ !</1 3>\n& �dispatch[" ²   ³ Olong³ "ifÍ � > MAXINT� o – < MININTà  ä ó raise OverflowError("int exceeds XML-RPC limits²  : >int�str(int(‚ ,))90"</7 5int ý ñ# backward compatible”ë ¾ ö4 ÷odoubleFÛ 3 Þ DreprÛ  /6 Ý Ffloaß / á ­ ounicod® ’, escape= ¶nstring½ 8 ¿ 8 ¿ 5strœ¨ ¾ _bytesjfbase64 Q enBd =  . ] Y}! @d.de: �('ascii'~R >å f ç  m ³‹ytearray% & l" 
ci = id�>  ý €if i in ¨_.memo¾CTypeºøcannot marshal recursive sequenceÂU  [i¾  1y  J" =x  __  Ü j><data¹Pfor v½ ¥
¹  Q $(vs[ /N #</\ 1 2delž  1[i]D —PtupleÕ  i _G 
! 6lis|  ! ³ostruct´ zÃL¯dictionariÆ@ï Á'k,Äw.items(m ŠjmemberC    0if ”ûisinstance(k, strG  + ŽÐô Ðy key must be> 6ing�À     write("¡<name>%s</	 ÷\n" % escape(k))
  Údump(v, write  æ("</member>\n"!  êstruct></value% ñdel self.memo[i]z ðdispatch[dict] = ƒ _G 
" "ef �datetime(E !, b « :+  Ê ‹   ><5 ÝTime.iso8601>¶  m fX 3 K /E à Ç ¥ Ë  <  ^ Í instancÍ õ# check for special wrappersò "ifö.__class__ in WRAPPERS  ;.Ø " =æG   b.encodš ã  ÂB : Jelseg „# store æ ò attributes as a áš (really?g ¥ (—  __$$__ô€ y@Dateéy| 
' oBinary% ô# XXX(twouters): using "_arbitrary_U "Ç 0key ±a quick-fixl #¯ð the p3yk merge, this should probably be fixed m.qneatly.E Ø ~ À ð
##
# XML-RPC unmarshaller.
 Á@see loads

&' U$ ¾5""" 5 anN ð	response, based on incom‘XML event¶ ð#messages (start, data, end).  Call close() to get '‘resultingD  3  Bure.8€Note tha1 ò&is reader is fairly tolerant, and gladly accepts bogu/ d ðwithout complainÏ ‚(but not4  )�2"""Š #b ð
again, if you don't underÖ°d what's goT /a here,á #É ó 's perfectly okè Ãdef __init__èDuse_E@=Falˆ  0bui5b_types )È «D q = None{  ’stack = [‡ _marks 41  �1 = › f `methodx† j $š= "utf-8"A  êBnd =8_µ . 
) _&0 =  	!1 or $ ?   byŸ<  ù ›½ \k”# return (a tuple(0taræt #ifÑ  ¼ Æ ¡ ¢  Z !._ƒË œsraise R‰fError(5
P ð == "fault":
     õraise Fault(**self._stack[0])
& Çeturn tuple(% !)
# òdef getmethodnam$ !):  D r@ : ' > #' ò# event handlers  Z 1xmlt ÷, encoding, standalonef _ % % =0 a  ˆ ÷ # FIXME: assertG – == 1 ???x Sstartz §tag, attrsp Ã# prepare to¸ Õ this elementw Öif ':' in tag ’ Ptag = ø .split(':')[-1]< $ À= "array" or0  ± Š"struct"S ñmarks.append(lenÉ Ü)Ú- ‰data = [w  ‘value andu 0notÇ  Šdispatch~ QñResponseError("unknowÿ ` %r" %M … j 4= (ð  "d § È g, text‹‘ _  ó ! Í  % ,z ³ ó	# call the appropriate eð ŽŽ6try<  À@f = X .F[tagG¡except Key

< T _ 9(# B?�  # “   — c¦  2 ª 
 ! ‹  f d"".joiv ™)Éïùaccelerator support¯_RR ƒI F$# %   ý 
§É 6˜½f decod‰íZ = {}¨Cnil ¤O ŸƒN¬¡ _áA = 0 Ëq["nil"]ÀZd_nilo bbooleaZ,÷!if 0Ž VFalse�(el9 19 9Tru8 &seï &P4TypûCbad ³  ð "w 6 
 
$in£| % àdata))
       ü self._value = 0
    dispatch["i1"] = end_int 2 	4 	8 	/nt ©biginteger% › !ef« pdouble(Û �, data):   Ü   á.append(float(! )! [ {  < 5W # $ ¡ ¯bigdecimal¥ D) § a ˆ  
Œ ostringˆ #if †encodingH L “ ! =bb.decodt$._/ Vw 7  pž Å  À ¥Kname" ð
 # struct keys are always Jings_arraycmark =  fs.pop(À a# map B ñs to Python lists©  *vp_stack[E :V[ ]2 ˜o ô  
Ò þ Ó *C Ô ¶dictionarieÛ   U = {}» Uitems4õ # ñfor i in range(0, len(9 G), 2° > c [ 0[i]: ,+10m @ = [: $ Tð U 
Vobase64VW gBinary!   ü.¦e("ascii")Lpšuse_bytesqK 1 =  .L RLa V  bÔ ÷  
÷ rdateTimÞRn D = D& z  û  	ë  a Otimeî _ R_type°ø Ž =  ½ v.iso860Ñ 
ì ³ âò# if we stumble upon a�ð element with no ¥Ernal© ## ós, treat it as a“ 1 "“ 
Ó –ù 7 Ø ë Àdef end_paraóms(self, data):
    ñ._type = "params" ”dispatch[ ‚] = end_% 
% !ef _faultb ) a  `  
_ ¯methodNamed 2if É †encodingá  è  ô ! =û b.decodG $._/ )Í  + G p 0nam >   0(  ˜ s" # no  J @& ä  ñ

## Multicall support
#

class _ QCallMÚ ð# some lesser magic to store I `s made a^  B q objectÍ p# for bâ¡ execution Ãdef __init__o R p_list, @_! ! = - N  U_; ! =B  i ugetattrl  & a mreturn™ &._y Ä, "%s.%s" %   K ² âr ­ Û W*argsp ¬ $  ò Š.append(T 5 )¤£‚Iterator¥2""" ôes over the results of a møp. Excep„Qs are �raised in5 AponsÐqxmlrpc &Vs."""+¶k Ý    =W  Œ A ugetitemŽi>   " =jE 1[i]«  æ0if (' B) == '{}B  ' Ö ! F1 + !['Ë ‡Code'],  ‚String']¼ < /ele ,[]e 6M 0£ Belseœ N   Ž ñValueError("unexpectedÁ  §2"úV `"""serëS-> anp  uÇ¢to boxcar ý(s|5 Ñshould be a SH SProxyG ., Qs can*  ddª o]‰Ñ using normal¢u Ò syntax e.g.:U â =/(—  _p… …( Œ.add(2,3 ðget_address("Guido- j#Tohe« J ,	 ¿ ©¢ Badd_u#, a & =A(‰ 	Î )ë Ù ». ±  
R = []/H4rep·V r{È"<%s at %#x>”ÖA__._a__, id\())\ 1Àist, name)

ð	    def __call__(self):
   õmarshalled_list = [] ðfor name, args in > .L  0 I M  ó.append({'methodName' :S p'params  ^ 5})
x ñ	return MultiCallIterator½ ð.__server.system.m'  Þ (Í ))

# - 0ô
# convenience functions

FastMD@r =  TParse %Un—   òNone

##
# Create a p0 °object, ando õ nect it to an uG õing instance.
# This“ ó picks the fastest available XMLl  .
� h2A (‚ ,f Àer) tuple.

A2get% ð(use_datetime=False,  Òbuiltin_types i6"""? C) ->† 
p  nä ? ofÐ ‘ 1‘attach itF4_B.  R_Rboth  !s.6 1""" (ifÇ � ÖÉø.ifý  k.5 = :'n  $   ñmkbytes = base64.decode ) #elq T l -w_binarya /seT 1 
» O PtargeWBs(True, @ü 5, m-  Eult)i î	c(_ $ (elº  8 = ·
¼ µGÃ   	Õh  ñ 	"
/§  ? 
«   6 RExpatA	Þ ¬( ", ß I œ²rt a Python¹¶ or a FaultLâXML-RPC packet@æPdumps‘ams, **opèQ)
# @° ºVams Ad 
b  ’B@key. ù DÄ If given, cø  âP requ­Pfor
#  t×" 2Y �response] R" ë ] I¶‚d with aÌ ,fôp must bœósingleton (that is,¡ "it' úcontain exactly one element)µ Pencod¿3The|  * åPA str( [   Ecd data–
°.Ðname=None, meòthodresponse=None, encoding %
  ñallow_none=False): ð"""data [,options] -> marshalled  
+ ð!Convert an argument tuple or a Fault instance to) qXML-RPC@ Ärequest (or ¶ ¸, if the meÍ  � ¢ is used).‚ pIn addi¨  `  8  Ÿ � object,I  foé 3ingD ás can be given‰ ¥as keywordÉ "s:b  /‹ Qname:R    ! fë  ¼Call packet= ß Q: truƒcreate aé R¶@ .˜  } I#is½ r with aoè zumust be? ña singleton (i.e. itðcontain only one eleÂ[ | <÷ Ú QR (defã‚s UTF-8)ö ñAll byte strings in7š°structure a `ssumed¼0use& ¹ j –.  UnicodS = âutomatically c�1ed,C ò where necessaryP2"""£ 0ass¹$isž¡(params, (G,½U)), "Û[t ã
á"x ?if V  * a Y0A = 1= Celif ?andR § R Ò 3lenË •) == 1, "J 3  Æ eif notà ® – = "utf-81 TFastMr3 Jm =  (F )ë *se/ G + &, ¥]E”= m.dumpsì Ö%if½ % !¬ f �xmlheaderÉ õ<?xml version='1.0'> À='%s'?>\n" %Æ‘ ¼ V H !# : À7´  # Sdard ` wrapp9) oÌ #:  +  ¬ (   £     ""<ˆ@Callí 	4  sName>",— … R, "</:  :\n"X  „ 
 1 k Vë ³ï  ,ƒ"a ƒWÄ  … ? = 	… 
Á  N 
 Ó 5 ~  _× éareturnD3 #  Qas is;  €"".join(v ‡)

##
# m)'À to a Pythonð: object.  If the XML-RPC packet
# represents a fault condition, this func ` raise( F( Pexcep û.
#
# @param data Anj ð, given as an 8-bit string.; àreturn A tuple‚ qtainingµ !un¯ d\ Q, and àmethod name
#  Ó(None if not Ø )a Asee ¶ À

def loads(« ò, use_datetime=False Òbuiltin_types 0):
g 0"""; ô  -> unmarshalleŸ — / pConvertù 
> toA @ pludG A  â  Ü ! ÝÛF ßõ & ùp, u = getparser(@ G   	Y)U Q.feed‘ bclose( #u. r, u.get# P()

#…ƒEncode a]4 usEAgzipYPent e'   @such•Àspecified by]±
# Content-S Ping: C P
# in" Ð HTTP header,C �described! �RFC 1952 …!un€ 2   	 ­ w _ "† " Ô T Vº e6	?as Á üZ o „   7ñ NotImplementedError„ ³f = BytesIOÍAwithKð.GzipFile(mode="wb", fileobj=f, comÄ�slevel=1)e6gzfz ’gzf.writep +f @valuC/DeŒ:TheÅb# @keyWRmax_dÂ �Maximum bW D ¡(20 MiB deÈ)€ƒ negativ#Ðs for unlimit2 X ;ingŠ§ VXã l!ist correctly ld{ *s 5 1maxpped pay�€ length WBededª lù æ&, 
–=20971520˜ / 	E¥>¢
(½ %E
r
> « )6tryð    if max_decodûe < 0: # no limit
  ùdecoded = gzf.read()% Yelse:  B 7  Bmax_ F + 1E êexcept OSErrorK ±raise Value ò ("invalid data"E 7if \ Ò>= 0 and len(p Gd) ># c _ ñmax gzipped payloaI @gth ¨ Cededv sreturn b ‚

##
# R a ñ
 file-like object for thee ð encoding
# as described in RFC 1952.
X ò@param response A stream supporting a ž³ method
# @¤ a‡ Athatˆ À Pt can beH òfrom

class GzipDR… ((. sFile ifÔ $lsí )j?"""‚ o%¹ Ø qed withŸ  d ]Õ ,( w1""". õdef __init__(self,<•  . #Ptdoesn'tOq tell()GU @ ‘quired byc A þ  aif not
ý  '   káNotImplementedÓ;  § ä.io = BytesIO(Ÿ wî M  z.é ¡mode="rb",÷Cobj=[ !)
m  Qclose:tryµ 
h 4 H  Š kfinall7 o .1 )


# - 0ô
# request dispatcher¢!_M÷Á ó# some magic to bind an XML-RPC#  0an  qserver.Ø #£s "nested"1 °s (e.g. exaÆâs.getStateNameŸ ]‘psend, n# ž  9$ __ 0 =  |   1 ! =8  Z ugetattr× & Ãr�á.f Ä, "%s.%s" %   = š ¾ Ecalla ^*argsb À 
N / àStandard trans© O Œñover HTTP.
# <p>
# YouŒÖcreate customE �s by subL  ûCthis£,µ0
# V  ri]“ selected" $s.3T– — """Handles+ ’ s caction-¶ 1 qžð	# client identifier (mayPŒ 2denfpuser_ag. ò= "Python-xmlrpc/¡²__version__´õ #if true, we'll ¢G > acO_ _O !b= TrueK À# if positivðe, encode request using gzip if it exceeds thi ð4reshold
    # note that many servers will get confused, so only useV ³if you knowK F ±they can de– dsuch a� * ° 3_thŠ ‘ = None # s= don'tÖ 
2 ðdef __init__(self,† ò _datetime=False Óbuiltin_types D  ï  õ *, headers=()):!  \ U._use\ ) =k *  	r / 	 4 àconnection = (ô , )( ¡ ƒ = list( & cextra_ R = []3!##O õ# Send a complet' , and parsÿ  ssponse.7 TRetry· I€a cachedÀ shas disÒ #ed= C ð @param host TarN  %   dandler" RPRC h ) àÕ_body XML-RPC¡   0 àverbose DebuggEflag% €return PDd reÿ ½  qp p º ,š ,x � #, k oO)#rF@onceKIgcš «çfor i in (0, 1X   6try¸    Õ Ç 4le_Ç Á ] M  8÷pt http.client.RemoteDó„  u  Q Qraise`    c ÎOSError as e;  Q ° or e.errno³ ×.ECONNRESET,  ‰ABORTED,o  s  < KPIPEj2 ¿ Q   ` t,í'l issueÕj  } ë “_v0 = x _.sendê( þ! =êW @.get  (!if,î.status == 200´– $ =!Ò  Ö   °Œ_w  	 )Ì * *ZFaulto — $   ( PExcepd
, ð #All unexpected1˜ors leaveÙ)in« À# a strange ù e²we clear itV €   ý [close=« [ ¢#We got an‰ Z tO #l@ard � ðonse data and raó ise exception
  õif resp.getheader("content-length", ""):1  8 2 eread()  raa åProtocolError(  5 ù host + handler, Q rstatus,� jreason& Qdict(+ ® 6s()ƒ  f 1)

Z "## ò  Create parser.  ð @return A 2-tuple û ƒaining a3 ð and an unmarshallG B rdef get[ W(self(# D A ?  ¯ ‚ F Ðuse_datetime=S (._ 
 B   ' ×builtin_types? 	 )"ÐGet authoriza± info from µ‘parameter· 0# HÊðmay be a string, or a (1 p, x509-¯!) YF; if+ G ñ it is checked f@ �"user:pw@H " Bmat,„s "Basic> ‘Authentic³ "" ¾ R Qaddedq «ppropriateùÒ Ý Í ð descriptor (URLÌ   É É )I <3<q(actuala s, extra  sÁ#¶ &] c.  The$ î  sfields kRNone.¼z_&_®~,q "):$  c F A= {}5  Óif isinstance®£» (  Z ÿ =W U  ,k ¡ = urllib.p._splitÃZ i O  ÿ:uthG I C ðunquote_to_bytes(% 
ã  ÷ = base64.encode, 0.de �("utf-8"< q"".join] .µ B()) ³õrid of whitespace< É Í_mYs = [  "  ("›M @¸A " +h
’  3 ]E Jelse%q ]Š>¬	) »* àonnect to servÈ ~ *@aTargetùòrn HTTPCM ¢ion objectm  šemake_c  
œ r   #½ €an existt4  ¿�possible•is allows+#† ã/1.1 keep-alivç _ 2if >T  Ê ,= == :[0]xŸ E &[1­2# c]a > `DaG dÃ cŽ ,Œ À  ¨ 7getë 5 D¡  ¯ð, http.client.HTTPóConnection(chost)
  åreturn self._c' A[1]
$ "## ö Clear any cached - ƒ object.* óUsed in the event of socket errors* 0  def close(„ !):  �  ¨ ,f =¦ , 'if) C  G  V Ú   = (None,  	 , Ó .“ )ôSend HTTP requesô ‰ �# @param º ó Host descriptor (URL  ó, x509 info) tuple)C óandler Target RPC h ñ(a path relative tor Ë … ¡ à_body The XML-H    
¸ Ñdebug Enable  rging if … is true« <!And.6 ÚSsend_r á,¬ ,Î ,I¨ ,i ’ ÿGmake©(mû  Âtheaders- _ +<Textra þ  6 â 
:| Q.set_vlevel(1q "ifZ ðaccept_gzip_encod:@and  X 4putg"POST"Sskip_W R V=True}  ¼ â ±.append(("AŠ #-E… @", "„ &")8 Oelse”  A u ÀContent-Typer ˆtext/xmlv 5 ÂUser-Agent",F`user_a ® ÂIB (š#,  œ / c• 	/ oo4 ÊX Âýø; r �This fun_ñ provides a useful hook for subclassingzZ6} X httpO èÙñ A lisZñ key,value pairsk £) Ë  de©$ndü�u J ¶  _ @ valÒR !  ™ C B.put# (6 AI ‚Fe„ ÅM _—
Â»0#opqQally Àey  ?1if Œ.$  _thresholdo1not§E and2  6  † 2 c< len(b À_body) and
   vgzip):
 ð  connection.putheader("Content-Encoding", "= )")= ð request_body = "  _e3 (e( %)
6 o úLength", str(lenF )} G 2end¶ s. t !##{ ò# Parse response.  ó @param file Stream  £ @return R8 ò
 tuple and target method.n Pdef pi _i e(self,x }e# read ô  data from http@ ,l T 1 it°  ¾ñ # Check for new3 K ò
object, otherwise it is aã  ã  M ¶if hasattr(w 3'ge'µ / ' .% 3S") ==:
w I skä = GzipDecodediŠ ô 3 OelseI ˜ (0 u , - pp, u = ² Ù u'r(½ wh"1� ¸=² 8 ÔZ(1024¸ aif notä
>  Õ Ubreak†   "if† _verboò pprint("x :"_0pr(‰ # H bp.feed ¢   ^ {!is— 
› *v.close(Ï p ³ %u ñ##
# Standard transport class¶òXML-RPC over HTTPS.

 TSafeT3 (
 ‡Ò"""Handles an: a aÆ0 to _ ¢server."""  ¢ƒ__init__œðuse_datetime=False,  Óbuiltin_types ó  H 3*, @=(),O“text=None±  ' …super().{  a u  ,c  A    ' 
•  > ¦  ÑðcñDxt =Â /ò	# FIXME: mostly untested  MVmake_�TGhostÿ  rGelf.) Ø '  "ƒ  :[0]Œb( "1]Š  dË F¡.client, "bCì"�  <  ra&ùNotImplementedError(�ñ"your version ofxe Á doesn't supìs 1£# create a¶6 “ÿ!a ¥descriptorƒ # Pmay bG àstring, or a (6 ð, x509-dict) tuple
   òchost, self._extra_headers, x509 = @get_+ `_info(
 ")
B  ! à_connection = ! õ, http.client.HTTPSC$ (y D  L áNone, context=“  Q, **(� for {})| mreturnƒ ö4[1]

##
# Standard server proxy.  This class establishes a virtual Ð ó
# to an XML-RPCK ˜.
# <p>
#L ñis available as Sv Pu C and ó	.  New code should
# use / ,u @void€fusion.
Ó H@def* @(uri" op~ðs)
# @param uri TheA œÇpoint on theÉ B@key4 Ætransport A  pfactoryŸPmpatiß @withG  
#¾si5 _ '^ �encoding— …default  òused for 8-bit strings` (. šis UTF-8)Z ð	verbose Use a true valueG!en�`debugg~ `outputA °   (printed* Æ " d Tsee T!

× �:Ç0"""p#[,ˆØ] -> a logicaP h N
D  A  isU´¡, given as8 �scheme://y‚/target.S   Ö  implementa+° always supñx "¶"" R Q.  Ifb ¤SSL socket/  ìô(Python 2.0), it also+ ¥ Z #s"˜ !Ifç ¬ Q part!—¡lash prece, N ñre both omitted,• q"/RPC2"Š cssumed]  õ afollowîu can be:Ð keyword argu"s:3 ÏÆ:N~  ' »:Í grequesÑµb :Allä@ pasý!toI ­0 arKß  ;1use  *… . 2"""e  '�__init__(O,,Ö=r?  Ib=Falseh ê  aWS_none#  º‰_datetim Óbuiltin_types- £ L  	 3*, s0=()a  œ )Z & #§C a "V"Ã.ü 3 1getO5urlx ð
p = urllib.parse.urlsplitGYRif p.‘ not in (Á1",  's"ž  o óraise OSError("unW%ed9–protocol"h  ˜!._\µ = p.netloc®  oandler»  "un½  ["™ ¦", *p[2:]]b !ifÁ ð self.__handler:'
  õ
self.__handler = "/RPC2"
& õif transport is None:  K úif p.scheme == "https"$  ( e TSafeTU 	L  ( óextra_kwargs = {"context": 
 }4 ;els’  F n j 
X ÷ #= N è(use_datetime= ,“  �   . Ñbuiltin_types@ 	 E ƒheaders= 1 (**O)¦ ùä  ý& µencoding =  ¬or 'utf-8'T £verbose = 
 ! �allow_non$  w Àdef __close( )I  5.__¨ .& )9 qrequest; ÷, methodname, paramsO ƒ# call a& ò on the remote server[  ËY ’ = dumps(O 
c =ª  §þ 4  !).@ 1.__ ó	ing, 'xmlcharrefreplace'ª Pspons]ˆ 2Æ (“ 1 & Jhostª  
 J 
 ñÌ  	m © ’if len(re° )>1ï ›  4 =  8[0]–Eturn  Carepr__	õ!re1 
ù"<%s for %s%s>" %² C .”€ass__.__QD__,   9 -j Ç õ ™ dgetattœ  , N ¢ t# magic–¥dispatcher• Ä !_MÞŸ ‘P 
¤# note: toìÞñobject with a non-standard? Q, usep #\Cult ¶ (@, "sV ge-python-Æ 0")(µ	î  d‡ , ø ë ð """A workaround§ ±get special. dibutesœS•QProxyž  \!  Ç Àout interfer«Û  ÐN#__Á %__: 5""" !ifo  ƒ"WÁtò" < (el>  .B 
& F ¡raise Attrô uError(" 0 %rÍ  f*P" % (M),)menhÐreturn self

ð    def __exit__(self, *args):
     ò.__close()

# compatibility

Server = 	 PProxy' - 0ð 
# test code

i­ ñname__ == "__main__":
¯ ‚# simple4 ôprogram (from the XML-RPC specification)< qlocal sÎ Á, available ? ²Lib/xmlrpc/" 1.pyt  
þ ‘("http://S £host:8000"k 6try_bprint(F ö.currentTime.getC 1())o üexcept Error as vJ £"ERROR", vn �multi = M CCallm P   l XData( xpow(2,9 radd(1,2 	Æ ñfor response in W (F Jë ' F Ð Dr"""Ämôs.

This module can be used to create; mBs
by! Sing aùð and either install @func-¢s, a
class ðnce, or by extend-  kS‰bXMLRPC« 7 Q.

It§ Halso¬ Vhandl¤prequesth ð a CGI
environment usi 2CGIb R- HC rqe Doc* ¬ !esr a that
ð pydoc-style docuw 0 ßÄ d”HTTP
GET ² !. ’5 ðs dynamically generated
ba¬!on¡g‡ðmethods registered with* ¥  ê ð A list of possi±òusage patterns follows:

1. IÔ j #:
L  Ãµ5(("Ä0", Æ#))1 .˜ _M O(pow õlambda x,y: x+y, 'add'1 x€_foreverj2¯ %anp":
J‚ MyFuncsÉ%inÉ| # make all' ž6sysëÀthrough sys.Õ _mx À`import   N = Š  ”M¿W	Ž f P! t»( 1 so H Gtem.B n p# knowsv�advertise 4  .- areturnƒ_public_# ’ E + \-  ß    ['û 3' +O  Ù7  ø • M a.sys)]N  ÿ  ; “, x, y): Œ    *  R*  + _x + y›0Pintroð ¾à_functions()
sòerver.register_instance(MyFuncs())
s$  ð_forever()

3. I/ dll an : ñ* with custom dispatch method:

class Math:
    def _listM" rs(self)    c# this@ ÷ must be present for system.D Y = eo work ñreturn ['add', 'pow'] ‰ § AHelpˆ ,x � !K _ � #ifb A == ” ú  2 ¯ õ "add(2,3) => 5"Q *elA  Î A Ñpow(x, y[, z]G hnumberL *se< ó# By convention, Ž Uempty„  § ù# string if no help is available- F "{ w'	u‡, params}î  í *= { , 
ð ™ 9 S[0] +‚ "[1# ë ,el'óraise ValueError('bad×3')
?ñ = SimpleXMLRPCSTö(("localhost", 8000p”ptrospec†A_fun	 %s(š* ¾?ath»	b4. SubŒ— 	§ª & ˜Á:tryt€# We areÊcBÐthe 'export_'ècfix onP`s that1 Ø •Q# caljð through XML-RPC toE  Ã@ potÊ�al securiÅ‰problems\  p£ = getattr¢¢ +š )5 ò except Attribut
ö 3E) Rion('-P "%s"9pnot sup^ed' %d l†Ù ® (ü”  ¡Q G ` , Á AûWx + y² § ª	ç5. CGI script:Q 2CGI ÁRequestHandlND ‰ É  ðE(powéh/ "_r= ð()
"""

# Written by Brian Quinlan (b ð@sweetapp.com).
# BasedWfcode w? ðFredrik Lundh.

from xmlrpc.clit im˜ð Fault, dumps, loads, gzip_enV   de H Rhttp.é  F  ‰ JHTTP/ Dools- rpartial !in £signature
Z Fhtml y ð
import socketseô rver
import sys o
 $re Tpydoc ótraceback
try:
    F áfcntl
except IZ RError%  ð = None

def resolve_dotted_attribute(obj,  t, allow" ²names=True)T ?"""E ña, 'b.c.d') => a. 
± Rz Bs a } n }  e ñ to an object.  Raises; Dan A© Þ w if anyB òin the chain starts with a '_'.ƒ !If% �optionalé  ð argument is false,® ‘s are not� 0supÂ�ed and th+ 0uncU ð operates similarÖ 0getYc!).H 2"""˜  Î tn ë = 1s =î ±.split('.')D Nelse* [3 ]] �for i in? s, Rif i.* )C('_'â t   r‚z(v    €'attemptê áaccess privater á�"%s"' % i? Ç  M 
Ë   hobj = ?i/ Qretur,Öðlist_public_methodsnÐ A"""R1  | + 7 ofœ àstrings, found* J‘specified² –à, which repres&wcallablë sÖ¥ €[member ˆ ain dir¢ ^  ì   ifh *   q2  : ˆ (-E ó))]

class SimpleXMLRPCDispatche,¢"""Mix-in , dthat d% ós XML-RPC requestsTTÿ2 pis used	…register6 –„ handler× > en1 i  ¡7m. V ¢doesn't ne[ !be�instancedK¢ectly when‚ )byë  Seyb but iÃvcan be E 	<   ’MultiPath.C z á PÔ__init__(self;bnone=F>�encoding=„,A  ± òuse_builtin_types9 » '  Z P.func%{}C  Â å 1    É Ž  >b  
B ¡ 5 =  ªor 'utf-8', ­   =q
Á w _¦ & 0_ÿ ¾Ns!=  6Prespo„oiŸ vOnly onï ÿ llÉƒt a timeÖ 7 .Å et0 haK_µÞt� 86ð method will be ñcalled with the name of óXML-RPC method and
  õ
its parameters as a tuple" õe.g. instance._dispatch('add',(2,3))
. Ir ¥registered; õ does not have a K ˜ D Athen¸ v ð will be searched to find a m� <ingE °and, if fou
 B '1. M€s beginn@ :ean '_'Š ¡are considË pprivateA“  Î 2be U 5 by9 ùSimpleXMLRPCServer.$'a "‚functionÌ des an ³€request,En itb 
Ñ f4eadò^ E
�  # opv ðal allow_dotted_9òs argument is truô &thW ×,š’sÀ acontaiz0dotq ¡e supporte£  resolved,–@long 0non×G  È  ² @ seg° rs startÎù  õö
*** SECURITY WARNING: ***¡ ' PEnabl b ! =s<¦s intruderá  E ñto access your module's global variablòRd mayN Ý  C Y  ôPexecu�órbitrary code on` Æachine.  Onl� G ’use this ¸  3 ÷	a secure, closed network06"""Uself.÷=s ¯ ! + =× 	aW 5def	_(H $,  a=None,> %):q C"""Ri ¸2  *arespon)Ksà 3The!alb ø0canruÁto set a Uniq r† 0forž± .  ? }  ö# decorator factor¡ §0is ñ å  = `return©Atial!.ã8$ œ ‘"ifÙ X  , & =º _þ%__Â  ‹.X s[, ]- Âž  '  Q 	Û ÅAospeç± sÉ Ð x»	@ P txesystem³  ¨ Wspaceèðsee http://xmlrpc.usefulinc.com/doc/res©ed.htmlN  Ã ¢.update({'~ S.listTA' : *  _ ,K  8 F ¡œSignatureJ  Ð,
             ò'system.methodHelp' : self. _ @})

: ðdef register_multicall_functions(? !):,  0 C"""R/ ås the XML-RPC <  e 1 in  z @ ¢namespace.€  T ø$see http://www.xmlrpc.com/discuss/msgReader$1208"""= 0lf.¯ ¥s.update({Ï  ñ_marshaled_dispatchý „, data,  EÓ = None, path 
(DF ees an (�c from r ‘led (XML)j 
4 Us are‡ "edD  „H sQusingŒÙ ¤1and õresult is returned asA _  õ. For backwards compatibility, a£ A  Ÿ Ná can be provide   argument (
1com %in@ ó SimpleXMLRPCRequestHandler.do_POST) but overridï ? Pexist šñ through subclasiÎæpreferred mean‡of changF ¥ behavior.q 	¡6try? ïtparams,„€= loads([ð, use_builtin_types=�. ¿ P   õ# generate responseŽ    %if–Àais notÅ
   0 E , =8 (E ø Ç )g OelseM 
Í ‡L 
e# wrapÏ  P a ¬ªleton tuplä ´ ( ,    × Fumps( Ž! 9=1,Ù  	 ¢allow_none¡ `, enco…  Š �except Fat@as f	 
7ˆ © $ &, g ]  ° † 7  ” 
… ’# report ± 1ionö© to server#1exc²,/ b_value �tb = sys." Vinfo(w  T!  	l  "   Cð (1, "%s:%s" % (f  :} ˆ /))
f
Ð kfinallõ ® �# Break d‹ence cycÅ ( Â & =K LÐNone

       ò return response.encode(self ñ&ing, 'xmlcharrefreplace')

    def system_listMethods@ !):"  & 2"""% .% ð) => ['add', 'subtract ¢multiple']f  D Rª @s a D ’ of the mq Ñ supported by ¦server."""C - Q= set¤ å.funcs.keys())° 1if öinstance is not NoneÖ  – 4# I$ çcan implement 4 toh½ k E š 	 ¢if hasattr« � 7, '] 's'h M   O ' |ê ? .= õ  9 2# iX.  ƒ Ã a _dispatchq cIn we± ð# don't have enough informationsprovideÅ> #of^ s Aelif~�  <ƒ_public_&
^sX(. ø ‚Signatur<,Ê W_name¡	6 ±double, int  describing‘$ s„ 
@. In  V0abo¢ xa®, C add³   takes two� Ðegers as arguÙœ3and× •µ  IFult.tRThis �” does NOT®:.
µò# See http://xmlrpc.usefulinc.com/doc/sysF †sig.html‚ Ç'Ì2'+ ÊJ AHelpÍ1 ÈK"AddH‡together”×0strÉpcontain 1doct?1for«„specifie±
/¼ ! =¬òi[‘2 inàþ
Ñ@ ! [ ; ]S —% ,& [  : «Phelp ï a”u  ¤	O _ 	µ . ƒ äé  t U ú 	í f {ý":tryÞð        method =ÿ resolve_dotted_attribute(
  ïself.instance,/ ¯method_nam- \ Tallow™  8 se )" „except AØ mError:'  ì Upass
 ò# Note that we aren't checking Bthe Ø — actually@ õbe a callable object of some kind, $ifG zis None¡ •return ""1 ?els$ Òpydoc.getdoc(› )Ô ðdef system_multi™ (h,¤ f_list)x 2""". .. 2[{'S ò!Name': 'add', 'params': [2, 2]}, ...]) => \
[[4] ˆ  jAÚ s ? ‡ áer to package p ±ple XML-RPCŸ õ s into a single	†request.\ õ!See http://www.xmlrpc.com/discuss/msgReader$1208K 6"""F Åresults = []" 1for� 1 in 43 Ú  æ! =% [4L  - 8(  &']†  % :tryc   ð# XXX A marshall’eÚ › 0any×ñ ponse will failnVentir> K   #u Œ2. I¢�one care§õy should fix this. @   2�.append([[£._dispatchŒ", ê *)]¯« Fault as f	 ü i ‰  � !{'= rCode' :J . ­4 kString6  }l Å ¶  exc_type, 
 Cvalu @tb =™. Zinfo(Q  Ï    ( 1 + °"%s:%s" % (¢ Ä ) I Ç 0fin# / ÷# Break reference cycê $  ‰ & =N O C¬>+] œ «,‚�¦ C"""DÇ šî}  Js4  forwardedãña registered functionK® m.g  F +edn  
¦uno suchI D Qexist¸ ]  ÇTll isŒ Àed to the reógistered instance,
  åif available.
 �If the re; ð has a _dispatch method/ en thatD  ðwill be called with- r name oh tXML-RPCL 5andF ñ its parameters } Utuple" Ee.g.Ú .™ ß('add',(2,3))Ú ßdoes not haveä  r 0theì ev  å ðsearched to find a m&3ingÝ E °and, if fou
 B '‹M`€s beginnI Cñan '_' are considá private anj%lln  × …. 6"""Etry:   #µ®Æ ‰function4   € = self. "s[]& ú except KeyErrors Fpass* :lse  0Runc i©;Non!  · preturn ~ !(*<%s)T ! aaise Eˆ Rion('£ T "%s"[ Ãsupported' %»F"ifâ Q6 ‘  if2Qattr(2 5, '«*')æ  ¤ |`) `Š * o€	Þ  > 	r ð ,YsØ  < z ­ $'sy ‰directlyr 9 G  ð = resolve_dotted_	iibute(B  1   	± ¦   ¼ ? Tallowp  fQD 
‘AAttr› —  9 	›  eŸ  £ ) ¤ (§× r¤&úclass SimpleXMLRPCRequestHandler(BaseHTTP „2""";  •r> " h?  ` ¡S `s all S c POST 2 s‡€attempts`decodeQ2m a—f sœ˜1# CÏ 8P list  ñaccessible path components;I# ,3!is@ °ðresult in a 404 e�€ @rpc_R ós = ('/', '/RPC2',1#if* ðA, en× ðresponses larger ¨!isé"po« š 3 ð_threshold = 1400 #aÅ rmon MTU›ú#Override form Stream¼@: fufPufferàof output
    ñ#and no Nagle.
    wbufsize = -1 �disable_n% ñ_algorithm = True
$ ñ# a re to match a gzip Accept-Encoding+ ñaepattern = re.compile(r"""   …  à\s* ([^\s;]+)  & —#content-i  	  (;= qC =
 ÿ ([0-9\.]+))? #q… 
@""",¶ �VERBOSE | ²IGNORECASE)Qdef aû #_eû …s(self):^ er = {} aq # ë.headers.get("Ae", "")5 ÷for e in ae.split(","d  ÷ �!= \ |. &(eL  , "if¿¦     2v = Š.group(39 # õfloat(v) if v else 1.0°  '   !r[ L u1)] = v& †return rLüis_rpc_path_validM"ifà & sÂ R  E  3 0 }  ´ 
= e# If .* ð is empty, just assume all [ µs are legalT ó Õ 2 $|do_POSTÎ ð"""Handles the HTTP ( ’ request. W 0Att� sz‘interpret� 6 õs as XML-RPC calls,¢ 0whiµÀre forwardedR  ~ áserver's _dispÝ`method+   h¨ 2ing< ’  ÇX Á# Check thatÌ  # B
!bif notÃìÑ¹ªeport_404(Šë!<tryÏG"ð rguments by reaž† body ofg Ð  A# We* P thisBQchunkzÄavoid strainç8 psocket.f ¡(); aroundõ10 or 15Mb mark, some platformsG L p# begin—öhave problems (bug #792570)ˆ 4 Amax_¦ _Òq10*1024 	^    B_remÁ a = int—�$["bŠlength"]xiL = []T jwhile Z 
Œ ¤ 	  Jmin(1 *, Å 
v A  áRrfilekY 4 q# “  V YbreakÏ   ‘L.append(: X 
¼ Ë -= len(L[-1/ódata = b''.join(L: e     ìsdecode_ý_ˆ(# 
‚ 0if   `NNoneÙ ðreturn #response ÷has been sent

  û(# In previous versions of SimpleXMLRPCServer, _dispatchD ðcould be overridden in this class, insteadZ +in? k Db ûer. To maintain backwards compatibility,K ñcheck to see if a subƒ  Ð VmentsÈ _ and Õ ðusing that methodP 0preE.w ñresponse = self.s/µ._marshaled8(8 ˆàdata, getattr(C 5, '4 ’', None),] :pat F )X �except E Ðion as e: # T�!shª�only happ¨õf the module is buggyP  ^ ð	# internal error, report\ RHTTP ñ  	:  Ì d.send_$\(500)„ÑSend informatµ About˜ Ð   Éif requestede eif has< Cz Ptrace?‘_header')ö\D  ç   ±  ï/._? :8 4 #nda E("X-· –", str(e)£ h   ™ 1 =   ¡ .__exc(/  O 3 ð.encode('ASCII', 'E óslashreplace'),  P · X  F "",— «4 úContent-length", "0"l 4  sÛ JelseP- x121 0 $ R $("… @typeƒ ‹text/xmlŠ "ifC8 _thresholdö1notg
�  s tif len(� ?) >F :  > #q  ac™_| úings().get("gzip", 05 ;   Oif qY   ?try  ! µ 0 = h ~ eÌ Ì 5  hEy0ingl X hA   	P NotIP €0edEFº Ipassž Ž { 	«uC Š «  ¨wfile.writ'Š `def des_‰"_cþ´ È)× A#sup' # ù ? V  z  ,Øs!d -%  u÷identity").lowerT!ifk Àding == "ide—ntity":
  µreturn data ûif encoding == "gzip7 :tryH  S L  / €_decode(X )Y  % þexcept NotImplementedErrorQ õ
self.send_response(501, "Ÿ õ%r not supported" %¼ x _Valueo 0400o  Ÿ  Ó   á – content"f JelseÄ À 5H ’header("C~ Ç-length", "0Š 0  7/ As()
„`def re*`_404 (( )³ 1# R! 0 a # eú <  ¼ 0 �6404¦ÿ = b'No such page'C  œ Ë @typeÉ ¬text/plainÒ 
7 „str(len(… &))™ ¹ 
 Ð    ¶wfile.write@ 4±log_request4 , Ý ='-', size
 Hð	"""Selectively log an acù3ed J B."""c  ‡ 1if Š ²server.logRq s ƒBaseHTTP RHandl0 ¢  ž °)

class SirqXMLRPCSh s(socketu 2TCP ,¯ › 	 D £Dispatcherý  ù d “ XML-RPC Z è <  ñ that allows functions and a single instance— Cto b ‘lled to hYñ s. The default ‘  gaZ C €attempts< dÅ — Acall 7the‘ *or‡ ” � 0in + ë ‘ Override __ °method inhegd‰ Ifrom—S œ PchangI Áis behavior.9 <9ò_reuse_address = Truetð# Warning: this is for debuggÍò	purposes only! Never set/ !toL 1 inw q# produ¤�, as will”   S �out sensiq inform}" (þ$ioO  ç stack tracµÅtails) when . °s are raiseC2sid#=qdo_POST¹ _œ _d Rback_Fs = Fals+ ƒ__init__ç R,Xl=ÇG
s 8 É=–,ëa_none=} ,±_=NoneD  `bind_a  S3ateJ  ô€builtin_>sQ � ·àself.logRequesóts = logRequests

  ó@SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding, use_builtin_types)
V ò socketserver.TCPS
 W bddr, r• ð Handler, bind_a òctivate)


class MultiPath± V (Ä  !):á 1"""2 Òpath XML-RPC "   þThis specialization of P Ps theö ±r to createH m— Fple Bð instances and assign@ m< ‘different? DHTTP ¬ As.  œ ðmakes it possible= ârun two or mor‚ …'virtualæ {Ps' atv ± same port.s ÃMake sure th" 
‡r acceptó ” A in >2ionE 1"""M Odef Ú=XŠõH = ®X=True…W=Fals‹ =NšD JJ ¹Q /):2½· ² ,� æ 
 [º nUelf.d¾ í%{}r  Ã.Â" =ÎÏ
% € % =æ fr'utf-8' íFadd_o $ %&,  „ â ‚   s[, 7] =. ‰ hreturn   w ?getw k ? r Â –_marshaleÉ Ç FdataÇ ¡_method = cž u 2tryq í   ¿response = Š .� é  ?  ‹ ,„ j ex¨
 @# reì² low level '  á@backG"	t w# (each}á should have h¢dPkir own= d sŸ  Ë 1exc ,† Q_valu0ys. ©info()[:2]O T J Xidumps(3  "   ðFault(1, "%s:%s" % (j 0typ5"xc„ /))–=» Î S
ï  ƒ ©  .J eg Eú'xmlcharrefreplace'O kfinalla d ¡# Break reLrce cyclð             excð_type = exc_valu cNone
  ò&return response

class CGIXMLRPCRequestHandler(Simple ÁDispatcher):P 2"""  " h/ ð for XML-RPC data passed throughg Q."""
? ðdef __init__(self, allow_none=False, encoding=Æ Ñ, use_builtinë s( ‘  ä ’ ² .i c ^  )ª ã s_xmlrpc¯ r-W_textƒ 2"""@• a single2  ² Œ0 = Ó._marshaled_ds(8 j •  ; ðprint('Content-Type: Ž a/xml')g(  ôLength: %d' % len(„ )4  ÿsys.stdout.flush( Æbuffer.writeV ‰ E * L #  i1getfX“HTTP GET !.�Default Âömentation indicates an error becaus$Âñuses the POST method.¨  T	Ä0codk5400  `messagÃÐxplain = Base² 
e.} s[G ]Ã  õ = http.server.DEFAULT_ERROR_MESSAGE % \|    {   '\ @' :  , ¬    " eÅ  "  	C } ´  .ÅŽe('utf-8—`Status�0 %s’(¤  ‹ ”ð4 !ÆCONTENT_TYPE´;‘ä,ò*ÕE šaœU postéÓPIf noÃÔ€is givenðn it is read from stdin. TheeuªgJ …  ; ‰ $o< àout along withc � correct :J headers�)if g  @K and&°os.environ.rð'REQUEST_METHOD', 8 ¢) == 'GET'ù _  ¯°^Jelse, #Fõis normally available%Bé  h :tryM   lÅð  = int(os.envir÷on.get('CONTENT_LENGTH', None))
  òexcept (ValueError, Typ )):,  7 ¹length = -1 ñif request_text isn A 	& ò= sys.stdin.read(_ ))
\ øself.handle_xmlrpc(F )


# - 9ó
# Self documenting XML-RPC Server.

class ãHTMLDoc(pydoc. ?A"""C+ ñused to generate .  . j � for a se 2"""
°def markup( , d�, escape=×Á, funcs={}, ™ e `method Ž  Åó"""Mark up some plainT °given a cone ° of symbols» @look£ .¡EEach- ñdictionary maps object name? banchor .Þ  Ž   Ê # =Ó @ or é . m Åresults = [] ‚here = 0+ N ð'# XXX Note that this regular expression does not allowØ E theY °# hyperlink�of arbitrß  strings be Ú2as nA ú c. Only bs with 81sis_÷of word charactersG Æand '.'s are• &ed‡ðpattern = re.compile(r'\b((http| õs|ftp)://\S+[\w/]|'d  7 ÿ r'RFC[- ]?(\d+)2 ?PEP2 Öö\.)?((?:\w|\.)+))\b'­zwhile 1Q@matc�þ €.search(¹ , @  Ý !ifî6 y: breakÑstart, end = & j.span(F …‚.append(£t [s :F +])Åñall, scheme, rfc, pep,æAdot,v kgroupsx #if@ 
 Ù 5url<÷(all).replace('"', '&quot;N 5   Ì ü'<a href="%s">%s</a>' % (url, url>lø/fc’ 'wð
://www.rfc-editor.org/rfc `%d.txtd zint(rfcl¤ Ž ¬ ?pep¬ 
s­ apython© €dev/peps d-%04d/® ?pep® K Èþ[end:end+1] == '('Á ð results.append(àself.namelink(	 ÷, methods, funcs, classes))
  Pelif ? Idot:  % ðresults.append(') Ó.<strong>%s</ @' % v \ /seT S  < » « ¥here = end¨   Àescape(text[. ':]î ó return ''.join(; !)
M ð def docroutine(• ‘, object,Ú ±, mod=None,1   d5={}g ƒ !cl> )ð """Produce HTML€ ñumentation for a¼ #orÑ– B."""»  † ðanchor = (cl and cl.__Vñ__ or '') + '-' +Î Ã 0notT&''L Atitl !<a, o="%s">õ @</a>ù(N  ‹  ;.‰— !),a  – )w 1 Âif callable(r$ ! õargspec = str(signatur- t,elp; g'(...)ç Äif isinstancL , tuple€ Ÿ 0[0]T\ 	ý ³docstring =¨![1- %""( ¦ 6 Äpydoc.getdocœrdecl = £#+ ƒ A + (É ú€Jgrey—ñ   '<font face="helvetica, arial"Ï ! Ô O ¥!do€ gjmarkup^ Â ëœpreformat~—¶[    ¿ �'<dd><tt� qtt></dd’ 5docCËb<dl><d,  Al>\n– ,,Ulãcserverâ )Ö, package_docˆ± ¹¢n XML-RPC c 
¯¥fdict = {}Ó  ïÓkey, value inï‹s.items(”B ¡[key] = '#Ù5keyO  8$ P  &   3 P�   _ ß» «@headp R<big> !</   ‰J Ÿ }s  W @ing( Q, '#f ' s7799ee'Ã Ö  )=QŠ¸	‰ uÌ H   ws µ 
n 3 = ¶ Q+ '<p pl . Ü Õcontents = [] _Í ø borted( äž A ‹À         conó)tents.append(self.docroutine(value, key, funcs=fdict))
  “result = 	 !+ D µbigsection(+  2 á'Methods', '#f  `eeaa77 ¡'.join(conš 5))
A creturnj ñ

class XMLRPCDocGenerator:1 3""" Àes documenta’ p for an: Â-RPC server.h RThis Z ñis designed as mix-in and should notk ñ	be constructed directly. 2"""Z Ádef __init__i)©  ñ# setup variables used© JHTMLÀ W  6 j¾ Á_name = 'XMLÕ SÕ ( Dù ': 
5= \&  d "e ò	 exports the following mÓ� through ‡ "N ¥protocol."f Æ OtitlÇ <  PBset_œ _; X,Ò fa"""Set  V3 1 of g?#ed> 
tÆ ² † ð   ¡
Ÿ   ž   ˜ ´ h � H =Ñ #› 	
¤ 	 ­ 	# @ str c &centire‚ .F
D ² 	 » «i_html_% ¾ 
¨ . 	P) => F 
Qy ¿ nz  úR�	{ 5 0 us	rintrosp # ¼ L pinstallç!un+s] 0ncegPat doh` impleÃ ­D “_dispatch…ö. Alternatively, M Öcan choose toO K  ï R_get_ÏB_argÌ(  M)h  C yprovide� 1arghÆ in$ b G5the w OHelpq ¡ help text)F k 
vÍ fs = {}Ø ¯ &2 inÇ³system_list¹(]Æf
9 -à *   d  á1lf.% [ ? ]É  - Belif‡ Æ1 isONone] �_info = [%  ,  @] # ÏApec,‡Àmentation
    ù%if hasattr(self.instance, '_get_method_argstring'):
A  ( ©info[0] = N .L (5 ]name)V š 	9 OHelp� 1�  B 
† ‡ ) _Ù „ = tuple2   ¸ 4  != (None,  >
7 = : Š �elif not±�dispatch?try¾ Å{ ð = resolve_dotted_mibute(’  7  	ø,3 z _0 t … ±except Attr¯ _Errorï ~  Í~ OelseC 6 ²; ñassert 0, "CouldÐCfindú2 in:Àfunctions an& = "\ž  ö  "· 	 illed"
0 ° "s[ l  + ödocumenter = ServerHTMLDoc(v% a¡ 4 =  qer.docs6 -)- � ,2 t „ ; è s; )hreturnÙ òpage(html.escape.¿ utitle),0 • ÿ)

class DocXMLRPCRequestHandler(Simple &¡"""XML-RPC	ó " rM " hN  l .Ã b ô s all HTTP POST2 Rò
attempts to decode them a$x f sY +GEX i<0preZ P x }:for'. #""°¡def do_GETb
 ¥4"""Ø 2theØ  ¢  * I„ ) Es as”  � Æˆ  ? 	hŸ    £     À# Check that8å path is legalJ °¸pis_rpc_) w_valid(Ü  T & §report_404p  ’ß dsponsejÄ  .generate_«_Ê Àtion().encodÃe('utf-8')
  ÿself.send_response(200  ÿheader("Content-type", "text/html"6 ôlength", str(len(w +))?  ” t +s( ¶wfile.write@ ø

class DocXMLRPCServer(  Simple ,  & áDocGenerator):- ñ"""XML-RPC and HTML documentation sp !.
/ òAdds the ability to!  r< !to- 2cap0 1iesG /of¾  . 2"""k Ðdef __init__(Ðõ, addr, requestHandler=R  3log$ ÿs=True, allow_none=False, encoding=NoneD  `bind_a sctivateJ Àuse_builtin_CsQ f ˆ¯.ß ', ¶ �   Z  Õ Ï -, ¹ M Ø ´T
Ñ )»2CGI/ �½O(    Ÿ U Ød T for äAdataé
äSñs passed through‘9CGI”hxA_get–â2"""t #„HTTP GET±C ®�Interpret‚ ) Ds as5 s¿ „�  ? 	½ 7  §   �0 = =".gù e_Ô_B 1().÷Hk tprint('eType: r) LŠ: %d' % ] Røsys.stdout.flush! mbuffer( õ   E * L x WÁ‹× f   }* 0

iÅòname__ == '__main__'ò import datetimeúñ0Exaà ï2ice/  v  Á |getData�  ²return '42'N   R §currentTimO    @sìqcmethod&    m C: (0 "   t Æ .	 Rnow()‡ Owithõ ð(("localhost", 8000)) ó÷  ð.register_function(poCw)
  ÿ server.register_function(lambda x,y: x+y, 'add'9 ÿ#instance(ExampleService(), allow_dotted_names=TrueL •multicall� &s(. qprint('a ÷ng XML-RPC on localhost port 8000² 8 òIt is advisable to run this e¼  ÷ within a secure, closed network.] Etry:U \C . ‡_foreverÅ ú	except KeyboardInterruptE ³ 4"\n( $ i) ö received, exiting."$‚ 0ys. a(0)
im¤contextlib $os
 Gpath dshutil Estat y4 °zipfile

__®ð_ = ['ZipAppError', 'create_archive Aget_È ðpreter']


# The __main__.py uj`if the òrs specifies "-m module:fn".
# Note thatÉòwill always be written as UTF-8 (> t and
# õ �@ can5 ðnon-ASCII in Python 3)m ðWe add a coding cookie eveHCoughg !is¿ xdefaultH �
# becaus¶ Pe resô3ng (@ may…  (@nded§!beªTunder‘ ó2.
MAIN_TEMPLATE = """\
# -*-  p: utf-8 Ä{ $}
	 µ.{fn}()
"""ŽóWindows launcher È s� H�when parsâshebang lines » ^ðile has no BOM. SoÑ#3on h  Z�On Unix,!  ú _’system enoð	.
if sys.platform.starts®r('win')F� _9 A = '
o'
else%  \ 6get{ A ·()


class åa(Valueðy †pass


@o. ó	manager
def _maybe_open(ö,ÖeF Uif isW" ó(str, os.PathLike)0  ô  R   úfñ  '   qyield fµ q "

­  C e_¢_prefix(f,ŽÆ… €"""Write5.X \  Õ  Ã5 ’ ¬¨ = b'#!' +\ .�#e(% Ñ‘) + b'\n'Å  _ !f.¨ *  °kDcopyƒm4new 	Ì D=Non†ð"""Copy an applica§±0ifyÿ ¯¢ ô •îP'rb')œ6srca# Skip:P R from eource.ö ò# Read 2 bytes o5s&  ãð check if they aƒre #!.
  õfirst_2 = src.read(2) 5if ! …= b'#!':  B ò# Discard the initial 2 bytes an qrest of$ Æshebang line‡  L j I b''f ›  4 5()
 úwith _maybe_open(new_archive, 'wb') as dst¶ ö_write_file_prefix(dst, interpreter › 1# I¾ £re was no Ç 3, "· ¡" containsç  	± L 
`ource † Q, so •  = ðm before copying  DH  A 
JAdst.N (‡ _Ò ‚ pshutil.^  < €obj(src,(](ifÈªisinstancefFstr)^Šos.chmod$ xos.stat À).st_mode |  ô.S_IEXEC)


def createÍ!(s,Ù, target=None¯ Bmain 	+ õ    j2ter  ó compressed=FalseÅ A"""C{ ó an application WÒ from SOURCE.Š3The q can be°@nameôða directory, or a‡ e  Q-like² Ñobject referrûo‰ Pexist † z  v!en_–   is packedÄ? È ¡in TARGET,y TwhichÀ ¤     . o ä N Z O qomittedGù will default to+Q ÖA.pyzK ˆappendedó ¡dŸ` dhave a¤kp specifOW ñthat it should run x ðINTERPRETER (theò ³ 'beöR !ifJ 2 0is ›!),ì @a __’b__.py bÒruns MAIN (if	 !isH 3not¥ 0iedA  ö	G Ž Pused)‰tñ�an errorJ #toI ya fw@nythBoÕ 0 thß› a!noG v  � d/iÕk  ¾ Úd i Q h(I ¨1""" 0# A`é Ç ë?* Ÿ 1_isµ1 = ´ ¥if hasattr&'È ü/nd  I'ò _ 2Tru‘Felseß( ó  = pathlib.Pathw 2#ifO.° (k o Î e ì } _±	Š ðreturn

    # We arð8e creating a new archive from a directory.
    if not source.exists():
   ñraise ZipAppError("S, Q does< 5 !")O Âhas_main = (T Q / '_ ò__.py').is_file(2 1if 1 Dand >  	g  š   A"Can¿ ðpecify entry pointÚ 3theÚ  [  ‡ ¯ þ (‚  or& « )‚ 	#"AR hau 1")
   P ¡_py = None è Y Â# Check that P  ³ Âright format¦ ì °mod, sep, f_ c â.partition(':'P+  _ok = all($ ð .isidentifier()\   ö in mod.split('.')E /fnD /fnC _°sep == ':' ç0mod[   e n ¾ s xInvalidkQ: " +8³  wâMAIN_TEMPLATE.K�(module=ISfn=fn®Áif target is±¥ =Gó.with_suffix('.pyzv#elì ‚hasattr(9 —, 'write'ã  ó  = pathlib.Path0 ‘  f Ã _maybe_open  N –b') as fd¤ _c T@_pre› ö fd, interpreter" compressioD@(zip‹€.ZIP_DEF-D9' bed elsÁ › ? fSTOREDj Ä ! 0ipFó ˜ T'w', a Gion= Ü zÛ  p �for child­T˜.rglob('*X ,   ’arcname =6 Ã.relative_to“¥  0   ”if filter3 or (P Â 2  !z.~(¢ ,m } §.as_posix(Q 3 :_pyå   K Istr(2,æð_py.encode('utf-8¬Zìb Šc.chmodcð.stat().st_mode |  ÷.S_IEXEC)


def get_s  # c#ú¾‚D, 'r¿þ  {€.read(2)%Vb'#!'  �return f' Aline¡ �rip().de�shebang_"4ingª  `(args=‰¡ p"""Run k`zipapp�m� ] 9Rface.Í€The ARGS2 amP³ lets you sy L âargument list hlgAOmit”I b(or se Qit tovq) worksßñor argparse, usingëÀsys.argv[1:]( w Àument list.
€    """
 ñimport argparse
  5r =  .ArgumentP% 7r()' c.add_a  ñ('--output', '-o', default=None,8  x   òhelp="The name of the ? ¢ archive. ¨  0  õ
"Required if SOURCE is an6 "¢ 
apython¢ p¢  P? ÿ interpreter to use¬ (ÿ: no shebang line).¦ 2mai¤ m¤  1 ” functionOqapplica KŸ  Á àan existing __Q ___.py« �compressSQc', a„ ß='store_true'üC8 ± files withïdeflate methodF3 Aare e Dd un‡ Ted byyf8inf¦_FalseÀ qDisplay´ Afrom Æê	_sourc S æ directory (or¡] �Yrargs = ¿.  š s( )Ü¢# Handle `¥ -m zipapp=`pyz --!`.X  if
 s. :  ‹ðif not os.path.isÅk .Ó ),  0 ðraise SystemExit("Can only get ] G forÇ; B c=5 _ 	z ¥ †print("I¬×: {}".format(@ Ò or "<none>")? t Psys.e® 0A/ifó 5Ð0is  f (3kž.' U) and½  €  C Lsamex,®R †ÁIn-place ediùoï~sW å0sup((edŽ ' 0gs.&ê G achange 6 ­Ówhen copying"iscreate_æß	á 
X/Ø=ý.í , w   
 < F)  �)


if __®t__ == '$' T 0()
]@ReadÍ¡ write ZIPÎñs.

XXX references<ñtf-8 need further investigº.S ¬“binascii
  …lib.util o
 ðtertools
import ôos
import posixpath eshutil 6tat 6ruc yD ”threading* Dtime ¤contextlib  n   £
try:
    Œ ñzlib # We may need its compression method5 €crc32 = 6 . ‘
except IÛ RError`  # y = None; ƒbinascii? ‘ ?bz2� y  A x ] Olzma^ +B _ ó
__all__ = ["BadZipFile",  f e!", |à   "ZIP_STORED0   fDEFLAT TBZIP2 KLZMAB dis_zipd qZipInfo0 ˆ 'Py• ULarge 	Ž æPath"]

class Ì !(EßBion)×Tpass
( Q * 1"""c óRaised when writing a º T, the ð requires ZIP64 extenƒsI —and those á are disabled.'  x 
r# =Ê  $  £…‘# Pre-3.2ïàatibility nameå † ð_LIMIT = (1 << 31) - 1
±›FILECOUNT$ &16$ ¦MAX_COMMEND   ñ
# constants for Zip ¬ sr 1A = 0 2A = 8 3Q = 12  5  �4
# OtherYí 
Ü�s not supŸñed

DEFAULT_VERSION = 2r '64 145
p   6
t  ñ63
# we recognize (butp ´necessarily| °) all featuàup to that ver

PhEXTRACž ±63

# Below@someRPmats 8ð associated data  A/• headers usW#š st€Ò module.  TheV  « 3of @ /ë 1rds‰ °‘used
# inT ð PKWARE descriptc!of 2ZIP ‘format:
#©ñLhttp://www.pkware.com/documents/casestudies/APPNOTE.TXT
# (URL valid as of January 2008)

#Ñ @"end õcentral directory" â ñ, magic number, size,pindicesn 1secÏ 4V.Ií Ê  ­ ")
R ð	EndArchive = b"<4s4H2LH" ;ing ÀPK\005\006"
y ÃEndCentDir =£ P.calc (a ñ)

_ECD_SIGNATURE? °DISK_NUMBER'(  @STAR±2 ÐENTRIES_THIS_! K = 3 ‚OTAL = 4 ðSIZE = 5
_ECD_OFFSðRET = 6
_ECD_COMMENT_SIZE = 7
# These last two indices are not part of the structure as defined in À
# spec, but yA 0use! ðternally by this moduleF Ùa convenience¤ B = 8 ÒLOCATION = 9
² ö "central directory"Ÿ ð	, magic number, size, anŒ Þ `
# of B Bies Â ? Ô (section V.F ñformat document)
sCE ð	alDir = "<4s4B4HL2L5H2L"$ 9ing$ àb"PK\001\002"
š 	 V P.calc ( # )indexesÄ  Ö Ð
_CD_SIGNATURý0 ²CREATE_VERSc1 ¡SYSTEM = 2 wEXTRACT. 3 / 4 ÑFLAG_BITS = 5 ÀCOMPRESS_TYP„ 6 0TIM 7 0DAT 8 1CRCö ¼ < EÇ ¿1Ã /UN  Ç ÷FILENAME_LENGTH = 1Ê g_FIELD Î %4 Ï ðDISK_NUMBER_STARX1Ø �INTERNAL_q  _ATTRIBUTEù 1ä /EX" ù  çÑL_HEADER_OFFS¹ 18òÿThe "local file headeró×A×QFileHd ×2×$2HÕ	" ÕR3\004Õ	 ÅÕ# l)

_FH�>FH_p1*  p2 øGENERAL_PURPOSE_€3" )áION_METHOD = 4 “LAST_MOD_Ž5 —6 —7 Ó—8 –9  $•0 × •1�Zip64 endúë  /to	  W ™ôuctEndArchive64LocatoÆ%LQ¾% òrx06\x07ò0End§8DirM ûT  Ùçæ �" recordäñGñ’ ótQ2H2L4Qñ" 6# =yõF  ÷LCD64ù ÓDIRECTORY_REC¯Ô=64_´Ô&640ÀERSION = 3
_üCD64_DISK_NUMBER = 4
_ £_START = 5 - Ñ_ENTRIES_THISF O = 6# ƒOTAL = 7 óDIRECTORY_SIZE = 8 bOFFSETr p_CENTDI– ð 9

_DD_SIGNATUR2 ð0x08074b50

_EXTRA_FIELD_STRUC¯ �struct.S ñ('<HH')

def _strip_extra( ð, xids):
    # Remove E! ñ Fields with specified IDs.. Ÿunpack = †  . ( 2mod: q= False ±buffer = [] Ñstart = i = 0 òwhile i + 4 <= len² ¬  ° Âxid, xlen = q # B[i :: !])L  - j^  N +4   if0 in s
 1   �if i != Ÿ 
   Æ s.append| +  € |  ,  5= jy   2Tru   * tif not ) … qreturn ÇT  ’b''.join(ž ûócheck_zipfile(fpH6tryS æif _EndRecData%  ’   b  ª     # Q ñ
 has correct magic numberš æexcept OSErrorp Apass! Y  «&is¬ silename² ò"""Quickly see if aƒ ‚is a ZIP 1by ó ying the• !.
v 1The,  ] € argumen¾ Dy beU !or# �-like objà 2too1"""I Presul¿Á  X€hasattr(- p ƒ, "read"Õ  3   J _½ $p=: ÓFelseM ? ¬Iopenh šb") as fp-  1 p g ºH fCó64(fpin, offset, endrecõ ?ARead¤PZIP64$ ð-of-archive records and use that to update. 1rec‡P 	| € b.seek(„ ÿ - sizeEndCentDir64Locator, 2õ A# If¨  O q fails,  ›1 is©@larg– @ough§ rcontain›!64©  z#º è ², so just rà ¼3endâ we were given† N - _Þqdata =   k(÷ ô !ifc 5 )ò$B
r  „ òsig, diskno, reloff  s B•§£BEndAå„‚ &aif sig� _tring/  � @ Ž  C Ð0 or disks > C1:
  ð:raise BadZipFile("zipfiles that span multiple disks are not supported")

P p# Assum ð 'zip64 extensib= Aata'y ÿfpin.seek(offset - sizeEndCentDir64Locator  A, 2)F qdata = M \read(D ' pif len(. M) !=j Áeturn endrecc ð
sig, sz, create_version, p   Q_num,!q_dir, \A  €dircount 
 2  ¯ 	 =4 âstruct.unpack( áEndArchive64, Ð d aif sigÛ Xtring( Ý 9 ó# Update the originalÿ a usingf Q from$ ÁZIP64 recordB +ð[_ECD_SIGNATURE] eg! °DISK_NUMBER# 5( USTART' =dir' ÐENTRIES_THIS_\ . b. HOTAL* 2+ 1SIZÄ 0dir£  SOFFSEœ r¼$ r?ð

def _EndRecData(©)‘B"""R.  Ça€"End of ãral Directory"v¢, or None.r2The¤�is a list?  ÐÔnine items in¾ a @centa Cdir"½  Õñ followed by a tenthE ,B   ¸ ÷ l #is� B."""— €# Determ„ 5 1izeh  û0É "  jÍdtell()J €Check toy ð if this is ZIP : ¢ with no aÂ comment (tht B# "eX÷ X\Âure should bAlastû ?¾ #r †  kacase).! 2tryâ ùì -ß ßú æexcept OSError: K éW &ëÛ(Ü=wF2 an§ �  C `[0:4] ( )* 1-2:* `b"\000 "¼ M #`signat;`is cor¬ J   @re's•�", Ë oØ  L D 4ô
ò7 =ó(C 2  P# Appôua blank3and­P star. �� !.a> B(b""i T e   z Õ¡	† 0Tryº . 2 "ZŽ’ I!64K-, V£ ‚ ƒ# Either1Às not a ZIP ðfile, or it is a ZIP  ð with an archive
    # comment.  Se ± the end of ; 1for " ócentral directory"N ôrecord signature. Thed  �  ^ Álast item inW £ ”and may bž òup to 64K long.  IÖ ±ssumed thatB ™ c magicŸ ônumber does not appear‡ - BmaxCÀStart = max(ðsize - (1 << 16) -  áEndCentDir, 0)D «fpin.seek(N " qdata = ) Rread(9 ss   ò.rfind(stringEndA¿) 2if , Q>= 0:u ×@foun e  ú �; attemptVpunpack t•interpretB BrecDœ  „ [e : +í ]3 sif len(: K) !=  ¤ 2ZipšÕis corrupted.P  % ¢return Non  Ðendrec = listBuct.Í  &$, � 0 @ çSÇ=ëðrec[_ECD_COMMENT_SIZE] #as claii!bygz² ¤ L 6 = '!6+9  … BÚ .–3nd(# ¹ 
 S" +
%)
� P# Tryê ZÀ `"Zip64ô  ßÆ` struc¹E ‚R_EndR064(°,	#‚ ! -Ö ',G  y Ñ ² €# Unable±  ò� a valid® ­ © +ò	

class ZipInfo (object)‚A"""C ñ
ttributes describing eachÇ  ¤  rive."""fÕ__slots__ = (ì `'orig_+Vname'' zdate_ti) Écompress_typB _ Xlevel\ / Xextra 0cren osystem  xversion D ?ct_  ˆreserved/ ˜flag_bits Jvoluà qˆnal_attr+ _exter Øheader_offset2 8CRC  _€  | H_raw}Œñdef __init__(self, Ï ="NoName",óºÀ=(1980,1,1,0 )i ñ > . ð0ileM ‚�Originalc   i¦V±# TerminateÌ Ð . Ðat the first Ônull byte.  N ³s in file
  ñ# names are used as tricks by viruse6 •archives.;  b _b ! =T  I Õ.find(chr(0))* 6if - U>= 0:  ‡  ‘  = H 5[0:2 ]- ’# This is« áto ensure path¦ Ñgenerated ZIP– qs alway3 I Ðforward slash ðs the directory separator,€required(th?h öormat specification(ôif os.sep != "/" and � þ ’.replace(N ,L %)
Ô _self.K  b  0# N§ Qlizedú
? Ædate_time =   > ð	 # year, month, day, hou vin, sec‹ &if> ›[0] < 198õðraise ValueError('Jðdoes not support � Ñstamps beforeK 'ø p# StandÍvN sIÀcompress_typØ àZIP_STORED # T 4of % qion for L
_' Álevel = NoneA # L = * *orC Òcomment = b"";  3# C  E Aeach§
@ _extra> 1  #ô! Edata9 öif sys.platform == 'win32'+ … / re system = 0  2# S qwhich c* js Jelse] ð# Assume everything & ÎUnix-y=  n Œ 3  Œ K @versäð= DEFAULT_VERSION?V ß S j?ct_T $# S pneeded ² Á<ct 2S Šreservedxò å# Must be zero,7 žflag_bits8  !  ! 
8 0vol’	åm  ‘number of�k headeÔÚinternal_attrƒ 3# I   jibutes… /ex> E } C m@_sizã
´  !ofÓ) 
‰  ðB   7# SF /unH w# Otherì Y0set9Çclass ZipFil#U@_off*  q   SByte  !toÀ  £ . ¼ P# CRC0 à              ñ* CRC-32 of the uncompressed file

    def __repr__(self):   áresult = ['<%s5 ±name=%r' % . Ð.__class__.__ @__, G .c   %)]P "if ‰ ö_type != ZIP_STORED} � ©.append(' 9 e=%s' %]  0 
 . !orš Rs.getµ  � ,C 
Q  ß 	C %))D Bhi =æ õexternal_attr >> 16& /lo& …& 0xFFFF) _if hi i4mod—Astat}  7(hiœ _if loM 	µ @=%#xê&loà Tisdir½ wis_dir( bf not % "or	 ¡ __size{ ' `g 	d .((f ‘ j U) andE ¸ù 
z9 or1 ¼  - ’ 
h . f 2±  • Ø 
F y @ &>'÷ ò return ''.join(* )Å¡FileHeaderë Ç, zip64=None¥ B"""RI  @per-b! h9 õ as a bytes object."""� d–date_time  os ð = (dt[0] - 1980) << 9 | dt[1] 5 20dosK   =% 3% "11& 4  3  V v5] // 2P flag_bits @*08hP# Setðse to zero because we write pm after ëU dataá  ÞVCRC =… Ô! =, ßE = 00 ;elsð> @5CRC)  Y 	]	 	/  ³r P   S TextraK   ¹min_version´ "if5@ is 8
HP	ð >¹»64_LIMIT or	 Á e 
]  fm]u'<HHQQ', É Ä ÿ + struct.pack(fmt¾$1,< @calc½ @ F)-4,Ã,Ã 	ke Ù ø 
ç i K
  ë àraise LargeZipÑ ("  ¬ â would requirey ®nÇ"s"« À        # Fiðle is larger than what fits into a 4 byte weger,
  ù# fall back to the ZIP64 extension/ ó file_size = 0xf 	# �compress' pmin_verb " =t •_VERSION
P …if self.T atype =0 u_BZIP2:,  Õ 
U Amax(% Y ', ! ): /elh 
OLZMAg  $ f g Ê wextractû  ¦ — ,ò ( ­ F ocreateE 
' D  ÆÀname, flag_b,=x °_encodeFile" fFlags(: òheader = struct.pack(  3 H , 7ing  ¦ Ô ò ‡reserved« 
ÁM 	1p, dostið Ïdosdate, CRCH C  ï , 4Ó7 @len(,  >0),  Ú )Esreturn L+[  /   +v"ra Odef Ž .)‘6try  _  ' .Š .×“('ascii')^ÿ  except UniE_Errord ^utf-8d ‡ | 0x800ß !def  (° × P# Try“$ šIw field.² 0tra’ )"   un   ®  Wwhile¢Z >= 4è ’tp, ln = ; r('<HH',§F[:4]Õ z—if ln+4 >U 
P  & Àraise BadZip#’("CorruptW à p %04x (|’=%d)" % (� I N Pif tpn0x0001o 0dat0[4:¡ ] B   #‚ ‚ ö! (Sœ‚s and/orfš archivesü  F ‹    ` �EÊ in (0xFFFF_ ',   G  @ = "C ("Ö 0  [| ,Ï@Q', ";[:8Í=    " " =) .8:? $ ä 	8™â ž :   Ï C?Ó 	À   self.compÿress_size, = unpack('<Q', data[:8])
   " " =) ?8:]( ðif self.header_offset == 0xFFFF_ ::  u ¡field = "H?  ? "0 k × ÿexcept struct.errorš ñraise BadZipFile(f"Corrupt zip64 extra ½ /. ®  â  1f"{1 ù
} not found.") from None
õ b =j r[ln+4:]" Á@classmethod3 1defF  _f« Pcls, 
 �name, arc	 =b @, *,þ öict_timestamps=True)	b"""Con%ð an appropriate ZipInfo for  ‘le on ther rsystem.§  ø ‡ ¡ should be, upath toB ¿r directoryO 
Ì 1 isG  Ø ò
 which it will have withi– ñarchive (by default,4 ž Bthis7 ˜ qsame asÌ  ] @, buY  thout a drL ¡letter andj O �leading Þ õseparators removed).* &""3äif isinstance(1È, os.PathLikœ · $   =%  fsp 9 Ì"st! Ostat  €isdir =  ö.S_ISDIR(st.st_modeH m*0 =  `.local
 +   , AdateZ1 = 8 F[0:67!ifû:str‚L< ¦[0] < 1980” ø ! @ = ( 1, 1 00,  ‡ /elj o> 2107j   ð, 12, 31, 23, 59 o X# CreÏ äBstorÅ information$if¢ Ö ¥
‹ ó=•;  0os.P.norm	 ( Qsplit¶(. 7)[1ðTwhile�  x0in = 1sep‚galtsep ˆJ % =9 1Ð+diY4 e+= '/'Ã zd = cls¡ —Eb( Ð.external_att»„Sode &oð) << 16  # Unix + eibutesu ¢ c  \-E = 02  ö   
ƒ |å 10m gMS-DOSÈEflagA JelseØO o | ©@qreturn -   ìpis_dir(›B"""R/ àTrue if this aórchive member is a directory."""
  ðBreturn self.filename[-1] == '/'


# ZIP encryption uses the CRC32 one-byte primitw õ%for scrambling some
# internal keys. We noticed that¢ ± implementao �is faster' €n
# relyW ð on binascii.crc32().

_crctable = None
def _gen a(crc):ý  ¤ Ãj in range(8  ¢if crc & 1+        = D ñ >> 1) ^ 0xEDB88320U  & Nelse8 Q>>= 1$ r4crc\psupport¥÷password-based form of~ð. Even though know0pla^ðxt attacks have been found against it, itPstillÍÁful
# to be 9ð to get data out� psuch a "à.
#
# Usage:
#ò Á zd = _ZipDe&“er(mypwd)  Ÿ ò_bytes = zd(cypher ")
£	?  = Eñkey0 = 305419896Dôkey1 = 591751049 á2 = 878082192
 pglobal þ &if   )o  Ð , Ä = list(map(C,1a256)))N r; }  |›0ch,Uf§"""ComputeMD onZ 5±†8†� [ Ö^ ch) & 0xFF]ˆ pupdate_}( î bnonloc— 0,�1 2Ü  " ƒÉ  0ú   Œ(” +  0~ )‡ F Q 3 Ð* 134775813 +Vº 2 F3  Ý„ k Q>> 24� "2)æ  ÓpÓ6pwdÎø p*  ˜d¬ é
™È! a€‹s objectˆasult =" farray(Pappen re& . Í  © c©  z ª N  =ƒF2 | �  ðc ^= ((k * (k^1))„8a[  + ò c•   ‰ ( � h"s(¯ % (Ð


class LZMA»rressor:} S�__init__(OR  d._comp•° 3  2 0 @prop*ðlzma._encode_filter_ áerties({'id': & pFILTER_› &1}ô 	z ) L½ ( °FORMAT_RAW,ãaters=[£  4  ' ?_deŠ  ƒ  , ¨ s‰ ] Xòstruct.pack('<BBH', 9, 4, len(? 2) +I d F y4,¥jÀ    if self.÷_comp is None:
  óreturn self._init() +  6 . ¥ress(data)< 	8  $ ) *  def flush(a ){ 'ifd š $Y “ 	" à

class LZMADe®  Ò Eor:
¦ _ý ,__©  ¸ 1._d5 ! =A4  C úunconsumed = b'' ¶eof = Falsem O  „ o !, \ )  ~ !+=H €  £ aif lenf &._ª f) <= 4q  +   ÖÆ   ópsize, = struct.unpack('<H',È\ V[2:4]– @ † 
1 + ` Ž 
	Õ ú |= lzma.Û( ùFORMAT_RAW, filters=[L  Ÿ + ä2de_' ³_propertiesJ `ILTER_g -1,B  F  ± #44:4÷ +   xŸA ? ):]� =del‘x Ÿ eresultP B. Ž o »· Á #emp.eofu 2Z 6


]¡_names = {- ¢0: 'store'?1 Shrink ”2: 'reduc" 3 4 5 ¤6: 'implodE ´7: 'tokeniz ¤8: 'deflat 9 #64� 1± 
L 1£ Tbzip2$  ’  >  [  eY 1Z Clz77! 9� 0wav?  4  ppmd',
}

2a_checkµ –Dion(W3ionF7if  æ == ZIP_STOREDKApass/el1 hDEFLAT3 ¶if not zlibH >ñaise RuntimeError([    S"Compµ ñ requires the (missing)Z ‚ module"m� VBZIP2… š 'bz  y r™ 4?bz2˜  —   ˜ 9 Z ™ sÈ ðNotImplementedError("That có"ompression method is not supported")


def _get_c1 4or( t_type,  õlevel=None):
    if + ò == ZIP_DEFLATED& * F Œ  M &  * Äreturn zlib.y 5obj” ? ,  h a, -15)“ C 	T Zž ÿAULT_COMPRESSIONP /elå VBZIP2¼ ' £ â Žbz2.BZ2Cw@ Ï 0 # #„8  x ±ignored for�ALZMAÎ  # Í …    p Melse*  ÈM%de¼O;e_checku5ionâKl U aHSTOR_° †  è 3Â · 5bj(UO ˆ «DÑ J  l•   F ƒudescr =Ïor_names.getU !1if 7 r   ôraise NotImplementedError("Ï O Ê %d (%s)" % e ,Z )ñ  W 
2  i d  )»óclass _SharedFil—Òó_init__(self, file, pos, close, lock, writing” š  0  ._0 ! =7 8 Ppos =J  W  … _   l ! =s  € $ =Š 
  ƒseekable‹ . 
& Dtell"   
   0 ÷offset, whence=0ó Rwith ø  ª 
#if « (9    ÎSValue.ÐCan't reposit3`in the�U� while "ª  C  `"thereÌtan open!ï handle on it.B 	CŠv » ; öbefore trying to read."° �  v(@, 8  Œ(*  % 6pos« „ «Gn=-1fŸÀg():
         ð"raise ValueError("Can't read from the ZIP file wh „there "
E  ÿ"is an open writing handle on it.< 	QClosev ;  before tryP !to¤ 9.")‡ `self._¬ b.seek( :pos' rdata =  .  ñ *(n&  :pos+ Ztell(* preturn W 
� Pdef cÊ ‚ !):  ('ifv Æ is not None#  '  ” 9objy D  ! œ  ' ! =@   �  $ âobj)

# Provid_ Ç à method for un2ðable stream
class _Tell ¢  Ú �__init__Ý G, fpá ™ ufp = fp”  ¦offset = 0$ äeG  >I ný 2fp.' ! T E+= n �nf  ë e _ & š 0 \flush1 * 2fp. ). g  _   B.fp. 3)

NóZipExtFile(io.BufferedIOBase? 0"""  Á-like object¡ £ ûôan archive member.û 2Is × �ed by ZipI .‰"()& 2"""º ò# Max size support5 ³decompressoY ôMAX_N = 1 << 31 - 1C R'5 !ed*âs in 4k blocks{ ôMIN_READ_SIZE = 4096I RChunkŽ Ú@ durî  •à  ‡ ASEEKD � "24B –ðileobj, mode, zipinfo, pwd=q,V  L ­>uobj=Fal” # Ó  àa G   Ppwd =e  	\ " =N Å e Nt_type =½ . a ·@_leffñ 4  ì4 +  +_' ( ˆ = _get_ ,)._Ÿ "Õ aeof = V_  Úbk = b'' 9S pnewline  ÒF ø! =ÿ
Q 8namU ö   ? ³if hasattr(Fs, 'CRC'¢ �   òÇexpected_crc¬5CRCw - srunning, –crc32(b''O;elsf ð  _+ ©fðtry:
            û	if fileobj.seekable():
  õself._orig_compress_start =@ otell(); æize = zipinfo.S ?izeA 	 « *_s=  9 	¬ r_crc = Ì prunning 9 f = Tru˜ úexcept AttributeError3Upass
W q ö decrypter = NonP jif pwdA %ifú flag_bits & 0x8(  § # @ñ are against the–õ type from extended local headers£  H   �check_bytŸ( ñ _raw_time >> 8)‰ )ff= Oelse› ÆCRC otherwis    ƒ  4 _>> 24~ h×Uinit_k�†if h != c ³ �raise Runð Û`("Bad Ó‚word for]U%r" %§ Œbname)
þ[def _“  b  .² „ = _ZipD-(  6pwdZ1# Táprst 12 ®As in÷ñcypher stream is an enz3ionøº¡#  used to2 RngtheH ¨algorithm.m 1m &ar¸!# €ñletely random, while’ �12th contœ aMSB of HCRC,Ž !or "  S ŒÂ depending o¤ ÅåD 0andù Ù íV ´correctness€ Ö.A U '   vread(12…˜ z¥left -= 12J creturno“a W)[11]%q_repr__ïPresuleÁ['<%s.%s' % % ö.__class__.__module__L J µ 9 @qual±E__)]¹ bif not¹ [close�• 0.ap�0(' A ¶=%r mode=%r£   ,H   )> › "if R¯ß!= ZIP_STORED  } ‚ = =!É  f  2 0or_¡ Ss.getS _M MZ /  Ò ÷ &L[q&]',# > c‚''.join(* )W ¶Alineß ð, limit=-1):
        ó"""Read and return a line from the stream.

  óIf limit is specified, at most õbytes will be read.A 6"""N iN E< 0:#  k ò# Shortcut common case - new£ æound in buffera  >  i = self._} " ³find(b'\n', ¹offset) + 1} lif i >“  Y { \ [m P I: i]O  9 ! M = i! r� a   Aio.Bæ �edIOBase.×  + (X ,w)8 ƒdef peek Fn=1)[ó ês84ed ®ñ thout advancing �position.· È   ¡if n > lend e9) -\z  9 Tchunk› Ã 9(n)	 1en(( ?) >K  O  ü } 1 = : # +9  c ý
¡Ÿ0– JelseÉ ~ ó1 -= ˆ $ 2# R×“up to 512nðto reduce allocad` overh‘ö for tight loopsÜù 
Þ ý š +v ] Aable»"if8 jclosedï óraise ValueError("I/O oper¹ "n 7 v file."Õ± JTrueƒ  ], n=-Ÿ
’:n8
!If qargumen�Pomitt�ðNone, or negative, data³ þ ðÃed until EOF ;che® É  "j HF0is ® ­  4buf.É
î
Ìi = b''Î# *= ë’while notJ_eof 	 — +1Îf.MAX_Nü +  2bufÿ  uend = n¦‹ ¤ 0if " <Q­  LÈ± K  Š ‰ % 
!?end$v   =m |  T ³ n( / -• @ � � Ý ­ ¨ ©¥ ¢Ì¯ø"À1(n)
         ðif n < len(data):
  ðself._readbuffer = * ( ­offset = n! Rbuf += N[:n]  Ireak 2 	 Fn -=³  ±return buf
 ðdef _update_crc(Ê P, newÀ ê 1# U% á the CRC using Qgivenð .S  0if J  ._expected] Š is None@ñ# No need to computeX  f õif we don't have a reference values  w Þ  ƒ qrunning‚ ƒ= crc32(á ,¦ # )> z# CheckŒ a're at aend of 6fil‰ ü nof andd 3 != 
ðraise BadZipFile("Badz€-32 for t b %r" %L Vname)Õ �1ÏÉ """Read uppÀn bytes withØ �most one ? ò() system call."""_  jÐ1 or!0Â  šè  O [•:â , e = b''‘ x # > I = 0 ’while notJ_eof“  B  Ù ˜ &f.MAX_Nþ +   !ifÛH    ã ¯	‰     b¯r€ &  IS= n +· Þ Q 0if " � #Ú K  ‘ Ü t?endwv   =m |  T ³ n( ! -c• @ � � H   ¨ ü�+> €%n )  œ, Ì 
 %  >_$ c  ¶8ÿ2 å 87, n„)# ] Ïoressedh,=‘# decryptF$deN  sml#of‹=Å &''Ã¬ AfromMR À  if self._c÷ompress_type == ZIP_DEFLATED:
  ù## Handle unconsumed data.'   Ã = self._deca 6or.7 Y_tail6 °if n > len(A ){  †   $ +Y –read2(n -3 )Q JelseA = < %)
1 #if° ® 	LSTORß 5eofë ; •left <= 0_ /ela p¢n = max(n,� ÖMIN_READ_SIZEí ß 	t X:, n: È ( 3 0or.â %orÊ  m 	 3 ü O and6 2notÔ !

ª C:eofÝ ‘ á	Ã fflush(M 	<  ?E  t ü  "{  #orè "~¼ =K"[:U  D]@ 6 -=ñ   7 {
!@  � e= True9  «update_crcå areturn™ ® Rdef _{ ;  Nj † ì %  8W 2b''V   í' %in_l ÒT ¦  ._fileobj.º ( 	C a ³ U Ë Öaise EOFErrorÏ Ðdecrypter is D ?Nonœ	0 ‹Qclose¶0:try¤ Œ / 
$  ƒ,- 6kfinall[ „super().- Y %}seekabl� Œ 1 d„ rLQValueNò("I/O operation on 7  ¤ &."�QÁ { �� &÷, offset, whence=08›  f ’  Ïä ,  ï ô io.UnsupportedOí ô("underlying streamAN  „curr_posŒGtell»#ifð  àð0: # Seek from sçtart of file
  õnew_pos = offset õelif whence == 1: # Seek from current position7  [ T  ' _ +_ 2_ ?EOFR °self._orig_Ì o_size ^  9se:B óraise ValueError("Ü ùmust be os.SEEK_SET (0), "@  Ø 	 "1 µCUR (1), orE ¥END (2)")
E 4if /> Æ 
° , =, W ?< 0D 01 Rread_ì% =“ -Ò «± Fbuff) 7 +” 22 8if 5 ‰>= 0 and b< len(  T  1 :er)¹ 0# J–”move the ‡ �index if 5newa is in _V ™  ¹s ù  x W 	'  >  E = 0  n3# P Ž Rbefor¾  ,q. Reset® |ZipExtF–­  áƒobj.seek3ù compress_s×)¤ ç Érunning_crc B2   5  W Jleft7   o;  2  ¼ �.   G €�er = b''#  ¨‚Þ $de� oB X_get_ ,% __type&ªeof = Fals   Š	¥ #if�decrypterô{not Nonz¸ 1ini© 2 (hwhile x >Í ƒlen = miBAMAX_µXREAD,@ ï   A ( J_len   s"-=H 8len5Bturnô Dtell¼ Adef   ±Å jclosedÝŠ B B on . ¤&."¢  :"ot} _;abldT ðio.UnsupportedOperaœô("underlying stream®N n  ¹ Ô k-ˆ ò-Í !   !reFb ð


class _ZipWriteó(io.BufferedIOBaseW k!__C_á°, zf, zinfo 3p64*  k ðself._zinfo = ziSnfo
  áself._zip64 =   @file f öcompressor = _get_ t(zinfo. e_type,@ ~  	@ R elevel)A ¸  ™ @_sizž 0 z   qrc = 0
7 ‘@property Pdef _\ @obj(j !):  ¯ preturn  8 ' 2.fpG  9 �writable9 JTrue- * g, datai "ife fclosed� … ðaise ValueError('I/O Â ’ation on 7  Ÿ '8Ñnbytes = len(r Ú Ó  1 S2+= . " c9Qcrc32B ,¨ F_crch ¾ À*orÃ  | $ =; I1[ P  ö ¡ 
Ø+Ê @obj.‘eO Æà á  ¼5¹Ë  ‰@  ¢ :tryæ �super().< (Ï ±# Flush anyü¤ from the ã ðor, and update header Xr  v ¡ l % ?bufofƒ ™  / l:bufÉ 0  =s) Ýè p 	é Jelse`{ R 	 — N ã 8 6CRC)rcv ( J .  Õ ‘   s# Write»d¼ˆ þflag_bits & 0x08î Y  ²   €  ãqs afterA  b	É  ˜ åfmt = '<LLQQ' :ù ` =LL':  Z âôstruct.pack(fmt, _DD_SIGNATUREÛ ?CRC Y % 	
@  z Å)~0zip% �.start_di–]    ¶ Ktellí ô fcif notž$  OA b ž ï > ZIP64_LIMIT6  : rÃcRuntimÅs (   'F… éò unexpectedly exceededv g limitð? À    if self.ÿ_compress_size > ZIP64_LIMIT:
  ÿraise RuntimeError(,  C #'Cf 1ed h òunexpectedly exceeded| � limit')Q ð0# Seek backwards and write file header (which will now include
ˆ  Ñ# correct CRCL F  Ÿ ?s)
~  ñPreserve current position in‚ 4 �self._zipZ Ò.start_dir =    žobj.tell(ñ 
% Rseek( bzinfo.ð _offset> (	? QFileH3 Op64)I 	‡ Ù 7á# Successfully«�ten: Add0é to our caches>è a  (µlist.append° :nfo¯ 
7 ´NameToInfo[  8 N Uname]ˆP€ zfinallyþA ‘ _Oð	ing = False



class ZipY= Q""" C Áwith methods÷ ¡pen, read, e, close, è A zip""s.‰4z =Z (¿ Ä, mode="r", Áõion=ZIP_STORED, allowZip64=True,à 9 £level=NoneÀ b ð: Either the path¶     a, or a¢ ×-like object.c ¡If it is a> ,H  < ™‘be openedyû Dd byå J  ä Q: Theî ’ can be e˜  <C 'r'@P 'w',J@lusi¤˜reate 'x'ù  · CB 'a'e @ion:�@H (no[!), ø	DEFLATED (requires zlib)e ` ŒWBZIP2, @bz2)<  GLZMA Rlzma)“ ºP: if ¾>cÝ  O!s [¶÷ extensions when�” ng0, oÚwÃ"itR Ñ anB!epÕ B ½ this wouldM Pbe neÞ2ary¸ KQ : RÂ (default foLXgivenZQ typeaJ]tegerm     specifyv ˆe  •pw!toa‚ "or’ ÷  pWhen usC  ‚*	�ð ûkeyword has no effÝQ !inÇ ÿs 0 through 9 are acceptedŸ =K 1K .2""",Bfp =|§ 	  Càt here since _ð0_del__ checks it
    _windows_illegal_name_trans_table = None

. ñ<def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True,~  T  : `level=u ñ, *, strict_timestamps@ %):A ñ """Open the ZIP’ Q with– ð read 'r', write 'w', exclusive crea 5x',R õor append 'a'.""" "ifU �not in (X R @'x',/ ™  Ú òraise ValueError("ZipFile requiresQ I  orL "")w I _¸_%Gion( )  —&._o' =|É & údidModify = False  àdebug = 0  # L—ú
 of printing: 0 through 39 ð NameToInfo = {}À b# Find�i `given o
<  Q�list = []: }   aof ZipV °instances f­[rchiv½ ( =— P `MethodÎ ' 
ˆ  �B  
+  þ! =É
 4pwd@Ê "  y`commenä :b''4 _ñ. =0# CÒñ if we were passed an²-like objecó Š Tif isE(sÛ, os.PathLikeÅ     =! afspath1 )· M ;strE £# No, it's™ 	û •  m PÁ 5= 0e !     ; ! =ß 	!  ‰0DicX {'r' : 'rb˜qw': 'w+ x x a$   	I  n  @'r+b3 ?    M L  Ixb'}@  ¥  �  ” [ ]&  wh	FTrueÎv >try   &Áfp = io.openŽ‰ c ˜ .   ‘except OS‚V !ifN A  Ù   µ -  U â  
æ  .   co;u«   ,	!  Ubreak ;els-_{ 61/  A ! 1 %   3ileQsgetattrR' !', VO p ARefCÄp  `lock =Üeading.RLock(D Cseekc š E  ® inš • ==è	³À     self._R÷ealGetContents()
  ù	elif mode in ('w', 'x'):%  0 �# set the. ÿified flag so central directory gets writtenJ  ñeven if no files are added tod }archive< þself._didModify = Tru' >tryÂ  Æ @ Ástart_dir =  {fp.tell 0 ñexcept (AttributeError, OS	 (  6 U Ó = _Tellable( 
~ -    — 0ú ' P_seekS ~ = Falsþ Oelseÿ a# Someuò-like objects can provide � but not o   � g  Ô 1fp.@  á l#k èn== 'a' Í P# See¯ ¬‘ is a zipE¦Rw
 ¶    V ekö7 ofF€and overIæ ? Wd`ŸBadZipFil$è  þì ß, just appendù Ž o0, 2)
(  õ K3 /# O' @ DS+ ©>…¢raise ValuJ0("M|mZPbe 'r€…@, or«"/Ã
¼&fpÇ	oÙ  :Non@ ¶_fpclose(fpb  ç ¥ »Ñdef __enter__ÄóareturnC	. 3xit- �, type, vñ ·, tracebackE ‹ ˆ /t ?reps ñsult = ['<%s.%s' % ˜ ù.__class__.__module__, Ü 
 } 9 Åqualname__)]< !ifä 0.fpþ  Q
†$ _=jPassed!  y  re¾ .C!('C0=%rÄ Š ‰µ 0ile˜ � 
` Àend(' filena÷
me=%r' % self.filename)
  ùresult.append(' mod6   2 _else:@ 
–[closed]'5 c > Òturn ''.join(* !)
b ðdef _RealGetContents(Ê )‚ ó
"""Read in the table of c0 A for @ZIP A."""^  Cfp =p 6try`  & öendrec = _EndRecData(fpà êexcept OSError= ðraise BadZipFile(" Ñ is not a zip˜ "O !if w N 1 4ª.debug > 1R bprint(l ƒ ¢size_cd =  °[_ECD_SIZE] p# bytesõcentral directoryQnoffsetO fOFFSETQ "# * ÀN Í ‹_comment¡ bCOMMENS £# archive , U »  # "concat"ˆÁzero, unless�0was@ñcatenated to another«Ù E „ ÄLOCATION] - G-Ú 5_cd= +if\òGNATURE] == stringEndAÄ *64¶ð# If Zip64 extension5 ôuctures are present, accountmƒ  Ä @-= (® áEndCentDir64 +Á  sLocator¡ @ "ifA_2© pinferreJj +  I ‰„"given, 8 ,. "	 8_cd U ¹#Ž ðstart_dir:  Posit 1of  `(  @ # =�  ¿+Aqfp.seek•.4 6, 0‘ ádata = fp.readd6_cd  ƒ@io.BH0IO(0  •total = 0s bwhile  < :_cdt Š;dirv  ×fralDir_  xsif len(5 A) !=V / 
]  3 Ô0TruP0ed H 	Ù <    � âstruct.unpack( v ,J d®  B ![_’6 ¸ 6D º àBad magic numbâ!or{ Å 	õ è Ï¬ 
r ‡ ˆ¡( Ô ûFILENAME_LENGTH]= alags =£ edir[5] w àif flags & 0x8[00:
  ý# UTF-8 file names extension-  %  $ ! =0   ù.decode('utf-8')4 Oelses åHistorical ZIPL ™ encodingE  ± y 	[cp437y ð# Create ZipInfo instance to | eu œ informatí 4x =; (| 
Û px.extra
üp.read(centdir[_CD_EXTRA_FIELD_LENGTH]? commentA COMMENT= Àheader_offseC | ùLOCAL_HEADER_OFFSET]QA(x.c@_verè%,  `system ß (ct$ ™reserved,O À x.flag_bits9 þcompress_type, t, 1 9CRC+ @size  l_ D) = Õ J1:12Â 3if €¡ b > MAXz®CT_VERSION~àraise NotImpleƒÂedError("zipŠ %.1f" %ï  � (˜ \/ 10)þQvolumó Ðinternal_attr  J5:18ð# Convert date/time Ž æð(year, month, day, hou |in, sec“ Q_raw_C 9= tó  x._  á( (d>>9)+1980, ë5)&0xF, d&0x1F,±t>>11, (t>>7  3F 9 ‹) * 2 )
} _cEp(¶ 
*x. z+ concaÑ Pself.lÚlist.append(x[ $ `NameToB![x1  óZ] = x¥ @# up$Ð total bytes Q fromÊÙral directoryâ 4 2= (	  + ÁCentralDir +@ [„FILENAME	K l
4 � 7 …	5 1if $ždebug > 2lqprint("Ø "",")
;1defp ƒ(I )@ À"""Return a   2 of™ õs in the archive."""™ r7 U[data±@ for"a:  k   Y ]Œ    Œ Tclass!\sh  W£ — « 	� � ;1dir� ,þ Z=None&Pa€ a table&rcontent‹ ðthe zip file."""#
  ðprint("%-46s %19 ð2s" % ("File Name", "Modified8   uSize"),I   p  file= ) ðfor zinfo in self.  Ulist:$  = âdate = "%d-%02  
 :  — K .- ™_time[:6]G 
Ñ Ï d8 (9  | `name, C ,š ’ ]_sizeÑ  š  4 Õ k Àdef testzip(Ñ )É ñ """Read all the±s and check qCRC."""K  _ Qchunk~ ¥ = 2 ** 20 >6try†  V   !# � 1by d õs, to avoid an OverflowError or av  =   ‚# Memory# ò	with very large embeddedæ .> 0  !].open�ž"r") as f¹  |  whqf.read(À $ ): A # CQmCRC-32{ $ y   pass Ðexcept BadZipá} greturn 0
F  ú0getÎú ,   ?  þðinstance of ZipIpgiven '8 ' U " =" u To0 P.get(- Q1if , zis NoneÁ ‚raise Ke³(¶   ñ'There is no itemÂ @d %rŸ µ ¡archive' % )ú  <  }   0seteCword:pwd±Set default‘ ,  ÙuencryptBPif pw¨„d not isM·(pwd, bytesg   ü AType°À("pwd: expecd 3 q, got %â@typeN @).__c)__e > 	@Ë • =›  ;els…)  ¢-‘@property9  ;qcomment7Ë s"""The  Ð text associaÇ V ©1ZIPz	F¤‚ _C €  .setter† ,v � ,if�I …. ‰( �#> 4Tvalid§ q lengthÌ   if (K ú > ZIP_MAX_COMMENT-êimport warning) .	 2('Ay ðis too long; truncatinga"%dž'—  › 
 %™ æ, stacklevel=2ˆ 7 Ï $ =~ +[:× 	ù2 ð
        self._dñ%idModify = True

    def read(self, name, pwd=None):$  ( ñ	"""Return file bytes for2 E."""* Pwith N b.open(R 1"r"W v) as fpX  \ rY !p.Š )š B  L š Tmode=M ¤ @, *,‰ ßce_zip64=Falsº À-like object7   '¡ "'.t  Ž   Á is a string& 2theù   ã 0in  1ZIP å, or a ZipInfoi ^  Á ñ should be 'r' to‚! aI 0 al/y a  'w/ ^ Pwrite@ ; °newly added    warchive‚ 0pwdß   qpasswor- qdecrypt„ Ás (only usedÿ  ’ Ging)G PWhen � qing, if@sizeb �not knownË õadvance but may exceedÊ p2 GiB, ‘  q Í Æ 1use\ PZIP64 õmat, which can handle largeP  ‰ Rs.  I˜ “ � @, it« @bestl € ÆAinst¾ ñ , p zinfo.l _b Eset.ƒ 1if ù Ain {ÂK"w"}	ñaise ValueError('¢) requiresF 0"r"nU"w"')o  if·Q and f sµ R(pwd,±Ð êro 3Typn â"pwd: expected3 ð, got %s" % typeN @).__/__ (ë o== "w"r á  s  �o`suppor{  ht‘"j  á  .JÒ `  ð   q"Attempî Z À$• that wasƒsclosed"‘ ? ð# Make sure we have aá#foUr Fif i… 0,#… 	þU  „ v! =zn $eldj== 'w'Y3 Ÿ•RU  .compress_ë" =Ç 5iono 3 _ \level4  6 Jelse™ `# Get G? á
Ú k \ 0get1 Å ]  	b4_T@_to_½!e(
B4for�û"if8 :ingÉ Lzb"Can'tÚDfromÄÐ ¿l×6re ; ë  "ƒ n ­ gëoon it.8 Cµn ð writing handle óbefore trying to read.")

  ¡# Open for Eing: õself._fileRefCnt += 1 1zef ñ  = _SharedFile(5 õ	fp, zinfo.header_offset,= ~  = ¢_fpclose,  Ólock, lambda: …writing)Q 6try¹  W °# Skip the Â  ‰ 
$ f 4 = Í .!P(sizeÍ H½ e  X sif len(; Z) != / 
c  3 Àraise BadZipW ¸("Truncatedœ "i b ò = struct.unpack(  H Ÿ #, * 
? $if ñ [_FH_SIGNATURE]² VtringD ´ ñBad magic number4[V ö ]fname[¬ ” ÿFILENAME_LENGTH]Á 
´EXTRA_FIELD0 ¶ 
Çl ?   ° #if³þflag_bits & 0x20g õ# Zip 2.7: compressed patched data˜ Z   ÿNotImplementedError("C   (‰ | bit 5)]­ 4­ ÿstrong encryptionž = ˜ 6˜ vñGENERAL_PURPOSE_FLAG_BITS]\/80° QUTF-8 C­ Yq_str =  ë.decode("utf-8GNelseÂ8 D _cp437o 2 #!=)Aorig § d ó÷Ê  '† B ó in directory %r and·  �differ.'F 2% (p	” , )êq# checkÁ Šùlag & handle passwordn 6is_0  ¦/  Ý 8if 4 $®if not pwd  A 0pwd ‰*pw�   ? ƒsRuntimeopT%r is5ed,ð ) "ò  e  p"requir:�or extrac]1" %Ï
Î‡ß FNone’ o `returnf0Ext± (Úc, mode^,9f, Truen Àexcept:
      ózef_file.close()
  araise
 ñ$def _open_to_write(self, zinfo, force_zip64=False):8  H (if � and not @ €._allowZ8 1  5 | Å ValueError(O     "t æ is True, but T Q was � ` when Â ^ing "N �the ZIP 
  #if·  ?ing´ p"Can't - Xe to d ` while  re¿ 
s  á 	 ƒ"anotherM ahandleÐ  on it.Ô  
A Câ p s first C RbeforJ  g 2.")ù D a# Size¹PCRC a/ 0ver× ðten with correct data after processV  ù  Yw7°.compress_s` ;= 0   n    ö flag_bits = 0x06 "if�Y ptype ==ÚZ_LZMA±3# C‚ "edº õincludes an end-of-stream (EOS) marker�  Ë ” |• 2$ 'ifïŠseekableˆ C 8‚D ( ßexternal_attrI 	!  $òo600 << 16  # permissions: ?rw- n 	s›ôcan be larger than un¾0ed % ñ # =*� ú\'  <  (È#orÂ .€* 1.05 >Ä‡64_LIMIT�“[f0fp. ³¦.start_dir×XÔheader_offsetÀ ‡fp.tell(r S acheck(? N   ±didModify =›_  0fp.@e= a.FileH€ (?)p  KN  :  Àreturn _ZipW— I è ›P   Çsextract% ñmember, path=None, pwd
 ÃB"""E7 2 a 3 Q fromOearchiváÀcurrent work±  diHory,ûu Äáfull name. Its€ UPrmatiÜ#s ³ øed as accuratelyP âas possible. `£ P' may¸aV  d ø or a ZipInfo object. You canP @spec½qa diffeÒ Ê  ¾ `5%'.7 &""Å!ifS Ú V
§ 8 Ç = os.getcwdx;els-  fs ( V_*_( ÞÐ, pwd)

    dóef extractall(self, path=None, members 1pwd
 C):
  B"""E@ D all0 ñ from the archive to õ current workingG ð    directory. `‚ ñ' specifies a diffe; (  T ¼ H to.L `¸ ñ' is optional and must be a subset of™ Ølist returnedK pby name  &()e 5"""& %ifø 0is 9  '� 0 = `.O 
C  ô  ¯ @  Õ= os.getcwd()8 Jelsem -  fs ( )j äfor zipinfo in¹ 
D § _\_¿ (5 S, pwdV ²@classmetho:ðdef _sanitize_windows_÷ P(cls,  J :sepOð Replace bad cha›1ers½@remoLÂrailing dotskhparts.•Åtable = cls.„ qillegalŒ q_trans_( Pqif not  
; Å = ':<>|"?*'6  å3  ãqtr.make^ (6 ´, '_' * len )Å ? § " =š y 0arcJ$ =T.w Qlate(‘ e /# >J  ð (x.rstrip('.') 0x*l a.splitV »
a Rjoin,i   bempty œj   š@sep.6 -(xj V if x` �é Ñj¨ ½¹€, targetj ³Õº ©@ZipI‚object 'ö'e¥a physicalÅ ¡   file on> ` k ' \²isinstance(d #, | )�    S0elfû ´4 { ' q# buildˆ pdestinaðÆ  � Ro#mÀward slashesç „platformxÆc separatorsÒ # =;. h ".r¹P('/',­ .$¬ ¬ %if jaltsepò \ 
 T 1os.O 6 _  Z   õ# interpret absoluteÀ as relativeJ drœ•letter orßQ# UNC;  + wdundantQ, "."“ï".." component(¼ 9r (ß E)[1]t €invalid_è _4W = ('Lfcurdirý  pa "V  + G  ~^ Àcname.split(ïos.path.sep)
  ðif x not in invalid_A f_partsC 7if [ ™ == '\\':c ù# filter illegal characters on Windows3 òarcname = self._sanitize_w- _ (& ,ƒ %)
I `target¶ % =# Vjoin( #, E Ó  7 @normJ ; j õ# Create all upper directories if necessary.Ÿ ( Gdirsg 1dirÚ „ ˜ "if[ 3 1andŸ}uexists(T )ƒpos.make; $ +ûif member.is_dir(@  Â %otE is$ ¥ 
n  _ r k& û  ! vreturn E Ž BwithùRopen(š ù, pwd=pwd) as source, \T  0 S a, "wb"1  
¨ ôshutil.copyfileobj(X / ã¯ ðdef _writecheck(¯w, zinfoC@"""C ð for errors before < Ping a%€e to the•…hive."""á "ifX .¬  & œ p º.NameToInfoà êimport warningb .	 €('DuplicÃ Z {: %r' %p é, stacklevel=3™‡ Amode•°in ('w', 'x 'a'û°aise ValueE ("Ñe() requires L D yor 'a'"t  žx *fp÷ r_ C }   €"Attempto{ D ZIPu@ tha5÷s already closed~ _íÑ_compression(ó. __type® »_allowZip64· ü  _z y = None» aif lend€list) >=¾ ú_FILECOUNT_LIMIT\  õ \` Æ"Files countg + )elmp_size >g /64_ ?ize\ ßheader_offset` 0Zip ž 
d %ifJî  %L#0Zip
(!+|   t" wouldo #` exten#s"C (j¾,í j€=î,s 	O"   ‡ 6 ^a"""PutCàbytes from filñename into the archive under    #
  0arc E.""" õ if not self.fp:  3 ùraise ValueError(  " ð"Attempt to write	 5ZIPŠ õ
that was already closed")K "if} _@ ?ingƒ _Can't~ Ñwhile an open# öing handle exists
 Ð %)
˜ ðzinfo = ZipInfo.from_file(  H,æ 	 5  D  ñstrict_timestamps=s_ ƒ 1if † š.is_dir() ùcompress_size = 0� $ 9CRC JelseL 5if I qtype is;Non*  ß V 
1 =A 	† p F [ 6ion’ 4 ¨ _level¨ _N 2 ©  © G 	ª L M »Cwith÷JlockŒè _ �_seekabl…  ' $ 0fp.& ( Pstart.b )   ¶ò header_offset =† àfp.tell()  # SC B of + e bytesÚ  J   â ^_8¾== ZIP_LZMAÖ 3# C®ðed data includes¥ýend-of-stream (EOS) marker}  � Ï úflag_bits |= 0x020 ) _qecheck(:  ( ÿdidModify = TrueP  ¿list.appendT 
`NameToF[{ .=  92] =âá Œ 0fp.e] a.FileH¾(False)Ã Þg ‘’ 'ßÒ"rb") as src,)" Å Q, 'w' Ndestì°shutil.copyï Aobj(G  . ƒ, 1024*8ì1def�AestrÆ,C_or_´,/,Á  Ø 	~=¯,‰” :A"""Wª a ˜ =ð .  The contentsa'«…', whichƒ ñmay be either a 'str' o 3ð' instance; if itL ( Ê  pencodedmÅUTF-8 first.m 'tÀrcname' is eóither a ZipInfo instance or
  Àthe name of  qfile in µarchive."""0 Tif isI Å(data, str):"  Y   0 =  õ.encode("utf-8")( hif notN Àzinfo_or_arc” ,º ^ ( $ = (´  0 = A m  •   date_time= `.local
 ( . v())[:6]´  C e õ.compress_type = self 9ionz 3 _4 \level4  	6 2if 9 à º[-1] == '/'o— ðexternal_attr = 0o40775 << 16   # drwx )-xm C p|= 0x10  ù# MS-DOS directory flagN Oelse£ 5600¡  £ B?rw- U Q " =#ô
4 aš*fp� õraise ValueError(6 æ ð "Attempt to write	 CZIP ú	 that was already closedâ} _@ ?ingƒ _Can't~  wh©qan open# öing handle exists.¶ Õ )ŒÀ!isŒ;Non·fØ- )= = W Î W X > X …  @_sizn1len|)Ù  D# UnB 0ed + ÖBwith¤Z_lockŠ  M(o ú, mode='w') as dest5  v   .ÝeŽ ³ Àdef __del__( ¾q"""Call^"0 ()" methodvAcase ¹user forgot P .9 n    l  ’P  =P, andU Û ‘ 'w', 'x' 1'a'E~ VendinÒyrecords‰ "ifO fpæ9breturn£  +0 "ûÙ Á  z Å  ù Úez 
ä j 	 ""on it. > CA æbabeforeó   :Wzip."e:try21modc(‚@, 'ag"ndTÓ_didModify: #—“ ‹Øí ÃÀ._lock:
      ûif self._seekable:
"  ( 0fp.* ( ¯start_dir)5 $ ö_write_end_record(- zfinallys Bfp =” )fpW O  NNone Ñ_fpclose(fp)
 Ndef €  H )t Ãfor zinfo inx …ilelist:û !# Æ ñ central directoryg ' Bdt =K š.date_tim§ 0dos ð = (dt[0] - 1980) << 9 | dt[1] 5 *2]`  osS   =) 3) "11* 4  7  Z v5] // 2i ¢ šextra = [U #if³ ù
file_size > ZIP64_LIMIT \„ 4   0Ÿ.compress6  _ {    �.append(p.r 
© . 	n 2 M c = 0xf ¼  F + ?els
 d Ã i 0 	 ¥ ï   ‰Úheader_offset�W	@ )	 = Ö 	 
Ö ÷@_dat{.  	0°min_version‘ 	 1if 1 û 1# AN" a°Ò field to the5 )'sL  gM ‘ q_strip_ (  n, (1,);"  £½truct.pack(f  j ò '<HH' + 'Q'*len` /),, H1, 8% ! *l 2) +É — 
Z c 
9¶zVERSION- ]�ptype ==;n_BZIP2a
^ Amax() _b ', ! 
-/elq OLZMAp  ( o 	G-'ctE ® Ÿ ,å) 
¶ 0cre·ŠE 
( 
D  #õ name, flag_bits°_encodeFile# WFlags Ñ a;dir_skC}?DirD @   Ú!ng4 ÀalDir, creatÏe_version,
  õzinfo.create_system, extractH  & �reservedX £flag_bits,= òcompress_type, dostim	 OdateT † UCRC, N ±size, file_ ó @len(1 pname),  ñ S_data k �comment)� 0é Ôinternal_attr (ex ¥ éheader_offset)1 ÿself.fp.write(centdir# 	í G & 

* tpos2 = š Vtell(’ 0# W« õ end-of-zip-archive recordH  Í ¡DirCount =›T gilelis	* qSize = € -€ œstart_dirV OL§ ' õrequires_zip64 = NoneE 3if t ž õ> ZIP_FILECOUNT_LIMIT:/  yQ €"Files cß "+ &el\ ¤ ] /64U òCentral directory 6b 2` , j^ :if ê 
¡# Need to ±@ the;$64
s Cbif notÙp_allowZ�
b  ) àraise LargeZiph(• ) +Y  4   t" wouldÑ © @xtenR&s"Ö > *ýendrec = struct.pack(m  BEndAû064,1 9ing 8 b44, 45 Y0, 0,‡ > ³ õ+ d
É fT× )åñ ?locñ "~LocatorN;str+  ð  Ý?, 1± — 
'  ³Q= min1d�, 0xFFFF5  5 4   3 7 _
9  
; ¬@/-	GÀ              û0, 0, centDirCount 
'  9 ESize8 õOffset, len(self._comment))M  ÿ fp.write(endrec , D C 1if  Åmode == "a":  °  Îfp.truncate(a �flush()
8 Ádef _fpclose¹ V, fp)T bassertu ñ _fileRefCnt > 0@ t  E-= 1 _if noB  ;and Pm d|  \ 2fp.œ ó)


class PyZipFile( ¯ A"""C! ðto create ZIP archives with Python library Ò  s ‹ Çpackages."""t_init__Pile, }õ="r", compression=ZIP_STORED,ü  Â  óallowZip64=True, optimize=-1¿  ( Ñ /._w  | 
x „ y   V   �  _• % =  ¶#py
àpathname, base
 @="",PÇterfunc=NoneÛ  """Add all% ”es from "H y" to th³.}  ¿ 4If * c is a ¯à directory, seëE   ÛŽ | 8 4sub% ñies recursively for§ @*.py@ e enterF  ¥ £modules in¶  z nive.  ª Elain> u ºy, listdir h { ` ….  Else,ü G ”must be aÑE  Î² ¤ P will* 5put¯ G · PAddedÚØ £are always U.pyc.7 ²This method`  „1ile|¼  < Ec ifB –necessaryU  If>(î)ï�given, it Pcallex Ðth every argukL CWhen/ !FaB &or4 O vskipped<    s  †  @s.fs › Î i» � ò=filÎ 
ÝÎZdebug  ~ �label = 'w €' if os. f.isdir‰ p else 'à '•  B   Óprint('%s %r î ! bûŸ Q' % (m j· E YreturÆ , õ” Vsplit” ˆ · 
ò  iS EjoinR 4, "F.py"¼   	e  (O à):
             ð# This is a package directory, add it
*  Íif basename:  )  ä = "%s/%s" % (  , : ): ?elsP  ; : ßif self.debug“ Õprint("Addingì �in", pathW u, "as",Ü ¢ f' 0arc	 " =v �_get_codP(init o[0:-3]N 	¶ 3", z š ÿ jwrite(¥ + pdirlist¾ �orted(os. Ddir()7 °.remove("__ê n__.py". õ	# Add all *.py files andz4subi=iesÒ1for5  J0 in• ¤ Ü�ath = os.À U.joinÊ ,G ¥  «€root, exA �splitext(·  ‚ ; %ifs $is>)£  k 	0  [  z
² *, XN  R ¿# :  8!py4±,•5  ¶filterfunc= ÿ)  # Recursive callR Belif�0= "NB
` O0notá~ Â 4và 8'¯Ñ %r skipped bÔw 1' %E'N �continue % 
¹   Ô
^ /ZH  L  Œ³ ($\¦	– v®
õ?NOT¸	s w®t top leve‚ç 	ß T @from•*EQËsvû õà2Às.path.splitÿ ext(filename)
   ÿif ext == ".py":%  8 ÷if filterfunc and not o(path)@ D ¯self.debug+  / pprint('Á ç %r skipped byw A' % z ¹  J �continue% f"P, arc	 1 = ¨ �_get_cod@á [0:-3],H  m  1basQ ‘ > "if€ ($…"Adding"Â \ Ù jwrite(õ 3 Jelsež!ife [-3:] !0ÿraise RuntimeError(.ñ'Files added with • Ãpy() must en ™'Ÿ  "
» °² ´ xl	` xeeYJdef Q 2 ,Y,¡ }¥"""Return Èä2hivD� for theG !.
j  !G!   a module # 2, rP  4 acorrecÆA  ØC 0arcg < ð, compiling if necessary.  For example, gw B õ/python/lib/string ( b.pyc, ( %).E 5""" DŠ eÛ, optimize=-1~£import py_2 G  !øCö !",ý
†6try« U   p .x ª !doW=True¸ Á 
[ Xexcep½ 2.Py� U as err  5zerr.msgT  ž þJFals  � F {a_py  ==F+*M$ c$ c¹ò pycache_opt0 = ›’lib.util. ¢from_sourcÜ5_py'wation='R 1R '1"Q 2Q '2Q b õ £ f*-1³€# legacy©ñ e: use whateverqµ is presentr Èpif (os.û0.is„fð _pyc) and
       ûos.stat(file_pyc).st_mtime >=   8):
F   °# Use .pyc M .! ´arcname = f u 	+ ðelif (os.path.isM ù(pycache_opt0) and3    ­ 	, Ï ,Pthe _~ 5_/*à ð, but write it to , ­legacy pyc¡ # û !in. ~archive+!Ë Q PH!1H1ú# Hs1H=2H2H·2H/se6ð	Compile py into PEP 3147E3Rif _c7 ¹‘  þif sys.flags.optimize == 0‹  0   } ) ª_ 1_ ”_ 1    ¦  “ ) ' # /elj f E þ< ó# new mode: use given }µation levelC  ƒ  ©@elf.â¥	‘ +ï ã Ã¥ ë©  çBø 2>S  ó�ð        msg = "iô!nvalid value for 'optimize': {!r}".format(self._ ?)
   praise VM šError(msg* ÿif not (os.path.isfile(fname) andX sos.stat' Õ.st_mtime >=  uile_py) -):K } Q_compv 4 $, Ö =å C  õ ­ ` = arc· 0 = Ä 5_pyq sarchive ì csplit(6 E)[1]0 aif bas0 
s 
I ´"%s/%s" % (/ ,† l krreturn 1$ ð 

def _parents(‡,1"""“ G¼ 0 a    with elem. Â separated bï Pposix)  .sep, gene  S all c � of thatP !.
c •>>> list(ˆ b'b/d')Ã B['b'(  V/b/d/* /+  * f,  c /, ] 	bY € " 5sòitertools.islice(_ancestryj³, 1, None)
‰
   U Š5À‹Š‰ ‹?/d'50 “3 › 4 œ !/fi = ×< „Ì ' & ÌU ®" =Žyrstrip(Æ„Qwhile%  —	 9!= * ­ Qyield% ß   g `, tailm '   ð_dedupe = dict.fromkeys
"""D  licate an Yðable in original orderØ Lûdifference(minuend, subtrahendçR%PitemsV 2 ¡'in8 ², retainingr ä ÁO(1) lookup.  �  þ ÷filterfalse(set(— `.__conb Ss__, ˆ  ûclass CompleteDirs(ZipFileÌ #A   · 6 srensures€ñimplied directories´ �are alway`cluded@the Ã ¨Ý 2 @�ricmetho³Ta  _d©  ; s§  =Ë$Qchainö_àE(map,� s F !as^ z = (p +�Áp» l Ê 7 �oÀpe(_differenñce(as_dirs, names))

    def ±list(self):   ) ñ = super(CompleteDE + ." : )5 areturnT As +   - ‘._implied† (: 	… _ =_se† Q  t Ã presolve\ Æ æ Ì 5"""£ aIf the£ ó
 represents a directory, v Athat) = a) a (withO õtrailing slash).2 {  å sSFelf.ó ?0dir$ ! =v e + '/'J ”dir_match Tnot im0andÂ ?  ; Ð _  if+ M 2elsÁ@classmethod@  $ÿmake(cls, source[sGiven a% a (file‘ `or zip )]!an_  kÈappropriate iA sub� Oâif isinstance(š ,A ¨  h * ï   1if KL hZipFilï  0 G 3clsu ‹  ð# Only allow for FastLookup whenO	Õ is read-onlybif 'r'— nPV.mode  n  clO3Ö æ 1.__B…__ = clsb Å & 1


& ® 	òHÌŸ± to ensure ç1cith  rp exist ŸCare «’d rapidlyÚ Y 2 ‘làcontextlib.sup¾ós(AttributeError¬    r’…t  —ê± , ! )t¤ V   .f ÍÂ 1lLl  ‰  ¢ 2.__ Ä ” n
C 
BPathm � k ñA pathlib-compatible interfaceí@zip æ"s.ˆ Consider aï  òthis structure::/  f  
 ââ”œâ”€â”€ a.txR ” b 0 c0  4 Õ   $â” e8 U ò>>> data = io.BytesIO(<  Szf = () X, 'w'  ±.writestr('À A', '¾nt of a- !b/¿ / c/ !d/¸ 1 Àe')
    >>> ð(zf.filename = 'mem/abcde.zip'

    Path accepts the zip4 ð object itself or a   L : ¡>>> root =E B(zf) @FromK Ðre, several pg ò
operations are available.8 ÃDirectory it) ° (includingR  � † — ")::  ‹ aa, b =’ .@ Qdir()ã  
  í (–, 'a.txt'- b- 	3b/'è  0 prÖ 'tyŠ  b. D #'bgðjoin with divide 6 Gator8 ¡c = b / 'c� A  ¼ c
 ¼ "b/. ¾ c  %˜Read texts `.read_ -Ó'content of c½ ™existence:  s7 ATrue§  ± (Æ qmissingÌ )).. RFalse– ÷Coercion to stringe •import os[ ðstr(c).replace(os.sep, posixpath 
ç/(v !AtO ¿@, ``° ``
 ã  áand ``parent``ƒ presolve­ ,`. NoteR Âse attributeå1not: `valid S €will rai, ð ``ValueError`` ifF  ç ‰ 9 ahas noö § , g ¾ ìÚ Ù "  .&  N  > : '† 	N g# 2"""]°__repr = "{<Ð.__class__.__… B__}( 	œ R!r},  cat!r})O Ðdef __init__(Q ,å‘, at=""):   ò  �     ±Construct až  f•�a ZipFileÐR 6  Ça: When‡Ñsource is an Á ˆC !, iAUype (ñ !) í be mutated9a2 �specializ bype. I Ðcaller wishes4 Qretai• = áoriginal type,° 7 ÷should either create v @epar 
É  Gpassè.m [ ƒ.ºð = FastLookup.make(  O* a!"at ÌCopenÈðmode='r', *args, pwd=None, **kw à!Op¤±is entry asÛ Å Ðbinary follow± ª‚semanticJ � !ofÝ`thlib.].™ p)`` by 
 < pargumenÛehroughÿto io.TextIOWrapper()21if 1is_–³ ‰ 5IsA #L@zip_/0 =  5[0]Š bif notc àexists() and z÷ip_mode == 'r':
  õraise FileNotFoundError(self)* �stream =  ¡.root.open& c.at, zd –, pwd=pwd<  if 'b' in … 
~ Ðif args or kw
 
  ¨ ¡ RValueš ’"encoding; öinvalid for binary operation"† K beturn Í Ü Jelsew ‹ [i Ô"] = io.text_~ (& V.get(* )r rn òio.TextIOWrapper( 0, *ð B, **I !)
’ 0@pr¿ !ty �def namei)¦ \ Ápathlib.Path# P.at).1  R¬@file  c % D g 6 `).joinŒ @  „ i  ¾ Pread_9 ö Ô v-Bwith¦¡>'r't 0 asm| 
 m.¶ (’Æ QbytesÇ #p ?b')` ‘_is_child_  , Me ï@osix @.dirÕ( ð at.rstrip("/"))çû
 “S_nexti .atg = ‘__class__) óG, atSis_di)J« 2not†%at‹pat.ends2ª ’ 0is_Mk � Õexists() and ^ „ – (  Ä J  atŒ ! Ö  ._JH_setñOiterÞ  .if| ü FP¯ðCan't listdir a ê ™¡subs = mapÿ .ž,=g Ÿ  > (\@filtREelf.C , S S__strÉpU Æ„ x  ¨  | Œ 	ü___repT ]$ b.formao= ™  q  Âu ‡, *other¢  ¨? = ¢  t0 ){q e FX åqresolve² W )‡ ä__truediv__ = ‘ š‹RparenÌ § +at” Q.G ¸  9_atì ãÏ Ë7'/'5if > 
y Àparent_at +=c '/'
  ñ$return self._next(parent_at)


def main(args=None):< ñimport argparse
 ñ4description = 'A simple command-line interface for zipfile module.'H S 5r =_  .ArgumentPm 'r(i = )> ‚group = F ñ	.add_mutually_exclusive_& ç(required=True? 6 au ó('-l', '--list', metavar='<¿ 1>',{ U °help='Show > „ing of aù 'u eu `extracx n†2l ˜ (™ ÿ '<output_dir>')> ª En    ¯Ïo target dir° 	c° Pcreat¼ ¯ /'+± Pname>A <¨ Cf § Ïfrom sources¤ 	 G_'--teÉ$gTest iÁ“ is validv  £}„_ B)( @ @rgs.†  @ @not \[ >2srcÿ% ]öwith ZipFile(src, 'r') as zf>  B 0badIQ = zfi Bzip(m  3if " 
7 �print("ThŸ@llow±‘enclosed R óis corrupted: {!r}".format(S )h P PDone ï Cing"$el  %  1zf.„ Mdir(y [| s, curdi‹#s.0 ‡ #= Ball(V � :Ž @zip_$, f.pop(0o ¡s# s ô ÍðaddToZip(zf, path,C 	 Ù )   `if os. 0.isW ( %  ) �zf.write  N æ, ZIP_DEFLATED¡  2 ù]  š\ $ifž 
¦ F   | 
n  (  jðnm in sorted(os.P{ Ø   8 .õ   Ï Cjoin
Enm),D 0zipé G, nm# L Ó# else: ignorN  	ðO, 'wõ è  b  ê  ´s7À          zi°ppath = os.
  .basename( ;)
  ‘if not zi8 :   /  U f 6dire f E pin ('',  acurdir  pa )€ -''¡ ÐaddToZip(zf, ä ,Í �)


if __š ò__ == "__main__"j   ñ()
"""zipimport provides sup Bfor  óing Python modules from Zip archives.

This! 0 exD ðs three objects:
-¥ U ñer: a class; its constructor takes aÙ X to al 0.
- I¸ øError: exception raised byk ‚ á. It's a
  sub} G of K ú	, so it can be caught as$ 0too† �_zip_direµ py_cacheÖ  dict, mapp;#Í sÎ Ezip 6 €
  info 4  s,j uÀ (inÀ Q._fileÑIt is usuallyÄ`neededX vuse the9 ŽplicitlykA is
d !by/ sbuiltiní° mechanism "syQP itemÐbat areÍ 0
toŠa"""

#ç4libY ÿ_bootstrap_external+ 1  #ˆ ò_verbose_message
_ ’ _frozen_ 5lib\  Ks � 7 J ù _unpack_uint16, /32 
v ¾ 4imp$ °check_hash_½ed_pycsh $io( Dopen tmarshal Eload3 4sys ¶6 Etime k  �_warning: @For  �()

__allMg ['Zip1E', 'Fper']


�_sep = ‚ ¡  _
alt_,  arators[1:a º
‰ (• RÖpass

# _read©1() «
À‚ = {}

_4€_type =  ð(sys)

END_CENTRAL_DIR_SIZE = 22
STRING_! `ARCHIV ò b'PK\x05\x06'
MAX_COMMENT_LEN = (1 << 16) - 1

Ú Q(BÓ_LoaderBasicsí Î3er(v _F) ->#er
UÉCreate a new% ·instance. 'L `' mustžG a<  ¥ , À ³�specific,` insidh 0zip(  . `†example,sN ‚'/tmp/myŒ@.zip;*r  À.zip/mydirecðtory', if mydirec ÷ is a
    valid  ñnside the archive.
) ð 'ZipImportErrorB `raised[ ', ó	path' doesn't point to ag 1ZipL . Z DThe A ñ' attribute of zipit ñer objects contains¤ 1nam) 1theZ ñzipfile targeted. 2"""Å q# Split; E"subø a" from 4Zipû  Ð ñ, lookup a matchingU ð # entry in sys.+ _­ Ñ_cache, fetchV – o n r· #Eõfound, or else read it+ • Ó ñdef __init__(self,­ !):œ  Úðif not isinstance(£ W, str& * c5 os<    . Ò = os.fsdecodA )% a  ( v  :  0(â§  >@emptš @ = 	Z @alt_ J_sep^   ! =G ˜.replace(. 	 8 )õ “ µprefix = []À  wh*JTruea :try  A ó
st = _bootstrap_external.¦ 1tat`Å  6 ¡except (OS5q, Value „ . ç# On Windows a,  /Uád for too longs @  Ñ# Back up one% Ž element, 0dirD`, base
 ç  >è   z  ifGC ŸF ( É  «a  *'Å >   » Ð    ì„.append(Ø ™+lsö : #pZexist  ðif (st.st_mode & 0o170000) !=   ý0:  # stat.S_ISREGž  L  h 'ã ö  ð & )/VbreakÙ { sñEzip_�½[f-Ê1Key¾
ÛH  ´I ) _j ! =úy Õ$._[  ' F B# a  �ð‘following�1ZIPm V ; í	bjoin(*) f[::-1]]7if G 
' " +# §
¢ñ# Check whether we can satisfy¸ _   pmodule rAd byð# 'fullname', or wóbhether it could be a portion of a namespace
    # package. Return self if we can load it, a string containing theF ñfull path if it'sw fssibles Š `, None+ w‡ ccan't n .V �def find_ �er(self, j  Ä ,o =I !):0  Ð 8"""3 - 1 ->å ,Ñ 1 orŒ %.
C ôSearch for a module specified by 'V ''. P mustpt �  * by qual> „(dotted)X  É a. It r}sR` zipim´%er• °instance it ;4theG ¯was found,§
’ :– H ®!po¬y·.(,“ :  orÀwise. The opl@al 'ñ	' argument is ignored --$K  B erñcompatibility with— protocol°ÐDeprecated si#òPython 3.10. UseE Ã0() I2eadb 5"""ˆ @_warÙ s.	 '("Š.W)Í dx aand slƒ  7Q  a  Æ"removal in ¦ O2; u¦ "nF   õ BionW´ )Æ ±mi = _get_m¾[_info>. Pif miÐ 1notM i @# Thº ÑO  35t  + Ä\&[]RV# NotM¤or regularUA. Setl ådirectory, andh #refore ´-ð# We're only interes: inY R last ‰ on¸%oft‡ …earlier ( às are recordedâ ©v.prefixo0mod¢  ¢	d_is_diD ÷ ªÈ 8 Î Zsírå@sentú1its
–#§ ouâPtrail+ –separatorú  l rçga, [f'{$ pPive}{c_sep}{ã '}'G
= "]
a“# Check wûw¸qsatisfyÖ> ÿ Ú Æ { Ï#É
´ ®Û ¦X Æ¦3  & � - ¦ n äÄ¡Àule specifie÷d by 'fullname'. ã must be the
   * ðy qualified (dotted) module F À. It returns= Å zipimporterI ñinstance itself if+ mG ðwas found, or None! ¥it wasn't.G ñThe optional 'path' argument is ignored -- it'� õre for compatibilityP Awith‰ ± µ protocol.
% ÐDeprecated siÄ ðPython 3.10. Use find_spec() ê 6ead´ 5"""K  _warnings.	 '("+.E  G 6s dx aand slƒ  Í Q ¨ Æ"removal in ¦ O2; u¦ %",› C  õ BionW´ )+ í É¶ ploader(.  , šB)[0]E7def# 7 &, , ptarget=ö%):d Ñ"""Create a M&ASpecË@the m“2¯R‹ Q  G / % a cannoån¤, ×_info = _get_ (¿ #if: 0is k  … Õ  \=°_bootstrap.Ì m_from_Hm ·is_package=Š { Jelsee s# Not a’  Uƒregular I A. See th7õs a directory, and‰ ´ #$ðrefore possibly a ä�ion of aUspacec ý @   ð# We're only interestedª ¢Alast7ª onÑ%of'� bearlieÖ, Âs are recordU  ;v.prefixè ‰ 0modŸÜ  Ü 7 £if _is_dir' H ´ '   3# TV-	Ø < ¢É {� string r@sent 1its1Ã # Ø ouPtrail/ šseparator t  ü a = f'{5�archive}{ c_sep}{ì -}'°  ½ KÏ®(=êßêµ  ‰  FTrueû2  ‡ C.sub  seÅ P_loca-�s.append(Ò = r2T	à X o .  Úâ ß &Ccodeô 5"""%  @ -> 7 } objectÆý!  ± Raise ZipI|BErroÀ    if the móodule couldn't be imported.
  5""" ñcode, ispackage, modpath = _get_mQ _' õ(self, fullname)D preturn $ !

 @def > Cdata7  U 7 :"  ‹ 5"""%  ð -> string with file H .[  9 Rq "th ² associated4 'N õ'. Raise OSError if~  > ] 0was+Ofoun%pif alt_V F_sepÂ  �    Ù 4 =  ˜.replace(6 ,  @ )Ê 7key8 œ !if-  W p.startsJ¡.archive +# P 
‘ 
T O[len9 ]‹ :tryH €toc_entr¢  û ._/es[key]ª ¡except Keya
B r|½(0, '', key;k å	ª %, ƒ )Y## üa%Pmatch._Ÿ p__ for Ý >dÐ1ule° – Ç   m Ñ½ š) ô ž ‚ ˜% Ž „specifie’ B or  AZipI¤Bª  X_if itÊp# Decid þ � Ðrequires work ‘out where&¶ p   0# w:Ñ come from if& õ was actually loaded°  I J4„ô·osourceµ' 	³ ±
#  Æ B´N² z,„\#, )DNoneYÎGdoesKWntainzÓ, but has no «  Z/it×+miÁLinfo;p �if mi is š  £Q(f"ca3%inÏ{q`!r}", `= ñ #›   › 
“  V  4  G òbootstrap_external.§Pjoin(& ö , '__init__.py'{OelseY 0f'{= }3 # £ (‚# we hav’@òî¬•  ®ð
        return ðf_get_data(self.archive, toc_entry).decode()


    # Return a bool signifying whether the module is a package or not.
G sdef is_ ~ Á, fullname):k  ( 7"""' ! 1 -> .•  * — ‡True if … Åspecified byd 	› ” F ûaise ZipImportErrorO öcouldn't be found> 5"""º Qmi = `\_infoé . Pif mi” FNoneÿ  “ r“  P(f"ca„ Rfind a $ {`!r}", J= )j r¿%miÑ“Load and  ; D 7'I 'î  ÀRload_| Ø Â 8"""( G )Â< ÄŠ  	ºƒ   A mus‹5theä  f by qualø„(dotted)* × C. Itò s.iò%edF Ÿ Q, or „s 1it  Ú E Õ ôDeprecated since Python 3.10. Use execI�) insteaV¢sg = ("zipk .
 8er.j)Nd|  á!sl‡ Ffor © dç   "removal in¢ O2; u¢ "U _warnings.	 d(msg, ø BionW 0  SC, is ,™Kpath3 ' [Ÿr = sys.©`s.get(û ßl  [ od \ Î`not ish£ance(mod, €H_typ€ 0mod˜ f ! f   ) Œ [ˆ 0] =Ý ¶ 0.__©@er__Á 6elfÆ6try< T i('
   €# add __<Q__ toÊª ‘ *before*  KU getsŠ  @   #€'utú     W  û  &U j “ 4    ý < ñbootstrap_external.E Q_joinJ w 4 ¹ J   Emod.ã != [ * ]7 ' !if…rhasattrÖç'__builtins__'X 1   \ $  î 3 	-_Ë cfix_up> u –.__dict__Ðß
Ü  ÷(˜  8 % jexceptö8delô ð]« °	VÀ    mod = syós.modules[fullname]
  õexcept KeyError:    Áraise Import ¢(f'Loaded R $ {R õ!r} not found in syw %')V ñ_bootstrap._verbose_message('ii r {} # lg äfrom Zip {}', m , FpathY `return !

n ödef get_resource_reader(selfJ )ñ B"""RE Sthe R7 R6 à for a packageß ²a zip file.p  0DIf '¤ G' is3 pwithin [ 9 #, µ 1the³  C 'y p' objecXr= ƒ �.  Otherw¡G UNone.I 5""" 6tryè  f !if­ C.is_U (¼  .   d W <7Zip#
i 7 ÔìBlib.˜"s   ítg D 2Zip Ãññinvalidate_caches, Ï å \M ¿� data of €archive \.B
;_A As = ]¡_directoryv .M ¤ HF_zip) ¦ [M / A] =  ] m\ I.pop�  , (
• p W = {}R�__repr__D I•bf'<zip»$er­!"{R Ò  }{OR_sep} ñ prefix}">'


# ·  se. òorder defines how we  ƒxK`Zip
# : @ive:- Zfirst3 Þ  __init__,ënP t
# non-! ð.pyc, and .py entries. The c r Ðe swapped by X P() if‹ 0run*roptimiz4Ñe. Also,
# '/#breplacH ( ¡ Mre.
1= ((* 4+ 'Ø  ¿ r', True /),- 
{', Fals- 'G ! H   5  )ÄpGiven a€@ule dß¡ potential3`  úÀ  (%ðout extension).
È_ÉmÄ_ú �Å“{c% +3ð.rpartition('.')[2]¸ ’Does this“  ì…esent a Î?„  is¸{  † P# SeeóG õ"< ð". If so, it's eligible to bg!rt£#�a7@spac j�. We testfbseeingj c 23 anE  ‘nžàpath separatorñ	, exists.
    dirpath =  + A_sep E# If# ðis present in self._files, we have a- bectory_ `return _ 
8 R

# R! òsome information about a module.
def _get_ _, („ Á, fullname):´ i =-   - , ðfor suffix, isbytecode `packag” ò _zip_searchorderg  = z  \ >M \  ! !ifž $ 
ü E  ( '#isw A  PNone
+‘implement"  ’_read_dirs(£ �ive) -> šñ dict (new reference)
#
# Given aï£ to a Zip A q, buildÏ±ct, mappingT  k s
# (local< 6the:  us* ñSEP as a separator)* ±oc entries.‡ `A toc_ 0y i0 atuple: !(__0__,#  p# valueJ @use ¾$ ‚availabl 1all¯ @s,
#;  @# enëdL  À /Rystem 0ing9 0comôsƒ   ¦qkind; 0Š $un  ed; ”data_size<  #  F of )  &   o" sk6  ˆ 6 +de8 0 boffseth "#   h  M ð header from start é B 5tim£ &#u   * D p(in dosè @mat)7 ?dat7 Ð f| 7  2crc¨ k ð   # crc checksumr  � G A
# )	Dáð
ies can be recognized by 2 Ptrail{ m Á ¥   °  S ZA and  _*Sare 0cR¯2try	  ½ àfp = _io.open_M€¿×except OSErro5PraisenaImport �(f"can't L     3: {¨Q!r}",¬= !)
e vwith fp– 	£ § ñ.seek(-END_CENTRAL_DIR_SIZE, 2)H  *   -Q_posi‡ª= fp.tell(( qbuffer   3(^ 3  s 
 \  L   rif len(¢ _) != œ 2 4 „ @€ @[:4]ƒ pSTRING_Š zARCHIVE�  # Bad: EndCùal Dir signature¨0# C20 ifý0re'<0comz ×   À            ð    fp.seek(0, 2)
  °file_size =* Ztell(& ý except OSError:B ñ raise ZipImport& Ð(f"can't read  h ý : {archive!r}",J ˜  Spath=7 
™ ð	max_comment_start = max(k Ó ÿ- MAX_COMMENT_LEN -u úEND_CENTRAL_DIR_SIZE, 0 >trymœ 
<  Þ Bdatau %u•`pos = ¼ à.rfind(STRING_3zARCHIVEë 0if 4 >< 0.;o'not a6'6.cbufferÄ �[pos:pos+¿ ò],rif len(? _) != 4 ä �"corruptæ /ð header_positionhé-É  Ã0) +�
é 7 ã_unpack_uint32û v[12:16]å4 Poffseƒ6 G6:206 3if 9 ¤ <   
I)ñbad central directory ? k?', F… 	Ð ‡ (A ‰ (-=ŸBarc_W  ! ?-3 " 5 7if 8 ˆ[B or c 	Ðe�  � 5%{} 1# S±Cof CÀDÀ% @counQ0 so@�½	ú ¹Nªwhile True63 ƒ!p.ë&46¡  
[:< 4A  $ ­ 2EOF`B'EOF]`where 3ðexpected')
        ð    # Start of file header
  ùif buffer[:4] != b'PK\x01\x02':,  4 Pbreak	  	ð# Bad: Central Dir F€ H€ Blen(„ )� .46v ùraise EOFError('EOF read where not expected')´ óflags = _unpack_uint16p j[8:10]1 compres4 [10:125 Otimee [12:141 ?dat1 K4:161 ;crca $32Æ L16:2Ç Œdata_sizf 6 L20:2—  &6 K4:28œ Oname6 hL28:3¢ Oextr£ 7 L30:3kcommentp O32:3Ü ooffsetJL42:4z5p ì '+ Â (+ ˜ 	‚i}_{ >† ì’ZipImportò³f'bad local@  P ó: {archive!r}', path= 
ÙÜ5 s += arcƒ 
¯ >try”  ö ` = fp.v( 
b ‘except OS´ F ÆÚ b"can'tÏ1Zipª	Ö "Ö 	0if @ ’ > 	 ›  Sð*# On Windows, calling fseek to skip over the fields we doó iuse is~a# slow0 !an P  =  ÑP beca6 a ìflushes stdio'I ƒinternalà s.² Ses ©sue #8745.} ûaû%- n)} ‹ ‹ A‚U	7 áf~& 0x800ï q# UTF-8Û4s<iensionK   T! =' ‹.decode(g?lsed àHistorical ZIPû filename encoding
  Mtry:  $ 7  =  ý.decode('ascii')0  except Uni( D. _Error[ ùlatin1').translate(cp437_table)
t  •  œ úreplace('/', path_sep£   ð	 = _bootstrap_external._ á_join(archive,ó 
A Pt = (* ñ, compress, data_size,g Áoffset, time) je, crcU  œ s[Ë Y] = tá ¡count += 1 º ñ._verbose_message('zipimport: found {}Ã  s in {!r}'¶ Sunt, ã ˆ areturn¼ Ås

# During %ö	, we may need to load thMñs
# package from a ZIPR Q. But- Æ€ð is implemented
#¥ `Python
 	^ \ ð.
#
# Break out of this dependency by us¾  A BAion >o for
#Ž  !.
ž d änñ# ASCII part, 8 rows x 16 chars$ ô-'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'A ô.10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1G ó !"#$%&\'()*+,-./_ ó0123456789:;<=>? ó@ABCDEFGHIJKLMNO óPQRSTUVWXYZ[\\]^_ ó`abcdefghijklmno ópqrstuvwxyz{|}~\x7� h# non-?$16@8?óc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7i õ\xea\xeb\xe8\xef\xee\xec\xc4\xc5' cF À6\xc6\xf4\xf •2\xfb\xf9' õff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192+ õe1\xed\xf3\xfa\xf1\xd1\xaa\xba' `bf\u23Ë�ac\xbd\xb\  ) Tb\xbb) `u2591\ 2 3 0  24 6 6 '567 5  !561 5%  571 !5d c b '107 1V 3 2% 1  00+ 3  5e 5½' a 7  69 !66 7 5 6= 6¥Qu2568% 7 ± 5= 5 5Ö Ã 66n 1% 0V 8 8I 8 9t 8Ü 003bŒpf\u0393  c0 a P3\xb5 %c4@03a6  98  a9 bd 021e c  7 5222/€u2261\xbu 26Ö  265  32“ `321\xf‹4248j  xb 2·b 1â a07f\xbÂa0\xa0'
)

_·ðing_zlib = FalseŒRœ Î  �x` functÛðobject, or NULL if zlib couldn't
# ó<be imported. The function is cached when found, so subsequent calls
# don'tI ð zlib again.
def _get_decompress_b ò():
    global _„ @ing_>  ,if 3  7 ñ # Someone has as ñ
.py[co] in their Zip fileN 6 õlet's avoid a stack overflow.( ò_bootstrap._verbose_message('zip­ :v å UNAVAILABLE')C Praise‚ I]ÖError("can't b data;H ñnot available")
K b = TruÑ 6tryBfromG œ d H �except E 6ion: ì r �gfinallÔ ü SFalse£W¡hreturn$ð
# Given a path to a¾@0 an.³toc_entry, A tthe (unÙ1ed)ÑöÕata(archive, B ý þ o $, C ,A a_size,|  Áoffset, time) †e, crc =Y í&ifF F < 0í–‘'negative6  | 'ôwith _io.open_codeÍ v) as fp[ p# Check:�make sureˆa localÌ q headerYaorrect¯  ý	Í  €fp.seek(À_ù ]Î!OSW„  9 ã fzEread×3: {šQ!r}",ù= l Àbuffer = fp.? 6(30 rif len($ g) != 3n� 1EOF« `('EOF G  T0re õ„expectedu 7 2if U @[:4]X Úb'PK\x03\x04'ò �# Bad: LhaFile Hh] Q N'bad¡	'W AnameŸó = _unpack_uint16v[26:28]/_extra3 G8:303 34 V30 + x &+ R — 23 +=tA ² # Start of‘ �9 „‡@raw_« †  Õ ^�- �' 	3À raise OSErrñ(or("zipimport: can't read data")

    if compress == 0:   #( u is not% %ed! °return raw_R P E# DeQ ‘with zlib4 6try^ d& v= _get_ q_func()5 �except E 6ionB ¡raise ZipIâ 0Errò ç L Å ;… È ¢available"` Å 1 (Ð ð, -15)


# LenientL ae/timeparison ­ ðtion. The precision of the m0 Q
# in parchiveW’lower tha ) p stored. ða .pyc: we
# must allow a differencee ñat most one second.
def _eq_T ‚(t1, t2);P# dos” R onlyp cs even> ¢s, so be lö ‡'€abs(t1 -O Q <= 1 Gi>  í �contents˜  À ñ[co] file, unmarshal2c# and \ @ Àde object. Rá's ß1 it= ðmagic word doesn't#€atch, orÔ M …recordedˆ @metax 5 m4 S csource:« ð_code(self, pathname, full 
   X bñ exc_details = {@ Q'* !':?   ,  N     }R@flagI ð_bootstrap_external._classify_pyc(„ ” ‰ îÒhash_based = Y ¡& 0b1 != 0� 6if % 2 ¼ bcheck_%
; 0<  ) ’if (_imp.2 L  ¢ s, p'never'ûr  6  (6 h ?or K Ã== 'always')zG @ Q_byte: _3pycÀ ÐÆ; 9if > ÿFNone- *  å " =¬  (ß  8 ÇòRAW_MAGIC_NUMBER /  \ × " ã1 l �validate_·  –¨ Ms  + Z r 7els 6 ~ N [™_size = \ú( A_and$ ?_of©; ¦< 
šp# We doïOuse  
Pstamp
`  Ó C# tos•for a mor 8  ³.;   5ƒá_unpack_uint32ªu[8:12]) Ê I) orK  Š   A p12:16])UrÀsize):
       ö_bootstrap._verbose_message(
' 
 ýf'bytecode is stale for {fullname!r}'); Áreturn None
 B ò
= marshal.loads(data[16:]A ðif not isinstance(6 0, _ q_type):M  Ÿ óraise TypeError(f'compiled module {path£  ½  \  a L s object¸ ¬   &

l 0 = s C(_un¶  !._ óŽ__)


# Replace any occurrences of '\r\n?' in the input string with '\n'.
# This converts DOS and Mac line endings to Unix line endings.
def _normalize_line_2 d(sourc5 2 = 	 ".rº !(b¨ s', b'\n# , 
* =1  tGiven aé àbuffer containû cPython† �#, »Q it
#ý W 	¯ì , _s (å,R # ? = Pn Z 7&, [ ð'exec', dont_inherit=True)ó !Co»æôdate/time values foundòZip archive to a% €
# that'‘mpatible " 8M ±stamp storeM £.pyc files�parse_dos/ S(d, t	Ü   0.mk (êð(d >> 9) + 1980,Yñ# bits 9..15: year$  / �5) & 0xF.  / µ5..8: month/ d( 1)  A  / •0..4: day- tŠ "11U , - "11Œ Uhours1 (2 � 3e � Ù8..10: minute2  ¹ r1F) * 2j 2 õ0..7: seconds / 2g B-1,  )íà ÄŒæâ$, |@he
#– ification ˆ $ áPmatch1.pyÔ „ñsize,
# or (0, 0) #ê Ô“availablePget_m] P_and_@ 4_of+BselfÖ6tryQ#³Pp 'c'q õ'o' from *.py[co]aassertP[-1:]÷  ('#'o@ À!=' 6:-1@ �toc_entry`Qelf._É[1 & q# fetchU Ñ  |$mp4+ Œ ¸earison¤ #@Àan embedded 2I *  %= • &[5„  Í ± &[6  unw Rressei	) 3) _¢Aate,=), L ž ±except (Keyãs, Index úÌ sk ð0, 0


# Given añ path to a .pyc file in the archive, retur á
# contents of& €matching@ ? ò%, or None if no source
# is available.
def _get_pyc_$ a(self,“ ð):
    # strip 'c'V ñ'o' from *.py[co]% aassert7 P[-1:]À ¡('c', 'o')# æ =# Q:-1]
 2tryg  k Àtoc_entry = ˆ  ._ s[; h ö except KeyError;   ô X Melse ì Adataæ .]x ‘)


# GetWð
code object associated wi¯÷he module specified by
# 'fullname'am+ _R | $, & f ã " =Ž-   - Ü €import_e! =è ðfor suffix, isbytep   apackagVp_zip_seü GordeC ’  t  ¥# +M \  Ÿð_bootstrap._verbose_message('try‚ {} "',À f ¿ X B_sepø   ", C Rity=2" d 	 ®  *   EpassÉ 
  0mod• 5 = &[0[  #  8¢  ›D .   ‚¤ 'if£©  P ¨_unmarshalTÆ e ' � , ´ hP 5IST~ as exc”  3 {5excU  Y  ´ tcompilej® š 1if 5 !isÞŒ ð# bad magic numberœEnon-Ymtimež  Œ #š a  , mMnext)  d:inuB ³ '	‰ ¿ z,- bh 
' Ò
í ‚msg = f"ø  load failed: {Ž!}"[  ä   —raise ZipÚ`(msg, =)ÌI G 
¦ U Àf"can't findæ Tule {` L!r}"s Á
__all__ = [m ²"ZoneInfo", €reset_tz1 ·_ØTzones dTZPATH M �NotFoundÕ ñInvalidTZPathWarning",
]

Ô". 
 }  t_common b %

´K _£ Linfo6 ð
except ImportErró<or:  # pragma: nocover
    from ._zoneinfo import ZoneInfo

reset_tzpath = 
 . ð 
available_timeL &s +   ÷
InvalidTZPathWarning3  ñ



def __getattr__(name):È 0if  Â == "TZPATH"  å treturn ¼   7 Gelse( ðaise AttributeError(f"module {__c Ð__!r} has no ‰ ,   { U!r}")©  di¥ ¡ „ ôsorted(list(globals()) + [· 3])
…cstructO ó load_tzdata(keyV *  0lib˜qources
à �component‘ákey.split("/")  qpackageÙ â = ".".join(["k .Í V"] + N R[:-1]C 1resr D % 2-1]‡ 7tryfŽ´  Ø.open_binary(› ), f y ‘except (I³­ã, FileNotFound ‘UnicodeEn  Ô= ò# There are three types of ` ðion that can be r$d ¡all amountMP `to "we/ pnot fin- gis key“#2 Á X: If ú ò	 doesn't exist (e.g. if Ÿ  i†~ ñ   installed, or+  á p's an eþ   iÒ ‚e folder7Glike’ ò  Amrica/New_Yorkrá cµ 	¡¶ q Ø 	h Ñ èEurope/Krasnoym ½n K t*orÍ }iUTF-8,p asuch aŽ�s contai|õa surrogate character.; ö	a`(f"No ù -  f{P withóV {keyÆÄCfobjˆ0hea‰�= _TZifH .™a_file(* H2if - P.vers›F== 1[ † •_size = 4½   × â!l" 
ù3# VP !2+Ûð64-bit integer transitq  M sC    q 8 q "q"¼  / 	h ²also starts/a† 1ç P and /u, whichb õ# we need to skip now   P_byteö(  ‚ ? ¸ pcnt * 5Tà x  Á ê  = +— . ? 6? RLocal   record<  ^ < r # Time5pdesignab7 @leap7 1* 8s ¯eap secondo À header.isst÷dcnt  # Standard/wall indicators
  Ó+ header.isut9 UT/loca4 %)
? ÷fobj.seek(skip_bytes, 1" ó# Now we need to read the second| â, which is not  5amei A# as Ufirst ¹ ’ = _TZifHÇ  from_file(Ÿ Œ @typeÜ =q . K ;tim   Ichar:  ô# The data portion starts with Z `transi Rs and‹eˆ$if' :q  ›0 õ_list_utc = struct.unpack((  , Cf">{h }	 _Ü @}",  .q(  ! *k e_size)E 
 w =idxr e B[ )F OelseÇ (&  · l (¦4# Rcttinfoø ò	, (utoff, isdst, abbrindN  Aßz ?utc0  j = zip?**(\Y">lbbâ ð6)) for i in range(b3cntõ  Ï ‹ 
ÿ … 7 = ÷ Á 
 Í  –6 ºõ ! Aevia@.rðy are null-terminated-Pings,_CexedL  RRby po‚ Æ  �¯array but   bunsplij#o� f ð. I suppose this makes morÛ0nseg CØ#usí#µ  	¸ ã 2str»  � ñ
it's inconvenient here...Ñ  ¦_vals = {}  ˜  ö   ¦«€def get_@ V(idx).ƒ# Gets aÜ Ãping at  ³@runn Quntil´ ‘next \x00„  #
 p We can|Ápre-populateK¾ 1by dtV !onJ a becauS)erÿ W€ome zone0at ( @subs» ‘of longera ¬§s, like soì ¤ @ LMTÁ 1AHS !HD " 
   W„ø  !toi P mappÀ ‡should býð {0: "LMT", 4: "p �", 5: "HS 9
 2DT"Ï K!ifz @!inl 6È  % ¢span_end ="  ñ�s.find(b"Ù  ",F œ 1     L Y[idx];   :U „].decode� < Wretur�  1 ]_ W ™ = tuple(h= dx & ¹Z>Áremainder ofa ½� consists Cleap1ðs (currently unused)SÐ
    # the stñrandard/wall and ut/local indicators, which are metadata we don't need.
    # In version 2 files, we need to skip the unnecessary N  to get at  °TZ string:
X ³if header.v] B>= 2    ñ# Each leap second record has size (time_ A+ 4)W  ; Äskip_bytes =e –isutcnt + 9std  k   E* 12L ¦fobj.seek(V U, 1)
" Ac = & pread(1)3ÅShould be \n) öassert c == b"\n", cG %tz³ 5b""5 ªwhile (c :f 3) !F 3 ü G ++=^ dstr =   a Felse? 2tz_$ BNone™ óreturn trans_idx, ðlist_utc, utcoff, isdst, abbr,e ñstr


class _TZifHín Ñ__slots__ = [Š  » "	&", ·
 ¹ »  9cnt ;ype Fchar ]ö ò
def __init__(self, *args)¾  ¬ ±for attr, vVA zip+ .Ü  , 4 ,õwct=TrueA  E 0setD 8 ,O \@=amethod — Ñfrom_file(cls\ 7eamW S# Theãð starts with a 4-€ "magic"¸ !ueX  ‹  if¨ Aeam.Æ4_ ¹"ö  * ðraise ValueError("Invalid -  !: d ³ not found"Ó  @ _æ) =r 1¿6if % å;x00† E 1Ä 
Î l & Dint(U j 5stró '15¥  ºC = (A , 0# S¼8¡defined inâƒorder thñ os( rarrangeÇ ™ `  +ôuct.unpack(">6l"Û�724)‚ •Bcls(—iÀZoneInfoNotFx¡1Key	 'Ñ"""Exception Î”d when a @ v key isÁä."""
import os
 Àsysconfig


�ðreset_tzpath(to=Hu Òglobal TZPATHf(  £!toÄ4if  |  A ~ãif isinstance(+ @, (s‡m)n  c  Þ C Typ«g    #f"G P must° a Ü¶ or tuple, ‹5 @+ f"ÛE{typˆ S)}: {M :!r}6 ½!ifV°all(map(os..`.isabs9  sÈ tb_get_ix_3 à_message(tzpatchs))
  âbase_tzpath = 	 s Qelse:
  + öenv_var = os.environ.get("PYTHONTZPATH", None_ 4if : ais not  W  [ 
ƒ Ó_parse_pythonš (D X 
� F Í  0   �sysconfigÊ _  æ #("Ï q  / !)
B   .Wuple(¿ �)


def Ä 
ý !ifÙ   d ƒreturn (l 3raw$ =J .split(os.¶2sep¦ 'ne+ t› dfilter* †.isabs, T )f ò# If anything has been ? ñed out, we will warn about itvif len(� A) != k ã aimportH BingsU ü ñmsg = _get_invalid_â —_message(O 6  �  H .	 (‘  M   ""IG  G è specified in · Z Ñùment variable. "M i+ msg, _ ÇTZPathWarnin" ]Ò%è ‡)4	@ = (Î A for×  Ì 0  Uð. éÁprefix = "\n!Ï °indented_stá% "+ 	 i.join(… 
Ú t"ðs should be absolute but found the followl�relativeË &s:r(+ – § ^ó find_tzfile(key&±"""Retrieved %�to a TZifÌò e from a key.""l _h at R rW t  fasearch  mÿ› D 6 m  
 27 ,s ¦ 2  ifE*  is? (   Ì  %   ; ô  h�


_TEST_|› F P.norm	 úÃô "_", "_"))[:-1]‡ > 0, _Ü=c Ÿ 	À 2abscöraise ValueError! Õ  f"ZoneInfoQs may/  �s, got: { }® @ }Ð# We only carj ‘ ]�kinds ofS ñalizations that wŸQchang,ê#±0gth: G ðey - e.g. a/../b -> a/b, or / Â. On Windows#u  ¶ 1Salso n ‚0/b š1\b,•  stcƒpreserve™  � qlength.  K_ r ç   ‹& –àpath) != len(psath):
  õraise ValueError(  ! ð*f"ZoneInfo keys must be normalized relative paths, got: { %}"L !)
 àresolved = os.$ .J  	 ( ðjoin(_base, new_ !))? tif not F ².startswith1 × +ÿrefer to subdirectories of TZPATHÜ °
del _TEST_) ó


def available_timezones(£ ö"""Returns a set containing all;  ;  < .DÂ.. caution::  ©ðThis may attemptÈ ðopen a large numberÍ ñfiles, since the best way tog P ðdetermine if a given : 1 on5 ˜ q searchÿ5 isy %itM Ñand check for> ñ"magic string" at Pbegin.; """Aãfrom importlib
 Rurcesavalid_)  =S(t0# S' 'P loaddS  ü Ñtzdata packagí Àit exists: tUQhas a� ð# pre-assembled listQu ðthat only requir: peÎ A one<× 6try–  ÑË .³r_text("š A", "` v") as f:  ¦ O  < in    =>.k"p(H   !if  
X  UP.add(Q C ‘except (I—:á, FileNotFound î O 3pasª Y Qkey(fà 	 9 " + _, "rb - rUò f.read(4) == b"TZifK $ » EÂ  G   ÚÑagma: nocoverð -   U RFalsem xptz_root{Ä ¨ÒO(1  ] scontinuY    ]  Z €, dirnam­ zsk os.walkM 0if :  ö n •  [   �# right/ –ðposix/ are specialu û # €shouldn'ø	M €included�  QQoutpuÿas< Aif "‹ "< ì ±  h  ƒ.remove(9 Œ !   U Õ U !9 8R  �  ¥   s¢ ÄÔÃ ‰,÷Q  Y 7key0 0relá×=Áã ïos.sep != "/":Àð         key = kûey.replace(os.sep, "/")

  Ñif not key or ý in valid_zones:2  A �continueP > ¯key(fpath)C & d ƒ.add(keyŸ ÿif "posixrules" ‘ &# & ð is a special symlink-only time h õ where it exists, itÞ �# should°be included~ –the outpu/ ¾ xremove(´ Ê YreturO±


class InC ðTZPathWarning(Run®  93""" P rais“ bf an iB  d ÿ ý  fi  òn PYTHONTZPATH."""


 à = ()
reset_tz< ô()
import bisect …calendar ¤ollections …functool $re ðweakref
from dateÙ  i  ,�âdelta, tzinfo
2 .+ “_common, ® •

EPOCH =U Â(1970, 1, 1) ORDINAL$ ð.toordinal()

# It>örelatively expensive to construct new¯ ` objecD!an$ðmost
# cases we're looking at BQsame ì `s, likdðteger numbers of hours, etc.
# To@roveÛ0ed m °memory use,i Áll keep a dižðary with references
#Ë  …  Ó 6 ‘ve alreadI ðd so far.
#
# Load¸ Hever?!inÈ Ð2020a version´  X Þeödatabase
# requires 447;ps, whic    approximat O `amount] @spacL òthat ZoneInfo("America/New_York")ô ¡236 transi©  takes up,â Âwe will
# se”‘cache sizì0512' k í ~×  w4‘ways get ; P
# hi0but£õcifically crafted³ 1ð don't leak arbitr°ð  ¨2of á5.
@_Q.lru_q @(max¯ ð=512)
def _load_€\ƒ(seconds=‚ =' ‘\ˆ@ r_strong} _z A = 86	 F = c â.OrderedDict().  G 0 =  Ðref.WeakValue* dionary0 Ð_module__ = "Z "qø ‘_init_subQT__(clö £?ls.£ 6  ž « Ü � 2new… ,G@ T €instance$ • _ @.getùb, None)2 %f 5 !is 
E 5= cS Àcache.setdefðault(key, cls._new_instance G))
   õ._from_cache = True
) ñ# Update the "strong" , $ m  F r[key] =†  @.popŠ $, } )k }if len(N >) >J e_size:ƒ  × 9  n ÷ item(last=Falseo ereturn‰ ˆ Á@classmethod] bdef no×  › f, key)y 4objé oA  š ;obje� s  ! Œ 2obj ‡ 
Ð?clsŒ ‘super()._0 _µ øŠ Pkey =È ¡ ±ile_path = ( ¢find_tzfil?œ  ° $if" 3 «is not Non– > _&Sopen(Z 8 f, "rb"  ?els@ °_common.loa˜ @dataMÔUwith r Fas fª ¸ } ?  % '(f; ƒ); qfobj, /ˆ=û �2 Z 
«Ã 6obj?à    €_repr =  (§ ê ð# Disable pickling forÑÐects created ì Ls| –_reduce__'#le "OXclear\Ì*, only_keysQ t  o orÚ6 inJ 
 +Bweak}  ) J,ÀO +   / È œ\À< k ô (d $ 	` & {‘@property  ’‡key(selfpq  .@‹ - ‘utcoffset3 O, dt7 ñ’rans(dt).9 I /dsC fdstoffC otzname‰ 6 F  ›?utcG ¢"""ConvertÁ ¼@timexUTC to  `local ! 2"""a  ñiõDt is§E(dt,9 ? - ôraise TypeError("Ÿ Å) requires a= — argumentöÄif dt.tzinfoÛ É
¹h DValui ðdt.tzinfo is not£ self")

  ±timestamp = Å._get_local_ E(dt)2 ðnum_trans = len(R . G_utc\ 6if - •>= 1 and V # <r N  < E[0]:h  ¡ 5tti˜ ©tti_before# …fold = 0 eelif (  G † w== 0 or… >… 5-1]> )³ änot isinstanceò ýz_after, _ttinfo)¼ #, ž $2 .cõ  8 Š_fromutc´  ¸ +•, dt.year™   ”ô 
æ � I‡ 	L © G*seD Òidx = bisect. d_right  Ç,_ ² 
>„[utc[1 F  
kprev,  Pnfos[§ –- 2 : idxÊ 9 'U û
ô  6 o Aï(s[) )   	’ i,elX7 _Ó d î, ' õ &0]Ó $ �# Detect�	épshift =;r �.utcoff -  	1 8 ö.total_seconds() >ë- -J‹OAdt +{ i !ifª 
}`returnû€replace(Œ (=1øM4 ’def _find¡ª M¬@if dßL NonòfÓ Êfixed_offset¤  mt 
å	Dõ8 ¢_NO_TTINFO´  S t^Q  -�a lÏ, 8. @[dt./!º'ltŸ	›¨ms < lt”¶ q •e 2o  q0s >N -Ñ/if[
WTZStr®   
† iY0(tsì9	  = G ™
ã ] p4 #k� is the „ñition that occurs ,0 th& tj, so wÐ°# subtract —�1 to get[ pcurrentª5nfo‘  É  k�Ðlt, ts) - 1
   öassert idx >= 0
 ñ  return self._ttinfos[idx]
' ð
def _get_local_timestamp(1 a, dt):(  S K (   ú(dt.toordinal() - EPOCHORDINAL) * 8640” ï+ dt.hour * 36 ¯minute * 6:  esecond† )Ê a_str__½ ¹ #if ö key is not NoneÛ  Ê ß 0f"{ü u._key}"f ?els0 Breprq ˆ   ‰ 5ö_class__.__name__}(key=§ O!r})ª Ú Q ³.from_file(W   _Æ  [ +~_reduceÛ >
&._b £unpickle,  Ckey,�u hcache)Å{  h 4 Êbmport S p»Caise  .Pp ŠingError­@"Caný@ À a ZoneInfo t � created ˜ " a vstream._ª @•Rmetho‹î a(cls, ë  M _å 8, /Ë fh  Š0clsé)~ ç „bcls.noK 3 4 “ pfind_tzá N— ˆ ¹ˆ_tzpath./ 3keyî J Bload$ !g, fobjI ñ# Retrieve all the data as it exists in @zone‹d¬  à ²trans_idx,  ðutc, utcoff, isdst, abbr, tzë± = _common.�  p 
ò ¤ ` Í  k q# Infer� ðDST offsets (need¡or .dst())§)  _ M ƒdstoff =Ì¦ B_to_ (Â Í  Â 	… @Conv»15 aition ‹Ò (UTC) into "øñs since 1970-01-01 ¼1 §J Ö¤  ts  . Ÿ + l£ ƒstruct `@ò` objects for each¯¸ â p,9 •_list = [  ‹ 
¸ Ô bdelta(G{set), _ u  tz'	d D Y  · M %, <  W ;  ¦3zipq ! {J B Q  %._H" =E_utc‡ $ ƒ&  ( ª - ð_list[idx] for iódx in trans_idx]

  ò	# Find the first non-DST- Uition, Pfor iI õrange(len(isdst)):$  W qif not  :[i]  ! ðself._tti_before =  ¹nfo_list[i]P  3 Ubreak JelseW 5if V Jnfos  B  u   2 *[0v d F HNoneQ1SetPð"fallback" time z(  D   Áif tz_str is. F   a‹ j!= b""Ç ° pz_after6bparse_J ( ¯.decode())/ £Q  ti~   Œ
�  º öraise ValueError("Noá  K 0rma9– found.") A «è 	¨ ?[-1ªE × D  À# Determine ™0his—ña "fixed offset"ÂÒ, meaning thaégoutputN !of2utc: Q, dst_°tzname func"Rs doe �depend on; L Ñspecific dateHvpassed.$ 
 ð We make three simplify® bassumpu 7her?#@ `1. If Qc�a ‡, it hass	Hmighð   actually occur (iò possible to construct TZ stringO “ 2   Qy STDF   bu¬	ˆ Beverl š, such asH ÷AAA0BBB,0/0,J365/25)H# 2þ ‹ ¢ ptains m¨„than one€ object,´ s ðrepresent differ
 sz $3.S w ”no unused  ös (in which case a¡#_`otherw¤½-n ¼¥ with extrÑÚs defined may.`appear§±*not* be a T T A@ AViolsA 0theª ƒPwouldS áfairly exotic,ß M  :As sh4  almost cer™!ly>1be %á *./G(theL ponly thÁ‰ ¡affected b  sÙ 0if íA�) > 1 or~ ³isinstance(ªv,¶"& L_ f= Falsª #elGv 
ŽF 2TruE À    else:
    òself._fixed_offset = _ttinfo_list[0] == (  tz_after

A Ñ@staticmethod òdef _utcoff_to_dstoff(trans_idx,  ásets, isdsts)::  P á# Now we must 6 óform our ttis and abbrs into `¨ §` objects,K ¡but there 9 â issue: .dst()b ðreturn a timedelta with7 I ödifference betweenÆ !()” ò the "standard" HW, butH % Cbase  "; F"DST ðre not encoded inŒ g file;J ñwe can infer whaé ¡y are from4 ]Q flagˆ 0 it(no’ Ðsufficient to jxRlook T d last Ù § —, because’ öoccasionally countries will shift both ì ü .R `typecn‡Alen(È %s)l S@s = ™$* . … # Provi†  assign allÚ (0.B _` ?sum` ¦_found = 0• Pfor i��range(1, � £ Ù)Æ Ä bif dstg = T ë %   Vbreakg   Ridx =þ [ :[i]   dsK[idx ð# We're only going ÕÁdaylight sav &imÈ~ f‚>dst­ Šcontinue� £# Skip any!0s t”àhave already b7“e+ m   + 3Í _ != 0{ ª K  e& =¨s\ 
¸ @compa
mK - 1Rir7 ]¥ � � -� 8 
† ] ;  á  4< (Ù;- 1] ç N ½ +½  - A# Ifafollowø “PitionAalso� €  ^fouldn', F   a# findL Ìñby this point, w€{%to€ H   0# s8!itBhopeF U› Tgets 60 laz ;  #ifI#[cÑš  1 ¾  }0 ¸7 CM+= 1ø 7 ’ 5off& JelseS ¾Pwe di“�pa valid 0ue �`a give1dex„“ll end up\ À      # withö0 dstoff = 0 for something where `isdst=1`. This is obviously
   ù&# wrong - one hour will be a much better guess than 0B   ùidx in range(typecnt):'  s cif not¼ ±s[idx] and ­  5  9 î " … = 3600
^ dreturnV  p@static!od* òdef _ts_to_local(trans_idx,  ÷list_utc, utcoffsetsÅ ñ""""Generate number of seconds since 1970 *in the g r time*.–  Ë �ñ	necessary to easily find; ‘ Qition@ s]O 1"""Ó  O S1 _Â 
E †[[], []]‹ Â# Start withw ‘imestamps—õ modify in-placet m €wall = [z R   G0),   € wif len(nJ > 1½ ˆG_0 =–5[0]�  % 1% § jidx[0]0 5if 3 > 0y X ,$ % =  1Œ JelseF g  ¿  ¥ 0±  5_X†[0][0] +s i * 1* 1åŸ @�!1,tA Gidx)âó  ± ˜[/ k[i - 1OÚ 4 u e €= ] x 	FiF. 91][. JH` ò


class _ttinfo �__slots__"JB", "É 
 stzname"ÿžÄ_init__(self…,Ø", 1 ¯ ' .[ ù
 n # =D 
 P # =Y 2ˆ %eq† Wotheru (L  Em Š != 4 š 	(  ì, ™ ,  , ¨ ,  , )¹ Crepr» õ):  # pragma: nocover6 Ç 1f"{ž !__ÒP__.__¥6__}q ð R+ f"(, ö 2},  É  ¬ &})? ô)


_NO_TTINFO =7v(None,   ) ‡ ð _TZStr:
    __slots_s_ = (
  f"std", 8dst Istar )en/ èget_trans_info: 
 ˆ_fromutc" ƒdst_diff !)
† Ædef __init__§ âself, std_abbr
 €offset, H   
  º ¡=None, end
 a !):    V .5  ‡ ! =J @ ! -m  0 2td_ ð = _load_timedelta(�  )1 pelf.std/  tt#Ó  � vutcoff=; Î   ^ ¡0), tzname.  ð f : Q Ò û 1 =  &   enŒ 2endm 3   ¸  ¦ Õ  Õ ï ,  a  1  N/   2 ÷  , z ÷ \ ê  !  ê á ð6# These are assertions because the constructor should only be called
÷   ’# by funcE athat w1 òfail before passingO0 orOV„  ris not uA"No i^ " ¬specified"B  š@ 	   > ? _
m û y_ 3 	 ;  6 £Ú  s(ƒ h, year\ :O Š."  _to_epoch( & ß  = J O.end+ 
breturnQÜ– ò š "tsž g, fold¤ a"""Get5 œ1rma«Babou xcurrentÈv- tti""ÀÜ ˆ î æ {a# Withˆ Q = 0,| ðperiod (denominated in local a0) w6 7theI  smÍ"r B2s a¹  O!of^ pgap and¶ M  8 ;j   à = 1, it runs ÀO ï  \  to L `beginn2&  N .! 
 0 Soé òorder to determinÈðDST boundaries we need( —know bothK Â ì €whether C °is positive½Anega q(rare),0 (itJ Rurns OÐis boils down€  Ñ „ XOR is_\ á #ifà!= �bG>= 0 ƒ ©-ù ï <Œ Felse® / ~+1 2 "if	  <ð< À     isdst =ó start <= ts < end
  Uelse:   õisdst = not (end7 E %)
- Àreturn self.3 2if <  T  2std0 ðdef _get_trans_info_fromutc(A ¶, ts, year)Ž q ,¯ " =P > qitions(- � , # -( õstd.utcoff.total_seconds()1  Ú / ?dst/ 0 $ifF ‘ ¥ 3… g<ð0# For positive DST, the ambiguous period is one dst_diff after + ñ@# ofE ¯; for negaW ebefore#� ú Z .  4“ :> 0:Å _> =Y<  X  ª " +â ,  qX 	` . Z  + -\ / bfold =oª â  å Y Õ , W A)


òpost_epoch_days_d_ãèÞ a"""Getq`numberÌ 1 ò between 1970-01-01 and YEAR 1"""Ò 1y =gA - 1 ± òy * 365 + y // 4 -	 5100 ò00 - EPOCHORDINAL


class _DayOffset© ð
__slots__ = ["d", "julian
 @hour `minute
 ž""]Gq_init__HR, d, @  , > B=2, > B=0, > '=0:"if¿ ¼ 9 )ÇÌ2365¥  ¯  `min_da/     óraise ValueError(f"d must be in [{C  },D ],} g: {d}"/ ç.J}   # =â z   î ! =õ 
 ÿ # =
 5 ÷W Q2_tok\  ; O€O = _Ÿb  , á º æ é ±and d >= 59¤ø calendar.isleapð Q   fd += 1e *M = (­ Å+ d) * 86400/ +S íÚ¬ M0* 6 Cs 'K ÷C¼ ümàw  }   r  
 i üð_DAYS_BEFORE_MONTHç Ê 5-1, 0 3 "59 À    90,
    �    120,
	   7151 8 6212 7243 7 6304 #33 !)
b ñ)def __init__(self, m, w, d, hour=2, minute=0, second=0):=  Ÿ öif not 0 < m <= 12    óraise ValueError("m must be in (0, 12]"�  2 R wR 5Q wQ 5P 0= dQ 6Q dQ Y[0, 6Q  'e.m = m Zw = w Zd = d  V! =]
 g W p
 z# =ƒ½²@classmethoe Î÷ymd2ord(cls, year, month, dayº…return (i  }ð	_post_epoch_days_before_H ( )/ ñ
+ cls._DAYS_BEFORE_MONTH[r ], ( ò	 > 2 and calendar.isleap_ ` 5dayF %ñ# TODO: These are‚‘actually ½ á dates as they% �expressedx¡local time^  9 Þ 2_toý   3‘"""Calcul] 1theg  F 0 ofj ñ occurrence from  E 1"""i  d‘# We knowžñ, we need to convert‹P into¾ f + L 
 ‘ Week 1 iô € first w �in whichC ð`d` (where 0 = Sunœ appears.P @5 re82entX Hlastç $ofW H, soÃ  ã O  /PrangeÆ   Ê q ±  u©Qs_in_" & =* E . ’Clf.m]ñThis equation seems magical¢ öI'll break it downE# 1.n Q says% Mo%v, POSIX <ã (  Ñ @ + 1Ô‚get 1 = O U -> 7‚£#Ç °€is stillÏ  iv/ 8pcause tç @mathñWmod 7‰ c2. GetÑday - desired­/ a: -1 %ƒ 6�we don't„M    ½ °do anything 0adjÆênegative numbe@²3. Add 1 be³ ¾ � s‘ba 1-ba‘6dex
(  
1 = ‰i.d - (P!))¼ 2+ 1 5`# Now 8a 0[ P vers`of `w`À cÈ£Gw-thò Æ 2 %d` › +œ ¨w - 1) * 7Š ) wÁ@onlyó>ÿ Üðif w was 5, and `£w` means
  ð$# "last occurrence of `d`", so now we just check if ×over-shot theM 0end@ Ðthe month and3 õso knock off 1 week.7 "if- ñ _day > days_in_A :&  ±  ' U-= 7
 òordinal = self._ymd2ord(year, &m,e )9 „epoch = A {* 86400  +X Óhour * 3600 +W •inute * 6 esecondC qreturn j ò


def _parse_tz_str( )ê ð# The tz string hascs format$ \ ó# std[offset[dst ó],start[/time],end "]]7   = �Pdst mßñbe 3 or more characters long* & ³not containI `a lead¬ ñcolon, embedded digits, commas, nor a plush ³inus signs;K  û ñspaces between "std" "ë  " are only� display" "ar‹ # ¦ ñactually present inJY~#y b¾m ò
 is ``[+|-]hh[:mm[:ss]]``{%  Å1, *w@_end 2 = ×â.split(",", 1)7 `# fmt: ñr_re = re.compile(  õør"(?P<std>[^<0-9:.+-]+|<[a-zA-Z0-9+\-]+>)" +5 6 õoff>[+-]?\d{1,2}(:\d{ I)?)?9 r  = odst>[^r  9   3r"(= z ()?µ ?  g # dstÏ Q)?$" ô1off ÆMn\Em = Qv.match(§� q ÛBNoneSz òaise ValueError(f"{Å}- T“ valid TZ "R ñstd_abbr = m.group(º¤ =dst Fdst" £ 0 = “ Ê S  .¼Tp("<>x  if'] É o  :  W y :¸ Coff"‘ 6try^   : =Îfdelta( à  1 gexcept]G as | $ r€"Inp0STD/!seÆ–‚") from ö7elsQ … B = 0R-Ñ oÛ !  ;dst ²    sB   5   ( $?DST$Àfrom e
     §   else:
  ôdst_offset = std u+ 3600
, úif not start_end_strJ ð!raise ValueError(f"Missing transition rules: {tzB 6}")c 	\ s� m õ[0].split(",", 1)› :tryŠ I ð, end = (_parse_é   ¾ Ê(x) for x inÔ sX gexceptÒ K as ?õ  øInvalid TZ stringî v from eõ àreturn _TZStr(�Wabbr,‹ , »   
 ® " 1artæ ³ JelifÌ §  T”ø present without DST¹ n
?°# This is ax ùtic ttinfo, don't Ü A  y , (   ñ _load_timedeltað <),   0) d_F �)


def ördststr)pdate, *m   =d4strb"/"T0if ' ¢[0] == "M";  « õn_is_julian = False… ñm = re.match(r"M(\d{1,2})\.(\d) 1$",\ i  R @if mN?Nonf#ds•/ï ­ 2: {è  ] X     Ûö= tuple(map(int, m.groups())Ž wÑ = _CalendarO''(*L / 
4J4 Š 
86Tru7   ]  �uate[1:]S
d  * 
I �/  doy = int(Q §  5 Ö 3DayÑ Wdoy, N “0if ò   _component¡FlistG   ¦(:"On: 0en(0  ¥  l F < 3†  Æ : €.extend(§x* (3 - o Õr.hour, P.minu
 Aseco9e ³½, 
k2tz_µ	 h¥ðr"(?P<sign>[+-])? $h>- (: m 22}) s e)?)?",J s  Jp# Anyth€°passed to t²Afunc�ðshould already have hit an equivùte À# regular ex*sÌâto find the seS 1to p.7  x 2rt !isC ß$, ² W`h, m, S ½pv) if v ~ ; Ä! 0_   ÇvÇ Ïi Îð, ("h", "m", "s"))q
    )
 ð	total = h * 3600 + m * 6	 s# òif not -86400 < 3 !<  :F  Q õraise ValueError(   õ-f"Offset must be strictly between -24h and +24h: {tz_delta}"I ´ ò# Yes, +5 maps to an o_ aof -5h2 öif match.group("sign") != "-"¸ Ï R*= -1ð Ðreturn total
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                