def _map_bins_to_labels(bins):
    """
    Maps integers 0-99 to a label according to the distribution specified in `bins`.

    Example:


    bins = [10, 20] # implies bin sizes of  10 - 20 - 70
      maps to => [0]*10 + [1]*20 + [2]*70

    Note that if the integers in `bins` don't add up to 100, this function will fill in the remaining difference with a
    new label

    :param bins: A list of integers from 0-100. Each value specifies how many times the label for the bin is repeated
    :return:
    """
    labels = [len(bins)] * 100
    label = 0
    i = 0
    for bin in bins:
        for _ in range(0, bin):
            labels[i] = label
            i += 1
        label += 1

    return labels