






'''simple docstring'''


from ...processing_utils import ProcessorMixin
class    _SCREAMING_SNAKE_CASE							(		SCREAMING_SNAKE_CASE	):


			'''simple docstring'''





			__a							:							Optional[Any]					     =					"WhisperFeatureExtractor"
			__a							:							Any					     =					"WhisperTokenizer"






			def __init__(   self							:						Any ,      lowercase							:						Tuple ,      lowercase							:						Union[str, Any]			)							->    List[Any]:

									'''simple docstring'''







									super().__init__(lowercase ,      lowercase			)
									UpperCamelCase__         = self.feature_extractor
									UpperCamelCase__         = False






			def 				A      (   self							:						List[Any] ,      lowercase							:						Dict=None ,      lowercase							:						List[str]=None ,      lowercase							:						int=True			)							->    Optional[int]:

									'''simple docstring'''







									return self.tokenizer.get_decoder_prompt_ids(task=lowercase ,      language=lowercase ,      no_timestamps=lowercase			)






			def __call__(   self							:						Union[str, Any] ,      *lowercase							:						str ,      **lowercase							:						Union[str, Any]			)							->    List[str]:

									'''simple docstring'''







									if self._in_target_context_manager:
															return self.current_processor(*lowercase ,      **lowercase			)

									UpperCamelCase__         = kwargs.pop("""audio""" ,      lowercase			)
									UpperCamelCase__         = kwargs.pop("""sampling_rate""" ,      lowercase			)
									UpperCamelCase__         = kwargs.pop("""text""" ,      lowercase			)
									if len(lowercase			) > 0:
															UpperCamelCase__         = args[0]
															UpperCamelCase__         = args[1:]

									if audio is None and text is None:
															raise ValueError("""You need to specify either an `audio` or `text` input to process."""			)

									if audio is not None:
															UpperCamelCase__         = self.feature_extractor(lowercase ,      *lowercase ,      sampling_rate=lowercase ,      **lowercase			)
									if text is not None:
															UpperCamelCase__         = self.tokenizer(lowercase ,      **lowercase			)

									if text is None:
															return inputs

									elif audio is None:
															return encodings
									else:
															UpperCamelCase__         = encodings["""input_ids"""]
															return inputs






			def 				A      (   self							:						Dict ,      *lowercase							:						int ,      **lowercase							:						int			)							->    int:

									'''simple docstring'''







									return self.tokenizer.batch_decode(*lowercase ,      **lowercase			)






			def 				A      (   self							:						str ,      *lowercase							:						str ,      **lowercase							:						str			)							->    Union[str, Any]:

									'''simple docstring'''







									return self.tokenizer.decode(*lowercase ,      **lowercase			)







			def 				A      (   self							:						Optional[Any] ,      lowercase							:						str ,      lowercase							:						Dict="np"			)							->    Any:

									'''simple docstring'''







									return self.tokenizer.get_prompt_ids(lowercase ,      return_tensors=lowercase			)








'''simple docstring'''


from __future__ import annotations

from typing import Any
class    _SCREAMING_SNAKE_CASE							:


			'''simple docstring'''





			def __init__(   self							:						Union[str, Any] ,      lowercase							:						int			)							->    None:

									'''simple docstring'''







									UpperCamelCase__         = num_of_nodes
									UpperCamelCase__         = []
									UpperCamelCase__         = {}






			def 				A      (   self							:						Optional[Any] ,      lowercase							:						int ,      lowercase							:						int ,      lowercase							:						int			)							->    None:

									'''simple docstring'''







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






			def 				A      (   self							:						str ,      lowercase							:						int			)							->    int:

									'''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] ,      lowercase							:						int			)							->    None:

									'''simple docstring'''







									if self.m_component[u_node] != u_node:
															for k in self.m_component:
																					UpperCamelCase__         = self.find_component(lowercase			)






			def 				A      (   self							:						Tuple ,      lowercase							:						list[int] ,      lowercase							:						int ,      lowercase							:						int			)							->    None:

									'''simple docstring'''







									if component_size[u_node] <= component_size[v_node]:
															UpperCamelCase__         = v_node
															component_size[v_node] += component_size[u_node]
															self.set_component(lowercase			)

									elif component_size[u_node] >= component_size[v_node]:
															UpperCamelCase__         = self.find_component(lowercase			)
															component_size[u_node] += component_size[v_node]
															self.set_component(lowercase			)







			def 				A      (   self							:						int			)							->    None:

									'''simple docstring'''







									UpperCamelCase__         = []
									UpperCamelCase__         = 0

									UpperCamelCase__         = [-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__         = self.m_num_of_nodes

									while num_of_components > 1:
															for edge in self.m_edges:
																					UpperCamelCase__    ,   UpperCamelCase__    ,   UpperCamelCase__         = edge

																					UpperCamelCase__         = self.m_component[u]
																					UpperCamelCase__         = 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__         = [u, v, w]

															for edge in minimum_weight_edge:
																					if isinstance(lowercase ,      lowercase			):
																											UpperCamelCase__    ,   UpperCamelCase__    ,   UpperCamelCase__         = edge

																											UpperCamelCase__         = self.m_component[u]
																											UpperCamelCase__         = self.m_component[v]

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

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







def 	__magic_name__( ):
						'''simple docstring'''







if __name__ == "__main__":
					import doctest

					doctest.testmod()
