def validateClips(cmodel, layers, gmused):
    """
    Ensures coefficients provided in model description are valid and outputs
    a dictionary of the coefficients.

    Args:
        cmodel (dict): Sub-dictionary from config for specific model,
            for example:

            .. code-block:: python

                cmodel = config['test_model']

    Returns:
        dict: a dictionary of clip values for each layer (if exists)
    """
    clips = {}
    if 'clip' in cmodel:
        for key, value in cmodel['clip'].items():
            if key not in layers:
                if key not in gmused:
                    x1 = [par for par in gmused if key in par]
                    if len(x1) == 0:
                        raise Exception(
                            'Clipping key %s does not match any names of layers'
                            % key)
            clips[key] = (float(value[0]), float(value[1]))
    return clips