def get_batch_size(batch, num_minions):
    '''
    Return the batch size that you should have
        batch: string
        num_minions: int

    '''
    # figure out how many we can keep in flight
    partition = lambda x: float(x) / 100.0 * num_minions
    try:
        if '%' in batch:
            res = partition(float(batch.strip('%')))
            if res < 1:
                return int(math.ceil(res))
            else:
                return int(res)
        else:
            return int(batch)
    except ValueError:
        print(('Invalid batch data sent: {0}\nData must be in the form'
               'of %10, 10% or 3').format(batch))
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_tornado/saltnado.py/get_batch_size/original