def get_confirmation(question):
    while True:
        response = input("%s (y/n): " % question).lower()
        if re.match(r'^[yn]', response) is not None:
            break
        print("Incorrect option '%s'" % response)

    return response[0] == 'y'
Will pose the question to the user and keep asking them until they
dataset/ETHPy150Open reviewboard/reviewboard/contrib/tools/generate_extension.py/get_confirmation