bg; dZddlmZddlZddlZddlZddlmZmZddl m Z m Z dZ e Z dgZejejzejzZd Ze\ZZZeeed Zejd eZd d dddddddZdZeedreZnd#dZejdjfdZ ddeejdj!eej"e fdZ#e pe#Z$ejdeZ%dZ&de%je&fd Z'e%je&fd!Z(Gd"de)Z*dS)$zImplementation of JSONDecoder )absolute_importN)PY3unichr) make_scannerJSONDecodeErrorc6 ddlm}|S#t$rYdSwxYw)Nr scanstring) _speedupsr ImportErrorr s I/opt/cloudlinux/venv/lib64/python3.11/site-packages/simplejson/decoder.py_import_c_scanstringr sA)))))) tts   JSONDecoderctjdkr.dd}tjd|\}}nt d}t d}||| fS)N) 7FF80000000000007FF0000000000000hexz>ddnaninf)sys version_infodecodestructunpackfloat)_BYTESrrs r_floatconstantsrs^ &  3::5AA=//SSEllEll cT>)z -InfinityInfinityNaNz(.*?)(["\\\x00-\x1f])"\/    )r#r$r%bfnrtzutf-8get_int_max_str_digitsct||kr#td|dt|dt|S)zBackport of the integer string length conversion limitation https://docs.python.org/3/library/stdtypes.html#int-max-str-digits zExceeds the limit (z+) for integer string conversion: value has z digits)len ValueErrorint)sINT_MAX_STR_DIGITSs r bounded_intr84sq q66& & &*l~l~l~ADEFAGAGAGAGHII I1vv r z^[0-9a-fA-F]{4}$cd}|||dz}||st|||dz  t|d|dzfS#t$rt|||dz wxYw)z5Scan a four digit hex number from s[end:end + 4] zInvalid \uXXXX escape sequencer)rr5r4)r6end_mmsgescs rscan_four_digit_hexr@>s ,C CaK.C 2c77/c1cAg.../3||S1W$$ ///c1cAg.../s AA$Tc b|t}g} | j} |dz } |||} | td|| |}| }| \}}|r2|s%t |t st ||}| ||dkrn|dkr!|rd}t|||| | ||}n#t$rtd|| wxYw|dkr1 ||}n!#t$rd}t|||wxYw|dz }no| ||dz\}}|d krH|d zd kr?|||d zd kr.| ||d z\}}|d zdkrd|d z dz|dz zz}|}t|}| ||| |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.NrzUnterminated string starting atr#r$zInvalid control character %r atuzInvalid \X escape sequence %riiirz\uii ) DEFAULT_ENCODINGappendrr<groups isinstanceunicode IndexErrorKeyErrorr)r6r<encodingstrict_br=_join_PY3 _maxunicode_scan_four_digit_hexchunks_appendbeginchunkprev_endcontent terminatorr>r?charuniuni2end2s r py_scanstringr^Jsw# FmG !GE51c  =!11e== =iikk#llnn   5 7G < < 5!'844 GG        4   7%c1h777 ### =C&CC = = =!11e== = = #:: 3#w 3 3 36%c1c222 3 1HCC,+AsQw77HCe##f &&#cAg+%''11!S1W== d&=F**!sV|&:)-&89CC#;;D k5l 5==# s CC.8DDz [ \t\n\r]*z c L|\} } |i}|j} g} | | | dz} | dkrv| |vr+|| | } | | | dz} | dkr*||| }|| dzfSi} | || } | | dzfS| dkrtd| | | dz } t| | ||\}} | ||}| | | dzdkr@|| | } | | | dzdkrtd| | | dz } | | |vr0| dz } | | |vr!|| | dz} n#t$rYnwxYw|| | \}} | ||f | | } | |vr)|| | dz} | | } n#t$rd} YnwxYw| dz } | dkrn| d krtd | | dz  | | } | |vr:| dz } | | } | |vr)|| | dz} | | } n#t$rd} YnwxYw| dz } | dkrtd | | dz ||| }|| fSt | } | || } | | fS) Nrr#}z8Expecting property name enclosed in double quotes or '}'T:zExpecting ':' delimiterrA,zExpecting ',' delimiter or '}'z1Expecting property name enclosed in double quotes) setdefaultr<rr rJrFdict)staterLrM scan_once object_hookobject_pairs_hookmemo_w_wsr6r<memo_getpairsnextcharresultkeyvalues r JSONObjectrrsHQ |H ES1W~H3 s??"Q**..""CS1W~H s?? ,**511sQw&E&# E**#'> ! __!J3 1HC5ah77ShsC   Sq[>S "Q**..""CS1W~$$%&?CHHH q v}}qS6S=="Qa..,,..C    D Yq#&& s c5\""" vH3bC!Gnn((**S6   HHH  q s??  __!"BAsQwOO O vH3qS6s??"Qa..,,..C vH   HHH  q s??!C37 g5n$""5))s{ KKE E"" #:s7:E E"!E" 5G GG;AI IIc|\}}g}|||dz}||vr.|||dz}|||dz}|dkr||dzfS|dkrtd|||j} |||\} }|| |||dz}||vr.|||dz}|||dz}|dz }|dkrng|dkrtd||dz  |||vr0|dz }|||vr!|||dz}n#t$rYnwxYw||fS)Nr]rAzExpecting value or ']'TrbzExpecting ',' delimiter or ']')r<rrFrJ) rerfrjrkr6r<valuesrnrTrqs r JSONArrayrvsHQ FS1W~H3bC!Gnn  ""Sq[>3sQw R63???mGYq#&& sSq[> s??"Qa..$$&&CS1W~H q s??  __!"BAsQwOO O v}}qS6S=="Qa..,,..C    D %* 3;s3:D.. D;:D;cNeZdZdZ d dZejefdZdejefdZ dS) ra3Simple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str, unicode | +---------------+-------------------+ | number (int) | int, long | +---------------+-------------------+ | number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ When allow_nan=True, it also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. NTFc 4|t}||_||_||_|pt|_|pt |_|p|r tj pd|_ ||_ t|_ t|_t |_i|_t'||_dS)a *encoding* determines the encoding used to interpret any :class:`str` objects decoded by this instance (``'utf-8'`` by default). It has no effect when decoding :class:`unicode` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as :class:`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 :class:`dict`. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). *object_pairs_hook* is an optional function that will be called with the result of any object literal decode with an ordered list of pairs. The return value of *object_pairs_hook* will be used instead of the :class:`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, :func:`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. :class:`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. :class:`float`). *allow_nan*, if True (default false), will allow the parser to accept the non-standard floats ``NaN``, ``Infinity``, and ``-Infinity``. *parse_constant*, if specified, will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. It is not recommended to use this feature, as it is rare to parse non-compliant JSON containing these values. *strict* controls the parser's behavior when it encounters an invalid control character in a string. The default setting of ``True`` means that unescaped control characters are parse errors, if ``False`` then control characters will be allowed in strings. N)rErLrgrhr parse_floatr8 parse_int _CONSTANTS __getitem__parse_constantrMrr parse_objectrv parse_arrayr parse_stringrirrf) selfrLrgryrzr}rMrh allow_nans r__init__zJSONDecoder.__init__;sb  'H  &!2&/%"1k,^1Uz?U1]Y] &$& %d++r c.|r*t|trt||j}||\}}|||}|t |krtd||t ||S)zzReturn the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) z Extra data)rHbytesstrrL raw_decoder<r3r)rr6rjrPobjr<s rrzJSONDecoder.decode{s  &Jq%(( &At}%%A??1%%SbCjjnn #a&&==!,3A?? ? r rc|dkrtd|||r$t|tstdt ||kr=t ||}|dkr|dz }n|dkr|||dzdkr|dz }||||| S) aDecode 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. Optionally, ``idx`` can be used to specify an offset in ``s`` where the JSON document begins. This can be used to decode a JSON document from a string that may have extraneous data at the end. rzExpecting valuez$Input string must be text, not bytesiru)idx)rrHr TypeErrorr3ordrfr<)rr6rrjrPord0s rrzJSONDecoder.raw_decodes 77""3Q<< <  D 1c** DBCC C q66C<<qv;;Dv~~q!CaK.N"B"Bq~~aRR3ZZ^^%5%5~666r )NNNNNTNF) __name__ __module__ __qualname____doc__r WHITESPACEmatchrrrr rrrs~<EI8<.3>,>,>,>,@&+#    !"j&6S777777r )r1)+r __future__rrerrcompatrrscannerrrr c_scanstring__all__VERBOSE MULTILINEDOTALLFLAGSrr"PosInfNegInfr{compile STRINGCHUNK BACKSLASHrEhasattrr5r8rr@join maxunicoder^r rWHITESPACE_STRrrrvobjectrrr rrsW&&&&&& 22222222 $#%%  / R\!BI-&o''VV  bj1599 U UU    73()) KK$.2:.A#B#B#H / / / /$( *#( cn0GGGGV *] RZ u - - !%  \\\\|$.#3""""HD7D7D7D7D7&D7D7D7D7D7r