





import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput






@dataclass
class  _UpperCAmelCase       (     _UpperCAmelCase			):
					UpperCamelCase								=							4_2
					UpperCamelCase								=							None
					UpperCamelCase								=							None







class  _UpperCAmelCase       (     unittest.TestCase			):


					def      lowerCamelCase	( self      :Tuple		):
												A		=  ModelOutputTest(a=30		)
												self.assertEqual(x.a					,	30		)
												self.assertIsNone(x.b		)
												self.assertIsNone(x.c		)
												with self.assertRaises(lowercase__		):
																			A		=  x.d


					def      lowerCamelCase	( self      :Optional[int]		):
												A		=  ModelOutputTest(a=30					,	b=10		)
												self.assertEqual(x[0]					,	30		)
												self.assertEqual(x[1]					,	10		)
												self.assertEqual(x[:2]					,	(30, 10)		)
												self.assertEqual(x[:]					,	(30, 10)		)

												A		=  ModelOutputTest(a=30					,	c=10		)
												self.assertEqual(x[0]					,	30		)
												self.assertEqual(x[1]					,	10		)
												self.assertEqual(x[:2]					,	(30, 10)		)
												self.assertEqual(x[:]					,	(30, 10)		)


					def      lowerCamelCase	( self      :List[str]		):
												A		=  ModelOutputTest(a=30					,	b=10		)
												self.assertEqual(x["a"]					,	30		)
												self.assertEqual(x["b"]					,	10		)
												with self.assertRaises(lowercase__		):
																			A		=  x["c"]

												A		=  ModelOutputTest(a=30					,	c=10		)
												self.assertEqual(x["a"]					,	30		)
												self.assertEqual(x["c"]					,	10		)
												with self.assertRaises(lowercase__		):
																			A		=  x["b"]


					def      lowerCamelCase	( self      :Dict		):
												A		=  ModelOutputTest(a=30		)
												self.assertEqual(list(x.keys()		)					,	["a"]		)
												self.assertEqual(list(x.values()		)					,	[30]		)
												self.assertEqual(list(x.items()		)					,	[("a", 30)]		)
												self.assertEqual(list(lowercase__		)					,	["a"]		)

												A		=  ModelOutputTest(a=30					,	b=10		)
												self.assertEqual(list(x.keys()		)					,	["a", "b"]		)
												self.assertEqual(list(x.values()		)					,	[30, 10]		)
												self.assertEqual(list(x.items()		)					,	[("a", 30), ("b", 10)]		)
												self.assertEqual(list(lowercase__		)					,	["a", "b"]		)

												A		=  ModelOutputTest(a=30					,	c=10		)
												self.assertEqual(list(x.keys()		)					,	["a", "c"]		)
												self.assertEqual(list(x.values()		)					,	[30, 10]		)
												self.assertEqual(list(x.items()		)					,	[("a", 30), ("c", 10)]		)
												self.assertEqual(list(lowercase__		)					,	["a", "c"]		)

												with self.assertRaises(lowercase__		):
																			A		=  x.update({"d": 20}		)
												with self.assertRaises(lowercase__		):
																			del x["a"]
												with self.assertRaises(lowercase__		):
																			A		=  x.pop("a"		)
												with self.assertRaises(lowercase__		):
																			A		=  x.setdefault("d"					,	32		)


					def      lowerCamelCase	( self      :Any		):
												A		=  ModelOutputTest(a=30		)
												A		=  10
												self.assertEqual(x.a					,	10		)
												self.assertEqual(x["a"]					,	10		)


					def      lowerCamelCase	( self      :Union[str, Any]		):
												A		=  ModelOutputTest(a=30		)
												A		=  10
												self.assertEqual(x.a					,	10		)
												self.assertEqual(x["a"]					,	10		)


					def      lowerCamelCase	( self      :Optional[int]		):
												A		=  ModelOutputTest({"a": 30, "b": 10}		)
												self.assertEqual(list(x.keys()		)					,	["a", "b"]		)
												self.assertEqual(x.a					,	30		)
												self.assertEqual(x.b					,	10		)


					def      lowerCamelCase	( self      :Any		):
												A		=  ModelOutputTest([("a", 30), ("b", 10)]		)
												self.assertEqual(list(x.keys()		)					,	["a", "b"]		)
												self.assertEqual(x.a					,	30		)
												self.assertEqual(x.b					,	10		)

												with self.assertRaises(lowercase__		):
																			A		=  ModelOutputTest([("a", 30), (10, 10)]		)

												A		=  ModelOutputTest(a=(30, 30)		)
												self.assertEqual(list(x.keys()		)					,	["a"]		)
												self.assertEqual(x.a					,	(30, 30)		)









"""simple docstring"""
from __future__ import annotations






class  _UpperCAmelCase       :


					def __init__( self      :Optional[Any]					,	__UpperCamelCase      :int		):
												A		=  vertices
												A		=  [[0] * vertices for _ in range(__UpperCamelCase		)]


					def      lowerCamelCase	( self      :Optional[Any]					,	__UpperCamelCase      :list[int]		):
												print("Vertex \t Distance from Source"		)
												for vertex in range(self.vertices		):
																			print(__UpperCamelCase					,	"\t\t"					,	distances_from_source[vertex]		)


					def      lowerCamelCase	( self      :Union[str, Any]					,	__UpperCamelCase      :list[int]					,	__UpperCamelCase      :list[bool]		):
												A		=  1e7
												A		=  0

												# Search not nearest vertex not in the shortest path tree
												for vertex in range(self.vertices		):
																			if distances_from_source[vertex] < minimum and visited[vertex] is False:
																										A		=  distances_from_source[vertex]
																										A		=  vertex
												return min_index


					def      lowerCamelCase	( self      :List[Any]					,	__UpperCamelCase      :int		):
												A		=  [int(1e7		)] * self.vertices  # distances from the source
												A		=  0
												A		=  [False] * self.vertices

												for _ in range(self.vertices		):
																			A		=  self.minimum_distance(__UpperCamelCase					,	__UpperCamelCase		)
																			A		=  True

																			# Update dist value of the adjacent vertices
																			# of the picked vertex only if the current
																			# distance is greater than new distance and
																			# the vertex in not in the shortest path tree
																			for v in range(self.vertices		):
																										if (
																										    self.graph[u][v] > 0
																										    and visited[v] is False
																										    and distances[v] > distances[u] + self.graph[u][v]
																										):
																																	A		=  distances[u] + self.graph[u][v]

												self.print_solution(__UpperCamelCase		)


if __name__ == "__main__":
		_snake_case					:		List[Any]							=			Graph(9)
		_snake_case					:		List[str]							=			[
		    [0, 4, 0, 0, 0, 0, 0, 8, 0],
		    [4, 0, 8, 0, 0, 0, 0, 11, 0],
		    [0, 8, 0, 7, 0, 4, 0, 0, 2],
		    [0, 0, 7, 0, 9, 14, 0, 0, 0],
		    [0, 0, 0, 9, 0, 10, 0, 0, 0],
		    [0, 0, 4, 14, 10, 0, 2, 0, 0],
		    [0, 0, 0, 0, 0, 2, 0, 1, 6],
		    [8, 11, 0, 0, 0, 0, 1, 0, 7],
		    [0, 0, 2, 0, 0, 0, 6, 7, 0],
		]
		graph.dijkstra(0)


