def fill_class_and_attribute_ids(annotation_json, annotation_classes_dict):
    for ann in annotation_json:
        if ((('userId' in ann) and ('type' in ann) and (ann['type'] == 'meta')) or ('className' not in ann)):
            continue
        annotation_class_name = ann['className']
        if (not (annotation_class_name in annotation_classes_dict)):
            logger.warning("Couldn't find annotation class %s", annotation_class_name)
            continue
        class_id = annotation_classes_dict[annotation_class_name]['id']
        ann['classId'] = class_id
        for attribute in ann['attributes']:
            if (attribute['groupName'] in annotation_classes_dict[annotation_class_name]['attribute_groups']):
                attribute['groupId'] = annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['id']
            else:
                logger.warning("Couldn't find annotation group %s", attribute['groupName'])
                continue
            if (attribute['name'] in annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['attributes']):
                attribute['id'] = annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['attributes'][attribute['name']]
            else:
                logger.warning("Couldn't find annotation name %s in annotation group %s", attribute['name'], attribute['groupName'])
                del attribute['groupId']
def fill_class_and_attribute_ids(annotation_json, annotation_classes_dict):
    for ann in annotation_json:
        if ((('userId' in ann) and ('type' in ann) and (ann['type'] == 'meta')) or ('className' not in ann)):
            continue
        annotation_class_name = ann['className']
        if (not (annotation_class_name in annotation_classes_dict)):
            logger.warning("Couldn't find annotation class %s", annotation_class_name)
            continue
        class_id = annotation_classes_dict[annotation_class_name]['id']
        ann['classId'] = class_id
        for attribute in ann['attributes']:
            if (attribute['groupName'] in annotation_classes_dict[annotation_class_name]['attribute_groups']):
                attribute['groupId'] = annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['id']
            else:
                logger.warning("Couldn't find annotation group %s", attribute['groupName'])
                continue
            if (attribute['name'] in annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['attributes']):
                attribute['id'] = annotation_classes_dict[annotation_class_name]['attribute_groups'][attribute['groupName']]['attributes'][attribute['name']]
            else:
                logger.warning("Couldn't find annotation name %s in annotation group %s", attribute['name'], attribute['groupName'])
                del attribute['groupId']