input: Write a function to generate a machine learning model in Python using scikit-learn for classifying digits in the MNIST dataset. Ensure the function returns the trained classifier.
  from sklearn.datasets import fetch_openml
  import numpy as np
  from sklearn.linear_model import LogisticRegression
  
  def generate_mnist_model():
      # Load the dataset
      mnist = fetch_openml('mnist_784')
      
      # Split into features and labels
      X = mnist.data
      y = mnist.target
      
      # Reshape data to be valid
      X = X.reshape((X.shape[0], -1))
      
      # Create a Logistic Regression classifier
      clf = LogisticRegression()
      
      # Fit the model to the data
      clf.fit(X, y)
      
      return clf
  
  assert isinstance(generate_mnist_model(), LogisticRegression)
  assert generate_mnist_model().score(mnist.data.reshape((mnist.data.shape[0], -1)), mnist.target) > 0.9
output: def generate_mnist_model():
      mnist = fetch_openml('mnist_784')
      X = mnist.data
      y = mnist.target
      X = X.reshape((X.shape[0], -1))
      clf = LogisticRegression()
      clf.fit(X, y)
      return clf