


import math
import unittest







def        SCREAMING_SNAKE_CASE_						(			__A :			int				)	->		bool:

       """simple docstring"""

       assert isinstance(__A  ,    __A				) 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(__A				) + 1				)  ,    6				):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True
class  SCREAMING_SNAKE_CASE__  (				unittest.TestCase			):
      def        SCREAMING_SNAKE_CASE							(       self				:       Tuple     )		->			List[Any]:
             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        SCREAMING_SNAKE_CASE							(       self				:       List[Any]     )		->			int:
             with self.assertRaises(SCREAMING_SNAKE_CASE__     ):
                    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()





'''simple docstring'''






import argparse

from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection

from diffusers import UnCLIPImageVariationPipeline, UnCLIPPipeline


if __name__ == "__main__":
 lowerCAmelCase__											=	argparse.ArgumentParser()

 parser.add_argument('''--dump_path''', default=None, type=str, required=True, help='''Path to the output model.''')

 parser.add_argument(
     '''--txt2img_unclip''',
     default='''kakaobrain/karlo-v1-alpha''',
     type=str,
     required=False,
     help='''The pretrained txt2img unclip.''',
 )

 lowerCAmelCase__											=	parser.parse_args()

 lowerCAmelCase__											=	UnCLIPPipeline.from_pretrained(args.txtaimg_unclip)

 lowerCAmelCase__											=	CLIPImageProcessor()
 lowerCAmelCase__											=	CLIPVisionModelWithProjection.from_pretrained('''openai/clip-vit-large-patch14''')

 lowerCAmelCase__											=	UnCLIPImageVariationPipeline(
     decoder=txtaimg.decoder,
     text_encoder=txtaimg.text_encoder,
     tokenizer=txtaimg.tokenizer,
     text_proj=txtaimg.text_proj,
     feature_extractor=feature_extractor,
     image_encoder=image_encoder,
     super_res_first=txtaimg.super_res_first,
     super_res_last=txtaimg.super_res_last,
     decoder_scheduler=txtaimg.decoder_scheduler,
     super_res_scheduler=txtaimg.super_res_scheduler,
 )

 imgaimg.save_pretrained(args.dump_path)

