





'''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=13_37	,			num_examples=42	,			dataset_name='my_dataset' )} ),
        SplitDict({'train': SplitInfo(name='train'	,			num_bytes=13_37	,			num_examples=42 )} ),
        SplitDict({'train': SplitInfo()} ),
    ]	,			)
def       A__(		__lowerCAmelCase ):
				_snake_case :			List[Any]  						=   split_dict._to_yaml_list()
				assert len(snake_case_ ) == len(snake_case_ )
				_snake_case :			Tuple  						=   SplitDict._from_yaml_list(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
								_snake_case :			Optional[Any]  						=   None
								# the split name of split_dict takes over the name of the split info object
								_snake_case :			List[Any]  						=   split_name
				assert split_dict == reloaded

@pytest.mark.parametrize(
    'split_info'	,			[SplitInfo(), SplitInfo(dataset_name=snake_case_ ), SplitInfo(dataset_name='my_dataset' )] )
def       A__(		__lowerCAmelCase ):
				# 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
				_snake_case :			List[str]  						=   asdict(SplitDict({'train': split_info} ) )
				assert "dataset_name" in split_dict_asdict["train"]
				assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name













import itertools
import math

def       A__(		__lowerCAmelCase ):

				if 1 < number < 4:
								# 2 and 3 are primes
								return True
				elif number < 2 or number % 2 == 0 or number % 3 == 0:
								# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
								return False

				# All primes number are in format of 6k +/- 1
				for i in range(5	,			int(math.sqrt(__lowerCAmelCase ) + 1 )	,			6 ):
								if number % i == 0 or number % (i + 2) == 0:
												return False
				return True

def       A__(		):
				_snake_case :			Optional[Any]  						=   2
				while True:
								if is_prime(__lowerCAmelCase ):
												yield num
								num += 1

def       A__(		__lowerCAmelCase = 1_00_01 ):
				return next(itertools.islice(prime_generator()	,			nth - 1	,			__lowerCAmelCase ) )


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






