
"""simple docstring"""
import json
import os
import unittest

from transformers.models.blenderbot_small.tokenization_blenderbot_small import (
    VOCAB_FILES_NAMES,
    BlenderbotSmallTokenizer,
)

from ...test_tokenization_common import TokenizerTesterMixin
class       lowerCAmelCase_		(				A__				,				unittest.TestCase ):



							'''simple docstring'''





							_snake_case						      =		BlenderbotSmallTokenizer
							_snake_case						      =		False




							def    A__						( self				)       ->  Tuple:
													super().setUp()

													__lowerCAmelCase     =  ["""__start__""", """adapt""", """act""", """ap@@""", """te""", """__end__""", """__unk__"""]
													__lowerCAmelCase     =  dict(zip(snake_case_    ,				range(len(snake_case_				)				)				)				)

													__lowerCAmelCase     =  ["""#version: 0.2""", """a p""", """t e</w>""", """ap t</w>""", """a d""", """ad apt</w>""", """a c""", """ac t</w>""", """"""]
													__lowerCAmelCase     =  {"""unk_token""": """__unk__""", """bos_token""": """__start__""", """eos_token""": """__end__"""}

													__lowerCAmelCase     =  os.path.join(self.tmpdirname    ,				VOCAB_FILES_NAMES["""vocab_file"""]				)
													__lowerCAmelCase     =  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(snake_case_				) + """\n"""				)
													with open(self.merges_file    ,				"""w"""    ,				encoding="""utf-8"""				) as fp:
																			fp.write("""\n""".join(snake_case_				)				)




							def    A__						( self    ,				**snake_case_				)       ->  List[str]:
													kwargs.update(self.special_tokens_map				)
													return BlenderbotSmallTokenizer.from_pretrained(self.tmpdirname    ,				**snake_case_				)




							def    A__						( self    ,				snake_case_				)       ->  Union[str, Any]:
													__lowerCAmelCase     =  """adapt act apte"""
													__lowerCAmelCase     =  """adapt act apte"""
													return input_text, output_text




							def    A__						( self				)       ->  Union[str, Any]:
													__lowerCAmelCase     =  BlenderbotSmallTokenizer(self.vocab_file    ,				self.merges_file    ,				**self.special_tokens_map				)
													__lowerCAmelCase     =  """adapt act apte"""
													__lowerCAmelCase     =  ["""adapt""", """act""", """ap@@""", """te"""]
													__lowerCAmelCase     =  tokenizer.tokenize(snake_case_				)
													self.assertListEqual(snake_case_    ,				snake_case_				)

													__lowerCAmelCase     =  [tokenizer.bos_token] + tokens + [tokenizer.eos_token]

													__lowerCAmelCase     =  [0, 1, 2, 3, 4, 5]
													self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case_				)    ,				snake_case_				)




							def    A__						( self				)       ->  Any:
													__lowerCAmelCase     =  BlenderbotSmallTokenizer.from_pretrained("""facebook/blenderbot-90M"""				)
													assert tok("""sam"""				).input_ids == [1_384]
													__lowerCAmelCase     =  """I am a small frog."""
													__lowerCAmelCase     =  tok([src_text]    ,				padding=snake_case_    ,				truncation=snake_case_				)["""input_ids"""]
													__lowerCAmelCase     =  tok.batch_decode(snake_case_    ,				skip_special_tokens=snake_case_    ,				clean_up_tokenization_spaces=snake_case_				)[0]
													assert src_text != decoded  # I wish it did!
													assert decoded == "i am a small frog ."




							def    A__						( self				)       ->  List[str]:
													__lowerCAmelCase     =  BlenderbotSmallTokenizer.from_pretrained("""facebook/blenderbot-90M"""				)
													__lowerCAmelCase     =  """I am a small frog ."""
													__lowerCAmelCase     =  """."""
													__lowerCAmelCase     =  tok(snake_case_				)["""input_ids"""]
													__lowerCAmelCase     =  tok(snake_case_				)["""input_ids"""]

													assert encoded[-1] == encoded_dot[0]


"""simple docstring"""
import os

def  lowercase     ():
						with open(os.path.dirname(_lowerCAmelCase						) + """/grid.txt"""						) as f:
												__lowerCAmelCase     =  []  # noqa: E741
												for _ in range(20						):
																		l.append([int(_lowerCAmelCase						) for x in f.readline().split()]						)

												__lowerCAmelCase     =  0

												# right
												for i in range(20						):
																		for j in range(17						):
																								__lowerCAmelCase     =  l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # down
												for i in range(17						):
																		for j in range(20						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # diagonal 1
												for i in range(17						):
																		for j in range(17						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # diagonal 2
												for i in range(17						):
																		for j in range(3 ,    20						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp
												return maximum


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