def get_combinations_as_dict(df, cols):
    """ Return all unique combinations of values in columns
    Args:
        df (pd.DataFrame): input df.
        cols (list): 2 or more column names
    Returns:
        d (dict): for a value v in cols[1:], d[v] = dict,
                  where d[v][value] = set containing all distinct values of v correponsing to value
    """

    grouped = df[cols].groupby(cols[0])[cols[1:]].agg(lambda x: set(x))[cols[1]]
    return grouped.to_dict()