def regroup(tuples):
    """Tuples is a list of tuples.
    (0, lol), (1, truc), (0, bra) --> {0 : [lol, bra], 1 : [truc]}"""
    group = dict()
    existing = list()
    for t in tuples:
        if t[0] in existing:
            group[t[0]].append(t[1])
        else:
            existing.append(t[0])
            group[t[0]] = list([t[1]])
    return group
