def group_by_key(dict_list, key):
    """
    >>> data = [
    ...     {'a': 1, 'b': 2},
    ...     {'a': 1, 'b': 3}
    ... ]
    >>> group_by_key(data, 'a')
    {1: [{'a': 1, 'b': 2}, {'a': 1, 'b': 3}]}
    """
    grouped = {}
    for d in dict_list:
        group_key = d.get(key)
        grouped.setdefault(group_key, [])
        grouped[group_key].append(d)
    return grouped