





"""simple docstring"""




from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset

class  __A       (  lowerCamelCase__      ):


				def _snake_case    (						self							):
								return [
								    {"col_1": 3, "col_2": "a"},
								    {"col_1": 2, "col_2": "b"},
								    {"col_1": 1, "col_2": "c"},
								    {"col_1": 0, "col_2": "d"},
								]


				def _snake_case    (						self							):
								lowerCamelCase			={'''col_1''': [3, 2, 1, 0], '''col_2''': ['''a''', '''b''', '''c''', '''d''']}
								return Dataset.from_dict(__A							)


				def _snake_case    (						self							):
								lowerCamelCase			=self._create_example_records()
								lowerCamelCase			=Dataset.from_list(__A							)
								self.assertListEqual(dset.column_names				,	["""col_1""", """col_2"""]							)
								for i, r in enumerate(__A							):
												self.assertDictEqual(__A				,	example_records[i]							)


				def _snake_case    (						self							):
								lowerCamelCase			=self._create_example_records()
								lowerCamelCase			=Dataset.from_list(__A							)
								lowerCamelCase			=Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]}							)
								self.assertEqual(dset.info				,	dset_from_dict.info							)


				def _snake_case    (						self							):  # checks what happens with missing columns
								lowerCamelCase			=[{'''col_1''': 1}, {'''col_2''': '''x'''}]
								lowerCamelCase			=Dataset.from_list(__A							)
								self.assertDictEqual(dset[0]				,	{"""col_1""": 1}							)
								self.assertDictEqual(dset[1]				,	{"""col_1""": None}							)  # NB: first record is used for columns


				def _snake_case    (						self							):  # checks if the type can be inferred from the second record
								lowerCamelCase			=[{'''col_1''': []}, {'''col_1''': [1, 2]}]
								lowerCamelCase			=Dataset.from_list(__A							)
								self.assertEqual(dset.info.features["""col_1"""]				,	Sequence(Value("""int64"""							)							)							)


				def _snake_case    (						self							):
								lowerCamelCase			=Dataset.from_list([]							)
								self.assertEqual(len(__A							)				,	0							)
								self.assertListEqual(dset.column_names				,	[]							)












from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels
from .squad import SquadExample, SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features
from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor
from .xnli import xnli_output_modes, xnli_processors, xnli_tasks_num_labels





