code: def _confirm_dialog(self, prompt):
          ''' Prompts for a 'yes' or 'no' to given prompt. '''
          response = raw_input(prompt).strip().lower()
          valid = {'y': True, 'ye': True, 'yes': True, 'n': False, 'no': False}
          while True:
              try:
                  return valid[response]
              except:
                  response = raw_input("Please respond 'y' or 'n': ").strip().lower(f _confirm_dialog(self, prompt):
          ''' Prompts for a 'yes' or 'no' to given prompt. '''
          response = raw_input(prompt).strip().lower()
          valid = {'y': True, 'ye': True, 'yes': True, 'n': False, 'no': False}
          while True:
              try:
                  return valid[response]
              except:
                  response = raw_input("Please respond 'y' or 'n': ").strip().lower()
docs: Prompts for a 'yes' or 'no' to given prompt.