
"""simple docstring"""







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 			A__	(     _lowerCamelCase):
		A_						:	Dict           =     ['image_processor', 'tokenizer']
		A_						:	Union[str, Any]           =     'BlipImageProcessor'
		A_						:	Optional[Any]           =     ('BertTokenizer', 'BertTokenizerFast')

		def __init__(				self	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE			):
			__lowerCAmelCase      :						Dict						      =				False
			super().__init__(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE			)
			__lowerCAmelCase      :						Optional[int]						      =				self.image_processor

		def __call__(				self	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = True	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = 0	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = None	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = False	,		_SCREAMING_SNAKE_CASE = True	,		_SCREAMING_SNAKE_CASE = None	,		**_SCREAMING_SNAKE_CASE	,		):
			if images is None and text is None:
				raise ValueError('You have to specify either images or text.'			)

			# Get only text
			if images is None:
				__lowerCAmelCase      :						Dict						      =				self.tokenizer
				__lowerCAmelCase      :						Dict						      =				self.tokenizer(
				    text=_SCREAMING_SNAKE_CASE	,		add_special_tokens=_SCREAMING_SNAKE_CASE	,		padding=_SCREAMING_SNAKE_CASE	,		truncation=_SCREAMING_SNAKE_CASE	,		max_length=_SCREAMING_SNAKE_CASE	,		stride=_SCREAMING_SNAKE_CASE	,		pad_to_multiple_of=_SCREAMING_SNAKE_CASE	,		return_attention_mask=_SCREAMING_SNAKE_CASE	,		return_overflowing_tokens=_SCREAMING_SNAKE_CASE	,		return_special_tokens_mask=_SCREAMING_SNAKE_CASE	,		return_offsets_mapping=_SCREAMING_SNAKE_CASE	,		return_token_type_ids=_SCREAMING_SNAKE_CASE	,		return_length=_SCREAMING_SNAKE_CASE	,		verbose=_SCREAMING_SNAKE_CASE	,		return_tensors=_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE	,		)
				return text_encoding

			# add pixel_values
			__lowerCAmelCase      :						str						      =				self.image_processor(_SCREAMING_SNAKE_CASE	,		return_tensors=_SCREAMING_SNAKE_CASE			)

			if text is not None:
				__lowerCAmelCase      :						str						      =				self.tokenizer(
				    text=_SCREAMING_SNAKE_CASE	,		add_special_tokens=_SCREAMING_SNAKE_CASE	,		padding=_SCREAMING_SNAKE_CASE	,		truncation=_SCREAMING_SNAKE_CASE	,		max_length=_SCREAMING_SNAKE_CASE	,		stride=_SCREAMING_SNAKE_CASE	,		pad_to_multiple_of=_SCREAMING_SNAKE_CASE	,		return_attention_mask=_SCREAMING_SNAKE_CASE	,		return_overflowing_tokens=_SCREAMING_SNAKE_CASE	,		return_special_tokens_mask=_SCREAMING_SNAKE_CASE	,		return_offsets_mapping=_SCREAMING_SNAKE_CASE	,		return_token_type_ids=_SCREAMING_SNAKE_CASE	,		return_length=_SCREAMING_SNAKE_CASE	,		verbose=_SCREAMING_SNAKE_CASE	,		return_tensors=_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE	,		)
			else:
				__lowerCAmelCase      :						List[Any]						      =				None

			if text_encoding is not None:
				encoding_image_processor.update(_SCREAMING_SNAKE_CASE			)

			return encoding_image_processor

		def 							__lowerCamelCase							(				self	,		*_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE			):
			return self.tokenizer.batch_decode(*_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE			)

		def 							__lowerCamelCase							(				self	,		*_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE			):
			return self.tokenizer.decode(*_SCREAMING_SNAKE_CASE	,		**_SCREAMING_SNAKE_CASE			)







		@property
		def 							__lowerCamelCase							(				self			):
			__lowerCAmelCase      :						Tuple						      =				self.tokenizer.model_input_names
			__lowerCAmelCase      :						Optional[int]						      =				self.image_processor.model_input_names
			return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names			)			)

"""simple docstring"""







from __future__ import annotations
def    __lowerCAmelCase    (_UpperCamelCase		):
	__lowerCAmelCase      :						List[str]						      =				str(_UpperCamelCase		)
	return len(_UpperCamelCase		) == 9 and set(_UpperCamelCase		) == set('123456789'		)
def    __lowerCAmelCase    ():
	for base_num in range(9999	,  4999	,  -1		):
		__lowerCAmelCase      :						Union[str, Any]						      =				10_0002 * base_num
		if is_9_pandigital(_UpperCamelCase		):
			return candidate

	for base_num in range(333	,  99	,  -1		):
		__lowerCAmelCase      :						Dict						      =				100_2003 * base_num
		if is_9_pandigital(_UpperCamelCase		):
			return candidate

	return None


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