import os
import string
import sys


__lowercase											=      1 << 8

__lowercase											=      {
    'tab': ord('''\t'''),
    'newline': ord('''\r'''),
    'esc': 27,
    'up': 65 + ARROW_KEY_FLAG,
    'down': 66 + ARROW_KEY_FLAG,
    'right': 67 + ARROW_KEY_FLAG,
    'left': 68 + ARROW_KEY_FLAG,
    'mod_int': 91,
    'undefined': sys.maxsize,
    'interrupt': 3,
    'insert': 50,
    'delete': 51,
    'pg_up': 53,
    'pg_down': 54,
}

__lowercase											=      KEYMAP['up']
__lowercase											=      KEYMAP['left']

if sys.platform == "win32":
  __lowercase											=      []
  __lowercase											=      {
      b'\xe0H': KEYMAP['up'] - ARROW_KEY_FLAG,
      b'\x00H': KEYMAP['up'] - ARROW_KEY_FLAG,
      b'\xe0P': KEYMAP['down'] - ARROW_KEY_FLAG,
      b'\x00P': KEYMAP['down'] - ARROW_KEY_FLAG,
      b'\xe0M': KEYMAP['right'] - ARROW_KEY_FLAG,
      b'\x00M': KEYMAP['right'] - ARROW_KEY_FLAG,
      b'\xe0K': KEYMAP['left'] - ARROW_KEY_FLAG,
      b'\x00K': KEYMAP['left'] - ARROW_KEY_FLAG,
  }

for i in range(10):
  __lowercase											=      ord(str(i))



def lowerCamelCase						(     ):
    '''simple docstring'''







    if os.name == "nt":
        import msvcrt

        __UpperCamelCase  :Optional[Any]    						=	"""mbcs"""
        # Flush the keyboard buffer
        while msvcrt.kbhit():
            msvcrt.getch()
        if len(UpperCamelCase__			) == 0:
            # Read the keystroke
            __UpperCamelCase  :Optional[int]    						=	msvcrt.getch()

            # If it is a prefix char, get second part
            if ch in (b"\x00", b"\xe0"):
                __UpperCamelCase  :str    						=	ch + msvcrt.getch()
                # Translate actual Win chars to bullet char types
                try:
                    __UpperCamelCase  :Dict    						=	chr(WIN_KEYMAP[cha]			)
                    WIN_CH_BUFFER.append(chr(KEYMAP['''mod_int''']			)			)
                    WIN_CH_BUFFER.append(UpperCamelCase__			)
                    if ord(UpperCamelCase__			) in (
                        KEYMAP["insert"] - 1 << 9,
                        KEYMAP["delete"] - 1 << 9,
                        KEYMAP["pg_up"] - 1 << 9,
                        KEYMAP["pg_down"] - 1 << 9,
                    ):
                        WIN_CH_BUFFER.append(chr(126			)			)
                    __UpperCamelCase  :List[Any]    						=	chr(KEYMAP['''esc''']			)
                except KeyError:
                    __UpperCamelCase  :Dict    						=	cha[1]
            else:
                __UpperCamelCase  :Any    						=	ch.decode(UpperCamelCase__			)
        else:
            __UpperCamelCase  :str    						=	WIN_CH_BUFFER.pop(0			)
    elif os.name == "posix":
        import termios
        import tty

        __UpperCamelCase  :Dict    						=	sys.stdin.fileno()
        __UpperCamelCase  :Optional[int]    						=	termios.tcgetattr(UpperCamelCase__			)
        try:
            tty.setraw(UpperCamelCase__			)
            __UpperCamelCase  :int    						=	sys.stdin.read(1			)
        finally:
            termios.tcsetattr(UpperCamelCase__						,    termios.TCSADRAIN						,    UpperCamelCase__			)
    return ch



def lowerCamelCase						(     ):
    '''simple docstring'''







    __UpperCamelCase  :Tuple    						=	get_raw_chars()
    if ord(UpperCamelCase__			) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
        return char

    elif ord(UpperCamelCase__			) == KEYMAP["esc"]:
        __UpperCamelCase  :str    						=	get_raw_chars()
        if ord(UpperCamelCase__			) == KEYMAP["mod_int"]:
            __UpperCamelCase  :Dict    						=	get_raw_chars()
            if ord(UpperCamelCase__			) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(UpperCamelCase__			) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
                return chr(ord(UpperCamelCase__			) + ARROW_KEY_FLAG			)
            else:
                return KEYMAP["undefined"]
        else:
            return get_raw_chars()

    else:
        if char in string.printable:
            return char
        else:
            return KEYMAP["undefined"]






from collections import Counter

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

__lowercase											=      datasets.load_iris()

__lowercase											=      np.array(data['''data'''])
__lowercase											=      np.array(data['''target'''])
__lowercase											=      data['''target_names''']

__lowercase				, __lowercase				, __lowercase				, __lowercase											=      train_test_split(X, y)



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE=5			):
    '''simple docstring'''







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





