def count_class(classes, class_label):
    """Increment the _count in classes for a particular class,
    given its canonical label."""
    if not class_label in classes:
        raise Exception('Unknown Class: %s' % class_label)
    if '_count' not in classes[class_label]:
        classes[class_label]['_count'] = 0
    classes[class_label]['_count'] += 1
