<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def multi_dict(pairs):
 """ Given a set of key value pairs, create a dictionary. If a key occurs multiple times, stack the values into an array. Can be called like the regular dict(pairs) constructor Parameters pairs: (n,2) array of key, value pairs Returns result: dict, with all values stored (rather than last with regular dict) """

    result = collections.defaultdict(list)
    for k, v in pairs:
        result[k].append(v)
    return result