

def ParseData(self, raw_text_data, mime_type):
    "Parses the payload of a magic envelope's data field.\n\n    Args:\n      raw_text_data: Data in given MIME type.\n      mime_type: Type of the textual data.  application/atom+xml supported\n    Raises:\n      ValueError: The input format was unrecognized or badly formed.\n    Returns:\n      Parsed data suitable for passing in to other methods of this object.\n    "
    if (mime_type != 'application/atom+xml'):
        raise ValueError(('Unknown MIME type %s' % mime_type))
    d = et.ElementTree()
    raw_text_data = (raw_text_data.encode('utf8') if (type(raw_text_data) is unicode) else raw_text_data)
    d._setroot(et.XML(raw_text_data))
    return d

dataset/ETHPy150Open mimecuvalo/helloworld/packages/magicsig/__init__.py MagicEnvelopeProtocol.ParseData/original