federated/main.py
def validate_options_input(input_string: str, default: str, options: List[str]) -> str:
    """Custom input with validation where we have options.

    Args:
        input_string (str): Prompt string for input.\n
        default (str): Default value.\n
        options (List[str]): Options for input.\n

    Returns:
        str: Input value.
    """
    prompts = chain(
        [input_string + f"{options}. (default: {boldify(default)}): "],
        repeat(f"Input must be one of {options}. Try again: "),
    )
    replies = map(input, prompts)
    valid_response = next(filter(lambda x: (x in options + [""]), replies))

    if valid_response == "":
        return default

    return valid_response
Custom input with validation where we have options.

    Args:
        input_string (str): Prompt string for input.\n
        default (str): Default value.\n
        options (List[str]): Options for input.\n

    Returns:
        str: Input value.
    
Custom input with validation where we have options.
Custom input with validation where we have options .
def validate_options_input(input_string: str, default: str, options: List[str]) -> str:
    prompts = chain(
        [input_string + f"{options}. (default: {boldify(default)}): "],
        repeat(f"Input must be one of {options}. Try again: "),
    )
    replies = map(input, prompts)
    valid_response = next(filter(lambda x: (x in options + [""]), replies))
    if valid_response == "":
        return default
    return valid_response
def validate_options_input ( input_string : str , default : str , options : List [ str ] ) -> str : prompts = chain ( [ input_string + f"{options}. (default: {boldify(default)}): " ] , repeat ( f"Input must be one of {options}. Try again: " ) , ) replies = map ( input , prompts ) valid_response = next ( filter ( lambda x : ( x in options + [ "" ] ) , replies ) ) if valid_response == "" : return default return valid_response
Custom input with validation where we have options.
Custom input with validation where we have options .
"""Custom input with validation where we have options.

    Args:
        input_string (str): Prompt string for input.\n
        default (str): Default value.\n
        options (List[str]): Options for input.\n

    Returns:
        str: Input value.
    """
None
str
input_string
str
Prompt string for input.\n
Prompt string for input . \ n
default
str
None
options
List[str]
Options for input.\n
Options for input . \ n