input: Write a python function to perform the K-means clustering algorithm.
  assert k_means_clustering([(6, 7), (5, 4), (8, 2), (9, 3), (3, 5)], k=2) == [expected output]
  assert k_means_clustering([(1, 1), (2, 2), (1, 2), (10, 10), (11, 11), (10, 11)], k=2) == [expected output]
  assert k_means_clustering([(1, 1), (2, 1), (1, 2), (2, 2), (10, 10), (10, 11), (11, 10), (11, 11)], k=2) == [expected output]
output: def k_means_clustering(data, k):
      import random
      from collections import defaultdict
      import math
  
      def euclidean_distance(point1, point2):
          return math.sqrt(sum((x - y) ** 2 for x, y in zip(point1, point2)))
  
      # Initialize centroids randomly
      centroids = random.sample(data, k)
      clusters = defaultdict(list)
      
      while True:
          new_clusters = defaultdict(list)
          
          # Assign points to the nearest centroid
          for point in data:
              distances = [euclidean_distance(point, centroid) for centroid in centroids]
              closest_centroid_index = distances.index(min(distances))
              new_clusters[closest_centroid_index].append(point)
          
          # Calculate new centroids
          new_centroids = []
          for cluster_index in new_clusters:
              cluster_points = new_clusters[cluster_index]
              new_centroid = tuple(sum(dim) / len(cluster_points) for dim in zip(*cluster_points))
              new_centroids.append(new_centroid)
          
          # Check for convergence
          if set(new_centroids) == set(centroids):
              break
          centroids = new_centroids
          clusters = new_clusters
      
      return [list(cluster) for cluster in clusters.values()]