



"""simple docstring"""





from __future__ import annotations

from typing import Any



class      a__				:


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


						"""simple docstring"""




						__UpperCAmelCase	: int		=					num_of_nodes
						__UpperCAmelCase	: Dict		=					[]
						__UpperCAmelCase	: Tuple		=					{}


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


						"""simple docstring"""




						self.m_edges.append([u_node, v_node, weight])


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


						"""simple docstring"""




						if self.m_component[u_node] == u_node:
									return u_node
						return self.find_component(self.m_component[u_node])


			def       a_     (      self      :    Union[str, Any]      ,  UpperCamelCase_      :    Union[str, Any]):


						"""simple docstring"""




						if self.m_component[u_node] != u_node:
									for k in self.m_component:
												__UpperCAmelCase	: List[Any]		=					self.find_component(__A)


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


						"""simple docstring"""




						if component_size[u_node] <= component_size[v_node]:
									__UpperCAmelCase	: Dict		=					v_node
									component_size[v_node] += component_size[u_node]
									self.set_component(__A)

						elif component_size[u_node] >= component_size[v_node]:
									__UpperCAmelCase	: Union[str, Any]		=					self.find_component(__A)
									component_size[u_node] += component_size[v_node]
									self.set_component(__A)


			def       a_     (      self      :    Tuple):


						"""simple docstring"""




						__UpperCAmelCase	: str		=					[]
						__UpperCAmelCase	: str		=					0

						__UpperCAmelCase	: Optional[int]		=					[-1] * self.m_num_of_nodes

						# A list of components (initialized to all of the nodes)
						for node in range(self.m_num_of_nodes):
									self.m_component.update({node: node})
									component_size.append(1)

						__UpperCAmelCase	: Tuple		=					self.m_num_of_nodes

						while num_of_components > 1:
									for edge in self.m_edges:
												__UpperCAmelCase	,     __UpperCAmelCase	,     __UpperCAmelCase	: Optional[Any]		=					edge

												__UpperCAmelCase	: List[Any]		=					self.m_component[u]
												__UpperCAmelCase	: Any		=					self.m_component[v]

												if u_component != v_component:

															for component in (u_component, v_component):
																		if (
																		    minimum_weight_edge[component] == -1
																		    or minimum_weight_edge[component][2] > w
																		):
																					__UpperCAmelCase	: Union[str, Any]		=					[u, v, w]

									for edge in minimum_weight_edge:
												if isinstance(__A      ,  __A):
															__UpperCAmelCase	,     __UpperCAmelCase	,     __UpperCAmelCase	: int		=					edge

															__UpperCAmelCase	: Optional[int]		=					self.m_component[u]
															__UpperCAmelCase	: Tuple		=					self.m_component[v]

															if u_component != v_component:
																		mst_weight += w
																		self.union(__A      ,  __A      ,  __A)
																		print(F"Added edge [{u} - {v}]\nAdded weight: {w}\n")
																		num_of_components -= 1

									__UpperCAmelCase	: int		=					[-1] * self.m_num_of_nodes
						print(F"The total weight of the minimal spanning tree is: {mst_weight}")






def 					_UpperCamelCase    (			)			->			Tuple:


			"""simple docstring"""








if __name__ == "__main__":
					import doctest

					doctest.testmod()








"""simple docstring"""





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


A   =       logging.get_logger(__name__)

A   =       {
    """bigcode/gpt_bigcode-santacoder""": """https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json""",
}



class      a__				(	__magic_name__   ):
			lowercase_    =	"gpt_bigcode"
			lowercase_    =	["past_key_values"]
			lowercase_    =	{
			    "hidden_size": "n_embd",
			    "max_position_embeddings": "n_positions",
			    "num_attention_heads": "n_head",
			    "num_hidden_layers": "n_layer",
			}


			def __init__(      self      :    Any      ,  UpperCamelCase_      :    Tuple=50257      ,  UpperCamelCase_      :    Dict=1024      ,  UpperCamelCase_      :    Optional[Any]=768      ,  UpperCamelCase_      :    Optional[Any]=12      ,  UpperCamelCase_      :    Any=12      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    List[Any]="gelu_pytorch_tanh"      ,  UpperCamelCase_      :    Optional[Any]=0.1      ,  UpperCamelCase_      :    Union[str, Any]=0.1      ,  UpperCamelCase_      :    Tuple=0.1      ,  UpperCamelCase_      :    Tuple=1e-5      ,  UpperCamelCase_      :    List[str]=0.02      ,  UpperCamelCase_      :    Dict=True      ,  UpperCamelCase_      :    Optional[int]=True      ,  UpperCamelCase_      :    str=50256      ,  UpperCamelCase_      :    Union[str, Any]=50256      ,  UpperCamelCase_      :    Dict=True      ,  UpperCamelCase_      :    List[str]=True      ,  UpperCamelCase_      :    Union[str, Any]=True      ,  **UpperCamelCase_      :    Union[str, Any]      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Tuple		=					vocab_size
						__UpperCAmelCase	: Optional[int]		=					n_positions
						__UpperCAmelCase	: Tuple		=					n_embd
						__UpperCAmelCase	: str		=					n_layer
						__UpperCAmelCase	: Dict		=					n_head
						__UpperCAmelCase	: Optional[Any]		=					n_inner
						__UpperCAmelCase	: Optional[Any]		=					activation_function
						__UpperCAmelCase	: List[str]		=					resid_pdrop
						__UpperCAmelCase	: List[Any]		=					embd_pdrop
						__UpperCAmelCase	: Optional[Any]		=					attn_pdrop
						__UpperCAmelCase	: Dict		=					layer_norm_epsilon
						__UpperCAmelCase	: List[str]		=					initializer_range
						__UpperCAmelCase	: int		=					scale_attn_weights
						__UpperCAmelCase	: Tuple		=					use_cache
						__UpperCAmelCase	: List[Any]		=					attention_softmax_in_fpaa
						__UpperCAmelCase	: Any		=					scale_attention_softmax_in_fpaa
						__UpperCAmelCase	: str		=					multi_query

						__UpperCAmelCase	: int		=					bos_token_id
						__UpperCAmelCase	: str		=					eos_token_id

						super().__init__(bos_token_id=UpperCamelCase_      ,  eos_token_id=UpperCamelCase_      ,  **UpperCamelCase_)


