


from manim import *







class     _lowercase				(							lowercase__):


       """simple docstring"""




       def 		lowerCAmelCase  (     self							:    Any ):


             '''simple docstring'''



             lowerCamelCase__	:       List[str]					=						Rectangle(height=0.5      ,   width=0.5 )
             lowerCamelCase__	:       List[str]					=						Rectangle(height=0.4_6      ,   width=0.4_6 ).set_stroke(width=0 )

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

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

             lowerCamelCase__	:       Optional[int]					=						[mem.copy() for i in range(6 )]
             lowerCamelCase__	:       int					=						VGroup(*__lowerCamelCase ).arrange(__lowerCamelCase      ,   buff=0 )

             lowerCamelCase__	:       Any					=						Text("Model"      ,   font_size=24 )
             lowerCamelCase__	:       List[str]					=						Group(__lowerCamelCase      ,   __lowerCamelCase ).arrange(__lowerCamelCase      ,   buff=0.5      ,   aligned_edge=__lowerCamelCase )
             model.move_to([3, -1.0, 0] )
             self.add(__lowerCamelCase )

             lowerCamelCase__	:       Optional[Any]					=						[]
             for i, rect in enumerate(__lowerCamelCase ):
                   rect.set_stroke(__lowerCamelCase )
                   # target = fill.copy().set_fill(YELLOW, opacity=0.7)
                   # target.move_to(rect)
                   # self.add(target)

                   lowerCamelCase__	:       Union[str, Any]					=						Rectangle(height=0.4_6 / 4      ,   width=0.4_6 / 3 ).set_stroke(width=0.0 ).set_fill(__lowerCamelCase      ,   opacity=0.7 )

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

             lowerCamelCase__	:       Dict					=						[mem.copy() for i in range(6 )]
             lowerCamelCase__	:       str					=						VGroup(*__lowerCamelCase ).arrange(__lowerCamelCase      ,   buff=0 )

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

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

             lowerCamelCase__	:       Union[str, 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(__lowerCamelCase      ,   __lowerCamelCase )

             lowerCamelCase__	:       Any					=						MarkupText(
                 f"<span fgcolor='{BLUE}'>●</span> Checkpoint"      ,   font_size=18      ,   )

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

             lowerCamelCase__	:       Optional[int]					=						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(__lowerCamelCase )      ,   Write(__lowerCamelCase ) )

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

             lowerCamelCase__	:       str					=						[]
             lowerCamelCase__	:       Tuple					=						[]
             for i, rect in enumerate(__lowerCamelCase ):
                   lowerCamelCase__	:       int					=						fill.copy().set_fill(__lowerCamelCase      ,   opacity=0.7 )
                   target.move_to(__lowerCamelCase )
                   first_animations.append(GrowFromCenter(__lowerCamelCase      ,   run_time=1 ) )

                   lowerCamelCase__	:       Optional[int]					=						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(__lowerCamelCase      ,   run_time=1.5 ) )

             self.play(*__lowerCamelCase )
             self.play(*__lowerCamelCase )
             self.wait()






def    lowercase_	(	_A    :					int		):

      """simple docstring"""




      if not isinstance(_A					,      _A		):
            lowerCamelCase__	:       List[str]					=						F"Input value of [number={number}] must be an integer"
            raise TypeError(_A		)
      if number < 0:
            return False
      lowerCamelCase__	:       Dict					=						number * number
      while number > 0:
            if number % 10 != number_square % 10:
                  return False
            number //= 10
            number_square //= 10
      return True


if __name__ == "__main__":
    import doctest

    doctest.testmod()


