def flatten_d_dict(dic, name):
    """ flatten {account1:[o1...],account2:[o2,...],...} to [o1,o2,...] with
    account names in the object attributes """
    result = []
    for keyname in dic:
        for i in dic[keyname]:
            i[name] = keyname
            result += [i]
    return result