@classmethod
    def parse_json(cls, source):
        if isinstance(source, basestring):
            source = json.loads(source, encoding='utf-8')

        el = cls(source['tag'], **source.get('attrs', {}))
        if source.get('text'):
            el.text = source['text']

        for child in source.get('children', []):
            el.append(cls.parse_json(child))

        return el
Parse the source and turn it into a proper MessageElement
dataset/ETHPy150Open flosch/simpleapi/example_project/client/python/sapi/message.py/MessageElement.parse_json