input: Write a function that creates a machine learning model in Python using Keras to distinguish between images of cats and dogs. The function should return the compiled model. The input will be a dataset path where the images are stored.
  assert distinguish_cats_dogs('/path/to/dataset')
  model.compile(loss = 'binary_crossentropy', optimizer = 'adam', metrics = ['accuracy'])
  assert model.loss == 'binary_crossentropy'
  assert model.optimizer.__class__.__name__ == 'Adam'
  assert 'accuracy' in model.metrics
output: def distinguish_cats_dogs(dataset_path):
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
      from tensorflow.keras.preprocessing.image import ImageDataGenerator
  
      model = Sequential([
          Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3)),
          MaxPooling2D(2, 2),
          Conv2D(64, (3, 3), activation='relu'),
          MaxPooling2D(2, 2),
          Conv2D(128, (3, 3), activation='relu'),
          MaxPooling2D(2, 2),
          Flatten(),
          Dense(512, activation='relu'),
          Dense(1, activation='sigmoid')
      ])
  
      model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
      return model