

'''simple docstring'''



from unittest import TestCase

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



class lowerCamelCase			(  lowercase_						):



			'''simple docstring'''






			def lowercase__						(				self	:						List[Any]			)      ->		Union[str, Any]:





									'''simple docstring'''
									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 lowercase__						(				self	:						int			)      ->		List[Any]:





									'''simple docstring'''
									A__					:       Union[str, Any]     ={"""col_1""": [3, 2, 1, 0], """col_2""": ["""a""", """b""", """c""", """d"""]}
									return Dataset.from_dict(lowerCAmelCase_			)


			def lowercase__						(				self	:						Optional[Any]			)      ->		int:





									'''simple docstring'''
									A__					:       str     =self._create_example_records()
									A__					:       Dict     =Dataset.from_list(lowerCAmelCase_			)
									self.assertListEqual(dset.column_names		,      ["""col_1""", """col_2"""]			)
									for i, r in enumerate(lowerCAmelCase_			):
															self.assertDictEqual(lowerCAmelCase_		,      example_records[i]			)


			def lowercase__						(				self	:						Union[str, Any]			)      ->		Union[str, Any]:





									'''simple docstring'''
									A__					:       Any     =self._create_example_records()
									A__					:       List[Any]     =Dataset.from_list(lowerCAmelCase_			)
									A__					:       Union[str, Any]     =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 lowercase__						(				self	:						Dict			)      ->		str:  # checks what happens with missing columns





									'''simple docstring'''
									A__					:       Optional[int]     =[{"""col_1""": 1}, {"""col_2""": """x"""}]
									A__					:       int     =Dataset.from_list(lowerCAmelCase_			)
									self.assertDictEqual(dset[0]		,      {"""col_1""": 1}			)
									self.assertDictEqual(dset[1]		,      {"""col_1""": None}			)  # NB: first record is used for columns


			def lowercase__						(				self	:						Union[str, Any]			)      ->		Dict:  # checks if the type can be inferred from the second record





									'''simple docstring'''
									A__					:       List[Any]     =[{"""col_1""": []}, {"""col_1""": [1, 2]}]
									A__					:       List[Any]     =Dataset.from_list(lowerCAmelCase_			)
									self.assertEqual(dset.info.features["""col_1"""]		,      Sequence(Value("""int64"""			)			)			)



			def lowercase__						(				self	:						Any			)      ->		Any:





									'''simple docstring'''
									A__					:       Dict     =Dataset.from_list([]			)
									self.assertEqual(len(lowerCAmelCase_			)		,      0			)
									self.assertListEqual(dset.column_names		,      []			)




'''simple docstring'''



from __future__ import annotations
def 						__lowerCamelCase	(       __snake_case					:		list[int]	)	->							bool:






						"""simple docstring"""





						return len(set(__snake_case	)	) == len(__snake_case	)


if __name__ == "__main__":
		import doctest

		doctest.testmod()

