Override default *range= handler to account for relative computation.
777402
def _ctorCmprRange(self, vals):
        '''
        
        '''

        if not isinstance(vals, (list, tuple)):
            raise s_exc.BadCmprValu(valu=vals, cmpr='*range=')

        if len(vals) != 2:
            raise s_exc.BadCmprValu(valu=vals, cmpr='*range=')

        tick, tock = self.getTickTock(vals)

        if tick > tock:
            # User input has requested a nullset
            def cmpr(valu):
                return False

            return cmpr

        def cmpr(valu):
            return tick <= valu <= tock

        return cmpr
1011940
def range(self, *args):
        
        args = list(args)
        args.insert(0, self.obj)
        return self._wrap(range(*args))
318450
def _range_check(self, value, min_value, max_value):
        '''
        
        '''
        if value < min_value or value > max_value:
            raise ValueError('%s out of range - %s is not between %s and %s' % (self.__class__.__name__, value, min_value, max_value))
1310591
public static float Clamp(float x, FloatRange range) {
        return Clamp(x, range.getMin(), range.getMax());
    }
347646
function Range(min, max, step) {
  var scope = null
    , re = /^([A-Za-z]|\d+)\.{2}([A-Za-z]|\d+)$/;

  if (typeof min === 'string' && min.match(re)) {
    step = max;
    scope = min.split('..');
    min = cast(scope[0]);
    max = cast(scope[1]);
  }

  this.min(min);
  this.max(max);
  this.step(step);
}
1329729
private void handleRange(final String range) {

		final String[] parts = range.split("[\\-]+");
		switch (parts.length) {

			case 1:
				// no range
				final Integer singleNumber = toInt(parts[0]);
				if (singleNumber != null) {

					ranges.add(new Range(singleNumber, singleNumber));
				}
				break;

			case 2:
				// valid range
				final Integer first = toInt(parts[0]);
				final Integer last  = toInt(parts[1]);

				if (first != null && last != null) {

					ranges.add(new Range(first, last));

				} else {

					throw new IllegalArgumentException("Range must have two boundaries");
				}
				break;

			default:
				logger.warn("Invalid range specification, unable to parse {}, ignoring.", range);
		}
	}
419493
def validate_value_range(self, value):
        
        low, high = self.value_range
        if not low <= value <= high:
            error('Value [%s] is out of range %s', value, self.value_range)
851290
def _numeric_param_check_range(variable_name, variable_value, range_bottom, range_top):
    
    err_msg = "%s must be between %i and %i"

    if variable_value < range_bottom or variable_value > range_top:
        raise ToolkitError(err_msg % (variable_name, range_bottom, range_top))
460466
def _call(self, x, out=None):
        """"""
        if out is None:
            out = self.range.zero()
        else:
            out.set_zero()

        out[self.index] = x
        return out
353338
function range( arr, clbk ) {
	if ( !isArray( arr ) ) {
		throw new TypeError( 'range()::invalid input argument. Must provide an array. Value: `' + arr + '`.' );
	}

	if ( arguments.length > 1 && !isFunction( clbk ) ) {
		throw new TypeError( 'range()::invalid input argument. Accessor must be a function. Value: `' + clbk + '`.' );
	}
	var len = arr.length,
		min,
		max,
		x, i;

	if ( len === 0 ) {
		return null;
	}
	if ( clbk ) {
		min = clbk( arr[ 0 ] );
		max = min;
		for ( i = 1; i < len; i++ ) {
			x = clbk( arr[ i ] );
			if ( x < min ) {
				min = x;
			} else if ( x > max ) {
				max = x;
			}
		}
	} else {
		min = arr[ 0 ];
		max = min;
		for ( i = 1; i < len; i++ ) {
			x = arr[ i ];
			if ( x < min ) {
				min = x;
			} else if ( x > max ) {
				max = x;
			}
		}
	}
	return [ min, max ];
}
587922
def _check_range(self, value):
        """"""
        if self.min is None and self.max is None:
            return

        measure = self.measure(value)
        prefix = "Value (%s) for parameter %s is invalid.  %s"

        if self.min is not None and measure < self.min:
            message = prefix % (value, self.name,
                                self.lower_than_min_template % self.min)
            raise InvalidParameterValueError(message)

        if self.max is not None and measure > self.max:
            message = prefix % (value, self.name,
                                self.greater_than_max_template % self.max)
            raise InvalidParameterValueError(message)
53683
def bounds_handler(ctx, param, value):
    """"""
    retval = from_like_context(ctx, param, value)
    if retval is None and value is not None:
        try:
            value = value.strip(", []")
            retval = tuple(float(x) for x in re.split(r"[,\s]+", value))
            assert len(retval) == 4
            return retval
        except Exception:
            raise click.BadParameter(
                "{0!r} is not a valid bounding box representation".format(value)
            )
    else:  # pragma: no cover
        return retval
1172061
def set_range(self, bounds, keep_aspect=False):
        """"""
        # a * (v0 + t) = -1
        # a * (v1 + t) = +1
        # =>
        # a * (v1 - v0) = 2
        bounds = np.asarray(bounds, dtype=np.float64)
        v0 = bounds[:2]
        v1 = bounds[2:]
        pan = -.5 * (v0 + v1)
        zoom = 2. / (v1 - v0)
        if keep_aspect:
            zoom = zoom.min() * np.ones(2)
        self.set_pan_zoom(pan=pan, zoom=zoom)
667478
def _in_bounds(prop, instance, value):
    """"""
    if (
            (prop.min is not None and value < prop.min) or
            (prop.max is not None and value > prop.max)
    ):
        prop.error(instance, value, extra='Not within allowed range.')
87450
function adjustRange(w, bisect) {
  var r0 = w.i0,
      r1 = w.i1 - 1,
      c = w.compare,
      d = w.data,
      n = d.length - 1;

  if (r0 > 0 && !c(d[r0], d[r0-1])) w.i0 = bisect.left(d, d[r0]);
  if (r1 < n && !c(d[r1], d[r1+1])) w.i1 = bisect.right(d, d[r1]);
}
632676
function RangeIterator(start, end, step) {
    this.start = start;
    this.end = (end !== undefined) ? end : Math.pow(2,32);    // or should this be Number.MAX_VALUE
    this.step = (step !== undefined)
        ? step
        : (this.end >= this.start)
            ? 1
            : -1;
    this.reset();
}
1276554
def _update_range(self, data, **kwargs):
        
        self._client.update_range(data=data, **kwargs)