def accepts(message: str) -> bool:
    """Ask the user to respond 'y' or 'n' to the specified prompt.

    If the user supplies an invalid response (i.e., neither 'y' or 'n'), then
    the user is re-asked the question.

    Args:
        message: The question to ask the user.

    Returns:
        True if the user responds 'y' and false if the user responds 'n'.
    """
    response = None
    while response not in {"y", "n"}:
        print(f"{message} (y/n)", end=" ")
        response = input()

    assert response in {"y", "n"}
    return response == "y"