ACC SHELL

Path : /usr/lib/python/json/
File Upload :
Current File : //usr/lib/python/json/encoder.pyc

Ñò
rÄMc@sLdZddkZddkZyddklZWnej
o
dZnXdgZei	dƒZ
ei	dƒZei	dƒZhdd	6d
d6dd
6dd6dd6dd6dd6Z
x3edƒD]%Ze
ieeƒdieƒƒqÈWeZed„Zd„Zd„Zedj	o
eZneZdefd„ƒYZdS(sImplementation of JSONEncoder
iÿÿÿÿN(tencode_basestring_asciitJSONEncoders[\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}nt|ƒ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/lib/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/lib/python2.6/json/encoder.pytreplace8sR(tESCAPEtsub(tsR((s"/usr/lib/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/lib/python2.6/json/encoder.pyR@s

R(t
isinstancetstrtHAS_UTF8tsearchtNonetdecodetESCAPE_ASCIIR(RR((s"/usr/lib/python2.6/json/encoder.pytpy_encode_basestring_ascii=s&	c
Bs¤eZdZddddgZdZdZeeeeeddddd„	Z	d	„Z
dd
„Zdd„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/lib/python2.6/json/encoder.pyR'ws-							


cCsdd|i|iS(Ns
t (R/R0(R4((s"/usr/lib/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#tidRR/R0R7R1tTruetFalset_iterencode(	R4tlsttmarkerstmarkeridtnewline_indentt	separatortfirsttvaluetchunk((s"/usr/lib/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:RR2R/R0R7R1R;R,RRR
R.tkeystsortt	iteritemsR3RR R$t
basestringtfloatRtinttlongR<R+t	TypeErrorRR=(R4tdctR?R@R2RAR1RCtencoderR
RLt_[1]tktitemst	_encodingt
_do_decodetkeyRDRE((s"/usr/lib/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|tt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:Rt_iterencode_default(R4RR?RURYRER@((s"/usr/lib/python2.6/json/encoder.pyR=sJ

	
	
	
	



	
cCs|i|ƒ}|i||ƒS(N(R(R=(R4RR?tnewobj((s"/usr/lib/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/lib/python2.6/json/encoder.pyR(FscCs t|tƒont|tƒo;|i}|dj	o!|djo|i|ƒ}q[n|iot|ƒ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/lib/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/lib/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/lib/python2.6/json/encoder.pyRWs	8	!G&		(RgtreRt_jsonRtc_encode_basestring_asciitImportErrorR#RhtcompileRR%R!Rtrangetit
setdefaulttchrRR
R	R;RRR&tobjectR(((s"/usr/lib/python2.6/json/encoder.pyt<module>s:	

#			



ACC SHELL 2018