Return the value at key 'id' or 'key'.

def _id_or_key(list_item):
    '''
    Return the value at key 'id' or 'key'.
    '''
    if isinstance(list_item, dict):
        if 'id' in list_item:
            return list_item['id']
        if 'key' in list_item:
            return list_item['key']
    return list_item