b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / json /
Filename/usr/lib64/python2.6/json/encoder.pyo
Size11.76 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 13:07
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc @sLdZddkZddkZyddklZWnej
o
dZnXdgZei d�Z
ei d�Z ei d�Z hdd 6d
d 6d d
6dd6dd6dd6dd6Z
x3ed�D]%Ze
iee�die��qÈWeZed�Zd�Zd�Zedj o
eZneZdefd��YZdS(sImplementation of JSONEncoder
iÿÿÿÿN(tencode_basestring_asciit JSONEncoders[\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}cCs�ti|�o
d}nHti|�o-tid|�djo
d}qad}n t|�S|p dt|�}t|��n|S(NtNaNgð?tInfinitys -Infinitys2Out of range float values are not JSON compliant: (tmathtisnantisinftcopysignt
FLOAT_REPRtreprt
ValueError(tot allow_nanttexttmsg((s$/usr/lib64/python2.6/json/encoder.pytfloatstrs



cCs!d�}dti||�dS(s5Return a JSON representation of a Python string

cSst|id�S(Ni(t
ESCAPE_DCTtgroup(tmatch((s$/usr/lib64/python2.6/json/encoder.pytreplace8sR(tESCAPEtsub(tsR((s$/usr/lib64/python2.6/json/encoder.pytencode_basestring4s cCs`t|t�o)ti|�dj o|id�}nd�}dtti||��dS(Nsutf-8cSs�|id�}y t|SWnttj
oht|�}|djodi|�S|d8}d|d?d@B}d|d@B}di||�SnXdS( Niis \u{0:04x}iØi
iÿiÜs\u{0:04x}\u{1:04x}(RRtKeyErrortordtformat(RRtnts1ts2((s$/usr/lib64/python2.6/json/encoder.pyR@s  

R(t
isinstancetstrtHAS_UTF8tsearchtNonetdecodet ESCAPE_ASCIIR(RR((s$/usr/lib64/python2.6/json/encoder.pytpy_encode_basestring_ascii=s& c
Bs¤eZdZddddgZdZdZeeeeeddddd� Z d �Z
dd
�Z dd �Z dd �Z
dd
�Zd�Zd�Zd�ZRS(sZExtensible JSON <http://json.org> 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``).

t__init__tdefaulttencodet
iterencodes, s: sutf-8c

Cs�||_||_||_||_||_||_d|_|dj o|\|_|_ n| dj o
| |_
n||_ dS(s0Constructor 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 output is guaranteed to be str
objects with all incoming unicode characters escaped. If
ensure_ascii is false, the output will be unicode object.

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 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.

iN( tskipkeyst ensure_asciitcheck_circularR
t sort_keystindenttcurrent_indent_levelR#titem_separatort
key_separatorR(tencoding(
tselfR+R,R-R
R.R/t
separatorsR3R(((s$/usr/lib64/python2.6/json/encoder.pyR'ws-       


cCsdd|i|iS(Ns
t (R/R0(R4((s$/usr/lib64/python2.6/json/encoder.pyt_newline_indent±sc csE|p
dVdS|dj o7t|�}||jotd��n|||<ndV|idj o1|id7_|i�}|i|}|Vnd}|i}t}xF|D]>}|o
t}n|Vx|i ||�D] }|VqæWq·W|dj o|id8_|i�VndV|dj o ||=ndS(Ns[]sCircular reference detectedt[it](
R#tidR R/R0R7R1tTruetFalset _iterencode( R4tlsttmarkerstmarkeridtnewline_indentt separatortfirsttvaluetchunk((s$/usr/lib64/python2.6/json/encoder.pyt_iterencode_list´s>
 
 
  



ccsû|p
dVdS|dj o7t|�}||jotd��n|||<ndV|i}|idj o1|id7_|i�}|i|}|Vnd}|i}t}|i o
t
}nt }|i } |i
oE|i�}
|
i�g} |
D]} | | || fq~ }
n
|i�}
|i}|dj o |dj }xR|
D]J\}}t|t�o|o|i|�}qcnÉt|t�onµt|t�ot|| �}n�t|ttf�ot|�}nl|tjo
d}nU|tjo
d}n>|djo
d}n'|ioqantd i|���|o
t}n|V||�V|Vx|i||�D] }|Vq�WqaW|dj o|id8_|i�Vnd
V|dj o ||=ndS( Ns{}sCircular reference detectedt{isutf-8ttruetfalsetnullskey {0!r} is not a stringt}(R#R:R R2R/R0R7R1R;R,RRR
R.tkeystsortt iteritemsR3RR R$t
basestringtfloatRtinttlongR<R+t TypeErrorRR=(R4tdctR?R@R2RAR1RCtencoderR
RLt_[1]tktitemst _encodingt
_do_decodetkeyRDRE((s$/usr/lib64/python2.6/json/encoder.pyt_iterencode_dictÕs�
 
  
  

 
 
/  

 







 


ccst|t�op|io
t}nt}|i}|dj o1t|t�o!|dj o|i|�}n||�Vn}|djo dVng|t jo dVnQ|t
jo dVn;t|t t f�ot|�Vnt|t
�ot||i�Vnñt|ttf�o&x×|i||�D] }|Vq5Wnµt|t�o&x¡|i||�D] }|VqkWn|dj o7t|�}||jotd��n|||<nx|i||�D] }|VqÕW|dj o ||=ndS(Nsutf-8RJRHRIsCircular reference detected(RROR,RRR3R#R R$R;R<RQRRRPRR
tlistttupleRFtdictR\R:R t_iterencode_default(R4R R?RURYRER@((s$/usr/lib64/python2.6/json/encoder.pyR=sJ

 
 
 
 


 
 
cCs|i|�}|i||�S(N(R(R=(R4R R?tnewobj((s$/usr/lib64/python2.6/json/encoder.pyR`BscCstt|�d��dS(s$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)
return JSONEncoder.default(self, o)

s is not JSON serializableN(RSR
(R4R ((s$/usr/lib64/python2.6/json/encoder.pyR(FscCs t|t�ont|t�o;|i}|dj o!|dj o|i|�}q[n|io t|�St|�Snt |i
|��}di |�S(s¦Return a JSON string representation of a Python data structure.

>>> JSONEncoder().encode({"foo": ["bar", "baz"]})
'{"foo": ["bar", "baz"]}'

sutf-8tN( RROR R3R#R$R,RRR]R*tjoin(R4R RYtchunks((s$/usr/lib64/python2.6/json/encoder.pyR)Zs 

 cCs*|io
h}nd}|i||�S(sØEncode the given object and yield each string representation as
available.

For example::

for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)

N(R-R#R=(R4R R?((s$/usr/lib64/python2.6/json/encoder.pyR*rs


N(t__name__t
__module__t__doc__t__all__R1R2R<R;R#R'R7RFR\R=R`R(R)R*(((s$/usr/lib64/python2.6/json/encoder.pyRWs 8  ! G &   (RgtreRt_jsonRtc_encode_basestring_asciit ImportErrorR#RhtcompileRR%R!Rtrangetit
setdefaulttchrRR
R R;RRR&tobjectR(((s$/usr/lib64/python2.6/json/encoder.pyt<module>s:    

#