
'''simple docstring'''
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import TensorType, logging


if TYPE_CHECKING:
				from ...onnx.config import PatchingSpec
				from ...tokenization_utils_base import PreTrainedTokenizerBase


__lowerCAmelCase												=	logging.get_logger(__name__)

__lowerCAmelCase												=	{
    'allenai/longformer-base-4096': 'https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json',
    'allenai/longformer-large-4096': 'https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json',
    'allenai/longformer-large-4096-finetuned-triviaqa': (
        'https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json'
    ),
    'allenai/longformer-base-4096-extra.pos.embd.only': (
        'https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json'
    ),
    'allenai/longformer-large-4096-extra.pos.embd.only': (
        'https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json'
    ),
}


class       _lowerCAmelCase   (   __snake_case				):







							'''simple docstring'''

							lowerCAmelCase_ 						=						"longformer"

							def __init__(self  ,  UpperCAmelCase = 512  ,  UpperCAmelCase = 2  ,  UpperCAmelCase = 1  ,  UpperCAmelCase = 0  ,  UpperCAmelCase = 2  ,  UpperCAmelCase = 30522  ,  UpperCAmelCase = 768  ,  UpperCAmelCase = 12  ,  UpperCAmelCase = 12  ,  UpperCAmelCase = 3072  ,  UpperCAmelCase = "gelu"  ,  UpperCAmelCase = 0.1  ,  UpperCAmelCase = 0.1  ,  UpperCAmelCase = 512  ,  UpperCAmelCase = 2  ,  UpperCAmelCase = 0.02  ,  UpperCAmelCase = 1e-1_2  ,  UpperCAmelCase = False  ,  **UpperCAmelCase  ,  )					->       Union[str, Any]:
														super().__init__(pad_token_id=UpperCAmelCase  ,  **UpperCAmelCase  )

														_snake_case       =  attention_window
														_snake_case       =  sep_token_id
														_snake_case       =  bos_token_id
														_snake_case       =  eos_token_id
														_snake_case       =  vocab_size
														_snake_case       =  hidden_size
														_snake_case       =  num_hidden_layers
														_snake_case       =  num_attention_heads
														_snake_case       =  hidden_act
														_snake_case       =  intermediate_size
														_snake_case       =  hidden_dropout_prob
														_snake_case       =  attention_probs_dropout_prob
														_snake_case       =  max_position_embeddings
														_snake_case       =  type_vocab_size
														_snake_case       =  initializer_range
														_snake_case       =  layer_norm_eps
														_snake_case       =  onnx_export


class       _lowerCAmelCase   (   __snake_case				):







							'''simple docstring'''

							def __init__(self  ,  UpperCAmelCase  ,  UpperCAmelCase = "default"  ,  UpperCAmelCase = None  )					->       Union[str, Any]:
														super().__init__(UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  )
														_snake_case       =  True

							@property
							def 	lowercase							(self  )					->       Mapping[str, Mapping[int, str]]:
														if self.task == "multiple-choice":
																					_snake_case       =  {0: """batch""", 1: """choice""", 2: """sequence"""}
														else:
																					_snake_case       =  {0: """batch""", 1: """sequence"""}
														return OrderedDict(
														    [
														        ("""input_ids""", dynamic_axis),
														        ("""attention_mask""", dynamic_axis),
														        ("""global_attention_mask""", dynamic_axis),
														    ]  )

							@property
							def 	lowercase							(self  )					->       Mapping[str, Mapping[int, str]]:
														_snake_case       =  super().outputs
														if self.task == "default":
																					_snake_case       =  {0: """batch"""}
														return outputs

							@property
							def 	lowercase							(self  )					->       float:
														return 1e-4

							@property
							def 	lowercase							(self  )					->       int:
														# needs to be >= 14 to support tril operator
														return max(super().default_onnx_opset  ,  14  )





							def 	lowercase							(self  ,  UpperCAmelCase  ,  UpperCAmelCase = -1  ,  UpperCAmelCase = -1  ,  UpperCAmelCase = False  ,  UpperCAmelCase = None  ,  )					->       Mapping[str, Any]:
														_snake_case       =  super().generate_dummy_inputs(
														    preprocessor=UpperCAmelCase  ,  batch_size=UpperCAmelCase  ,  seq_length=UpperCAmelCase  ,  is_pair=UpperCAmelCase  ,  framework=UpperCAmelCase  )
														import torch

														# for some reason, replacing this code by inputs["global_attention_mask"] = torch.randint(2, inputs["input_ids"].shape, dtype=torch.int64)
														# makes the export fail randomly
														_snake_case       =  torch.zeros_like(inputs["""input_ids"""]  )
														# make every second token global
														_snake_case       =  1

														return inputs

'''simple docstring'''
import qiskit






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				):
							_snake_case       =  qiskit.Aer.get_backend("""aer_simulator"""				)

							# Create a Quantum Circuit acting on the q register
							_snake_case       =  qiskit.QuantumCircuit(_SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				)

							# Apply X (NOT) Gate to Qubits 0 & 1
							circuit.x(0				)
							circuit.x(1				)

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

							# Execute the circuit on the qasm simulator
							_snake_case       =  qiskit.execute(_SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE							, shots=1000				)

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


if __name__ == "__main__":
				__lowerCAmelCase												=	single_qubit_measure(2, 2)
				print(f'''Total count for various states are: {counts}''')