def ask_yes_no(question: str) -> bool:
    """Ask the user the question until the user inputs a valid answer."""
    while True:
        try:
            print("{0} [y/n]".format(question))
            return strtobool(input().lower())
        except ValueError:
            pass
Ask the user the question until the user inputs a valid answer.
converters/stylegan2ada_tf_official/dnnlib/util.py