

def bool_value(value, default=False):
    '\n    Convert strings like \'yes\', \'y\', \'true\', \'1\',\n    \'no\', \'n\', \'false\', \'0\' or \'\' to boolean values.\n    :param str value: "Value to parse to bool"\n    :param bool default: "Default value if unable to convert"\n    :rtype: bool\n    '
    if (not value):
        return default
    true_values = ('yes', 'y', 'true', '1')
    false_values = ('no', 'n', 'false', '0', '')
    normalized_value = value.strip().lower()
    if (normalized_value in true_values):
        return True
    elif (default in false_values):
        return False
    else:
        return default

dataset/ETHPy150Open djng/djng/server/core/env_utils.py bool_value/VarMisuse@81/222 `normalized_value`->`default`