




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       SCREAMING_SNAKE_CASE_							(					unittest.TestCase      ):



 """simple docstring"""


 __magic_name__      :					str			  =		EsmTokenizer






 def 				lowerCamelCase__    (				self		:	Union[str, Any]  )  ->					int:







      """simple docstring"""







      super().setUp()
      __UpperCamelCase				:  Any								=			tempfile.mkdtemp()
      # fmt: off
      __UpperCamelCase				:  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
      __UpperCamelCase				:  str								=			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 				lowerCamelCase__    (				self		:	Tuple				,    **lowerCAmelCase		:	Union[str, Any]  )  ->					List[PreTrainedTokenizerBase]:







      """simple docstring"""







      return [self.get_tokenizer(**lowerCAmelCase  )]






 def 				lowerCamelCase__    (				self		:	Tuple				,    **lowerCAmelCase		:	str  )  ->					PreTrainedTokenizer:







      """simple docstring"""







      return self.tokenizer_class.from_pretrained(self.tmpdirname				,    **lowerCAmelCase  )






 def 				lowerCamelCase__    (				self		:	str  )  ->					Union[str, Any]:







      """simple docstring"""







      __UpperCamelCase				:  Tuple								=			self.tokenizer_class(self.vocab_file  )

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






 def 				lowerCamelCase__    (				self		:	Optional[int]  )  ->					Union[str, Any]:







      """simple docstring"""







      __UpperCamelCase				:  str								=			self.tokenizer_class(self.vocab_file  )

      __UpperCamelCase				:  Dict								=			"""LAGVS"""
      self.assertListEqual(tokenizer.encode(lowerCAmelCase  )				,    [0, 4, 5, 6, 7, 8, 2]  )






 def 				lowerCamelCase__    (				self		:	Tuple  )  ->					str:







      """simple docstring"""







      __UpperCamelCase				:  str								=			self.tokenizer_class(self.vocab_file  )

      __UpperCamelCase				:  str								=			["""LAGVS""", """WCB"""]
      __UpperCamelCase				:  Dict								=			tokenizer(lowerCAmelCase				,    padding=lowerCAmelCase  )["""input_ids"""]

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






 def 				lowerCamelCase__    (				self		:	Optional[int]  )  ->					str:







      """simple docstring"""







      __UpperCamelCase				:  str								=			self.tokenizer_class(self.vocab_file  )

      __UpperCamelCase				:  Optional[int]								=			["""LAGVS""", """WCB"""]
      __UpperCamelCase				:  int								=			tokenizer(lowerCAmelCase				,    padding=lowerCAmelCase  )["""input_ids"""]

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






 def 				lowerCamelCase__    (				self		:	Any  )  ->					Optional[int]:







      """simple docstring"""







      __UpperCamelCase				:  Dict								=			self.get_tokenizers(fast=lowerCAmelCase  )
      for tokenizer in tokenizers:
           with self.subTest(F'''{tokenizer.__class__.__name__}'''  ):
                __UpperCamelCase				:  Optional[int]								=			"""<unk>"""
                __UpperCamelCase				:  int								=			"""<mask>"""

                __UpperCamelCase				:  List[Any]								=			tokenizer.tokenize(lowerCAmelCase  )
                __UpperCamelCase				:  Union[str, Any]								=			tokenizer.tokenize(lowerCAmelCase  )

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












import os





def 							A__   ()    ->	int:
					__UpperCamelCase				:  int								=			os.path.dirname(os.path.realpath(snake_case							)							)
					__UpperCamelCase				:  List[str]								=			os.path.join(snake_case		,  """triangle.txt"""							)

					with open(snake_case							) as in_file:
										__UpperCamelCase				:  Optional[Any]								=			[[int(snake_case							) for i in line.split()] for line in in_file]

					while len(snake_case							) != 1:
										__UpperCamelCase				:  Union[str, Any]								=			triangle.pop()
										__UpperCamelCase				:  List[str]								=			triangle[-1]
										for j in range(len(snake_case							) - 1							):
															curr_row[j] += max(last_row[j]		,  last_row[j + 1]							)
					return triangle[0][0]


if __name__ == "__main__":
	print(solution())






