input: def recognize_handwritten_digits(data: tuple) -> tuple:
      """ Recognize handwritten digits from 0 to 9 using a machine learning model.
      The input data should be a tuple containing (X_train, y_train) and (X_test, y_test).
      The function will preprocess the data, define and compile a neural network model, 
      train the model, and return the accuracy of predictions on the test set.
      
      >>> data = mnist.load_data()
      >>> recognize_handwritten_digits(data)
      (0.9756, 0.9789)
      """
      from tensorflow.keras.datasets import mnist
      (X_train, y_train), (X_test, y_test) = data
      
      # Reshape inputs from (n, 28, 28) to (n, 784)
      X_train = X_train.reshape(-1, 784)
      X_test = X_test.reshape(-1, 784)
      
      # Normalize pixel values
      X_train = X_train.astype('float32') / 255
      X_test = X_test.astype('float32') / 255
      
      # One-hot encode labels
      y_train = to_categorical(y_train, num_classes=10)
      y_test = to_categorical(y_test, num_classes=10)
      
      # Define the neural network model
      inputs = Input(shape=(784,))
      h1 = Dense(64, activation='relu')(inputs)
      h2 = Dropout(0.5)(h1)
      outputs = Dense(10, activation='softmax')(h2)
      
      model = Model(inputs=inputs, outputs=outputs)
      model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
      
      # Fit the model
      model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=5, batch_size=128, verbose=0)
      
      # Evaluate the model
      loss, accuracy = model.evaluate(X_test, y_test, verbose=0)
      
      return accuracy
output:     from tensorflow.keras.utils import to_categorical
      from tensorflow.keras.models import Model
      from tensorflow.keras.layers import Input, Dense, Dropout