def get_parent_id(element):
        """returns the ID of the parent of the given element"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
def get_parent_id ( element ) : if 'parent' in element . attrib : return element . attrib [ 'parent' ] else : return element . getparent ( ) . attrib [ add_ns ( 'id' ) ]
returns the ID of the parent of the given element