

import warnings

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

class 				__UpperCamelCase				(					SCREAMING_SNAKE_CASE			):
	_lowercase  :   List[str]       				=  ["image_processor", "tokenizer"]
	_lowercase  :   Optional[Any]       				=  "CLIPImageProcessor"
	_lowercase  :   int       				=  ("XLMRobertaTokenizer", "XLMRobertaTokenizerFast")







	def __init__(   self: str  , __UpperCamelCase: List[Any]=None  , __UpperCamelCase: List[Any]=None  , **__UpperCamelCase: Optional[Any]      ):

						'''simple docstring'''





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

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







	def __call__(   self: Any  , __UpperCamelCase: List[str]=None  , __UpperCamelCase: Tuple=None  , __UpperCamelCase: Union[str, Any]=None  , **__UpperCamelCase: 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:
											__magic_name__							=    self.tokenizer(__UpperCamelCase  , return_tensors=__UpperCamelCase  , **__UpperCamelCase      )

						if images is not None:
											__magic_name__							=    self.image_processor(__UpperCamelCase  , return_tensors=__UpperCamelCase  , **__UpperCamelCase      )

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







	def 	_SCREAMING_SNAKE_CASE							(   self: Union[str, Any]  , *__UpperCamelCase: Tuple  , **__UpperCamelCase: str      ):

						'''simple docstring'''





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







	def 	_SCREAMING_SNAKE_CASE							(   self: Optional[Any]  , *__UpperCamelCase: Tuple  , **__UpperCamelCase: int      ):

						'''simple docstring'''





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







	@property
	def 	_SCREAMING_SNAKE_CASE							(   self: Optional[int]      ):

						'''simple docstring'''





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







from __future__ import annotations




def 					_lowercase     (				a_				:					int				)				->	bool:




					'''simple docstring'''







					__magic_name__							=    str(a_				)
					return len(a_				) == 9 and set(a_				) == set('123456789'				)




def 					_lowercase     (				)				->	int | None:




					'''simple docstring'''







					for base_num in range(9_9_9_9					,4_9_9_9					,-1				):
										__magic_name__							=    1_0_0_0_0_2 * base_num
										if is_9_pandigital(a_				):
															return candidate

					for base_num in range(3_3_3					,9_9					,-1				):
										__magic_name__							=    1_0_0_2_0_0_3 * base_num
										if is_9_pandigital(a_				):
															return candidate

					return None


if __name__ == "__main__":
						print(f'''{solution() = }''')




