MCPcopy Index your code
hub / github.com/clips/pattern / decode

Method decode

pattern/web/json/decoder.py:401–410  ·  view source on GitHub ↗

Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document)

(self, s, _w=WHITESPACE.match)

Source from the content-addressed store, hash-verified

399 self.scan_once = make_scanner(self)
400
401 def decode(self, s, _w=WHITESPACE.match):
402 """Return the Python representation of ``s`` (a ``str`` or ``unicode``
403 instance containing a JSON document)
404
405 """
406 obj, end = self.raw_decode(s)
407 end = _w(s, end).end()
408 if end != len(s):
409 raise JSONDecodeError("Extra data", s, end, len(s))
410 return obj
411
412 def raw_decode(self, s, idx=0, _w=WHITESPACE.match):
413 """Decode a JSON document from ``s`` (a ``str`` or ``unicode``

Callers 6

_floatconstantsFunction · 0.45
loadsFunction · 0.45
encode_basestringFunction · 0.45
encodeMethod · 0.45
_encoderMethod · 0.45

Calls 3

raw_decodeMethod · 0.95
lenFunction · 0.85
JSONDecodeErrorClass · 0.85

Tested by

no test coverage detected