def check_all_same_idtype(glist, name):
    """Check all the graphs have the same idtype."""
    if len(glist) == 0:
        return
    idtype = glist[0].idtype
    for i, g in enumerate(glist):
        if g.idtype != idtype:
            raise DGLError(
                "Expect {}[{}] to have {} type ID, but got {}.".format(
                    name, i, idtype, g.idtype
                )
            )
Check all the graphs have the same idtype.
python/dgl/utils/checks.py