def get_partitions(num_items, buckets, prefix):
    """
    Given a number of items and a number of buckets, return all possible combination of divider locations.

    Result is a list of lists, where each sub-list is set of divider locations. Each divider is placed after
    the 1-based index provided (or, alternately, *before* the zero-based index provided).
    """
    partitions = []
    num_dividers = len(prefix)
    if num_dividers:
        last_divider_loc = prefix[-1]
    else:
        last_divider_loc = 0
    remaining_dividers = (buckets - 1) - num_dividers
    for next_divider_loc in range(last_divider_loc + 1, num_items - (remaining_dividers - 1)):
        new_prefix = prefix.copy() + [next_divider_loc]
        if remaining_dividers == 1:
            partitions.append(new_prefix)
        else:
            partitions.extend(get_partitions(num_items, buckets, new_prefix))
    return partitions