

"""simple docstring"""






from __future__ import annotations





def 	lowercase      (   __UpperCamelCase      ,   __UpperCamelCase						) ->      Optional[int]:
 print(f'''Vertex\tShortest Distance from vertex {src}'''						)
 for i, d in enumerate(__UpperCamelCase						):
  print(f'''{i}\t\t{d}'''						)





def 	lowercase      (   __UpperCamelCase      ,   __UpperCamelCase      ,   __UpperCamelCase						) ->      Union[str, Any]:
 for j in range(__UpperCamelCase						):
  __magic_name__   ,						__magic_name__   ,						__magic_name__     =      (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 	lowercase      (   __UpperCamelCase      ,   __UpperCamelCase      ,   __UpperCamelCase      ,   __UpperCamelCase						) ->      list[float]:
 __magic_name__     =      [float('''inf'''						)] * vertex_count
 __magic_name__     =      0.0

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

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

 __magic_name__     =      check_negative_cycle(__UpperCamelCase      ,   __UpperCamelCase      ,   __UpperCamelCase						)
 if negative_cycle_exists:
  raise Exception('''Negative cycle found'''						)

 return distance


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 __lowerCamelCase										=		int(input("Enter number of vertices: ").strip())
 __lowerCamelCase										=		int(input("Enter number of edges: ").strip())

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

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

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




"""simple docstring"""






import os
import unittest

from transformers import FunnelTokenizer, FunnelTokenizerFast
from transformers.models.funnel.tokenization_funnel import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin
@require_tokenizers
class        _lowercase					(     __UpperCAmelCase   , unittest.TestCase     ):
     _lowerCamelCase     =       FunnelTokenizer
     _lowerCamelCase     =       FunnelTokenizerFast
     _lowerCamelCase     =       True
     _lowerCamelCase     =       True







     def 	lowerCAmelCase__    (      self       ):
      super().setUp()

      __magic_name__     =      [
          '''<unk>''',
          '''<cls>''',
          '''<sep>''',
          '''want''',
          '''##want''',
          '''##ed''',
          '''wa''',
          '''un''',
          '''runn''',
          '''##ing''',
          ''',''',
          '''low''',
          '''lowest''',
      ]
      __magic_name__     =      os.path.join(self.tmpdirname ,						VOCAB_FILES_NAMES['''vocab_file''']       )
      with open(self.vocab_file ,						'''w''' ,						encoding='''utf-8'''       ) as vocab_writer:
       vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]       )       )







     def 	lowerCAmelCase__    (      self ,						**UpperCamelCase_       ):
      return FunnelTokenizer.from_pretrained(self.tmpdirname ,						**UpperCamelCase_       )







     def 	lowerCAmelCase__    (      self ,						**UpperCamelCase_       ):
      return FunnelTokenizerFast.from_pretrained(self.tmpdirname ,						**UpperCamelCase_       )







     def 	lowerCAmelCase__    (      self ,						UpperCamelCase_       ):
      __magic_name__     =      '''UNwant\u00E9d,running'''
      __magic_name__     =      '''unwanted, running'''
      return input_text, output_text







     def 	lowerCAmelCase__    (      self       ):
      __magic_name__     =      self.tokenizer_class(self.vocab_file       )

      __magic_name__     =      tokenizer.tokenize('''UNwant\u00E9d,running'''       )
      self.assertListEqual(UpperCamelCase_ ,						['''un''', '''##want''', '''##ed''', ''',''', '''runn''', '''##ing''']       )
      self.assertListEqual(tokenizer.convert_tokens_to_ids(UpperCamelCase_       ) ,						[7, 4, 5, 10, 8, 9]       )







     def 	lowerCAmelCase__    (      self       ):
      __magic_name__     =      self.get_tokenizers(do_lower_case=UpperCamelCase_       )
      for tokenizer in tokenizers:
       __magic_name__     =      tokenizer('''UNwant\u00E9d,running'''       )
       __magic_name__     =      len(inputs['''input_ids''']       ) - 1
       self.assertListEqual(inputs['''token_type_ids'''] ,						[2] + [0] * sentence_len       )

       __magic_name__     =      tokenizer('''UNwant\u00E9d,running''' ,						'''UNwant\u00E9d,running'''       )
       self.assertListEqual(inputs['''token_type_ids'''] ,						[2] + [0] * sentence_len + [1] * sentence_len       )

