input: Write a python function to classify emails as spam or not using a Naive Bayes classifier.
  assert classify_email("Hi, I am offering a great deal on your favorite products.")=="SPAM"
  assert classify_email("Meeting at 3 PM tomorrow.")=="NOT SPAM"
  assert classify_email("Congratulations! You've won a free ticket.")=="SPAM"
output: def classify_email(email):
      import re
      from collections import Counter
      
      # Sample spam and not spam words
      spam_words = ["offer", "deal", "free", "winner", "congratulations", "won"]
      not_spam_words = ["meeting", "schedule", "project", "tomorrow", "report"]
      
      def tokenize(text):
          return re.findall(r'\b\w+\b', text.lower())
      
      def word_probabilities(word_list, total_words):
          word_counts = Counter(word_list)
          return {word: (count / total_words) for word, count in word_counts.items()}
      
      def naive_bayes_classifier(email, spam_probs, not_spam_probs, spam_prior, not_spam_prior):
          email_tokens = tokenize(email)
          spam_likelihood = spam_prior
          not_spam_likelihood = not_spam_prior
          
          for token in email_tokens:
              spam_likelihood *= spam_probs.get(token, 1e-5)
              not_spam_likelihood *= not_spam_probs.get(token, 1e-5)
          
          return "SPAM" if spam_likelihood > not_spam_likelihood else "NOT SPAM"
      
      # Create probability distributions
      total_spam_words = len(spam_words)
      total_not_spam_words = len(not_spam_words)
      
      spam_probs = word_probabilities(spam_words, total_spam_words)
      not_spam_probs = word_probabilities(not_spam_words, total_not_spam_words)
      
      # Priors (for simplicity, assume equal priors)
      spam_prior = 0.5
      not_spam_prior = 0.5
      
      return naive_bayes_classifier(email, spam_probs, not_spam_probs, spam_prior, not_spam_prior)