



class 	lowerCamelCase_    :






						'''simple docstring'''







						def __init__(	self      :			List[Any] )      ->				Dict:
									A							:					Optional[int]              =						0
									A							:					Optional[Any]              =						0
									A							:					Dict              =						{}







						def 			SCREAMING_SNAKE_CASE__		(	self      :			List[str]	,	__lowerCamelCase      :			int )      ->				Tuple:
									if vertex not in self.adjacency:
												A							:					Union[str, Any]              =						{}
												self.num_vertices += 1







						def 			SCREAMING_SNAKE_CASE__		(	self      :			List[str]	,	__lowerCamelCase      :			Dict	,	__lowerCamelCase      :			List[Any]	,	__lowerCamelCase      :			Any )      ->				List[Any]:
									self.add_vertex(__lowerCamelCase )
									self.add_vertex(__lowerCamelCase )

									if head == tail:
												return

									A							:					Tuple              =						weight
									A							:					Optional[Any]              =						weight







						def 			SCREAMING_SNAKE_CASE__		(	self      :			Union[str, Any] )      ->				Union[str, Any]:
									A							:					Union[str, Any]              =						self.get_edges()
									for edge in edges:
												A       , A       , A							:					Union[str, Any]              =						edge
												edges.remove((tail, head, weight) )
									for i in range(len(__lowerCamelCase ) ):
												A							:					Optional[Any]              =						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]:
															A							:					str              =						edges[i][2] + 1
									for edge in edges:
												A       , A       , A							:					Dict              =						edge
												A							:					List[str]              =						weight
												A							:					Union[str, Any]              =						weight







						def __str__(	self      :			Tuple )      ->				int:
									A							:					Tuple              =						""
									for tail in self.adjacency:
												for head in self.adjacency[tail]:
															A							:					Dict              =						self.adjacency[head][tail]
															string += F"""{head} -> {tail} == {weight}\n"""
									return string.rstrip("\n" )







						def 			SCREAMING_SNAKE_CASE__		(	self      :			Tuple )      ->				Any:
									A							:					Optional[int]              =						[]
									for tail in self.adjacency:
												for head in self.adjacency[tail]:
															output.append((tail, head, self.adjacency[head][tail]) )
									return output







						def 			SCREAMING_SNAKE_CASE__		(	self      :			Optional[Any] )      ->				Union[str, Any]:
									return self.adjacency.keys()







						@staticmethod
						def 			SCREAMING_SNAKE_CASE__		(	__lowerCamelCase      :			Tuple=None	,	__lowerCamelCase      :			Optional[int]=None )      ->				Any:
									A							:					int              =						Graph()
									if vertices is None:
												A							:					int              =						[]
									if edges is None:
												A							:					Any              =						[]
									for vertex in vertices:
												g.add_vertex(__lowerCamelCase )
									for edge in edges:
												g.add_edge(*__lowerCamelCase )
									return g

						class 	lowerCamelCase_    :






												'''simple docstring'''







												def __init__(	self      :			str )      ->				Optional[int]:
															A							:					Tuple              =						{}
															A							:					Optional[Any]              =						{}







												def __len__(	self      :			Dict )      ->				Tuple:
															return len(self.parent )







												def 			SCREAMING_SNAKE_CASE__		(	self      :			List[Any]	,	__lowerCamelCase      :			List[str] )      ->				Union[str, Any]:
															if item in self.parent:
																		return self.find(__lowerCamelCase )

															A							:					Union[str, Any]              =						item
															A							:					List[str]              =						0
															return item







												def 			SCREAMING_SNAKE_CASE__		(	self      :			int	,	__lowerCamelCase      :			List[str] )      ->				Optional[int]:
															if item not in self.parent:
																		return self.make_set(__lowerCamelCase )
															if item != self.parent[item]:
																		A							:					Any              =						self.find(self.parent[item] )
															return self.parent[item]







												def 			SCREAMING_SNAKE_CASE__		(	self      :			List[Any]	,	__lowerCamelCase      :			int	,	__lowerCamelCase      :			Dict )      ->				int:
															A							:					int              =						self.find(__lowerCamelCase )
															A							:					int              =						self.find(__lowerCamelCase )

															if roota == roota:
																		return roota

															if self.rank[roota] > self.rank[roota]:
																		A							:					int              =						roota
																		return roota

															if self.rank[roota] < self.rank[roota]:
																		A							:					Union[str, Any]              =						roota
																		return roota

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







						@staticmethod
						def 			SCREAMING_SNAKE_CASE__		(	__lowerCamelCase      :			Any )      ->				str:
									A							:					Any              =						graph.num_vertices

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

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

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




from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Sequence, Value
from .base import TaskTemplate

@dataclass(frozen=_A						)
class 	lowerCamelCase_    ( _A						):






						'''simple docstring'''
						# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
						a__   =  field(default="question-answering-extractive"						,metadata={"include_in_asdict_even_if_is_default": True}						)
						a__   =  Features({"question": Value("string"						), "context": Value("string"						)}						)
						a__   =  Features(
						    {
						        "answers": Sequence(
						            {
						                "text": Value("string"						),
						                "answer_start": Value("int32"						),
						            }						)
						    }						)
						a__   =  "question"
						a__   =  "context"
						a__   =  "answers"







						@property
						def 			SCREAMING_SNAKE_CASE__		(	self      :			Union[str, Any] )      ->				Dict[str, str]:
									return {self.question_column: "question", self.context_column: "context", self.answers_column: "answers"}