input: Write a function to classify emails from the Enron Spam Dataset as either spam or non-spam using a Support Vector Machine (SVM) model in Python. The function should return the precision score of the model. If no dataset is provided, it should return None.
  assert classify_spam(pd.DataFrame({'EmailText': ["Get rich quick!", "Urgent: You've won a prize"], 'Label': ['spam', 'non-spam']})) == 1.0
  assert classify_spam(["Dear valued customer", "You won $1000!"], ['non-spam', 'spam']) is None
  assert classify_spam([]) is None
output: def classify_spam(data=None):
      if data is None or len(data) == 0:
          return None
      
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.svm import SVC
      from sklearn.metrics import precision_score
      from sklearn.model_selection import train_test_split
      
      if isinstance(data, list):
          return None
      
      emails = data['EmailText']
      labels = data['Label']
      
      vectorizer = TfidfVectorizer()
      X = vectorizer.fit_transform(emails)
      y = labels
      
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      svm = SVC(kernel='linear')
      svm.fit(X_train, y_train)
      
      y_pred = svm.predict(X_test)
      precision = precision_score(y_test, y_pred, pos_label='spam')
      
      return precision