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=1_337						,    num_examples=42						,    dataset_name='''my_dataset'''			)}			),
        SplitDict({'''train''': SplitInfo(name='''train'''						,    num_bytes=1_337						,    num_examples=42			)}			),
        SplitDict({'''train''': SplitInfo()}			),
    ]						,    )
def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :str    						=	split_dict._to_yaml_list()
    assert len(SCREAMING_SNAKE_CASE			) == len(SCREAMING_SNAKE_CASE			)
    __UpperCamelCase  :Optional[Any]    						=	SplitDict._from_yaml_list(SCREAMING_SNAKE_CASE			)
    for split_name, split_info in split_dict.items():
        # dataset_name field is deprecated, and is therefore not part of the YAML dump
        __UpperCamelCase  :List[Any]    						=	None
        # the split name of split_dict takes over the name of the split info object
        __UpperCamelCase  :Tuple    						=	split_name
    assert split_dict == reloaded



@pytest.mark.parametrize(
    '''split_info'''						,    [SplitInfo(), SplitInfo(dataset_name=SCREAMING_SNAKE_CASE			), SplitInfo(dataset_name='''my_dataset'''			)]			)
def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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






def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    return 1 if input_a == input_a else 0



def lowerCamelCase						(     ):
    '''simple docstring'''







    assert xnor_gate(0						,    0			) == 1
    assert xnor_gate(0						,    1			) == 0
    assert xnor_gate(1						,    0			) == 0
    assert xnor_gate(1						,    1			) == 1


if __name__ == "__main__":
    print(xnor_gate(0, 0))
    print(xnor_gate(0, 1))
    print(xnor_gate(1, 0))
    print(xnor_gate(1, 1))





