input: Write a python function to preprocess the MNIST dataset, including reshaping, normalizing, and converting labels to one-hot vectors.
  assert preprocess_mnist()[0].shape == (60000, 784)
  assert preprocess_mnist()[1].shape == (60000, 10)
  assert preprocess_mnist()[2].shape == (10000, 784)
  assert preprocess_mnist()[3].shape == (10000, 10)
output: def preprocess_mnist():
      from tensorflow.keras.datasets import mnist
      from tensorflow.keras.utils import to_categorical
  
      # Load the dataset
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
  
      # Reshape the data to (num_samples, 784)
      x_train = x_train.reshape(-1, 784)
      x_test = x_test.reshape(-1, 784)
  
      # Normalize the data to range [0, 1]
      x_train = x_train.astype('float32') / 255
      x_test = x_test.astype('float32') / 255
  
      # Convert labels to one-hot vectors
      y_train = to_categorical(y_train, 10)
      y_test = to_categorical(y_test, 10)
  
      return x_train, y_train, x_test, y_test