Gets a parameter whose value is a (possibly empty) list of positive integers.
764636
public List<Integer> getPositiveIntegerList(final String param) {
    return getList(param, new StringToInteger(),
        new IsPositive<Integer>(), "positive integer");
  }
1217950
def get_int(self, key, optional=False):
        
        return self._get_typed_value(key, int, lambda x: int(x), optional)
359866
def convert(self, value, param, ctx):
        
        value = super(PositiveInt, self).convert(value, param, ctx)
        if value < 0:
            self.fail('%s is not positive' % value, param, ctx)
        if not self.allow_zero and not value:
            self.fail('%s is not greater than 0' % value, param, ctx)
        return value
836349
int getNumberOfNullEnderParameter(List<String> parameters) {
		int nbnull = 0;
		for (int i = parameters.size() - 1; i >= 0; i--) {
			String parameter = parameters.get(i);
			if (parameter.equals("null")) {
				nbnull++;
			} else {
				break;
			}
		}
		return nbnull;
	}
453477
def positive(value, argument='argument'):
    
    value = _get_integer(value)
    if value < 1:
        error = ('Invalid {arg}: {value}. {arg} must be a positive '
                 'integer'.format(arg=argument, value=value))
        raise ValueError(error)
    return value
1151785
public List<Integer> getIntegers(String name, String delimiter) {
        List<String> strings = getStrings(name, delimiter);

        List<Integer> ints = new ArrayList<>(strings.size());
        for (String value : strings) {
            try {
                int i = Integer.parseInt(value);
                ints.add(i);
            } catch (NumberFormatException e) {
            }
        }

        return Collections.unmodifiableList(ints);
    }
420217
def parseValue(self, value):
        """"""
        if self.isVector():
            return list(map(self._pythonType, value.split(',')))
        if self.typ == 'boolean':
            return _parseBool(value)
        return self._pythonType(value)
936103
def clean(self, value):
        """"""

        if isinstance(value, numpy.ndarray):
            return value
        elif isinstance(value, (list, tuple)):
            return numpy.array(value)

        raise ParameterNotValidError
870403
def pos_int(i):
    
    try:
        if isinstance(i, string_types):
            i = int(i)
        if not isinstance(i, int) or i < 0:
            raise Exception()
    except:
        raise ValueError("Not a positive integer")
    return i
1333241
def check_positive_integer(name, value):
    
    try:
        value = int(value)
        is_positive = (value > 0)
    except ValueError:
        raise ValueError('%s should be an integer; got %r' % (name, value))

    if is_positive:
        return value
    else:
        raise ValueError('%s should be positive; got %r' % (name, value))
1203495
public List<Double> getPositiveDoubleList(final String param) {
    return getList(param, new StringToDouble(),
        new IsPositive<Double>(), "positive double");
  }
361721
def _get_value(self, value, default):
        """"""
        vtype = type(default)

        if vtype is bool:
            return value.get_bool()
        elif vtype is str:
            return value.get_string()
        elif vtype is int:
            return value.get_int()
        elif vtype in (list, tuple):
            l = []
            for i in value.get_list():
                l.append(i.get_string())
            return l

        return None
1131957
public static int indexOf(List<Node> list , int value ) {

		for (int i = 0; i < list.size(); i++) {
			if( list.get(i).which == value )
				return i;
		}

		return -1;
	}
1158721
def positive_int(val):
    """"""
    if isinstance(val, float):
        raise ValueError('"{}" must not be a float'.format(val))
    val = int(val)
    if val >= 0:
        return val
    raise ValueError('"{}" must be positive'.format(val))
146862
private final Integer getInteger(NamedList<Object> response, String... args) {
    Object objectItem = response.findRecursive(args);
    if (objectItem != null && objectItem instanceof Integer) {
      return (Integer) objectItem;
    } else {
      return null;
    }
  }
11235
public static <T> List<T> positiveFilter(List<T> input, Predicate<T> filter) {
        argumentsAreNotNull(input, filter);
        return input.stream().filter(filter).collect(Collectors.toList());
    }
151122
def get_primes(n):
    
    if n <= 0:
        raise ValueError("'n' must be a positive integer.")
    # If x is even, exclude x from list (-1):
    sieve_size = (n // 2 - 1) if n % 2 == 0 else (n // 2)
    sieve = [True for _ in range(sieve_size)]   # Sieve
    primes = []      # List of Primes
    if n >= 2:
        primes.append(2)      # 2 is prime by default
    for i in range(sieve_size):
        if sieve[i]:
            value_at_i = i*2 + 3
            primes.append(value_at_i)
            for j in range(i, sieve_size, value_at_i):
                sieve[j] = False
    return primes