def write_root_rels(workbook):
    """Write the relationships xml."""
    root = Element('Relationships', xmlns=PKG_REL_NS)
    relation_tag = '{%s}Relationship' % PKG_REL_NS

    rel = Relationship(type="officeDocument", target=ARC_WORKBOOK, id="rId1")
    root.append(rel.to_tree())

    rel = Relationship("", target=ARC_CORE, id='rId2',)
    rel.type = PKG_REL_NS % "%s/metadata/core-properties"
    root.append(rel.to_tree())

    rel = Relationship("extended-properties", target=ARC_APP, id='rId3')

    root.append(rel.to_tree())

    if workbook.vba_archive is not None:
        # See if there was a customUI relation and reuse its id
        arc = fromstring(workbook.vba_archive.read(ARC_ROOT_RELS))
        rels = arc.findall(relation_tag)
        rId = None
        for rel in rels:
                if rel.get('Target') == ARC_CUSTOM_UI:
                        rId = rel.get('Id')
                        break
        if rId is not None:
            vba = Relationship("", target=ARC_CUSTOM_UI, id=rId)
            vba.type = CUSTOMUI_NS
            root.append(vba.to_tree())

    return tostring(root)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/writer/workbook.py/write_root_rels/swapped operands of `%`