intent: How to group similar items in a list?
rewritten_intent: make a list of lists in which each list `g` are the elements from list `test` which have the same characters up to the first `_` character
snippet: [list(g) for _, g in itertools.groupby(test, lambda x: x.split('_')[0])]