


from unittest import TestCase

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




class 			UpperCamelCase_     (			UpperCamelCase):

	"""simple docstring"""





	def   UpperCAmelCase_				(			self      :    Optional[int]       )	->     List[Any]:
						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   UpperCAmelCase_				(			self      :    int       )	->     Dict:
						__SCREAMING_SNAKE_CASE						       =    {"col_1": [3, 2, 1, 0], "col_2": ["a", "b", "c", "d"]}
						return Dataset.from_dict(UpperCAmelCase__       )




	def   UpperCAmelCase_				(			self      :    str       )	->     Dict:
						__SCREAMING_SNAKE_CASE						       =    self._create_example_records()
						__SCREAMING_SNAKE_CASE						       =    Dataset.from_list(UpperCAmelCase__       )
						self.assertListEqual(dset.column_names      ,      ["col_1", "col_2"]       )
						for i, r in enumerate(UpperCAmelCase__       ):
											self.assertDictEqual(UpperCAmelCase__      ,      example_records[i]       )




	def   UpperCAmelCase_				(			self      :    int       )	->     int:
						__SCREAMING_SNAKE_CASE						       =    self._create_example_records()
						__SCREAMING_SNAKE_CASE						       =    Dataset.from_list(UpperCAmelCase__       )
						__SCREAMING_SNAKE_CASE						       =    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   UpperCAmelCase_				(			self      :    int       )	->     Optional[Any]:  # checks what happens with missing columns
						__SCREAMING_SNAKE_CASE						       =    [{"col_1": 1}, {"col_2": "x"}]
						__SCREAMING_SNAKE_CASE						       =    Dataset.from_list(UpperCAmelCase__       )
						self.assertDictEqual(dset[0]      ,      {"col_1": 1}       )
						self.assertDictEqual(dset[1]      ,      {"col_1": None}       )  # NB: first record is used for columns




	def   UpperCAmelCase_				(			self      :    Dict       )	->     Optional[Any]:  # checks if the type can be inferred from the second record
						__SCREAMING_SNAKE_CASE						       =    [{"col_1": []}, {"col_1": [1, 2]}]
						__SCREAMING_SNAKE_CASE						       =    Dataset.from_list(UpperCAmelCase__       )
						self.assertEqual(dset.info.features["col_1"]      ,      Sequence(Value("int64"       )       )       )




	def   UpperCAmelCase_				(			self      :    Optional[Any]       )	->     int:
						__SCREAMING_SNAKE_CASE						       =    Dataset.from_list([]       )
						self.assertEqual(len(UpperCAmelCase__       )      ,      0       )
						self.assertListEqual(dset.column_names      ,      []       )




"""simple docstring"""







def        UpperCAmelCase__	(lowerCAmelCase_  ,						lowerCAmelCase_       ):




					'''simple docstring'''


					if digit_amount > 0:
										return round(number - int(lowerCAmelCase_       )  ,						lowerCAmelCase_       )
					return number - int(lowerCAmelCase_       )


if __name__ == "__main__":
		print(decimal_isolate(1.53, 0))
		print(decimal_isolate(35.3_45, 1))
		print(decimal_isolate(35.3_45, 2))
		print(decimal_isolate(35.3_45, 3))
		print(decimal_isolate(-14.7_89, 3))
		print(decimal_isolate(0, 2))
		print(decimal_isolate(-14.1_23, 1))
		print(decimal_isolate(-14.1_23, 2))
		print(decimal_isolate(-14.1_23, 3))
