input: Write a function to create and train a machine learning model using scikit-learn for classifying digits in the MNIST dataset. The function should return the trained classifier.
  
  
  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))
      print(X.shape, y.shape)
      
      # Create a Logistic Regression classifier
      clf = LogisticRegression()
      
      # Fit the model to the data
      clf.fit(X, y)
      
      return clf
  
  assert train_mnist_classifier().predict(np.array([mnist.data[0]])) == mnist.target[0]
  assert train_mnist_classifier().predict(np.array([mnist.data[1]])) == mnist.target[1]
  assert train_mnist_classifier().predict(np.array([mnist.data[2]])) == mnist.target[2]
  assert train_mnist_classifier().predict(np.array([mnist.data[3]])) == mnist.target[3]
  assert train_mnist_classifier().predict(np.array([mnist.data[4]])) == mnist.target[4]
  
output: 
  def train_mnist_classifier():
      mnist = fetch_openml('mnist_784')
      X = mnist.data
      y = mnist.target
      clf = LogisticRegression()
      clf.fit(X, y)
      return clf
  