input: Write a function to construct a neural network model in Python using Keras that correctly classifies the MNIST data set. The function should return the compiled model.
  
  def mnist_classifier():
      import keras
      from keras.layers import Input, Dense
  
      # Input layer
      input_layer = Input(shape=(784,))
  
      # Hidden layer
      hidden_layer = Dense(128, activation='relu')(input_layer)
  
      # Output layer
      output_layer = 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
  
  assert isinstance(mnist_classifier(), keras.Model)
  assert mnist_classifier().loss == 'sparse_categorical_crossentropy'
  assert mnist_classifier().optimizer.get_config()['name'] == 'Adam'
  assert mnist_classifier().layers[1].units == 128
  assert mnist_classifier().layers[2].units == 10
output: def mnist_classifier():
      import keras
      from keras.layers import Input, Dense
  
      input_layer = Input(shape=(784,))
      hidden_layer = Dense(128, activation='relu')(input_layer)
      output_layer = 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