def get_iref(doc: Doc, o_num: int, rev: int=-1) -> complex:
    """Build the relevant indirect reference for o_num in a doc revision."""
    current = doc.index[rev]
    if current[o_num]:
        o_gen = current[o_num]['o_gen']
        return complex(o_gen, o_num)
    else:
        return None
Build the relevant indirect reference for o_num in a doc revision.
pdfsyntax/docstruct.py