<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(fn, coll):
 """Group elements in sub-collections by fn :param fn: a function :param coll: a collection :returns: a dictionary {4: ['John', 'Eric'], 5: ['Terry'], 6: ['Graham'], 7: ['Mickael']} """

    d = collections.defaultdict(list)
    for item in coll:
        key = fn(item)
        d[key].append(item)
    return dict(d)