itertools learn, groupby todo