

from ...processing_utils import ProcessorMixin





class A__    ( A ):



 """simple docstring"""







 _lowercase     :					Optional[int]      =						'''WhisperFeatureExtractor'''
 _lowercase     :					List[str]      =						'''WhisperTokenizer'''

 def __init__(		self :	Optional[Any]     ,						A_ :	Dict     ,						A_ :	Any       ):






      '''simple docstring'''




      super().__init__(A_     ,						A_       )
      _lowerCAmelCase   :					Optional[Any]        =    self.feature_extractor
      _lowerCAmelCase   :					Tuple        =    False

 def    __magic_name__       (		self :	int     ,						A_ :	Union[str, Any]=None     ,						A_ :	Optional[int]=None     ,						A_ :	str=True       ):






      '''simple docstring'''




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

 def __call__(		self :	List[Any]     ,						*A_ :	List[Any]     ,						**A_ :	List[str]       ):






      '''simple docstring'''




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

      _lowerCAmelCase   :					Union[str, Any]        =    kwargs.pop("audio"     ,						A_       )
      _lowerCAmelCase   :					int        =    kwargs.pop("sampling_rate"     ,						A_       )
      _lowerCAmelCase   :					Optional[Any]        =    kwargs.pop("text"     ,						A_       )
      if len(A_       ) > 0:
           _lowerCAmelCase   :					List[Any]        =    args[0]
           _lowerCAmelCase   :					Optional[Any]        =    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   :					str        =    self.feature_extractor(A_     ,						*A_     ,						sampling_rate=A_     ,						**A_       )
      if text is not None:
           _lowerCAmelCase   :					Tuple        =    self.tokenizer(A_     ,						**A_       )

      if text is None:
           return inputs

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

 def    __magic_name__       (		self :	Tuple     ,						*A_ :	str     ,						**A_ :	Tuple       ):






      '''simple docstring'''




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

 def    __magic_name__       (		self :	Tuple     ,						*A_ :	List[Any]     ,						**A_ :	Optional[int]       ):






      '''simple docstring'''




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


 def    __magic_name__       (		self :	Dict     ,						A_ :	str     ,						A_ :	List[Any]="np"       ):






      '''simple docstring'''




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









from __future__ import annotations







def 	_snake_case		(    SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE				)       ->      List[Any]:

     """simple docstring"""







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







def 	_snake_case		(    SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE				)       ->      Tuple:

     """simple docstring"""







     for j in range(SCREAMING_SNAKE_CASE				):
          _lowerCAmelCase      ,			_lowerCAmelCase      ,			_lowerCAmelCase   :					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 	_snake_case		(    SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE				)       ->      list[float]:

     """simple docstring"""







     _lowerCAmelCase   :					Tuple        =    [float("inf"				)] * vertex_count
     _lowerCAmelCase   :					int        =    0.0

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

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

     _lowerCAmelCase   :					int        =    check_negative_cycle(SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE		,							SCREAMING_SNAKE_CASE				)
     if negative_cycle_exists:
          raise Exception("Negative cycle found"				)

     return distance


if __name__ == "__main__":
  import doctest

  doctest.testmod()

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

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

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

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






