






import sys
import turtle



def 					_lowerCamelCase(			lowerCAmelCase__				:		tuple[float, float]    ,    lowerCAmelCase__				:		tuple[float, float]      ):





				'''simple docstring'''







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



def 					_lowerCamelCase(			lowerCAmelCase__				:		tuple[float, float]    ,    lowerCAmelCase__				:		tuple[float, float]    ,    lowerCAmelCase__				:		tuple[float, float]    ,    lowerCAmelCase__				:		int    ,    ):





				'''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(lowerCAmelCase__    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    depth - 1      )
				triangle(lowerCAmelCase__    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    depth - 1      )
				triangle(lowerCAmelCase__    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    get_mid(lowerCAmelCase__    ,    lowerCAmelCase__      )    ,    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        =			turtle.Turtle()
				my_pen.ht()
				my_pen.speed(5)
				my_pen.pencolor('red')

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







from timeit import timeit



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				if number < 0:
								raise ValueError('the value of input must not be negative'      )
				SCREAMING_SNAKE_CASE_   :	Tuple													=   0
				while number:
								number &= number - 1
								result += 1
				return result



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				if number < 0:
								raise ValueError('the value of input must not be negative'      )
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   0
				while number:
								if number % 2 == 1:
												result += 1
								number >>= 1
				return result



def 					_lowerCamelCase(			):





				'''simple docstring'''







				def do_benchmark(lowerCAmelCase__				:		int      ) -> None:
								SCREAMING_SNAKE_CASE_   :	int													=   'import __main__ as z'
								print(F'''Benchmark when {number = }:'''      )
								print(F'''{get_set_bits_count_using_modulo_operator(lowerCAmelCase__      ) = }'''      )
								SCREAMING_SNAKE_CASE_   :	int													=   timeit('z.get_set_bits_count_using_modulo_operator(25)'    ,    setup=lowerCAmelCase__      )
								print(F'''timeit() runs in {timing} seconds'''      )
								print(F'''{get_set_bits_count_using_brian_kernighans_algorithm(lowerCAmelCase__      ) = }'''      )
								SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   timeit(
								    'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'    ,    setup=lowerCAmelCase__    ,    )
								print(F'''timeit() runs in {timing} seconds'''      )

				for number in (25, 37, 58, 0):
								do_benchmark(lowerCAmelCase__      )
								print()


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				benchmark()