






import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
					import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin


@require_torch
class       __SCREAMING_SNAKE_CASE   (				unittest.TestCase						,   __lowercase):






						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												lowerCAmelCase__        =  load_tool('text-to-speech'				)
												self.tool.setup()






						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												# SpeechT5 isn't deterministic
												torch.manual_seed(0				)
												lowerCAmelCase__        =  self.tool('hey'				)
												lowerCAmelCase__        =  result.to_raw()
												self.assertTrue(
												    torch.allclose(
												        resulting_tensor[:3]       ,  torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]				)       ,  )				)







						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												# SpeechT5 isn't deterministic
												torch.manual_seed(0				)
												lowerCAmelCase__        =  self.tool('hey'				)
												lowerCAmelCase__        =  result.to_raw()
												self.assertTrue(
												    torch.allclose(
												        resulting_tensor[:3]       ,  torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]				)       ,  )				)













import qiskit







def 		_UpperCamelCase				(      UpperCamelCase_    :   int      ,    UpperCamelCase_    :   int						)					->				qiskit.result.counts.Counts:

						"""simple docstring"""



						lowerCAmelCase__        =  qiskit.Aer.get_backend('aer_simulator'						)

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

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

						# Execute the circuit on the simulator
						lowerCAmelCase__        =  qiskit.execute(UpperCamelCase_      ,    UpperCamelCase_      ,    shots=1000						)

						# 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)}')





