def check_attribute(targattr):
    # This is used if the attribute is optional (or if error checking is handled by the calling
    # routine); if an error needs to be raised, use get_attribute()
    if (targattr in PETRglobals.AttributeList):
        return (
            PETRglobals.AttributeList[
                PETRglobals.AttributeList.index(targattr) + 1]
        )
    else:
        return ""
Looks for targetattr in AttributeList; returns value if found, null string otherwise.
dataset/ETHPy150Open openeventdata/petrarch/petrarch/PETRreader.py/check_attribute