


"""simple docstring"""







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






class  __A							(			_SCREAMING_SNAKE_CASE     ):






 """simple docstring"""




 __lowerCAmelCase					   =    ["image_processor", "tokenizer"]
 __lowerCAmelCase					   =    "EfficientNetImageProcessor"
 __lowerCAmelCase					   =    ("BertTokenizer", "BertTokenizerFast")


 def __init__(						self					,       __A					,       __A		)   ->	List[str]:
     super().__init__(__A					,       __A		)


 def __call__(						self					,       __A=None					,       __A=None					,       __A="max_length"					,       __A=64					,       __A=None					,       **__A		)   ->	Union[str, Any]:
     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(
             __A					,       padding=__A					,       max_length=__A					,       return_tensors=__A					,       **__A		)

     if images is not None:
         a											=self.image_processor(__A					,       return_tensors=__A					,       **__A		)

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


 def  SCREAMING_SNAKE_CASE				(						self					,       *__A					,       **__A		)   ->	List[str]:
     return self.tokenizer.batch_decode(*__A					,       **__A		)


 def  SCREAMING_SNAKE_CASE				(						self					,       *__A					,       **__A		)   ->	str:
     return self.tokenizer.decode(*__A					,       **__A		)





 @property
 def  SCREAMING_SNAKE_CASE				(						self		)   ->	int:
     a											=self.tokenizer.model_input_names
     a											=self.image_processor.model_input_names
     return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names		)		)



"""simple docstring"""







import pytest

from datasets.utils.version import Version
@pytest.mark.parametrize(
    '''other, expected_equality'''			,       [
        (Version('''1.0.0'''						), True),
        ('''1.0.0''', True),
        (Version('''2.0.0'''						), False),
        ('''2.0.0''', False),
        ('''1''', False),
        ('''a''', False),
        (1, False),
        (None, False),
    ]			,       )
def _A		(		lowercase			,       lowercase						):







    """simple docstring"""
    a											=Version('''1.0.0'''						)
    assert (version == other) is expected_equality
    assert (version != other) is not expected_equality
    assert (hash(lowercase						) == hash(lowercase						)) is expected_equality