


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   _UpperCAmelCase       (     UpperCAmelCase      :			SplitDict      ):
      """simple docstring"""




      __lowerCamelCase     :      Optional[int]       						=						split_dict._to_yaml_list()
      assert len(UpperCamelCase__      ) == len(UpperCamelCase__      )
      __lowerCamelCase     :      List[Any]       						=						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
            __lowerCamelCase     :      Optional[Any]       						=						None
            # the split name of split_dict takes over the name of the split info object
            __lowerCamelCase     :      List[Any]       						=						split_name
      assert split_dict == reloaded




@pytest.mark.parametrize(
    """split_info"""						,	[SplitInfo(), SplitInfo(dataset_name=UpperCamelCase__      ), SplitInfo(dataset_name="""my_dataset"""      )]      )
def   _UpperCAmelCase       (     UpperCAmelCase      :			Optional[int]      ):
      """simple docstring"""




      __lowerCamelCase     :      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







def   _UpperCAmelCase       (     ):
      """simple docstring"""




      __lowerCamelCase     :      Optional[int]       						=						[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

      __lowerCamelCase     :      str       						=						6
      __lowerCamelCase     :      Optional[int]       						=						1
      __lowerCamelCase     :      Optional[int]       						=						1_901

      __lowerCamelCase     :      Optional[Any]       						=						0

      while year < 2_001:
            day += 7

            if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
                  if day > days_per_month[month - 1] and month != 2:
                        month += 1
                        __lowerCamelCase     :      Tuple       						=						day - days_per_month[month - 2]
                  elif day > 29 and month == 2:
                        month += 1
                        __lowerCamelCase     :      str       						=						day - 29
            else:
                  if day > days_per_month[month - 1]:
                        month += 1
                        __lowerCamelCase     :      Any       						=						day - days_per_month[month - 2]

            if month > 12:
                  year += 1
                  __lowerCamelCase     :      Optional[Any]       						=						1

            if year < 2_001 and day == 1:
                  sundays += 1
      return sundays


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



