






from manim import *
class 				A_     (    SCREAMING_SNAKE_CASE_      ):






 '''simple docstring'''




 def 			snake_case__					(						self)			->		List[str]:

     """simple docstring"""



     _UpperCAmelCase					:   Any      	=					Rectangle(height=0.5				,	width=0.5)
     _UpperCAmelCase					:   Optional[int]      	=					Rectangle(height=0.46				,	width=0.46).set_stroke(width=0)

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

     _UpperCAmelCase					:   Union[str, Any]      	=					[mem.copy() for i in range(1)]
     _UpperCAmelCase					:   Tuple      	=					VGroup(*snake_case__).arrange(snake_case__				,	buff=0)
     _UpperCAmelCase					:   Tuple      	=					Text('''GPU'''				,	font_size=24)
     _UpperCAmelCase					:   int      	=					Group(snake_case__				,	snake_case__).arrange(snake_case__				,	buff=0.5				,	aligned_edge=snake_case__)
     gpu.align_to(snake_case__				,	snake_case__)
     gpu.set_x(gpu.get_x() - 1)

     self.add(snake_case__)

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

     _UpperCAmelCase					:   Optional[Any]      	=					Text('''Model'''				,	font_size=24)
     _UpperCAmelCase					:   str      	=					Group(snake_case__				,	snake_case__).arrange(snake_case__				,	buff=0.5				,	aligned_edge=snake_case__)
     model.move_to([3, -1.0, 0])

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

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

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

     _UpperCAmelCase					:   Dict      	=					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(snake_case__				,	run_time=2.5)				,	Write(snake_case__)				,	Write(snake_case__))

     self.add(snake_case__)

     _UpperCAmelCase					:   int      	=					[]
     _UpperCAmelCase					:   str      	=					[]
     _UpperCAmelCase					:   List[str]      	=					[]
     for i, rect in enumerate(snake_case__):
         _UpperCAmelCase					:   Tuple      	=					Rectangle(height=0.46				,	width=0.46).set_stroke(width=0.0).set_fill(snake_case__				,	opacity=0.7)
         cpu_target.move_to(snake_case__)
         cpu_target.generate_target()
         _UpperCAmelCase					:   List[Any]      	=					0.46 / 4
         _UpperCAmelCase					:   Dict      	=					0.46 / 3

         if i == 0:
             cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT)				,	buff=0.02				,	direction=snake_case__)
             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=snake_case__				,	buff=0.0)
         else:
             cpu_target.target.next_to(cpu_targs[i - 1].target				,	direction=snake_case__				,	buff=0.0)
         cpu_targs.append(snake_case__)

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

     self.play(*snake_case__)
     self.play(*snake_case__)

     self.wait()





def 	lowerCamelCase					(	UpperCamelCase     :				int			,       UpperCamelCase     :				int							)   ->    str:
		if number < 0 or shift_amount < 0:
				raise ValueError('both inputs must be positive integers'							)

		_lowerCamelCase				   =  str(bin(UpperCamelCase							)							)
		binary_number += "0" * shift_amount
		return binary_number


def 	lowerCamelCase					(	UpperCamelCase     :				int			,       UpperCamelCase     :				int							)   ->    str:
		if number < 0 or shift_amount < 0:
				raise ValueError('both inputs must be positive integers'							)

		_lowerCamelCase				   =  str(bin(UpperCamelCase							)							)[2:]
		if shift_amount >= len(UpperCamelCase							):
				return "0b0"
		_lowerCamelCase				   =  binary_number[: len(UpperCamelCase							) - shift_amount]
		return "0b" + shifted_binary_number


def 	lowerCamelCase					(	UpperCamelCase     :				int			,       UpperCamelCase     :				int							)   ->    str:
		if number >= 0:  # Get binary representation of positive number
				_lowerCamelCase				   =  '0' + str(bin(UpperCamelCase							)							).strip('-'							)[2:]
		else:  # Get binary (2's complement) representation of negative number
				_lowerCamelCase				   =  len(bin(UpperCamelCase							)[3:]							)  # Find 2's complement of number
				_lowerCamelCase				   =  bin(abs(UpperCamelCase							) - (1 << binary_number_length)							)[3:]
				_lowerCamelCase				   =  (
				    '1' + '0' * (binary_number_length - len(UpperCamelCase							)) + binary_number
				)

		if shift_amount >= len(UpperCamelCase							):
				return "0b" + binary_number[0] * len(UpperCamelCase							)
		return (
		    "0b"
		    + binary_number[0] * shift_amount
		    + binary_number[: len(UpperCamelCase							) - shift_amount]
		)


if __name__ == "__main__":
				import doctest

				doctest.testmod()