


"""simple docstring"""






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




class 							A_      (       _a ):
  lowerCAmelCase__      			=	['image_processor', 'tokenizer']
  lowerCAmelCase__      			=	'AutoImageProcessor'
  lowerCAmelCase__      			=	'AutoTokenizer'


  def __init__(			self:						Optional[int]							,__lowerCAmelCase:						Dict							,__lowerCAmelCase:						Optional[Any]    ):







     '''simple docstring'''







     super().__init__(__lowerCAmelCase							,__lowerCAmelCase    )
     _lowerCamelCase   :				str							=     self.image_processor


  def __call__(			self:						int							,__lowerCAmelCase:						int=None							,__lowerCAmelCase:						List[Any]=None							,__lowerCAmelCase:						Optional[int]=None							,**__lowerCAmelCase:						Optional[int]    ):







     '''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:
        _lowerCamelCase   :				Dict							=     self.tokenizer(__lowerCAmelCase							,return_tensors=__lowerCAmelCase							,**__lowerCAmelCase    )

     if images is not None:
        _lowerCamelCase   :				Any							=     self.image_processor(__lowerCAmelCase							,return_tensors=__lowerCAmelCase							,**__lowerCAmelCase    )

     if text is not None and images is not None:
        _lowerCamelCase   :				int							=     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:						Dict							,*__lowerCAmelCase:						Optional[Any]							,**__lowerCAmelCase:						Optional[int]    ):







     '''simple docstring'''







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


  def 							_lowercase					(			self:						List[str]							,*__lowerCAmelCase:						List[Any]							,**__lowerCAmelCase:						Union[str, Any]    ):







     '''simple docstring'''







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






  @property
  def 							_lowercase					(			self:						Dict    ):







     '''simple docstring'''







     return ["input_ids", "attention_mask", "pixel_values"]




import re






def  lowerCamelCase_	(      lowerCAmelCase__	:	str				)       ->							str:

							'''simple docstring'''






							if len(re.findall('[ATCG]'			,	lowerCAmelCase__				)				) != len(lowerCAmelCase__				):
														raise ValueError('Invalid Strand'				)

							return dna.translate(dna.maketrans('ATCG'			,	'TAGC'				)				)


if __name__ == "__main__":
				import doctest

				doctest.testmod()