input: Write a function to classify emails from a dataset (in this case, the Enron Spam Dataset) as either spam or non-spam using a Support Vector Machine (SVM) model. The function should load the dataset, preprocess it, train the model, and then return the precision score of the model on the test set. If the dataset is empty, the function should return 0.
  assert classify_emails() > 0.8
  assert classify_emails() == 0.0
output: def classify_emails():
      from sklearn.model_selection import train_test_split
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.svm import SVC
      from sklearn.metrics import precision_score
      import pandas as pd
  
      try:
          df = pd.read_csv('enron_spam_data.csv')
      except FileNotFoundError:
          return 0
  
      if df.empty:
          return 0
  
      df['label'] = df['label'].map({'ham': 0, 'spam': 1})
      X_train, X_test, y_train, y_test = train_test_split(df['text'], df['label'], test_size=0.2, random_state=42)
  
      vectorizer = TfidfVectorizer()
      X_train_tfidf = vectorizer.fit_transform(X_train)
      X_test_tfidf = vectorizer.transform(X_test)
  
      svm = SVC(kernel='linear')
      svm.fit(X_train_tfidf, y_train)
  
      y_pred = svm.predict(X_test_tfidf)
      return precision_score(y_test, y_pred)