api_helper.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:MundiAPI-PYTHON 作者: mundipagg 项目源码 文件源码
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 is None:
            return decoded
        elif isinstance(decoded, list):
            return [unboxing_function(element) for element in decoded]
        else:
            return unboxing_function(decoded)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号