




import unittest
import warnings
from dataclasses import dataclass

from transformers.convert_slow_tokenizer import SpmConverter
from transformers.testing_utils import get_tests_dir



@dataclass
class 			a     :

     '''simple docstring'''





     lowerCAmelCase				:       str



class 			a     (   unittest.TestCase			):

     '''simple docstring'''





     def   lowerCamelCase_   (	self   :			Tuple				):
         UpperCAmelCase_							 =     get_tests_dir('''fixtures/test_sentencepiece.model'''				)
         UpperCAmelCase_							 =     get_tests_dir('''fixtures/test_sentencepiece_with_bytefallback.model'''				)

         UpperCAmelCase_							 =     FakeOriginalTokenizer(vocab_file=__snake_case				)

         with warnings.catch_warnings(record=__snake_case				) as w:
             UpperCAmelCase_							 =     SpmConverter(__snake_case				)
         self.assertEqual(len(__snake_case				)					,    0				)

         UpperCAmelCase_							 =     FakeOriginalTokenizer(vocab_file=__snake_case				)

         with warnings.catch_warnings(record=__snake_case				) as w:
             UpperCAmelCase_							 =     SpmConverter(__snake_case				)
         self.assertEqual(len(__snake_case				)					,    1				)

         self.assertIn(
             '''The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option'''
             ''' which is not implemented in the fast tokenizers.'''					,    str(w[0].message				)					,    )











def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						str      )  ->							int:
    UpperCAmelCase_							 =     5381
    for x in s:
        UpperCAmelCase_							 =     ((hash_value << 5) + hash_value) + ord(__UpperCamelCase      )
    return hash_value & 0xffff_ffff





