def bin(iterable, key=lambda x: x, value=lambda x: x):
    # bin([["a", 1], ["a", 2], ["b", 3]], key=lambda x: x[0]) => 
    # {"a": [["a", 1], ["a", 2]], 
    #  "b": [["b", 3]]
    # }
    m = defaultdict(list)
    for x in iterable:
        m[key(x)].append(value(x))
    return m
Returns a dictionary with items in the given list grouped by the given key.
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/bin