"""simple docstring"""


import json
import os
import unittest

from transformers.models.gpt_neox_japanese.tokenization_gpt_neox_japanese import (
    VOCAB_FILES_NAMES,
    GPTNeoXJapaneseTokenizer,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin




@require_tokenizers
class 					UpperCamelCase   (							lowerCAmelCase__       ,						unittest.TestCase  ):
       SCREAMING_SNAKE_CASE_						      = GPTNeoXJapaneseTokenizer
       SCREAMING_SNAKE_CASE_						      = False
       SCREAMING_SNAKE_CASE_						      = {"do_clean_text": False, "add_prefix_space": False}







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

            snake_case_   			=   [
                'こん',
                'こんに',
                'にちは',
                'ばんは',
                '世界,㔺界',
                '、',
                '。',
                '<BR>',
                '<SP>',
                '<TAB>',
                '<URL>',
                '<EMAIL>',
                '<TEL>',
                '<DATE>',
                '<PRICE>',
                '<BLOCK>',
                '<KIGOU>',
                '<U2000U2BFF>',
                '<|emoji1|>',
                '<unk>',
                '<|startoftext|>',
                '<|endoftext|>',
            ]
            snake_case_   			=   {'emoji': {'\ud83d\ude00': '<|emoji1|>'}, 'emoji_inv': {'<|emoji1|>': '\ud83d\ude00'}}  # 😀
            snake_case_   			=   {'unk_token': '<unk>'}

            snake_case_   			=   os.path.join(self.tmpdirname,				VOCAB_FILES_NAMES['vocab_file'])
            snake_case_   			=   os.path.join(self.tmpdirname,				VOCAB_FILES_NAMES['emoji_file'])
            with open(self.vocab_file,				'w',				encoding='utf-8') as vocab_writer:
                 vocab_writer.write(''.join([x + '\n' for x in vocab_tokens]))
            with open(self.emoji_file,				'w') as emoji_writer:
                 emoji_writer.write(json.dumps(lowerCAmelCase__))







       def 						a_		(					self,				**lowerCAmelCase__) -> Union[str, Any]:
            kwargs.update(self.special_tokens_map)
            return GPTNeoXJapaneseTokenizer.from_pretrained(self.tmpdirname,				**lowerCAmelCase__)







       def 						a_		(					self,				lowerCAmelCase__) -> str:
            snake_case_   			=   'こんにちは、世界。 \nこんばんは、㔺界。😀'
            snake_case_   			=   'こんにちは、世界。 \nこんばんは、世界。😀'
            return input_text, output_text







       def 						a_		(					self,				lowerCAmelCase__) -> Tuple:
            snake_case_			,      snake_case_   			=   self.get_input_output_texts(lowerCAmelCase__)
            snake_case_   			=   tokenizer.encode(lowerCAmelCase__,				add_special_tokens=lowerCAmelCase__)
            snake_case_   			=   tokenizer.decode(lowerCAmelCase__,				clean_up_tokenization_spaces=lowerCAmelCase__)
            return text, ids







       def 						a_		(					self) -> int:
            pass  # TODO add if relevant







       def 						a_		(					self) -> Optional[int]:
            pass  # TODO add if relevant







       def 						a_		(					self) -> Any:
            pass  # TODO add if relevant







       def 						a_		(					self) -> List[str]:
            snake_case_   			=   self.get_tokenizer()

            # Testing tokenization
            snake_case_   			=   'こんにちは、世界。　こんばんは、㔺界。'
            snake_case_   			=   ['こん', 'にちは', '、', '世界', '。', '<SP>', 'こん', 'ばんは', '、', '㔺界', '。']
            snake_case_   			=   tokenizer.tokenize(lowerCAmelCase__)
            self.assertListEqual(lowerCAmelCase__,				lowerCAmelCase__)

            # Testing conversion to ids without special tokens
            snake_case_   			=   [0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6]
            snake_case_   			=   tokenizer.convert_tokens_to_ids(lowerCAmelCase__)
            self.assertListEqual(lowerCAmelCase__,				lowerCAmelCase__)

            # Testing conversion to ids with special tokens
            snake_case_   			=   tokens + [tokenizer.unk_token]
            snake_case_   			=   [0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6, 19]
            snake_case_   			=   tokenizer.convert_tokens_to_ids(lowerCAmelCase__)
            self.assertListEqual(lowerCAmelCase__,				lowerCAmelCase__)







       @slow
       def 						a_		(					self) -> Dict:
            snake_case_   			=   self.tokenizer_class.from_pretrained('abeja/gpt-neox-japanese-2.7b')

            snake_case_   			=   tokenizer.encode('ありがとう。',				add_special_tokens=lowerCAmelCase__)
            snake_case_   			=   tokenizer.encode('どういたしまして。',				add_special_tokens=lowerCAmelCase__)

            snake_case_   			=   tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__)
            snake_case_   			=   tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__,				lowerCAmelCase__)

            assert encoded_sentence == ids_a
            assert encoded_pair == ids_a + ids_a







       def 						a_		(					self) -> Any:
            # Intentionally convert some words to accommodate character fluctuations unique to Japanese
            pass







       def 						a_		(					self) -> int:
            # tokenizer has no padding token
            pass


"""simple docstring"""


from math import factorial







def    UpperCAmelCase       (						UpperCAmelCase		,   UpperCAmelCase   )							-> List[str]:
     return factorial(UpperCAmelCase   ) / (factorial(UpperCAmelCase   ) * factorial(n - r   ))







def    UpperCAmelCase       (						)							-> Optional[Any]:
     snake_case_   			=   0

     for i in range(1		,   101   ):
          for j in range(1		,   i + 1   ):
               if combinations(UpperCAmelCase		,   UpperCAmelCase   ) > 1e6:
                    total += 1
     return total


if __name__ == "__main__":
    print(solution())

