def parse_bool(text):
    if text.lower() in ('true', '1'):
        return True
    elif text.lower() in ('false', '0'):
        return False
    raise Exception('Invalid boolean: %s' % text)
Parse a string to a boolean, ignoring case. "true"/"1" is True,
dataset/ETHPy150Open kivy/kivy/kivy/parser.py/parse_bool