input: Write a Python function to build and compile a Convolutional Neural Network (CNN) model for binary classification.
  assert isinstance(build_cnn_model((150, 150, 1)), models.Sequential)
  assert build_cnn_model((150, 150, 1)).layers[0].input_shape == (None, 150, 150, 1)
  assert build_cnn_model((150, 150, 1)).layers[-1].output_shape == (None, 2)
output: def build_cnn_model(input_shape):
      from tensorflow.keras import layers, models
  
      model = models.Sequential()
      model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=input_shape))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Conv2D(64, (3, 3), activation='relu'))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Conv2D(128, (3, 3), activation='relu'))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Conv2D(128, (3, 3), activation='relu'))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Flatten())
      model.add(layers.Dense(512, activation='relu'))
      model.add(layers.Dense(2, activation='softmax'))  # Output layer for binary classification
  
      model.compile(optimizer='adam', 
                    loss='sparse_categorical_crossentropy', 
                    metrics=['accuracy'])
      
      return model