input: Write a python function to train a Naive Bayes classifier and make predictions on the sentiment of a given review.
  assert train_and_predict_sentiment([('The food was amazing!', 'positive'), ('I was not happy with the customer service.', 'negative'), ('The quality of the food was fantastic!', 'positive')], 'The food was not good.') == 'negative'
  assert train_and_predict_sentiment([('Great service and friendly staff.', 'positive'), ('The restaurant was dirty and the food was cold.', 'negative')], 'The food was cold but the staff was friendly.') == 'negative'
  assert train_and_predict_sentiment([('Absolutely loved the ambiance.', 'positive'), ('Worst dining experience ever.', 'negative')], 'The ambiance was great but the service was slow.') == 'positive'
output: def train_and_predict_sentiment(training_data, review):
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.naive_bayes import MultinomialNB
      
      # Separate the training data into texts and labels
      texts, labels = zip(*training_data)
      
      # Convert texts to a matrix of token counts
      vectorizer = CountVectorizer()
      X_train = vectorizer.fit_transform(texts)
      
      # Train a Naive Bayes classifier
      classifier = MultinomialNB()
      classifier.fit(X_train, labels)
      
      # Transform the review into the same vector space
      X_review = vectorizer.transform([review])
      
      # Make a prediction on the review
      prediction = classifier.predict(X_review)
      
      return prediction[0]