input: def recognize_handwritten_digits() -> Model:
      """ Generate a Machine Learning model in Python which can recognize handwritten digits from 0 to 9.
      Steps include:
      1. Importing necessary libraries
      2. Loading MNIST dataset
      3. Defining a neural network model with input, hidden, and output layers
      4. Pre-processing data (reshaping, normalization, and one-hot encoding)
      5. Compiling and fitting the model.
      >>> recognize_handwritten_digits()
      <tensorflow.python.keras.engine.functional.Functional object at 0x...>
      """
output:     import tensorflow as tf
      from tensorflow.keras.datasets import mnist
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Dense, Flatten
      from tensorflow.keras.utils import to_categorical
  
      # Load MNIST dataset
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
  
      # Pre-processing data
      x_train = x_train.reshape((x_train.shape[0], 28, 28, 1)).astype('float32') / 255
      x_test = x_test.reshape((x_test.shape[0], 28, 28, 1)).astype('float32') / 255
      y_train = to_categorical(y_train)
      y_test = to_categorical(y_test)
  
      # Define the neural network model
      model = Sequential()
      model.add(Flatten(input_shape=(28, 28, 1)))
      model.add(Dense(128, activation='relu'))
      model.add(Dense(10, activation='softmax'))
  
      # Compile and fit the model
      model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
      model.fit(x_train, y_train, epochs=5, batch_size=32, validation_data=(x_test, y_test))
  
      return model