def json_deserialize(json, unboxing_function=None):
"""JSON Deerialization of a given string.
Args:
json (str): The JSON serialized string to deserialize.
Returns:
dict: A dictionary representing the data contained in the
JSON serialized string.
"""
if json is None:
return None
try:
decoded = jsonpickle.decode(json)
except:
return json
if unboxing_function == None:
return decoded
elif type(decoded) == list:
return [unboxing_function(element) for element in decoded]
else:
return unboxing_function(decoded)
评论列表
文章目录