input: Write a function to construct a neural network model in Python using the Keras library that correctly classifies the MNIST data set. The output should be a compiled Keras model ready to be trained.
  
  assert construct_mnist_model().__class__.__name__=="Model"
  assert construct_mnist_model().get_config()["layers"][1]["config"]["units"]==128
  assert construct_mnist_model().get_config()["layers"][2]["config"]["units"]==10
  assert construct_mnist_model().optimizer.__class__.__name__=="Adam"
  assert construct_mnist_model().loss=="sparse_categorical_crossentropy"
output: def construct_mnist_model():
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Dense, Flatten
      from tensorflow.keras.optimizers import Adam
      
      model = Sequential([
          Flatten(input_shape=(28, 28)),
          Dense(128, activation='relu'),
          Dense(10, activation='softmax')
      ])
      
      model.compile(optimizer=Adam(), loss='sparse_categorical_crossentropy')
      return model