Get all parent item IDs for each item in dict keys.

def get_id2upper(objs):
    """Get all parent item IDs for each item in dict keys."""
    id2upper = {}
    for obj in objs:
        _get_id2upper(id2upper, obj.item_id, obj)
    return id2upper