input: Write a function to generate a machine learning model in Python using scikit-learn for classifying digits in the MNIST dataset. The function should load the MNIST dataset, preprocess it, and then train a Logistic Regression classifier on the data.
  
  def generate_mnist_model():
      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))
      print(X.shape, y.shape)
      clf = LogisticRegression()
      clf.fit(X, y)
  
  assert generate_mnist_model() is not None
output: def generate_mnist_model():
      from sklearn.datasets import fetch_openml
      from sklearn.linear_model import LogisticRegression
      from sklearn.model_selection import train_test_split
      from sklearn.preprocessing import StandardScaler
  
      mnist = fetch_openml('mnist_784')
      X = mnist.data
      y = mnist.target.astype('int')
  
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      scaler = StandardScaler()
      X_train = scaler.fit_transform(X_train)
      X_test = scaler.transform(X_test)
  
      clf = LogisticRegression(max_iter=200)
      clf.fit(X_train, y_train)