(
        choice: Text, default: Optional[bool] = True,
        abort: Optional[bool] = True)
return value
Returns a bool from a yes/no question presented to the end user.

    Args:
        choice (str): the question presented to the end user.
        default (bool): the default for the confirmation answer. If True the
            default is Y(es), if False the default is N(o)
        abort (bool): if the program should abort if the user answer to the
            confirm prompt is no. The default is an abort.

    Raises:
        RuntimeError: If abort is set to True and the choice is no.

    Returns:
        bool: False if the user entered no, True if the user entered yes
Returns a bool from a yes/no question presented to the end user.
Returns a bool from a yes / no question presented to the end user .
def confirm_choice(
        choice: Text, default: Optional[bool] = True,
        abort: Optional[bool] = True) -> bool:
    """Returns a bool from a yes/no question presented to the end user.

    Args:
        choice (str): the question presented to the end user.
        default (bool): the default for the confirmation answer. If True the
            default is Y(es), if False the default is N(o)
        abort (bool): if the program should abort if the user answer to the
            confirm prompt is no. The default is an abort.

    Raises:
        RuntimeError: If abort is set to True and the choice is no.

    Returns:
        bool: False if the user entered no, True if the user entered yes
    """
    if default:
        hint = 'Y/n'
    else:
        hint = 'y/N'
    answer = input(f'{choice} [{hint}]: ')

    value = None
    if answer.lower() in ['y', 'yes']:
        value = True

    if answer.lower() in ['n', 'no']:
        value = False

    if not answer:
        value = default

    if value is None:
        print('Invalid answer')
        return confirm_choice(choice=choice, default=default, abort=abort)

    if abort and not value:
        raise RuntimeError('Aborting')

    return value
def confirm_choice ( choice : Text , default : Optional [ bool ] = True , abort : Optional [ bool ] = True ) -> bool : if default : hint = 'Y/n' else : hint = 'y/N' answer = input ( f'{choice} [{hint}]: ' ) value = None if answer . lower ( ) in [ 'y' , 'yes' ] : value = True if answer . lower ( ) in [ 'n' , 'no' ] : value = False if not answer : value = default if value is None : print ( 'Invalid answer' ) return confirm_choice ( choice = choice , default = default , abort = abort ) if abort and not value : raise RuntimeError ( 'Aborting' ) return value