def main():
    for let, gen in itertools.groupby(big_gen(), key=operator.itemgetter(0)):
        secgen = map(operator.itemgetter(1), gen)
Can a Python function take a generator and return generators to subsets of its generated output?