'''simple docstring'''


import warnings

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






class 					__SCREAMING_SNAKE_CASE						(	lowerCamelCase_	):







  '''simple docstring'''






  lowerCamelCase_		:Dict						   =		['''image_processor''', '''tokenizer''']
  lowerCamelCase_		:Any						   =		'''CLIPImageProcessor'''
  lowerCamelCase_		:Union[str, Any]						   =		('''CLIPTokenizer''', '''CLIPTokenizerFast''')


  def __init__(			self				,		snake_case_=None				,		snake_case_=None				,		**snake_case_						):




       '''simple docstring'''

       UpperCAmelCase_							:       str       =				None
       if "feature_extractor" in kwargs:
            warnings.warn(
                'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
                ' instead.'				,		snake_case_				,		)
            UpperCAmelCase_							:       Tuple       =				kwargs.pop('feature_extractor'						)

       UpperCAmelCase_							:       Optional[int]       =				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__(snake_case_				,		snake_case_						)


  def __call__(			self				,		snake_case_=None				,		snake_case_=None				,		snake_case_=None				,		**snake_case_						):




       '''simple docstring'''

       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:
            UpperCAmelCase_							:       Optional[int]       =				self.tokenizer(snake_case_				,		return_tensors=snake_case_				,		**snake_case_						)

       if images is not None:
            UpperCAmelCase_							:       Tuple       =				self.image_processor(snake_case_				,		return_tensors=snake_case_				,		**snake_case_						)

       if text is not None and images is not None:
            UpperCAmelCase_							:       Optional[Any]       =				image_features.pixel_values
            return encoding
       elif text is not None:
            return encoding
       else:
            return BatchEncoding(data=dict(**snake_case_						)				,		tensor_type=snake_case_						)


  def _UpperCamelCase					(			self				,		*snake_case_				,		**snake_case_						):




       '''simple docstring'''

       return self.tokenizer.batch_decode(*snake_case_				,		**snake_case_						)


  def _UpperCamelCase					(			self				,		*snake_case_				,		**snake_case_						):




       '''simple docstring'''

       return self.tokenizer.decode(*snake_case_				,		**snake_case_						)


  @property
  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Tuple       =				self.tokenizer.model_input_names
       UpperCAmelCase_							:       Optional[Any]       =				self.image_processor.model_input_names
       return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names						)						)


  @property
  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       warnings.warn(
           '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'				,		snake_case_				,		)
       return self.image_processor_class






  @property
  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       warnings.warn(
           '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'				,		snake_case_				,		)
       return self.image_processor







'''simple docstring'''


def  _lowerCamelCase   (				lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     return int(input_a == input_a == 0       )


def  _lowerCamelCase   (				):



     """simple docstring"""





     print('Truth Table of NOR Gate:'       )
     print('|   Input 1   |  Input 2  | Output |'       )
     print(F'''|      0      |    0      |  {nor_gate(0     ,					0       )}     |'''       )
     print(F'''|      0      |    1      |  {nor_gate(0     ,					1       )}     |'''       )
     print(F'''|      1      |    0      |  {nor_gate(1     ,					0       )}     |'''       )
     print(F'''|      1      |    1      |  {nor_gate(1     ,					1       )}     |'''       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()






