
'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_lowercase			:  List[Any]   							=	logging.get_logger(__name__)

_lowercase			:  Optional[Any]   							=	{
    "google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json",
    # See all ViT models at https://huggingface.co/models?filter=vit
}






class 			lowerCAmelCase__       (  lowerCamelCase_					):
     lowerCAmelCase_					       =					'''vit'''






     def __init__(       self    ,							__SCREAMING_SNAKE_CASE=7_68    ,							__SCREAMING_SNAKE_CASE=12    ,							__SCREAMING_SNAKE_CASE=12    ,							__SCREAMING_SNAKE_CASE=30_72    ,							__SCREAMING_SNAKE_CASE="gelu"    ,							__SCREAMING_SNAKE_CASE=0.0    ,							__SCREAMING_SNAKE_CASE=0.0    ,							__SCREAMING_SNAKE_CASE=0.02    ,							__SCREAMING_SNAKE_CASE=1E-1_2    ,							__SCREAMING_SNAKE_CASE=2_24    ,							__SCREAMING_SNAKE_CASE=16    ,							__SCREAMING_SNAKE_CASE=3    ,							__SCREAMING_SNAKE_CASE=True    ,							__SCREAMING_SNAKE_CASE=16    ,							**__SCREAMING_SNAKE_CASE    ,							):


           """simple docstring"""





           super().__init__(**__SCREAMING_SNAKE_CASE		)

           lowercase_     :					Union[str, Any]													=	hidden_size
           lowercase_     :					Dict													=	num_hidden_layers
           lowercase_     :					List[Any]													=	num_attention_heads
           lowercase_     :					Any													=	intermediate_size
           lowercase_     :					Union[str, Any]													=	hidden_act
           lowercase_     :					Dict													=	hidden_dropout_prob
           lowercase_     :					List[str]													=	attention_probs_dropout_prob
           lowercase_     :					Any													=	initializer_range
           lowercase_     :					Tuple													=	layer_norm_eps
           lowercase_     :					Union[str, Any]													=	image_size
           lowercase_     :					Tuple													=	patch_size
           lowercase_     :					Tuple													=	num_channels
           lowercase_     :					Union[str, Any]													=	qkv_bias
           lowercase_     :					List[Any]													=	encoder_stride







class 			lowerCAmelCase__       (  lowerCamelCase_					):
     lowerCAmelCase_					       =					version.parse('''1.11'''					)






     @property
     def      _snake_case   (       self		):


           """simple docstring"""





           return OrderedDict(
               [
                   ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
               ]		)






     @property
     def      _snake_case   (       self		):


           """simple docstring"""





           return 1E-4





'''simple docstring'''







from __future__ import annotations

from typing import Any






class 			lowerCAmelCase__       :






					def __init__(       self    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											lowercase_     :					str													=	num_of_nodes
											lowercase_     :					list[list[int]]													=	[]
											lowercase_     :					dict[int, int]													=	{}






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





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






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





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






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											if self.m_component[u_node] != u_node:
																	for k in self.m_component:
																							lowercase_     :					Optional[int]													=	self.find_component(__SCREAMING_SNAKE_CASE		)






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											if component_size[u_node] <= component_size[v_node]:
																	lowercase_     :					Any													=	v_node
																	component_size[v_node] += component_size[u_node]
																	self.set_component(__SCREAMING_SNAKE_CASE		)

											elif component_size[u_node] >= component_size[v_node]:
																	lowercase_     :					int													=	self.find_component(__SCREAMING_SNAKE_CASE		)
																	component_size[u_node] += component_size[v_node]
																	self.set_component(__SCREAMING_SNAKE_CASE		)






					def      _snake_case   (       self		):


											"""simple docstring"""





											lowercase_     :					Dict													=	[]
											lowercase_     :					Optional[Any]													=	0

											lowercase_     :					list[Any]													=	[-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		)

											lowercase_     :					Union[str, Any]													=	self.m_num_of_nodes

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

																							lowercase_     :					Dict													=	self.m_component[u]
																							lowercase_     :					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
																																			):
																																									lowercase_     :					Union[str, Any]													=	[u, v, w]

																	for edge in minimum_weight_edge:
																							if isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):
																													lowercase_						,			lowercase_						,			lowercase_     :					str													=	edge

																													lowercase_     :					Tuple													=	self.m_component[u]
																													lowercase_     :					Union[str, Any]													=	self.m_component[v]

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

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







def  snake_case_		(    ):



						"""simple docstring"""







if __name__ == "__main__":
							import doctest

							doctest.testmod()



