



'''simple docstring'''
import json
import os
import unittest

from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer
from transformers.testing_utils import slow

from ...test_tokenization_common import TokenizerTesterMixin






class 				lowercase__      (				lowercase		,   unittest.TestCase  ):
	lowercase__    							=     XLMTokenizer
	lowercase__    							=     False





	def       UpperCamelCase_    (					self   :							List[Any]					):







							'''simple docstring'''
							super().setUp()

							# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
							_UpperCamelCase   :						Optional[int]												=  [
							    'l',
							    'o',
							    'w',
							    'e',
							    'r',
							    's',
							    't',
							    'i',
							    'd',
							    'n',
							    'w</w>',
							    'r</w>',
							    't</w>',
							    'lo',
							    'low',
							    'er</w>',
							    'low</w>',
							    'lowest</w>',
							    'newer</w>',
							    'wider</w>',
							    '<unk>',
							]
							_UpperCamelCase   :						Optional[int]												=  dict(zip(lowerCamelCase__					,range(len(lowerCamelCase__					)					)					)					)
							_UpperCamelCase   :						str												=  ['l o 123', 'lo w 1456', 'e r</w> 1789', '']

							_UpperCamelCase   :						Dict												=  os.path.join(self.tmpdirname					,VOCAB_FILES_NAMES['vocab_file']					)
							_UpperCamelCase   :						Dict												=  os.path.join(self.tmpdirname					,VOCAB_FILES_NAMES['merges_file']					)
							with open(self.vocab_file					,'w'					) as fp:
													fp.write(json.dumps(lowerCamelCase__					)					)
							with open(self.merges_file					,'w'					) as fp:
													fp.write('\n'.join(lowerCamelCase__					)					)





	def       UpperCamelCase_    (					self   :							Optional[int]					,lowerCamelCase__   :							Optional[int]					):







							'''simple docstring'''
							_UpperCamelCase   :						Dict												=  'lower newer'
							_UpperCamelCase   :						Any												=  'lower newer'
							return input_text, output_text





	def       UpperCamelCase_    (					self   :							List[str]					):







							'''simple docstring'''
							_UpperCamelCase   :						Tuple												=  XLMTokenizer(self.vocab_file					,self.merges_file					)

							_UpperCamelCase   :						Union[str, Any]												=  'lower'
							_UpperCamelCase   :						List[str]												=  ['low', 'er</w>']
							_UpperCamelCase   :						Dict												=  tokenizer.tokenize(lowerCamelCase__					)
							self.assertListEqual(lowerCamelCase__					,lowerCamelCase__					)

							_UpperCamelCase   :						int												=  tokens + ['<unk>']
							_UpperCamelCase   :						int												=  [14, 15, 20]
							self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCamelCase__					)					,lowerCamelCase__					)





	@slow
	def       UpperCamelCase_    (					self   :							Optional[Any]					):







							'''simple docstring'''
							_UpperCamelCase   :						int												=  XLMTokenizer.from_pretrained('xlm-mlm-en-2048'					)

							_UpperCamelCase   :						Any												=  tokenizer.encode('sequence builders'					,add_special_tokens=lowerCamelCase__					)
							_UpperCamelCase   :						Dict												=  tokenizer.encode('multi-sequence build'					,add_special_tokens=lowerCamelCase__					)

							_UpperCamelCase   :						Optional[Any]												=  tokenizer.build_inputs_with_special_tokens(lowerCamelCase__					)
							_UpperCamelCase   :						Optional[Any]												=  tokenizer.build_inputs_with_special_tokens(lowerCamelCase__					,lowerCamelCase__					)

							assert encoded_sentence == [0] + text + [1]
							assert encoded_pair == [0] + text + [1] + text_a + [1]







'''simple docstring'''
def A__       (	UpperCAmelCase_ = 1_0_0_0				):
						_UpperCamelCase   :						List[str]												=  3
						_UpperCamelCase   :						Any												=  0
						while a < n:
												if a % 3 == 0 or a % 5 == 0:
																		result += a
												elif a % 1_5 == 0:
																		result -= a
												a += 1
						return result


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


