"""simple docstring"""


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






class    a__    :


   def __init__(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        lowercase__				 =							str(id_  )
        lowercase__				 =							None
        lowercase__				 =							None
        lowercase__				 =							[]
        lowercase__				 =							{}  # {vertex:distance}


   def __lt__(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        return self.key < other.key


   def __repr__(     self  ):
        '''simple docstring'''



        return self.id


   def 	snake_case__	(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        self.neighbors.append(_UpperCAmelCase  )


   def 	snake_case__	(     self,				_UpperCAmelCase,				_UpperCAmelCase  ):
        '''simple docstring'''



        lowercase__				 =							weight







def 					__a   (		A    ,				A    ,				A    ,				A      ):






     '''simple docstring'''



     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]    ,				A      )
     graph[b - 1].add_edge(graph[a - 1]    ,				A      )







def 					__a   (		A    ,				A      ):






     '''simple docstring'''



     lowercase__				 =							[]
     for u in graph:
          lowercase__				 =							math.inf
          lowercase__				 =							None
     lowercase__				 =							0
     lowercase__				 =							graph[:]
     while q:
          lowercase__				 =							min(A      )
          q.remove(A      )
          for v in u.neighbors:
               if (v in q) and (u.edges[v.id] < v.key):
                    lowercase__				 =							u
                    lowercase__				 =							u.edges[v.id]
     for i in range(1    ,				len(A      )      ):
          a.append((int(graph[i].id      ) + 1, int(graph[i].pi.id      ) + 1)      )
     return a







def 					__a   (		A    ,				A      ):






     '''simple docstring'''



     for u in graph:
          lowercase__				 =							math.inf
          lowercase__				 =							None
     lowercase__				 =							0

     lowercase__				 =							list(A      )
     hq.heapify(A      )

     while h:
          lowercase__				 =							hq.heappop(A      )
          for v in u.neighbors:
               if (v in h) and (u.edges[v.id] < v.key):
                    lowercase__				 =							u
                    lowercase__				 =							u.edges[v.id]
                    hq.heapify(A      )

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







def 					__a   (		):






     '''simple docstring'''








if __name__ == "__main__":
      import doctest

      doctest.testmod()





"""simple docstring"""


import os
import sys

lowerCAmelCase_:					Any     =					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,
)


lowerCAmelCase_:					Union[str, Any]     =					[
    "torch",
    "numpy",
    "tokenizers",
    "filelock",
    "requests",
    "tqdm",
    "regex",
    "sentencepiece",
    "sacremoses",
    "importlib_metadata",
    "huggingface_hub",
]







@add_start_docstrings(AutoConfig.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoTokenizer.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoModel.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoModelForCausalLM.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoModelForMaskedLM.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoModelForSequenceClassification.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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







@add_start_docstrings(AutoModelForQuestionAnswering.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



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




