input: Write a function to construct a neural network model using Keras to classify the MNIST dataset. The function should define the input, hidden, and output layers, compile the model with the Adam optimizer and sparse categorical crossentropy loss, and return the compiled model.
  
  def create_mnist_model():
      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
  
  assert isinstance(create_mnist_model(), keras.Model) == True
  assert create_mnist_model().optimizer.__class__.__name__ == "Adam"
  assert create_mnist_model().loss == 'sparse_categorical_crossentropy'
  assert 'accuracy' in create_mnist_model().metrics
  assert create_mnist_model().input_shape == (None, 784)
  assert create_mnist_model().output_shape == (None, 10)
output: def create_mnist_model():
      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