



'''simple docstring'''



import random






class        UpperCAmelCase__						:



					def __init__(     self      ,					UpperCamelCase      ,					UpperCamelCase  )  ->      None:
						__lowerCAmelCase       				=	x
						__lowerCAmelCase       				=	y



					def 							UpperCAmelCase_			(     self  )  ->      bool:
						return (self.x**2 + self.y**2) <= 1



					@classmethod
					def 							UpperCAmelCase_			(     cls  )  ->      int:
						return cls(x=random.random()      ,					y=random.random()  )



def 	__lowerCAmelCase       (				lowerCamelCase :    int       ):






	'''simple docstring'''




	if number_of_simulations < 1:
		raise ValueError("At least one simulation is necessary to estimate PI."       )

	__lowerCAmelCase       				=	0
	for _ in range(lowerCamelCase       ):
		__lowerCAmelCase       				=	Point.random_unit_square()

		if random_point.is_in_unit_circle():
			number_in_unit_circle += 1

	return 4 * number_in_unit_circle / number_of_simulations


if __name__ == "__main__":
	# import doctest

	# doctest.testmod()
	from math import pi

	lowerCAmelCase						:		List[str]						      = '''Please enter the desired number of Monte Carlo simulations: '''
	lowerCAmelCase						:		Tuple						      = estimate_pi(int(input(prompt).strip()))
	print(f'An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}')




'''simple docstring'''



lowerCAmelCase						:		Tuple						      = '''
# Diffusers installation
! pip install diffusers transformers datasets accelerate
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/diffusers.git
'''

lowerCAmelCase						:		Tuple						      = [{'''type''': '''code''', '''content''': INSTALL_CONTENT}]