


import sys
import turtle







def 	SCREAMING_SNAKE_CASE_						(      __A			:      tuple[float, float]  ,   __A			:      tuple[float, float]    )     ->		tuple[float, float]:

       """simple docstring"""

       return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2







def 	SCREAMING_SNAKE_CASE_						(      __A			:      tuple[float, float]  ,   __A			:      tuple[float, float]  ,   __A			:      tuple[float, float]  ,   __A			:      int  ,   )     ->		None:

       """simple docstring"""

       my_pen.up()
       my_pen.goto(vertexa[0]  ,   vertexa[1]    )
       my_pen.down()
       my_pen.goto(vertexa[0]  ,   vertexa[1]    )
       my_pen.goto(vertexa[0]  ,   vertexa[1]    )
       my_pen.goto(vertexa[0]  ,   vertexa[1]    )

       if depth == 0:
              return

       triangle(__A  ,   get_mid(__A  ,   __A    )  ,   get_mid(__A  ,   __A    )  ,   depth - 1    )
       triangle(__A  ,   get_mid(__A  ,   __A    )  ,   get_mid(__A  ,   __A    )  ,   depth - 1    )
       triangle(__A  ,   get_mid(__A  ,   __A    )  ,   get_mid(__A  ,   __A    )  ,   depth - 1    )


if __name__ == "__main__":
   if len(sys.argv) != 2:
      raise ValueError(
          'Correct format for using this script: '
          'python fractals.py <int:depth_for_fractal>'
      )
   UpperCAmelCase_				:			List[Any]   =	turtle.Turtle()
   my_pen.ht()
   my_pen.speed(5)
   my_pen.pencolor('red')

   UpperCAmelCase_				:			Tuple   =	[(-175, -125), (0, 175), (175, -125)]  # vertices of triangle
   triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))






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 			SCREAMING_SNAKE_CASE__  (    unittest.TestCase      ):
      def 	SCREAMING_SNAKE_CASE							(	self    :	Dict					)		->      List[str]:
             a_ :		List[str]							=  torch.tensor([-1_0_0, -1, -0.1, 0, 0.1, 1.0, 1_0_0]					)
             a_ :		Union[str, Any]							=  get_activation('gelu'					)
             self.assertTrue(torch.allclose(gelu_python(SCREAMING_SNAKE_CASE__					)					,							torch_builtin(SCREAMING_SNAKE_CASE__					)					)					)
             self.assertFalse(torch.allclose(gelu_python(SCREAMING_SNAKE_CASE__					)					,							gelu_new(SCREAMING_SNAKE_CASE__					)					)					)
      def 	SCREAMING_SNAKE_CASE							(	self    :	Union[str, Any]					)		->      Any:
             a_ :		List[str]							=  torch.tensor([-1_0_0, -1, -0.1, 0, 0.1, 1.0, 1_0_0]					)
             a_ :		Union[str, Any]							=  get_activation('gelu'					)
             a_ :		str							=  get_activation('gelu_10'					)

             a_ :		Tuple							=  torch_builtin(SCREAMING_SNAKE_CASE__					)
             a_ :		str							=  geluaa(SCREAMING_SNAKE_CASE__					)

             a_ :		List[Any]							=  torch.where(y_gelu_aa < 10.0					,							1					,							0					)

             self.assertTrue(torch.max(SCREAMING_SNAKE_CASE__					).item() == 10.0					)
             self.assertTrue(torch.allclose(y_gelu * clipped_mask					,							y_gelu_aa * clipped_mask					)					)
      def 	SCREAMING_SNAKE_CASE							(	self    :	Dict					)		->      List[Any]:
             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(SCREAMING_SNAKE_CASE__					):
                    get_activation('bogus'					)
             with self.assertRaises(SCREAMING_SNAKE_CASE__					):
                    get_activation(SCREAMING_SNAKE_CASE__					)

      def 	SCREAMING_SNAKE_CASE							(	self    :	str					)		->      str:
             a_ :		Any							=  get_activation('gelu'					)
             a_ :		Any							=  1
             a_ :		int							=  get_activation('gelu'					)
             self.assertEqual(acta.a					,							1					)
             with self.assertRaises(SCREAMING_SNAKE_CASE__					):
                    a_ :		Tuple							=  acta.a


