input: 
  def classify_mnist_digits(dataset_name: str) -> LogisticRegression:
      """Generate and train a Logistic Regression model on the MNIST dataset for digit classification.
      The function should return the trained Logistic Regression model after fitting it to the dataset.
      >>> classify_mnist_digits('mnist_784')
      LogisticRegression()
      """
      from sklearn.datasets import fetch_openml
      import numpy as np
      from sklearn.linear_model import LogisticRegression
  
      # Load the dataset
      mnist = fetch_openml(dataset_name)
  
      # 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:     from sklearn.datasets import fetch_openml
      import numpy as np
      from sklearn.linear_model import LogisticRegression
  
      # Load the dataset
      mnist = fetch_openml(dataset_name)
  
      # 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