From 143d24691b4d545d993e80705583f5b17b8c90c8 Mon Sep 17 00:00:00 2001 From: Pierre Quentel Date: Mon, 6 Feb 2017 15:27:33 +0100 Subject: [PATCH] Fixes #558 : a set isn't properly cloned by "a = set(b)" statement --- www/src/brython.js | 4 ++-- www/src/brython_dist.js | 6 +++--- www/src/py_VFS.js | 2 +- www/src/py_set.js | 12 ++++++------ www/src/version_info.js | 2 +- www/tests/issues.py | 6 ++++++ 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/www/src/brython.js b/www/src/brython.js index 7b88f8cd3..8f5d1121d 100644 --- a/www/src/brython.js +++ b/www/src/brython.js @@ -61,7 +61,7 @@ $B.regexIdentifier=/^(?:[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C __BRYTHON__.implementation=[3,3,1,'alpha',0] __BRYTHON__.__MAGIC__="3.3.1" __BRYTHON__.version_info=[3,3,0,'alpha',0] -__BRYTHON__.compiled_date="2017-02-05 21:43:42.821780" +__BRYTHON__.compiled_date="2017-02-06 15:25:19.796403" __BRYTHON__.builtin_module_names=["posix","sys","errno","time","_ajax","_base64","_jsre","_multiprocessing","_posixsubprocess","_profile","_svg","_sys","builtins","dis","hashlib","json","long_int","math","modulefinder","random","_abcoll","_codecs","_collections","_csv","_functools","_imp","_io","_random","_socket","_sre","_string","_struct","_sysconfigdata","_testcapi","_thread","_warnings","_weakref"] ;(function($B){var js,$pos,res,$op @@ -9763,7 +9763,7 @@ $SetDict.__format__=function(self,format_string){return $SetDict.__str__(self)} $SetDict.__ge__=function(self,other){if(_b_.isinstance(other,[set,frozenset])){return !$SetDict.__lt__(self,other)}else{return _b_.object.$dict.__ge__(self,other)}} $SetDict.__gt__=function(self,other){if(_b_.isinstance(other,[set,frozenset])){return !$SetDict.__le__(self,other)}else{return _b_.object.$dict.__gt__(self,other)}} $SetDict.__init__=function(self){var $=$B.args('__init__',2,{self:null,iterable:null},['self','iterable'],arguments,{iterable:[]},null,null),self=$.self,iterable=$.iterable -if(_b_.isinstance(iterable,[set,frozenset])){self.$items=iterable.$items +if(_b_.isinstance(iterable,[set,frozenset])){self.$items=iterable.$items.slice() return $N} var it=_b_.iter(iterable),obj={$items:[],$str:true,$num:true} while(1){try{var item=_b_.next(it) diff --git a/www/src/brython_dist.js b/www/src/brython_dist.js index 9f51b470f..d5c46859a 100644 --- a/www/src/brython_dist.js +++ b/www/src/brython_dist.js @@ -61,7 +61,7 @@ $B.regexIdentifier=/^(?:[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C __BRYTHON__.implementation=[3,3,1,'alpha',0] __BRYTHON__.__MAGIC__="3.3.1" __BRYTHON__.version_info=[3,3,0,'alpha',0] -__BRYTHON__.compiled_date="2017-02-05 21:43:42.821780" +__BRYTHON__.compiled_date="2017-02-06 15:25:19.796403" __BRYTHON__.builtin_module_names=["posix","sys","errno","time","_ajax","_base64","_jsre","_multiprocessing","_posixsubprocess","_profile","_svg","_sys","builtins","dis","hashlib","json","long_int","math","modulefinder","random","_abcoll","_codecs","_collections","_csv","_functools","_imp","_io","_random","_socket","_sre","_string","_struct","_sysconfigdata","_testcapi","_thread","_warnings","_weakref"] ;(function($B){var js,$pos,res,$op @@ -9763,7 +9763,7 @@ $SetDict.__format__=function(self,format_string){return $SetDict.__str__(self)} $SetDict.__ge__=function(self,other){if(_b_.isinstance(other,[set,frozenset])){return !$SetDict.__lt__(self,other)}else{return _b_.object.$dict.__ge__(self,other)}} $SetDict.__gt__=function(self,other){if(_b_.isinstance(other,[set,frozenset])){return !$SetDict.__le__(self,other)}else{return _b_.object.$dict.__gt__(self,other)}} $SetDict.__init__=function(self){var $=$B.args('__init__',2,{self:null,iterable:null},['self','iterable'],arguments,{iterable:[]},null,null),self=$.self,iterable=$.iterable -if(_b_.isinstance(iterable,[set,frozenset])){self.$items=iterable.$items +if(_b_.isinstance(iterable,[set,frozenset])){self.$items=iterable.$items.slice() return $N} var it=_b_.iter(iterable),obj={$items:[],$str:true,$num:true} while(1){try{var item=_b_.next(it) @@ -11007,5 +11007,5 @@ throw e;}}} return _sys_modules[_spec_name];} $B.import_hooks=import_hooks})(__BRYTHON__) __BRYTHON__.use_VFS = true; -__BRYTHON__.VFS={"crypto_js.rollups.sha224": [".js", "/*\nCryptoJS v3.1.2\ncode.google.com/p/crypto-js\n(c) 2009-2013 by Jeff Mott. All rights reserved.\ncode.google.com/p/crypto-js/wiki/License\n*/\nvar CryptoJS=CryptoJS||function(g,l){var f={},k=f.lib={},h=function(){},m=k.Base={extend:function(a){h.prototype=this;var c=new h;a&&c.mixIn(a);c.hasOwnProperty(\"init\")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty(\"toString\")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},\nq=k.WordArray=m.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=l?c:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var c=this.words,d=a.words,b=this.sigBytes;a=a.sigBytes;this.clamp();if(b%4)for(var e=0;e>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((b+e)%4);else if(65535>>2]=d[e>>>2];else c.push.apply(c,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<\n32-8*(c%4);a.length=g.ceil(c/4)},clone:function(){var a=m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],d=0;d>>2]>>>24-8*(b%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join(\"\")},parse:function(a){for(var c=a.length,d=[],b=0;b>>3]|=parseInt(a.substr(b,\n2),16)<<24-4*(b%8);return new q.init(d,c/2)}},n=t.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b>>2]>>>24-8*(b%4)&255));return d.join(\"\")},parse:function(a){for(var c=a.length,d=[],b=0;b>>2]|=(a.charCodeAt(b)&255)<<24-8*(b%4);return new q.init(d,c)}},j=t.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(c){throw Error(\"Malformed UTF-8 data\");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},\nw=k.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(a){\"string\"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,d=c.words,b=c.sigBytes,e=this.blockSize,f=b/(4*e),f=a?g.ceil(f):g.max((f|0)-this._minBufferSize,0);a=f*e;b=g.min(4*a,b);if(a){for(var u=0;un;){var j;a:{j=s;for(var w=g.sqrt(j),v=2;v<=w;v++)if(!(j%v)){j=!1;break a}j=!0}j&&(8>n&&(m[n]=t(g.pow(s,0.5))),q[n]=t(g.pow(s,1/3)),n++);s++}var a=[],f=f.SHA256=h.extend({_doReset:function(){this._hash=new k.init(m.slice(0))},_doProcessBlock:function(c,d){for(var b=this._hash.words,e=b[0],f=b[1],g=b[2],k=b[3],h=b[4],l=b[5],m=b[6],n=b[7],p=0;64>p;p++){if(16>p)a[p]=\nc[d+p]|0;else{var j=a[p-15],r=a[p-2];a[p]=((j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3)+a[p-7]+((r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10)+a[p-16]}j=n+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&l^~h&m)+q[p]+a[p];r=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&f^e&g^f&g);n=m;m=l;l=h;h=k+j|0;k=g;g=f;f=e;e=j+r|0}b[0]=b[0]+e|0;b[1]=b[1]+f|0;b[2]=b[2]+g|0;b[3]=b[3]+k|0;b[4]=b[4]+h|0;b[5]=b[5]+l|0;b[6]=b[6]+m|0;b[7]=b[7]+n|0},_doFinalize:function(){var a=this._data,d=a.words,b=8*this._nDataBytes,e=8*a.sigBytes;\nd[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=g.floor(b/4294967296);d[(e+64>>>9<<4)+15]=b;a.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var a=h.clone.call(this);a._hash=this._hash.clone();return a}});l.SHA256=h._createHelper(f);l.HmacSHA256=h._createHmacHelper(f)})(Math);\n(function(){var g=CryptoJS,l=g.lib.WordArray,f=g.algo,k=f.SHA256,f=f.SHA224=k.extend({_doReset:function(){this._hash=new l.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var f=k._doFinalize.call(this);f.sigBytes-=4;return f}});g.SHA224=k._createHelper(f);g.HmacSHA224=k._createHmacHelper(f)})();\n"], "encodings.cp863": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_map)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_map)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='cp863',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \ndecoding_map=codecs.make_identity_dict(range(256))\ndecoding_map.update({\n0x0080:0x00c7,\n0x0081:0x00fc,\n0x0082:0x00e9,\n0x0083:0x00e2,\n0x0084:0x00c2,\n0x0085:0x00e0,\n0x0086:0x00b6,\n0x0087:0x00e7,\n0x0088:0x00ea,\n0x0089:0x00eb,\n0x008a:0x00e8,\n0x008b:0x00ef,\n0x008c:0x00ee,\n0x008d:0x2017,\n0x008e:0x00c0,\n0x008f:0x00a7,\n0x0090:0x00c9,\n0x0091:0x00c8,\n0x0092:0x00ca,\n0x0093:0x00f4,\n0x0094:0x00cb,\n0x0095:0x00cf,\n0x0096:0x00fb,\n0x0097:0x00f9,\n0x0098:0x00a4,\n0x0099:0x00d4,\n0x009a:0x00dc,\n0x009b:0x00a2,\n0x009c:0x00a3,\n0x009d:0x00d9,\n0x009e:0x00db,\n0x009f:0x0192,\n0x00a0:0x00a6,\n0x00a1:0x00b4,\n0x00a2:0x00f3,\n0x00a3:0x00fa,\n0x00a4:0x00a8,\n0x00a5:0x00b8,\n0x00a6:0x00b3,\n0x00a7:0x00af,\n0x00a8:0x00ce,\n0x00a9:0x2310,\n0x00aa:0x00ac,\n0x00ab:0x00bd,\n0x00ac:0x00bc,\n0x00ad:0x00be,\n0x00ae:0x00ab,\n0x00af:0x00bb,\n0x00b0:0x2591,\n0x00b1:0x2592,\n0x00b2:0x2593,\n0x00b3:0x2502,\n0x00b4:0x2524,\n0x00b5:0x2561,\n0x00b6:0x2562,\n0x00b7:0x2556,\n0x00b8:0x2555,\n0x00b9:0x2563,\n0x00ba:0x2551,\n0x00bb:0x2557,\n0x00bc:0x255d,\n0x00bd:0x255c,\n0x00be:0x255b,\n0x00bf:0x2510,\n0x00c0:0x2514,\n0x00c1:0x2534,\n0x00c2:0x252c,\n0x00c3:0x251c,\n0x00c4:0x2500,\n0x00c5:0x253c,\n0x00c6:0x255e,\n0x00c7:0x255f,\n0x00c8:0x255a,\n0x00c9:0x2554,\n0x00ca:0x2569,\n0x00cb:0x2566,\n0x00cc:0x2560,\n0x00cd:0x2550,\n0x00ce:0x256c,\n0x00cf:0x2567,\n0x00d0:0x2568,\n0x00d1:0x2564,\n0x00d2:0x2565,\n0x00d3:0x2559,\n0x00d4:0x2558,\n0x00d5:0x2552,\n0x00d6:0x2553,\n0x00d7:0x256b,\n0x00d8:0x256a,\n0x00d9:0x2518,\n0x00da:0x250c,\n0x00db:0x2588,\n0x00dc:0x2584,\n0x00dd:0x258c,\n0x00de:0x2590,\n0x00df:0x2580,\n0x00e0:0x03b1,\n0x00e1:0x00df,\n0x00e2:0x0393,\n0x00e3:0x03c0,\n0x00e4:0x03a3,\n0x00e5:0x03c3,\n0x00e6:0x00b5,\n0x00e7:0x03c4,\n0x00e8:0x03a6,\n0x00e9:0x0398,\n0x00ea:0x03a9,\n0x00eb:0x03b4,\n0x00ec:0x221e,\n0x00ed:0x03c6,\n0x00ee:0x03b5,\n0x00ef:0x2229,\n0x00f0:0x2261,\n0x00f1:0x00b1,\n0x00f2:0x2265,\n0x00f3:0x2264,\n0x00f4:0x2320,\n0x00f5:0x2321,\n0x00f6:0x00f7,\n0x00f7:0x2248,\n0x00f8:0x00b0,\n0x00f9:0x2219,\n0x00fa:0x00b7,\n0x00fb:0x221a,\n0x00fc:0x207f,\n0x00fd:0x00b2,\n0x00fe:0x25a0,\n0x00ff:0x00a0,\n})\n\n\n\ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\xc7'\n'\\xfc'\n'\\xe9'\n'\\xe2'\n'\\xc2'\n'\\xe0'\n'\\xb6'\n'\\xe7'\n'\\xea'\n'\\xeb'\n'\\xe8'\n'\\xef'\n'\\xee'\n'\\u2017'\n'\\xc0'\n'\\xa7'\n'\\xc9'\n'\\xc8'\n'\\xca'\n'\\xf4'\n'\\xcb'\n'\\xcf'\n'\\xfb'\n'\\xf9'\n'\\xa4'\n'\\xd4'\n'\\xdc'\n'\\xa2'\n'\\xa3'\n'\\xd9'\n'\\xdb'\n'\\u0192'\n'\\xa6'\n'\\xb4'\n'\\xf3'\n'\\xfa'\n'\\xa8'\n'\\xb8'\n'\\xb3'\n'\\xaf'\n'\\xce'\n'\\u2310'\n'\\xac'\n'\\xbd'\n'\\xbc'\n'\\xbe'\n'\\xab'\n'\\xbb'\n'\\u2591'\n'\\u2592'\n'\\u2593'\n'\\u2502'\n'\\u2524'\n'\\u2561'\n'\\u2562'\n'\\u2556'\n'\\u2555'\n'\\u2563'\n'\\u2551'\n'\\u2557'\n'\\u255d'\n'\\u255c'\n'\\u255b'\n'\\u2510'\n'\\u2514'\n'\\u2534'\n'\\u252c'\n'\\u251c'\n'\\u2500'\n'\\u253c'\n'\\u255e'\n'\\u255f'\n'\\u255a'\n'\\u2554'\n'\\u2569'\n'\\u2566'\n'\\u2560'\n'\\u2550'\n'\\u256c'\n'\\u2567'\n'\\u2568'\n'\\u2564'\n'\\u2565'\n'\\u2559'\n'\\u2558'\n'\\u2552'\n'\\u2553'\n'\\u256b'\n'\\u256a'\n'\\u2518'\n'\\u250c'\n'\\u2588'\n'\\u2584'\n'\\u258c'\n'\\u2590'\n'\\u2580'\n'\\u03b1'\n'\\xdf'\n'\\u0393'\n'\\u03c0'\n'\\u03a3'\n'\\u03c3'\n'\\xb5'\n'\\u03c4'\n'\\u03a6'\n'\\u0398'\n'\\u03a9'\n'\\u03b4'\n'\\u221e'\n'\\u03c6'\n'\\u03b5'\n'\\u2229'\n'\\u2261'\n'\\xb1'\n'\\u2265'\n'\\u2264'\n'\\u2320'\n'\\u2321'\n'\\xf7'\n'\\u2248'\n'\\xb0'\n'\\u2219'\n'\\xb7'\n'\\u221a'\n'\\u207f'\n'\\xb2'\n'\\u25a0'\n'\\xa0'\n)\n\n\n\nencoding_map={\n0x0000:0x0000,\n0x0001:0x0001,\n0x0002:0x0002,\n0x0003:0x0003,\n0x0004:0x0004,\n0x0005:0x0005,\n0x0006:0x0006,\n0x0007:0x0007,\n0x0008:0x0008,\n0x0009:0x0009,\n0x000a:0x000a,\n0x000b:0x000b,\n0x000c:0x000c,\n0x000d:0x000d,\n0x000e:0x000e,\n0x000f:0x000f,\n0x0010:0x0010,\n0x0011:0x0011,\n0x0012:0x0012,\n0x0013:0x0013,\n0x0014:0x0014,\n0x0015:0x0015,\n0x0016:0x0016,\n0x0017:0x0017,\n0x0018:0x0018,\n0x0019:0x0019,\n0x001a:0x001a,\n0x001b:0x001b,\n0x001c:0x001c,\n0x001d:0x001d,\n0x001e:0x001e,\n0x001f:0x001f,\n0x0020:0x0020,\n0x0021:0x0021,\n0x0022:0x0022,\n0x0023:0x0023,\n0x0024:0x0024,\n0x0025:0x0025,\n0x0026:0x0026,\n0x0027:0x0027,\n0x0028:0x0028,\n0x0029:0x0029,\n0x002a:0x002a,\n0x002b:0x002b,\n0x002c:0x002c,\n0x002d:0x002d,\n0x002e:0x002e,\n0x002f:0x002f,\n0x0030:0x0030,\n0x0031:0x0031,\n0x0032:0x0032,\n0x0033:0x0033,\n0x0034:0x0034,\n0x0035:0x0035,\n0x0036:0x0036,\n0x0037:0x0037,\n0x0038:0x0038,\n0x0039:0x0039,\n0x003a:0x003a,\n0x003b:0x003b,\n0x003c:0x003c,\n0x003d:0x003d,\n0x003e:0x003e,\n0x003f:0x003f,\n0x0040:0x0040,\n0x0041:0x0041,\n0x0042:0x0042,\n0x0043:0x0043,\n0x0044:0x0044,\n0x0045:0x0045,\n0x0046:0x0046,\n0x0047:0x0047,\n0x0048:0x0048,\n0x0049:0x0049,\n0x004a:0x004a,\n0x004b:0x004b,\n0x004c:0x004c,\n0x004d:0x004d,\n0x004e:0x004e,\n0x004f:0x004f,\n0x0050:0x0050,\n0x0051:0x0051,\n0x0052:0x0052,\n0x0053:0x0053,\n0x0054:0x0054,\n0x0055:0x0055,\n0x0056:0x0056,\n0x0057:0x0057,\n0x0058:0x0058,\n0x0059:0x0059,\n0x005a:0x005a,\n0x005b:0x005b,\n0x005c:0x005c,\n0x005d:0x005d,\n0x005e:0x005e,\n0x005f:0x005f,\n0x0060:0x0060,\n0x0061:0x0061,\n0x0062:0x0062,\n0x0063:0x0063,\n0x0064:0x0064,\n0x0065:0x0065,\n0x0066:0x0066,\n0x0067:0x0067,\n0x0068:0x0068,\n0x0069:0x0069,\n0x006a:0x006a,\n0x006b:0x006b,\n0x006c:0x006c,\n0x006d:0x006d,\n0x006e:0x006e,\n0x006f:0x006f,\n0x0070:0x0070,\n0x0071:0x0071,\n0x0072:0x0072,\n0x0073:0x0073,\n0x0074:0x0074,\n0x0075:0x0075,\n0x0076:0x0076,\n0x0077:0x0077,\n0x0078:0x0078,\n0x0079:0x0079,\n0x007a:0x007a,\n0x007b:0x007b,\n0x007c:0x007c,\n0x007d:0x007d,\n0x007e:0x007e,\n0x007f:0x007f,\n0x00a0:0x00ff,\n0x00a2:0x009b,\n0x00a3:0x009c,\n0x00a4:0x0098,\n0x00a6:0x00a0,\n0x00a7:0x008f,\n0x00a8:0x00a4,\n0x00ab:0x00ae,\n0x00ac:0x00aa,\n0x00af:0x00a7,\n0x00b0:0x00f8,\n0x00b1:0x00f1,\n0x00b2:0x00fd,\n0x00b3:0x00a6,\n0x00b4:0x00a1,\n0x00b5:0x00e6,\n0x00b6:0x0086,\n0x00b7:0x00fa,\n0x00b8:0x00a5,\n0x00bb:0x00af,\n0x00bc:0x00ac,\n0x00bd:0x00ab,\n0x00be:0x00ad,\n0x00c0:0x008e,\n0x00c2:0x0084,\n0x00c7:0x0080,\n0x00c8:0x0091,\n0x00c9:0x0090,\n0x00ca:0x0092,\n0x00cb:0x0094,\n0x00ce:0x00a8,\n0x00cf:0x0095,\n0x00d4:0x0099,\n0x00d9:0x009d,\n0x00db:0x009e,\n0x00dc:0x009a,\n0x00df:0x00e1,\n0x00e0:0x0085,\n0x00e2:0x0083,\n0x00e7:0x0087,\n0x00e8:0x008a,\n0x00e9:0x0082,\n0x00ea:0x0088,\n0x00eb:0x0089,\n0x00ee:0x008c,\n0x00ef:0x008b,\n0x00f3:0x00a2,\n0x00f4:0x0093,\n0x00f7:0x00f6,\n0x00f9:0x0097,\n0x00fa:0x00a3,\n0x00fb:0x0096,\n0x00fc:0x0081,\n0x0192:0x009f,\n0x0393:0x00e2,\n0x0398:0x00e9,\n0x03a3:0x00e4,\n0x03a6:0x00e8,\n0x03a9:0x00ea,\n0x03b1:0x00e0,\n0x03b4:0x00eb,\n0x03b5:0x00ee,\n0x03c0:0x00e3,\n0x03c3:0x00e5,\n0x03c4:0x00e7,\n0x03c6:0x00ed,\n0x2017:0x008d,\n0x207f:0x00fc,\n0x2219:0x00f9,\n0x221a:0x00fb,\n0x221e:0x00ec,\n0x2229:0x00ef,\n0x2248:0x00f7,\n0x2261:0x00f0,\n0x2264:0x00f3,\n0x2265:0x00f2,\n0x2310:0x00a9,\n0x2320:0x00f4,\n0x2321:0x00f5,\n0x2500:0x00c4,\n0x2502:0x00b3,\n0x250c:0x00da,\n0x2510:0x00bf,\n0x2514:0x00c0,\n0x2518:0x00d9,\n0x251c:0x00c3,\n0x2524:0x00b4,\n0x252c:0x00c2,\n0x2534:0x00c1,\n0x253c:0x00c5,\n0x2550:0x00cd,\n0x2551:0x00ba,\n0x2552:0x00d5,\n0x2553:0x00d6,\n0x2554:0x00c9,\n0x2555:0x00b8,\n0x2556:0x00b7,\n0x2557:0x00bb,\n0x2558:0x00d4,\n0x2559:0x00d3,\n0x255a:0x00c8,\n0x255b:0x00be,\n0x255c:0x00bd,\n0x255d:0x00bc,\n0x255e:0x00c6,\n0x255f:0x00c7,\n0x2560:0x00cc,\n0x2561:0x00b5,\n0x2562:0x00b6,\n0x2563:0x00b9,\n0x2564:0x00d1,\n0x2565:0x00d2,\n0x2566:0x00cb,\n0x2567:0x00cf,\n0x2568:0x00d0,\n0x2569:0x00ca,\n0x256a:0x00d8,\n0x256b:0x00d7,\n0x256c:0x00ce,\n0x2580:0x00df,\n0x2584:0x00dc,\n0x2588:0x00db,\n0x258c:0x00dd,\n0x2590:0x00de,\n0x2591:0x00b0,\n0x2592:0x00b1,\n0x2593:0x00b2,\n0x25a0:0x00fe,\n}\n"], "datetime": [".py", "''\n\n\n\n\n\nimport time as _time\nimport math as _math\n\ndef _cmp(x,y):\n return 0 if x ==y else 1 if x >y else -1\n \nMINYEAR=1\nMAXYEAR=9999\n_MAXORDINAL=3652059\n\n\n\n\n\n\n\n\n\n\n_DAYS_IN_MONTH=[None ,31,28,31,30,31,30,31,31,30,31,30,31]\n\n_DAYS_BEFORE_MONTH=[None ]\ndbm=0\nfor dim in _DAYS_IN_MONTH[1:]:\n _DAYS_BEFORE_MONTH.append(dbm)\n dbm +=dim\ndel dbm,dim\n\ndef _is_leap(year):\n ''\n return year %4 ==0 and (year %100 !=0 or year %400 ==0)\n \ndef _days_before_year(year):\n ''\n y=year -1\n return y *365+y //4 -y //100+y //400\n \ndef _days_in_month(year,month):\n ''\n assert 1 <=month <=12,month\n if month ==2 and _is_leap(year):\n return 29\n return _DAYS_IN_MONTH[month]\n \ndef _days_before_month(year,month):\n ''\n assert 1 <=month <=12,'month must be in 1..12'\n return _DAYS_BEFORE_MONTH[month]+(month >2 and _is_leap(year))\n \ndef _ymd2ord(year,month,day):\n ''\n assert 1 <=month <=12,'month must be in 1..12'\n dim=_days_in_month(year,month)\n assert 1 <=day <=dim,('day must be in 1..%d'%dim)\n return (_days_before_year(year)+\n _days_before_month(year,month)+\n day)\n \n_DI400Y=_days_before_year(401)\n_DI100Y=_days_before_year(101)\n_DI4Y=_days_before_year(5)\n\n\n\nassert _DI4Y ==4 *365+1\n\n\n\nassert _DI400Y ==4 *_DI100Y+1\n\n\n\nassert _DI100Y ==25 *_DI4Y -1\n\ndef _ord2ymd(n):\n ''\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n n -=1\n n400,n=divmod(n,_DI400Y)\n year=n400 *400+1\n \n \n \n \n \n \n n100,n=divmod(n,_DI100Y)\n \n \n n4,n=divmod(n,_DI4Y)\n \n \n \n n1,n=divmod(n,365)\n \n year +=n100 *100+n4 *4+n1\n if n1 ==4 or n100 ==4:\n assert n ==0\n return year -1,12,31\n \n \n \n leapyear=n1 ==3 and (n4 !=24 or n100 ==3)\n assert leapyear ==_is_leap(year)\n month=(n+50)>>5\n preceding=_DAYS_BEFORE_MONTH[month]+(month >2 and leapyear)\n if preceding >n:\n month -=1\n preceding -=_DAYS_IN_MONTH[month]+(month ==2 and leapyear)\n n -=preceding\n assert 0 <=n <_days_in_month(year,month)\n \n \n \n return year,month,n+1\n \n \n_MONTHNAMES=[None ,\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\n\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]\n_DAYNAMES=[None ,\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"]\n\n\ndef _build_struct_time(y,m,d,hh,mm,ss,dstflag):\n wday=(_ymd2ord(y,m,d)+6)%7\n dnum=_days_before_month(y,m)+d\n return _time.struct_time((y,m,d,hh,mm,ss,wday,dnum,dstflag))\n \ndef _format_time(hh,mm,ss,us):\n\n result=\"%02d:%02d:%02d\"%(hh,mm,ss)\n if us:\n result +=\".%06d\"%us\n return result\n \n \ndef _wrap_strftime(object,format,timetuple):\n\n freplace=None\n zreplace=None\n Zreplace=None\n \n \n newformat=[]\n push=newformat.append\n i,n=0,len(format)\n while i 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\"%d)\n \n return self\n \n def __repr__(self):\n if self._microseconds:\n return\"%s(%d, %d, %d)\"%('datetime.'+self.__class__.__name__,\n self._days,\n self._seconds,\n self._microseconds)\n if self._seconds:\n return\"%s(%d, %d)\"%('datetime.'+self.__class__.__name__,\n self._days,\n self._seconds)\n return\"%s(%d)\"%('datetime.'+self.__class__.__name__,self._days)\n \n def __str__(self):\n mm,ss=divmod(self._seconds,60)\n hh,mm=divmod(mm,60)\n s=\"%d:%02d:%02d\"%(hh,mm,ss)\n if self._days:\n def plural(n):\n return n,abs(n)!=1 and\"s\"or\"\"\n s=(\"%d day%s, \"%plural(self._days))+s\n if self._microseconds:\n s=s+\".%06d\"%self._microseconds\n return s\n \n def total_seconds(self):\n ''\n return ((self.days *86400+self.seconds)*10 **6+\n self.microseconds)/10 **6\n \n \n @property\n def days(self):\n ''\n return self._days\n \n @property\n def seconds(self):\n ''\n return self._seconds\n \n @property\n def microseconds(self):\n ''\n return self._microseconds\n \n def __add__(self,other):\n if isinstance(other,timedelta):\n \n \n return timedelta(self._days+other._days,\n self._seconds+other._seconds,\n self._microseconds+other._microseconds)\n return NotImplemented\n \n __radd__=__add__\n \n def __sub__(self,other):\n if isinstance(other,timedelta):\n \n \n return timedelta(self._days -other._days,\n self._seconds -other._seconds,\n self._microseconds -other._microseconds)\n return NotImplemented\n \n def __rsub__(self,other):\n if isinstance(other,timedelta):\n return -self+other\n return NotImplemented\n \n def __neg__(self):\n \n \n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n \n def __pos__(self):\n return self\n \n def __abs__(self):\n if self._days <0:\n return -self\n else :\n return self\n \n def __mul__(self,other):\n if isinstance(other,int):\n \n \n return timedelta(self._days *other,\n self._seconds *other,\n self._microseconds *other)\n if isinstance(other,float):\n a,b=other.as_integer_ratio()\n return self *a /b\n return NotImplemented\n \n __rmul__=__mul__\n \n def _to_microseconds(self):\n return ((self._days *(24 *3600)+self._seconds)*1000000+\n self._microseconds)\n \n def __floordiv__(self,other):\n if not isinstance(other,(int,timedelta)):\n return NotImplemented\n usec=self._to_microseconds()\n if isinstance(other,timedelta):\n return usec //other._to_microseconds()\n if isinstance(other,int):\n return timedelta(0,0,usec //other)\n \n def __truediv__(self,other):\n if not isinstance(other,(int,float,timedelta)):\n return NotImplemented\n usec=self._to_microseconds()\n if isinstance(other,timedelta):\n return usec /other._to_microseconds()\n if isinstance(other,int):\n return timedelta(0,0,usec /other)\n if isinstance(other,float):\n a,b=other.as_integer_ratio()\n return timedelta(0,0,b *usec /a)\n \n def __mod__(self,other):\n if isinstance(other,timedelta):\n r=self._to_microseconds()%other._to_microseconds()\n return timedelta(0,0,r)\n return NotImplemented\n \n def __divmod__(self,other):\n if isinstance(other,timedelta):\n q,r=divmod(self._to_microseconds(),\n other._to_microseconds())\n return q,timedelta(0,0,r)\n return NotImplemented\n \n \n \n def __eq__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)==0\n else :\n return False\n \n def __ne__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)!=0\n else :\n return True\n \n def __le__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)<=0\n else :\n _cmperror(self,other)\n \n def __lt__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)<0\n else :\n _cmperror(self,other)\n \n def __ge__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)>=0\n else :\n _cmperror(self,other)\n \n def __gt__(self,other):\n if isinstance(other,timedelta):\n return self._cmp(other)>0\n else :\n _cmperror(self,other)\n \n def _cmp(self,other):\n assert isinstance(other,timedelta)\n return _cmp(self._getstate(),other._getstate())\n \n def __hash__(self):\n return hash(self._getstate())\n \n def __bool__(self):\n return (self._days !=0 or\n self._seconds !=0 or\n self._microseconds !=0)\n \n \n \n def _getstate(self):\n return (self._days,self._seconds,self._microseconds)\n \n def __reduce__(self):\n return (self.__class__,self._getstate())\n \ntimedelta.min=timedelta(-999999999)\ntimedelta.max=timedelta(days=999999999,hours=23,minutes=59,seconds=59,\nmicroseconds=999999)\ntimedelta.resolution=timedelta(microseconds=1)\n\nclass date:\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n __slots__='_year','_month','_day'\n \n def __new__(cls,year,month=None ,day=None ):\n ''\n\n\n\n\n \n if (isinstance(year,bytes)and len(year)==4 and\n 1 <=year[2]<=12 and month is None ):\n \n self=object.__new__(cls)\n self.__setstate(year)\n return self\n _check_date_fields(year,month,day)\n self=object.__new__(cls)\n self._year=year\n self._month=month\n self._day=day\n return self\n \n \n \n @classmethod\n def fromtimestamp(cls,t):\n ''\n y,m,d,hh,mm,ss,weekday,jday,dst=_time.localtime(t)\n return cls(y,m,d)\n \n @classmethod\n def today(cls):\n ''\n t=_time.time()\n return cls.fromtimestamp(t)\n \n @classmethod\n def fromordinal(cls,n):\n ''\n\n\n\n \n y,m,d=_ord2ymd(n)\n return cls(y,m,d)\n \n \n \n def __repr__(self):\n ''\n\n\n\n\n\n\n\n\n \n return\"%s(%d, %d, %d)\"%('datetime.'+self.__class__.__name__,\n self._year,\n self._month,\n self._day)\n \n \n \n \n \n \n def ctime(self):\n ''\n weekday=self.toordinal()%7 or 7\n return\"%s %s %2d 00:00:00 %04d\"%(\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,self._year)\n \n def strftime(self,fmt):\n ''\n return _wrap_strftime(self,fmt,self.timetuple())\n \n def __format__(self,fmt):\n if len(fmt)!=0:\n return self.strftime(fmt)\n return str(self)\n \n def isoformat(self):\n ''\n\n\n\n\n\n\n \n return\"%04d-%02d-%02d\"%(self._year,self._month,self._day)\n \n __str__=isoformat\n \n \n @property\n def year(self):\n ''\n return self._year\n \n @property\n def month(self):\n ''\n return self._month\n \n @property\n def day(self):\n ''\n return self._day\n \n \n \n def timetuple(self):\n ''\n return _build_struct_time(self._year,self._month,self._day,\n 0,0,0,-1)\n \n def toordinal(self):\n ''\n\n\n\n \n return _ymd2ord(self._year,self._month,self._day)\n \n def replace(self,year=None ,month=None ,day=None ):\n ''\n if year is None :\n year=self._year\n if month is None :\n month=self._month\n if day is None :\n day=self._day\n _check_date_fields(year,month,day)\n return date(year,month,day)\n \n \n \n def __eq__(self,other):\n if isinstance(other,date):\n return self._cmp(other)==0\n return NotImplemented\n \n def __ne__(self,other):\n if isinstance(other,date):\n return self._cmp(other)!=0\n return NotImplemented\n \n def __le__(self,other):\n if isinstance(other,date):\n return self._cmp(other)<=0\n return NotImplemented\n \n def __lt__(self,other):\n if isinstance(other,date):\n return self._cmp(other)<0\n return NotImplemented\n \n def __ge__(self,other):\n if isinstance(other,date):\n return self._cmp(other)>=0\n return NotImplemented\n \n def __gt__(self,other):\n if isinstance(other,date):\n return self._cmp(other)>0\n return NotImplemented\n \n def _cmp(self,other):\n assert isinstance(other,date)\n y,m,d=self._year,self._month,self._day\n y2,m2,d2=other._year,other._month,other._day\n return _cmp((y,m,d),(y2,m2,d2))\n \n def __hash__(self):\n ''\n return hash(self._getstate())\n \n \n \n def __add__(self,other):\n ''\n if isinstance(other,timedelta):\n o=self.toordinal()+other.days\n if 0 =52:\n if today >=_isoweek1monday(year+1):\n year +=1\n week=0\n return year,week+1,day+1\n \n \n \n def _getstate(self):\n yhi,ylo=divmod(self._year,256)\n return bytes([yhi,ylo,self._month,self._day]),\n \n def __setstate(self,string):\n if len(string)!=4 or not (1 <=string[2]<=12):\n raise TypeError(\"not enough arguments\")\n yhi,ylo,self._month,self._day=string\n self._year=yhi *256+ylo\n \n def __reduce__(self):\n return (self.__class__,self._getstate())\n \n_date_class=date\n\ndate.min=date(1,1,1)\ndate.max=date(9999,12,31)\ndate.resolution=timedelta(days=1)\n\nclass tzinfo:\n ''\n\n\n \n __slots__=()\n def tzname(self,dt):\n ''\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n \n def utcoffset(self,dt):\n ''\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n \n def dst(self,dt):\n ''\n\n\n\n \n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n \n def fromutc(self,dt):\n ''\n \n if not isinstance(dt,datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n \n dtoff=dt.utcoffset()\n if dtoff is None :\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n \n \n \n dtdst=dt.dst()\n if dtdst is None :\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta=dtoff -dtdst\n if delta:\n dt +=delta\n dtdst=dt.dst()\n if dtdst is None :\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt+dtdst\n \n \n \n def __reduce__(self):\n getinitargs=getattr(self,\"__getinitargs__\",None )\n if getinitargs:\n args=getinitargs()\n else :\n args=()\n getstate=getattr(self,\"__getstate__\",None )\n if getstate:\n state=getstate()\n else :\n state=getattr(self,\"__dict__\",None )or None\n if state is None :\n return (self.__class__,args)\n else :\n return (self.__class__,args,state)\n \n_tzinfo_class=tzinfo\n\nclass time:\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n def __new__(cls,hour=0,minute=0,second=0,microsecond=0,tzinfo=None ):\n ''\n\n\n\n\n\n\n \n self=object.__new__(cls)\n if isinstance(hour,bytes)and len(hour)==6:\n \n self.__setstate(hour,minute or None )\n return self\n _check_tzinfo_arg(tzinfo)\n _check_time_fields(hour,minute,second,microsecond)\n self._hour=hour\n self._minute=minute\n self._second=second\n self._microsecond=microsecond\n self._tzinfo=tzinfo\n return self\n \n \n @property\n def hour(self):\n ''\n return self._hour\n \n @property\n def minute(self):\n ''\n return self._minute\n \n @property\n def second(self):\n ''\n return self._second\n \n @property\n def microsecond(self):\n ''\n return self._microsecond\n \n @property\n def tzinfo(self):\n ''\n return self._tzinfo\n \n \n \n \n \n def __eq__(self,other):\n if isinstance(other,time):\n return self._cmp(other,allow_mixed=True )==0\n else :\n return False\n \n def __ne__(self,other):\n if isinstance(other,time):\n return self._cmp(other,allow_mixed=True )!=0\n else :\n return True\n \n def __le__(self,other):\n if isinstance(other,time):\n return self._cmp(other)<=0\n else :\n _cmperror(self,other)\n \n def __lt__(self,other):\n if isinstance(other,time):\n return self._cmp(other)<0\n else :\n _cmperror(self,other)\n \n def __ge__(self,other):\n if isinstance(other,time):\n return self._cmp(other)>=0\n else :\n _cmperror(self,other)\n \n def __gt__(self,other):\n if isinstance(other,time):\n return self._cmp(other)>0\n else :\n _cmperror(self,other)\n \n def _cmp(self,other,allow_mixed=False ):\n assert isinstance(other,time)\n mytz=self._tzinfo\n ottz=other._tzinfo\n myoff=otoff=None\n \n if mytz is ottz:\n base_compare=True\n else :\n myoff=self.utcoffset()\n otoff=other.utcoffset()\n base_compare=myoff ==otoff\n \n if base_compare:\n return _cmp((self._hour,self._minute,self._second,\n self._microsecond),\n (other._hour,other._minute,other._second,\n other._microsecond))\n if myoff is None or otoff is None :\n if allow_mixed:\n return 2\n else :\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm=self._hour *60+self._minute -myoff //timedelta(minutes=1)\n othhmm=other._hour *60+other._minute -otoff //timedelta(minutes=1)\n return _cmp((myhhmm,self._second,self._microsecond),\n (othhmm,other._second,other._microsecond))\n \n def __hash__(self):\n ''\n tzoff=self.utcoffset()\n if not tzoff:\n return hash(self._getstate()[0])\n h,m=divmod(timedelta(hours=self.hour,minutes=self.minute)-tzoff,\n timedelta(hours=1))\n assert not m %timedelta(minutes=1),\"whole minute\"\n m //=timedelta(minutes=1)\n if 0 <=h <24:\n return hash(time(h,m,self.second,self.microsecond))\n return hash((h,m,self.second,self.microsecond))\n \n \n \n def _tzstr(self,sep=\":\"):\n ''\n off=self.utcoffset()\n if off is not None :\n if off.days <0:\n sign=\"-\"\n off=-off\n else :\n sign=\"+\"\n hh,mm=divmod(off,timedelta(hours=1))\n assert not mm %timedelta(minutes=1),\"whole minute\"\n mm //=timedelta(minutes=1)\n assert 0 <=hh <24\n off=\"%s%02d%s%02d\"%(sign,hh,sep,mm)\n return off\n \n def __repr__(self):\n ''\n if self._microsecond !=0:\n s=\", %d, %d\"%(self._second,self._microsecond)\n elif self._second !=0:\n s=\", %d\"%self._second\n else :\n s=\"\"\n s=\"%s(%d, %d%s)\"%('datetime.'+self.__class__.__name__,\n self._hour,self._minute,s)\n if self._tzinfo is not None :\n assert s[-1:]==\")\"\n s=s[:-1]+\", tzinfo=%r\"%self._tzinfo+\")\"\n return s\n \n def isoformat(self):\n ''\n\n\n\n \n s=_format_time(self._hour,self._minute,self._second,\n self._microsecond)\n tz=self._tzstr()\n if tz:\n s +=tz\n return s\n \n __str__=isoformat\n \n def strftime(self,fmt):\n ''\n\n \n \n \n timetuple=(1900,1,1,\n self._hour,self._minute,self._second,\n 0,1,-1)\n return _wrap_strftime(self,fmt,timetuple)\n \n def __format__(self,fmt):\n if len(fmt)!=0:\n return self.strftime(fmt)\n return str(self)\n \n \n \n def utcoffset(self):\n ''\n \n if self._tzinfo is None :\n return None\n offset=self._tzinfo.utcoffset(None )\n _check_utc_offset(\"utcoffset\",offset)\n return offset\n \n def tzname(self):\n ''\n\n\n\n\n \n if self._tzinfo is None :\n return None\n name=self._tzinfo.tzname(None )\n _check_tzname(name)\n return name\n \n def dst(self):\n ''\n\n\n\n\n\n\n \n if self._tzinfo is None :\n return None\n offset=self._tzinfo.dst(None )\n _check_utc_offset(\"dst\",offset)\n return offset\n \n def replace(self,hour=None ,minute=None ,second=None ,microsecond=None ,\n tzinfo=True ):\n ''\n if hour is None :\n hour=self.hour\n if minute is None :\n minute=self.minute\n if second is None :\n second=self.second\n if microsecond is None :\n microsecond=self.microsecond\n if tzinfo is True :\n tzinfo=self.tzinfo\n _check_time_fields(hour,minute,second,microsecond)\n _check_tzinfo_arg(tzinfo)\n return time(hour,minute,second,microsecond,tzinfo)\n \n def __bool__(self):\n if self.second or self.microsecond:\n return True\n offset=self.utcoffset()or timedelta(0)\n return timedelta(hours=self.hour,minutes=self.minute)!=offset\n \n \n \n def _getstate(self):\n us2,us3=divmod(self._microsecond,256)\n us1,us2=divmod(us2,256)\n basestate=bytes([self._hour,self._minute,self._second,\n us1,us2,us3])\n if self._tzinfo is None :\n return (basestate,)\n else :\n return (basestate,self._tzinfo)\n \n def __setstate(self,string,tzinfo):\n if len(string)!=6 or string[0]>=24:\n raise TypeError(\"an integer is required\")\n (self._hour,self._minute,self._second,\n us1,us2,us3)=string\n self._microsecond=(((us1 <<8)|us2)<<8)|us3\n if tzinfo is None or isinstance(tzinfo,_tzinfo_class):\n self._tzinfo=tzinfo\n else :\n raise TypeError(\"bad tzinfo state arg %r\"%tzinfo)\n \n def __reduce__(self):\n return (time,self._getstate())\n \n_time_class=time\n\ntime.min=time(0,0,0)\ntime.max=time(23,59,59,999999)\ntime.resolution=timedelta(microseconds=1)\n\nclass datetime(date):\n ''\n\n\n\n \n \n __slots__=date.__slots__+(\n '_hour','_minute','_second',\n '_microsecond','_tzinfo')\n def __new__(cls,year,month=None ,day=None ,hour=0,minute=0,second=0,\n microsecond=0,tzinfo=None ):\n if isinstance(year,bytes)and len(year)==10:\n \n self=date.__new__(cls,year[:4])\n self.__setstate(year,month)\n return self\n _check_tzinfo_arg(tzinfo)\n _check_time_fields(hour,minute,second,microsecond)\n self=date.__new__(cls,year,month,day)\n self._hour=hour\n self._minute=minute\n self._second=second\n self._microsecond=microsecond\n self._tzinfo=tzinfo\n return self\n \n \n @property\n def hour(self):\n ''\n return self._hour\n \n @property\n def minute(self):\n ''\n return self._minute\n \n @property\n def second(self):\n ''\n return self._second\n \n @property\n def microsecond(self):\n ''\n return self._microsecond\n \n @property\n def tzinfo(self):\n ''\n return self._tzinfo\n \n @classmethod\n def fromtimestamp(cls,t,tz=None ):\n ''\n\n\n \n \n _check_tzinfo_arg(tz)\n \n converter=_time.localtime if tz is None else _time.gmtime\n \n t,frac=divmod(t,1.0)\n us=int(frac *1e6)\n \n \n \n \n \n if us ==1000000:\n t +=1\n us=0\n y,m,d,hh,mm,ss,weekday,jday,dst=converter(t)\n ss=min(ss,59)\n result=cls(y,m,d,hh,mm,ss,us,tz)\n if tz is not None :\n result=tz.fromutc(result)\n return result\n \n @classmethod\n def utcfromtimestamp(cls,t):\n ''\n t,frac=divmod(t,1.0)\n us=int(frac *1e6)\n \n \n \n \n \n if us ==1000000:\n t +=1\n us=0\n y,m,d,hh,mm,ss,weekday,jday,dst=_time.gmtime(t)\n ss=min(ss,59)\n return cls(y,m,d,hh,mm,ss,us)\n \n \n \n \n \n \n @classmethod\n def now(cls,tz=None ):\n ''\n t=_time.time()\n return cls.fromtimestamp(t,tz)\n \n @classmethod\n def utcnow(cls):\n ''\n t=_time.time()\n return cls.utcfromtimestamp(t)\n \n @classmethod\n def combine(cls,date,time):\n ''\n if not isinstance(date,_date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time,_time_class):\n raise TypeError(\"time argument must be a time instance\")\n return cls(date.year,date.month,date.day,\n time.hour,time.minute,time.second,time.microsecond,\n time.tzinfo)\n \n def timetuple(self):\n ''\n dst=self.dst()\n if dst is None :\n dst=-1\n elif dst:\n dst=1\n else :\n dst=0\n return _build_struct_time(self.year,self.month,self.day,\n self.hour,self.minute,self.second,\n dst)\n \n def timestamp(self):\n ''\n if self._tzinfo is None :\n return _time.mktime((self.year,self.month,self.day,\n self.hour,self.minute,self.second,\n -1,-1,-1))+self.microsecond /1e6\n else :\n return (self -_EPOCH).total_seconds()\n \n def utctimetuple(self):\n ''\n offset=self.utcoffset()\n if offset:\n self -=offset\n y,m,d=self.year,self.month,self.day\n hh,mm,ss=self.hour,self.minute,self.second\n return _build_struct_time(y,m,d,hh,mm,ss,0)\n \n def date(self):\n ''\n return date(self._year,self._month,self._day)\n \n def time(self):\n ''\n return time(self.hour,self.minute,self.second,self.microsecond)\n \n def timetz(self):\n ''\n return time(self.hour,self.minute,self.second,self.microsecond,\n self._tzinfo)\n \n def replace(self,year=None ,month=None ,day=None ,hour=None ,\n minute=None ,second=None ,microsecond=None ,tzinfo=True ):\n ''\n if year is None :\n year=self.year\n if month is None :\n month=self.month\n if day is None :\n day=self.day\n if hour is None :\n hour=self.hour\n if minute is None :\n minute=self.minute\n if second is None :\n second=self.second\n if microsecond is None :\n microsecond=self.microsecond\n if tzinfo is True :\n tzinfo=self.tzinfo\n _check_date_fields(year,month,day)\n _check_time_fields(hour,minute,second,microsecond)\n _check_tzinfo_arg(tzinfo)\n return datetime(year,month,day,hour,minute,second,\n microsecond,tzinfo)\n \n def astimezone(self,tz=None ):\n if tz is None :\n if self.tzinfo is None :\n raise ValueError(\"astimezone() requires an aware datetime\")\n ts=(self -_EPOCH)//timedelta(seconds=1)\n localtm=_time.localtime(ts)\n local=datetime(*localtm[:6])\n try :\n \n gmtoff=localtm.tm_gmtoff\n zone=localtm.tm_zone\n except AttributeError:\n \n \n \n delta=local -datetime(*_time.gmtime(ts)[:6])\n dst=_time.daylight and localtm.tm_isdst >0\n gmtoff=-(_time.altzone if dst else _time.timezone)\n if delta ==timedelta(seconds=gmtoff):\n tz=timezone(delta,_time.tzname[dst])\n else :\n tz=timezone(delta)\n else :\n tz=timezone(timedelta(seconds=gmtoff),zone)\n \n elif not isinstance(tz,tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n \n mytz=self.tzinfo\n if mytz is None :\n raise ValueError(\"astimezone() requires an aware datetime\")\n \n if tz is mytz:\n return self\n \n \n myoffset=self.utcoffset()\n if myoffset is None :\n raise ValueError(\"astimezone() requires an aware datetime\")\n utc=(self -myoffset).replace(tzinfo=tz)\n \n \n return tz.fromutc(utc)\n \n \n \n def ctime(self):\n ''\n weekday=self.toordinal()%7 or 7\n return\"%s %s %2d %02d:%02d:%02d %04d\"%(\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour,self._minute,self._second,\n self._year)\n \n def isoformat(self,sep='T'):\n ''\n\n\n\n\n\n\n\n\n\n \n s=(\"%04d-%02d-%02d%c\"%(self._year,self._month,self._day,\n sep)+\n _format_time(self._hour,self._minute,self._second,\n self._microsecond))\n off=self.utcoffset()\n if off is not None :\n if off.days <0:\n sign=\"-\"\n off=-off\n else :\n sign=\"+\"\n hh,mm=divmod(off,timedelta(hours=1))\n assert not mm %timedelta(minutes=1),\"whole minute\"\n mm //=timedelta(minutes=1)\n s +=\"%s%02d:%02d\"%(sign,hh,mm)\n return s\n \n def __repr__(self):\n ''\n L=[self._year,self._month,self._day,\n self._hour,self._minute,self._second,self._microsecond]\n if L[-1]==0:\n del L[-1]\n if L[-1]==0:\n del L[-1]\n s=\", \".join(map(str,L))\n s=\"%s(%s)\"%('datetime.'+self.__class__.__name__,s)\n if self._tzinfo is not None :\n assert s[-1:]==\")\"\n s=s[:-1]+\", tzinfo=%r\"%self._tzinfo+\")\"\n return s\n \n def __str__(self):\n ''\n return self.isoformat(sep=' ')\n \n @classmethod\n def strptime(cls,date_string,format):\n ''\n import _strptime\n return _strptime._strptime_datetime(cls,date_string,format)\n \n def utcoffset(self):\n ''\n \n if self._tzinfo is None :\n return None\n offset=self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\",offset)\n return offset\n \n def tzname(self):\n ''\n\n\n\n\n \n name=_call_tzinfo_method(self._tzinfo,\"tzname\",self)\n _check_tzname(name)\n return name\n \n def dst(self):\n ''\n\n\n\n\n\n\n \n if self._tzinfo is None :\n return None\n offset=self._tzinfo.dst(self)\n _check_utc_offset(\"dst\",offset)\n return offset\n \n \n \n def __eq__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other,allow_mixed=True )==0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n return False\n \n def __ne__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other,allow_mixed=True )!=0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n return True\n \n def __le__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other)<=0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n _cmperror(self,other)\n \n def __lt__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other)<0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n _cmperror(self,other)\n \n def __ge__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other)>=0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n _cmperror(self,other)\n \n def __gt__(self,other):\n if isinstance(other,datetime):\n return self._cmp(other)>0\n elif not isinstance(other,date):\n return NotImplemented\n else :\n _cmperror(self,other)\n \n def _cmp(self,other,allow_mixed=False ):\n assert isinstance(other,datetime)\n mytz=self._tzinfo\n ottz=other._tzinfo\n myoff=otoff=None\n \n if mytz is ottz:\n base_compare=True\n else :\n myoff=self.utcoffset()\n otoff=other.utcoffset()\n base_compare=myoff ==otoff\n \n if base_compare:\n return _cmp((self._year,self._month,self._day,\n self._hour,self._minute,self._second,\n self._microsecond),\n (other._year,other._month,other._day,\n other._hour,other._minute,other._second,\n other._microsecond))\n if myoff is None or otoff is None :\n if allow_mixed:\n return 2\n else :\n raise TypeError(\"cannot compare naive and aware datetimes\")\n \n diff=self -other\n if diff.days <0:\n return -1\n return diff and 1 or 0\n \n def __add__(self,other):\n ''\n if not isinstance(other,timedelta):\n return NotImplemented\n delta=timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta +=other\n hour,rem=divmod(delta.seconds,3600)\n minute,second=divmod(rem,60)\n if 0 THURSDAY:\n week1monday +=7\n return week1monday\n \nclass timezone(tzinfo):\n __slots__='_offset','_name'\n \n \n _Omitted=object()\n def __new__(cls,offset,name=_Omitted):\n if not isinstance(offset,timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name=None\n elif not isinstance(name,str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <=offset <=cls._maxoffset:\n raise ValueError(\"offset must be a timedelta\"\n \" strictly between -timedelta(hours=24) and\"\n \" timedelta(hours=24).\")\n if (offset.microseconds !=0 or\n offset.seconds %60 !=0):\n raise ValueError(\"offset must be a timedelta\"\n \" representing a whole number of minutes\")\n return cls._create(offset,name)\n \n @classmethod\n def _create(cls,offset,name=None ):\n self=tzinfo.__new__(cls)\n self._offset=offset\n self._name=name\n return self\n \n def __getinitargs__(self):\n ''\n if self._name is None :\n return (self._offset,)\n return (self._offset,self._name)\n \n def __eq__(self,other):\n if type(other)!=timezone:\n return False\n return self._offset ==other._offset\n \n def __hash__(self):\n return hash(self._offset)\n \n def __repr__(self):\n ''\n\n\n\n\n\n\n\n \n if self is self.utc:\n return'datetime.timezone.utc'\n if self._name is None :\n return\"%s(%r)\"%('datetime.'+self.__class__.__name__,\n self._offset)\n return\"%s(%r, %r)\"%('datetime.'+self.__class__.__name__,\n self._offset,self._name)\n \n def __str__(self):\n return self.tzname(None )\n \n def utcoffset(self,dt):\n if isinstance(dt,datetime)or dt is None :\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n \n def tzname(self,dt):\n if isinstance(dt,datetime)or dt is None :\n if self._name is None :\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n \n def dst(self,dt):\n if isinstance(dt,datetime)or dt is None :\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n \n def fromutc(self,dt):\n if isinstance(dt,datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt+self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n \n _maxoffset=timedelta(hours=23,minutes=59)\n _minoffset=-_maxoffset\n \n @staticmethod\n def _name_from_offset(delta):\n if delta ','>=','in','not in','is',\n'is not','exception match','BAD')\n\nhasconst=[]\nhasname=[]\nhasjrel=[]\nhasjabs=[]\nhaslocal=[]\nhascompare=[]\nhasfree=[]\nhasnargs=[]\n\nopmap={}\nopname=['']*256\nfor op in range(256):opname[op]='<%r>'%(op,)\ndel op\n\ndef def_op(name,op):\n opname[op]=name\n opmap[name]=op\n \ndef name_op(name,op):\n def_op(name,op)\n hasname.append(op)\n \ndef jrel_op(name,op):\n def_op(name,op)\n hasjrel.append(op)\n \ndef jabs_op(name,op):\n def_op(name,op)\n hasjabs.append(op)\n \n \n \n \ndef_op('POP_TOP',1)\ndef_op('ROT_TWO',2)\ndef_op('ROT_THREE',3)\ndef_op('DUP_TOP',4)\ndef_op('DUP_TOP_TWO',5)\n\ndef_op('NOP',9)\ndef_op('UNARY_POSITIVE',10)\ndef_op('UNARY_NEGATIVE',11)\ndef_op('UNARY_NOT',12)\n\ndef_op('UNARY_INVERT',15)\n\ndef_op('BINARY_POWER',19)\ndef_op('BINARY_MULTIPLY',20)\n\ndef_op('BINARY_MODULO',22)\ndef_op('BINARY_ADD',23)\ndef_op('BINARY_SUBTRACT',24)\ndef_op('BINARY_SUBSCR',25)\ndef_op('BINARY_FLOOR_DIVIDE',26)\ndef_op('BINARY_TRUE_DIVIDE',27)\ndef_op('INPLACE_FLOOR_DIVIDE',28)\ndef_op('INPLACE_TRUE_DIVIDE',29)\n\ndef_op('STORE_MAP',54)\ndef_op('INPLACE_ADD',55)\ndef_op('INPLACE_SUBTRACT',56)\ndef_op('INPLACE_MULTIPLY',57)\n\ndef_op('INPLACE_MODULO',59)\ndef_op('STORE_SUBSCR',60)\ndef_op('DELETE_SUBSCR',61)\ndef_op('BINARY_LSHIFT',62)\ndef_op('BINARY_RSHIFT',63)\ndef_op('BINARY_AND',64)\ndef_op('BINARY_XOR',65)\ndef_op('BINARY_OR',66)\ndef_op('INPLACE_POWER',67)\ndef_op('GET_ITER',68)\n\ndef_op('PRINT_EXPR',70)\ndef_op('LOAD_BUILD_CLASS',71)\ndef_op('YIELD_FROM',72)\n\ndef_op('INPLACE_LSHIFT',75)\ndef_op('INPLACE_RSHIFT',76)\ndef_op('INPLACE_AND',77)\ndef_op('INPLACE_XOR',78)\ndef_op('INPLACE_OR',79)\ndef_op('BREAK_LOOP',80)\ndef_op('WITH_CLEANUP',81)\n\ndef_op('RETURN_VALUE',83)\ndef_op('IMPORT_STAR',84)\n\ndef_op('YIELD_VALUE',86)\ndef_op('POP_BLOCK',87)\ndef_op('END_FINALLY',88)\ndef_op('POP_EXCEPT',89)\n\nHAVE_ARGUMENT=90\n\nname_op('STORE_NAME',90)\nname_op('DELETE_NAME',91)\ndef_op('UNPACK_SEQUENCE',92)\njrel_op('FOR_ITER',93)\ndef_op('UNPACK_EX',94)\nname_op('STORE_ATTR',95)\nname_op('DELETE_ATTR',96)\nname_op('STORE_GLOBAL',97)\nname_op('DELETE_GLOBAL',98)\ndef_op('LOAD_CONST',100)\nhasconst.append(100)\nname_op('LOAD_NAME',101)\ndef_op('BUILD_TUPLE',102)\ndef_op('BUILD_LIST',103)\ndef_op('BUILD_SET',104)\ndef_op('BUILD_MAP',105)\nname_op('LOAD_ATTR',106)\ndef_op('COMPARE_OP',107)\nhascompare.append(107)\nname_op('IMPORT_NAME',108)\nname_op('IMPORT_FROM',109)\n\njrel_op('JUMP_FORWARD',110)\njabs_op('JUMP_IF_FALSE_OR_POP',111)\njabs_op('JUMP_IF_TRUE_OR_POP',112)\njabs_op('JUMP_ABSOLUTE',113)\njabs_op('POP_JUMP_IF_FALSE',114)\njabs_op('POP_JUMP_IF_TRUE',115)\n\nname_op('LOAD_GLOBAL',116)\n\njabs_op('CONTINUE_LOOP',119)\njrel_op('SETUP_LOOP',120)\njrel_op('SETUP_EXCEPT',121)\njrel_op('SETUP_FINALLY',122)\n\ndef_op('LOAD_FAST',124)\nhaslocal.append(124)\ndef_op('STORE_FAST',125)\nhaslocal.append(125)\ndef_op('DELETE_FAST',126)\nhaslocal.append(126)\n\ndef_op('RAISE_VARARGS',130)\ndef_op('CALL_FUNCTION',131)\nhasnargs.append(131)\ndef_op('MAKE_FUNCTION',132)\ndef_op('BUILD_SLICE',133)\ndef_op('MAKE_CLOSURE',134)\ndef_op('LOAD_CLOSURE',135)\nhasfree.append(135)\ndef_op('LOAD_DEREF',136)\nhasfree.append(136)\ndef_op('STORE_DEREF',137)\nhasfree.append(137)\ndef_op('DELETE_DEREF',138)\nhasfree.append(138)\n\ndef_op('CALL_FUNCTION_VAR',140)\nhasnargs.append(140)\ndef_op('CALL_FUNCTION_KW',141)\nhasnargs.append(141)\ndef_op('CALL_FUNCTION_VAR_KW',142)\nhasnargs.append(142)\n\njrel_op('SETUP_WITH',143)\n\ndef_op('LIST_APPEND',145)\ndef_op('SET_ADD',146)\ndef_op('MAP_ADD',147)\n\ndef_op('LOAD_CLASSDEREF',148)\nhasfree.append(148)\n\ndef_op('EXTENDED_ARG',144)\nEXTENDED_ARG=144\n\ndel def_op,name_op,jrel_op,jabs_op\n"], "binascii": [".py", "''\n\n\n\n\n\n\n\nclass Error(Exception):\n pass\n \nclass Done(Exception):\n pass\n \nclass Incomplete(Exception):\n pass\n \ndef a2b_uu(s):\n if not s:\n return''\n \n length=(ord(s[0])-0x20)%64\n \n def quadruplets_gen(s):\n while s:\n try :\n yield ord(s[0]),ord(s[1]),ord(s[2]),ord(s[3])\n except IndexError:\n s +=' '\n yield ord(s[0]),ord(s[1]),ord(s[2]),ord(s[3])\n return\n s=s[4:]\n \n try :\n result=[''.join(\n [chr((A -0x20)<<2 |(((B -0x20)>>4)&0x3)),\n chr(((B -0x20)&0xf)<<4 |(((C -0x20)>>2)&0xf)),\n chr(((C -0x20)&0x3)<<6 |((D -0x20)&0x3f))\n ])for A,B,C,D in quadruplets_gen(s[1:].rstrip())]\n except ValueError:\n raise Error('Illegal char')\n result=''.join(result)\n trailingdata=result[length:]\n if trailingdata.strip('\\x00'):\n raise Error('Trailing garbage')\n result=result[:length]\n if len(result)45:\n raise Error('At most 45 bytes at once')\n \n def triples_gen(s):\n while s:\n try :\n yield ord(s[0]),ord(s[1]),ord(s[2])\n except IndexError:\n s +='\\0\\0'\n yield ord(s[0]),ord(s[1]),ord(s[2])\n return\n s=s[3:]\n \n result=[''.join(\n [chr(0x20+((A >>2)&0x3F)),\n chr(0x20+(((A <<4)|((B >>4)&0xF))&0x3F)),\n chr(0x20+(((B <<2)|((C >>6)&0x3))&0x3F)),\n chr(0x20+((C)&0x3F))])\n for A,B,C in triples_gen(s)]\n return chr(ord(' ')+(length&0o77))+''.join(result)+'\\n'\n \n \ntable_a2b_base64={\n'A':0,\n'B':1,\n'C':2,\n'D':3,\n'E':4,\n'F':5,\n'G':6,\n'H':7,\n'I':8,\n'J':9,\n'K':10,\n'L':11,\n'M':12,\n'N':13,\n'O':14,\n'P':15,\n'Q':16,\n'R':17,\n'S':18,\n'T':19,\n'U':20,\n'V':21,\n'W':22,\n'X':23,\n'Y':24,\n'Z':25,\n'a':26,\n'b':27,\n'c':28,\n'd':29,\n'e':30,\n'f':31,\n'g':32,\n'h':33,\n'i':34,\n'j':35,\n'k':36,\n'l':37,\n'm':38,\n'n':39,\n'o':40,\n'p':41,\n'q':42,\n'r':43,\n's':44,\n't':45,\n'u':46,\n'v':47,\n'w':48,\n'x':49,\n'y':50,\n'z':51,\n'0':52,\n'1':53,\n'2':54,\n'3':55,\n'4':56,\n'5':57,\n'6':58,\n'7':59,\n'8':60,\n'9':61,\n'+':62,\n'/':63,\n'=':0,\n}\n\n\ndef a2b_base64(s):\n if not isinstance(s,(str,bytes)):\n raise TypeError(\"expected string, got %r\"%(s,))\n s=s.rstrip()\n \n \n \n def next_valid_char(s,pos):\n for i in range(pos+1,len(s)):\n c=s[i]\n if c <0x7f:\n try :\n table_a2b_base64[chr(c)]\n return chr(c)\n except KeyError:\n pass\n return None\n \n quad_pos=0\n leftbits=0\n leftchar=0\n res=[]\n for i,c in enumerate(s):\n if isinstance(c,int):\n c=chr(c)\n if c >'\\x7f'or c =='\\n'or c =='\\r'or c ==' ':\n continue\n if c =='=':\n if quad_pos <2 or (quad_pos ==2 and next_valid_char(s,i)!='='):\n continue\n else :\n leftbits=0\n break\n try :\n next_c=table_a2b_base64[c]\n except KeyError:\n continue\n quad_pos=(quad_pos+1)&0x03\n leftchar=(leftchar <<6)|next_c\n leftbits +=6\n if leftbits >=8:\n leftbits -=8\n res.append((leftchar >>leftbits&0xff))\n leftchar &=((1 <>2)&0x3F],\n table_b2a_base64[((A <<4)|((B >>4)&0xF))&0x3F],\n table_b2a_base64[((B <<2)|((C >>6)&0x3))&0x3F],\n table_b2a_base64[(C)&0x3F]])\n for A,B,C in a]\n \n final=s[length -final_length:]\n if final_length ==0:\n snippet=''\n elif final_length ==1:\n a=final[0]\n snippet=table_b2a_base64[(a >>2)&0x3F]+ table_b2a_base64[(a <<4)&0x3F]+'=='\n else :\n a=final[0]\n b=final[1]\n snippet=table_b2a_base64[(a >>2)&0x3F]+ table_b2a_base64[((a <<4)|(b >>4)&0xF)&0x3F]+ table_b2a_base64[(b <<2)&0x3F]+'='\n return bytes(''.join(result)+snippet+'\\n',__BRYTHON__.charset)\n \ndef a2b_qp(s,header=False ):\n inp=0\n odata=[]\n while inp =len(s):\n break\n \n if (s[inp]=='\\n')or (s[inp]=='\\r'):\n if s[inp]!='\\n':\n while inp 0 and data[lf -1]=='\\r'\n \n inp=0\n linelen=0\n odata=[]\n while inp '~'or\n c =='='or\n (header and c =='_')or\n (c =='.'and linelen ==0 and (inp+1 ==len(data)or\n data[inp+1]=='\\n'or\n data[inp+1]=='\\r'))or\n (not istext and (c =='\\r'or c =='\\n'))or\n ((c =='\\t'or c ==' ')and (inp+1 ==len(data)))or\n (c <=' 'and c !='\\r'and c !='\\n'and\n (quotetabs or (not quotetabs and (c !='\\t'and c !=' '))))):\n linelen +=3\n if linelen >=MAXLINESIZE:\n odata.append('=')\n if crlf:odata.append('\\r')\n odata.append('\\n')\n linelen=3\n odata.append('='+two_hex_digits(ord(c)))\n inp +=1\n else :\n if (istext and\n (c =='\\n'or (inp+1 0 and\n (odata[-1]==' 'or odata[-1]=='\\t')):\n ch=ord(odata[-1])\n odata[-1]='='\n odata.append(two_hex_digits(ch))\n \n if crlf:odata.append('\\r')\n odata.append('\\n')\n if c =='\\r':\n inp +=2\n else :\n inp +=1\n else :\n if (inp+1 =MAXLINESIZE):\n odata.append('=')\n if crlf:odata.append('\\r')\n odata.append('\\n')\n linelen=0\n \n linelen +=1\n if header and c ==' ':\n c='_'\n odata.append(c)\n inp +=1\n return''.join(odata)\n \nhex_numbers='0123456789ABCDEF'\ndef hex(n):\n if n ==0:\n return'0'\n \n if n <0:\n n=-n\n sign='-'\n else :\n sign=''\n arr=[]\n \n def hex_gen(n):\n ''\n while n:\n yield n %0x10\n n=n /0x10\n \n for nibble in hex_gen(n):\n arr=[hex_numbers[nibble]]+arr\n return sign+''.join(arr)\n \ndef two_hex_digits(n):\n return hex_numbers[n /0x10]+hex_numbers[n %0x10]\n \n \ndef strhex_to_int(s):\n i=0\n for c in s:\n i=i *0x10+hex_numbers.index(c)\n return i\n \nhqx_encoding='!\"#$%&\\'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr'\n\nDONE=0x7f\nSKIP=0x7e\nFAIL=0x7d\n\ntable_a2b_hqx=[\n\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\n\nFAIL,FAIL,SKIP,FAIL,FAIL,SKIP,FAIL,FAIL,\n\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\n\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\n\nFAIL,0x00,0x01,0x02,0x03,0x04,0x05,0x06,\n\n0x07,0x08,0x09,0x0A,0x0B,0x0C,FAIL,FAIL,\n\n0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,FAIL,\n\n0x14,0x15,DONE,FAIL,FAIL,FAIL,FAIL,FAIL,\n\n0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,\n\n0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,FAIL,\n\n0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,FAIL,\n\n0x2C,0x2D,0x2E,0x2F,FAIL,FAIL,FAIL,FAIL,\n\n0x30,0x31,0x32,0x33,0x34,0x35,0x36,FAIL,\n\n0x37,0x38,0x39,0x3A,0x3B,0x3C,FAIL,FAIL,\n\n0x3D,0x3E,0x3F,FAIL,FAIL,FAIL,FAIL,FAIL,\n\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\nFAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,FAIL,\n]\n\ndef a2b_hqx(s):\n result=[]\n \n def quadruples_gen(s):\n t=[]\n for c in s:\n res=table_a2b_hqx[ord(c)]\n if res ==SKIP:\n continue\n elif res ==FAIL:\n raise Error('Illegal character')\n elif res ==DONE:\n yield t\n raise Done\n else :\n t.append(res)\n if len(t)==4:\n yield t\n t=[]\n yield t\n \n done=0\n try :\n for snippet in quadruples_gen(s):\n length=len(snippet)\n if length ==4:\n result.append(chr(((snippet[0]&0x3f)<<2)|(snippet[1]>>4)))\n result.append(chr(((snippet[1]&0x0f)<<4)|(snippet[2]>>2)))\n result.append(chr(((snippet[2]&0x03)<<6)|(snippet[3])))\n elif length ==3:\n result.append(chr(((snippet[0]&0x3f)<<2)|(snippet[1]>>4)))\n result.append(chr(((snippet[1]&0x0f)<<4)|(snippet[2]>>2)))\n elif length ==2:\n result.append(chr(((snippet[0]&0x3f)<<2)|(snippet[1]>>4)))\n except Done:\n done=1\n except Error:\n raise\n return (''.join(result),done)\n \n \n \ndef b2a_hqx(s):\n result=[]\n \n def triples_gen(s):\n while s:\n try :\n yield ord(s[0]),ord(s[1]),ord(s[2])\n except IndexError:\n yield tuple([ord(c)for c in s])\n s=s[3:]\n \n for snippet in triples_gen(s):\n length=len(snippet)\n if length ==3:\n result.append(\n hqx_encoding[(snippet[0]&0xfc)>>2])\n result.append(hqx_encoding[\n ((snippet[0]&0x03)<<4)|((snippet[1]&0xf0)>>4)])\n result.append(hqx_encoding[\n (snippet[1]&0x0f)<<2 |((snippet[2]&0xc0)>>6)])\n result.append(hqx_encoding[snippet[2]&0x3f])\n elif length ==2:\n result.append(\n hqx_encoding[(snippet[0]&0xfc)>>2])\n result.append(hqx_encoding[\n ((snippet[0]&0x03)<<4)|((snippet[1]&0xf0)>>4)])\n result.append(hqx_encoding[\n (snippet[1]&0x0f)<<2])\n elif length ==1:\n result.append(\n hqx_encoding[(snippet[0]&0xfc)>>2])\n result.append(hqx_encoding[\n ((snippet[0]&0x03)<<4)])\n return''.join(result)\n \ncrctab_hqx=[\n0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,\n0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,\n0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,\n0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,\n0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,\n0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58d,\n0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4,\n0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,\n0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,\n0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92b,\n0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,\n0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,\n0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,\n0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49,\n0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,\n0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,\n0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16f,\n0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067,\n0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,\n0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,\n0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50d,\n0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,\n0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,\n0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634,\n0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9ab,\n0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,\n0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,\n0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92,\n0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9,\n0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,\n0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,\n0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0,\n]\n\ndef crc_hqx(s,crc):\n for c in s:\n crc=((crc <<8)&0xff00)^crctab_hqx[((crc >>8)&0xff)^ord(c)]\n \n return crc\n \ndef rlecode_hqx(s):\n ''\n\n\n\n \n if not s:\n return''\n result=[]\n prev=s[0]\n count=1\n \n \n \n \n if s[-1]=='!':\n s=s[1:]+'?'\n else :\n s=s[1:]+'!'\n \n for c in s:\n if c ==prev and count <255:\n count +=1\n else :\n if count ==1:\n if prev !='\\x90':\n result.append(prev)\n else :\n result.extend(['\\x90','\\x00'])\n elif count <4:\n if prev !='\\x90':\n result.extend([prev]*count)\n else :\n result.extend(['\\x90','\\x00']*count)\n else :\n if prev !='\\x90':\n result.extend([prev,'\\x90',chr(count)])\n else :\n result.extend(['\\x90','\\x00','\\x90',chr(count)])\n count=1\n prev=c\n \n return''.join(result)\n \ndef rledecode_hqx(s):\n s=s.split('\\x90')\n result=[s[0]]\n prev=s[0]\n for snippet in s[1:]:\n count=ord(snippet[0])\n if count >0:\n result.append(prev[-1]*(count -1))\n prev=snippet\n else :\n result.append('\\x90')\n prev='\\x90'\n result.append(snippet[1:])\n \n return''.join(result)\n \ncrc_32_tab=[\n0x00000000,0x77073096,0xee0e612c,0x990951ba,0x076dc419,\n0x706af48f,0xe963a535,0x9e6495a3,0x0edb8832,0x79dcb8a4,\n0xe0d5e91e,0x97d2d988,0x09b64c2b,0x7eb17cbd,0xe7b82d07,\n0x90bf1d91,0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,\n0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83d385c7,0x136c9856,\n0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,\n0xfa0f3d63,0x8d080df5,0x3b6e20c8,0x4c69105e,0xd56041e4,\n0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa50ab56b,\n0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,\n0x45df5c75,0xdcd60dcf,0xabd13d59,0x26d930ac,0x51de003a,\n0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,\n0xb8bda50f,0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,\n0x2f6f7c87,0x58684c11,0xc1611dab,0xb6662d3d,0x76dc4190,\n0x01db7106,0x98d220bc,0xefd5102a,0x71b18589,0x06b6b51f,\n0x9fbfe4a5,0xe8b8d433,0x7807c9a2,0x0f00f934,0x9609a88e,\n0xe10e9818,0x7f6a0dbb,0x086d3d2d,0x91646c97,0xe6635c01,\n0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,\n0x1b01a57b,0x8208f4c1,0xf50fc457,0x65b0d9c6,0x12b7e950,\n0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,\n0xfbd44c65,0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,\n0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3d6f4fb,0x4369e96a,\n0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,\n0xaa0a4c5f,0xdd0d7cc9,0x5005713c,0x270241aa,0xbe0b1010,\n0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce61e49f,\n0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,\n0x2eb40d81,0xb7bd5c3b,0xc0ba6cad,0xedb88320,0x9abfb3b6,\n0x03b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x04db2615,\n0x73dc1683,0xe3630b12,0x94643b84,0x0d6d6a3e,0x7a6a5aa8,\n0xe40ecf0b,0x9309ff9d,0x0a00ae27,0x7d079eb1,0xf00f9344,\n0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,\n0x196c3671,0x6e6b06e7,0xfed41b76,0x89d32be0,0x10da7a5a,\n0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60b08ed5,\n0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,\n0xa6bc5767,0x3fb506dd,0x48b2364b,0xd80d2bda,0xaf0a1b4c,\n0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,\n0x4669be79,0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,\n0xcc0c7795,0xbb0b4703,0x220216b9,0x5505262f,0xc5ba3bbe,\n0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,\n0x2cd99e8b,0x5bdeae1d,0x9b64c2b0,0xec63f226,0x756aa39c,\n0x026d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x05005713,\n0x95bf4a82,0xe2b87a14,0x7bb12bae,0x0cb61b38,0x92d28e9b,\n0xe5d5be0d,0x7cdcefb7,0x0bdbdf21,0x86d3d2d4,0xf1d4e242,\n0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,\n0x18b74777,0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,\n0x8f659eff,0xf862ae69,0x616bffd3,0x166ccf45,0xa00ae278,\n0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,\n0x4969474d,0x3e6e77db,0xaed16a4a,0xd9d65adc,0x40df0b66,\n0x37d83bf0,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30b5ffe9,\n0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,\n0xcdd70693,0x54de5729,0x23d967bf,0xb3667a2e,0xc4614ab8,\n0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,\n0x2d02ef8d\n]\n\ndef crc32(s,crc=0):\n result=0\n crc=~int(crc)&0xffffffff\n \n for c in s:\n crc=crc_32_tab[(crc ^int(ord(c)))&0xff]^(crc >>8)\n \n \n \n result=crc ^0xffffffff\n \n if result >2 **31:\n result=((result+2 **31)%2 **32)-2 **31\n \n return result\n \ndef b2a_hex(s):\n result=[]\n for char in s:\n c=(ord(char)>>4)&0xf\n if c >9:\n c=c+ord('a')-10\n else :\n c=c+ord('0')\n result.append(chr(c))\n c=ord(char)&0xf\n if c >9:\n c=c+ord('a')-10\n else :\n c=c+ord('0')\n result.append(chr(c))\n return''.join(result)\n \nhexlify=b2a_hex\n\ntable_hex=[\n-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,\n-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1\n]\n\n\ndef a2b_hex(t):\n result=[]\n \n def pairs_gen(s):\n while s:\n try :\n yield table_hex[ord(s[0])],table_hex[ord(s[1])]\n except IndexError:\n if len(s):\n raise TypeError('Odd-length string')\n return\n s=s[2:]\n \n for a,b in pairs_gen(t):\n if a <0 or b <0:\n raise TypeError('Non-hexadecimal digit found')\n result.append(chr((a <<4)+b))\n return bytes(''.join(result),__BRYTHON__.charset)\n \n \nunhexlify=a2b_hex\n"], "browser.websocket": [".py", "from browser import window\n\nif hasattr(window,'WebSocket'):\n supported=True\n WebSocket=window.WebSocket.new\nelse :\n supported=False\n def WebSocket(*args,**kw):\n raise NotImplementedError"], "encodings.cp850": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_map)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_map)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='cp850',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \ndecoding_map=codecs.make_identity_dict(range(256))\ndecoding_map.update({\n0x0080:0x00c7,\n0x0081:0x00fc,\n0x0082:0x00e9,\n0x0083:0x00e2,\n0x0084:0x00e4,\n0x0085:0x00e0,\n0x0086:0x00e5,\n0x0087:0x00e7,\n0x0088:0x00ea,\n0x0089:0x00eb,\n0x008a:0x00e8,\n0x008b:0x00ef,\n0x008c:0x00ee,\n0x008d:0x00ec,\n0x008e:0x00c4,\n0x008f:0x00c5,\n0x0090:0x00c9,\n0x0091:0x00e6,\n0x0092:0x00c6,\n0x0093:0x00f4,\n0x0094:0x00f6,\n0x0095:0x00f2,\n0x0096:0x00fb,\n0x0097:0x00f9,\n0x0098:0x00ff,\n0x0099:0x00d6,\n0x009a:0x00dc,\n0x009b:0x00f8,\n0x009c:0x00a3,\n0x009d:0x00d8,\n0x009e:0x00d7,\n0x009f:0x0192,\n0x00a0:0x00e1,\n0x00a1:0x00ed,\n0x00a2:0x00f3,\n0x00a3:0x00fa,\n0x00a4:0x00f1,\n0x00a5:0x00d1,\n0x00a6:0x00aa,\n0x00a7:0x00ba,\n0x00a8:0x00bf,\n0x00a9:0x00ae,\n0x00aa:0x00ac,\n0x00ab:0x00bd,\n0x00ac:0x00bc,\n0x00ad:0x00a1,\n0x00ae:0x00ab,\n0x00af:0x00bb,\n0x00b0:0x2591,\n0x00b1:0x2592,\n0x00b2:0x2593,\n0x00b3:0x2502,\n0x00b4:0x2524,\n0x00b5:0x00c1,\n0x00b6:0x00c2,\n0x00b7:0x00c0,\n0x00b8:0x00a9,\n0x00b9:0x2563,\n0x00ba:0x2551,\n0x00bb:0x2557,\n0x00bc:0x255d,\n0x00bd:0x00a2,\n0x00be:0x00a5,\n0x00bf:0x2510,\n0x00c0:0x2514,\n0x00c1:0x2534,\n0x00c2:0x252c,\n0x00c3:0x251c,\n0x00c4:0x2500,\n0x00c5:0x253c,\n0x00c6:0x00e3,\n0x00c7:0x00c3,\n0x00c8:0x255a,\n0x00c9:0x2554,\n0x00ca:0x2569,\n0x00cb:0x2566,\n0x00cc:0x2560,\n0x00cd:0x2550,\n0x00ce:0x256c,\n0x00cf:0x00a4,\n0x00d0:0x00f0,\n0x00d1:0x00d0,\n0x00d2:0x00ca,\n0x00d3:0x00cb,\n0x00d4:0x00c8,\n0x00d5:0x0131,\n0x00d6:0x00cd,\n0x00d7:0x00ce,\n0x00d8:0x00cf,\n0x00d9:0x2518,\n0x00da:0x250c,\n0x00db:0x2588,\n0x00dc:0x2584,\n0x00dd:0x00a6,\n0x00de:0x00cc,\n0x00df:0x2580,\n0x00e0:0x00d3,\n0x00e1:0x00df,\n0x00e2:0x00d4,\n0x00e3:0x00d2,\n0x00e4:0x00f5,\n0x00e5:0x00d5,\n0x00e6:0x00b5,\n0x00e7:0x00fe,\n0x00e8:0x00de,\n0x00e9:0x00da,\n0x00ea:0x00db,\n0x00eb:0x00d9,\n0x00ec:0x00fd,\n0x00ed:0x00dd,\n0x00ee:0x00af,\n0x00ef:0x00b4,\n0x00f0:0x00ad,\n0x00f1:0x00b1,\n0x00f2:0x2017,\n0x00f3:0x00be,\n0x00f4:0x00b6,\n0x00f5:0x00a7,\n0x00f6:0x00f7,\n0x00f7:0x00b8,\n0x00f8:0x00b0,\n0x00f9:0x00a8,\n0x00fa:0x00b7,\n0x00fb:0x00b9,\n0x00fc:0x00b3,\n0x00fd:0x00b2,\n0x00fe:0x25a0,\n0x00ff:0x00a0,\n})\n\n\n\ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\xc7'\n'\\xfc'\n'\\xe9'\n'\\xe2'\n'\\xe4'\n'\\xe0'\n'\\xe5'\n'\\xe7'\n'\\xea'\n'\\xeb'\n'\\xe8'\n'\\xef'\n'\\xee'\n'\\xec'\n'\\xc4'\n'\\xc5'\n'\\xc9'\n'\\xe6'\n'\\xc6'\n'\\xf4'\n'\\xf6'\n'\\xf2'\n'\\xfb'\n'\\xf9'\n'\\xff'\n'\\xd6'\n'\\xdc'\n'\\xf8'\n'\\xa3'\n'\\xd8'\n'\\xd7'\n'\\u0192'\n'\\xe1'\n'\\xed'\n'\\xf3'\n'\\xfa'\n'\\xf1'\n'\\xd1'\n'\\xaa'\n'\\xba'\n'\\xbf'\n'\\xae'\n'\\xac'\n'\\xbd'\n'\\xbc'\n'\\xa1'\n'\\xab'\n'\\xbb'\n'\\u2591'\n'\\u2592'\n'\\u2593'\n'\\u2502'\n'\\u2524'\n'\\xc1'\n'\\xc2'\n'\\xc0'\n'\\xa9'\n'\\u2563'\n'\\u2551'\n'\\u2557'\n'\\u255d'\n'\\xa2'\n'\\xa5'\n'\\u2510'\n'\\u2514'\n'\\u2534'\n'\\u252c'\n'\\u251c'\n'\\u2500'\n'\\u253c'\n'\\xe3'\n'\\xc3'\n'\\u255a'\n'\\u2554'\n'\\u2569'\n'\\u2566'\n'\\u2560'\n'\\u2550'\n'\\u256c'\n'\\xa4'\n'\\xf0'\n'\\xd0'\n'\\xca'\n'\\xcb'\n'\\xc8'\n'\\u0131'\n'\\xcd'\n'\\xce'\n'\\xcf'\n'\\u2518'\n'\\u250c'\n'\\u2588'\n'\\u2584'\n'\\xa6'\n'\\xcc'\n'\\u2580'\n'\\xd3'\n'\\xdf'\n'\\xd4'\n'\\xd2'\n'\\xf5'\n'\\xd5'\n'\\xb5'\n'\\xfe'\n'\\xde'\n'\\xda'\n'\\xdb'\n'\\xd9'\n'\\xfd'\n'\\xdd'\n'\\xaf'\n'\\xb4'\n'\\xad'\n'\\xb1'\n'\\u2017'\n'\\xbe'\n'\\xb6'\n'\\xa7'\n'\\xf7'\n'\\xb8'\n'\\xb0'\n'\\xa8'\n'\\xb7'\n'\\xb9'\n'\\xb3'\n'\\xb2'\n'\\u25a0'\n'\\xa0'\n)\n\n\n\nencoding_map={\n0x0000:0x0000,\n0x0001:0x0001,\n0x0002:0x0002,\n0x0003:0x0003,\n0x0004:0x0004,\n0x0005:0x0005,\n0x0006:0x0006,\n0x0007:0x0007,\n0x0008:0x0008,\n0x0009:0x0009,\n0x000a:0x000a,\n0x000b:0x000b,\n0x000c:0x000c,\n0x000d:0x000d,\n0x000e:0x000e,\n0x000f:0x000f,\n0x0010:0x0010,\n0x0011:0x0011,\n0x0012:0x0012,\n0x0013:0x0013,\n0x0014:0x0014,\n0x0015:0x0015,\n0x0016:0x0016,\n0x0017:0x0017,\n0x0018:0x0018,\n0x0019:0x0019,\n0x001a:0x001a,\n0x001b:0x001b,\n0x001c:0x001c,\n0x001d:0x001d,\n0x001e:0x001e,\n0x001f:0x001f,\n0x0020:0x0020,\n0x0021:0x0021,\n0x0022:0x0022,\n0x0023:0x0023,\n0x0024:0x0024,\n0x0025:0x0025,\n0x0026:0x0026,\n0x0027:0x0027,\n0x0028:0x0028,\n0x0029:0x0029,\n0x002a:0x002a,\n0x002b:0x002b,\n0x002c:0x002c,\n0x002d:0x002d,\n0x002e:0x002e,\n0x002f:0x002f,\n0x0030:0x0030,\n0x0031:0x0031,\n0x0032:0x0032,\n0x0033:0x0033,\n0x0034:0x0034,\n0x0035:0x0035,\n0x0036:0x0036,\n0x0037:0x0037,\n0x0038:0x0038,\n0x0039:0x0039,\n0x003a:0x003a,\n0x003b:0x003b,\n0x003c:0x003c,\n0x003d:0x003d,\n0x003e:0x003e,\n0x003f:0x003f,\n0x0040:0x0040,\n0x0041:0x0041,\n0x0042:0x0042,\n0x0043:0x0043,\n0x0044:0x0044,\n0x0045:0x0045,\n0x0046:0x0046,\n0x0047:0x0047,\n0x0048:0x0048,\n0x0049:0x0049,\n0x004a:0x004a,\n0x004b:0x004b,\n0x004c:0x004c,\n0x004d:0x004d,\n0x004e:0x004e,\n0x004f:0x004f,\n0x0050:0x0050,\n0x0051:0x0051,\n0x0052:0x0052,\n0x0053:0x0053,\n0x0054:0x0054,\n0x0055:0x0055,\n0x0056:0x0056,\n0x0057:0x0057,\n0x0058:0x0058,\n0x0059:0x0059,\n0x005a:0x005a,\n0x005b:0x005b,\n0x005c:0x005c,\n0x005d:0x005d,\n0x005e:0x005e,\n0x005f:0x005f,\n0x0060:0x0060,\n0x0061:0x0061,\n0x0062:0x0062,\n0x0063:0x0063,\n0x0064:0x0064,\n0x0065:0x0065,\n0x0066:0x0066,\n0x0067:0x0067,\n0x0068:0x0068,\n0x0069:0x0069,\n0x006a:0x006a,\n0x006b:0x006b,\n0x006c:0x006c,\n0x006d:0x006d,\n0x006e:0x006e,\n0x006f:0x006f,\n0x0070:0x0070,\n0x0071:0x0071,\n0x0072:0x0072,\n0x0073:0x0073,\n0x0074:0x0074,\n0x0075:0x0075,\n0x0076:0x0076,\n0x0077:0x0077,\n0x0078:0x0078,\n0x0079:0x0079,\n0x007a:0x007a,\n0x007b:0x007b,\n0x007c:0x007c,\n0x007d:0x007d,\n0x007e:0x007e,\n0x007f:0x007f,\n0x00a0:0x00ff,\n0x00a1:0x00ad,\n0x00a2:0x00bd,\n0x00a3:0x009c,\n0x00a4:0x00cf,\n0x00a5:0x00be,\n0x00a6:0x00dd,\n0x00a7:0x00f5,\n0x00a8:0x00f9,\n0x00a9:0x00b8,\n0x00aa:0x00a6,\n0x00ab:0x00ae,\n0x00ac:0x00aa,\n0x00ad:0x00f0,\n0x00ae:0x00a9,\n0x00af:0x00ee,\n0x00b0:0x00f8,\n0x00b1:0x00f1,\n0x00b2:0x00fd,\n0x00b3:0x00fc,\n0x00b4:0x00ef,\n0x00b5:0x00e6,\n0x00b6:0x00f4,\n0x00b7:0x00fa,\n0x00b8:0x00f7,\n0x00b9:0x00fb,\n0x00ba:0x00a7,\n0x00bb:0x00af,\n0x00bc:0x00ac,\n0x00bd:0x00ab,\n0x00be:0x00f3,\n0x00bf:0x00a8,\n0x00c0:0x00b7,\n0x00c1:0x00b5,\n0x00c2:0x00b6,\n0x00c3:0x00c7,\n0x00c4:0x008e,\n0x00c5:0x008f,\n0x00c6:0x0092,\n0x00c7:0x0080,\n0x00c8:0x00d4,\n0x00c9:0x0090,\n0x00ca:0x00d2,\n0x00cb:0x00d3,\n0x00cc:0x00de,\n0x00cd:0x00d6,\n0x00ce:0x00d7,\n0x00cf:0x00d8,\n0x00d0:0x00d1,\n0x00d1:0x00a5,\n0x00d2:0x00e3,\n0x00d3:0x00e0,\n0x00d4:0x00e2,\n0x00d5:0x00e5,\n0x00d6:0x0099,\n0x00d7:0x009e,\n0x00d8:0x009d,\n0x00d9:0x00eb,\n0x00da:0x00e9,\n0x00db:0x00ea,\n0x00dc:0x009a,\n0x00dd:0x00ed,\n0x00de:0x00e8,\n0x00df:0x00e1,\n0x00e0:0x0085,\n0x00e1:0x00a0,\n0x00e2:0x0083,\n0x00e3:0x00c6,\n0x00e4:0x0084,\n0x00e5:0x0086,\n0x00e6:0x0091,\n0x00e7:0x0087,\n0x00e8:0x008a,\n0x00e9:0x0082,\n0x00ea:0x0088,\n0x00eb:0x0089,\n0x00ec:0x008d,\n0x00ed:0x00a1,\n0x00ee:0x008c,\n0x00ef:0x008b,\n0x00f0:0x00d0,\n0x00f1:0x00a4,\n0x00f2:0x0095,\n0x00f3:0x00a2,\n0x00f4:0x0093,\n0x00f5:0x00e4,\n0x00f6:0x0094,\n0x00f7:0x00f6,\n0x00f8:0x009b,\n0x00f9:0x0097,\n0x00fa:0x00a3,\n0x00fb:0x0096,\n0x00fc:0x0081,\n0x00fd:0x00ec,\n0x00fe:0x00e7,\n0x00ff:0x0098,\n0x0131:0x00d5,\n0x0192:0x009f,\n0x2017:0x00f2,\n0x2500:0x00c4,\n0x2502:0x00b3,\n0x250c:0x00da,\n0x2510:0x00bf,\n0x2514:0x00c0,\n0x2518:0x00d9,\n0x251c:0x00c3,\n0x2524:0x00b4,\n0x252c:0x00c2,\n0x2534:0x00c1,\n0x253c:0x00c5,\n0x2550:0x00cd,\n0x2551:0x00ba,\n0x2554:0x00c9,\n0x2557:0x00bb,\n0x255a:0x00c8,\n0x255d:0x00bc,\n0x2560:0x00cc,\n0x2563:0x00b9,\n0x2566:0x00cb,\n0x2569:0x00ca,\n0x256c:0x00ce,\n0x2580:0x00df,\n0x2584:0x00dc,\n0x2588:0x00db,\n0x2591:0x00b0,\n0x2592:0x00b1,\n0x2593:0x00b2,\n0x25a0:0x00fe,\n}\n"], "encodings.iso8859_13": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='iso8859-13',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\x80'\n'\\x81'\n'\\x82'\n'\\x83'\n'\\x84'\n'\\x85'\n'\\x86'\n'\\x87'\n'\\x88'\n'\\x89'\n'\\x8a'\n'\\x8b'\n'\\x8c'\n'\\x8d'\n'\\x8e'\n'\\x8f'\n'\\x90'\n'\\x91'\n'\\x92'\n'\\x93'\n'\\x94'\n'\\x95'\n'\\x96'\n'\\x97'\n'\\x98'\n'\\x99'\n'\\x9a'\n'\\x9b'\n'\\x9c'\n'\\x9d'\n'\\x9e'\n'\\x9f'\n'\\xa0'\n'\\u201d'\n'\\xa2'\n'\\xa3'\n'\\xa4'\n'\\u201e'\n'\\xa6'\n'\\xa7'\n'\\xd8'\n'\\xa9'\n'\\u0156'\n'\\xab'\n'\\xac'\n'\\xad'\n'\\xae'\n'\\xc6'\n'\\xb0'\n'\\xb1'\n'\\xb2'\n'\\xb3'\n'\\u201c'\n'\\xb5'\n'\\xb6'\n'\\xb7'\n'\\xf8'\n'\\xb9'\n'\\u0157'\n'\\xbb'\n'\\xbc'\n'\\xbd'\n'\\xbe'\n'\\xe6'\n'\\u0104'\n'\\u012e'\n'\\u0100'\n'\\u0106'\n'\\xc4'\n'\\xc5'\n'\\u0118'\n'\\u0112'\n'\\u010c'\n'\\xc9'\n'\\u0179'\n'\\u0116'\n'\\u0122'\n'\\u0136'\n'\\u012a'\n'\\u013b'\n'\\u0160'\n'\\u0143'\n'\\u0145'\n'\\xd3'\n'\\u014c'\n'\\xd5'\n'\\xd6'\n'\\xd7'\n'\\u0172'\n'\\u0141'\n'\\u015a'\n'\\u016a'\n'\\xdc'\n'\\u017b'\n'\\u017d'\n'\\xdf'\n'\\u0105'\n'\\u012f'\n'\\u0101'\n'\\u0107'\n'\\xe4'\n'\\xe5'\n'\\u0119'\n'\\u0113'\n'\\u010d'\n'\\xe9'\n'\\u017a'\n'\\u0117'\n'\\u0123'\n'\\u0137'\n'\\u012b'\n'\\u013c'\n'\\u0161'\n'\\u0144'\n'\\u0146'\n'\\xf3'\n'\\u014d'\n'\\xf5'\n'\\xf6'\n'\\xf7'\n'\\u0173'\n'\\u0142'\n'\\u015b'\n'\\u016b'\n'\\xfc'\n'\\u017c'\n'\\u017e'\n'\\u2019'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "_svg": [".js", "// creation of an HTML element\nvar $module = (function($B){\n\nvar _b_ = $B.builtins\nvar $TagSumDict = $B.$TagSum.$dict\n\nvar $s=[]\nfor(var $b in _b_) $s.push('var ' + $b +'=_b_[\"'+$b+'\"]')\neval($s.join(';'))\n\nvar $svgNS = \"http://www.w3.org/2000/svg\"\nvar $xlinkNS = \"http://www.w3.org/1999/xlink\"\n\nfunction makeTagDict(tagName){\n // return the dictionary for the class associated with tagName\n var dict = {__class__:$B.$type,\n __name__:tagName\n }\n\n dict.__getattribute__ = function(self, attr){\n if(self.elt.hasAttributeNS(null, attr)){\n return self.elt.getAttributeNS(null,attr)\n }\n if(dict[attr]!==undefined){\n return function(){\n var args = [self].concat(Array.prototype.slice.call(arguments))\n return dict[attr].apply(null, args)\n }\n }\n return $B.DOMNodeDict.__getattribute__(self, attr) \n }\n\n dict.__init__ = function(){\n var $ns=$B.args('__init__',1,{self:null},['self'],\n arguments,{},'args','kw')\n var self = $ns['self']\n var args = $ns['args']\n if(args.length==1){\n var first=args[0]\n if(isinstance(first,[str,int,float])){\n self.elt.appendChild(document.createTextNode(str(first)))\n } else if(first.__class__===$TagSumDict){\n for(var i=0, _len_i = first.children.length; i < _len_i;i++){\n self.elt.appendChild(first.children[i].elt)\n }\n } else { // argument is another DOMNode instance\n try{self.elt.appendChild(first.elt)}\n catch(err){throw ValueError('wrong element '+first)}\n }\n }\n\n // attributes\n var items = _b_.list(_b_.dict.$dict.items($ns['kw']))\n for(var i=0, _len_i = items.length; i < _len_i;i++){\n // keyword arguments\n var arg = items[i][0]\n var value = items[i][1]\n if(arg.toLowerCase().substr(0,2)===\"on\"){ \n // Event binding passed as argument \"onclick\", \"onfocus\"...\n // Better use method bind of DOMNode objects\n var js = '$B.DOMNodeDict.bind(self,\"'\n js += arg.toLowerCase().substr(2)\n eval(js+'\",function(){'+value+'})')\n }else if(arg.toLowerCase()==\"style\"){\n $B.DOMNodeDict.set_style(self,value)\n }else if(arg.toLowerCase().indexOf(\"href\") !== -1){ // xlink:href\n self.elt.setAttributeNS( \"http://www.w3.org/1999/xlink\",\"href\",value)\n } else {\n if(value!==false){\n // option.selected=false sets it to true :-)\n try{\n arg = arg.toLowerCase().replace('_','-')\n self.elt.setAttributeNS(null,arg,value)\n }catch(err){\n throw ValueError(\"can't set attribute \"+arg)\n }\n }\n }\n }\n }\n\n dict.__mro__ = [$B.DOMNodeDict,$B.builtins.object.$dict]\n\n dict.__new__ = function(cls){\n var res = $B.DOMNode(document.createElementNS($svgNS,tagName))\n res.__class__ = cls.$dict\n return res\n }\n \n dict.__setattr__ = function(self, key, value){\n if(self.elt.hasAttributeNS(null, key)){\n self.elt.setAttributeNS(null,key,value)\n }else{\n $B.DOMNodeDict.__setattr__(self, key, value)\n }\n }\n\n return dict\n}\n\n\n// the classes used for tag sums, $TagSum and $TagSumClass \n// are defined in py_dom.js\n\nfunction makeFactory(tagName){\n var factory = function(){\n var res = $B.DOMNode(document.createElementNS($svgNS,tagName))\n res.__class__ = dicts[tagName]\n // apply __init__\n var args = [res]\n for(var i=0, _len_i = arguments.length; i < _len_i;i++){args.push(arguments[i])}\n dicts[tagName].__init__.apply(null,args)\n return res\n }\n factory.__class__=$B.$factory\n factory.$dict = dicts[tagName]\n return factory\n}\n\n// SVG\nvar $svg_tags = ['a',\n'altGlyph',\n'altGlyphDef',\n'altGlyphItem',\n'animate',\n'animateColor',\n'animateMotion',\n'animateTransform',\n'circle',\n'clipPath',\n'color_profile', // instead of color-profile\n'cursor',\n'defs',\n'desc',\n'ellipse',\n'feBlend',\n'foreignObject', //patch to enable foreign objects\n'g',\n'image',\n'line',\n'linearGradient',\n'marker',\n'mask',\n'path',\n'pattern',\n'polygon',\n'polyline',\n'radialGradient',\n'rect',\n'set',\n'stop',\n'svg',\n'text',\n'tref',\n'tspan',\n'use']\n\n// create classes\nvar obj = new Object()\nvar dicts = {}\nfor(var i=0, _len_i = $svg_tags.length; i < _len_i;i++){\n var tag = $svg_tags[i]\n dicts[tag]=makeTagDict(tag)\n obj[tag] = makeFactory(tag)\n dicts[tag].$factory = obj[tag]\n}\nreturn obj\n})(__BRYTHON__)\n"], "_base64": [".js", "var $module=(function($B){\n\nvar _b_ = $B.builtins,\n _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"\n\nfunction make_alphabet(altchars){\n var alphabet = _keyStr\n if(altchars!==undefined && altchars!==_b_.None){\n // altchars is an instance of Python bytes\n var source = altchars.source\n alphabet = alphabet.substr(0,alphabet.length-3)+\n _b_.chr(source[0])+_b_.chr(source[1])+'='\n }\n return alphabet\n}\n\nvar Base64 = {\n\n encode: function(bytes, altchars) {\n\n var input = bytes.source\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n\n var alphabet = make_alphabet(altchars)\n\n while (i < input.length) {\n\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output + alphabet.charAt(enc1) + \n alphabet.charAt(enc2) + \n alphabet.charAt(enc3) + \n alphabet.charAt(enc4);\n\n }\n return _b_.bytes(output, 'utf-8', 'strict');\n },\n\n\n decode: function(bytes, altchars, validate) {\n var output = [];\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n \n var alphabet = make_alphabet(altchars)\n \n var input = bytes.source\n\n // If validate is set, check that all characters in input\n // are in the alphabet\n var _input = ''\n for(var i=0, len=input.length;i> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output.push(chr1);\n\n if (enc3 != 64) {\n output.push(chr2);\n }\n if (enc4 != 64) {\n output.push(chr3);\n }\n\n }\n // return Python bytes\n return _b_.bytes(output, 'utf-8', 'strict')\n\n },\n\n _utf8_encode: function(string) {\n string = string.replace(/\\r\\n/g, \"\\n\");\n var utftext = \"\";\n\n for (var n = 0; n < string.length; n++) {\n\n var c = string.charCodeAt(n);\n\n if (c < 128) {\n utftext += String.fromCharCode(c);\n }\n else if ((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n\n }\n\n return utftext;\n },\n\n _utf8_decode: function(utftext) {\n var string = \"\";\n var i = 0;\n var c = c1 = c2 = 0;\n\n while (i < utftext.length) {\n\n c = utftext.charCodeAt(i);\n\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n }\n else if ((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n\n }\n\n return string;\n }\n\n}\n\nreturn {Base64:Base64}\n}\n\n)(__BRYTHON__)"], "random": [".js", "// Javascript implementation of the random module\n// Based on Ian Bicking's implementation of the Mersenne twister\n\nvar $module = (function($B){\n\n_b_ = $B.builtins\n\nvar VERSION = 3\n\n// Code copied from https://github.com/ianb/whrandom/blob/master/mersenne.js\n// by Ian Bicking\n\n// this program is a JavaScript version of Mersenne Twister,\n// a straight conversion from the original program, mt19937ar.c,\n// translated by y. okada on july 17, 2006.\n// and modified a little at july 20, 2006, but there are not any substantial differences.\n// modularized by Ian Bicking, March 25, 2013 (found original version at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/JAVASCRIPT/java-script.html)\n// in this program, procedure descriptions and comments of original source code were not removed.\n// lines commented with //c// were originally descriptions of c procedure. and a few following lines are appropriate JavaScript descriptions.\n// lines commented with /* and */ are original comments.\n// lines commented with // are additional comments in this JavaScript version.\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n\n Before using, initialize the state by using init_genrand(seed)\n or init_by_array(init_key, key_length).\n\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nfunction RandomStream(seed) {\n\n /*jshint bitwise:false */\n /* Period parameters */\n //c//#define N 624\n //c//#define M 397\n //c//#define MATRIX_A 0x9908b0dfUL /* constant vector a */\n //c//#define UPPER_MASK 0x80000000UL /* most significant w-r bits */\n //c//#define LOWER_MASK 0x7fffffffUL /* least significant r bits */\n var N = 624;\n var M = 397;\n var MATRIX_A = 0x9908b0df; /* constant vector a */\n var UPPER_MASK = 0x80000000; /* most significant w-r bits */\n var LOWER_MASK = 0x7fffffff; /* least significant r bits */\n //c//static unsigned long mt[N]; /* the array for the state vector */\n //c//static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */\n var mt = new Array(N); /* the array for the state vector */\n var mti = N+1; /* mti==N+1 means mt[N] is not initialized */\n\n function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n {\n return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n }\n\n function subtraction32 (n1, n2) // emulates lowerflow of a c 32-bits unsiged integer variable, instead of the operator -. these both arguments must be non-negative integers expressible using unsigned 32 bits.\n {\n return n1 < n2 ? unsigned32((0x100000000 - (n2 - n1)) & 0xffffffff) : n1 - n2;\n }\n\n function addition32 (n1, n2) // emulates overflow of a c 32-bits unsiged integer variable, instead of the operator +. these both arguments must be non-negative integers expressible using unsigned 32 bits.\n {\n return unsigned32((n1 + n2) & 0xffffffff);\n }\n\n function multiplication32 (n1, n2) // emulates overflow of a c 32-bits unsiged integer variable, instead of the operator *. these both arguments must be non-negative integers expressible using unsigned 32 bits.\n {\n var sum = 0;\n for (var i = 0; i < 32; ++i){\n if ((n1 >>> i) & 0x1){\n sum = addition32(sum, unsigned32(n2 << i));\n }\n }\n return sum;\n }\n\n /* initializes mt[N] with a seed */\n //c//void init_genrand(unsigned long s)\n function init_genrand(s) {\n //c//mt[0]= s & 0xffffffff;\n mt[0]= unsigned32(s & 0xffffffff);\n for (mti=1; mti> 30)) + mti);\n addition32(multiplication32(1812433253, unsigned32(mt[mti-1] ^ (mt[mti-1] >>> 30))), mti);\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n //c//mt[mti] &= 0xffffffff;\n mt[mti] = unsigned32(mt[mti] & 0xffffffff);\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n //c//void init_by_array(unsigned long init_key[], int key_length)\n function init_by_array(init_key, key_length) {\n //c//int i, j, k;\n var i, j, k;\n init_genrand(19650218);\n i=1; j=0;\n k = (N>key_length ? N : key_length);\n for (; k; k--) {\n //c//mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525))\n //c// + init_key[j] + j; /* non linear */\n mt[i] = addition32(addition32(unsigned32(mt[i] ^ multiplication32(unsigned32(mt[i-1] ^ (mt[i-1] >>> 30)), 1664525)), init_key[j]), j);\n mt[i] =\n //c//mt[i] &= 0xffffffff; /* for WORDSIZE > 32 machines */\n unsigned32(mt[i] & 0xffffffff);\n i++; j++;\n if (i>=N) { mt[0] = mt[N-1]; i=1; }\n if (j>=key_length) {\n j=0;\n }\n }\n for (k=N-1; k; k--) {\n //c//mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941))\n //c//- i; /* non linear */\n mt[i] = subtraction32(unsigned32((mt[i]) ^ multiplication32(unsigned32(mt[i-1] ^ (mt[i-1] >>> 30)), 1566083941)), i);\n //c//mt[i] &= 0xffffffff; /* for WORDSIZE > 32 machines */\n mt[i] = unsigned32(mt[i] & 0xffffffff);\n i++;\n if (i>=N) { mt[0] = mt[N-1]; i=1; }\n }\n mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n //c//unsigned long genrand_int32(void)\n function genrand_int32() {\n //c//unsigned long y;\n //c//static unsigned long mag01[2]={0x0UL, MATRIX_A};\n var y;\n var mag01 = [0x0, MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (mti >= N) { /* generate N words at one time */\n //c//int kk;\n var kk;\n\n if (mti == N+1) { /* if init_genrand() has not been called, */\n init_genrand(Date.now()); /* a default initial seed is used */\n }\n\n for (kk=0;kk> 1) ^ mag01[y & 0x1];\n y = unsigned32((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK));\n mt[kk] = unsigned32(mt[kk+M] ^ (y >>> 1) ^ mag01[y & 0x1]);\n }\n for (;kk> 1) ^ mag01[y & 0x1];\n y = unsigned32((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK));\n mt[kk] = unsigned32(mt[kk+(M-N)] ^ (y >>> 1) ^ mag01[y & 0x1]);\n }\n //c//y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);\n //c//mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1];\n y = unsigned32((mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK));\n mt[N-1] = unsigned32(mt[M-1] ^ (y >>> 1) ^ mag01[y & 0x1]);\n mti = 0;\n }\n\n y = mt[mti++];\n\n /* Tempering */\n //c//y ^= (y >> 11);\n //c//y ^= (y << 7) & 0x9d2c5680;\n //c//y ^= (y << 15) & 0xefc60000;\n //c//y ^= (y >> 18);\n y = unsigned32(y ^ (y >>> 11));\n y = unsigned32(y ^ ((y << 7) & 0x9d2c5680));\n y = unsigned32(y ^ ((y << 15) & 0xefc60000));\n y = unsigned32(y ^ (y >>> 18));\n\n return y;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n //c//long genrand_int31(void)\n function genrand_int31() {\n //c//return (genrand_int32()>>1);\n return (genrand_int32()>>>1);\n }\n\n /* generates a random number on [0,1]-real-interval */\n //c//double genrand_real1(void)\n function genrand_real1() {\n return genrand_int32()*(1.0/4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n //c//double genrand_real2(void)\n function genrand_real2() {\n return genrand_int32()*(1.0/4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n //c//double genrand_real3(void)\n function genrand_real3() {\n return ((genrand_int32()) + 0.5)*(1.0/4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n //c//double genrand_res53(void)\n function genrand_res53() {\n //c//unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6;\n var a=genrand_int32()>>>5, b=genrand_int32()>>>6;\n return (a*67108864.0+b)*(1.0/9007199254740992.0);\n }\n /* These real versions are due to Isaku Wada, 2002/01/09 added */\n\n var random = genrand_res53;\n\n random.seed = function (seed) {\n if (! seed) {\n seed = Date.now();\n }\n if (typeof seed != \"number\") {\n seed = parseInt(seed, 10);\n }\n if ((seed !== 0 && ! seed) || isNaN(seed)) {\n throw \"Bad seed\";\n }\n init_genrand(seed);\n };\n\n random.seed(seed);\n\n random.int31 = genrand_int31;\n random.real1 = genrand_real1;\n random.real2 = genrand_real2;\n random.real3 = genrand_real3;\n random.res53 = genrand_res53;\n \n // Added for compatibility with Python\n random.getstate = function(){return [VERSION, mt, mti]}\n \n random.setstate = function(state){\n mt = state[1]\n mti = state[2]\n }\n\n return random;\n\n}\n\nfunction _Random(){\n var _random = RandomStream()\n \n _b_ = $B.builtins\n \n var NV_MAGICCONST = 4 * Math.exp(-0.5)/Math.sqrt(2),\n gauss_next = null\n \n function _randbelow(x){\n return Math.floor(x*_random())\n }\n \n function _urandom(n){\n /*\n urandom(n) -> str\n Return n random bytes suitable for cryptographic use.\n */\n \n var randbytes= []\n for(i=0;i 0 and beta > 0.\n \n The probability distribution function is:\n \n x ** (alpha - 1) * math.exp(-x / beta)\n pdf(x) = --------------------------------------\n math.gamma(alpha) * beta ** alpha\n \n */\n \n // alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2\n \n // Warning: a few older sources define the gamma distribution in terms\n // of alpha > -1.0\n \n var $ = $B.args('gammavariate', 2,\n {alpha:null, beta:null}, ['alpha', 'beta'],\n arguments, {}, null, null),\n alpha = $.alpha,\n beta = $.beta,\n LOG4 = Math.log(4),\n SG_MAGICCONST = 1.0 + Math.log(4.5)\n \n if(alpha <= 0.0 || beta <= 0.0){\n throw _b_.ValueError('gammavariate: alpha and beta must be > 0.0')\n }\n \n if(alpha > 1.0){\n \n // Uses R.C.H. Cheng, \"The generation of Gamma\n // variables with non-integral shape parameters\",\n // Applied Statistics, (1977), 26, No. 1, p71-74\n \n var ainv = Math.sqrt(2.0 * alpha - 1.0),\n bbb = alpha - LOG4,\n ccc = alpha + ainv\n \n while(true){\n var u1 = _random()\n if(!((1e-7 < u1) && (u1 < .9999999))){\n continue\n }\n var u2 = 1.0 - _random(),\n v = Math.log(u1/(1.0-u1))/ainv,\n x = alpha*Math.exp(v),\n z = u1*u1*u2,\n r = bbb+ccc*v-x\n if((r + SG_MAGICCONST - 4.5*z >= 0.0) || r >= Math.log(z)){\n return x * beta\n }\n }\n }else if(alpha == 1.0){\n // expovariate(1)\n var u = _random()\n while(u <= 1e-7){u = _random()}\n return -Math.log(u) * beta\n }else{\n // alpha is between 0 and 1 (exclusive)\n \n // Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentle\n \n while(true){\n var u = _random(),\n b = (Math.E + alpha)/Math.E,\n p = b*u,\n x\n if(p <= 1.0){x = Math.pow(p, (1.0/alpha))}\n else{x = -Math.log((b-p)/alpha)}\n var u1 = _random()\n if(p > 1.0){\n if(u1 <= Math.pow(x, alpha - 1.0)){\n break\n }\n }else if(u1 <= Math.exp(-x)){\n break\n }\n }\n return x * beta\n }\n },\n \n gauss:function(){\n \n /* Gaussian distribution.\n \n mu is the mean, and sigma is the standard deviation. This is\n slightly faster than the normalvariate() function.\n \n Not thread-safe without a lock around calls.\n \n # When x and y are two variables from [0, 1), uniformly\n # distributed, then\n #\n # cos(2*pi*x)*sqrt(-2*log(1-y))\n # sin(2*pi*x)*sqrt(-2*log(1-y))\n #\n # are two *independent* variables with normal distribution\n # (mu = 0, sigma = 1).\n # (Lambert Meertens)\n # (corrected version; bug discovered by Mike Miller, fixed by LM)\n \n # Multithreading note: When two threads call this function\n # simultaneously, it is possible that they will receive the\n # same return value. The window is very small though. To\n # avoid this, you have to use a lock around all calls. (I\n # didn't want to slow this down in the serial case by using a\n # lock here.)\n */\n \n var $ = $B.args('gauss', 2, {mu:null, sigma:null},\n ['mu', 'sigma'], arguments, {}, null, null),\n mu = $.mu,\n sigma = $.sigma\n \n var z = gauss_next\n gauss_next = null\n if(z===null){\n var x2pi = _random() * Math.PI * 2,\n g2rad = Math.sqrt(-2.0 * Math.log(1.0 - _random())),\n z = Math.cos(x2pi) * g2rad\n gauss_next = Math.sin(x2pi) * g2rad\n }\n return mu + z*sigma\n },\n \n getrandbits: function(k){\n var $ = $B.args('getrandbits', 1,\n {k:null},['k'],arguments, {}, null, null),\n k = $B.$GetInt($.k)\n // getrandbits(k) -> x. Generates a long int with k random bits.\n if(k <= 0){\n throw _b_.ValueError('number of bits must be greater than zero')\n }\n if(k != _b_.int(k)){\n throw _b_.TypeError('number of bits should be an integer')\n }\n var numbytes = (k + 7), // bits / 8 and rounded up\n x = _b_.int.$dict.from_bytes(_urandom(numbytes), 'big')\n return _b_.getattr(x, '__rshift__')(\n _b_.getattr(numbytes*8,'__sub__')(k))\n },\n \n getstate: function(){\n // Return internal state; can be passed to setstate() later.\n var $ = $B.args('getstate', 0, {}, [], arguments, {}, null, null)\n return _random.getstate()\n },\n \n normalvariate: function(mu, sigma){\n /*\n Normal distribution.\n \n mu is the mean, and sigma is the standard deviation.\n \n */\n \n // mu = mean, sigma = standard deviation\n \n // Uses Kinderman and Monahan method. Reference: Kinderman,\n // A.J. and Monahan, J.F., \"Computer generation of random\n // variables using the ratio of uniform deviates\", ACM Trans\n // Math Software, 3, (1977), pp257-260.\n \n var $=$B.args('normalvariate', 2,\n {mu:null, sigma:null}, ['mu', 'sigma'],\n arguments, {}, null, null),\n mu = $.mu,\n sigma = $.sigma\n \n while(true){\n var u1 = _random(),\n u2 = 1.0 - _random(),\n z = NV_MAGICCONST*(u1-0.5)/u2,\n zz = z*z/4.0\n if(zz <= -Math.log(u2)){break}\n }\n return mu + z*sigma\n },\n \n paretovariate: function(){\n /* Pareto distribution. alpha is the shape parameter.*/\n // Jain, pg. 495\n \n var $ = $B.args('paretovariate', 1, {alpha:null}, ['alpha'],\n arguments, {}, null, null)\n \n var u = 1 - _random()\n return 1 / Math.pow(u,1/$.alpha)\n },\n \n randint: function(a, b){\n var $ = $B.args('randint', 2,\n {a:null, b:null},\n ['a', 'b'],\n arguments, {}, null, null)\n return parseInt(_random()*($.b-$.a+1)+$.a)\n },\n \n random: _random,\n \n randrange: function(){\n var $ = $B.args('randrange', 3,\n {x:null, stop:null, step:null},\n ['x', 'stop', 'step'],\n arguments, {stop:null, step:null}, null, null)\n if($.stop===null){\n var start = 0, stop = $.x, step = 1\n }else{\n var start = $.x, stop = $.stop, \n step = $.step===null ? 1 : $.step\n if(step==0){throw _b_.ValueError('step cannot be 0')}\n }\n if(typeof start=='number' && typeof stop == 'number' &&\n typeof step=='number'){\n return start+step*Math.floor(_random()*Math.floor((stop-start)/step))\n }else{\n var d = _b_.getattr(stop,'__sub__')(start)\n d = _b_.getattr(d, '__floordiv__')(step)\n // Force d to be a LongInt\n d = $B.LongInt(d)\n // d is a long integer with n digits ; to choose a random number\n // between 0 and d the most simple is to take a random digit\n // at each position, except the first one\n var s = d.value, _len = s.length,\n res = Math.floor(_random()*(parseInt(s.charAt(0))+(_len==1 ? 0 : 1)))+''\n var same_start = res.charAt(0)==s.charAt(0)\n for(var i=1;i<_len;i++){\n if(same_start){\n // If it's the last digit, don't allow stop as valid\n if(i==_len-1){\n res += Math.floor(_random()*parseInt(s.charAt(i)))+''\n }else{\n res += Math.floor(_random()*(parseInt(s.charAt(i))+1))+''\n same_start = res.charAt(i)==s.charAt(i)\n }\n }else{\n res += Math.floor(_random()*10)+''\n }\n }\n var offset = {__class__:$B.LongInt.$dict, value: res, \n pos: true}\n d = _b_.getattr(step, '__mul__')(offset)\n d = _b_.getattr(start, '__add__')(d)\n return _b_.int(d)\n }\n },\n \n sample: function(){\n /*\n Chooses k unique random elements from a population sequence or set.\n \n Returns a new list containing elements from the population while\n leaving the original population unchanged. The resulting list is\n in selection order so that all sub-slices will also be valid random\n samples. This allows raffle winners (the sample) to be partitioned\n into grand prize and second place winners (the subslices).\n \n Members of the population need not be hashable or unique. If the\n population contains repeats, then each occurrence is a possible\n selection in the sample.\n \n To choose a sample in a range of integers, use range as an argument.\n This is especially fast and space efficient for sampling from a\n large population: sample(range(10000000), 60)\n \n # Sampling without replacement entails tracking either potential\n # selections (the pool) in a list or previous selections in a set.\n \n # When the number of selections is small compared to the\n # population, then tracking selections is efficient, requiring\n # only a small set and an occasional reselection. For\n # a larger number of selections, the pool tracking method is\n # preferred since the list takes less space than the\n # set and it doesn't suffer from frequent reselections.'\n \n */\n var $ = $B.args('sample',2,{population:null,k:null},\n ['population','k'], arguments,{},null,null),\n population = $.population,\n k = $.k\n \n if(!_b_.hasattr(population, '__len__')){\n throw _b_.TypeError(\"Population must be a sequence or set. For dicts, use list(d).\")\n }\n var n = _b_.getattr(population, '__len__')()\n \n if(k<0 || k>n){\n throw _b_.ValueError(\"Sample larger than population\")\n }\n var result = [],\n setsize = 21 // size of a small set minus size of an empty list\n if(k > 5){\n setsize += Math.pow(4, Math.ceil(Math.log(k * 3, 4))) // table size for big sets\n }\n if(n <= setsize){\n // An n-length list is smaller than a k-length set\n if(Array.isArray(population)){\n var pool = population.slice()\n }else{var pool = _b_.list(population)}\n for(var i=0;istate.length){\n throw _b_.ValueError(\"too many values to unpack (expected \"+\n state.length+\")\")\n }\n if($.state[0]!=3){\n throw _b_.ValueError(\"ValueError: state with version \"+\n $.state[0]+\" passed to Random.setstate() of version 3\")\n }\n var second = _b_.list($.state[1])\n if(second.length!==state[1].length){\n throw _b_.ValueError('state vector is the wrong size')\n }\n for(var i=0;i shuffle list x in place; return None.\n \n Optional arg random is a 0-argument function returning a random\n float in [0.0, 1.0); by default, the standard random.random.\n */\n \n var $ = $B.args('shuffle',2,{x:null,random:null},\n ['x','random'],\n arguments,{random:null},null,null),\n x = $.x,\n random = $.random\n \n if(random===null){random=_random}\n \n if(Array.isArray(x)){\n for(var i=x.length-1;i>=0;i--){\n var j = Math.floor(random() * (i+1)),\n temp = x[j]\n x[j] = x[i]\n x[i] = temp\n }\n }else{\n var len = _b_.getattr(x, '__len__')(), temp,\n x_get = _b_.getattr(x, '__getitem__'),\n x_set = _b_.getattr(x, '__setitem__')\n \n for(i=len-1;i>=0;i--){\n var j = Math.floor(random() * (i+1)),\n temp = x_get(j)\n x_set(j, x_get(i))\n x_set(i, temp)\n }\n }\n },\n \n triangular: function(){\n /*\n Triangular distribution.\n \n Continuous distribution bounded by given lower and upper limits,\n and having a given mode value in-between.\n \n http://en.wikipedia.org/wiki/Triangular_distribution\n */\n var $=$B.args('triangular',3,\n {low:null, high:null, mode:null},\n ['low', 'high', 'mode'],\n arguments,{low:0, high:1, mode:null}, null, null),\n low = $.low,\n high = $.high,\n mode = $.mode\n \n var u = _random(),\n c = mode===null ? 0.5 : (mode - low) / (high - low)\n if(u > c){\n u = 1 - u\n c = 1 - c\n var temp = low\n low = high\n high = temp\n }\n return low + (high - low) * Math.pow(u * c, 0.5)\n },\n \n uniform: function(){\n var $ = $B.args('uniform',2,{a:null,b:null},['a','b'],\n arguments,{},null,null),\n a = $B.$GetInt($.a),\n b = $B.$GetInt($.b)\n \n return a + (b-a)*_random()\n },\n \n vonmisesvariate: function(mu, kappa){\n /* Circular data distribution.\n \n mu is the mean angle, expressed in radians between 0 and 2*pi, and\n kappa is the concentration parameter, which must be greater than or\n equal to zero. If kappa is equal to zero, this distribution reduces\n to a uniform random angle over the range 0 to 2*pi.\n \n */\n // mu: mean angle (in radians between 0 and 2*pi)\n // kappa: concentration parameter kappa (>= 0)\n // if kappa = 0 generate uniform random angle\n \n // Based upon an algorithm published in: Fisher, N.I.,\n // \"Statistical Analysis of Circular Data\", Cambridge\n // University Press, 1993.\n \n // Thanks to Magnus Kessler for a correction to the\n // implementation of step 4.\n \n var $=$B.args('vonmisesvariate', 2,\n {mu: null, kappa:null}, ['mu', 'kappa'],\n arguments, {}, null, null),\n mu = $.mu,\n kappa = $.kappa,\n TWOPI = 2*Math.PI\n \n if(kappa <= 1e-6){return TWOPI * _random()}\n \n var s = 0.5 / kappa,\n r = s + Math.sqrt(1.0 + s * s)\n \n while(true){\n var u1 = _random(),\n z = Math.cos(Math.PI * u1),\n d = z / (r + z),\n u2 = _random()\n if((u2 < 1.0 - d * d) || \n (u2 <= (1.0 - d) * Math.exp(d))){\n break\n }\n }\n var q = 1.0 / r,\n f = (q + z) / (1.0 + q * z),\n u3 = _random()\n if(u3 > 0.5){var theta = (mu + Math.acos(f)) % TWOPI}\n else{var theta = (mu - Math.acos(f)) % TWOPI}\n return theta\n },\n \n weibullvariate: function(){\n /*Weibull distribution.\n \n alpha is the scale parameter and beta is the shape parameter.\n \n */\n // Jain, pg. 499; bug fix courtesy Bill Arms\n \n var $ = $B.args('weibullvariate', 2, {alpha:null, beta:null},\n ['alpha', 'beta'], arguments, {}, null, null),\n alpha = $.alpha,\n beta = $.beta\n \n var u = 1 - _random()\n return alpha * Math.pow(-Math.log(u), 1/beta)\n },\n \n VERSION: VERSION\n }\n\n res.lognormvariate = function(){\n /*\n Log normal distribution.\n \n If you take the natural logarithm of this distribution, you'll get a\n normal distribution with mean mu and standard deviation sigma.\n mu can have any value, and sigma must be greater than zero.\n \n */\n \n return Math.exp(res.normalvariate.apply(null, arguments))\n }\n \n res.betavariate = function(){\n /* Beta distribution.\n \n Conditions on the parameters are alpha > 0 and beta > 0.\n Returned values range between 0 and 1.\n \n \n # This version due to Janne Sinkkonen, and matches all the std\n # texts (e.g., Knuth Vol 2 Ed 3 pg 134 \"the beta distribution\").\n */\n \n var $ = $B.args('betavariate', 2, {alpha:null, beta:null},\n ['alpha', 'beta'], arguments, {}, null, null),\n alpha = $.alpha,\n beta = $.beta\n \n var y = res.gammavariate(alpha, 1)\n if(y == 0){return _b_.float(0)}\n else{return y / (y + res.gammavariate(beta, 1))}\n }\n \n return res\n\n}\n\nfunction Random(){\n var obj = {__class__: Random.$dict}\n Random.$dict.__init__(obj)\n return obj\n}\nRandom.__class__ = $B.$factory\nRandom.$dict = {\n __class__: $B.$type,\n __name__: 'Random',\n $factory: Random,\n __init__: function(self){self.$r = _Random()},\n __getattribute__: function(self, attr){return self.$r[attr]}\n}\nRandom.$dict.__mro__ = [$B.builtins.object.$dict]\n\nvar $module = _Random()\n\n$module.Random = Random\n\n$module.SystemRandom = function(){\n var f = function(){return {__class__:f.$dict}}\n f.__class__ = $B.$factory\n f.$dict = {\n __class__: $B.$type,\n __name__: 'SystemRandom',\n $factory: f,\n __getattribute__: function(){\n throw $B.builtins.NotImplementedError()\n }\n }\n f.$dict.__mro__ = [$B.builtins.object.$dict]\n return f()\n}\n\nreturn $module\n\n})(__BRYTHON__)\n\n"], "encodings.mac_croatian": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='mac-croatian',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\xc4'\n'\\xc5'\n'\\xc7'\n'\\xc9'\n'\\xd1'\n'\\xd6'\n'\\xdc'\n'\\xe1'\n'\\xe0'\n'\\xe2'\n'\\xe4'\n'\\xe3'\n'\\xe5'\n'\\xe7'\n'\\xe9'\n'\\xe8'\n'\\xea'\n'\\xeb'\n'\\xed'\n'\\xec'\n'\\xee'\n'\\xef'\n'\\xf1'\n'\\xf3'\n'\\xf2'\n'\\xf4'\n'\\xf6'\n'\\xf5'\n'\\xfa'\n'\\xf9'\n'\\xfb'\n'\\xfc'\n'\\u2020'\n'\\xb0'\n'\\xa2'\n'\\xa3'\n'\\xa7'\n'\\u2022'\n'\\xb6'\n'\\xdf'\n'\\xae'\n'\\u0160'\n'\\u2122'\n'\\xb4'\n'\\xa8'\n'\\u2260'\n'\\u017d'\n'\\xd8'\n'\\u221e'\n'\\xb1'\n'\\u2264'\n'\\u2265'\n'\\u2206'\n'\\xb5'\n'\\u2202'\n'\\u2211'\n'\\u220f'\n'\\u0161'\n'\\u222b'\n'\\xaa'\n'\\xba'\n'\\u03a9'\n'\\u017e'\n'\\xf8'\n'\\xbf'\n'\\xa1'\n'\\xac'\n'\\u221a'\n'\\u0192'\n'\\u2248'\n'\\u0106'\n'\\xab'\n'\\u010c'\n'\\u2026'\n'\\xa0'\n'\\xc0'\n'\\xc3'\n'\\xd5'\n'\\u0152'\n'\\u0153'\n'\\u0110'\n'\\u2014'\n'\\u201c'\n'\\u201d'\n'\\u2018'\n'\\u2019'\n'\\xf7'\n'\\u25ca'\n'\\uf8ff'\n'\\xa9'\n'\\u2044'\n'\\u20ac'\n'\\u2039'\n'\\u203a'\n'\\xc6'\n'\\xbb'\n'\\u2013'\n'\\xb7'\n'\\u201a'\n'\\u201e'\n'\\u2030'\n'\\xc2'\n'\\u0107'\n'\\xc1'\n'\\u010d'\n'\\xc8'\n'\\xcd'\n'\\xce'\n'\\xcf'\n'\\xcc'\n'\\xd3'\n'\\xd4'\n'\\u0111'\n'\\xd2'\n'\\xda'\n'\\xdb'\n'\\xd9'\n'\\u0131'\n'\\u02c6'\n'\\u02dc'\n'\\xaf'\n'\\u03c0'\n'\\xcb'\n'\\u02da'\n'\\xb8'\n'\\xca'\n'\\xe6'\n'\\u02c7'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "warnings": [".py", "''\n\n\n\n\nimport linecache\nimport sys\n\n__all__=[\"warn\",\"showwarning\",\"formatwarning\",\"filterwarnings\",\n\"resetwarnings\",\"catch_warnings\"]\n\n\ndef showwarning(message,category,filename,lineno,file=None ,line=None ):\n ''\n if file is None :\n file=sys.stderr\n try :\n file.write(formatwarning(message,category,filename,lineno,line))\n except IOError:\n pass\n \ndef formatwarning(message,category,filename,lineno,line=None ):\n ''\n s=\"%s:%s: %s: %s\\n\"%(filename,lineno,category.__name__,message)\n line=linecache.getline(filename,lineno)if line is None else line\n if line:\n line=line.strip()\n s +=\" %s\\n\"%line\n return s\n \ndef filterwarnings(action,message=\"\",category=Warning,module=\"\",lineno=0,\nappend=False ):\n ''\n\n\n\n\n\n\n\n\n \n import re\n assert action in (\"error\",\"ignore\",\"always\",\"default\",\"module\",\n \"once\"),\"invalid action: %r\"%(action,)\n assert isinstance(message,str),\"message must be a string\"\n assert isinstance(category,type),\"category must be a class\"\n assert issubclass(category,Warning),\"category must be a Warning subclass\"\n assert isinstance(module,str),\"module must be a string\"\n assert isinstance(lineno,int)and lineno >=0, \"lineno must be an int >= 0\"\n item=(action,re.compile(message,re.I),category,\n re.compile(module),lineno)\n if append:\n filters.append(item)\n else :\n filters.insert(0,item)\n \ndef simplefilter(action,category=Warning,lineno=0,append=False ):\n ''\n\n\n\n\n\n\n\n \n assert action in (\"error\",\"ignore\",\"always\",\"default\",\"module\",\n \"once\"),\"invalid action: %r\"%(action,)\n assert isinstance(lineno,int)and lineno >=0, \"lineno must be an int >= 0\"\n item=(action,None ,category,None ,lineno)\n if append:\n filters.append(item)\n else :\n filters.insert(0,item)\n \ndef resetwarnings():\n ''\n filters[:]=[]\n \nclass _OptionError(Exception):\n ''\n pass\n \n \ndef _processoptions(args):\n for arg in args:\n try :\n _setoption(arg)\n except _OptionError as msg:\n print(\"Invalid -W option ignored:\",msg,file=sys.stderr)\n \n \ndef _setoption(arg):\n import re\n parts=arg.split(':')\n if len(parts)>5:\n raise _OptionError(\"too many fields (max 5): %r\"%(arg,))\n while len(parts)<5:\n parts.append('')\n action,message,category,module,lineno=[s.strip()\n for s in parts]\n action=_getaction(action)\n message=re.escape(message)\n category=_getcategory(category)\n module=re.escape(module)\n if module:\n module=module+'$'\n if lineno:\n try :\n lineno=int(lineno)\n if lineno <0:\n raise ValueError\n except (ValueError,OverflowError):\n raise _OptionError(\"invalid lineno %r\"%(lineno,))\n else :\n lineno=0\n filterwarnings(action,message,category,module,lineno)\n \n \ndef _getaction(action):\n if not action:\n return\"default\"\n if action ==\"all\":return\"always\"\n for a in ('default','always','ignore','module','once','error'):\n if a.startswith(action):\n return a\n raise _OptionError(\"invalid action: %r\"%(action,))\n \n \ndef _getcategory(category):\n import re\n if not category:\n return Warning\n if re.match(\"^[a-zA-Z0-9_]+$\",category):\n try :\n cat=eval(category)\n except NameError:\n raise _OptionError(\"unknown warning category: %r\"%(category,))\n else :\n i=category.rfind(\".\")\n module=category[:i]\n klass=category[i+1:]\n try :\n m=__import__(module,None ,None ,[klass])\n except ImportError:\n raise _OptionError(\"invalid module name: %r\"%(module,))\n try :\n cat=getattr(m,klass)\n except AttributeError:\n raise _OptionError(\"unknown warning category: %r\"%(category,))\n if not issubclass(cat,Warning):\n raise _OptionError(\"invalid warning category: %r\"%(category,))\n return cat\n \n \n \ndef warn(message,category=None ,stacklevel=1):\n ''\n \n if isinstance(message,Warning):\n category=message.__class__\n \n if category is None :\n category=UserWarning\n assert issubclass(category,Warning)\n \n try :\n caller=sys._getframe(stacklevel)\n except ValueError:\n globals=sys.__dict__\n lineno=1\n else :\n globals=caller.f_globals\n lineno=caller.f_lineno\n if'__name__'in globals:\n module=globals['__name__']\n else :\n module=\"\"\n filename=globals.get('__file__')\n if filename:\n fnl=filename.lower()\n if fnl.endswith((\".pyc\",\".pyo\")):\n filename=filename[:-1]\n else :\n if module ==\"__main__\":\n try :\n filename=sys.argv[0]\n except AttributeError:\n \n filename='__main__'\n if not filename:\n filename=module\n registry=globals.setdefault(\"__warningregistry__\",{})\n warn_explicit(message,category,filename,lineno,module,registry,\n globals)\n \ndef warn_explicit(message,category,filename,lineno,\nmodule=None ,registry=None ,module_globals=None ):\n lineno=int(lineno)\n if module is None :\n module=filename or\"\"\n if module[-3:].lower()==\".py\":\n module=module[:-3]\n if registry is None :\n registry={}\n if isinstance(message,Warning):\n text=str(message)\n category=message.__class__\n else :\n text=message\n message=category(message)\n key=(text,category,lineno)\n \n if registry.get(key):\n return\n \n for item in filters:\n action,msg,cat,mod,ln=item\n if ((msg is None or msg.match(text))and\n issubclass(category,cat)and\n (mod is None or mod.match(module))and\n (ln ==0 or lineno ==ln)):\n break\n else :\n action=defaultaction\n \n if action ==\"ignore\":\n registry[key]=1\n return\n \n \n \n linecache.getlines(filename,module_globals)\n \n if action ==\"error\":\n raise message\n \n if action ==\"once\":\n registry[key]=1\n oncekey=(text,category)\n if onceregistry.get(oncekey):\n return\n onceregistry[oncekey]=1\n elif action ==\"always\":\n pass\n elif action ==\"module\":\n registry[key]=1\n altkey=(text,category,0)\n if registry.get(altkey):\n return\n registry[altkey]=1\n elif action ==\"default\":\n registry[key]=1\n else :\n \n raise RuntimeError(\n \"Unrecognized action (%r) in warnings.filters:\\n %s\"%\n (action,item))\n if not callable(showwarning):\n raise TypeError(\"warnings.showwarning() must be set to a \"\n \"function or method\")\n \n showwarning(message,category,filename,lineno)\n \n \nclass WarningMessage(object):\n\n ''\n \n _WARNING_DETAILS=(\"message\",\"category\",\"filename\",\"lineno\",\"file\",\n \"line\")\n \n def __init__(self,message,category,filename,lineno,file=None ,\n line=None ):\n local_values=locals()\n for attr in self._WARNING_DETAILS:\n setattr(self,attr,local_values[attr])\n self._category_name=category.__name__ if category else None\n \n def __str__(self):\n return (\"{message : %r, category : %r, filename : %r, lineno : %s, \"\n \"line : %r}\"%(self.message,self._category_name,\n self.filename,self.lineno,self.line))\n \n \nclass catch_warnings(object):\n\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n def __init__(self,*,record=False ,module=None ):\n ''\n\n\n\n\n\n \n self._record=record\n self._module=sys.modules['warnings']if module is None else module\n self._entered=False\n \n def __repr__(self):\n args=[]\n if self._record:\n args.append(\"record=True\")\n if self._module is not sys.modules['warnings']:\n args.append(\"module=%r\"%self._module)\n name=type(self).__name__\n return\"%s(%s)\"%(name,\", \".join(args))\n \n def __enter__(self):\n if self._entered:\n raise RuntimeError(\"Cannot enter %r twice\"%self)\n self._entered=True\n self._filters=self._module.filters\n self._module.filters=self._filters[:]\n self._showwarning=self._module.showwarning\n if self._record:\n log=[]\n def showwarning(*args,**kwargs):\n log.append(WarningMessage(*args,**kwargs))\n self._module.showwarning=showwarning\n return log\n else :\n return None\n \n def __exit__(self,*exc_info):\n if not self._entered:\n raise RuntimeError(\"Cannot exit %r without entering first\"%self)\n self._module.filters=self._filters\n self._module.showwarning=self._showwarning\n \n \n \n \n \n \n \n \n \n \n_warnings_defaults=False\ntry :\n from _warnings import (filters,_defaultaction,_onceregistry,\n warn,warn_explicit)\n defaultaction=_defaultaction\n onceregistry=_onceregistry\n _warnings_defaults=True\nexcept ImportError:\n filters=[]\n defaultaction=\"default\"\n onceregistry={}\n \n \n \n_processoptions(sys.warnoptions)\nif not _warnings_defaults:\n silence=[ImportWarning,PendingDeprecationWarning]\n silence.append(DeprecationWarning)\n for cls in silence:\n simplefilter(\"ignore\",category=cls)\n bytes_warning=sys.flags.bytes_warning\n if bytes_warning >1:\n bytes_action=\"error\"\n elif bytes_warning:\n bytes_action=\"default\"\n else :\n bytes_action=\"ignore\"\n simplefilter(bytes_action,category=BytesWarning,append=1)\n \n if hasattr(sys,'gettotalrefcount'):\n resource_action=\"always\"\n else :\n resource_action=\"ignore\"\n simplefilter(resource_action,category=ResourceWarning,append=1)\n \ndel _warnings_defaults\n"], "encodings.iso8859_7": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='iso8859-7',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\x80'\n'\\x81'\n'\\x82'\n'\\x83'\n'\\x84'\n'\\x85'\n'\\x86'\n'\\x87'\n'\\x88'\n'\\x89'\n'\\x8a'\n'\\x8b'\n'\\x8c'\n'\\x8d'\n'\\x8e'\n'\\x8f'\n'\\x90'\n'\\x91'\n'\\x92'\n'\\x93'\n'\\x94'\n'\\x95'\n'\\x96'\n'\\x97'\n'\\x98'\n'\\x99'\n'\\x9a'\n'\\x9b'\n'\\x9c'\n'\\x9d'\n'\\x9e'\n'\\x9f'\n'\\xa0'\n'\\u2018'\n'\\u2019'\n'\\xa3'\n'\\u20ac'\n'\\u20af'\n'\\xa6'\n'\\xa7'\n'\\xa8'\n'\\xa9'\n'\\u037a'\n'\\xab'\n'\\xac'\n'\\xad'\n'\\ufffe'\n'\\u2015'\n'\\xb0'\n'\\xb1'\n'\\xb2'\n'\\xb3'\n'\\u0384'\n'\\u0385'\n'\\u0386'\n'\\xb7'\n'\\u0388'\n'\\u0389'\n'\\u038a'\n'\\xbb'\n'\\u038c'\n'\\xbd'\n'\\u038e'\n'\\u038f'\n'\\u0390'\n'\\u0391'\n'\\u0392'\n'\\u0393'\n'\\u0394'\n'\\u0395'\n'\\u0396'\n'\\u0397'\n'\\u0398'\n'\\u0399'\n'\\u039a'\n'\\u039b'\n'\\u039c'\n'\\u039d'\n'\\u039e'\n'\\u039f'\n'\\u03a0'\n'\\u03a1'\n'\\ufffe'\n'\\u03a3'\n'\\u03a4'\n'\\u03a5'\n'\\u03a6'\n'\\u03a7'\n'\\u03a8'\n'\\u03a9'\n'\\u03aa'\n'\\u03ab'\n'\\u03ac'\n'\\u03ad'\n'\\u03ae'\n'\\u03af'\n'\\u03b0'\n'\\u03b1'\n'\\u03b2'\n'\\u03b3'\n'\\u03b4'\n'\\u03b5'\n'\\u03b6'\n'\\u03b7'\n'\\u03b8'\n'\\u03b9'\n'\\u03ba'\n'\\u03bb'\n'\\u03bc'\n'\\u03bd'\n'\\u03be'\n'\\u03bf'\n'\\u03c0'\n'\\u03c1'\n'\\u03c2'\n'\\u03c3'\n'\\u03c4'\n'\\u03c5'\n'\\u03c6'\n'\\u03c7'\n'\\u03c8'\n'\\u03c9'\n'\\u03ca'\n'\\u03cb'\n'\\u03cc'\n'\\u03cd'\n'\\u03ce'\n'\\ufffe'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "encodings.mac_greek": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='mac-greek',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\xc4'\n'\\xb9'\n'\\xb2'\n'\\xc9'\n'\\xb3'\n'\\xd6'\n'\\xdc'\n'\\u0385'\n'\\xe0'\n'\\xe2'\n'\\xe4'\n'\\u0384'\n'\\xa8'\n'\\xe7'\n'\\xe9'\n'\\xe8'\n'\\xea'\n'\\xeb'\n'\\xa3'\n'\\u2122'\n'\\xee'\n'\\xef'\n'\\u2022'\n'\\xbd'\n'\\u2030'\n'\\xf4'\n'\\xf6'\n'\\xa6'\n'\\u20ac'\n'\\xf9'\n'\\xfb'\n'\\xfc'\n'\\u2020'\n'\\u0393'\n'\\u0394'\n'\\u0398'\n'\\u039b'\n'\\u039e'\n'\\u03a0'\n'\\xdf'\n'\\xae'\n'\\xa9'\n'\\u03a3'\n'\\u03aa'\n'\\xa7'\n'\\u2260'\n'\\xb0'\n'\\xb7'\n'\\u0391'\n'\\xb1'\n'\\u2264'\n'\\u2265'\n'\\xa5'\n'\\u0392'\n'\\u0395'\n'\\u0396'\n'\\u0397'\n'\\u0399'\n'\\u039a'\n'\\u039c'\n'\\u03a6'\n'\\u03ab'\n'\\u03a8'\n'\\u03a9'\n'\\u03ac'\n'\\u039d'\n'\\xac'\n'\\u039f'\n'\\u03a1'\n'\\u2248'\n'\\u03a4'\n'\\xab'\n'\\xbb'\n'\\u2026'\n'\\xa0'\n'\\u03a5'\n'\\u03a7'\n'\\u0386'\n'\\u0388'\n'\\u0153'\n'\\u2013'\n'\\u2015'\n'\\u201c'\n'\\u201d'\n'\\u2018'\n'\\u2019'\n'\\xf7'\n'\\u0389'\n'\\u038a'\n'\\u038c'\n'\\u038e'\n'\\u03ad'\n'\\u03ae'\n'\\u03af'\n'\\u03cc'\n'\\u038f'\n'\\u03cd'\n'\\u03b1'\n'\\u03b2'\n'\\u03c8'\n'\\u03b4'\n'\\u03b5'\n'\\u03c6'\n'\\u03b3'\n'\\u03b7'\n'\\u03b9'\n'\\u03be'\n'\\u03ba'\n'\\u03bb'\n'\\u03bc'\n'\\u03bd'\n'\\u03bf'\n'\\u03c0'\n'\\u03ce'\n'\\u03c1'\n'\\u03c3'\n'\\u03c4'\n'\\u03b8'\n'\\u03c9'\n'\\u03c2'\n'\\u03c7'\n'\\u03c5'\n'\\u03b6'\n'\\u03ca'\n'\\u03cb'\n'\\u0390'\n'\\u03b0'\n'\\xad'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "asyncio.subprocess": [".py", "__all__=['create_subprocess_exec','create_subprocess_shell']\n\nimport collections\nimport subprocess\n\nfrom .import events\nfrom .import futures\nfrom .import protocols\nfrom .import streams\nfrom .import tasks\nfrom .coroutines import coroutine\nfrom .log import logger\n\n\nPIPE=subprocess.PIPE\nSTDOUT=subprocess.STDOUT\nDEVNULL=subprocess.DEVNULL\n\n\nclass SubprocessStreamProtocol(streams.FlowControlMixin,\nprotocols.SubprocessProtocol):\n ''\n \n def __init__(self,limit,loop):\n super().__init__(loop=loop)\n self._limit=limit\n self.stdin=self.stdout=self.stderr=None\n self._transport=None\n \n def __repr__(self):\n info=[self.__class__.__name__]\n if self.stdin is not None :\n info.append('stdin=%r'%self.stdin)\n if self.stdout is not None :\n info.append('stdout=%r'%self.stdout)\n if self.stderr is not None :\n info.append('stderr=%r'%self.stderr)\n return'<%s>'%' '.join(info)\n \n def connection_made(self,transport):\n self._transport=transport\n \n stdout_transport=transport.get_pipe_transport(1)\n if stdout_transport is not None :\n self.stdout=streams.StreamReader(limit=self._limit,\n loop=self._loop)\n self.stdout.set_transport(stdout_transport)\n \n stderr_transport=transport.get_pipe_transport(2)\n if stderr_transport is not None :\n self.stderr=streams.StreamReader(limit=self._limit,\n loop=self._loop)\n self.stderr.set_transport(stderr_transport)\n \n stdin_transport=transport.get_pipe_transport(0)\n if stdin_transport is not None :\n self.stdin=streams.StreamWriter(stdin_transport,\n protocol=self,\n reader=None ,\n loop=self._loop)\n \n def pipe_data_received(self,fd,data):\n if fd ==1:\n reader=self.stdout\n elif fd ==2:\n reader=self.stderr\n else :\n reader=None\n if reader is not None :\n reader.feed_data(data)\n \n def pipe_connection_lost(self,fd,exc):\n if fd ==0:\n pipe=self.stdin\n if pipe is not None :\n pipe.close()\n self.connection_lost(exc)\n return\n if fd ==1:\n reader=self.stdout\n elif fd ==2:\n reader=self.stderr\n else :\n reader=None\n if reader !=None :\n if exc is None :\n reader.feed_eof()\n else :\n reader.set_exception(exc)\n \n def process_exited(self):\n self._transport.close()\n self._transport=None\n \n \nclass Process:\n def __init__(self,transport,protocol,loop):\n self._transport=transport\n self._protocol=protocol\n self._loop=loop\n self.stdin=protocol.stdin\n self.stdout=protocol.stdout\n self.stderr=protocol.stderr\n self.pid=transport.get_pid()\n \n def __repr__(self):\n return'<%s %s>'%(self.__class__.__name__,self.pid)\n \n @property\n def returncode(self):\n return self._transport.get_returncode()\n \n @coroutine\n def wait(self):\n ''\n\n \n return (yield from self._transport._wait())\n \n def send_signal(self,signal):\n self._transport.send_signal(signal)\n \n def terminate(self):\n self._transport.terminate()\n \n def kill(self):\n self._transport.kill()\n \n @coroutine\n def _feed_stdin(self,input):\n debug=self._loop.get_debug()\n self.stdin.write(input)\n if debug:\n logger.debug('%r communicate: feed stdin (%s bytes)',\n self,len(input))\n try :\n yield from self.stdin.drain()\n except (BrokenPipeError,ConnectionResetError)as exc:\n \n if debug:\n logger.debug('%r communicate: stdin got %r',self,exc)\n \n if debug:\n logger.debug('%r communicate: close stdin',self)\n self.stdin.close()\n \n @coroutine\n def _noop(self):\n return None\n \n @coroutine\n def _read_stream(self,fd):\n transport=self._transport.get_pipe_transport(fd)\n if fd ==2:\n stream=self.stderr\n else :\n assert fd ==1\n stream=self.stdout\n if self._loop.get_debug():\n name='stdout'if fd ==1 else'stderr'\n logger.debug('%r communicate: read %s',self,name)\n output=yield from stream.read()\n if self._loop.get_debug():\n name='stdout'if fd ==1 else'stderr'\n logger.debug('%r communicate: close %s',self,name)\n transport.close()\n return output\n \n @coroutine\n def communicate(self,input=None ):\n if input:\n stdin=self._feed_stdin(input)\n else :\n stdin=self._noop()\n if self.stdout is not None :\n stdout=self._read_stream(1)\n else :\n stdout=self._noop()\n if self.stderr is not None :\n stderr=self._read_stream(2)\n else :\n stderr=self._noop()\n stdin,stdout,stderr=yield from tasks.gather(stdin,stdout,stderr,\n loop=self._loop)\n yield from self.wait()\n return (stdout,stderr)\n \n \n@coroutine\ndef create_subprocess_shell(cmd,stdin=None ,stdout=None ,stderr=None ,\nloop=None ,limit=streams._DEFAULT_LIMIT,**kwds):\n if loop is None :\n loop=events.get_event_loop()\n protocol_factory=lambda :SubprocessStreamProtocol(limit=limit,\n loop=loop)\n transport,protocol=yield from loop.subprocess_shell(\n protocol_factory,\n cmd,stdin=stdin,stdout=stdout,\n stderr=stderr,**kwds)\n return Process(transport,protocol,loop)\n \n@coroutine\ndef create_subprocess_exec(program,*args,stdin=None ,stdout=None ,\nstderr=None ,loop=None ,\nlimit=streams._DEFAULT_LIMIT,**kwds):\n if loop is None :\n loop=events.get_event_loop()\n protocol_factory=lambda :SubprocessStreamProtocol(limit=limit,\n loop=loop)\n transport,protocol=yield from loop.subprocess_exec(\n protocol_factory,\n program,*args,\n stdin=stdin,stdout=stdout,\n stderr=stderr,**kwds)\n return Process(transport,protocol,loop)\n"], "_markupbase": [".py", "''\n\n\n\n\n\n\nimport re\n\n_declname_match=re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\\s*').match\n_declstringlit_match=re.compile(r'(\\'[^\\']*\\'|\"[^\"]*\")\\s*').match\n_commentclose=re.compile(r'--\\s*>')\n_markedsectionclose=re.compile(r']\\s*]\\s*>')\n\n\n\n\n_msmarkedsectionclose=re.compile(r']\\s*>')\n\ndel re\n\n\nclass ParserBase:\n ''\n \n \n def __init__(self):\n if self.__class__ is ParserBase:\n raise RuntimeError(\n \"_markupbase.ParserBase must be subclassed\")\n \n def error(self,message):\n raise NotImplementedError(\n \"subclasses of ParserBase must override error()\")\n \n def reset(self):\n self.lineno=1\n self.offset=0\n \n def getpos(self):\n ''\n return self.lineno,self.offset\n \n \n \n \n \n def updatepos(self,i,j):\n if i >=j:\n return j\n rawdata=self.rawdata\n nlines=rawdata.count(\"\\n\",i,j)\n if nlines:\n self.lineno=self.lineno+nlines\n pos=rawdata.rindex(\"\\n\",i,j)\n self.offset=j -(pos+1)\n else :\n self.offset=self.offset+j -i\n return j\n \n _decl_otherchars=''\n \n \n def parse_declaration(self,i):\n \n \n \n \n \n \n \n \n \n \n rawdata=self.rawdata\n j=i+2\n assert rawdata[i:j]==\"\":\n \n return j+1\n if rawdata[j:j+1]in (\"-\",\"\"):\n \n \n return -1\n \n n=len(rawdata)\n if rawdata[j:j+2]=='--':\n \n return self.parse_comment(i)\n elif rawdata[j]=='[':\n \n \n \n \n return self.parse_marked_section(i)\n else :\n decltype,j=self._scan_name(j,i)\n if j <0:\n return j\n if decltype ==\"doctype\":\n self._decl_otherchars=''\n while j \":\n \n data=rawdata[i+2:j]\n if decltype ==\"doctype\":\n self.handle_decl(data)\n else :\n \n \n \n \n self.unknown_decl(data)\n return j+1\n if c in\"\\\"'\":\n m=_declstringlit_match(rawdata,j)\n if not m:\n return -1\n j=m.end()\n elif c in\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\":\n name,j=self._scan_name(j,i)\n elif c in self._decl_otherchars:\n j=j+1\n elif c ==\"[\":\n \n if decltype ==\"doctype\":\n j=self._parse_doctype_subset(j+1,i)\n elif decltype in {\"attlist\",\"linktype\",\"link\",\"element\"}:\n \n \n \n \n self.error(\"unsupported '[' char in %s declaration\"%decltype)\n else :\n self.error(\"unexpected '[' char in declaration\")\n else :\n self.error(\n \"unexpected %r char in declaration\"%rawdata[j])\n if j <0:\n return j\n return -1\n \n \n \n def parse_marked_section(self,i,report=1):\n rawdata=self.rawdata\n assert rawdata[i:i+3]=='n:\n \n return -1\n if rawdata[j:j+4]==\"\"%text)\n elif tag is ProcessingInstruction:\n write(\"\"%text)\n else :\n tag=qnames[tag]\n if tag is None :\n if text:\n write(_escape_cdata(text))\n for e in elem:\n _serialize_xml(write,e,qnames,None )\n else :\n write(\"<\"+tag)\n items=list(elem.items())\n if items or namespaces:\n if namespaces:\n for v,k in sorted(namespaces.items(),\n key=lambda x:x[1]):\n if k:\n k=\":\"+k\n write(\" xmlns%s=\\\"%s\\\"\"%(\n k,\n _escape_attrib(v)\n ))\n for k,v in sorted(items):\n if isinstance(k,QName):\n k=k.text\n if isinstance(v,QName):\n v=qnames[v.text]\n else :\n v=_escape_attrib(v)\n write(\" %s=\\\"%s\\\"\"%(qnames[k],v))\n if text or len(elem):\n write(\">\")\n if text:\n write(_escape_cdata(text))\n for e in elem:\n _serialize_xml(write,e,qnames,None )\n write(\"\")\n else :\n write(\" />\")\n if elem.tail:\n write(_escape_cdata(elem.tail))\n \nHTML_EMPTY=(\"area\",\"base\",\"basefont\",\"br\",\"col\",\"frame\",\"hr\",\n\"img\",\"input\",\"isindex\",\"link\",\"meta\",\"param\")\n\ntry :\n HTML_EMPTY=set(HTML_EMPTY)\nexcept NameError:\n pass\n \ndef _serialize_html(write,elem,qnames,namespaces):\n tag=elem.tag\n text=elem.text\n if tag is Comment:\n write(\"\"%_escape_cdata(text))\n elif tag is ProcessingInstruction:\n write(\"\"%_escape_cdata(text))\n else :\n tag=qnames[tag]\n if tag is None :\n if text:\n write(_escape_cdata(text))\n for e in elem:\n _serialize_html(write,e,qnames,None )\n else :\n write(\"<\"+tag)\n items=list(elem.items())\n if items or namespaces:\n if namespaces:\n for v,k in sorted(namespaces.items(),\n key=lambda x:x[1]):\n if k:\n k=\":\"+k\n write(\" xmlns%s=\\\"%s\\\"\"%(\n k,\n _escape_attrib(v)\n ))\n for k,v in sorted(items):\n if isinstance(k,QName):\n k=k.text\n if isinstance(v,QName):\n v=qnames[v.text]\n else :\n v=_escape_attrib_html(v)\n \n write(\" %s=\\\"%s\\\"\"%(qnames[k],v))\n write(\">\")\n tag=tag.lower()\n if text:\n if tag ==\"script\"or tag ==\"style\":\n write(text)\n else :\n write(_escape_cdata(text))\n for e in elem:\n _serialize_html(write,e,qnames,None )\n if tag not in HTML_EMPTY:\n write(\"\")\n if elem.tail:\n write(_escape_cdata(elem.tail))\n \ndef _serialize_text(write,elem):\n for part in elem.itertext():\n write(part)\n if elem.tail:\n write(elem.tail)\n \n_serialize={\n\"xml\":_serialize_xml,\n\"html\":_serialize_html,\n\"text\":_serialize_text,\n\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\ndef register_namespace(prefix,uri):\n if re.match(\"ns\\d+$\",prefix):\n raise ValueError(\"Prefix format reserved for internal use\")\n for k,v in list(_namespace_map.items()):\n if k ==uri or v ==prefix:\n del _namespace_map[k]\n _namespace_map[uri]=prefix\n \n_namespace_map={\n\n\"http://www.w3.org/XML/1998/namespace\":\"xml\",\n\"http://www.w3.org/1999/xhtml\":\"html\",\n\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\":\"rdf\",\n\"http://schemas.xmlsoap.org/wsdl/\":\"wsdl\",\n\n\"http://www.w3.org/2001/XMLSchema\":\"xs\",\n\"http://www.w3.org/2001/XMLSchema-instance\":\"xsi\",\n\n\"http://purl.org/dc/elements/1.1/\":\"dc\",\n}\n\nregister_namespace._namespace_map=_namespace_map\n\ndef _raise_serialization_error(text):\n raise TypeError(\n \"cannot serialize %r (type %s)\"%(text,type(text).__name__)\n )\n \ndef _escape_cdata(text):\n\n try :\n \n \n \n if\"&\"in text:\n text=text.replace(\"&\",\"&\")\n if\"<\"in text:\n text=text.replace(\"<\",\"<\")\n if\">\"in text:\n text=text.replace(\">\",\">\")\n return text\n except (TypeError,AttributeError):\n _raise_serialization_error(text)\n \ndef _escape_attrib(text):\n\n try :\n if\"&\"in text:\n text=text.replace(\"&\",\"&\")\n if\"<\"in text:\n text=text.replace(\"<\",\"<\")\n if\">\"in text:\n text=text.replace(\">\",\">\")\n if\"\\\"\"in text:\n text=text.replace(\"\\\"\",\""\")\n if\"\\n\"in text:\n text=text.replace(\"\\n\",\" \")\n return text\n except (TypeError,AttributeError):\n _raise_serialization_error(text)\n \ndef _escape_attrib_html(text):\n\n try :\n if\"&\"in text:\n text=text.replace(\"&\",\"&\")\n if\">\"in text:\n text=text.replace(\">\",\">\")\n if\"\\\"\"in text:\n text=text.replace(\"\\\"\",\""\")\n return text\n except (TypeError,AttributeError):\n _raise_serialization_error(text)\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \ndef tostring(element,encoding=None ,method=None ):\n stream=io.StringIO()if encoding =='unicode'else io.BytesIO()\n ElementTree(element).write(stream,encoding,method=method)\n return stream.getvalue()\n \n \n \n \n \n \n \n \n \n \n \n \n \n \nclass _ListDataStream(io.BufferedIOBase):\n ''\n \n def __init__(self,lst):\n self.lst=lst\n \n def writable(self):\n return True\n \n def seekable(self):\n return True\n \n def write(self,b):\n self.lst.append(b)\n \n def tell(self):\n return len(self.lst)\n \ndef tostringlist(element,encoding=None ,method=None ):\n lst=[]\n stream=_ListDataStream(lst)\n ElementTree(element).write(stream,encoding,method=method)\n return lst\n \n \n \n \n \n \n \n \n \n \ndef dump(elem):\n\n if not isinstance(elem,ElementTree):\n elem=ElementTree(elem)\n elem.write(sys.stdout,encoding=\"unicode\")\n tail=elem.getroot().tail\n if not tail or tail[-1]!=\"\\n\":\n sys.stdout.write(\"\\n\")\n \n \n \n \n \n \n \n \n \n \n \n \ndef parse(source,parser=None ):\n tree=ElementTree()\n tree.parse(source,parser)\n return tree\n \n \n \n \n \n \n \n \n \n \n \n \ndef iterparse(source,events=None ,parser=None ):\n close_source=False\n if not hasattr(source,\"read\"):\n source=open(source,\"rb\")\n close_source=True\n if not parser:\n parser=XMLParser(target=TreeBuilder())\n return _IterParseIterator(source,events,parser,close_source)\n \nclass _IterParseIterator:\n\n def __init__(self,source,events,parser,close_source=False ):\n self._file=source\n self._close_file=close_source\n self._events=[]\n self._index=0\n self._error=None\n self.root=self._root=None\n self._parser=parser\n \n parser=self._parser._parser\n append=self._events.append\n if events is None :\n events=[\"end\"]\n for event in events:\n if event ==\"start\":\n try :\n parser.ordered_attributes=1\n parser.specified_attributes=1\n def handler(tag,attrib_in,event=event,append=append,\n start=self._parser._start_list):\n append((event,start(tag,attrib_in)))\n parser.StartElementHandler=handler\n except AttributeError:\n def handler(tag,attrib_in,event=event,append=append,\n start=self._parser._start):\n append((event,start(tag,attrib_in)))\n parser.StartElementHandler=handler\n elif event ==\"end\":\n def handler(tag,event=event,append=append,\n end=self._parser._end):\n append((event,end(tag)))\n parser.EndElementHandler=handler\n elif event ==\"start-ns\":\n def handler(prefix,uri,event=event,append=append):\n append((event,(prefix or\"\",uri or\"\")))\n parser.StartNamespaceDeclHandler=handler\n elif event ==\"end-ns\":\n def handler(prefix,event=event,append=append):\n append((event,None ))\n parser.EndNamespaceDeclHandler=handler\n else :\n raise ValueError(\"unknown event %r\"%event)\n \n def __next__(self):\n while 1:\n try :\n item=self._events[self._index]\n self._index +=1\n return item\n except IndexError:\n pass\n if self._error:\n e=self._error\n self._error=None\n raise e\n if self._parser is None :\n self.root=self._root\n if self._close_file:\n self._file.close()\n raise StopIteration\n \n del self._events[:]\n self._index=0\n data=self._file.read(16384)\n if data:\n try :\n self._parser.feed(data)\n except SyntaxError as exc:\n self._error=exc\n else :\n self._root=self._parser.close()\n self._parser=None\n \n def __iter__(self):\n return self\n \n \n \n \n \n \n \n \n \n \n \ndef XML(text,parser=None ):\n if not parser:\n parser=XMLParser(target=TreeBuilder())\n parser.feed(text)\n return parser.close()\n \n \n \n \n \n \n \n \n \n \n \ndef XMLID(text,parser=None ):\n if not parser:\n parser=XMLParser(target=TreeBuilder())\n parser.feed(text)\n tree=parser.close()\n ids={}\n for elem in tree.iter():\n id=elem.get(\"id\")\n if id:\n ids[id]=elem\n return tree,ids\n \n \n \n \n \n \n \n \n \nfromstring=XML\n\n\n\n\n\n\n\n\n\n\n\ndef fromstringlist(sequence,parser=None ):\n if not parser:\n parser=XMLParser(target=TreeBuilder())\n for text in sequence:\n parser.feed(text)\n return parser.close()\n \n \n \n \n \n \n \n \n \n \n \n \n \n \nclass TreeBuilder:\n\n def __init__(self,element_factory=None ):\n self._data=[]\n self._elem=[]\n self._last=None\n self._tail=None\n if element_factory is None :\n element_factory=Element\n self._factory=element_factory\n \n \n \n \n \n \n \n \n def close(self):\n assert len(self._elem)==0,\"missing end tags\"\n assert self._last is not None ,\"missing toplevel element\"\n return self._last\n \n def _flush(self):\n if self._data:\n if self._last is not None :\n text=\"\".join(self._data)\n if self._tail:\n assert self._last.tail is None ,\"internal error (tail)\"\n self._last.tail=text\n else :\n assert self._last.text is None ,\"internal error (text)\"\n self._last.text=text\n self._data=[]\n \n \n \n \n \n \n \n def data(self,data):\n self._data.append(data)\n \n \n \n \n \n \n \n \n \n def start(self,tag,attrs):\n self._flush()\n self._last=elem=self._factory(tag,attrs)\n if self._elem:\n self._elem[-1].append(elem)\n self._elem.append(elem)\n self._tail=0\n return elem\n \n \n \n \n \n \n \n \n def end(self,tag):\n self._flush()\n self._last=self._elem.pop()\n assert self._last.tag ==tag, \"end tag mismatch (expected %s, got %s)\"%(\n self._last.tag,tag)\n self._tail=1\n return self._last\n \n \n \n \n \n \n \n \n \n \n \n \n \n \nclass XMLParser:\n\n def __init__(self,html=0,target=None ,encoding=None ):\n try :\n from xml.parsers import expat\n except ImportError:\n try :\n import pyexpat as expat\n except ImportError:\n raise ImportError(\n \"No module named expat; use SimpleXMLTreeBuilder instead\"\n )\n parser=expat.ParserCreate(encoding,\"}\")\n if target is None :\n target=TreeBuilder()\n \n self.parser=self._parser=parser\n self.target=self._target=target\n self._error=expat.error\n self._names={}\n \n parser.DefaultHandlerExpand=self._default\n if hasattr(target,'start'):\n parser.StartElementHandler=self._start\n if hasattr(target,'end'):\n parser.EndElementHandler=self._end\n if hasattr(target,'data'):\n parser.CharacterDataHandler=target.data\n \n if hasattr(target,'comment'):\n parser.CommentHandler=target.comment\n if hasattr(target,'pi'):\n parser.ProcessingInstructionHandler=target.pi\n \n try :\n parser.buffer_text=1\n except AttributeError:\n pass\n \n try :\n parser.ordered_attributes=1\n parser.specified_attributes=1\n if hasattr(target,'start'):\n parser.StartElementHandler=self._start_list\n except AttributeError:\n pass\n self._doctype=None\n self.entity={}\n try :\n self.version=\"Expat %d.%d.%d\"%expat.version_info\n except AttributeError:\n pass\n \n def _raiseerror(self,value):\n err=ParseError(value)\n err.code=value.code\n err.position=value.lineno,value.offset\n raise err\n \n def _fixname(self,key):\n \n try :\n name=self._names[key]\n except KeyError:\n name=key\n if\"}\"in name:\n name=\"{\"+name\n self._names[key]=name\n return name\n \n def _start(self,tag,attrib_in):\n fixname=self._fixname\n tag=fixname(tag)\n attrib={}\n for key,value in attrib_in.items():\n attrib[fixname(key)]=value\n return self.target.start(tag,attrib)\n \n def _start_list(self,tag,attrib_in):\n fixname=self._fixname\n tag=fixname(tag)\n attrib={}\n if attrib_in:\n for i in range(0,len(attrib_in),2):\n attrib[fixname(attrib_in[i])]=attrib_in[i+1]\n return self.target.start(tag,attrib)\n \n def _end(self,tag):\n return self.target.end(self._fixname(tag))\n \n def _default(self,text):\n prefix=text[:1]\n if prefix ==\"&\":\n \n try :\n data_handler=self.target.data\n except AttributeError:\n return\n try :\n data_handler(self.entity[text[1:-1]])\n except KeyError:\n from xml.parsers import expat\n err=expat.error(\n \"undefined entity %s: line %d, column %d\"%\n (text,self.parser.ErrorLineNumber,\n self.parser.ErrorColumnNumber)\n )\n err.code=11\n err.lineno=self.parser.ErrorLineNumber\n err.offset=self.parser.ErrorColumnNumber\n raise err\n elif prefix ==\"<\"and text[:9]==\"\":\n self._doctype=None\n return\n text=text.strip()\n if not text:\n return\n self._doctype.append(text)\n n=len(self._doctype)\n if n >2:\n type=self._doctype[1]\n if type ==\"PUBLIC\"and n ==4:\n name,type,pubid,system=self._doctype\n if pubid:\n pubid=pubid[1:-1]\n elif type ==\"SYSTEM\"and n ==3:\n name,type,system=self._doctype\n pubid=None\n else :\n return\n if hasattr(self.target,\"doctype\"):\n self.target.doctype(name,pubid,system[1:-1])\n elif self.doctype !=self._XMLParser__doctype:\n \n self._XMLParser__doctype(name,pubid,system[1:-1])\n self.doctype(name,pubid,system[1:-1])\n self._doctype=None\n \n \n \n \n \n \n \n \n def doctype(self,name,pubid,system):\n ''\n warnings.warn(\n \"This method of XMLParser is deprecated. Define doctype() \"\n \"method on the TreeBuilder target.\",\n DeprecationWarning,\n )\n \n \n __doctype=doctype\n \n \n \n \n \n \n def feed(self,data):\n try :\n self.parser.Parse(data,0)\n except self._error as v:\n self._raiseerror(v)\n \n \n \n \n \n \n \n def close(self):\n try :\n self.parser.Parse(\"\",1)\n except self._error as v:\n self._raiseerror(v)\n try :\n close_handler=self.target.close\n except AttributeError:\n pass\n else :\n return close_handler()\n finally :\n \n del self.parser,self._parser\n del self.target,self._target\n \n \n \ntry :\n\n from _elementtree import *\nexcept ImportError:\n pass\nelse :\n\n\n class ElementTree(ElementTree):\n def parse(self,source,parser=None ):\n close_source=False\n if not hasattr(source,'read'):\n source=open(source,'rb')\n close_source=True\n try :\n if parser is not None :\n while True :\n data=source.read(65536)\n if not data:\n break\n parser.feed(data)\n self._root=parser.close()\n else :\n parser=XMLParser()\n self._root=parser._parse(source)\n return self._root\n finally :\n if close_source:\n source.close()\n \n class iterparse:\n ''\n\n\n\n\n\n\n\n\n\n \n \n root=None\n def __init__(self,file,events=None ,parser=None ):\n self._close_file=False\n if not hasattr(file,'read'):\n file=open(file,'rb')\n self._close_file=True\n self._file=file\n self._events=[]\n self._index=0\n self._error=None\n self.root=self._root=None\n if parser is None :\n parser=XMLParser(target=TreeBuilder())\n self._parser=parser\n self._parser._setevents(self._events,events)\n \n def __next__(self):\n while True :\n try :\n item=self._events[self._index]\n self._index +=1\n return item\n except IndexError:\n pass\n if self._error:\n e=self._error\n self._error=None\n raise e\n if self._parser is None :\n self.root=self._root\n if self._close_file:\n self._file.close()\n raise StopIteration\n \n del self._events[:]\n self._index=0\n data=self._file.read(16384)\n if data:\n try :\n self._parser.feed(data)\n except SyntaxError as exc:\n self._error=exc\n else :\n self._root=self._parser.close()\n self._parser=None\n \n def __iter__(self):\n return self\n \n \nXMLTreeBuilder=XMLParser\n\n\ntry :\n from ElementC14N import _serialize_c14n\n _serialize[\"c14n\"]=_serialize_c14n\nexcept ImportError:\n pass\n"], "encodings.cp865": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_map)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_map)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='cp865',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \ndecoding_map=codecs.make_identity_dict(range(256))\ndecoding_map.update({\n0x0080:0x00c7,\n0x0081:0x00fc,\n0x0082:0x00e9,\n0x0083:0x00e2,\n0x0084:0x00e4,\n0x0085:0x00e0,\n0x0086:0x00e5,\n0x0087:0x00e7,\n0x0088:0x00ea,\n0x0089:0x00eb,\n0x008a:0x00e8,\n0x008b:0x00ef,\n0x008c:0x00ee,\n0x008d:0x00ec,\n0x008e:0x00c4,\n0x008f:0x00c5,\n0x0090:0x00c9,\n0x0091:0x00e6,\n0x0092:0x00c6,\n0x0093:0x00f4,\n0x0094:0x00f6,\n0x0095:0x00f2,\n0x0096:0x00fb,\n0x0097:0x00f9,\n0x0098:0x00ff,\n0x0099:0x00d6,\n0x009a:0x00dc,\n0x009b:0x00f8,\n0x009c:0x00a3,\n0x009d:0x00d8,\n0x009e:0x20a7,\n0x009f:0x0192,\n0x00a0:0x00e1,\n0x00a1:0x00ed,\n0x00a2:0x00f3,\n0x00a3:0x00fa,\n0x00a4:0x00f1,\n0x00a5:0x00d1,\n0x00a6:0x00aa,\n0x00a7:0x00ba,\n0x00a8:0x00bf,\n0x00a9:0x2310,\n0x00aa:0x00ac,\n0x00ab:0x00bd,\n0x00ac:0x00bc,\n0x00ad:0x00a1,\n0x00ae:0x00ab,\n0x00af:0x00a4,\n0x00b0:0x2591,\n0x00b1:0x2592,\n0x00b2:0x2593,\n0x00b3:0x2502,\n0x00b4:0x2524,\n0x00b5:0x2561,\n0x00b6:0x2562,\n0x00b7:0x2556,\n0x00b8:0x2555,\n0x00b9:0x2563,\n0x00ba:0x2551,\n0x00bb:0x2557,\n0x00bc:0x255d,\n0x00bd:0x255c,\n0x00be:0x255b,\n0x00bf:0x2510,\n0x00c0:0x2514,\n0x00c1:0x2534,\n0x00c2:0x252c,\n0x00c3:0x251c,\n0x00c4:0x2500,\n0x00c5:0x253c,\n0x00c6:0x255e,\n0x00c7:0x255f,\n0x00c8:0x255a,\n0x00c9:0x2554,\n0x00ca:0x2569,\n0x00cb:0x2566,\n0x00cc:0x2560,\n0x00cd:0x2550,\n0x00ce:0x256c,\n0x00cf:0x2567,\n0x00d0:0x2568,\n0x00d1:0x2564,\n0x00d2:0x2565,\n0x00d3:0x2559,\n0x00d4:0x2558,\n0x00d5:0x2552,\n0x00d6:0x2553,\n0x00d7:0x256b,\n0x00d8:0x256a,\n0x00d9:0x2518,\n0x00da:0x250c,\n0x00db:0x2588,\n0x00dc:0x2584,\n0x00dd:0x258c,\n0x00de:0x2590,\n0x00df:0x2580,\n0x00e0:0x03b1,\n0x00e1:0x00df,\n0x00e2:0x0393,\n0x00e3:0x03c0,\n0x00e4:0x03a3,\n0x00e5:0x03c3,\n0x00e6:0x00b5,\n0x00e7:0x03c4,\n0x00e8:0x03a6,\n0x00e9:0x0398,\n0x00ea:0x03a9,\n0x00eb:0x03b4,\n0x00ec:0x221e,\n0x00ed:0x03c6,\n0x00ee:0x03b5,\n0x00ef:0x2229,\n0x00f0:0x2261,\n0x00f1:0x00b1,\n0x00f2:0x2265,\n0x00f3:0x2264,\n0x00f4:0x2320,\n0x00f5:0x2321,\n0x00f6:0x00f7,\n0x00f7:0x2248,\n0x00f8:0x00b0,\n0x00f9:0x2219,\n0x00fa:0x00b7,\n0x00fb:0x221a,\n0x00fc:0x207f,\n0x00fd:0x00b2,\n0x00fe:0x25a0,\n0x00ff:0x00a0,\n})\n\n\n\ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\xc7'\n'\\xfc'\n'\\xe9'\n'\\xe2'\n'\\xe4'\n'\\xe0'\n'\\xe5'\n'\\xe7'\n'\\xea'\n'\\xeb'\n'\\xe8'\n'\\xef'\n'\\xee'\n'\\xec'\n'\\xc4'\n'\\xc5'\n'\\xc9'\n'\\xe6'\n'\\xc6'\n'\\xf4'\n'\\xf6'\n'\\xf2'\n'\\xfb'\n'\\xf9'\n'\\xff'\n'\\xd6'\n'\\xdc'\n'\\xf8'\n'\\xa3'\n'\\xd8'\n'\\u20a7'\n'\\u0192'\n'\\xe1'\n'\\xed'\n'\\xf3'\n'\\xfa'\n'\\xf1'\n'\\xd1'\n'\\xaa'\n'\\xba'\n'\\xbf'\n'\\u2310'\n'\\xac'\n'\\xbd'\n'\\xbc'\n'\\xa1'\n'\\xab'\n'\\xa4'\n'\\u2591'\n'\\u2592'\n'\\u2593'\n'\\u2502'\n'\\u2524'\n'\\u2561'\n'\\u2562'\n'\\u2556'\n'\\u2555'\n'\\u2563'\n'\\u2551'\n'\\u2557'\n'\\u255d'\n'\\u255c'\n'\\u255b'\n'\\u2510'\n'\\u2514'\n'\\u2534'\n'\\u252c'\n'\\u251c'\n'\\u2500'\n'\\u253c'\n'\\u255e'\n'\\u255f'\n'\\u255a'\n'\\u2554'\n'\\u2569'\n'\\u2566'\n'\\u2560'\n'\\u2550'\n'\\u256c'\n'\\u2567'\n'\\u2568'\n'\\u2564'\n'\\u2565'\n'\\u2559'\n'\\u2558'\n'\\u2552'\n'\\u2553'\n'\\u256b'\n'\\u256a'\n'\\u2518'\n'\\u250c'\n'\\u2588'\n'\\u2584'\n'\\u258c'\n'\\u2590'\n'\\u2580'\n'\\u03b1'\n'\\xdf'\n'\\u0393'\n'\\u03c0'\n'\\u03a3'\n'\\u03c3'\n'\\xb5'\n'\\u03c4'\n'\\u03a6'\n'\\u0398'\n'\\u03a9'\n'\\u03b4'\n'\\u221e'\n'\\u03c6'\n'\\u03b5'\n'\\u2229'\n'\\u2261'\n'\\xb1'\n'\\u2265'\n'\\u2264'\n'\\u2320'\n'\\u2321'\n'\\xf7'\n'\\u2248'\n'\\xb0'\n'\\u2219'\n'\\xb7'\n'\\u221a'\n'\\u207f'\n'\\xb2'\n'\\u25a0'\n'\\xa0'\n)\n\n\n\nencoding_map={\n0x0000:0x0000,\n0x0001:0x0001,\n0x0002:0x0002,\n0x0003:0x0003,\n0x0004:0x0004,\n0x0005:0x0005,\n0x0006:0x0006,\n0x0007:0x0007,\n0x0008:0x0008,\n0x0009:0x0009,\n0x000a:0x000a,\n0x000b:0x000b,\n0x000c:0x000c,\n0x000d:0x000d,\n0x000e:0x000e,\n0x000f:0x000f,\n0x0010:0x0010,\n0x0011:0x0011,\n0x0012:0x0012,\n0x0013:0x0013,\n0x0014:0x0014,\n0x0015:0x0015,\n0x0016:0x0016,\n0x0017:0x0017,\n0x0018:0x0018,\n0x0019:0x0019,\n0x001a:0x001a,\n0x001b:0x001b,\n0x001c:0x001c,\n0x001d:0x001d,\n0x001e:0x001e,\n0x001f:0x001f,\n0x0020:0x0020,\n0x0021:0x0021,\n0x0022:0x0022,\n0x0023:0x0023,\n0x0024:0x0024,\n0x0025:0x0025,\n0x0026:0x0026,\n0x0027:0x0027,\n0x0028:0x0028,\n0x0029:0x0029,\n0x002a:0x002a,\n0x002b:0x002b,\n0x002c:0x002c,\n0x002d:0x002d,\n0x002e:0x002e,\n0x002f:0x002f,\n0x0030:0x0030,\n0x0031:0x0031,\n0x0032:0x0032,\n0x0033:0x0033,\n0x0034:0x0034,\n0x0035:0x0035,\n0x0036:0x0036,\n0x0037:0x0037,\n0x0038:0x0038,\n0x0039:0x0039,\n0x003a:0x003a,\n0x003b:0x003b,\n0x003c:0x003c,\n0x003d:0x003d,\n0x003e:0x003e,\n0x003f:0x003f,\n0x0040:0x0040,\n0x0041:0x0041,\n0x0042:0x0042,\n0x0043:0x0043,\n0x0044:0x0044,\n0x0045:0x0045,\n0x0046:0x0046,\n0x0047:0x0047,\n0x0048:0x0048,\n0x0049:0x0049,\n0x004a:0x004a,\n0x004b:0x004b,\n0x004c:0x004c,\n0x004d:0x004d,\n0x004e:0x004e,\n0x004f:0x004f,\n0x0050:0x0050,\n0x0051:0x0051,\n0x0052:0x0052,\n0x0053:0x0053,\n0x0054:0x0054,\n0x0055:0x0055,\n0x0056:0x0056,\n0x0057:0x0057,\n0x0058:0x0058,\n0x0059:0x0059,\n0x005a:0x005a,\n0x005b:0x005b,\n0x005c:0x005c,\n0x005d:0x005d,\n0x005e:0x005e,\n0x005f:0x005f,\n0x0060:0x0060,\n0x0061:0x0061,\n0x0062:0x0062,\n0x0063:0x0063,\n0x0064:0x0064,\n0x0065:0x0065,\n0x0066:0x0066,\n0x0067:0x0067,\n0x0068:0x0068,\n0x0069:0x0069,\n0x006a:0x006a,\n0x006b:0x006b,\n0x006c:0x006c,\n0x006d:0x006d,\n0x006e:0x006e,\n0x006f:0x006f,\n0x0070:0x0070,\n0x0071:0x0071,\n0x0072:0x0072,\n0x0073:0x0073,\n0x0074:0x0074,\n0x0075:0x0075,\n0x0076:0x0076,\n0x0077:0x0077,\n0x0078:0x0078,\n0x0079:0x0079,\n0x007a:0x007a,\n0x007b:0x007b,\n0x007c:0x007c,\n0x007d:0x007d,\n0x007e:0x007e,\n0x007f:0x007f,\n0x00a0:0x00ff,\n0x00a1:0x00ad,\n0x00a3:0x009c,\n0x00a4:0x00af,\n0x00aa:0x00a6,\n0x00ab:0x00ae,\n0x00ac:0x00aa,\n0x00b0:0x00f8,\n0x00b1:0x00f1,\n0x00b2:0x00fd,\n0x00b5:0x00e6,\n0x00b7:0x00fa,\n0x00ba:0x00a7,\n0x00bc:0x00ac,\n0x00bd:0x00ab,\n0x00bf:0x00a8,\n0x00c4:0x008e,\n0x00c5:0x008f,\n0x00c6:0x0092,\n0x00c7:0x0080,\n0x00c9:0x0090,\n0x00d1:0x00a5,\n0x00d6:0x0099,\n0x00d8:0x009d,\n0x00dc:0x009a,\n0x00df:0x00e1,\n0x00e0:0x0085,\n0x00e1:0x00a0,\n0x00e2:0x0083,\n0x00e4:0x0084,\n0x00e5:0x0086,\n0x00e6:0x0091,\n0x00e7:0x0087,\n0x00e8:0x008a,\n0x00e9:0x0082,\n0x00ea:0x0088,\n0x00eb:0x0089,\n0x00ec:0x008d,\n0x00ed:0x00a1,\n0x00ee:0x008c,\n0x00ef:0x008b,\n0x00f1:0x00a4,\n0x00f2:0x0095,\n0x00f3:0x00a2,\n0x00f4:0x0093,\n0x00f6:0x0094,\n0x00f7:0x00f6,\n0x00f8:0x009b,\n0x00f9:0x0097,\n0x00fa:0x00a3,\n0x00fb:0x0096,\n0x00fc:0x0081,\n0x00ff:0x0098,\n0x0192:0x009f,\n0x0393:0x00e2,\n0x0398:0x00e9,\n0x03a3:0x00e4,\n0x03a6:0x00e8,\n0x03a9:0x00ea,\n0x03b1:0x00e0,\n0x03b4:0x00eb,\n0x03b5:0x00ee,\n0x03c0:0x00e3,\n0x03c3:0x00e5,\n0x03c4:0x00e7,\n0x03c6:0x00ed,\n0x207f:0x00fc,\n0x20a7:0x009e,\n0x2219:0x00f9,\n0x221a:0x00fb,\n0x221e:0x00ec,\n0x2229:0x00ef,\n0x2248:0x00f7,\n0x2261:0x00f0,\n0x2264:0x00f3,\n0x2265:0x00f2,\n0x2310:0x00a9,\n0x2320:0x00f4,\n0x2321:0x00f5,\n0x2500:0x00c4,\n0x2502:0x00b3,\n0x250c:0x00da,\n0x2510:0x00bf,\n0x2514:0x00c0,\n0x2518:0x00d9,\n0x251c:0x00c3,\n0x2524:0x00b4,\n0x252c:0x00c2,\n0x2534:0x00c1,\n0x253c:0x00c5,\n0x2550:0x00cd,\n0x2551:0x00ba,\n0x2552:0x00d5,\n0x2553:0x00d6,\n0x2554:0x00c9,\n0x2555:0x00b8,\n0x2556:0x00b7,\n0x2557:0x00bb,\n0x2558:0x00d4,\n0x2559:0x00d3,\n0x255a:0x00c8,\n0x255b:0x00be,\n0x255c:0x00bd,\n0x255d:0x00bc,\n0x255e:0x00c6,\n0x255f:0x00c7,\n0x2560:0x00cc,\n0x2561:0x00b5,\n0x2562:0x00b6,\n0x2563:0x00b9,\n0x2564:0x00d1,\n0x2565:0x00d2,\n0x2566:0x00cb,\n0x2567:0x00cf,\n0x2568:0x00d0,\n0x2569:0x00ca,\n0x256a:0x00d8,\n0x256b:0x00d7,\n0x256c:0x00ce,\n0x2580:0x00df,\n0x2584:0x00dc,\n0x2588:0x00db,\n0x258c:0x00dd,\n0x2590:0x00de,\n0x2591:0x00b0,\n0x2592:0x00b1,\n0x2593:0x00b2,\n0x25a0:0x00fe,\n}\n"], "keyword": [".py", "#! /usr/bin/env python3\n\n\"\"\"Keywords (from \"graminit.c\")\n\nThis file is automatically generated; please don't muck it up!\n\nTo update the symbols in this file, 'cd' to the top directory of\nthe python source tree after building the interpreter and run:\n\n ./python Lib/keyword.py\n\"\"\"\n\n__all__=[\"iskeyword\",\"kwlist\"]\n\nkwlist=[\n\n'False',\n'None',\n'True',\n'and',\n'as',\n'assert',\n'break',\n'class',\n'continue',\n'def',\n'del',\n'elif',\n'else',\n'except',\n'finally',\n'for',\n'from',\n'global',\n'if',\n'import',\n'in',\n'is',\n'lambda',\n'nonlocal',\n'not',\n'or',\n'pass',\n'raise',\n'return',\n'try',\n'while',\n'with',\n'yield',\n\n]\n\niskeyword=frozenset(kwlist).__contains__\n\ndef main():\n import sys,re\n \n args=sys.argv[1:]\n iptfile=args and args[0]or\"Python/graminit.c\"\n if len(args)>1:optfile=args[1]\n else :optfile=\"Lib/keyword.py\"\n \n \n with open(iptfile)as fp:\n strprog=re.compile('\"([^\"]+)\"')\n lines=[]\n for line in fp:\n if'{1, \"'in line:\n match=strprog.search(line)\n if match:\n lines.append(\" '\"+match.group(1)+\"',\\n\")\n lines.sort()\n \n \n with open(optfile)as fp:\n format=fp.readlines()\n \n \n try :\n start=format.index(\"#--start keywords--\\n\")+1\n end=format.index(\"#--end keywords--\\n\")\n format[start:end]=lines\n except ValueError:\n sys.stderr.write(\"target does not contain format markers\\n\")\n sys.exit(1)\n \n \n fp=open(optfile,'w')\n fp.write(''.join(format))\n fp.close()\n \nif __name__ ==\"__main__\":\n main()\n"], "colorsys": [".py", "''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n__all__=[\"rgb_to_yiq\",\"yiq_to_rgb\",\"rgb_to_hls\",\"hls_to_rgb\",\n\"rgb_to_hsv\",\"hsv_to_rgb\"]\n\n\n\nONE_THIRD=1.0 /3.0\nONE_SIXTH=1.0 /6.0\nTWO_THIRD=2.0 /3.0\n\n\n\n\n\ndef rgb_to_yiq(r,g,b):\n y=0.30 *r+0.59 *g+0.11 *b\n i=0.60 *r -0.28 *g -0.32 *b\n q=0.21 *r -0.52 *g+0.31 *b\n return (y,i,q)\n \ndef yiq_to_rgb(y,i,q):\n r=y+0.948262 *i+0.624013 *q\n g=y -0.276066 *i -0.639810 *q\n b=y -1.105450 *i+1.729860 *q\n if r <0.0:\n r=0.0\n if g <0.0:\n g=0.0\n if b <0.0:\n b=0.0\n if r >1.0:\n r=1.0\n if g >1.0:\n g=1.0\n if b >1.0:\n b=1.0\n return (r,g,b)\n \n \n \n \n \n \n \ndef rgb_to_hls(r,g,b):\n maxc=max(r,g,b)\n minc=min(r,g,b)\n \n l=(minc+maxc)/2.0\n if minc ==maxc:\n return 0.0,l,0.0\n if l <=0.5:\n s=(maxc -minc)/(maxc+minc)\n else :\n s=(maxc -minc)/(2.0 -maxc -minc)\n rc=(maxc -r)/(maxc -minc)\n gc=(maxc -g)/(maxc -minc)\n bc=(maxc -b)/(maxc -minc)\n if r ==maxc:\n h=bc -gc\n elif g ==maxc:\n h=2.0+rc -bc\n else :\n h=4.0+gc -rc\n h=(h /6.0)%1.0\n return h,l,s\n \ndef hls_to_rgb(h,l,s):\n if s ==0.0:\n return l,l,l\n if l <=0.5:\n m2=l *(1.0+s)\n else :\n m2=l+s -(l *s)\n m1=2.0 *l -m2\n return (_v(m1,m2,h+ONE_THIRD),_v(m1,m2,h),_v(m1,m2,h -ONE_THIRD))\n \ndef _v(m1,m2,hue):\n hue=hue %1.0\n if hue '.format(res[1:-1],extra)\n \n def locked(self):\n ''\n return self._locked\n \n @coroutine\n def acquire(self):\n ''\n\n\n\n \n if not self._waiters and not self._locked:\n self._locked=True\n return True\n \n fut=futures.Future(loop=self._loop)\n self._waiters.append(fut)\n try :\n yield from fut\n self._locked=True\n return True\n finally :\n self._waiters.remove(fut)\n \n def release(self):\n ''\n\n\n\n\n\n\n\n\n \n if self._locked:\n self._locked=False\n \n for fut in self._waiters:\n if not fut.done():\n fut.set_result(True )\n break\n else :\n raise RuntimeError('Lock is not acquired.')\n \n def __enter__(self):\n raise RuntimeError(\n '\"yield from\" should be used as context manager expression')\n \n def __exit__(self,*args):\n \n \n pass\n \n def __iter__(self):\n \n \n \n \n \n \n \n \n \n \n \n \n yield from self.acquire()\n return _ContextManager(self)\n \n \nclass Event:\n ''\n\n\n\n\n\n \n \n def __init__(self,*,loop=None ):\n self._waiters=collections.deque()\n self._value=False\n if loop is not None :\n self._loop=loop\n else :\n self._loop=events.get_event_loop()\n \n def __repr__(self):\n res=super().__repr__()\n extra='set'if self._value else'unset'\n if self._waiters:\n extra='{},waiters:{}'.format(extra,len(self._waiters))\n return'<{} [{}]>'.format(res[1:-1],extra)\n \n def is_set(self):\n ''\n return self._value\n \n def set(self):\n ''\n\n\n \n if not self._value:\n self._value=True\n \n for fut in self._waiters:\n if not fut.done():\n fut.set_result(True )\n \n def clear(self):\n ''\n\n \n self._value=False\n \n @coroutine\n def wait(self):\n ''\n\n\n\n\n \n if self._value:\n return True\n \n fut=futures.Future(loop=self._loop)\n self._waiters.append(fut)\n try :\n yield from fut\n return True\n finally :\n self._waiters.remove(fut)\n \n \nclass Condition:\n ''\n\n\n\n\n\n\n \n \n def __init__(self,lock=None ,*,loop=None ):\n if loop is not None :\n self._loop=loop\n else :\n self._loop=events.get_event_loop()\n \n if lock is None :\n lock=Lock(loop=self._loop)\n elif lock._loop is not self._loop:\n raise ValueError(\"loop argument must agree with lock\")\n \n self._lock=lock\n \n self.locked=lock.locked\n self.acquire=lock.acquire\n self.release=lock.release\n \n self._waiters=collections.deque()\n \n def __repr__(self):\n res=super().__repr__()\n extra='locked'if self.locked()else'unlocked'\n if self._waiters:\n extra='{},waiters:{}'.format(extra,len(self._waiters))\n return'<{} [{}]>'.format(res[1:-1],extra)\n \n @coroutine\n def wait(self):\n ''\n\n\n\n\n\n\n\n\n \n if not self.locked():\n raise RuntimeError('cannot wait on un-acquired lock')\n \n self.release()\n try :\n fut=futures.Future(loop=self._loop)\n self._waiters.append(fut)\n try :\n yield from fut\n return True\n finally :\n self._waiters.remove(fut)\n \n finally :\n yield from self.acquire()\n \n @coroutine\n def wait_for(self,predicate):\n ''\n\n\n\n\n \n result=predicate()\n while not result:\n yield from self.wait()\n result=predicate()\n return result\n \n def notify(self,n=1):\n ''\n\n\n\n\n\n\n\n\n\n \n if not self.locked():\n raise RuntimeError('cannot notify on un-acquired lock')\n \n idx=0\n for fut in self._waiters:\n if idx >=n:\n break\n \n if not fut.done():\n idx +=1\n fut.set_result(False )\n \n def notify_all(self):\n ''\n\n\n\n \n self.notify(len(self._waiters))\n \n def __enter__(self):\n raise RuntimeError(\n '\"yield from\" should be used as context manager expression')\n \n def __exit__(self,*args):\n pass\n \n def __iter__(self):\n \n yield from self.acquire()\n return _ContextManager(self)\n \n \nclass Semaphore:\n ''\n\n\n\n\n\n\n\n\n\n\n\n \n \n def __init__(self,value=1,*,loop=None ):\n if value <0:\n raise ValueError(\"Semaphore initial value must be >= 0\")\n self._value=value\n self._waiters=collections.deque()\n if loop is not None :\n self._loop=loop\n else :\n self._loop=events.get_event_loop()\n \n def __repr__(self):\n res=super().__repr__()\n extra='locked'if self.locked()else'unlocked,value:{}'.format(\n self._value)\n if self._waiters:\n extra='{},waiters:{}'.format(extra,len(self._waiters))\n return'<{} [{}]>'.format(res[1:-1],extra)\n \n def locked(self):\n ''\n return self._value ==0\n \n @coroutine\n def acquire(self):\n ''\n\n\n\n\n\n\n \n if not self._waiters and self._value >0:\n self._value -=1\n return True\n \n fut=futures.Future(loop=self._loop)\n self._waiters.append(fut)\n try :\n yield from fut\n self._value -=1\n return True\n finally :\n self._waiters.remove(fut)\n \n def release(self):\n ''\n\n\n \n self._value +=1\n for waiter in self._waiters:\n if not waiter.done():\n waiter.set_result(True )\n break\n \n def __enter__(self):\n raise RuntimeError(\n '\"yield from\" should be used as context manager expression')\n \n def __exit__(self,*args):\n pass\n \n def __iter__(self):\n \n yield from self.acquire()\n return _ContextManager(self)\n \n \nclass BoundedSemaphore(Semaphore):\n ''\n\n\n\n \n \n def __init__(self,value=1,*,loop=None ):\n self._bound_value=value\n super().__init__(value,loop=loop)\n \n def release(self):\n if self._value >=self._bound_value:\n raise ValueError('BoundedSemaphore released too many times')\n super().release()\n"], "browser.object_storage": [".py", "import pickle\n\nclass __UnProvided():\n pass\n \n \nclass ObjectStorage():\n\n def __init__(self,storage):\n self.storage=storage\n \n def __delitem__(self,key):\n del self.storage[pickle.dumps(key)]\n \n def __getitem__(self,key):\n return pickle.loads(self.storage[pickle.dumps(key)])\n \n def __setitem__(self,key,value):\n self.storage[pickle.dumps(key)]=pickle.dumps(value)\n \n def __contains__(self,key):\n return pickle.dumps(key)in self.storage\n \n def get(self,key,default=None ):\n if pickle.dumps(key)in self.storage:\n return self.storage[pickle.dumps(key)]\n return default\n \n def pop(self,key,default=__UnProvided()):\n if type(default)is __UnProvided or pickle.dumps(key)in self.storage:\n return pickle.loads(self.storage.pop(pickle.dumps(key)))\n return default\n \n def __iter__(self):\n keys=self.keys()\n return keys.__iter__()\n \n def keys(self):\n return [pickle.loads(key)for key in self.storage.keys()]\n \n def values(self):\n return [pickle.loads(val)for val in self.storage.values()]\n \n def items(self):\n return list(zip(self.keys(),self.values()))\n \n def clear(self):\n self.storage.clear()\n \n def __len__(self):\n return len(self.storage)\n"], "__future__": [".py", "''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nall_feature_names=[\n\"nested_scopes\",\n\"generators\",\n\"division\",\n\"absolute_import\",\n\"with_statement\",\n\"print_function\",\n\"unicode_literals\",\n\"barry_as_FLUFL\",\n]\n\n__all__=[\"all_feature_names\"]+all_feature_names\n\n\n\n\n\nCO_NESTED=0x0010\nCO_GENERATOR_ALLOWED=0\nCO_FUTURE_DIVISION=0x2000\nCO_FUTURE_ABSOLUTE_IMPORT=0x4000\nCO_FUTURE_WITH_STATEMENT=0x8000\nCO_FUTURE_PRINT_FUNCTION=0x10000\nCO_FUTURE_UNICODE_LITERALS=0x20000\nCO_FUTURE_BARRY_AS_BDFL=0x40000\n\nclass _Feature:\n def __init__(self,optionalRelease,mandatoryRelease,compiler_flag):\n self.optional=optionalRelease\n self.mandatory=mandatoryRelease\n self.compiler_flag=compiler_flag\n \n def getOptionalRelease(self):\n ''\n\n\n \n \n return self.optional\n \n def getMandatoryRelease(self):\n ''\n\n\n\n \n \n return self.mandatory\n \n def __repr__(self):\n return\"_Feature\"+repr((self.optional,\n self.mandatory,\n self.compiler_flag))\n \nnested_scopes=_Feature((2,1,0,\"beta\",1),\n(2,2,0,\"alpha\",0),\nCO_NESTED)\n\ngenerators=_Feature((2,2,0,\"alpha\",1),\n(2,3,0,\"final\",0),\nCO_GENERATOR_ALLOWED)\n\ndivision=_Feature((2,2,0,\"alpha\",2),\n(3,0,0,\"alpha\",0),\nCO_FUTURE_DIVISION)\n\nabsolute_import=_Feature((2,5,0,\"alpha\",1),\n(3,0,0,\"alpha\",0),\nCO_FUTURE_ABSOLUTE_IMPORT)\n\nwith_statement=_Feature((2,5,0,\"alpha\",1),\n(2,6,0,\"alpha\",0),\nCO_FUTURE_WITH_STATEMENT)\n\nprint_function=_Feature((2,6,0,\"alpha\",2),\n(3,0,0,\"alpha\",0),\nCO_FUTURE_PRINT_FUNCTION)\n\nunicode_literals=_Feature((2,6,0,\"alpha\",2),\n(3,0,0,\"alpha\",0),\nCO_FUTURE_UNICODE_LITERALS)\n\nbarry_as_FLUFL=_Feature((3,1,0,\"alpha\",2),\n(3,9,0,\"alpha\",0),\nCO_FUTURE_BARRY_AS_BDFL)\n"], "encodings.iso8859_1": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='iso8859-1',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\x80'\n'\\x81'\n'\\x82'\n'\\x83'\n'\\x84'\n'\\x85'\n'\\x86'\n'\\x87'\n'\\x88'\n'\\x89'\n'\\x8a'\n'\\x8b'\n'\\x8c'\n'\\x8d'\n'\\x8e'\n'\\x8f'\n'\\x90'\n'\\x91'\n'\\x92'\n'\\x93'\n'\\x94'\n'\\x95'\n'\\x96'\n'\\x97'\n'\\x98'\n'\\x99'\n'\\x9a'\n'\\x9b'\n'\\x9c'\n'\\x9d'\n'\\x9e'\n'\\x9f'\n'\\xa0'\n'\\xa1'\n'\\xa2'\n'\\xa3'\n'\\xa4'\n'\\xa5'\n'\\xa6'\n'\\xa7'\n'\\xa8'\n'\\xa9'\n'\\xaa'\n'\\xab'\n'\\xac'\n'\\xad'\n'\\xae'\n'\\xaf'\n'\\xb0'\n'\\xb1'\n'\\xb2'\n'\\xb3'\n'\\xb4'\n'\\xb5'\n'\\xb6'\n'\\xb7'\n'\\xb8'\n'\\xb9'\n'\\xba'\n'\\xbb'\n'\\xbc'\n'\\xbd'\n'\\xbe'\n'\\xbf'\n'\\xc0'\n'\\xc1'\n'\\xc2'\n'\\xc3'\n'\\xc4'\n'\\xc5'\n'\\xc6'\n'\\xc7'\n'\\xc8'\n'\\xc9'\n'\\xca'\n'\\xcb'\n'\\xcc'\n'\\xcd'\n'\\xce'\n'\\xcf'\n'\\xd0'\n'\\xd1'\n'\\xd2'\n'\\xd3'\n'\\xd4'\n'\\xd5'\n'\\xd6'\n'\\xd7'\n'\\xd8'\n'\\xd9'\n'\\xda'\n'\\xdb'\n'\\xdc'\n'\\xdd'\n'\\xde'\n'\\xdf'\n'\\xe0'\n'\\xe1'\n'\\xe2'\n'\\xe3'\n'\\xe4'\n'\\xe5'\n'\\xe6'\n'\\xe7'\n'\\xe8'\n'\\xe9'\n'\\xea'\n'\\xeb'\n'\\xec'\n'\\xed'\n'\\xee'\n'\\xef'\n'\\xf0'\n'\\xf1'\n'\\xf2'\n'\\xf3'\n'\\xf4'\n'\\xf5'\n'\\xf6'\n'\\xf7'\n'\\xf8'\n'\\xf9'\n'\\xfa'\n'\\xfb'\n'\\xfc'\n'\\xfd'\n'\\xfe'\n'\\xff'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "encodings.iso8859_14": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_table)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='iso8859-14',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \n \n \ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\x80'\n'\\x81'\n'\\x82'\n'\\x83'\n'\\x84'\n'\\x85'\n'\\x86'\n'\\x87'\n'\\x88'\n'\\x89'\n'\\x8a'\n'\\x8b'\n'\\x8c'\n'\\x8d'\n'\\x8e'\n'\\x8f'\n'\\x90'\n'\\x91'\n'\\x92'\n'\\x93'\n'\\x94'\n'\\x95'\n'\\x96'\n'\\x97'\n'\\x98'\n'\\x99'\n'\\x9a'\n'\\x9b'\n'\\x9c'\n'\\x9d'\n'\\x9e'\n'\\x9f'\n'\\xa0'\n'\\u1e02'\n'\\u1e03'\n'\\xa3'\n'\\u010a'\n'\\u010b'\n'\\u1e0a'\n'\\xa7'\n'\\u1e80'\n'\\xa9'\n'\\u1e82'\n'\\u1e0b'\n'\\u1ef2'\n'\\xad'\n'\\xae'\n'\\u0178'\n'\\u1e1e'\n'\\u1e1f'\n'\\u0120'\n'\\u0121'\n'\\u1e40'\n'\\u1e41'\n'\\xb6'\n'\\u1e56'\n'\\u1e81'\n'\\u1e57'\n'\\u1e83'\n'\\u1e60'\n'\\u1ef3'\n'\\u1e84'\n'\\u1e85'\n'\\u1e61'\n'\\xc0'\n'\\xc1'\n'\\xc2'\n'\\xc3'\n'\\xc4'\n'\\xc5'\n'\\xc6'\n'\\xc7'\n'\\xc8'\n'\\xc9'\n'\\xca'\n'\\xcb'\n'\\xcc'\n'\\xcd'\n'\\xce'\n'\\xcf'\n'\\u0174'\n'\\xd1'\n'\\xd2'\n'\\xd3'\n'\\xd4'\n'\\xd5'\n'\\xd6'\n'\\u1e6a'\n'\\xd8'\n'\\xd9'\n'\\xda'\n'\\xdb'\n'\\xdc'\n'\\xdd'\n'\\u0176'\n'\\xdf'\n'\\xe0'\n'\\xe1'\n'\\xe2'\n'\\xe3'\n'\\xe4'\n'\\xe5'\n'\\xe6'\n'\\xe7'\n'\\xe8'\n'\\xe9'\n'\\xea'\n'\\xeb'\n'\\xec'\n'\\xed'\n'\\xee'\n'\\xef'\n'\\u0175'\n'\\xf1'\n'\\xf2'\n'\\xf3'\n'\\xf4'\n'\\xf5'\n'\\xf6'\n'\\u1e6b'\n'\\xf8'\n'\\xf9'\n'\\xfa'\n'\\xfb'\n'\\xfc'\n'\\xfd'\n'\\u0177'\n'\\xff'\n)\n\n\nencoding_table=codecs.charmap_build(decoding_table)\n"], "browser.local_storage": [".py", "\nimport sys\nfrom browser import window,console\n\nhas_local_storage=hasattr(window,'localStorage')\n\nclass __UnProvided():\n pass\n \nclass LocalStorage():\n storage_type=\"local_storage\"\n \n def __init__(self):\n if not has_local_storage:\n raise EnvironmentError(\"LocalStorage not available\")\n self.store=window.localStorage\n \n def __delitem__(self,key):\n if (not isinstance(key,str)):\n raise TypeError(\"key must be string\")\n if key not in self:\n raise KeyError(key)\n self.store.removeItem(key)\n \n def __getitem__(self,key):\n if (not isinstance(key,str)):\n raise TypeError(\"key must be string\")\n res=self.store.getItem(key)\n if res is not None :\n return res\n raise KeyError(key)\n \n def __setitem__(self,key,value):\n if not isinstance(key,str):\n raise TypeError(\"key must be string\")\n if not isinstance(value,str):\n raise TypeError(\"value must be string\")\n self.store.setItem(key,value)\n \n \n def __contains__(self,key):\n if (not isinstance(key,str)):\n raise TypeError(\"key must be string\")\n res=self.store.getItem(key)\n if res is None :\n return False\n return True\n \n def __iter__(self):\n keys=self.keys()\n return keys.__iter__()\n \n def get(self,key,default=None ):\n if (not isinstance(key,str)):\n raise TypeError(\"key must be string\")\n return self.store.getItem(key)or default\n \n def pop(self,key,default=__UnProvided()):\n if (not isinstance(key,str)):\n raise TypeError(\"key must be string\")\n if type(default)is __UnProvided:\n ret=self.get(key)\n del self[key]\n return ret\n else :\n if key in self:\n ret=self.get(key)\n del self[key]\n return ret\n else :\n return default\n \n \n \n def keys(self):\n return [self.store.key(i)for i in range(self.store.length)]\n \n def values(self):\n return [self.__getitem__(k)for k in self.keys()]\n \n def items(self):\n return list(zip(self.keys(),self.values()))\n \n def clear(self):\n self.store.clear()\n \n def __len__(self):\n return self.store.length\n \nif has_local_storage:\n storage=LocalStorage()\n"], "encodings.cp775": [".py", "''\n\n\n\nimport codecs\n\n\n\nclass Codec(codecs.Codec):\n\n def encode(self,input,errors='strict'):\n return codecs.charmap_encode(input,errors,encoding_map)\n \n def decode(self,input,errors='strict'):\n return codecs.charmap_decode(input,errors,decoding_table)\n \nclass IncrementalEncoder(codecs.IncrementalEncoder):\n def encode(self,input,final=False ):\n return codecs.charmap_encode(input,self.errors,encoding_map)[0]\n \nclass IncrementalDecoder(codecs.IncrementalDecoder):\n def decode(self,input,final=False ):\n return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n \nclass StreamWriter(Codec,codecs.StreamWriter):\n pass\n \nclass StreamReader(Codec,codecs.StreamReader):\n pass\n \n \n \ndef getregentry():\n return codecs.CodecInfo(\n name='cp775',\n encode=Codec().encode,\n decode=Codec().decode,\n incrementalencoder=IncrementalEncoder,\n incrementaldecoder=IncrementalDecoder,\n streamreader=StreamReader,\n streamwriter=StreamWriter,\n )\n \n \ndecoding_map=codecs.make_identity_dict(range(256))\ndecoding_map.update({\n0x0080:0x0106,\n0x0081:0x00fc,\n0x0082:0x00e9,\n0x0083:0x0101,\n0x0084:0x00e4,\n0x0085:0x0123,\n0x0086:0x00e5,\n0x0087:0x0107,\n0x0088:0x0142,\n0x0089:0x0113,\n0x008a:0x0156,\n0x008b:0x0157,\n0x008c:0x012b,\n0x008d:0x0179,\n0x008e:0x00c4,\n0x008f:0x00c5,\n0x0090:0x00c9,\n0x0091:0x00e6,\n0x0092:0x00c6,\n0x0093:0x014d,\n0x0094:0x00f6,\n0x0095:0x0122,\n0x0096:0x00a2,\n0x0097:0x015a,\n0x0098:0x015b,\n0x0099:0x00d6,\n0x009a:0x00dc,\n0x009b:0x00f8,\n0x009c:0x00a3,\n0x009d:0x00d8,\n0x009e:0x00d7,\n0x009f:0x00a4,\n0x00a0:0x0100,\n0x00a1:0x012a,\n0x00a2:0x00f3,\n0x00a3:0x017b,\n0x00a4:0x017c,\n0x00a5:0x017a,\n0x00a6:0x201d,\n0x00a7:0x00a6,\n0x00a8:0x00a9,\n0x00a9:0x00ae,\n0x00aa:0x00ac,\n0x00ab:0x00bd,\n0x00ac:0x00bc,\n0x00ad:0x0141,\n0x00ae:0x00ab,\n0x00af:0x00bb,\n0x00b0:0x2591,\n0x00b1:0x2592,\n0x00b2:0x2593,\n0x00b3:0x2502,\n0x00b4:0x2524,\n0x00b5:0x0104,\n0x00b6:0x010c,\n0x00b7:0x0118,\n0x00b8:0x0116,\n0x00b9:0x2563,\n0x00ba:0x2551,\n0x00bb:0x2557,\n0x00bc:0x255d,\n0x00bd:0x012e,\n0x00be:0x0160,\n0x00bf:0x2510,\n0x00c0:0x2514,\n0x00c1:0x2534,\n0x00c2:0x252c,\n0x00c3:0x251c,\n0x00c4:0x2500,\n0x00c5:0x253c,\n0x00c6:0x0172,\n0x00c7:0x016a,\n0x00c8:0x255a,\n0x00c9:0x2554,\n0x00ca:0x2569,\n0x00cb:0x2566,\n0x00cc:0x2560,\n0x00cd:0x2550,\n0x00ce:0x256c,\n0x00cf:0x017d,\n0x00d0:0x0105,\n0x00d1:0x010d,\n0x00d2:0x0119,\n0x00d3:0x0117,\n0x00d4:0x012f,\n0x00d5:0x0161,\n0x00d6:0x0173,\n0x00d7:0x016b,\n0x00d8:0x017e,\n0x00d9:0x2518,\n0x00da:0x250c,\n0x00db:0x2588,\n0x00dc:0x2584,\n0x00dd:0x258c,\n0x00de:0x2590,\n0x00df:0x2580,\n0x00e0:0x00d3,\n0x00e1:0x00df,\n0x00e2:0x014c,\n0x00e3:0x0143,\n0x00e4:0x00f5,\n0x00e5:0x00d5,\n0x00e6:0x00b5,\n0x00e7:0x0144,\n0x00e8:0x0136,\n0x00e9:0x0137,\n0x00ea:0x013b,\n0x00eb:0x013c,\n0x00ec:0x0146,\n0x00ed:0x0112,\n0x00ee:0x0145,\n0x00ef:0x2019,\n0x00f0:0x00ad,\n0x00f1:0x00b1,\n0x00f2:0x201c,\n0x00f3:0x00be,\n0x00f4:0x00b6,\n0x00f5:0x00a7,\n0x00f6:0x00f7,\n0x00f7:0x201e,\n0x00f8:0x00b0,\n0x00f9:0x2219,\n0x00fa:0x00b7,\n0x00fb:0x00b9,\n0x00fc:0x00b3,\n0x00fd:0x00b2,\n0x00fe:0x25a0,\n0x00ff:0x00a0,\n})\n\n\n\ndecoding_table=(\n'\\x00'\n'\\x01'\n'\\x02'\n'\\x03'\n'\\x04'\n'\\x05'\n'\\x06'\n'\\x07'\n'\\x08'\n'\\t'\n'\\n'\n'\\x0b'\n'\\x0c'\n'\\r'\n'\\x0e'\n'\\x0f'\n'\\x10'\n'\\x11'\n'\\x12'\n'\\x13'\n'\\x14'\n'\\x15'\n'\\x16'\n'\\x17'\n'\\x18'\n'\\x19'\n'\\x1a'\n'\\x1b'\n'\\x1c'\n'\\x1d'\n'\\x1e'\n'\\x1f'\n' '\n'!'\n'\"'\n'#'\n'$'\n'%'\n'&'\n\"'\"\n'('\n')'\n'*'\n'+'\n','\n'-'\n'.'\n'/'\n'0'\n'1'\n'2'\n'3'\n'4'\n'5'\n'6'\n'7'\n'8'\n'9'\n':'\n';'\n'<'\n'='\n'>'\n'?'\n'@'\n'A'\n'B'\n'C'\n'D'\n'E'\n'F'\n'G'\n'H'\n'I'\n'J'\n'K'\n'L'\n'M'\n'N'\n'O'\n'P'\n'Q'\n'R'\n'S'\n'T'\n'U'\n'V'\n'W'\n'X'\n'Y'\n'Z'\n'['\n'\\\\'\n']'\n'^'\n'_'\n'`'\n'a'\n'b'\n'c'\n'd'\n'e'\n'f'\n'g'\n'h'\n'i'\n'j'\n'k'\n'l'\n'm'\n'n'\n'o'\n'p'\n'q'\n'r'\n's'\n't'\n'u'\n'v'\n'w'\n'x'\n'y'\n'z'\n'{'\n'|'\n'}'\n'~'\n'\\x7f'\n'\\u0106'\n'\\xfc'\n'\\xe9'\n'\\u0101'\n'\\xe4'\n'\\u0123'\n'\\xe5'\n'\\u0107'\n'\\u0142'\n'\\u0113'\n'\\u0156'\n'\\u0157'\n'\\u012b'\n'\\u0179'\n'\\xc4'\n'\\xc5'\n'\\xc9'\n'\\xe6'\n'\\xc6'\n'\\u014d'\n'\\xf6'\n'\\u0122'\n'\\xa2'\n'\\u015a'\n'\\u015b'\n'\\xd6'\n'\\xdc'\n'\\xf8'\n'\\xa3'\n'\\xd8'\n'\\xd7'\n'\\xa4'\n'\\u0100'\n'\\u012a'\n'\\xf3'\n'\\u017b'\n'\\u017c'\n'\\u017a'\n'\\u201d'\n'\\xa6'\n'\\xa9'\n'\\xae'\n'\\xac'\n'\\xbd'\n'\\xbc'\n'\\u0141'\n'\\xab'\n'\\xbb'\n'\\u2591'\n'\\u2592'\n'\\u2593'\n'\\u2502'\n'\\u2524'\n'\\u0104'\n'\\u010c'\n'\\u0118'\n'\\u0116'\n'\\u2563'\n'\\u2551'\n'\\u2557'\n'\\u255d'\n'\\u012e'\n'\\u0160'\n'\\u2510'\n'\\u2514'\n'\\u2534'\n'\\u252c'\n'\\u251c'\n'\\u2500'\n'\\u253c'\n'\\u0172'\n'\\u016a'\n'\\u255a'\n'\\u2554'\n'\\u2569'\n'\\u2566'\n'\\u2560'\n'\\u2550'\n'\\u256c'\n'\\u017d'\n'\\u0105'\n'\\u010d'\n'\\u0119'\n'\\u0117'\n'\\u012f'\n'\\u0161'\n'\\u0173'\n'\\u016b'\n'\\u017e'\n'\\u2518'\n'\\u250c'\n'\\u2588'\n'\\u2584'\n'\\u258c'\n'\\u2590'\n'\\u2580'\n'\\xd3'\n'\\xdf'\n'\\u014c'\n'\\u0143'\n'\\xf5'\n'\\xd5'\n'\\xb5'\n'\\u0144'\n'\\u0136'\n'\\u0137'\n'\\u013b'\n'\\u013c'\n'\\u0146'\n'\\u0112'\n'\\u0145'\n'\\u2019'\n'\\xad'\n'\\xb1'\n'\\u201c'\n'\\xbe'\n'\\xb6'\n'\\xa7'\n'\\xf7'\n'\\u201e'\n'\\xb0'\n'\\u2219'\n'\\xb7'\n'\\xb9'\n'\\xb3'\n'\\xb2'\n'\\u25a0'\n'\\xa0'\n)\n\n\n\nencoding_map={\n0x0000:0x0000,\n0x0001:0x0001,\n0x0002:0x0002,\n0x0003:0x0003,\n0x0004:0x0004,\n0x0005:0x0005,\n0x0006:0x0006,\n0x0007:0x0007,\n0x0008:0x0008,\n0x0009:0x0009,\n0x000a:0x000a,\n0x000b:0x000b,\n0x000c:0x000c,\n0x000d:0x000d,\n0x000e:0x000e,\n0x000f:0x000f,\n0x0010:0x0010,\n0x0011:0x0011,\n0x0012:0x0012,\n0x0013:0x0013,\n0x0014:0x0014,\n0x0015:0x0015,\n0x0016:0x0016,\n0x0017:0x0017,\n0x0018:0x0018,\n0x0019:0x0019,\n0x001a:0x001a,\n0x001b:0x001b,\n0x001c:0x001c,\n0x001d:0x001d,\n0x001e:0x001e,\n0x001f:0x001f,\n0x0020:0x0020,\n0x0021:0x0021,\n0x0022:0x0022,\n0x0023:0x0023,\n0x0024:0x0024,\n0x0025:0x0025,\n0x0026:0x0026,\n0x0027:0x0027,\n0x0028:0x0028,\n0x0029:0x0029,\n0x002a:0x002a,\n0x002b:0x002b,\n0x002c:0x002c,\n0x002d:0x002d,\n0x002e:0x002e,\n0x002f:0x002f,\n0x0030:0x0030,\n0x0031:0x0031,\n0x0032:0x0032,\n0x0033:0x0033,\n0x0034:0x0034,\n0x0035:0x0035,\n0x0036:0x0036,\n0x0037:0x0037,\n0x0038:0x0038,\n0x0039:0x0039,\n0x003a:0x003a,\n0x003b:0x003b,\n0x003c:0x003c,\n0x003d:0x003d,\n0x003e:0x003e,\n0x003f:0x003f,\n0x0040:0x0040,\n0x0041:0x0041,\n0x0042:0x0042,\n0x0043:0x0043,\n0x0044:0x0044,\n0x0045:0x0045,\n0x0046:0x0046,\n0x0047:0x0047,\n0x0048:0x0048,\n0x0049:0x0049,\n0x004a:0x004a,\n0x004b:0x004b,\n0x004c:0x004c,\n0x004d:0x004d,\n0x004e:0x004e,\n0x004f:0x004f,\n0x0050:0x0050,\n0x0051:0x0051,\n0x0052:0x0052,\n0x0053:0x0053,\n0x0054:0x0054,\n0x0055:0x0055,\n0x0056:0x0056,\n0x0057:0x0057,\n0x0058:0x0058,\n0x0059:0x0059,\n0x005a:0x005a,\n0x005b:0x005b,\n0x005c:0x005c,\n0x005d:0x005d,\n0x005e:0x005e,\n0x005f:0x005f,\n0x0060:0x0060,\n0x0061:0x0061,\n0x0062:0x0062,\n0x0063:0x0063,\n0x0064:0x0064,\n0x0065:0x0065,\n0x0066:0x0066,\n0x0067:0x0067,\n0x0068:0x0068,\n0x0069:0x0069,\n0x006a:0x006a,\n0x006b:0x006b,\n0x006c:0x006c,\n0x006d:0x006d,\n0x006e:0x006e,\n0x006f:0x006f,\n0x0070:0x0070,\n0x0071:0x0071,\n0x0072:0x0072,\n0x0073:0x0073,\n0x0074:0x0074,\n0x0075:0x0075,\n0x0076:0x0076,\n0x0077:0x0077,\n0x0078:0x0078,\n0x0079:0x0079,\n0x007a:0x007a,\n0x007b:0x007b,\n0x007c:0x007c,\n0x007d:0x007d,\n0x007e:0x007e,\n0x007f:0x007f,\n0x00a0:0x00ff,\n0x00a2:0x0096,\n0x00a3:0x009c,\n0x00a4:0x009f,\n0x00a6:0x00a7,\n0x00a7:0x00f5,\n0x00a9:0x00a8,\n0x00ab:0x00ae,\n0x00ac:0x00aa,\n0x00ad:0x00f0,\n0x00ae:0x00a9,\n0x00b0:0x00f8,\n0x00b1:0x00f1,\n0x00b2:0x00fd,\n0x00b3:0x00fc,\n0x00b5:0x00e6,\n0x00b6:0x00f4,\n0x00b7:0x00fa,\n0x00b9:0x00fb,\n0x00bb:0x00af,\n0x00bc:0x00ac,\n0x00bd:0x00ab,\n0x00be:0x00f3,\n0x00c4:0x008e,\n0x00c5:0x008f,\n0x00c6:0x0092,\n0x00c9:0x0090,\n0x00d3:0x00e0,\n0x00d5:0x00e5,\n0x00d6:0x0099,\n0x00d7:0x009e,\n0x00d8:0x009d,\n0x00dc:0x009a,\n0x00df:0x00e1,\n0x00e4:0x0084,\n0x00e5:0x0086,\n0x00e6:0x0091,\n0x00e9:0x0082,\n0x00f3:0x00a2,\n0x00f5:0x00e4,\n0x00f6:0x0094,\n0x00f7:0x00f6,\n0x00f8:0x009b,\n0x00fc:0x0081,\n0x0100:0x00a0,\n0x0101:0x0083,\n0x0104:0x00b5,\n0x0105:0x00d0,\n0x0106:0x0080,\n0x0107:0x0087,\n0x010c:0x00b6,\n0x010d:0x00d1,\n0x0112:0x00ed,\n0x0113:0x0089,\n0x0116:0x00b8,\n0x0117:0x00d3,\n0x0118:0x00b7,\n0x0119:0x00d2,\n0x0122:0x0095,\n0x0123:0x0085,\n0x012a:0x00a1,\n0x012b:0x008c,\n0x012e:0x00bd,\n0x012f:0x00d4,\n0x0136:0x00e8,\n0x0137:0x00e9,\n0x013b:0x00ea,\n0x013c:0x00eb,\n0x0141:0x00ad,\n0x0142:0x0088,\n0x0143:0x00e3,\n0x0144:0x00e7,\n0x0145:0x00ee,\n0x0146:0x00ec,\n0x014c:0x00e2,\n0x014d:0x0093,\n0x0156:0x008a,\n0x0157:0x008b,\n0x015a:0x0097,\n0x015b:0x0098,\n0x0160:0x00be,\n0x0161:0x00d5,\n0x016a:0x00c7,\n0x016b:0x00d7,\n0x0172:0x00c6,\n0x0173:0x00d6,\n0x0179:0x008d,\n0x017a:0x00a5,\n0x017b:0x00a3,\n0x017c:0x00a4,\n0x017d:0x00cf,\n0x017e:0x00d8,\n0x2019:0x00ef,\n0x201c:0x00f2,\n0x201d:0x00a6,\n0x201e:0x00f7,\n0x2219:0x00f9,\n0x2500:0x00c4,\n0x2502:0x00b3,\n0x250c:0x00da,\n0x2510:0x00bf,\n0x2514:0x00c0,\n0x2518:0x00d9,\n0x251c:0x00c3,\n0x2524:0x00b4,\n0x252c:0x00c2,\n0x2534:0x00c1,\n0x253c:0x00c5,\n0x2550:0x00cd,\n0x2551:0x00ba,\n0x2554:0x00c9,\n0x2557:0x00bb,\n0x255a:0x00c8,\n0x255d:0x00bc,\n0x2560:0x00cc,\n0x2563:0x00b9,\n0x2566:0x00cb,\n0x2569:0x00ca,\n0x256c:0x00ce,\n0x2580:0x00df,\n0x2584:0x00dc,\n0x2588:0x00db,\n0x258c:0x00dd,\n0x2590:0x00de,\n0x2591:0x00b0,\n0x2592:0x00b1,\n0x2593:0x00b2,\n0x25a0:0x00fe,\n}\n"], "multiprocessing.dummy": [".py", "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n__all__=[\n'Process','current_process','active_children','freeze_support',\n'Lock','RLock','Semaphore','BoundedSemaphore','Condition',\n'Event','Barrier','Queue','Manager','Pipe','Pool','JoinableQueue'\n]\n\n\n\n\n\nimport threading\nimport sys\nimport weakref\n\n\n\nfrom multiprocessing.dummy.connection import Pipe\nfrom threading import Lock,RLock,Semaphore,BoundedSemaphore\nfrom threading import Event,Condition,Barrier\nfrom queue import Queue\n\n\n\n\n\nclass DummyProcess(threading.Thread):\n\n def __init__(self,group=None ,target=None ,name=None ,args=(),kwargs={}):\n threading.Thread.__init__(self,group,target,name,args,kwargs)\n self._pid=None\n self._children=weakref.WeakKeyDictionary()\n self._start_called=False\n self._parent=current_process()\n \n def start(self):\n assert self._parent is current_process()\n self._start_called=True\n if hasattr(self._parent,'_children'):\n self._parent._children[self]=None\n threading.Thread.start(self)\n \n @property\n def exitcode(self):\n if self._start_called and not self.is_alive():\n return 0\n else :\n return None\n \n \n \n \n \nProcess=DummyProcess\ncurrent_process=threading.current_thread\ncurrent_process()._children=weakref.WeakKeyDictionary()\n\ndef active_children():\n children=current_process()._children\n for p in list(children):\n if not p.is_alive():\n children.pop(p,None )\n return list(children)\n \ndef freeze_support():\n pass\n \n \n \n \n \nclass Namespace(object):\n def __init__(self,**kwds):\n self.__dict__.update(kwds)\n def __repr__(self):\n items=list(self.__dict__.items())\n temp=[]\n for name,value in items:\n if not name.startswith('_'):\n temp.append('%s=%r'%(name,value))\n temp.sort()\n return'Namespace(%s)'%str.join(', ',temp)\n \ndict=dict\nlist=list\n\n\n\n\n\nclass Value(object):\n def __init__(self,typecode,value,lock=True ):\n self._typecode=typecode\n self._value=value\n def _get(self):\n return self._value\n def _set(self,value):\n self._value=value\n value=property(_get,_set)\n def __repr__(self):\n return'<%r(%r, %r)>'%(type(self).__name__,self._typecode,self._value)\n \ndef Manager():\n return sys.modules[__name__]\n \ndef shutdown():\n pass\n \ndef Pool(processes=None ,initializer=None ,initargs=()):\n from multiprocessing.pool import ThreadPool\n return ThreadPool(processes,initializer,initargs)\n \nJoinableQueue=Queue\n", 1], "xml.dom.expatbuilder": [".py", "''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfrom xml.dom import xmlbuilder,minidom,Node\nfrom xml.dom import EMPTY_NAMESPACE,EMPTY_PREFIX,XMLNS_NAMESPACE\nfrom xml.parsers import expat\nfrom xml.dom.minidom import _append_child,_set_attribute_node\nfrom xml.dom.NodeFilter import NodeFilter\n\nTEXT_NODE=Node.TEXT_NODE\nCDATA_SECTION_NODE=Node.CDATA_SECTION_NODE\nDOCUMENT_NODE=Node.DOCUMENT_NODE\n\nFILTER_ACCEPT=xmlbuilder.DOMBuilderFilter.FILTER_ACCEPT\nFILTER_REJECT=xmlbuilder.DOMBuilderFilter.FILTER_REJECT\nFILTER_SKIP=xmlbuilder.DOMBuilderFilter.FILTER_SKIP\nFILTER_INTERRUPT=xmlbuilder.DOMBuilderFilter.FILTER_INTERRUPT\n\ntheDOMImplementation=minidom.getDOMImplementation()\n\n\n_typeinfo_map={\n\"CDATA\":minidom.TypeInfo(None ,\"cdata\"),\n\"ENUM\":minidom.TypeInfo(None ,\"enumeration\"),\n\"ENTITY\":minidom.TypeInfo(None ,\"entity\"),\n\"ENTITIES\":minidom.TypeInfo(None ,\"entities\"),\n\"ID\":minidom.TypeInfo(None ,\"id\"),\n\"IDREF\":minidom.TypeInfo(None ,\"idref\"),\n\"IDREFS\":minidom.TypeInfo(None ,\"idrefs\"),\n\"NMTOKEN\":minidom.TypeInfo(None ,\"nmtoken\"),\n\"NMTOKENS\":minidom.TypeInfo(None ,\"nmtokens\"),\n}\n\nclass ElementInfo(object):\n __slots__='_attr_info','_model','tagName'\n \n def __init__(self,tagName,model=None ):\n self.tagName=tagName\n self._attr_info=[]\n self._model=model\n \n def __getstate__(self):\n return self._attr_info,self._model,self.tagName\n \n def __setstate__(self,state):\n self._attr_info,self._model,self.tagName=state\n \n def getAttributeType(self,aname):\n for info in self._attr_info:\n if info[1]==aname:\n t=info[-2]\n if t[0]==\"(\":\n return _typeinfo_map[\"ENUM\"]\n else :\n return _typeinfo_map[info[-2]]\n return minidom._no_type\n \n def getAttributeTypeNS(self,namespaceURI,localName):\n return minidom._no_type\n \n def isElementContent(self):\n if self._model:\n type=self._model[0]\n return type not in (expat.model.XML_CTYPE_ANY,\n expat.model.XML_CTYPE_MIXED)\n else :\n return False\n \n def isEmpty(self):\n if self._model:\n return self._model[0]==expat.model.XML_CTYPE_EMPTY\n else :\n return False\n \n def isId(self,aname):\n for info in self._attr_info:\n if info[1]==aname:\n return info[-2]==\"ID\"\n return False\n \n def isIdNS(self,euri,ename,auri,aname):\n \n return self.isId((auri,aname))\n \ndef _intern(builder,s):\n return builder._intern_setdefault(s,s)\n \ndef _parse_ns_name(builder,name):\n assert' 'in name\n parts=name.split(' ')\n intern=builder._intern_setdefault\n if len(parts)==3:\n uri,localname,prefix=parts\n prefix=intern(prefix,prefix)\n qname=\"%s:%s\"%(prefix,localname)\n qname=intern(qname,qname)\n localname=intern(localname,localname)\n else :\n uri,localname=parts\n prefix=EMPTY_PREFIX\n qname=localname=intern(localname,localname)\n return intern(uri,uri),localname,prefix,qname\n \n \nclass ExpatBuilder:\n ''\n \n \n def __init__(self,options=None ):\n if options is None :\n options=xmlbuilder.Options()\n self._options=options\n if self._options.filter is not None :\n self._filter=FilterVisibilityController(self._options.filter)\n else :\n self._filter=None\n \n \n self._finish_start_element=id\n self._parser=None\n self.reset()\n \n def createParser(self):\n ''\n return expat.ParserCreate()\n \n def getParser(self):\n ''\n if not self._parser:\n self._parser=self.createParser()\n self._intern_setdefault=self._parser.intern.setdefault\n self._parser.buffer_text=True\n self._parser.ordered_attributes=True\n self._parser.specified_attributes=True\n self.install(self._parser)\n return self._parser\n \n def reset(self):\n ''\n self.document=theDOMImplementation.createDocument(\n EMPTY_NAMESPACE,None ,None )\n self.curNode=self.document\n self._elem_info=self.document._elem_info\n self._cdata=False\n \n def install(self,parser):\n ''\n \n parser.StartDoctypeDeclHandler=self.start_doctype_decl_handler\n parser.StartElementHandler=self.first_element_handler\n parser.EndElementHandler=self.end_element_handler\n parser.ProcessingInstructionHandler=self.pi_handler\n if self._options.entities:\n parser.EntityDeclHandler=self.entity_decl_handler\n parser.NotationDeclHandler=self.notation_decl_handler\n if self._options.comments:\n parser.CommentHandler=self.comment_handler\n if self._options.cdata_sections:\n parser.StartCdataSectionHandler=self.start_cdata_section_handler\n parser.EndCdataSectionHandler=self.end_cdata_section_handler\n parser.CharacterDataHandler=self.character_data_handler_cdata\n else :\n parser.CharacterDataHandler=self.character_data_handler\n parser.ExternalEntityRefHandler=self.external_entity_ref_handler\n parser.XmlDeclHandler=self.xml_decl_handler\n parser.ElementDeclHandler=self.element_decl_handler\n parser.AttlistDeclHandler=self.attlist_decl_handler\n \n def parseFile(self,file):\n ''\n \n parser=self.getParser()\n first_buffer=True\n try :\n while 1:\n buffer=file.read(16 *1024)\n if not buffer:\n break\n parser.Parse(buffer,0)\n if first_buffer and self.document.documentElement:\n self._setup_subset(buffer)\n first_buffer=False\n parser.Parse(\"\",True )\n except ParseEscape:\n pass\n doc=self.document\n self.reset()\n self._parser=None\n return doc\n \n def parseString(self,string):\n ''\n parser=self.getParser()\n try :\n parser.Parse(string,True )\n self._setup_subset(string)\n except ParseEscape:\n pass\n doc=self.document\n self.reset()\n self._parser=None\n return doc\n \n def _setup_subset(self,buffer):\n ''\n if self.document.doctype:\n extractor=InternalSubsetExtractor()\n extractor.parseString(buffer)\n subset=extractor.getSubset()\n self.document.doctype.internalSubset=subset\n \n def start_doctype_decl_handler(self,doctypeName,systemId,publicId,\n has_internal_subset):\n doctype=self.document.implementation.createDocumentType(\n doctypeName,publicId,systemId)\n doctype.ownerDocument=self.document\n _append_child(self.document,doctype)\n self.document.doctype=doctype\n if self._filter and self._filter.acceptNode(doctype)==FILTER_REJECT:\n self.document.doctype=None\n del self.document.childNodes[-1]\n doctype=None\n self._parser.EntityDeclHandler=None\n self._parser.NotationDeclHandler=None\n if has_internal_subset:\n if doctype is not None :\n doctype.entities._seq=[]\n doctype.notations._seq=[]\n self._parser.CommentHandler=None\n self._parser.ProcessingInstructionHandler=None\n self._parser.EndDoctypeDeclHandler=self.end_doctype_decl_handler\n \n def end_doctype_decl_handler(self):\n if self._options.comments:\n self._parser.CommentHandler=self.comment_handler\n self._parser.ProcessingInstructionHandler=self.pi_handler\n if not (self._elem_info or self._filter):\n self._finish_end_element=id\n \n def pi_handler(self,target,data):\n node=self.document.createProcessingInstruction(target,data)\n _append_child(self.curNode,node)\n if self._filter and self._filter.acceptNode(node)==FILTER_REJECT:\n self.curNode.removeChild(node)\n \n def character_data_handler_cdata(self,data):\n childNodes=self.curNode.childNodes\n if self._cdata:\n if (self._cdata_continue\n and childNodes[-1].nodeType ==CDATA_SECTION_NODE):\n childNodes[-1].appendData(data)\n return\n node=self.document.createCDATASection(data)\n self._cdata_continue=True\n elif childNodes and childNodes[-1].nodeType ==TEXT_NODE:\n node=childNodes[-1]\n value=node.data+data\n node.data=value\n return\n else :\n node=minidom.Text()\n node.data=data\n node.ownerDocument=self.document\n _append_child(self.curNode,node)\n \n def character_data_handler(self,data):\n childNodes=self.curNode.childNodes\n if childNodes and childNodes[-1].nodeType ==TEXT_NODE:\n node=childNodes[-1]\n node.data=node.data+data\n return\n node=minidom.Text()\n node.data=node.data+data\n node.ownerDocument=self.document\n _append_child(self.curNode,node)\n \n def entity_decl_handler(self,entityName,is_parameter_entity,value,\n base,systemId,publicId,notationName):\n if is_parameter_entity:\n \n return\n if not self._options.entities:\n return\n node=self.document._create_entity(entityName,publicId,\n systemId,notationName)\n if value is not None :\n \n \n child=self.document.createTextNode(value)\n node.childNodes.append(child)\n self.document.doctype.entities._seq.append(node)\n if self._filter and self._filter.acceptNode(node)==FILTER_REJECT:\n del self.document.doctype.entities._seq[-1]\n \n def notation_decl_handler(self,notationName,base,systemId,publicId):\n node=self.document._create_notation(notationName,publicId,systemId)\n self.document.doctype.notations._seq.append(node)\n if self._filter and self._filter.acceptNode(node)==FILTER_ACCEPT:\n del self.document.doctype.notations._seq[-1]\n \n def comment_handler(self,data):\n node=self.document.createComment(data)\n _append_child(self.curNode,node)\n if self._filter and self._filter.acceptNode(node)==FILTER_REJECT:\n self.curNode.removeChild(node)\n \n def start_cdata_section_handler(self):\n self._cdata=True\n self._cdata_continue=False\n \n def end_cdata_section_handler(self):\n self._cdata=False\n self._cdata_continue=False\n \n def external_entity_ref_handler(self,context,base,systemId,publicId):\n return 1\n \n def first_element_handler(self,name,attributes):\n if self._filter is None and not self._elem_info:\n self._finish_end_element=id\n self.getParser().StartElementHandler=self.start_element_handler\n self.start_element_handler(name,attributes)\n \n def start_element_handler(self,name,attributes):\n node=self.document.createElement(name)\n _append_child(self.curNode,node)\n self.curNode=node\n \n if attributes:\n for i in range(0,len(attributes),2):\n a=minidom.Attr(attributes[i],EMPTY_NAMESPACE,\n None ,EMPTY_PREFIX)\n value=attributes[i+1]\n a.value=value\n a.ownerDocument=self.document\n _set_attribute_node(node,a)\n \n if node is not self.document.documentElement:\n self._finish_start_element(node)\n \n def _finish_start_element(self,node):\n if self._filter:\n \n \n if node is self.document.documentElement:\n return\n filt=self._filter.startContainer(node)\n if filt ==FILTER_REJECT:\n \n Rejecter(self)\n elif filt ==FILTER_SKIP:\n \n \n Skipper(self)\n else :\n return\n self.curNode=node.parentNode\n node.parentNode.removeChild(node)\n node.unlink()\n \n \n \n \n def end_element_handler(self,name):\n curNode=self.curNode\n self.curNode=curNode.parentNode\n self._finish_end_element(curNode)\n \n def _finish_end_element(self,curNode):\n info=self._elem_info.get(curNode.tagName)\n if info:\n self._handle_white_text_nodes(curNode,info)\n if self._filter:\n if curNode is self.document.documentElement:\n return\n if self._filter.acceptNode(curNode)==FILTER_REJECT:\n self.curNode.removeChild(curNode)\n curNode.unlink()\n \n def _handle_white_text_nodes(self,node,info):\n if (self._options.whitespace_in_element_content\n or not info.isElementContent()):\n return\n \n \n \n \n L=[]\n for child in node.childNodes:\n if child.nodeType ==TEXT_NODE and not child.data.strip():\n L.append(child)\n \n \n for child in L:\n node.removeChild(child)\n \n def element_decl_handler(self,name,model):\n info=self._elem_info.get(name)\n if info is None :\n self._elem_info[name]=ElementInfo(name,model)\n else :\n assert info._model is None\n info._model=model\n \n def attlist_decl_handler(self,elem,name,type,default,required):\n info=self._elem_info.get(elem)\n if info is None :\n info=ElementInfo(elem)\n self._elem_info[elem]=info\n info._attr_info.append(\n [None ,name,None ,None ,default,0,type,required])\n \n def xml_decl_handler(self,version,encoding,standalone):\n self.document.version=version\n self.document.encoding=encoding\n \n if standalone >=0:\n if standalone:\n self.document.standalone=True\n else :\n self.document.standalone=False\n \n \n \n \n_ALLOWED_FILTER_RETURNS=(FILTER_ACCEPT,FILTER_REJECT,FILTER_SKIP)\n\nclass FilterVisibilityController(object):\n ''\n \n \n __slots__='filter',\n \n def __init__(self,filter):\n self.filter=filter\n \n def startContainer(self,node):\n mask=self._nodetype_mask[node.nodeType]\n if self.filter.whatToShow&mask:\n val=self.filter.startContainer(node)\n if val ==FILTER_INTERRUPT:\n raise ParseEscape\n if val not in _ALLOWED_FILTER_RETURNS:\n raise ValueError(\n \"startContainer() returned illegal value: \"+repr(val))\n return val\n else :\n return FILTER_ACCEPT\n \n def acceptNode(self,node):\n mask=self._nodetype_mask[node.nodeType]\n if self.filter.whatToShow&mask:\n val=self.filter.acceptNode(node)\n if val ==FILTER_INTERRUPT:\n raise ParseEscape\n if val ==FILTER_SKIP:\n \n parent=node.parentNode\n for child in node.childNodes[:]:\n parent.appendChild(child)\n \n return FILTER_REJECT\n if val not in _ALLOWED_FILTER_RETURNS:\n raise ValueError(\n \"acceptNode() returned illegal value: \"+repr(val))\n return val\n else :\n return FILTER_ACCEPT\n \n _nodetype_mask={\n Node.ELEMENT_NODE:NodeFilter.SHOW_ELEMENT,\n Node.ATTRIBUTE_NODE:NodeFilter.SHOW_ATTRIBUTE,\n Node.TEXT_NODE:NodeFilter.SHOW_TEXT,\n Node.CDATA_SECTION_NODE:NodeFilter.SHOW_CDATA_SECTION,\n Node.ENTITY_REFERENCE_NODE:NodeFilter.SHOW_ENTITY_REFERENCE,\n Node.ENTITY_NODE:NodeFilter.SHOW_ENTITY,\n Node.PROCESSING_INSTRUCTION_NODE:NodeFilter.SHOW_PROCESSING_INSTRUCTION,\n Node.COMMENT_NODE:NodeFilter.SHOW_COMMENT,\n Node.DOCUMENT_NODE:NodeFilter.SHOW_DOCUMENT,\n Node.DOCUMENT_TYPE_NODE:NodeFilter.SHOW_DOCUMENT_TYPE,\n Node.DOCUMENT_FRAGMENT_NODE:NodeFilter.SHOW_DOCUMENT_FRAGMENT,\n Node.NOTATION_NODE:NodeFilter.SHOW_NOTATION,\n }\n \n \nclass FilterCrutch(object):\n __slots__='_builder','_level','_old_start','_old_end'\n \n def __init__(self,builder):\n self._level=0\n self._builder=builder\n parser=builder._parser\n self._old_start=parser.StartElementHandler\n self._old_end=parser.EndElementHandler\n parser.StartElementHandler=self.start_element_handler\n parser.EndElementHandler=self.end_element_handler\n \nclass Rejecter(FilterCrutch):\n __slots__=()\n \n def __init__(self,builder):\n FilterCrutch.__init__(self,builder)\n parser=builder._parser\n for name in (\"ProcessingInstructionHandler\",\n \"CommentHandler\",\n \"CharacterDataHandler\",\n \"StartCdataSectionHandler\",\n \"EndCdataSectionHandler\",\n \"ExternalEntityRefHandler\",\n ):\n setattr(parser,name,None )\n \n def start_element_handler(self,*args):\n self._level=self._level+1\n \n def end_element_handler(self,*args):\n if self._level ==0:\n \n parser=self._builder._parser\n self._builder.install(parser)\n parser.StartElementHandler=self._old_start\n parser.EndElementHandler=self._old_end\n else :\n self._level=self._level -1\n \nclass Skipper(FilterCrutch):\n __slots__=()\n \n def start_element_handler(self,*args):\n node=self._builder.curNode\n self._old_start(*args)\n if self._builder.curNode is not node:\n self._level=self._level+1\n \n def end_element_handler(self,*args):\n if self._level ==0:\n \n \n self._builder._parser.StartElementHandler=self._old_start\n self._builder._parser.EndElementHandler=self._old_end\n self._builder=None\n else :\n self._level=self._level -1\n self._old_end(*args)\n \n \n \n \n \n_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID=\"http://xml.python.org/entities/fragment-builder/internal\"\n\n_FRAGMENT_BUILDER_TEMPLATE=(\n'''\\\n\n%%s\n]>\n&fragment-builder-internal;'''\n%_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID)\n\n\nclass FragmentBuilder(ExpatBuilder):\n ''\n\n\n\n\n\n \n \n def __init__(self,context,options=None ):\n if context.nodeType ==DOCUMENT_NODE:\n self.originalDocument=context\n self.context=context\n else :\n self.originalDocument=context.ownerDocument\n self.context=context\n ExpatBuilder.__init__(self,options)\n \n def reset(self):\n ExpatBuilder.reset(self)\n self.fragment=None\n \n def parseFile(self,file):\n ''\n \n return self.parseString(file.read())\n \n def parseString(self,string):\n ''\n \n self._source=string\n parser=self.getParser()\n doctype=self.originalDocument.doctype\n ident=\"\"\n if doctype:\n subset=doctype.internalSubset or self._getDeclarations()\n if doctype.publicId:\n ident=('PUBLIC \"%s\" \"%s\"'\n %(doctype.publicId,doctype.systemId))\n elif doctype.systemId:\n ident='SYSTEM \"%s\"'%doctype.systemId\n else :\n subset=\"\"\n nsattrs=self._getNSattrs()\n document=_FRAGMENT_BUILDER_TEMPLATE %(ident,subset,nsattrs)\n try :\n parser.Parse(document,1)\n except :\n self.reset()\n raise\n fragment=self.fragment\n self.reset()\n \n return fragment\n \n def _getDeclarations(self):\n ''\n\n\n\n \n doctype=self.context.ownerDocument.doctype\n s=\"\"\n if doctype:\n for i in range(doctype.notations.length):\n notation=doctype.notations.item(i)\n if s:\n s=s+\"\\n \"\n s=\"%s' %(s,notation.publicId,notation.systemId)\n else :\n s='%s SYSTEM \"%s\">'%(s,notation.systemId)\n for i in range(doctype.entities.length):\n entity=doctype.entities.item(i)\n if s:\n s=s+\"\\n \"\n s=\"%s\"\n return s\n \n def _getNSattrs(self):\n return\"\"\n \n def external_entity_ref_handler(self,context,base,systemId,publicId):\n if systemId ==_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID:\n \n \n old_document=self.document\n old_cur_node=self.curNode\n parser=self._parser.ExternalEntityParserCreate(context)\n \n self.document=self.originalDocument\n self.fragment=self.document.createDocumentFragment()\n self.curNode=self.fragment\n try :\n parser.Parse(self._source,1)\n finally :\n self.curNode=old_cur_node\n self.document=old_document\n self._source=None\n return -1\n else :\n return ExpatBuilder.external_entity_ref_handler(\n self,context,base,systemId,publicId)\n \n \nclass Namespaces:\n ''\n \n def _initNamespaces(self):\n \n \n self._ns_ordered_prefixes=[]\n \n def createParser(self):\n ''\n parser=expat.ParserCreate(namespace_separator=\" \")\n parser.namespace_prefixes=True\n return parser\n \n def install(self,parser):\n ''\n ExpatBuilder.install(self,parser)\n if self._options.namespace_declarations:\n parser.StartNamespaceDeclHandler=(\n self.start_namespace_decl_handler)\n \n def start_namespace_decl_handler(self,prefix,uri):\n ''\n self._ns_ordered_prefixes.append((prefix,uri))\n \n def start_element_handler(self,name,attributes):\n if' 'in name:\n uri,localname,prefix,qname=_parse_ns_name(self,name)\n else :\n uri=EMPTY_NAMESPACE\n qname=name\n localname=None\n prefix=EMPTY_PREFIX\n node=minidom.Element(qname,uri,prefix,localname)\n node.ownerDocument=self.document\n _append_child(self.curNode,node)\n self.curNode=node\n \n if self._ns_ordered_prefixes:\n for prefix,uri in self._ns_ordered_prefixes:\n if prefix:\n a=minidom.Attr(_intern(self,'xmlns:'+prefix),\n XMLNS_NAMESPACE,prefix,\"xmlns\")\n else :\n a=minidom.Attr(\"xmlns\",XMLNS_NAMESPACE,\n \"xmlns\",EMPTY_PREFIX)\n a.value=uri\n a.ownerDocument=self.document\n _set_attribute_node(node,a)\n del self._ns_ordered_prefixes[:]\n \n if attributes:\n node._ensure_attributes()\n _attrs=node._attrs\n _attrsNS=node._attrsNS\n for i in range(0,len(attributes),2):\n aname=attributes[i]\n value=attributes[i+1]\n if' 'in aname:\n uri,localname,prefix,qname=_parse_ns_name(self,aname)\n a=minidom.Attr(qname,uri,localname,prefix)\n _attrs[qname]=a\n _attrsNS[(uri,localname)]=a\n else :\n a=minidom.Attr(aname,EMPTY_NAMESPACE,\n aname,EMPTY_PREFIX)\n _attrs[aname]=a\n _attrsNS[(EMPTY_NAMESPACE,aname)]=a\n a.ownerDocument=self.document\n a.value=value\n a.ownerElement=node\n \n if __debug__:\n \n \n \n \n \n def end_element_handler(self,name):\n curNode=self.curNode\n if' 'in name:\n uri,localname,prefix,qname=_parse_ns_name(self,name)\n assert (curNode.namespaceURI ==uri\n and curNode.localName ==localname\n and curNode.prefix ==prefix), \"element stack messed up! (namespace)\"\n else :\n assert curNode.nodeName ==name, \"element stack messed up - bad nodeName\"\n assert curNode.namespaceURI ==EMPTY_NAMESPACE, \"element stack messed up - bad namespaceURI\"\n self.curNode=curNode.parentNode\n self._finish_end_element(curNode)\n \n \nclass ExpatBuilderNS(Namespaces,ExpatBuilder):\n ''\n \n def reset(self):\n ExpatBuilder.reset(self)\n self._initNamespaces()\n \n \nclass FragmentBuilderNS(Namespaces,FragmentBuilder):\n ''\n \n def reset(self):\n FragmentBuilder.reset(self)\n self._initNamespaces()\n \n def _getNSattrs(self):\n ''\n \n \n \n \n \n \n attrs=\"\"\n context=self.context\n L=[]\n while context:\n if hasattr(context,'_ns_prefix_uri'):\n for prefix,uri in context._ns_prefix_uri.items():\n \n if prefix in L:\n continue\n L.append(prefix)\n if prefix:\n declname=\"xmlns:\"+prefix\n else :\n declname=\"xmlns\"\n if attrs:\n attrs=\"%s\\n %s='%s'\"%(attrs,declname,uri)\n else :\n attrs=\" %s='%s'\"%(declname,uri)\n context=context.parentNode\n return attrs\n \n \nclass ParseEscape(Exception):\n ''\n pass\n \nclass InternalSubsetExtractor(ExpatBuilder):\n ''\n \n subset=None\n \n def getSubset(self):\n ''\n return self.subset\n \n def parseFile(self,file):\n try :\n ExpatBuilder.parseFile(self,file)\n except ParseEscape:\n pass\n \n def parseString(self,string):\n try :\n ExpatBuilder.parseString(self,string)\n except ParseEscape:\n pass\n \n def install(self,parser):\n parser.StartDoctypeDeclHandler=self.start_doctype_decl_handler\n parser.StartElementHandler=self.start_element_handler\n \n def start_doctype_decl_handler(self,name,publicId,systemId,\n has_internal_subset):\n if has_internal_subset:\n parser=self.getParser()\n self.subset=[]\n parser.DefaultHandler=self.subset.append\n parser.EndDoctypeDeclHandler=self.end_doctype_decl_handler\n else :\n raise ParseEscape()\n \n def end_doctype_decl_handler(self):\n s=''.join(self.subset).replace('\\r\\n','\\n').replace('\\r','\\n')\n self.subset=s\n raise ParseEscape()\n \n def start_element_handler(self,name,attrs):\n raise ParseEscape()\n \n \ndef parse(file,namespaces=True ):\n ''\n\n\n \n if namespaces:\n builder=ExpatBuilderNS()\n else :\n builder=ExpatBuilder()\n \n if isinstance(file,str):\n fp=open(file,'rb')\n try :\n result=builder.parseFile(fp)\n finally :\n fp.close()\n else :\n result=builder.parseFile(file)\n return result\n \n \ndef parseString(string,namespaces=True ):\n ''\n\n \n if namespaces:\n builder=ExpatBuilderNS()\n else :\n builder=ExpatBuilder()\n return builder.parseString(string)\n \n \ndef parseFragment(file,context,namespaces=True ):\n ''\n\n\n\n\n \n if namespaces:\n builder=FragmentBuilderNS(context)\n else :\n builder=FragmentBuilder(context)\n \n if isinstance(file,str):\n fp=open(file,'rb')\n try :\n result=builder.parseFile(fp)\n finally :\n fp.close()\n else :\n result=builder.parseFile(file)\n return result\n \n \ndef parseFragmentString(string,context,namespaces=True ):\n ''\n\n\n \n if namespaces:\n builder=FragmentBuilderNS(context)\n else :\n builder=FragmentBuilder(context)\n return builder.parseString(string)\n \n \ndef makeBuilder(options):\n ''\n if options.namespaces:\n return ExpatBuilderNS(options)\n else :\n return ExpatBuilder(options)\n"], "asyncio.coroutines": [".py", "__all__=['coroutine',\n'iscoroutinefunction','iscoroutine']\n\nimport functools\nimport inspect\nimport opcode\nimport os\nimport sys\nimport traceback\nimport types\n\nfrom .import events\nfrom .import futures\nfrom .log import logger\n\n\n\n_YIELD_FROM=opcode.opmap['YIELD_FROM']\n\n\n\n\n\n\n\n\n\n\n_DEBUG=(not sys.flags.ignore_environment\nand bool(os.environ.get('PYTHONASYNCIODEBUG')))\n\n\n\ndef has_yield_from_bug():\n class MyGen:\n def __init__(self):\n self.send_args=None\n def __iter__(self):\n return self\n def __next__(self):\n return 42\n def send(self,*what):\n self.send_args=what\n return None\n def yield_from_gen(gen):\n yield from gen\n value=(1,2,3)\n gen=MyGen()\n coro=yield_from_gen(gen)\n next(coro)\n coro.send(value)\n return gen.send_args !=(value,)\n_YIELD_FROM_BUG=has_yield_from_bug()\ndel has_yield_from_bug\n\n\nclass CoroWrapper:\n\n\n def __init__(self,gen,func):\n assert inspect.isgenerator(gen),gen\n self.gen=gen\n self.func=func\n self._source_traceback=traceback.extract_stack(sys._getframe(1))\n \n \n \n def __repr__(self):\n coro_repr=_format_coroutine(self)\n if self._source_traceback:\n frame=self._source_traceback[-1]\n coro_repr +=', created at %s:%s'%(frame[0],frame[1])\n return'<%s %s>'%(self.__class__.__name__,coro_repr)\n \n def __iter__(self):\n return self\n \n def __next__(self):\n return next(self.gen)\n \n if _YIELD_FROM_BUG:\n \n \n \n \n def send(self,*value):\n frame=sys._getframe()\n caller=frame.f_back\n assert caller.f_lasti >=0\n if caller.f_code.co_code[caller.f_lasti]!=_YIELD_FROM:\n value=value[0]\n return self.gen.send(value)\n else :\n def send(self,value):\n return self.gen.send(value)\n \n def throw(self,exc):\n return self.gen.throw(exc)\n \n def close(self):\n return self.gen.close()\n \n @property\n def gi_frame(self):\n return None\n \n \n @property\n def gi_running(self):\n return self.gen.gi_running\n \n @property\n def gi_code(self):\n return self.gen.__code__\n \n def __del__(self):\n \n gen=getattr(self,'gen',None )\n frame=getattr(gen,'gi_frame',None )\n if frame is not None and frame.f_lasti ==-1:\n msg='%r was never yielded from'%self\n tb=getattr(self,'_source_traceback',())\n if tb:\n tb=''.join(traceback.format_list(tb))\n msg +=('\\nCoroutine object created at '\n '(most recent call last):\\n')\n msg +=tb.rstrip()\n logger.error(msg)\n \n \ndef coroutine(func):\n ''\n\n\n\n \n if inspect.isgeneratorfunction(func):\n coro=func\n else :\n @functools.wraps(func)\n def coro(*args,**kw):\n res=func(*args,**kw)\n if isinstance(res,futures.Future)or inspect.isgenerator(res):\n res=yield from res\n res.gi_frame=None\n return res\n \n if not _DEBUG:\n wrapper=coro\n else :\n @functools.wraps(func)\n def wrapper(*args,**kwds):\n w=CoroWrapper(coro(*args,**kwds),func)\n if w._source_traceback:\n del w._source_traceback[-1]\n w.__name__=func.__name__\n if hasattr(func,'__qualname__'):\n w.__qualname__=func.__qualname__\n w.__doc__=func.__doc__\n return w\n \n wrapper.gi_frame=None\n wrapper._is_coroutine=True\n return wrapper\n \n \ndef iscoroutinefunction(func):\n ''\n return getattr(func,'_is_coroutine',False )\n \n \n_COROUTINE_TYPES=(types.GeneratorType,CoroWrapper)\n\ndef iscoroutine(obj):\n ''\n return isinstance(obj,_COROUTINE_TYPES)\n \n \ndef _format_coroutine(coro):\n try :\n assert iscoroutine(coro)\n coro_name=getattr(coro,'__qualname__',coro.__name__)\n \n filename=coro.__code__.co_filename\n if (isinstance(coro,CoroWrapper)\n and not inspect.isgeneratorfunction(coro.func)):\n filename,lineno=events._get_function_source(coro.func)\n if coro.gi_frame is None :\n coro_repr=('%s() done, defined at %s:%s'\n %(coro_name,filename,lineno))\n else :\n coro_repr=('%s() running, defined at %s:%s'\n %(coro_name,filename,lineno))\n elif coro.gi_frame is not None :\n lineno=coro.gi_frame.f_lineno\n coro_repr=('%s() running at %s:%s'\n %(coro_name,filename,lineno))\n else :\n lineno=coro.__code__.co_firstlineno\n coro_repr=('%s() done, defined at %s:%s'\n %(coro_name,filename,lineno))\n except :\n coro_repr=\"Coroutine: %s\"%coro_name\n return coro_repr\n"], "posix": [".py", "''\n\n\n\n\nimport datetime\n\nfrom browser import window\n\ndef _randint(a,b):\n return int(window.Math.random()*(b -a+1)+a)\n \nF_OK=0\n\nO_APPEND=8\n\nO_BINARY=32768\n\nO_CREAT=256\n\nO_EXCL=1024\n\nO_NOINHERIT=128\n\nO_RANDOM=16\n\nO_RDONLY=0\n\nO_RDWR=2\n\nO_SEQUENTIAL=32\n\nO_SHORT_LIVED=4096\n\nO_TEMPORARY=64\n\nO_TEXT=16384\n\nO_TRUNC=512\n\nO_WRONLY=1\n\nP_DETACH=4\n\nP_NOWAIT=1\n\nP_NOWAITO=3\n\nP_OVERLAY=2\n\nP_WAIT=0\n\nR_OK=4\n\nTMP_MAX=32767\n\nW_OK=2\n\nX_OK=1\n\nclass __loader__:\n pass\n \ndef _exit(*args,**kw):\n ''\n \n pass\n \ndef _getdiskusage(*args,**kw):\n ''\n \n pass\n \ndef _getfileinformation(*args,**kw):\n pass\n \ndef _getfinalpathname(*args,**kw):\n pass\n \ndef _getfullpathname(*args,**kw):\n pass\n \n_have_functions=['MS_WINDOWS']\n\ndef _isdir(*args,**kw):\n ''\n pass\n \ndef abort(*args,**kw):\n ''\n\n \n pass\n \ndef access(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef chdir(*args,**kw):\n ''\n\n\n\n\n \n pass\n \ndef chmod(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef close(*args,**kw):\n ''\n \n pass\n \ndef closerange(*args,**kw):\n ''\n \n pass\n \ndef device_encoding(*args,**kw):\n ''\n\n \n pass\n \ndef dup(*args,**kw):\n ''\n \n pass\n \ndef dup2(*args,**kw):\n ''\n \n pass\n \nenviron={'PYTHONUSERBASE':' '}\n\nerror=OSError\n\ndef execv(*args,**kw):\n ''\n\n\n\n \n pass\n \ndef execve(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n \n pass\n \ndef fstat(*args,**kw):\n ''\n\n \n pass\n \ndef fsync(*args,**kw):\n ''\n \n pass\n \ndef get_terminal_size(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef getcwd(*args,**kw):\n ''\n \n return __BRYTHON__.brython_path\n \ndef getcwdb(*args,**kw):\n ''\n \n pass\n \ndef getlogin(*args,**kw):\n ''\n \n pass\n \ndef getpid(*args,**kw):\n ''\n \n return 0\n \ndef getppid(*args,**kw):\n ''\n\n\n \n pass\n \ndef isatty(*args,**kw):\n ''\n\n \n pass\n \ndef kill(*args,**kw):\n ''\n \n pass\n \ndef link(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef listdir(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef lseek(*args,**kw):\n ''\n\n \n pass\n \ndef lstat(*args,**kw):\n ''\n\n \n return stat_result()\n \ndef mkdir(*args,**kw):\n ''\n\n\n\n\n\n\n\n \n pass\n \ndef open(path,flags,mode=0o777,*args,dir_fd=None ):\n ''\n\n\n\n\n\n \n \n \n from browser.local_storage import storage\n \n class mystorage:\n def __init__(self,path,flags):\n self._path=path\n self._pos=0\n self._flags=flags\n \n if self._flags&O_RDONLY ==O_RDONLY:\n self._data=storage.get(self._path,None )\n if self._data is None :\n raise FileNotFoundError(\"%s not found\"%self._path)\n elif self._flags&O_WRONLY ==O_WRONLY:\n storage[self._path]=''\n \n def seek(self,pos):\n self._pos=pos\n \n def read(self,size=None ):\n if size is None :\n _result=self._data[self._pos:]\n self._pos=len(self._data)\n return _result\n \n assert size <=len(self._data)-self._pos\n _result=self._data[self._pos:self._pos+size]\n self._pos +=size\n return _result\n \n def write(self,data):\n storage[self._path]+=str(data)\n \n def close(self):\n pass\n \n return mystorage(path,flags)\n \ndef pipe(*args,**kw):\n ''\n \n pass\n \ndef putenv(*args,**kw):\n ''\n \n pass\n \ndef read(*args,**kw):\n ''\n \n pass\n \ndef readlink(*args,**kw):\n ''\n\n\n\n\n\n \n pass\n \ndef remove(*args,**kw):\n ''\n\n\n\n\n\n \n pass\n \ndef rename(*args,**kw):\n ''\n\n\n\n\n\n\n \n pass\n \ndef replace(*args,**kw):\n ''\n\n\n\n\n\n\n \n pass\n \ndef rmdir(*args,**kw):\n ''\n\n\n\n\n\n \n pass\n \ndef spawnv(*args,**kw):\n ''\n\n\n\n\n \n pass\n \ndef spawnve(*args,**kw):\n ''\n\n\n\n\n\n \n pass\n \ndef startfile(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef stat(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n \n return stat_result()\n \ndef stat_float_times(*args,**kw):\n ''\n\n\n\n\n \n pass\n \nclass stat_result:\n\n def __init__(self):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n self.st_atime=datetime.datetime.now()\n self.st_mtime=self.st_ctime=self.st_atime_ns= self.st_mtime_ns=self.st_ctime_ns=self.st_atime\n self.st_uid=self.st_gid=self.st_ino=-1\n self.st_mode=0\n self.st_size=1\n \nclass statvfs_result:\n pass\n \ndef strerror(*args,**kw):\n ''\n \n pass\n \ndef symlink(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef system(*args,**kw):\n ''\n \n pass\n \nclass terminal_size:\n pass\n \ndef times(*args,**kw):\n ''\n\n\n \n pass\n \nclass times_result:\n pass\n \ndef umask(*args,**kw):\n ''\n \n pass\n \nclass uname_result:\n pass\n \ndef unlink(path,*args,dir_fd=None ):\n ''\n\n\n\n\n\n \n pass\n \ndef urandom(n):\n ''\n \n randbytes=[_randint(0,255)for i in range(n)]\n return bytes(randbytes)\n \ndef utime(*args,**kw):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n pass\n \ndef waitpid(*args,**kw):\n ''\n \n pass\n \ndef write(*args,**kw):\n ''\n \n pass\n \n \n \ndef WIFSIGNALED(a):\n return False\n \ndef WTERMSIG(status):\n return 0\n \ndef WIFSIGNALED(status):\n ''\n return False\n \ndef WIFEXITED(status):\n return False\n \ndef WEXITSTATUS(status):\n pass\n \ndef WNOHANG():\n return (0,0)\n"], "xml.dom.minidom": [".py", "''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport io\nimport xml.dom\n\nfrom xml.dom import EMPTY_NAMESPACE,EMPTY_PREFIX,XMLNS_NAMESPACE,domreg\nfrom xml.dom.minicompat import *\nfrom xml.dom.xmlbuilder import DOMImplementationLS,DocumentLS\n\n\n\n\n\n\n_nodeTypes_with_children=(xml.dom.Node.ELEMENT_NODE,\nxml.dom.Node.ENTITY_REFERENCE_NODE)\n\n\nclass Node(xml.dom.Node):\n namespaceURI=None\n parentNode=None\n ownerDocument=None\n nextSibling=None\n previousSibling=None\n \n prefix=EMPTY_PREFIX\n \n def __bool__(self):\n return True\n \n def toxml(self,encoding=None ):\n return self.toprettyxml(\"\",\"\",encoding)\n \n def toprettyxml(self,indent=\"\\t\",newl=\"\\n\",encoding=None ):\n if encoding is None :\n writer=io.StringIO()\n else :\n writer=io.TextIOWrapper(io.BytesIO(),\n encoding=encoding,\n errors=\"xmlcharrefreplace\",\n newline='\\n')\n if self.nodeType ==Node.DOCUMENT_NODE:\n \n self.writexml(writer,\"\",indent,newl,encoding)\n else :\n self.writexml(writer,\"\",indent,newl)\n if encoding is None :\n return writer.getvalue()\n else :\n return writer.detach().getvalue()\n \n def hasChildNodes(self):\n return bool(self.childNodes)\n \n def _get_childNodes(self):\n return self.childNodes\n \n def _get_firstChild(self):\n if self.childNodes:\n return self.childNodes[0]\n \n def _get_lastChild(self):\n if self.childNodes:\n return self.childNodes[-1]\n \n def insertBefore(self,newChild,refChild):\n if newChild.nodeType ==self.DOCUMENT_FRAGMENT_NODE:\n for c in tuple(newChild.childNodes):\n self.insertBefore(c,refChild)\n \n return newChild\n if newChild.nodeType not in self._child_node_types:\n raise xml.dom.HierarchyRequestErr(\n \"%s cannot be child of %s\"%(repr(newChild),repr(self)))\n if newChild.parentNode is not None :\n newChild.parentNode.removeChild(newChild)\n if refChild is None :\n self.appendChild(newChild)\n else :\n try :\n index=self.childNodes.index(refChild)\n except ValueError:\n raise xml.dom.NotFoundErr()\n if newChild.nodeType in _nodeTypes_with_children:\n _clear_id_cache(self)\n self.childNodes.insert(index,newChild)\n newChild.nextSibling=refChild\n refChild.previousSibling=newChild\n if index:\n node=self.childNodes[index -1]\n node.nextSibling=newChild\n newChild.previousSibling=node\n else :\n newChild.previousSibling=None\n newChild.parentNode=self\n return newChild\n \n def appendChild(self,node):\n if node.nodeType ==self.DOCUMENT_FRAGMENT_NODE:\n for c in tuple(node.childNodes):\n self.appendChild(c)\n \n return node\n if node.nodeType not in self._child_node_types:\n raise xml.dom.HierarchyRequestErr(\n \"%s cannot be child of %s\"%(repr(node),repr(self)))\n elif node.nodeType in _nodeTypes_with_children:\n _clear_id_cache(self)\n if node.parentNode is not None :\n node.parentNode.removeChild(node)\n _append_child(self,node)\n node.nextSibling=None\n return node\n \n def replaceChild(self,newChild,oldChild):\n if newChild.nodeType ==self.DOCUMENT_FRAGMENT_NODE:\n refChild=oldChild.nextSibling\n self.removeChild(oldChild)\n return self.insertBefore(newChild,refChild)\n if newChild.nodeType not in self._child_node_types:\n raise xml.dom.HierarchyRequestErr(\n \"%s cannot be child of %s\"%(repr(newChild),repr(self)))\n if newChild is oldChild:\n return\n if newChild.parentNode is not None :\n newChild.parentNode.removeChild(newChild)\n try :\n index=self.childNodes.index(oldChild)\n except ValueError:\n raise xml.dom.NotFoundErr()\n self.childNodes[index]=newChild\n newChild.parentNode=self\n oldChild.parentNode=None\n if (newChild.nodeType in _nodeTypes_with_children\n or oldChild.nodeType in _nodeTypes_with_children):\n _clear_id_cache(self)\n newChild.nextSibling=oldChild.nextSibling\n newChild.previousSibling=oldChild.previousSibling\n oldChild.nextSibling=None\n oldChild.previousSibling=None\n if newChild.previousSibling:\n newChild.previousSibling.nextSibling=newChild\n if newChild.nextSibling:\n newChild.nextSibling.previousSibling=newChild\n return oldChild\n \n def removeChild(self,oldChild):\n try :\n self.childNodes.remove(oldChild)\n except ValueError:\n raise xml.dom.NotFoundErr()\n if oldChild.nextSibling is not None :\n oldChild.nextSibling.previousSibling=oldChild.previousSibling\n if oldChild.previousSibling is not None :\n oldChild.previousSibling.nextSibling=oldChild.nextSibling\n oldChild.nextSibling=oldChild.previousSibling=None\n if oldChild.nodeType in _nodeTypes_with_children:\n _clear_id_cache(self)\n \n oldChild.parentNode=None\n return oldChild\n \n def normalize(self):\n L=[]\n for child in self.childNodes:\n if child.nodeType ==Node.TEXT_NODE:\n if not child.data:\n \n if L:\n L[-1].nextSibling=child.nextSibling\n if child.nextSibling:\n child.nextSibling.previousSibling=child.previousSibling\n child.unlink()\n elif L and L[-1].nodeType ==child.nodeType:\n \n node=L[-1]\n node.data=node.data+child.data\n node.nextSibling=child.nextSibling\n if child.nextSibling:\n child.nextSibling.previousSibling=node\n child.unlink()\n else :\n L.append(child)\n else :\n L.append(child)\n if child.nodeType ==Node.ELEMENT_NODE:\n child.normalize()\n self.childNodes[:]=L\n \n def cloneNode(self,deep):\n return _clone_node(self,deep,self.ownerDocument or self)\n \n def isSupported(self,feature,version):\n return self.ownerDocument.implementation.hasFeature(feature,version)\n \n def _get_localName(self):\n \n return None\n \n \n \n def isSameNode(self,other):\n return self is other\n \n def getInterface(self,feature):\n if self.isSupported(feature,None ):\n return self\n else :\n return None\n \n \n \n \n \n def getUserData(self,key):\n try :\n return self._user_data[key][0]\n except (AttributeError,KeyError):\n return None\n \n def setUserData(self,key,data,handler):\n old=None\n try :\n d=self._user_data\n except AttributeError:\n d={}\n self._user_data=d\n if key in d:\n old=d[key][0]\n if data is None :\n \n handler=None\n if old is not None :\n del d[key]\n else :\n d[key]=(data,handler)\n return old\n \n def _call_user_data_handler(self,operation,src,dst):\n if hasattr(self,\"_user_data\"):\n for key,(data,handler)in list(self._user_data.items()):\n if handler is not None :\n handler.handle(operation,key,data,src,dst)\n \n \n \n def unlink(self):\n self.parentNode=self.ownerDocument=None\n if self.childNodes:\n for child in self.childNodes:\n child.unlink()\n self.childNodes=NodeList()\n self.previousSibling=None\n self.nextSibling=None\n \n \n \n def __enter__(self):\n return self\n \n def __exit__(self,et,ev,tb):\n self.unlink()\n \ndefproperty(Node,\"firstChild\",doc=\"First child node, or None.\")\ndefproperty(Node,\"lastChild\",doc=\"Last child node, or None.\")\ndefproperty(Node,\"localName\",doc=\"Namespace-local name of this node.\")\n\n\ndef _append_child(self,node):\n\n childNodes=self.childNodes\n if childNodes:\n last=childNodes[-1]\n node.previousSibling=last\n last.nextSibling=node\n childNodes.append(node)\n node.parentNode=self\n \ndef _in_document(node):\n\n while node is not None :\n if node.nodeType ==Node.DOCUMENT_NODE:\n return True\n node=node.parentNode\n return False\n \ndef _write_data(writer,data):\n ''\n if data:\n data=data.replace(\"&\",\"&\").replace(\"<\",\"<\"). replace(\"\\\"\",\""\").replace(\">\",\">\")\n writer.write(data)\n \ndef _get_elements_by_tagName_helper(parent,name,rc):\n for node in parent.childNodes:\n if node.nodeType ==Node.ELEMENT_NODE and (name ==\"*\"or node.tagName ==name):\n rc.append(node)\n _get_elements_by_tagName_helper(node,name,rc)\n return rc\n \ndef _get_elements_by_tagName_ns_helper(parent,nsURI,localName,rc):\n for node in parent.childNodes:\n if node.nodeType ==Node.ELEMENT_NODE:\n if ((localName ==\"*\"or node.localName ==localName)and\n (nsURI ==\"*\"or node.namespaceURI ==nsURI)):\n rc.append(node)\n _get_elements_by_tagName_ns_helper(node,nsURI,localName,rc)\n return rc\n \nclass DocumentFragment(Node):\n nodeType=Node.DOCUMENT_FRAGMENT_NODE\n nodeName=\"#document-fragment\"\n nodeValue=None\n attributes=None\n parentNode=None\n _child_node_types=(Node.ELEMENT_NODE,\n Node.TEXT_NODE,\n Node.CDATA_SECTION_NODE,\n Node.ENTITY_REFERENCE_NODE,\n Node.PROCESSING_INSTRUCTION_NODE,\n Node.COMMENT_NODE,\n Node.NOTATION_NODE)\n \n def __init__(self):\n self.childNodes=NodeList()\n \n \nclass Attr(Node):\n __slots__=('_name','_value','namespaceURI',\n '_prefix','childNodes','_localName','ownerDocument','ownerElement')\n nodeType=Node.ATTRIBUTE_NODE\n attributes=None\n specified=False\n _is_id=False\n \n _child_node_types=(Node.TEXT_NODE,Node.ENTITY_REFERENCE_NODE)\n \n def __init__(self,qName,namespaceURI=EMPTY_NAMESPACE,localName=None ,\n prefix=None ):\n self.ownerElement=None\n self._name=qName\n self.namespaceURI=namespaceURI\n self._prefix=prefix\n self.childNodes=NodeList()\n \n \n self.childNodes.append(Text())\n \n \n \n def _get_localName(self):\n try :\n return self._localName\n except AttributeError:\n return self.nodeName.split(\":\",1)[-1]\n \n def _get_name(self):\n return self.name\n \n def _get_specified(self):\n return self.specified\n \n def _get_name(self):\n return self._name\n \n def _set_name(self,value):\n self._name=value\n if self.ownerElement is not None :\n _clear_id_cache(self.ownerElement)\n \n nodeName=name=property(_get_name,_set_name)\n \n def _get_value(self):\n return self._value\n \n def _set_value(self,value):\n self._value=value\n self.childNodes[0].data=value\n if self.ownerElement is not None :\n _clear_id_cache(self.ownerElement)\n self.childNodes[0].data=value\n \n nodeValue=value=property(_get_value,_set_value)\n \n def _get_prefix(self):\n return self._prefix\n \n def _set_prefix(self,prefix):\n nsuri=self.namespaceURI\n if prefix ==\"xmlns\":\n if nsuri and nsuri !=XMLNS_NAMESPACE:\n raise xml.dom.NamespaceErr(\n \"illegal use of 'xmlns' prefix for the wrong namespace\")\n self._prefix=prefix\n if prefix is None :\n newName=self.localName\n else :\n newName=\"%s:%s\"%(prefix,self.localName)\n if self.ownerElement:\n _clear_id_cache(self.ownerElement)\n self.name=newName\n \n prefix=property(_get_prefix,_set_prefix)\n \n def unlink(self):\n \n \n \n \n elem=self.ownerElement\n if elem is not None :\n del elem._attrs[self.nodeName]\n del elem._attrsNS[(self.namespaceURI,self.localName)]\n if self._is_id:\n self._is_id=False\n elem._magic_id_nodes -=1\n self.ownerDocument._magic_id_count -=1\n for child in self.childNodes:\n child.unlink()\n del self.childNodes[:]\n \n def _get_isId(self):\n if self._is_id:\n return True\n doc=self.ownerDocument\n elem=self.ownerElement\n if doc is None or elem is None :\n return False\n \n info=doc._get_elem_info(elem)\n if info is None :\n return False\n if self.namespaceURI:\n return info.isIdNS(self.namespaceURI,self.localName)\n else :\n return info.isId(self.nodeName)\n \n def _get_schemaType(self):\n doc=self.ownerDocument\n elem=self.ownerElement\n if doc is None or elem is None :\n return _no_type\n \n info=doc._get_elem_info(elem)\n if info is None :\n return _no_type\n if self.namespaceURI:\n return info.getAttributeTypeNS(self.namespaceURI,self.localName)\n else :\n return info.getAttributeType(self.nodeName)\n \ndefproperty(Attr,\"isId\",doc=\"True if this attribute is an ID.\")\ndefproperty(Attr,\"localName\",doc=\"Namespace-local name of this attribute.\")\ndefproperty(Attr,\"schemaType\",doc=\"Schema type for this attribute.\")\n\n\nclass NamedNodeMap(object):\n ''\n\n\n\n\n\n \n \n __slots__=('_attrs','_attrsNS','_ownerElement')\n \n def __init__(self,attrs,attrsNS,ownerElement):\n self._attrs=attrs\n self._attrsNS=attrsNS\n self._ownerElement=ownerElement\n \n def _get_length(self):\n return len(self._attrs)\n \n def item(self,index):\n try :\n return self[list(self._attrs.keys())[index]]\n except IndexError:\n return None\n \n def items(self):\n L=[]\n for node in self._attrs.values():\n L.append((node.nodeName,node.value))\n return L\n \n def itemsNS(self):\n L=[]\n for node in self._attrs.values():\n L.append(((node.namespaceURI,node.localName),node.value))\n return L\n \n def __contains__(self,key):\n if isinstance(key,str):\n return key in self._attrs\n else :\n return key in self._attrsNS\n \n def keys(self):\n return self._attrs.keys()\n \n def keysNS(self):\n return self._attrsNS.keys()\n \n def values(self):\n return self._attrs.values()\n \n def get(self,name,value=None ):\n return self._attrs.get(name,value)\n \n __len__=_get_length\n \n def _cmp(self,other):\n if self._attrs is getattr(other,\"_attrs\",None ):\n return 0\n else :\n return (id(self)>id(other))-(id(self)=0\n \n def __gt__(self,other):\n return self._cmp(other)>0\n \n def __le__(self,other):\n return self._cmp(other)<=0\n \n def __lt__(self,other):\n return self._cmp(other)<0\n \n def __ne__(self,other):\n return self._cmp(other)!=0\n \n def __getitem__(self,attname_or_tuple):\n if isinstance(attname_or_tuple,tuple):\n return self._attrsNS[attname_or_tuple]\n else :\n return self._attrs[attname_or_tuple]\n \n \n def __setitem__(self,attname,value):\n if isinstance(value,str):\n try :\n node=self._attrs[attname]\n except KeyError:\n node=Attr(attname)\n node.ownerDocument=self._ownerElement.ownerDocument\n self.setNamedItem(node)\n node.value=value\n else :\n if not isinstance(value,Attr):\n raise TypeError(\"value must be a string or Attr object\")\n node=value\n self.setNamedItem(node)\n \n def getNamedItem(self,name):\n try :\n return self._attrs[name]\n except KeyError:\n return None\n \n def getNamedItemNS(self,namespaceURI,localName):\n try :\n return self._attrsNS[(namespaceURI,localName)]\n except KeyError:\n return None\n \n def removeNamedItem(self,name):\n n=self.getNamedItem(name)\n if n is not None :\n _clear_id_cache(self._ownerElement)\n del self._attrs[n.nodeName]\n del self._attrsNS[(n.namespaceURI,n.localName)]\n if hasattr(n,'ownerElement'):\n n.ownerElement=None\n return n\n else :\n raise xml.dom.NotFoundErr()\n \n def removeNamedItemNS(self,namespaceURI,localName):\n n=self.getNamedItemNS(namespaceURI,localName)\n if n is not None :\n _clear_id_cache(self._ownerElement)\n del self._attrsNS[(n.namespaceURI,n.localName)]\n del self._attrs[n.nodeName]\n if hasattr(n,'ownerElement'):\n n.ownerElement=None\n return n\n else :\n raise xml.dom.NotFoundErr()\n \n def setNamedItem(self,node):\n if not isinstance(node,Attr):\n raise xml.dom.HierarchyRequestErr(\n \"%s cannot be child of %s\"%(repr(node),repr(self)))\n old=self._attrs.get(node.name)\n if old:\n old.unlink()\n self._attrs[node.name]=node\n self._attrsNS[(node.namespaceURI,node.localName)]=node\n node.ownerElement=self._ownerElement\n _clear_id_cache(node.ownerElement)\n return old\n \n def setNamedItemNS(self,node):\n return self.setNamedItem(node)\n \n def __delitem__(self,attname_or_tuple):\n node=self[attname_or_tuple]\n _clear_id_cache(node.ownerElement)\n node.unlink()\n \n def __getstate__(self):\n return self._attrs,self._attrsNS,self._ownerElement\n \n def __setstate__(self,state):\n self._attrs,self._attrsNS,self._ownerElement=state\n \ndefproperty(NamedNodeMap,\"length\",\ndoc=\"Number of nodes in the NamedNodeMap.\")\n\nAttributeList=NamedNodeMap\n\n\nclass TypeInfo(object):\n __slots__='namespace','name'\n \n def __init__(self,namespace,name):\n self.namespace=namespace\n self.name=name\n \n def __repr__(self):\n if self.namespace:\n return\"\"%(self.name,self.namespace)\n else :\n return\"\"%self.name\n \n def _get_name(self):\n return self.name\n \n def _get_namespace(self):\n return self.namespace\n \n_no_type=TypeInfo(None ,None )\n\nclass Element(Node):\n __slots__=('ownerDocument','parentNode','tagName','nodeName','prefix',\n 'namespaceURI','_localName','childNodes','_attrs','_attrsNS',\n 'nextSibling','previousSibling')\n nodeType=Node.ELEMENT_NODE\n nodeValue=None\n schemaType=_no_type\n \n _magic_id_nodes=0\n \n _child_node_types=(Node.ELEMENT_NODE,\n Node.PROCESSING_INSTRUCTION_NODE,\n Node.COMMENT_NODE,\n Node.TEXT_NODE,\n Node.CDATA_SECTION_NODE,\n Node.ENTITY_REFERENCE_NODE)\n \n def __init__(self,tagName,namespaceURI=EMPTY_NAMESPACE,prefix=None ,\n localName=None ):\n self.parentNode=None\n self.tagName=self.nodeName=tagName\n self.prefix=prefix\n self.namespaceURI=namespaceURI\n self.childNodes=NodeList()\n self.nextSibling=self.previousSibling=None\n \n \n \n \n \n \n \n \n \n self._attrs=None\n self._attrsNS=None\n \n def _ensure_attributes(self):\n if self._attrs is None :\n self._attrs={}\n self._attrsNS={}\n \n def _get_localName(self):\n try :\n return self._localName\n except AttributeError:\n return self.tagName.split(\":\",1)[-1]\n \n def _get_tagName(self):\n return self.tagName\n \n def unlink(self):\n if self._attrs is not None :\n for attr in list(self._attrs.values()):\n attr.unlink()\n self._attrs=None\n self._attrsNS=None\n Node.unlink(self)\n \n def getAttribute(self,attname):\n if self._attrs is None :\n return\"\"\n try :\n return self._attrs[attname].value\n except KeyError:\n return\"\"\n \n def getAttributeNS(self,namespaceURI,localName):\n if self._attrsNS is None :\n return\"\"\n try :\n return self._attrsNS[(namespaceURI,localName)].value\n except KeyError:\n return\"\"\n \n def setAttribute(self,attname,value):\n attr=self.getAttributeNode(attname)\n if attr is None :\n attr=Attr(attname)\n attr.value=value\n attr.ownerDocument=self.ownerDocument\n self.setAttributeNode(attr)\n elif value !=attr.value:\n attr.value=value\n if attr.isId:\n _clear_id_cache(self)\n \n def setAttributeNS(self,namespaceURI,qualifiedName,value):\n prefix,localname=_nssplit(qualifiedName)\n attr=self.getAttributeNodeNS(namespaceURI,localname)\n if attr is None :\n attr=Attr(qualifiedName,namespaceURI,localname,prefix)\n attr.value=value\n attr.ownerDocument=self.ownerDocument\n self.setAttributeNode(attr)\n else :\n if value !=attr.value:\n attr.value=value\n if attr.isId:\n _clear_id_cache(self)\n if attr.prefix !=prefix:\n attr.prefix=prefix\n attr.nodeName=qualifiedName\n \n def getAttributeNode(self,attrname):\n if self._attrs is None :\n return None\n return self._attrs.get(attrname)\n \n def getAttributeNodeNS(self,namespaceURI,localName):\n if self._attrsNS is None :\n return None\n return self._attrsNS.get((namespaceURI,localName))\n \n def setAttributeNode(self,attr):\n if attr.ownerElement not in (None ,self):\n raise xml.dom.InuseAttributeErr(\"attribute node already owned\")\n self._ensure_attributes()\n old1=self._attrs.get(attr.name,None )\n if old1 is not None :\n self.removeAttributeNode(old1)\n old2=self._attrsNS.get((attr.namespaceURI,attr.localName),None )\n if old2 is not None and old2 is not old1:\n self.removeAttributeNode(old2)\n _set_attribute_node(self,attr)\n \n if old1 is not attr:\n \n \n return old1\n if old2 is not attr:\n return old2\n \n setAttributeNodeNS=setAttributeNode\n \n def removeAttribute(self,name):\n if self._attrsNS is None :\n raise xml.dom.NotFoundErr()\n try :\n attr=self._attrs[name]\n except KeyError:\n raise xml.dom.NotFoundErr()\n self.removeAttributeNode(attr)\n \n def removeAttributeNS(self,namespaceURI,localName):\n if self._attrsNS is None :\n raise xml.dom.NotFoundErr()\n try :\n attr=self._attrsNS[(namespaceURI,localName)]\n except KeyError:\n raise xml.dom.NotFoundErr()\n self.removeAttributeNode(attr)\n \n def removeAttributeNode(self,node):\n if node is None :\n raise xml.dom.NotFoundErr()\n try :\n self._attrs[node.name]\n except KeyError:\n raise xml.dom.NotFoundErr()\n _clear_id_cache(self)\n node.unlink()\n \n \n node.ownerDocument=self.ownerDocument\n \n removeAttributeNodeNS=removeAttributeNode\n \n def hasAttribute(self,name):\n if self._attrs is None :\n return False\n return name in self._attrs\n \n def hasAttributeNS(self,namespaceURI,localName):\n if self._attrsNS is None :\n return False\n return (namespaceURI,localName)in self._attrsNS\n \n def getElementsByTagName(self,name):\n return _get_elements_by_tagName_helper(self,name,NodeList())\n \n def getElementsByTagNameNS(self,namespaceURI,localName):\n return _get_elements_by_tagName_ns_helper(\n self,namespaceURI,localName,NodeList())\n \n def __repr__(self):\n return\"\"%(self.tagName,id(self))\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n \n \n \n writer.write(indent+\"<\"+self.tagName)\n \n attrs=self._get_attributes()\n a_names=sorted(attrs.keys())\n \n for a_name in a_names:\n writer.write(\" %s=\\\"\"%a_name)\n _write_data(writer,attrs[a_name].value)\n writer.write(\"\\\"\")\n if self.childNodes:\n writer.write(\">\")\n if (len(self.childNodes)==1 and\n self.childNodes[0].nodeType ==Node.TEXT_NODE):\n self.childNodes[0].writexml(writer,'','','')\n else :\n writer.write(newl)\n for node in self.childNodes:\n node.writexml(writer,indent+addindent,addindent,newl)\n writer.write(indent)\n writer.write(\"%s\"%(self.tagName,newl))\n else :\n writer.write(\"/>%s\"%(newl))\n \n def _get_attributes(self):\n self._ensure_attributes()\n return NamedNodeMap(self._attrs,self._attrsNS,self)\n \n def hasAttributes(self):\n if self._attrs:\n return True\n else :\n return False\n \n \n \n def setIdAttribute(self,name):\n idAttr=self.getAttributeNode(name)\n self.setIdAttributeNode(idAttr)\n \n def setIdAttributeNS(self,namespaceURI,localName):\n idAttr=self.getAttributeNodeNS(namespaceURI,localName)\n self.setIdAttributeNode(idAttr)\n \n def setIdAttributeNode(self,idAttr):\n if idAttr is None or not self.isSameNode(idAttr.ownerElement):\n raise xml.dom.NotFoundErr()\n if _get_containing_entref(self)is not None :\n raise xml.dom.NoModificationAllowedErr()\n if not idAttr._is_id:\n idAttr._is_id=True\n self._magic_id_nodes +=1\n self.ownerDocument._magic_id_count +=1\n _clear_id_cache(self)\n \ndefproperty(Element,\"attributes\",\ndoc=\"NamedNodeMap of attributes on the element.\")\ndefproperty(Element,\"localName\",\ndoc=\"Namespace-local name of this element.\")\n\n\ndef _set_attribute_node(element,attr):\n _clear_id_cache(element)\n element._ensure_attributes()\n element._attrs[attr.name]=attr\n element._attrsNS[(attr.namespaceURI,attr.localName)]=attr\n \n \n \n \n attr.ownerElement=element\n \nclass Childless:\n ''\n\n \n __slots__=()\n \n attributes=None\n childNodes=EmptyNodeList()\n firstChild=None\n lastChild=None\n \n def _get_firstChild(self):\n return None\n \n def _get_lastChild(self):\n return None\n \n def appendChild(self,node):\n raise xml.dom.HierarchyRequestErr(\n self.nodeName+\" nodes cannot have children\")\n \n def hasChildNodes(self):\n return False\n \n def insertBefore(self,newChild,refChild):\n raise xml.dom.HierarchyRequestErr(\n self.nodeName+\" nodes do not have children\")\n \n def removeChild(self,oldChild):\n raise xml.dom.NotFoundErr(\n self.nodeName+\" nodes do not have children\")\n \n def normalize(self):\n \n pass\n \n def replaceChild(self,newChild,oldChild):\n raise xml.dom.HierarchyRequestErr(\n self.nodeName+\" nodes do not have children\")\n \n \nclass ProcessingInstruction(Childless,Node):\n nodeType=Node.PROCESSING_INSTRUCTION_NODE\n __slots__=('target','data')\n \n def __init__(self,target,data):\n self.target=target\n self.data=data\n \n \n def _get_nodeValue(self):\n return self.data\n def _set_nodeValue(self,value):\n self.data=data\n nodeValue=property(_get_nodeValue,_set_nodeValue)\n \n \n def _get_nodeName(self):\n return self.target\n def _set_nodeName(self,value):\n self.target=value\n nodeName=property(_get_nodeName,_set_nodeName)\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n writer.write(\"%s%s\"%(indent,self.target,self.data,newl))\n \n \nclass CharacterData(Childless,Node):\n __slots__=('_data','ownerDocument','parentNode','previousSibling','nextSibling')\n \n def __init__(self):\n self.ownerDocument=self.parentNode=None\n self.previousSibling=self.nextSibling=None\n self._data=''\n Node.__init__(self)\n \n def _get_length(self):\n return len(self.data)\n __len__=_get_length\n \n def _get_data(self):\n return self._data\n def _set_data(self,data):\n self._data=data\n \n data=nodeValue=property(_get_data,_set_data)\n \n def __repr__(self):\n data=self.data\n if len(data)>10:\n dotdotdot=\"...\"\n else :\n dotdotdot=\"\"\n return''%(\n self.__class__.__name__,data[0:10],dotdotdot)\n \n def substringData(self,offset,count):\n if offset <0:\n raise xml.dom.IndexSizeErr(\"offset cannot be negative\")\n if offset >=len(self.data):\n raise xml.dom.IndexSizeErr(\"offset cannot be beyond end of data\")\n if count <0:\n raise xml.dom.IndexSizeErr(\"count cannot be negative\")\n return self.data[offset:offset+count]\n \n def appendData(self,arg):\n self.data=self.data+arg\n \n def insertData(self,offset,arg):\n if offset <0:\n raise xml.dom.IndexSizeErr(\"offset cannot be negative\")\n if offset >=len(self.data):\n raise xml.dom.IndexSizeErr(\"offset cannot be beyond end of data\")\n if arg:\n self.data=\"%s%s%s\"%(\n self.data[:offset],arg,self.data[offset:])\n \n def deleteData(self,offset,count):\n if offset <0:\n raise xml.dom.IndexSizeErr(\"offset cannot be negative\")\n if offset >=len(self.data):\n raise xml.dom.IndexSizeErr(\"offset cannot be beyond end of data\")\n if count <0:\n raise xml.dom.IndexSizeErr(\"count cannot be negative\")\n if count:\n self.data=self.data[:offset]+self.data[offset+count:]\n \n def replaceData(self,offset,count,arg):\n if offset <0:\n raise xml.dom.IndexSizeErr(\"offset cannot be negative\")\n if offset >=len(self.data):\n raise xml.dom.IndexSizeErr(\"offset cannot be beyond end of data\")\n if count <0:\n raise xml.dom.IndexSizeErr(\"count cannot be negative\")\n if count:\n self.data=\"%s%s%s\"%(\n self.data[:offset],arg,self.data[offset+count:])\n \ndefproperty(CharacterData,\"length\",doc=\"Length of the string data.\")\n\n\nclass Text(CharacterData):\n __slots__=()\n \n nodeType=Node.TEXT_NODE\n nodeName=\"#text\"\n attributes=None\n \n def splitText(self,offset):\n if offset <0 or offset >len(self.data):\n raise xml.dom.IndexSizeErr(\"illegal offset value\")\n newText=self.__class__()\n newText.data=self.data[offset:]\n newText.ownerDocument=self.ownerDocument\n next=self.nextSibling\n if self.parentNode and self in self.parentNode.childNodes:\n if next is None :\n self.parentNode.appendChild(newText)\n else :\n self.parentNode.insertBefore(newText,next)\n self.data=self.data[:offset]\n return newText\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n _write_data(writer,\"%s%s%s\"%(indent,self.data,newl))\n \n \n \n def _get_wholeText(self):\n L=[self.data]\n n=self.previousSibling\n while n is not None :\n if n.nodeType in (Node.TEXT_NODE,Node.CDATA_SECTION_NODE):\n L.insert(0,n.data)\n n=n.previousSibling\n else :\n break\n n=self.nextSibling\n while n is not None :\n if n.nodeType in (Node.TEXT_NODE,Node.CDATA_SECTION_NODE):\n L.append(n.data)\n n=n.nextSibling\n else :\n break\n return''.join(L)\n \n def replaceWholeText(self,content):\n \n \n parent=self.parentNode\n n=self.previousSibling\n while n is not None :\n if n.nodeType in (Node.TEXT_NODE,Node.CDATA_SECTION_NODE):\n next=n.previousSibling\n parent.removeChild(n)\n n=next\n else :\n break\n n=self.nextSibling\n if not content:\n parent.removeChild(self)\n while n is not None :\n if n.nodeType in (Node.TEXT_NODE,Node.CDATA_SECTION_NODE):\n next=n.nextSibling\n parent.removeChild(n)\n n=next\n else :\n break\n if content:\n self.data=content\n return self\n else :\n return None\n \n def _get_isWhitespaceInElementContent(self):\n if self.data.strip():\n return False\n elem=_get_containing_element(self)\n if elem is None :\n return False\n info=self.ownerDocument._get_elem_info(elem)\n if info is None :\n return False\n else :\n return info.isElementContent()\n \ndefproperty(Text,\"isWhitespaceInElementContent\",\ndoc=\"True iff this text node contains only whitespace\"\n\" and is in element content.\")\ndefproperty(Text,\"wholeText\",\ndoc=\"The text of all logically-adjacent text nodes.\")\n\n\ndef _get_containing_element(node):\n c=node.parentNode\n while c is not None :\n if c.nodeType ==Node.ELEMENT_NODE:\n return c\n c=c.parentNode\n return None\n \ndef _get_containing_entref(node):\n c=node.parentNode\n while c is not None :\n if c.nodeType ==Node.ENTITY_REFERENCE_NODE:\n return c\n c=c.parentNode\n return None\n \n \nclass Comment(CharacterData):\n nodeType=Node.COMMENT_NODE\n nodeName=\"#comment\"\n \n def __init__(self,data):\n CharacterData.__init__(self)\n self._data=data\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n if\"--\"in self.data:\n raise ValueError(\"'--' is not allowed in a comment node\")\n writer.write(\"%s%s\"%(indent,self.data,newl))\n \n \nclass CDATASection(Text):\n __slots__=()\n \n nodeType=Node.CDATA_SECTION_NODE\n nodeName=\"#cdata-section\"\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n if self.data.find(\"]]>\")>=0:\n raise ValueError(\"']]>' not allowed in a CDATA section\")\n writer.write(\"\"%self.data)\n \n \nclass ReadOnlySequentialNamedNodeMap(object):\n __slots__='_seq',\n \n def __init__(self,seq=()):\n \n self._seq=seq\n \n def __len__(self):\n return len(self._seq)\n \n def _get_length(self):\n return len(self._seq)\n \n def getNamedItem(self,name):\n for n in self._seq:\n if n.nodeName ==name:\n return n\n \n def getNamedItemNS(self,namespaceURI,localName):\n for n in self._seq:\n if n.namespaceURI ==namespaceURI and n.localName ==localName:\n return n\n \n def __getitem__(self,name_or_tuple):\n if isinstance(name_or_tuple,tuple):\n node=self.getNamedItemNS(*name_or_tuple)\n else :\n node=self.getNamedItem(name_or_tuple)\n if node is None :\n raise KeyError(name_or_tuple)\n return node\n \n def item(self,index):\n if index <0:\n return None\n try :\n return self._seq[index]\n except IndexError:\n return None\n \n def removeNamedItem(self,name):\n raise xml.dom.NoModificationAllowedErr(\n \"NamedNodeMap instance is read-only\")\n \n def removeNamedItemNS(self,namespaceURI,localName):\n raise xml.dom.NoModificationAllowedErr(\n \"NamedNodeMap instance is read-only\")\n \n def setNamedItem(self,node):\n raise xml.dom.NoModificationAllowedErr(\n \"NamedNodeMap instance is read-only\")\n \n def setNamedItemNS(self,node):\n raise xml.dom.NoModificationAllowedErr(\n \"NamedNodeMap instance is read-only\")\n \n def __getstate__(self):\n return [self._seq]\n \n def __setstate__(self,state):\n self._seq=state[0]\n \ndefproperty(ReadOnlySequentialNamedNodeMap,\"length\",\ndoc=\"Number of entries in the NamedNodeMap.\")\n\n\nclass Identified:\n ''\n \n __slots__='publicId','systemId'\n \n def _identified_mixin_init(self,publicId,systemId):\n self.publicId=publicId\n self.systemId=systemId\n \n def _get_publicId(self):\n return self.publicId\n \n def _get_systemId(self):\n return self.systemId\n \nclass DocumentType(Identified,Childless,Node):\n nodeType=Node.DOCUMENT_TYPE_NODE\n nodeValue=None\n name=None\n publicId=None\n systemId=None\n internalSubset=None\n \n def __init__(self,qualifiedName):\n self.entities=ReadOnlySequentialNamedNodeMap()\n self.notations=ReadOnlySequentialNamedNodeMap()\n if qualifiedName:\n prefix,localname=_nssplit(qualifiedName)\n self.name=localname\n self.nodeName=self.name\n \n def _get_internalSubset(self):\n return self.internalSubset\n \n def cloneNode(self,deep):\n if self.ownerDocument is None :\n \n clone=DocumentType(None )\n clone.name=self.name\n clone.nodeName=self.name\n operation=xml.dom.UserDataHandler.NODE_CLONED\n if deep:\n clone.entities._seq=[]\n clone.notations._seq=[]\n for n in self.notations._seq:\n notation=Notation(n.nodeName,n.publicId,n.systemId)\n clone.notations._seq.append(notation)\n n._call_user_data_handler(operation,n,notation)\n for e in self.entities._seq:\n entity=Entity(e.nodeName,e.publicId,e.systemId,\n e.notationName)\n entity.actualEncoding=e.actualEncoding\n entity.encoding=e.encoding\n entity.version=e.version\n clone.entities._seq.append(entity)\n e._call_user_data_handler(operation,n,entity)\n self._call_user_data_handler(operation,self,clone)\n return clone\n else :\n return None\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\"):\n writer.write(\"\"+newl)\n \nclass Entity(Identified,Node):\n attributes=None\n nodeType=Node.ENTITY_NODE\n nodeValue=None\n \n actualEncoding=None\n encoding=None\n version=None\n \n def __init__(self,name,publicId,systemId,notation):\n self.nodeName=name\n self.notationName=notation\n self.childNodes=NodeList()\n self._identified_mixin_init(publicId,systemId)\n \n def _get_actualEncoding(self):\n return self.actualEncoding\n \n def _get_encoding(self):\n return self.encoding\n \n def _get_version(self):\n return self.version\n \n def appendChild(self,newChild):\n raise xml.dom.HierarchyRequestErr(\n \"cannot append children to an entity node\")\n \n def insertBefore(self,newChild,refChild):\n raise xml.dom.HierarchyRequestErr(\n \"cannot insert children below an entity node\")\n \n def removeChild(self,oldChild):\n raise xml.dom.HierarchyRequestErr(\n \"cannot remove children from an entity node\")\n \n def replaceChild(self,newChild,oldChild):\n raise xml.dom.HierarchyRequestErr(\n \"cannot replace children of an entity node\")\n \nclass Notation(Identified,Childless,Node):\n nodeType=Node.NOTATION_NODE\n nodeValue=None\n \n def __init__(self,name,publicId,systemId):\n self.nodeName=name\n self._identified_mixin_init(publicId,systemId)\n \n \nclass DOMImplementation(DOMImplementationLS):\n _features=[(\"core\",\"1.0\"),\n (\"core\",\"2.0\"),\n (\"core\",None ),\n (\"xml\",\"1.0\"),\n (\"xml\",\"2.0\"),\n (\"xml\",None ),\n (\"ls-load\",\"3.0\"),\n (\"ls-load\",None ),\n ]\n \n def hasFeature(self,feature,version):\n if version ==\"\":\n version=None\n return (feature.lower(),version)in self._features\n \n def createDocument(self,namespaceURI,qualifiedName,doctype):\n if doctype and doctype.parentNode is not None :\n raise xml.dom.WrongDocumentErr(\n \"doctype object owned by another DOM tree\")\n doc=self._create_document()\n \n add_root_element=not (namespaceURI is None\n and qualifiedName is None\n and doctype is None )\n \n if not qualifiedName and add_root_element:\n \n \n \n \n \n \n \n \n \n \n \n \n raise xml.dom.InvalidCharacterErr(\"Element with no name\")\n \n if add_root_element:\n prefix,localname=_nssplit(qualifiedName)\n if prefix ==\"xml\" and namespaceURI !=\"http://www.w3.org/XML/1998/namespace\":\n raise xml.dom.NamespaceErr(\"illegal use of 'xml' prefix\")\n if prefix and not namespaceURI:\n raise xml.dom.NamespaceErr(\n \"illegal use of prefix without namespaces\")\n element=doc.createElementNS(namespaceURI,qualifiedName)\n if doctype:\n doc.appendChild(doctype)\n doc.appendChild(element)\n \n if doctype:\n doctype.parentNode=doctype.ownerDocument=doc\n \n doc.doctype=doctype\n doc.implementation=self\n return doc\n \n def createDocumentType(self,qualifiedName,publicId,systemId):\n doctype=DocumentType(qualifiedName)\n doctype.publicId=publicId\n doctype.systemId=systemId\n return doctype\n \n \n \n def getInterface(self,feature):\n if self.hasFeature(feature,None ):\n return self\n else :\n return None\n \n \n def _create_document(self):\n return Document()\n \nclass ElementInfo(object):\n ''\n\n\n\n\n\n \n \n __slots__='tagName',\n \n def __init__(self,name):\n self.tagName=name\n \n def getAttributeType(self,aname):\n return _no_type\n \n def getAttributeTypeNS(self,namespaceURI,localName):\n return _no_type\n \n def isElementContent(self):\n return False\n \n def isEmpty(self):\n ''\n \n return False\n \n def isId(self,aname):\n ''\n return False\n \n def isIdNS(self,namespaceURI,localName):\n ''\n return False\n \n def __getstate__(self):\n return self.tagName\n \n def __setstate__(self,state):\n self.tagName=state\n \ndef _clear_id_cache(node):\n if node.nodeType ==Node.DOCUMENT_NODE:\n node._id_cache.clear()\n node._id_search_stack=None\n elif _in_document(node):\n node.ownerDocument._id_cache.clear()\n node.ownerDocument._id_search_stack=None\n \nclass Document(Node,DocumentLS):\n __slots__=('_elem_info','doctype',\n '_id_search_stack','childNodes','_id_cache')\n _child_node_types=(Node.ELEMENT_NODE,Node.PROCESSING_INSTRUCTION_NODE,\n Node.COMMENT_NODE,Node.DOCUMENT_TYPE_NODE)\n \n implementation=DOMImplementation()\n nodeType=Node.DOCUMENT_NODE\n nodeName=\"#document\"\n nodeValue=None\n attributes=None\n parentNode=None\n previousSibling=nextSibling=None\n \n \n \n \n actualEncoding=None\n encoding=None\n standalone=None\n version=None\n strictErrorChecking=False\n errorHandler=None\n documentURI=None\n \n _magic_id_count=0\n \n def __init__(self):\n self.doctype=None\n self.childNodes=NodeList()\n \n \n self._elem_info={}\n self._id_cache={}\n self._id_search_stack=None\n \n def _get_elem_info(self,element):\n if element.namespaceURI:\n key=element.namespaceURI,element.localName\n else :\n key=element.tagName\n return self._elem_info.get(key)\n \n def _get_actualEncoding(self):\n return self.actualEncoding\n \n def _get_doctype(self):\n return self.doctype\n \n def _get_documentURI(self):\n return self.documentURI\n \n def _get_encoding(self):\n return self.encoding\n \n def _get_errorHandler(self):\n return self.errorHandler\n \n def _get_standalone(self):\n return self.standalone\n \n def _get_strictErrorChecking(self):\n return self.strictErrorChecking\n \n def _get_version(self):\n return self.version\n \n def appendChild(self,node):\n if node.nodeType not in self._child_node_types:\n raise xml.dom.HierarchyRequestErr(\n \"%s cannot be child of %s\"%(repr(node),repr(self)))\n if node.parentNode is not None :\n \n \n \n node.parentNode.removeChild(node)\n \n if node.nodeType ==Node.ELEMENT_NODE and self._get_documentElement():\n raise xml.dom.HierarchyRequestErr(\n \"two document elements disallowed\")\n return Node.appendChild(self,node)\n \n def removeChild(self,oldChild):\n try :\n self.childNodes.remove(oldChild)\n except ValueError:\n raise xml.dom.NotFoundErr()\n oldChild.nextSibling=oldChild.previousSibling=None\n oldChild.parentNode=None\n if self.documentElement is oldChild:\n self.documentElement=None\n \n return oldChild\n \n def _get_documentElement(self):\n for node in self.childNodes:\n if node.nodeType ==Node.ELEMENT_NODE:\n return node\n \n def unlink(self):\n if self.doctype is not None :\n self.doctype.unlink()\n self.doctype=None\n Node.unlink(self)\n \n def cloneNode(self,deep):\n if not deep:\n return None\n clone=self.implementation.createDocument(None ,None ,None )\n clone.encoding=self.encoding\n clone.standalone=self.standalone\n clone.version=self.version\n for n in self.childNodes:\n childclone=_clone_node(n,deep,clone)\n assert childclone.ownerDocument.isSameNode(clone)\n clone.childNodes.append(childclone)\n if childclone.nodeType ==Node.DOCUMENT_NODE:\n assert clone.documentElement is None\n elif childclone.nodeType ==Node.DOCUMENT_TYPE_NODE:\n assert clone.doctype is None\n clone.doctype=childclone\n childclone.parentNode=clone\n self._call_user_data_handler(xml.dom.UserDataHandler.NODE_CLONED,\n self,clone)\n return clone\n \n def createDocumentFragment(self):\n d=DocumentFragment()\n d.ownerDocument=self\n return d\n \n def createElement(self,tagName):\n e=Element(tagName)\n e.ownerDocument=self\n return e\n \n def createTextNode(self,data):\n if not isinstance(data,str):\n raise TypeError(\"node contents must be a string\")\n t=Text()\n t.data=data\n t.ownerDocument=self\n return t\n \n def createCDATASection(self,data):\n if not isinstance(data,str):\n raise TypeError(\"node contents must be a string\")\n c=CDATASection()\n c.data=data\n c.ownerDocument=self\n return c\n \n def createComment(self,data):\n c=Comment(data)\n c.ownerDocument=self\n return c\n \n def createProcessingInstruction(self,target,data):\n p=ProcessingInstruction(target,data)\n p.ownerDocument=self\n return p\n \n def createAttribute(self,qName):\n a=Attr(qName)\n a.ownerDocument=self\n a.value=\"\"\n return a\n \n def createElementNS(self,namespaceURI,qualifiedName):\n prefix,localName=_nssplit(qualifiedName)\n e=Element(qualifiedName,namespaceURI,prefix)\n e.ownerDocument=self\n return e\n \n def createAttributeNS(self,namespaceURI,qualifiedName):\n prefix,localName=_nssplit(qualifiedName)\n a=Attr(qualifiedName,namespaceURI,localName,prefix)\n a.ownerDocument=self\n a.value=\"\"\n return a\n \n \n \n \n def _create_entity(self,name,publicId,systemId,notationName):\n e=Entity(name,publicId,systemId,notationName)\n e.ownerDocument=self\n return e\n \n def _create_notation(self,name,publicId,systemId):\n n=Notation(name,publicId,systemId)\n n.ownerDocument=self\n return n\n \n def getElementById(self,id):\n if id in self._id_cache:\n return self._id_cache[id]\n if not (self._elem_info or self._magic_id_count):\n return None\n \n stack=self._id_search_stack\n if stack is None :\n \n stack=[self.documentElement]\n self._id_search_stack=stack\n elif not stack:\n \n \n return None\n \n result=None\n while stack:\n node=stack.pop()\n \n stack.extend([child for child in node.childNodes\n if child.nodeType in _nodeTypes_with_children])\n \n info=self._get_elem_info(node)\n if info:\n \n \n \n for attr in node.attributes.values():\n if attr.namespaceURI:\n if info.isIdNS(attr.namespaceURI,attr.localName):\n self._id_cache[attr.value]=node\n if attr.value ==id:\n result=node\n elif not node._magic_id_nodes:\n break\n elif info.isId(attr.name):\n self._id_cache[attr.value]=node\n if attr.value ==id:\n result=node\n elif not node._magic_id_nodes:\n break\n elif attr._is_id:\n self._id_cache[attr.value]=node\n if attr.value ==id:\n result=node\n elif node._magic_id_nodes ==1:\n break\n elif node._magic_id_nodes:\n for attr in node.attributes.values():\n if attr._is_id:\n self._id_cache[attr.value]=node\n if attr.value ==id:\n result=node\n if result is not None :\n break\n return result\n \n def getElementsByTagName(self,name):\n return _get_elements_by_tagName_helper(self,name,NodeList())\n \n def getElementsByTagNameNS(self,namespaceURI,localName):\n return _get_elements_by_tagName_ns_helper(\n self,namespaceURI,localName,NodeList())\n \n def isSupported(self,feature,version):\n return self.implementation.hasFeature(feature,version)\n \n def importNode(self,node,deep):\n if node.nodeType ==Node.DOCUMENT_NODE:\n raise xml.dom.NotSupportedErr(\"cannot import document nodes\")\n elif node.nodeType ==Node.DOCUMENT_TYPE_NODE:\n raise xml.dom.NotSupportedErr(\"cannot import document type nodes\")\n return _clone_node(node,deep,self)\n \n def writexml(self,writer,indent=\"\",addindent=\"\",newl=\"\",encoding=None ):\n if encoding is None :\n writer.write(''+newl)\n else :\n writer.write('%s'%(\n encoding,newl))\n for node in self.childNodes:\n node.writexml(writer,indent,addindent,newl)\n \n \n \n def renameNode(self,n,namespaceURI,name):\n if n.ownerDocument is not self:\n raise xml.dom.WrongDocumentErr(\n \"cannot rename nodes from other documents;\\n\"\n \"expected %s,\\nfound %s\"%(self,n.ownerDocument))\n if n.nodeType not in (Node.ELEMENT_NODE,Node.ATTRIBUTE_NODE):\n raise xml.dom.NotSupportedErr(\n \"renameNode() only applies to element and attribute nodes\")\n if namespaceURI !=EMPTY_NAMESPACE:\n if':'in name:\n prefix,localName=name.split(':',1)\n if (prefix ==\"xmlns\"\n and namespaceURI !=xml.dom.XMLNS_NAMESPACE):\n raise xml.dom.NamespaceErr(\n \"illegal use of 'xmlns' prefix\")\n else :\n if (name ==\"xmlns\"\n and namespaceURI !=xml.dom.XMLNS_NAMESPACE\n and n.nodeType ==Node.ATTRIBUTE_NODE):\n raise xml.dom.NamespaceErr(\n \"illegal use of the 'xmlns' attribute\")\n prefix=None\n localName=name\n else :\n prefix=None\n localName=None\n if n.nodeType ==Node.ATTRIBUTE_NODE:\n element=n.ownerElement\n if element is not None :\n is_id=n._is_id\n element.removeAttributeNode(n)\n else :\n element=None\n n.prefix=prefix\n n._localName=localName\n n.namespaceURI=namespaceURI\n n.nodeName=name\n if n.nodeType ==Node.ELEMENT_NODE:\n n.tagName=name\n else :\n \n n.name=name\n if element is not None :\n element.setAttributeNode(n)\n if is_id:\n element.setIdAttributeNode(n)\n \n \n \n \n \n return n\n \ndefproperty(Document,\"documentElement\",\ndoc=\"Top-level element of this document.\")\n\n\ndef _clone_node(node,deep,newOwnerDocument):\n ''\n\n\n \n if node.ownerDocument.isSameNode(newOwnerDocument):\n operation=xml.dom.UserDataHandler.NODE_CLONED\n else :\n operation=xml.dom.UserDataHandler.NODE_IMPORTED\n if node.nodeType ==Node.ELEMENT_NODE:\n clone=newOwnerDocument.createElementNS(node.namespaceURI,\n node.nodeName)\n for attr in node.attributes.values():\n clone.setAttributeNS(attr.namespaceURI,attr.nodeName,attr.value)\n a=clone.getAttributeNodeNS(attr.namespaceURI,attr.localName)\n a.specified=attr.specified\n \n if deep:\n for child in node.childNodes:\n c=_clone_node(child,deep,newOwnerDocument)\n clone.appendChild(c)\n \n elif node.nodeType ==Node.DOCUMENT_FRAGMENT_NODE:\n clone=newOwnerDocument.createDocumentFragment()\n if deep:\n for child in node.childNodes:\n c=_clone_node(child,deep,newOwnerDocument)\n clone.appendChild(c)\n \n elif node.nodeType ==Node.TEXT_NODE:\n clone=newOwnerDocument.createTextNode(node.data)\n elif node.nodeType ==Node.CDATA_SECTION_NODE:\n clone=newOwnerDocument.createCDATASection(node.data)\n elif node.nodeType ==Node.PROCESSING_INSTRUCTION_NODE:\n clone=newOwnerDocument.createProcessingInstruction(node.target,\n node.data)\n elif node.nodeType ==Node.COMMENT_NODE:\n clone=newOwnerDocument.createComment(node.data)\n elif node.nodeType ==Node.ATTRIBUTE_NODE:\n clone=newOwnerDocument.createAttributeNS(node.namespaceURI,\n node.nodeName)\n clone.specified=True\n clone.value=node.value\n elif node.nodeType ==Node.DOCUMENT_TYPE_NODE:\n assert node.ownerDocument is not newOwnerDocument\n operation=xml.dom.UserDataHandler.NODE_IMPORTED\n clone=newOwnerDocument.implementation.createDocumentType(\n node.name,node.publicId,node.systemId)\n clone.ownerDocument=newOwnerDocument\n if deep:\n clone.entities._seq=[]\n clone.notations._seq=[]\n for n in node.notations._seq:\n notation=Notation(n.nodeName,n.publicId,n.systemId)\n notation.ownerDocument=newOwnerDocument\n clone.notations._seq.append(notation)\n if hasattr(n,'_call_user_data_handler'):\n n._call_user_data_handler(operation,n,notation)\n for e in node.entities._seq:\n entity=Entity(e.nodeName,e.publicId,e.systemId,\n e.notationName)\n entity.actualEncoding=e.actualEncoding\n entity.encoding=e.encoding\n entity.version=e.version\n entity.ownerDocument=newOwnerDocument\n clone.entities._seq.append(entity)\n if hasattr(e,'_call_user_data_handler'):\n e._call_user_data_handler(operation,n,entity)\n else :\n \n \n \n raise xml.dom.NotSupportedErr(\"Cannot clone node %s\"%repr(node))\n \n \n \n \n if hasattr(node,'_call_user_data_handler'):\n node._call_user_data_handler(operation,node,clone)\n return clone\n \n \ndef _nssplit(qualifiedName):\n fields=qualifiedName.split(':',1)\n if len(fields)==2:\n return fields\n else :\n return (None ,fields[0])\n \n \ndef _do_pulldom_parse(func,args,kwargs):\n events=func(*args,**kwargs)\n toktype,rootNode=events.getEvent()\n events.expandNode(rootNode)\n events.clear()\n return rootNode\n \ndef parse(file,parser=None ,bufsize=None ):\n ''\n if parser is None and not bufsize:\n from xml.dom import expatbuilder\n return expatbuilder.parse(file)\n else :\n from xml.dom import pulldom\n return _do_pulldom_parse(pulldom.parse,(file,),\n {'parser':parser,'bufsize':bufsize})\n \ndef parseString(string,parser=None ):\n ''\n if parser is None :\n from xml.dom import expatbuilder\n return expatbuilder.parseString(string)\n else :\n from xml.dom import pulldom\n return _do_pulldom_parse(pulldom.parseString,(string,),\n {'parser':parser})\n \ndef getDOMImplementation(features=None ):\n if features:\n if isinstance(features,str):\n features=domreg._parse_feature_string(features)\n for f,v in features:\n if not Document.implementation.hasFeature(f,v):\n return None\n return Document.implementation\n"], "_collections": [".py", "\n\n\n\n\n\n\n\n\n\nimport operator\n\n\n\ndef _thread_ident():\n return -1\n \n \nn=30\nLFTLNK=n\nRGTLNK=n+1\nBLOCKSIZ=n+2\n\n\n\n\n\n\n\n\nclass deque:\n\n def __new__(cls,iterable=(),*args,**kw):\n \n \n self=object.__new__(cls,*args,**kw)\n self.clear()\n return self\n \n def __init__(self,iterable=(),maxlen=None ):\n object.__init__(self)\n self.clear()\n if maxlen is not None :\n if maxlen <0:\n raise ValueError(\"maxlen must be non-negative\")\n self._maxlen=maxlen\n add=self.append\n for elem in iterable:\n add(elem)\n \n @property\n def maxlen(self):\n return self._maxlen\n \n def clear(self):\n self.right=self.left=[None ]*BLOCKSIZ\n self.rightndx=n //2\n self.leftndx=n //2+1\n self.length=0\n self.state=0\n \n def append(self,x):\n self.state +=1\n self.rightndx +=1\n if self.rightndx ==n:\n newblock=[None ]*BLOCKSIZ\n self.right[RGTLNK]=newblock\n newblock[LFTLNK]=self.right\n self.right=newblock\n self.rightndx=0\n self.length +=1\n self.right[self.rightndx]=x\n if self.maxlen is not None and self.length >self.maxlen:\n self.popleft()\n \n def appendleft(self,x):\n self.state +=1\n self.leftndx -=1\n if self.leftndx ==-1:\n newblock=[None ]*BLOCKSIZ\n self.left[LFTLNK]=newblock\n newblock[RGTLNK]=self.left\n self.left=newblock\n self.leftndx=n -1\n self.length +=1\n self.left[self.leftndx]=x\n if self.maxlen is not None and self.length >self.maxlen:\n self.pop()\n \n def extend(self,iterable):\n if iterable is self:\n iterable=list(iterable)\n for elem in iterable:\n self.append(elem)\n \n def extendleft(self,iterable):\n if iterable is self:\n iterable=list(iterable)\n for elem in iterable:\n self.appendleft(elem)\n \n def pop(self):\n if self.left is self.right and self.leftndx >self.rightndx:\n \n raise IndexError(\"pop from an empty deque\")\n x=self.right[self.rightndx]\n self.right[self.rightndx]=None\n self.length -=1\n self.rightndx -=1\n self.state +=1\n if self.rightndx ==-1:\n prevblock=self.right[LFTLNK]\n if prevblock is None :\n \n self.rightndx=n //2\n self.leftndx=n //2+1\n else :\n prevblock[RGTLNK]=None\n self.right[LFTLNK]=None\n self.right=prevblock\n self.rightndx=n -1\n return x\n \n def popleft(self):\n if self.left is self.right and self.leftndx >self.rightndx:\n \n raise IndexError(\"pop from an empty deque\")\n x=self.left[self.leftndx]\n self.left[self.leftndx]=None\n self.length -=1\n self.leftndx +=1\n self.state +=1\n if self.leftndx ==n:\n prevblock=self.left[RGTLNK]\n if prevblock is None :\n \n self.rightndx=n //2\n self.leftndx=n //2+1\n else :\n prevblock[LFTLNK]=None\n self.left[RGTLNK]=None\n self.left=prevblock\n self.leftndx=0\n return x\n \n def count(self,value):\n c=0\n for item in self:\n if item ==value:\n c +=1\n return c\n \n def remove(self,value):\n \n for i in range(len(self)):\n if self[i]==value:\n del self[i]\n return\n raise ValueError(\"deque.remove(x): x not in deque\")\n \n def rotate(self,n=1):\n length=len(self)\n if length ==0:\n return\n halflen=(length+1)>>1\n if n >halflen or n <-halflen:\n n %=length\n if n >halflen:\n n -=length\n elif n <-halflen:\n n +=length\n while n >0:\n self.appendleft(self.pop())\n n -=1\n while n <0:\n self.append(self.popleft())\n n +=1\n \n def reverse(self):\n ''\n leftblock=self.left\n rightblock=self.right\n leftindex=self.leftndx\n rightindex=self.rightndx\n for i in range(self.length //2):\n \n assert leftblock !=rightblock or leftindex =0:\n block=self.left\n while block:\n l,r=0,n\n if block is self.left:\n l=self.leftndx\n if block is self.right:\n r=self.rightndx+1\n span=r -l\n if index =negative_span:\n return block,r+index\n index -=negative_span\n block=block[LFTLNK]\n raise IndexError(\"deque index out of range\")\n \n def __getitem__(self,index):\n block,index=self.__getref(index)\n return block[index]\n \n def __setitem__(self,index,value):\n block,index=self.__getref(index)\n block[index]=value\n \n def __delitem__(self,index):\n length=len(self)\n if index >=0:\n if index >=length:\n raise IndexError(\"deque index out of range\")\n self.rotate(-index)\n self.popleft()\n self.rotate(index)\n else :\n \n index=index ^(2 **31)\n if index >=length:\n raise IndexError(\"deque index out of range\")\n self.rotate(index)\n self.pop()\n self.rotate(-index)\n \n def __reduce_ex__(self,proto):\n return type(self),(list(self),self.maxlen)\n \n def __hash__(self):\n \n raise TypeError(\"deque objects are unhashable\")\n \n def __copy__(self):\n return self.__class__(self,self.maxlen)\n \n \n def __eq__(self,other):\n if isinstance(other,deque):\n return list(self)==list(other)\n else :\n return NotImplemented\n \n def __ne__(self,other):\n if isinstance(other,deque):\n return list(self)!=list(other)\n else :\n return NotImplemented\n \n def __lt__(self,other):\n if isinstance(other,deque):\n return list(self)list(other)\n else :\n return NotImplemented\n \n def __ge__(self,other):\n if isinstance(other,deque):\n return list(self)>=list(other)\n else :\n return NotImplemented\n \n def __iadd__(self,other):\n self.extend(other)\n return self\n \n \nclass deque_iterator(object):\n\n def __init__(self,deq,itergen):\n self.counter=len(deq)\n def giveup():\n self.counter=0\n \n raise RuntimeError(\"deque mutated during iteration\")\n self._gen=itergen(deq.state,giveup)\n \n def next(self):\n res=self._gen.next()\n self.counter -=1\n return res\n \n def __iter__(self):\n return self\n \nclass defaultdict(dict):\n\n def __init__(self,*args,**kwds):\n if len(args)>0:\n default_factory=args[0]\n args=args[1:]\n if not callable(default_factory)and default_factory is not None :\n raise TypeError(\"first argument must be callable\")\n else :\n default_factory=None\n dict.__init__(self,args,kwds)\n self.default_factory=default_factory\n self.update(args,kwds)\n super(defaultdict,self).__init__(*args,**kwds)\n \n \n \n \n \n \n \n \n def __missing__(self,key):\n \n if self.default_factory is None :\n raise KeyError(key)\n self[key]=value=self.default_factory()\n return value\n \n def __repr__(self,recurse=set()):\n if id(self)in recurse:\n return\"defaultdict(...)\"\n try :\n recurse.add(id(self))\n return\"defaultdict(%s, %s)\"%(repr(self.default_factory),super(defaultdict,self).__repr__())\n finally :\n recurse.remove(id(self))\n \n def copy(self):\n return type(self)(self.default_factory,self)\n \n def __copy__(self):\n return self.copy()\n \n def __reduce__(self):\n \n \n \n \n \n \n \n \n \n \n \n return (type(self),(self.default_factory,),None ,None ,self.items())\n \nfrom operator import itemgetter as _itemgetter\nfrom keyword import iskeyword as _iskeyword\nimport sys as _sys\n\ndef namedtuple(typename,field_names,verbose=False ,rename=False ):\n ''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n if isinstance(field_names,str):\n field_names=field_names.replace(',',' ').split()\n field_names=tuple(map(str,field_names))\n if rename:\n names=list(field_names)\n seen=set()\n for i,name in enumerate(names):\n if (not min(c.isalnum()or c =='_'for c in name)or _iskeyword(name)\n or not name or name[0].isdigit()or name.startswith('_')\n or name in seen):\n names[i]='_%d'%i\n seen.add(name)\n field_names=tuple(names)\n for name in (typename,)+field_names:\n if not min(c.isalnum()or c =='_'for c in name):\n raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r'%name)\n if _iskeyword(name):\n raise ValueError('Type names and field names cannot be a keyword: %r'%name)\n if name[0].isdigit():\n raise ValueError('Type names and field names cannot start with a number: %r'%name)\n seen_names=set()\n for name in field_names:\n if name.startswith('_')and not rename:\n raise ValueError('Field names cannot start with an underscore: %r'%name)\n if name in seen_names:\n raise ValueError('Encountered duplicate field name: %r'%name)\n seen_names.add(name)\n \n \n numfields=len(field_names)\n argtxt=repr(field_names).replace(\"'\",\"\")[1:-1]\n reprtxt=', '.join('%s=%%r'%name for name in field_names)\n \n template='''class %(typename)s(tuple):\n '%(typename)s(%(argtxt)s)' \\n\n __slots__ = () \\n\n _fields = %(field_names)r \\n\n def __new__(_cls, %(argtxt)s):\n return tuple.__new__(_cls, (%(argtxt)s)) \\n\n @classmethod\n def _make(cls, iterable, new=tuple.__new__, len=len):\n 'Make a new %(typename)s object from a sequence or iterable'\n result = new(cls, iterable)\n if len(result) != %(numfields)d:\n raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result))\n return result \\n\n def __repr__(self):\n return '%(typename)s(%(reprtxt)s)' %% self \\n\n def _asdict(self):\n 'Return a new dict which maps field names to their values'\n return dict(zip(self._fields, self)) \\n\n def _replace(_self, **kwds):\n 'Return a new %(typename)s object replacing specified fields with new values'\n result = _self._make(map(kwds.pop, %(field_names)r, _self))\n if kwds:\n raise ValueError('Got unexpected field names: %%r' %% kwds.keys())\n return result \\n\n def __getnewargs__(self):\n return tuple(self) \\n\\n'''%locals()\n for i,name in enumerate(field_names):\n template +=' %s = _property(_itemgetter(%d))\\n'%(name,i)\n \n if verbose:\n print(template)\n \n \n namespace=dict(_itemgetter=_itemgetter,__name__='namedtuple_%s'%typename,\n _property=property,_tuple=tuple)\n try :\n exec(template,namespace)\n except SyntaxError as e:\n raise SyntaxError(e.message+':\\n'+template)\n result=namespace[typename]\n \n \n \n \n \n try :\n result.__module__=_sys._getframe(1).f_globals.get('__name__','__main__')\n except (AttributeError,ValueError):\n pass\n \n return result\n \nif __name__ =='__main__':\n Point=namedtuple('Point',['x','y'])\n p=Point(11,y=22)\n print(p[0]+p[1])\n x,y=p\n print(x,y)\n print(p.x+p.y)\n print(p)\n"], "struct": [".py", "__all__=[\n\n'calcsize','pack','pack_into','unpack','unpack_from',\n\n\n'Struct',\n\n\n'error'\n]\n\nfrom _struct import *\nfrom _struct import _clearcache\nfrom _struct import __doc__\n"], "configparser": [".py", "''\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfrom collections.abc import MutableMapping\nfrom collections import OrderedDict as _default_dict,ChainMap as _ChainMap\nimport functools\nimport io\nimport itertools\nimport re\nimport sys\nimport warnings\n\n__all__=[\"NoSectionError\",\"DuplicateOptionError\",\"DuplicateSectionError\",\n\"NoOptionError\",\"InterpolationError\",\"InterpolationDepthError\",\n\"InterpolationSyntaxError\",\"ParsingError\",\n\"MissingSectionHeaderError\",\n\"ConfigParser\",\"SafeConfigParser\",\"RawConfigParser\",\n\"DEFAULTSECT\",\"MAX_INTERPOLATION_DEPTH\"]\n\nDEFAULTSECT=\"DEFAULT\"\n\nMAX_INTERPOLATION_DEPTH=10\n\n\n\n\nclass Error(Exception):\n ''\n \n def _get_message(self):\n ''\n\n \n return self.__message\n \n def _set_message(self,value):\n ''\n\n \n self.__message=value\n \n \n \n \n message=property(_get_message,_set_message)\n \n def __init__(self,msg=''):\n self.message=msg\n Exception.__init__(self,msg)\n \n def __repr__(self):\n return self.message\n \n __str__=__repr__\n \n \nclass NoSectionError(Error):\n ''\n \n def __init__(self,section):\n Error.__init__(self,'No section: %r'%(section,))\n self.section=section\n self.args=(section,)\n \n \nclass DuplicateSectionError(Error):\n ''\n\n\n\n\n \n \n def __init__(self,section,source=None ,lineno=None ):\n msg=[repr(section),\" already exists\"]\n if source is not None :\n message=[\"While reading from \",source]\n if lineno is not None :\n message.append(\" [line {0:2d}]\".format(lineno))\n message.append(\": section \")\n message.extend(msg)\n msg=message\n else :\n msg.insert(0,\"Section \")\n Error.__init__(self,\"\".join(msg))\n self.section=section\n self.source=source\n self.lineno=lineno\n self.args=(section,source,lineno)\n \n \nclass DuplicateOptionError(Error):\n ''\n\n\n\n \n \n def __init__(self,section,option,source=None ,lineno=None ):\n msg=[repr(option),\" in section \",repr(section),\n \" already exists\"]\n if source is not None :\n message=[\"While reading from \",source]\n if lineno is not None :\n message.append(\" [line {0:2d}]\".format(lineno))\n message.append(\": option \")\n message.extend(msg)\n msg=message\n else :\n msg.insert(0,\"Option \")\n Error.__init__(self,\"\".join(msg))\n self.section=section\n self.option=option\n self.source=source\n self.lineno=lineno\n self.args=(section,option,source,lineno)\n \n \nclass NoOptionError(Error):\n ''\n \n def __init__(self,option,section):\n Error.__init__(self,\"No option %r in section: %r\"%\n (option,section))\n self.option=option\n self.section=section\n self.args=(option,section)\n \n \nclass InterpolationError(Error):\n ''\n \n def __init__(self,option,section,msg):\n Error.__init__(self,msg)\n self.option=option\n self.section=section\n self.args=(option,section,msg)\n \n \nclass InterpolationMissingOptionError(InterpolationError):\n ''\n \n def __init__(self,option,section,rawval,reference):\n msg=(\"Bad value substitution:\\n\"\n \"\\tsection: [%s]\\n\"\n \"\\toption : %s\\n\"\n \"\\tkey : %s\\n\"\n \"\\trawval : %s\\n\"\n %(section,option,reference,rawval))\n InterpolationError.__init__(self,option,section,msg)\n self.reference=reference\n self.args=(option,section,rawval,reference)\n \n \nclass InterpolationSyntaxError(InterpolationError):\n ''\n\n\n\n \n \n \nclass InterpolationDepthError(InterpolationError):\n ''\n \n def __init__(self,option,section,rawval):\n msg=(\"Value interpolation too deeply recursive:\\n\"\n \"\\tsection: [%s]\\n\"\n \"\\toption : %s\\n\"\n \"\\trawval : %s\\n\"\n %(section,option,rawval))\n InterpolationError.__init__(self,option,section,msg)\n self.args=(option,section,rawval)\n \n \nclass ParsingError(Error):\n ''\n \n def __init__(self,source=None ,filename=None ):\n \n \n if filename and source:\n raise ValueError(\"Cannot specify both `filename' and `source'. \"\n \"Use `source'.\")\n elif not filename and not source:\n raise ValueError(\"Required argument `source' not given.\")\n elif filename:\n source=filename\n Error.__init__(self,'Source contains parsing errors: %s'%source)\n self.source=source\n self.errors=[]\n self.args=(source,)\n \n @property\n def filename(self):\n ''\n warnings.warn(\n \"The 'filename' attribute will be removed in future versions. \"\n \"Use 'source' instead.\",\n DeprecationWarning,stacklevel=2\n )\n return self.source\n \n @filename.setter\n def filename(self,value):\n ''\n warnings.warn(\n \"The 'filename' attribute will be removed in future versions. \"\n \"Use 'source' instead.\",\n DeprecationWarning,stacklevel=2\n )\n self.source=value\n \n def append(self,lineno,line):\n self.errors.append((lineno,line))\n self.message +='\\n\\t[line %2d]: %s'%(lineno,line)\n \n \nclass MissingSectionHeaderError(ParsingError):\n ''\n \n def __init__(self,filename,lineno,line):\n Error.__init__(\n self,\n 'File contains no section headers.\\nfile: %s, line: %d\\n%r'%\n (filename,lineno,line))\n self.source=filename\n self.lineno=lineno\n self.line=line\n self.args=(filename,lineno,line)\n \n \n \n \n \n_UNSET=object()\n\n\nclass Interpolation:\n ''\n \n def before_get(self,parser,section,option,value,defaults):\n return value\n \n def before_set(self,parser,section,option,value):\n return value\n \n def before_read(self,parser,section,option,value):\n return value\n \n def before_write(self,parser,section,option,value):\n return value\n \n \nclass BasicInterpolation(Interpolation):\n ''\n\n\n\n\n\n\n\n\n\n\n\n \n \n _KEYCRE=re.compile(r\"%\\(([^)]+)\\)s\")\n \n def before_get(self,parser,section,option,value,defaults):\n L=[]\n self._interpolate_some(parser,option,L,value,section,defaults,1)\n return''.join(L)\n \n def before_set(self,parser,section,option,value):\n tmp_value=value.replace('%%','')\n tmp_value=self._KEYCRE.sub('',tmp_value)\n if'%'in tmp_value:\n raise ValueError(\"invalid interpolation syntax in %r at \"\n \"position %d\"%(value,tmp_value.find('%')))\n return value\n \n def _interpolate_some(self,parser,option,accum,rest,section,map,\n depth):\n if depth >MAX_INTERPOLATION_DEPTH:\n raise InterpolationDepthError(option,section,rest)\n while rest:\n p=rest.find(\"%\")\n if p <0:\n accum.append(rest)\n return\n if p >0:\n accum.append(rest[:p])\n rest=rest[p:]\n \n c=rest[1:2]\n if c ==\"%\":\n accum.append(\"%\")\n rest=rest[2:]\n elif c ==\"(\":\n m=self._KEYCRE.match(rest)\n if m is None :\n raise InterpolationSyntaxError(option,section,\n \"bad interpolation variable reference %r\"%rest)\n var=parser.optionxform(m.group(1))\n rest=rest[m.end():]\n try :\n v=map[var]\n except KeyError:\n raise InterpolationMissingOptionError(\n option,section,rest,var)\n if\"%\"in v:\n self._interpolate_some(parser,option,accum,v,\n section,map,depth+1)\n else :\n accum.append(v)\n else :\n raise InterpolationSyntaxError(\n option,section,\n \"'%%' must be followed by '%%' or '(', \"\n \"found: %r\"%(rest,))\n \n \nclass ExtendedInterpolation(Interpolation):\n ''\n \n \n _KEYCRE=re.compile(r\"\\$\\{([^}]+)\\}\")\n \n def before_get(self,parser,section,option,value,defaults):\n L=[]\n self._interpolate_some(parser,option,L,value,section,defaults,1)\n return''.join(L)\n \n def before_set(self,parser,section,option,value):\n tmp_value=value.replace('$$','')\n tmp_value=self._KEYCRE.sub('',tmp_value)\n if'$'in tmp_value:\n raise ValueError(\"invalid interpolation syntax in %r at \"\n \"position %d\"%(value,tmp_value.find('%')))\n return value\n \n def _interpolate_some(self,parser,option,accum,rest,section,map,\n depth):\n if depth >MAX_INTERPOLATION_DEPTH:\n raise InterpolationDepthError(option,section,rest)\n while rest:\n p=rest.find(\"$\")\n if p <0:\n accum.append(rest)\n return\n if p >0:\n accum.append(rest[:p])\n rest=rest[p:]\n \n c=rest[1:2]\n if c ==\"$\":\n accum.append(\"$\")\n rest=rest[2:]\n elif c ==\"{\":\n m=self._KEYCRE.match(rest)\n if m is None :\n raise InterpolationSyntaxError(option,section,\n \"bad interpolation variable reference %r\"%rest)\n path=m.group(1).split(':')\n rest=rest[m.end():]\n sect=section\n opt=option\n try :\n if len(path)==1:\n opt=parser.optionxform(path[0])\n v=map[opt]\n elif len(path)==2:\n sect=path[0]\n opt=parser.optionxform(path[1])\n v=parser.get(sect,opt,raw=True )\n else :\n raise InterpolationSyntaxError(\n option,section,\n \"More than one ':' found: %r\"%(rest,))\n except (KeyError,NoSectionError,NoOptionError):\n raise InterpolationMissingOptionError(\n option,section,rest,\":\".join(path))\n if\"$\"in v:\n self._interpolate_some(parser,opt,accum,v,sect,\n dict(parser.items(sect,raw=True )),\n depth+1)\n else :\n accum.append(v)\n else :\n raise InterpolationSyntaxError(\n option,section,\n \"'$' must be followed by '$' or '{', \"\n \"found: %r\"%(rest,))\n \n \nclass LegacyInterpolation(Interpolation):\n ''\n \n \n _KEYCRE=re.compile(r\"%\\(([^)]*)\\)s|.\")\n \n def before_get(self,parser,section,option,value,vars):\n rawval=value\n depth=MAX_INTERPOLATION_DEPTH\n while depth:\n depth -=1\n if value and\"%(\"in value:\n replace=functools.partial(self._interpolation_replace,\n parser=parser)\n value=self._KEYCRE.sub(replace,value)\n try :\n value=value %vars\n except KeyError as e:\n raise InterpolationMissingOptionError(\n option,section,rawval,e.args[0])\n else :\n break\n if value and\"%(\"in value:\n raise InterpolationDepthError(option,section,rawval)\n return value\n \n def before_set(self,parser,section,option,value):\n return value\n \n @staticmethod\n def _interpolation_replace(match,parser):\n s=match.group(1)\n if s is None :\n return match.group()\n else :\n return\"%%(%s)s\"%parser.optionxform(s)\n \n \nclass RawConfigParser(MutableMapping):\n ''\n \n \n _SECT_TMPL=r\"\"\"\n \\[ # [\n (?P
[^]]+) # very permissive!\n \\] # ]\n \"\"\"\n _OPT_TMPL=r\"\"\"\n (?P