
"""simple docstring"""




import random



def 							a__ (				lowerCAmelCase	:       int		):






     '''simple docstring'''
     UpperCAmelCase__							: Union[str, Any] 							=						num - 1
     UpperCAmelCase__							: Dict 							=						0

     while s % 2 == 0:
          UpperCAmelCase__							: Tuple 							=						s // 2
          t += 1

     for _ in range(5		):
          UpperCAmelCase__							: Optional[int] 							=						random.randrange(2       ,    num - 1		)
          UpperCAmelCase__							: Optional[Any] 							=						pow(lowerCAmelCase       ,    lowerCAmelCase       ,    lowerCAmelCase		)
          if v != 1:
               UpperCAmelCase__							: Union[str, Any] 							=						0
               while v != (num - 1):
                    if i == t - 1:
                         return False
                    else:
                         UpperCAmelCase__							: Optional[int] 							=						i + 1
                         UpperCAmelCase__							: Optional[int] 							=						(v**2) % num
     return True



def 							a__ (				lowerCAmelCase	:       int		):






     '''simple docstring'''
     if num < 2:
          return False

     UpperCAmelCase__							: List[str] 							=						[
         2,
         3,
         5,
         7,
         11,
         13,
         17,
         19,
         23,
         29,
         31,
         37,
         41,
         43,
         47,
         53,
         59,
         61,
         67,
         71,
         73,
         79,
         83,
         89,
         97,
         101,
         103,
         107,
         109,
         113,
         127,
         131,
         137,
         139,
         149,
         151,
         157,
         163,
         167,
         173,
         179,
         181,
         191,
         193,
         197,
         199,
         211,
         223,
         227,
         229,
         233,
         239,
         241,
         251,
         257,
         263,
         269,
         271,
         277,
         281,
         283,
         293,
         307,
         311,
         313,
         317,
         331,
         337,
         347,
         349,
         353,
         359,
         367,
         373,
         379,
         383,
         389,
         397,
         401,
         409,
         419,
         421,
         431,
         433,
         439,
         443,
         449,
         457,
         461,
         463,
         467,
         479,
         487,
         491,
         499,
         503,
         509,
         521,
         523,
         541,
         547,
         557,
         563,
         569,
         571,
         577,
         587,
         593,
         599,
         601,
         607,
         613,
         617,
         619,
         631,
         641,
         643,
         647,
         653,
         659,
         661,
         673,
         677,
         683,
         691,
         701,
         709,
         719,
         727,
         733,
         739,
         743,
         751,
         757,
         761,
         769,
         773,
         787,
         797,
         809,
         811,
         821,
         823,
         827,
         829,
         839,
         853,
         857,
         859,
         863,
         877,
         881,
         883,
         887,
         907,
         911,
         919,
         929,
         937,
         941,
         947,
         953,
         967,
         971,
         977,
         983,
         991,
         997,
     ]

     if num in low_primes:
          return True

     for prime in low_primes:
          if (num % prime) == 0:
               return False

     return rabin_miller(lowerCAmelCase		)



def 							a__ (				lowerCAmelCase	:       int = 1024		):






     '''simple docstring'''
     while True:
          UpperCAmelCase__							: Tuple 							=						random.randrange(2 ** (keysize - 1)       ,    2 ** (keysize)		)
          if is_prime_low_num(lowerCAmelCase		):
               return num


if __name__ == "__main__":
    A__      :	int          =    generate_large_prime()
    print(("""Prime number:""", num))
    print(("""is_prime_low_num:""", is_prime_low_num(num)))





"""simple docstring"""




from manim import *







