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 import the necessary libraries, load the MNIST dataset, split it into features and labels, reshape the data, create a Logistic Regression classifier, and fit the model to the data. The function should return the fitted classifier.
  assert generate_mnist_classifier().predict([X[0]])==[y[0]]
  assert generate_mnist_classifier().predict([X[1]])==[y[1]]
  assert generate_mnist_classifier().predict([X[2]])==[y[2]]
  assert generate_mnist_classifier().predict([X[3]])==[y[3]]
  assert generate_mnist_classifier().predict([X[4]])==[y[4]]
output: def generate_mnist_classifier():
      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
      import numpy as np
      
      mnist = fetch_openml('mnist_784', version=1)
      X, y = mnist["data"], mnist["target"]
      X = X / 255.0
      X = X.values.reshape(-1, 28*28)
      
      scaler = StandardScaler()
      X = scaler.fit_transform(X)
      
      model = LogisticRegression(max_iter=1000)
      model.fit(X, y)
      
      return model