




import warnings

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

class        _lowerCamelCase  (	_SCREAMING_SNAKE_CASE      ):

      """simple docstring"""

      lowerCAmelCase__	:       List[str]			=    ["image_processor", "tokenizer"]
      lowerCAmelCase__	:       List[str]			=    "VideoMAEImageProcessor"
      lowerCAmelCase__	:       List[Any]			=    ("CLIPTokenizer", "CLIPTokenizerFast")







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

          __UpperCamelCase     						=  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__(snake_case       ,				snake_case )
          __UpperCamelCase     						=  self.image_processor







      def __call__(   self    :       Optional[int]       ,				snake_case    :       Optional[int]=None       ,				snake_case    :       Tuple=None       ,				snake_case    :       List[Any]=None       ,				**snake_case    :       Tuple ):

          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:
              __UpperCamelCase     						=  self.tokenizer(snake_case       ,				return_tensors=snake_case       ,				**snake_case )

          if videos is not None:
              __UpperCamelCase     						=  self.image_processor(snake_case       ,				return_tensors=snake_case       ,				**snake_case )

          if text is not None and videos is not None:
              __UpperCamelCase     						=  image_features.pixel_values
              return encoding
          elif text is not None:
              return encoding
          else:
              return BatchEncoding(data=dict(**snake_case )       ,				tensor_type=snake_case )







      def 					snake_case		(   self    :       Union[str, Any]       ,				*snake_case    :       Dict       ,				**snake_case    :       List[Any] ):
          return self.tokenizer.batch_decode(*snake_case       ,				**snake_case )







      def 					snake_case		(   self    :       str       ,				*snake_case    :       int       ,				**snake_case    :       List[Any] ):
          return self.tokenizer.decode(*snake_case       ,				**snake_case )







      @property
      def 					snake_case		(   self    :       List[Any] ):
          return ["input_ids", "attention_mask", "position_ids", "pixel_values"]







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







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












def     __SCREAMING_SNAKE_CASE      (     lowercase_					)				->		bool:

    """simple docstring"""


    if not isinstance(lowercase_    ,   lowercase_					):
        __UpperCamelCase     						=  F"Input value of [number={number}] must be an integer"
        raise TypeError(lowercase_					)
    if number < 0 or number % 2 == 1:
        return False
    __UpperCamelCase     						=  int(number**0.5					)
    return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
 import doctest

 doctest.testmod()






