






'''simple docstring'''







import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format

class _lowercase			:

							'''simple docstring'''





							a          = None




							def 	lowerCamelCase_       (							self:       Dict  ):
														lowerCamelCase__      :			List[str] 						= self.feature_extraction_class(**self.feat_extract_dict  )
														lowerCamelCase__      :			List[Any] 						= json.loads(feat_extract.to_json_string()  )
														for key, value in self.feat_extract_dict.items():
																					self.assertEqual(obj[key]    ,							__SCREAMING_SNAKE_CASE  )




							def 	lowerCamelCase_       (							self:       Tuple  ):
														lowerCamelCase__      :			Optional[int] 						= self.feature_extraction_class(**self.feat_extract_dict  )

														with tempfile.TemporaryDirectory() as tmpdirname:
																					lowerCamelCase__      :			Optional[Any] 						= os.path.join(__SCREAMING_SNAKE_CASE    ,							"""feat_extract.json"""  )
																					feat_extract_first.to_json_file(__SCREAMING_SNAKE_CASE  )
																					lowerCamelCase__      :			Optional[Any] 						= self.feature_extraction_class.from_json_file(__SCREAMING_SNAKE_CASE  )

														self.assertEqual(feat_extract_second.to_dict()    ,							feat_extract_first.to_dict()  )




							def 	lowerCamelCase_       (							self:       Dict  ):
														lowerCamelCase__      :			List[Any] 						= self.feature_extraction_class(**self.feat_extract_dict  )

														with tempfile.TemporaryDirectory() as tmpdirname:
																					lowerCamelCase__      :			str 						= feat_extract_first.save_pretrained(__SCREAMING_SNAKE_CASE  )[0]
																					check_json_file_has_correct_format(__SCREAMING_SNAKE_CASE  )
																					lowerCamelCase__      :			Any 						= self.feature_extraction_class.from_pretrained(__SCREAMING_SNAKE_CASE  )

														self.assertEqual(feat_extract_second.to_dict()    ,							feat_extract_first.to_dict()  )




							def 	lowerCamelCase_       (							self:       str  ):
														lowerCamelCase__      :			Dict 						= self.feature_extraction_class()
														self.assertIsNotNone(__SCREAMING_SNAKE_CASE  )









'''simple docstring'''







import sys
import turtle





def 				SCREAMING_SNAKE_CASE_ (UpperCamelCase       ,    UpperCamelCase   )   -> tuple[float, float]:
							return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2





def 				SCREAMING_SNAKE_CASE_ (UpperCamelCase       ,    UpperCamelCase       ,    UpperCamelCase       ,    UpperCamelCase       ,    )   -> None:
							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(UpperCamelCase       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    depth - 1   )
							triangle(UpperCamelCase       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    depth - 1   )
							triangle(UpperCamelCase       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    get_mid(UpperCamelCase       ,    UpperCamelCase   )       ,    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>'''
						)
			_A			:    Any					  =turtle.Turtle()
			my_pen.ht()
			my_pen.speed(5)
			my_pen.pencolor('''red''')

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

