

'''simple docstring'''

from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import center_crop, normalize, rescale, resize, to_channel_dimension_format
from ...image_utils import (
    IMAGENET_STANDARD_MEAN,
    IMAGENET_STANDARD_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
			import PIL


a       :      Dict  	=			logging.get_logger(__name__)







class   UpperCamelCase__   (       A__       ):


		"""simple docstring"""

		SCREAMING_SNAKE_CASE__  :     Optional[int]       =							["pixel_values"]







		def __init__(			self   ,      snake_case = True   ,      snake_case = None   ,      snake_case = PIL.Image.NEAREST   ,      snake_case = False   ,      snake_case = None   ,      snake_case = 1 / 2_5_5   ,      snake_case = False   ,      snake_case = True   ,      snake_case = True   ,      snake_case = None   ,      snake_case = None   ,      snake_case = True   ,      **snake_case   ,      ):


							'''simple docstring'''

							super().__init__(**__snake_case      )
							UpperCAmelCase		:							Any        =       size if size is not None else {'''height''': 3_4_6, '''width''': 3_4_6}
							UpperCAmelCase		:							Optional[int]        =       get_size_dict(__snake_case      )
							UpperCAmelCase		:							List[Any]        =       crop_size if crop_size is not None else {'''height''': 2_8_9, '''width''': 2_8_9}
							UpperCAmelCase		:							str        =       get_size_dict(__snake_case   ,      param_name="crop_size"      )

							UpperCAmelCase		:							int        =       do_resize
							UpperCAmelCase		:							Tuple        =       size
							UpperCAmelCase		:							int        =       resample
							UpperCAmelCase		:							List[str]        =       do_center_crop
							UpperCAmelCase		:							str        =       crop_size
							UpperCAmelCase		:							List[str]        =       do_rescale
							UpperCAmelCase		:							List[Any]        =       rescale_factor
							UpperCAmelCase		:							Optional[Any]        =       rescale_offset
							UpperCAmelCase		:							int        =       do_normalize
							UpperCAmelCase		:							Union[str, Any]        =       image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
							UpperCAmelCase		:							Any        =       image_std if image_std is not None else IMAGENET_STANDARD_STD
							UpperCAmelCase		:							Tuple        =       include_top







		def 				A_	(			self   ,      snake_case   ,      snake_case   ,      snake_case = PIL.Image.NEAREST   ,      snake_case = None   ,      **snake_case   ,      ):


							'''simple docstring'''

							UpperCAmelCase		:							Optional[Any]        =       get_size_dict(__snake_case      )
							if "height" not in size or "width" not in size:
												raise ValueError(f"The size dictionary must have keys 'height' and 'width'. Got {size.keys()}"      )
							return resize(
							    __snake_case   ,      size=(size["height"], size["width"])   ,      resample=__snake_case   ,      data_format=__snake_case   ,      **__snake_case      )







		def 				A_	(			self   ,      snake_case   ,      snake_case   ,      snake_case = None   ,      **snake_case   ,      ):


							'''simple docstring'''

							UpperCAmelCase		:							Optional[Any]        =       get_size_dict(__snake_case      )
							if "height" not in size or "width" not in size:
												raise ValueError(f"The size dictionary must have keys 'height' and 'width'. Got {size.keys()}"      )
							return center_crop(__snake_case   ,      size=(size["height"], size["width"])   ,      data_format=__snake_case   ,      **__snake_case      )







		def 				A_	(			self   ,      snake_case   ,      snake_case   ,      snake_case = True   ,      snake_case = None   ,      **snake_case   ,      ):


							'''simple docstring'''

							if offset:
												UpperCAmelCase		:							Optional[int]        =       (image - 1_2_7.5) * scale
												if data_format is not None:
																	UpperCAmelCase		:							Tuple        =       to_channel_dimension_format(__snake_case   ,      __snake_case      )
												UpperCAmelCase		:							Tuple        =       rescaled_image.astype(np.floataa      )
							else:
												UpperCAmelCase		:							Dict        =       rescale(__snake_case   ,      scale=__snake_case   ,      data_format=__snake_case   ,      **__snake_case      )
							return rescaled_image







		def 				A_	(			self   ,      snake_case   ,      snake_case   ,      snake_case   ,      snake_case = None   ,      **snake_case   ,      ):


							'''simple docstring'''

							return normalize(__snake_case   ,      mean=__snake_case   ,      std=__snake_case   ,      data_format=__snake_case   ,      **__snake_case      )







		def 				A_	(			self   ,      snake_case   ,      snake_case = None   ,      snake_case = None   ,      snake_case=None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = None   ,      snake_case = ChannelDimension.FIRST   ,      **snake_case   ,      ):


							'''simple docstring'''

							UpperCAmelCase		:							Any        =       do_resize if do_resize is not None else self.do_resize
							UpperCAmelCase		:							Any        =       resample if resample is not None else self.resample
							UpperCAmelCase		:							Union[str, Any]        =       do_center_crop if do_center_crop is not None else self.do_center_crop
							UpperCAmelCase		:							List[str]        =       do_rescale if do_rescale is not None else self.do_rescale
							UpperCAmelCase		:							str        =       rescale_factor if rescale_factor is not None else self.rescale_factor
							UpperCAmelCase		:							Any        =       rescale_offset if rescale_offset is not None else self.rescale_offset
							UpperCAmelCase		:							Tuple        =       do_normalize if do_normalize is not None else self.do_normalize
							UpperCAmelCase		:							Optional[int]        =       image_mean if image_mean is not None else self.image_mean
							UpperCAmelCase		:							str        =       image_std if image_std is not None else self.image_std
							UpperCAmelCase		:							Optional[Any]        =       include_top if include_top is not None else self.include_top

							UpperCAmelCase		:							Optional[Any]        =       size if size is not None else self.size
							UpperCAmelCase		:							Dict        =       get_size_dict(__snake_case      )
							UpperCAmelCase		:							Union[str, Any]        =       crop_size if crop_size is not None else self.crop_size
							UpperCAmelCase		:							Tuple        =       get_size_dict(__snake_case   ,      param_name="crop_size"      )

							UpperCAmelCase		:							List[Any]        =       make_list_of_images(__snake_case      )

							if not valid_images(__snake_case      ):
												raise ValueError(
												    "Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, "
												    "torch.Tensor, tf.Tensor or jax.ndarray."      )

							if do_resize and size is None or resample is None:
												raise ValueError("Size and resample must be specified if do_resize is True."      )

							if do_center_crop and crop_size is None:
												raise ValueError("Crop size must be specified if do_center_crop is True."      )

							if do_rescale and rescale_factor is None:
												raise ValueError("Rescale factor must be specified if do_rescale is True."      )

							if do_normalize and (image_mean is None or image_std is None):
												raise ValueError("Image mean and std must be specified if do_normalize is True."      )

							# All transformations expect numpy arrays.
							UpperCAmelCase		:							Any        =       [to_numpy_array(__snake_case      ) for image in images]

							if do_resize:
												UpperCAmelCase		:							Dict        =       [self.resize(image=__snake_case   ,      size=__snake_case   ,      resample=__snake_case      ) for image in images]

							if do_center_crop:
												UpperCAmelCase		:							Optional[Any]        =       [self.center_crop(image=__snake_case   ,      size=__snake_case      ) for image in images]

							if do_rescale:
												UpperCAmelCase		:							Union[str, Any]        =       [self.rescale(image=__snake_case   ,      scale=__snake_case   ,      offset=__snake_case      ) for image in images]

							if do_normalize:
												UpperCAmelCase		:							Optional[int]        =       [self.normalize(image=__snake_case   ,      mean=__snake_case   ,      std=__snake_case      ) for image in images]

							if include_top:
												UpperCAmelCase		:							str        =       [self.normalize(image=__snake_case   ,      mean=[0, 0, 0]   ,      std=__snake_case      ) for image in images]

							UpperCAmelCase		:							List[Any]        =       [to_channel_dimension_format(__snake_case   ,      __snake_case      ) for image in images]

							UpperCAmelCase		:							int        =       {'''pixel_values''': images}
							return BatchFeature(data=__snake_case   ,      tensor_type=__snake_case      )



'''simple docstring'''

import math

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





def 				lowercase (					__magic_name__ = 1			,   __magic_name__ = 1							):



					'''simple docstring'''







					if isinstance(__magic_name__			,   __magic_name__							) or isinstance(__magic_name__			,   __magic_name__							):
										raise TypeError("inputs must be integers."							)
					if (bit_a < 0) or (bit_a < 0):
										raise ValueError("inputs must be positive."							)
					if (math.floor(__magic_name__							) != bit_a) or (math.floor(__magic_name__							) != 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
					UpperCAmelCase		:							List[Any]        =       QuantumRegister(2			,   "qr"							)
					UpperCAmelCase		:							Optional[int]        =       ClassicalRegister(2			,   "cr"							)

					UpperCAmelCase		:							Optional[int]        =       QuantumCircuit(__magic_name__			,   __magic_name__							)

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

					# send the information
					UpperCAmelCase		:							Any        =       str(__magic_name__							) + str(__magic_name__							)

					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(__magic_name__			,   __magic_name__							)

					UpperCAmelCase		:							Tuple        =       Aer.get_backend("aer_simulator"							)
					UpperCAmelCase		:							Any        =       execute(__magic_name__			,   __magic_name__			,   shots=1000							)

					return job.result().get_counts(__magic_name__							)


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