


"""simple docstring"""







def   UpperCAmelCase__			(lowerCAmelCase_    ,		lowerCAmelCase_  ):




					'''simple docstring'''


					print("\nThe shortest path matrix using Floyd Warshall algorithm\n"  )
					for i in range(_a  ):
										for j in range(_a  ):
															if dist[i][j] != float("inf"  ):
																				print(int(dist[i][j]  )    ,		end="\t"  )
															else:
																				print("INF"    ,		end="\t"  )
										print()




def   UpperCAmelCase__			(lowerCAmelCase_    ,		lowerCAmelCase_  ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		  =							[[float("inf"  ) for _ in range(_a  )] for _ in range(_a  )]

					for i in range(_a  ):
										for j in range(_a  ):
															__SCREAMING_SNAKE_CASE		  =							graph[i][j]

															# check vertex k against all other vertices (i, j)
					for k in range(_a  ):
										# looping through rows of graph array
										for i in range(_a  ):
															# looping through columns of graph array
															for j in range(_a  ):
																				if (
																				    dist[i][k] != float("inf"  )
																				    and dist[k][j] != float("inf"  )
																				    and dist[i][k] + dist[k][j] < dist[i][j]
																				):
																									__SCREAMING_SNAKE_CASE		  =							dist[i][k] + dist[k][j]

					_print_dist(_a    ,		_a  )
					return dist, v


if __name__ == "__main__":
		a__							:				List[str]          =	int(input('''Enter number of vertices: '''))
		a__							:				Any          =	int(input('''Enter number of edges: '''))

		a__							:				Tuple          =	[[float('''inf''') for i in range(v)] for j in range(v)]

		for i in range(v):
				a__							:				List[Any]          =	0.0

				# src and dst are indices that must be within the array size graph[e][v]
				# failure to follow this will result in an error
		for i in range(e):
				print('''\nEdge ''', i + 1)
				a__							:				int          =	int(input('''Enter source:'''))
				a__							:				Any          =	int(input('''Enter destination:'''))
				a__							:				List[str]          =	float(input('''Enter weight:'''))
				a__							:				Any          =	weight

		floyd_warshall(graph, v)

		# Example Input
		# Enter number of vertices: 3
		# Enter number of edges: 2

		# # generated graph from vertex and edge inputs
		# [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
		# [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

		# specify source, destination and weight for edge #1
		# Edge  1
		# Enter source:1
		# Enter destination:2
		# Enter weight:2

		# specify source, destination and weight for edge #2
		# Edge  2
		# Enter source:2
		# Enter destination:1
		# Enter weight:1

		# # Expected Output from the vertice, edge and src, dst, weight inputs!!
		# 0		INF	INF
		# INF	0	2
		# INF	1	0



"""simple docstring"""


import os
import unittest

from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer
from transformers.testing_utils import get_tests_dir

from ...test_tokenization_common import TokenizerTesterMixin


UpperCAmelCase													=get_tests_dir("fixtures/test_sentencepiece_bpe.model")





class lowerCamelCase__   (				SCREAMING_SNAKE_CASE     ,   unittest.TestCase    ):



    '''simple docstring'''




    _lowerCamelCase					=   BartphoTokenizer
    _lowerCamelCase					=   False
    _lowerCamelCase					=   True




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

          A				  =		["""▁This""", """▁is""", """▁a""", """▁t""", """est"""]
          A				  =		dict(zip(lowerCamelCase_ ,range(len(lowerCamelCase_    )    )    )    )
          A				  =		{"""unk_token""": """<unk>"""}

          A				  =		os.path.join(self.tmpdirname ,VOCAB_FILES_NAMES["""monolingual_vocab_file"""]    )
          with open(self.monolingual_vocab_file ,"""w""" ,encoding="""utf-8"""    ) as fp:
                for token in vocab_tokens:
                      fp.write(f'{token} {vocab_tokens[token]}\n'    )

          A				  =		BartphoTokenizer(lowerCamelCase_ ,self.monolingual_vocab_file ,**self.special_tokens_map    )
          tokenizer.save_pretrained(self.tmpdirname    )




    def UpperCamelCase__		( self ,**lowerCamelCase_    )    ->      Tuple:
          kwargs.update(self.special_tokens_map    )
          return BartphoTokenizer.from_pretrained(self.tmpdirname ,**lowerCamelCase_    )




    def UpperCamelCase__		( self ,lowerCamelCase_    )    ->      Optional[Any]:
          A				  =		"""This is a là test"""
          A				  =		"""This is a<unk><unk> test"""
          return input_text, output_text




    def UpperCamelCase__		( self    )    ->      int:
          A				  =		BartphoTokenizer(lowerCamelCase_ ,self.monolingual_vocab_file ,**self.special_tokens_map    )
          A				  =		"""This is a là test"""
          A				  =		"""▁This ▁is ▁a ▁l à ▁t est""".split()
          A				  =		tokenizer.tokenize(lowerCamelCase_    )
          self.assertListEqual(lowerCamelCase_ ,lowerCamelCase_    )

          A				  =		tokens + [tokenizer.unk_token]
          A				  =		[4, 5, 6, 3, 3, 7, 8, 3]
          self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCamelCase_    ) ,lowerCamelCase_    )




