





'''simple docstring'''




from manim import *






class UpperCAmelCase							(		UpperCAmelCase_							):



    def 					__lowerCamelCase						(  self					):
     __UpperCAmelCase					=   Rectangle(height=0.5     ,			width=0.5					)
     __UpperCAmelCase					=   Rectangle(height=0.4_6     ,			width=0.4_6					).set_stroke(width=0					)

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

     __UpperCAmelCase					=   [mem.copy() for i in range(4					)]
     __UpperCAmelCase					=   VGroup(*__A					).arrange(__A     ,			buff=0					)
     __UpperCAmelCase					=   Text('GPU'     ,			font_size=24					)
     __UpperCAmelCase					=   Group(__A     ,			__A					).arrange(__A     ,			buff=0.5     ,			aligned_edge=__A					)
     gpu.move_to([-1, -1, 0]					)
     self.add(__A					)

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

     __UpperCAmelCase					=   Text('Model'     ,			font_size=24					)
     __UpperCAmelCase					=   Group(__A     ,			__A					).arrange(__A     ,			buff=0.5     ,			aligned_edge=__A					)
     model.move_to([3, -1.0, 0]					)
     self.add(__A					)

     __UpperCAmelCase					=   []
     for i, rect in enumerate(__A					):
      rect.set_stroke(__A					)
      # target = fill.copy().set_fill(YELLOW, opacity=0.7)
      # target.move_to(rect)
      # self.add(target)

      __UpperCAmelCase					=   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(cpu_targs[0]     ,			direction=__A     ,			buff=0.0					)
      else:
       cpu_target.next_to(cpu_targs[i - 1]     ,			direction=__A     ,			buff=0.0					)
      self.add(__A					)
      cpu_targs.append(__A					)

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

     __UpperCAmelCase					=   Text('Loaded Checkpoint'     ,			font_size=24					)
     __UpperCAmelCase					=   Group(__A     ,			__A					).arrange(__A     ,			aligned_edge=__A     ,			buff=0.4					)
     checkpoint.move_to([3, 0.5, 0]					)

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

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

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

     self.add(__A     ,			__A					)

     __UpperCAmelCase					=   MarkupText(
         f'<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'     ,			font_size=18     ,			)

     blue_text.next_to(__A     ,			DOWN * 2.4     ,			aligned_edge=key_text.get_left()					)

     __UpperCAmelCase					=   MarkupText(
         f'Next, a <i><span fgcolor="{BLUE}">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor="{BLUE}">single shard</span>.'     ,			font_size=24     ,			)
     step_a.move_to([2, 2, 0]					)
     self.play(Write(__A					)     ,			Write(__A					)					)

     self.play(Write(__A     ,			run_time=1					)     ,			Create(__A     ,			run_time=1					)					)

     __UpperCAmelCase					=   []
     __UpperCAmelCase					=   []
     for i, rect in enumerate(__A					):
      __UpperCAmelCase					=   fill.copy().set_fill(__A     ,			opacity=0.7					)
      target.move_to(__A					)
      first_animations.append(GrowFromCenter(__A     ,			run_time=1					)					)

      __UpperCAmelCase					=   target.copy()
      cpu_target.generate_target()
      if i < 5:
       cpu_target.target.move_to(cpu_left_col_base[i + 1]					)
      else:
       cpu_target.target.move_to(cpu_right_col_base[i - 5]					)
      second_animations.append(MoveToTarget(__A     ,			run_time=1.5					)					)

     self.play(*__A					)
     self.play(*__A					)
     self.wait()












'''simple docstring'''




from __future__ import annotations







def _lowerCAmelCase     (      _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase       ,    )->     tuple:
 if (electron_conc, hole_conc, intrinsic_conc).count(0    ) != 1:
  raise ValueError('You cannot supply more or less than 2 values'    )
 elif electron_conc < 0:
  raise ValueError('Electron concentration cannot be negative in a semiconductor'    )
 elif hole_conc < 0:
  raise ValueError('Hole concentration cannot be negative in a semiconductor'    )
 elif intrinsic_conc < 0:
  raise ValueError(
      'Intrinsic concentration cannot be negative in a semiconductor'    )
 elif electron_conc == 0:
  return (
      "electron_conc",
      intrinsic_conc**2 / hole_conc,
  )
 elif hole_conc == 0:
  return (
      "hole_conc",
      intrinsic_conc**2 / electron_conc,
  )
 elif intrinsic_conc == 0:
  return (
      "intrinsic_conc",
      (electron_conc * hole_conc) ** 0.5,
  )
 else:
  return (-1, -1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()





