

@property
def next_id(self):
    '\n        The next available positive integer id value in this document. Gaps\n        in id sequence are filled. The id attribute value is unique in the\n        document, without regard to the element type it appears on.\n        '
    id_str_lst = self._element.xpath('//@id')
    used_ids = [int(id_str) for id_str in id_str_lst if id_str.isdigit()]
    for n in range(1, (len(used_ids) + 2)):
        if (n not in used_ids):
            return n

dataset/ETHPy150Open python-openxml/python-docx/docx/parts/document.py DocumentPart.next_id/original