def validate_questions(questions: typing.Union[AllowedQuestionTypes, typing.List[AllowedQuestionTypes]]) -> None:
    """Validates that the questions used in the filters are valid."""
    if not isinstance(questions, list):
        raise TypeError(f"Expected `questions` to be a list, got {type(questions)} instead.")

    any_required = False
    unique_names = set()
    for question in questions:
        if not isinstance(question, AllowedQuestionTypes.__args__):
            raise TypeError(
                "Expected `questions` to be a list of"
                f" `{'`, `'.join([arg.__name__ for arg in AllowedQuestionTypes.__args__])}` got a"
                f" question in the list with type {type(question)} instead."
            )
        if question.name in unique_names:
            raise ValueError(f"Expected `questions` to have unique names, got {question.name} twice instead.")
        unique_names.add(question.name)
        if not any_required and question.required:
            any_required = True

    if not any_required:
        raise ValueError("At least one question in `questions` must be required (`required=True`).")
Validates that the questions used in the filters are valid.
argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py