Value that can be any number
193698
public static PactDslJsonRootValue numberType() {
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    value.generators.addGenerator(Category.BODY, "", new RandomIntGenerator(0, Integer.MAX_VALUE));
    value.setValue(100);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
1056966
function filter_number(value) {
    var m = NUMBER_RE.exec(value);
    if(m == null) throw OptError('Expected a number representative');
    if(m[1]) {
        // The number is in HEX format. Convert into a number, then return it
        return parseInt(m[1], 16);
    } else {
        // The number is in regular- or decimal form. Just run in through
        // the float caster.
        return parseFloat(m[2] || m[3]);
    }
}
132525
def isNumber(self, value):
        
        try:
            str(value)
            float(value)
            return True

        except ValueError:
            return False
892619
def validate(self, value: int):
        '''  '''
        if not isinstance(value, int):
            raise ValueError('value is not an integer')

        if self.minimum > value or self.maximum < value:
            msg = (
                '{} is outside the valide range [{},{}]'
            ).format(value, self.minimum, self.maximum)
            raise ValueError(msg)
685305
def _limit_value(value, upper=1.0, lower=0.0):
    
    if value > upper:
        return(upper)
    if value < lower:
        return(lower)
    return value
1250111
private static Integer integerValueOf(String value) {
		try {
			return Integer.valueOf(value);
		} catch (NumberFormatException e) {
			throw new CannotParseException(40, value);
		}
	}
954714
public static int
value(String s, boolean numberok) {
	int val = types.getValue(s);
	if (val == -1 && numberok) {
		val = types.getValue("TYPE" + s);
	}
	return val;
}
605996
function limit(value) {
    var val = parseInt(value, 10);
    if (isNaN(val)) {
      debug('A valid integer must be provided to limit');
    } else {
      this._single.limit = val;
    }
    return this;
  }
67072
def to_int(value: Any) -> int:
        

        if isinstance(value, (bool, int)):
            return int(value)
        return int(str(value))
479547
def APEValue(value, kind):
    

    try:
        type_ = _get_value_type(kind)
    except ValueError:
        raise ValueError("kind must be TEXT, BINARY, or EXTERNAL")
    else:
        return type_(value)
757788
private static Object toExternalNumber( Object value)
    {
    Class<?> valueType =
      value == null
      ? null
      : value.getClass();

    return
      !(valueType != null && Number.class.isAssignableFrom( valueType))?
      null :

      valueType.equals( BigDecimal.class)?
      toExternalNumber( (BigDecimal) value) :

      valueType.equals( Long.class)?
      toExternalNumber( new BigDecimal( (Long) value)) :

      value;      
    }
1029230
def value?(value)
      value = Erlang.from(value)
      each { |k,v| return true if value == v }
      return false
    end
956967
def num(string):
    """"""
    if not isinstance(string, type('')):
        raise ValueError(type(''))
    try:
        string = re.sub('[^a-zA-Z0-9\.\-]', '', string)
        number = re.findall(r"[-+]?\d*\.\d+|[-+]?\d+", string)
        return float(number[0])
    except Exception as e:
        logger = logging.getLogger('tradingAPI.utils.num')
        logger.debug("number not found in %s" % string)
        logger.debug(e)
        return None
509280
def as_int(value, default = 0)
      res = default

      if value
        if value.is_a?(Fixnum)
          res = value
        elsif value.respond_to?(:to_i)
          res = value.to_i
        end
      end

      res
    end
303542
def publish(self, value):
        
        value = super(Integer, self).publish(value)
        if isinstance(value, float):
            value = int(value)
        if not isinstance(value, (int, long)):
            raise ValueError("Not an integer: %r" % (value, ))
        return value
430011
def _format_num(self, value):
        """"""
        # (value is True or value is False) is ~5x faster than isinstance(value, bool)
        if value is True or value is False:
            raise TypeError('value must be a Number, not a boolean.')
        return self.num_type(value)
878196
function(value)
	{
		if (value == 'thin')
		{
			value = '2';
		}
		else if (value == 'medium')
		{
			value = '4';
		}
		else if (value == 'thick')
		{
			value = '6';
		}
		
		value = parseFloat(value);
		
		if (isNaN(value))
		{
			value = 0;
		}
		
		return value;
	}