def expand_xref_index(xref_index: list) -> list:
    """Transform index section pairs into a flat list of (object_number, subsection) tuples."""
    res = []
    subsection = 0
    i = 0
    while i < len(xref_index):
        o_num = xref_index[i]
        i += 1
        res.append((o_num, subsection))
        for j in range(xref_index[i]-1):
            res.append((o_num+j+1, subsection))
        i += 1
        subsection += 1
    return res
Transform index section pairs into a flat list of (object_number, subsection) tuples.
pdfsyntax/objects.py