input: def classify_emails(dataset_path: str, test_size: float, random_state: int) -> float:
      """
      Create an AI model in Python to classify emails from a given dataset as either spam or non-spam.
      The function loads the dataset, preprocesses the text data, trains a Support Vector Machine (SVM) classifier,
      and returns the precision score of the model on the test data.
      
      >>> classify_emails("spam.csv", 0.20, 42)
      0.946
      """
output:     import pandas as pd
      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
  
      # Load the dataset
      df = pd.read_csv(dataset_path, encoding='latin-1')
      df = df[['v1', 'v2']]
      df.columns = ['label', 'text']
  
      # Preprocess the text data
      df['text'] = df['text'].str.lower()
  
      # Split the dataset into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(df['text'], df['label'], test_size=test_size, random_state=random_state)
  
      # Vectorize the text data
      vectorizer = TfidfVectorizer()
      X_train_vec = vectorizer.fit_transform(X_train)
      X_test_vec = vectorizer.transform(X_test)
  
      # Train the SVM classifier
      svm_classifier = SVC(kernel='linear')
      svm_classifier.fit(X_train_vec, y_train)
  
      # Predict on the test set
      y_pred = svm_classifier.predict(X_test_vec)
  
      # Calculate and return the precision score
      return precision_score(y_test, y_pred, pos_label='spam')