input: 
  def load_and_train_mnist(dataset_name: str) -> LogisticRegression:
      """Load the MNIST dataset and train a Logistic Regression model using scikit-learn.
      >>> model = load_and_train_mnist('mnist_784')
      >>> print(model.score(X, y))
      0.9252
      """
      from sklearn.datasets import fetch_openml
      from sklearn.linear_model import LogisticRegression
  
      mnist = fetch_openml(dataset_name)
      X = mnist.data.reshape((mnist.data.shape[0], -1))
      y = mnist.target
  
      clf = LogisticRegression()
      clf.fit(X, y)
      return clf
  
output:     from sklearn.datasets import fetch_openml
      from sklearn.linear_model import LogisticRegression
  
      mnist = fetch_openml(dataset_name)
      X = mnist.data.reshape((mnist.data.shape[0], -1))
      y = mnist.target
  
      clf = LogisticRegression()
      clf.fit(X, y)
      return clf