def rating_label(rating, cfg):
    """Convert a credibility rating into a label

    :param rating: a credibility rating. We assume it has
      `reviewAspect == credibility` and float `confidence` and
      `ratingValue`s
    :param cfg: configuration options
    :returns: a short string to summarise the credibility rating
    :rtype: str
    """
    if 'reviewAspect' in rating:
        assert rating['reviewAspect'] == 'credibility', '%s' % (rating)
    conf_threshold = float(cfg.get('cred_conf_threshold', 0.7))
    if 'confidence' in rating and rating['confidence'] < conf_threshold:
        return 'not verifiable'
    assert 'ratingValue' in rating, '%s' % (rating)
    val = rating['ratingValue']
    assert val <= 1.0 and val >= -1.0, '%s' % (rating)
    if val >= 0.5:
        return 'credible'
    if val >= 0.25:
        return 'mostly credible'
    if val >= -0.25:
        return 'uncertain'
    if val >= -0.5:
        return 'mostly not credible'
    return 'not credible'