input: Write a python function to create, compile, and train a Convolutional Neural Network (CNN) model using Keras.
  assert create_compile_train_cnn(X_train, y_train, X_test, y_test)['loss'] < 0.5
  assert create_compile_train_cnn(X_train, y_train, X_test, y_test)['accuracy'] > 0.85
output: def create_compile_train_cnn(X_train, y_train, X_test, y_test):
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
      from tensorflow.keras.utils import to_categorical
  
      # Convert labels to categorical one-hot encoding
      y_train = to_categorical(y_train)
      y_test = to_categorical(y_test)
  
      # Define the model
      model = Sequential([
          Conv2D(32, (3, 3), activation='relu', input_shape=X_train.shape[1:]),
          MaxPooling2D((2, 2)),
          Conv2D(64, (3, 3), activation='relu'),
          MaxPooling2D((2, 2)),
          Flatten(),
          Dense(128, activation='relu'),
          Dense(y_train.shape[1], activation='softmax')
      ])
  
      # Compile the model
      model.compile(optimizer='adam',
                    loss='categorical_crossentropy',
                    metrics=['accuracy'])
  
      # Train the model
      history = model.fit(X_train, y_train, epochs=10, validation_data=(X_test, y_test))
  
      # Evaluate the model
      results = model.evaluate(X_test, y_test)
      return {'loss': results[0], 'accuracy': results[1]}