def get_annotation_classes_name_to_id(annotation_classes):
    annotation_classes_dict = {}
    for annotation_class in annotation_classes:
        class_id = annotation_class['id']
        class_name = annotation_class['name']
        class_info = {'id': class_id}
        class_info['attribute_groups'] = {}
        if ('attribute_groups' in annotation_class):
            for attribute_group in annotation_class['attribute_groups']:
                attribute_group_info = {}
                for attribute in attribute_group['attributes']:
                    if (attribute['name'] in attribute_group_info):
                        logger.warning('Duplicate annotation class attribute name %s in attribute group %s. Only one of the annotation classe attributes will be used. This will result in errors in annotation upload.', attribute['name'], attribute_group['name'])
                    attribute_group_info[attribute['name']] = attribute['id']
                if (attribute_group['name'] in class_info['attribute_groups']):
                    logger.warning('Duplicate annotation class attribute group name %s. Only one of the annotation classe attribute groups will be used. This will result in errors in annotation upload.', attribute_group['name'])
                class_info['attribute_groups'][attribute_group['name']] = {'id': attribute_group['id'], 'attributes': attribute_group_info}
        if (class_name in annotation_classes_dict):
            logger.warning('Duplicate annotation class name %s. Only one of the annotation classes will be used. This will result in errors in annotation upload.', class_name)
        annotation_classes_dict[class_name] = class_info
    return annotation_classes_dict
def get_annotation_classes_name_to_id(annotation_classes):
    annotation_classes_dict = {}
    for annotation_class in annotation_classes:
        class_id = annotation_class['id']
        class_name = annotation_class['name']
        class_info = {'id': class_id}
        class_info['attribute_groups'] = {}
        if ('attribute_groups' in annotation_class):
            for attribute_group in annotation_class['attribute_groups']:
                attribute_group_info = {}
                for attribute in attribute_group['attributes']:
                    if (attribute['name'] in attribute_group_info):
                        logger.warning('Duplicate annotation class attribute name %s in attribute group %s. Only one of the annotation classe attributes will be used. This will result in errors in annotation upload.', attribute['name'], attribute_group['name'])
                    attribute_group_info[attribute['name']] = attribute['id']
                if (attribute_group['name'] in class_info['attribute_groups']):
                    logger.warning('Duplicate annotation class attribute group name %s. Only one of the annotation classe attribute groups will be used. This will result in errors in annotation upload.', attribute_group['name'])
                class_info['attribute_groups'][attribute_group['name']] = {'id': attribute_group['id'], 'attributes': attribute_group_info}
        if (class_name in annotation_classes_dict):
            logger.warning('Duplicate annotation class name %s. Only one of the annotation classes will be used. This will result in errors in annotation upload.', class_name)
        annotation_classes_dict[class_name] = class_info
    return annotation_classes_dict