




def  a_		(							__snake_case     ,		__snake_case     ,		__snake_case     ,		__snake_case					)	->			int:

			'''simple docstring'''


			UpperCamelCase_     				= int((lower_bound + upper_bound) // 2					)
			if array[r] == value:
						return r
			if lower_bound >= upper_bound:
						return -1
			if array[r] < value:
						return binary_search(SCREAMING_SNAKE_CASE_     ,		r + 1     ,		SCREAMING_SNAKE_CASE_     ,		SCREAMING_SNAKE_CASE_					)
			else:
						return binary_search(SCREAMING_SNAKE_CASE_     ,		SCREAMING_SNAKE_CASE_     ,		r - 1     ,		SCREAMING_SNAKE_CASE_					)




def  a_		(							__snake_case     ,		__snake_case					)	->			list:

			'''simple docstring'''


			UpperCamelCase_     				= 0
			if matrix[index][0] == value:
						return [index, 0]
			while index < len(SCREAMING_SNAKE_CASE_					) and matrix[index][0] < value:
						UpperCamelCase_     				= binary_search(matrix[index]     ,		0     ,		len(matrix[index]					) - 1     ,		SCREAMING_SNAKE_CASE_					)
						if r != -1:
									return [index, r]
						index += 1
			return [-1, -1]


if __name__ == "__main__":
				import doctest

				doctest.testmod()


from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

# Load iris file
lowerCamelCase__        =						load_iris()
iris.keys()


print(F"""Target names: \n {iris.target_names} """)
print(F"""\n Features: \n {iris.feature_names}""")

# Train set e Test set
lowerCamelCase__ ,   lowerCamelCase__ ,   lowerCamelCase__ ,   lowerCamelCase__        =						train_test_split(
    iris["""data"""], iris["""target"""], random_state=4
)

# KNN

lowerCamelCase__        =						KNeighborsClassifier(n_neighbors=1)
knn.fit(X_train, y_train)

# new array to test
lowerCamelCase__        =						[[1, 2, 1, 4], [2, 3, 4, 5]]

lowerCamelCase__        =						knn.predict(X_new)

print(
    F"""\nNew array: \n {X_new}\n\nTarget Names Prediction: \n"""
    F""" {iris["target_names"][prediction]}"""
)