import time
def pi_estimation():
"""Pi estimation.
Example is taken from: https://spark.apache.org/examples.html
:return: If the pi value calculated is between 3.1 and 3.2.
"""
start = time.time()
print("--- PI ESTIMATION ---")
print("- Estimating Pi by 'throwing darts' algorithm.")
tries = 100000
print(f"- Number of tries: {tries}")
count = DDS().load(range(0, tries), 10).filter(inside).count()
rough_pi = 4.0 * count / tries
print(f"- Pi is roughly {rough_pi}")
print("- Elapsed Time: ", time.time() - start)
print("---------------------")
return 3.1 < rough_pi < 3.2