input: Write a function to generate a machine learning model using scikit-learn for classifying digits in the MNIST dataset. If the dataset is loaded and the model is successfully trained, return True, otherwise return False.
  
  def classify_mnist_digits():
      try:
          # 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))
  
          # Create a Logistic Regression classifier 
          clf = LogisticRegression()
  
          # Fit the model to the data 
          clf.fit(X, y)
          return True
      except Exception as e:
          print(f"An error occurred: {e}")
          return False
  
  assert classify_mnist_digits()==True
output: 
  def classify_mnist_digits():
      try:
          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 True
      except Exception as e:
          print(f"An error occurred: {e}")
          return False
  