






def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							int  ):


					'''simple docstring'''


					while b:
										UpperCAmelCase_       ,  UpperCAmelCase_    :      List[Any]            =						b, a % b
					return a




def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							int  ):


					'''simple docstring'''


					return a if b == 0 else euclidean_gcd_recursive(__snake_case     ,       a % b  )




def      lowercase__      (     ):


					'''simple docstring'''


					print(F"euclidean_gcd(3, 5) = {euclidean_gcd(3     ,       5  )}"  )
					print(F"euclidean_gcd(5, 3) = {euclidean_gcd(5     ,       3  )}"  )
					print(F"euclidean_gcd(1, 3) = {euclidean_gcd(1     ,       3  )}"  )
					print(F"euclidean_gcd(3, 6) = {euclidean_gcd(3     ,       6  )}"  )
					print(F"euclidean_gcd(6, 3) = {euclidean_gcd(6     ,       3  )}"  )

					print(F"euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3     ,       5  )}"  )
					print(F"euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5     ,       3  )}"  )
					print(F"euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1     ,       3  )}"  )
					print(F"euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3     ,       6  )}"  )
					print(F"euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6     ,       3  )}"  )


if __name__ == "__main__":
		main()










from collections import Counter

import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split

__lowerCAmelCase	: List[Any]  				=datasets.load_iris()

__lowerCAmelCase	: Tuple  				=np.array(data['data'])
__lowerCAmelCase	: Dict  				=np.array(data['target'])
__lowerCAmelCase	: List[str]  				=data['target_names']

__lowerCAmelCase				,__lowerCAmelCase				,__lowerCAmelCase				,__lowerCAmelCase	: str  				=train_test_split(X, y)


def        _UpperCamelCase							(      lowercase__    ,       lowercase__      ):
						return np.linalg.norm(np.array(lowercase__      ) - np.array(lowercase__      )      )


def        _UpperCamelCase							(      lowercase__    ,       lowercase__    ,       lowercase__    ,       lowercase__    ,       lowercase__=5      ):
						__SCREAMING_SNAKE_CASE						:     Optional[int]					=		zip(lowercase__    ,       lowercase__      )
						# List of distances of all points from the point to be classified
						__SCREAMING_SNAKE_CASE						:     Dict					=		[]
						for data_point in data:
												__SCREAMING_SNAKE_CASE						:     Tuple					=		euclidean_distance(data_point[0]    ,       lowercase__      )
												distances.append((distance, data_point[1])      )
						# Choosing 'k' points with the least distances.
						__SCREAMING_SNAKE_CASE						:     int					=		[i[1] for i in sorted(lowercase__      )[:k]]
						# Most commonly occurring class among them
						# is the class into which the point is classified
						__SCREAMING_SNAKE_CASE						:     Any					=		Counter(lowercase__      ).most_common(1      )[0][0]
						return classes[result]


if __name__ == "__main__":
						print(classifier(X_train, y_train, classes, [4.4, 3.1, 1.3, 1.4]))
