





"""simple docstring"""


from ...configuration_utils import PretrainedConfig
from ...utils import logging


__magic_name__       :					Union[str, Any]						=			logging.get_logger(__name__)

__magic_name__       :					List[Any]						=			{
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}






class 							lowercase__			(   __SCREAMING_SNAKE_CASE	):

			"""simple docstring"""
			__lowerCAmelCase     :				Any										=  """megatron-bert"""







			def __init__(      self						,   _A=2_9_0_5_6						,   _A=1_0_2_4						,   _A=2_4						,   _A=1_6						,   _A=4_0_9_6						,   _A="gelu"						,   _A=0.1						,   _A=0.1						,   _A=5_1_2						,   _A=2						,   _A=0.02						,   _A=1e-1_2						,   _A=0						,   _A="absolute"						,   _A=True						,   **_A						,   ):






									'''simple docstring'''







									super().__init__(pad_token_id=_A						,   **_A    )

									UpperCamelCase				:		int				   =			vocab_size
									UpperCamelCase				:		int				   =			hidden_size
									UpperCamelCase				:		Tuple				   =			num_hidden_layers
									UpperCamelCase				:		Tuple				   =			num_attention_heads
									UpperCamelCase				:		Any				   =			hidden_act
									UpperCamelCase				:		Dict				   =			intermediate_size
									UpperCamelCase				:		Union[str, Any]				   =			hidden_dropout_prob
									UpperCamelCase				:		List[Any]				   =			attention_probs_dropout_prob
									UpperCamelCase				:		Union[str, Any]				   =			max_position_embeddings
									UpperCamelCase				:		int				   =			type_vocab_size
									UpperCamelCase				:		List[Any]				   =			initializer_range
									UpperCamelCase				:		Union[str, Any]				   =			layer_norm_eps
									UpperCamelCase				:		Optional[int]				   =			position_embedding_type
									UpperCamelCase				:		int				   =			use_cache









'''simple docstring'''


from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass

@dataclass
class      A       :
							lowercase_							     =							42
							lowercase_							     =							42



class      A       :







							def __init__(    self			:    Optional[Any]				,     lowerCAmelCase_			:    int   )     ->				str:


														"""simple docstring"""


														_a      	=							[[] for _ in range(lowerCAmelCase_   )]
														_a      	=							size







							def __getitem__(    self			:    Any				,     lowerCAmelCase_			:    int   )     ->				Iterator[Edge]:


														"""simple docstring"""


														return iter(self._graph[vertex]   )







							@property
							def   __lowerCAmelCase     (    self			:    str   )     ->				Tuple:


														"""simple docstring"""


														return self._size







							def   __lowerCAmelCase     (    self			:    Union[str, Any]				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int   )     ->				Dict:


														"""simple docstring"""


														if weight not in (0, 1):
																					raise ValueError('''Edge weight must be either 0 or 1.'''   )

														if to_vertex < 0 or to_vertex >= self.size:
																					raise ValueError('''Vertex indexes must be in [0; size).'''   )

														self._graph[from_vertex].append(Edge(lowerCAmelCase_				,     lowerCAmelCase_   )   )







							def   __lowerCAmelCase     (    self			:    Tuple				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int   )     ->				int | None:


														"""simple docstring"""


														_a      	=							deque([start_vertex]   )
														_a      	=							[None] * self.size
														_a      	=							0

														while queue:
																					_a      	=							queue.popleft()
																					_a      	=							distances[current_vertex]
																					if current_distance is None:
																												continue

																					for edge in self[current_vertex]:
																												_a      	=							current_distance + edge.weight
																												_a      	=							distances[edge.destination_vertex]
																												if (
																												    isinstance(lowerCAmelCase_				,     lowerCAmelCase_   )
																												    and new_distance >= dest_vertex_distance
																												):
																																			continue
																												_a      	=							new_distance
																												if edge.weight == 0:
																																			queue.appendleft(edge.destination_vertex   )
																												else:
																																			queue.append(edge.destination_vertex   )

														if distances[finish_vertex] is None:
																					raise ValueError('''No path from start_vertex to finish_vertex.'''   )

														return distances[finish_vertex]


if __name__ == "__main__":
				import doctest

				doctest.testmod()

