code: def query_yes_no(question, default=None):  # pragma: no cover
      
      valid = {'yes': True, 'y': True, 'ye': True, 'no': False, 'n': False}
      if default is None:
          prompt = ' [y/n] '
      elif default == 'yes':
          prompt = ' [Y/n] '
      elif default == 'no':
          prompt = ' [y/N] '
      else:
          raise ValueError('invalid default answer: "{0}"'.format(default))
  
      while True:
          sys.stdout.write(question + prompt)
          choice = compat.input().lower()
  
          if default is not None and choice == '':
              return valid[default]
          elif choice in valid:
              return valid[choice]
          else:
              sys.stdout.write('Please answer with "yes" or "no" (or "y" or "n").\n')
docs: Ask a yes/no question via `raw_input()` and return their answer.
  
      :param question: A string that is presented to the user.
      :param default: 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".
  
      Code borrowed from cookiecutter
      https://github.com/audreyr/cookiecutter/blob/master/cookiecutter/prompt.py