




'''simple docstring'''






import warnings

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






class 					lowercase_			(	lowerCAmelCase_       ):
     A_       							= ["image_processor", "tokenizer"]
     A_       							= "AutoImageProcessor"
     A_       							= "AutoTokenizer"





     def __init__(    self    :				Any    ,       __lowerCamelCase    :				Union[str, Any]=None    ,       __lowerCamelCase    :				int=None    ,       **__lowerCamelCase    :				Optional[int] ):
           snake_case__					:      Union[str, Any]  			=						None
           if "feature_extractor" in kwargs:
                 warnings.warn(
                     'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
                     ' instead.'    ,       __lowerCamelCase    ,       )
                 snake_case__					:      str  			=						kwargs.pop('feature_extractor' )

           snake_case__					:      Optional[Any]  			=						image_processor if image_processor is not None else feature_extractor
           if image_processor is None:
                 raise ValueError('You have to specify an image_processor.' )
           if tokenizer is None:
                 raise ValueError('You have to specify a tokenizer.' )

           super().__init__(__lowerCamelCase    ,       __lowerCamelCase )
           snake_case__					:      Optional[int]  			=						self.image_processor





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

           if images is not None:
                 snake_case__					:      Dict  			=						self.image_processor(__lowerCamelCase    ,       return_tensors=__lowerCamelCase    ,       **__lowerCamelCase )

           if text is not None and images is not None:
                 snake_case__					:      List[Any]  			=						image_features.pixel_values
                 return encoding
           elif text is not None:
                 return encoding
           else:
                 return BatchEncoding(data=dict(**__lowerCamelCase )    ,       tensor_type=__lowerCamelCase )





     def  _lowerCAmelCase			(    self    :				List[Any]    ,       *__lowerCamelCase    :				Optional[int]    ,       **__lowerCamelCase    :				str ):
           return self.tokenizer.batch_decode(*__lowerCamelCase    ,       **__lowerCamelCase )





     def  _lowerCAmelCase			(    self    :				List[str]    ,       *__lowerCamelCase    :				str    ,       **__lowerCamelCase    :				Dict ):
           return self.tokenizer.decode(*__lowerCamelCase    ,       **__lowerCamelCase )





     @property
     def  _lowerCAmelCase			(    self    :				List[Any] ):
           snake_case__					:      List[str]  			=						self.tokenizer.model_input_names
           snake_case__					:      Dict  			=						self.image_processor.model_input_names
           return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names ) )





     @property
     def  _lowerCAmelCase			(    self    :				Any ):
           warnings.warn(
               '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'    ,       __lowerCamelCase    ,       )
           return self.image_processor_class





     @property
     def  _lowerCAmelCase			(    self    :				List[str] ):
           warnings.warn(
               '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'    ,       __lowerCamelCase    ,       )
           return self.image_processor






'''simple docstring'''






def 		UpperCamelCase__			(		__SCREAMING_SNAKE_CASE = 1000		)						->      int:
      snake_case__					:      List[str]  			=						0
      snake_case__					:      int  			=						(n - 1) // 3
      total += ((terms) * (6 + (terms - 1) * 3)) // 2  # total of an A.P.
      snake_case__					:      Optional[Any]  			=						(n - 1) // 5
      total += ((terms) * (10 + (terms - 1) * 5)) // 2
      snake_case__					:      Tuple  			=						(n - 1) // 15
      total -= ((terms) * (30 + (terms - 1) * 15)) // 2
      return total


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