def group_by_keys(dict_list, keys):
    """
    >>> data = [
    ...     {'a': 1, 'b': 2},
    ...     {'a': 1, 'b': 3}
    ... ]
    >>> group_by_keys(data, ['a', 'b'])
    {(1, 2): [{'a': 1, 'b': 2}], (1, 3): [{'a': 1, 'b': 3}]}
    """
    groups = {}
    for d in dict_list:
        value = tuple((d[k] for k in keys))
        groups.setdefault(value, [])
        groups[value].append(d)
    return groups