






'''simple docstring'''

class      A     :






 """simple docstring"""





 def __init__(				self			):
       UpperCamelCase_					: str            =				0
       UpperCamelCase_					: int            =				0
       UpperCamelCase_					: str            =				{}
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase			):
       if vertex not in self.adjacency:
             UpperCamelCase_					: Optional[Any]            =				{}
             self.num_vertices += 1
 def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase      ,  __lowerCAmelCase			):
       self.add_vertex(__lowerCAmelCase			)
       self.add_vertex(__lowerCAmelCase			)

       if head == tail:
             return

       UpperCamelCase_					: Optional[Any]            =				weight
       UpperCamelCase_					: Tuple            =				weight
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: str            =				self.get_edges()
       for edge in edges:
             UpperCamelCase_     ,      UpperCamelCase_     ,      UpperCamelCase_					: Tuple            =				edge
             edges.remove((tail, head, weight)			)
       for i in range(len(__lowerCAmelCase			)			):
             UpperCamelCase_					: Optional[int]            =				list(edges[i]			)

       edges.sort(key=lambda __lowerCAmelCase			: e[2]			)
       for i in range(len(__lowerCAmelCase			) - 1			):
             if edges[i][2] >= edges[i + 1][2]:
                   UpperCamelCase_					: List[str]            =				edges[i][2] + 1
       for edge in edges:
             UpperCamelCase_     ,      UpperCamelCase_     ,      UpperCamelCase_					: List[Any]            =				edge
             UpperCamelCase_					: int            =				weight
             UpperCamelCase_					: int            =				weight
 def __str__(				self			):
       UpperCamelCase_					: List[Any]            =				""""""
       for tail in self.adjacency:
             for head in self.adjacency[tail]:
                   UpperCamelCase_					: Tuple            =				self.adjacency[head][tail]
                   string += F"{head} -> {tail} == {weight}\n"
       return string.rstrip("""\n"""			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Optional[int]            =				[]
       for tail in self.adjacency:
             for head in self.adjacency[tail]:
                   output.append((tail, head, self.adjacency[head][tail])			)
       return output
 def 	_UpperCAmelCase							(				self			):
       return self.adjacency.keys()
 @staticmethod
 def 	_UpperCAmelCase							(				__lowerCAmelCase=None      ,  __lowerCAmelCase=None			):
       UpperCamelCase_					: str            =				Graph()
       if vertices is None:
             UpperCamelCase_					: List[Any]            =				[]
       if edges is None:
             UpperCamelCase_					: int            =				[]
       for vertex in vertices:
             g.add_vertex(__lowerCAmelCase			)
       for edge in edges:
             g.add_edge(*__lowerCAmelCase			)
       return g




 class      A     :






  """simple docstring"""





  def __init__(				self			):
        UpperCamelCase_					: str            =				{}
        UpperCamelCase_					: List[Any]            =				{}
  def __len__(				self			):
        return len(self.parent			)
  def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase			):
        if item in self.parent:
              return self.find(__lowerCAmelCase			)

        UpperCamelCase_					: int            =				item
        UpperCamelCase_					: str            =				0
        return item
  def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase			):
        if item not in self.parent:
              return self.make_set(__lowerCAmelCase			)
        if item != self.parent[item]:
              UpperCamelCase_					: Dict            =				self.find(self.parent[item]			)
        return self.parent[item]





  def 	_UpperCAmelCase							(				self      ,  __lowerCAmelCase      ,  __lowerCAmelCase			):
        UpperCamelCase_					: int            =				self.find(__lowerCAmelCase			)
        UpperCamelCase_					: Tuple            =				self.find(__lowerCAmelCase			)

        if roota == roota:
              return roota

        if self.rank[roota] > self.rank[roota]:
              UpperCamelCase_					: Optional[Any]            =				roota
              return roota

        if self.rank[roota] < self.rank[roota]:
              UpperCamelCase_					: int            =				roota
              return roota

        if self.rank[roota] == self.rank[roota]:
              self.rank[roota] += 1
              UpperCamelCase_					: Any            =				roota
              return roota
        return None






 @staticmethod
 def 	_UpperCAmelCase							(				__lowerCAmelCase			):
       UpperCamelCase_					: List[Any]            =				graph.num_vertices

       UpperCamelCase_					: str            =				Graph.UnionFind()
       UpperCamelCase_					: str            =				[]
       while num_components > 1:
             UpperCamelCase_					: List[str]            =				{}
             for vertex in graph.get_vertices():
                   UpperCamelCase_					: Any            =				-1

             UpperCamelCase_					: Any            =				graph.get_edges()
             for edge in edges:
                   UpperCamelCase_     ,      UpperCamelCase_     ,      UpperCamelCase_					: Any            =				edge
                   edges.remove((tail, head, weight)			)
             for edge in edges:
                   UpperCamelCase_     ,      UpperCamelCase_     ,      UpperCamelCase_					: str            =				edge
                   UpperCamelCase_					: Optional[Any]            =				union_find.find(__lowerCAmelCase			)
                   UpperCamelCase_					: Optional[int]            =				union_find.find(__lowerCAmelCase			)
                   if seta != seta:
                         if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                               UpperCamelCase_					: List[str]            =				[head, tail, weight]

                         if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                               UpperCamelCase_					: int            =				[head, tail, weight]
             for vertex in cheap_edge:
                   if cheap_edge[vertex] != -1:
                         UpperCamelCase_     ,      UpperCamelCase_     ,      UpperCamelCase_					: Optional[Any]            =				cheap_edge[vertex]
                         if union_find.find(__lowerCAmelCase			) != union_find.find(__lowerCAmelCase			):
                               union_find.union(__lowerCAmelCase      ,  __lowerCAmelCase			)
                               mst_edges.append(cheap_edge[vertex]			)
                               UpperCamelCase_					: Optional[Any]            =				num_components - 1
       UpperCamelCase_					: Union[str, Any]            =				Graph.build(edges=__lowerCAmelCase			)
       return mst














'''simple docstring'''

import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


UpperCamelCase      					="\nHugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.\n\nIn March 2021, Hugging Face raised $40 million in a Series B funding round.[3]\n\nOn April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]\n"




class      A     (   unittest.TestCase, SCREAMING_SNAKE_CASE__    ):






 """simple docstring"""





 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Optional[Any]            =				load_tool("""text-question-answering"""			)
       self.tool.setup()
       UpperCamelCase_					: List[str]            =				load_tool("""text-question-answering"""      ,  remote=__lowerCAmelCase			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Union[str, Any]            =				self.tool(__lowerCAmelCase      ,  """What did Hugging Face do in April 2021?"""			)
       self.assertEqual(__lowerCAmelCase      ,  """launched the BigScience Research Workshop"""			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Optional[Any]            =				self.remote_tool(__lowerCAmelCase      ,  """What did Hugging Face do in April 2021?"""			)
       self.assertEqual(__lowerCAmelCase      ,  """launched the BigScience Research Workshop"""			)
 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: List[Any]            =				self.tool(text=__lowerCAmelCase      ,  question="""What did Hugging Face do in April 2021?"""			)
       self.assertEqual(__lowerCAmelCase      ,  """launched the BigScience Research Workshop"""			)





 def 	_UpperCAmelCase							(				self			):
       UpperCamelCase_					: Dict            =				self.remote_tool(text=__lowerCAmelCase      ,  question="""What did Hugging Face do in April 2021?"""			)
       self.assertEqual(__lowerCAmelCase      ,  """launched the BigScience Research Workshop"""			)






