<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bucket(things, key):
 """Return a map of key -> list of things."""

    ret = defaultdict(list)
    for thing in things:
        ret[key(thing)].append(thing)
    return ret