input: Write a function to train a machine learning model using scikit-learn to classify digits in the MNIST dataset. The function should return the trained classifier.
  assert type(train_mnist_model())==LogisticRegression
  assert train_mnist_model().score(X, y) > 0.9
  def train_mnist_model():
      # Import the necessary libraries 
      from sklearn.datasets import fetch_openml
      import numpy as np
      from sklearn.linear_model import LogisticRegression
  
      #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))
      print(X.shape, y.shape)
  
      # Create a Logistic Regression classifier 
      clf = LogisticRegression()
  
      # Fit the model to the data 
      clf.fit(X, y)
      return clf
output: def train_mnist_model():
      from sklearn.datasets import fetch_openml
      from sklearn.linear_model import LogisticRegression
  
      mnist = fetch_openml('mnist_784')
      X = mnist.data
      y = mnist.target
      clf = LogisticRegression()
      clf.fit(X, y)
      return clf