code: def query_yes_no(
      question: str, default: Union[str, None] = "yes"
  ) -> bool:
      """Ask a yes/no question via ``input()`` and return ``True``/``False``.
  
      Source: `<https://stackoverflow.com/a/3041990>`_.
  
      Args:
          question: Question string presented to the user.
          default: 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).
  
      Returns:
          ``True`` for "yes" and "y" or ``False`` for "no" and "n".
      """
      # 1. Construct prompt
      if default == "yes":
          prompt = " [Y/n] "
      elif default == "no":
          prompt = " [y/N] "
      elif not default:
          prompt = " [y/n] "
      else:
          raise ValueError("Invalid default answer: '%s'" % default)
  
      # 2. Check user input and return correct boolean
      while True:
          # sys.stdout.write(question + prompt)
          print(question + prompt)
          choice = input()
          if default and choice == "":
              return str_to_bool(default)
          try:
              return str_to_bool(choice)
          except ValueError:
              print(
                  "Please respond with 'yes' or 'no' (or 'y' or 'n')."
              )
  
imports: import os
  import sys
  from contextlib import contextmanager
  from enum import EnumMeta, IntEnum
  from typing import Any, Dict, List, Optional, Union
  import requests
  from tqdm import tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: query_yes_no(question, default) and returns: str_to_bool, str_to_bool