input: Write a function to implement a k-means clustering algorithm in Python, which takes two arguments: k (the number of clusters) and data (a set of data points). The function should return two values: clusters (an array indicating the cluster assignment for each data point) and centroids (an array of the final centroid positions). 
  
  assert np.allclose(kmeans(2, np.array([[1,1], [2,2], [4,4], [5,5]]))[1], np.array([[1.5,1.5], [4.5,4.5]]))==True
  assert np.allclose(kmeans(2, np.array([[10,10], [100, 100], [50, 50], [70, 70]]))[1], np.array([[30, 30], [95, 95]]))==True
  assert np.allclose(kmeans(3, np.array([[1,1], [2,2], [3,3], [4,4], [5,5], [6,6]]))[1], np.array([[2,2], [4,4], [6,6]]))==True
output: 
  def kmeans(k, data):
      import numpy as np
      from sklearn.cluster import KMeans
      
      kmeans = KMeans(n_clusters=k, random_state=0).fit(data)
      clusters = kmeans.labels_
      centroids = kmeans.cluster_centers_
      
      return clusters, centroids
  