





"""simple docstring"""




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   ,      lowerCAmelCase__ = "▁"   ,      lowerCAmelCase__ = True   ,      lowerCAmelCase__ = "<unk>"   ,      lowerCAmelCase__ = "</s>"   ,      lowerCAmelCase__ = "<pad>"   ,      )			->				Optional[Any]:
								a   :	List[str]			=       {
								    "pad": {"id": 0, "token": pad_token},
								    "eos": {"id": 1, "token": eos_token},
								    "unk": {"id": 2, "token": unk_token},
								}

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

								a   :	List[str]			=       Tokenizer(Unigram()   )

								a   :	int			=       normalizers.Sequence(
								    [
								        normalizers.Nmt(),
								        normalizers.NFKC(),
								        normalizers.Replace(Regex(" {2,}"   )   ,      " "   ),
								        normalizers.Lowercase(),
								    ]   )
								a   :	str			=       pre_tokenizers.Sequence(
								    [
								        pre_tokenizers.Metaspace(replacement=lowerCAmelCase__   ,      add_prefix_space=lowerCAmelCase__   ),
								        pre_tokenizers.Digits(individual_digits=lowerCAmelCase__   ),
								        pre_tokenizers.Punctuation(),
								    ]   )
								a   :	Union[str, Any]			=       decoders.Metaspace(replacement=lowerCAmelCase__   ,      add_prefix_space=lowerCAmelCase__   )

								a   :	int			=       TemplateProcessing(
								    single=f"""$A {self.special_tokens['eos']['token']}"""   ,      special_tokens=[(self.special_tokens["eos"]["token"], self.special_tokens["eos"]["id"])]   ,      )

								a   :	Any			=       {
								    "model": "SentencePieceUnigram",
								    "replacement": replacement,
								    "add_prefix_space": add_prefix_space,
								}

								super().__init__(lowerCAmelCase__   ,      lowerCAmelCase__   )






							def 					__a     (     self   ,      lowerCAmelCase__   ,      lowerCAmelCase__ = 8000   ,      lowerCAmelCase__ = True   ,      )			->				Optional[int]:
								a   :	str			=       trainers.UnigramTrainer(
								    vocab_size=lowerCAmelCase__   ,      special_tokens=self.special_tokens_list   ,      show_progress=lowerCAmelCase__   ,      )

								if isinstance(lowerCAmelCase__   ,      lowerCAmelCase__   ):
									a   :	Tuple			=       [files]
								self._tokenizer.train(lowerCAmelCase__   ,      trainer=lowerCAmelCase__   )

								self.add_unk_id()






							def 					__a     (     self   ,      lowerCAmelCase__   ,      lowerCAmelCase__ = 8000   ,      lowerCAmelCase__ = True   ,      )			->				List[str]:
								a   :	List[Any]			=       trainers.UnigramTrainer(
								    vocab_size=lowerCAmelCase__   ,      special_tokens=self.special_tokens_list   ,      show_progress=lowerCAmelCase__   ,      )

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

								self.add_unk_id()






							def 					__a     (     self   )			->				Tuple:
								a   :	List[Any]			=       json.loads(self._tokenizer.to_str()   )

								a   :	Dict			=       self.special_tokens["unk"]["id"]

								a   :	str			=       Tokenizer.from_str(json.dumps(lowerCAmelCase__   )   )









"""simple docstring"""




import qiskit






def    _SCREAMING_SNAKE_CASE	(			_lowercase		:					int					, _lowercase		:					int      )				->qiskit.result.counts.Counts:






	'''simple docstring'''






	a   :	Union[str, Any]			=       qiskit.Aer.get_backend("aer_simulator"      )

	# Create a Quantum Circuit acting on the q register
	a   :	Optional[Any]			=       qiskit.QuantumCircuit(_lowercase					, _lowercase      )

	# Map the quantum measurement to the classical bits
	circuit.measure([0]					, [0]      )

	# Execute the circuit on the simulator
	a   :	Optional[int]			=       qiskit.execute(_lowercase					, _lowercase					, shots=1000      )

	# Return the histogram data of the results of the experiment.
	return job.result().get_counts(_lowercase      )


if __name__ == "__main__":
		print(F'''Total count for various states are: {single_qubit_measure(1, 1)}''')


