input: Write a python function to train a logistic regression model on email data and evaluate its accuracy. 
  assert train_and_evaluate_model(data)['accuracy'] >= 0.8
output: def train_and_evaluate_model(data):
      from sklearn.model_selection import train_test_split
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.linear_model import LogisticRegression
      from sklearn.metrics import accuracy_score
      
      # Split the data into features and labels
      X, y = data['email'], data['label']
      
      # Split the dataset into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      # Convert text data into numerical data
      vectorizer = CountVectorizer()
      X_train_vect = vectorizer.fit_transform(X_train)
      X_test_vect = vectorizer.transform(X_test)
      
      # Train the logistic regression model
      model = LogisticRegression()
      model.fit(X_train_vect, y_train)
      
      # Predict the labels for the test set
      y_pred = model.predict(X_test_vect)
      
      # Calculate the accuracy of the model
      accuracy = accuracy_score(y_test, y_pred)
      
      return {'accuracy': accuracy}