


"""simple docstring"""







from string import ascii_uppercase

lowerCAmelCase__      				=   {str(ord(c) - 55): c for c in ascii_uppercase}
def 					a__			(				SCREAMING_SNAKE_CASE    :    int				,      SCREAMING_SNAKE_CASE    :    int				):


  '''simple docstring'''







  if isinstance(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				):
    raise TypeError("int() can't convert non-string with explicit base"				)
  if num < 0:
    raise ValueError("parameter must be positive int"				)
  if isinstance(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				):
    raise TypeError("'str' object cannot be interpreted as an integer"				)
  if isinstance(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				):
    raise TypeError("'float' object cannot be interpreted as an integer"				)
  if base in (0, 1):
    raise ValueError("base must be >= 2"				)
  if base > 3_6:
    raise ValueError("base must be <= 36"				)
  lowerCAmelCase     :     str								=							""
  lowerCAmelCase     :     Optional[Any]								=							0
  lowerCAmelCase     :     List[Any]								=							0
  while div != 1:
    lowerCAmelCase						,  lowerCAmelCase     :     Optional[Any]								=							divmod(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				)
    if base >= 1_1 and 9 < mod < 3_6:
      lowerCAmelCase     :     int								=							ALPHABET_VALUES[str(SCREAMING_SNAKE_CASE				)]
    else:
      lowerCAmelCase     :     List[str]								=							str(SCREAMING_SNAKE_CASE				)
    new_value += actual_value
    lowerCAmelCase     :     Dict								=							num // base
    lowerCAmelCase     :     Tuple								=							div
    if div == 0:
      return str(new_value[::-1]				)
    elif div == 1:
      new_value += str(SCREAMING_SNAKE_CASE				)
      return str(new_value[::-1]				)

  return new_value[::-1]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     for base in range(2, 37):
          for num in range(1_000):
               assert int(decimal_to_any(num, base), base) == num, (
                   num,
                   base,
                   decimal_to_any(num, base),
                   int(decimal_to_any(num, base), base),
               )









"""simple docstring"""







import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation


class       SCREAMING_SNAKE_CASE__				(		unittest.TestCase				):
       """simple docstring"""


       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     int								=							get_activation("swish"						)

         self.assertIsInstance(snake_case__		,     nn.SiLU						)

         self.assertEqual(act(torch.tensor(-100		,     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        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							get_activation("silu"						)

         self.assertIsInstance(snake_case__		,     nn.SiLU						)

         self.assertEqual(act(torch.tensor(-100		,     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        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Dict								=							get_activation("mish"						)

         self.assertIsInstance(snake_case__		,     nn.Mish						)

         self.assertEqual(act(torch.tensor(-200		,     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        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							get_activation("gelu"						)

         self.assertIsInstance(snake_case__		,     nn.GELU						)

         self.assertEqual(act(torch.tensor(-100		,     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						)





