input: Write a python function to perform a grid search for SVM hyperparameters using scikit-learn.
  assert perform_grid_search(X_train, y_train, X_test) == {'best_params': {'C': 10, 'kernel': 'rbf'}, 'y_pred': [1, 0, 1, 1]}
  assert perform_grid_search(X_train2, y_train2, X_test2) == {'best_params': {'C': 1, 'kernel': 'linear'}, 'y_pred': [0, 0, 1, 1]}
  assert perform_grid_search(X_train3, y_train3, X_test3) == {'best_params': {'C': 10, 'kernel': 'linear'}, 'y_pred': [1, 0, 1, 0]}
output: from sklearn.model_selection import GridSearchCV
  from sklearn.svm import SVC
  from sklearn.metrics import accuracy_score
  
  def perform_grid_search(X_train, y_train, X_test):
      # Define the parameter grid
      param_grid = {
          'C': [0.1, 1, 10],
          'kernel': ['linear', 'rbf']
      }
      
      # Initialize the SVM classifier
      svc = SVC()
      
      # Initialize GridSearchCV
      grid_search = GridSearchCV(estimator=svc, param_grid=param_grid, cv=5, scoring='accuracy')
      
      # Fit GridSearchCV
      grid_search.fit(X_train, y_train)
      
      # Get the best parameters
      best_params = grid_search.best_params_
      
      # Predict on the test set
      y_pred = grid_search.predict(X_test)
      
      return {'best_params': best_params, 'y_pred': y_pred.tolist()}