





'''simple docstring'''

from manim import *

class       UpperCAmelCase (						_lowercase  ):




		def 				UpperCAmelCase__   (self      :	List[str]				)					-> List[str]:
						lowercase         = Rectangle(height=0.5							,			width=0.5				)
						lowercase         = Rectangle(height=0.2_5							,			width=0.2_5				)
						lowercase         = Rectangle(height=0.4_6							,			width=0.4_6				).set_stroke(width=0				)

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

						lowercase         = [mem.copy() for i in range(4				)]
						lowercase         = VGroup(*A__				).arrange(A__							,			buff=0				)
						lowercase         = Text("GPU"							,			font_size=2_4				)
						lowercase         = Group(A__							,			A__				).arrange(A__							,			buff=0.5							,			aligned_edge=A__				)
						gpu.move_to([-1, -1, 0]				)
						self.add(A__				)

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

						lowercase         = Text("Model"							,			font_size=2_4				)
						lowercase         = Group(A__							,			A__				).arrange(A__							,			buff=0.5							,			aligned_edge=A__				)
						model.move_to([3, -1.0, 0]				)
						self.add(A__				)

						lowercase         = []
						lowercase         = []
						lowercase         = []

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

										lowercase         = 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         = [mem.copy() for i in range(6				)]
						lowercase         = VGroup(*A__				).arrange(A__							,			buff=0				)

						lowercase         = Text("Loaded Checkpoint"							,			font_size=2_4				)
						lowercase         = Group(A__							,			A__				).arrange(A__							,			buff=0.5							,			aligned_edge=A__				)
						checkpoint.move_to([3, 0.5, 0]				)

						self.add(A__				)

						lowercase         = []
						lowercase         = []

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

										lowercase         = 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         = Square(side_length=2.2				)
						key.move_to([-5, 2, 0]				)

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

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

						self.add(A__							,			A__				)

						lowercase         = MarkupText(
						    f'<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'							,			font_size=1_8							,			)

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

						lowercase         = 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=2_4							,			)
						step_a.move_to([2, 2, 0]				)

						lowercase         = [meta_mem.copy() for i in range(6				)]
						lowercase         = [meta_mem.copy() for i in range(6				)]
						lowercase         = VGroup(*A__				).arrange(A__							,			buff=0				)
						lowercase         = VGroup(*A__				).arrange(A__							,			buff=0				)
						lowercase         = VGroup(A__							,			A__				).arrange(A__							,			buff=0				)
						lowercase         = Text("Disk"							,			font_size=2_4				)
						lowercase         = 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         = []
						for i, rect in enumerate(A__				):
										lowercase         = 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         = MarkupText(f'Then, the checkpoint is removed from memory\nthrough garbage collection.'							,			font_size=2_4				)
						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'''

__lowerCamelCase : str											=			8.314_4598







def 							UpperCAmelCase_    (	lowerCAmelCase_		,							lowerCAmelCase_							):

				"""simple docstring"""






				if temperature < 0:
								raise Exception("Temperature cannot be less than 0 K"							)
				if molar_mass <= 0:
								raise Exception("Molar mass cannot be less than or equal to 0 kg/mol"							)
				else:
								return (3 * UNIVERSAL_GAS_CONSTANT * temperature / molar_mass) ** 0.5


if __name__ == "__main__":
			import doctest

			# run doctest
			doctest.testmod()

			# example
			__lowerCamelCase : Optional[Any]											=			300
			__lowerCamelCase : Tuple											=			28
			__lowerCamelCase : str											=			rms_speed_of_molecule(temperature, molar_mass)
			print(f"Vrms of Nitrogen gas at 300 K is {vrms} m/s")




