
"""simple docstring"""




import unittest
from dataclasses import dataclass

import pytest

from accelerate.commands.config.config_args import SageMakerConfig
from accelerate.utils import ComputeEnvironment
from accelerate.utils.launch import _convert_nargs_to_dict


@dataclass
class 			__magic_name__       (       __lowercase ):
       UpperCamelCase_   =		ComputeEnvironment.AMAZON_SAGEMAKER
       UpperCamelCase_   =		True
       UpperCamelCase_   =		'''ml.p3.2xlarge'''
       UpperCamelCase_   =		'''accelerate_sagemaker_execution_role'''
       UpperCamelCase_   =		'''hf-sm'''
       UpperCamelCase_   =		'''us-east-1'''
       UpperCamelCase_   =		1
       UpperCamelCase_   =		'''accelerate-sagemaker-1'''
       UpperCamelCase_   =		'''1.6'''
       UpperCamelCase_   =		'''4.4'''
       UpperCamelCase_   =		'''train.py'''
       UpperCamelCase_   =		[
           '''--model_name_or_path''',
           '''bert''',
           '''--do_train''',
           '''False''',
           '''--epochs''',
           '''3''',
           '''--learning_rate''',
           '''5e-5''',
           '''--max_steps''',
           '''50.5''',
       ]
       UpperCamelCase_   =		[
           '''--model_name_or_path''',
           '''bert''',
           '''--do_train''',
           '''--do_test''',
           '''False''',
           '''--do_predict''',
           '''--epochs''',
           '''3''',
           '''--learning_rate''',
           '''5e-5''',
           '''--max_steps''',
           '''50.5''',
       ]


class 			__magic_name__       (       unittest.TestCase ):
       def 							lowercase_							(     self       )     ->	List[Any]:





         """simple docstring"""




         _lowercase:			List[Any]       =     _convert_nargs_to_dict(MockLaunchConfig.success_training_script_args       )
         assert isinstance(converted_args['''model_name_or_path'''] ,				_A       )
         assert isinstance(converted_args['''do_train'''] ,				_A       )
         assert isinstance(converted_args['''epochs'''] ,				_A       )
         assert isinstance(converted_args['''learning_rate'''] ,				_A       )
         assert isinstance(converted_args['''max_steps'''] ,				_A       )

         with pytest.raises(_A       ):
           _convert_nargs_to_dict(MockLaunchConfig.fail_training_script_args       )


"""simple docstring"""




import qiskit




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  _lowercase:			Dict       =     qiskit.Aer.get_backend('''aer_simulator'''						)

  # Create a Quantum Circuit acting on the q register
  _lowercase:			str       =     qiskit.QuantumCircuit(_UpperCamelCase ,				_UpperCamelCase						)

  # 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
  _lowercase:			Tuple       =     qiskit.execute(_UpperCamelCase ,				_UpperCamelCase ,				shots=1_000						)

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


if __name__ == "__main__":
  A__   :					Optional[int]							=   single_qubit_measure(2, 2)
  print(f"""Total count for various states are: {counts}""")
