'''simple docstring'''

import warnings

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding



class       UpperCAmelCase  (						__snake_case ):





       '''simple docstring'''



       SCREAMING_SNAKE_CASE 		=   ["image_processor", "tokenizer"]
       SCREAMING_SNAKE_CASE 		=   "ChineseCLIPImageProcessor"
       SCREAMING_SNAKE_CASE 		=   ("BertTokenizer", "BertTokenizerFast")

       def __init__(						self     ,       __lowerCAmelCase=None     ,       __lowerCAmelCase=None     ,       **__lowerCAmelCase			)  ->  str:
        lowercase__    :   Optional[int]						= None
        if "feature_extractor" in kwargs:
         warnings.warn(
             '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
             ''' instead.'''     ,       lowerCamelCase_     ,       )
         lowercase__    :   Optional[Any]						= kwargs.pop('''feature_extractor'''			)

        lowercase__    :   Dict						= image_processor if image_processor is not None else feature_extractor
        if image_processor is None:
         raise ValueError('''You need to specify an `image_processor`.'''			)
        if tokenizer is None:
         raise ValueError('''You need to specify a `tokenizer`.'''			)

        super().__init__(lowerCamelCase_     ,       lowerCamelCase_			)
        lowercase__    :   List[str]						= self.image_processor

       def __call__(						self     ,       __lowerCAmelCase=None     ,       __lowerCAmelCase=None     ,       __lowerCAmelCase=None     ,       **__lowerCAmelCase			)  ->  Optional[int]:

        if text is None and images is None:
         raise ValueError('''You have to specify either text or images. Both cannot be none.'''			)

        if text is not None:
         lowercase__    :   str						= self.tokenizer(lowerCamelCase_     ,       return_tensors=lowerCamelCase_     ,       **lowerCamelCase_			)

        if images is not None:
         lowercase__    :   List[Any]						= self.image_processor(lowerCamelCase_     ,       return_tensors=lowerCamelCase_     ,       **lowerCamelCase_			)

        if text is not None and images is not None:
         lowercase__    :   str						= image_features.pixel_values
         return encoding
        elif text is not None:
         return encoding
        else:
         return BatchEncoding(data=dict(**lowerCamelCase_			)     ,       tensor_type=lowerCamelCase_			)

       def _lowerCAmelCase(						self     ,       *__lowerCAmelCase     ,       **__lowerCAmelCase			)  ->  Optional[int]:
        return self.tokenizer.batch_decode(*lowerCamelCase_     ,       **lowerCamelCase_			)

       def _lowerCAmelCase(						self     ,       *__lowerCAmelCase     ,       **__lowerCAmelCase			)  ->  Tuple:
        return self.tokenizer.decode(*lowerCamelCase_     ,       **lowerCamelCase_			)

       @property
       def _lowerCAmelCase(						self			)  ->  List[str]:
        lowercase__    :   List[Any]						= self.tokenizer.model_input_names
        lowercase__    :   Union[str, Any]						= self.image_processor.model_input_names
        return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names			)			)


       @property
       def _lowerCAmelCase(						self			)  ->  List[Any]:
        warnings.warn(
            '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''     ,       lowerCamelCase_     ,       )
        return self.image_processor_class


'''simple docstring'''

import qiskit
def       __UpperCamelCase	(       UpperCAmelCase		,					UpperCAmelCase					):
 lowercase__    :   Dict						= qiskit.Aer.get_backend('''aer_simulator'''					)

 # Create a Quantum Circuit acting on the q register
 lowercase__    :   Any						= qiskit.QuantumCircuit(UpperCAmelCase		,					UpperCAmelCase					)

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

 # Execute the circuit on the simulator
 lowercase__    :   Any						= 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)}')

