


"""simple docstring"""


from __future__ import annotations


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			__lowerCAmelCase							       =     []
			create_all_state(1       ,					_UpperCamelCase       ,					_UpperCamelCase       ,					[]       ,					_UpperCamelCase )
			return result


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase       ,					_UpperCamelCase       ,					_UpperCamelCase       ,					_UpperCamelCase       ,					):

			'''simple docstring'''




			if level == 0:
						total_list.append(current_list[:] )
						return

			for i in range(_UpperCamelCase       ,					total_number - level + 2 ):
						current_list.append(_UpperCamelCase )
						create_all_state(i + 1       ,					_UpperCamelCase       ,					level - 1       ,					_UpperCamelCase       ,					_UpperCamelCase )
						current_list.pop()


def _lowerCamelCase      (						_UpperCamelCase ):

			'''simple docstring'''




			for i in total_list:
						print(*_UpperCamelCase )


if __name__ == "__main__":
	A	:  Dict            =     4
	A	:  Optional[int]            =     2
	A	:  Union[str, Any]            =     generate_all_combinations(n, k)
	print_all_state(total_list)








"""simple docstring"""


import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch


if is_torch_available():
	import torch

	from transformers.activations import gelu_new, gelu_python, get_activation
@require_torch
class     _UpperCamelCase    (  unittest.TestCase						):
							'''simple docstring'''







							def      snake_case							(	self      ):
										__lowerCAmelCase							       =     torch.tensor([-1_00, -1, -0.1, 0, 0.1, 1.0, 1_00]      )
										__lowerCAmelCase							       =     get_activation("gelu"      )
										self.assertTrue(torch.allclose(gelu_python(__a      )       ,  torch_builtin(__a      )      )      )
										self.assertFalse(torch.allclose(gelu_python(__a      )       ,  gelu_new(__a      )      )      )

							def      snake_case							(	self      ):
										__lowerCAmelCase							       =     torch.tensor([-1_00, -1, -0.1, 0, 0.1, 1.0, 1_00]      )
										__lowerCAmelCase							       =     get_activation("gelu"      )
										__lowerCAmelCase							       =     get_activation("gelu_10"      )

										__lowerCAmelCase							       =     torch_builtin(__a      )
										__lowerCAmelCase							       =     geluaa(__a      )

										__lowerCAmelCase							       =     torch.where(y_gelu_aa < 1_0.0       ,  1       ,  0      )

										self.assertTrue(torch.max(__a      ).item() == 1_0.0      )
										self.assertTrue(torch.allclose(y_gelu * clipped_mask       ,  y_gelu_aa * clipped_mask      )      )

							def      snake_case							(	self      ):
										get_activation("gelu"      )
										get_activation("gelu_10"      )
										get_activation("gelu_fast"      )
										get_activation("gelu_new"      )
										get_activation("gelu_python"      )
										get_activation("gelu_pytorch_tanh"      )
										get_activation("linear"      )
										get_activation("mish"      )
										get_activation("quick_gelu"      )
										get_activation("relu"      )
										get_activation("sigmoid"      )
										get_activation("silu"      )
										get_activation("swish"      )
										get_activation("tanh"      )
										with self.assertRaises(__a      ):
													get_activation("bogus"      )
										with self.assertRaises(__a      ):
													get_activation(__a      )



							def      snake_case							(	self      ):
										__lowerCAmelCase							       =     get_activation("gelu"      )
										__lowerCAmelCase							       =     1
										__lowerCAmelCase							       =     get_activation("gelu"      )
										self.assertEqual(acta.a       ,  1      )
										with self.assertRaises(__a      ):
													__lowerCAmelCase							       =     acta.a




