def is_dict_str_list_str()

in src/hyperpod_cli/validators/job_validator.py [0:0]


def is_dict_str_list_str(data: dict) -> bool:
    """
    Check if the given dictionary is of type Dict[str, List[str]].

    Parameters:
    data (dict): The dictionary to check.

    Returns:
    bool: True if the dictionary is of type Dict[str, List[str]], False otherwise.
    """
    for key, value in data.items():
        if not isinstance(value, list) and not isinstance(value, str):
            return False
        elif isinstance(value, list) and not all(
            isinstance(item, str) for item in value
        ):
            return False
    return True