


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_3_3_7  ,						num_examples=4_2  ,						dataset_name="""my_dataset"""   )}   ),
        SplitDict({"""train""": SplitInfo(name="""train"""  ,						num_bytes=1_3_3_7  ,						num_examples=4_2   )}   ),
        SplitDict({"""train""": SplitInfo()}   ),
    ]  ,						)
def   _UpperCamelCase				(						lowerCAmelCase_   )						->Optional[int]:
   UpperCAmelCase							=     split_dict._to_yaml_list()
   assert len(a_   ) == len(a_   )
   UpperCAmelCase							=     SplitDict._from_yaml_list(a_   )
   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=a_   ), SplitInfo(dataset_name="""my_dataset"""   )]   )
def   _UpperCamelCase				(						lowerCAmelCase_   )						->Union[str, Any]:
   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







from math import isqrt
def   _UpperCamelCase				(						lowerCAmelCase_   )						->bool:
   return all(number % divisor != 0 for divisor in range(2  ,						isqrt(lowerCAmelCase_   ) + 1   )   )
def   _UpperCamelCase				(						lowerCAmelCase_ = 1_0**6   )						->int:
   UpperCAmelCase							=     0
   UpperCAmelCase							=     1
   UpperCAmelCase							=     7
   while prime_candidate < max_prime:
      primes_count += is_prime(lowerCAmelCase_   )

      cube_index += 1
      prime_candidate += 6 * cube_index

   return primes_count


if __name__ == "__main__":
 print(F"""{solution() = }""")



