def check_choices(card):
    bullets = len(re.findall(re.escape(utils.bullet_marker), card.text.text))
    obracks = len(re.findall(re.escape(utils.choice_open_delimiter), card.text.text))
    cbracks = len(re.findall(re.escape(utils.choice_close_delimiter), card.text.text))
    if bullets + obracks + cbracks > 0:
        if not (obracks == cbracks and bullets > 0):
            return False
        # could compile ahead of time
        choice_regex = (re.escape(utils.choice_open_delimiter) + re.escape(utils.unary_marker)
                        + r'.*' + re.escape(utils.bullet_marker) + r'.*' 
                        + re.escape(utils.choice_close_delimiter))
        nochoices = re.sub(choice_regex, '', card.text.text)
        nobullets = len(re.findall(re.escape(utils.bullet_marker), nochoices))
        noobracks = len(re.findall(re.escape(utils.choice_open_delimiter), nochoices))
        nocbracks = len(re.findall(re.escape(utils.choice_close_delimiter), nochoices))
        return nobullets + noobracks + nocbracks == 0
    else:
        return None
dataset/ETHPy150Open billzorn/mtgencode/scripts/mtg_validate.py/check_choices/original