
'''simple docstring'''


import math
def 					__magic_name__(       UpperCAmelCase__ :       int	):
						if n <= 0:
												raise ValueError("""Only positive integers have prime factors"""	)
						UpperCamelCase_     :	Tuple					     =     []
						while n % 2 == 0:
												pf.append(2	)
												UpperCamelCase_     :	Optional[int]					     =     int(n / 2	)
						for i in range(3							,				int(math.sqrt(UpperCAmelCase__	)	) + 1							,				2	):
												while n % i == 0:
																		pf.append(UpperCAmelCase__	)
																		UpperCamelCase_     :	List[Any]					     =     int(n / i	)
						if n > 2:
												pf.append(UpperCAmelCase__	)
						return pf
def 					__magic_name__(       UpperCAmelCase__ :       int	):
						if n <= 0:
												raise ValueError("""Only positive numbers are accepted"""	)
						UpperCamelCase_     :	List[str]					     =     1
						UpperCamelCase_     :	int					     =     1
						while n % 2 == 0:
												temp += 1
												UpperCamelCase_     :	Dict					     =     int(n / 2	)
						div *= temp
						for i in range(3							,				int(math.sqrt(UpperCAmelCase__	)	) + 1							,				2	):
												UpperCamelCase_     :	List[str]					     =     1
												while n % i == 0:
																		temp += 1
																		UpperCamelCase_     :	Union[str, Any]					     =     int(n / i	)
												div *= temp
						if n > 1:
												div *= 2
						return div
def 					__magic_name__(       UpperCAmelCase__ :       int	):
						if n <= 0:
												raise ValueError("""Only positive numbers are accepted"""	)
						UpperCamelCase_     :	Optional[int]					     =     1
						UpperCamelCase_     :	Tuple					     =     1
						while n % 2 == 0:
												temp += 1
												UpperCamelCase_     :	str					     =     int(n / 2	)
						if temp > 1:
												s *= (2**temp - 1) / (2 - 1)
						for i in range(3							,				int(math.sqrt(UpperCAmelCase__	)	) + 1							,				2	):
												UpperCamelCase_     :	Union[str, Any]					     =     1
												while n % i == 0:
																		temp += 1
																		UpperCamelCase_     :	str					     =     int(n / i	)
												if temp > 1:
																		s *= (i**temp - 1) / (i - 1)
						return int(UpperCAmelCase__	)
def 					__magic_name__(       UpperCAmelCase__ :       int	):
						UpperCamelCase_     :	int					     =     n
						for x in set(prime_factors(UpperCAmelCase__	)	):
												s *= (x - 1) / x
						return int(UpperCAmelCase__	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()






'''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     __snake_case			(    unittest.TestCase	):




		def 	_snake_case	(  self					:Tuple)					->			List[Any]:






								'''simple docstring'''






								UpperCamelCase_     :	List[str]					     =     tf.constant([-1_0_0, -1.0, -0.1, 0, 0.1, 1.0, 100.0])
								UpperCamelCase_     :	Any					     =     get_tf_activation("""gelu""")
								UpperCamelCase_     :	List[Any]					     =     get_tf_activation("""gelu_10""")

								UpperCamelCase_     :	Optional[int]					     =     gelu(_SCREAMING_SNAKE_CASE)
								UpperCamelCase_     :	Dict					     =     geluaa(_SCREAMING_SNAKE_CASE)

								UpperCamelCase_     :	List[Any]					     =     tf.where(y_gelu_aa < 10.0			,    1.0			,    0.0)

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





		def 	_snake_case	(  self					:Any)					->			Dict:






								'''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(_SCREAMING_SNAKE_CASE):
														get_tf_activation("""bogus""")
								with self.assertRaises(_SCREAMING_SNAKE_CASE):
														get_tf_activation(_SCREAMING_SNAKE_CASE)




