input: Write a python function to train a logistic regression model using a TF-IDF vectorizer pipeline.
  assert train_model(['I love programming', 'Python is amazing'], [1, 0]) is not None
  assert isinstance(train_model(['I love programming', 'Python is amazing'], [1, 0]), Pipeline)
  assert train_model(['I love programming', 'Python is amazing'], [1, 0]).named_steps['tfidf'] is not None
output: def train_model(documents, labels):
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.linear_model import LogisticRegression
      from sklearn.pipeline import Pipeline
  
      pipeline = Pipeline([
          ('tfidf', TfidfVectorizer()),
          ('logreg', LogisticRegression())
      ])
  
      pipeline.fit(documents, labels)
      return pipeline