(option, value)
return validate_boolean(option, value)
Validates that value is True, False, 'true', or 'false'.
Validates that value is True, False, 'true', or 'false'.
Validates that value is True False true or false .
def validate_boolean_or_string(option, value):
    """Validates that value is True, False, 'true', or 'false'."""
    if isinstance(value, string_type):
        if value not in ('true', 'false'):
            raise ValueError("The value of %s must be "
                             "'true' or 'false'" % (option,))
        return value == 'true'
    return validate_boolean(option, value)
def validate_boolean_or_string ( option , value ) : if isinstance ( value , string_type ) : if value not in ( 'true' , 'false' ) : raise ValueError ( "The value of %s must be " "'true' or 'false'" % ( option , ) ) return value == 'true' return validate_boolean ( option , value )