def ensure_valid_kernel_type(specified_kernel, kernel_type_list):
    """
    Checks to make sure that `specified_kernel` is in `kernel_type_list` and
    raises a helpful error if this is not the case.

    Parameters
    ----------
    specified_kernel : str.
        Denotes the user-specified kernel class that is to be checked.
    kernel_type_list : list of strings.
        Contains all of the valid kernel classes types.

    Returns
    -------
    None.
    """
    if specified_kernel not in kernel_type_list:
        msg_1 = "The kernel_type specified was not valid."
        msg_2 = "Valid kernel-types are {}".format(kernel_type_list)
        msg_3 = "The passed kernel_type was: {}".format(specified_kernel)
        total_msg = "\n".join([msg_1, msg_2, msg_3])
        raise ValueError(total_msg)
    return None