


'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__	, UpperCamelCase__   ):
			# "extended trapezoidal rule"
			# int(f) = dx/2 * (f1 + 2f2 + ... + fn)
			UpperCAmelCase__					:   Any       				=       (boundary[1] - boundary[0]) / steps
			UpperCAmelCase__					:   Any       				=       boundary[0]
			UpperCAmelCase__					:   Tuple       				=       boundary[1]
			UpperCAmelCase__					:   Optional[Any]       				=       make_points(a__	, a__	, a__   )
			UpperCAmelCase__					:   Union[str, Any]       				=       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       _UpperCamelCase (						UpperCamelCase__	, UpperCamelCase__	, UpperCamelCase__   ):
			UpperCAmelCase__					:   int       				=       a + h
			while x < (b - h):
						yield x
						UpperCAmelCase__					:   Dict       				=       x + h







def       _UpperCamelCase (						UpperCamelCase__   ):  # enter your function here
			UpperCAmelCase__					:   int       				=       (x - 0) * (x - 0)
			return y







def       _UpperCamelCase (						):
			UpperCAmelCase__					:   Any       				=       0.0  # Lower bound of integration
			UpperCAmelCase__					:   List[Any]       				=       1.0  # Upper bound of integration
			UpperCAmelCase__					:   Optional[int]       				=       10.0  # define number of steps or resolution
			UpperCAmelCase__					:   Dict       				=       [a, b]  # define boundary of integration
			UpperCAmelCase__					:   List[Any]       				=       method_a(a__	, a__   )
			print(f'''y = {y}'''   )


if __name__ == "__main__":
		main()



'''simple docstring'''



from __future__ import annotations

import unittest

from transformers import is_tf_available
from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow


if is_tf_available():
		import tensorflow as tf

		from transformers import AutoTokenizer, TFAutoModelForSeqaSeqLM


@require_tf
@require_sentencepiece
@require_tokenizers
class 						_snake_case   (       unittest.TestCase		):




					@slow
					def 			snake_case__  ( self):
								UpperCAmelCase__					:   Optional[int]       				=       TFAutoModelForSeqaSeqLM.from_pretrained("""google/mt5-small""")
								UpperCAmelCase__					:   str       				=       AutoTokenizer.from_pretrained("""google/mt5-small""")

								UpperCAmelCase__					:   Optional[Any]       				=       tokenizer("""Hello there"""							,							return_tensors="""tf""").input_ids
								UpperCAmelCase__					:   Tuple       				=       tokenizer("""Hi I am"""							,							return_tensors="""tf""").input_ids

								UpperCAmelCase__					:   List[Any]       				=       model(_lowerCamelCase							,							labels=_lowerCamelCase).loss
								UpperCAmelCase__					:   Tuple       				=       -tf.math.reduce_mean(_lowerCamelCase).numpy()

								UpperCAmelCase__					:   Optional[int]       				=       -21.228168
								self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)