



"""simple docstring"""
from __future__ import annotations


def 	_SCREAMING_SNAKE_CASE  (__lowerCAmelCase       ,     __lowerCAmelCase							)       ->  Tuple:







  '''simple docstring'''


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


def 	_SCREAMING_SNAKE_CASE  (__lowerCAmelCase       ,     __lowerCAmelCase       ,     __lowerCAmelCase							)       ->  int:







  '''simple docstring'''


  for j in range(__snake_case							):
    lowercase_    ,			lowercase_    ,			lowercase_	    =       (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 	_SCREAMING_SNAKE_CASE  (__lowerCAmelCase       ,     __lowerCAmelCase       ,     __lowerCAmelCase       ,     __lowerCAmelCase							)       ->  list[float]:







  '''simple docstring'''


  lowercase_	    =       [float("""inf"""							)] * vertex_count
  lowercase_	    =       0.0

  for _ in range(vertex_count - 1							):
    for j in range(__snake_case							):
      lowercase_    ,			lowercase_    ,			lowercase_	    =       (graph[j][k] for k in ["""src""", """dst""", """weight"""])

      if distance[u] != float("""inf"""							) and distance[u] + w < distance[v]:
        lowercase_	    =       distance[u] + w

  lowercase_	    =       check_negative_cycle(__snake_case       ,     __snake_case       ,     __snake_case							)
  if negative_cycle_exists:
    raise Exception("""Negative cycle found"""							)

  return distance


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       UpperCAmelCase  :						List[Any]	=       int(input("Enter number of vertices: ").strip())
       UpperCAmelCase  :						Any	=       int(input("Enter number of edges: ").strip())

       UpperCAmelCase  :						int	=       [{} for _ in range(E)]

       for i in range(E):
              print("Edge ", i + 1)
              UpperCAmelCase	, UpperCAmelCase	, UpperCAmelCase  :						List[Any]	=       (
                  int(x)
                  for x in input("Enter source, destination, weight: ").strip().split(" ")
              )
              UpperCAmelCase  :						Optional[int]	=       {"src": src, "dst": dest, "weight": weight}

       UpperCAmelCase  :						Tuple	=       int(input("\nEnter shortest path source:").strip())
       UpperCAmelCase  :						Optional[int]	=       bellman_ford(graph, V, E, source)
       print_distance(shortest_distance, 0)








import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin






class 					__A    (    lowerCAmelCase ):

			'''simple docstring'''







			lowerCAmelCase_							     =						"""Speech2TextFeatureExtractor"""
			lowerCAmelCase_							     =						"""Speech2TextTokenizer"""





			def __init__(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase							):



				'''simple docstring'''







				super().__init__(__lowerCAmelCase       ,  __lowerCAmelCase							)
				lowerCamelCase__								=		self.feature_extractor
				lowerCamelCase__								=		False





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



				'''simple docstring'''







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

				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'''       ,  __lowerCAmelCase							)
				lowerCamelCase__								=		kwargs.pop('''sampling_rate'''       ,  __lowerCAmelCase							)
				lowerCamelCase__								=		kwargs.pop('''text'''       ,  __lowerCAmelCase							)
				if len(__lowerCAmelCase							) > 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(__lowerCAmelCase       ,  *__lowerCAmelCase       ,  sampling_rate=__lowerCAmelCase       ,  **__lowerCAmelCase							)
				if text is not None:
					lowerCamelCase__								=		self.tokenizer(__lowerCAmelCase       ,  **__lowerCAmelCase							)

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





			def 		__lowerCamelCase				(    self       ,  *__lowerCAmelCase       ,  **__lowerCAmelCase							):



				'''simple docstring'''







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





			def 		__lowerCamelCase				(    self       ,  *__lowerCAmelCase       ,  **__lowerCAmelCase							):



				'''simple docstring'''







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





			@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.'''							)
				lowerCamelCase__								=		True
				lowerCamelCase__								=		self.tokenizer
				yield
				lowerCamelCase__								=		self.feature_extractor
				lowerCamelCase__								=		False



