def validateYesNo(value, blank=False, strip=None, allowlistRegexes=None, blocklistRegexes=None, yesVal='<STR_LIT:yes>', noVal='<STR_LIT>', caseSensitive=False, excMsg=None):
<EOL>_validateGenericParameters(blank=blank, strip=strip, allowlistRegexes=allowlistRegexes, blocklistRegexes=blocklistRegexes)<EOL>returnNow, value = _prevalidationCheck(value, blank, strip, allowlistRegexes, blocklistRegexes, excMsg)<EOL>if returnNow:<EOL><INDENT>return value<EOL><DEDENT>yesVal = str(yesVal)<EOL>noVal = str(noVal)<EOL>if len(yesVal) == <NUM_LIT:0>:<EOL><INDENT>raise PySimpleValidateException('<STR_LIT>')<EOL><DEDENT>if len(noVal) == <NUM_LIT:0>:<EOL><INDENT>raise PySimpleValidateException('<STR_LIT>')<EOL><DEDENT>if (yesVal == noVal) or (not caseSensitive and yesVal.upper() == noVal.upper()):<EOL><INDENT>raise PySimpleValidateException('<STR_LIT>')<EOL><DEDENT>if (yesVal[<NUM_LIT:0>] == noVal[<NUM_LIT:0>]) or (not caseSensitive and yesVal[<NUM_LIT:0>].upper() == noVal[<NUM_LIT:0>].upper()):<EOL><INDENT>raise PySimpleValidateException('<STR_LIT>')<EOL><DEDENT>returnNow, value = _prevalidationCheck(value, blank, strip, allowlistRegexes, blocklistRegexes, excMsg)<EOL>if returnNow:<EOL><INDENT>return value<EOL><DEDENT>if caseSensitive:<EOL><INDENT>if value in (yesVal, yesVal[<NUM_LIT:0>]):<EOL><INDENT>return yesVal<EOL><DEDENT>elif value in (noVal, noVal[<NUM_LIT:0>]):<EOL><INDENT>return noVal<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if value.upper() in (yesVal.upper(), yesVal[<NUM_LIT:0>].upper()):<EOL><INDENT>return yesVal<EOL><DEDENT>elif value.upper() in (noVal.upper(), noVal[<NUM_LIT:0>].upper()):<EOL><INDENT>return noVal<EOL><DEDENT><DEDENT>_raiseValidationException(_('<STR_LIT>') % (_errstr(value), yesVal, noVal), excMsg)<EOL>
Raises ValidationException if value is not a yes or no response.
    Returns the yesVal or noVal argument, not value.

    Note that value can be any case (by default) and can also just match the

    * value (str): The value being validated as an email address.
    * blank (bool):  If True, a blank string will be accepted. Defaults to False.
    * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped.
    * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers.
    * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation.
    * caseSensitive (bool): Determines if value must match the case of yesVal and noVal. Defaults to False.
    * excMsg (str): A custom message to use in the raised ValidationException.

    >>> import pysimplevalidate as pysv
    >>> pysv.validateYesNo('y')
    'yes'
    >>> pysv.validateYesNo('YES')
    'yes'
    >>> pysv.validateYesNo('No')
    'no'
    >>> pysv.validateYesNo('OUI', yesVal='oui', noVal='no')
    'oui'