



import json
from typing import Iterator, List, Union

from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers
from tokenizers.implementations.base_tokenizer import BaseTokenizer
from tokenizers.models import Unigram
from tokenizers.processors import TemplateProcessing






class      UpperCamelCase    (						a__     ):



	def __init__(       self			,	UpperCAmelCase__ = "▁"			,	UpperCAmelCase__ = True			,	UpperCAmelCase__ = "<unk>"			,	UpperCAmelCase__ = "</s>"			,	UpperCAmelCase__ = "<pad>"			,	):
							A__							=       {
							    "pad": {"id": 0, "token": pad_token},
							    "eos": {"id": 1, "token": eos_token},
							    "unk": {"id": 2, "token": unk_token},
							}

							A__							=       [None] * len(self.special_tokens		)
							for token_dict in self.special_tokens.values():
													A__							=       token_dict["token"]

							A__							=       Tokenizer(Unigram()		)

							A__							=       normalizers.Sequence(
							    [
							        normalizers.Nmt(),
							        normalizers.NFKC(),
							        normalizers.Replace(Regex(" {2,}"		)			,	" "		),
							        normalizers.Lowercase(),
							    ]		)
							A__							=       pre_tokenizers.Sequence(
							    [
							        pre_tokenizers.Metaspace(replacement=UpperCAmelCase__			,	add_prefix_space=UpperCAmelCase__		),
							        pre_tokenizers.Digits(individual_digits=UpperCAmelCase__		),
							        pre_tokenizers.Punctuation(),
							    ]		)
							A__							=       decoders.Metaspace(replacement=UpperCAmelCase__			,	add_prefix_space=UpperCAmelCase__		)

							A__							=       TemplateProcessing(
							    single=F"""$A {self.special_tokens["eos"]["token"]}"""			,	special_tokens=[(self.special_tokens["eos"]["token"], self.special_tokens["eos"]["id"])]			,	)

							A__							=       {
							    "model": "SentencePieceUnigram",
							    "replacement": replacement,
							    "add_prefix_space": add_prefix_space,
							}

							super().__init__(UpperCAmelCase__			,	UpperCAmelCase__		)



	def 			__A							(       self			,	UpperCAmelCase__			,	UpperCAmelCase__ = 8_000			,	UpperCAmelCase__ = True			,	):
							A__							=       trainers.UnigramTrainer(
							    vocab_size=UpperCAmelCase__			,	special_tokens=self.special_tokens_list			,	show_progress=UpperCAmelCase__			,	)

							if isinstance(UpperCAmelCase__			,	UpperCAmelCase__		):
													A__							=       [files]
							self._tokenizer.train(UpperCAmelCase__			,	trainer=UpperCAmelCase__		)

							self.add_unk_id()



	def 			__A							(       self			,	UpperCAmelCase__			,	UpperCAmelCase__ = 8_000			,	UpperCAmelCase__ = True			,	):
							A__							=       trainers.UnigramTrainer(
							    vocab_size=UpperCAmelCase__			,	special_tokens=self.special_tokens_list			,	show_progress=UpperCAmelCase__			,	)

							self._tokenizer.train_from_iterator(UpperCAmelCase__			,	trainer=UpperCAmelCase__		)

							self.add_unk_id()



	def 			__A							(       self		):
							A__							=       json.loads(self._tokenizer.to_str()		)

							A__							=       self.special_tokens["unk"]["id"]

							A__							=       Tokenizer.from_str(json.dumps(UpperCAmelCase__		)		)










def  UpperCamelCase						(       _A			:				int			,							_A			:				int    )->       int:





						"""simple docstring"""





						return int((input_a, input_a).count(0    ) == 0    )
def  UpperCamelCase						(       )->       None:





						"""simple docstring"""





						assert and_gate(0			,							0    ) == 0
						assert and_gate(0			,							1    ) == 0
						assert and_gate(1			,							0    ) == 0
						assert and_gate(1			,							1    ) == 1


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





