



'''simple docstring'''





import unittest

from transformers import DebertaVaTokenizer, DebertaVaTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


lowercase_		       =  get_tests_dir("fixtures/spiece.model")






@require_sentencepiece
@require_tokenizers
class __A			(  A   ,   unittest.TestCase						):



 '''simple docstring'''







 __lowerCamelCase    :       str          =       DebertaVaTokenizer
 __lowerCamelCase    :       Union[str, Any]          =       DebertaVaTokenizerFast
 __lowerCamelCase    :       Union[str, Any]          =       True
 __lowerCamelCase    :       List[str]          =       True



 def 					a__  (self       )    ->     Optional[int]:


      """simple docstring"""



      super().setUp()

      # We have a SentencePiece fixture for testing
      _a      =  DebertaVaTokenizer(A ,   unk_token='''<unk>'''       )
      tokenizer.save_pretrained(self.tmpdirname       )



 def 					a__  (self ,   A       )    ->     Tuple:


      """simple docstring"""



      _a      =  '''this is a test'''
      _a      =  '''this is a test'''
      return input_text, output_text



 def 					a__  (self       )    ->     Union[str, Any]:


      """simple docstring"""



      _a      =  '''<pad>'''
      _a      =  0

      self.assertEqual(self.get_tokenizer()._convert_token_to_id(A       ) ,   A       )
      self.assertEqual(self.get_tokenizer()._convert_id_to_token(A       ) ,   A       )



 def 					a__  (self       )    ->     int:


      """simple docstring"""



      _a      =  list(self.get_tokenizer().get_vocab().keys()       )
      self.assertEqual(vocab_keys[0] ,   '''<pad>'''       )
      self.assertEqual(vocab_keys[1] ,   '''<unk>'''       )
      self.assertEqual(vocab_keys[-1] ,   '''[PAD]'''       )
      self.assertEqual(len(A       ) ,   30_001       )



 def 					a__  (self       )    ->     Optional[int]:


      """simple docstring"""



      self.assertEqual(self.get_tokenizer().vocab_size ,   30_000       )



 def 					a__  (self       )    ->     Optional[int]:


      """simple docstring"""



      _a      =  ''' \tHeLLo!how  \n Are yoU?  '''
      _a      =  ['''▁hello''', '''!''', '''how''', '''▁are''', '''▁you''', '''?''']
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   do_lower_case=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   do_lower_case=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )



 @unittest.skip('''There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.'''       )
 def 					a__  (self       )    ->     Dict:


      """simple docstring"""



      pass



 @unittest.skip('''There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.'''       )
 def 					a__  (self       )    ->     int:


      """simple docstring"""



      pass



 def 					a__  (self       )    ->     List[str]:


      """simple docstring"""



      _a      =  '''I was born in 92000, and this is falsé.'''
      _a      =  ['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   split_by_punct=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   split_by_punct=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     List[str]:


      """simple docstring"""



      _a      =  '''I was born in 92000, and this is falsé.'''
      _a      =  ['''▁i''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )
      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )
      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     Any:


      """simple docstring"""



      _a      =  '''I was born in 92000, and this is falsé.'''
      _a      =  ['''▁i''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''.''', ]
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     Optional[Any]:


      """simple docstring"""



      _a      =  '''I was born in 92000, and this is falsé.'''
      _a      =  ['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     int:


      """simple docstring"""



      _a      =  ''' \tHeLLo!how  \n Are yoU?  '''
      _a      =  ['''▁''', '''<unk>''', '''e''', '''<unk>''', '''o''', '''!''', '''how''', '''▁''', '''<unk>''', '''re''', '''▁yo''', '''<unk>''', '''?''']
      # fmt: on

      _a      =  DebertaVaTokenizer(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )

      _a      =  DebertaVaTokenizerFast(A ,   do_lower_case=A ,   split_by_punct=A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )

      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     List[str]:


      """simple docstring"""



      _a      =  self.get_tokenizer()
      _a      =  self.get_rust_tokenizer()

      _a      =  '''I was born in 92000, and this is falsé.'''

      _a      =  tokenizer.convert_ids_to_tokens(tokenizer.encode(A ,   add_special_tokens=A       )       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(A ,   add_special_tokens=A       )       )
      self.assertListEqual(A ,   A       )

      _a      =  tokenizer.encode(A ,   add_special_tokens=A       )
      _a      =  rust_tokenizer.encode(A ,   add_special_tokens=A       )
      self.assertListEqual(A ,   A       )

      _a      =  self.get_rust_tokenizer()
      _a      =  tokenizer.encode(A       )
      _a      =  rust_tokenizer.encode(A       )
      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     Tuple:


      """simple docstring"""



      _a      =  '''This is a test'''
      _a      =  [13, 1, 4_398, 25, 21, 1_289]
      _a      =  ['''▁''', '''T''', '''his''', '''▁is''', '''▁a''', '''▁test''']
      _a      =  ['''▁''', '''<unk>''', '''his''', '''▁is''', '''▁a''', '''▁test''']

      _a      =  DebertaVaTokenizer(A ,   keep_accents=A       )
      _a      =  DebertaVaTokenizerFast(A ,   keep_accents=A       )

      _a      =  tokenizer.encode(A ,   add_special_tokens=A       )
      self.assertListEqual(A ,   A       )
      _a      =  tokenizer.tokenize(A       )
      self.assertListEqual(A ,   A       )
      _a      =  tokenizer.convert_ids_to_tokens(A       )
      self.assertListEqual(A ,   A       )

      _a      =  rust_tokenizer.encode(A ,   add_special_tokens=A       )
      self.assertListEqual(A ,   A       )
      _a      =  rust_tokenizer.tokenize(A       )
      self.assertListEqual(A ,   A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(A       )
      self.assertListEqual(A ,   A       )

      # fmt: off
      _a      =  '''I was born in 92000, and this is falsé.'''
      _a      =  [13, 1, 23, 386, 19, 561, 3_050, 15, 17, 48, 25, 8_256, 18, 1, 9]
      _a      =  ['''▁''', '''I''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''é''', '''.''', ]
      _a      =  ['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''.''', ]
      # fmt: on

      _a      =  tokenizer.encode(A ,   add_special_tokens=A       )
      self.assertListEqual(A ,   A       )
      _a      =  tokenizer.tokenize(A       )
      self.assertListEqual(A ,   A       )
      _a      =  tokenizer.convert_ids_to_tokens(A       )
      self.assertListEqual(A ,   A       )

      _a      =  rust_tokenizer.encode(A ,   add_special_tokens=A       )
      self.assertListEqual(A ,   A       )
      _a      =  rust_tokenizer.tokenize(A       )
      self.assertListEqual(A ,   A       )
      _a      =  rust_tokenizer.convert_ids_to_tokens(A       )
      self.assertListEqual(A ,   A       )



 def 					a__  (self       )    ->     Optional[int]:


      """simple docstring"""



      _a      =  DebertaVaTokenizer(A       )

      _a      =  tokenizer.encode('''sequence builders'''       )
      _a      =  tokenizer.encode('''multi-sequence build'''       )

      _a      =  tokenizer.build_inputs_with_special_tokens(A       )
      _a      =  tokenizer.build_inputs_with_special_tokens(A ,   A       )

      self.assertEqual([tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] ,   A       )
      self.assertEqual(
          [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [tokenizer.sep_token_id] ,   A ,   )



 @slow
 def 					a__  (self       )    ->     int:


      """simple docstring"""



      _a      =  {'''input_ids''': [[1, 39_867, 36, 19_390, 486, 27, 35_052, 81_436, 18, 60_685, 1_225, 7, 35_052, 81_436, 18, 9_367, 16_899, 18, 15_937, 53, 594, 773, 18, 16_287, 30_465, 36, 15_937, 6, 41_139, 38, 36_979, 60_763, 191, 6, 34_132, 99, 6, 50_538, 390, 43_230, 6, 34_132, 2_779, 20_850, 14, 699, 1_072, 1_194, 36, 382, 10_901, 53, 7, 699, 1_072, 2_084, 36, 20_422, 630, 53, 19, 105, 3_049, 1_896, 1_053, 16_899, 1_506, 11, 37_978, 4_243, 7, 1_237, 31_869, 200, 16_566, 654, 6, 35_052, 81_436, 7, 55_630, 13_593, 4, 2], [1, 26, 15_011, 13, 667, 8, 1_053, 18, 23_611, 1_237, 72_356, 12_820, 34, 104_134, 1_209, 35, 13_313, 6_627, 21, 202, 347, 7, 164, 2_399, 11, 46, 4_485, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 5, 1_232, 2_864, 15_785, 14_951, 105, 5, 8_581, 1_250, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], '''token_type_ids''': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}  # noqa: E501
      # fmt: on

      self.tokenizer_integration_test_util(
          expected_encoding=A ,   model_name='''microsoft/deberta-v2-xlarge''' ,   revision='''ad6e42c1532ddf3a15c39246b63f5559d558b670''' ,   )








'''simple docstring'''





import math






class __A			:



 '''simple docstring'''







 def __init__(self ,   A=0       )    ->     Dict:  # a graph with Node 0,1,...,N-1


      """simple docstring"""



      _a      =  n
      _a      =  [
          [math.inf for j in range(0 ,   A       )] for i in range(0 ,   A       )
      ]  # adjacency matrix for weight
      _a      =  [
          [math.inf for j in range(0 ,   A       )] for i in range(0 ,   A       )
      ]  # dp[i][j] stores minimum distance from i to j



 def 					a__  (self ,   A ,   A ,   A       )    ->     Tuple:


      """simple docstring"""



      _a      =  w



 def 					a__  (self       )    ->     List[Any]:


      """simple docstring"""



      for k in range(0 ,   self.n       ):
           for i in range(0 ,   self.n       ):
                for j in range(0 ,   self.n       ):
                     _a      =  min(self.dp[i][j] ,   self.dp[i][k] + self.dp[k][j]       )



 def 					a__  (self ,   A ,   A       )    ->     str:


      """simple docstring"""



      return self.dp[u][v]


if __name__ == "__main__":
  lowercase_		       =  Graph(5)
  graph.add_edge(0, 2, 9)
  graph.add_edge(0, 4, 10)
  graph.add_edge(1, 3, 5)
  graph.add_edge(2, 3, 7)
  graph.add_edge(3, 0, 10)
  graph.add_edge(3, 1, 2)
  graph.add_edge(3, 2, 1)
  graph.add_edge(3, 4, 6)
  graph.add_edge(4, 1, 3)
  graph.add_edge(4, 2, 4)
  graph.add_edge(4, 3, 9)
  graph.floyd_warshall()
  graph.show_min(1, 4)
  graph.show_min(0, 3)



