https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/simplejson/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/simplejson/encoder.pyo
�
6ȩSc@@s�dZddlmZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZd�Ze�\ZZdd	lmZejd
�Zejd�Zejd�Zid
d6dd6dd6dd6dd6dd6dd6Zx1ed�D]#Zejee�def�q	Wx1ddgD]#Zeje
e�def�q=WeZee	d�d�Zed �Z ep�e Z!d!e"fd"��YZ#d#e#fd$��YZ$ee%eee&e'e(e
e)e*e+e,d%�Z-dS(&sImplementation of JSONEncoder
i(tabsolute_importN(t
itemgetter(tDecimali(tutunichrtbinary_typetstring_typest
integer_typestPY3cC@s=y$ddlm}|j|jfSWntk
r8dSXdS(Ni(t	_speedups(NN(tR	tencode_basestring_asciitmake_encodertImportErrortNone(R	((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt_import_speedupss

(tPosInfu[\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%04xi( i) cC@s�|r*t|t�r`|jd�}q`n6t|t�r`tj|�dk	r`|jd�}nd�}|tj||�|S(s5Return a JSON representation of a Python string

    sutf-8cS@st|jd�S(Ni(t
ESCAPE_DCTtgroup(tmatch((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pytreplace3sN(	t
isinstanceRtdecodetstrtHAS_UTF8tsearchRtESCAPEtsub(tst_PY3t_qR((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pytencode_basestring)s$	cC@s�|r*t|t�r`|jd�}q`n6t|t�r`tj|�dk	r`|jd�}nd�}dttj||��dS(sAReturn an ASCII-only JSON representation of a Python string

    sutf-8cS@s�|jd�}yt|SWnltk
r�t|�}|dkrNd|fS|d8}d|d?d@B}d|d@B}d||fSnXdS(	Niis\u%04xi�i
i�i�s\u%04x\u%04x(RRtKeyErrortord(RRtnts1ts2((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRBs

RN(	RRRRRRRtESCAPE_ASCIIR(RRR((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pytpy_encode_basestring_ascii8s$	tJSONEncodercB@steZdZdZdZeeeeeddddeeeedeedd�Zd�Z	d�Z
ed�ZRS(	sZExtensible JSON <http://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict, namedtuple  | 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-8cC@s||_||_||_||_||_|
|_||_||_|
|_||_	||_
||_||_|dk	r�t|t�r�|d}n||_|dk	r�|\|_|_n|dk	r�d|_n|	dk	r�|	|_n||_dS(sConstructor 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 string, then JSON array elements and object members
        will be pretty-printed with a newline followed by that string repeated
        for each level of nesting. ``None`` (the default) selects the most compact
        representation without any newlines. For backwards compatibility with
        versions of simplejson earlier than 2.1.0, an integer is also accepted
        and is converted to a string with that many spaces.

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

        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.

        If use_decimal is true (not the default), ``decimal.Decimal`` will
        be supported directly by the encoder. For the inverse, decode JSON
        with ``parse_float=decimal.Decimal``.

        If namedtuple_as_object is true (the default), objects with
        ``_asdict()`` methods will be encoded as JSON objects.

        If tuple_as_array is true (the default), tuple (and subclasses) will
        be encoded as JSON arrays.

        If bigint_as_string is true (not the default), ints 2**53 and higher
        or lower than -2**53 will be encoded as strings. This is to avoid the
        rounding that happens in Javascript otherwise.

        If int_as_string_bitcount is a positive number (n), then int of size
        greater than or equal to 2**n or lower than or equal to -2**n will be
        encoded as strings.

        If specified, item_sort_key is a callable used to sort the items in
        each dictionary. This is useful if you want to sort items other than
        in alphabetical order by key.

        If for_json is true (not the default), objects with a ``for_json()``
        method will use the return value of that method for encoding as JSON
        instead of the object.

        If *ignore_nan* is true (default: ``False``), then out of range
        :class:`float` values (``nan``, ``inf``, ``-inf``) will be serialized
        as ``null`` in compliance with the ECMA-262 specification. If true,
        this will override *allow_nan*.

        t t,N(tskipkeystensure_asciitcheck_circulart	allow_nant	sort_keystuse_decimaltnamedtuple_as_objectttuple_as_arraytbigint_as_stringt
item_sort_keytfor_jsont
ignore_nantint_as_string_bitcountRRRtindenttitem_separatort
key_separatortdefaulttencoding(tselfR+R,R-R.R/R8t
separatorsR<R;R0R1R2R3R4R5R6R7((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt__init__xs.T													
	cC@stt|�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(t	TypeErrortrepr(R=to((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyR;�scC@s�t|t�rF|j}|dk	rF|dkrF|j|�}qFnt|t�ru|jrht|�St|�Sn|j	|dt
�}t|ttf�s�t|�}n|jr�dj
|�Sdj
|�SdS(s�Return a JSON string representation of a Python data structure.

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

        sutf-8t	_one_shotR
uN(RRR<RRRR,RR t
iterencodetTruetlistttupletjoin(R=RBt	_encodingtchunks((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pytencode�s			

	
c	C@s�|jri}nd}|jr*t}nt}|jdkrT||jd�}n|j|jtt	t	d�}i}|j
r�dn|j}|r!tdk	r!|j
dkr!t||j||j
|j|j|j|j|j||j|j|j||j|j|j|jt�}nft||j||j
||j|j|j|j||j|j|j||j|j|jdt�}z||d�SWd|j�XdS(s�Encode the given object and yield each string
        representation as available.

        For example::

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

        sutf-8cS@s+t|t�r!|j|�}n||�S(N(RRR(RBt
_orig_encoderRI((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt_encoder(scS@s{||krd}n4||kr*d}n||kr?d}n
||�S|rXd}n|swtdt|���n|S(NtNaNtInfinitys	-Infinitytnulls2Out of range float values are not JSON compliant: (t
ValueErrorRA(RBR.R6t_reprt_inft_neginfttext((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pytfloatstr-s			
	i5RiN(R-RR,RR R<R.R6t
FLOAT_REPRRR3R7tc_make_encoderR8R;R:R9R/R+R0R1R2R4R5Rt_make_iterencodetclear(	R=RBRCtmarkersRMRVtkey_memoR7t_iterencode((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRDsB
					N(t__name__t
__module__t__doc__R9R:tFalseRERR?R;RKRD(((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyR(Xs		f		tJSONEncoderForHTMLcB@s#eZdZd�Zed�ZRS(s"An encoder that produces JSON safe to embed in HTML.

    To embed JSON content in, say, a script tag on a web page, the
    characters &, < and > should be escaped. They cannot be escaped
    with the usual entities (e.g. &amp;) because they are not expanded
    within <script> tags.
    cC@s9|j|t�}|jr(dj|�Sdj|�SdS(NR
u(RDRER,RH(R=RBRJ((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRKjs	
cc@sktt|�j||�}xI|D]A}|jdd�}|jdd�}|jdd�}|Vq"WdS(Nt&s\u0026t<s\u003ct>s\u003e(tsuperRbRDR(R=RBRCRJtchunk((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRDss
(R^R_R`RKRaRD(((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRbas		c @s��r"t��r"td��n|r>�r>td��n�
dk	ru�
dksf��
��rutd��n�
�fd����������	��
���������������fd������������f
d����������	���
�����������������fd�����������
���������������fd��
�
S(	Ns&item_sort_key must be None or callableis1int_as_string_bitcount must be a positive integerc@s^�dkp�dk}|sBd�>|ko=d�>knrL�|�Sd�|�dS(Nii����R(R(tvaluetskip_quoting(t_int_as_string_bitcountR(s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt_encode_int�s
c3@s|sdVdS�dk	rO�|�}|�krB�d��n|�|<nd}�dk	r�|d7}d�|}�|}||7}nd}�}t}x|D]}|r�t}n|}�|��s��r��|t�r�|�|�Vq�|dkr|dVq�|tkr*|dVq�|tkrB|dVq��|��rc|�|�Vq��|��r�|�|�Vq��r��|��r�|�|�Vq�|V�o�t|d	d�}|r�t|�r��	|�|�}	n��|��r�||�}	n��o%t|d
d�}
|
rOt|
�rO�
|
�|�}	nW�
rv�|��rv�||�}	n0�|��r��
||�}	n�	||�}	x|	D]}|Vq�Wq�W|dk	r�|d8}d�|VndV�dk	r�|=ndS(Ns[]sCircular reference detectedt[is
RPttruetfalseR5t_asdictt](RRERaRtgetattrtcallable(tlstt_current_indent_leveltmarkeridtbuftnewline_indentt	separatortfirstRhR5RJRoRg(RRQRRkRMt	_floatstrt	_for_jsont_indentt_item_separatorR]t_iterencode_dictt_iterencode_listt_namedtuple_as_objectt_tuple_as_arrayt_use_decimaltdicttfloattidRRRFR[RRRG(s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyR�sv




		


c@s��|�	�rn��|t�r3|j��}n��|��rQ�|�}n�|tkrfd}n�|tkr{d}n�|dkr�d}nk�|��r��|�}nM�r��|��r��|�}n)�r�d}ntdt|�d��|S(NRmRnRPskey s is not a string(RRRERaRR@RA(tkey(
RRIRzt	_skipkeysR�R�RRRR(s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt_stringify_key�s(				c
3@s�|sdVdS�dk	rO�|�}|�krB�d��n|�|<ndV�dk	r�|d7}d�|}�|}|Vnd}�}t}�r�|j�}n|j�}�	r<g}x]|j�D]O\}}	�|��s�|�}|dkrq�qn|j||	f�q�W|jd�	�n|}xE|D]=\}
}�	pg�|
��s��|
�}
|
dkr�qIq�n|r�t}n|V�|
�V�
V�|��s��r��|t�r��|�VqI|dkr�dVqI|tkr	dVqI|tkrd	VqI�|��r:�|�VqI�|��rW�|�VqI�rz�|��rz�|�VqI�o�t|d
d�}|r�t	|�r��
|�|�}
n��|��r��||�}
n��o�t|dd�}|rt	|�r�|�|�}
nW�r@�|��r@�||�}
n0�|��ra�||�}
n�
||�}
x|
D]}|VqwWqIW|dk	r�|d8}d�|VndV�dk	r��|=ndS(
Ns{}sCircular reference detectedt{is
R�RPRmRnR5Rot}(
RREtitemst	iteritemstappendtsortRaRRqRr(tdctRtRuRwR9RyR�R�tktvR�RhR5RJRoRg(RRQRRkRMRzR{R|R}t_item_sort_keyR]R~Rt_key_separatorR�R�R�R�R�R�R�RRRFR[RRRG(s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyR~s�


				


c3@s��|��s$�r2�|t�r2�|�VnQ|dkrFdVn=|tkrZdVn)|tkrndVn�|��r��|�Vn��|��r��|�Vn��o�t|dd�}|r�t|�r�x��|�|�D]}|Vq�Wn��|��r(xz�
||�D]}|VqWn[�o=t|dd�}|rwt|�rwx.�	|�|�D]}|VqeWn�r��|��r�x��
||�D]}|Vq�Wn��|��r�x��	||�D]}|Vq�Wn��
r�|��r�|�Vn��dk	rB�|�}|�kr5�d��n|�|<n�|�}x�||�D]}|Vq^W�dk	r��|=ndS(NRPRmRnR5RosCircular reference detected(RRRERaRqRr(RBRtR5RgRoRu(RRQRt_defaultRkRMRzR{R]R~RR�R�R�R�R�R�RRRFR[RRRG(s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyR]XsV

	(RrR@RR(R[R�RMR|RzR�R}t
_sort_keysR�RCR�R�R�RjR�RIR{RRQRRR�R�R�RRRFRRG(( RRQRR�RkRMRIRzR{R|RjR}R�R]R~RR�R�R�R�R�R�R�R�R�RRRFR[RRRGs8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyRY|s
WB*`WT0(.R`t
__future__RtretoperatorRtdecimalRtcompatRRRRRRRtc_encode_basestring_asciiRXtsimplejson.decoderRtcompileRR&RRtrangetit
setdefaulttchrRARWR R'RtobjectR(RbRQR�R�R�RRFRRGRY(((s8/usr/lib64/python2.7/site-packages/simplejson/encoder.pyt<module>sT.	
!!�
!

https://t.me/AnonymousX5 - 2025