
"""simple docstring"""




from manim import *

class 						a__		( a_		):
   def      __magic_name__     (     self							):
          lowercase       :							Any									=				Rectangle(height=0.5      ,       width=0.5							)
          lowercase       :							Optional[int]									=				Rectangle(height=0.2_5      ,       width=0.2_5							)
          lowercase       :							Optional[int]									=				Rectangle(height=0.4_6      ,       width=0.4_6							).set_stroke(width=0							)

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

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

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

          lowercase       :							Tuple									=				Text("Model"      ,       font_size=24							)
          lowercase       :							Optional[Any]									=				Group(_a      ,       _a							).arrange(_a      ,       buff=0.5      ,       aligned_edge=_a							)
          model.move_to([3, -1.0, 0]							)
          self.add(_a							)

          lowercase       :							List[str]									=				[]
          lowercase       :							Union[str, Any]									=				[]
          lowercase       :							Any									=				[]

          for i, rect in enumerate(_a							):
                 rect.set_stroke(_a							)

                 lowercase       :							Tuple									=				Rectangle(height=0.4_6 / 4      ,       width=0.4_6 / 3							).set_stroke(width=0.0							).set_fill(_a      ,       opacity=0.7							)

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

          self.add(*_a      ,       *_a      ,       *_a							)

          lowercase       :							Union[str, Any]									=				[mem.copy() for i in range(6							)]
          lowercase       :							Optional[Any]									=				VGroup(*_a							).arrange(_a      ,       buff=0							)

          lowercase       :							Dict									=				Text("Loaded Checkpoint"      ,       font_size=24							)
          lowercase       :							Optional[int]									=				Group(_a      ,       _a							).arrange(_a      ,       buff=0.5      ,       aligned_edge=_a							)
          checkpoint.move_to([3, 0.5, 0]							)

          self.add(_a							)

          lowercase       :							Any									=				[]
          lowercase       :							Union[str, Any]									=				[]

          for i, rect in enumerate(_a							):
                 lowercase       :							Tuple									=				fill.copy().set_fill(_a      ,       opacity=0.7							)
                 target.move_to(_a							)
                 ckpt_arr.append(_a							)

                 lowercase       :							Tuple									=				target.copy()
                 if i < 5:
                        cpu_target.move_to(cpu_left_col_base[i + 1]							)
                 else:
                        cpu_target.move_to(cpu_right_col_base[i - 5]							)
                 ckpt_cpu_arr.append(_a							)
          self.add(*_a      ,       *_a							)

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

          lowercase       :							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(_a      ,       _a							)

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

          blue_text.next_to(_a      ,       DOWN * 2.4      ,       aligned_edge=key_text.get_left()							)
          self.add(_a							)

          lowercase       :							int									=				MarkupText(
              f"""Based on the passed in configuration, weights are stored in\na variety of np.memmaps on disk or to a particular device."""      ,       font_size=24      ,       )
          step_a.move_to([2, 2, 0]							)

          lowercase       :							Union[str, Any]									=				[meta_mem.copy() for i in range(6							)]
          lowercase       :							Optional[int]									=				[meta_mem.copy() for i in range(6							)]
          lowercase       :							List[str]									=				VGroup(*_a							).arrange(_a      ,       buff=0							)
          lowercase       :							Tuple									=				VGroup(*_a							).arrange(_a      ,       buff=0							)
          lowercase       :							Dict									=				VGroup(_a      ,       _a							).arrange(_a      ,       buff=0							)
          lowercase       :							Any									=				Text("Disk"      ,       font_size=24							)
          lowercase       :							Optional[Any]									=				Group(_a      ,       _a							).arrange(_a      ,       buff=0.5      ,       aligned_edge=_a							)
          disk.move_to([-4.0, -1.2_5, 0]							)
          self.play(Write(_a      ,       run_time=3							)      ,       Write(_a      ,       run_time=1							)      ,       Create(_a      ,       run_time=1							)							)

          lowercase       :							Dict									=				[]
          for i, rect in enumerate(_a							):
                 lowercase       :							Tuple									=				rect.copy()
                 target.generate_target()
                 target.target.move_to(disk_left_col_base[i]							).scale(0.5							)
                 animations.append(MoveToTarget(_a      ,       run_time=1.5							)							)
          self.play(*_a							)

          self.play(FadeOut(_a							)							)

          lowercase       :							Tuple									=				MarkupText(f"""Then, the checkpoint is removed from memory\nthrough garbage collection."""      ,       font_size=24							)
          step_a.move_to([2, 2, 0]							)

          self.play(Write(_a      ,       run_time=3							)							)

          self.play(
              FadeOut(_a      ,       _a      ,       *_a      ,       *_a							)      ,       )

          self.wait()




"""simple docstring"""




def     __magic_name__      ( __snake_case							:			int	,					__snake_case							:			int    )					->							Any:
       if b == 0:
              return 1
       if (b % 2) == 0:
              return actual_power(__snake_case	,					int(b / 2    )    ) * actual_power(__snake_case	,					int(b / 2    )    )
       else:
              return a * actual_power(__snake_case	,					int(b / 2    )    ) * actual_power(__snake_case	,					int(b / 2    )    )


def     __magic_name__      ( __snake_case							:			int	,					__snake_case							:			int    )					->							float:
       if b < 0:
              return 1 / actual_power(__snake_case	,					__snake_case    )
       return actual_power(__snake_case	,					__snake_case    )


if __name__ == "__main__":
   print(power(-2, -3))


