"""simple docstring"""



from manim import *

class SCREAMING_SNAKE_CASE  (     UpperCAmelCase_						):







 """simple docstring"""


 def 							_lowerCAmelCase					( self		:   str					)					->      Dict:




    '''simple docstring'''






    a__  					=		Rectangle(height=0.5       , width=0.5					)
    a__  					=		Rectangle(height=0.46       , width=0.46					).set_stroke(width=0					)

    a__  					=		[mem.copy() for i in range(6					)]
    a__  					=		[mem.copy() for i in range(6					)]
    a__  					=		VGroup(*SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0					)
    a__  					=		VGroup(*SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0					)
    a__  					=		VGroup(SCREAMING_SNAKE_CASE_       , SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0					)
    a__  					=		Text('CPU'       , font_size=24					)
    a__  					=		Group(SCREAMING_SNAKE_CASE_       , SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0.5       , aligned_edge=SCREAMING_SNAKE_CASE_					)
    cpu.move_to([-2.5, -0.5, 0]					)
    self.add(SCREAMING_SNAKE_CASE_					)

    a__  					=		[mem.copy() for i in range(1					)]
    a__  					=		VGroup(*SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0					)
    a__  					=		Text('GPU'       , font_size=24					)
    a__  					=		Group(SCREAMING_SNAKE_CASE_       , SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0.5       , aligned_edge=SCREAMING_SNAKE_CASE_					)
    gpu.align_to(SCREAMING_SNAKE_CASE_       , SCREAMING_SNAKE_CASE_					)
    gpu.set_x(gpu.get_x() - 1					)

    self.add(SCREAMING_SNAKE_CASE_					)

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

    a__  					=		Text('Model'       , font_size=24					)
    a__  					=		Group(SCREAMING_SNAKE_CASE_       , SCREAMING_SNAKE_CASE_					).arrange(SCREAMING_SNAKE_CASE_       , buff=0.5       , aligned_edge=SCREAMING_SNAKE_CASE_					)
    model.move_to([3, -1.0, 0]					)

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

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

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

    a__  					=		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(SCREAMING_SNAKE_CASE_       , run_time=2.5					)       , Write(SCREAMING_SNAKE_CASE_					)       , Write(SCREAMING_SNAKE_CASE_					)					)

    self.add(SCREAMING_SNAKE_CASE_					)

    a__  					=		[]
    a__  					=		[]
    a__  					=		[]
    for i, rect in enumerate(SCREAMING_SNAKE_CASE_					):
       a__  					=		Rectangle(height=0.46       , width=0.46					).set_stroke(width=0.0					).set_fill(SCREAMING_SNAKE_CASE_       , opacity=0.7					)
       cpu_target.move_to(SCREAMING_SNAKE_CASE_					)
       cpu_target.generate_target()
       a__  					=		0.46 / 4
       a__  					=		0.46 / 3

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

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

    self.play(*SCREAMING_SNAKE_CASE_					)
    self.play(*SCREAMING_SNAKE_CASE_					)

    self.wait()




def 		UpperCamelCase						(   lowercase_ )		->						float:


  '''simple docstring'''






  if not nums:  # Makes sure that the list is not empty
    raise ValueError("""List is empty""" )

  lowercase__	: int     		=   sum(lowercase_ ) / len(lowercase_ )  # Calculate the average
  return sum(abs(x - average ) for x in nums ) / len(lowercase_ )


if __name__ == "__main__":
     import doctest

     doctest.testmod()






