






"""simple docstring"""






import os
import unittest

from transformers import LayoutLMTokenizer, LayoutLMTokenizerFast
from transformers.models.layoutlm.tokenization_layoutlm import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin





@require_tokenizers
class       snake_case_       (    _lowerCamelCase    ,							unittest.TestCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Any   			=					LayoutLMTokenizer
	SCREAMING_SNAKE_CASE_:							Optional[int]   			=					LayoutLMTokenizerFast
	SCREAMING_SNAKE_CASE_:							int   			=					True
	SCREAMING_SNAKE_CASE_:							str   			=					True


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					super().setUp()

					A__							 =       [
					    '[UNK]',
					    '[CLS]',
					    '[SEP]',
					    'want',
					    '##want',
					    '##ed',
					    'wa',
					    'un',
					    'runn',
					    '##ing',
					    ',',
					    'low',
					    'lowest',
					]
					A__							 =       os.path.join(self.tmpdirname  ,					VOCAB_FILES_NAMES['vocab_file']						)
					with open(self.vocab_file  ,					'w'  ,					encoding='utf-8'						) as vocab_writer:
									vocab_writer.write(''.join([x + '\n' for x in vocab_tokens]						)						)


	def       _UpperCAmelCase						(      self  ,					**__a						):


					"""simple docstring"""

					return LayoutLMTokenizer.from_pretrained(self.tmpdirname  ,					**__a						)


	def       _UpperCAmelCase						(      self  ,					__a						):


					"""simple docstring"""

					A__							 =       'UNwant\u00E9d,running'
					A__							 =       'unwanted, running'
					return input_text, output_text


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.tokenizer_class(self.vocab_file						)

					A__							 =       tokenizer.tokenize('UNwant\u00E9d,running'						)
					self.assertListEqual(__a  ,					['un', '##want', '##ed', ',', 'runn', '##ing']						)
					self.assertListEqual(tokenizer.convert_tokens_to_ids(__a						)  ,					[7, 4, 5, 10, 8, 9]						)






	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					pass










"""simple docstring"""






def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				return 1 if input_a == input_a else 0



def  __lowerCamelCase					(					):
				assert xnor_gate(0       ,0				) == 1
				assert xnor_gate(0       ,1				) == 0
				assert xnor_gate(1       ,0				) == 0
				assert xnor_gate(1       ,1				) == 1


if __name__ == "__main__":
					print(xnor_gate(0, 0))
					print(xnor_gate(0, 1))
					print(xnor_gate(1, 0))
					print(xnor_gate(1, 1))


