tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
W\¬Qc @s|dZddlZyddlmZWnek
r?dZnXyddlmZWnek
rmdZnXej    dƒZ
ej    dƒZ ej    dƒZ idd    6d
d 6d d 6dd6dd6dd6dd6Z x3edƒD]%Ze jeeƒdjeƒƒqßWedƒZeZd„Zd„Zep5eZdefd„ƒYZeeeeeee e!e"e#e$d„ Z%dS(sImplementation of JSONEncoder
iÿÿÿÿN(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|jdƒS(Ni(t
ESCAPE_DCTtgroup(tmatch((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pytreplace%sR(tESCAPEtsub(tsR((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pytencode_basestring!s    cCs]t|tƒr6tj|ƒdk    r6|jdƒ}nd„}dttj||ƒƒdS(sAReturn an ASCII-only JSON representation of a Python string
 
    sutf-8cSs’|jdƒ}y t|SWnptk
rt|ƒ}|dkrPdj|ƒS|d8}d|d?d@B}d|d@B}dj||ƒSnXdS(    Niis    \u{0:04x}iØi
iÿiÜs\u{0:04x}\u{1:04x}(RRtKeyErrortordtformat(RR
tnts1ts2((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyR0s     
RN(t
isinstancetstrtHAS_UTF8tsearchtNonetdecodet ESCAPE_ASCIIR    (R
R((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pytpy_encode_basestring_ascii*s$    t JSONEncoderc
Bs\eZdZdZdZeeeeeddddd„    Zd„Z    d„Z
ed„Z RS(    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``).
 
    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#((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyt__init__es4                           cCstt|ƒdƒ‚dS(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((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyR#¥scCs»t|tƒrut|tƒrU|j}|dk    rU|dk rU|j|ƒ}qUn|jrht|ƒSt|ƒSn|j    |dt
ƒ}t|t t fƒs®t |ƒ}ndj |ƒS(s¦Return 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((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pytencodeºs          
 cCs|jri}nd}|jr*t}nt}|jdkrT||jd„}n|jttt d„}|rÔt    dk    rÔ|j
dkrÔ|j rÔt    ||j ||j
|j |j|j |j|jƒ    }n9t||j ||j
||j |j|j |j|ƒ
}||dƒS(sØEncode the given object and yield each string
        representation as available.
 
        For example::
 
            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)
 
        sutf-8cSs+t|tƒr!|j|ƒ}n||ƒS(N(RRR(R*t _orig_encoderR3((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyt_encoderçscSsl||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((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pytfloatstrìs               
iN(RRRRR R$Rt
FLOAT_REPRtINFINITYtc_make_encoderR RR#R"R!Rt_make_iterencode(R%R*R+tmarkersR7R?t _iterencode((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyR.Ôs*
               N( t__name__t
__module__t__doc__R!R"tFalseR/RR'R#R5R.(((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyRFs    >        csه‡‡‡‡‡‡‡‡ ‡ ‡‡‡‡‡‡‡‡‡fd†‰‡‡‡‡‡‡‡‡‡    ‡
‡ ‡ ‡ ‡‡‡‡‡‡‡‡‡fd†‰‡‡‡‡‡‡‡‡ ‡ ‡‡‡‡‡‡‡‡‡fd†‰ˆS(Nc
3s8|sdVdSˆdk    rOˆ |ƒ}|ˆkrBˆdƒ‚n|ˆ|<nd}ˆdk    r”|d7}ddˆ|}ˆ|}||7}n d}ˆ}t}xF|D]>}|rÂt}n|}ˆ |ˆƒré|ˆ|ƒVq­|dkr|dVq­|tkr|dVq­|tkr1|d    Vq­ˆ |ˆ ˆfƒrX|ˆ|ƒVq­ˆ |ˆ
ƒry|ˆ|ƒVq­|Vˆ |ˆˆfƒr¥ˆ||ƒ}n0ˆ |ˆ    ƒrƈ||ƒ}nˆ||ƒ}x|D] }    |    VqÜWq­W|dk    r|d8}ddˆ|Vnd
Vˆdk    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(sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyR] s^     
 
               
 c 3s|sdVdSˆdk    rOˆ|ƒ}|ˆkrBˆdƒ‚n|ˆ|<ndVˆdk    rŽ|d7}ddˆ|}ˆ|}|Vn d}ˆ}t}ˆ
rÄt|jƒdd„ƒ}n |jƒ}x÷|D]ï\}}ˆ|ˆ ƒrõn§ˆ|ˆ ƒrˆ|ƒ}n‰|tkr(d    }nt|tkr=d
}n_|dkrRd }nJˆ|ˆˆfƒrvˆ|ƒ}n&ˆ    r‚q×ntd t|ƒd ƒ‚|r«t}n|Vˆ|ƒVˆVˆ|ˆ ƒr݈|ƒVq×|dkrñd Vq×|tkrd    Vq×|tkrd
Vq׈|ˆˆfƒr<ˆ|ƒVq׈|ˆ ƒrYˆ|ƒVq׈|ˆˆfƒr€ˆ||ƒ}    n0ˆ|ˆ ƒr¡ˆ||ƒ}    nˆ||ƒ}    x|    D] }
|
Vq·Wq×W|dk    rô|d8}ddˆ|VndVˆdk    rˆ|=ndS(Ns{}sCircular reference detectedt{is
RKtkeycSs|dS(Ni((tkv((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyt<lambda>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(sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyR\Us„     
 
                           
 c3s†ˆ |ˆƒrˆ|ƒVne|dkr1dVnQ|tkrEdVn=|tkrYdVn)ˆ |ˆ ˆfƒr|ˆ|ƒVnˆ |ˆ    ƒr™ˆ|ƒVnéˆ |ˆ ˆfƒrÐxш||ƒD] }|Vq¾Wn²ˆ |ˆƒrx ˆ||ƒD] }|VqïWnˆdk    rAˆ
|ƒ}|ˆkr4ˆdƒ‚n|ˆ|<nˆ|ƒ}xˆ||ƒD] }|Vq]Wˆdk    r‚ˆ|=ndS(NRLRMRNsCircular reference detected(RR/RI(R*RQRXRR(R:t_defaultR7RYRER\R]R-R^R_R`RaRR0RbRDRR1(sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyRE¡s8               ((RDRoR7RZRYRlR[RnRmR+R:R-R^R_R`RaRR0RbRR1((R:RoR7RYRZR[RER\R]RlRmRnR-R^R_R`RaRR0RbRDRR1sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyRCsE5NLB(&RHtret_jsonRtc_encode_basestring_asciit ImportErrorRRRBtcompileRRRRtrangetit
setdefaulttchrRR_RAR)R@R RtobjectRR:R-R^R`RaRR0RbRR1RC(((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/json/encoder.pyt<module>sN  
 
 
#              Í