
'''simple docstring'''






import itertools
import os
import re


A			      =      re.compile(R'([A-Z]+)([A-Z][a-z])')
A			      =      re.compile(R'([a-z\d])([A-Z])')

A			      =      re.compile(R'(?<!_)_(?!_)')
A			      =      re.compile(R'(_{2,})')

A			      =      R'^\w+(\.\w+)*$'

A			      =      R'<>:/\|?*'





def    UpperCAmelCase							(  UpperCAmelCase__							:							str):
				lowerCamelCase					:			Optional[Any]									= _uppercase_uppercase_re.sub(R'\1_\2'       ,							UpperCAmelCase__)
				lowerCamelCase					:			List[str]									= _lowercase_uppercase_re.sub(R'\1_\2'       ,							UpperCAmelCase__)
				return name.lower()





def    UpperCAmelCase							(  UpperCAmelCase__							:							Any):
				lowerCamelCase					:			Tuple									= _single_underscore_re.split(UpperCAmelCase__)
				lowerCamelCase					:			str									= [_multiple_underscores_re.split(UpperCAmelCase__) for n in name]
				return "".join(n.capitalize() for n in itertools.chain.from_iterable(UpperCAmelCase__) if n != '')





def    UpperCAmelCase							(  UpperCAmelCase__							:							Optional[Any]):
				if os.path.basename(UpperCAmelCase__) != name:
								raise ValueError(F'''Should be a dataset name, not a path: {name}''')
				return camelcase_to_snakecase(UpperCAmelCase__)





def    UpperCAmelCase							(  UpperCAmelCase__							:							Any       ,							UpperCAmelCase__							:							Any):
				if os.path.basename(UpperCAmelCase__) != name:
								raise ValueError(F'''Should be a dataset name, not a path: {name}''')
				if not re.match(_split_re       ,							UpperCAmelCase__):
								raise ValueError(F'''Split name should match \'{_split_re}\'\' but got \'{split}\'.''')
				return F'''{filename_prefix_for_name(UpperCAmelCase__)}-{split}'''





def    UpperCAmelCase							(  UpperCAmelCase__							:							Union[str, Any]       ,							UpperCAmelCase__							:							Optional[Any]       ,							UpperCAmelCase__							:							Any       ,							UpperCAmelCase__							:							Optional[Any]=None):
				lowerCamelCase					:			Union[str, Any]									= filename_prefix_for_split(UpperCAmelCase__       ,							UpperCAmelCase__)
				if filetype_suffix:
								prefix += F'''.{filetype_suffix}'''
				lowerCamelCase					:			Tuple									= os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__)
				return F'''{filepath}*'''





def    UpperCAmelCase							(  UpperCAmelCase__							:							int       ,							UpperCAmelCase__							:							Union[str, Any]       ,							UpperCAmelCase__							:							Optional[Any]       ,							UpperCAmelCase__							:							int=None       ,							UpperCAmelCase__							:							List[str]=None):
				lowerCamelCase					:			Optional[Any]									= filename_prefix_for_split(UpperCAmelCase__       ,							UpperCAmelCase__)
				lowerCamelCase					:			Any									= os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__)

				if shard_lengths:
								lowerCamelCase					:			List[str]									= len(UpperCAmelCase__)
								lowerCamelCase					:			int									= [F'''{prefix}-{shard_id:05d}-of-{num_shards:05d}''' for shard_id in range(UpperCAmelCase__)]
								if filetype_suffix:
												lowerCamelCase					:			str									= [filename + F'''.{filetype_suffix}''' for filename in filenames]
								return filenames
				else:
								lowerCamelCase					:			Any									= prefix
								if filetype_suffix:
												filename += F'''.{filetype_suffix}'''
								return [filename]


'''simple docstring'''






from manim import *




class     __snake_case		(   a__):
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


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

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

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

									self.add(A      )

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

									lowerCamelCase					:			Any									= Text('Model',    font_size=24      )
									lowerCamelCase					:			Tuple									= Group(A,    A      ).arrange(A,    buff=0.5,    aligned_edge=A      )
									model.move_to([3, -1.0, 0]      )

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

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

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

									lowerCamelCase					:			Tuple									= 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(A,    run_time=2.5      ),    Write(A      ),    Write(A      )      )

									self.add(A      )

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

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

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

									self.play(*A      )
									self.play(*A      )

									self.wait()
