input: Write a function to generate a machine learning model for classifying digits in the MNIST dataset using scikit-learn. The function should return the trained model.
  
  
  from sklearn.datasets import fetch_openml
  from sklearn.linear_model import LogisticRegression
  import numpy as np
  
  def train_mnist_classifier():
      # 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
  
  # Test cases
  model = train_mnist_classifier()
  assert model is not None
  
output: def train_mnist_classifier():
      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