def 							lowerCAmelCase(     __lowerCamelCase						):
					return 10 - x * x
def 							lowerCAmelCase(     __lowerCamelCase				,    __lowerCamelCase						):
					# Bolzano theory in order to find if there is a root between a and b
					if equation(__lowerCamelCase						) * equation(__lowerCamelCase						) >= 0:
										raise ValueError('Wrong space!'						)

					__a		 =       a
					while (b - a) >= 0.01:
										# Find middle point
										__a		 =       (a + b) / 2
										# Check if middle point is root
										if equation(__lowerCamelCase						) == 0.0:
															break
										# Decide the side to repeat the steps
										if equation(__lowerCamelCase						) * equation(__lowerCamelCase						) < 0:
															__a		 =       c
										else:
															__a		 =       c
					return c


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	print(bisection(-2, 5))
	print(bisection(0, 6))





from datetime import datetime

import matplotlib.pyplot as plt
import torch
def 							lowerCAmelCase(     __lowerCamelCase						):
					for param in module.parameters():
										__a		 =       False
def 							lowerCAmelCase(     ):
					__a		 =       'cuda' if torch.cuda.is_available() else 'cpu'
					if torch.backends.mps.is_available() and torch.backends.mps.is_built():
										__a		 =       'mps'
					if device == "mps":
										print(
										    'WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'
										    ' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'
										    ' with generations.'						)
					return device
def 							lowerCAmelCase(     __lowerCamelCase						):
					__a		 =       plt.imshow(__lowerCamelCase						)
					fig.axes.get_xaxis().set_visible(__lowerCamelCase						)
					fig.axes.get_yaxis().set_visible(__lowerCamelCase						)
					plt.show()



def 							lowerCAmelCase(     ):
					__a		 =       datetime.now()
					__a		 =       current_time.strftime('%H:%M:%S'						)
					return timestamp




