
import os
import shutil
import unittest
from unittest.mock import patch

from transformers.testing_utils import CaptureStd, is_pt_tf_cross_test, require_torch


class 							lowerCamelCase       (		unittest.TestCase					):



  """simple docstring"""





  @patch("sys.argv"						,    ["fakeprogrampath", "env"]					)
  def 					lowercase_						(					self					):
      # test transformers-cli env
      import transformers.commands.transformers_cli

      with CaptureStd() as cs:
          transformers.commands.transformers_cli.main()
      self.assertIn("Python version"						,    cs.out					)
      self.assertIn("Platform"						,    cs.out					)
      self.assertIn("Using distributed or parallel set-up in script?"						,    cs.out					)

  @is_pt_tf_cross_test
  @patch(
      "sys.argv"						,    ["fakeprogrampath", "pt-to-tf", "--model-name", "hf-internal-testing/tiny-random-gptj", "--no-pr"]					)
  def 					lowercase_						(					self					):
      import transformers.commands.transformers_cli

      shutil.rmtree("/tmp/hf-internal-testing/tiny-random-gptj"						,    ignore_errors=__UpperCamelCase					)  # cleans potential past runs
      transformers.commands.transformers_cli.main()

      # The original repo has no TF weights -- if they exist, they were created by the CLI
      self.assertTrue(os.path.exists("/tmp/hf-internal-testing/tiny-random-gptj/tf_model.h5"					)					)

  @require_torch
  @patch("sys.argv"						,    ["fakeprogrampath", "download", "hf-internal-testing/tiny-random-gptj", "--cache-dir", "/tmp"]					)
  def 					lowercase_						(					self					):
      import transformers.commands.transformers_cli

      # # remove any previously downloaded model to start clean
      shutil.rmtree("/tmp/models--hf-internal-testing--tiny-random-gptj"						,    ignore_errors=__UpperCamelCase					)

      # run the command
      transformers.commands.transformers_cli.main()

      # check if the model files are downloaded correctly on /tmp/models--hf-internal-testing--tiny-random-gptj
      self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/blobs"					)					)
      self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/refs"					)					)
      self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/snapshots"					)					)

  @require_torch
  @patch(
      "sys.argv"						,    [
          "fakeprogrampath",
          "download",
          "hf-internal-testing/test_dynamic_model_with_tokenizer",
          "--trust-remote-code",
          "--cache-dir",
          "/tmp",
      ]						,    )
  def 					lowercase_						(					self					):
      import transformers.commands.transformers_cli

      # # remove any previously downloaded model to start clean
      shutil.rmtree("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer"						,    ignore_errors=__UpperCamelCase					)

      # run the command
      transformers.commands.transformers_cli.main()

      # check if the model files are downloaded correctly on /tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer
      self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/blobs"					)					)
      self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/refs"					)					)
      self.assertTrue(
          os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/snapshots"					)					)








import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute





def        lowerCAmelCase       (				snake_case__   :      int = 1				,					snake_case__   :      int = 1 )->			qiskit.result.counts.Counts:
    if isinstance(snake_case__				,					snake_case__ ) or isinstance(snake_case__				,					snake_case__ ):
        raise TypeError("inputs must be integers." )
    if (bit_a < 0) or (bit_a < 0):
        raise ValueError("inputs must be positive." )
    if (math.floor(snake_case__ ) != bit_a) or (math.floor(snake_case__ ) != bit_a):
        raise ValueError("inputs must be exact integers." )
    if (bit_a > 1) or (bit_a > 1):
        raise ValueError("inputs must be less or equal to 1." )

    # build registers
    A_								=					QuantumRegister(2				,					"qr" )
    A_								=					ClassicalRegister(2				,					"cr" )

    A_								=					QuantumCircuit(snake_case__				,					snake_case__ )

    # entanglement the qubits
    quantum_circuit.h(1 )
    quantum_circuit.cx(1				,					0 )

    # send the information
    A_								=					str(snake_case__ ) + str(snake_case__ )

    if c_information == "11":
        quantum_circuit.x(1 )
        quantum_circuit.z(1 )
    elif c_information == "10":
        quantum_circuit.z(1 )
    elif c_information == "01":
        quantum_circuit.x(1 )
    else:
        quantum_circuit.i(1 )

    # unentangled the circuit
    quantum_circuit.cx(1				,					0 )
    quantum_circuit.h(1 )

    # measure the circuit
    quantum_circuit.measure(snake_case__				,					snake_case__ )

    A_								=					Aer.get_backend("aer_simulator" )
    A_								=					execute(snake_case__				,					snake_case__				,					shots=1000 )

    return job.result().get_counts(snake_case__ )


if __name__ == "__main__":
     print(f"""Counts for classical state send: {superdense_coding(1,1)}""")






