





"""simple docstring"""
from __future__ import annotations

import random







class 	a				:
 snake_case__    	=    6



 def __init__(			self			):







  """simple docstring"""






  lowerCAmelCase  							=      list(range(1							,    Dice.NUM_SIDES + 1			)			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  return random.choice(self.sides			)


def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  int   ,			_UpperCAmelCase :  int = 2       ):
 lowerCAmelCase  							=      [Dice() for i in range(_UpperCAmelCase       )]
 lowerCAmelCase  							=      [0] * (len(_UpperCAmelCase       ) * Dice.NUM_SIDES + 1)
 for _ in range(_UpperCAmelCase       ):
  count_of_sum[sum(dice.roll() for dice in dices       )] += 1
 lowerCAmelCase  							=      [round((count * 100) / num_throws   ,			2       ) for count in count_of_sum]
 return probability[num_dice:]  # remove probability of sums that never appear


if __name__ == "__main__":
       import doctest

       doctest.testmod()






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        UpperCamelCase       (						self				):
													_snake_case						:     int				=    tf.constant([-100, -1.0, -0.1, 0, 0.1, 1.0, 100.0]				)
													_snake_case						:     List[Any]				=    get_tf_activation("gelu"				)
													_snake_case						:     Any				=    get_tf_activation("gelu_10"				)

													_snake_case						:     Dict				=    gelu(lowercase_				)
													_snake_case						:     Optional[int]				=    geluaa(lowercase_				)

													_snake_case						:     Tuple				=    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        UpperCamelCase       (						self				):
													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_				)