






"""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      UpperCamelCase_			(__A							,		unittest.TestCase	):
	__magic_name__       =							FunnelTokenizer
	__magic_name__       =							FunnelTokenizerFast
	__magic_name__       =							True
	__magic_name__       =							True





	def 	_SCREAMING_SNAKE_CASE ( self   :					str		)		->     str:
				super().setUp()

				UpperCAmelCase_	:					Optional[int]     	=   [
				    "<unk>",
				    "<cls>",
				    "<sep>",
				    "want",
				    "##want",
				    "##ed",
				    "wa",
				    "un",
				    "runn",
				    "##ing",
				    ",",
				    "low",
				    "lowest",
				]
				UpperCAmelCase_	:					List[Any]     	=   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 	_SCREAMING_SNAKE_CASE ( self   :					Dict      ,      **lowerCAmelCase_   :					List[Any]		)		->     Any:
				return FunnelTokenizer.from_pretrained(self.tmpdirname      ,      **lowerCAmelCase_		)





	def 	_SCREAMING_SNAKE_CASE ( self   :					int      ,      **lowerCAmelCase_   :					Any		)		->     Dict:
				return FunnelTokenizerFast.from_pretrained(self.tmpdirname      ,      **lowerCAmelCase_		)





	def 	_SCREAMING_SNAKE_CASE ( self   :					Optional[int]      ,      lowerCAmelCase_   :					str		)		->     Dict:
				UpperCAmelCase_	:					Union[str, Any]     	=   "UNwant\u00E9d,running"
				UpperCAmelCase_	:					Optional[Any]     	=   "unwanted, running"
				return input_text, output_text





	def 	_SCREAMING_SNAKE_CASE ( self   :					str		)		->     List[str]:
				UpperCAmelCase_	:					str     	=   self.tokenizer_class(self.vocab_file		)

				UpperCAmelCase_	:					List[str]     	=   tokenizer.tokenize("UNwant\u00E9d,running"		)
				self.assertListEqual(lowerCAmelCase_      ,      ["un", "##want", "##ed", ",", "runn", "##ing"]		)
				self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase_		)      ,      [7, 4, 5, 10, 8, 9]		)





	def 	_SCREAMING_SNAKE_CASE ( self   :					Optional[Any]		)		->     Tuple:
				UpperCAmelCase_	:					List[Any]     	=   self.get_tokenizers(do_lower_case=lowerCAmelCase_		)
				for tokenizer in tokenizers:
							UpperCAmelCase_	:					Union[str, Any]     	=   tokenizer("UNwant\u00E9d,running"		)
							UpperCAmelCase_	:					List[Any]     	=   len(inputs["input_ids"]		) - 1
							self.assertListEqual(inputs["token_type_ids"]      ,      [2] + [0] * sentence_len		)

							UpperCAmelCase_	:					Union[str, Any]     	=   tokenizer("UNwant\u00E9d,running"      ,      "UNwant\u00E9d,running"		)
							self.assertListEqual(inputs["token_type_ids"]      ,      [2] + [0] * sentence_len + [1] * sentence_len		)







"""simple docstring"""


def    _lowerCamelCase   (     lowerCamelCase__	:							str  ):
 assert column_title.isupper()
 lowercase__       :       int				=						0
 lowercase__       :       Optional[int]				=						len(lowerCamelCase__  ) - 1
 lowercase__       :       int				=						0

 while index >= 0:
  lowercase__       :       List[str]				=						(ord(column_title[index]  ) - 64) * pow(26       ,		lowerCamelCase__  )
  answer += value
  power += 1
  index -= 1

 return answer


if __name__ == "__main__":
   from doctest import testmod

   testmod()