





'''simple docstring'''







from __future__ import annotations


class        __a   :

							def __init__(				self				:  int							,  __magic_name__				:  int )       ->							None:







													"""simple docstring"""
													UpperCAmelCase_      :   List[Any]      =	vertices
													UpperCAmelCase_      :   int      =	[[0] * vertices for _ in range(__magic_name__ )]

							def      UpperCAmelCase__						(				self				:  List[Any]							,  __magic_name__				:  list[int] )       ->							None:







													"""simple docstring"""
													print('''Vertex \t Distance from Source''' )
													for vertex in range(self.vertices ):
																			print(__magic_name__							,  '''\t\t'''							,  distances_from_source[vertex] )

							def      UpperCAmelCase__						(				self				:  Tuple							,  __magic_name__				:  list[int]							,  __magic_name__				:  list[bool] )       ->							int:







													"""simple docstring"""
													UpperCAmelCase_      :   Optional[Any]      =	1E7
													UpperCAmelCase_      :   Optional[Any]      =	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:
																									UpperCAmelCase_      :   Union[str, Any]      =	distances_from_source[vertex]
																									UpperCAmelCase_      :   Optional[int]      =	vertex
													return min_index



							def      UpperCAmelCase__						(				self				:  int							,  __magic_name__				:  int )       ->							None:







													"""simple docstring"""
													UpperCAmelCase_      :   Optional[int]      =	[int(1E7 )] * self.vertices  # distances from the source
													UpperCAmelCase_      :   Optional[int]      =	0
													UpperCAmelCase_      :   List[str]      =	[False] * self.vertices

													for _ in range(self.vertices ):
																			UpperCAmelCase_      :   List[Any]      =	self.minimum_distance(__magic_name__							,  __magic_name__ )
																			UpperCAmelCase_      :   List[str]      =	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]
																									):
																															UpperCAmelCase_      :   Dict      =	distances[u] + self.graph[u][v]

													self.print_solution(__magic_name__ )


if __name__ == "__main__":
					snake_case_  :							int            =	Graph(9)
					snake_case_  :							Tuple            =	[
					    [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)












'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


snake_case_  :							Any            =	{
    "configuration_flava": [
        "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "FlavaConfig",
        "FlavaImageCodebookConfig",
        "FlavaImageConfig",
        "FlavaMultimodalConfig",
        "FlavaTextConfig",
    ],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_  :							List[str]            =	["FlavaFeatureExtractor"]
					snake_case_  :							int            =	["FlavaImageProcessor"]
					snake_case_  :							Tuple            =	["FlavaProcessor"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_  :							Optional[int]            =	[
					    "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "FlavaForPreTraining",
					    "FlavaImageCodebook",
					    "FlavaImageModel",
					    "FlavaModel",
					    "FlavaMultimodalModel",
					    "FlavaPreTrainedModel",
					    "FlavaTextModel",
					]

if TYPE_CHECKING:
					from .configuration_flava import (
					    FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    FlavaConfig,
					    FlavaImageCodebookConfig,
					    FlavaImageConfig,
					    FlavaMultimodalConfig,
					    FlavaTextConfig,
					)

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_flava import FlavaFeatureExtractor
										from .image_processing_flava import FlavaImageProcessor
										from .processing_flava import FlavaProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flava import (
										    FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST,
										    FlavaForPreTraining,
										    FlavaImageCodebook,
										    FlavaImageModel,
										    FlavaModel,
										    FlavaMultimodalModel,
										    FlavaPreTrainedModel,
										    FlavaTextModel,
										)

else:
					import sys

					snake_case_  :							Any            =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





