import warnings

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



class 						snake_case_ (	__A ):
   __A			:	Dict        =       ["image_processor", "tokenizer"]
   __A			:	Union[str, Any]        =       "VideoMAEImageProcessor"
   __A			:	Optional[int]        =       ("CLIPTokenizer", "CLIPTokenizerFast")






   def __init__(   self       :  List[Any]			,		lowercase_       :  Any=None			,		lowercase_       :  Union[str, Any]=None			,		**lowercase_       :  Dict						)      ->		Union[str, Any]:
       lowercase__				:     Dict					      =       None
       if "feature_extractor" in kwargs:
           warnings.warn(
               "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
               " instead."			,		lowercase_			,		)
           lowercase__				:     int					      =       kwargs.pop("feature_extractor"						)

       lowercase__				:     Tuple					      =       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__(lowercase_			,		lowercase_						)
       lowercase__				:     Dict					      =       self.image_processor






   def __call__(   self       :  List[str]			,		lowercase_       :  Any=None			,		lowercase_       :  Optional[Any]=None			,		lowercase_       :  Optional[Any]=None			,		**lowercase_       :  Dict						)      ->		Optional[int]:

       if text is None and videos is None:
           raise ValueError("You have to specify either text or videos. Both cannot be none."						)

       if text is not None:
           lowercase__				:     str					      =       self.tokenizer(lowercase_			,		return_tensors=lowercase_			,		**lowercase_						)

       if videos is not None:
           lowercase__				:     List[Any]					      =       self.image_processor(lowercase_			,		return_tensors=lowercase_			,		**lowercase_						)

       if text is not None and videos is not None:
           lowercase__				:     Optional[int]					      =       image_features.pixel_values
           return encoding
       elif text is not None:
           return encoding
       else:
           return BatchEncoding(data=dict(**lowercase_						)			,		tensor_type=lowercase_						)






   def    __UpperCamelCase  (   self       :  List[str]			,		*lowercase_       :  Any			,		**lowercase_       :  Any						)      ->		Union[str, Any]:
       return self.tokenizer.batch_decode(*lowercase_			,		**lowercase_						)






   def    __UpperCamelCase  (   self       :  Optional[Any]			,		*lowercase_       :  str			,		**lowercase_       :  str						)      ->		Union[str, Any]:
       return self.tokenizer.decode(*lowercase_			,		**lowercase_						)






   @property
   def    __UpperCamelCase  (   self       :  Optional[Any]						)      ->		Dict:
       return ["input_ids", "attention_mask", "position_ids", "pixel_values"]






   @property
   def    __UpperCamelCase  (   self       :  Union[str, Any]						)      ->		List[str]:
       warnings.warn(
           "`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."			,		lowercase_			,		)
       return self.image_processor_class







   @property
   def    __UpperCamelCase  (   self       :  Dict						)      ->		Any:
       warnings.warn(
           "`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead."			,		lowercase_			,		)
       return self.image_processor




from typing import Callable

def     lowercase_       (    _lowerCamelCase							: Callable):

    def wrapper(_lowerCamelCase							: str):
        lowercase__				:     Tuple					      =       function_with_docstring.__doc__
        return target_function

    return wrapper



