

import numpy as np

from transformers import Pipeline



def 				snake_case_(_UpperCamelCase					)							->     str:



  """simple docstring"""






  _snake_case						=							np.max(_UpperCamelCase			,	axis=-1			,	keepdims=_UpperCamelCase					)
  _snake_case						=							np.exp(outputs - maxes					)
  return shifted_exp / shifted_exp.sum(axis=-1			,	keepdims=_UpperCamelCase					)



class   lowercase_   (  __lowercase					):



      def 						UpperCamelCase_		(      self				:    List[Any]      , **A__				:    List[str]		)   ->					Optional[Any]:
        _snake_case						=							{}
        if "second_text" in kwargs:
          _snake_case						=							kwargs['''second_text''']
        return preprocess_kwargs, {}, {}



      def 						UpperCamelCase_		(      self				:    Union[str, Any]      , A__				:    Dict      , A__				:    Tuple=None		)   ->					List[Any]:
        return self.tokenizer(A__      , text_pair=A__      , return_tensors=self.framework		)



      def 						UpperCamelCase_		(      self				:    Dict      , A__				:    int		)   ->					Union[str, Any]:
        return self.model(**A__		)







      def 						UpperCamelCase_		(      self				:    Union[str, Any]      , A__				:    str		)   ->					Tuple:
        _snake_case						=							model_outputs.logits[0].numpy()
        _snake_case						=							softmax(A__		)

        _snake_case						=							np.argmax(A__		)
        _snake_case						=							self.model.config.idalabel[best_class]
        _snake_case						=							probabilities[best_class].item()
        _snake_case						=							logits.tolist()
        return {"label": label, "score": score, "logits": logits}




import cmath
import math



def 				snake_case_(_UpperCamelCase			,	_UpperCamelCase			,	_UpperCamelCase			,	_UpperCamelCase					)							->     complex:



  """simple docstring"""






  _snake_case						=							math.radians(_UpperCamelCase					)
  _snake_case						=							math.radians(_UpperCamelCase					)

  # Convert voltage and current to rectangular form
  _snake_case						=							cmath.rect(_UpperCamelCase			,	_UpperCamelCase					)
  _snake_case						=							cmath.rect(_UpperCamelCase			,	_UpperCamelCase					)

  # Calculate apparent power
  return voltage_rect * current_rect


if __name__ == "__main__":
 import doctest

 doctest.testmod()

