



"""simple docstring"""






import os
import unittest

from transformers.models.cpmant.tokenization_cpmant import VOCAB_FILES_NAMES, CpmAntTokenizer
from transformers.testing_utils import require_jieba, tooslow

from ...test_tokenization_common import TokenizerTesterMixin

@require_jieba
class  __SCREAMING_SNAKE_CASE			(   lowerCAmelCase_	,     unittest.TestCase     ):


					'''simple docstring'''





					_a         =							CpmAntTokenizer
					_a         =							False



					def 	snake_case ( self							:						List[Any]  )->      Union[str, Any]:
								super().setUp()

								lowerCamelCase__	:	Optional[int]				=[
								    '''<d>''',
								    '''</d>''',
								    '''<s>''',
								    '''</s>''',
								    '''</_>''',
								    '''<unk>''',
								    '''<pad>''',
								    '''</n>''',
								    '''我''',
								    '''是''',
								    '''C''',
								    '''P''',
								    '''M''',
								    '''A''',
								    '''n''',
								    '''t''',
								]
								lowerCamelCase__	:	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]  )  )




					@tooslow
					def 	snake_case ( self							:						Tuple  )->      Optional[Any]:
								lowerCamelCase__	:	Optional[int]				=CpmAntTokenizer.from_pretrained('''openbmb/cpm-ant-10b'''  )
								lowerCamelCase__	:	Dict				='''今天天气真好！'''
								lowerCamelCase__	:	Dict				=['''今天''', '''天气''', '''真''', '''好''', '''！''']
								lowerCamelCase__	:	List[str]				=tokenizer.tokenize(lowerCamelCase  )
								self.assertListEqual(lowerCamelCase,						lowerCamelCase  )
								lowerCamelCase__	:	Any				='''今天天气真好！'''
								lowerCamelCase__	:	int				=[tokenizer.bos_token] + tokens

								lowerCamelCase__	:	Dict				=[6, 9802, 1_4962, 2082, 831, 244]
								self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCamelCase  ),						lowerCamelCase  )

								lowerCamelCase__	:	str				=tokenizer.decode(lowerCamelCase  )
								self.assertEqual(lowerCamelCase,						lowerCamelCase  )









"""simple docstring"""






def   snake_case__     (	__lowerCamelCase       :					int = 10							,	__lowerCamelCase       :					int = 22			):
			"""simple docstring"""
			lowerCamelCase__	:	Optional[Any]				=range(1							,	__lowerCamelCase			)
			lowerCamelCase__	:	str				=range(1							,	__lowerCamelCase			)
			return sum(
			    1 for power in powers for base in bases if len(str(base**power			)			) == power			)


if __name__ == "__main__":
		print(f'{solution(1_0, 2_2) = }')




