input: from typing import List
  
  def classify_emails(training_data: List[List[float]], training_labels: List[int], test_data: List[List[float]]) -> List[int]:
      """ Construct a naive bayes classifier using python to classify emails as spam or not spam.
      The function takes a list of training data (each element representing a feature vector) and
      corresponding training labels (0 for not spam, 1 for spam). It also takes a list of test data
      (each element representing a feature vector) and returns a list of predictions (0 for not spam,
      1 for spam).
      >>> classify_emails([[0.1, 0.2], [0.2, 0.3], [0.3, 0.4]], [0, 1, 0], [[0.15, 0.25]])
      [0]
      >>> classify_emails([[0.1, 0.2, 0.3], [0.2, 0.3, 0.4]], [1, 0], [[0.15, 0.25, 0.35]])
      [1]
      """
output:     
      num_features = len(training_data[0])
      num_spam = sum(training_labels)
      num_not_spam = len(training_labels) - num_spam
      
      p_spam = num_spam / len(training_labels)
      p_not_spam = num_not_spam / len(training_labels)
      
      spam_features = [0] * num_features
      not_spam_features = [0] * num_features
      
      for i in range(len(training_data)):
          if training_labels[i] == 1:
              for j in range(num_features):
                  spam_features[j] += training_data[i][j]
          else:
              for j in range(num_features):
                  not_spam_features[j] += training_data[i][j]
      
      spam_features = [x / num_spam for x in spam_features]
      not_spam_features = [x / num_not_spam for x in not_spam_features]
      
      predictions = []
      
      for test_vector in test_data:
          p_spam_given_features = p_spam
          p_not_spam_given_features = p_not_spam
          
          for i in range(num_features):
              if spam_features[i] > 0:
                  p_spam_given_features *= (test_vector[i] / spam_features[i])
              if not_spam_features[i] > 0:
                  p_not_spam_given_features *= (test_vector[i] / not_spam_features[i])
          
          if p_spam_given_features > p_not_spam_given_features:
              predictions.append(1)
          else:
              predictions.append(0)
      
      return predictions
  