
'''simple docstring'''


snake_case_			:	List[str] 	=       [0, 2, 4, 6, 8]
snake_case_			:	Optional[int] 	=       [1, 3, 5, 7, 9]



def 			__snake_case  (     _UpperCAmelCase       :							int,   _UpperCAmelCase       :							int,   _UpperCAmelCase       :							list[int],   _UpperCAmelCase       :							int):
   if remaining_length == 0:
      if digits[0] == 0 or digits[-1] == 0:
         return 0

      for i in range(length // 2 - 1,   -1,   -1):
         remainder += digits[i] + digits[length - i - 1]

         if remainder % 2 == 0:
            return 0

         remainder //= 10

      return 1

   if remaining_length == 1:
      if remainder % 2 == 0:
         return 0

      UpperCamelCase	  =	0
      for digit in range(10):
         UpperCamelCase	  =	digit
         result += reversible_numbers(
             0,   (remainder + 2 * digit) // 10,   UpperCamelCase__,   UpperCamelCase__)
      return result

   UpperCamelCase	  =	0
   for digita in range(10):
      UpperCamelCase	  =	digita

      if (remainder + digita) % 2 == 0:
         UpperCamelCase	  =	ODD_DIGITS
      else:
         UpperCamelCase	  =	EVEN_DIGITS

      for digita in other_parity_digits:
         UpperCamelCase	  =	digita
         result += reversible_numbers(
             remaining_length - 2,   (remainder + digita + digita) // 10,   UpperCamelCase__,   UpperCamelCase__,   )
   return result



def 			__snake_case  (     _UpperCAmelCase       :							int = 9):
   UpperCamelCase	  =	0
   for length in range(1,   max_power + 1):
      result += reversible_numbers(UpperCamelCase__,   0,   [0] * length,   UpperCamelCase__)
   return result


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












import json
import os
import unittest

from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin




class        SCREAMING_SNAKE_CASE__					(		UpperCamelCase__							,   unittest.TestCase ):
 __SCREAMING_SNAKE_CASE							=      CTRLTokenizer
 __SCREAMING_SNAKE_CASE							=      False
 __SCREAMING_SNAKE_CASE							=      False



 def 							UpperCamelCase     (				self					):
        super().setUp()

        # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
        A__		   =		['''adapt''', '''re@@''', '''a@@''', '''apt''', '''c@@''', '''t''', '''<unk>''']
        A__		   =		dict(zip(__lowerCamelCase,range(len(__lowerCamelCase					)					)					)					)
        A__		   =		['''#version: 0.2''', '''a p''', '''ap t</w>''', '''r e''', '''a d''', '''ad apt</w>''', '''''']
        A__		   =		{'''unk_token''': '''<unk>'''}

        A__		   =		os.path.join(self.tmpdirname,VOCAB_FILES_NAMES['''vocab_file''']					)
        A__		   =		os.path.join(self.tmpdirname,VOCAB_FILES_NAMES['''merges_file''']					)
        with open(self.vocab_file,'''w''',encoding='''utf-8'''					) as fp:
               fp.write(json.dumps(__lowerCamelCase					) + '''\n'''					)
        with open(self.merges_file,'''w''',encoding='''utf-8'''					) as fp:
               fp.write('''\n'''.join(__lowerCamelCase					)					)



 def 							UpperCamelCase     (				self,**__lowerCamelCase					):
        kwargs.update(self.special_tokens_map					)
        return CTRLTokenizer.from_pretrained(self.tmpdirname,**__lowerCamelCase					)



 def 							UpperCamelCase     (				self,__lowerCamelCase					):
        A__		   =		'''adapt react readapt apt'''
        A__		   =		'''adapt react readapt apt'''
        return input_text, output_text




 def 							UpperCamelCase     (				self					):
        A__		   =		CTRLTokenizer(self.vocab_file,self.merges_file,**self.special_tokens_map					)
        A__		   =		'''adapt react readapt apt'''
        A__		   =		'''adapt re@@ a@@ c@@ t re@@ adapt apt'''.split()
        A__		   =		tokenizer.tokenize(__lowerCamelCase					)
        self.assertListEqual(__lowerCamelCase,__lowerCamelCase					)

        A__		   =		tokens + [tokenizer.unk_token]

        A__		   =		[0, 1, 2, 4, 5, 1, 0, 3, 6]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(__lowerCamelCase					),__lowerCamelCase					)





