



import warnings
from typing import List, Optional, Union

from ...image_utils import ImageInput
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType






class      UpperCamelCase    (						_UpperCAmelCase     ):
	lowerCAmelCase	:   List[str]				=	["""image_processor""", """tokenizer"""]
	lowerCAmelCase	:   Dict				=	"""FlavaImageProcessor"""
	lowerCAmelCase	:   str				=	("""BertTokenizer""", """BertTokenizerFast""")



	def __init__(       self			,	UpperCAmelCase__=None			,	UpperCAmelCase__=None			,	**UpperCAmelCase__		):
							A__							=       None
							if "feature_extractor" in kwargs:
													warnings.warn(
													    "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
													    " instead."			,	UpperCAmelCase__			,	)
													A__							=       kwargs.pop("feature_extractor"		)

							A__							=       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__(UpperCAmelCase__			,	UpperCAmelCase__		)
							A__							=       self.image_processor



	def __call__(       self			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = True			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = 0			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = None			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = False			,	UpperCAmelCase__ = True			,	UpperCAmelCase__ = None			,	**UpperCAmelCase__			,	):

							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:
													A__							=       self.tokenizer(
													    text=UpperCAmelCase__			,	add_special_tokens=UpperCAmelCase__			,	padding=UpperCAmelCase__			,	truncation=UpperCAmelCase__			,	max_length=UpperCAmelCase__			,	stride=UpperCAmelCase__			,	pad_to_multiple_of=UpperCAmelCase__			,	return_token_type_ids=UpperCAmelCase__			,	return_attention_mask=UpperCAmelCase__			,	return_overflowing_tokens=UpperCAmelCase__			,	return_special_tokens_mask=UpperCAmelCase__			,	return_offsets_mapping=UpperCAmelCase__			,	return_length=UpperCAmelCase__			,	verbose=UpperCAmelCase__			,	return_tensors=UpperCAmelCase__			,	**UpperCAmelCase__			,	)
							if images is not None:
													A__							=       self.image_processor(
													    UpperCAmelCase__			,	return_image_mask=UpperCAmelCase__			,	return_codebook_pixels=UpperCAmelCase__			,	return_tensors=UpperCAmelCase__			,	**UpperCAmelCase__			,	)

							if text is not None and images is not None:
													encoding.update(UpperCAmelCase__		)
													return encoding
							elif text is not None:
													return encoding
							else:
													return BatchEncoding(data=dict(**UpperCAmelCase__		)			,	tensor_type=UpperCAmelCase__		)



	def 			__A							(       self			,	*UpperCAmelCase__			,	**UpperCAmelCase__		):
							return self.tokenizer.batch_decode(*UpperCAmelCase__			,	**UpperCAmelCase__		)



	def 			__A							(       self			,	*UpperCAmelCase__			,	**UpperCAmelCase__		):
							return self.tokenizer.decode(*UpperCAmelCase__			,	**UpperCAmelCase__		)



	@property
	def 			__A							(       self		):
							A__							=       self.tokenizer.model_input_names
							A__							=       self.image_processor.model_input_names
							return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names		)		)



	@property
	def 			__A							(       self		):
							warnings.warn(
							    "`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."			,	UpperCAmelCase__			,	)
							return self.image_processor_class



	@property
	def 			__A							(       self		):
							warnings.warn(
							    "`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead."			,	UpperCAmelCase__			,	)
							return self.image_processor










def  UpperCamelCase						(       _A			:				int			,							_A			:				int    )->       int:





						"""simple docstring"""





						return int((input_a, input_a).count(0    ) == 0    )
def  UpperCamelCase						(       )->       None:





						"""simple docstring"""





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





