
from typing import List, Optional, TypeVar

from .arrow_dataset import Dataset, _concatenate_map_style_datasets, _interleave_map_style_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .info import DatasetInfo
from .iterable_dataset import IterableDataset, _concatenate_iterable_datasets, _interleave_iterable_datasets
from .splits import NamedSplit
from .utils import logging
from .utils.py_utils import Literal


__A							=logging.get_logger(__name__)


__A							=TypeVar('''DatasetType''', Dataset, IterableDataset)





def      lowerCamelCase_					(							lowerCamelCase__      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = "first_exhausted"      ,					):
				from .arrow_dataset import Dataset
				from .iterable_dataset import IterableDataset

				if not datasets:
								raise ValueError("Unable to interleave an empty list of datasets."       )
				for i, dataset in enumerate(lowerCamelCase__       ):
								if not isinstance(lowerCamelCase__      ,					(Dataset, IterableDataset)       ):
												if isinstance(lowerCamelCase__      ,					(DatasetDict, IterableDatasetDict)       ):
																if not dataset:
																				raise ValueError(
																				    F'Expected a list of Dataset objects or a list of IterableDataset objects, but element at position {i} '
																				    "is an empty dataset dictionary."       )
																raise ValueError(
																    F'Dataset at position {i} has at least one split: {list(lowerCamelCase__       )}\n'
																    F'Please pick one to interleave with the other datasets, for example: dataset[\'{next(iter(lowerCamelCase__       )       )}\']'       )
												raise ValueError(
												    F'Expected a list of Dataset objects or a list of IterableDataset objects, but element at position {i} is a {type(lowerCamelCase__       ).__name__}.'       )
								if i == 0:
												lowerCamelCase_      ,       lowerCamelCase_         =     (
												    (Dataset, IterableDataset) if isinstance(lowerCamelCase__      ,					lowerCamelCase__       ) else (IterableDataset, Dataset)
												)
								elif not isinstance(lowerCamelCase__      ,					lowerCamelCase__       ):
												raise ValueError(
												    F'Unable to interleave a {dataset_type.__name__} (at position 0) with a {other_type.__name__} (at position {i}). Expected a list of Dataset objects or a list of IterableDataset objects.'       )
				if stopping_strategy not in ["first_exhausted", "all_exhausted"]:
								raise ValueError(F'{stopping_strategy} is not supported. Please enter a valid stopping_strategy.'       )
				if dataset_type is Dataset:
								return _interleave_map_style_datasets(
								    lowerCamelCase__      ,					lowerCamelCase__      ,					lowerCamelCase__      ,					info=lowerCamelCase__      ,					split=lowerCamelCase__      ,					stopping_strategy=lowerCamelCase__       )
				else:
								return _interleave_iterable_datasets(
								    lowerCamelCase__      ,					lowerCamelCase__      ,					lowerCamelCase__      ,					info=lowerCamelCase__      ,					split=lowerCamelCase__      ,					stopping_strategy=lowerCamelCase__       )





def      lowerCamelCase_					(							lowerCamelCase__      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = None      ,					lowerCamelCase__ = 0      ,					):

				if not dsets:
								raise ValueError("Unable to concatenate an empty list of datasets."       )
				for i, dataset in enumerate(lowerCamelCase__       ):
								if not isinstance(lowerCamelCase__      ,					(Dataset, IterableDataset)       ):
												if isinstance(lowerCamelCase__      ,					(DatasetDict, IterableDatasetDict)       ):
																if not dataset:
																				raise ValueError(
																				    F'Expected a list of Dataset objects or a list of IterableDataset objects, but element at position {i} '
																				    "is an empty dataset dictionary."       )
																raise ValueError(
																    F'Dataset at position {i} has at least one split: {list(lowerCamelCase__       )}\n'
																    F'Please pick one to interleave with the other datasets, for example: dataset[\'{next(iter(lowerCamelCase__       )       )}\']'       )
												raise ValueError(
												    F'Expected a list of Dataset objects or a list of IterableDataset objects, but element at position {i} is a {type(lowerCamelCase__       ).__name__}.'       )
								if i == 0:
												lowerCamelCase_      ,       lowerCamelCase_         =     (
												    (Dataset, IterableDataset) if isinstance(lowerCamelCase__      ,					lowerCamelCase__       ) else (IterableDataset, Dataset)
												)
								elif not isinstance(lowerCamelCase__      ,					lowerCamelCase__       ):
												raise ValueError(
												    F'Unable to interleave a {dataset_type.__name__} (at position 0) with a {other_type.__name__} (at position {i}). Expected a list of Dataset objects or a list of IterableDataset objects.'       )
				if dataset_type is Dataset:
								return _concatenate_map_style_datasets(lowerCamelCase__      ,					info=lowerCamelCase__      ,					split=lowerCamelCase__      ,					axis=lowerCamelCase__       )
				else:
								return _concatenate_iterable_datasets(lowerCamelCase__      ,					info=lowerCamelCase__      ,					split=lowerCamelCase__      ,					axis=lowerCamelCase__       )




from __future__ import annotations

import math





def      lowerCamelCase_					(							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


__A							=[num for num in range(3, 1_0_0_0_0_1, 2) if not is_prime(num)]





def      lowerCamelCase_					(							lowerCamelCase__       ):
				if not isinstance(lowerCamelCase__      ,					lowerCamelCase__       ):
								raise ValueError("n must be an integer"       )
				if n <= 0:
								raise ValueError("n must be >= 0"       )

				lowerCamelCase_         =     []
				for num in range(len(lowerCamelCase__       )       ):
								lowerCamelCase_         =     0
								while 2 * i * i <= odd_composites[num]:
												lowerCamelCase_         =     odd_composites[num] - 2 * i * i
												if is_prime(lowerCamelCase__       ):
																break
												i += 1
								else:
												list_nums.append(odd_composites[num]       )
												if len(lowerCamelCase__       ) == n:
																return list_nums

				return []





def      lowerCamelCase_					(							):
				return compute_nums(1       )[0]


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


