input: Write a function to build and train a machine learning model using scikit-learn for classifying digits in the MNIST dataset. The function should return the trained model.
  def train_mnist_classifier():
      from sklearn.datasets import fetch_openml
      import numpy as np
      from sklearn.linear_model import LogisticRegression
  
      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
  
  assert isinstance(train_mnist_classifier(), LogisticRegression)
output: def train_mnist_classifier():
      from sklearn.datasets import fetch_openml
      import numpy as np
      from sklearn.linear_model import LogisticRegression
  
      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