






'''simple docstring'''
import numpy as np

from transformers import Pipeline





def  _a(  UpperCamelCase__				:						Union[str, Any]							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__     :				Tuple							 =np.max(UpperCamelCase__,	axis=-1,	keepdims=UpperCamelCase__							)
      SCREAMING_SNAKE_CASE__     :				Any							 =np.exp(outputs - maxes							)
      return shifted_exp / shifted_exp.sum(axis=-1,	keepdims=UpperCamelCase__							)







class      __SCREAMING_SNAKE_CASE      (			lowercase_				):




 def      __magic_name__	(      self	:							List[str]					,      **__lowercase	:							List[str]      )	->						int:
       SCREAMING_SNAKE_CASE__     :				List[Any]							 ={}
       if "second_text" in kwargs:
             SCREAMING_SNAKE_CASE__     :				List[str]							 =kwargs['''second_text''']
       return preprocess_kwargs, {}, {}




 def      __magic_name__	(      self	:							List[Any]					,      __lowercase	:							List[str]					,      __lowercase	:							List[Any]=None      )	->						Optional[Any]:
       return self.tokenizer(__lowercase					,      text_pair=__lowercase					,      return_tensors=self.framework      )




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




 def      __magic_name__	(      self	:							Any					,      __lowercase	:							Any      )	->						Tuple:
       SCREAMING_SNAKE_CASE__     :				Optional[Any]							 =model_outputs.logits[0].numpy()
       SCREAMING_SNAKE_CASE__     :				List[Any]							 =softmax(__lowercase      )

       SCREAMING_SNAKE_CASE__     :				Union[str, Any]							 =np.argmax(__lowercase      )
       SCREAMING_SNAKE_CASE__     :				Optional[int]							 =self.model.config.idalabel[best_class]
       SCREAMING_SNAKE_CASE__     :				str							 =probabilities[best_class].item()
       SCREAMING_SNAKE_CASE__     :				Optional[Any]							 =logits.tolist()
       return {"label": label, "score": score, "logits": logits}







'''simple docstring'''
class      __SCREAMING_SNAKE_CASE      :




 def __init__(      self	:							List[Any]					,      __lowercase	:							int      )	->						None:
       SCREAMING_SNAKE_CASE__     :				Union[str, Any]									=size
       SCREAMING_SNAKE_CASE__     :				List[Any]									=[0] * size
       SCREAMING_SNAKE_CASE__     :				str									=[0] * size




 @staticmethod
 def      __magic_name__	(      __lowercase	:							int      )	->						int:
       return index | (index + 1)




 @staticmethod
 def      __magic_name__	(      __lowercase	:							int      )	->						int:
       return (index & (index + 1)) - 1




 def      __magic_name__	(      self	:							Dict					,      __lowercase	:							int					,      __lowercase	:							int      )	->						None:
       SCREAMING_SNAKE_CASE__     :				List[str]									=value
       while index < self.size:
             SCREAMING_SNAKE_CASE__     :				Any									=self.get_prev(__lowercase      ) + 1
             if current_left_border == index:
                   SCREAMING_SNAKE_CASE__     :				List[str]									=value
             else:
                   SCREAMING_SNAKE_CASE__     :				str									=max(__lowercase					,      __lowercase					,      __lowercase      )
             SCREAMING_SNAKE_CASE__     :				Optional[Any]									=self.get_next(__lowercase      )




 def      __magic_name__	(      self	:							Optional[int]					,      __lowercase	:							int					,      __lowercase	:							int      )	->						int:
       right -= 1  # Because of right is exclusive
       SCREAMING_SNAKE_CASE__     :				str									=0
       while left <= right:
             SCREAMING_SNAKE_CASE__     :				Optional[Any]									=self.get_prev(__lowercase      )
             if left <= current_left:
                   SCREAMING_SNAKE_CASE__     :				List[Any]									=max(__lowercase					,      self.tree[right]      )
                   SCREAMING_SNAKE_CASE__     :				Any									=current_left
             else:
                   SCREAMING_SNAKE_CASE__     :				Optional[Any]									=max(__lowercase					,      self.arr[right]      )
                   right -= 1
       return result


if __name__ == "__main__":
  import doctest

  doctest.testmod()