def to_list(
        records: List[Union["Record", Tuple["Record", float]]], flatten: bool = False
    ) -> List[Dict[str, Union[str, float, int, list]]]:
        """Export records to a list of dictionaries with either names or record index as keys.
        Args:
            flatten (bool): The structure of the exported dictionary.
                - True: The record fields, metadata, suggestions and responses will be flattened.
                - False: The record fields, metadata, suggestions and responses will be nested.
        Returns:
            dataset_records (List[Dict[str, Union[str, float, int, list]]]): The exported records in a list of dictionaries format.
        """
        records_schema = set()
        dataset_records: list = []
        for record in records:
            record_dict = GenericIO._record_to_dict(record=record, flatten=flatten)
            records_schema.update([k for k in record_dict])
            dataset_records.append(record_dict)

        # normalize records structure
        for record_dict in dataset_records:
            record_dict.update({k: None for k in records_schema if k not in record_dict})

        return dataset_records
Export records to a list of dictionaries with either names or record index as keys.
        Args:
            flatten (bool): The structure of the exported dictionary.
                - True: The record fields, metadata, suggestions and responses will be flattened.
                - False: The record fields, metadata, suggestions and responses will be nested.
        Returns:
            dataset_records (List[Dict[str, Union[str, float, int, list]]]): The exported records in a list of dictionaries format.
        
argilla/src/argilla/records/_io/_generic.py