"""simple docstring"""







import unittest

import numpy as np

from transformers import is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
						import tensorflow as tf

						from transformers.activations_tf import get_tf_activation


@require_tf
class 			_lowercase		(   unittest.TestCase  ):

				def        A (     self       :    Any     ):


										'''simple docstring'''
										UpperCAmelCase__						=		tf.constant([-1_0_0, -1.0, -0.1, 0, 0.1, 1.0, 100.0]     )
										UpperCAmelCase__						=		get_tf_activation("""gelu"""     )
										UpperCAmelCase__						=		get_tf_activation("""gelu_10"""     )

										UpperCAmelCase__						=		gelu(_lowercase     )
										UpperCAmelCase__						=		geluaa(_lowercase     )

										UpperCAmelCase__						=		tf.where(y_gelu_aa < 10.0       ,    1.0       ,    0.0     )

										self.assertEqual(tf.math.reduce_max(_lowercase     ).numpy().item()       ,    10.0     )
										self.assertTrue(np.allclose(y_gelu * clipped_mask       ,    y_gelu_aa * clipped_mask     )     )

				def        A (     self       :    Optional[Any]     ):


										'''simple docstring'''
										get_tf_activation("""gelu"""     )
										get_tf_activation("""gelu_10"""     )
										get_tf_activation("""gelu_fast"""     )
										get_tf_activation("""gelu_new"""     )
										get_tf_activation("""glu"""     )
										get_tf_activation("""mish"""     )
										get_tf_activation("""quick_gelu"""     )
										get_tf_activation("""relu"""     )
										get_tf_activation("""sigmoid"""     )
										get_tf_activation("""silu"""     )
										get_tf_activation("""swish"""     )
										get_tf_activation("""tanh"""     )
										with self.assertRaises(_lowercase     ):
																get_tf_activation("""bogus"""     )
										with self.assertRaises(_lowercase     ):
																get_tf_activation(_lowercase     )


"""simple docstring"""







from __future__ import annotations

import sys


def   a__      (		UpperCAmelCase__       :			int			)->	int:
						if n < 0:
												raise ValueError("""Negative arguments are not supported"""			)
						return _fib(UpperCAmelCase__			)[0]


def   a__      (		UpperCAmelCase__       :			int			)->	tuple[int, int]:
						if n == 0:  # (F(0), F(1))
												return (0, 1)

						# F(2n) = F(n)[2F(n+1) − F(n)]
						# F(2n+1) = F(n+1)^2+F(n)^2
						UpperCAmelCase__	,      UpperCAmelCase__						=		_fib(n // 2			)
						UpperCAmelCase__						=		a * (b * 2 - a)
						UpperCAmelCase__						=		a * a + b * b
						return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
						UpperCamelCase_       :       int							   =		int(sys.argv[1])
						print(F"""fibonacci({n}) is {fibonacci(n)}""")

