





"""simple docstring"""
import warnings

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






class       _SCREAMING_SNAKE_CASE(     A						):
       SCREAMING_SNAKE_CASE_     :   Optional[int]					=						['''image_processor''', '''tokenizer''']
       SCREAMING_SNAKE_CASE_     :   int					=						'''VideoMAEImageProcessor'''
       SCREAMING_SNAKE_CASE_     :   List[str]					=						('''CLIPTokenizer''', '''CLIPTokenizerFast''')




       def __init__(		self	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=None	,**SCREAMING_SNAKE_CASE__							)    ->   int:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :Optional[int]	       =						None
             if "feature_extractor" in kwargs:
                   warnings.warn(
                       '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
                       ''' instead.'''	,SCREAMING_SNAKE_CASE__	,)
                   __SCREAMING_SNAKE_CASE     :int	       =						kwargs.pop('''feature_extractor'''							)

             __SCREAMING_SNAKE_CASE     :str	       =						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__(SCREAMING_SNAKE_CASE__	,SCREAMING_SNAKE_CASE__							)
             __SCREAMING_SNAKE_CASE     :str	       =						self.image_processor




       def __call__(		self	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=None	,**SCREAMING_SNAKE_CASE__							)    ->   str:





             """simple docstring"""






             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:
                   __SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						self.tokenizer(SCREAMING_SNAKE_CASE__	,return_tensors=SCREAMING_SNAKE_CASE__	,**SCREAMING_SNAKE_CASE__							)

             if videos is not None:
                   __SCREAMING_SNAKE_CASE     :str	       =						self.image_processor(SCREAMING_SNAKE_CASE__	,return_tensors=SCREAMING_SNAKE_CASE__	,**SCREAMING_SNAKE_CASE__							)

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




       def 					_UpperCamelCase  (		self	,*SCREAMING_SNAKE_CASE__	,**SCREAMING_SNAKE_CASE__							)    ->   Dict:





             """simple docstring"""






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




       def 					_UpperCamelCase  (		self	,*SCREAMING_SNAKE_CASE__	,**SCREAMING_SNAKE_CASE__							)    ->   Optional[Any]:





             """simple docstring"""






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




       @property
       def 					_UpperCamelCase  (		self							)    ->   Optional[Any]:





             """simple docstring"""






             return ["input_ids", "attention_mask", "position_ids", "pixel_values"]




       @property
       def 					_UpperCamelCase  (		self							)    ->   Tuple:





             """simple docstring"""






             warnings.warn(
                 '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''	,SCREAMING_SNAKE_CASE__	,)
             return self.image_processor_class




       @property
       def 					_UpperCamelCase  (		self							)    ->   str:





             """simple docstring"""






             warnings.warn(
                 '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''	,SCREAMING_SNAKE_CASE__	,)
             return self.image_processor






"""simple docstring"""
def   __lowerCamelCase     (							a_  :	str							)    ->   int:
      __SCREAMING_SNAKE_CASE     :List[Any]	       =						0
      for plain_chr in plain_text:
            __SCREAMING_SNAKE_CASE     :List[str]	       =						(
                ord(a_							) + (hash_value << 6) + (hash_value << 16) - hash_value
            )
      return hash_value