PK!Qa== ext/parser.sonuȯELF>p@X4@8@#"NN (](] (]  ]] ]  $$PtdKKK||QtdRtd(](] (] GNUXS To@JI A\ 9 @ 9<>BE|ŷ|!qX {K-n"uhQD gZ>O>a )8 R"(\{a c  0:Na   ?__gmon_start___init_fini_ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesruby_xfreerb_gc_mark_mayberb_str_buf_newrb_str_resizerb_str_catrb_utf8_encodingrb_enc_associaterb_str_internrb_ary_new_caparb_ary_pushrb_hash_foreachrb_ary_entryrb_funcall__stack_chk_failrb_enc_raiseruby_xrealloc2ruby_xmalloc2rb_check_typeddatarb_scan_argsrb_id2symrb_string_valuerb_enc_getrb_ascii8bit_encodingrb_str_conv_encrb_hash_arefrb_str_duprb_check_typerb_fix2intrb_eTypeErrorrb_raiserb_eArgErrorrb_data_typed_object_zallocruby_xmallocrb_class_new_instancememcpyrb_cstr2inumrb_hash_newrb_ary_newrb_cstr_to_dblrb_float_newrb_hash_asetInit_parserrb_requirerb_define_modulerb_define_module_underrb_cObjectrb_define_class_underrb_path2classrb_define_alloc_funcrb_define_methodrb_const_getrb_intern2libruby.so.2.4libpthread.so.0libdl.so.2libcrypt.so.1libm.so.6libc.so.6_edata__bss_start_end/opt/cpanel/ea-openssl/lib64:/opt/cpanel/ea-ruby24/root/usr/lib64GLIBC_2.2.5GLIBC_2.14GLIBC_2.4ui  ii $(]  0] @] 5AH]  P] X] ] ] _ _ _ _ _ (_ 0_ 1_ 2`  ` (` 0` 8` @`  H`  P`  X`  ``  h` p` x` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `  a !a "a #a $ a %(a &0a '8a )@a *Ha +Pa ,Xa -`a .ha /pa 2xa 3a 4a 5a 6a 7a 8HHL HtH5L %L @%L h%L h%L h%L h%L h%L h%L h%L hp%L h`%zL h P%rL h @%jL h 0%bL h %ZL h %RL h%JL h%BL h%:L h%2L h%*L h%"L h%L h%L h% L hp%L h`%K hP%K h@%K h0%K h %K h%K h%K h%K h %K h!%K h"%K h#%K h$%K h%%K h&%K h'p%K h(`%zK h)P%rK h*@%jK h+0%bK h, %ZK h-%RK h.%JK h/%BK h0%:K h1H8K H=*K UH)HHw]H$I Ht]@HK H=J UH)HHHH?HHu]HI Ht]H@=J u'H=H UHt H=F h]J @f.H=F t&HH HtUH=E H]WKf.HV3 xIwH42@x;DGNEx,H:xHHH HL HH fD@f.HGXH@H`USHHHoXH}Ht5H-HH[]Df.SHH?H{ H{8H{@H{P[Df.AWAVAUIATUH1SHH8HT$dH%(HD$(1}HT$IEIH]H9E1;"IMHtLePI I}U4t E0H7 xHwH1AHDHL$(dH3 %(H8[]A\A]A^A_fD<\uMwI9\AG@ H|$ HHź1HHCPLHHII9HIHLHHLHl$HL$H udHHCHAHT$(dH3%(HCH LH0[]A\A]A^f.H|$ HHC f.HAHCHAf@u HmHHMHH2?DH5A? H=? 1C(dC,1CHlHC8HC HC@H|$ H#HCHoH|$ HHC4 H|$ HHC,H|$ HHC(<H|$ HHHEHSPH|$ H[HC@fH|$ HCHC8;f.HEƒx~HǾHD$HD$HQC(H: H5H81,H: H5~H81@H57 H H8Ht HHH: H5_H81AUATUHSHH4t#IH5.= 1IL10]HuH[]A\A]1LH5< H1HHtLLfDUH(7 `SHHh HH@H@H@HHEXHH[]Ðf.AWAVAUATUHSHH8dH%(HD$(1H9tGH`II A1Ht?H5: H=: H1H5M: 1HH1~H IIE HLHLHHEHHCH9Ÿ{nHSH9{fHSH9{iHSH9{nHSH9{iHCH9Ÿ{t~HSH9q{ygA|$, HR9 HI.fDHCH9Ÿ0{a&HSH9{NAT$,7 H9 HIDAD$(EhIT$@H11_H9It;[HH5 H-8 hIعHHH1@HCH9Ÿh{a^HSH9Q{lGHSH9:{s0HSH9#{eIHHCH9Ÿ{uHSH9{lHSH9{lIHfDHCH9Ÿ{rHSH9y{uoHSH9b{eXIH.fD r^)fH9I\$<-8<0&1<wHHHBH9t<RE<e3.#0 wHHBH9ufH9I\$<-q<01<lIAE0< w IL9uIl$XMI)HEt'HLH}H}LHPL}Il$XHHE HUID$XHEHxIIIEfDA9H=5 H5D1/A9D s8LLxL9 HQnwHcHHHXH9b@<*t1LD$IPLzL9t7B<,<< t< t <L%LzL9B<*t>1IGLxL9bP,/} 1LLxL9u HpH9 @<*t; u HH9<*t*uЀ t LLxL9P t~Ӏ"/uHPH9i@<*|/HH98 uhHH9z*t/JHH9\8*uLkLzL9B<*t6LD$ r ifVHPH9@<*tIHH9*t/EHHHH98*uH-+ Iع9H-+ Iع H-+ tLCfDATH5% USHdH%(HD$1H$H8HhH5_HHXH9t;MQnSHcHLDHH9uIH+ HHMH1}D0 wE1HHHHLHHL`I9t+P t/ t wLL`I9uH|$dH3<%(H$H[]A\f.LeI9>U*tE/,II9@A<$ II9uA<$*II9u @HH9zL`I9@<*tBz~u 1Q *&  6 W       xq v ,V ! W GX r8QIPx  Uimleniptrauxxary  ($ "asP-^ 3 f (6 "7 8 9 . : W= H? e @ (G Hg0 . I8 ! K@(AB B C DQ -EW-QB g m xb  c  n U O? PM QMe _M  3 bq bG 3 C   Y_b}}ba t s   b] b @  (  06 0 8 T @ H P X `[  h pq N x b! Mb      t      b   b    b* *      bT N 6 b}   }  CZ b     b   b }            bH H *      v  T ! o_  . /8!ptr0!len18283o  8` w   !len !i " #  $b( %b, &b0 'b4 (8O )@ *bH +P2 ,w X   - "j "k f C Mn v o K  S w x& 6  F V f 3 #Y} $fbYw %j $ &$'& } %8b &&G&()0)&0)m0)/0-#*oB$fbow )^ o$leno8#Yd$fbw )' %Ul&U *pU*peU&U8+csWb, b-st2-st3-st7K-st0,c,X,Y-st4 -st5+,Z-st8,[-tr9!-st9O,\, ]-st66, =,^,i_, `.+len^i%3$&3 *p3*pe3&38+cs5b, -st2-st3-st5-st0,,,-tr4-st40,, .+len<i(LV)&L)K Lb)/L-/C Iw |)I80fbKw 1- `b2p-3b/940  ?5?- 6ptrU7U } #S3$fbSw 8 19ptr: ;<(=>>>?Uv@>?UU83 1N9ptr!: !=,>=5>=>>=G>AQ>%&&I&+p+pe''b+buf.+ch .+sur / @b $buf@$ch@ 0lenBb5>`tB m9p9pe B8ECcsb: D c-st2-st0DdD[Etr2wEst3<-st8,\D]Est4&D^Est537D _Est6@XD`Est7MyD aFN{[|?UsL|?Us= >>)>?Ts?Q A?R ?XL>?U|L>?U|L2>?U|?T?Qs=5>>S>?Ts?Q HA?R ?XKp:G5:kL??U2L2??UL L??U|?T %?QLh??U?T1>>??Q1L?2?U0=?=>=?=?=@M^`2fb^w N ^84L`8L @?Ts?Q1>(@?T1%;&;+enc>d 5 fL BfbBf8YBf37h7e h@:i JlCtmpz$J:|HLE$B@?TvL$]@?U?TE>$t@?UK`$ Y: >m$B@?Tv=h @L ??Q1?Rv= @L ??Q1?Rv= @L!??Q1?Rv=!@L=!??Q1?Rv=n!@L!?+?Q1?RvL!?B?Q0=!@L!?l?Q1?Rv=!@L"??Q1?Rv=;"@LY"??Q1?RvL#B@?TvL#B@?TvL#B@?TvL$B@ ?TvL$B@8?TvL$B@P?Tv><%@?T AFu"><GH %L"@?Uv="@=">L"@?UvL"@?Uv?Q~L[#@?Uv=c#>>n#??UvL# Ac?U}?T @] LP (A?Uv?T~?Q ??R|?X@Lu"IA?U|L"IA?U|L#??Q0= %@>$%@?T ?O} @%9< H Ka%P UQa%R >y%@?T ?LP% A?UU?T @] Aa%@O %< < O< K%:rP ]P \P VL%h?:?U}?T0L%?W?Uv?Q1>&2??U}?T|>%??U|?Q05+ &UBG : FCobjiJ` :0i>'&jA?UU?T`?Q @] SV+&TfGHqU$8&NzVJ V?<4>8&A?U %2!& *p*pe&8&(b+csb'O, m-st2-st0,n,\-tr2, ;-tr41-st3,]-st4-st9,^-st5, _-st6-st8 ,`-st7, a,b,c, , *,id, !,ue,f,# ,tg,h, D, T,i, K,j,k.+vq+npr/#) $p$pe)8)(b0csbWW, Xst2Xst0,,Xtr2, -tr4`Xst3,Xst4Xst8,Xst5Xst7, Xst6,, ,Y ,- jXst9,, , @,i,  ,u, ), 9,, 0,,,, I,( Y,,# P,t,Y%,k,, s, ,, z,%,1,=, , ,I, ,,_Zj#0npZ#0v0np.W".WG5p&k2B 9p9pe#B8%B(b&CcsbR), _Est1',AEtr2([tr3('Est6&D (D# )Etr7)D- h*D *D +@+D '-st0,`\9܊+Dl  {)\q )\ *\*+\֊+,B-st2{,C-st3-st5,D-st4,E, F,GEst7-Est9', HEst8q-,I,J,iKD (,uLD ),MD ),ND 1),OD H),PD d),Q,tRD( ),S,TD *,UD *,%VD *,1W,=XD *,IYD $+,Z,_[D%2\+,k\D 9s+,w]J+0np]d+`)0A?Ts?Qw>0t?U?Tw;f 0_K)0t?U?T1L0A)?T1=1A]l0,p+<}g.<}g.<.</<~/GpH90^_/_/^^^^^^^^^ GH0F,>.+<60<+1,A?Ts?Q>,t?Uv?T;f ,=T+,t?Uv?T1>,A?T:= 7>Jp/+npS2!'.?Q1L(?[.?Uv?Q0>4??Uv?Q1LY(?.?Q1=1B@J/Io#Hx#Z9L3#.?U|?Qv?R?X}LU3?.?Q2=6BKP21L/H_#9>k2 ?U|?T?Qv?RwL''Bh/?U0?T0L!-@/?T  @?Q}=/GBK(/3np9>( ?U|?Ts?Qv?R~J02+npS)<9<:<L;< <<=GHd>HB?^^^ ^ ^ _ S/_" i.^* ^2 ^: ^B _J {5^R _Z .^b _j %/_r =/^z _ }/^ ^ ^ _ 5_ 5^ _ 5^ ^ ^ ^ ^ _ ._ .^ _![/^ !^!J`1I!H%!?L-#1?U|?T?Qv?Rw?X}L.?1?Q1=62?L!*'B2?U0?T0=H*>=/SBLd*>C2?Tv?Q ?=:6@=#7>=<7>5 P745B?@Cpx@CpeACcsb'B7P: BD 9Est1C7D9Etr2^8Est68-st0[D9, Di9Est2r09D9Est3{9Est5k9D9Est49D9D 9D9Est79Est98D 9Est89D9D9K8!4Cnp^C>$8#?Tv?Qs?Rw?X0L|7 A4?UU?T @] =7>L8>5?Ts?Q ??R ?X|L :@&5?T ?=%:@a#*0:N;J57^7 Hb >o?^B?U x@J57^8 @b >O?^B?U ?J 67^9 8b >/?^B?U |@J@ C67^; 0b >?^B?U @?T?Jp 67^< (b >>^B?U @?T;J 67^=  b >>^B?U @?T9J 77^> b >>^B?U @?T@J C77^? b >>^B?U @?T3J0 77^@ b >q>^B?U @?T;J` 77^A b >Q>^B?U @?T9J 87^B a >1>^B?U @?T?J C87^C a >>^B?U @?T<J 87^D a >=^B?U @?T;J 87^E a >=^B?U A?T5JP 97^F a >=^B?U  A?T<J C97^G a >=^B?U A?T4J 97^H a >q=^B?U A?T>J 97^I a >Q=^B?U +A?T3J :7^J a >1=^B?U /A?T2K<$O:7^K a >=^B?U 2A?T2L@:yBn:?U &@LL:B:?U 2@Lb:B:?T 7@L:B:?T :AL:B:?U ;@L:B ;?U M@L:B(;?T &L: CZ;?T `@?Q ?R L: C;?T k@?Q P7?R0L; C;?T q@?Q @%?R0=5;.C=X;.C={;.C7  m @] < b< J ;bZ c biZ c bZ c bZ b b Z b b![ b b[ b b[ b b9] b b ] b b] b b] b b-^ b b^ b b^ b b^ b b_ b bM_ b b_ b b_ xb b~_ pb b ` hb b` `b b_ ` Xb b` Pb c_kcwkd(Td? ^dedtgdtmdxd {dd e>ff >g; e >h, ?ii 32?iiw CL?fL h?i, G?ih?bh ?ih ?ii ?h[ @j: iȍ(@--iōB@--h" ]@f1t@bhRi@hTv@f @iB }@g iC @hT  Ah q(Agh7bIAbPh5_A_AeAkhnA-gičA-l)Ah mAbh Ai fBbh 'Bh< GBbPmD gj 2h yBih+FBhBhDBht Bh Bf  Cf.Crbn % : ; I$ > $ >   I : ;  : ; I8 : ;I8 I !I/ : ; &I&: ; I : ;(  : ; : ; : ; : ;I : ; : ;I8  : ;I'I: ;I'II : ;   : ; ! : ; I8 " : ; #.: ; ' $: ; I%.: ;'I &: ;I'4: ;I(.?: ; 'I 4): ; I*: ;I+4: ;I, : ;- : ;. /.: ; 'I 04: ; I1.: ; 'I@B2: ; I34: ; I44: ; I5.: ;'I@B6: ;I74: ;I8.: ;'@B9: ;I:4: ;I;1X Y<1=1>1?B@B1AB1B: ;IC4: ;ID : ;E : ;F1RUX YG UH41I41J UK L1M.: ; '@BN: ; IO.1@BP1Q R41S1RUX YT1U1X Y V1 W4: ; IX : ; Y : ; Z [ : ; \ : ; ]1RUX Y ^ 1_ 1`1a.?: ;'@Bb4: ; Ic4: ; I?<d4: ;I?<e.?: ; '<f.?: ;'<g.?: ; 'I<h.?: ;'I<i.?: ; 'I<j.?'4<k5Il.?'I4<m.?: ;'I<n.?: ;'I< 5 ../fbuffer/usr/include/bits/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/usr/include../../.././include/rubyparser.rlfbuffer.hparser.cstring3.hstddef.htypes.hlibio.hruby.hst.hintern.honigmo.hencoding.hparser.hstdio.hdefines.h `-גZZxJMwwKvJzJI=-s< >K~<*NXxXvJ 8xt JtJ[)JTCwJ J[;|J|Jh=KI=WJ < IKj].EIYIYlvr qr.].vts=Y!ɻ,KztGYYW|>V=IKI=WK t tL]<o<t   tt<s?U=IKI=Wt?<s +<b<G7<p<wXv*}7Y!W[vXIYXZr:XZH>j= tv=wv=wv=wvt=w=w=w=x ~<~<;YYMK>Xf$~/uv-uYLUz(z(t(ɾ0yzt>!JX-tsKIW}֑WK)E#g-"ZzXz<_otL|J<`'}f0#~}gvH>f{fXJZY.'<YQ>SSbQbQ2R2]R].< f<[1[^1^18a1a^1^1fs\v\^|^|Sa^^Sq^E^Sb^^;S;T#aT#T#qT#>T#>ESSbT#T#\a\\q\E\Sb\\;S;kX:CSCXXX>EScSc_sUss_:_:vS_XSa_s,_,[s[_Sq_>_>ESSb__R @TC @ ?T @ ? @ ?1 ?1I ?Ia @ @q @> @Sb @ @R1C11a11q1>1Sb11PZP0Z0[[ZPqZ"Z"&PSbZZZP[ZPqZ"Z"&PSbZT[q>Sb12[13q1212>4Sb11;PPUP_Uc\cdUdgUg\TaVadTdlTlV(R(_SU V  U ] V] U V UT# ^# T ^  T V ^V T ^ T ^Q ] P ] P ]P S S P S ! P! % R% W VW ^ P^ b Rb V P R V P R V ' P' + R+ q Vq x Px | R| V P R V P R V V] V V V V P P  % P  P V  VV V V# ' P' < ^  ^V ^ U U PP JUJcVchUhV BTB[\[hTh\ LQL[][hQh]UUVPSPPvUUU \ }U}H\H\U\p\pU\WUW\U\U\6U6=\=DUDJ\JTUT\U\U\U\FTFdSdPPS S GPGFSHpSptst|P|ssQsQsQsQsPss:Q:DsDLPL\s\`s`xQxssS s P$s$(s(;Q;?s?RQRVsVyQysPssQsQsPssQs*Q*5s5WSSSPKSPS !S&SSGrSSSSsQs@Q@VQ+V+HQHhVhpQpVQ"V"QQVQrQrVQVQVQVQFRF^R^R^XXXH}H`X`pXpX}XXXXXX}@X@=}=DXDJ}JTXTZ}ZXIXIXGXGr}rX}X}X}X}XXXXXX411 M h1hpMp11W\6@\ZG\r\\\W^6@^ZG^r^^^W"V"Q6@VZGVrVVVQPQP]Q]PG]r]]W16@1%1G1r11*0}s0IPIw*k_>IPIkw>k_JkwJR"R]Uk0k_\6@\Z\\^6@^Z^^"V"QZVVS]6@SZ^S^]SP]]16@1Z11(}s(_"(}s(_"S"YV2Y_2YS2YV=Y_=YS=Evv"EOUY0YVYH]]=J]Gr]]]]YH^^=J^Gr^^^^Y+V+HQV=JVGQVQrQVVVYSQB_BHS=JSG!_!%Q%ZPZTP:_:>P>H_HT_P_QQPQr_P__Q8P8;Q;OPfPQPY}U}H\U=DUDJ\Gr\\\\Y f1HK f=J fGYKYQ1QrK111gQQ=DQPR+-P-1U1>VQrVP_O`P`f_ !PahP]]]@=]JZ]]]]^^^@=^JZ^^^^VQVV@=VJZVVVVSS_P_@_Q_Q_ ]_]nPnr_rP_=PJZS___U\U\@=\JTUTZ\\\\ f1 f1@PAP=1JZ f111QQJTQP]=P U "U* Y VY c \c { V{ \ V P \ !P!!\&!4!V4!!\!!V!X"\X"c"Vc"h"\h""V""S8 S "!S&!"S""S &  f& q 1 !1!&!:&!"1"":""1"" f"": q P P&!!PX""P""P P p""P YhxESb0@x>Sb[x>Sb ` `    R  ` `6@ZGr`Gr%*4<kk|6@Z"(0YYjow|PP@PGrPUY>@PGr>GYQr>QrOf@@PZP@PZe##((####'(##$$''"$2$''9$I$''P$`$`''g$w$@'`'~$$ '@'$$' '$$&'$$&&$$&&$%&&%%`&&%/%@&`&6%F% &@&M%]%& &d%p%%&w%%%%0F   p  @ p ? ?K@L(] 0] 8] @] ] _ ` a  8]  p . Da S0] z (]  `b J   1 1 ` %b b " `3 LF@] HWb eb mb yb b b c b b hb  @%9b pb  &U p&/b >Xb Exb Vb `b eb sPb `b  P7c c Hb @b 8b 0b (b  b 7b Pb ib ob b a a a a a a 7a Pa ia a N8] ] ] Ka `  3>ITaa hw ?5@Siy c $5@a LYf z 0:N ": @\r}crtstuff.c__JCR_LIST__deregister_tm_clones__do_global_dtors_auxcompleted.6355__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entryparser.cunescape_unicodedigit_valuesJSON_memsizeJSON_freeJSON_markJSON_parse_stringmatch_ii_json_createeParserErrorfbuffer_inc_capacParser_initializeJSON_Parser_typei_max_nestingi_key_pi_allow_nani_symbolize_namesi_create_additionsi_create_idmJSONi_object_classi_array_classi_match_stringcParser_sourcei_json_creatable_pi_matchcJSON_parser_s_allocateJSON_parse_valueCMinusInfinityi_arefi_deep_const_getCInfinityCNaNeNestingErrori_leftshifti_asetcParser_parsemExtcParserrb_intern_id_cache.10715rb_intern_id_cache.10717rb_intern_id_cache.10719rb_intern_id_cache.10721rb_intern_id_cache.10723rb_intern_id_cache.10725rb_intern_id_cache.10727rb_intern_id_cache.10729i_chrrb_intern_id_cache.10731rb_intern_id_cache.10733rb_intern_id_cache.10735rb_intern_id_cache.10737rb_intern_id_cache.10739rb_intern_id_cache.10741rb_intern_id_cache.10743rb_intern_id_cache.10745rb_intern_id_cache.10747rb_intern_id_cache.10749rb_intern_id_cache.10751rb_intern_id_cache.10753__FRAME_END____JCR_END____dso_handle_DYNAMIC__GNU_EH_FRAME_HDR__TMC_END___GLOBAL_OFFSET_TABLE_rb_eTypeErrorrb_raise_ITM_deregisterTMCloneTablerb_cObjectrb_enc_getrb_requirerb_ary_entry_edatarb_cstr_to_dblrb_enc_associaterb_scan_argsruby_xrealloc2_fini__stack_chk_fail@@GLIBC_2.4rb_cstr2inumrb_hash_arefrb_str_resizerb_funcallrb_str_catruby_xfreerb_string_valuerb_ascii8bit_encodingrb_ary_newrb_check_typeddatarb_class_new_instancerb_ary_new_caparb_str_conv_encrb_utf8_encodingrb_hash_asetruby_xmalloc__gmon_start__rb_check_typememcpy@@GLIBC_2.14rb_str_buf_newrb_hash_foreachruby_xmalloc2rb_path2class_endrb_define_methodrb_str_dup__bss_startrb_const_getrb_enc_raise_Jv_RegisterClassesrb_float_newrb_ary_pushInit_parserrb_id2symrb_define_alloc_funcrb_gc_mark_mayberb_define_modulerb_define_module_under_ITM_registerTMCloneTablerb_eArgError__cxa_finalize@@GLIBC_2.2.5_initrb_data_typed_object_zallocrb_define_class_underrb_intern2rb_str_internrb_fix2intrb_hash_new.symtab.strtab.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.got.plt.bss.comment.debug_aranges.debug_info.debug_abbrev.debug_line.debug_str.debug_loc.debug_ranges$.o<8 00@.HoF F ~Uo @d  hnBppx  s@@0~pp)?? ?? KK|@L@L(] (]0] 0]8] 8]@] @]P ] ] _ _@` `a ap0a-a0bFCK" .09UCD @ @ !n `*3RPK!'1@@ext/generator.sonuȯELF>@@8@#"tmtm || | P P}P} P}  $$Ptd___QtdRtd|| | GNUle3#~IeRN/$F$@ FHJBE|qXt)s '\7! uhP `Bt].@5a gx8 R"D)Xȁ k8 _ȁ  8 YM L __gmon_start___init_fini_ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesrb_funcallrb_check_typeddataruby_xfreeruby_xmallocruby_xrealloc2ruby_xmalloc2memcpyrb_str_newrb_utf8_encodingrb_enc_associaterb_check_typerb_str_new_staticrb_hash_arefrb_hash_newrb_obj_classrb_class_namerb_hash_asetrb_str_duprb_str_catrb_str_concatrb_str_internrb_sym2idrb_ivar_setrb_ivar_getrb_ary_entryrb_string_value_cstrrb_iv_getrb_str_substrrb_id2symrb_intern2__stack_chk_failrb_check_convert_typerb_convert_typerb_scan_argsrb_data_typed_object_zallocrb_string_value_ptrrb_path2classrb_raiserb_eArgErrorrb_float_value__isinf__isnanrb_cHashrb_cArrayrb_cStringrb_cFloatrb_respond_torb_cFalseClassrb_cIntegerrb_cTrueClassrb_cSymbolrb_cNilClassrb_obj_is_kind_ofrb_const_getInit_generatorrb_requirerb_define_modulerb_define_module_underrb_cObjectrb_define_class_underrb_define_alloc_funcrb_define_singleton_methodrb_define_methodrb_define_aliasrb_cRegexplibruby.so.2.4libpthread.so.0libdl.so.2libcrypt.so.1libm.so.6libc.so.6_edata__bss_start_end/opt/cpanel/ea-openssl/lib64:/opt/cpanel/ea-ruby24/root/usr/lib64GLIBC_2.14GLIBC_2.4GLIBC_2.2.5Nii ui | | @} J]} } H} H} p x         ' ) / 0 2 : ; < > E  ( 0 8 @ H  P  X  `  h p x          Ȁ Ѐ ؀   ! " # $ % & ( *( +0 ,8 -@ .H 1P 3X 4` 5h 6p 7x 8 9 = > ? @ A B C DHH]i HtH5i %i @%i h%i h%i h%i h%i h%zi h%ri h%ji hp%bi h`%Zi h P%Ri h @%Ji h 0%Bi h %:i h %2i h%*i h%"i h%i h%i h% i h%i h%h h%h h%h hp%h h`%h hP%h h@%h h0%h h %h h%h h%h h%h h %h h!%h h"%h h#%h h$%zh h%%rh h&%jh h'p%bh h(`%Zh h)P%Rh h*@%Jh h+0%Bh h, %:h h-%2h h.%*h h/%"h h0%h h1%h h2% h h3%h h4%g h5Hg H=g UH)HHw]H|e Ht]@Hg H=g UH)HHHH?HHu]He Ht]H@=g u'H=e UHt H=b h]Xg @f.H=pb t&H7e HtUH=Zb H]WKf.HH7tuYv@fDHuJ1AvfD1Dwfu w@1xvfHW>f WfWf0WG@f.H?tzHGHHt HWHDH t HW(HDH0t HW8HDH@t HWHHDHWPHtHBHWXHtHBHW`HtHBfHH 6g H5wf 1H5Y` HHHHDDf.H5)` HH@xHHDfH5 ` HxqHHHЃ@f.H5_ HpxpHHHЃ@f.H5_ H@HxhHHHЃf.H5y_ HH@hHHDfSHHHtH[DSHH?HtH{HtH{ HtH{0HtH{@HtH{PHtH{XHt{H{`HtmH[T@SHH HDH@H@H@H[fATIUHSHtSHOIT$HH)H9v:HHHH)H9rH9vI|$H;I\$ID$[]A\H?_I $ID$IL$Df.U1SHHHtHH HHHH[]Ðf.USHHHwHHH/JHHoHH[]DUSHH5d] HH߾HHXH~HH[]USHH5$] HHHHH]xH[]USHH5\ H{H߾HHHHEhH[]f.ATUSHH5\ =HIH+H% upHHI|$@uHtID$@[]A\fHt H% HH{tH{H9Il$HID$@[]A\DHkf.ATUSHH5[ HIH+H% upHHI|$0uHtEID$0[]A\fHt &H% HH{tH{HIl$8ID$0[]A\DHkf.ATUSHH5B[ HI=H+H% |HHI|$ u+HtID$ ID$([]A\DHt fH% HH{tH{HIl$(ID$ []A\DHkf.ATUSHH5Z HI}H+H% |HHI|$u+HtID$ID$[]A\DHt H% HH{tH{H Il$ID$[]A\DHkf.ATUSHH5Y ]HIH+H% uxHHI<$u(HtI$ID$[]A\Ht H% HH{tH{HQIl$I$[]A\fDHkfSHHH=h8HH3H=5HþHH5^ H[1%DATUHStHHyHH5^ H=_ I11LHHYH=5H5y^ HH1H=7Hž[HHH H[]A\DAU1I1ATUSHHHH5z^ ]HHH56H^H5] HIĺ1H"HuJH=4HH.H6HLHH0H[]A\A]H5Y] HH[]LMA\A]1f.U11SHHHH5] H5] HHź1HhHu@H= 4HHtH|HHHH[]sH5\ HH[H1]AWAVAUATUSHH(H<$dH%(HD$16H5oV HIH5-[ IHH<$111HHD$HD$HH9L-\ HH1H1L_HHD$ HIAH|$HUH<$H9H|$IWI#HKLHL}HE `HEH9cIvI>H=[ HXHHL:IvI~}H=[ H.HHLIv(I~ SH=l[ HHHLIv8I~0)H=:[ HHHLIvHI~@H=[ HHHLA~pH=Z HHӃHHLjA~qH=Z HHӃ`HHLBI^hH=Z H\=HHLI^xH=Z H\HHLIH=Y H\HHLHL$dH3 %(LuAH([]A\A]A^A_@LxH=0@AHzX HQf.AVAUIATIH5}S USHH 0H0LHHH/H=Y +HHpHDH=uY HHMHH=JY HH*HfH=Y HHHH=X HHHH=X |H5X HIHEhd1HH,H=%X @H5IX HIHEx1HHH=W H5 X HIĺ1HXHuXH=X HHH=W HEpHHHLEqH[]A\A]A^fDLHHItHIMyLmDLHHyHEx@LHeH)HEh@HǾHD$HD$L0A LpHxIvLu8HE0+HǾHD$HD$L0A QLpHxIvLuHHE@HǾHD$vHD$L0A LpHxIvPLu(HE UHǾHD$.HD$L A L`HxIt$LeHEf.HǾHD$HD$L A t%L`HxIt$LeHEzfDIHxAIt$DIHxAIt$nf.IHxAIvIHxAIvIHxAIvFH G,H;,LHDHǾHD$HD$HHEhqDHǾHD$HD$HHExDATIH5N UHSHHdH%(HD$1H+H@hdHǀL1HHH4$HtHHT$dH3%(Hu H[]A\EDH N oDf.ATIHUHSH[H{H{HLHk[]A\Df.ATH5M US@HHHkXIH!HEHHEHU,HEHk`HHEHs Ht HS(HHHEHU:HsHEHt HSH{`Hu\HkPHt{HEH^HEHU,Hs@HEHtHSHH{PHt[]LA\f.fHHk`OHHCPwfHHCXf.vHHC`f.SIgfffffffHV-H dH%(HD$1HIIH?HH1H)fMHMAIHH?HH)HHH)H HA@uHxVI@LL9v$f.1HHH9@pQwLL)tLvHD$dH3%(uH [MAAA-pUHSH(H\$Ht$dH%(HD$1HEHL$H u8HH\$HHL$t HHHD$dH3%(u H([]HQDUHSHHH>HHuHtHHD$HD$H[]H5yJ HHx@HtHpHHf.H='1H^@f.H5)J HHx0HtHp8H:f.H=K'1H@f.H5I HpHx HtHp(Hf.H=&1H@f.H5I H HxHtHpHf.H=&1Hn@f.H59I HH8HtHpHKH=c&1H&fDAWAVAUATIUHSHHHdH%(HD$81OHCHSHH O H5O "HC1A<$^L(A L`Lh1E11fD$4HD$0MD$0L5[)D$0\D$1uHD$fDI<,<yP5IcLfHJ%AHL)HLHHII9wHL)t K4fDL(HD$ A LpLhK.1D$0fT$4D$0\L9HD$D$1uQA.H '@fD<EK.H9D$;HD$0HD$fDELAt$Hcd/fAIH&H &JcHf.1AIFHHLpHHAIVHHHBHHLpHH&McJ+,HH(H=HEH_fH"\H\*H5 "HfDL9t$A.H J&@fD<EK.H9D$H=!H5$H1L1fD1fL1fDL1fDIHILpAfHHL|$HfH f(L{LHLZLHL9t$HD$ HD$(HD$ HEHH $HcHf.H5 H\H5 H@T@HHsH;HsH{HEHs(H{ HEHs8H{0HE H{@HsHHE0zH{PHE@HtHwHHEPH{XHtHwHvHEXH{`HtHwH\HE`[]LA\J@fH2f. DHHOH}HsEHHfOHRC H5H81ATIUHHSHH'E$$H5F 1H1D$EHuD$fu"D$u8HHH[]A\HH=F H5ZHٺ^1kHcH=\F H55Hٺa1FfDAUIATIHUHSHH5ȃ/HU dHCLA I9H=A H9H=A H9HHH*HuHt HWA H9^H57E HH5(E H11HHHHH[]It$qA\A]zf.HHHH A HHA HH5D HL1wHHHHH[]A\A]fH5HH[]A\A]fHHH[]A\A]HHHH[]LLA\A]eDHHH[]LLA\A]DHHH[]It$pA\A]fDH5[H? HfH5+H? HfH? HH5RC 0H1.HfDHQ? HaAWHAVAUATIUSHHH@PL*H $HJ@Ht$LzHpH@HL$ HJHHT$HD$Ht$(HL$0HHRhHHIxHYHL$8H9HXxLID$IT$[ID$H|$ t H|$0HL1IH$H HH9t H|$Mt8M~3E1fIM9tHtHLLIM9uH<$HH[HT$Ht$HLH$H nH$H@H9mH|$ HD$IHL$8HHxtIH|$0Mt8Hl$8H~.1DHH9tMtLLLHH9uLVID$IT$]ID$HH[]A\A]A^A_HT$Ht$(LHT$0Ht$ LbHT$0Ht$ LeH'fHD$H=@ H5HHxHQH $HPx1AWHAVAUATUHSHhH@XL*HL$@HJ0Ht$LrHpH@HL$(HJ8HT$HD$HHt$XHL$8HHRhHA`HxH@HD$0HHIxH|$PHYHL$H9HXxbHE1HEHUH5]? H|$@{HE11HD$HD$H HI9Et H|$HH|$(t H|$8Mt3H~.E1 @II9tMtLLHII9uH|$LH5G? 1HI1 HHD$ HD$ HT$HHt$HH|$0H|$@LIHT$Ht$HHHD$H HD$H@I9HD$H|$(HHxLaHL$L`xtFH|$8Mt5M~01HL9tMtLLHHL9uHNHEHU}HEHh[]A\A]A^A_fDHT$0Ht$PH HT$8Ht$(H^fHT$HHt$XHn*HT$8Ht$(HW-HHHD$H== H5HHxHQHL$HPx1fDATIUSHAH56 HHHLHH.[H]A\fUSHHH56 HH@HH[]fDUHSHHHH)HtHH[]f.H8 HH0Hu)H=< HtH=3 H H5 H=3 HH5 1H=3 H H5 H=g3 H H5] H=H3 H!H5A H=)3 HbH5& H=3 H5 >H5 HH2 (HqH5 HH2 FH=2 H5H\H5 HH~2 H=2 H5 HH5 HHA2 H=M2 H5 HrH5g HH2 H=2 H5[ TH}H52 HH1 rH=1 H5, HXH5 HǹH1 MH=~1 HH5 H=_1 HH5 H=@1 HH5 1H=$1 H5 H)H5 HH0 H=1 H5 [HTH59 HH0 yH=0 H5 &HH5 HHy0 DH=0 H5U H5HHH<0 H5@/ HOH(, H80H/ H/ H H/ H. HH/ H. HH/ H. HdHm/ H. H-HN/ Hw. HH// HX. HH/ H9. HH. H. HQH. H- HH. H- HH. H- HH%. H- HuH. H- H>HG. H`- HH(. HA- HH . H"- HH- H- HbH- H, H+H- H, HH- H, HHn- H, HHO- Hh, HOH0- HI, HH=RH, PH, HHH=2qHHǺ1H\H%. H+ HtyH . H+ HtFH- H+ HuH=BH+ H$- H!- H[]fH=HX+ fDH=H@+ jH=`H(+ HH=6H+ H=H* H=oH* ]H= OH* &H=/H* H=H* H=QH* H=*Hh* JH= HP* H=H8* H=oH * H=OH* nH=c/H) 7H=N H) H=$ H) H= H) H=H) [H=[ Hx) $H=  oH`) H=OHH) H=/H0) H=@H) HH=H) H=ϿH( H=@ 豿H( HHH0123456789abcdefC*@instance_variablesto_hashHashto_h01\n\r\t\f\b\\\"JSON::GeneratorErrorunallocated JSON::State%u: %li not allowed in JSONnullfalsetruenesting of %ld is too deepjson/commonExtGeneratorJSON::NestingErrorfrom_stateinitializeinitialize_copyindentindent=spacespace=space_beforespace_before=object_nlobject_nl=array_nlarray_nl=max_nestingmax_nesting=check_circular?allow_nan?ascii_only?depthdepth=buffer_initial_lengthbuffer_initial_length=configuremerge[][]=generateGeneratorMethodsObjectto_jsonArrayIntegerFloatStringincludedto_json_rawto_json_raw_objectExtendjson_createTrueClassFalseClassNilClassMULTILINEto_snewallow_nanascii_onlyunpackcreate_idextendkey?__send__respond_to?matchkeysduputf-8findEncodingencodingencodeSAFE_STATE_PROTOTYPEJSON/Generator/Statepartial character in source, but hit endsource sequence is illegal/malformed utf-8source sequence is illegal/malformed utf8xxp01234567890    ;?  H`Px0P 8 Xxp0@ph`P@@  p@Pxp@ Hp0 ` ` p 0 ` @ h  0( ` p   8 p P zRx $pFJ w?;*3$"Dи\BtйHP!KPhKMp"KP"KP#KQKM4AUT|Avt 7Au,@BDD V ABA $5ACG gAA$;AAG lDA$л@AAN hFA$<8AAN `FA$d6AAN cAA<BAA Q AGC w ABF <BAA Q AGC w ABF < BAA ^ AGF w ABF <LxBAA ^ AGF w ABF <BAA X AGD v ABG h[AN,BAD ABLBIA A(J0 (F ABBA K(D AMB4lAEJ ` GAH KDKLBBB B(A0A8G` 8A0A(B BBBE DBBE K(A0D@ 0A(A BBBG 4<xBKF G0g  AABA t,1BGD `AB,BHA  AEK $HAU0 AA ,{ADD@d AAA $DP9ADG0jAAlhBKV O MBKV O MBKV O MBKV O M(:KU H ML HBBB B(I0D8GT 8A0A(B BBBF ,\BGA  AEA 4hBDG G0M  GABE BEG D(G0 (G AGBO p (D ABBG P (D ABBG D (G ABBP D (G AHBJ D (G AHBJ D (G AGBK Ll8BEB B(D0A8D 8A0A(B BBBD Lh*BEB B(A0D8Dc 8A0A(B BBBG , H>BDA lDB$< X*AAG [DADd `ADM N DAK o CAM K DKF $ AK w AA $ 0AK w AA $ AK w AA 4$ BAK D0v  AABA 4\ hBAK D0v  AABA 4 BAK D0x  AABA 4 8BAK D0x  AABA , 2BDF ^AB44 BDH D0u  AABA ,l AKD0 AAG , AHD n AAC @J]H}  +6DNp 8 Y| | oP 0   (( ooo$oP} v&6FVfv&6FVfv&6FVfvGCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44),.?S}C .?B %?w|int pypA$ iI  ( ^ 0  8 @ {H 9P X  \`  bh > ip  it ; wx M [ Ih 3x ? & 0 / 7 0 > 1 E 2 L 34 5i 7~ \s\S bi+ x $   r i U?IDV?I ? Y4 5 # ?'Y{     , z1 o(IM,V W X    Frk+ 1h(p@lenpptrauxF:hary  " ( sasl  @(p@qlenpauxptrq:@ary ( sasw (6 s7 t 8 9 :  =$ H?s @ fGs s H0 I8 K@(A t B C "D E4   p OF PTb QT _T l i i l |  ?5 ii L  ? iP iY     (g : 0 i 8. @ HA P XI / ` S hx p( x i Ti  i  i4 4  ic 4c 4 @ i 4o i 4 | i  i ) i ) $ *  4 S 5 i  c 4 4 4Y    o  . /? ptr0 len1?(2?r3 X ? M F : C ;$ p ? + @p( A03 Bp8 C@ DpH E P F X G `  Hph; Ip Jq[ Kpx Lp # M ! Y "fbY !J #J"end$c%L| #L# Li#L4%0 #0#F0#04!o "fbo #o"leno?! "fb # &T3; '3 ' 3' 3; (obj3 &8 '8 ' 8' 8; (obj8&= '= ' =' =; (obj=&B 'B ' B' B; (objB)  ,"fb $len?*- +V' , ; +' , ; + Z' Z, \; +U5' 5, 7; +<' , ; ! |,#| "buf|#} &%j'% ' %' %; (obj%+(obj',; ,; & V'V ' V' V; (objV,jX-,;Y-tmpZ&GX'G ' G' G; (objG-tmpI&*N'N ' N' N; (objN+4p(a+' ' .UF4/BU4U/U?T0aW 1,X4:  2\pB3bufpU4p J5yr Z6 47ptr U8  U9#4 6 R: :,-;#x<UT<Q16!: h9 ; =Dx<UU<T } 6T: 9 ; =Dx<UU<T } 6E":  9 ; Y=Dx<UU<T } 6" ": |9 ; =0Dx<UU<T } 6P#K: 9 ; =`Dx<UU<T } 6: 49 ; m=Dx<UU<T } 2S>fbS ?_x;_x<UU@||Aptr9 ; ?_x?_x?_x?_x? _x??%?3;<_x<UU.I @7:4I?NBfbK PCJ ZN%Dp De EZ P=Zpx<U 2^>fb^ 4 ^? 1(`?|Fx<Ts<Q1=x<T162 35rAptr3Alen3?9-4JG| 07XH mH H J=>x<Tv<Qs=0x<Us<T1.P;>fb 1-?fxFq<Us?vx=y<Uv6d )@: )H:)9+p9 ,;  FDx<UU<T } =!y<UT<TE68-: Q :[ 9 ; FDx<UU<T } =!y<UT<TE6 6:  :[X 9 ; F% Dx<UU<T } =5 !y<Us<TE6P :  : Ilen? 9 ; Fc DxG<UU<T } Fs !yd<Us<T5? _x? _x= <Tv6* !g: B :{ Ilen? 9 ; M F!Dx<UU<T } F#!!y8<Us<T5?K!_x?j!_x=!<Tv6e!;: e : e Ileng?j9 h; F!Dx<UU<T } F!!y <Us<T5?!_x?*"_x=G"<Tv6Ap": A:\AIIlenC?9 D; F"Dx<UU<T } F"!y<Us<T5?"_x?"_x=#<Tv60#: w:CIlen?89 ; FC#Dx<UU<T } FS#!y<Us<T5?z#_x?#_x=#<Tv6G #[: AoIarycF#!yP<Us<T8F$8yt<U `\<T3F $Sy<UsF!$8y<U Z<T2;;$#x<Q16C@$: Iary9-.?L$nyFW$zy;<Uv?_$yFy$#x_<Q0F$y}<Us<Q|F$8y<U Z<T2F$#x<Uv<Q1F$8y<U `\<T3=$y<Us<Qv6$r!: w::j9f F%#x} <UT<Q0F%y <UvF"%y <T  \<Q1F>%#x <Us<Q1<R|FW%8y!<U Z<T1Fb%y!<Tv?j%z?r%-zF%CzP!<Us<Q};%#x<UU<Q2<XQ6o%": {:F%#x!<UT<Q0F%#x!<Us<Q1<RvF&8y"<U Z<T1F&y1"<Tv?$&z?,&-zJ=&czd"<UU;_&#x<UU<Q1&"'' ,-iiK",L-key,cp,j6 `&&: 9-[9 ; M"&$H"LH"NO"O"dP@#Q" Ё =O)~z<U ZP$Q"O"O"F&z#<Uv<TsF'#x$<T}<Q0F+'z3$<UF7'zL$<UwFM'zi$<T1<Q?U'z=c'y<U|<Q}M&$H=&#x<Uw<Qs?&nyF&Dx%<Us<T } ?'x?'{F'y:%<U|<Qs?'x?'{F'yr%<U|<Qs?'x?'{F'y%<U|<Qs?(x?({F$(y%<U|<Qs?1(x?@({FN(y&<U|<Qs?h({Fv(yE&<U|<Qs?({F(yp&<U|<Qs?({F(y&<U|<Qs?({F(y&<U|<Qs?({F )y&<U|<Qs?c){62p),: 2c: 2Itmp4T9 5; Rh+@'9y8R~+*'9{p[=+!y<TE=s+Sy<Us<T|P,(9[o~F+Sy(<Us<T|=J.!y<UH<TEP ~(9 dF+Syc(<Us<T|=".!y<UH<TEPP(Ilen[?F ,!y(<UH<T5?0,P)IlenS?HFR,!y(<UH<T5?x,PM)IlenK?~F,!y?)<UH<T5?,P)IlenC?F,!y)<UH<T5? -R -`)Ilen;?F2-!y)<UH<T5?U-F)Dx*<U}<T } F){?*<U|<T8<Q 1Z<R )Z?){F)Syd*<Us?){F)Sy*<Us? *{F*Sy*<Us?.*{F9*Sy*<Us?Q*{F\*Sy*<Us?t*{F*#x(+<Us<Q1<R|?*{F*#xX+<Us<Q1<R|?*{F+#x+<Us<Q1<R|?+{F'+Sy+<Us?=+{FH+Sy+<Us=.D{<U|<T8<Q 1Z<R 6Z6 `.,: i :o  :  8 P9 ; :!F.Dx,<Us<T } F.i{,<Uv<T|<Q ;Z<RwF.&,<Us?.{6%.x-:%]!, '; S.,(;/{<UU<T<Q } T /1.H !H !H ."C| -/ s-H z"H "H "=8/x<T|<Qv=%/:<Us<Tv6 P/0: )#9 b#9 ; #G /.H -$G /.H P$H $=/:<Uv<T1G //H $M /H/H $H %H <%=x0x-<UvM /@/H r%H %=/:<Uv<T1M /p/H %H &H N&?e0x-G 0/H &M 070H &H &="0:<Uv<T1G D0 |0H &H 'H 5'?N0x-F`/Dx0<UU<T } ?o/F00<U@F00<U@=0<U@)hp=1#l p"bufUyM1*p$tmp M1 =1202>fb X'4l p'Bbuf~P0len?(V00?2H 1W(H1(NO&1)O11s)Q1 H^W ^1,H5 )H* *S^1,O@ ;*C 12H (H ^*H *=1x-<UU<Tw?1{2hy1{3>fby *>stryW+1{+0len|?+R135 ~3PV 2b3H ,H 2,H U,=2x-<UvF1{z3<Us?;2{3XT @2924E  E  O,O ,C [2$4H ,H -H B-=m2x-<UX?T2T,2B4H=y-OI-P@4E=UN@YI;28y<U RZ<T0F2Dx4<UU<T } Z2xTV2Br5Hg-Os!.Pp>5EgUNpYs;38y<U RZ<T0F2Dxd5<UU<T } Z2xT 3B6HW.O.P5EUNY;b38y<U RZ<T0F03Dx6<UU<T } ZF3xTp3B6H.O.P~6EUNY;38y<U RZ<T0F3Dx6<UU<T } Z3xT3:R7H5/On/P7EUNY;38y<U RZ<T0F3DxD7<UU<T } Z3x!W7# #*B4*4$buf7K7$ch *ML* 3 7 !^8# #$ptr$p$len?*J?$end?*d*Ni$cF$buf7L, MT,4@H9/H]0EQQEEEM 40'8D "H 0=14:<Us<T1M7j4p.;H70H7/1NpO7x1O71O82O83O83O%84O08H5O;85QD8M 5+9H 6H A7H 7=5x-<Us<T|"M 5,9H 7H 7H 7=!5x-<UsM &500W:H 8H s8H 8=:5x-<Us<T|"<QvP`:OP88?6F6{:<U SZF6{:<T ]F8{:<U SZ=8{<T `]=6?<UG :50O;H %9H _9=G5:<Us<T1MR76,o@Hi79H^7:NOt7:O7;Q7PR@O7I<O7 =V87@Q<H >H[>H >C %9<<H >H >H >=59x-<Us<T<Q6=%9?<UC &8<H ?H 3?H _?=:8x-<Us<T MZ<Q2C;9K=[ H?H ?C F96=H ?H ?H @=V9x-<Us<T<Q6=F9?<UC 9 =H 6@H Z@H @=9x-<Us<T AZ<Q2C 9 >H @H @H @=9x-<Us<T GZ<Q2C 9 b>H AH @AH lA=9x-<Us<T >Z<Q2C : Ŀ>H AH AH A=:x-<Us<T DZ<Q2C : ?H BH &BH RB=4:x-<Us<T JZ<Q2C@:S?H uBHBH BV P:?H BH C=]::<Us<T1C x:?H &CH JCH vC=:x-<Us<T PZ<Q2F\7@<U~<T| $ &F:{6@<U SZ=:{<T ]Sa9 Q7F_4#x@<Uv<Q1?:{Tj:BH{CHCYYNHADH{DNODO[EM| :3AH EH FH MFF:DxXA<U|<T } F:Dx}A<Us<T } ?R;?c;?t;?;?;?;3?;3?;3=<{<T hZT<lCHFHGEEOgGOGOGF<{{B<UsF<#xB<Us<Q0F<|B<aX-F<|B<aX-J=2B<UUF=B<UvF5={+C<T Z<Q ^<RsF==CC<Uv=Z={<T Z<Q a<Rs+\C(obj@ g`=G:g 0H: gJ: g; LAobjgNItmpioP,jMlCj=j&DH}CNMA ?tDHZ PHf QHr $QHN GQ\ ?:H jQH QH GQ;.?x-<UUM 4?xEH QH RH ?RH xR;H?R1<UU<TR1&G ?rxEH RH" RH. SH @S] ?5H cSH SH @SG ?vEH SH SH TH /T] ??H RTH vTH /TG@!z]FH'TH3TH?TH1US@!OKTU=2@#x<UsFA>.|uF<UsF\>#xF<Us<Q0Fl>!yF<Us<T5J>^8F<UU<TQ#q^ET^QQF>#xG<Us<Q1<R}F>!y#G<Us<T5J?2Q: kAobj*l9 vl9 ; lFF.aQ<UsF!FDxQ<Us<T } F2FCQ<Uv<Ts<R|Z>Fr68@F*WR: lAobj.m9-gm, ; FNFP5R<Us<TT=`FDx<Us<T } TpFSHmHnP RHHoHo;F#x<UU<Q1<RTFFI|R<Us<TvFFI|R<UsJF#xS<Q0?Gd|6 GT: io:o p: Rp9 p8 `, ; M pGp -TH p[" E. QH p\ pG 5D E ZH p=Gx-<Us<T Z<Q4FDGi{`T<UU<TT<Q ;Z<Rw?TGFgGDxT<T } ?pG.FGrT<Us?G{6pGbV: ip:o 1q: jq9 q8 `, ; MA H UHZ q[f Er QHN q\ H :D E ZH q=Hx-<Us<T Z<Q5FGi{V<UU<TT<Q ;Z<Rw?GFGDx/V<T } ?H.FHrTV<Us?:H{6@HX: ir:o Ir: r9 r8 `, ; M H0 sWH s[ E QH r\ H` ?D E ZH r=Hx-<Us<T Z<Q4FdHi{W<UU<TT<Q ;Z<Rw?tHFHDxW<T } ?H.FHrW<Us?H{6HEY: i(s:o as: s9 s8 P9 ; BtFHi{X<UU<TT<Q ;Z<Rw? IFIDxX<T } ?)I.F}m<T [<Q [FxP}n<T 6Z<Q `&<R0FP>},n<T )Z<Q 6ZFP}]n<T \<Q %<R1FP}n<T \<Q $<R2FP}n<T  \<Q @F<R1FQ|n<T \FQ|n<T %\F:Q}/o<T ,\<Q K<R FMQ|No<T 1ZFoQ}o<T ,\<Q J<R FQ|o<T 4\FQ}o<T ,\<Q J<R FQ|o<T :\FQ}"p<T ,\<Q 0L<R FQ|Ap<T B\FR}sp<T ,\<Q pI<R F!R|p<T H\FCR|p<T O\<Q <R1FbR}p<T ,\<Q H<R FR}'q<T X\<Q PK<R FR}Xq<T d\<Q @$<R0FR|wq<T w\FR}q<T ~\<Q #<R1FR|q<T \FS}q<T ,\<Q @H<R FS|r<T \F  5  5 x 5 p 5 h 5 ` 51 X 5^ P 5H H 5 @ 5J 8 59 0 5  ( 5  5   5m  5  5p  5   5  5  5  5 ؂ 5 Ђ 5 Ȃ 5  9w 5]8Nw ^ )w cw 5Hxw `^ Swc bc bdTd?Ud ^dedfdgdGmdBtdYvdxdd{deDxie q_xf pxg` Ĕx4g Ȕx44g  Ŕx44hxexpi y gg !yyj#18yie Sypenyke\yeye-ye yehypeY ze-zeuCzecze~zezpgb Gzpe7z3e^zeX{ppev{l e bD{ie ai{iei{iqen{4em6{3e{jS {ea-|gi|-gi.|-eMiI|eNd|eW |eXF|e |e|e|j |fz }ij>}imr% $ > : ; I$ >   I : ;  : ; I8 : ;I8 : ; I !I/ &I&: ; I : ;(  : ; : ; : ; : ;I : ; : ;I8  : ;I'I: ;I'II : ;  : ; I8 !.: ; ' ": ; I#: ; I$4: ; I%.?: ; 'I 4&.: ;' ': ;I(: ;I).: ; 'I *4: ; I+.: ;'I ,4: ;I-4: ;I..: ; 'I@B/: ; I04: ; I14: ; I2.: ; '@B3: ; I4: ; I54: ; I6.: ;'I@B7: ;I84: ;I94: ;I:: ;I;B1<B=1>: ; I?1@.: ;'@BA: ;IB4: ; IC1X Y D1 E1F1G1X YH1I4: ;IJB1K L M1RUX YN UO41P UQ41R S T.1@BU4: ; IV1RUX Y W1X Y X5IY41ZB1[1\1RUX Y]1X Y^1B_.?: ;'@B`4: ; I a4: ; Ib4: ; Ic4: ; I?<d4: ;I?<e.?: ;'I<f.?: ; '<g.?: ; 'I<h.?'I4<i.?: ; 'I<j.?: ;'<k.?: ;'I<l.?'4<m.?: ;'<5 ../fbuffer/usr/include/bits../../.././include/ruby/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/usr/includegenerator.cfbuffer.hstring3.hruby.hstddef.htypes.hlibio.hintern.honigmo.hencoding.hgenerator.hstdio.hdefines.hmathcalls.h IK?ofKs/H0Z]ts< .Zo.wfZz .Qvg/;I= fttttKKLv=sKYuIYdsKYKIYr<sKYuIgqsKYuIgXsKYIg sKYKIYv< =Y= >YYYYYYYY=|":>YWK_o>Y!W[vXIYX",}~ ;=YZrLY:=ZYw^YsKY;>;LK=Yu=W/YYXJW\tYJ>=Yu=W/YYXJW\tVJ>=Yu=W/YYXJW\sXJ>=Yu=W/YYXJW\sVJ>=Yu=I/YYXJWNs{ >s=g_vY;=5*s=v1+?+ٻ;==i:yEA)Ek!I=i,Hh,xF@ff=Y=mXtm< ut;Y== Ku)****((##&d&  rhYW=YI=hggggg= = = fhsh:Ls.e=0;Zqps!JKYIv!JKYIv!JKYIv!JKYIv.!KYIKIKKIKCKIKKIKKIKY/(! X!XZr>:[r|&|[9X?Y@L<0r0Ys=ZH>y+ɻXyyJyJXXyXy+yJXXy: qtzy Jy*5YrJ!=sa.6vX SXWKvsX <sXak(BtfsKYKIIZ.sKYKIIY.sKYKIIY.sKYKIIY.sKYKII~zXzYzKX{=N0VXfX:ztfXK=zt~DJX~ɻXz(~tJ(h||$/_IK&  ol~ >9YZhKq.s,.נ .[.K.~s< s< s<nIK tX=Wf [fC1PJ(z19X?gs=;=xfIKYKYKYKYIKYx~:YYhY;=/IgIyX#w<ןwJXhk/=[HhɟywW=BzJBzf4tfffJff.ffJhJfh.fhJvJ fv#0uw/vBG9KI\LKzJYH_WTZ=M:Lzffz  XuvtzJYX zXf\ %uv ez.YzXfzXfgWYC+BG9YI\LKzJYH_WTZ=MrZ9M{f{ T> B UB I TI M PM V V ) Q) ] Q ] X Qo v Pv } R} \ \ R U w Sw | U| } U} S U U  T  U ) T) 0 P0 7 R7 x V} V R U S awallywySw P ]\]lPl\P\ P i^ly^yP^ awallw ]\]lPl\P\  P cVlyVV  0 f S SlyS] _ P ] cVlyVVU]P]T\PS%S%K\KSPSP3?PVbPyPPPR\PR9\9@P@GRGP\g|PP\4\4IPI}H}PHP H !P!VHVqPq%H%BPBFSFKPK\PVVP\ PsPH4PKaPasHc}^%^^ ^ ^^;V\\\\U#V#&U&+VT%\%&T&+\QS*P*+SP0@U@AUPdUd}S}UPXTX\TPdQd~V~Qe~V~Qe\Temss"mwUUUP\P\P\PSSV,,VVQQTTVV::HVV?DQQ?DTT?DUUMUVU,UVQTU UUUU TTTTxwQFWPWF^T^cQcRQQFTTTTF^W^cXcjYjXXPWRQWPWUUU&U&oVopUp{V*T*nsnpHp{s+XPpvP?XQLXQLXPLoVopUv{VtPXQTPXUUPPURU 5P6QP`oUoUpPPUUPPU:U$P%9P@pUpSUS@pQpVPmP)P).PlpUpSUSPmPzSSSz\m\x\\=U=P|v"Pa|v"1U|v"UUUm|v"UUz]m]]]0\_az_m___0PVPavazVmVVV=0=LPaz0 GZP02 DZ2J JZJ]0]m002J2]m67P7=uPuPu-P-2u2EPEJuJ\PPuPPu=FvFLQqQ=L|"|"=aSSL`XL`PLaSflvlyQyzvfr|"ryTyz|"fzSp^"8$8&#z""zSUS)P).P.pSSS!^P^QP^^~^%^   ~"^E_P_.P0V00vV.QVQUTV0e_\p^"8$8&__.I_I\_\__DQ v:% (QU t:% (D~D~Se~6e~e~Sfz2fz MZfzSu~u~S6S2 AZS2 GZS929 >Z9S9Y29Y DZ9YSYy2Yy JZYySyVyySVS2 PZS  U /!\/!0!P0!!\  T 7 S7 !T  T 7 S7 (!T0!!T  U (!\0!!\) 0 P0 (!V0!!V!!U!!V7 L PL (!S0!!S!!P!!S= (!0!!= L PL (!S0!!S= (!V0!!V!!U!!V!!U!I"VI"O"UO"P"UP""V!!Q!"S""Q""a""X"K"\P""\")"P)"H"SH"O"TP""S"#U##V##U##U#$U$E$VE$M$UM$N$UN$e$Ve$m$Um$n$Un$|$V|$$U$$U$$U$$V$$U$$U$$V$$U$$U$$V$$U$$U$%V%%U%1%V1%_%U_%z%Vz%%U"y#Ty##]##T#$T$I$]I$N$TN$W$TW$i$]i$n$Tn$w$Tw$$]$$T$$T$$]$$T$$T$$T$$]$$T$$T$$T$$]$$T$$T$%]%,%T,%1%]1%f%Tf%z%]z%%T""Q"#\##t##Q#G$\G$N$QN$g$\g$n$Qn$~$\~$$Q$$\$$Q$$Q$$\$$Q$$Q$$\$$t$$Q$%\"#R##S##R#$R$1$S1$N$RN$m$Rm$n$Rn$$R$$R$$R$$S$$R$$R$$R$$S$$R$$R$$R$$R$q%Rq%z%Sz%%R##P##S1$8$P8$<$SN$W$TW$\$]N$\$\N$\$RN$\$VN$\$5N$\$ Zn$w$Tw$$]$$Tn$~$\~$$Qn$$R$$Rn$|$V|$$U$$U$$T$%]$%\$%R$%V$%4$% Z%,%T,%1%]%1%\%1%R%1%V%1%4%1% Z_%f%Tf%z%]_%z%\_%q%Rq%z%S_%z%Vr%z%P% &U &'\''U''\''U'(\%%T%(%%Q%%R%&P&'''P'(%%R%'w'''(w((R%%R%%q%%r%&p&'''p'(%%R%%q%%r%&p&'''p'(%']'(]%E&_E&1'S1''_''S'(_%&Q''Q% &T &&p#&'''T'(%%P%%r#%&p#&'''p#'(%@&S@&I&PI& '_ ''''_''R'''(SE&&V&*'V''V}&&0&&~&&^%'3'03'<'sA'S'S&'[&&U&'\''U''\.&:&''.&:&''.&:&\''\E&'w''''wl&x&''l&x&''l&x&\''\&&S&&]&&\']'''']'''']'\''\3']'_3']']3']'\]'']]''\''U(q(Uq(*V**U*:+V(A(TA(:+~(i(Qi((R((P(*~*+P+:+~(4(R4(:+J(N(RN(i(q0i((r0((p0(**+p0+:+b(e(Re(i(q8i((r8((p8(**+p8+:+b(*]*:+]b(*^*:+^i((Q*+Qi((T((p#(**+T+:+i(m(Pm((r#((p#(**+p#+:+((U((p#(** +U ++p#+:+((p#(**+p#+:+(*S**\**~1**S**\*:+S()\)*\**\*)4)04)<)A)S)_0*9*09*D*sI*[*Sy){)P{))U))_**_))P))**((P(*~**~(*{(*V**U**V((P(*~))**))**))V**V)%)**)%)**)%)V**V4)])^4)])]4)])V))**))**))V**V*e****e****e*V**V9*e*^9*e*]9*e*Ve**}e**V**U@+N+UN+s+Ss+~+U@+N+TN+y+\y+~+TY+`+P`+w+Vw+}+Ua+q+P++U++S++U++T++T++P++V++P++U++T++V++U+,V,,U,:,V:,>,U>,?,U?,_,V++T++S++P+,S,,T,/,S/,>,R>,?,T?,_,S,/,S/,>,R>,?,T,:,V:,>,U>,?,U`,,U,,U`,,T,,T`,h,Qh,,Q,,P,,S,,S,,w,-U-z-U,-T-z-T,,Q,z-QJ-V-PV-t-Su-z-SJ-V-w--U- .U--T- .T--Q- .Q--P-.S. .S--w.9.U9..U.9.T9..T..Q..V..Q..Vq.{.P{..S..Sd.h.Ph..\..\..U.B/U..T.B/T..Q.:/V:/=/Q=/B/V//P/9/S=/B/S//P/?88>>99>>9,9>>39C9p>>J9Z9P>p>a9q90>P>x99>0>99=>99==99==99==99p==::P=p=:):0=P=0:@:=0=G:W:<=^:n:<<u::<<::<<::p<<::P<p<::0<P<::<0<;;;#;;<K;W;;;^;j;;;0P $( 8 `  Y Z_a| | | } P} p  ȁ  |   . @Dȁ S| z |   B     !"} H< I "] "p P#   | @7  5 P; @  8  61 P E !Z !r p" 0# #[  @$    $x    %" `&.Ё G` PX XP gH s@ ~0 ( 8 Ђ Ȃ  p)  `. . /1 P/. 0B H^ N 1{a @29t 2B 2B 3B p3B 3: 40   ^ `^0 :0 <L \ `=jp t B* P@ ؂  F> @F* pF   h  , G> E GY @Hl H| pI J J PK2 K 0L       ؃ Ѓ $ȃ , 7 C M f x       'x @p Yh r` X P H @ 8  0 ! ( :  S  Z  s               (   5 ؁ N pm\ | h H} u P} ~ _ ȁ         5 ? J W ȁ ^ o |      Y      L   * 5 @ S _ p ~          8  ) 4 E ` k ȁ w         $; Uan" 8 crtstuff.c__JCR_LIST__deregister_tm_clones__do_global_dtors_auxcompleted.6355__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrygenerator.cisLegalUTF8unicode_escapeState_memsizemString_included_smString_Extendi_extendcState_buffer_initial_lengthJSON_Generator_State_typecState_depthcState_ascii_only_pcState_allow_nan_pcState_check_circular_pcState_max_nestingfbuffer_freeState_freefbuffer_allocfbuffer_inc_capafstrndupfbuffer_to_scState_buffer_initial_length_setcState_depth_setcState_max_nesting_setcState_array_nl_setcState_object_nl_setcState_space_before_setcState_space_setcState_indent_setmString_Extend_json_createi_packmString_to_json_raw_objecti_create_idmJSONi_unpackcState_aseti_to_si_respond_to_pi_sendcState_arefcState_to_hrb_intern_id_cache.10569i_indenti_spacei_space_beforei_object_nli_array_nli_allow_nani_ascii_onlyi_max_nestingi_depthi_buffer_initial_lengthcState_configurei_key_pcState_initializecState_s_allocatefbuffer_append.part.1cState_prepare_bufferfbuffer_append_longdigits.9915fbuffer_append_strfbuffer_dup.isra.6cState_array_nlcState_object_nlcState_space_beforecState_spacecState_indentgenerate_json_string.isra.12CEncoding_UTF_8i_encodetrailingBytesForUTF8offsetsFromUTF8cState_init_copygenerate_json_float.isra.14eGeneratorErrorgenerate_jsoni_to_jsongenerate_json_objectgenerate_json_arrayeNestingErrori_keyscState_partial_generatecState_generatecState_from_state_sCJSON_SAFE_STATE_PROTOTYPEi_dupi_newi_SAFE_STATE_PROTOTYPEmNilClass_to_jsoncStatemFalseClass_to_jsonmTrueClass_to_jsonmString_to_jsonmFloat_to_jsonmArray_to_jsonmHash_to_jsonmString_to_json_rawmObject_to_jsonmInteger_to_jsonmExtmGeneratormGeneratorMethodsmObjectmHashmArraymIntegermFloatmStringmTrueClassmFalseClassmNilClassrb_intern_id_cache.10835CRegexp_MULTILINErb_intern_id_cache.10837rb_intern_id_cache.10839rb_intern_id_cache.10841rb_intern_id_cache.10843rb_intern_id_cache.10845rb_intern_id_cache.10847rb_intern_id_cache.10849rb_intern_id_cache.10851rb_intern_id_cache.10853rb_intern_id_cache.10855rb_intern_id_cache.10857rb_intern_id_cache.10859rb_intern_id_cache.10861rb_intern_id_cache.10863rb_intern_id_cache.10865rb_intern_id_cache.10867rb_intern_id_cache.10869rb_intern_id_cache.10871rb_intern_id_cache.10873i_arefrb_intern_id_cache.10875rb_intern_id_cache.10877rb_intern_id_cache.10879i_matchrb_intern_id_cache.10881rb_intern_id_cache.10883rb_intern_id_cache.10885rb_intern_id_cache.10887i_encodingrb_intern_id_cache.10889rb_intern_id_cache.10891__FRAME_END____JCR_END____dso_handle_DYNAMIC__GNU_EH_FRAME_HDR__TMC_END___GLOBAL_OFFSET_TABLE_rb_iv_getrb_string_value_cstrrb_str_concatrb_raise_ITM_deregisterTMCloneTablerb_convert_typerb_cObject__isnan@@GLIBC_2.2.5rb_cFloatrb_requirerb_ary_entry_edatarb_enc_associaterb_scan_argsrb_cStringrb_cHashrb_cNilClassruby_xrealloc2_finirb_str_new_static__stack_chk_fail@@GLIBC_2.4rb_hash_aref__isinf@@GLIBC_2.2.5Init_generatorrb_funcallrb_str_substrrb_str_catruby_xfreerb_check_typeddatarb_ivar_getrb_utf8_encodingrb_respond_torb_hash_asetruby_xmalloc__gmon_start__rb_check_typememcpy@@GLIBC_2.14rb_string_value_ptrrb_class_nameruby_xmalloc2rb_path2classrb_cTrueClass_endrb_define_aliasrb_cRegexprb_define_methodrb_define_singleton_methodrb_str_dup__bss_startrb_obj_is_kind_ofrb_const_getrb_cArrayrb_cFalseClassrb_obj_class_Jv_RegisterClassesrb_float_valuerb_id2symrb_sym2idrb_define_alloc_funcrb_define_modulerb_str_newrb_define_module_under_ITM_registerTMCloneTablerb_cIntegerrb_eArgErrorrb_check_convert_type__cxa_finalize@@GLIBC_2.2.5_initrb_data_typed_object_zallocrb_define_class_underrb_intern2rb_str_internrb_ivar_setrb_hash_newrb_cSymbol.symtab.strtab.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.got.plt.bss.comment.debug_aranges.debug_info.debug_abbrev.debug_line.debug_str.debug_loc.debug_ranges$.o<8 00 @P P Ho$$Uo@d(nB((x88s``p~@YY ZZ __aa | || || |} }P P} P} p p ȁ ȁp0ȁ-0%W}|"i.0=9*~DӨ  ! ,RPK!L99 __init__.pynu[r"""JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of the :mod:`json` library contained in Python 2.6, but maintains compatibility with Python 2.4 and Python 2.5 and (currently) has significant performance advantages, even without using the optional C extension for speedups. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print json.dumps("\"foo\bar") "\"foo\bar" >>> print json.dumps(u'\u1234') "\u1234" >>> print json.dumps('\\') "\\" >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) {"a": 0, "b": 0, "c": 0} >>> from StringIO import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, ... indent=4, separators=(',', ': ')) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == u'"foo\x08ar' True >>> from StringIO import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(o) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) """ __version__ = '2.0.9' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONEncoder', ] __author__ = 'Bob Ippolito ' from .decoder import JSONDecoder from .encoder import JSONEncoder _default_encoder = JSONEncoder( skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, encoding='utf-8', default=None, ) def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, sort_keys=False, **kw): """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is true (the default), all non-ASCII characters in the output are escaped with ``\uXXXX`` sequences, and the result is a ``str`` instance consisting of ASCII characters only. If ``ensure_ascii`` is ``False``, some chunks written to ``fp`` may be ``unicode`` instances. This usually happens because the input contains unicode strings or the ``encoding`` parameter is used. Unless ``fp.write()`` explicitly understands ``unicode`` (as in ``codecs.getwriter``) this is likely to cause an error. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. """ # cached encoder if (not skipkeys and ensure_ascii and check_circular and allow_nan and cls is None and indent is None and separators is None and encoding == 'utf-8' and default is None and not sort_keys and not kw): iterable = _default_encoder.iterencode(obj) else: if cls is None: cls = JSONEncoder iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, separators=separators, encoding=encoding, default=default, sort_keys=sort_keys, **kw).iterencode(obj) # could accelerate with writelines in some versions of Python, at # a debuggability cost for chunk in iterable: fp.write(chunk) def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, sort_keys=False, **kw): """Serialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is false then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, all non-ASCII characters are not escaped, and the return value may be a ``unicode`` instance. See ``dump`` for details. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. """ # cached encoder if (not skipkeys and ensure_ascii and check_circular and allow_nan and cls is None and indent is None and separators is None and encoding == 'utf-8' and default is None and not sort_keys and not kw): return _default_encoder.encode(obj) if cls is None: cls = JSONEncoder return cls( skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, separators=separators, encoding=encoding, default=default, sort_keys=sort_keys, **kw).encode(obj) _default_decoder = JSONDecoder(encoding=None, object_hook=None, object_pairs_hook=None) def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. If the contents of ``fp`` is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must be specified. Encodings that are not ASCII based (such as UCS-2) are not allowed, and should be wrapped with ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` object and passed to ``loads()`` ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. """ return loads(fp.read(), encoding=encoding, cls=cls, object_hook=object_hook, parse_float=parse_float, parse_int=parse_int, parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name must be specified. Encodings that are not ASCII based (such as UCS-2) are not allowed and should be decoded to ``unicode`` first. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN, null, true, false. This can be used to raise an exception if invalid JSON numbers are encountered. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. """ if (cls is None and encoding is None and object_hook is None and parse_int is None and parse_float is None and parse_constant is None and object_pairs_hook is None and not kw): return _default_decoder.decode(s) if cls is None: cls = JSONDecoder if object_hook is not None: kw['object_hook'] = object_hook if object_pairs_hook is not None: kw['object_pairs_hook'] = object_pairs_hook if parse_float is not None: kw['parse_float'] = parse_float if parse_int is not None: kw['parse_int'] = parse_int if parse_constant is not None: kw['parse_constant'] = parse_constant return cls(encoding=encoding, **kw).decode(s) PK!q tool.pycnu[ ofc@sAdZddlZddlZdZedkr=endS(sCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) iNcCs>ttjdkr*tj}tj}nttjdkrattjdd}tj}n[ttjdkrttjdd}ttjdd}nttjdd|:ytj|}Wnt k r}t|nXWdQX|4tj ||dt d d d d|j dWdQXdS(Niitrbitwbis [infile [outfile]]t sort_keystindentit separatorst,s: s (Rs: ( tlentsystargvtstdintstdouttopent SystemExittjsontloadt ValueErrortdumptTruetwrite(tinfiletoutfiletobjte((s!/usr/lib64/python2.7/json/tool.pytmains&    t__main__(t__doc__RR Rt__name__(((s!/usr/lib64/python2.7/json/tool.pyt s     PK!8>/>/ decoder.pyonu[ ofc@sdZddlZddlZddlZddlmZyddlmZWne k rgdZnXdgZ ej ej BejBZdZe\ZZZdZddZied 6ed 6ed 6Zejd eZid d6dd6dd6dd6dd6dd6dd6dd6ZdZdZdeeejdZepSeZejd eZd!Z eje d"Z!eje d#Z"de#fd$YZ$dS(%sImplementation of JSONDecoder iN(tscanner(t scanstringt JSONDecodercCssdjd}tjdkrM|d ddd|dddd}ntjd|\}}||| fS(Nt 7FF80000000000007FF0000000000000thextbigiitdd(tdecodetsyst byteordertstructtunpack(t_BYTEStnantinf((s$/usr/lib64/python2.7/json/decoder.pyt_floatconstantss /cCsU|jdd|d}|dkr2|d}n||jdd|}||fS(Ns ii(tcounttrindex(tdoctpostlinenotcolno((s$/usr/lib64/python2.7/json/decoder.pytlinecols   c Cswt||\}}|dkr=d}|j||||St||\}}d}|j|||||||S(Ns#{0}: line {1} column {2} (char {3})s?{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})(RtNonetformat( tmsgRRtendRRtfmtt endlinenotendcolno((s$/usr/lib64/python2.7/json/decoder.pyterrmsg$s s -InfinitytInfinitytNaNs(.*?)(["\\\x00-\x1f])u"t"u\s\u/t/utbu tfu tnu tru ttsutf-8cCs||d|d!}t|dkr_|ddkr_yt|dSWq_tk r[q_Xnd}tt|||dS(NiiitxXisInvalid \uXXXX escape(tlentintt ValueErrorR(tsRtescR((s$/usr/lib64/python2.7/json/decoder.pyt _decode_uXXXXAs" cCs|dkrt}ng}|j}|d}xN|||} | dkrgttd||n| j}| j\} } | rt| tst| |} n|| n| dkrPnL| dkr|rdj | } tt| ||q|| q1ny||} Wn)t k rNttd||nX| dkry|| }Wn9t k rdt | } tt| ||nX|d7}nt ||}|d7}tjd krfd |kod knrf|||d !d krft ||d}d|ko7dknrfd|d d>|dB}|d7}qfnt|}||q1dj||fS(sScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.isUnterminated string starting atR!s\s"Invalid control character {0!r} attusInvalid \escape: iiiiis\uiiii iuN(RtDEFAULT_ENCODINGtappendR+RRtgroupst isinstancetunicodeRt IndexErrortKeyErrortreprR.Rt maxunicodetunichrtjoin(R,Rtencodingtstrictt_bt_mtchunkst_appendtbegintchunktcontentt terminatorRR-tchartunituni2((s$/usr/lib64/python2.7/json/decoder.pyt py_scanstringKs^               3  s [ \t\n\r]*s cCs|\}} g} | j} || | d!} | dkr| |krm||| j} || | d!} n| dkr|dk r|| } | | dfSi} |dk r|| } n| | dfS| dkrttd|| qn| d7} xtrt|| ||\}} || | d!dkr||| j} || | d!dkrttd|| qn| d7} yM|| |kr| d7} || |kr||| dj} qnWntk rnXy||| \}} Wn)tk r6ttd|| nX| ||fy@|| } | |kr||| dj} || } nWntk rd} nX| d7} | dkrPn+| d krttd || dnyc|| } | |krH| d7} || } | |krH||| dj} || } qHnWntk rbd} nX| d7} | dkrttd|| dqqW|dk r|| } | | fSt | } |dk r|| } n| | fS( NiR!t}s1Expecting property name enclosed in double quotest:sExpecting ':' delimitersExpecting objecttt,sExpecting ',' delimiter( R1RRR+RtTrueRR5t StopIterationtdict(t s_and_endR;R<t scan_oncet object_hooktobject_pairs_hookt_wt_wsR,Rtpairst pairs_appendtnextchartresulttkeytvalue((s$/usr/lib64/python2.7/json/decoder.pyt JSONObjects             #                       c Cs|\}}g}|||d!}||kr\|||dj}|||d!}n|dkrv||dfS|j}xEtry|||\} }Wn)tk rttd||nX|| |||d!}||kr!|||dj}|||d!}n|d7}|dkr;Pn'|dkrbttd||nyM|||kr|d7}|||kr|||dj}qnWqtk rqXqW||fS(Nit]sExpecting objectRLsExpecting ',' delimiter(RR1RMRNR+RR5( RPRQRTRUR,RtvaluesRXR@R[((s$/usr/lib64/python2.7/json/decoder.pyt JSONArrays@            # cBsGeZdZdddddeddZejdZddZ RS(sSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | unicode | +---------------+-------------------+ | number (int) | int, long | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. cCs||_||_||_|p$t|_|p3t|_|pEtj|_ ||_ t |_ t |_t|_tj||_dS(s``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as ``unicode``. ``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N(R;RRRStfloatt parse_floatR*t parse_intt _CONSTANTSt __getitem__tparse_constantR<R\t parse_objectR_t parse_arrayRt parse_stringRt make_scannerRQ(tselfR;RRRaRbReR<RS((s$/usr/lib64/python2.7/json/decoder.pyt__init__0s-       cCsy|j|d||dj\}}|||j}|t|kruttd||t|n|S(szReturn the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) tidxis Extra data(t raw_decodeRR)R+R(RjR,RTtobjR((s$/usr/lib64/python2.7/json/decoder.pyRis *$icCsFy|j||\}}Wntk r;tdnX||fS(sLDecode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. sNo JSON object could be decoded(RQRNR+(RjR,RlRnR((s$/usr/lib64/python2.7/json/decoder.pyRmts  N( t__name__t __module__t__doc__RRMRkt WHITESPACEtmatchRRm(((s$/usr/lib64/python2.7/json/decoder.pyRs    7 (%RqtreRR tjsonRt_jsonRt c_scanstringt ImportErrorRt__all__tVERBOSEt MULTILINEtDOTALLtFLAGSRR tPosInftNegInfRRRctcompilet STRINGCHUNKt BACKSLASHR0R.RMRsRHRrtWHITESPACE_STRR\R_tobjectR(((s$/usr/lib64/python2.7/json/decoder.pyts@         & E W$PK!y55 encoder.pyonu[ ofc @s|dZddlZyddlmZWnek r?dZnXyddlmZWnek rmdZnXej dZ ej dZ ej dZ idd 6d d 6d d 6dd6dd6dd6dd6Z x3edD]%Ze jeedjeqWedZeZdZdZep5eZdefdYZeeeeeee e!e"e#e$d Z%dS(sImplementation of JSONEncoder iN(tencode_basestring_ascii(t make_encoders[\x00-\x1f\\"\b\f\n\r\t]s([\\"]|[^\ -~])s [\x80-\xff]s\\s\s\"t"s\bss\fs s\ns s\rs s\ts i s \u{0:04x}tinfcCs!d}dtj||dS(s5Return a JSON representation of a Python string cSst|jdS(Ni(t ESCAPE_DCTtgroup(tmatch((s$/usr/lib64/python2.7/json/encoder.pytreplace%sR(tESCAPEtsub(tsR((s$/usr/lib64/python2.7/json/encoder.pytencode_basestring!s cCs]t|tr6tj|dk r6|jd}nd}dttj||dS(sAReturn an ASCII-only JSON representation of a Python string sutf-8cSs|jd}y t|SWnptk rt|}|dkrPdj|S|d8}d|d?d@B}d|d@B}dj||SnXdS( Niis \u{0:04x}ii iis\u{0:04x}\u{1:04x}(RRtKeyErrortordtformat(RR tnts1ts2((s$/usr/lib64/python2.7/json/encoder.pyR0s      RN(t isinstancetstrtHAS_UTF8tsearchtNonetdecodet ESCAPE_ASCIIR (R R((s$/usr/lib64/python2.7/json/encoder.pytpy_encode_basestring_ascii*s$ t JSONEncoderc Bs\eZdZdZdZeeeeeddddd ZdZ dZ edZ RS( sZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str, unicode | string | +-------------------+---------------+ | int, long, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). s, s: sutf-8c Cs|||_||_||_||_||_||_|dk rW|\|_|_n| dk ro| |_ n||_ dS(s Constructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. If *ensure_ascii* is true (the default), all non-ASCII characters in the output are escaped with \uXXXX sequences, and the results are str instances consisting of ASCII characters only. If ensure_ascii is False, a result may be a unicode instance. This usually happens if the input contains unicode strings or the *encoding* parameter is used. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this. If specified, separators should be a (item_separator, key_separator) tuple. The default is (', ', ': '). To get the most compact JSON representation you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. If encoding is not None, then all input strings will be transformed into unicode using that encoding prior to JSON-encoding. The default is UTF-8. N( tskipkeyst ensure_asciitcheck_circulart allow_nant sort_keystindentRtitem_separatort key_separatortdefaulttencoding( tselfRRRRRR t separatorsR$R#((s$/usr/lib64/python2.7/json/encoder.pyt__init__es4         cCstt|ddS(slImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) s is not JSON serializableN(t TypeErrortrepr(R%to((s$/usr/lib64/python2.7/json/encoder.pyR#scCst|trut|trU|j}|dk rU|dk rU|j|}qUn|jrht|St|Sn|j |dt }t|t t fst |}ndj |S(sReturn a JSON string representation of a Python data structure. >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' sutf-8t _one_shottN(Rt basestringRR$RRRRR t iterencodetTruetlistttupletjoin(R%R*t _encodingtchunks((s$/usr/lib64/python2.7/json/encoder.pytencodes      cCs|jri}nd}|jr*t}nt}|jdkrT||jd}n|jttt d}|rt dk r|j dkr|j rt ||j ||j |j |j|j |j|j }n9t||j ||j ||j |j|j |j| }||dS(sEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) sutf-8cSs+t|tr!|j|}n||S(N(RRR(R*t _orig_encoderR3((s$/usr/lib64/python2.7/json/encoder.pyt_encoderscSsl||krd}n4||kr*d}n||kr?d}n ||S|shtdt|n|S(NtNaNtInfinitys -Infinitys2Out of range float values are not JSON compliant: (t ValueErrorR)(R*Rt_reprt_inft_neginfttext((s$/usr/lib64/python2.7/json/encoder.pytfloatstrs       iN(RRRRR R$Rt FLOAT_REPRtINFINITYtc_make_encoderR RR#R"R!Rt_make_iterencode(R%R*R+tmarkersR7R?t _iterencode((s$/usr/lib64/python2.7/json/encoder.pyR.s*    N( t__name__t __module__t__doc__R!R"tFalseR/RR'R#R5R.(((s$/usr/lib64/python2.7/json/encoder.pyRFs >  cs fd fd fdS(Nc 3s8|sdVdSdk rO |}|krBdn||}|rt}n|} |r||Vq|dkr|dVq|tkr|dVq|tkr1|d Vq | frX||Vq | ry||Vq|V |fr||}n0 | r||}n||}x|D] } | VqWqW|dk r|d8}dd|Vnd Vdk r4|=ndS( Ns[]sCircular reference detectedt[is t tnullttruetfalset](RR/RI( tlstt_current_indent_leveltmarkeridtbuftnewline_indentt separatortfirsttvalueR4tchunk(R:R7t _floatstrt_indentt_item_separatorREt_iterencode_dictt_iterencode_listR-tdicttfloattidtintRR0tlongRDRR1(s$/usr/lib64/python2.7/json/encoder.pyR] s^                     c 3s|sdVdSdk rO|}|krBdn||isRMRNRLskey s is not a stringt}(RR/tsortedtitemst iteritemsRIR(R)( tdctRQRRRTR!RVRiRdRWR4RX(R:R7RYRZR[RER\R]t_key_separatort _skipkeyst _sort_keysR-R^R_R`RaRR0RbRDRR1(s$/usr/lib64/python2.7/json/encoder.pyR\Us                        c3s |r|Vne|dkr1dVnQ|tkrEdVn=|tkrYdVn) | fr||Vn | r|Vn | frx||D] }|VqWn |rx||D] }|VqWndk rA |}|kr4dn||sN      #   PK!N@@ encoder.pynu["""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(r'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', } for i in range(0x20): ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i)) #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) INFINITY = float('inf') FLOAT_REPR = repr def encode_basestring(s): """Return a JSON representation of a Python string """ def replace(match): return ESCAPE_DCT[match.group(0)] return '"' + ESCAPE.sub(replace, s) + '"' def py_encode_basestring_ascii(s): """Return an ASCII-only JSON representation of a Python string """ if isinstance(s, str) and HAS_UTF8.search(s) is not None: s = s.decode('utf-8') def replace(match): s = match.group(0) try: return ESCAPE_DCT[s] except KeyError: n = ord(s) if n < 0x10000: return '\\u{0:04x}'.format(n) #return '\\u%04x' % (n,) else: # surrogate pair n -= 0x10000 s1 = 0xd800 | ((n >> 10) & 0x3ff) s2 = 0xdc00 | (n & 0x3ff) return '\\u{0:04x}\\u{1:04x}'.format(s1, s2) #return '\\u%04x\\u%04x' % (s1, s2) return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"' encode_basestring_ascii = ( c_encode_basestring_ascii or py_encode_basestring_ascii) class JSONEncoder(object): """Extensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str, unicode | string | +-------------------+---------------+ | int, long, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). """ item_separator = ', ' key_separator = ': ' def __init__(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None): """Constructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. If *ensure_ascii* is true (the default), all non-ASCII characters in the output are escaped with \uXXXX sequences, and the results are str instances consisting of ASCII characters only. If ensure_ascii is False, a result may be a unicode instance. This usually happens if the input contains unicode strings or the *encoding* parameter is used. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this. If specified, separators should be a (item_separator, key_separator) tuple. The default is (', ', ': '). To get the most compact JSON representation you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. If encoding is not None, then all input strings will be transformed into unicode using that encoding prior to JSON-encoding. The default is UTF-8. """ self.skipkeys = skipkeys self.ensure_ascii = ensure_ascii self.check_circular = check_circular self.allow_nan = allow_nan self.sort_keys = sort_keys self.indent = indent if separators is not None: self.item_separator, self.key_separator = separators if default is not None: self.default = default self.encoding = encoding def default(self, o): """Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) """ raise TypeError(repr(o) + " is not JSON serializable") def encode(self, o): """Return a JSON string representation of a Python data structure. >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' """ # This is for extremely simple cases and benchmarks. if isinstance(o, basestring): if isinstance(o, str): _encoding = self.encoding if (_encoding is not None and not (_encoding == 'utf-8')): o = o.decode(_encoding) if self.ensure_ascii: return encode_basestring_ascii(o) else: return encode_basestring(o) # This doesn't pass the iterator directly to ''.join() because the # exceptions aren't as detailed. The list call should be roughly # equivalent to the PySequence_Fast that ''.join() would do. chunks = self.iterencode(o, _one_shot=True) if not isinstance(chunks, (list, tuple)): chunks = list(chunks) return ''.join(chunks) def iterencode(self, o, _one_shot=False): """Encode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) """ if self.check_circular: markers = {} else: markers = None if self.ensure_ascii: _encoder = encode_basestring_ascii else: _encoder = encode_basestring if self.encoding != 'utf-8': def _encoder(o, _orig_encoder=_encoder, _encoding=self.encoding): if isinstance(o, str): o = o.decode(_encoding) return _orig_encoder(o) def floatstr(o, allow_nan=self.allow_nan, _repr=FLOAT_REPR, _inf=INFINITY, _neginf=-INFINITY): # Check for specials. Note that this type of test is processor # and/or platform-specific, so do tests which don't depend on the # internals. if o != o: text = 'NaN' elif o == _inf: text = 'Infinity' elif o == _neginf: text = '-Infinity' else: return _repr(o) if not allow_nan: raise ValueError( "Out of range float values are not JSON compliant: " + repr(o)) return text if (_one_shot and c_make_encoder is not None and self.indent is None and not self.sort_keys): _iterencode = c_make_encoder( markers, self.default, _encoder, self.indent, self.key_separator, self.item_separator, self.sort_keys, self.skipkeys, self.allow_nan) else: _iterencode = _make_iterencode( markers, self.default, _encoder, self.indent, floatstr, self.key_separator, self.item_separator, self.sort_keys, self.skipkeys, _one_shot) return _iterencode(o, 0) def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, ## HACK: hand-optimized bytecode; turn globals into locals ValueError=ValueError, basestring=basestring, dict=dict, float=float, id=id, int=int, isinstance=isinstance, list=list, long=long, str=str, tuple=tuple, ): def _iterencode_list(lst, _current_indent_level): if not lst: yield '[]' return if markers is not None: markerid = id(lst) if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = lst buf = '[' if _indent is not None: _current_indent_level += 1 newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) separator = _item_separator + newline_indent buf += newline_indent else: newline_indent = None separator = _item_separator first = True for value in lst: if first: first = False else: buf = separator if isinstance(value, basestring): yield buf + _encoder(value) elif value is None: yield buf + 'null' elif value is True: yield buf + 'true' elif value is False: yield buf + 'false' elif isinstance(value, (int, long)): yield buf + str(value) elif isinstance(value, float): yield buf + _floatstr(value) else: yield buf if isinstance(value, (list, tuple)): chunks = _iterencode_list(value, _current_indent_level) elif isinstance(value, dict): chunks = _iterencode_dict(value, _current_indent_level) else: chunks = _iterencode(value, _current_indent_level) for chunk in chunks: yield chunk if newline_indent is not None: _current_indent_level -= 1 yield '\n' + (' ' * (_indent * _current_indent_level)) yield ']' if markers is not None: del markers[markerid] def _iterencode_dict(dct, _current_indent_level): if not dct: yield '{}' return if markers is not None: markerid = id(dct) if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = dct yield '{' if _indent is not None: _current_indent_level += 1 newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) item_separator = _item_separator + newline_indent yield newline_indent else: newline_indent = None item_separator = _item_separator first = True if _sort_keys: items = sorted(dct.items(), key=lambda kv: kv[0]) else: items = dct.iteritems() for key, value in items: if isinstance(key, basestring): pass # JavaScript is weakly typed for these, so it makes sense to # also allow them. Many encoders seem to do something like this. elif isinstance(key, float): key = _floatstr(key) elif key is True: key = 'true' elif key is False: key = 'false' elif key is None: key = 'null' elif isinstance(key, (int, long)): key = str(key) elif _skipkeys: continue else: raise TypeError("key " + repr(key) + " is not a string") if first: first = False else: yield item_separator yield _encoder(key) yield _key_separator if isinstance(value, basestring): yield _encoder(value) elif value is None: yield 'null' elif value is True: yield 'true' elif value is False: yield 'false' elif isinstance(value, (int, long)): yield str(value) elif isinstance(value, float): yield _floatstr(value) else: if isinstance(value, (list, tuple)): chunks = _iterencode_list(value, _current_indent_level) elif isinstance(value, dict): chunks = _iterencode_dict(value, _current_indent_level) else: chunks = _iterencode(value, _current_indent_level) for chunk in chunks: yield chunk if newline_indent is not None: _current_indent_level -= 1 yield '\n' + (' ' * (_indent * _current_indent_level)) yield '}' if markers is not None: del markers[markerid] def _iterencode(o, _current_indent_level): if isinstance(o, basestring): yield _encoder(o) elif o is None: yield 'null' elif o is True: yield 'true' elif o is False: yield 'false' elif isinstance(o, (int, long)): yield str(o) elif isinstance(o, float): yield _floatstr(o) elif isinstance(o, (list, tuple)): for chunk in _iterencode_list(o, _current_indent_level): yield chunk elif isinstance(o, dict): for chunk in _iterencode_dict(o, _current_indent_level): yield chunk else: if markers is not None: markerid = id(o) if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = o o = _default(o) for chunk in _iterencode(o, _current_indent_level): yield chunk if markers is not None: del markers[markerid] return _iterencode PK!n66 __init__.pycnu[ ofc@s,dZdZddddddgZdZd d lmZd d lmZed ed e de de ddddddddZ ee e e ddddded Z ee e e ddddded Z eddddddZddddddddZddddddddZdS(s JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of the :mod:`json` library contained in Python 2.6, but maintains compatibility with Python 2.4 and Python 2.5 and (currently) has significant performance advantages, even without using the optional C extension for speedups. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print json.dumps("\"foo\bar") "\"foo\bar" >>> print json.dumps(u'\u1234') "\u1234" >>> print json.dumps('\\') "\\" >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) {"a": 0, "b": 0, "c": 0} >>> from StringIO import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, ... indent=4, separators=(',', ': ')) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == u'"foo\x08ar' True >>> from StringIO import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(o) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) s2.0.9tdumptdumpstloadtloadst JSONDecodert JSONEncodersBob Ippolito i(R(Rtskipkeyst ensure_asciitcheck_circulart allow_nantindentt separatorstencodingsutf-8tdefaultc Ks| ru|ru|ru|ru|d kru|d kru|d kru| dkru| d kru| ru| rutj|} n`|d krt}n|d|d|d|d|d|d|d| d | d | | j|} x| D]}|j|qWd S( s Serialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is true (the default), all non-ASCII characters in the output are escaped with ``\uXXXX`` sequences, and the result is a ``str`` instance consisting of ASCII characters only. If ``ensure_ascii`` is ``False``, some chunks written to ``fp`` may be ``unicode`` instances. This usually happens because the input contains unicode strings or the ``encoding`` parameter is used. Unless ``fp.write()`` explicitly understands ``unicode`` (as in ``codecs.getwriter``) this is likely to cause an error. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. sutf-8RRRR R R R R t sort_keysN(tNonet_default_encodert iterencodeRtwrite(tobjtfpRRRR tclsR R R R Rtkwtiterabletchunk((s%/usr/lib64/python2.7/json/__init__.pyRzs5  $&    c Ks| rp|rp|rp|rp|d krp|d krp|d krp|dkrp| d krp| rp| rptj|S|d krt}n|d|d|d|d|d|d|d|d | d | | j|S( sSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is false then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, all non-ASCII characters are not escaped, and the return value may be a ``unicode`` instance. See ``dump`` for details. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. sutf-8RRRR R R R R RN(RRtencodeR( RRRRR RR R R R RR((s%/usr/lib64/python2.7/json/__init__.pyRs.  $&    t object_hooktobject_pairs_hookc Ks=t|jd|d|d|d|d|d|d||S(sDeserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. If the contents of ``fp`` is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must be specified. Encodings that are not ASCII based (such as UCS-2) are not allowed, and should be wrapped with ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` object and passed to ``loads()`` ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. R RRt parse_floatt parse_inttparse_constantR(Rtread( RR RRRRRRR((s%/usr/lib64/python2.7/json/__init__.pyRs   c Ks|dkrh|dkrh|dkrh|dkrh|dkrh|dkrh|dkrh| rhtj|S|dkr}t}n|dk r||dcs6     E  :  # PK!q tool.pyonu[ ofc@sAdZddlZddlZdZedkr=endS(sCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) iNcCs>ttjdkr*tj}tj}nttjdkrattjdd}tj}n[ttjdkrttjdd}ttjdd}nttjdd|:ytj|}Wnt k r}t|nXWdQX|4tj ||dt d d d d|j dWdQXdS(Niitrbitwbis [infile [outfile]]t sort_keystindentit separatorst,s: s (Rs: ( tlentsystargvtstdintstdouttopent SystemExittjsontloadt ValueErrortdumptTruetwrite(tinfiletoutfiletobjte((s!/usr/lib64/python2.7/json/tool.pytmains&    t__main__(t__doc__RR Rt__name__(((s!/usr/lib64/python2.7/json/tool.pyt s     PK! scanner.pycnu[ ofc@sdZddlZyddlmZWnek r?dZnXdgZejdej ej Bej BZ dZ ep~e ZdS(sJSON token scanner iN(t make_scannerRs)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c s|j |j|j tj|j|j |j|j|j |j |j  f dS(Nc sZy||}Wntk r'tnX|dkrK ||d S|dkrz ||df S|dkr||dfS|dkr|||d!dkrd|dfS|dkr|||d!d krt|dfS|d kr0|||d !d kr0t|d fS||}|dk r|j\}}}|sl|r||p{d |pd }n |}||jfS|dkr|||d!dkrd|dfS|dkr|||d!dkrd|dfS|dkrP|||d!dkrPd|dfStdS(Nt"it{t[tnitnullttttruetfitfalsettNitNaNtIitInfinityt-i s -Infinity(t IndexErrort StopIterationtNonetTruetFalsetgroupstend(tstringtidxtnextchartmtintegertfractexptres( t _scan_oncetencodingt match_numbert object_hooktobject_pairs_hookt parse_arraytparse_constantt parse_floatt parse_intt parse_objectt parse_stringtstrict(s$/usr/lib64/python2.7/json/scanner.pyRs>      ###  # ###( R(R$R)t NUMBER_REtmatchR R*R&R'R%R"R#(tcontext(( RR R!R"R#R$R%R&R'R(R)R*s$/usr/lib64/python2.7/json/scanner.pytpy_make_scanners           0%(t__doc__tret_jsonRtc_make_scannert ImportErrorRt__all__tcompiletVERBOSEt MULTILINEtDOTALLR+R.(((s$/usr/lib64/python2.7/json/scanner.pyts     4PK!y55 encoder.pycnu[ ofc @s|dZddlZyddlmZWnek r?dZnXyddlmZWnek rmdZnXej dZ ej dZ ej dZ idd 6d d 6d d 6dd6dd6dd6dd6Z x3edD]%Ze jeedjeqWedZeZdZdZep5eZdefdYZeeeeeee e!e"e#e$d Z%dS(sImplementation of JSONEncoder iN(tencode_basestring_ascii(t make_encoders[\x00-\x1f\\"\b\f\n\r\t]s([\\"]|[^\ -~])s [\x80-\xff]s\\s\s\"t"s\bss\fs s\ns s\rs s\ts i s \u{0:04x}tinfcCs!d}dtj||dS(s5Return a JSON representation of a Python string cSst|jdS(Ni(t ESCAPE_DCTtgroup(tmatch((s$/usr/lib64/python2.7/json/encoder.pytreplace%sR(tESCAPEtsub(tsR((s$/usr/lib64/python2.7/json/encoder.pytencode_basestring!s cCs]t|tr6tj|dk r6|jd}nd}dttj||dS(sAReturn an ASCII-only JSON representation of a Python string sutf-8cSs|jd}y t|SWnptk rt|}|dkrPdj|S|d8}d|d?d@B}d|d@B}dj||SnXdS( Niis \u{0:04x}ii iis\u{0:04x}\u{1:04x}(RRtKeyErrortordtformat(RR tnts1ts2((s$/usr/lib64/python2.7/json/encoder.pyR0s      RN(t isinstancetstrtHAS_UTF8tsearchtNonetdecodet ESCAPE_ASCIIR (R R((s$/usr/lib64/python2.7/json/encoder.pytpy_encode_basestring_ascii*s$ t JSONEncoderc Bs\eZdZdZdZeeeeeddddd ZdZ dZ edZ RS( sZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str, unicode | string | +-------------------+---------------+ | int, long, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). s, s: sutf-8c Cs|||_||_||_||_||_||_|dk rW|\|_|_n| dk ro| |_ n||_ dS(s Constructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. If *ensure_ascii* is true (the default), all non-ASCII characters in the output are escaped with \uXXXX sequences, and the results are str instances consisting of ASCII characters only. If ensure_ascii is False, a result may be a unicode instance. This usually happens if the input contains unicode strings or the *encoding* parameter is used. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this. If specified, separators should be a (item_separator, key_separator) tuple. The default is (', ', ': '). To get the most compact JSON representation you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. If encoding is not None, then all input strings will be transformed into unicode using that encoding prior to JSON-encoding. The default is UTF-8. N( tskipkeyst ensure_asciitcheck_circulart allow_nant sort_keystindentRtitem_separatort key_separatortdefaulttencoding( tselfRRRRRR t separatorsR$R#((s$/usr/lib64/python2.7/json/encoder.pyt__init__es4         cCstt|ddS(slImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) s is not JSON serializableN(t TypeErrortrepr(R%to((s$/usr/lib64/python2.7/json/encoder.pyR#scCst|trut|trU|j}|dk rU|dk rU|j|}qUn|jrht|St|Sn|j |dt }t|t t fst |}ndj |S(sReturn a JSON string representation of a Python data structure. >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' sutf-8t _one_shottN(Rt basestringRR$RRRRR t iterencodetTruetlistttupletjoin(R%R*t _encodingtchunks((s$/usr/lib64/python2.7/json/encoder.pytencodes      cCs|jri}nd}|jr*t}nt}|jdkrT||jd}n|jttt d}|rt dk r|j dkr|j rt ||j ||j |j |j|j |j|j }n9t||j ||j ||j |j|j |j| }||dS(sEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) sutf-8cSs+t|tr!|j|}n||S(N(RRR(R*t _orig_encoderR3((s$/usr/lib64/python2.7/json/encoder.pyt_encoderscSsl||krd}n4||kr*d}n||kr?d}n ||S|shtdt|n|S(NtNaNtInfinitys -Infinitys2Out of range float values are not JSON compliant: (t ValueErrorR)(R*Rt_reprt_inft_neginfttext((s$/usr/lib64/python2.7/json/encoder.pytfloatstrs       iN(RRRRR R$Rt FLOAT_REPRtINFINITYtc_make_encoderR RR#R"R!Rt_make_iterencode(R%R*R+tmarkersR7R?t _iterencode((s$/usr/lib64/python2.7/json/encoder.pyR.s*    N( t__name__t __module__t__doc__R!R"tFalseR/RR'R#R5R.(((s$/usr/lib64/python2.7/json/encoder.pyRFs >  cs fd fd fdS(Nc 3s8|sdVdSdk rO |}|krBdn||}|rt}n|} |r||Vq|dkr|dVq|tkr|dVq|tkr1|d Vq | frX||Vq | ry||Vq|V |fr||}n0 | r||}n||}x|D] } | VqWqW|dk r|d8}dd|Vnd Vdk r4|=ndS( Ns[]sCircular reference detectedt[is t tnullttruetfalset](RR/RI( tlstt_current_indent_leveltmarkeridtbuftnewline_indentt separatortfirsttvalueR4tchunk(R:R7t _floatstrt_indentt_item_separatorREt_iterencode_dictt_iterencode_listR-tdicttfloattidtintRR0tlongRDRR1(s$/usr/lib64/python2.7/json/encoder.pyR] s^                     c 3s|sdVdSdk rO|}|krBdn||isRMRNRLskey s is not a stringt}(RR/tsortedtitemst iteritemsRIR(R)( tdctRQRRRTR!RVRiRdRWR4RX(R:R7RYRZR[RER\R]t_key_separatort _skipkeyst _sort_keysR-R^R_R`RaRR0RbRDRR1(s$/usr/lib64/python2.7/json/encoder.pyR\Us                        c3s |r|Vne|dkr1dVnQ|tkrEdVn=|tkrYdVn) | fr||Vn | r|Vn | frx||D] }|VqWn |rx||D] }|VqWndk rA |}|kr4dn||sN      #   PK! scanner.pyonu[ ofc@sdZddlZyddlmZWnek r?dZnXdgZejdej ej Bej BZ dZ ep~e ZdS(sJSON token scanner iN(t make_scannerRs)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c s|j |j|j tj|j|j |j|j|j |j |j  f dS(Nc sZy||}Wntk r'tnX|dkrK ||d S|dkrz ||df S|dkr||dfS|dkr|||d!dkrd|dfS|dkr|||d!d krt|dfS|d kr0|||d !d kr0t|d fS||}|dk r|j\}}}|sl|r||p{d |pd }n |}||jfS|dkr|||d!dkrd|dfS|dkr|||d!dkrd|dfS|dkrP|||d!dkrPd|dfStdS(Nt"it{t[tnitnullttttruetfitfalsettNitNaNtIitInfinityt-i s -Infinity(t IndexErrort StopIterationtNonetTruetFalsetgroupstend(tstringtidxtnextchartmtintegertfractexptres( t _scan_oncetencodingt match_numbert object_hooktobject_pairs_hookt parse_arraytparse_constantt parse_floatt parse_intt parse_objectt parse_stringtstrict(s$/usr/lib64/python2.7/json/scanner.pyRs>      ###  # ###( R(R$R)t NUMBER_REtmatchR R*R&R'R%R"R#(tcontext(( RR R!R"R#R$R%R&R'R(R)R*s$/usr/lib64/python2.7/json/scanner.pytpy_make_scanners           0%(t__doc__tret_jsonRtc_make_scannert ImportErrorRt__all__tcompiletVERBOSEt MULTILINEtDOTALLR+R.(((s$/usr/lib64/python2.7/json/scanner.pyts     4PK!8>/>/ decoder.pycnu[ ofc@sdZddlZddlZddlZddlmZyddlmZWne k rgdZnXdgZ ej ej BejBZdZe\ZZZdZddZied 6ed 6ed 6Zejd eZid d6dd6dd6dd6dd6dd6dd6dd6ZdZdZdeeejdZepSeZejd eZd!Z eje d"Z!eje d#Z"de#fd$YZ$dS(%sImplementation of JSONDecoder iN(tscanner(t scanstringt JSONDecodercCssdjd}tjdkrM|d ddd|dddd}ntjd|\}}||| fS(Nt 7FF80000000000007FF0000000000000thextbigiitdd(tdecodetsyst byteordertstructtunpack(t_BYTEStnantinf((s$/usr/lib64/python2.7/json/decoder.pyt_floatconstantss /cCsU|jdd|d}|dkr2|d}n||jdd|}||fS(Ns ii(tcounttrindex(tdoctpostlinenotcolno((s$/usr/lib64/python2.7/json/decoder.pytlinecols   c Cswt||\}}|dkr=d}|j||||St||\}}d}|j|||||||S(Ns#{0}: line {1} column {2} (char {3})s?{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})(RtNonetformat( tmsgRRtendRRtfmtt endlinenotendcolno((s$/usr/lib64/python2.7/json/decoder.pyterrmsg$s s -InfinitytInfinitytNaNs(.*?)(["\\\x00-\x1f])u"t"u\s\u/t/utbu tfu tnu tru ttsutf-8cCs||d|d!}t|dkr_|ddkr_yt|dSWq_tk r[q_Xnd}tt|||dS(NiiitxXisInvalid \uXXXX escape(tlentintt ValueErrorR(tsRtescR((s$/usr/lib64/python2.7/json/decoder.pyt _decode_uXXXXAs" cCs|dkrt}ng}|j}|d}xN|||} | dkrgttd||n| j}| j\} } | rt| tst| |} n|| n| dkrPnL| dkr|rdj | } tt| ||q|| q1ny||} Wn)t k rNttd||nX| dkry|| }Wn9t k rdt | } tt| ||nX|d7}nt ||}|d7}tjd krfd |kod knrf|||d !d krft ||d}d|ko7dknrfd|d d>|dB}|d7}qfnt|}||q1dj||fS(sScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.isUnterminated string starting atR!s\s"Invalid control character {0!r} attusInvalid \escape: iiiiis\uiiii iuN(RtDEFAULT_ENCODINGtappendR+RRtgroupst isinstancetunicodeRt IndexErrortKeyErrortreprR.Rt maxunicodetunichrtjoin(R,Rtencodingtstrictt_bt_mtchunkst_appendtbegintchunktcontentt terminatorRR-tchartunituni2((s$/usr/lib64/python2.7/json/decoder.pyt py_scanstringKs^               3  s [ \t\n\r]*s cCs|\}} g} | j} || | d!} | dkr| |krm||| j} || | d!} n| dkr|dk r|| } | | dfSi} |dk r|| } n| | dfS| dkrttd|| qn| d7} xtrt|| ||\}} || | d!dkr||| j} || | d!dkrttd|| qn| d7} yM|| |kr| d7} || |kr||| dj} qnWntk rnXy||| \}} Wn)tk r6ttd|| nX| ||fy@|| } | |kr||| dj} || } nWntk rd} nX| d7} | dkrPn+| d krttd || dnyc|| } | |krH| d7} || } | |krH||| dj} || } qHnWntk rbd} nX| d7} | dkrttd|| dqqW|dk r|| } | | fSt | } |dk r|| } n| | fS( NiR!t}s1Expecting property name enclosed in double quotest:sExpecting ':' delimitersExpecting objecttt,sExpecting ',' delimiter( R1RRR+RtTrueRR5t StopIterationtdict(t s_and_endR;R<t scan_oncet object_hooktobject_pairs_hookt_wt_wsR,Rtpairst pairs_appendtnextchartresulttkeytvalue((s$/usr/lib64/python2.7/json/decoder.pyt JSONObjects             #                       c Cs|\}}g}|||d!}||kr\|||dj}|||d!}n|dkrv||dfS|j}xEtry|||\} }Wn)tk rttd||nX|| |||d!}||kr!|||dj}|||d!}n|d7}|dkr;Pn'|dkrbttd||nyM|||kr|d7}|||kr|||dj}qnWqtk rqXqW||fS(Nit]sExpecting objectRLsExpecting ',' delimiter(RR1RMRNR+RR5( RPRQRTRUR,RtvaluesRXR@R[((s$/usr/lib64/python2.7/json/decoder.pyt JSONArrays@            # cBsGeZdZdddddeddZejdZddZ RS(sSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | unicode | +---------------+-------------------+ | number (int) | int, long | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. cCs||_||_||_|p$t|_|p3t|_|pEtj|_ ||_ t |_ t |_t|_tj||_dS(s``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as ``unicode``. ``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N(R;RRRStfloatt parse_floatR*t parse_intt _CONSTANTSt __getitem__tparse_constantR<R\t parse_objectR_t parse_arrayRt parse_stringRt make_scannerRQ(tselfR;RRRaRbReR<RS((s$/usr/lib64/python2.7/json/decoder.pyt__init__0s-       cCsy|j|d||dj\}}|||j}|t|kruttd||t|n|S(szReturn the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) tidxis Extra data(t raw_decodeRR)R+R(RjR,RTtobjR((s$/usr/lib64/python2.7/json/decoder.pyRis *$icCsFy|j||\}}Wntk r;tdnX||fS(sLDecode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. sNo JSON object could be decoded(RQRNR+(RjR,RlRnR((s$/usr/lib64/python2.7/json/decoder.pyRmts  N( t__name__t __module__t__doc__RRMRkt WHITESPACEtmatchRRm(((s$/usr/lib64/python2.7/json/decoder.pyRs    7 (%RqtreRR tjsonRt_jsonRt c_scanstringt ImportErrorRt__all__tVERBOSEt MULTILINEtDOTALLtFLAGSRR tPosInftNegInfRRRctcompilet STRINGCHUNKt BACKSLASHR0R.RMRsRHRrtWHITESPACE_STRR\R_tobjectR(((s$/usr/lib64/python2.7/json/decoder.pyts@         & E W$PK!n66 __init__.pyonu[ ofc@s,dZdZddddddgZdZd d lmZd d lmZed ed e de de ddddddddZ ee e e ddddded Z ee e e ddddded Z eddddddZddddddddZddddddddZdS(s JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of the :mod:`json` library contained in Python 2.6, but maintains compatibility with Python 2.4 and Python 2.5 and (currently) has significant performance advantages, even without using the optional C extension for speedups. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print json.dumps("\"foo\bar") "\"foo\bar" >>> print json.dumps(u'\u1234') "\u1234" >>> print json.dumps('\\') "\\" >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) {"a": 0, "b": 0, "c": 0} >>> from StringIO import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, ... indent=4, separators=(',', ': ')) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == u'"foo\x08ar' True >>> from StringIO import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(o) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) s2.0.9tdumptdumpstloadtloadst JSONDecodert JSONEncodersBob Ippolito i(R(Rtskipkeyst ensure_asciitcheck_circulart allow_nantindentt separatorstencodingsutf-8tdefaultc Ks| ru|ru|ru|ru|d kru|d kru|d kru| dkru| d kru| ru| rutj|} n`|d krt}n|d|d|d|d|d|d|d| d | d | | j|} x| D]}|j|qWd S( s Serialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is true (the default), all non-ASCII characters in the output are escaped with ``\uXXXX`` sequences, and the result is a ``str`` instance consisting of ASCII characters only. If ``ensure_ascii`` is ``False``, some chunks written to ``fp`` may be ``unicode`` instances. This usually happens because the input contains unicode strings or the ``encoding`` parameter is used. Unless ``fp.write()`` explicitly understands ``unicode`` (as in ``codecs.getwriter``) this is likely to cause an error. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. sutf-8RRRR R R R R t sort_keysN(tNonet_default_encodert iterencodeRtwrite(tobjtfpRRRR tclsR R R R Rtkwtiterabletchunk((s%/usr/lib64/python2.7/json/__init__.pyRzs5  $&    c Ks| rp|rp|rp|rp|d krp|d krp|d krp|dkrp| d krp| rp| rptj|S|d krt}n|d|d|d|d|d|d|d|d | d | | j|S( sSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is false then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, all non-ASCII characters are not escaped, and the return value may be a ``unicode`` instance. See ``dump`` for details. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. Since the default item separator is ``', '``, the output might include trailing whitespace when ``indent`` is specified. You can use ``separators=(',', ': ')`` to avoid this. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. ``encoding`` is the character encoding for str instances, default is UTF-8. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is ``True`` (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. sutf-8RRRR R R R R RN(RRtencodeR( RRRRR RR R R R RR((s%/usr/lib64/python2.7/json/__init__.pyRs.  $&    t object_hooktobject_pairs_hookc Ks=t|jd|d|d|d|d|d|d||S(sDeserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. If the contents of ``fp`` is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must be specified. Encodings that are not ASCII based (such as UCS-2) are not allowed, and should be wrapped with ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` object and passed to ``loads()`` ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. R RRt parse_floatt parse_inttparse_constantR(Rtread( RR RRRRRRR((s%/usr/lib64/python2.7/json/__init__.pyRs   c Ks|dkrh|dkrh|dkrh|dkrh|dkrh|dkrh|dkrh| rhtj|S|dkr}t}n|dk r||dcs6     E  :  # PK!3)tool.pynu[r"""Command-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) """ import sys import json def main(): if len(sys.argv) == 1: infile = sys.stdin outfile = sys.stdout elif len(sys.argv) == 2: infile = open(sys.argv[1], 'rb') outfile = sys.stdout elif len(sys.argv) == 3: infile = open(sys.argv[1], 'rb') outfile = open(sys.argv[2], 'wb') else: raise SystemExit(sys.argv[0] + " [infile [outfile]]") with infile: try: obj = json.load(infile) except ValueError, e: raise SystemExit(e) with outfile: json.dump(obj, outfile, sort_keys=True, indent=4, separators=(',', ': ')) outfile.write('\n') if __name__ == '__main__': main() PK!TY55 decoder.pynu["""Implementation of JSONDecoder """ import re import sys import struct from json import scanner try: from _json import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys.byteorder != 'big': _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1] nan, inf = struct.unpack('dd', _BYTES) return nan, inf, -inf NaN, PosInf, NegInf = _floatconstants() def linecol(doc, pos): lineno = doc.count('\n', 0, pos) + 1 if lineno == 1: colno = pos + 1 else: colno = pos - doc.rindex('\n', 0, pos) return lineno, colno def errmsg(msg, doc, pos, end=None): # Note that this function is called from _json lineno, colno = linecol(doc, pos) if end is None: fmt = '{0}: line {1} column {2} (char {3})' return fmt.format(msg, lineno, colno, pos) #fmt = '%s: line %d column %d (char %d)' #return fmt % (msg, lineno, colno, pos) endlineno, endcolno = linecol(doc, end) fmt = '{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})' return fmt.format(msg, lineno, colno, endlineno, endcolno, pos, end) #fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' #return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) _CONSTANTS = { '-Infinity': NegInf, 'Infinity': PosInf, 'NaN': NaN, } STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS) BACKSLASH = { '"': u'"', '\\': u'\\', '/': u'/', 'b': u'\b', 'f': u'\f', 'n': u'\n', 'r': u'\r', 't': u'\t', } DEFAULT_ENCODING = "utf-8" def _decode_uXXXX(s, pos): esc = s[pos + 1:pos + 5] if len(esc) == 4 and esc[1] not in 'xX': try: return int(esc, 16) except ValueError: pass msg = "Invalid \\uXXXX escape" raise ValueError(errmsg(msg, s, pos)) def py_scanstring(s, end, encoding=None, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match): """Scan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.""" if encoding is None: encoding = DEFAULT_ENCODING chunks = [] _append = chunks.append begin = end - 1 while 1: chunk = _m(s, end) if chunk is None: raise ValueError( errmsg("Unterminated string starting at", s, begin)) end = chunk.end() content, terminator = chunk.groups() # Content is contains zero or more unescaped string characters if content: if not isinstance(content, unicode): content = unicode(content, encoding) _append(content) # Terminator is the end of string, a literal control character, # or a backslash denoting that an escape sequence follows if terminator == '"': break elif terminator != '\\': if strict: #msg = "Invalid control character %r at" % (terminator,) msg = "Invalid control character {0!r} at".format(terminator) raise ValueError(errmsg(msg, s, end)) else: _append(terminator) continue try: esc = s[end] except IndexError: raise ValueError( errmsg("Unterminated string starting at", s, begin)) # If not a unicode escape sequence, must be in the lookup table if esc != 'u': try: char = _b[esc] except KeyError: msg = "Invalid \\escape: " + repr(esc) raise ValueError(errmsg(msg, s, end)) end += 1 else: # Unicode escape sequence uni = _decode_uXXXX(s, end) end += 5 # Check for surrogate pair on UCS-4 systems if sys.maxunicode > 65535 and \ 0xd800 <= uni <= 0xdbff and s[end:end + 2] == '\\u': uni2 = _decode_uXXXX(s, end + 1) if 0xdc00 <= uni2 <= 0xdfff: uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) end += 6 char = unichr(uni) # Append the unescaped character _append(char) return u''.join(chunks), end # Use speedup if available scanstring = c_scanstring or py_scanstring WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) WHITESPACE_STR = ' \t\n\r' def JSONObject(s_and_end, encoding, strict, scan_once, object_hook, object_pairs_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR): s, end = s_and_end pairs = [] pairs_append = pairs.append # Use a slice to prevent IndexError from being raised, the following # check will raise a more specific ValueError if the string is empty nextchar = s[end:end + 1] # Normally we expect nextchar == '"' if nextchar != '"': if nextchar in _ws: end = _w(s, end).end() nextchar = s[end:end + 1] # Trivial empty object if nextchar == '}': if object_pairs_hook is not None: result = object_pairs_hook(pairs) return result, end + 1 pairs = {} if object_hook is not None: pairs = object_hook(pairs) return pairs, end + 1 elif nextchar != '"': raise ValueError(errmsg( "Expecting property name enclosed in double quotes", s, end)) end += 1 while True: key, end = scanstring(s, end, encoding, strict) # To skip some function call overhead we optimize the fast paths where # the JSON key separator is ": " or just ":". if s[end:end + 1] != ':': end = _w(s, end).end() if s[end:end + 1] != ':': raise ValueError(errmsg("Expecting ':' delimiter", s, end)) end += 1 try: if s[end] in _ws: end += 1 if s[end] in _ws: end = _w(s, end + 1).end() except IndexError: pass try: value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) pairs_append((key, value)) try: nextchar = s[end] if nextchar in _ws: end = _w(s, end + 1).end() nextchar = s[end] except IndexError: nextchar = '' end += 1 if nextchar == '}': break elif nextchar != ',': raise ValueError(errmsg("Expecting ',' delimiter", s, end - 1)) try: nextchar = s[end] if nextchar in _ws: end += 1 nextchar = s[end] if nextchar in _ws: end = _w(s, end + 1).end() nextchar = s[end] except IndexError: nextchar = '' end += 1 if nextchar != '"': raise ValueError(errmsg( "Expecting property name enclosed in double quotes", s, end - 1)) if object_pairs_hook is not None: result = object_pairs_hook(pairs) return result, end pairs = dict(pairs) if object_hook is not None: pairs = object_hook(pairs) return pairs, end def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): s, end = s_and_end values = [] nextchar = s[end:end + 1] if nextchar in _ws: end = _w(s, end + 1).end() nextchar = s[end:end + 1] # Look-ahead for trivial empty array if nextchar == ']': return values, end + 1 _append = values.append while True: try: value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) _append(value) nextchar = s[end:end + 1] if nextchar in _ws: end = _w(s, end + 1).end() nextchar = s[end:end + 1] end += 1 if nextchar == ']': break elif nextchar != ',': raise ValueError(errmsg("Expecting ',' delimiter", s, end)) try: if s[end] in _ws: end += 1 if s[end] in _ws: end = _w(s, end + 1).end() except IndexError: pass return values, end class JSONDecoder(object): """Simple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | unicode | +---------------+-------------------+ | number (int) | int, long | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. """ def __init__(self, encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None): """``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as ``unicode``. ``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\\t'`` (tab), ``'\\n'``, ``'\\r'`` and ``'\\0'``. """ self.encoding = encoding self.object_hook = object_hook self.object_pairs_hook = object_pairs_hook self.parse_float = parse_float or float self.parse_int = parse_int or int self.parse_constant = parse_constant or _CONSTANTS.__getitem__ self.strict = strict self.parse_object = JSONObject self.parse_array = JSONArray self.parse_string = scanstring self.scan_once = scanner.make_scanner(self) def decode(self, s, _w=WHITESPACE.match): """Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) """ obj, end = self.raw_decode(s, idx=_w(s, 0).end()) end = _w(s, end).end() if end != len(s): raise ValueError(errmsg("Extra data", s, end, len(s))) return obj def raw_decode(self, s, idx=0): """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. """ try: obj, end = self.scan_once(s, idx) except StopIteration: raise ValueError("No JSON object could be decoded") return obj, end PK!A scanner.pynu["""JSON token scanner """ import re try: from _json import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scanner(context): parse_object = context.parse_object parse_array = context.parse_array parse_string = context.parse_string match_number = NUMBER_RE.match encoding = context.encoding strict = context.strict parse_float = context.parse_float parse_int = context.parse_int parse_constant = context.parse_constant object_hook = context.object_hook object_pairs_hook = context.object_pairs_hook def _scan_once(string, idx): try: nextchar = string[idx] except IndexError: raise StopIteration if nextchar == '"': return parse_string(string, idx + 1, encoding, strict) elif nextchar == '{': return parse_object((string, idx + 1), encoding, strict, _scan_once, object_hook, object_pairs_hook) elif nextchar == '[': return parse_array((string, idx + 1), _scan_once) elif nextchar == 'n' and string[idx:idx + 4] == 'null': return None, idx + 4 elif nextchar == 't' and string[idx:idx + 4] == 'true': return True, idx + 4 elif nextchar == 'f' and string[idx:idx + 5] == 'false': return False, idx + 5 m = match_number(string, idx) if m is not None: integer, frac, exp = m.groups() if frac or exp: res = parse_float(integer + (frac or '') + (exp or '')) else: res = parse_int(integer) return res, m.end() elif nextchar == 'N' and string[idx:idx + 3] == 'NaN': return parse_constant('NaN'), idx + 3 elif nextchar == 'I' and string[idx:idx + 8] == 'Infinity': return parse_constant('Infinity'), idx + 8 elif nextchar == '-' and string[idx:idx + 9] == '-Infinity': return parse_constant('-Infinity'), idx + 9 else: raise StopIteration return _scan_once make_scanner = c_make_scanner or py_make_scanner PK!Ui%__pycache__/tool.cpython-36.opt-1.pycnu[3 \m@s>dZddlZddlZddlZddlZddZedkr:edS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc "Cs d}d}tj||d}|jddtjdd|jddtjd d d|jd d d dd|j}|jphtj}|jpttj }|j }|Vy$|rt j |}nt j |t jd}Wn*tk r}zt|WYdd}~XnXWdQRX|"t j|||dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?z-a JSON file to be validated or pretty-printed)nargstypehelpoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actiondefaultr)Zobject_pairs_hook) sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$/usr/lib64/python3.6/tool.pymains0    $r&__main__)__doc__rrrrr&__name__r$r$r$r% sPK!B7f++(__pycache__/encoder.cpython-36.opt-1.pycnu[3 \>"@sBdZddlZyddlmZWnek r4dZYnXyddlmZWnek r^dZYnXyddlmZ Wnek rdZ YnXej dZ ej dZ ej dZ d d d d d dddZx&edD]ZejeedjeqWedZddZepeZddZep eZGdddeZeeeeeeee e!ej"f ddZ#dS)zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    z \u{0:04x}infcCsdd}dtj||dS)z5Return a JSON representation of a Python string cSst|jdS)Nr) ESCAPE_DCTgroup)matchr/usr/lib64/python3.6/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$srcCsdd}dtj||dS)zAReturn an ASCII-only JSON representation of a Python string c Ssv|jd}yt|Stk rpt|}|dkr.replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0sr c @sNeZdZdZdZdZddddddddddd Zd d Zd d ZdddZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) r"r#r$r%r&r'item_separator key_separatorr)) selfr"r#r$r%r&r'r(r)rrr__init__hs+zJSONEncoder.__init__cCstd|jjdS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) z,Object of type '%s' is not JSON serializableN) TypeError __class____name__)r-orrrr)szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}dj|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' T) _one_shot) isinstancestrr#rr iterencodelisttuplejoin)r-r2chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r2r%Z_reprZ_infZ_neginftextrrrfloatstrs z(JSONEncoder.iterencode..floatstrr)r$r#rrr%float__repr__INFINITYc_make_encoderr'r)r,r+r&r"_make_iterencode)r-r2r3markers_encoderr@ _iterencoderrrr7s&       zJSONEncoder.iterencode)F) r1 __module__ __qualname____doc__r+r,r.r)r<r7rrrrr!Is6r!csdk r rd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}x|D]}|rd}n|} |r||Vqz|dkr|dVqz|dkr|d Vqz|dkr|d Vqz | r||Vqz | r||Vqz|V |fr:||}n" | rR||}n ||}|EdHqzW|dk r|d8}d|Vd Vdk r|=dS) Nz[]zCircular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer;)r=rG _floatstr_indent_intstr_item_separatorrH_iterencode_dict_iterencode_listdictrAidintr5r8rFr6r9rrr]s\               z*_make_iterencode.._iterencode_listc 3sL|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|jddd }n|j}xx|D]n\}}|rnr| rȈ|}n^|dkrd }nP|d krd }nB|dkrd }n4|r|}n rqntdt|d|r2d }n|V|V V|r`|Vq|dkrrd Vq|dkrd Vq|d krd Vq|r|Vq| rƈ|Vq|fr||} n"| r||} n ||} | EdHqW|dk r2|d8}d|VdVdk rH|=dS)Nz{}zCircular reference detected{rNr TcSs|dS)Nrr)Zkvrrrasz<_make_iterencode.._iterencode_dict..)keyrPFrQrOzkey z is not a string})sorteditemsr/r>) ZdctrSrTrUr+rVrfrcrWr;)r=rGrXrYrZr[rHr\r]_key_separator _skipkeys _sort_keysr^rAr_r`r5r8rFr6r9rrr\Ms                      z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrOTrPFrQzCircular reference detectedr)r2rSrT)r=_defaultrGrXrZrHr\r]r^rAr_r`r5r8rFr6r9rrrHs2       z%_make_iterencode.._iterencoder)rFrjrGrYrXrgr[rirhr3r=r^rAr_r`r5r8r6r9rZr)r=rjrGrXrYrZr[rHr\r]rgrhrir^rAr_r`r5r8rFr6r9rrEs .84O,rE)$rKreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrDcompilerrZHAS_UTF8rrangei setdefaultchrrrArCrr objectr!r=r^r_r`r5r8r6r9__str__rErrrrsT        >PK!i r(__pycache__/scanner.cpython-36.opt-1.pycnu[3 \o @sjdZddlZyddlmZWnek r4dZYnXdgZejdejej Bej BZ ddZ epde ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsy ||}Wntk r(t|YnX|dkrB ||d S|dkrd ||df S|dkr~||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d ko|||d d krd|d fS||}|dk rX|j\}}}|s&|rD||p2d|p            z#py_make_scanner.._scan_oncec sz ||SjXdS)N)clear)rr)rrr(r) scan_onceAs z"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r() rrrrr r!r"r#r$r%r&r'r)py_make_scanners"%r/) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!ީi%__pycache__/tool.cpython-36.opt-2.pycnu[3 \m@s:ddlZddlZddlZddlZddZedkr6edS)Nc "Cs d}d}tj||d}|jddtjdd|jddtjd d d|jd d d dd|j}|jphtj}|jpttj }|j }|Vy$|rt j |}nt j |t jd}Wn*tk r}zt|WYdd}~XnXWdQRX|"t j|||dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?z-a JSON file to be validated or pretty-printed)nargstypehelpoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actiondefaultr)Zobject_pairs_hook) sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$!/usr/lib64/python3.6/json/tool.pymains0    $r&__main__)rrrrr&__name__r$r$r$r% s PK!i r"__pycache__/scanner.cpython-36.pycnu[3 \o @sjdZddlZyddlmZWnek r4dZYnXdgZejdejej Bej BZ ddZ epde ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsy ||}Wntk r(t|YnX|dkrB ||d S|dkrd ||df S|dkr~||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d ko|||d d krd|d fS||}|dk rX|j\}}}|s&|rD||p2d|p            z#py_make_scanner.._scan_oncec sz ||SjXdS)N)clear)rr)rrr(r) scan_onceAs z"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r() rrrrr r!r"r#r$r%r&r'r)py_make_scanners"%r/) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!+d&&(__pycache__/decoder.cpython-36.opt-1.pycnu[3 \)1@sdZddlZddlmZyddlmZWnek r@dZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZeeed Zejd e Zd ddddddddZddZdeejfddZepeZejde ZdZdejefddZejefdd ZGd!ddeZdS)"zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCsb|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr/usr/lib64/python3.6/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrr bfnrtc Cs`||d|d}t|dkrL|ddkrLy t|dStk rJYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r1TcCsg}|j}|d}x|||}|dkr4td|||j}|j\} } | rT|| | dkr`Pn.| dkr|rdj| } t| ||n || qy ||} Wn tk rtd||YnX| dkry || } Wn*tk rdj| } t| ||YnX|d7}nt||}|d 7}d |ko.d knr|||d d krt||d}d|kondknrd|d d>|dB}|d7}t|} || qWdj ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsP           2 rDz [ \t\n\r]*z c#Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} xt|| |\}} | ||}|| | ddkr&||| j} || | ddkr&td|| | d7} y:|| |krf| d7} || |krf||| dj} Wntk r~YnXy||| \}} Wn4tk r}ztd||jdWYdd}~XnX| ||fy0|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkr6Pn| d krPtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer6,zExpecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrJerrrrr JSONObjects     "        rWc Csz|\}}g}|||d}||krF|||dj}|||d}|dkrZ||dfS|j}xy|||\} }Wn2tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr|||dj}|||d}|d7}|dkrPn|dkrtd||dy:|||krT|d7}|||krT|||dj}Wqdtk rlYqdXqdW||fS)Nr ]zExpecting valuerGzExpecting ',' delimiter)r8r7rIrrJr;) rLrMrQrRr/r8valuesrSr@rJrVrrr JSONArrays@ "   rZc@s@eZdZdZdddddddddZejfddZd d d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NT)rN parse_float parse_intparse_constantr?rOcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)aD``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rNfloatr[r.r\ _CONSTANTS __getitem__r]r?rOrWZ parse_objectrZZ parse_arrayrZ parse_stringrPrZ make_scannerrM)rrNr[r\r]r?rOrrrr s&   zJSONDecoder.__init__cCsF|j|||djd\}}|||j}|t|krBtd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). r)idxz Extra data) raw_decoder8r-r)rr/rQobjr8rrrdecodeNs   zJSONDecoder.decodercCsPy|j||\}}Wn2tk rF}ztd||jdWYdd}~XnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. zExpecting valueN)rMrIrrJ)rr/rarcr8rVrrrrbYs "zJSONDecoder.raw_decode)r) rrrrr WHITESPACEmatchrdrbrrrrrs 1 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr^rZPosInfZNegInfr rr_compileZ STRINGCHUNKZ BACKSLASHr1rfrDreZWHITESPACE_STRrWrZobjectrrrrrs6    ; P%PK!](__pycache__/scanner.cpython-36.opt-2.pycnu[3 \o @sfddlZyddlmZWnek r0dZYnXdgZejdejejBej BZ ddZ ep`e ZdS)N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsy ||}Wntk r(t|YnX|dkrB ||d S|dkrd ||df S|dkr~||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d ko|||d d krd|d fS||}|dk rX|j\}}}|s&|rD||p2d|p            z#py_make_scanner.._scan_oncec sz ||SjXdS)N)clear)rr)rrr(r) scan_onceAs z"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r() rrrrr r!r"r#r$r%r&r'r)py_make_scanners"%r/) reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!Ui__pycache__/tool.cpython-36.pycnu[3 \m@s>dZddlZddlZddlZddlZddZedkr:edS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc "Cs d}d}tj||d}|jddtjdd|jddtjd d d|jd d d dd|j}|jphtj}|jpttj }|j }|Vy$|rt j |}nt j |t jd}Wn*tk r}zt|WYdd}~XnXWdQRX|"t j|||dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?z-a JSON file to be validated or pretty-printed)nargstypehelpoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actiondefaultr)Zobject_pairs_hook) sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$/usr/lib64/python3.6/tool.pymains0    $r&__main__)__doc__rrrrr&__name__r$r$r$r% sPK!+d&&"__pycache__/decoder.cpython-36.pycnu[3 \)1@sdZddlZddlmZyddlmZWnek r@dZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZeeed Zejd e Zd ddddddddZddZdeejfddZepeZejde ZdZdejefddZejefdd ZGd!ddeZdS)"zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCsb|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr/usr/lib64/python3.6/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrr bfnrtc Cs`||d|d}t|dkrL|ddkrLy t|dStk rJYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r1TcCsg}|j}|d}x|||}|dkr4td|||j}|j\} } | rT|| | dkr`Pn.| dkr|rdj| } t| ||n || qy ||} Wn tk rtd||YnX| dkry || } Wn*tk rdj| } t| ||YnX|d7}nt||}|d 7}d |ko.d knr|||d d krt||d}d|kondknrd|d d>|dB}|d7}t|} || qWdj ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsP           2 rDz [ \t\n\r]*z c#Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} xt|| |\}} | ||}|| | ddkr&||| j} || | ddkr&td|| | d7} y:|| |krf| d7} || |krf||| dj} Wntk r~YnXy||| \}} Wn4tk r}ztd||jdWYdd}~XnX| ||fy0|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkr6Pn| d krPtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer6,zExpecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrJerrrrr JSONObjects     "        rWc Csz|\}}g}|||d}||krF|||dj}|||d}|dkrZ||dfS|j}xy|||\} }Wn2tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr|||dj}|||d}|d7}|dkrPn|dkrtd||dy:|||krT|d7}|||krT|||dj}Wqdtk rlYqdXqdW||fS)Nr ]zExpecting valuerGzExpecting ',' delimiter)r8r7rIrrJr;) rLrMrQrRr/r8valuesrSr@rJrVrrr JSONArrays@ "   rZc@s@eZdZdZdddddddddZejfddZd d d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NT)rN parse_float parse_intparse_constantr?rOcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)aD``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rNfloatr[r.r\ _CONSTANTS __getitem__r]r?rOrWZ parse_objectrZZ parse_arrayrZ parse_stringrPrZ make_scannerrM)rrNr[r\r]r?rOrrrr s&   zJSONDecoder.__init__cCsF|j|||djd\}}|||j}|t|krBtd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). r)idxz Extra data) raw_decoder8r-r)rr/rQobjr8rrrdecodeNs   zJSONDecoder.decodercCsPy|j||\}}Wn2tk rF}ztd||jdWYdd}~XnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. zExpecting valueN)rMrIrrJ)rr/rarcr8rVrrrrbYs "zJSONDecoder.raw_decode)r) rrrrr WHITESPACEmatchrdrbrrrrrs 1 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr^rZPosInfZNegInfr rr_compileZ STRINGCHUNKZ BACKSLASHr1rfrDreZWHITESPACE_STRrWrZobjectrrrrrs6    ; P%PK!)o^1^1)__pycache__/__init__.cpython-36.opt-1.pycnu[3 \<8 @sdZdZdddddddgZd Zd d lmZmZd d lmZd dl Z eddddddddZ dddddddddd ddZ dddddddddd ddZ edddZ ddZdddddddddZddddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> from collections import OrderedDict >>> mydict = OrderedDict([('4', 5), ('6', 7)]) >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(obj) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks| rJ|rJ|rJ|rJ|dkrJ|dkrJ|dkrJ| dkrJ| rJ| rJtj|} n2|dkrVt}|f||||||| | d| j|} x| D]} |j| qWdS)aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. N)r r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr /usr/lib64/python3.6/__init__.pyrxs-   c Ksz| rH|rH|rH|rH|dkrH|dkrH|dkrH|dkrH| rH| rHtj|S|dkrTt}|f|||||||| d| j|S)auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. N)r r r r rrrr)rencoder) rr r r r rrrrrrrrrrs,   ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjras6  =8 PK!)o^1^1#__pycache__/__init__.cpython-36.pycnu[3 \<8 @sdZdZdddddddgZd Zd d lmZmZd d lmZd dl Z eddddddddZ dddddddddd ddZ dddddddddd ddZ edddZ ddZdddddddddZddddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> from collections import OrderedDict >>> mydict = OrderedDict([('4', 5), ('6', 7)]) >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(obj) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks| rJ|rJ|rJ|rJ|dkrJ|dkrJ|dkrJ| dkrJ| rJ| rJtj|} n2|dkrVt}|f||||||| | d| j|} x| D]} |j| qWdS)aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. N)r r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr /usr/lib64/python3.6/__init__.pyrxs-   c Ksz| rH|rH|rH|rH|dkrH|dkrH|dkrH|dkrH| rH| rHtj|S|dkrTt}|f|||||||| d| j|S)auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. N)r r r r rrrr)rencoder) rr r r r rrrrrrrrrrs,   ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjras6  =8 PK!f n(__pycache__/decoder.cpython-36.opt-2.pycnu[3 \)1@sddlZddlmZyddlmZWnek r<dZYnXddgZejej Bej BZ e dZ e dZe dZGd ddeZeee d Zejd e Zd d dddddddZddZdeejfddZepeZejde ZdZdejefddZejefddZGd ddeZdS)!N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@seZdZddZddZdS)rcCsb|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr$/usr/lib64/python3.6/json/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrrbfnrtc Cs`||d|d}t|dkrL|ddkrLy t|dStk rJYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r0TcCsg}|j}|d}x|||}|dkr4td|||j}|j\} } | rT|| | dkr`Pn.| dkr|rdj| } t| ||n || qy ||} Wn tk rtd||YnX| dkry || } Wn*tk rdj| } t| ||YnX|d7}nt||}|d7}d |ko.d knr|||d d krt||d}d |kondknrd|d d>|d B}|d7}t|} || qWdj ||fS)Nr zUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r)iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr0chrjoin)r.r7strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr/charZuniZuni2rrr py_scanstringEsP           2 rCz [ \t\n\r]*z c#Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} xt|| |\}} | ||}|| | ddkr&||| j} || | ddkr&td|| | d7} y:|| |krf| d7} || |krf||| dj} Wntk r~YnXy||| \}} Wn4tk r}ztd||jdWYdd}~XnX| ||fy0|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkr6Pn| d krPtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer5,zExpecting ',' delimiter) r6 setdefaultr7rrr: StopIterationvaluedict) s_and_endr> scan_once object_hookobject_pairs_hookmemo_w_wsr.r7ZpairsZ pairs_appendZmemo_getnextcharresultkeyrIerrrrr JSONObjects     "        rVc Csz|\}}g}|||d}||krF|||dj}|||d}|dkrZ||dfS|j}xy|||\} }Wn2tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr|||dj}|||d}|d7}|dkrPn|dkrtd||dy:|||krT|d7}|||krT|||dj}Wqdtk rlYqdXqdW||fS)Nr ]zExpecting valuerFzExpecting ',' delimiter)r7r6rHrrIr:) rKrLrPrQr.r7valuesrRr?rIrUrrr JSONArrays@ "   rYc@s<eZdZdddddddddZejfddZd d d ZdS) rNT)rM parse_float parse_intparse_constantr>rNcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)N)rMfloatrZr-r[ _CONSTANTS __getitem__r\r>rNrVZ parse_objectrYZ parse_arrayrZ parse_stringrOrZ make_scannerrL)rrMrZr[r\r>rNrrrr s&   zJSONDecoder.__init__cCsF|j|||djd\}}|||j}|t|krBtd|||S)Nr)idxz Extra data) raw_decoder7r,r)rr.rPobjr7rrrdecodeNs   zJSONDecoder.decodercCsPy|j||\}}Wn2tk rF}ztd||jdWYdd}~XnX||fS)NzExpecting value)rLrHrrI)rr.r`rbr7rUrrrraYs "zJSONDecoder.raw_decode)r)rrrr WHITESPACEmatchrcrarrrrrs 1 )reZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr]rZPosInfZNegInfr rr^compileZ STRINGCHUNKZ BACKSLASHr0rerCrdZWHITESPACE_STRrVrYobjectrrrrrs4    ; P%PK!(__pycache__/encoder.cpython-36.opt-2.pycnu[3 \>"@s>ddlZyddlmZWnek r0dZYnXyddlmZWnek rZdZYnXyddlmZWnek rdZYnXej dZ ej dZ ej dZ dd d d d d ddZ x&edD]Ze jeedjeqWedZddZepeZddZepeZGdddeZeeeeeeeee ej!f ddZ"dS)N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    z \u{0:04x}infcCsdd}dtj||dS)NcSst|jdS)Nr) ESCAPE_DCTgroup)matchr$/usr/lib64/python3.6/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$srcCsdd}dtj||dS)Nc Ssv|jd}yt|Stk rpt|}|dkr.replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0sr c @sJeZdZdZdZdddddddddddZd d Zd d Zdd dZdS) JSONEncoderz, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)N,) r"r#r$r%r&r'item_separator key_separatorr)) selfr"r#r$r%r&r'r(r)rrr__init__hs+zJSONEncoder.__init__cCstd|jjdS)Nz,Object of type '%s' is not JSON serializable) TypeError __class____name__)r-orrrr)szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}dj|S)NT) _one_shot) isinstancestrr#rr iterencodelisttuplejoin)r-r2chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r2r%Z_reprZ_infZ_neginftextrrrfloatstrs z(JSONEncoder.iterencode..floatstrr)r$r#rrr%float__repr__INFINITYc_make_encoderr'r)r,r+r&r"_make_iterencode)r-r2r3markers_encoderr@ _iterencoderrrr7s&       zJSONEncoder.iterencode)F) r1 __module__ __qualname__r+r,r.r)r<r7rrrrr!Is6r!csdk r rd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}x|D]}|rd}n|} |r||Vqz|dkr|dVqz|dkr|d Vqz|dkr|d Vqz | r||Vqz | r||Vqz|V |fr:||}n" | rR||}n ||}|EdHqzW|dk r|d8}d|Vd Vdk r|=dS) Nz[]zCircular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer;)r=rG _floatstr_indent_intstr_item_separatorrH_iterencode_dict_iterencode_listdictrAidintr5r8rFr6r9rrr\s\               z*_make_iterencode.._iterencode_listc 3sL|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|jddd }n|j}xx|D]n\}}|rnr| rȈ|}n^|dkrd }nP|d krd }nB|dkrd }n4|r|}n rqntdt|d|r2d }n|V|V V|r`|Vq|dkrrd Vq|dkrd Vq|d krd Vq|r|Vq| rƈ|Vq|fr||} n"| r||} n ||} | EdHqW|dk r2|d8}d|VdVdk rH|=dS)Nz{}zCircular reference detected{rMr TcSs|dS)Nrr)Zkvrrrasz<_make_iterencode.._iterencode_dict..)keyrOFrPrNzkey z is not a string})sorteditemsr/r>) ZdctrRrSrTr+rUrerbrVr;)r=rGrWrXrYrZrHr[r\_key_separator _skipkeys _sort_keysr]rAr^r_r5r8rFr6r9rrr[Ms                      z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrNTrOFrPzCircular reference detectedr)r2rRrS)r=_defaultrGrWrYrHr[r\r]rAr^r_r5r8rFr6r9rrrHs2       z%_make_iterencode.._iterencoder)rFrirGrXrWrfrZrhrgr3r=r]rAr^r_r5r8r6r9rYr)r=rirGrWrXrYrZrHr[r\rfrgrhr]rAr^r_r5r8rFr6r9rrEs .84O,rE)#reZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrDcompilerrZHAS_UTF8rrangei setdefaultchrrrArCrr objectr!r=r]r^r_r5r8r6r9__str__rErrrrsR        >PK! ;) )__pycache__/__init__.cpython-36.opt-2.pycnu[3 \<8 @sdZdddddddgZdZd d lmZmZd d lmZd d lZeddddd d d dZ ddddd d d d dd ddZ ddddd d d d dd ddZ ed d dZ ddZ d d d d d d dddZd d d d d d d dddZd S)z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks| rJ|rJ|rJ|rJ|dkrJ|dkrJ|dkrJ| dkrJ| rJ| rJtj|} n2|dkrVt}|f||||||| | d| j|} x| D]} |j| qWdS)N)r r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr%/usr/lib64/python3.6/json/__init__.pyrxs-   c Ksz| rH|rH|rH|rH|dkrH|dkrH|dkrH|dkrH| rH| rHtj|S|dkrTt}|f|||||||| d| j|S)N)r r r r rrrr)rencoder) rr r r r rrrrrrrrrrs,   ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjrbs4  =8 PK!B7f++"__pycache__/encoder.cpython-36.pycnu[3 \>"@sBdZddlZyddlmZWnek r4dZYnXyddlmZWnek r^dZYnXyddlmZ Wnek rdZ YnXej dZ ej dZ ej dZ d d d d d dddZx&edD]ZejeedjeqWedZddZepeZddZep eZGdddeZeeeeeeee e!ej"f ddZ#dS)zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    z \u{0:04x}infcCsdd}dtj||dS)z5Return a JSON representation of a Python string cSst|jdS)Nr) ESCAPE_DCTgroup)matchr/usr/lib64/python3.6/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$srcCsdd}dtj||dS)zAReturn an ASCII-only JSON representation of a Python string c Ssv|jd}yt|Stk rpt|}|dkr.replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0sr c @sNeZdZdZdZdZddddddddddd Zd d Zd d ZdddZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) r"r#r$r%r&r'item_separator key_separatorr)) selfr"r#r$r%r&r'r(r)rrr__init__hs+zJSONEncoder.__init__cCstd|jjdS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) z,Object of type '%s' is not JSON serializableN) TypeError __class____name__)r-orrrr)szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}dj|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' T) _one_shot) isinstancestrr#rr iterencodelisttuplejoin)r-r2chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r2r%Z_reprZ_infZ_neginftextrrrfloatstrs z(JSONEncoder.iterencode..floatstrr)r$r#rrr%float__repr__INFINITYc_make_encoderr'r)r,r+r&r"_make_iterencode)r-r2r3markers_encoderr@ _iterencoderrrr7s&       zJSONEncoder.iterencode)F) r1 __module__ __qualname____doc__r+r,r.r)r<r7rrrrr!Is6r!csdk r rd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}x|D]}|rd}n|} |r||Vqz|dkr|dVqz|dkr|d Vqz|dkr|d Vqz | r||Vqz | r||Vqz|V |fr:||}n" | rR||}n ||}|EdHqzW|dk r|d8}d|Vd Vdk r|=dS) Nz[]zCircular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer;)r=rG _floatstr_indent_intstr_item_separatorrH_iterencode_dict_iterencode_listdictrAidintr5r8rFr6r9rrr]s\               z*_make_iterencode.._iterencode_listc 3sL|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|jddd }n|j}xx|D]n\}}|rnr| rȈ|}n^|dkrd }nP|d krd }nB|dkrd }n4|r|}n rqntdt|d|r2d }n|V|V V|r`|Vq|dkrrd Vq|dkrd Vq|d krd Vq|r|Vq| rƈ|Vq|fr||} n"| r||} n ||} | EdHqW|dk r2|d8}d|VdVdk rH|=dS)Nz{}zCircular reference detected{rNr TcSs|dS)Nrr)Zkvrrrasz<_make_iterencode.._iterencode_dict..)keyrPFrQrOzkey z is not a string})sorteditemsr/r>) ZdctrSrTrUr+rVrfrcrWr;)r=rGrXrYrZr[rHr\r]_key_separator _skipkeys _sort_keysr^rAr_r`r5r8rFr6r9rrr\Ms                      z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrOTrPFrQzCircular reference detectedr)r2rSrT)r=_defaultrGrXrZrHr\r]r^rAr_r`r5r8rFr6r9rrrHs2       z%_make_iterencode.._iterencoder)rFrjrGrYrXrgr[rirhr3r=r^rAr_r`r5r8r6r9rZr)r=rjrGrXrYrZr[rHr\r]rgrhrir^rAr_r`r5r8rFr6r9rrEs .84O,rE)$rKreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrDcompilerrZHAS_UTF8rrangei setdefaultchrrrArCrr objectr!r=r^r_r`r5r8r6r9__str__rErrrrsT        >PK!__pycache__/tool.cpython-35.pycnu[ Yfm@sYdZddlZddlZddlZddlZddZedkrUedS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc #Cszd}d}tjd|d|}|jddddtjd d |jd dddtjd d d |jdddddd d|j}|jptj}|jptj }|j }|my4|rt j |}nt j |dt j}Wn1tk r7}zt|WYdd}~XnXWdQRX|.t j||d|dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.prog descriptioninfilenargs?typehelpz-a JSON file to be validated or pretty-printedoutfilewz%write the output of infile to outfilez --sort-keysaction store_truedefaultFz5sort the output of dictionaries alphabetically by keyZobject_pairs_hook sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$./opt/alt/python35/lib64/python3.5/json/tool.pymains0!   &r&__main__)__doc__rrrrr&__name__r$r$r$r% s      PK!]"__pycache__/scanner.cpython-35.pycnu[ Yfp @sdZddlZyddlmZWnek r@dZYnXdgZejdejej Bej BZ ddZ epe ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c s|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}S)Ncsvy||}Wntk r.t|YnX|dkrO ||d S|dkr~ ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr |||dd kr d |dfS|d kr=|||d d kr=d|d fS||}|dk r|j\}}}|sy|r||pd|pd}n |}||jfS|dkr|||ddkrd|dfS|dkr,|||ddkr,d|dfS|dkrf|||ddkrfd|dfSt|dS)N"{[nZnullttrueTffalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracZexpres) _scan_once match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict1/opt/alt/python35/lib64/python3.5/json/scanner.pyrs>    &&&  # &&&z#py_make_scanner.._scan_oncec s#z||SWdjXdS)N)clear)rr)rrr)r* scan_onceAsz"py_make_scanner..scan_once) r&r"r' NUMBER_REmatchr(r$r%r#r r!r)contextr,r)) rrrr r!r"r#r$r%r&r'r(r*py_make_scanners           3%r0) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr-r0r)r)r)r*s     :PK!ff%__pycache__/tool.cpython-35.opt-2.pycnu[ ]m@sSddlZddlZddlZddlZddZedkrOedS)Nc #Cszd}d}tjd|d|}|jddddtjd d |jd dddtjd d d |jdddddd d|j}|jptj}|jptj }|j }|my4|rt j |}nt j |dt j}Wn1tk r7}zt|WYdd}~XnXWdQRX|.t j||d|dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.prog descriptioninfilenargs?typehelpz-a JSON file to be validated or pretty-printedoutfilewz%write the output of infile to outfilez --sort-keysaction store_truedefaultFz5sort the output of dictionaries alphabetically by keyZobject_pairs_hook sort_keysindent )argparseArgumentParser add_argumentFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparseroptionsrr robjer&)/opt/alt/python35/lib64/python3.5/tool.pymains0!   &r(__main__)rrrrr(__name__r&r&r&r' s      PK!ۂm.."__pycache__/encoder.cpython-35.pycnu[ YfY>&@sdZddlZyddlmZWnek r@dZYnXyddlmZWnek rodZYnXyddlmZ Wnek rdZ YnXej dZ ej dZ ej dZ d d d d d dddddddddiZx3edD]%Zejeedjeq WedZddZepSeZddZepkeZGdddeZeeeeeeee e!ej"d d! Z#dS)"zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]\z\\"z\"z\b z\f z\n z\r z\t z \u{0:04x}infcCs$dd}dtj||dS)z5Return a JSON representation of a Python string cSst|jdS)Nr) ESCAPE_DCTgroup)matchr1/opt/alt/python35/lib64/python3.5/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$s rcCs$dd}dtj||dS)zAReturn an ASCII-only JSON representation of a Python string c Ss|jd}y t|SWnqtk rt|}|dkrPdj|S|d8}d|d?d@B}d|d@B}dj||SYnXdS) Nriz \u{0:04x}i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s      z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0s r c @smeZdZdZdZdZddddddddddZd d Zd d Zdd dZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTNc Cs||_||_||_||_||_||_|dk rW|\|_|_n|dk rld|_|dk r||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) skipkeys ensure_asciicheck_circular allow_nan sort_keysindentitem_separator key_separatordefault) selfr#r$r%r&r'r(Z separatorsr+rrr__init__hs+          zJSONEncoder.__init__cCstt|ddS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) z is not JSON serializableN) TypeErrorrepr)r,orrrr+szJSONEncoder.defaultcCsot|tr,|jr"t|St|S|j|dd}t|ttfsbt|}dj|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' _one_shotT) isinstancestrr$rr iterencodelisttuplejoin)r,r0chunksrrrencodes     zJSONEncoder.encodec Cs|jri}nd}|jr*t}nt}|jtjtt dd}|rtdk r|j dkrt||j ||j |j |j |j |j|j }n9t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsi||krd}n4||kr*d}n||kr?d}n ||S|setdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorr/)r0r&Z_reprZ_infZ_neginftextrrrfloatstrs       z(JSONEncoder.iterencode..floatstrr)r%r$rrr&float__repr__INFINITYc_make_encoderr(r+r*r)r'r#_make_iterencode)r,r0r1markers_encoderr= _iterencoderrrr5s&    zJSONEncoder.iterencode) __name__ __module__ __qualname____doc__r)r*r-r+r:r5rrrrr!Is  6  r!csdk r& r&d fdd  fdd fddS)N c 3s|sdVdSdk rI |}|kr?d||idintr3r6rCr4r7rrr[s\                      z*_make_iterencode.._iterencode_listc 3s|sdVdSdk rI|}|kr?d||`sz<_make_iterencode.._iterencode_dict..rNFrOrMzkey z is not a string})sorteditemsr.r/) ZdctrQrRrSr)rTrdr`rUr9)r;rDrVrWrXrYrErZr[_key_separator _skipkeys _sort_keysr\r>r]r^r3r6rCr4r7rrrZLs        !                 z*_make_iterencode.._iterencode_dictc3sP |r|Vn/|dkr1dVn|dkrEdVn|dkrYdVn | rv|Vn | r|Vn | fr||EdHn |r||EdHnkdk r |}|krd||<|}||EdHdk rL|=dS)NrMTrNFrOzCircular reference detectedr)r0rQrR)r;_defaultrDrVrXrErZr[r\r>r]r^r3r6rCr4r7rrrEs2          z%_make_iterencode.._iterencoder)rCrhrDrWrVrerYrgrfr1r;r\r>r]r^r3r6r4r7rXr)r;rhrDrVrWrXrYrErZr[rerfrgr\r>r]r^r3r6rCr4r7rrBs  E8NOBrB)$rIreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrAcompilerrZHAS_UTF8rrangei setdefaultchrrr>r@rr objectr!r;r\r]r^r3r6r4r7__str__rBrrrrsR        #    PK!vk))(__pycache__/decoder.cpython-35.opt-1.pycnu[ Yf&1@sdZddlZddlmZyddlmZWnek rPdZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZd ed ed eiZejde ZddddddddddddddddiZddZdeejdd Zep;eZejd!e Zd"Zdejed#d$Zejed%d&ZGd'ddeZdS)(zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s.eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCs|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr1/opt/alt/python35/lib64/python3.5/json/decoder.pyr s    zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/bf nrr t c Cs|||d|d}t|dkr`|ddkr`yt|dSWntk r_YnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s" r1TcCs+g}|j}|d}x|||}|dkrItd|||j}|j\} } | rw|| | dkrPnC| dkr|rdj| } t| ||n || qy||} Wn$tk rtd||YnX| dkr\y|| } Wn3tk rNdj| } t| ||YnX|d7}nt||}|d 7}d |kod knr|||d d krt||d}d|kodknrd|d d>|dB}|d7}t|} || qWdj ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsP              6  rDz [ \t\n\r]*z c#Cs|\}} g} | j} |dkr-i}|j} || | d} | dkr| |kr||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} x>t|| |\}} | ||}|| | ddkr||| j} || | ddkrtd|| | d7} yG|| |kr| d7} || |kr||| dj} Wntk rYnXy||| \}} Wn=tk rT}ztd||jdWYdd}~XnX| ||fy=|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkrPn"| d krtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk rt|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer6,zExpecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrJerrrrr JSONObjects                +               rWc Cs|\}}g}|||d}||kr_|||dj}|||d}|dkry||dfS|j}xLy|||\} }Wn=tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr5|||dj}|||d}|d7}|dkrOPn"|dkrqtd||dyG|||kr|d7}|||kr|||dj}Wqtk rYqXqW||fS)Nr ]zExpecting valuerGzExpecting ',' delimiter)r8r7rIrrJr;) rLrMrQrRr/r8valuesrSr@rJrVrrr JSONArrays@    +        rZc@sUeZdZdZddddddddZejddZdd d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NTcCs||_|pt|_|p!t|_|p3tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)aD``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rNfloat parse_floatr. parse_int _CONSTANTS __getitem__parse_constantr?rOrWZ parse_objectrZZ parse_arrayrZ parse_stringrPrZ make_scannerrM)rrNr\r]r`r?rOrrrr s&       zJSONDecoder.__init__cCsg|j|d||dj\}}|||j}|t|krctd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). idxrz Extra data) raw_decoder8r-r)rr/rQobjr8rrrdecodeNs *zJSONDecoder.decodercCsfy|j||\}}Wn=tk r[}ztd||jdWYdd}~XnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. zExpecting valueN)rMrIrrJ)rr/rarcr8rVrrrrbYs +zJSONDecoder.raw_decode) rrrrr WHITESPACEmatchrdrbrrrrrs  1 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr[rZPosInfZNegInfr rr^compileZ STRINGCHUNKZ BACKSLASHr1rfrDreZWHITESPACE_STRrWrZobjectrrrrrs6        $ ; P%PK!yy(__pycache__/scanner.cpython-35.opt-2.pycnu[ ]p @sddlZyddlmZWnek r:dZYnXdgZejdejejBej BZ ddZ ep|e ZdS)N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c s|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}S)Ncsvy||}Wntk r.t|YnX|dkrO ||d S|dkr~ ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr |||dd kr d |dfS|d kr=|||d d kr=d|d fS||}|dk r|j\}}}|sy|r||pd|pd}n |}||jfS|dkr|||ddkrd|dfS|dkr,|||ddkr,d|dfS|dkrf|||ddkrfd|dfSt|dS)N"{[nZnullttrueTffalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracexpres) _scan_once match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict,/opt/alt/python35/lib64/python3.5/scanner.pyrs>    &&&  # &&&z#py_make_scanner.._scan_oncec s#z||SWdjXdS)N)clear)rr)rr r*r+ scan_onceAsz"py_make_scanner..scan_once) r'r#r( NUMBER_REmatchr)r%r&r$r!r"r )contextr-r*) rrr r!r"r#r$r%r&r'r(r)r+py_make_scanners           3%r1) reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr.r1r*r*r*r+s     :PK!ۂm..(__pycache__/encoder.cpython-35.opt-1.pycnu[ YfY>&@sdZddlZyddlmZWnek r@dZYnXyddlmZWnek rodZYnXyddlmZ Wnek rdZ YnXej dZ ej dZ ej dZ d d d d d dddddddddiZx3edD]%Zejeedjeq WedZddZepSeZddZepkeZGdddeZeeeeeeee e!ej"d d! Z#dS)"zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]\z\\"z\"z\b z\f z\n z\r z\t z \u{0:04x}infcCs$dd}dtj||dS)z5Return a JSON representation of a Python string cSst|jdS)Nr) ESCAPE_DCTgroup)matchr1/opt/alt/python35/lib64/python3.5/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$s rcCs$dd}dtj||dS)zAReturn an ASCII-only JSON representation of a Python string c Ss|jd}y t|SWnqtk rt|}|dkrPdj|S|d8}d|d?d@B}d|d@B}dj||SYnXdS) Nriz \u{0:04x}i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s      z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0s r c @smeZdZdZdZdZddddddddddZd d Zd d Zdd dZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTNc Cs||_||_||_||_||_||_|dk rW|\|_|_n|dk rld|_|dk r||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) skipkeys ensure_asciicheck_circular allow_nan sort_keysindentitem_separator key_separatordefault) selfr#r$r%r&r'r(Z separatorsr+rrr__init__hs+          zJSONEncoder.__init__cCstt|ddS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) z is not JSON serializableN) TypeErrorrepr)r,orrrr+szJSONEncoder.defaultcCsot|tr,|jr"t|St|S|j|dd}t|ttfsbt|}dj|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' _one_shotT) isinstancestrr$rr iterencodelisttuplejoin)r,r0chunksrrrencodes     zJSONEncoder.encodec Cs|jri}nd}|jr*t}nt}|jtjtt dd}|rtdk r|j dkrt||j ||j |j |j |j |j|j }n9t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsi||krd}n4||kr*d}n||kr?d}n ||S|setdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorr/)r0r&Z_reprZ_infZ_neginftextrrrfloatstrs       z(JSONEncoder.iterencode..floatstrr)r%r$rrr&float__repr__INFINITYc_make_encoderr(r+r*r)r'r#_make_iterencode)r,r0r1markers_encoderr= _iterencoderrrr5s&    zJSONEncoder.iterencode) __name__ __module__ __qualname____doc__r)r*r-r+r:r5rrrrr!Is  6  r!csdk r& r&d fdd  fdd fddS)N c 3s|sdVdSdk rI |}|kr?d||idintr3r6rCr4r7rrr[s\                      z*_make_iterencode.._iterencode_listc 3s|sdVdSdk rI|}|kr?d||`sz<_make_iterencode.._iterencode_dict..rNFrOrMzkey z is not a string})sorteditemsr.r/) ZdctrQrRrSr)rTrdr`rUr9)r;rDrVrWrXrYrErZr[_key_separator _skipkeys _sort_keysr\r>r]r^r3r6rCr4r7rrrZLs        !                 z*_make_iterencode.._iterencode_dictc3sP |r|Vn/|dkr1dVn|dkrEdVn|dkrYdVn | rv|Vn | r|Vn | fr||EdHn |r||EdHnkdk r |}|krd||<|}||EdHdk rL|=dS)NrMTrNFrOzCircular reference detectedr)r0rQrR)r;_defaultrDrVrXrErZr[r\r>r]r^r3r6rCr4r7rrrEs2          z%_make_iterencode.._iterencoder)rCrhrDrWrVrerYrgrfr1r;r\r>r]r^r3r6r4r7rXr)r;rhrDrVrWrXrYrErZr[rerfrgr\r>r]r^r3r6rCr4r7rrBs  E8NOBrB)$rIreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrAcompilerrZHAS_UTF8rrangei setdefaultchrrr>r@rr objectr!r;r\r]r^r3r6r4r7__str__rBrrrrsR        #    PK!n ss(__pycache__/decoder.cpython-35.opt-2.pycnu[ ]&1@sddlZddlmZyddlmZWnek rJdZYnXddgZejej Bej BZ e dZ e dZe dZGd ddeZd ed ed e iZejd e ZddddddddddddddddiZddZdeejddZep5eZejd e Zd!Zdejed"d#Zejed$d%ZGd&ddeZdS)'N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s(eZdZddZddZdS)rcCs|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr,/opt/alt/python35/lib64/python3.5/decoder.pyr s    zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname__r rrrrrrs z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/bf nrr t c Cs|||d|d}t|dkr`|ddkr`yt|dSWntk r_YnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s" r0TcCs+g}|j}|d}x|||}|dkrItd|||j}|j\} } | rw|| | dkrPnC| dkr|rdj| } t| ||n || qy||} Wn$tk rtd||YnX| dkr\y|| } Wn3tk rNdj| } t| ||YnX|d7}nt||}|d7}d |kod knr|||d d krt||d}d |kodknrd|d d>|d B}|d7}t|} || qWdj ||fS)Nr zUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r)iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr0chrjoin)r.r7strictZ_bZ_mchunks_appendZbeginchunkZcontent terminatorrr/charZuniZuni2rrr py_scanstringEsP              6  rDz [ \t\n\r]*z c#Cs|\}} g} | j} |dkr-i}|j} || | d} | dkr| |kr||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} x>t|| |\}} | ||}|| | ddkr||| j} || | ddkrtd|| | d7} yG|| |kr| d7} || |kr||| dj} Wntk rYnXy||| \}} Wn=tk rT}ztd||jdWYdd}~XnX| ||fy=|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkrPn"| d krtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk rt|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer5,zExpecting ',' delimiter) r6 setdefaultr7rrr: StopIterationvaluedict) s_and_endr> scan_once object_hookobject_pairs_hookmemo_w_wsr.r7ZpairsZ pairs_appendZmemo_getnextcharresultkeyrJerrrrr JSONObjects                +               rWc Cs|\}}g}|||d}||kr_|||dj}|||d}|dkry||dfS|j}xLy|||\} }Wn=tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr5|||dj}|||d}|d7}|dkrOPn"|dkrqtd||dyG|||kr|d7}|||kr|||dj}Wqtk rYqXqW||fS)Nr ]zExpecting valuerGzExpecting ',' delimiter)r7r6rIrrJr:) rLrMrQrRr.r7valuesrSr@rJrVrrr JSONArrays@    +        rZc@sOeZdZddddddddZejddZddd ZdS) rNTcCs||_|pt|_|p!t|_|p3tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)N)rNfloat parse_floatr- parse_int _CONSTANTS __getitem__parse_constantr>rOrWZ parse_objectrZZ parse_arrayrZ parse_stringrPrZ make_scannerrM)rrNr\r]r`r>rOrrrr s&       zJSONDecoder.__init__cCsg|j|d||dj\}}|||j}|t|krctd|||S)Nidxrz Extra data) raw_decoder7r,r)rr.rQobjr7rrrdecodeNs *zJSONDecoder.decodercCsfy|j||\}}Wn=tk r[}ztd||jdWYdd}~XnX||fS)NzExpecting value)rMrIrrJ)rr.rarcr7rVrrrrbYs +zJSONDecoder.raw_decode)rrrr WHITESPACEmatchrdrbrrrrrs  1 )reZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr[rZPosInfZNegInfr rr^compileZ STRINGCHUNKZ BACKSLASHr0rfrDreZWHITESPACE_STRrWrZobjectrrrrrs4        $ ; P%PK!j>](__pycache__/encoder.cpython-35.opt-2.pycnu[ ]Y>&@sddlZyddlmZWnek r:dZYnXyddlmZWnek ridZYnXyddlmZWnek rdZYnXej dZ ej dZ ej dZ dd d d d d ddddddddiZ x3edD]%Ze jeedjeqWedZddZepMeZddZepeeZGdddeZeeeeeeeee ej!dd Z"dS)!N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]\z\\"z\"z\b z\f z\n z\r z\t z \u{0:04x}infcCs$dd}dtj||dS)NcSst|jdS)Nr) ESCAPE_DCTgroup)matchr,/opt/alt/python35/lib64/python3.5/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsub)srrrrpy_encode_basestring$s rcCs$dd}dtj||dS)Nc Ss|jd}y t|SWnqtk rt|}|dkrPdj|S|d8}d|d?d@B}d|d@B}dj||SYnXdS) Nriz \u{0:04x}i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s      z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIr)rrrrrpy_encode_basestring_ascii0s r c @sgeZdZdZdZddddddddddZdd Zd d Zdd d ZdS) JSONEncoderz, z: FTNc Cs||_||_||_||_||_||_|dk rW|\|_|_n|dk rld|_|dk r||_dS)N,) skipkeys ensure_asciicheck_circular allow_nan sort_keysindentitem_separator key_separatordefault) selfr#r$r%r&r'r(Z separatorsr+rrr__init__hs+          zJSONEncoder.__init__cCstt|ddS)Nz is not JSON serializable) TypeErrorrepr)r,orrrr+szJSONEncoder.defaultcCsot|tr,|jr"t|St|S|j|dd}t|ttfsbt|}dj|S)N _one_shotT) isinstancestrr$rr iterencodelisttuplejoin)r,r0chunksrrrencodes     zJSONEncoder.encodec Cs|jri}nd}|jr*t}nt}|jtjtt dd}|rtdk r|j dkrt||j ||j |j |j |j |j|j }n9t||j ||j ||j |j |j |j| }||dS)NcSsi||krd}n4||kr*d}n||kr?d}n ||S|setdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorr/)r0r&Z_reprZ_infZ_neginftextrrrfloatstrs       z(JSONEncoder.iterencode..floatstrr)r%r$rrr&float__repr__INFINITYc_make_encoderr(r+r*r)r'r#_make_iterencode)r,r0r1markers_encoderr= _iterencoderrrr5s&    zJSONEncoder.iterencode) __name__ __module__ __qualname__r)r*r-r+r:r5rrrrr!Is  6  r!csdk r& r&d fdd  fdd fddS)N c 3s|sdVdSdk rI |}|kr?d||idintr3r6rCr4r7rrr[s\                      z*_make_iterencode.._iterencode_listc 3s|sdVdSdk rI|}|kr?d||`sz<_make_iterencode.._iterencode_dict..rMFrNrLzkey z is not a string})sorteditemsr.r/) dctrPrQrSr)rTrdr`rUr9)r;rDrVrWrXrYrErZr[_key_separator _skipkeys _sort_keysr\r>r]r^r3r6rCr4r7rrrZLs        !                 z*_make_iterencode.._iterencode_dictc3sP |r|Vn/|dkr1dVn|dkrEdVn|dkrYdVn | rv|Vn | r|Vn | fr||EdHn |r||EdHnkdk r |}|krd||<|}||EdHdk rL|=dS)NrLTrMFrNzCircular reference detectedr)r0rPrQ)r;_defaultrDrVrXrErZr[r\r>r]r^r3r6rCr4r7rrrEs2          z%_make_iterencode.._iterencoder)rCrirDrWrVrfrYrhrgr1r;r\r>r]r^r3r6r4r7rXr)r;rirDrVrWrXrYrErZr[rfrgrhr\r>r]r^r3r6rCr4r7rrBs  E8NOBrB)#reZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrAcompilerrZHAS_UTF8rrangei setdefaultchrrr>r@rr objectr!r;r\r]r^r3r6r4r7__str__rBrrrrsP        #    PK!vk))"__pycache__/decoder.cpython-35.pycnu[ Yf&1@sdZddlZddlmZyddlmZWnek rPdZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZd ed ed eiZejde ZddddddddddddddddiZddZdeejdd Zep;eZejd!e Zd"Zdejed#d$Zejed%d&ZGd'ddeZdS)(zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s.eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCs|jdd|d}||jdd|}d||||f}tj||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr1/opt/alt/python35/lib64/python3.5/json/decoder.pyr s    zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/bf nrr t c Cs|||d|d}t|dkr`|ddkr`yt|dSWntk r_YnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s" r1TcCs+g}|j}|d}x|||}|dkrItd|||j}|j\} } | rw|| | dkrPnC| dkr|rdj| } t| ||n || qy||} Wn$tk rtd||YnX| dkr\y|| } Wn3tk rNdj| } t| ||YnX|d7}nt||}|d 7}d |kod knr|||d d krt||d}d|kodknrd|d d>|dB}|d7}t|} || qWdj ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsP              6  rDz [ \t\n\r]*z c#Cs|\}} g} | j} |dkr-i}|j} || | d} | dkr| |kr||| j} || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} x>t|| |\}} | ||}|| | ddkr||| j} || | ddkrtd|| | d7} yG|| |kr| d7} || |kr||| dj} Wntk rYnXy||| \}} Wn=tk rT}ztd||jdWYdd}~XnX| ||fy=|| } | |kr||| dj} || } Wntk rd} YnX| d7} | dkrPn"| d krtd || d||| j} || | d} | d7} | dkrtd|| dqW|dk rt|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterzExpecting valuer6,zExpecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrJerrrrr JSONObjects                +               rWc Cs|\}}g}|||d}||kr_|||dj}|||d}|dkry||dfS|j}xLy|||\} }Wn=tk r} ztd|| jdWYdd} ~ XnX|| |||d}||kr5|||dj}|||d}|d7}|dkrOPn"|dkrqtd||dyG|||kr|d7}|||kr|||dj}Wqtk rYqXqW||fS)Nr ]zExpecting valuerGzExpecting ',' delimiter)r8r7rIrrJr;) rLrMrQrRr/r8valuesrSr@rJrVrrr JSONArrays@    +        rZc@sUeZdZdZddddddddZejddZdd d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NTcCs||_|pt|_|p!t|_|p3tj|_||_||_ t |_ t |_ t|_i|_tj||_dS)aD``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rNfloat parse_floatr. parse_int _CONSTANTS __getitem__parse_constantr?rOrWZ parse_objectrZZ parse_arrayrZ parse_stringrPrZ make_scannerrM)rrNr\r]r`r?rOrrrr s&       zJSONDecoder.__init__cCsg|j|d||dj\}}|||j}|t|krctd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). idxrz Extra data) raw_decoder8r-r)rr/rQobjr8rrrdecodeNs *zJSONDecoder.decodercCsfy|j||\}}Wn=tk r[}ztd||jdWYdd}~XnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. zExpecting valueN)rMrIrrJ)rr/rarcr8rVrrrrbYs +zJSONDecoder.raw_decode) rrrrr WHITESPACEmatchrdrbrrrrrs  1 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr[rZPosInfZNegInfr rr^compileZ STRINGCHUNKZ BACKSLASHr1rfrDreZWHITESPACE_STRrWrZobjectrrrrrs6        $ ; P%PK!½x.//#__pycache__/__init__.cpython-35.pycnu[ Yf3@s,dZdZdddddddgZd Zd d lmZmZd d lmZed dddddddddddddZ ddddddddddd Z ddddddddddd Z eddddZ ddddddddZ dddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> from collections import OrderedDict >>> mydict = OrderedDict([('4', 5), ('6', 7)]) >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(obj) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rskipkeysF ensure_asciiTcheck_circular allow_nanindentN separatorsdefaultc Ks| ri|ri|ri|ri|dkri|dkri|dkri| dkri| ri| ritj|} nW|dkr{t}|d|d|d|d|d|d|d| d | | j|} x| D]} |j| qWdS) aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r r rr sort_keys)_default_encoder iterencoderwrite)objfpr r r r clsr rrrkwiterablechunkr2/opt/alt/python35/lib64/python3.5/json/__init__.pyrws-  $  c Ks| rd|rd|rd|rd|dkrd|dkrd|dkrd|dkrd| rd| rdtj|S|dkrvt}|d|d|d|d|d|d|d|d | | j|S) auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r r rrr)rencoder) rr r r r rr rrrrrrrrs,  $    object_hookobject_pairs_hookcKs7t|jd|d|d|d|d|d||S)a%Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. rr parse_float parse_intparse_constantr)rread)rrrrr r!rrrrrrs  c Ks:t|ts*tdj|jj|jdrKtd|d|dkr|dkr|dkr|dkr|dkr|dkr| rtj |S|dkrt }|dk r||d<|dk r||d<|dk r||d<|dk r||d <|dk r'||d <||j |S) aDeserialize ``s`` (a ``str`` instance containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. The ``encoding`` argument is ignored and deprecated. z%the JSON object must be str, not {!r}uz-Unexpected UTF-8 BOM (decode using utf-8-sig)Nrrrr r!) isinstancestr TypeErrorformat __class____name__ startswithr_default_decoderdecoder) sencodingrrrr r!rrrrrrs.'              )__doc__ __version____all__ __author__decoderrrencoderrrrrr+rrrrrras2    =  8  PK!](__pycache__/scanner.cpython-35.opt-1.pycnu[ Yfp @sdZddlZyddlmZWnek r@dZYnXdgZejdejej Bej BZ ddZ epe ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c s|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}S)Ncsvy||}Wntk r.t|YnX|dkrO ||d S|dkr~ ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr |||dd kr d |dfS|d kr=|||d d kr=d|d fS||}|dk r|j\}}}|sy|r||pd|pd}n |}||jfS|dkr|||ddkrd|dfS|dkr,|||ddkr,d|dfS|dkrf|||ddkrfd|dfSt|dS)N"{[nZnullttrueTffalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracZexpres) _scan_once match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict1/opt/alt/python35/lib64/python3.5/json/scanner.pyrs>    &&&  # &&&z#py_make_scanner.._scan_oncec s#z||SWdjXdS)N)clear)rr)rrr)r* scan_onceAsz"py_make_scanner..scan_once) r&r"r' NUMBER_REmatchr(r$r%r#r r!r)contextr,r)) rrrr r!r"r#r$r%r&r'r(r*py_make_scanners           3%r0) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr-r0r)r)r)r*s     :PK! $ $ )__pycache__/__init__.cpython-35.opt-2.pycnu[ ]3@s&dZdddddddgZdZd d lmZmZd d lmZed d ddddddddddddZd dddddddd dd Z d dddddddd dd Z eddddZ ddddddddZ dddddddddZ dS)z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rskipkeysF ensure_asciiTcheck_circular allow_nanindentN separatorsdefaultc Ks| ri|ri|ri|ri|dkri|dkri|dkri| dkri| ri| ritj|} nW|dkr{t}|d|d|d|d|d|d|d| d| | j|} x| D]} |j| qWdS) Nr r r r r rr sort_keys)_default_encoder iterencoderwrite)objfpr r r r clsr rrrkwiterablechunkr-/opt/alt/python35/lib64/python3.5/__init__.pyrws-  $  c Ks| rd|rd|rd|rd|dkrd|dkrd|dkrd|dkrd| rd| rdtj|S|dkrvt}|d|d|d|d|d|d|d|d| | j|S) Nr r r r r rrr)rencoder) rr r r r rr rrrrrrrrs,  $    object_hookobject_pairs_hookcKs7t|jd|d|d|d|d|d||S)Nrr parse_float parse_intparse_constantr)rread)rrrrr r!rrrrrrs  c Ks:t|ts*tdj|jj|jdrKtd|d|dkr|dkr|dkr|dkr|dkr|dkr| rtj |S|dkrt }|dk r||d<|dk r||d<|dk r||d<|dk r||d<|dk r'||d <||j |S) Nz%the JSON object must be str, not {!r}uz-Unexpected UTF-8 BOM (decode using utf-8-sig)rrrr r!) isinstancestr TypeErrorformat __class____name__ startswithr_default_decoderdecoder) sencodingrrrr r!rrrrrrs.'              ) __version____all__ __author__decoderrrencoderrrrrr+rrrrrrbs0    =  8  PK!½x.//)__pycache__/__init__.cpython-35.opt-1.pycnu[ Yf3@s,dZdZdddddddgZd Zd d lmZmZd d lmZed dddddddddddddZ ddddddddddd Z ddddddddddd Z eddddZ ddddddddZ dddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> from collections import OrderedDict >>> mydict = OrderedDict([('4', 5), ('6', 7)]) >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(repr(obj) + " is not JSON serializable") ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rskipkeysF ensure_asciiTcheck_circular allow_nanindentN separatorsdefaultc Ks| ri|ri|ri|ri|dkri|dkri|dkri| dkri| ri| ritj|} nW|dkr{t}|d|d|d|d|d|d|d| d | | j|} x| D]} |j| qWdS) aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r r rr sort_keys)_default_encoder iterencoderwrite)objfpr r r r clsr rrrkwiterablechunkr2/opt/alt/python35/lib64/python3.5/json/__init__.pyrws-  $  c Ks| rd|rd|rd|rd|dkrd|dkrd|dkrd|dkrd| rd| rdtj|S|dkrvt}|d|d|d|d|d|d|d|d | | j|S) auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r r rrr)rencoder) rr r r r rr rrrrrrrrs,  $    object_hookobject_pairs_hookcKs7t|jd|d|d|d|d|d||S)a%Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. rr parse_float parse_intparse_constantr)rread)rrrrr r!rrrrrrs  c Ks:t|ts*tdj|jj|jdrKtd|d|dkr|dkr|dkr|dkr|dkr|dkr| rtj |S|dkrt }|dk r||d<|dk r||d<|dk r||d<|dk r||d <|dk r'||d <||j |S) aDeserialize ``s`` (a ``str`` instance containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. The ``encoding`` argument is ignored and deprecated. z%the JSON object must be str, not {!r}uz-Unexpected UTF-8 BOM (decode using utf-8-sig)Nrrrr r!) isinstancestr TypeErrorformat __class____name__ startswithr_default_decoderdecoder) sencodingrrrr r!rrrrrrs.'              )__doc__ __version____all__ __author__decoderrrencoderrrrrr+rrrrrras2    =  8  PK!%__pycache__/tool.cpython-35.opt-1.pycnu[ Yfm@sYdZddlZddlZddlZddlZddZedkrUedS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc #Cszd}d}tjd|d|}|jddddtjd d |jd dddtjd d d |jdddddd d|j}|jptj}|jptj }|j }|my4|rt j |}nt j |dt j}Wn1tk r7}zt|WYdd}~XnXWdQRX|.t j||d|dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.prog descriptioninfilenargs?typehelpz-a JSON file to be validated or pretty-printedoutfilewz%write the output of infile to outfilez --sort-keysaction store_truedefaultFz5sort the output of dictionaries alphabetically by keyZobject_pairs_hook sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$./opt/alt/python35/lib64/python3.5/json/tool.pymains0!   &r&__main__)__doc__rrrrr&__name__r$r$r$r% s      PK!1zext.rbnu[require 'json/common' module JSON # This module holds all the modules/classes that implement JSON's # functionality as C extensions. module Ext require 'json/ext/parser' require 'json/ext/generator' $DEBUG and warn "Using Ext extension for JSON." JSON.parser = Parser JSON.generator = Generator end JSON_LOADED = true unless defined?(::JSON::JSON_LOADED) end PK!1+Ǔ00add/date_time.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end require 'date' class DateTime # Deserializes JSON string by converting year y, month m, # day d, hour H, minute M, second S, # offset of and Day of Calendar Reform sg to DateTime. def self.json_create(object) args = object.values_at('y', 'm', 'd', 'H', 'M', 'S') of_a, of_b = object['of'].split('/') if of_b and of_b != '0' args << Rational(of_a.to_i, of_b.to_i) else args << of_a end args << object['sg'] civil(*args) end alias start sg unless method_defined?(:start) # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'y' => year, 'm' => month, 'd' => day, 'H' => hour, 'M' => min, 'S' => sec, 'of' => offset.to_s, 'sg' => start, } end # Stores class name (DateTime) with Julian year y, month m, # day d, hour H, minute M, second S, # offset of and Day of Calendar Reform sg as JSON string def to_json(*args) as_json.to_json(*args) end end PK!}VVadd/bigdecimal.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end defined?(::BigDecimal) or require 'bigdecimal' class BigDecimal # Import a JSON Marshalled object. # # method used for JSON marshalling support. def self.json_create(object) BigDecimal._load object['b'] end # Marshal the object to JSON. # # method used for JSON marshalling support. def as_json(*) { JSON.create_id => self.class.name, 'b' => _dump, } end # return the JSON value def to_json(*) as_json.to_json end end PK!Pmadd/complex.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end defined?(::Complex) or require 'complex' class Complex # Deserializes JSON string by converting Real value r, imaginary # value i, to a Complex object. def self.json_create(object) Complex(object['r'], object['i']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'r' => real, 'i' => imag, } end # Stores class name (Complex) along with real value r and imaginary value i as JSON string def to_json(*) as_json.to_json end end PK!% add/struct.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Struct # Deserializes JSON string by constructing new Struct object with values # v serialized by to_json. def self.json_create(object) new(*object['v']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) klass = self.class.name klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!" { JSON.create_id => klass, 'v' => values, } end # Stores class name (Struct) with Struct values v as a JSON string. # Only named structs are supported. def to_json(*args) as_json.to_json(*args) end end PK!}ȋ add/regexp.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Regexp # Deserializes JSON string by constructing new Regexp object with source # s (Regexp or String) and options o serialized by # to_json def self.json_create(object) new(object['s'], object['o']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'o' => options, 's' => source, } end # Stores class name (Regexp) with options o and source s # (Regexp or String) as JSON string def to_json(*) as_json.to_json end end PK!  add/rational.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end defined?(::Rational) or require 'rational' class Rational # Deserializes JSON string by converting numerator value n, # denominator value d, to a Rational object. def self.json_create(object) Rational(object['n'], object['d']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'n' => numerator, 'd' => denominator, } end # Stores class name (Rational) along with numerator value n and denominator value d as JSON string def to_json(*) as_json.to_json end end PK!&a\\ add/core.rbnu[#frozen_string_literal: false # This file requires the implementations of ruby core's custom objects for # serialisation/deserialisation. require 'json/add/date' require 'json/add/date_time' require 'json/add/exception' require 'json/add/range' require 'json/add/regexp' require 'json/add/struct' require 'json/add/symbol' require 'json/add/time' PK!"2add/ostruct.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end require 'ostruct' class OpenStruct # Deserializes JSON string by constructing new Struct object with values # t serialized by to_json. def self.json_create(object) new(object['t'] || object[:t]) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) klass = self.class.name klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!" { JSON.create_id => klass, 't' => table, } end # Stores class name (OpenStruct) with this struct's values v as a # JSON string. def to_json(*args) as_json.to_json(*args) end end PK!mqq add/date.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end require 'date' class Date # Deserializes JSON string by converting Julian year y, month # m, day d and Day of Calendar Reform sg to Date. def self.json_create(object) civil(*object.values_at('y', 'm', 'd', 'sg')) end alias start sg unless method_defined?(:start) # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'y' => year, 'm' => month, 'd' => day, 'sg' => start, } end # Stores class name (Date) with Julian year y, month m, day # d and Day of Calendar Reform sg as JSON string def to_json(*args) as_json.to_json(*args) end end PK!J add/time.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Time # Deserializes JSON string by converting time since epoch to Time def self.json_create(object) if usec = object.delete('u') # used to be tv_usec -> tv_nsec object['n'] = usec * 1000 end if method_defined?(:tv_nsec) at(object['s'], Rational(object['n'], 1000)) else at(object['s'], object['n'] / 1000) end end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) nanoseconds = [ tv_usec * 1000 ] respond_to?(:tv_nsec) and nanoseconds << tv_nsec nanoseconds = nanoseconds.max { JSON.create_id => self.class.name, 's' => tv_sec, 'n' => nanoseconds, } end # Stores class name (Time) with number of seconds since epoch and number of # microseconds for Time as JSON string def to_json(*args) as_json.to_json(*args) end end PK!kadd/exception.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Exception # Deserializes JSON string by constructing new Exception object with message # m and backtrace b serialized with to_json def self.json_create(object) result = new(object['m']) result.set_backtrace object['b'] result end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'm' => message, 'b' => backtrace, } end # Stores class name (Exception) with message m and backtrace array # b as JSON string def to_json(*args) as_json.to_json(*args) end end PK!a add/range.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Range # Deserializes JSON string by constructing new Range object with arguments # a serialized by to_json. def self.json_create(object) new(*object['a']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'a' => [ first, last, exclude_end? ] } end # Stores class name (Range) with JSON array of arguments a which # include first (integer), last (integer), and # exclude_end? (boolean) as JSON string. def to_json(*args) as_json.to_json(*args) end end PK!ff add/symbol.rbnu[#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end class Symbol # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 's' => to_s, } end # Stores class name (Symbol) with String representation of Symbol as a JSON string. def to_json(*a) as_json.to_json(*a) end # Deserializes JSON string by converting the string value stored in the object to a Symbol def self.json_create(o) o['s'].to_sym end end PK!E”generic_object.rbnu[#frozen_string_literal: false require 'ostruct' module JSON class GenericObject < OpenStruct class << self alias [] new def json_creatable? @json_creatable end attr_writer :json_creatable def json_create(data) data = data.dup data.delete JSON.create_id self[data] end def from_hash(object) case when object.respond_to?(:to_hash) result = new object.to_hash.each do |key, value| result[key] = from_hash(value) end result when object.respond_to?(:to_ary) object.to_ary.map { |a| from_hash(a) } else object end end def load(source, proc = nil, opts = {}) result = ::JSON.load(source, proc, opts.merge(:object_class => self)) result.nil? ? new : result end def dump(obj, *args) ::JSON.dump(obj, *args) end end self.json_creatable = false def to_hash table end def [](name) __send__(name) end unless method_defined?(:[]) def []=(name, value) __send__("#{name}=", value) end unless method_defined?(:[]=) def |(other) self.class[other.to_hash.merge(to_hash)] end def as_json(*) { JSON.create_id => self.class.name }.merge to_hash end def to_json(*a) as_json.to_json(*a) end end end PK!:oS;; common.rbnu[#frozen_string_literal: false require 'json/version' require 'json/generic_object' module JSON class << self # If _object_ is string-like, parse the string and return the parsed # result as a Ruby data structure. Otherwise generate a JSON text from the # Ruby data structure object and return it. # # The _opts_ argument is passed through to generate/parse respectively. # See generate and parse for their documentation. def [](object, opts = {}) if object.respond_to? :to_str JSON.parse(object.to_str, opts) else JSON.generate(object, opts) end end # Returns the JSON parser class that is used by JSON. This is either # JSON::Ext::Parser or JSON::Pure::Parser. attr_reader :parser # Set the JSON parser class _parser_ to be used by JSON. def parser=(parser) # :nodoc: @parser = parser remove_const :Parser if const_defined?(:Parser, false) const_set :Parser, parser end # Return the constant located at _path_. The format of _path_ has to be # either ::A::B::C or A::B::C. In any case, A has to be located at the top # level (absolute namespace path?). If there doesn't exist a constant at # the given path, an ArgumentError is raised. def deep_const_get(path) # :nodoc: path.to_s.split(/::/).inject(Object) do |p, c| case when c.empty? then p when p.const_defined?(c, true) then p.const_get(c) else begin p.const_missing(c) rescue NameError => e raise ArgumentError, "can't get const #{path}: #{e}" end end end end # Set the module _generator_ to be used by JSON. def generator=(generator) # :nodoc: old, $VERBOSE = $VERBOSE, nil @generator = generator generator_methods = generator::GeneratorMethods for const in generator_methods.constants klass = deep_const_get(const) modul = generator_methods.const_get(const) klass.class_eval do instance_methods(false).each do |m| m.to_s == 'to_json' and remove_method m end include modul end end self.state = generator::State const_set :State, self.state const_set :SAFE_STATE_PROTOTYPE, State.new const_set :FAST_STATE_PROTOTYPE, State.new( :indent => '', :space => '', :object_nl => "", :array_nl => "", :max_nesting => false ) const_set :PRETTY_STATE_PROTOTYPE, State.new( :indent => ' ', :space => ' ', :object_nl => "\n", :array_nl => "\n" ) ensure $VERBOSE = old end # Returns the JSON generator module that is used by JSON. This is # either JSON::Ext::Generator or JSON::Pure::Generator. attr_reader :generator # Returns the JSON generator state class that is used by JSON. This is # either JSON::Ext::Generator::State or JSON::Pure::Generator::State. attr_accessor :state # This is create identifier, which is used to decide if the _json_create_ # hook of a class should be called. It defaults to 'json_class'. attr_accessor :create_id end self.create_id = 'json_class' NaN = 0.0/0 Infinity = 1.0/0 MinusInfinity = -Infinity # The base exception for JSON errors. class JSONError < StandardError def self.wrap(exception) obj = new("Wrapped(#{exception.class}): #{exception.message.inspect}") obj.set_backtrace exception.backtrace obj end end # This exception is raised if a parser error occurs. class ParserError < JSONError; end # This exception is raised if the nesting of parsed data structures is too # deep. class NestingError < ParserError; end # :stopdoc: class CircularDatastructure < NestingError; end # :startdoc: # This exception is raised if a generator or unparser error occurs. class GeneratorError < JSONError; end # For backwards compatibility UnparserError = GeneratorError # This exception is raised if the required unicode support is missing on the # system. Usually this means that the iconv library is not installed. class MissingUnicodeSupport < JSONError; end module_function # Parse the JSON document _source_ into a Ruby data structure and return it. # # _opts_ can have the following # keys: # * *max_nesting*: The maximum depth of nesting allowed in the parsed data # structures. Disable depth checking with :max_nesting => false. It # defaults to 100. # * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in # defiance of RFC 7159 to be parsed by the Parser. This option defaults # to false. # * *symbolize_names*: If set to true, returns symbols for the names # (keys) in a JSON object. Otherwise strings are returned. Strings are # the default. # * *create_additions*: If set to false, the Parser doesn't create # additions even if a matching class and create_id was found. This option # defaults to false. # * *object_class*: Defaults to Hash # * *array_class*: Defaults to Array def parse(source, opts = {}) Parser.new(source, opts).parse end # Parse the JSON document _source_ into a Ruby data structure and return it. # The bang version of the parse method defaults to the more dangerous values # for the _opts_ hash, so be sure only to parse trusted _source_ documents. # # _opts_ can have the following keys: # * *max_nesting*: The maximum depth of nesting allowed in the parsed data # structures. Enable depth checking with :max_nesting => anInteger. The # parse! methods defaults to not doing max depth checking: This can be # dangerous if someone wants to fill up your stack. # * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in # defiance of RFC 7159 to be parsed by the Parser. This option defaults # to true. # * *create_additions*: If set to false, the Parser doesn't create # additions even if a matching class and create_id was found. This option # defaults to false. def parse!(source, opts = {}) opts = { :max_nesting => false, :allow_nan => true }.merge(opts) Parser.new(source, opts).parse end # Generate a JSON document from the Ruby data structure _obj_ and return # it. _state_ is * a JSON::State object, # * or a Hash like object (responding to to_hash), # * an object convertible into a hash by a to_h method, # that is used as or to configure a State object. # # It defaults to a state object, that creates the shortest possible JSON text # in one line, checks for circular data structures and doesn't allow NaN, # Infinity, and -Infinity. # # A _state_ hash can have the following keys: # * *indent*: a string used to indent levels (default: ''), # * *space*: a string that is put after, a : or , delimiter (default: ''), # * *space_before*: a string that is put before a : pair delimiter (default: ''), # * *object_nl*: a string that is put at the end of a JSON object (default: ''), # * *array_nl*: a string that is put at the end of a JSON array (default: ''), # * *allow_nan*: true if NaN, Infinity, and -Infinity should be # generated, otherwise an exception is thrown if these values are # encountered. This options defaults to false. # * *max_nesting*: The maximum depth of nesting allowed in the data # structures from which JSON is to be generated. Disable depth checking # with :max_nesting => false, it defaults to 100. # # See also the fast_generate for the fastest creation method with the least # amount of sanity checks, and the pretty_generate method for some # defaults for pretty output. def generate(obj, opts = nil) if State === opts state, opts = opts, nil else state = SAFE_STATE_PROTOTYPE.dup end if opts if opts.respond_to? :to_hash opts = opts.to_hash elsif opts.respond_to? :to_h opts = opts.to_h else raise TypeError, "can't convert #{opts.class} into Hash" end state = state.configure(opts) end state.generate(obj) end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and # later delete them. alias unparse generate module_function :unparse # :startdoc: # Generate a JSON document from the Ruby data structure _obj_ and return it. # This method disables the checks for circles in Ruby objects. # # *WARNING*: Be careful not to pass any Ruby data structures with circles as # _obj_ argument because this will cause JSON to go into an infinite loop. def fast_generate(obj, opts = nil) if State === opts state, opts = opts, nil else state = FAST_STATE_PROTOTYPE.dup end if opts if opts.respond_to? :to_hash opts = opts.to_hash elsif opts.respond_to? :to_h opts = opts.to_h else raise TypeError, "can't convert #{opts.class} into Hash" end state.configure(opts) end state.generate(obj) end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. alias fast_unparse fast_generate module_function :fast_unparse # :startdoc: # Generate a JSON document from the Ruby data structure _obj_ and return it. # The returned document is a prettier form of the document returned by # #unparse. # # The _opts_ argument can be used to configure the generator. See the # generate method for a more detailed explanation. def pretty_generate(obj, opts = nil) if State === opts state, opts = opts, nil else state = PRETTY_STATE_PROTOTYPE.dup end if opts if opts.respond_to? :to_hash opts = opts.to_hash elsif opts.respond_to? :to_h opts = opts.to_h else raise TypeError, "can't convert #{opts.class} into Hash" end state.configure(opts) end state.generate(obj) end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. alias pretty_unparse pretty_generate module_function :pretty_unparse # :startdoc: class << self # The global default options for the JSON.load method: # :max_nesting: false # :allow_nan: true # :allow_blank: true attr_accessor :load_default_options end self.load_default_options = { :max_nesting => false, :allow_nan => true, :allow_blank => true, :create_additions => true, } # Load a ruby data structure from a JSON _source_ and return it. A source can # either be a string-like object, an IO-like object, or an object responding # to the read method. If _proc_ was given, it will be called with any nested # Ruby object as an argument recursively in depth first order. To modify the # default options pass in the optional _options_ argument as well. # # BEWARE: This method is meant to serialise data from trusted user input, # like from your own database server or clients under your control, it could # be dangerous to allow untrusted users to pass JSON sources into it. The # default options for the parser can be changed via the load_default_options # method. # # This method is part of the implementation of the load/dump interface of # Marshal and YAML. def load(source, proc = nil, options = {}) opts = load_default_options.merge options if source.respond_to? :to_str source = source.to_str elsif source.respond_to? :to_io source = source.to_io.read elsif source.respond_to?(:read) source = source.read end if opts[:allow_blank] && (source.nil? || source.empty?) source = 'null' end result = parse(source, opts) recurse_proc(result, &proc) if proc result end # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ def recurse_proc(result, &proc) case result when Array result.each { |x| recurse_proc x, &proc } proc.call result when Hash result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc } proc.call result else proc.call result end end alias restore load module_function :restore class << self # The global default options for the JSON.dump method: # :max_nesting: false # :allow_nan: true # :allow_blank: true attr_accessor :dump_default_options end self.dump_default_options = { :max_nesting => false, :allow_nan => true, } # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns # the result. # # If anIO (an IO-like object or an object that responds to the write method) # was given, the resulting JSON is written to it. # # If the number of nested arrays or objects exceeds _limit_, an ArgumentError # exception is raised. This argument is similar (but not exactly the # same!) to the _limit_ argument in Marshal.dump. # # The default options for the generator can be changed via the # dump_default_options method. # # This method is part of the implementation of the load/dump interface of # Marshal and YAML. def dump(obj, anIO = nil, limit = nil) if anIO and limit.nil? anIO = anIO.to_io if anIO.respond_to?(:to_io) unless anIO.respond_to?(:write) limit = anIO anIO = nil end end opts = JSON.dump_default_options opts = opts.merge(:max_nesting => limit) if limit result = generate(obj, opts) if anIO anIO.write result anIO else result end rescue JSON::NestingError raise ArgumentError, "exceed depth limit" end # Encodes string using Ruby's _String.encode_ def self.iconv(to, from, string) string.encode(to, from) end end module ::Kernel private # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in # one line. def j(*objs) objs.each do |obj| puts JSON::generate(obj, :allow_nan => true, :max_nesting => false) end nil end # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with # indentation and over many lines. def jj(*objs) objs.each do |obj| puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false) end nil end # If _object_ is string-like, parse the string and return the parsed result as # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data # structure object and return it. # # The _opts_ argument is passed through to generate/parse respectively. See # generate and parse for their documentation. def JSON(object, *args) if object.respond_to? :to_str JSON.parse(object.to_str, args.first) else JSON.generate(object, args.first) end end end # Extends any Class to include _json_creatable?_ method. class ::Class # Returns true if this class can be used to create an instance # from a serialised JSON string. The class has to implement a class # method _json_create_ that expects a hash as first parameter. The hash # should include the required data. def json_creatable? respond_to?(:json_create) end end PK!0.. version.rbnu[# frozen_string_literal: false module JSON # JSON version VERSION = '2.0.4' VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc: VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc: VERSION_MINOR = VERSION_ARRAY[1] # :nodoc: VERSION_BUILD = VERSION_ARRAY[2] # :nodoc: end PK!u֋o o php_json_scanner.hnu[/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ */ #ifndef PHP_JSON_SCANNER_H #define PHP_JSON_SCANNER_H #include "php.h" #include "php_json.h" typedef unsigned char php_json_ctype; typedef struct _php_json_scanner { php_json_ctype *cursor; /* cursor position */ php_json_ctype *token; /* token position */ php_json_ctype *limit; /* the last read character + 1 position */ php_json_ctype *marker; /* marker position for backtracking */ php_json_ctype *ctxmarker; /* marker position for context backtracking */ php_json_ctype *str_start; /* start position of the string */ php_json_ctype *pstr; /* string pointer for escapes conversion */ zval value; /* value */ int str_esc; /* number of extra characters for escaping */ int state; /* condition state */ int options; /* options */ php_json_error_code errcode; /* error type if there is an error */ int utf8_invalid; /* whether utf8 is invalid */ int utf8_invalid_count; /* number of extra character for invalid utf8 */ } php_json_scanner; void php_json_scanner_init(php_json_scanner *scanner, char *str, size_t str_len, int options); int php_json_scan(php_json_scanner *s); #endif /* PHP_JSON_SCANNER_H */ PK!͚ php_json.hnu[/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2017 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Omar Kilani | | Jakub Zelenka | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_JSON_H #define PHP_JSON_H #define PHP_JSON_VERSION "1.4.0" #include "zend_smart_str_public.h" extern zend_module_entry json_module_entry; #define phpext_json_ptr &json_module_entry #if defined(PHP_WIN32) && defined(JSON_EXPORTS) #define PHP_JSON_API __declspec(dllexport) #else #define PHP_JSON_API PHPAPI #endif #ifdef ZTS #include "TSRM.h" #endif extern PHP_JSON_API zend_class_entry *php_json_serializable_ce; /* error codes */ typedef enum { PHP_JSON_ERROR_NONE = 0, PHP_JSON_ERROR_DEPTH, PHP_JSON_ERROR_STATE_MISMATCH, PHP_JSON_ERROR_CTRL_CHAR, PHP_JSON_ERROR_SYNTAX, PHP_JSON_ERROR_UTF8, PHP_JSON_ERROR_RECURSION, PHP_JSON_ERROR_INF_OR_NAN, PHP_JSON_ERROR_UNSUPPORTED_TYPE, PHP_JSON_ERROR_INVALID_PROPERTY_NAME, PHP_JSON_ERROR_UTF16 } php_json_error_code; /* json_encode() options */ #define PHP_JSON_HEX_TAG (1<<0) #define PHP_JSON_HEX_AMP (1<<1) #define PHP_JSON_HEX_APOS (1<<2) #define PHP_JSON_HEX_QUOT (1<<3) #define PHP_JSON_FORCE_OBJECT (1<<4) #define PHP_JSON_NUMERIC_CHECK (1<<5) #define PHP_JSON_UNESCAPED_SLASHES (1<<6) #define PHP_JSON_PRETTY_PRINT (1<<7) #define PHP_JSON_UNESCAPED_UNICODE (1<<8) #define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) #define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10) /* json_decode() options */ #define PHP_JSON_OBJECT_AS_ARRAY (1<<0) #define PHP_JSON_BIGINT_AS_STRING (1<<1) /* Internal flags */ #define PHP_JSON_OUTPUT_ARRAY 0 #define PHP_JSON_OUTPUT_OBJECT 1 /* default depth */ #define PHP_JSON_PARSER_DEFAULT_DEPTH 512 ZEND_BEGIN_MODULE_GLOBALS(json) int encoder_depth; int encode_max_depth; php_json_error_code error_code; ZEND_END_MODULE_GLOBALS(json) PHP_JSON_API ZEND_EXTERN_MODULE_GLOBALS(json) #define JSON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(json, v) #if defined(ZTS) && defined(COMPILE_DL_JSON) ZEND_TSRMLS_CACHE_EXTERN() #endif PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options); PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth); static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth) { php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth); } #endif /* PHP_JSON_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!> php_json_parser.hnu[/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ */ #ifndef PHP_JSON_PARSER_H #define PHP_JSON_PARSER_H #include "php.h" #include "php_json_scanner.h" typedef struct _php_json_parser php_json_parser; typedef int (*php_json_parser_func_array_create_t)( php_json_parser *parser, zval *array); typedef int (*php_json_parser_func_array_append_t)( php_json_parser *parser, zval *array, zval *zvalue); typedef int (*php_json_parser_func_array_start_t)( php_json_parser *parser); typedef int (*php_json_parser_func_array_end_t)( php_json_parser *parser, zval *object); typedef int (*php_json_parser_func_object_create_t)( php_json_parser *parser, zval *object); typedef int (*php_json_parser_func_object_update_t)( php_json_parser *parser, zval *object, zend_string *key, zval *zvalue); typedef int (*php_json_parser_func_object_start_t)( php_json_parser *parser); typedef int (*php_json_parser_func_object_end_t)( php_json_parser *parser, zval *object); typedef struct _php_json_parser_methods { php_json_parser_func_array_create_t array_create; php_json_parser_func_array_append_t array_append; php_json_parser_func_array_start_t array_start; php_json_parser_func_array_end_t array_end; php_json_parser_func_object_create_t object_create; php_json_parser_func_object_update_t object_update; php_json_parser_func_object_start_t object_start; php_json_parser_func_object_end_t object_end; } php_json_parser_methods; struct _php_json_parser { php_json_scanner scanner; zval *return_value; int depth; int max_depth; php_json_parser_methods methods; }; PHP_JSON_API void php_json_parser_init_ex( php_json_parser *parser, zval *return_value, char *str, size_t str_len, int options, int max_depth, const php_json_parser_methods *methods); PHP_JSON_API void php_json_parser_init( php_json_parser *parser, zval *return_value, char *str, size_t str_len, int options, int max_depth); PHP_JSON_API php_json_error_code php_json_parser_error_code(const php_json_parser *parser); PHP_JSON_API int php_json_parse(php_json_parser *parser); int php_json_yyparse(php_json_parser *parser); #endif /* PHP_JSON_PARSER_H */ PK!?OGGtree_builder.rbnu[require 'psych/json/yaml_events' module Psych module JSON ### # Psych::JSON::TreeBuilder is an event based AST builder. Events are sent # to an instance of Psych::JSON::TreeBuilder and a JSON AST is constructed. class TreeBuilder < Psych::TreeBuilder include Psych::JSON::YAMLEvents end end end PK!@Eyaml_events.rbnu[module Psych module JSON module YAMLEvents # :nodoc: def start_document version, tag_directives, implicit super(version, tag_directives, !streaming?) end def end_document implicit_end = !streaming? super(implicit_end) end def start_mapping anchor, tag, implicit, style super(anchor, nil, true, Nodes::Mapping::FLOW) end def start_sequence anchor, tag, implicit, style super(anchor, nil, true, Nodes::Sequence::FLOW) end def scalar value, anchor, tag, plain, quoted, style if "tag:yaml.org,2002:null" == tag super('null', nil, nil, true, false, Nodes::Scalar::PLAIN) else super end end end end end PK!|ruby_events.rbnu[module Psych module JSON module RubyEvents # :nodoc: def visit_Time o formatted = format_time o @emitter.scalar formatted, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED end def visit_DateTime o visit_Time o.to_time end def visit_String o @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED end alias :visit_Symbol :visit_String end end end PK!p6xx stream.rbnu[require 'psych/json/ruby_events' require 'psych/json/yaml_events' module Psych module JSON class Stream < Psych::Visitors::JSONTree include Psych::JSON::RubyEvents include Psych::Streaming extend Psych::Streaming::ClassMethods class Emitter < Psych::Stream::Emitter # :nodoc: include Psych::JSON::YAMLEvents end end end end PK!igFcc JSON_parser.hnu[/* JSON_parser.h */ #ifndef JSON_PARSER_H #define JSON_PARSER_H #include "php.h" #include "ext/standard/php_smart_str.h" #include "php_json.h" #define JSON_PARSER_DEFAULT_DEPTH 512 typedef struct JSON_parser_struct { int state; int depth; int top; int error_code; int* stack; zval **the_zstack; zval *the_static_zstack[JSON_PARSER_DEFAULT_DEPTH]; } * JSON_parser; enum error_codes { PHP_JSON_ERROR_NONE = 0, PHP_JSON_ERROR_DEPTH, PHP_JSON_ERROR_STATE_MISMATCH, PHP_JSON_ERROR_CTRL_CHAR, PHP_JSON_ERROR_SYNTAX, PHP_JSON_ERROR_UTF8, PHP_JSON_ERROR_RECURSION, PHP_JSON_ERROR_INF_OR_NAN, PHP_JSON_ERROR_UNSUPPORTED_TYPE }; extern JSON_parser new_JSON_parser(int depth); extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC); extern int free_JSON_parser(JSON_parser jp); static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC) { return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC); } #endif PK!V`` JSON_parser.cnu[/* JSON_parser.c */ /* 2005-12-30 */ /* Copyright (c) 2005 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "JSON_parser.h" /* Windows defines IN for documentation */ #undef IN #define true 1 #define false 0 #define __ -1 /* the universal error code */ /* Characters are mapped into these 31 character classes. This allows for a significant reduction in the size of the state transition table. */ enum classes { C_SPACE, /* space */ C_WHITE, /* other whitespace */ C_LCURB, /* { */ C_RCURB, /* } */ C_LSQRB, /* [ */ C_RSQRB, /* ] */ C_COLON, /* : */ C_COMMA, /* , */ C_QUOTE, /* " */ C_BACKS, /* \ */ C_SLASH, /* / */ C_PLUS, /* + */ C_MINUS, /* - */ C_POINT, /* . */ C_ZERO , /* 0 */ C_DIGIT, /* 123456789 */ C_LOW_A, /* a */ C_LOW_B, /* b */ C_LOW_C, /* c */ C_LOW_D, /* d */ C_LOW_E, /* e */ C_LOW_F, /* f */ C_LOW_L, /* l */ C_LOW_N, /* n */ C_LOW_R, /* r */ C_LOW_S, /* s */ C_LOW_T, /* t */ C_LOW_U, /* u */ C_ABCDF, /* ABCDF */ C_E, /* E */ C_ETC, /* everything else */ NR_CLASSES }; static const int ascii_class[128] = { /* This array maps the 128 ASCII characters into character classes. The remaining Unicode characters should be mapped to C_ETC. Non-whitespace control characters are errors. */ __, __, __, __, __, __, __, __, __, C_WHITE, C_WHITE, __, __, C_WHITE, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, C_SPACE, C_ETC, C_QUOTE, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_PLUS, C_COMMA, C_MINUS, C_POINT, C_SLASH, C_ZERO, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_COLON, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ABCDF, C_ABCDF, C_ABCDF, C_ABCDF, C_E, C_ABCDF, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_LSQRB, C_BACKS, C_RSQRB, C_ETC, C_ETC, C_ETC, C_LOW_A, C_LOW_B, C_LOW_C, C_LOW_D, C_LOW_E, C_LOW_F, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_LOW_L, C_ETC, C_LOW_N, C_ETC, C_ETC, C_ETC, C_LOW_R, C_LOW_S, C_LOW_T, C_LOW_U, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_LCURB, C_ETC, C_RCURB, C_ETC, C_ETC }; /* The state codes. */ enum states { GO, /* start */ OK, /* ok */ OB, /* object */ KE, /* key */ CO, /* colon */ VA, /* value */ AR, /* array */ ST, /* string */ ES, /* escape */ U1, /* u1 */ U2, /* u2 */ U3, /* u3 */ U4, /* u4 */ MI, /* minus */ ZE, /* zero */ IN, /* integer */ FR, /* fraction */ E1, /* e */ E2, /* ex */ E3, /* exp */ T1, /* tr */ T2, /* tru */ T3, /* true */ F1, /* fa */ F2, /* fal */ F3, /* fals */ F4, /* false */ N1, /* nu */ N2, /* nul */ N3, /* null */ NR_STATES }; static const int state_transition_table[NR_STATES][NR_CLASSES] = { /* The state transition table takes the current state and the current symbol, and returns either a new state or an action. An action is represented as a negative number. A JSON text is accepted if at the end of the text the state is OK and if the mode is MODE_DONE. white 1-9 ABCDF etc space | { } [ ] : , " \ / + - . 0 | a b c d e f l n r s t u | E |*/ /*start GO*/ {GO,GO,-6,__,-5,__,__,__,ST,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*ok OK*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*object OB*/ {OB,OB,__,-9,__,__,__,__,ST,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*key KE*/ {KE,KE,__,__,__,__,__,__,ST,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*colon CO*/ {CO,CO,__,__,__,__,-2,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*value VA*/ {VA,VA,-6,__,-5,__,__,__,ST,__,__,__,MI,__,ZE,IN,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__}, /*array AR*/ {AR,AR,-6,__,-5,-7,__,__,ST,__,__,__,MI,__,ZE,IN,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__}, /*string ST*/ {ST,__,ST,ST,ST,ST,ST,ST,-4,ES,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST}, /*escape ES*/ {__,__,__,__,__,__,__,__,ST,ST,ST,__,__,__,__,__,__,ST,__,__,__,ST,__,ST,ST,__,ST,U1,__,__,__}, /*u1 U1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U2,U2,U2,U2,U2,U2,U2,U2,__,__,__,__,__,__,U2,U2,__}, /*u2 U2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U3,U3,U3,U3,U3,U3,U3,U3,__,__,__,__,__,__,U3,U3,__}, /*u3 U3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U4,U4,U4,U4,U4,U4,U4,U4,__,__,__,__,__,__,U4,U4,__}, /*u4 U4*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,ST,ST,ST,ST,ST,ST,ST,ST,__,__,__,__,__,__,ST,ST,__}, /*minus MI*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,ZE,IN,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*zero ZE*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,FR,__,__,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__}, /*int IN*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,FR,IN,IN,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__}, /*frac FR*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,FR,FR,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__}, /*e E1*/ {__,__,__,__,__,__,__,__,__,__,__,E2,E2,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*ex E2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*exp E3*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*tr T1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T2,__,__,__,__,__,__}, /*tru T2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T3,__,__,__}, /*true T3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__,__,__}, /*fa F1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F2,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, /*fal F2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F3,__,__,__,__,__,__,__,__}, /*fals F3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F4,__,__,__,__,__}, /*false F4*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__,__,__}, /*nu N1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N2,__,__,__}, /*nul N2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N3,__,__,__,__,__,__,__,__}, /*null N3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__}, }; /* These modes can be pushed on the stack. */ enum modes { MODE_ARRAY, MODE_DONE, MODE_KEY, MODE_OBJECT, }; /* Push a mode onto the stack. Return false if there is overflow. */ static int push(JSON_parser jp, int mode) { jp->top += 1; if (jp->top >= jp->depth) { jp->error_code = PHP_JSON_ERROR_DEPTH; return false; } jp->stack[jp->top] = mode; return true; } /* Pop the stack, assuring that the current mode matches the expectation. Return false if there is underflow or if the modes mismatch. */ static int pop(JSON_parser jp, int mode) { if (jp->top < 0 || jp->stack[jp->top] != mode) { jp->error_code = PHP_JSON_ERROR_STATE_MISMATCH; return false; } jp->top -= 1; return true; } /* new_JSON_checker starts the checking process by constructing a JSON_checker object. It takes a depth parameter that restricts the level of maximum nesting. To continue the process, call JSON_checker_char for each character in the JSON text, and then call JSON_checker_done to obtain the final result. These functions are fully reentrant. The JSON_checker object will be deleted by JSON_checker_done. JSON_checker_char will delete the JSON_checker object if it sees an error. */ JSON_parser new_JSON_parser(int depth) { JSON_parser jp = (JSON_parser)emalloc(sizeof(struct JSON_parser_struct)); jp->state = GO; jp->depth = depth; jp->top = -1; jp->error_code = PHP_JSON_ERROR_NONE; jp->stack = (int*)ecalloc(depth, sizeof(int)); if (depth > JSON_PARSER_DEFAULT_DEPTH) { jp->the_zstack = (zval **)safe_emalloc(depth, sizeof(zval), 0); } else { jp->the_zstack = &jp->the_static_zstack[0]; } push(jp, MODE_DONE); return jp; } /* Delete the JSON_parser object. */ int free_JSON_parser(JSON_parser jp) { efree((void*)jp->stack); if (jp->the_zstack != &jp->the_static_zstack[0]) { efree(jp->the_zstack); } efree((void*)jp); return false; } static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } else if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } else if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } else { return -1; } } static void json_create_zval(zval **z, smart_str *buf, int type, int options) { ALLOC_INIT_ZVAL(*z); if (type == IS_LONG) { zend_bool bigint = 0; if (buf->c[0] == '-') { buf->len--; } if (buf->len >= MAX_LENGTH_OF_LONG - 1) { if (buf->len == MAX_LENGTH_OF_LONG - 1) { int cmp = strcmp(buf->c + (buf->c[0] == '-'), long_min_digits); if (!(cmp < 0 || (cmp == 0 && buf->c[0] == '-'))) { bigint = 1; } } else { bigint = 1; } } if (bigint) { /* value too large to represent as a long */ if (options & PHP_JSON_BIGINT_AS_STRING) { if (buf->c[0] == '-') { /* Restore last char consumed above */ buf->len++; } goto use_string; } else { goto use_double; } } ZVAL_LONG(*z, strtol(buf->c, NULL, 10)); } else if (type == IS_DOUBLE) { use_double: ZVAL_DOUBLE(*z, zend_strtod(buf->c, NULL)); } else if (type == IS_STRING) { use_string: ZVAL_STRINGL(*z, buf->c, buf->len, 1); } else if (type == IS_BOOL) { ZVAL_BOOL(*z, (*(buf->c) == 't')); } else /* type == IS_NULL) || type unknown */ { ZVAL_NULL(*z); } } static void utf16_to_utf8(smart_str *buf, unsigned short utf16) { if (utf16 < 0x80) { smart_str_appendc(buf, (unsigned char) utf16); } else if (utf16 < 0x800) { smart_str_appendc(buf, 0xc0 | (utf16 >> 6)); smart_str_appendc(buf, 0x80 | (utf16 & 0x3f)); } else if ((utf16 & 0xfc00) == 0xdc00 && buf->len >= 3 && ((unsigned char) buf->c[buf->len - 3]) == 0xed && ((unsigned char) buf->c[buf->len - 2] & 0xf0) == 0xa0 && ((unsigned char) buf->c[buf->len - 1] & 0xc0) == 0x80) { /* found surrogate pair */ unsigned long utf32; utf32 = (((buf->c[buf->len - 2] & 0xf) << 16) | ((buf->c[buf->len - 1] & 0x3f) << 10) | (utf16 & 0x3ff)) + 0x10000; buf->len -= 3; smart_str_appendc(buf, (unsigned char) (0xf0 | (utf32 >> 18))); smart_str_appendc(buf, 0x80 | ((utf32 >> 12) & 0x3f)); smart_str_appendc(buf, 0x80 | ((utf32 >> 6) & 0x3f)); smart_str_appendc(buf, 0x80 | (utf32 & 0x3f)); } else { smart_str_appendc(buf, 0xe0 | (utf16 >> 12)); smart_str_appendc(buf, 0x80 | ((utf16 >> 6) & 0x3f)); smart_str_appendc(buf, 0x80 | (utf16 & 0x3f)); } } static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int assoc TSRMLS_DC) { zval *root = jp->the_zstack[up]; zval *child = jp->the_zstack[cur]; int up_mode = jp->stack[up]; if (up_mode == MODE_ARRAY) { add_next_index_zval(root, child); } else if (up_mode == MODE_OBJECT) { if (!assoc) { add_property_zval_ex(root, (key->len ? key->c : "_empty_"), (key->len ? (key->len + 1) : sizeof("_empty_")), child TSRMLS_CC); Z_DELREF_P(child); } else { add_assoc_zval_ex(root, (key->len ? key->c : ""), (key->len ? (key->len + 1) : sizeof("")), child); } key->len = 0; } } #define FREE_BUFFERS() smart_str_free(&buf); smart_str_free(&key); #define SWAP_BUFFERS(from, to) do { \ char *t1 = from.c; \ int t2 = from.a; \ from.c = to.c; \ from.a = to.a; \ to.c = t1; \ to.a = t2; \ to.len = from.len; \ from.len = 0; \ } while(0); #define JSON_RESET_TYPE() type = -1; /* The JSON_parser takes a UTF-16 encoded string and determines if it is a syntactically correct JSON text. Along the way, it creates a PHP variable. It is implemented as a Pushdown Automaton; that means it is a finite state machine with a stack. */ int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC) { int next_char; /* the next character */ int next_class; /* the next character class */ int next_state; /* the next state */ int the_index; int assoc = options & PHP_JSON_OBJECT_AS_ARRAY; smart_str buf = {0}; smart_str key = {0}; unsigned short utf16 = 0; int type; JSON_RESET_TYPE(); for (the_index = 0; the_index < length; the_index += 1) { next_char = utf16_json[the_index]; if (next_char >= 128) { next_class = C_ETC; } else { next_class = ascii_class[next_char]; if (next_class <= __) { jp->error_code = PHP_JSON_ERROR_CTRL_CHAR; FREE_BUFFERS(); return false; } } /* Get the next state from the transition table. */ next_state = state_transition_table[jp->state][next_class]; if (next_state >= 0) { /* Change the state and iterate */ if (type == IS_STRING) { if (next_state == ST && jp->state != U4) { if (jp->state != ES) { utf16_to_utf8(&buf, next_char); } else { switch (next_char) { case 'b': smart_str_appendc(&buf, '\b'); break; case 't': smart_str_appendc(&buf, '\t'); break; case 'n': smart_str_appendc(&buf, '\n'); break; case 'f': smart_str_appendc(&buf, '\f'); break; case 'r': smart_str_appendc(&buf, '\r'); break; default: utf16_to_utf8(&buf, next_char); break; } } } else if (next_state == U2) { utf16 = dehexchar(next_char) << 12; } else if (next_state == U3) { utf16 += dehexchar(next_char) << 8; } else if (next_state == U4) { utf16 += dehexchar(next_char) << 4; } else if (next_state == ST && jp->state == U4) { utf16 += dehexchar(next_char); utf16_to_utf8(&buf, utf16); } } else if (type < IS_LONG && (next_class == C_DIGIT || next_class == C_ZERO)) { type = IS_LONG; smart_str_appendc(&buf, next_char); } else if (type == IS_LONG && next_state == E1) { type = IS_DOUBLE; smart_str_appendc(&buf, next_char); } else if (type < IS_DOUBLE && next_class == C_POINT) { type = IS_DOUBLE; smart_str_appendc(&buf, next_char); } else if (type < IS_STRING && next_class == C_QUOTE) { type = IS_STRING; } else if (type < IS_BOOL && ((jp->state == T3 && next_state == OK) || (jp->state == F4 && next_state == OK))) { type = IS_BOOL; } else if (type < IS_NULL && jp->state == N3 && next_state == OK) { type = IS_NULL; } else if (type != IS_STRING && next_class > C_WHITE) { utf16_to_utf8(&buf, next_char); } jp->state = next_state; } else { /* Perform one of the predefined actions. */ switch (next_state) { /* empty } */ case -9: if (!pop(jp, MODE_KEY)) { FREE_BUFFERS(); return false; } jp->state = OK; break; /* } */ case -8: if (type != -1 && jp->stack[jp->top] == MODE_OBJECT) { zval *mval; smart_str_0(&buf); json_create_zval(&mval, &buf, type, options); if (!assoc) { add_property_zval_ex(jp->the_zstack[jp->top], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC); Z_DELREF_P(mval); } else { add_assoc_zval_ex(jp->the_zstack[jp->top], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval); } key.len = 0; buf.len = 0; JSON_RESET_TYPE(); } if (!pop(jp, MODE_OBJECT)) { FREE_BUFFERS(); return false; } jp->state = OK; break; /* ] */ case -7: { if (type != -1 && jp->stack[jp->top] == MODE_ARRAY) { zval *mval; smart_str_0(&buf); json_create_zval(&mval, &buf, type, options); add_next_index_zval(jp->the_zstack[jp->top], mval); buf.len = 0; JSON_RESET_TYPE(); } if (!pop(jp, MODE_ARRAY)) { FREE_BUFFERS(); return false; } jp->state = OK; } break; /* { */ case -6: if (!push(jp, MODE_KEY)) { FREE_BUFFERS(); return false; } jp->state = OB; if (jp->top > 0) { zval *obj; if (jp->top == 1) { obj = z; } else { ALLOC_INIT_ZVAL(obj); } if (!assoc) { object_init(obj); } else { array_init(obj); } jp->the_zstack[jp->top] = obj; if (jp->top > 1) { attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC); } JSON_RESET_TYPE(); } break; /* [ */ case -5: if (!push(jp, MODE_ARRAY)) { FREE_BUFFERS(); return false; } jp->state = AR; if (jp->top > 0) { zval *arr; if (jp->top == 1) { arr = z; } else { ALLOC_INIT_ZVAL(arr); } array_init(arr); jp->the_zstack[jp->top] = arr; if (jp->top > 1) { attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC); } JSON_RESET_TYPE(); } break; /* " */ case -4: switch (jp->stack[jp->top]) { case MODE_KEY: jp->state = CO; smart_str_0(&buf); SWAP_BUFFERS(buf, key); JSON_RESET_TYPE(); break; case MODE_ARRAY: case MODE_OBJECT: jp->state = OK; break; case MODE_DONE: if (type == IS_STRING) { smart_str_0(&buf); ZVAL_STRINGL(z, buf.c, buf.len, 1); jp->state = OK; break; } /* fall through if not IS_STRING */ default: FREE_BUFFERS(); jp->error_code = PHP_JSON_ERROR_SYNTAX; return false; } break; /* , */ case -3: { zval *mval; if (type != -1 && (jp->stack[jp->top] == MODE_OBJECT || jp->stack[jp->top] == MODE_ARRAY)) { smart_str_0(&buf); json_create_zval(&mval, &buf, type, options); } switch (jp->stack[jp->top]) { case MODE_OBJECT: if (pop(jp, MODE_OBJECT) && push(jp, MODE_KEY)) { if (type != -1) { if (!assoc) { add_property_zval_ex(jp->the_zstack[jp->top], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC); Z_DELREF_P(mval); } else { add_assoc_zval_ex(jp->the_zstack[jp->top], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval); } key.len = 0; } jp->state = KE; } break; case MODE_ARRAY: if (type != -1) { add_next_index_zval(jp->the_zstack[jp->top], mval); } jp->state = VA; break; default: FREE_BUFFERS(); jp->error_code = PHP_JSON_ERROR_SYNTAX; return false; } buf.len = 0; JSON_RESET_TYPE(); } break; /* : */ case -2: if (pop(jp, MODE_KEY) && push(jp, MODE_OBJECT)) { jp->state = VA; break; } /* syntax error */ default: { jp->error_code = PHP_JSON_ERROR_SYNTAX; FREE_BUFFERS(); return false; } } } } FREE_BUFFERS(); if (jp->state == OK && pop(jp, MODE_DONE)) { return true; } jp->error_code = PHP_JSON_ERROR_SYNTAX; return false; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 * vim<600: noet sw=4 ts=4 */ PK!Xm^m^json.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Omar Kilani | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/html.h" #include "ext/standard/php_smart_str.h" #include "JSON_parser.h" #include "php_json.h" #include #include #if defined(DBL_MANT_DIG) && defined(DBL_MIN_EXP) #define NUM_BUF_SIZE (3 + DBL_MANT_DIG - DBL_MIN_EXP) #else #define NUM_BUF_SIZE 1080 #endif static PHP_MINFO_FUNCTION(json); static PHP_FUNCTION(json_encode); static PHP_FUNCTION(json_decode); static PHP_FUNCTION(json_last_error); static PHP_FUNCTION(json_last_error_msg); static const char digits[] = "0123456789abcdef"; PHP_JSON_API zend_class_entry *php_json_serializable_ce; ZEND_DECLARE_MODULE_GLOBALS(json) /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_json_encode, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, depth) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_json_decode, 0, 0, 1) ZEND_ARG_INFO(0, json) ZEND_ARG_INFO(0, assoc) ZEND_ARG_INFO(0, depth) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_json_last_error, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_json_last_error_msg, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ json_functions[] */ static const zend_function_entry json_functions[] = { PHP_FE(json_encode, arginfo_json_encode) PHP_FE(json_decode, arginfo_json_decode) PHP_FE(json_last_error, arginfo_json_last_error) PHP_FE(json_last_error_msg, arginfo_json_last_error_msg) PHP_FE_END }; /* }}} */ /* {{{ JsonSerializable methods */ ZEND_BEGIN_ARG_INFO(json_serialize_arginfo, 0) /* No arguments */ ZEND_END_ARG_INFO(); static const zend_function_entry json_serializable_interface[] = { PHP_ABSTRACT_ME(JsonSerializable, jsonSerialize, json_serialize_arginfo) PHP_FE_END }; /* }}} */ /* {{{ MINIT */ static PHP_MINIT_FUNCTION(json) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "JsonSerializable", json_serializable_interface); php_json_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC); REGISTER_LONG_CONSTANT("JSON_HEX_TAG", PHP_JSON_HEX_TAG, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_HEX_AMP", PHP_JSON_HEX_AMP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_HEX_APOS", PHP_JSON_HEX_APOS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_HEX_QUOT", PHP_JSON_HEX_QUOT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_FORCE_OBJECT", PHP_JSON_FORCE_OBJECT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_NUMERIC_CHECK", PHP_JSON_NUMERIC_CHECK, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_UNESCAPED_SLASHES", PHP_JSON_UNESCAPED_SLASHES, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_PRETTY_PRINT", PHP_JSON_PRETTY_PRINT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_UNESCAPED_UNICODE", PHP_JSON_UNESCAPED_UNICODE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_PARTIAL_OUTPUT_ON_ERROR", PHP_JSON_PARTIAL_OUTPUT_ON_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_PRESERVE_ZERO_FRACTION", PHP_JSON_PRESERVE_ZERO_FRACTION, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_STATE_MISMATCH", PHP_JSON_ERROR_STATE_MISMATCH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_CTRL_CHAR", PHP_JSON_ERROR_CTRL_CHAR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_SYNTAX", PHP_JSON_ERROR_SYNTAX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_UTF8", PHP_JSON_ERROR_UTF8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_RECURSION", PHP_JSON_ERROR_RECURSION, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_INF_OR_NAN", PHP_JSON_ERROR_INF_OR_NAN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_UNSUPPORTED_TYPE", PHP_JSON_ERROR_UNSUPPORTED_TYPE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_OBJECT_AS_ARRAY", PHP_JSON_OBJECT_AS_ARRAY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_BIGINT_AS_STRING", PHP_JSON_BIGINT_AS_STRING, CONST_CS | CONST_PERSISTENT); return SUCCESS; } /* }}} */ /* {{{ PHP_GINIT_FUNCTION */ static PHP_GINIT_FUNCTION(json) { json_globals->encoder_depth = 0; json_globals->error_code = 0; json_globals->encode_max_depth = 0; } /* }}} */ /* {{{ json_module_entry */ zend_module_entry json_module_entry = { STANDARD_MODULE_HEADER, "json", json_functions, PHP_MINIT(json), NULL, NULL, NULL, PHP_MINFO(json), PHP_JSON_VERSION, PHP_MODULE_GLOBALS(json), PHP_GINIT(json), NULL, NULL, STANDARD_MODULE_PROPERTIES_EX }; /* }}} */ #ifdef COMPILE_DL_JSON ZEND_GET_MODULE(json) #endif /* {{{ PHP_MINFO_FUNCTION */ static PHP_MINFO_FUNCTION(json) { php_info_print_table_start(); php_info_print_table_row(2, "json support", "enabled"); php_info_print_table_row(2, "json version", PHP_JSON_VERSION); php_info_print_table_end(); } /* }}} */ static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC); static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ { int i; HashTable *myht = HASH_OF(*val); i = myht ? zend_hash_num_elements(myht) : 0; if (i > 0) { char *key; ulong index, idx; uint key_len; HashPosition pos; zend_hash_internal_pointer_reset_ex(myht, &pos); idx = 0; for (;; zend_hash_move_forward_ex(myht, &pos)) { i = zend_hash_get_current_key_ex(myht, &key, &key_len, &index, 0, &pos); if (i == HASH_KEY_NON_EXISTENT) { break; } if (i == HASH_KEY_IS_STRING) { return 1; } else { if (index != idx) { return 1; } } idx++; } } return PHP_JSON_OUTPUT_ARRAY; } /* }}} */ /* {{{ Pretty printing support functions */ static inline void json_pretty_print_char(smart_str *buf, int options, char c TSRMLS_DC) /* {{{ */ { if (options & PHP_JSON_PRETTY_PRINT) { smart_str_appendc(buf, c); } } /* }}} */ static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_DC) /* {{{ */ { int i; if (options & PHP_JSON_PRETTY_PRINT) { for (i = 0; i < JSON_G(encoder_depth); ++i) { smart_str_appendl(buf, " ", 4); } } } /* }}} */ /* }}} */ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) /* {{{ */ { int i, r, need_comma = 0; HashTable *myht; if (Z_TYPE_PP(val) == IS_ARRAY) { myht = HASH_OF(*val); r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val TSRMLS_CC); } else { myht = Z_OBJPROP_PP(val); r = PHP_JSON_OUTPUT_OBJECT; } if (myht && myht->nApplyCount > 1) { JSON_G(error_code) = PHP_JSON_ERROR_RECURSION; smart_str_appendl(buf, "null", 4); return; } if (r == PHP_JSON_OUTPUT_ARRAY) { smart_str_appendc(buf, '['); } else { smart_str_appendc(buf, '{'); } ++JSON_G(encoder_depth); i = myht ? zend_hash_num_elements(myht) : 0; if (i > 0) { char *key; zval **data; ulong index; uint key_len; HashPosition pos; HashTable *tmp_ht; zend_hash_internal_pointer_reset_ex(myht, &pos); for (;; zend_hash_move_forward_ex(myht, &pos)) { i = zend_hash_get_current_key_ex(myht, &key, &key_len, &index, 0, &pos); if (i == HASH_KEY_NON_EXISTENT) break; if (zend_hash_get_current_data_ex(myht, (void **) &data, &pos) == SUCCESS) { tmp_ht = HASH_OF(*data); if (tmp_ht) { tmp_ht->nApplyCount++; } if (r == PHP_JSON_OUTPUT_ARRAY) { if (need_comma) { smart_str_appendc(buf, ','); } else { need_comma = 1; } json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); php_json_encode(buf, *data, options TSRMLS_CC); } else if (r == PHP_JSON_OUTPUT_OBJECT) { if (i == HASH_KEY_IS_STRING) { if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) { /* Skip protected and private members. */ if (tmp_ht) { tmp_ht->nApplyCount--; } continue; } if (need_comma) { smart_str_appendc(buf, ','); } else { need_comma = 1; } json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); json_escape_string(buf, key, key_len - 1, options & ~PHP_JSON_NUMERIC_CHECK TSRMLS_CC); smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); php_json_encode(buf, *data, options TSRMLS_CC); } else { if (need_comma) { smart_str_appendc(buf, ','); } else { need_comma = 1; } json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); smart_str_appendc(buf, '"'); smart_str_append_long(buf, (long) index); smart_str_appendc(buf, '"'); smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); php_json_encode(buf, *data, options TSRMLS_CC); } } if (tmp_ht) { tmp_ht->nApplyCount--; } } } } if (JSON_G(encoder_depth) > JSON_G(encode_max_depth)) { JSON_G(error_code) = PHP_JSON_ERROR_DEPTH; } --JSON_G(encoder_depth); /* Only keep closing bracket on same line for empty arrays/objects */ if (need_comma) { json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); } if (r == PHP_JSON_OUTPUT_ARRAY) { smart_str_appendc(buf, ']'); } else { smart_str_appendc(buf, '}'); } } /* }}} */ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{{ */ { size_t pos = 0, us; int j, status; if (utf16) { /* really convert the utf8 string */ for (j=0 ; pos < len ; j++) { us = php_next_utf8_char((const unsigned char *)utf8, len, &pos, &status); if (status != SUCCESS) { return -1; } /* From http://en.wikipedia.org/wiki/UTF16 */ if (us >= 0x10000) { us -= 0x10000; utf16[j++] = (unsigned short)((us >> 10) | 0xd800); utf16[j] = (unsigned short)((us & 0x3ff) | 0xdc00); } else { utf16[j] = (unsigned short)us; } } } else { /* Only check if utf8 string is valid, and compute utf16 length */ for (j=0 ; pos < len ; j++) { us = php_next_utf8_char((const unsigned char *)utf8, len, &pos, &status); if (status != SUCCESS) { return -1; } if (us >= 0x10000) { j++; } } } return j; } /* }}} */ static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC) /* {{{ */ { int pos = 0, ulen = 0; unsigned short us; unsigned short *utf16; size_t newlen; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); return; } if (options & PHP_JSON_NUMERIC_CHECK) { double d; int type; long p; if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) { if (type == IS_LONG) { smart_str_append_long(buf, p); return; } else if (type == IS_DOUBLE && !zend_isinf(d) && !zend_isnan(d)) { char num[NUM_BUF_SIZE]; int l; php_gcvt(d, EG(precision), '.', 'e', (char *)num); l = strlen(num); if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2) { num[l++] = '.'; num[l++] = '0'; num[l] = '\0'; } smart_str_appendl(buf, num, l); return; } } } utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0); ulen = json_utf8_to_utf16(utf16, s, len); if (ulen <= 0) { if (utf16) { efree(utf16); } if (ulen < 0) { JSON_G(error_code) = PHP_JSON_ERROR_UTF8; smart_str_appendl(buf, "null", 4); } else { smart_str_appendl(buf, "\"\"", 2); } return; } if (!(options & PHP_JSON_UNESCAPED_UNICODE)) { len = ulen; } /* pre-allocate for string length plus 2 quotes */ smart_str_alloc(buf, len+2, 0); smart_str_appendc(buf, '"'); while (pos < len) { us = (options & PHP_JSON_UNESCAPED_UNICODE) ? s[pos++] : utf16[pos++]; switch (us) { case '"': if (options & PHP_JSON_HEX_QUOT) { smart_str_appendl(buf, "\\u0022", 6); } else { smart_str_appendl(buf, "\\\"", 2); } break; case '\\': smart_str_appendl(buf, "\\\\", 2); break; case '/': if (options & PHP_JSON_UNESCAPED_SLASHES) { smart_str_appendc(buf, '/'); } else { smart_str_appendl(buf, "\\/", 2); } break; case '\b': smart_str_appendl(buf, "\\b", 2); break; case '\f': smart_str_appendl(buf, "\\f", 2); break; case '\n': smart_str_appendl(buf, "\\n", 2); break; case '\r': smart_str_appendl(buf, "\\r", 2); break; case '\t': smart_str_appendl(buf, "\\t", 2); break; case '<': if (options & PHP_JSON_HEX_TAG) { smart_str_appendl(buf, "\\u003C", 6); } else { smart_str_appendc(buf, '<'); } break; case '>': if (options & PHP_JSON_HEX_TAG) { smart_str_appendl(buf, "\\u003E", 6); } else { smart_str_appendc(buf, '>'); } break; case '&': if (options & PHP_JSON_HEX_AMP) { smart_str_appendl(buf, "\\u0026", 6); } else { smart_str_appendc(buf, '&'); } break; case '\'': if (options & PHP_JSON_HEX_APOS) { smart_str_appendl(buf, "\\u0027", 6); } else { smart_str_appendc(buf, '\''); } break; default: if (us >= ' ' && ((options & PHP_JSON_UNESCAPED_UNICODE) || (us & 127) == us)) { smart_str_appendc(buf, (unsigned char) us); } else { smart_str_appendl(buf, "\\u", 2); smart_str_appendc(buf, digits[(us & 0xf000) >> 12]); smart_str_appendc(buf, digits[(us & 0xf00) >> 8]); smart_str_appendc(buf, digits[(us & 0xf0) >> 4]); smart_str_appendc(buf, digits[(us & 0xf)]); } break; } } smart_str_appendc(buf, '"'); if (utf16) { efree(utf16); } } /* }}} */ static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(val); zval *retval = NULL, fname; HashTable* myht; if (Z_TYPE_P(val) == IS_ARRAY) { myht = HASH_OF(val); } else { myht = Z_OBJPROP_P(val); } if (myht && myht->nApplyCount > 1) { JSON_G(error_code) = PHP_JSON_ERROR_RECURSION; smart_str_appendl(buf, "null", 4); return; } ZVAL_STRING(&fname, "jsonSerialize", 0); if (FAILURE == call_user_function_ex(EG(function_table), &val, &fname, &retval, 0, NULL, 1, NULL TSRMLS_CC) || !retval) { if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name); } smart_str_appendl(buf, "null", sizeof("null") - 1); return; } if (EG(exception)) { /* Error already raised */ zval_ptr_dtor(&retval); smart_str_appendl(buf, "null", sizeof("null") - 1); return; } if ((Z_TYPE_P(retval) == IS_OBJECT) && (Z_OBJ_HANDLE_P(retval) == Z_OBJ_HANDLE_P(val))) { /* Handle the case where jsonSerialize does: return $this; by going straight to encode array */ json_encode_array(buf, &retval, options TSRMLS_CC); } else { /* All other types, encode as normal */ php_json_encode(buf, retval, options TSRMLS_CC); } zval_ptr_dtor(&retval); } /* }}} */ PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { switch (Z_TYPE_P(val)) { case IS_NULL: smart_str_appendl(buf, "null", 4); break; case IS_BOOL: if (Z_BVAL_P(val)) { smart_str_appendl(buf, "true", 4); } else { smart_str_appendl(buf, "false", 5); } break; case IS_LONG: smart_str_append_long(buf, Z_LVAL_P(val)); break; case IS_DOUBLE: { char num[NUM_BUF_SIZE]; int len; double dbl = Z_DVAL_P(val); if (!zend_isinf(dbl) && !zend_isnan(dbl)) { php_gcvt(dbl, EG(precision), '.', 'e', (char *)num); len = strlen(num); if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < NUM_BUF_SIZE - 2) { num[len++] = '.'; num[len++] = '0'; num[len] = '\0'; } smart_str_appendl(buf, num, len); } else { JSON_G(error_code) = PHP_JSON_ERROR_INF_OR_NAN; smart_str_appendc(buf, '0'); } } break; case IS_STRING: json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options TSRMLS_CC); break; case IS_OBJECT: if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce TSRMLS_CC)) { json_encode_serializable_object(buf, val, options TSRMLS_CC); break; } /* fallthrough -- Non-serializable object */ case IS_ARRAY: json_encode_array(buf, &val, options TSRMLS_CC); break; default: JSON_G(error_code) = PHP_JSON_ERROR_UNSUPPORTED_TYPE; smart_str_appendl(buf, "null", 4); break; } return; } /* }}} */ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long depth TSRMLS_DC) /* {{{ */ { int utf16_len; zval *z; unsigned short *utf16; JSON_parser jp; utf16 = (unsigned short *) safe_emalloc((str_len+1), sizeof(unsigned short), 1); utf16_len = json_utf8_to_utf16(utf16, str, str_len); if (utf16_len <= 0) { if (utf16) { efree(utf16); } JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); } if (depth <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero"); efree(utf16); RETURN_NULL(); } if (depth > INT_MAX) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be lower than %d", INT_MAX); efree(utf16); RETURN_NULL(); } ALLOC_INIT_ZVAL(z); jp = new_JSON_parser(depth); if (parse_JSON_ex(jp, z, utf16, utf16_len, options TSRMLS_CC)) { *return_value = *z; } else { double d; int type, overflow_info; long p; char *trim = str; int trim_len = str_len; /* Increment trimmed string pointer to strip leading whitespace */ /* JSON RFC says to consider as whitespace: space, tab, LF or CR */ while (trim_len && (*trim == ' ' || *trim == '\t' || *trim == '\n' || *trim == '\r')) { trim++; trim_len--; } /* Decrement trimmed string length to strip trailing whitespace */ while (trim_len && (trim[trim_len - 1] == ' ' || trim[trim_len - 1] == '\t' || trim[trim_len - 1] == '\n' || trim[trim_len - 1] == '\r')) { trim_len--; } RETVAL_NULL(); if (trim_len == 4) { if (!strncmp(trim, "null", trim_len)) { /* We need to explicitly clear the error because its an actual NULL and not an error */ jp->error_code = PHP_JSON_ERROR_NONE; RETVAL_NULL(); } else if (!strncmp(trim, "true", trim_len)) { RETVAL_BOOL(1); } } else if (trim_len == 5 && !strncmp(trim, "false", trim_len)) { RETVAL_BOOL(0); } if ((type = is_numeric_string_ex(trim, trim_len, &p, &d, 0, &overflow_info)) != 0) { if (type == IS_LONG) { RETVAL_LONG(p); } else if (type == IS_DOUBLE) { if (options & PHP_JSON_BIGINT_AS_STRING && overflow_info) { /* Within an object or array, a numeric literal is assumed * to be an integer if and only if it's entirely made up of * digits (exponent notation will result in the number * being treated as a double). We'll match that behaviour * here. */ int i; zend_bool is_float = 0; for (i = (trim[0] == '-' ? 1 : 0); i < trim_len; i++) { /* Not using isdigit() because it's locale specific, * but we expect JSON input to always be UTF-8. */ if (trim[i] < '0' || trim[i] > '9') { is_float = 1; break; } } if (is_float) { RETVAL_DOUBLE(d); } else { RETVAL_STRINGL(trim, trim_len, 1); } } else { RETVAL_DOUBLE(d); } } } if (Z_TYPE_P(return_value) != IS_NULL) { jp->error_code = PHP_JSON_ERROR_NONE; } zval_dtor(z); } FREE_ZVAL(z); efree(utf16); JSON_G(error_code) = jp->error_code; free_JSON_parser(jp); } /* }}} */ /* {{{ proto string json_encode(mixed data [, int options[, int depth]]) Returns the JSON representation of a value */ static PHP_FUNCTION(json_encode) { zval *parameter; smart_str buf = {0}; long options = 0; long depth = JSON_PARSER_DEFAULT_DEPTH; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", ¶meter, &options, &depth) == FAILURE) { return; } JSON_G(error_code) = PHP_JSON_ERROR_NONE; JSON_G(encode_max_depth) = depth; php_json_encode(&buf, parameter, options TSRMLS_CC); if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && !(options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) { ZVAL_FALSE(return_value); } else { ZVAL_STRINGL(return_value, buf.c, buf.len, 1); } smart_str_free(&buf); } /* }}} */ /* {{{ proto mixed json_decode(string json [, bool assoc [, long depth]]) Decodes the JSON representation into a PHP value */ static PHP_FUNCTION(json_decode) { char *str; int str_len; zend_bool assoc = 0; /* return JS objects as PHP objects by default */ long depth = JSON_PARSER_DEFAULT_DEPTH; long options = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) { return; } JSON_G(error_code) = 0; if (!str_len) { RETURN_NULL(); } /* For BC reasons, the bool $assoc overrides the long $options bit for PHP_JSON_OBJECT_AS_ARRAY */ if (assoc) { options |= PHP_JSON_OBJECT_AS_ARRAY; } else { options &= ~PHP_JSON_OBJECT_AS_ARRAY; } php_json_decode_ex(return_value, str, str_len, options, depth TSRMLS_CC); } /* }}} */ /* {{{ proto int json_last_error() Returns the error code of the last json_encode() or json_decode() call. */ static PHP_FUNCTION(json_last_error) { if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(JSON_G(error_code)); } /* }}} */ /* {{{ proto string json_last_error_msg() Returns the error string of the last json_encode() or json_decode() call. */ static PHP_FUNCTION(json_last_error_msg) { if (zend_parse_parameters_none() == FAILURE) { return; } switch(JSON_G(error_code)) { case PHP_JSON_ERROR_NONE: RETURN_STRING("No error", 1); case PHP_JSON_ERROR_DEPTH: RETURN_STRING("Maximum stack depth exceeded", 1); case PHP_JSON_ERROR_STATE_MISMATCH: RETURN_STRING("State mismatch (invalid or malformed JSON)", 1); case PHP_JSON_ERROR_CTRL_CHAR: RETURN_STRING("Control character error, possibly incorrectly encoded", 1); case PHP_JSON_ERROR_SYNTAX: RETURN_STRING("Syntax error", 1); case PHP_JSON_ERROR_UTF8: RETURN_STRING("Malformed UTF-8 characters, possibly incorrectly encoded", 1); case PHP_JSON_ERROR_RECURSION: RETURN_STRING("Recursion detected", 1); case PHP_JSON_ERROR_INF_OR_NAN: RETURN_STRING("Inf and NaN cannot be JSON encoded", 1); case PHP_JSON_ERROR_UNSUPPORTED_TYPE: RETURN_STRING("Type is not supported", 1); default: RETURN_STRING("Unknown error", 1); } } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!++"__pycache__/encoder.cpython-38.pycnu[U ,a> @s>dZddlZzddlmZWnek r4dZYnXzddlmZWnek r^dZYnXzddlmZ Wnek rdZ YnXe dZ e dZ e dZ d d d d d dddZedD]ZeeedeqedZddZepeZddZepeZGdddeZeeeeeeee e!ej"f ddZ#dS)zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    \u{0:04x}infcCsdd}dt||dS)z5Return a JSON representation of a Python string cSst|dS)Nr) ESCAPE_DCTgroup)matchr1/opt/alt/python38/lib64/python3.8/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsubsrrrrpy_encode_basestring$srcCsdd}dt||dS)zAReturn an ASCII-only JSON representation of a Python string cSs|d}z t|WStk rzt|}|dkrBd|YS|d8}d|d?d@B}d|d@B}d||YSYnXdS) Nrir i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s   z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIrrrrrpy_encode_basestring_ascii0sr"c @sNeZdZdZdZdZddddddddddd Zd d Zd d ZdddZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) r$r%r&r'r(r)item_separator key_separatorr+) selfr$r%r&r'r(r)r*r+rrr__init__hs+zJSONEncoder.__init__cCstd|jjddS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) zObject of type z is not JSON serializableN) TypeError __class____name__)r/orrrr+szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}d|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' T) _one_shot) isinstancestrr%rr iterencodelisttuplejoin)r/r4chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r4r'Z_reprZ_infZ_neginftextrrrfloatstrsz(JSONEncoder.iterencode..floatstrr)r&r%rrr'float__repr__INFINITYc_make_encoderr)r+r.r-r(r$_make_iterencode)r/r4r5markers_encoderrB _iterencoderrrr9sL   zJSONEncoder.iterencode)F) r3 __module__ __qualname____doc__r-r.r0r+r>r9rrrrr#Is 8r#csdk rsd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}|D]}|rd}n|} |r||Vqx|dkr|dVqx|dkr|d Vqx|dkr|d Vqx | r||Vqx | r||Vqx|V |fr8||}n" | rP||}n ||}|EdHqx|dk r|d8}d|Vd Vdk r|=dS) Nz[]Circular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer=)r?rI _floatstr_indent_intstr_item_separatorrJ_iterencode_dict_iterencode_listdictrCidintr7r:rHr8r;rrr`s\               z*_make_iterencode.._iterencode_listc 3s:|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|}n|}|D]j\}}|rnn| r|}nZ|dkrd}nL|dkrd }n>|dkrd }n0|r|}n rqntd |jj|r"d}n|V|V V|rP|Vq|dkrbd Vq|dkrtdVq|dkrd Vq|r|Vq| r|Vq|fr҈||} n"| r||} n ||} | EdHq|dk r |d8}d|Vd Vdk r6|=dS) Nz{}rO{rQr TrSFrTrRz0keys must be str, int, float, bool or None, not })sorteditemsr1r2r3) ZdctrVrWrXr-rYrgkeyrZr=)r?rIr[r\r]r^rJr_r`_key_separator _skipkeys _sort_keysrarCrbrcr7r:rHr8r;rrr_Ms                       z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrRTrSFrTrOr)r4rVrW)r?_defaultrIr[r]rJr_r`rarCrbrcr7r:rHr8r;rrrJs2       z%_make_iterencode.._iterencoder)rHrlrIr\r[rir^rkrjr5r?rarCrbrcr7r:r8r;r]r)r?rlrIr[r\r]r^rJr_r`rirjrkrarCrbrcr7r:rHr8r;rrGs .84P,rG)$rMreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrFcompilerr!ZHAS_UTF8rrangei setdefaultchrrrCrErr"objectr#r?rarbrcr7r:r8r;rDrGrrrrsZ        >PK!*ww__pycache__/tool.cpython-38.pycnu[U ,a @sjdZddlZddlZddlZddZedkrfz eWn.ek rdZzeej W5dZ[XYnXdS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc Cs4d}d}tj||d}|jddtjdddtjd |jd dtjd ddd tjd |jd dddd|jddddd|}|j}|j }|j }|j }||~zJ|rdd|D}n t |f}|D] } t j| ||dd|dqWn,tk r} z t| W5d} ~ XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?zutf-8)encodingz-a JSON file to be validated or pretty-printed)nargstypehelpdefaultoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actionr r z --json-linesz&parse input using the jsonlines formatcss|]}t|VqdS)N)jsonloads).0liner./opt/alt/python38/lib64/python3.8/json/tool.py ,szmain..) sort_keysindent )argparseArgumentParser add_argumentZFileTypesysstdinstdout parse_argsrr r json_linesrloaddumpwrite ValueError SystemExit) rrparserZoptionsrr rr!ZobjsobjerrrmainsD      r*__main__) __doc__rrrr*__name__BrokenPipeErrorexcexiterrnorrrrs $ PK!]T(__pycache__/decoder.cpython-38.opt-2.pycnu[U ,a0 @sddlZddlmZzddlmZWnek r<dZYnXddgZejej Bej BZ e dZ e dZe dZGd ddeZeee d Zed e Zd d dddddddZddZdeejfddZepeZede ZdZdejefddZejefddZGd ddeZdS)!N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@seZdZddZddZdS)rcCsb|dd|d}||dd|}d||||f}t||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr1/opt/alt/python38/lib64/python3.8/json/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffSN) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrr bfnrtcCsb||d|d}t|dkrN|ddkrNz t|dWStk rLYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r1TcCsg}|j}|d}|||}|dkr0td|||}|\} } | rP|| | dkr^qn.| dkr|rd| } t| ||n || qz ||} Wn"tk rtd||dYnX| dkrz || } Wn*tk rd| } t| ||YnX|d7}nt||}|d7}d |kr2d krnn`|||d d krt||d}d |krrdkrnn d|d d>|d B}|d7}t|} || qd ||fS)Nr zUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsX           2 rDz [ \t\n\r]*z c Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| } || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} t|| |\}} | ||}|| | ddkr"||| } || | ddkr"td|| | d7} z:|| |krb| d7} || |krb||| d} Wntk rzYnXz||| \}} Wn4tk r}ztd||jdW5d}~XYnX| ||fz0|| } | |kr||| d} || } Wntk rd} YnX| d7} | dkr4qn| d krNtd || d||| } || | d} | d7} | dkrtd|| dq|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterExpecting valuer6,Expecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrLerrrrr JSONObjects    "        rYc Cst|\}}g}|||d}||krF|||d}|||d}|dkrZ||dfS|j}z|||\} }Wn2tk r} ztd|| jdW5d} ~ XYnX|| |||d}||kr|||d}|||d}|d7}|dkrqln|dkrtd||dz:|||krP|d7}|||krP|||d}Wq`tk rhYq`Xq`||fS)Nr ]rGrHrI)r8r7rKrrLr;) rNrOrSrTr/r8valuesrUr@rLrXrrr JSONArrays> " r\c@s<eZdZdddddddddZejfddZd d d ZdS) rNT)rP parse_float parse_intparse_constantr?rQcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_t||_dSr)rPfloatr]r.r^ _CONSTANTS __getitem__r_r?rQrYZ parse_objectr\Z parse_arrayrZ parse_stringrRrZ make_scannerrO)rrPr]r^r_r?rQrrrr s#   zJSONDecoder.__init__cCsF|j|||dd\}}|||}|t|krBtd|||S)Nr)idxz Extra data) raw_decoder8r-r)rr/rSobjr8rrrdecodeLs   zJSONDecoder.decoderc CsPz|||\}}Wn2tk rF}ztd||jdW5d}~XYnX||fS)NrG)rOrKrrL)rr/rcrer8rXrrrrdWs "zJSONDecoder.raw_decode)r)rrrr WHITESPACEmatchrfrdrrrrrs 0 )reZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr`rZPosInfZNegInfr rracompileZ STRINGCHUNKZ BACKSLASHr1rhrDrgZWHITESPACE_STRrYr\objectrrrrrsN     =  Q%PK!?"__pycache__/scanner.cpython-38.pycnu[U ,ay @sjdZddlZzddlmZWnek r4dZYnXdgZedejej Bej BZ ddZ epde ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsz ||}Wntk r*t|dYnX|dkrD ||d S|dkrf ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d kr|||d d krd|d fS||}|dk r\|\}}}|s*|rH||p6d|p@d}n|}||fS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfSt|dS)N"{[nZnullttrueTfZfalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracZexpres _scan_onceZ match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict1/opt/alt/python38/lib64/python3.8/json/scanner.pyrsF            z#py_make_scanner.._scan_oncecsz||WSXdS)N)clear)rr)rrr(r) scan_onceAsz"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r(rr)py_make_scanners"%r/) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!Z&&"__pycache__/decoder.cpython-38.pycnu[U ,a0 @sdZddlZddlmZzddlmZWnek r@dZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZeeed Zed e Zd ddddddddZddZdeejfddZepeZede ZdZdejefddZejefdd ZGd!ddeZdS)"zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCsb|dd|d}||dd|}d||||f}t||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr1/opt/alt/python38/lib64/python3.8/json/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrr bfnrtcCsb||d|d}t|dkrN|ddkrNz t|dWStk rLYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r1TcCsg}|j}|d}|||}|dkr0td|||}|\} } | rP|| | dkr^qn.| dkr|rd| } t| ||n || qz ||} Wn"tk rtd||dYnX| dkrz || } Wn*tk rd| } t| ||YnX|d7}nt||}|d 7}d |kr2d krnn`|||d d krt||d}d|krrdkrnn d|d d>|dB}|d7}t|} || qd ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsX           2 rDz [ \t\n\r]*z c Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| } || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} t|| |\}} | ||}|| | ddkr"||| } || | ddkr"td|| | d7} z:|| |krb| d7} || |krb||| d} Wntk rzYnXz||| \}} Wn4tk r}ztd||jdW5d}~XYnX| ||fz0|| } | |kr||| d} || } Wntk rd} YnX| d7} | dkr4qn| d krNtd || d||| } || | d} | d7} | dkrtd|| dq|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterExpecting valuer6,Expecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrLerrrrr JSONObjects    "        rYc Cst|\}}g}|||d}||krF|||d}|||d}|dkrZ||dfS|j}z|||\} }Wn2tk r} ztd|| jdW5d} ~ XYnX|| |||d}||kr|||d}|||d}|d7}|dkrqln|dkrtd||dz:|||krP|d7}|||krP|||d}Wq`tk rhYq`Xq`||fS)Nr ]rGrHrI)r8r7rKrrLr;) rNrOrSrTr/r8valuesrUr@rLrXrrr JSONArrays> " r\c@s@eZdZdZdddddddddZejfddZd d d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NT)rP parse_float parse_intparse_constantr?rQcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_t||_dS)a``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders. If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rPfloatr]r.r^ _CONSTANTS __getitem__r_r?rQrYZ parse_objectr\Z parse_arrayrZ parse_stringrRrZ make_scannerrO)rrPr]r^r_r?rQrrrr s#   zJSONDecoder.__init__cCsF|j|||dd\}}|||}|t|krBtd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). r)idxz Extra data) raw_decoder8r-r)rr/rSobjr8rrrdecodeLs   zJSONDecoder.decoderc CsPz|||\}}Wn2tk rF}ztd||jdW5d}~XYnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. rGN)rOrKrrL)rr/rcrer8rXrrrrdWs "zJSONDecoder.raw_decode)r) rrrrr WHITESPACEmatchrfrdrrrrrs 0 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr`rZPosInfZNegInfr rracompileZ STRINGCHUNKZ BACKSLASHr1rhrDrgZWHITESPACE_STRrYr\objectrrrrrsP     =  Q%PK! 7n&&(__pycache__/decoder.cpython-38.opt-1.pycnu[U ,a0 @sdZddlZddlmZzddlmZWnek r@dZYnXddgZej ej Bej BZ e dZe dZe d ZGd ddeZeeed Zed e Zd ddddddddZddZdeejfddZepeZede ZdZdejefddZejefdd ZGd!ddeZdS)"zImplementation of JSONDecoder N)scanner) scanstring JSONDecoderJSONDecodeErrornaninfz-infc@s eZdZdZddZddZdS)ra Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos cCsb|dd|d}||dd|}d||||f}t||||_||_||_||_||_dS)N rz%s: line %d column %d (char %d)) countrfind ValueError__init__msgdocposlinenocolno)selfrrrrrerrmsgr1/opt/alt/python38/lib64/python3.8/json/decoder.pyr s zJSONDecodeError.__init__cCs|j|j|j|jffS)N) __class__rrr)rrrr __reduce__*szJSONDecodeError.__reduce__N)__name__ __module__ __qualname____doc__r rrrrrrs  )z -InfinityZInfinityNaNz(.*?)(["\\\x00-\x1f])"\/ r  )rrr bfnrtcCsb||d|d}t|dkrN|ddkrNz t|dWStk rLYnXd}t|||dS)Nr ZxXzInvalid \uXXXX escape)lenintr r)srescrrrr _decode_uXXXX;s r1TcCsg}|j}|d}|||}|dkr0td|||}|\} } | rP|| | dkr^qn.| dkr|rd| } t| ||n || qz ||} Wn"tk rtd||dYnX| dkrz || } Wn*tk rd| } t| ||YnX|d7}nt||}|d 7}d |kr2d krnn`|||d d krt||d}d|krrdkrnn d|d d>|dB}|d7}t|} || qd ||fS)aScan the string s for a JSON string. End is the index of the character in s after the quote that started the JSON string. Unescapes all valid JSON string escape sequences and raises ValueError on attempt to decode an invalid string. If strict is False then literal control characters are allowed in the string. Returns a tuple of the decoded string and the index of the character in s after the end quote.r NzUnterminated string starting atrrz"Invalid control character {0!r} atuzInvalid \escape: {0!r}r*iiz\uiii ) appendrendgroupsformat IndexErrorKeyErrorr1chrjoin)r/r8strictZ_bZ_mZchunks_appendZbeginchunkZcontent terminatorrr0charZuniZuni2rrr py_scanstringEsX           2 rDz [ \t\n\r]*z c Cs|\}} g} | j} |dkri}|j} || | d} | dkr| |krb||| } || | d} | dkr|dk r|| }|| dfSi} |dk r|| } | | dfS| dkrtd|| | d7} t|| |\}} | ||}|| | ddkr"||| } || | ddkr"td|| | d7} z:|| |krb| d7} || |krb||| d} Wntk rzYnXz||| \}} Wn4tk r}ztd||jdW5d}~XYnX| ||fz0|| } | |kr||| d} || } Wntk rd} YnX| d7} | dkr4qn| d krNtd || d||| } || | d} | d7} | dkrtd|| dq|dk r|| }|| fSt| } |dk r|| } | | fS) Nr r}z1Expecting property name enclosed in double quotes:zExpecting ':' delimiterExpecting valuer6,Expecting ',' delimiter) r7 setdefaultr8rrr; StopIterationvaluedict) s_and_endr? scan_once object_hookobject_pairs_hookmemo_w_wsr/r8ZpairsZ pairs_appendZmemo_getnextcharresultkeyrLerrrrr JSONObjects    "        rYc Cst|\}}g}|||d}||krF|||d}|||d}|dkrZ||dfS|j}z|||\} }Wn2tk r} ztd|| jdW5d} ~ XYnX|| |||d}||kr|||d}|||d}|d7}|dkrqln|dkrtd||dz:|||krP|d7}|||krP|||d}Wq`tk rhYq`Xq`||fS)Nr ]rGrHrI)r8r7rKrrLr;) rNrOrSrTr/r8valuesrUr@rLrXrrr JSONArrays> " r\c@s@eZdZdZdddddddddZejfddZd d d ZdS) raSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NT)rP parse_float parse_intparse_constantr?rQcCsZ||_|p t|_|pt|_|p"tj|_||_||_ t |_ t |_ t|_i|_t||_dS)a``object_hook``, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). ``object_pairs_hook``, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders. If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. If ``strict`` is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. N)rPfloatr]r.r^ _CONSTANTS __getitem__r_r?rQrYZ parse_objectr\Z parse_arrayrZ parse_stringrRrZ make_scannerrO)rrPr]r^r_r?rQrrrr s#   zJSONDecoder.__init__cCsF|j|||dd\}}|||}|t|krBtd|||S)zlReturn the Python representation of ``s`` (a ``str`` instance containing a JSON document). r)idxz Extra data) raw_decoder8r-r)rr/rSobjr8rrrdecodeLs   zJSONDecoder.decoderc CsPz|||\}}Wn2tk rF}ztd||jdW5d}~XYnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. rGN)rOrKrrL)rr/rcrer8rXrrrrdWs "zJSONDecoder.raw_decode)r) rrrrr WHITESPACEmatchrfrdrrrrrs 0 ) rreZjsonrZ_jsonrZ c_scanstring ImportError__all__VERBOSE MULTILINEDOTALLFLAGSr`rZPosInfZNegInfr rracompileZ STRINGCHUNKZ BACKSLASHr1rhrDrgZWHITESPACE_STRrYr\objectrrrrrsP     =  Q%PK!j(__pycache__/scanner.cpython-38.opt-1.pycnu[U ,ay @sjdZddlZzddlmZWnek r4dZYnXdgZedejej Bej BZ ddZ epde ZdS)zJSON token scanner N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsz ||}Wntk r*t|dYnX|dkrD ||d S|dkrf ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d kr|||d d krd|d fS||}|dk r\|\}}}|s*|rH||p6d|p@d}n|}||fS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfSt|dS)N"{[nZnullttrueTfZfalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracZexpres _scan_onceZ match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict1/opt/alt/python38/lib64/python3.8/json/scanner.pyrsF            z#py_make_scanner.._scan_oncecsz||WSXdS)N)clear)rr)rrr(r) scan_onceAsz"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r(rr)py_make_scanners"%r/) __doc__reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!ېT(__pycache__/encoder.cpython-38.opt-2.pycnu[U ,a> @s:ddlZzddlmZWnek r0dZYnXzddlmZWnek rZdZYnXzddlmZWnek rdZYnXe dZ e dZ e dZ dd d d d d ddZ edD]Ze eedeqedZddZepeZddZepeZGdddeZeeeeeeeee ej!f ddZ"dS)N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    \u{0:04x}infcCsdd}dt||dS)NcSst|dS)Nr) ESCAPE_DCTgroup)matchr1/opt/alt/python38/lib64/python3.8/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsubsrrrrpy_encode_basestring$srcCsdd}dt||dS)NcSs|d}z t|WStk rzt|}|dkrBd|YS|d8}d|d?d@B}d|d@B}d||YSYnXdS) Nrir i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s   z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIrrrrrpy_encode_basestring_ascii0sr"c @sJeZdZdZdZdddddddddddZd d Zd d Zdd dZdS) JSONEncoderz, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)N,) r$r%r&r'r(r)item_separator key_separatorr+) selfr$r%r&r'r(r)r*r+rrr__init__hs+zJSONEncoder.__init__cCstd|jjddS)NzObject of type z is not JSON serializable) TypeError __class____name__)r/orrrr+szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}d|S)NT) _one_shot) isinstancestrr%rr iterencodelisttuplejoin)r/r4chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r4r'Z_reprZ_infZ_neginftextrrrfloatstrsz(JSONEncoder.iterencode..floatstrr)r&r%rrr'float__repr__INFINITYc_make_encoderr)r+r.r-r(r$_make_iterencode)r/r4r5markers_encoderrB _iterencoderrrr9sL   zJSONEncoder.iterencode)F) r3 __module__ __qualname__r-r.r0r+r>r9rrrrr#Is 8r#csdk rsd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}|D]}|rd}n|} |r||Vqx|dkr|dVqx|dkr|d Vqx|dkr|d Vqx | r||Vqx | r||Vqx|V |fr8||}n" | rP||}n ||}|EdHqx|dk r|d8}d|Vd Vdk r|=dS) Nz[]Circular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer=)r?rI _floatstr_indent_intstr_item_separatorrJ_iterencode_dict_iterencode_listdictrCidintr7r:rHr8r;rrr_s\               z*_make_iterencode.._iterencode_listc 3s:|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|}n|}|D]j\}}|rnn| r|}nZ|dkrd}nL|dkrd }n>|dkrd }n0|r|}n rqntd |jj|r"d}n|V|V V|rP|Vq|dkrbd Vq|dkrtdVq|dkrd Vq|r|Vq| r|Vq|fr҈||} n"| r||} n ||} | EdHq|dk r |d8}d|Vd Vdk r6|=dS) Nz{}rN{rPr TrRFrSrQz0keys must be str, int, float, bool or None, not })sorteditemsr1r2r3) ZdctrUrVrWr-rXrfkeyrYr=)r?rIrZr[r\r]rJr^r__key_separator _skipkeys _sort_keysr`rCrarbr7r:rHr8r;rrr^Ms                       z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrQTrRFrSrNr)r4rUrV)r?_defaultrIrZr\rJr^r_r`rCrarbr7r:rHr8r;rrrJs2       z%_make_iterencode.._iterencoder)rHrkrIr[rZrhr]rjrir5r?r`rCrarbr7r:r8r;r\r)r?rkrIrZr[r\r]rJr^r_rhrirjr`rCrarbr7r:rHr8r;rrGs .84P,rG)#reZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrFcompilerr!ZHAS_UTF8rrangei setdefaultchrrrCrErr"objectr#r?r`rarbr7r:r8r;rDrGrrrrsX        >PK!X!M )__pycache__/__init__.cpython-38.opt-2.pycnu[U ,a 8 @sdZdddddddgZdZd d lmZmZd d lmZd d lZeddddd d d dZ ddddd d d d dd ddZ ddddd d d d dd ddZ ed d dZ ddZ d d d d d d dddZd d d d d d dddZd S)z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks|sD|rD|rD|rD|dkrD|dkrD|dkrD| dkrD| sD| sDt|} n2|dkrPt}|f||||||| | d| |} | D]} || qzdSN)r r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr2/opt/alt/python38/lib64/python3.8/json/__init__.pyrxsD- c Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB| sB| sBt|S|dkrNt}|f|||||||| d| |Sr)rencoder) rr r r r rrrrrrrrrrsD, ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjrrrrr+sT$     ) __version____all__ __author__decoderrrencoderrr%rrrrAr-rrrrrrbsb   ? :  PK!+(__pycache__/scanner.cpython-38.opt-2.pycnu[U ,ay @sfddlZzddlmZWnek r0dZYnXdgZedejejBej BZ ddZ ep`e ZdS)N) make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c sv|j |j|j tj|j |j|j|j|j |j |j  f ddfdd}|S)Ncsz ||}Wntk r*t|dYnX|dkrD ||d S|dkrf ||df S|dkr||dfS|dkr|||ddkrd|dfS|dkr|||dd krd |dfS|d kr|||d d krd|d fS||}|dk r\|\}}}|s*|rH||p6d|p@d}n|}||fS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfS|dkr|||ddkrd|dfSt|dS)N"{[nZnullttrueTfZfalseFNZNaNIZInfinity- z -Infinity) IndexError StopIterationgroupsend)stringidxZnextcharmZintegerZfracZexpres _scan_onceZ match_numbermemo object_hookobject_pairs_hook parse_arrayparse_constant parse_float parse_int parse_object parse_stringstrict1/opt/alt/python38/lib64/python3.8/json/scanner.pyrsF            z#py_make_scanner.._scan_oncecsz||WSXdS)N)clear)rr)rrr(r) scan_onceAsz"py_make_scanner..scan_once) r%r!r& NUMBER_REmatchr'r#r$r"rr r)contextr+r(rr)py_make_scanners"%r/) reZ_jsonrZc_make_scanner ImportError__all__compileVERBOSE MULTILINEDOTALLr,r/r(r(r(r)s :PK!ڛDO1O1)__pycache__/__init__.cpython-38.opt-1.pycnu[U ,a 8 @sdZdZdddddddgZd Zd d lmZmZd d lmZd dl Z eddddddddZ dddddddddd ddZ dddddddddd ddZ edddZ ddZdddddddddZdddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> mydict = {'4': 5, '6': 7} >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(f'Object of type {obj.__class__.__name__} ' ... f'is not JSON serializable') ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks|sD|rD|rD|rD|dkrD|dkrD|dkrD| dkrD| sD| sDt|} n2|dkrPt}|f||||||| | d| |} | D]} || qzdS)aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr2/opt/alt/python38/lib64/python3.8/json/__init__.pyrxsD- c Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB| sB| sBt|S|dkrNt}|f|||||||| d| |S)auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr)rencoder) rr r r r rrrrrrrrrrsD, ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjrrrrr+sT$     )__doc__ __version____all__ __author__decoderrrencoderrr%rrrrAr-rrrrrrsda   ? :  PK!qRR%__pycache__/tool.cpython-38.opt-2.pycnu[U ,a @sfddlZddlZddlZddZedkrbz eWn.ek r`ZzeejW5dZ[XYnXdS)Nc Cs4d}d}tj||d}|jddtjdddtjd |jd dtjd ddd tjd |jd dddd|jddddd|}|j}|j }|j }|j }||~zJ|rdd|D}n t |f}|D] } t j| ||dd|dqWn,tk r} z t| W5d} ~ XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?zutf-8)encodingz-a JSON file to be validated or pretty-printed)nargstypehelpdefaultoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actionr r z --json-linesz&parse input using the jsonlines formatcss|]}t|VqdS)N)jsonloads).0liner./opt/alt/python38/lib64/python3.8/json/tool.py ,szmain..) sort_keysindent )argparseArgumentParser add_argumentZFileTypesysstdinstdout parse_argsrr r json_linesrloaddumpwrite ValueError SystemExit) rrparserZoptionsrr rr!ZobjsobjerrrmainsD      r*__main__) rrrr*__name__BrokenPipeErrorexcexiterrnorrrr s$ PK!;SX ++(__pycache__/encoder.cpython-38.opt-1.pycnu[U ,a> @s>dZddlZzddlmZWnek r4dZYnXzddlmZWnek r^dZYnXzddlmZ Wnek rdZ YnXe dZ e dZ e dZ d d d d d dddZedD]ZeeedeqedZddZepeZddZepeZGdddeZeeeeeeee e!ej"f ddZ#dS)zImplementation of JSONEncoder N)encode_basestring_ascii)encode_basestring) make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[-]z\\z\"z\bz\fz\nz\rz\t)\"    \u{0:04x}infcCsdd}dt||dS)z5Return a JSON representation of a Python string cSst|dS)Nr) ESCAPE_DCTgroup)matchr1/opt/alt/python38/lib64/python3.8/json/encoder.pyreplace(sz%py_encode_basestring..replacer)ESCAPEsubsrrrrpy_encode_basestring$srcCsdd}dt||dS)zAReturn an ASCII-only JSON representation of a Python string cSs|d}z t|WStk rzt|}|dkrBd|YS|d8}d|d?d@B}d|d@B}d||YSYnXdS) Nrir i iiz\u{0:04x}\u{1:04x})rrKeyErrorordformat)rrns1s2rrrr4s   z+py_encode_basestring_ascii..replacer) ESCAPE_ASCIIrrrrrpy_encode_basestring_ascii0sr"c @sNeZdZdZdZdZddddddddddd Zd d Zd d ZdddZ dS) JSONEncoderaZExtensible JSON encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +===================+===============+ | dict | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ | True | true | +-------------------+---------------+ | False | false | +-------------------+---------------+ | None | null | +-------------------+---------------+ To extend this to recognize other objects, subclass and implement a ``.default()`` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise ``TypeError``). z, z: FTN)skipkeys ensure_asciicheck_circular allow_nan sort_keysindent separatorsdefaultc CsZ||_||_||_||_||_||_|dk r:|\|_|_n|dk rHd|_|dk rV||_dS)aConstructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters. If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. If specified, default is a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. N,) r$r%r&r'r(r)item_separator key_separatorr+) selfr$r%r&r'r(r)r*r+rrr__init__hs+zJSONEncoder.__init__cCstd|jjddS)alImplement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) zObject of type z is not JSON serializableN) TypeError __class____name__)r/orrrr+szJSONEncoder.defaultcCsNt|tr |jrt|St|S|j|dd}t|ttfsDt|}d|S)zReturn a JSON string representation of a Python data structure. >>> from json.encoder import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' T) _one_shot) isinstancestrr%rr iterencodelisttuplejoin)r/r4chunksrrrencodes zJSONEncoder.encodec Cs|jr i}nd}|jrt}nt}|jtjtt fdd}|rvtdk rv|j dkrvt||j ||j |j |j |j |j|j }n&t||j ||j ||j |j |j |j| }||dS)zEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) NcSsJ||krd}n$||krd}n||kr*d}n||S|sFtdt||S)NZNaNZInfinityz -Infinityz2Out of range float values are not JSON compliant: ) ValueErrorrepr)r4r'Z_reprZ_infZ_neginftextrrrfloatstrsz(JSONEncoder.iterencode..floatstrr)r&r%rrr'float__repr__INFINITYc_make_encoderr)r+r.r-r(r$_make_iterencode)r/r4r5markers_encoderrB _iterencoderrrr9sL   zJSONEncoder.iterencode)F) r3 __module__ __qualname____doc__r-r.r0r+r>r9rrrrr#Is 8r#csdk rsd fdd  fdd fddS)N c 3s|sdVdSdk r6 |}|kr.d||<d}dk rh|d7}d|}|}||7}nd}}d}|D]}|rd}n|} |r||Vqx|dkr|dVqx|dkr|d Vqx|dkr|d Vqx | r||Vqx | r||Vqx|V |fr8||}n" | rP||}n ||}|EdHqx|dk r|d8}d|Vd Vdk r|=dS) Nz[]Circular reference detected[r TFnulltruefalse]r) Zlst_current_indent_levelmarkeridZbufnewline_indentZ separatorfirstvaluer=)r?rI _floatstr_indent_intstr_item_separatorrJ_iterencode_dict_iterencode_listdictrCidintr7r:rHr8r;rrr`s\               z*_make_iterencode.._iterencode_listc 3s:|sdVdSdk r6|}|kr.d||<dVdk rh|d7}d|}|}|Vnd}}d} rt|}n|}|D]j\}}|rnn| r|}nZ|dkrd}nL|dkrd }n>|dkrd }n0|r|}n rqntd |jj|r"d}n|V|V V|rP|Vq|dkrbd Vq|dkrtdVq|dkrd Vq|r|Vq| r|Vq|fr҈||} n"| r||} n ||} | EdHq|dk r |d8}d|Vd Vdk r6|=dS) Nz{}rO{rQr TrSFrTrRz0keys must be str, int, float, bool or None, not })sorteditemsr1r2r3) ZdctrVrWrXr-rYrgkeyrZr=)r?rIr[r\r]r^rJr_r`_key_separator _skipkeys _sort_keysrarCrbrcr7r:rHr8r;rrr_Ms                       z*_make_iterencode.._iterencode_dictc3s |r|Vn|dkr&dVn|dkr6dVn|dkrFdVn | r\|Vn | rr|Vn | fr||EdHnj |r||EdHnNdk rֈ |}|krΈd||<|}||EdHdk r|=dS)NrRTrSFrTrOr)r4rVrW)r?_defaultrIr[r]rJr_r`rarCrbrcr7r:rHr8r;rrrJs2       z%_make_iterencode.._iterencoder)rHrlrIr\r[rir^rkrjr5r?rarCrbrcr7r:r8r;r]r)r?rlrIr[r\r]r^rJr_r`rirjrkrarCrbrcr7r:rHr8r;rrGs .84P,rG)$rMreZ_jsonrZc_encode_basestring_ascii ImportErrorrZc_encode_basestringrrFcompilerr!ZHAS_UTF8rrangei setdefaultchrrrCrErr"objectr#r?rarbrcr7r:r8r;rDrGrrrrsZ        >PK!*ww%__pycache__/tool.cpython-38.opt-1.pycnu[U ,a @sjdZddlZddlZddlZddZedkrfz eWn.ek rdZzeej W5dZ[XYnXdS)aCommand-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) Nc Cs4d}d}tj||d}|jddtjdddtjd |jd dtjd ddd tjd |jd dddd|jddddd|}|j}|j }|j }|j }||~zJ|rdd|D}n t |f}|D] } t j| ||dd|dqWn,tk r} z t| W5d} ~ XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?zutf-8)encodingz-a JSON file to be validated or pretty-printed)nargstypehelpdefaultoutfilewz%write the output of infile to outfilez --sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actionr r z --json-linesz&parse input using the jsonlines formatcss|]}t|VqdS)N)jsonloads).0liner./opt/alt/python38/lib64/python3.8/json/tool.py ,szmain..) sort_keysindent )argparseArgumentParser add_argumentZFileTypesysstdinstdout parse_argsrr r json_linesrloaddumpwrite ValueError SystemExit) rrparserZoptionsrr rr!ZobjsobjerrrmainsD      r*__main__) __doc__rrrr*__name__BrokenPipeErrorexcexiterrnorrrrs $ PK!ڛDO1O1#__pycache__/__init__.cpython-38.pycnu[U ,a 8 @sdZdZdddddddgZd Zd d lmZmZd d lmZd dl Z eddddddddZ dddddddddd ddZ dddddddddd ddZ edddZ ddZdddddddddZdddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> mydict = {'4': 5, '6': 7} >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(f'Object of type {obj.__class__.__name__} ' ... f'is not JSON serializable') ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks|sD|rD|rD|rD|dkrD|dkrD|dkrD| dkrD| sD| sDt|} n2|dkrPt}|f||||||| | d| |} | D]} || qzdS)aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr2/opt/alt/python38/lib64/python3.8/json/__init__.pyrxsD- c Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB| sB| sBt|S|dkrNt}|f|||||||| d| |S)auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr)rencoder) rr r r r rrrrrrrrrrsD, ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjrrrrr+sT$     )__doc__ __version____all__ __author__decoderrrencoderrr%rrrrAr-rrrrrrsda   ? :  PK!Qa== ext/parser.sonuȯPK!'1@@U=ext/generator.sonuȯPK!L99 )__init__.pynu[PK!q ctool.pycnu[PK!8>/>/ hdecoder.pyonu[PK!y55 mencoder.pyonu[PK!N@@ 6encoder.pynu[PK!n66 u__init__.pycnu[PK!q 4Etool.pyonu[PK! zJscanner.pycnu[PK!y55 jSencoder.pycnu[PK! 3scanner.pyonu[PK!8>/>/ #decoder.pycnu[PK!n66 __init__.pyonu[PK!3)[tool.pynu[PK!TY55 wdecoder.pynu[PK!A h2scanner.pynu[PK!Ui%;__pycache__/tool.cpython-36.opt-1.pycnu[PK!B7f++(A__pycache__/encoder.cpython-36.opt-1.pycnu[PK!i r(Dn__pycache__/scanner.cpython-36.opt-1.pycnu[PK!ީi%Kv__pycache__/tool.cpython-36.opt-2.pycnu[PK!i r"{__pycache__/scanner.cpython-36.pycnu[PK!+d&&(__pycache__/decoder.cpython-36.opt-1.pycnu[PK!](__pycache__/scanner.cpython-36.opt-2.pycnu[PK!Ui__pycache__/tool.cpython-36.pycnu[PK!+d&&"__pycache__/decoder.cpython-36.pycnu[PK!)o^1^1).__pycache__/__init__.cpython-36.opt-1.pycnu[PK!)o^1^1#__pycache__/__init__.cpython-36.pycnu[PK!f n(C__pycache__/decoder.cpython-36.opt-2.pycnu[PK!(Z__pycache__/encoder.cpython-36.opt-2.pycnu[PK! ;) )u__pycache__/__init__.cpython-36.opt-2.pycnu[PK!B7f++"__pycache__/encoder.cpython-36.pycnu[PK!A__pycache__/tool.cpython-35.pycnu[PK!]""__pycache__/scanner.cpython-35.pycnu[PK!ff%__pycache__/tool.cpython-35.opt-2.pycnu[PK!ۂm.."__pycache__/encoder.cpython-35.pycnu[PK!vk))(__pycache__/decoder.cpython-35.opt-1.pycnu[PK!yy( __pycache__/scanner.cpython-35.opt-2.pycnu[PK!ۂm..(%__pycache__/encoder.cpython-35.opt-1.pycnu[PK!n ss(U__pycache__/decoder.cpython-35.opt-2.pycnu[PK!j>](n__pycache__/encoder.cpython-35.opt-2.pycnu[PK!vk))" __pycache__/decoder.cpython-35.pycnu[PK!½x.//#__pycache__/__init__.cpython-35.pycnu[PK!](&__pycache__/scanner.cpython-35.opt-1.pycnu[PK! $ $ )"__pycache__/__init__.cpython-35.opt-2.pycnu[PK!½x.//)__pycache__/__init__.cpython-35.opt-1.pycnu[PK!%*__pycache__/tool.cpython-35.opt-1.pycnu[PK!1z1ext.rbnu[PK!1+Ǔ00a3add/date_time.rbnu[PK!}VV8add/bigdecimal.rbnu[PK!Pmh;add/complex.rbnu[PK!% >add/struct.rbnu[PK!}ȋ Aadd/regexp.rbnu[PK!  Eadd/rational.rbnu[PK!&a\\ bHadd/core.rbnu[PK!"2Iadd/ostruct.rbnu[PK!mqq TMadd/date.rbnu[PK!J Qadd/time.rbnu[PK!k3Uadd/exception.rbnu[PK!a Xadd/range.rbnu[PK!ff [add/symbol.rbnu[PK!E”^generic_object.rbnu[PK!:oS;; Xdcommon.rbnu[PK!0.. }version.rbnu[PK!u֋o o php_json_scanner.hnu[PK!͚ php_json.hnu[PK!> jphp_json_parser.hnu[PK!?OGGUtree_builder.rbnu[PK!@Eyaml_events.rbnu[PK!|ruby_events.rbnu[PK!p6xx stream.rbnu[PK!igFcc JSON_parser.hnu[PK!V`` _JSON_parser.cnu[PK!Xm^m^`5 json.cnu[PK!++" __pycache__/encoder.cpython-38.pycnu[PK!*ww __pycache__/tool.cpython-38.pycnu[PK!]T( __pycache__/decoder.cpython-38.opt-2.pycnu[PK!?" __pycache__/scanner.cpython-38.pycnu[PK!Z&&" __pycache__/decoder.cpython-38.pycnu[PK! 7n&&( __pycache__/decoder.cpython-38.opt-1.pycnu[PK!j(4 __pycache__/scanner.cpython-38.opt-1.pycnu[PK!ېT(< __pycache__/encoder.cpython-38.opt-2.pycnu[PK!X!M )W __pycache__/__init__.cpython-38.opt-2.pycnu[PK!+(d __pycache__/scanner.cpython-38.opt-2.pycnu[PK!ڛDO1O1)l __pycache__/__init__.cpython-38.opt-1.pycnu[PK!qRR%e __pycache__/tool.cpython-38.opt-2.pycnu[PK!;SX ++( __pycache__/encoder.cpython-38.opt-1.pycnu[PK!*ww% __pycache__/tool.cpython-38.opt-1.pycnu[PK!ڛDO1O1# __pycache__/__init__.cpython-38.pycnu[PKYY