def check_quotes(card):
    retval = None
    for line in card.text_lines:
        quotes = len(re.findall(re.escape('"'), line.text))
        # HACK: the '" pattern in the training set is actually incorrect
        quotes += len(re.findall(re.escape('\'"'), line.text))
        if quotes > 0:
            thisval = quotes % 2 == 0
            if retval is None:
                retval = thisval
            else:
                retval = retval and thisval
    return retval
dataset/ETHPy150Open billzorn/mtgencode/scripts/mtg_validate.py/check_quotes/original