input: def classify_mnist(dataset):
      """ Generate a machine learning model in Python using scikit-learn for classifying digits in the MNIST dataset.
      >>> classify_mnist('mnist_784')
      """
      # 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(dataset)
      
      # 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)
output:     # Predict the labels for the training data
      y_pred = clf.predict(X)
      
      # Print the accuracy of the model
      accuracy = np.mean(y_pred == y)
      print(f"Model accuracy: {accuracy * 100:.2f}%")
      
      return clf