def generate_kv_list(features):
    """Render cvlm key-value pairs to text from a dictionary."""
    pieces = []
    for k, v in sorted(features.items()):
        if v == 1:
            pieces.append(str(k))
        else:
            pieces.append('%s=%s' % (k, v))
    return ' '.join(pieces)
