
"""simple docstring"""




import itertools
import json
import os
import unittest

from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast
from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin







@require_tokenizers
class   _lowercase						(       __UpperCAmelCase	,   unittest.TestCase				):


					'''simple docstring'''





					_A								=							LongformerTokenizer
					_A								=							True
					_A								=							LongformerTokenizerFast
					_A								=							True



					def  lowerCAmelCase__       (      self  )->					str:
										super().setUp()

										# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
										UpperCAmelCase__							: int 							=						[
										    "l",
										    "o",
										    "w",
										    "e",
										    "r",
										    "s",
										    "t",
										    "i",
										    "d",
										    "n",
										    "\u0120",
										    "\u0120l",
										    "\u0120n",
										    "\u0120lo",
										    "\u0120low",
										    "er",
										    "\u0120lowest",
										    "\u0120newer",
										    "\u0120wider",
										    "<unk>",
										]
										UpperCAmelCase__							: int 							=						dict(zip(__UpperCamelCase ,			range(len(__UpperCamelCase  )  )  )  )
										UpperCAmelCase__							: Dict 							=						["#version: 0.2", "\u0120 l", "\u0120l o", "\u0120lo w", "e r", ""]
										UpperCAmelCase__							: List[str] 							=						{"unk_token": "<unk>"}

										UpperCAmelCase__							: Union[str, Any] 							=						os.path.join(self.tmpdirname ,			VOCAB_FILES_NAMES["vocab_file"]  )
										UpperCAmelCase__							: Tuple 							=						os.path.join(self.tmpdirname ,			VOCAB_FILES_NAMES["merges_file"]  )
										with open(self.vocab_file ,			"w" ,			encoding="utf-8"  ) as fp:
															fp.write(json.dumps(__UpperCamelCase  ) + "\n"  )
										with open(self.merges_file ,			"w" ,			encoding="utf-8"  ) as fp:
															fp.write("\n".join(__UpperCamelCase  )  )



					def  lowerCAmelCase__       (      self ,			**__UpperCamelCase  )->					List[Any]:
										kwargs.update(self.special_tokens_map  )
										return self.tokenizer_class.from_pretrained(self.tmpdirname ,			**__UpperCamelCase  )



					def  lowerCAmelCase__       (      self ,			**__UpperCamelCase  )->					List[Any]:
										kwargs.update(self.special_tokens_map  )
										return self.rust_tokenizer_class.from_pretrained(self.tmpdirname ,			**__UpperCamelCase  )



					def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					Tuple:
										UpperCAmelCase__							: Optional[Any] 							=						"lower newer"
										UpperCAmelCase__							: str 							=						"lower newer"
										return input_text, output_text



					def  lowerCAmelCase__       (      self  )->					str:
										UpperCAmelCase__							: Union[str, Any] 							=						self.tokenizer_class(self.vocab_file ,			self.merges_file ,			**self.special_tokens_map  )
										UpperCAmelCase__							: Optional[int] 							=						"lower newer"
										UpperCAmelCase__							: int 							=						["l", "o", "w", "er", "\u0120", "n", "e", "w", "er"]
										UpperCAmelCase__							: List[Any] 							=						tokenizer.tokenize(__UpperCamelCase  )  # , add_prefix_space=True)
										self.assertListEqual(__UpperCamelCase ,			__UpperCamelCase  )

										UpperCAmelCase__							: Optional[Any] 							=						tokens + [tokenizer.unk_token]
										UpperCAmelCase__							: Dict 							=						[0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
										self.assertListEqual(tokenizer.convert_tokens_to_ids(__UpperCamelCase  ) ,			__UpperCamelCase  )



					def  lowerCAmelCase__       (      self  )->					Optional[Any]:
										UpperCAmelCase__							: int 							=						self.get_tokenizer()

										self.assertListEqual(tokenizer.encode("Hello world!" ,			add_special_tokens=__UpperCamelCase  ) ,			[0, 3_14_14, 2_32, 3_28, 2]  )
										self.assertListEqual(
										    tokenizer.encode("Hello world! cécé herlolip 418" ,			add_special_tokens=__UpperCamelCase  ) ,			[0, 3_14_14, 2_32, 3_28, 7_40, 11_40, 1_26_95, 69, 4_60_78, 15_88, 2] ,			)



					@slow
					def  lowerCAmelCase__       (      self  )->					Tuple:
										UpperCAmelCase__							: List[Any] 							=						self.tokenizer_class.from_pretrained("allenai/longformer-base-4096"  )

										UpperCAmelCase__							: Optional[Any] 							=						tokenizer.encode("sequence builders" ,			add_special_tokens=__UpperCamelCase  )
										UpperCAmelCase__							: Optional[Any] 							=						tokenizer.encode("multi-sequence build" ,			add_special_tokens=__UpperCamelCase  )

										UpperCAmelCase__							: Optional[int] 							=						tokenizer.encode(
										    "sequence builders" ,			add_special_tokens=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase  )
										UpperCAmelCase__							: Dict 							=						tokenizer.encode(
										    "sequence builders" ,			"multi-sequence build" ,			add_special_tokens=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase  )

										UpperCAmelCase__							: Dict 							=						tokenizer.build_inputs_with_special_tokens(__UpperCamelCase  )
										UpperCAmelCase__							: str 							=						tokenizer.build_inputs_with_special_tokens(__UpperCamelCase ,			__UpperCamelCase  )

										assert encoded_sentence == encoded_text_from_decode
										assert encoded_pair == encoded_pair_from_decode



					def  lowerCAmelCase__       (      self  )->					Optional[Any]:
										UpperCAmelCase__							: Tuple 							=						self.get_tokenizer()

										UpperCAmelCase__							: Optional[Any] 							=						"Encode this sequence."
										UpperCAmelCase__							: List[Any] 							=						tokenizer.byte_encoder[" ".encode("utf-8"  )[0]]

										# Testing encoder arguments
										UpperCAmelCase__							: Any 							=						tokenizer.encode(__UpperCamelCase ,			add_special_tokens=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase  )
										UpperCAmelCase__							: Union[str, Any] 							=						tokenizer.convert_ids_to_tokens(encoded[0]  )[0]
										self.assertNotEqual(__UpperCamelCase ,			__UpperCamelCase  )

										UpperCAmelCase__							: Tuple 							=						tokenizer.encode(__UpperCamelCase ,			add_special_tokens=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase  )
										UpperCAmelCase__							: List[Any] 							=						tokenizer.convert_ids_to_tokens(encoded[0]  )[0]
										self.assertEqual(__UpperCamelCase ,			__UpperCamelCase  )

										tokenizer.add_special_tokens({"bos_token": "<s>"}  )
										UpperCAmelCase__							: Union[str, Any] 							=						tokenizer.encode(__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
										UpperCAmelCase__							: Union[str, Any] 							=						tokenizer.convert_ids_to_tokens(encoded[1]  )[0]
										self.assertNotEqual(__UpperCamelCase ,			__UpperCamelCase  )

										# Testing spaces after special tokens
										UpperCAmelCase__							: Union[str, Any] 							=						"<mask>"
										tokenizer.add_special_tokens(
										    {"mask_token": AddedToken(__UpperCamelCase ,			lstrip=__UpperCamelCase ,			rstrip=__UpperCamelCase  )}  )  # mask token has a left space
										UpperCAmelCase__							: Optional[Any] 							=						tokenizer.convert_tokens_to_ids(__UpperCamelCase  )

										UpperCAmelCase__							: Dict 							=						"Encode <mask> sequence"
										UpperCAmelCase__							: Optional[Any] 							=						"Encode <mask>sequence"

										UpperCAmelCase__							: List[str] 							=						tokenizer.encode(__UpperCamelCase  )
										UpperCAmelCase__							: Optional[Any] 							=						encoded.index(__UpperCamelCase  )
										UpperCAmelCase__							: Dict 							=						tokenizer.convert_ids_to_tokens(encoded[mask_loc + 1]  )[0]
										self.assertEqual(__UpperCamelCase ,			__UpperCamelCase  )

										UpperCAmelCase__							: List[str] 							=						tokenizer.encode(__UpperCamelCase  )
										UpperCAmelCase__							: int 							=						encoded.index(__UpperCamelCase  )
										UpperCAmelCase__							: Dict 							=						tokenizer.convert_ids_to_tokens(encoded[mask_loc + 1]  )[0]
										self.assertNotEqual(__UpperCamelCase ,			__UpperCamelCase  )



					def  lowerCAmelCase__       (      self  )->					int:
										pass



					def  lowerCAmelCase__       (      self  )->					Optional[Any]:

										for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
															with self.subTest(F"{tokenizer.__class__.__name__} ({pretrained_name})"  ):
																				UpperCAmelCase__							: Dict 							=						self.rust_tokenizer_class.from_pretrained(__UpperCamelCase ,			**__UpperCamelCase  )
																				UpperCAmelCase__							: Dict 							=						self.tokenizer_class.from_pretrained(__UpperCamelCase ,			**__UpperCamelCase  )
																				UpperCAmelCase__							: List[str] 							=						"A, <mask> AllenNLP sentence."
																				UpperCAmelCase__							: int 							=						tokenizer_r.encode_plus(__UpperCamelCase ,			add_special_tokens=__UpperCamelCase ,			return_token_type_ids=__UpperCamelCase  )
																				UpperCAmelCase__							: Optional[Any] 							=						tokenizer_p.encode_plus(__UpperCamelCase ,			add_special_tokens=__UpperCamelCase ,			return_token_type_ids=__UpperCamelCase  )

																				# token_type_ids should put 0 everywhere
																				self.assertEqual(sum(tokens_r["token_type_ids"]  ) ,			sum(tokens_p["token_type_ids"]  )  )

																				# attention_mask should put 1 everywhere, so sum over length should be 1
																				self.assertEqual(
																				    sum(tokens_r["attention_mask"]  ) / len(tokens_r["attention_mask"]  ) ,			sum(tokens_p["attention_mask"]  ) / len(tokens_p["attention_mask"]  ) ,			)

																				UpperCAmelCase__							: List[Any] 							=						tokenizer_r.convert_ids_to_tokens(tokens_r["input_ids"]  )
																				UpperCAmelCase__							: int 							=						tokenizer_p.convert_ids_to_tokens(tokens_p["input_ids"]  )

																				# Rust correctly handles the space before the mask while python doesnt
																				self.assertSequenceEqual(tokens_p["input_ids"] ,			[0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]  )
																				self.assertSequenceEqual(tokens_r["input_ids"] ,			[0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]  )

																				self.assertSequenceEqual(
																				    __UpperCamelCase ,			["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"]  )
																				self.assertSequenceEqual(
																				    __UpperCamelCase ,			["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"]  )



					def  lowerCAmelCase__       (      self  )->					Dict:

										for trim_offsets, add_prefix_space in itertools.product([True, False] ,			repeat=2  ):
															UpperCAmelCase__							: str 							=						self.rust_tokenizer_class.from_pretrained(
															    self.tmpdirname ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )

															UpperCAmelCase__							: Tuple 							=						json.loads(tokenizer_r.backend_tokenizer.pre_tokenizer.__getstate__()  )
															UpperCAmelCase__							: List[Any] 							=						json.loads(tokenizer_r.backend_tokenizer.post_processor.__getstate__()  )

															self.assertEqual(pre_tokenizer_state["add_prefix_space"] ,			__UpperCamelCase  )

															self.assertEqual(post_processor_state["add_prefix_space"] ,			__UpperCamelCase  )
															self.assertEqual(post_processor_state["trim_offsets"] ,			__UpperCamelCase  )



					def  lowerCAmelCase__       (      self  )->					Any:

										for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
															with self.subTest(F"{tokenizer.__class__.__name__} ({pretrained_name})"  ):
																				UpperCAmelCase__							: List[str] 							=						"hello"  # `hello` is a token in the vocabulary of `pretrained_name`
																				UpperCAmelCase__							: str 							=						F"{text_of_1_token} {text_of_1_token}"

																				UpperCAmelCase__							: Dict 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: int 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(len(__UpperCamelCase  ) + 1, len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: List[Any] 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: Optional[Any] 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(len(__UpperCamelCase  ) + 1, len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: int 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: Union[str, Any] 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(len(__UpperCamelCase  ), len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: Union[str, Any] 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: Tuple 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(len(__UpperCamelCase  ), len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: Optional[int] 							=						F" {text}"

																				# tokenizer_r = self.rust_tokenizer_class.from_pretrained(
																				#     pretrained_name, use_fast=True, add_prefix_space=True, trim_offsets=True
																				# )
																				# encoding = tokenizer_r(text, return_offsets_mapping=True, add_special_tokens=False)
																				# self.assertEqual(encoding.offset_mapping[0], (1, 1 + len(text_of_1_token)))
																				# self.assertEqual(
																				#     encoding.offset_mapping[1],
																				#     (1 + len(text_of_1_token) + 1, 1 + len(text_of_1_token) + 1 + len(text_of_1_token)),
																				# )

																				UpperCAmelCase__							: str 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: Optional[Any] 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(1, 1 + len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(1 + len(__UpperCamelCase  ) + 1, 1 + len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: Tuple 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: List[Any] 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, 1 + len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(1 + len(__UpperCamelCase  ), 1 + len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)

																				UpperCAmelCase__							: Tuple 							=						self.rust_tokenizer_class.from_pretrained(
																				    __UpperCamelCase ,			use_fast=__UpperCamelCase ,			add_prefix_space=__UpperCamelCase ,			trim_offsets=__UpperCamelCase  )
																				UpperCAmelCase__							: Optional[int] 							=						tokenizer_r(__UpperCamelCase ,			return_offsets_mapping=__UpperCamelCase ,			add_special_tokens=__UpperCamelCase  )
																				self.assertEqual(encoding.offset_mapping[0] ,			(0, 1 + len(__UpperCamelCase  ))  )
																				self.assertEqual(
																				    encoding.offset_mapping[1] ,			(1 + len(__UpperCamelCase  ), 1 + len(__UpperCamelCase  ) + 1 + len(__UpperCamelCase  )) ,			)





"""simple docstring"""




from manim import *







class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     def  lowerCAmelCase__       (      self  )->					Tuple:
          UpperCAmelCase__							: str 							=						Rectangle(height=0.5 ,			width=0.5  )
          UpperCAmelCase__							: List[str] 							=						Rectangle(height=0.46 ,			width=0.46  ).set_stroke(width=0  )

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

          UpperCAmelCase__							: List[Any] 							=						[mem.copy() for i in range(4  )]
          UpperCAmelCase__							: List[str] 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )
          UpperCAmelCase__							: Union[str, Any] 							=						Text("GPU" ,			font_size=24  )
          UpperCAmelCase__							: Dict 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0.5 ,			aligned_edge=__UpperCamelCase  )
          gpu.move_to([-1, -1, 0]  )
          self.add(__UpperCamelCase  )

          UpperCAmelCase__							: Optional[int] 							=						[mem.copy() for i in range(6  )]
          UpperCAmelCase__							: List[str] 							=						VGroup(*__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0  )

          UpperCAmelCase__							: Tuple 							=						Text("Model" ,			font_size=24  )
          UpperCAmelCase__							: Dict 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			buff=0.5 ,			aligned_edge=__UpperCamelCase  )
          model.move_to([3, -1.0, 0]  )
          self.add(__UpperCamelCase  )

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

               UpperCAmelCase__							: int 							=						Rectangle(height=0.46 / 4 ,			width=0.46 / 3  ).set_stroke(width=0.0  ).set_fill(__UpperCamelCase ,			opacity=0.7  )

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

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

          UpperCAmelCase__							: Tuple 							=						Text("Loaded Checkpoint" ,			font_size=24  )
          UpperCAmelCase__							: Any 							=						Group(__UpperCamelCase ,			__UpperCamelCase  ).arrange(__UpperCamelCase ,			aligned_edge=__UpperCamelCase ,			buff=0.4  )
          checkpoint.move_to([3, 0.5, 0]  )

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

          UpperCAmelCase__							: Any 							=						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(__UpperCamelCase ,			__UpperCamelCase  )

          UpperCAmelCase__							: str 							=						MarkupText(
              F"<span fgcolor='{BLUE}'>●</span> Checkpoint" ,			font_size=18 ,			)

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

          UpperCAmelCase__							: Optional[Any] 							=						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(__UpperCamelCase  ) ,			Write(__UpperCamelCase  )  )

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

          UpperCAmelCase__							: Union[str, Any] 							=						[]
          UpperCAmelCase__							: List[str] 							=						[]
          for i, rect in enumerate(__UpperCamelCase  ):
               UpperCAmelCase__							: Optional[Any] 							=						fill.copy().set_fill(__UpperCamelCase ,			opacity=0.7  )
               target.move_to(__UpperCamelCase  )
               first_animations.append(GrowFromCenter(__UpperCamelCase ,			run_time=1  )  )

               UpperCAmelCase__							: List[str] 							=						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(__UpperCamelCase ,			run_time=1.5  )  )

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



