






"""simple docstring"""
import numpy as np

from transformers import Pipeline

def 				snake_case      (   A__						):
			UpperCAmelCase_     : Optional[Any]			     =					np.max(A__	,axis=-1	,keepdims=A__						)
			UpperCAmelCase_     : List[Any]			     =					np.exp(outputs - maxes						)
			return shifted_exp / shifted_exp.sum(axis=-1	,keepdims=A__						)







class 			UpperCamelCase_       (__A     ):





	def      _SCREAMING_SNAKE_CASE      (      self					: Any	,	**lowerCAmelCase_					: int						)						->			List[str]:
				UpperCAmelCase_     : Optional[Any]			     =					{}
				if "second_text" in kwargs:
							UpperCAmelCase_     : List[Any]			     =					kwargs["second_text"]
				return preprocess_kwargs, {}, {}





	def      _SCREAMING_SNAKE_CASE      (      self					: Union[str, Any]	,	lowerCAmelCase_					: Tuple	,	lowerCAmelCase_					: Optional[int]=None						)						->			Dict:
				return self.tokenizer(lowerCAmelCase_	,	text_pair=lowerCAmelCase_	,	return_tensors=self.framework						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Tuple	,	lowerCAmelCase_					: List[Any]						)						->			Tuple:
				return self.model(**lowerCAmelCase_						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[Any]	,	lowerCAmelCase_					: Union[str, Any]						)						->			Union[str, Any]:
				UpperCAmelCase_     : List[Any]			     =					model_outputs.logits[0].numpy()
				UpperCAmelCase_     : Optional[int]			     =					softmax(lowerCAmelCase_						)

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











"""simple docstring"""
def 				snake_case      (   A__	,A__						):
			# "extended trapezoidal rule"
			# int(f) = dx/2 * (f1 + 2f2 + ... + fn)
			UpperCAmelCase_     : Dict			     =					(boundary[1] - boundary[0]) / steps
			UpperCAmelCase_     : Optional[int]			     =					boundary[0]
			UpperCAmelCase_     : str			     =					boundary[1]
			UpperCAmelCase_     : Tuple			     =					make_points(A__	,A__	,A__						)
			UpperCAmelCase_     : List[str]			     =					0.0
			y += (h / 2.0) * f(A__						)
			for i in x_i:
						# print(i)
						y += h * f(A__						)
			y += (h / 2.0) * f(A__						)
			return y

def 				snake_case      (   A__	,A__	,A__						):
			UpperCAmelCase_     : Union[str, Any]			     =					a + h
			while x < (b - h):
						yield x
						UpperCAmelCase_     : Optional[Any]			     =					x + h

def 				snake_case      (   A__						):  # enter your function here
			UpperCAmelCase_     : Dict			     =					(x - 0) * (x - 0)
			return y

def 				snake_case      (   ):
			UpperCAmelCase_     : Dict			     =					0.0  # Lower bound of integration
			UpperCAmelCase_     : Optional[int]			     =					1.0  # Upper bound of integration
			UpperCAmelCase_     : Dict			     =					10.0  # define number of steps or resolution
			UpperCAmelCase_     : List[Any]			     =					[a, b]  # define boundary of integration
			UpperCAmelCase_     : Union[str, Any]			     =					method_a(A__	,A__						)
			print(F"""y = {y}"""						)


if __name__ == "__main__":
			main()



