MCPcopy
hub / github.com/jazzband/django-constance / loads

Function loads

constance/codecs.py:43–51  ·  view source on GitHub ↗

Deserialize json string to object.

(s, _loads=json.loads, *, first_level=True, **kwargs)

Source from the content-addressed store, hash-verified

41
42
43def loads(s, _loads=json.loads, *, first_level=True, **kwargs):
44 """Deserialize json string to object."""
45 if first_level:
46 return _loads(s, object_hook=object_hook, **kwargs)
47 if isinstance(s, dict) and "__type__" not in s and "__value__" not in s:
48 return {k: loads(v, first_level=False) for k, v in s.items()}
49 if isinstance(s, list):
50 return list(loads(v, first_level=False) for v in s)
51 return _loads(s, object_hook=object_hook, **kwargs)
52
53
54def object_hook(o: dict) -> Any:

Callers 13

mgetMethod · 0.90
getMethod · 0.90
agetMethod · 0.90
amgetMethod · 0.90
setMethod · 0.90
getMethod · 0.90
agetMethod · 0.90
mgetMethod · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…