


'''simple docstring'''
from __future__ import annotations


def     a   (    __a				,      __a     )						->			List[Any]:



					'''simple docstring'''






					print(f'''Vertex\tShortest Distance from vertex {src}'''     )
					for i, d in enumerate(__a     ):
										print(f'''{i}\t\t{d}'''     )


def     a   (    __a				,      __a				,      __a     )						->			Tuple:



					'''simple docstring'''






					for j in range(__a     ):
										UpperCamelCase__      ,       UpperCamelCase__      ,       UpperCamelCase__     :Optional[Any]							      =				(graph[j][k] for k in ['''src''', '''dst''', '''weight'''])
										if distance[u] != float('''inf'''     ) and distance[u] + w < distance[v]:
															return True
					return False


def     a   (    __a				,      __a				,      __a				,      __a     )						->			list[float]:



					'''simple docstring'''






					UpperCamelCase__     :Tuple							      =				[float('''inf'''     )] * vertex_count
					UpperCamelCase__     :Any							      =				0.0

					for _ in range(vertex_count - 1     ):
										for j in range(__a     ):
															UpperCamelCase__      ,       UpperCamelCase__      ,       UpperCamelCase__     :str							      =				(graph[j][k] for k in ['''src''', '''dst''', '''weight'''])

															if distance[u] != float('''inf'''     ) and distance[u] + w < distance[v]:
																				UpperCamelCase__     :Union[str, Any]							      =				distance[u] + w

					UpperCamelCase__     :Optional[Any]							      =				check_negative_cycle(__a				,      __a				,      __a     )
					if negative_cycle_exists:
										raise Exception('''Negative cycle found'''     )

					return distance


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		__snake_case							   =  int(input('''Enter number of vertices: ''').strip())
		__snake_case							   =  int(input('''Enter number of edges: ''').strip())

		__snake_case							   =  [{} for _ in range(E)]

		for i in range(E):
				print('''Edge ''', i + 1)
				__snake_case   ,      __snake_case   ,      __snake_case							   =  (
				    int(x)
				    for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
				)
				__snake_case							   =  {'''src''': src, '''dst''': dest, '''weight''': weight}

		__snake_case							   =  int(input('''\nEnter shortest path source:''').strip())
		__snake_case							   =  bellman_ford(graph, V, E, source)
		print_distance(shortest_distance, 0)



'''simple docstring'''
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin
class      lowercase			(							A__      ):

		"""simple docstring"""

		_a									=       'Speech2TextFeatureExtractor'
		_a									=       'Speech2TextTokenizer'




		def __init__(	self					,     UpperCamelCase_					,     UpperCamelCase_							):

							'''simple docstring'''


							super().__init__(UpperCamelCase_					,     UpperCamelCase_							)
							UpperCamelCase__     :List[str]							      =				self.feature_extractor
							UpperCamelCase__     :Optional[Any]							      =				False




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

							'''simple docstring'''


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

							if "raw_speech" in kwargs:
												warnings.warn('''Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.'''							)
												UpperCamelCase__     :Optional[Any]							      =				kwargs.pop('''raw_speech'''							)
							else:
												UpperCamelCase__     :List[Any]							      =				kwargs.pop('''audio'''					,     UpperCamelCase_							)
							UpperCamelCase__     :List[Any]							      =				kwargs.pop('''sampling_rate'''					,     UpperCamelCase_							)
							UpperCamelCase__     :Dict							      =				kwargs.pop('''text'''					,     UpperCamelCase_							)
							if len(UpperCamelCase_							) > 0:
												UpperCamelCase__     :Tuple							      =				args[0]
												UpperCamelCase__     :Optional[int]							      =				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__     :Any							      =				self.feature_extractor(UpperCamelCase_					,     *UpperCamelCase_					,     sampling_rate=UpperCamelCase_					,     **UpperCamelCase_							)
							if text is not None:
												UpperCamelCase__     :Dict							      =				self.tokenizer(UpperCamelCase_					,     **UpperCamelCase_							)

							if text is None:
												return inputs
							elif audio is None:
												return encodings
							else:
												UpperCamelCase__     :Dict							      =				encodings['''input_ids''']
												return inputs




		def 					lowerCAmelCase__       (	self					,     *UpperCamelCase_					,     **UpperCamelCase_							):

							'''simple docstring'''


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




		def 					lowerCAmelCase__       (	self					,     *UpperCamelCase_					,     **UpperCamelCase_							):

							'''simple docstring'''


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




		@contextmanager
		def 					lowerCAmelCase__       (	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.'''							)
							UpperCamelCase__     :Optional[Any]							      =				True
							UpperCamelCase__     :Any							      =				self.tokenizer
							yield
							UpperCamelCase__     :Any							      =				self.feature_extractor
							UpperCamelCase__     :Any							      =				False