





'''simple docstring'''

import re
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin






class       _UpperCamelCase      (			_A			):






				'''simple docstring'''





				SCREAMING_SNAKE_CASE:Tuple         =	["""image_processor""", """tokenizer"""]
				SCREAMING_SNAKE_CASE:Optional[Any]         =	"""AutoImageProcessor"""
				SCREAMING_SNAKE_CASE:Union[str, Any]         =	"""AutoTokenizer"""






				def __init__(				self       ,					_a=None       ,					_a=None       ,					**_a    ):
											"""simple docstring"""
											a__            =							None
											if "feature_extractor" in kwargs:
																		warnings.warn(
																		    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
																		    ' instead.'       ,					a_       ,					)
																		a__            =							kwargs.pop('feature_extractor'    )

											a__            =							image_processor if image_processor is not None else feature_extractor
											if image_processor is None:
																		raise ValueError('You need to specify an `image_processor`.'    )
											if tokenizer is None:
																		raise ValueError('You need to specify a `tokenizer`.'    )

											super().__init__(a_       ,					a_    )
											a__            =							self.image_processor
											a__            =							False






				def __call__(				self       ,					*_a       ,					**_a    ):
											"""simple docstring"""
											# For backward compatibility
											if self._in_target_context_manager:
																		return self.current_processor(*a_       ,					**a_    )

											a__            =							kwargs.pop('images'       ,					a_    )
											a__            =							kwargs.pop('text'       ,					a_    )
											if len(a_    ) > 0:
																		a__            =							args[0]
																		a__            =							args[1:]

											if images is None and text is None:
																		raise ValueError('You need to specify either an `images` or `text` input to process.'    )

											if images is not None:
																		a__            =							self.image_processor(a_       ,					*a_       ,					**a_    )
											if text is not None:
																		a__            =							self.tokenizer(a_       ,					**a_    )

											if text is None:
																		return inputs
											elif images is None:
																		return encodings
											else:
																		a__            =							encodings['input_ids']
																		return inputs






				def        lowercase__   (				self       ,					*_a       ,					**_a    ):
											"""simple docstring"""
											return self.tokenizer.batch_decode(*a_       ,					**a_    )






				def        lowercase__   (				self       ,					*_a       ,					**_a    ):
											"""simple docstring"""
											return self.tokenizer.decode(*a_       ,					**a_    )






				@contextmanager
				def        lowercase__   (				self    ):
											"""simple docstring"""
											warnings.warn(
											    '`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '
											    'labels by using the argument `text` of the regular `__call__` method (either in the same call as '
											    'your images inputs, or in a separate call.'    )
											a__            =							True
											a__            =							self.tokenizer
											yield
											a__            =							self.image_processor
											a__            =							False






				def        lowercase__   (				self       ,					_a       ,					_a=False       ,					_a=None    ):
											"""simple docstring"""
											if added_vocab is None:
																		a__            =							self.tokenizer.get_added_vocab()

											a__            =							{}

											while tokens:
																		a__            =							re.search(r'<s_(.*?)>'       ,					a_       ,					re.IGNORECASE    )
																		if start_token is None:
																									break
																		a__            =							start_token.group(1    )
																		a__            =							re.search(rF'''</s_{key}>'''       ,					a_       ,					re.IGNORECASE    )
																		a__            =							start_token.group()
																		if end_token is None:
																									a__            =							tokens.replace(a_       ,					''    )
																		else:
																									a__            =							end_token.group()
																									a__            =							re.escape(a_    )
																									a__            =							re.escape(a_    )
																									a__            =							re.search(F'''{start_token_escaped}(.*?){end_token_escaped}'''       ,					a_       ,					re.IGNORECASE    )
																									if content is not None:
																																a__            =							content.group(1    ).strip()
																																if r"<s_" in content and r"</s_" in content:  # non-leaf node
																																							a__            =							self.tokenajson(a_       ,					is_inner_value=a_       ,					added_vocab=a_    )
																																							if value:
																																														if len(a_    ) == 1:
																																																					a__            =							value[0]
																																														a__            =							value
																																else:  # leaf nodes
																																							a__            =							[]
																																							for leaf in content.split(r'<sep/>'    ):
																																														a__            =							leaf.strip()
																																														if leaf in added_vocab and leaf[0] == "<" and leaf[-2:] == "/>":
																																																					a__            =							leaf[1:-2]  # for categorical special tokens
																																														output[key].append(a_    )
																																							if len(output[key]    ) == 1:
																																														a__            =							output[key][0]

																									a__            =							tokens[tokens.find(a_    ) + len(a_    ) :].strip()
																									if tokens[:6] == r"<sep/>":  # non-leaf nodes
																																return [output] + self.tokenajson(tokens[6:]       ,					is_inner_value=a_       ,					added_vocab=a_    )

											if len(a_    ):
																		return [output] if is_inner_value else output
											else:
																		return [] if is_inner_value else {"text_sequence": tokens}






				@property
				def        lowercase__   (				self    ):
											"""simple docstring"""
											warnings.warn(
											    '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'       ,					a_       ,					)
											return self.image_processor_class






				@property
				def        lowercase__   (				self    ):
											"""simple docstring"""
											warnings.warn(
											    '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'       ,					a_       ,					)
											return self.image_processor










'''simple docstring'''

import qiskit







def a_     (    __UpperCAmelCase				,							__UpperCAmelCase					)				->					qiskit.result.counts.Counts:





			"""simple docstring"""







			snake_case:    Union[str, Any]      							=qiskit.Aer.get_backend('aer_simulator'					)

			# Create a Quantum Circuit acting on the q register
			snake_case:    Dict      							=qiskit.QuantumCircuit(__UpperCAmelCase				,							__UpperCAmelCase					)

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

			# Execute the circuit on the simulator
			snake_case:    Dict      							=qiskit.execute(__UpperCAmelCase				,							__UpperCAmelCase				,							shots=10_00					)

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


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




