input: 
  from sklearn.datasets import fetch_openml
  import numpy as np
  from sklearn.linear_model import LogisticRegression
  
  def load_and_classify_mnist():
      """Load the MNIST dataset and train a Logistic Regression model for classifying the digits.
      Returns the trained Logistic Regression model.
      >>> model = load_and_classify_mnist()
      >>> model.predict([mnist.data[0]])
      array(['5'], dtype=object)
      """
      # 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
  
output:     # 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