




import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin



class 						lowercase_					(						SCREAMING_SNAKE_CASE__  ):
      UpperCamelCase_    :	Union[str, Any]		   =       ["image_processor", "tokenizer"]
      UpperCamelCase_    :	Any		   =       "AutoImageProcessor"
      UpperCamelCase_    :	Tuple		   =       "AutoTokenizer"



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

        _snake_case		=							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__(A__    ,      A__	)
        _snake_case		=							self.image_processor
        _snake_case		=							False



      def __call__(    self   :       Tuple    ,      *A__   :       Tuple    ,      **A__   :       Optional[int]	)					->  List[Any]:



        if self._in_target_context_manager:
          return self.current_processor(*A__    ,      **A__	)

        _snake_case		=							kwargs.pop('''images'''    ,      A__	)
        _snake_case		=							kwargs.pop('''text'''    ,      A__	)
        if len(A__	) > 0:
          _snake_case		=							args[0]
          _snake_case		=							args[1:]

        if images is None and text is None:
          raise ValueError('''You need to specify either an `images` or `text` input to process.'''	)

        if images is not None:
          _snake_case		=							self.image_processor(A__    ,      *A__    ,      **A__	)
        if text is not None:
          _snake_case		=							self.tokenizer(A__    ,      **A__	)

        if text is None:
          return inputs
        elif images is None:
          return encodings
        else:
          _snake_case		=							encodings['''input_ids''']
          return inputs



      def 		UpperCamelCase_	(    self   :       Optional[Any]    ,      *A__   :       Optional[int]    ,      **A__   :       int	)					->  Any:
        return self.tokenizer.batch_decode(*A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       Any    ,      *A__   :       Dict    ,      **A__   :       Tuple	)					->  Optional[int]:
        return self.tokenizer.decode(*A__    ,      **A__	)



      @contextmanager
      def 		UpperCamelCase_	(    self   :       Optional[Any]	)					->  List[str]:
        warnings.warn(
            '''`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '''
            '''labels by using the argument `text` of the regular `__call__` method (either in the same call as '''
            '''your images inputs, or in a separate call.'''	)
        _snake_case		=							True
        _snake_case		=							self.tokenizer
        yield
        _snake_case		=							self.image_processor
        _snake_case		=							False



      @property
      def 		UpperCamelCase_	(    self   :       int	)					->  Union[str, Any]:
        warnings.warn(
            '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''    ,      A__    ,      )
        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.'''    ,      A__    ,      )
        return self.image_processor




import numpy as np



def    snake_case_(_UpperCamelCase  )							->			Any:



  """simple docstring"""






  _snake_case		=							np.exp(_UpperCamelCase  )

  # Add up the all the exponentials
  _snake_case		=							np.sum(_UpperCamelCase  )

  # Divide every exponent by the sum of all exponents
  _snake_case		=							exponent_vector / sum_of_exponents

  return softmax_vector


if __name__ == "__main__":
 print(softmax((0,)))

