def next_batch(targ_capacity, curr_capacity, num_up_to_date, batch_size, min_in_service):
 assert (num_up_to_date <= curr_capacity)
 efft_min_sz = min(min_in_service, targ_capacity, curr_capacity)
 efft_bat_sz = min(batch_size, max((targ_capacity - num_up_to_date), 0))
 new_capacity = (efft_bat_sz + max(min(curr_capacity, (targ_capacity - efft_bat_sz)), efft_min_sz))
 return (new_capacity, efft_bat_sz)

def next_batch ( targ_capacity , curr_capacity , num_up_to_date , batch_size , min_in_service ) : assert ( num_up_to_date <= curr_capacity ) efft_min_sz = min ( min_in_service , targ_capacity , curr_capacity ) efft_bat_sz = min ( batch_size , max ( ( targ_capacity - num_up_to_date ) , 0 ) ) new_capacity = ( efft_bat_sz + max ( min ( curr_capacity , ( targ_capacity - efft_bat_sz ) ) , efft_min_sz ) ) return ( new_capacity , efft_bat_sz )
return details of the next batch in a batched update .