input: Write a function to construct a neural network model in Python using Keras to classify the MNIST data set correctly. The function should return the compiled model.
  
  def mnist_classifier():
      import keras
  
      # Input layer
      input_layer = keras.layers.Input(shape=(784,))
  
      # Hidden layer
      hidden_layer = keras.layers.Dense(128, 
                      activation='relu')(input_layer)
  
      # Output layer
      output_layer = keras.layers.Dense(10, 
                      activation='softmax')(hidden_layer)
  
      # Model
      model = keras.Model(inputs=input_layer, outputs=output_layer)
  
      # Compile model
      model.compile(optimizer='adam', 
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
  
      return model
  
  # Test cases
  model = mnist_classifier()
  assert isinstance(model, keras.models.Model)
  assert model.layers[0].input_shape == [(None, 784)]
  assert model.layers[1].output_shape == (None, 128)
  assert model.layers[2].output_shape == (None, 10)
  assert model.loss == 'sparse_categorical_crossentropy'
  assert model.optimizer.__class__.__name__ == 'Adam'
output: def mnist_classifier():
      import keras
  
      input_layer = keras.layers.Input(shape=(784,))
      hidden_layer = keras.layers.Dense(128, activation='relu')(input_layer)
      output_layer = keras.layers.Dense(10, activation='softmax')(hidden_layer)
      model = keras.Model(inputs=input_layer, outputs=output_layer)
      model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
      return model