


import unittest
from timeit import timeit
def   snake_case_    (			__lowercase      ,							__lowercase							):
   UpperCAmelCase_				:   Optional[Any]							= first_num if first_num >= second_num else second_num
   UpperCAmelCase_				:   Dict							= max_num
   while (common_mult % first_num > 0) or (common_mult % second_num > 0):
      common_mult += max_num
   return common_mult
def   snake_case_    (			__lowercase      ,							__lowercase							):
   return b if a == 0 else greatest_common_divisor(b % a      ,							__lowercase							)
def   snake_case_    (			__lowercase      ,							__lowercase							):
   return first_num // greatest_common_divisor(__lowercase      ,							__lowercase							) * second_num
def   snake_case_    (			):
   UpperCAmelCase_				:   Any							= (
       '''from __main__ import least_common_multiple_slow, least_common_multiple_fast'''
   )
   print(
       '''least_common_multiple_slow():'''      ,							timeit('''least_common_multiple_slow(1000, 999)'''      ,							setup=__lowercase							)      ,							)
   print(
       '''least_common_multiple_fast():'''      ,							timeit('''least_common_multiple_fast(1000, 999)'''      ,							setup=__lowercase							)      ,							)





class 			lowerCAmelCase__(     unittest.TestCase    ):






    '''simple docstring'''





    A_	:  Union[str, Any]								=			(
        (1_0, 2_0),
        (1_3, 1_5),
        (4, 3_1),
        (1_0, 4_2),
        (4_3, 3_4),
        (5, 1_2),
        (1_2, 2_5),
        (1_0, 2_5),
        (6, 9),
    )
    A_	:  Optional[int]								=			(2_0, 1_9_5, 1_2_4, 2_1_0, 1_4_6_2, 6_0, 3_0_0, 5_0, 1_8)





    def        _lowerCamelCase			(						self					: Dict						):





       '''simple docstring'''
       for i, (first_num, second_num) in enumerate(self.test_inputs						):
          UpperCAmelCase_				:   List[str]							= least_common_multiple_slow(__snake_case							, __snake_case						)
          UpperCAmelCase_				:   List[Any]							= least_common_multiple_fast(__snake_case							, __snake_case						)
          with self.subTest(i=__snake_case						):
             self.assertEqual(__snake_case							, self.expected_results[i]						)
             self.assertEqual(__snake_case							, self.expected_results[i]						)


if __name__ == "__main__":
       benchmark()
       unittest.main()



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






    '''simple docstring'''





    def        _lowerCamelCase			(						self					: Optional[int]						):





       '''simple docstring'''
       UpperCAmelCase_				:   str							= tf.constant([-100, -1.0, -0.1, 0, 0.1, 1.0, 100.0]						)
       UpperCAmelCase_				:   List[Any]							= get_tf_activation('''gelu'''						)
       UpperCAmelCase_				:   Any							= get_tf_activation('''gelu_10'''						)

       UpperCAmelCase_				:   int							= gelu(__snake_case						)
       UpperCAmelCase_				:   Union[str, Any]							= geluaa(__snake_case						)

       UpperCAmelCase_				:   Union[str, Any]							= tf.where(y_gelu_aa < 10.0							, 1.0							, 0.0						)

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





    def        _lowerCamelCase			(						self					: 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(__snake_case						):
          get_tf_activation('''bogus'''						)
       with self.assertRaises(__snake_case						):
          get_tf_activation(__snake_case						)