def outsidein(d):
    """Transform a dictionary of lists to a list of dictionaries."""
    ds = []
    keys = d.keys()
    for key in keys:
        d[key] = list(d[key])
    for i in  range(len(d.values()[0])):
        ds.append(dict([(k, d[k][i]) for k in keys]))
    return ds