if (checkbox.get_attribute("checked") != "true" and check) or \
                (checkbox.get_attribute("checked") == "true" and not check):
            checkbox.click()