code: def query_yes_no(question: str, default: Union[str, None] = "yes"):
      """Ask a yes/no question via raw_input() and return their answer.
  
      Args:
          question: String presented to the user
          default: The presumed answer from the user. Must be "yes", "no", or None (Answer is required)
  
      Returns: Boolean based on prompt response
      """
      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: '%s'" % default)
  
      while True:
          logger.info(question + prompt)
          choice = input().lower()
          if default is not None and choice == "":
              return valid[default]
          elif choice in valid:
              return valid[choice]
          else:
              logger.info(
                  "Please respond with 'yes' or 'no' "
                  "(or 'y' or 'n').\n"
              )
  
file_path: ludwig/ludwig/utils/print_utils.py
imports: import logging
  from collections import OrderedDict
  from pprint import pformat
  from typing import Dict, Union
  from ludwig.api_annotations import DeveloperAPI
label_desc: Use image node_id 6 for calling a global function with example usage: query_yes_no(question, default) and returns: valid, valid