
"""simple docstring"""


import timeit

class 					A_			:



							"""simple docstring"""






							def __init__(						self						:Dict  ,							lowerCamelCase_						:List[Any] ):





										"""simple docstring"""

										if isinstance(lowerCamelCase_  ,							lowerCamelCase_ ):  # Initializes a matrix identical to the one provided.
													lowerCamelCase__			:  Optional[int]  =arg
													lowerCamelCase__			:  Tuple  =len(lowerCamelCase_ )
										else:  # Initializes a square matrix of the given size and set values to zero.
													lowerCamelCase__			:  List[str]  =arg
													lowerCamelCase__			:  Tuple  =[[0 for _ in range(self.n )] for _ in range(self.n )]





							def __mul__(						self						:str  ,							lowerCamelCase_						:int ):





										"""simple docstring"""

										lowerCamelCase__			:  Tuple  =Matrix(self.n )
										for i in range(self.n ):
													for j in range(self.n ):
																for k in range(self.n ):
																			matrix.t[i][j] += self.t[i][k] * b.t[k][j]
										return matrix






def      lowerCAmelCase_     (	snake_case_	:    str							,					snake_case_	:    Tuple    )     ->int:
			lowerCamelCase__			:  Union[str, Any]  =Matrix([[1, 0], [0, 1]]    )
			while b > 0:
						if b & 1:
									matrix *= a
						a *= a
						b >>= 1
			return matrix


def      lowerCAmelCase_     (	snake_case_	:    str							,					snake_case_	:    Tuple							,					snake_case_	:    List[Any]    )     ->str:
			# Trivial Cases
			if n == 1:
						return fa
			elif n == 2:
						return fa
			lowerCamelCase__			:  str  =Matrix([[1, 1], [1, 0]]    )
			lowerCamelCase__			:  Dict  =modular_exponentiation(__lowerCAmelCase							,					n - 2    )
			return fa * matrix.t[0][0] + fa * matrix.t[0][1]


def      lowerCAmelCase_     (	snake_case_	:    Union[str, Any]							,					snake_case_	:    Any							,					snake_case_	:    Optional[Any]    )     ->Tuple:
			# Trivial Cases
			if n == 1:
						return fa
			elif n == 2:
						return fa

			lowerCamelCase__			:  Union[str, Any]  =fa
			lowerCamelCase__			:  int  =fa
			n -= 2

			while n > 0:
						lowerCamelCase__			:  Any  =fn_a + fn_a, fn_a
						n -= 1

			return fn_a


def      lowerCAmelCase_     (	)     ->str:
			lowerCamelCase__			:  Any  ="\nfrom random import randint\nfrom __main__ import fibonacci_with_matrix_exponentiation\n"
			lowerCamelCase__			:  Tuple  ="fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)"
			lowerCamelCase__			:  Any  =timeit.timeit(setup=__lowerCAmelCase							,					stmt=__lowerCAmelCase							,					number=1_0_0    )
			print('With matrix exponentiation the average execution time is '							,					exec_time / 1_0_0    )
			return exec_time


def      lowerCAmelCase_     (	)     ->List[Any]:
			lowerCamelCase__			:  str  ="\nfrom random import randint\nfrom __main__ import simple_fibonacci\n"
			lowerCamelCase__			:  str  ="simple_fibonacci(randint(1,70000), 1, 1)"
			lowerCamelCase__			:  Union[str, Any]  =timeit.timeit(setup=__lowerCAmelCase							,					stmt=__lowerCAmelCase							,					number=1_0_0    )
			print(
			    'Without matrix exponentiation the average execution time is '							,					exec_time / 1_0_0    )
			return exec_time


def      lowerCAmelCase_     (	)     ->int:
			matrix_exponentiation_time()
			simple_fibonacci_time()


if __name__ == "__main__":
							main()

"""simple docstring"""


from sklearn.neural_network import MLPClassifier

lowerCAmelCase			=		[[0.0, 0.0], [1.0, 1.0], [1.0, 0.0], [0.0, 1.0]]
lowerCAmelCase			=		[0, 1, 0, 0]


lowerCAmelCase			=		MLPClassifier(
    solver="""lbfgs""", alpha=1E-5, hidden_layer_sizes=(5, 2), random_state=1
)

clf.fit(X, y)


lowerCAmelCase			=		[[0.0, 0.0], [0.0, 1.0], [1.0, 1.0]]
lowerCAmelCase			=		clf.predict(test)






def      lowerCAmelCase_     (	snake_case_	:    Tuple    )     ->List[Any]:
			return list(snake_case_    )


if __name__ == "__main__":
							import doctest

							doctest.testmod()