
import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict


@pytest.mark.parametrize(
    "split_dict"				,					[
        SplitDict(),
        SplitDict({"train": SplitInfo(name="train"				,					num_bytes=1337				,					num_examples=42				,					dataset_name="my_dataset"    )}    ),
        SplitDict({"train": SplitInfo(name="train"				,					num_bytes=1337				,					num_examples=42    )}    ),
        SplitDict({"train": SplitInfo()}    ),
    ]				,					)
def 			UpperCamelCase					(    __lowerCamelCase     : SplitDict    ):
       snake_case       :   List[Any]							=      split_dict._to_yaml_list()
       assert len(__lowerCamelCase    ) == len(__lowerCamelCase    )
       snake_case       :   List[Any]							=      SplitDict._from_yaml_list(__lowerCamelCase    )
       for split_name, split_info in split_dict.items():
              # dataset_name field is deprecated, and is therefore not part of the YAML dump
              snake_case       :   Tuple							=      None
              # the split name of split_dict takes over the name of the split info object
              snake_case       :   str							=      split_name
       assert split_dict == reloaded




@pytest.mark.parametrize(
    "split_info"				,					[SplitInfo(), SplitInfo(dataset_name=__lowerCamelCase    ), SplitInfo(dataset_name="my_dataset"    )]    )
def 			UpperCamelCase					(    __lowerCamelCase     : Dict    ):
       # For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
       # field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
       snake_case       :   Tuple							=      asdict(SplitDict({"train": split_info}    )    )
       assert "dataset_name" in split_dict_asdict["train"]
       assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name







from __future__ import annotations




def    __UpperCamelCase     (				lowerCAmelCase__							:				list[float]  ,   lowerCAmelCase__							:				list[float]  ):
 __a :  Dict						=  sorted(numsa + numsa  )
 __a				,       __a :  Optional[Any]						=  divmod(len(lowerCAmelCase__  )  ,   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()
      lowercase__       =[float(x) for x in input('Enter the elements of first array: ').split()]
      lowercase__       =[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)}""")
