def train_model_and_get_test_results(model, x_train, y_train, x_test, y_test, **kwargs):
    """
    Train the model on given training data and evaluate its performance on test set

    Args:
        model: various ML models
        x_train: Training data
        y_train: Training targets
        x_test: Testing data
        y_test: Testing targets
        kwargs: dictionary that maps each keyword to the value that we pass alongside it

    Returns:
        Accuracy and predictions made by the specified model
    """
    # Instantiate the classification model
    if "sample_weight" in kwargs:
        model.fit(x_train, y_train.ravel(),
                  sample_weight=kwargs["sample_weight"])
    else:
        model.fit(x_train, y_train)

    predicted = model.predict(x_test)

    # compute the accuracy of the model
    accuracy = model.score(x_test, y_test.ravel())

    return accuracy, predicted