"""simple docstring"""






from collections import Counter

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

__lowerCAmelCase       :			Optional[int]   	=datasets.load_iris()

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

__lowerCAmelCase	,	__lowerCAmelCase	,	__lowerCAmelCase	,	__lowerCAmelCase       :			List[Any]   	=train_test_split(X, y)


def      UpperCAmelCase__			(							lowerCAmelCase__	:Union[str, Any]   ,						lowerCAmelCase__	:Tuple						)					->       List[str]:
      '''simple docstring'''


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


def      UpperCAmelCase__			(							lowerCAmelCase__	:List[str]   ,						lowerCAmelCase__	:Optional[int]   ,						lowerCAmelCase__	:Any   ,						lowerCAmelCase__	:List[str]   ,						lowerCAmelCase__	:Optional[int]=5						)					->       str:
      '''simple docstring'''


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




"""simple docstring"""






import torch

from diffusers import StableDiffusionPipeline


__lowerCAmelCase       :			str   	="""path-to-your-trained-model"""
__lowerCAmelCase       :			int   	=StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to("""cuda""")

__lowerCAmelCase       :			Optional[int]   	="""A photo of sks dog in a bucket"""
__lowerCAmelCase       :			int   	=pipe(prompt, num_inference_steps=5_0, guidance_scale=7.5).images[0]

image.save("""dog-bucket.png""")



