"""simple docstring"""




import cmath
import math






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							A__	     =							math.radians(UpperCamelCase__				)
							A__	     =							math.radians(UpperCamelCase__				)

							# Convert voltage and current to rectangular form
							A__	     =							cmath.rect(UpperCamelCase__       ,    UpperCamelCase__				)
							A__	     =							cmath.rect(UpperCamelCase__       ,    UpperCamelCase__				)

							# Calculate apparent power
							return voltage_rect * current_rect


if __name__ == "__main__":
				import doctest

				doctest.testmod()






"""simple docstring"""




import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation
class     UpperCamelCase__(			unittest.TestCase ):





						def 				snake_case__	(       self     )					->				str:
													A__	     =							get_activation('swish'     )

													self.assertIsInstance(__UpperCAmelCase		,nn.SiLU     )

													self.assertEqual(act(torch.tensor(-1_00		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertNotEqual(act(torch.tensor(-1		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(0		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(20		,dtype=torch.floataa     )     ).item()		,20     )





						def 				snake_case__	(       self     )					->				Optional[Any]:
													A__	     =							get_activation('silu'     )

													self.assertIsInstance(__UpperCAmelCase		,nn.SiLU     )

													self.assertEqual(act(torch.tensor(-1_00		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertNotEqual(act(torch.tensor(-1		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(0		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(20		,dtype=torch.floataa     )     ).item()		,20     )





						def 				snake_case__	(       self     )					->				List[str]:
													A__	     =							get_activation('mish'     )

													self.assertIsInstance(__UpperCAmelCase		,nn.Mish     )

													self.assertEqual(act(torch.tensor(-2_00		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertNotEqual(act(torch.tensor(-1		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(0		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(20		,dtype=torch.floataa     )     ).item()		,20     )





						def 				snake_case__	(       self     )					->				List[str]:
													A__	     =							get_activation('gelu'     )

													self.assertIsInstance(__UpperCAmelCase		,nn.GELU     )

													self.assertEqual(act(torch.tensor(-1_00		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertNotEqual(act(torch.tensor(-1		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(0		,dtype=torch.floataa     )     ).item()		,0     )
													self.assertEqual(act(torch.tensor(20		,dtype=torch.floataa     )     ).item()		,20     )





