input: Write a python function to optimize the hyperparameters of a Support Vector Machine model using GridSearchCV.
  assert isinstance(optimize_svm(np.array([[1,2],[2,3],[3,4]]), np.array([0, 1, 0])), SVC)
  assert optimize_svm(np.array([[1,2],[2,3],[3,4]]), np.array([0, 1, 0])).kernel in ['linear', 'rbf']
output: def optimize_svm(X, y):
      from sklearn.svm import SVC
      from sklearn.model_selection import GridSearchCV
      import numpy as np
      
      # Define the parameter grid
      param_grid = {
          'C': [0.1, 1, 10, 100],
          'gamma': [1, 0.1, 0.01, 0.001],
          'kernel': ['linear', 'rbf']
      }
      
      # Initialize the Support Vector Classifier
      svc = SVC()
      
      # Initialize GridSearchCV with the SVC and parameter grid
      grid_search = GridSearchCV(svc, param_grid, refit=True, verbose=0)
      
      # Fit the GridSearchCV to the data
      grid_search.fit(X, y)
      
      # Return the best estimator (best model found)
      return grid_search.best_estimator_