


"""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"""




    UpperCAmelCase	:							int     =	DebertaVaTokenizer
    UpperCAmelCase	:							str     =	DebertaVaTokenizerFast
    UpperCAmelCase	:							str     =	True
    UpperCAmelCase	:							Tuple     =	True






    def      __snake_case							( self    :   Tuple):
      super().setUp()

      # We have a SentencePiece fixture for testing
      a						:		Dict											=      DebertaVaTokenizer(__UpperCAmelCase    ,			unk_token="<unk>")
      tokenizer.save_pretrained(self.tmpdirname)






    def      __snake_case							( self    :   Optional[Any]    ,			__UpperCAmelCase    :   str):
      a						:		Union[str, Any]											=      "this is a test"
      a						:		List[Any]											=      "this is a test"
      return input_text, output_text






    def      __snake_case							( self    :   List[str]):
      a						:		str											=      "<pad>"
      a						:		Tuple											=      0

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






    def      __snake_case							( self    :   Optional[int]):
      a						:		List[str]											=      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(__UpperCAmelCase)    ,			30001)






    def      __snake_case							( self    :   Dict):
      self.assertEqual(self.get_tokenizer().vocab_size    ,			30000)






    def      __snake_case							( self    :   Optional[Any]):
      # fmt: off
      a						:		Optional[Any]											=      " \tHeLLo!how  \n Are yoU?  "
      a						:		Dict											=      ["▁hello", "!", "how", "▁are", "▁you", "?"]
      # fmt: on

      a						:		List[Any]											=      DebertaVaTokenizer(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase)
      a						:		Optional[int]											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Union[str, Any]											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase)
      a						:		Tuple											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    @unittest.skip("There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.")
    def      __snake_case							( self    :   Any):
      pass






    @unittest.skip("There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.")
    def      __snake_case							( self    :   Union[str, Any]):
      pass






    def      __snake_case							( self    :   Optional[int]):
      # fmt: off
      a						:		int											=      "I was born in 92000, and this is falsé."
      a						:		List[str]											=      ["▁", "<unk>", "▁was", "▁born", "▁in", "▁9", "2000", "▁", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", "▁", ".", ]
      # fmt: on

      a						:		int											=      DebertaVaTokenizer(__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		int											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Dict											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Optional[int]											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   int):
      # fmt: off
      a						:		Dict											=      "I was born in 92000, and this is falsé."
      a						:		List[str]											=      ["▁i", "▁was", "▁born", "▁in", "▁9", "2000", "▁", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", "▁", ".", ]
      # fmt: on

      a						:		Union[str, Any]											=      DebertaVaTokenizer(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		List[str]											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Tuple											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Union[str, Any]											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   Union[str, Any]):
      # fmt: off
      a						:		Optional[Any]											=      "I was born in 92000, and this is falsé."
      a						:		Optional[int]											=      ["▁i", "▁was", "▁born", "▁in", "▁9", "2000", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", ".", ]
      # fmt: on

      a						:		Tuple											=      DebertaVaTokenizer(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Any											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		str											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Optional[Any]											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   Union[str, Any]):
      # fmt: off
      a						:		str											=      "I was born in 92000, and this is falsé."
      a						:		Optional[int]											=      ["▁", "<unk>", "▁was", "▁born", "▁in", "▁9", "2000", "▁", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", "▁", ".", ]
      # fmt: on

      a						:		List[Any]											=      DebertaVaTokenizer(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		str											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		str											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		List[Any]											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   Optional[int]):
      # fmt: off
      a						:		Union[str, Any]											=      " \tHeLLo!how  \n Are yoU?  "
      a						:		Tuple											=      ["▁", "<unk>", "e", "<unk>", "o", "!", "how", "▁", "<unk>", "re", "▁yo", "<unk>", "?"]
      # fmt: on

      a						:		List[Any]											=      DebertaVaTokenizer(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Optional[int]											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Optional[int]											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			do_lower_case=__UpperCAmelCase    ,			split_by_punct=__UpperCAmelCase)
      a						:		Tuple											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))

      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   int):
      a						:		Optional[Any]											=      self.get_tokenizer()
      a						:		Optional[int]											=      self.get_rust_tokenizer()

      a						:		Dict											=      "I was born in 92000, and this is falsé."

      a						:		Any											=      tokenizer.convert_ids_to_tokens(tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))
      a						:		Union[str, Any]											=      rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase))
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Any											=      tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      a						:		Dict											=      rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Optional[int]											=      self.get_rust_tokenizer()
      a						:		List[str]											=      tokenizer.encode(__UpperCAmelCase)
      a						:		int											=      rust_tokenizer.encode(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   Dict):
      a						:		Dict											=      "This is a test"
      a						:		str											=      [13, 1, 4398, 25, 21, 1289]
      a						:		Optional[int]											=      ["▁", "T", "his", "▁is", "▁a", "▁test"]
      a						:		List[str]											=      ["▁", "<unk>", "his", "▁is", "▁a", "▁test"]

      a						:		str											=      DebertaVaTokenizer(__UpperCAmelCase    ,			keep_accents=__UpperCAmelCase)
      a						:		int											=      DebertaVaTokenizerFast(__UpperCAmelCase    ,			keep_accents=__UpperCAmelCase)

      a						:		Tuple											=      tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		List[Any]											=      tokenizer.tokenize(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		Dict											=      tokenizer.convert_ids_to_tokens(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		str											=      rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		Any											=      rust_tokenizer.tokenize(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		int											=      rust_tokenizer.convert_ids_to_tokens(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      # fmt: off
      a						:		Dict											=      "I was born in 92000, and this is falsé."
      a						:		str											=      [13, 1, 23, 386, 19, 561, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]
      a						:		Tuple											=      ["▁", "I", "▁was", "▁born", "▁in", "▁9", "2000", ",", "▁and", "▁this", "▁is", "▁fal", "s", "é", ".", ]
      a						:		List[str]											=      ["▁", "<unk>", "▁was", "▁born", "▁in", "▁9", "2000", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", ".", ]
      # fmt: on

      a						:		Optional[Any]											=      tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		Dict											=      tokenizer.tokenize(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		Tuple											=      tokenizer.convert_ids_to_tokens(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)

      a						:		Optional[int]											=      rust_tokenizer.encode(__UpperCAmelCase    ,			add_special_tokens=__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		List[str]											=      rust_tokenizer.tokenize(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)
      a						:		Dict											=      rust_tokenizer.convert_ids_to_tokens(__UpperCAmelCase)
      self.assertListEqual(__UpperCAmelCase    ,			__UpperCAmelCase)






    def      __snake_case							( self    :   List[str]):
      a						:		Dict											=      DebertaVaTokenizer(__UpperCAmelCase)

      a						:		Union[str, Any]											=      tokenizer.encode("sequence builders")
      a						:		Any											=      tokenizer.encode("multi-sequence build")

      a						:		str											=      tokenizer.build_inputs_with_special_tokens(__UpperCAmelCase)
      a						:		Any											=      tokenizer.build_inputs_with_special_tokens(__UpperCAmelCase    ,			__UpperCAmelCase)

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






    @slow
    def      __snake_case							( self    :   str):
      # fmt: off
      a						:		int											=      {"input_ids": [[1, 39867, 36, 19390, 486, 27, 35052, 81436, 18, 60685, 1225, 7, 35052, 81436, 18, 9367, 16899, 18, 15937, 53, 594, 773, 18, 16287, 30465, 36, 15937, 6, 41139, 38, 36979, 60763, 191, 6, 34132, 99, 6, 50538, 390, 43230, 6, 34132, 2779, 20850, 14, 699, 1072, 1194, 36, 382, 10901, 53, 7, 699, 1072, 2084, 36, 20422, 630, 53, 19, 105, 3049, 1896, 1053, 16899, 1506, 11, 37978, 4243, 7, 1237, 31869, 200, 16566, 654, 6, 35052, 81436, 7, 55630, 13593, 4, 2], [1, 26, 15011, 13, 667, 8, 1053, 18, 23611, 1237, 72356, 12820, 34, 104134, 1209, 35, 13313, 6627, 21, 202, 347, 7, 164, 2399, 11, 46, 4485, 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, 1232, 2864, 15785,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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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=__UpperCAmelCase    ,			model_name="microsoft/deberta-v2-xlarge"    ,			revision="ad6e42c1532ddf3a15c39246b63f5559d558b670"    ,			)










"""simple docstring"""







import sys
import turtle


def 					lowercase      (    A_  ,       A_	)->				tuple[float, float]:
  '''simple docstring'''







  return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2


def 					lowercase      (    A_  ,       A_  ,       A_  ,       A_  ,       )->				None:
  '''simple docstring'''







  my_pen.up()
  my_pen.goto(vertexa[0]  ,       vertexa[1]	)
  my_pen.down()
  my_pen.goto(vertexa[0]  ,       vertexa[1]	)
  my_pen.goto(vertexa[0]  ,       vertexa[1]	)
  my_pen.goto(vertexa[0]  ,       vertexa[1]	)

  if depth == 0:
    return

  triangle(A_  ,       get_mid(A_  ,       A_	)  ,       get_mid(A_  ,       A_	)  ,       depth - 1	)
  triangle(A_  ,       get_mid(A_  ,       A_	)  ,       get_mid(A_  ,       A_	)  ,       depth - 1	)
  triangle(A_  ,       get_mid(A_  ,       A_	)  ,       get_mid(A_  ,       A_	)  ,       depth - 1	)


if __name__ == "__main__":
 if len(sys.argv) != 2:
  raise ValueError(
      """Correct format for using this script: """
      """python fractals.py <int:depth_for_fractal>"""
  )
 __lowercase    =				turtle.Turtle()
 my_pen.ht()
 my_pen.speed(5)
 my_pen.pencolor("""red""")

 __lowercase    =				[(-175, -125), (0, 175), (175, -125)]  # vertices of triangle
 triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))






