





from collections import Counter

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

_lowercase		:  List[str]			       =datasets.load_iris()

_lowercase		:  Any			       =np.array(data["""data"""])
_lowercase		:  List[Any]			       =np.array(data["""target"""])
_lowercase		:  List[Any]			       =data["""target_names"""]

_lowercase       , _lowercase       , _lowercase       , _lowercase		:  List[str]			       =train_test_split(X, y)


def 		_SCREAMING_SNAKE_CASE     ( lowerCAmelCase__							,lowerCAmelCase__						):
		return np.linalg.norm(np.array(lowerCAmelCase__						) - np.array(lowerCAmelCase__						)						)


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







import os
import sys

_lowercase		:  List[str]			       =os.path.join(os.path.dirname(__file__), """src""")
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


_lowercase		:  Optional[int]			       =[
    """torch""",
    """numpy""",
    """tokenizers""",
    """filelock""",
    """requests""",
    """tqdm""",
    """regex""",
    """sentencepiece""",
    """sacremoses""",
    """importlib_metadata""",
    """huggingface_hub""",
]


@add_start_docstrings(AutoConfig.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoConfig.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)


@add_start_docstrings(AutoTokenizer.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoTokenizer.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)


@add_start_docstrings(AutoModel.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoModel.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)


@add_start_docstrings(AutoModelForCausalLM.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoModelForCausalLM.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)


@add_start_docstrings(AutoModelForMaskedLM.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoModelForMaskedLM.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)


@add_start_docstrings(AutoModelForSequenceClassification.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoModelForSequenceClassification.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)





@add_start_docstrings(AutoModelForQuestionAnswering.__doc__						)
def 		_SCREAMING_SNAKE_CASE     ( *lowerCAmelCase__							,**lowerCAmelCase__						):
		return AutoModelForQuestionAnswering.from_pretrained(*lowerCAmelCase__							,**lowerCAmelCase__						)
