code: def ask(prompt: str, limited_to: Optional[Collection[str]] = None):
      from dvc.ui import Console
  
      if not Console.isatty():
          return None
  
      while True:
          try:
              answer = input(prompt + " ").lower()
          except EOFError:
              return None
  
          if not limited_to:
              return answer
  
          if answer in limited_to:
              return answer
  
          logger.info(
              "Your response must be one of: %s. Please try again.",
              limited_to,
          )
  
imports: from getpass import getpass
  from typing import Collection, Optional
  from dvc.log import logger
label_desc: Use image node_id 1 for calling a global function with example usage: ask(prompt, limited_to) and returns: None, answer, answer, None