def _query_yes_no(question, default="<STR_LIT:yes>"):
valid = {"<STR_LIT:yes>": "<STR_LIT:yes>", "<STR_LIT:y>": "<STR_LIT:yes>", "<STR_LIT>": "<STR_LIT:yes>",<EOL>"<STR_LIT>": "<STR_LIT>", "<STR_LIT:n>": "<STR_LIT>"}<EOL>if default is None:<EOL><INDENT>prompt = "<STR_LIT>"<EOL><DEDENT>elif default == "<STR_LIT:yes>":<EOL><INDENT>prompt = "<STR_LIT>"<EOL><DEDENT>elif default == "<STR_LIT>":<EOL><INDENT>prompt = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % default)<EOL><DEDENT>while <NUM_LIT:1>:<EOL><INDENT>sys.stdout.write(question + prompt)<EOL>try:<EOL><INDENT>choice = input().lower()<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>print()<EOL>return "<STR_LIT>"<EOL><DEDENT>if default is not None and choice == '<STR_LIT>':<EOL><INDENT>return default<EOL><DEDENT>elif choice in list(valid.keys()):<EOL><INDENT>return valid[choice]<EOL><DEDENT>else:<EOL><INDENT>sys.stdout.write("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>
Ask a yes/no question via raw_input() and return their answer.

    "question" is a string that is presented to the user.
    "default" is the presumed answer if the user just hits <Enter>.
        It must be "yes" (the default), "no" or None (meaning
        an answer is required of the user).

    The "answer" return value is one of "yes" or "no".