






"""simple docstring"""



import math
import unittest
def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  Union[str, Any]    ):





  '''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       ):
      self.assertTrue(is_prime(2       )       )
      self.assertTrue(is_prime(3       )       )
      self.assertTrue(is_prime(5       )       )
      self.assertTrue(is_prime(7       )       )
      self.assertTrue(is_prime(1_1       )       )
      self.assertTrue(is_prime(1_3       )       )
      self.assertTrue(is_prime(1_7       )       )
      self.assertTrue(is_prime(1_9       )       )
      self.assertTrue(is_prime(2_3       )       )
      self.assertTrue(is_prime(2_9       )       )







    def 			UpperCamelCase_      (			self       ):
      with self.assertRaises(_lowerCamelCase       ):
        is_prime(-1_9       )
      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()










import json
import os
import unittest

from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin
class       _UpperCAmelCase					(       A__		,unittest.TestCase	):

				"""simple docstring"""




				lowercase__											=       CTRLTokenizer
				lowercase__											=       False
				lowercase__											=       False




				def 				lowercase__   (     self						:    Union[str, Any]  ):

								'''simple docstring'''
								super().setUp()

								# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
								lowercase__    =			['''adapt''', '''re@@''', '''a@@''', '''apt''', '''c@@''', '''t''', '''<unk>''']
								lowercase__    =			dict(zip(lowerCamelCase,  range(len(lowerCamelCase  )  )  )  )
								lowercase__    =			['''#version: 0.2''', '''a p''', '''ap t</w>''', '''r e''', '''a d''', '''ad apt</w>''', '''''']
								lowercase__    =			{'''unk_token''': '''<unk>'''}

								lowercase__    =			os.path.join(self.tmpdirname,  VOCAB_FILES_NAMES['''vocab_file''']  )
								lowercase__    =			os.path.join(self.tmpdirname,  VOCAB_FILES_NAMES['''merges_file''']  )
								with open(self.vocab_file,  '''w''',  encoding='''utf-8'''  ) as fp:
												fp.write(json.dumps(lowerCamelCase  ) + '''\n'''  )
								with open(self.merges_file,  '''w''',  encoding='''utf-8'''  ) as fp:
												fp.write('''\n'''.join(lowerCamelCase  )  )




				def 				lowercase__   (     self						:    Union[str, Any],  **lowerCamelCase						:    Dict  ):

								'''simple docstring'''
								kwargs.update(self.special_tokens_map  )
								return CTRLTokenizer.from_pretrained(self.tmpdirname,  **lowerCamelCase  )




				def 				lowercase__   (     self						:    Dict,  lowerCamelCase						:    Optional[int]  ):

								'''simple docstring'''
								lowercase__    =			'''adapt react readapt apt'''
								lowercase__    =			'''adapt react readapt apt'''
								return input_text, output_text




				def 				lowercase__   (     self						:    Tuple  ):

								'''simple docstring'''
								lowercase__    =			CTRLTokenizer(self.vocab_file,  self.merges_file,  **self.special_tokens_map  )
								lowercase__    =			'''adapt react readapt apt'''
								lowercase__    =			'''adapt re@@ a@@ c@@ t re@@ adapt apt'''.split()
								lowercase__    =			tokenizer.tokenize(lowerCamelCase  )
								self.assertListEqual(lowerCamelCase,  lowerCamelCase  )

								lowercase__    =			tokens + [tokenizer.unk_token]

								lowercase__    =			[0, 1, 2, 4, 5, 1, 0, 3, 6]
								self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCamelCase  ),  lowerCamelCase  )




