def adapt_sample_keys(sample_list, key_type):
    """
        Converts sample_list to a new format where instead of "scene_id", "object_id" and "ann_id"
        there is a "sample_id".
    :param key_type:
    'kkk' for {scene_id}-{object_id}_{ann_id}
    'kk' for {scene_id}-{object_id}
    'k' for {scene_id}
    :return: new sample list.
    """
    assert key_type in ['kkk', 'kk', 'k']

    up_sl = []
    for item in sample_list:
        if key_type == 'kkk':
            key_format = '{}-{}_{}'
            item['sample_id'] = key_format.format(item['scene_id'], item['object_id'], item['ann_id'])
            up_sl.append(item)

        elif key_type == 'kk':
            key_format = '{}-{}'
            item['sample_id'] = key_format.format(item['scene_id'], item['object_id'])
            up_sl.append(item)

        elif key_type == 'k':
            key_format = '{}'
            item['sample_id'] = key_format.format(item['scene_id'])
            up_sl.append(item)

        else:
            pass

    return up_sl