input: Write a python function to preprocess IMDb dataset for sentiment analysis using TensorFlow.
  assert preprocess_imdb_data('imdb.npz', 10000, 500) == (expected_train_x, expected_train_y)
output: def preprocess_imdb_data(imdb_path, num_words, maxlen):
      import tensorflow as tf
      from tensorflow.keras.datasets import imdb
      from tensorflow.keras.preprocessing.sequence import pad_sequences
      
      # Load data
      (train_x, train_y), (test_x, test_y) = imdb.load_data(path=imdb_path, num_words=num_words)
      
      # Pad sequences
      train_x = pad_sequences(train_x, maxlen=maxlen)
      test_x = pad_sequences(test_x, maxlen=maxlen)
      
      return (train_x, train_y), (test_x, test_y)