def generate_data_to_show(nearest_labels):
    unique_labels = get_unique_elements(nearest_labels['pred_labels'])
    data_to_show = {pred_label: {} for pred_label in unique_labels}
    data_to_show = OrderedDict(data_to_show)
    for (dist, label) in zip(nearest_labels['pred_dist'], nearest_labels['pred_labels']):
        data_to_show[label]['dist'] = (data_to_show[label].get('dist', 0) + dist)
        if (data_to_show[label].get('url', None) is None):
            data_to_show[label]['url'] = get_urls_by_label(label)
        if (data_to_show[label].get('description', None) is None):
            data_to_show[label]['description'] = get_item_description_by_label(label)
    return dict(data_to_show)
def generate_data_to_show(nearest_labels):
    unique_labels = get_unique_elements(nearest_labels['pred_labels'])
    data_to_show = {pred_label: {} for pred_label in unique_labels}
    data_to_show = OrderedDict(data_to_show)
    for (dist, label) in zip(nearest_labels['pred_dist'], nearest_labels['pred_labels']):
        data_to_show[label]['dist'] = (data_to_show[label].get('dist', 0) + dist)
        if (data_to_show[label].get('url', None) is None):
            data_to_show[label]['url'] = get_urls_by_label(label)
        if (data_to_show[label].get('description', None) is None):
            data_to_show[label]['description'] = get_item_description_by_label(label)
    return dict(data_to_show)