
'''simple docstring'''



import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin




class   UpperCAmelCase_     (		_SCREAMING_SNAKE_CASE ):






						'''simple docstring'''






						_lowercase		:      List[Any]									=   '''AutoFeatureExtractor'''
						_lowercase		:      Dict									=   '''Speech2Text2Tokenizer'''




						def __init__(					self    ,   _lowercase    ,   _lowercase      ):

												"""simple docstring"""



												super().__init__(A_    ,   A_      )
												_lowerCAmelCase  						= self.feature_extractor
												_lowerCAmelCase  						= False




						def __call__(					self    ,   *_lowercase    ,   **_lowercase      ):

												"""simple docstring"""



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

												if "raw_speech" in kwargs:
																		warnings.warn("""Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."""      )
																		_lowerCAmelCase  						= kwargs.pop("""raw_speech"""      )
												else:
																		_lowerCAmelCase  						= kwargs.pop("""audio"""    ,   A_      )
												_lowerCAmelCase  						= kwargs.pop("""sampling_rate"""    ,   A_      )
												_lowerCAmelCase  						= kwargs.pop("""text"""    ,   A_      )
												if len(A_      ) > 0:
																		_lowerCAmelCase  						= args[0]
																		_lowerCAmelCase  						= 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:
																		_lowerCAmelCase  						= self.feature_extractor(A_    ,   *A_    ,   sampling_rate=A_    ,   **A_      )
												if text is not None:
																		_lowerCAmelCase  						= self.tokenizer(A_    ,   **A_      )

												if text is None:
																		return inputs
												elif audio is None:
																		return encodings
												else:
																		_lowerCAmelCase  						= encodings["input_ids"]
																		return inputs




						def 					_lowercase	(					self    ,   *_lowercase    ,   **_lowercase      ):

												"""simple docstring"""



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




						def 					_lowercase	(					self    ,   *_lowercase    ,   **_lowercase      ):

												"""simple docstring"""



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




						@contextmanager
						def 					_lowercase	(					self      ):

												"""simple docstring"""



												warnings.warn(
												    """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
												    """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
												    """your audio inputs, or in a separate call."""      )
												_lowerCAmelCase  						= True
												_lowerCAmelCase  						= self.tokenizer
												yield
												_lowerCAmelCase  						= self.feature_extractor
												_lowerCAmelCase  						= False



from __future__ import annotations

class  a     :


						def __init__(				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						List[Any]       						=			vertices
										_UpperCAmelCase				:						List[str]       						=			[[0] * vertices for _ in range(A_		)]


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										print("Vertex \t Distance from Source"		)
										for vertex in range(self.vertices		):
														print(A_  ,    "\t\t"  ,    distances_from_source[vertex]		)


						def 				_UpperCAmelCase (				self  ,    A_  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Tuple       						=			1e7
										_UpperCAmelCase				:						Any       						=			0

										# Search not nearest vertex not in the shortest path tree
										for vertex in range(self.vertices		):
														if distances_from_source[vertex] < minimum and visited[vertex] is False:
																		_UpperCAmelCase				:						List[Any]       						=			distances_from_source[vertex]
																		_UpperCAmelCase				:						Tuple       						=			vertex
										return min_index





						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			[int(1e7		)] * self.vertices  # distances from the source
										_UpperCAmelCase				:						Optional[Any]       						=			0
										_UpperCAmelCase				:						List[str]       						=			[False] * self.vertices

										for _ in range(self.vertices		):
														_UpperCAmelCase				:						str       						=			self.minimum_distance(A_  ,    A_		)
														_UpperCAmelCase				:						str       						=			True

														# Update dist value of the adjacent vertices
														# of the picked vertex only if the current
														# distance is greater than new distance and
														# the vertex in not in the shortest path tree
														for v in range(self.vertices		):
																		if (
																		    self.graph[u][v] > 0
																		    and visited[v] is False
																		    and distances[v] > distances[u] + self.graph[u][v]
																		):
																						_UpperCAmelCase				:						str       						=			distances[u] + self.graph[u][v]

										self.print_solution(A_		)


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE_						=					Graph(9)
					SCREAMING_SNAKE_CASE_						=					[
					    [0, 4, 0, 0, 0, 0, 0, 8, 0],
					    [4, 0, 8, 0, 0, 0, 0, 11, 0],
					    [0, 8, 0, 7, 0, 4, 0, 0, 2],
					    [0, 0, 7, 0, 9, 14, 0, 0, 0],
					    [0, 0, 0, 9, 0, 10, 0, 0, 0],
					    [0, 0, 4, 14, 10, 0, 2, 0, 0],
					    [0, 0, 0, 0, 0, 2, 0, 1, 6],
					    [8, 11, 0, 0, 0, 0, 1, 0, 7],
					    [0, 0, 2, 0, 0, 0, 6, 7, 0],
					]
					graph.dijkstra(0)


