'''simple docstring'''




import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
   import ctypes
   import msvcrt  # noqa






   class 		__A       (ctypes.Structure   ):
          # _fields is a specific attr expected by ctypes
          snake_case       :Optional[int]				    =					[("size", ctypes.c_int), ("visible", ctypes.c_byte)]

def _lowercase	(      )					->       str:





       """simple docstring"""


       if os.name == "nt":
              __UpperCAmelCase  :				List[str]       				=		CursorInfo()
              __UpperCAmelCase  :				int       				=		ctypes.windll.kernelaa.GetStdHandle(-11						)
              ctypes.windll.kernelaa.GetConsoleCursorInfo(lowerCamelCase__							,    ctypes.byref(lowerCamelCase__						)						)
              __UpperCAmelCase  :				Union[str, Any]       				=		False
              ctypes.windll.kernelaa.SetConsoleCursorInfo(lowerCamelCase__							,    ctypes.byref(lowerCamelCase__						)						)
       elif os.name == "posix":
              sys.stdout.write("\033[?25l"						)
              sys.stdout.flush()

def _lowercase	(      )					->       Any:





       """simple docstring"""


       if os.name == "nt":
              __UpperCAmelCase  :				Optional[Any]       				=		CursorInfo()
              __UpperCAmelCase  :				int       				=		ctypes.windll.kernelaa.GetStdHandle(-11						)
              ctypes.windll.kernelaa.GetConsoleCursorInfo(lowerCamelCase__							,    ctypes.byref(lowerCamelCase__						)						)
              __UpperCAmelCase  :				Dict       				=		True
              ctypes.windll.kernelaa.SetConsoleCursorInfo(lowerCamelCase__							,    ctypes.byref(lowerCamelCase__						)						)
       elif os.name == "posix":
              sys.stdout.write("\033[?25h"						)
              sys.stdout.flush()


@contextmanager
def _lowercase	(      )					->       int:





       """simple docstring"""


       try:
              hide_cursor()
              yield
       finally:
              show_cursor()







'''simple docstring'''




from collections import Counter

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

_a   :	str 							=   datasets.load_iris()

_a   :	List[Any] 							=   np.array(data["data"])
_a   :	Optional[Any] 							=   np.array(data["target"])
_a   :	Dict 							=   data["target_names"]

_a							,					_a							,					_a							,					_a   :	Any 							=   train_test_split(X, y)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       Tuple:





       """simple docstring"""


       return np.linalg.norm(np.array(lowerCamelCase__						) - np.array(lowerCamelCase__						)						)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__=5						)					->       int:





       """simple docstring"""


       __UpperCAmelCase  :				List[Any]       				=		zip(lowerCamelCase__							,    lowerCamelCase__						)
       # List of distances of all points from the point to be classified
       __UpperCAmelCase  :				int       				=		[]
       for data_point in data:
              __UpperCAmelCase  :				Optional[Any]       				=		euclidean_distance(data_point[0]							,    lowerCamelCase__						)
              distances.append((distance, data_point[1])						)
       # Choosing 'k' points with the least distances.
       __UpperCAmelCase  :				Union[str, Any]       				=		[i[1] for i in sorted(lowerCamelCase__						)[:k]]
       # Most commonly occurring class among them
       # is the class into which the point is classified
       __UpperCAmelCase  :				Dict       				=		Counter(lowerCamelCase__						).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]))






