input: Write a function to construct a neural network model in Python using Keras to classify the MNIST data set correctly. The function should compile the model with the Adam optimizer and sparse categorical crossentropy loss.
  
  def build_mnist_classifier():
      from keras.layers import Input, Dense
      from keras.models import Model
      
      input_layer = Input(shape=(784,))
      hidden_layer = Dense(128, activation='relu')(input_layer)
      output_layer = Dense(10, activation='softmax')(hidden_layer)
      model = Model(inputs=input_layer, outputs=output_layer)
      model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
      return model
  
  
  
  # Test cases
  mnist_model = build_mnist_classifier()
  assert isinstance(mnist_model, keras.models.Model)
  assert mnist_model.optimizer.get_config()['name'] == 'Adam'
  assert mnist_model.loss == 'sparse_categorical_crossentropy'
  
output: def build_mnist_classifier():
      from keras.layers import Input, Dense
      from keras.models import Model
      
      input_layer = Input(shape=(784,))
      hidden_layer = Dense(128, activation='relu')(input_layer)
      output_layer = Dense(10, activation='softmax')(hidden_layer)
      model = Model(inputs=input_layer, outputs=output_layer)
      model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
      return model