def normalize_records(
    records: Union[FeedbackRecord, Dict[str, Any], List[Union[FeedbackRecord, Dict[str, Any]]]],
) -> List[FeedbackRecord]:
    """Parses the records into a list of `FeedbackRecord` objects.

    Args:
        records: either a single `FeedbackRecord` or `dict` or a list of `FeedbackRecord` or `dict`.

    Returns:
        A list of `FeedbackRecord` objects.

    Raises:
        ValueError: if `records` is not a `FeedbackRecord` or `dict` or a list of `FeedbackRecord` or `dict`.
    """
    if isinstance(records, (dict, FeedbackRecord)):
        records = [records]

    if len(records) == 0:
        raise ValueError("Expected `records` to be a non-empty list of `dict` or `FeedbackRecord`.")

    new_records = []
    for record in records:
        if isinstance(record, dict):
            new_records.append(FeedbackRecord(**record))
        elif isinstance(record, FeedbackRecord):
            new_records.append(record)
        else:
            raise ValueError(
                "Expected `records` to be a list of `dict` or `FeedbackRecord`," f" got type `{type(record)}` instead."
            )
    return new_records
Parses the records into a list of `FeedbackRecord` objects.

    Args:
        records: either a single `FeedbackRecord` or `dict` or a list of `FeedbackRecord` or `dict`.

    Returns:
        A list of `FeedbackRecord` objects.

    Raises:
        ValueError: if `records` is not a `FeedbackRecord` or `dict` or a list of `FeedbackRecord` or `dict`.
    
argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py