




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  SCREAMING_SNAKE_CASE     (	__UpperCamelCase      :						Union[str, Any]				)  ->							Tuple:
    UpperCAmelCase_										=					split_dict._to_yaml_list()
    assert len(_UpperCAmelCase				) == len(_UpperCAmelCase				)
    UpperCAmelCase_										=					SplitDict._from_yaml_list(_UpperCAmelCase				)
    for split_name, split_info in split_dict.items():
        # dataset_name field is deprecated, and is therefore not part of the YAML dump
        UpperCAmelCase_										=					None
        # the split name of split_dict takes over the name of the split info object
        UpperCAmelCase_										=					split_name
    assert split_dict == reloaded







@pytest.mark.parametrize(
    '''split_info'''	,					[SplitInfo(), SplitInfo(dataset_name=_UpperCAmelCase				), SplitInfo(dataset_name='''my_dataset'''				)]				)
def  SCREAMING_SNAKE_CASE     (	__UpperCamelCase      :						Optional[int]				)  ->							Any:
    # 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
    UpperCAmelCase_										=					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  SCREAMING_SNAKE_CASE     (	__UpperCamelCase      :						Dict=2_8123				)  ->							str:
    UpperCAmelCase_										=					[1] * (limit + 1)

    for i in range(2	,					int(limit**0.5				) + 1				):
        sum_divs[i * i] += i
        for k in range(i + 1	,					limit // i + 1				):
            sum_divs[k * i] += k + i

    UpperCAmelCase_										=					set()
    UpperCAmelCase_										=					0

    for n in range(1	,					limit + 1				):
        if sum_divs[n] > n:
            abundants.add(__UpperCamelCase				)

        if not any((n - a in abundants) for a in abundants				):
            res += n

    return res


if __name__ == "__main__":
 print(solution())





