
"""simple docstring"""





from manim import *
class 						SCREAMING_SNAKE_CASE_ (						__a ):




		"""simple docstring"""





		def 	snake_case_     (     self):
				__SCREAMING_SNAKE_CASE            = Rectangle(height=0.5							,  width=0.5)
				__SCREAMING_SNAKE_CASE            = Rectangle(height=0.25							,  width=0.25)
				__SCREAMING_SNAKE_CASE            = Rectangle(height=0.46							,  width=0.46).set_stroke(width=0)

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

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

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

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

				__SCREAMING_SNAKE_CASE            = []
				__SCREAMING_SNAKE_CASE            = []
				__SCREAMING_SNAKE_CASE            = []

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

						__SCREAMING_SNAKE_CASE            = Rectangle(height=0.46 / 4							,  width=0.46 / 3).set_stroke(width=0.0).set_fill(lowerCAmelCase__							,  opacity=0.7)

						if i == 0:
								cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT)							,  buff=0.02							,  direction=lowerCAmelCase__)
								cpu_target.set_x(cpu_target.get_x() + 0.1)
						elif i == 3:
								cpu_target.next_to(model_cpu_arr[0]							,  direction=lowerCAmelCase__							,  buff=0.0)
						else:
								cpu_target.next_to(model_cpu_arr[i - 1]							,  direction=lowerCAmelCase__							,  buff=0.0)
						self.add(lowerCAmelCase__)
						model_cpu_arr.append(lowerCAmelCase__)

				self.add(*lowerCAmelCase__							,  *lowerCAmelCase__							,  *lowerCAmelCase__)

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

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

				self.add(lowerCAmelCase__)

				__SCREAMING_SNAKE_CASE            = []
				__SCREAMING_SNAKE_CASE            = []

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

						__SCREAMING_SNAKE_CASE            = 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(lowerCAmelCase__)
				self.add(*lowerCAmelCase__							,  *lowerCAmelCase__)

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

				__SCREAMING_SNAKE_CASE            = 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(lowerCAmelCase__							,  lowerCAmelCase__)

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

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

				__SCREAMING_SNAKE_CASE            = 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])

				__SCREAMING_SNAKE_CASE            = [meta_mem.copy() for i in range(6)]
				__SCREAMING_SNAKE_CASE            = [meta_mem.copy() for i in range(6)]
				__SCREAMING_SNAKE_CASE            = VGroup(*lowerCAmelCase__).arrange(lowerCAmelCase__							,  buff=0)
				__SCREAMING_SNAKE_CASE            = VGroup(*lowerCAmelCase__).arrange(lowerCAmelCase__							,  buff=0)
				__SCREAMING_SNAKE_CASE            = VGroup(lowerCAmelCase__							,  lowerCAmelCase__).arrange(lowerCAmelCase__							,  buff=0)
				__SCREAMING_SNAKE_CASE            = Text("""Disk"""							,  font_size=2_4)
				__SCREAMING_SNAKE_CASE            = Group(lowerCAmelCase__							,  lowerCAmelCase__).arrange(lowerCAmelCase__							,  buff=0.5							,  aligned_edge=lowerCAmelCase__)
				disk.move_to([-4.0, -1.25, 0])
				self.play(Write(lowerCAmelCase__							,  run_time=3)							,  Write(lowerCAmelCase__							,  run_time=1)							,  Create(lowerCAmelCase__							,  run_time=1))

				__SCREAMING_SNAKE_CASE            = []
				for i, rect in enumerate(lowerCAmelCase__):
						__SCREAMING_SNAKE_CASE            = rect.copy()
						target.generate_target()
						target.target.move_to(disk_left_col_base[i]).scale(0.5)
						animations.append(MoveToTarget(lowerCAmelCase__							,  run_time=1.5))
				self.play(*lowerCAmelCase__)

				self.play(FadeOut(lowerCAmelCase__))

				__SCREAMING_SNAKE_CASE            = 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(lowerCAmelCase__							,  run_time=3))

				self.play(
				    FadeOut(lowerCAmelCase__							,  lowerCAmelCase__							,  *lowerCAmelCase__							,  *lowerCAmelCase__)							,  )

				self.wait()






"""simple docstring"""





from collections import defaultdict



def 						_lowerCAmelCase				(				UpperCamelCase_  ,				UpperCamelCase_				):
		__SCREAMING_SNAKE_CASE            = first_str.lower().strip()
		__SCREAMING_SNAKE_CASE            = second_str.lower().strip()

		# Remove whitespace
		__SCREAMING_SNAKE_CASE            = first_str.replace(""" """  ,				""""""				)
		__SCREAMING_SNAKE_CASE            = second_str.replace(""" """  ,				""""""				)

		# Strings of different lengths are not anagrams
		if len(UpperCamelCase_				) != len(UpperCamelCase_				):
				return False

		# Default values for count should be 0
		__SCREAMING_SNAKE_CASE            = defaultdict(UpperCamelCase_				)

		# For each character in input strings,
		# increment count in the corresponding
		for i in range(len(UpperCamelCase_				)				):
				count[first_str[i]] += 1
				count[second_str[i]] -= 1

		return all(_count == 0 for _count in count.values()				)


if __name__ == "__main__":
							from doctest import testmod

							testmod()
							__magic_name__       =			input("Enter the first string ").strip()
							__magic_name__       =			input("Enter the second string ").strip()

							__magic_name__       =			check_anagrams(input_a, input_b)
							print(F"""{input_a} and {input_b} are {"" if status else "not "}anagrams.""")




