"""simple docstring"""






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 							snake_case			:




					"""simple docstring"""

					snake_case__							       =					42






class 							snake_case			(					unittest.TestCase							):




					"""simple docstring"""

					def 						__lowerCAmelCase		(							self  :      Optional[int]     ):
									UpperCAmelCase__			 =				get_tests_dir('fixtures/test_sentencepiece.model'     )
									UpperCAmelCase__			 =				get_tests_dir('fixtures/test_sentencepiece_with_bytefallback.model'     )

									UpperCAmelCase__			 =				FakeOriginalTokenizer(vocab_file=_A     )

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

									UpperCAmelCase__			 =				FakeOriginalTokenizer(vocab_file=_A     )

									with warnings.catch_warnings(record=_A     ) as w:
													UpperCAmelCase__			 =				SpmConverter(_A     )
									self.assertEqual(len(_A     )       ,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     )       ,)





_A       =					{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 24,
    "5": 1_20,
    "6": 7_20,
    "7": 50_40,
    "8": 4_03_20,
    "9": 36_28_80,
}

_A       =					{1_45: 1_45}

_A       =					{
    1_45: 0,
    1_69: 3,
    3_63_01: 3,
    14_54: 3,
    8_71: 2,
    4_53_61: 2,
    8_72: 2,
}



def 		lowercase_     (  A__						)				->				int:
    """simple docstring"""

    if n in CACHE_SUM_DIGIT_FACTORIALS:
        return CACHE_SUM_DIGIT_FACTORIALS[n]
    snake_case						=   sum(DIGIT_FACTORIALS[let] for let in str(A__						)						)
    snake_case						=   ret
    return ret



def 		lowercase_     (  A__					,						A__ = None						)				->				int:
    """simple docstring"""

    snake_case						=   previous or set()
    if n in CHAIN_LENGTH_CACHE:
        return CHAIN_LENGTH_CACHE[n]
    snake_case						=   sum_digit_factorials(A__						)
    if next_number in previous:
        snake_case						=   0
        return 0
    else:
        previous.add(A__						)
        snake_case						=   1 + chain_length(A__					,						A__						)
        snake_case						=   ret
        return ret



def 		lowercase_     (  A__ = 60					,						A__ = 100_0000						)				->				int:
    """simple docstring"""

    return sum(1 for i in range(1					,						A__						) if chain_length(A__						) == num_terms						)


if __name__ == "__main__":
   print(f"{solution() = }")

