<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def groupby(itr, key_fn=None):
 """ An wrapper function around itertools.groupby to sort each results. :param itr: Iterable object, a list/tuple/genrator, etc. :param key_fn: Key function to sort 'itr'. [(-1, (('b', -1),)), (1, (('a', 1), ('c', 1)))] """

    return itertools.groupby(sorted(itr, key=key_fn), key=key_fn)