





from __future__ import annotations

class    __A  :


				def __init__(		self ,			UpperCAmelCase_				):
								lowerCamelCase									=vertices
								lowerCamelCase									=[[0] * vertices for _ in range(UpperCAmelCase_				)]


				def _snake_case							(		self ,			UpperCAmelCase_				):
								print("""Vertex \t Distance from Source"""				)
								for vertex in range(self.vertices				):
												print(UpperCAmelCase_ ,			"""\t\t""" ,			distances_from_source[vertex]				)


				def _snake_case							(		self ,			UpperCAmelCase_ ,			UpperCAmelCase_				):
								lowerCamelCase									=1E7
								lowerCamelCase									=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:
																lowerCamelCase									=distances_from_source[vertex]
																lowerCamelCase									=vertex
								return min_index


				def _snake_case							(		self ,			UpperCAmelCase_				):
								lowerCamelCase									=[int(1E7				)] * self.vertices  # distances from the source
								lowerCamelCase									=0
								lowerCamelCase									=[False] * self.vertices

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

								self.print_solution(UpperCAmelCase_				)


if __name__ == "__main__":
							UpperCAmelCase__    :      str       					=Graph(9)
							UpperCAmelCase__    :      Dict       					=[
							    [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)












from typing import TYPE_CHECKING

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


UpperCAmelCase__    :      int       					={
    '''configuration_flaubert''': ['''FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''FlaubertConfig''', '''FlaubertOnnxConfig'''],
    '''tokenization_flaubert''': ['''FlaubertTokenizer'''],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__    :      int       					=[
							    '''FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''FlaubertForMultipleChoice''',
							    '''FlaubertForQuestionAnswering''',
							    '''FlaubertForQuestionAnsweringSimple''',
							    '''FlaubertForSequenceClassification''',
							    '''FlaubertForTokenClassification''',
							    '''FlaubertModel''',
							    '''FlaubertWithLMHeadModel''',
							    '''FlaubertPreTrainedModel''',
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__    :      List[str]       					=[
							    '''TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''TFFlaubertForMultipleChoice''',
							    '''TFFlaubertForQuestionAnsweringSimple''',
							    '''TFFlaubertForSequenceClassification''',
							    '''TFFlaubertForTokenClassification''',
							    '''TFFlaubertModel''',
							    '''TFFlaubertPreTrainedModel''',
							    '''TFFlaubertWithLMHeadModel''',
							]


if TYPE_CHECKING:
							from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig
							from .tokenization_flaubert import FlaubertTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_flaubert import (
														    FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    FlaubertForMultipleChoice,
														    FlaubertForQuestionAnswering,
														    FlaubertForQuestionAnsweringSimple,
														    FlaubertForSequenceClassification,
														    FlaubertForTokenClassification,
														    FlaubertModel,
														    FlaubertPreTrainedModel,
														    FlaubertWithLMHeadModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_flaubert import (
														    TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFFlaubertForMultipleChoice,
														    TFFlaubertForQuestionAnsweringSimple,
														    TFFlaubertForSequenceClassification,
														    TFFlaubertForTokenClassification,
														    TFFlaubertModel,
														    TFFlaubertPreTrainedModel,
														    TFFlaubertWithLMHeadModel,
														)

else:
							import sys

							UpperCAmelCase__    :      List[Any]       					=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





