




from unittest import TestCase

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




class       _A				(		__UpperCAmelCase     ):






		def 				UpperCAmelCase (    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 				UpperCAmelCase (    self			):
								_UpperCAmelCase      =			{"""col_1""": [3, 2, 1, 0], """col_2""": ["""a""", """b""", """c""", """d"""]}
								return Dataset.from_dict(__SCREAMING_SNAKE_CASE			)






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






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






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






		def 				UpperCAmelCase (    self			):
								_UpperCAmelCase      =			Dataset.from_list([]			)
								self.assertEqual(len(__SCREAMING_SNAKE_CASE			)						,		0			)
								self.assertListEqual(dset.column_names						,		[]			)





from __future__ import annotations




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				float:
						_UpperCAmelCase      =			sorted(numsa + numsa       )
						_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(len(snake_case       )			,     2       )
						if mod == 1:
												return all_numbers[div]
						else:
												return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				a													=			[float(x) for x in input("Enter the elements of first array: ").split()]
				a													=			[float(x) for x in input("Enter the elements of second array: ").split()]
				print(F'The median of two arrays is: {median_of_two_arrays(array_a, array_a)}')