def confirm(question, error_response='Valid options : yes or no'):
    """
         ask the user if they would like to perform the action

         Parameters:
             question       - the question you would like to ask the user to confirm.
             error_response - the message to display if an invalid option is given.
    """
    while True:
        answer = raw_input(question).lower()
        if answer in ('y', 'yes'):
            return True
        if ('n', 'no' ) in answer:
            return False
        print(error_response)
dataset/ETHPy150Open graphite-project/whisper/contrib/whisper-auto-resize.py/confirm/swapped operands of `in`