class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     def  lowerCAmelCase__       (      self  )->					Tuple:
          UpperCAmelCase__							: str 							=						Rectangle(height=0.5 ,			width=0.5  )
          UpperCAmelCase__							: List[str] 							=						Rectangle(height=0.46 ,			width=0.46  ).set_stroke(width=0  )

          UpperCAmelCase__							: List[Any] 							=						[mem.copy() for i in range(6  )]
          UpperCAmelCase__							: Union[str, Any] 							=						[mem.copy() for i in range(6  )]
          UpperCAmelCase__							: List[Any] 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )
          UpperCAmelCase__							: int 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )
          UpperCAmelCase__							: Tuple 							=						VGroup(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )
          UpperCAmelCase__							: Tuple 							=						Text("CPU" ,			font_size=24  )
          UpperCAmelCase__							: Any 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0.5 ,			aligned_edge=__UpperCamelCase  )
          cpu.move_to([-2.5, -0.5, 0]  )
          self.add(__UpperCamelCase  )

          UpperCAmelCase__							: List[Any] 							=						[mem.copy() for i in range(4  )]
          UpperCAmelCase__							: List[str] 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )
          UpperCAmelCase__							: Union[str, Any] 							=						Text("GPU" ,			font_size=24  )
          UpperCAmelCase__							: Dict 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0.5 ,			aligned_edge=__UpperCamelCase  )
          gpu.move_to([-1, -1, 0]  )
          self.add(__UpperCamelCase  )

          UpperCAmelCase__							: Optional[int] 							=						[mem.copy() for i in range(6  )]
          UpperCAmelCase__							: List[str] 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )

          UpperCAmelCase__							: Tuple 							=						Text("Model" ,			font_size=24  )
          UpperCAmelCase__							: Dict 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0.5 ,			aligned_edge=__UpperCamelCase  )
          model.move_to([3, -1.0, 0]  )
          self.add(__UpperCamelCase  )

          UpperCAmelCase__							: List[str] 							=						[]
          for i, rect in enumerate(__UpperCamelCase  ):
               rect.set_stroke(__UpperCamelCase  )
               # target = fill.copy().set_fill(YELLOW, opacity=0.7)
               # target.move_to(rect)
               # self.add(target)

               UpperCAmelCase__							: int 							=						Rectangle(height=0.46 / 4 ,			width=0.46 / 3  ).set_stroke(width=0.0  ).set_fill(__UpperCamelCase ,			opacity=0.7  )

               if i == 0:
                    cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT  ) ,			buff=0.02 ,			direction=__UpperCamelCase  )
                    cpu_target.set_x(cpu_target.get_x() + 0.1  )
               elif i == 3:
                    cpu_target.next_to(cpu_targs[0] ,			direction=__UpperCamelCase ,			buff=0.0  )
               else:
                    cpu_target.next_to(cpu_targs[i - 1] ,			direction=__UpperCamelCase ,			buff=0.0  )
               self.add(__UpperCamelCase  )
               cpu_targs.append(__UpperCamelCase  )

          UpperCAmelCase__							: List[Any] 							=						[mem.copy() for i in range(6  )]
          UpperCAmelCase__							: Any 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )

          UpperCAmelCase__							: Tuple 							=						Text("Loaded Checkpoint" ,			font_size=24  )
          UpperCAmelCase__							: Any 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			aligned_edge=__UpperCamelCase ,			buff=0.4  )
          checkpoint.move_to([3, 0.5, 0]  )

          UpperCAmelCase__							: Optional[Any] 							=						Square(side_length=2.2  )
          key.move_to([-5, 2, 0]  )

          UpperCAmelCase__							: Any 							=						MarkupText(
              F"<b>Key:</b>\n\n<span fgcolor='{YELLOW}'>●</span> Empty Model" ,			font_size=18 ,			)

          key_text.move_to([-5, 2.4, 0]  )

          self.add(__UpperCamelCase ,			__UpperCamelCase  )

          UpperCAmelCase__							: str 							=						MarkupText(
              F"<span fgcolor='{BLUE}'>●</span> Checkpoint" ,			font_size=18 ,			)

          blue_text.next_to(__UpperCamelCase ,			DOWN * 2.4 ,			aligned_edge=key_text.get_left()  )

          UpperCAmelCase__							: Optional[Any] 							=						MarkupText(
              F"Next, a <i><span fgcolor=\"{BLUE}\">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor=\"{BLUE}\">single shard</span>." ,			font_size=24 ,			)
          step_a.move_to([2, 2, 0]  )
          self.play(Write(__UpperCamelCase  ) ,			Write(__UpperCamelCase  )  )

          self.play(Write(__UpperCamelCase ,			run_time=1  ) ,			Create(__UpperCamelCase ,			run_time=1  )  )

          UpperCAmelCase__							: Union[str, Any] 							=						[]
          UpperCAmelCase__							: List[str] 							=						[]
          for i, rect in enumerate(__UpperCamelCase  ):
               UpperCAmelCase__							: Optional[Any] 							=						fill.copy().set_fill(__UpperCamelCase ,			opacity=0.7  )
               target.move_to(__UpperCamelCase  )
               first_animations.append(GrowFromCenter(__UpperCamelCase ,			run_time=1  )  )

               UpperCAmelCase__							: List[str] 							=						target.copy()
               cpu_target.generate_target()
               if i < 5:
                    cpu_target.target.move_to(cpu_left_col_base[i + 1]  )
               else:
                    cpu_target.target.move_to(cpu_right_col_base[i - 5]  )
               second_animations.append(MoveToTarget(__UpperCamelCase ,			run_time=1.5  )  )

          self.play(*__UpperCamelCase  )
          self.play(*__UpperCamelCase  )
          self.wait()



