Evaluate an integer as a priority.
553557
def _evaluate_priority_int(int)
      raise Errors::InvalidPriorityError, int unless int > 0 && int <= config.max_priority
      int
    end
1041049
public function insert($value, $priority)
    {
        if (! is_int($priority)) {
            throw new Exception\InvalidArgumentException('The priority must be an integer');
        }
        $this->values[$priority][] = $value;
        if (! isset($this->priorities[$priority])) {
            $this->priorities[$priority] = $priority;
            $this->maxPriority           = max($priority, $this->maxPriority);
        }
        ++$this->count;
    }
768038
@Override
  public void evaluate(IntegerSolution solution) {
    int approximationToN;

    approximationToN = 0;

    for (int i = 0; i < solution.getNumberOfVariables(); i++) {
      int value = solution.getVariableValue(i) ;
      approximationToN += Math.abs(valueN - value) ;
    }

    solution.setObjective(0, approximationToN);
  }
405717
def IntGreaterThanZero(n):
    """"""
    try:
        n = int(n)
    except:
        raise ValueError("%s is not an integer" % n)
    if n <= 0:
        raise ValueError("%d is not > 0" % n)
    else:
        return n
1191045
public static final Priority parsePriority(BigInteger priority)
   {
      return (priority == null ? null : Priority.getInstance(priority.intValue()));
   }
1289740
public function setPriority(int $priority): void
    {
        if ($priority < 0 || $priority > static::MAX_PRIORITY) {
            throw new \InvalidArgumentException('Priority must be an unsigned integer on the range [0-65535]');
        }

        $this->priority = $priority;
    }
883740
private function sortByPriority($a, $b)
    {
        $a = $a['_priority'];
        $b = $b['_priority'];

        if ($a == $b) {
            return 0;
        }

        return ($a < $b) ? -1 : 1;
    }
968711
public static Priority get(int value)
	{
		if (value == 1)
			return NORMAL;
		if (value == 0)
			return SYSTEM;
		if (value == 3)
			return LOW;
		if (value == 2)
			return URGENT;
		throw new KNXIllegalArgumentException("invalid priority value");
	}
116466
def red(self, value):
        """"""
        if value != self._red and \
           isinstance(value, int):
            self._red = value
118162
public static final BigInteger printPriority(Priority priority)
   {
      int result = Priority.MEDIUM;

      if (priority != null)
      {
         result = priority.getValue();
      }

      return (BigInteger.valueOf(result));
   }
224858
private IntegerConstant parseIntegerConstant(int index)
    throws IOException
  {
    int value = readInt();

    return new IntegerConstant(_class.getConstantPool(), index, value);
  }
432874
public void setPriority (byte priority)
    {
        info.priority = (byte)Math.max(
            Byte.MIN_VALUE, Math.min(Byte.MAX_VALUE, priority));
    }
499931
function formatPriority(priority) {
        var s = '';
        s += (priority >> 24);
        s += ' | ';
        s += (priority >> 8) & 0xFFFF;
        s += ' | ';
        s += priority & 0xFF;
        return s;
    }
374409
def numval(token):
    """"""
    if token.type == 'INTEGER':
        return int(token.value)
    elif token.type == 'FLOAT':
        return float(token.value)
    else:
        return token.value
1250111
private static Integer integerValueOf(String value) {
		try {
			return Integer.valueOf(value);
		} catch (NumberFormatException e) {
			throw new CannotParseException(40, value);
		}
	}
1282063
def set_integer(self, option, value):
        
        try:
            int_value = int(value)
        except ValueError as err:
            print(err.args)

        self.options[option] = value
703022
public void setPriority(int priority) throws IllegalArgumentException {
        if (priority < Thread.MIN_PRIORITY || priority > Thread.MAX_PRIORITY) {
            throw new IllegalArgumentException
                ("Priority out of range: " + priority);
        }

        synchronized (mPool) {
            mPriority = priority;
        }
    }