def get_bucketed_sizes(orig_sizes, buckets):
    sizes = np.copy(orig_sizes)
    assert (np.min(sizes) >= 0)
    start_val = (- 1)
    for end_val in buckets:
        mask = ((sizes > start_val) & (sizes <= end_val))
        sizes[mask] = end_val
        start_val = end_val
    return sizes
def get_bucketed_sizes(orig_sizes, buckets):
    sizes = np.copy(orig_sizes)
    assert (np.min(sizes) >= 0)
    start_val = (- 1)
    for end_val in buckets:
        mask = ((sizes > start_val) & (sizes <= end_val))
        sizes[mask] = end_val
        start_val = end_val
    return sizes