

def ToAtom(self, fulldoc=True, indentation=0):
    'Turns envelope into serialized Atom entry.\n\n    Args:\n      fulldoc: Return a full XML document with <?xml...\n      indentation: Indent each line this number of spaces.\n    Returns:\n      An Atom entry XML document with an me:provenance element\n      containing the original magic signature data.\n    '
    if (not self._parsed_data):
        self._parsed_data = self._protocol.ParseData(text, self._data_type)
    d = self._parsed_data
    assert (d.getroot().tag == (_ATOM_NS + 'entry'))
    prov_el = et.Element((_ME_NS + 'provenance'))
    data_el = et.SubElement(prov_el, (_ME_NS + 'data'))
    data_el.set('type', self._data_type)
    data_el.text = ('\n' + _ToPretty(self._data, (indentation + 6), 60))
    et.SubElement(prov_el, (_ME_NS + 'encoding')).text = indented_text._encoding
    et.SubElement(prov_el, (_ME_NS + 'sig')).text = ('\n' + _ToPretty(self._sig, (indentation + 6), 60))
    d.getroot().append(prov_el)
    self._PrettyIndent(d.getroot(), (indentation / 2))
    text = et.tostring(d.getroot(), encoding='utf-8')
    indented_text = ''
    for line in text.strip().split('\n'):
        if (line.strip() != ''):
            indented_text += (((' ' * indentation) + line) + '\n')
    if fulldoc:
        indented_text = ("<?xml version='1.0' encoding='UTF-8'?>\n" + indented_text)
    return indented_text

dataset/ETHPy150Open mimecuvalo/helloworld/packages/magicsig/__init__.py Envelope.ToAtom/VarMisuse@148/316 `self`->`indented_text`