



'''simple docstring'''





import numpy as np

from transformers import Pipeline

def 			a_	(				_lowerCAmelCase			) -> Optional[int]:
  __lowerCamelCase			:			Optional[Any]       			=					np.max(_lowerCAmelCase			,axis=-1			,keepdims=_lowerCAmelCase			)
  __lowerCamelCase			:			int       			=					np.exp(outputs - maxes			)
  return shifted_exp / shifted_exp.sum(axis=-1			,keepdims=_lowerCAmelCase			)






class    lowerCamelCase_       (							SCREAMING_SNAKE_CASE_	):
  """simple docstring"""




  def 		_lowercase	(					self :      List[str]     ,      **_a :      Dict  )   ->   str:
    __lowerCamelCase			:			str       			=					{}
    if "second_text" in kwargs:
      __lowerCamelCase			:			Optional[int]       			=					kwargs['second_text']
    return preprocess_kwargs, {}, {}




  def 		_lowercase	(					self :      Optional[Any]     ,      _a :      Optional[int]     ,      _a :      Dict=None  )   ->   Optional[int]:
    return self.tokenizer(_a     ,      text_pair=_a     ,      return_tensors=self.framework  )




  def 		_lowercase	(					self :      List[Any]     ,      _a :      Optional[Any]  )   ->   List[str]:
    return self.model(**_a  )




  def 		_lowercase	(					self :      List[str]     ,      _a :      Optional[Any]  )   ->   Optional[Any]:
    __lowerCamelCase			:			int       			=					model_outputs.logits[0].numpy()
    __lowerCamelCase			:			str       			=					softmax(_a  )

    __lowerCamelCase			:			List[Any]       			=					np.argmax(_a  )
    __lowerCamelCase			:			Tuple       			=					self.model.config.idalabel[best_class]
    __lowerCamelCase			:			List[str]       			=					probabilities[best_class].item()
    __lowerCamelCase			:			Tuple       			=					logits.tolist()
    return {"label": label, "score": score, "logits": logits}











'''simple docstring'''





def 			a_	(				_lowerCAmelCase			) -> int:

  if not isinstance(_lowerCAmelCase			,_lowerCAmelCase			):
    raise TypeError('only integers accepted as input'			)
  else:
    __lowerCamelCase			:			Any       			=					str(abs(_lowerCAmelCase			)			)
    __lowerCamelCase			:			Tuple       			=					[list(_lowerCAmelCase			) for char in range(len(_lowerCAmelCase			)			)]
    for index in range(len(_lowerCAmelCase			)			):
      num_transpositions[index].pop(_lowerCAmelCase			)
    return max(
        int(''.join(list(_lowerCAmelCase			)			)			) for transposition in num_transpositions			)


if __name__ == "__main__":
   __import__('doctest').testmod()






