input: Write a function to generate a machine learning model in Python using scikit-learn for classifying digits in the MNIST dataset. If the model is trained successfully, return the classifier object. If there is an error during the process, return None.
  assert generate_mnist_classifier() is not None
  assert generate_mnist_classifier() is not None
  assert generate_mnist_classifier() is not None
  assert generate_mnist_classifier() is not None
  assert generate_mnist_classifier() is not None
output: def generate_mnist_classifier():
      try:
          from sklearn.datasets import fetch_openml
          from sklearn.model_selection import train_test_split
          from sklearn.ensemble import RandomForestClassifier
          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)
  
          clf = RandomForestClassifier(n_estimators=100, random_state=42)
          clf.fit(X_train, y_train)
  
          y_pred = clf.predict(X_test)
          accuracy = accuracy_score(y_test, y_pred)
  
          if accuracy > 0.9:
              return clf
          else:
              return None
      except Exception as e:
          return None