def batch_size(value):
    """Check if batch size is a non-negative integer"""

    value = int(value)
    if value < 0:
        raise ValueError('Batch size must be positive, %s given' % value)
    return value