0
7 ˆ
ƒ g_•I|¥‰ÓMdœv ©ƒ&íK<óo¬a–ß=¿JJj"Tâ�vã`¸ÓJbÑ¿À §
Index of /FSS-BCZ/root/sys/devices/system/cpu/cpu3/node0/memory16/subsystem
Index of /FSS-BCZ/root/sys/devices/system/cpu/cpu3/node0/memory16/subsystem
$ ˆl–Ðz¾”Ëm
q@=q¦nõ1hßÄ
„d2ßÿÁ ?÷ """Implementation of JSONEncoder
"""
from __future__ import absolute_import
import re
from operator import itemgetter
# Do not import Decimal directly to avoid reload issues
import decimal
import sys
from .compat import binary_type, text_type, string_types, integer_types, PY3
# PEP 678 add_note() is available on Python 3.11+
_HAS_ADD_NOTE = sys.version_info >= (3, 11)
def _import_speedups():
try:
from . import _speedups
return (_speedups.encode_basestring_ascii,
_speedups.encode_basestring,
_speedups.make_encoder)
except ImportError:
return None, None, None
c_encode_basestring_ascii, c_encode_basestring, c_make_encoder = (
_import_speedups())
from .decoder import PosInf
from .raw_json import RawJSON
ESCAPE = re.compile(r'[\x00-\x1f\\"]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
}
for i in range(0x20):
ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
del i
FLOAT_REPR = repr
# dict-like types that should be encoded as JSON objects.
# frozendict is a builtin added in CPython 3.15 (PEP 814).
if sys.version_info >= (3, 15):
_dict_types = (dict, frozendict)
else:
_dict_types = dict
def py_encode_basestring(s, _PY3=PY3, _q=u'"'):
"""Return a JSON representation of a Python string
"""
if _PY3:
if isinstance(s, bytes):
s = str(s, 'utf-8')
elif type(s) is not str:
# convert an str subclass instance to exact str
# raise a TypeError otherwise
s = str.__str__(s)
else:
if isinstance(s, str) and HAS_UTF8.search(s) is not None:
s = unicode(s, 'utf-8')
elif type(s) not in (str, unicode):
# convert an str subclass instance to exact str
# convert a unicode subclass instance to exact unicode
# raise a TypeError otherwise
if isinstance(s, str):
s = str.__str__(s)
else:
s = unicode.__getnewargs__(s)[0]
def replace(match):
return ESCAPE_DCT[match.group(0)]
return _q + ESCAPE.s