def prompt_text_input(message: str, allowed_values: set, lower_case=False) -> str:
    """
    prompts text input and check if it's an allowed value
    :param message: display message
    :param allowed_values: values allowed in a set, all allowed values should be in lower case
    :param lower_case: whether to convert the processed input to all lower case
    :return: processed input
    """
    text_input = input(message).strip()
    while text_input.lower() not in allowed_values:
        print("Invalid input. Try again.", end=' ')
        text_input = input(message).strip()

    return text_input.lower() if lower_case else text_input