def unpack_distrib(d):
    """
    Return the original data from a given distribution, e.g.: ::

        >>> unpack_distrib([0, 3, 2, 0, 1])
        [1, 1, 1, 2, 2, 4]
    """
    data = []
    for i, n in enumerate(d):
        if n:
            data += [i] * n

    return data