






from manim import *
class        SCREAMING_SNAKE_CASE     (UpperCAmelCase   ):


   def  SCREAMING_SNAKE_CASE_							(					self    :       Dict )->     Tuple:





     """simple docstring"""







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

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

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

     self.add(__UpperCamelCase )

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

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

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

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

     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=18    ,  )

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

     step_a.move_to([2, 2, 0] )
     self.play(Write(__UpperCamelCase    ,  run_time=2.5 )    ,  Write(__UpperCamelCase )    ,  Write(__UpperCamelCase ) )

     self.add(__UpperCamelCase )

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

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

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

     self.play(*__UpperCamelCase )
     self.play(*__UpperCamelCase )

     self.wait()









def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     bool:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  if len(_SCREAMING_SNAKE_CASE	) == 1:
    return True
  lowercase__			    =						series[1] - series[0]
  for index in range(len(_SCREAMING_SNAKE_CASE	) - 1	):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     float:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  lowercase__			    =						0
  for val in series:
    answer += val
  return answer / len(_SCREAMING_SNAKE_CASE	)


if __name__ == "__main__":
      import doctest

      doctest.testmod()


