input: Write a python function to train a Naive Bayes classifier on text data and make predictions on new samples.
  assert train_and_predict(['spam', 'ham'], ['I am a spam email', 'This is a ham message'], 'I am a spam email') == 'spam'
  assert train_and_predict(['spam', 'ham'], ['Spammy spammy spam', 'Not spam at all'], 'Spammy spammy spam') == 'spam'
  assert train_and_predict(['ham', 'ham'], ['Just a regular email', 'Another regular email'], 'Just a regular email') == 'ham'
output: def train_and_predict(labels, texts, new_text):
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.naive_bayes import MultinomialNB
  
      # Convert texts to a matrix of token counts
      vectorizer = CountVectorizer()
      X = vectorizer.fit_transform(texts)
  
      # Train the Naive Bayes classifier
      clf = MultinomialNB()
      clf.fit(X, labels)
  
      # Transform the new text to the same token count matrix
      new_X = vectorizer.transform([new_text])
  
      # Make the prediction
      prediction = clf.predict(new_X)
  
      return prediction[0]