





"""simple docstring"""





from manim import *

class 		lowercase					(					_UpperCAmelCase					):





      def     _snake_case			(       self )		->     Tuple:
            lowerCAmelCase  						=       Rectangle(height=0.5      ,						width=0.5 )
            lowerCAmelCase  						=       Rectangle(height=0.46      ,						width=0.46 ).set_stroke(width=0 )

            lowerCAmelCase  						=       [mem.copy() for i in range(6 )]
            lowerCAmelCase  						=       [mem.copy() for i in range(6 )]
            lowerCAmelCase  						=       VGroup(*lowercase ).arrange(lowercase      ,						buff=0 )
            lowerCAmelCase  						=       VGroup(*lowercase ).arrange(lowercase      ,						buff=0 )
            lowerCAmelCase  						=       VGroup(lowercase      ,						lowercase ).arrange(lowercase      ,						buff=0 )
            lowerCAmelCase  						=       Text("""CPU"""      ,						font_size=24 )
            lowerCAmelCase  						=       Group(lowercase      ,						lowercase ).arrange(lowercase      ,						buff=0.5      ,						aligned_edge=lowercase )
            cpu.move_to([-2.5, -0.5, 0] )
            self.add(lowercase )

            lowerCAmelCase  						=       [mem.copy() for i in range(1 )]
            lowerCAmelCase  						=       VGroup(*lowercase ).arrange(lowercase      ,						buff=0 )
            lowerCAmelCase  						=       Text("""GPU"""      ,						font_size=24 )
            lowerCAmelCase  						=       Group(lowercase      ,						lowercase ).arrange(lowercase      ,						buff=0.5      ,						aligned_edge=lowercase )
            gpu.align_to(lowercase      ,						lowercase )
            gpu.set_x(gpu.get_x() - 1 )

            self.add(lowercase )

            lowerCAmelCase  						=       [mem.copy() for i in range(6 )]
            lowerCAmelCase  						=       VGroup(*lowercase ).arrange(lowercase      ,						buff=0 )

            lowerCAmelCase  						=       Text("""Model"""      ,						font_size=24 )
            lowerCAmelCase  						=       Group(lowercase      ,						lowercase ).arrange(lowercase      ,						buff=0.5      ,						aligned_edge=lowercase )
            model.move_to([3, -1.0, 0] )

            self.play(
                Create(lowercase      ,						run_time=1 )      ,						Create(lowercase      ,						run_time=1 )      ,						Create(lowercase      ,						run_time=1 )      ,						)

            lowerCAmelCase  						=       MarkupText(
                f'First, an empty model skeleton is loaded\ninto <span fgcolor=\'{YELLOW}\'>memory</span> without using much RAM.'      ,						font_size=24      ,						)

            lowerCAmelCase  						=       Square(side_length=2.2 )
            key.move_to([-5, 2, 0] )

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

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

            step_a.move_to([2, 2, 0] )
            self.play(Write(lowercase      ,						run_time=2.5 )      ,						Write(lowercase )      ,						Write(lowercase ) )

            self.add(lowercase )

            lowerCAmelCase  						=       []
            lowerCAmelCase  						=       []
            lowerCAmelCase  						=       []
            for i, rect in enumerate(lowercase ):
                  lowerCAmelCase  						=       Rectangle(height=0.46      ,						width=0.46 ).set_stroke(width=0.0 ).set_fill(lowercase      ,						opacity=0.7 )
                  cpu_target.move_to(lowercase )
                  cpu_target.generate_target()
                  lowerCAmelCase  						=       0.46 / 4
                  lowerCAmelCase  						=       0.46 / 3

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

                  first_animations.append(rect.animate(run_time=0.5 ).set_stroke(lowercase ) )
                  second_animations.append(MoveToTarget(lowercase      ,						run_time=1.5 ) )

            self.play(*lowercase )
            self.play(*lowercase )

            self.wait()













"""simple docstring"""





def 			UpperCAmelCase__							(  SCREAMING_SNAKE_CASE     :						int							,						SCREAMING_SNAKE_CASE     :						int			):







      '''simple docstring'''




      while b:
            lowerCAmelCase						,		lowerCAmelCase  						=       b, a % b
      return a


def 			UpperCAmelCase__							(  SCREAMING_SNAKE_CASE     :						int							,						SCREAMING_SNAKE_CASE     :						int			):







      '''simple docstring'''




      return a if b == 0 else euclidean_gcd_recursive(SCREAMING_SNAKE_CASE							,						a % b			)


def 			UpperCAmelCase__							(  ):







      '''simple docstring'''




      print(F'euclidean_gcd(3, 5) = {euclidean_gcd(3							,						5			)}'			)
      print(F'euclidean_gcd(5, 3) = {euclidean_gcd(5							,						3			)}'			)
      print(F'euclidean_gcd(1, 3) = {euclidean_gcd(1							,						3			)}'			)
      print(F'euclidean_gcd(3, 6) = {euclidean_gcd(3							,						6			)}'			)
      print(F'euclidean_gcd(6, 3) = {euclidean_gcd(6							,						3			)}'			)

      print(F'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3							,						5			)}'			)
      print(F'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5							,						3			)}'			)
      print(F'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1							,						3			)}'			)
      print(F'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3							,						6			)}'			)
      print(F'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6							,						3			)}'			)


if __name__ == "__main__":
       main()






