input: Write a python function to cluster customers based on their purchased products and prices using KMeans and assign the cluster labels to each customer.
  assert cluster_customers([
   {'customer': 'John', 'product': 'iPhone', 'price': 800},
   {'customer': 'Tim', 'product': 'Macbook', 'price': 1200},
   {'customer': 'Frank', 'product': 'Macbook', 'price': 1200},
   {'customer': 'Alice', 'product': 'Airpods', 'price': 200},
   {'customer': 'John', 'product': 'iPad', 'price': 500},
   {'customer': 'Tom', 'product': 'iPhone', 'price': 800},
   {'customer': 'Bob', 'product': 'Airpods', 'price': 200},
   {'customer': 'Alice', 'product': 'Magic Mouse', 'price': 50},
  ])['cluster'].nunique() == 3
  assert 'cluster' in cluster_customers([
   {'customer': 'John', 'product': 'iPhone', 'price': 800},
   {'customer': 'Tim', 'product': 'Macbook', 'price': 1200},
   {'customer': 'Frank', 'product': 'Macbook', 'price': 1200},
   {'customer': 'Alice', 'product': 'Airpods', 'price': 200},
   {'customer': 'John', 'product': 'iPad', 'price': 500},
   {'customer': 'Tom', 'product': 'iPhone', 'price': 800},
   {'customer': 'Bob', 'product': 'Airpods', 'price': 200},
   {'customer': 'Alice', 'product': 'Magic Mouse', 'price': 50},
  ])
output: def cluster_customers(data):
      from sklearn.cluster import KMeans
      import pandas as pd
  
      df = pd.DataFrame(data)
      
      # Create dummy variables for the product column
      df = pd.get_dummies(df, columns=['product'])
      
      # Create the model
      kmeans = KMeans(n_clusters=3, random_state=0)
      
      # Fit the model
      df['cluster'] = kmeans.fit_predict(df[['price'] + [col for col in df.columns if 'product_' in col]])
      
      return df