input: Write a python function to train and test a Naive Bayes classifier on email data using the NLTK library.
  assert classify_email('Yes, I would like a new laptop.') == 'request'
  assert classify_email('No, I don\'t need one.') == 'response'
output: def classify_email(email):
      import nltk
      from nltk.corpus import names
      from nltk.classify import NaiveBayesClassifier
      from nltk.classify.util import accuracy
      
      def gender_features(word):
          return {'last_letter': word[-1]}
      
      labeled_names = ([(name, 'request') for name in ['Yes', 'I', 'would', 'like', 'a', 'new', 'laptop', '.']] +
                       [(name, 'response') for name in ['No', 'I', 'don\'t', 'need', 'one', '.']])
      
      featuresets = [(gender_features(n), gender) for (n, gender) in labeled_names]
      train_set, test_set = featuresets, featuresets
      
      classifier = NaiveBayesClassifier.train(train_set)
      
      def classify(email):
          features = gender_features(email.split()[-1])
          return classifier.classify(features)
      
      return classify(email)