def METHOD_NAME(models, x_train, y_train, x_test, y_test):
  for model in models:
    model.compile(
        loss=tf.keras.losses.categorical_crossentropy,
        optimizer='adam',
        metrics=['accuracy'])
    # Print the model summary.
    model.summary()
    # Model needs to be clustered after initial training
    # and having achieved good accuracy
    model.fit(
        x_train,
        y_train,
        batch_size=batch_size,
        epochs=epochs,
        verbose=1,
        validation_data=(x_test, y_test))
    score = model.evaluate(x_test, y_test, verbose=0)
    print('Test loss:', score[0])
    print('Test accuracy:', score[1])
    print('Clustering model')
    clustering_params = {
      'number_of_clusters': 8,
      'cluster_centroids_init': cluster_config.CentroidInitialization.DENSITY_BASED
    }
    # Cluster model
    clustered_model = cluster.cluster_weights(model, **clustering_params)
    # Use smaller learning rate for fine-tuning
    # clustered model
    opt = tf.keras.optimizers.Adam(learning_rate=1e-5)
    clustered_model.compile(
    loss=tf.keras.losses.categorical_crossentropy,
    optimizer=opt,
    metrics=['accuracy'])
    # Fine-tune model
    clustered_model.fit(
        x_train,
        y_train,
        batch_size=batch_size,
        epochs=epochs_fine_tuning,
        verbose=1,
        validation_data=(x_test, y_test))
    score = clustered_model.evaluate(x_test, y_test, verbose=0)
    print('Clustered Model Test loss:', score[0])
    print('Clustered Model Test accuracy:', score[1])
    #Ensure accuracy persists after stripping the model
    stripped_model = cluster.strip_clustering(clustered_model)
    stripped_model.compile(
    loss=tf.keras.losses.categorical_crossentropy,
    optimizer='adam',
    metrics=['accuracy'])
    stripped_model.save('stripped_model.h5')
    # To acquire the stripped model,
    # deserialize with clustering scope
    with cluster.cluster_scope():
      loaded_model = keras.models.load_model('stripped_model.h5')
    # Checking that the stripped model's accuracy matches the clustered model
    score = loaded_model.evaluate(x_test, y_test, verbose=0)
    print('Stripped Model Test loss:', score[0])
    print('Stripped Model Test accuracy:', score[1])