


import warnings

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






class   __lowercase				(  __snake_case  ):
      UpperCamelCase								=       ['''image_processor''', '''tokenizer''']
      UpperCamelCase								=       '''CLIPImageProcessor'''
      UpperCamelCase								=       ('''XLMRobertaTokenizer''', '''XLMRobertaTokenizerFast''')





      def __init__(		self						:					List[Any]					,       __lowerCamelCase						:					Optional[Any]=None					,       __lowerCamelCase						:					Dict=None					,       **__lowerCamelCase						:					Any       )    ->   List[Any]:






         """simple docstring"""







         UpperCAmelCase							=     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					,       )
            UpperCAmelCase							=     kwargs.pop("""feature_extractor"""       )

         UpperCAmelCase							=     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       )





      def __call__(		self						:					Tuple					,       __lowerCamelCase						:					List[str]=None					,       __lowerCamelCase						:					Tuple=None					,       __lowerCamelCase						:					Dict=None					,       **__lowerCamelCase						:					Union[str, Any]       )    ->   Dict:






         """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							=     self.tokenizer(__lowerCamelCase					,       return_tensors=__lowerCamelCase					,       **__lowerCamelCase       )

         if images is not None:
            UpperCAmelCase							=     self.image_processor(__lowerCamelCase					,       return_tensors=__lowerCamelCase					,       **__lowerCamelCase       )

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





      def        _lowercase				(		self						:					List[str]					,       *__lowerCamelCase						:					Tuple					,       **__lowerCamelCase						:					Dict       )    ->   Optional[Any]:






         """simple docstring"""







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





      def        _lowercase				(		self						:					Any					,       *__lowerCamelCase						:					str					,       **__lowerCamelCase						:					List[Any]       )    ->   int:






         """simple docstring"""







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





      @property
      def        _lowercase				(		self						:					int       )    ->   Tuple:






         """simple docstring"""







         UpperCAmelCase							=     self.tokenizer.model_input_names
         UpperCAmelCase							=     self.image_processor.model_input_names
         return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names       )       )







def   _UpperCamelCase				(						lowerCAmelCase_  ,						lowerCAmelCase_   )						->int:
   return int((input_a, input_a).count(0   ) == 0   )
def   _UpperCamelCase				(						)						->None:
   assert and_gate(0  ,						0   ) == 0
   assert and_gate(0  ,						1   ) == 0
   assert and_gate(1  ,						0   ) == 0
   assert and_gate(1  ,						1   ) == 1


if __name__ == "__main__":
 test_and_gate()
 print(and_gate(1, 0))
 print(and_gate(0, 0))
 print(and_gate(0, 1))
 print(and_gate(1, 1))



