def load_string(json_string):
"""Deserialize `json_string` to Python Object. If `json_string` is not a valid json
document, just return `json_string`. It is used in the context of activity results: floto
handles str and JSON serialized results.
Parameters
----------
json_string : any
Returns
-------
obj
"""
try:
j = json.loads(json_string)
except (TypeError, json.JSONDecodeError):
j = json_string
return j
评论列表
文章目录