import math
import unittest




def       _snake_case	(   lowerCAmelCase							:   int	):
		"""simple docstring"""







		assert isinstance(lowerCAmelCase   , lowerCAmelCase	) and (
		    number >= 0
		), "'number' must been an int and positive"

		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






class 		a__						(					unittest.TestCase					):

					def 				__UpperCamelCase   (    self      :       Optional[Any]    ):







							"""simple docstring"""






							self.assertTrue(is_prime(2    )    )
							self.assertTrue(is_prime(3    )    )
							self.assertTrue(is_prime(5    )    )
							self.assertTrue(is_prime(7    )    )
							self.assertTrue(is_prime(11    )    )
							self.assertTrue(is_prime(13    )    )
							self.assertTrue(is_prime(17    )    )
							self.assertTrue(is_prime(19    )    )
							self.assertTrue(is_prime(23    )    )
							self.assertTrue(is_prime(29    )    )






					def 				__UpperCamelCase   (    self      :       Optional[Any]    ):







							"""simple docstring"""






							with self.assertRaises(_A    ):
									is_prime(-19    )
							self.assertFalse(
							    is_prime(0    ),"Zero doesn't have any positive factors, primes must have exactly two.",)
							self.assertFalse(
							    is_prime(1    ),"One only has 1 positive factor, primes must have exactly two.",)
							self.assertFalse(is_prime(2 * 2    )    )
							self.assertFalse(is_prime(2 * 3    )    )
							self.assertFalse(is_prime(3 * 3    )    )
							self.assertFalse(is_prime(3 * 5    )    )
							self.assertFalse(is_prime(3 * 5 * 7    )    )


if __name__ == "__main__":
		unittest.main()





from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader



class 				lowerCAmelCase_		(  a__							):
       def __init__(			self,			SCREAMING_SNAKE_CASE_,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = True,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = False,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = True,			SCREAMING_SNAKE_CASE_ = "arrow",			**SCREAMING_SNAKE_CASE_,			)     ->		Optional[int]:
          super().__init__(
              split=SCREAMING_SNAKE_CASE_,			features=SCREAMING_SNAKE_CASE_,			cache_dir=SCREAMING_SNAKE_CASE_,			keep_in_memory=SCREAMING_SNAKE_CASE_,			streaming=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_,			)
          UpperCamelCase    :  List[str]							=	load_from_cache_file
          UpperCamelCase    :  List[str]							=	file_format
          UpperCamelCase    :  Optional[int]							=	Spark(
              df=SCREAMING_SNAKE_CASE_,			features=SCREAMING_SNAKE_CASE_,			cache_dir=SCREAMING_SNAKE_CASE_,			working_dir=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_,			)






       def 					snake_case_       (			self       )     ->		int:
          if self.streaming:
             return self.builder.as_streaming_dataset(split=self.split       )
          UpperCamelCase    :  Union[str, Any]							=	None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
          self.builder.download_and_prepare(
              download_mode=SCREAMING_SNAKE_CASE_,			file_format=self._file_format,			)
          return self.builder.as_dataset(split=self.split       )



