


from __future__ import annotations

def 						_UpperCAmelCase    (      SCREAMING_SNAKE_CASE__      : list[float]      ,					SCREAMING_SNAKE_CASE__      : Tuple    ):
     print(F'Vertex\tShortest Distance from vertex {src}'    )
     for i, d in enumerate(SCREAMING_SNAKE_CASE__    ):
          print(F'{i}\t\t{d}'    )

def 						_UpperCAmelCase    (      SCREAMING_SNAKE_CASE__      : list[dict[str, int]]      ,					SCREAMING_SNAKE_CASE__      : list[float]      ,					SCREAMING_SNAKE_CASE__      : int    ):
     for j in range(SCREAMING_SNAKE_CASE__    ):
          __UpperCamelCase							,				__UpperCamelCase							,				__UpperCamelCase   							=(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 						_UpperCAmelCase    (      SCREAMING_SNAKE_CASE__      : list[dict[str, int]]      ,					SCREAMING_SNAKE_CASE__      : int      ,					SCREAMING_SNAKE_CASE__      : int      ,					SCREAMING_SNAKE_CASE__      : int    ):
     __UpperCamelCase   							=[float('inf'    )] * vertex_count
     __UpperCamelCase   							=0.0

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

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

     __UpperCamelCase   							=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()

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

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

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

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









import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin






class    UpperCAmelCase__	( A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Optional[int]              =  "MCTCTFeatureExtractor"
    UpperCAmelCase__						:		str              =  "AutoTokenizer"






    def __init__(      self ,       A_ ,       A_   )  ->	Dict:
         super().__init__(A_ ,       A_   )
         __UpperCamelCase   							=self.feature_extractor
         __UpperCamelCase   							=False






    def __call__(      self ,       *A_ ,       **A_   )  ->	Optional[Any]:
         # For backward compatibility
         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.'   )
              __UpperCamelCase   							=kwargs.pop('raw_speech'   )
         else:
              __UpperCamelCase   							=kwargs.pop('audio' ,       A_   )
         __UpperCamelCase   							=kwargs.pop('sampling_rate' ,       A_   )
         __UpperCamelCase   							=kwargs.pop('text' ,       A_   )
         if len(A_   ) > 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(A_ ,       *A_ ,       sampling_rate=A_ ,       **A_   )
         if text is not None:
              __UpperCamelCase   							=self.tokenizer(A_ ,       **A_   )

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






    def _a (      self ,       *A_ ,       **A_   )  ->	str:
         return self.tokenizer.batch_decode(*A_ ,       **A_   )






    def _a (      self ,       *A_ ,       **A_   )  ->	List[Any]:
         # For backward compatibility
         if self._in_target_context_manager:
              return self.current_processor.pad(*A_ ,       **A_   )

         __UpperCamelCase   							=kwargs.pop('input_features' ,       A_   )
         __UpperCamelCase   							=kwargs.pop('labels' ,       A_   )
         if len(A_   ) > 0:
              __UpperCamelCase   							=args[0]
              __UpperCamelCase   							=args[1:]

         if input_features is not None:
              __UpperCamelCase   							=self.feature_extractor.pad(A_ ,       *A_ ,       **A_   )
         if labels is not None:
              __UpperCamelCase   							=self.tokenizer.pad(A_ ,       **A_   )

         if labels is None:
              return input_features
         elif input_features is None:
              return labels
         else:
              __UpperCamelCase   							=labels['input_ids']
              return input_features






    def _a (      self ,       *A_ ,       **A_   )  ->	Optional[int]:
         return self.tokenizer.decode(*A_ ,       **A_   )






    @contextmanager
    def _a (      self   )  ->	str:
         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   							=True
         __UpperCamelCase   							=self.tokenizer
         yield
         __UpperCamelCase   							=self.feature_extractor
         __UpperCamelCase   							=False





