"""simple docstring"""






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowerCAmelCase__  :  Optional[Any]											=     logging.get_logger(__name__)

lowerCAmelCase__  :  Union[str, Any]											=     {
    'nghuyong/ernie-1.0-base-zh': 'https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-2.0-base-en': 'https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json',
    'nghuyong/ernie-2.0-large-en': 'https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json',
    'nghuyong/ernie-3.0-base-zh': 'https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-medium-zh': 'https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-mini-zh': 'https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-micro-zh': 'https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-nano-zh': 'https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json',
    'nghuyong/ernie-gram-zh': 'https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json',
    'nghuyong/ernie-health-zh': 'https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json',
}
class     snake_case	(			__UpperCAmelCase    ):




					"""simple docstring"""

					snake_case__       =			"ernie"







					def __init__(    self       :     Optional[int]   ,lowerCamelCase__       :     Union[str, Any]=30_522   ,lowerCamelCase__       :     Optional[int]=768   ,lowerCamelCase__       :     Tuple=12   ,lowerCamelCase__       :     Union[str, Any]=12   ,lowerCamelCase__       :     Optional[Any]=3_072   ,lowerCamelCase__       :     Optional[Any]="gelu"   ,lowerCamelCase__       :     int=0.1   ,lowerCamelCase__       :     Optional[int]=0.1   ,lowerCamelCase__       :     Optional[int]=512   ,lowerCamelCase__       :     Optional[int]=2   ,lowerCamelCase__       :     Optional[int]=3   ,lowerCamelCase__       :     Dict=False   ,lowerCamelCase__       :     str=0.0_2   ,lowerCamelCase__       :     Dict=1e-12   ,lowerCamelCase__       :     List[Any]=0   ,lowerCamelCase__       :     List[str]="absolute"   ,lowerCamelCase__       :     List[Any]=True   ,lowerCamelCase__       :     int=None   ,**lowerCamelCase__       :     Dict   ,):
									super().__init__(pad_token_id=lowerCamelCase__   ,**lowerCamelCase__      )

									UpperCAmelCase__					=							vocab_size
									UpperCAmelCase__					=							hidden_size
									UpperCAmelCase__					=							num_hidden_layers
									UpperCAmelCase__					=							num_attention_heads
									UpperCAmelCase__					=							hidden_act
									UpperCAmelCase__					=							intermediate_size
									UpperCAmelCase__					=							hidden_dropout_prob
									UpperCAmelCase__					=							attention_probs_dropout_prob
									UpperCAmelCase__					=							max_position_embeddings
									UpperCAmelCase__					=							type_vocab_size
									UpperCAmelCase__					=							task_type_vocab_size
									UpperCAmelCase__					=							use_task_id
									UpperCAmelCase__					=							initializer_range
									UpperCAmelCase__					=							layer_norm_eps
									UpperCAmelCase__					=							position_embedding_type
									UpperCAmelCase__					=							use_cache
									UpperCAmelCase__					=							classifier_dropout






class     snake_case	(			__UpperCAmelCase    ):




					"""simple docstring"""

					@property
					def 		__lowerCAmelCase						(    self       :     Tuple      ):
									if self.task == "multiple-choice":
													UpperCAmelCase__					=							{0: 'batch', 1: 'choice', 2: 'sequence'}
									else:
													UpperCAmelCase__					=							{0: 'batch', 1: 'sequence'}
									return OrderedDict(
									    [
									        ('input_ids', dynamic_axis),
									        ('attention_mask', dynamic_axis),
									        ('token_type_ids', dynamic_axis),
									        ('task_type_ids', dynamic_axis),
									    ]      )




"""simple docstring"""






from __future__ import annotations
class     snake_case	:




					"""simple docstring"""

					def __init__(    self       :     Tuple   ,lowerCamelCase__       :     int      ):
									UpperCAmelCase__					=							vertices
									UpperCAmelCase__					=							[[0] * vertices for _ in range(lowerCamelCase__      )]







					def 		__lowerCAmelCase						(    self       :     Dict   ,lowerCamelCase__       :     list[int]      ):
									print('Vertex \t Distance from Source'      )
									for vertex in range(self.vertices      ):
													print(lowerCamelCase__   ,'\t\t'   ,distances_from_source[vertex]      )







					def 		__lowerCAmelCase						(    self       :     List[Any]   ,lowerCamelCase__       :     list[int]   ,lowerCamelCase__       :     list[bool]      ):
									UpperCAmelCase__					=							1e7
									UpperCAmelCase__					=							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__					=							distances_from_source[vertex]
																	UpperCAmelCase__					=							vertex
									return min_index







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

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

									self.print_solution(lowerCamelCase__      )


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



