




"""simple docstring"""





import heapq as hq
import math
from collections.abc import Iterator



class   a__					:


			def __init__(   self   :     Optional[Any]   ,	UpperCamelCase_   :     List[str]):


						"""simple docstring"""




						__UpperCAmelCase						:			Tuple												=       str(id_)
						__UpperCAmelCase						:			Optional[Any]												=       None
						__UpperCAmelCase						:			Tuple												=       None
						__UpperCAmelCase						:			Optional[Any]												=       []
						__UpperCAmelCase						:			str												=       {}  # {vertex:distance}


			def __lt__(   self   :     Optional[int]   ,	UpperCamelCase_   :     int):


						"""simple docstring"""




						return self.key < other.key


			def __repr__(   self   :     Tuple):


						"""simple docstring"""




						return self.id


			def    a_  (   self   :     int   ,	UpperCamelCase_   :     str):


						"""simple docstring"""




						self.neighbors.append(UpperCamelCase_)


			def    a_  (   self   :     Optional[Any]   ,	UpperCamelCase_   :     List[str]   ,	UpperCamelCase_   :     Optional[int]):


						"""simple docstring"""




						__UpperCAmelCase						:			int												=       weight






def        _UpperCamelCase     (      UpperCamelCase					,							UpperCamelCase					,							UpperCamelCase					,							UpperCamelCase				)      ->      Union[str, Any]:


			"""simple docstring"""
			# add the neighbors:
			graph[a - 1].add_neighbor(graph[b - 1]				)
			graph[b - 1].add_neighbor(graph[a - 1]				)
			# add the edges:
			graph[a - 1].add_edge(graph[b - 1]					,							UpperCamelCase				)
			graph[b - 1].add_edge(graph[a - 1]					,							UpperCamelCase				)

def        _UpperCamelCase     (      UpperCamelCase					,							UpperCamelCase				)      ->      list:


			"""simple docstring"""
			__UpperCAmelCase						:			Optional[int]												=       []
			for u in graph:
						__UpperCAmelCase						:			Optional[int]												=       math.inf
						__UpperCAmelCase						:			List[Any]												=       None
			__UpperCAmelCase						:			int												=       0
			__UpperCAmelCase						:			Dict												=       graph[:]
			while q:
						__UpperCAmelCase						:			Optional[int]												=       min(UpperCamelCase				)
						q.remove(UpperCamelCase				)
						for v in u.neighbors:
									if (v in q) and (u.edges[v.id] < v.key):
												__UpperCAmelCase						:			Any												=       u
												__UpperCAmelCase						:			List[Any]												=       u.edges[v.id]
			for i in range(1					,							len(UpperCamelCase				)				):
						a.append((int(graph[i].id				) + 1, int(graph[i].pi.id				) + 1)				)
			return a

def        _UpperCamelCase     (      UpperCamelCase					,							UpperCamelCase				)      ->      Iterator[tuple]:


			"""simple docstring"""
			for u in graph:
						__UpperCAmelCase						:			Dict												=       math.inf
						__UpperCAmelCase						:			Optional[Any]												=       None
			__UpperCAmelCase						:			Optional[int]												=       0

			__UpperCAmelCase						:			Any												=       list(UpperCamelCase				)
			hq.heapify(UpperCamelCase				)

			while h:
						__UpperCAmelCase						:			Any												=       hq.heappop(UpperCamelCase				)
						for v in u.neighbors:
									if (v in h) and (u.edges[v.id] < v.key):
												__UpperCAmelCase						:			Any												=       u
												__UpperCAmelCase						:			List[Any]												=       u.edges[v.id]
												hq.heapify(UpperCamelCase				)

			for i in range(1					,							len(UpperCamelCase				)				):
						yield (int(graph[i].id				) + 1, int(graph[i].pi.id				) + 1)

def        _UpperCamelCase     (      )      ->      None:


			"""simple docstring"""


if __name__ == "__main__":
					import doctest

					doctest.testmod()






import os
import sys

A			:						Tuple        =  os.path.join(os.path.dirname(__file__), 'src')
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


A			:						Dict        =  [
    'torch',
    'numpy',
    'tokenizers',
    'filelock',
    'requests',
    'tqdm',
    'regex',
    'sentencepiece',
    'sacremoses',
    'importlib_metadata',
    'huggingface_hub',
]






@add_start_docstrings(AutoConfig.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				str       ,       **__magic_name__	:				List[Any]	)  ->    str:
		"""simple docstring"""




		return AutoConfig.from_pretrained(*__magic_name__       ,       **__magic_name__	)






@add_start_docstrings(AutoTokenizer.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				Any       ,       **__magic_name__	:				Optional[Any]	)  ->    Optional[Any]:
		"""simple docstring"""




		return AutoTokenizer.from_pretrained(*__magic_name__       ,       **__magic_name__	)






@add_start_docstrings(AutoModel.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				str       ,       **__magic_name__	:				Optional[Any]	)  ->    Tuple:
		"""simple docstring"""




		return AutoModel.from_pretrained(*__magic_name__       ,       **__magic_name__	)






@add_start_docstrings(AutoModelForCausalLM.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				str       ,       **__magic_name__	:				Tuple	)  ->    List[str]:
		"""simple docstring"""




		return AutoModelForCausalLM.from_pretrained(*__magic_name__       ,       **__magic_name__	)






@add_start_docstrings(AutoModelForMaskedLM.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				Optional[Any]       ,       **__magic_name__	:				Any	)  ->    Optional[int]:
		"""simple docstring"""




		return AutoModelForMaskedLM.from_pretrained(*__magic_name__       ,       **__magic_name__	)






@add_start_docstrings(AutoModelForSequenceClassification.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				Any       ,       **__magic_name__	:				List[str]	)  ->    Union[str, Any]:
		"""simple docstring"""




		return AutoModelForSequenceClassification.from_pretrained(*__magic_name__       ,       **__magic_name__	)







@add_start_docstrings(AutoModelForQuestionAnswering.__doc__	)
def 					UpperCamelCase   (      *__magic_name__	:				Dict       ,       **__magic_name__	:				List[Any]	)  ->    int:
		"""simple docstring"""




		return AutoModelForQuestionAnswering.from_pretrained(*__magic_name__       ,       **__magic_name__	)

