def METHOD_NAME(prompt, default=None, interrupt=None):
    """Asks a question and returns a boolean (y/n) answer.
    If default is given (one of 'y','n'), it is used if the user input is
    empty. If interrupt is given (one of 'y','n'), it is used if the user
    presses Ctrl-C. Otherwise the question is repeated until an answer is
    given.
    An EOF is treated as the default answer.  If there is no default, an
    exception is raised to prevent infinite loops.
    Valid answers are: y/yes/n/no (match is not case sensitive)."""
    answers = {'y':True,'n':False,'yes':True,'no':False}
    ans = None
    while ans not in answers.keys():
        try:
            ans = input(prompt+' ').lower()
            if not ans:  # response was an empty string
                ans = default
        except KeyboardInterrupt:
            if interrupt:
                ans = interrupt
            print("\r")
        except EOFError:
            if default in answers.keys():
                ans = default
                print()
            else:
                raise
    return answers[ans]