




'''simple docstring'''






import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_layoutlm import LayoutLMTokenizer


_lowerCAmelCase				     = logging.get_logger(__name__)

_lowerCAmelCase				     = {'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

_lowerCAmelCase				     = {
    '''vocab_file''': {
        '''microsoft/layoutlm-base-uncased''': (
            '''https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt'''
        ),
        '''microsoft/layoutlm-large-uncased''': (
            '''https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''microsoft/layoutlm-base-uncased''': (
            '''https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json'''
        ),
        '''microsoft/layoutlm-large-uncased''': (
            '''https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json'''
        ),
    },
}

_lowerCAmelCase				     = {
    '''microsoft/layoutlm-base-uncased''': 512,
    '''microsoft/layoutlm-large-uncased''': 512,
}

_lowerCAmelCase				     = {
    '''microsoft/layoutlm-base-uncased''': {'''do_lower_case''': True},
    '''microsoft/layoutlm-large-uncased''': {'''do_lower_case''': True},
}



class  A		(			lowerCamelCase_		):




				'''simple docstring'''





				A				     =    VOCAB_FILES_NAMES
				A				     =    PRETRAINED_VOCAB_FILES_MAP
				A				     =    PRETRAINED_INIT_CONFIGURATION
				A				     =    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
				A				     =    LayoutLMTokenizer
				def __init__(self			,  _UpperCAmelCase=None			,  _UpperCAmelCase=None			,  _UpperCAmelCase=True			,  _UpperCAmelCase="[UNK]"			,  _UpperCAmelCase="[SEP]"			,  _UpperCAmelCase="[PAD]"			,  _UpperCAmelCase="[CLS]"			,  _UpperCAmelCase="[MASK]"			,  _UpperCAmelCase=True			,  _UpperCAmelCase=None			,  **_UpperCAmelCase			,  )     ->	Union[str, Any]:
							super().__init__(
							    _UpperCAmelCase			,  tokenizer_file=_UpperCAmelCase			,  do_lower_case=_UpperCAmelCase			,  unk_token=_UpperCAmelCase			,  sep_token=_UpperCAmelCase			,  pad_token=_UpperCAmelCase			,  cls_token=_UpperCAmelCase			,  mask_token=_UpperCAmelCase			,  tokenize_chinese_chars=_UpperCAmelCase			,  strip_accents=_UpperCAmelCase			,  **_UpperCAmelCase			,  )

							__UpperCamelCase				:      Tuple									=       json.loads(self.backend_tokenizer.normalizer.__getstate__()      )
							if (
							    normalizer_state.get("lowercase"			,  _UpperCAmelCase      ) != do_lower_case
							    or normalizer_state.get("strip_accents"			,  _UpperCAmelCase      ) != strip_accents
							    or normalizer_state.get("handle_chinese_chars"			,  _UpperCAmelCase      ) != tokenize_chinese_chars
							):
										__UpperCamelCase				:      str									=       getattr(_UpperCAmelCase			,  normalizer_state.pop("type"      )      )
										__UpperCamelCase				:      Tuple									=       do_lower_case
										__UpperCamelCase				:      List[str]									=       strip_accents
										__UpperCamelCase				:      str									=       tokenize_chinese_chars
										__UpperCamelCase				:      Tuple									=       normalizer_class(**_UpperCAmelCase      )

							__UpperCamelCase				:      Tuple									=       do_lower_case
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase=None      )     ->	List[str]:
							__UpperCamelCase				:      Optional[Any]									=       [self.cls_token_id] + token_ids_a + [self.sep_token_id]

							if token_ids_a:
										output += token_ids_a + [self.sep_token_id]

							return output
				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase = None      )     ->	int:
							__UpperCamelCase				:      Optional[Any]									=       [self.sep_token_id]
							__UpperCamelCase				:      Any									=       [self.cls_token_id]
							if token_ids_a is None:
										return len(cls + token_ids_a + sep      ) * [0]
							return len(cls + token_ids_a + sep      ) * [0] + len(token_ids_a + sep      ) * [1]





				def 	a_	(self			,  _UpperCAmelCase			,  _UpperCAmelCase = None      )     ->	Dict:
							__UpperCamelCase				:      List[Any]									=       self._tokenizer.model.save(_UpperCAmelCase			,  name=_UpperCAmelCase      )
							return tuple(_UpperCAmelCase      )








'''simple docstring'''






import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute

def       __lowerCAmelCase (   snake_case__ = 1 ,				snake_case__ = 1						):
			if isinstance(snake_case__ ,				snake_case__						) or isinstance(snake_case__ ,				snake_case__						):
						raise TypeError("inputs must be integers."						)
			if (bit_a < 0) or (bit_a < 0):
						raise ValueError("inputs must be positive."						)
			if (math.floor(snake_case__						) != bit_a) or (math.floor(snake_case__						) != bit_a):
						raise ValueError("inputs must be exact integers."						)
			if (bit_a > 1) or (bit_a > 1):
						raise ValueError("inputs must be less or equal to 1."						)

			# build registers
			__UpperCamelCase				:      Tuple									=       QuantumRegister(2 ,				"qr"						)
			__UpperCamelCase				:      Dict									=       ClassicalRegister(2 ,				"cr"						)

			__UpperCamelCase				:      str									=       QuantumCircuit(snake_case__ ,				snake_case__						)

			# entanglement the qubits
			quantum_circuit.h(1						)
			quantum_circuit.cx(1 ,				0						)

			# send the information
			__UpperCamelCase				:      Optional[Any]									=       str(snake_case__						) + str(snake_case__						)

			if c_information == "11":
						quantum_circuit.x(1						)
						quantum_circuit.z(1						)
			elif c_information == "10":
						quantum_circuit.z(1						)
			elif c_information == "01":
						quantum_circuit.x(1						)
			else:
						quantum_circuit.i(1						)

			# unentangled the circuit
			quantum_circuit.cx(1 ,				0						)
			quantum_circuit.h(1						)

			# measure the circuit
			quantum_circuit.measure(snake_case__ ,				snake_case__						)

			__UpperCamelCase				:      Dict									=       Aer.get_backend("aer_simulator"						)
			__UpperCamelCase				:      Tuple									=       execute(snake_case__ ,				snake_case__ ,				shots=1_000						)

			return job.result().get_counts(snake_case__						)


if __name__ == "__main__":
				print(f'Counts for classical state send: {superdense_coding(1,1)}')



