input: def generate_mnist_model():
      """Generate a neural network model with TensorFlow and Python for classifying hand-written digits from the MNIST dataset.
  
      >>> generate_mnist_model()
      Optimization Finished!
      Accuracy: 0.95
      """
output:     import tensorflow as tf
      from tensorflow.keras import layers, models
  
      # Load and preprocess the MNIST dataset
      mnist = tf.keras.datasets.mnist
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      x_train, x_test = x_train / 255.0, x_test / 255.0
  
      # Build the model
      model = models.Sequential([
          layers.Flatten(input_shape=(28, 28)),
          layers.Dense(128, activation='relu'),
          layers.Dropout(0.2),
          layers.Dense(10, activation='softmax')
      ])
  
      # Compile the model
      model.compile(optimizer='adam',
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
  
      # Train the model
      model.fit(x_train, y_train, epochs=5)
  
      # Evaluate the model
      test_loss, test_acc = model.evaluate(x_test, y_test, verbose=2)
      print("\nOptimization Finished!")
      print(f"Accuracy: {test_acc:.2f}")
  
      return model