MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / load_json_attr

Function load_json_attr

backend/tkhelper/utils/utils.py:31–41  ·  view source on GitHub ↗
(row: Dict, key: str, default_value: Any = None)

Source from the content-addressed store, hash-verified

29
30
31def load_json_attr(row: Dict, key: str, default_value: Any = None):
32 data = row.get(key)
33 if data:
34 if isinstance(data, str):
35 return json.loads(data)
36 elif isinstance(data, dict) or isinstance(data, list):
37 return data
38 else:
39 return default_value
40 else:
41 return default_value
42
43
44class ResponseWrapper:

Callers 10

buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected