def _execute_formatting_func(self, dataset: "FeedbackDataset") -> Any:
        """
        Execute the formatting function on the dataset and return the output.
        """

        def test_none_sample(sample: Any) -> list:
            """
            Check for None values in the sample. If there are None values, return an empty list.
            """

            if sample is None:
                return []
            if isinstance(sample, (list, typing.Generator)):
                values = [test_none_sample(entry) for entry in sample]
                values = [value for value in values if value]
                values = [value[0] for value in values]
                return values
            else:
                return [sample]

        def test_output_formatting_func(sample: Any) -> list:
            """
            Test if the formatting function returns the expected format.
            """
            try:
                if isinstance(sample, list):
                    return [self._formatting_func_return_types(format=entry).format for entry in sample]
                else:
                    return [self._formatting_func_return_types(format=sample).format]
            except Exception:
                raise ValueError(
                    f"formatting_func must return {self._formatting_func_return_types.__annotations__['format']}, not {type(sample)}"
                )

        formatted_output = []
        for sample in dataset.format_as("datasets"):
            formatted_sample = self.formatting_func(sample)
            formatted_sample = test_none_sample(formatted_sample)
            if not formatted_sample:
                continue
            formatted_output += test_output_formatting_func(formatted_sample)
        return formatted_output

        Execute the formatting function on the dataset and return the output.
        
argilla-v1/src/argilla_v1/client/feedback/training/schemas/base.py