def save_model(nameprefix, model):
    """ Save a keras sequential model into files.

    Given a keras sequential model, save the model with the given file path prefix.
    It saves the model into a JSON file, and an HDF5 file (.h5).

    :param nameprefix: Prefix of the paths of the model files
    :param model: keras sequential model to be saved
    :return: None
    :type nameprefix: str
    :type model: keras.models.Model
    """
    model_json = model.to_json()
    open(nameprefix + '.json', 'w').write(model_json)
    model.save_weights(nameprefix + '.h5')
