



import os
import tempfile
import unittest
from typing import List

from transformers.models.esm.tokenization_esm import VOCAB_FILES_NAMES, EsmTokenizer
from transformers.testing_utils import require_tokenizers
from transformers.tokenization_utils import PreTrainedTokenizer
from transformers.tokenization_utils_base import PreTrainedTokenizerBase





@require_tokenizers
class    lowerCAmelCase__				(			unittest.TestCase       ):






						"""simple docstring"""
						__UpperCAmelCase   :		Union[str, Any]  					=	EsmTokenizer




						def 					_UpperCamelCase			(   self     ):
							super().setUp()
							lowerCamelCase_			:							Optional[int]      =       tempfile.mkdtemp()
							# fmt: off
							lowerCamelCase_			:							List[str]      =       ["<cls>", "<pad>", "<eos>", "<unk>", "L", "A", "G", "V", "S", "E", "R", "T", "I", "D", "P", "K", "Q", "N", "F", "Y", "M", "H", "W", "C", "X", "B", "U", "Z", "O", ".", "-", "<null_1>", "<mask>"]  # noqa: E501
							# fmt: on
							lowerCamelCase_			:							Optional[Any]      =       os.path.join(self.tmpdirname				,							VOCAB_FILES_NAMES["vocab_file"]     )
							with open(self.vocab_file				,							"w"				,							encoding="utf-8"     ) as vocab_writer:
								vocab_writer.write("".join([x + "\n" for x in vocab_tokens]     )     )




						def 					_UpperCamelCase			(   self				,							**a_     ):
							return [self.get_tokenizer(**a_     )]




						def 					_UpperCamelCase			(   self				,							**a_     ):
							return self.tokenizer_class.from_pretrained(self.tmpdirname				,							**a_     )




						def 					_UpperCamelCase			(   self     ):
							lowerCamelCase_			:							List[Any]      =       self.tokenizer_class(self.vocab_file     )

							lowerCamelCase_			:							Tuple      =       tokenizer.tokenize("LAGVS"     )
							self.assertListEqual(a_				,							["L", "A", "G", "V", "S"]     )
							self.assertListEqual(tokenizer.convert_tokens_to_ids(a_     )				,							[4, 5, 6, 7, 8]     )




						def 					_UpperCamelCase			(   self     ):
							lowerCamelCase_			:							Optional[Any]      =       self.tokenizer_class(self.vocab_file     )

							lowerCamelCase_			:							List[Any]      =       "LAGVS"
							self.assertListEqual(tokenizer.encode(a_     )				,							[0, 4, 5, 6, 7, 8, 2]     )




						def 					_UpperCamelCase			(   self     ):
							lowerCamelCase_			:							List[Any]      =       self.tokenizer_class(self.vocab_file     )

							lowerCamelCase_			:							Dict      =       ["LAGVS", "WCB"]
							lowerCamelCase_			:							List[Any]      =       tokenizer(a_				,							padding=a_     )["input_ids"]

							self.assertListEqual(a_				,							[[0, 4, 5, 6, 7, 8, 2], [0, 22, 23, 25, 2]]     )




						def 					_UpperCamelCase			(   self     ):
							lowerCamelCase_			:							Any      =       self.tokenizer_class(self.vocab_file     )

							lowerCamelCase_			:							Optional[int]      =       ["LAGVS", "WCB"]
							lowerCamelCase_			:							Any      =       tokenizer(a_				,							padding=a_     )["input_ids"]

							self.assertListEqual(a_				,							[[0, 4, 5, 6, 7, 8, 2], [0, 22, 23, 25, 2, 1, 1]]     )




						def 					_UpperCamelCase			(   self     ):
							lowerCamelCase_			:							Dict      =       self.get_tokenizers(fast=a_     )
							for tokenizer in tokenizers:
								with self.subTest(F"""{tokenizer.__class__.__name__}"""     ):
									lowerCamelCase_			:							List[Any]      =       "<unk>"
									lowerCamelCase_			:							List[str]      =       "<mask>"

									lowerCamelCase_			:							int      =       tokenizer.tokenize(a_     )
									lowerCamelCase_			:							Optional[int]      =       tokenizer.tokenize(a_     )

									self.assertEqual(len(a_     )				,							1     )
									self.assertEqual(len(a_     )				,							1     )
									self.assertEqual(token_a[0]				,							a_     )
									self.assertEqual(token_a[0]				,							a_     )





def     __magic_name__  (      lowerCAmelCase_      ,					lowerCAmelCase_):
	'''simple docstring'''


	lowerCamelCase_			:							Union[str, Any]      =       0
	for ele in arr:
		total_sum += product_sum(lowerCAmelCase_      ,					depth + 1) if isinstance(lowerCAmelCase_      ,					lowerCAmelCase_) else ele
	return total_sum * depth







def     __magic_name__  (      lowerCAmelCase_):
	'''simple docstring'''


	return product_sum(lowerCAmelCase_      ,					1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()

