"""simple docstring"""




import os
from typing import List, Optional, Union

from ...image_processing_utils import BatchFeature
from ...image_utils import ImageInput
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType
from ..auto import AutoTokenizer

class    a_   (  __UpperCamelCase      ):
					UpperCamelCase_			:						Union[str, Any]      =     ["image_processor", "tokenizer"]
					UpperCamelCase_			:						List[str]      =     "BlipImageProcessor"
					UpperCamelCase_			:						int      =     "AutoTokenizer"




					def __init__(						self    :  List[Any]	,    snake_case__    :  Union[str, Any]	,    snake_case__    :  Union[str, Any]	,    snake_case__    :  List[Any]  ):
							super().__init__(snake_case__	,    snake_case__  )

							# add QFormer tokenizer
							lowerCAmelCase__   = qformer_tokenizer




					def __call__(						self    :  Optional[int]	,    snake_case__    :  ImageInput = None	,    snake_case__    :  Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None	,    snake_case__    :  bool = True	,    snake_case__    :  Union[bool, str, PaddingStrategy] = False	,    snake_case__    :  Union[bool, str, TruncationStrategy] = None	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  int = 0	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  Optional[bool] = None	,    snake_case__    :  bool = False	,    snake_case__    :  bool = False	,    snake_case__    :  bool = False	,    snake_case__    :  bool = False	,    snake_case__    :  bool = False	,    snake_case__    :  bool = True	,    snake_case__    :  Optional[Union[str, TensorType]] = None	,    **snake_case__    :  Optional[Any]	,    ):
							if images is None and text is None:
									raise ValueError("""You have to specify at least images or text."""  )

							lowerCAmelCase__   = BatchFeature()

							if text is not None:
									lowerCAmelCase__   = self.tokenizer(
									    text=snake_case__	,    add_special_tokens=snake_case__	,    padding=snake_case__	,    truncation=snake_case__	,    max_length=snake_case__	,    stride=snake_case__	,    pad_to_multiple_of=snake_case__	,    return_attention_mask=snake_case__	,    return_overflowing_tokens=snake_case__	,    return_special_tokens_mask=snake_case__	,    return_offsets_mapping=snake_case__	,    return_token_type_ids=snake_case__	,    return_length=snake_case__	,    verbose=snake_case__	,    return_tensors=snake_case__	,    **snake_case__	,    )
									encoding.update(snake_case__  )
									lowerCAmelCase__   = self.qformer_tokenizer(
									    text=snake_case__	,    add_special_tokens=snake_case__	,    padding=snake_case__	,    truncation=snake_case__	,    max_length=snake_case__	,    stride=snake_case__	,    pad_to_multiple_of=snake_case__	,    return_attention_mask=snake_case__	,    return_overflowing_tokens=snake_case__	,    return_special_tokens_mask=snake_case__	,    return_offsets_mapping=snake_case__	,    return_token_type_ids=snake_case__	,    return_length=snake_case__	,    verbose=snake_case__	,    return_tensors=snake_case__	,    **snake_case__	,    )
									lowerCAmelCase__   = qformer_text_encoding.pop("""input_ids"""  )
									lowerCAmelCase__   = qformer_text_encoding.pop("""attention_mask"""  )

							if images is not None:
									lowerCAmelCase__   = self.image_processor(snake_case__	,    return_tensors=snake_case__  )
									encoding.update(snake_case__  )

							return encoding




					def     _SCREAMING_SNAKE_CASE    (						self    :  str	,    *snake_case__    :  Tuple	,    **snake_case__    :  Dict  ):
							return self.tokenizer.batch_decode(*snake_case__	,    **snake_case__  )




					def     _SCREAMING_SNAKE_CASE    (						self    :  Dict	,    *snake_case__    :  Optional[int]	,    **snake_case__    :  Any  ):
							return self.tokenizer.decode(*snake_case__	,    **snake_case__  )




					@property
					# Copied from transformers.models.blip.processing_blip.BlipProcessor.model_input_names
					def     _SCREAMING_SNAKE_CASE    (						self    :  Any  ):
							lowerCAmelCase__   = self.tokenizer.model_input_names
							lowerCAmelCase__   = self.image_processor.model_input_names
							return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names  )  )




					def     _SCREAMING_SNAKE_CASE    (						self    :  Union[str, Any]	,    snake_case__    :  Optional[Any]	,    **snake_case__    :  Dict  ):
							if os.path.isfile(snake_case__  ):
									raise ValueError(F"""Provided path ({save_directory}) should be a directory, not a file"""  )
							os.makedirs(snake_case__	,    exist_ok=snake_case__  )
							lowerCAmelCase__   = os.path.join(snake_case__	,    """qformer_tokenizer"""  )
							self.qformer_tokenizer.save_pretrained(snake_case__  )
							return super().save_pretrained(snake_case__	,    **snake_case__  )




					@classmethod
					def     _SCREAMING_SNAKE_CASE    (						cls    :  Tuple	,    snake_case__    :  Dict	,    **snake_case__    :  Any  ):
							lowerCAmelCase__   = AutoTokenizer.from_pretrained(snake_case__	,    subfolder="""qformer_tokenizer"""  )
							lowerCAmelCase__   = cls._get_arguments_from_pretrained(snake_case__	,    **snake_case__  )
							args.append(snake_case__  )
							return cls(*snake_case__  )





"""simple docstring"""




from itertools import permutations







def 				_UpperCAmelCase		(							lowerCamelCase__  ):





		"""simple docstring"""




		if num[3] % 2 != 0:
				return False

		if (num[2] + num[3] + num[4]) % 3 != 0:
				return False

		if num[5] % 5 != 0:
				return False

		lowerCAmelCase__   = [7, 11, 13, 17]
		for i, test in enumerate(lowerCamelCase__  ):
				if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
						return False
		return True







def 				_UpperCAmelCase		(							lowerCamelCase__ = 10  ):





		"""simple docstring"""




		return sum(
		    int("""""".join(map(lowerCamelCase__      ,	lowerCamelCase__  )  )  )
		    for num in permutations(range(lowerCamelCase__  )  )
		    if is_substring_divisible(lowerCamelCase__  )  )


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




