def kernel_scaling(scale_data, kernel_list, rescale):
    """Base hyperparameter scaling function.

    Parameters
    ----------
    scale_data : object
        Output from the default scaling function.
    kernel_list : list
        Dictionary containing all dictionaries for the kernels.
    rescale : boolean
       Flag for whether to scale or rescale the data.
    """
    store_mean = scale_data.feature_data['mean']
    store_std = scale_data.feature_data['std']
    for k in kernel_list:
        mean, std = store_mean, store_std
        if 'dimension' in k and k['dimension'] == 'single':
            print('single hyperparameter being used, cant scale')
            continue
        if 'features' in k:
            mean = mean[k['features']]
            std = std[k['features']]
        ktype = k['type']
        kernel = eval('_{}_kernel_scale(k, mean, std, rescale)'.format(ktype))
        k = kernel
    return kernel_list
