
'''simple docstring'''







import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin






class 			lowerCAmelCase__       (  __lowercase					):
					lowerCAmelCase_					       =					'''Speech2TextFeatureExtractor'''
					lowerCAmelCase_					       =					'''Speech2TextTokenizer'''






					def __init__(       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											super().__init__(UpperCAmelCase__    ,							UpperCAmelCase__		)
											lowercase_     :					int													=	self.feature_extractor
											lowercase_     :					List[str]													=	False






					def __call__(       self    ,							*__SCREAMING_SNAKE_CASE    ,							**__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											if self._in_target_context_manager:
																	return self.current_processor(*UpperCAmelCase__    ,							**UpperCAmelCase__		)

											if "raw_speech" in kwargs:
																	warnings.warn('''Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.'''		)
																	lowercase_     :					Dict													=	kwargs.pop('''raw_speech'''		)
											else:
																	lowercase_     :					Any													=	kwargs.pop('''audio'''    ,							UpperCAmelCase__		)
											lowercase_     :					List[Any]													=	kwargs.pop('''sampling_rate'''    ,							UpperCAmelCase__		)
											lowercase_     :					Dict													=	kwargs.pop('''text'''    ,							UpperCAmelCase__		)
											if len(UpperCAmelCase__		) > 0:
																	lowercase_     :					Any													=	args[0]
																	lowercase_     :					Any													=	args[1:]

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

											if audio is not None:
																	lowercase_     :					List[Any]													=	self.feature_extractor(UpperCAmelCase__    ,							*UpperCAmelCase__    ,							sampling_rate=UpperCAmelCase__    ,							**UpperCAmelCase__		)
											if text is not None:
																	lowercase_     :					Any													=	self.tokenizer(UpperCAmelCase__    ,							**UpperCAmelCase__		)

											if text is None:
																	return inputs
											elif audio is None:
																	return encodings
											else:
																	lowercase_     :					List[str]													=	encodings['''input_ids''']
																	return inputs






					def      _snake_case   (       self    ,							*__SCREAMING_SNAKE_CASE    ,							**__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											return self.tokenizer.batch_decode(*UpperCAmelCase__    ,							**UpperCAmelCase__		)






					def      _snake_case   (       self    ,							*__SCREAMING_SNAKE_CASE    ,							**__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											return self.tokenizer.decode(*UpperCAmelCase__    ,							**UpperCAmelCase__		)






					@contextmanager
					def      _snake_case   (       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 audio inputs, or in a separate call.'''		)
											lowercase_     :					List[Any]													=	True
											lowercase_     :					str													=	self.tokenizer
											yield
											lowercase_     :					Optional[int]													=	self.feature_extractor
											lowercase_     :					List[str]													=	False





'''simple docstring'''







import qiskit
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			int				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					List[Any]													=	qiskit.Aer.get_backend('''aer_simulator'''							)

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

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

						# Execute the circuit on the simulator
						lowercase_     :					Union[str, Any]													=	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__":
							print(f"""Total count for various states are: {single_qubit_measure(1, 1)}""")



