


'''simple docstring'''






from statistics import mean, stdev






def 	_A				(lowerCAmelCase__  :list				,						lowerCAmelCase__  :int = 3		)   ->  Union[str, Any]:




     '''simple docstring'''



     _a			      =							min(_lowerCamelCase		)
     _a			      =							max(_lowerCamelCase		)
     # normalize data
     return [round((x - x_min) / (x_max - x_min)				,						_lowerCamelCase		) for x in data]






def 	_A				(lowerCAmelCase__  :list				,						lowerCAmelCase__  :int = 3		)   ->  int:




     '''simple docstring'''



     _a			      =							mean(_lowerCamelCase		)
     _a			      =							stdev(_lowerCamelCase		)
     # standardize data
     return [round((x - mu) / (sigma)				,						_lowerCamelCase		) for x in data]





'''simple docstring'''






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=13_37				,						num_examples=42				,						dataset_name='my_dataset'		)}		),
        SplitDict({'train': SplitInfo(name='train'				,						num_bytes=13_37				,						num_examples=42		)}		),
        SplitDict({'train': SplitInfo()}		),
    ]				,						)
def 	_A				(lowerCAmelCase__  :SplitDict		)   ->  Any:




     '''simple docstring'''



     _a			      =							split_dict._to_yaml_list()
     assert len(lowerCAmelCase__		) == len(lowerCAmelCase__		)
     _a			      =							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
          _a			      =							None
          # the split name of split_dict takes over the name of the split info object
          _a			      =							split_name
     assert split_dict == reloaded






@pytest.mark.parametrize(
    'split_info'				,						[SplitInfo(), SplitInfo(dataset_name=lowerCAmelCase__		), SplitInfo(dataset_name='my_dataset'		)]		)
def 	_A				(lowerCAmelCase__  :Optional[Any]		)   ->  List[str]:




     '''simple docstring'''



     _a			      =							asdict(SplitDict({'train': split_info}		)		)
     assert "dataset_name" in split_dict_asdict["train"]
     assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name

