input: Write a function to complete a task using Python which involves generating a machine learning model for classifying the digits in the MNIST dataset. The response should include importing necessary libraries, loading the dataset, splitting it into features and labels, reshaping the data if necessary, creating a Logistic Regression classifier, and fitting the model to the data.
  assert generate_mnist_model()==None
  assert generate_mnist_model()==None
output: def generate_mnist_model():
      from sklearn.datasets import fetch_openml
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LogisticRegression
      from sklearn.preprocessing import StandardScaler
      from sklearn.metrics import accuracy_score
  
      mnist = fetch_openml('mnist_784', version=1)
      X, y = mnist["data"], mnist["target"]
      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)
  
      model = LogisticRegression(max_iter=1000)
      model.fit(X_train, y_train)
  
      y_pred = model.predict(X_test)
      accuracy = accuracy_score(y_test, y_pred)
      return None