def bool_value(value, default=False):
    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 normalized_value in false_values:
        return False
    else:
        return default
Convert strings like 'yes', 'y', 'true', '1',
dataset/ETHPy150Open djng/djng/server/core/env_utils.py/bool_value