


"""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=1337						,							num_examples=42						,							dataset_name="my_dataset"			)}			),
        SplitDict({"train": SplitInfo(name="train"						,							num_bytes=1337						,							num_examples=42			)}			),
        SplitDict({"train": SplitInfo()}			),
    ]						,							)
def   __lowerCAmelCase						(						lowercase  :  SplitDict			)     ->						Tuple:


    """simple docstring"""





    snake_case   :				List[str]				 =   split_dict._to_yaml_list()
    assert len(lowercase			) == len(lowercase			)
    snake_case   :				List[str]				 =   SplitDict._from_yaml_list(lowercase			)
    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   :				Dict				 =   None
        # the split name of split_dict takes over the name of the split info object
        snake_case   :				Optional[int]				 =   split_name
    assert split_dict == reloaded







@pytest.mark.parametrize(
    "split_info"						,							[SplitInfo(), SplitInfo(dataset_name=lowercase			), SplitInfo(dataset_name="my_dataset"			)]			)
def   __lowerCAmelCase						(						lowercase  :  Optional[Any]			)     ->						str:


    """simple docstring"""





    snake_case   :				List[Any]				 =   asdict(SplitDict({"train": split_info}			)			)
    assert "dataset_name" in split_dict_asdict["train"]
    assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name









"""simple docstring"""



from __future__ import annotations

import numpy as np







def   __lowerCAmelCase						(						lowercase  :  list[float]			)     ->						Any:


    """simple docstring"""





    return np.maximum(0						,							lowercase			)


if __name__ == "__main__":
  print(np.array(relu([-1, 0, 5])))  # --> [0, 0, 5]





