input: Write a function to generate a machine learning model in Python using scikit-learn for classifying digits in the MNIST dataset. The function should load the MNIST dataset, split it into features and labels, reshape the data, create a Logistic Regression classifier, and fit the model to the data. The function should return the trained model.
  assert generate_digit_classifier() is not None
  assert isinstance(generate_digit_classifier(), LogisticRegression)
  assert generate_digit_classifier().coef_.shape == (10, 784)
  assert generate_digit_classifier().intercept_.shape == (10,)
  assert generate_digit_classifier().predict(mnist.data[:1]) == ['5']
output: def generate_digit_classifier():
      from sklearn.datasets import fetch_openml
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LogisticRegression
      mnist = fetch_openml('mnist_784', version=1)
      X, y = mnist.data, mnist.target
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      model = LogisticRegression(max_iter=2000)
      model.fit(X_train, y_train)
      return model